({
borderRadius = "1.75rem",
children,
as: Component = "button",
containerClassName,
borderClassName,
duration,
className,
...otherProps
}: {
borderRadius?: string
children: React.ReactNode
as?: any
containerClassName?: string
borderClassName?: string
duration?: number
className?: string
[key: string]: any
})
| 4 | import { cn } from "~/utils/css" |
| 5 | |
| 6 | export function Button({ |
| 7 | borderRadius = "1.75rem", |
| 8 | children, |
| 9 | as: Component = "button", |
| 10 | containerClassName, |
| 11 | borderClassName, |
| 12 | duration, |
| 13 | className, |
| 14 | ...otherProps |
| 15 | }: { |
| 16 | borderRadius?: string |
| 17 | children: React.ReactNode |
| 18 | as?: any |
| 19 | containerClassName?: string |
| 20 | borderClassName?: string |
| 21 | duration?: number |
| 22 | className?: string |
| 23 | [key: string]: any |
| 24 | }) { |
| 25 | return ( |
| 26 | <Component |
| 27 | className={cn("relative h-16 w-40 overflow-hidden bg-transparent p-[1px] text-xl ", containerClassName)} |
| 28 | style={{ |
| 29 | borderRadius: borderRadius, |
| 30 | }} |
| 31 | {...otherProps} |
| 32 | > |
| 33 | <div className="absolute inset-0" style={{ borderRadius: `calc(${borderRadius} * 0.96)` }}> |
| 34 | <MovingBorder duration={duration} rx="30%" ry="30%"> |
| 35 | <div |
| 36 | className={cn( |
| 37 | "h-20 w-20 bg-[radial-gradient(var(--sky-500)_40%,transparent_60%)] opacity-[0.8]", |
| 38 | borderClassName |
| 39 | )} |
| 40 | /> |
| 41 | </MovingBorder> |
| 42 | </div> |
| 43 | |
| 44 | <div |
| 45 | className={cn( |
| 46 | "relative flex h-full w-full items-center justify-center border border-slate-800 bg-slate-900/[0.8] text-sm text-white antialiased backdrop-blur-xl", |
| 47 | className |
| 48 | )} |
| 49 | style={{ |
| 50 | borderRadius: `calc(${borderRadius} * 0.96)`, |
| 51 | }} |
| 52 | > |
| 53 | {children} |
| 54 | </div> |
| 55 | </Component> |
| 56 | ) |
| 57 | } |
| 58 | |
| 59 | const MovingBorder = ({ |
| 60 | children, |
nothing calls this directly
no test coverage detected
searching dependent graphs…