Skip to content

Commit f193f88

Browse files
committed
revert: ui/button glow variant
1 parent 6ae6a7e commit f193f88

File tree

1 file changed

+18
-46
lines changed

1 file changed

+18
-46
lines changed

src/components/ui/buttons/Button.tsx

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import * as React from "react"
44
import { cva, type VariantProps } from "class-variance-authority"
5-
import { Sparkles } from "lucide-react"
65
import { Slot } from "@radix-ui/react-slot"
76

87
import { cn } from "@/lib/utils/cn"
@@ -11,26 +10,6 @@ import { scrollIntoView } from "@/lib/utils/scrollIntoView"
1110

1211
import { BaseLink, type LinkProps } from "../Link"
1312

14-
const variants = {
15-
variant: {
16-
solid: cn(
17-
"text-white bg-primary-action border-transparent",
18-
"hover:!text-white hover:bg-primary-action-hover", // Hover
19-
"active:bg-primary-action-hover", // Active
20-
"disabled:bg-disabled disabled:text-background" // Disabled
21-
),
22-
outline: "", // Base styling
23-
ghost: "border-transparent hover:shadow-none",
24-
link: "border-transparent hover:shadow-none underline !min-h-0 !py-0 !px-1 active:text-primary",
25-
glow: "group relative rounded-lg border-none p-px text-body [&_[data-label='inner']]:!rounded-[7px]",
26-
},
27-
size: {
28-
lg: "text-lg py-3 px-8 [&>svg]:size-6 [&>svg]:text-2xl rounded-lg focus-visible:rounded-lg",
29-
md: "min-h-10.5 px-4 py-2 [&>svg]:size-6 [&>svg]:text-2xl",
30-
sm: "text-xs min-h-[31px] py-1.5 px-2 [&>svg]:size-4 [&>svg]:text-md",
31-
},
32-
}
33-
3413
const buttonVariants = cva(
3514
cn(
3615
// Sizing and positioning classes:
@@ -49,7 +28,24 @@ const buttonVariants = cva(
4928
"[&[data-secondary='true']]:text-body"
5029
),
5130
{
52-
variants,
31+
variants: {
32+
variant: {
33+
solid: cn(
34+
"text-white bg-primary-action border-transparent",
35+
"hover:!text-white hover:bg-primary-action-hover", // Hover
36+
"active:bg-primary-action-hover", // Active
37+
"disabled:bg-disabled disabled:text-background" // Disabled
38+
),
39+
outline: "", // Base styling
40+
ghost: "border-transparent hover:shadow-none",
41+
link: "border-transparent hover:shadow-none underline !min-h-0 !py-0 !px-1 active:text-primary",
42+
},
43+
size: {
44+
lg: "text-lg py-3 px-8 [&>svg]:text-2xl rounded-lg focus-visible:rounded-lg",
45+
md: "min-h-10.5 px-4 py-2 [&>svg]:text-2xl",
46+
sm: "text-xs min-h-[31px] py-1.5 px-2 [&>svg]:text-md",
47+
},
48+
},
5349
defaultVariants: {
5450
variant: "solid",
5551
size: "md",
@@ -114,30 +110,6 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
114110

115111
onClick?.(e)
116112
}
117-
if (variant === "glow") {
118-
const { children, ...buttonProps } = props
119-
return (
120-
<button
121-
className={cn(variants.variant.glow, className)}
122-
{...buttonProps}
123-
>
124-
{/* Glow */}
125-
<div className="absolute inset-0 overflow-hidden rounded-[inherit] opacity-50 blur-md transition-transform duration-300 after:absolute after:-inset-[200%] after:bg-rainbow-gradient group-hover:scale-110 group-hover:transition-transform group-hover:duration-300 after:motion-safe:animate-spin-4" />
126-
{/* Border */}
127-
<div className="absolute inset-0 overflow-hidden rounded-[inherit] after:absolute after:-inset-[200%] after:bg-rainbow-gradient after:motion-safe:animate-spin-4" />
128-
<div
129-
data-label="inner"
130-
className={cn(
131-
variants.size[size || "md"],
132-
"relative z-[1] inline-flex gap-2 bg-background/90 px-6 pb-2 pt-3 font-semibold shadow-inner ring-[1px] ring-white/25 backdrop-blur-lg"
133-
)}
134-
>
135-
{children}
136-
<Sparkles className="rotate//-12 mb-1 transition-transform group-hover:animate-wave group-hover:transition-transform" />
137-
</div>
138-
</button>
139-
)
140-
}
141113

142114
const Comp = asChild ? Slot : "button"
143115
return (

0 commit comments

Comments
 (0)