@@ -6,46 +6,48 @@ import { type VariantProps, cva } from 'class-variance-authority';
6
6
import { cn } from "@/app/_utils/cn" ;
7
7
8
8
const buttonVariants = cva (
9
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring -2 focus-visible:ring -ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0" ,
9
+ "inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors outline-offset-2 focus-visible:outline focus-visible:outline -2 focus-visible:outline -ring/70 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0" ,
10
10
{
11
11
variants : {
12
12
variant : {
13
- default : 'bg-primary text-primary-foreground hover:bg-primary/90' ,
14
- destructive : 'bg-destructive text-destructive-foreground hover:bg-destructive/90' ,
15
- outline : 'border border-input bg-background hover:border-neutral-200 dark:hover:bg-neutral-900' ,
16
- secondary : 'bg-secondary text-secondary-foreground hover:bg-secondary/80' ,
17
- ghost : 'hover:bg-accent hover:text-accent-foreground' ,
18
- link : 'text-primary underline-offset-4 hover:underline' ,
13
+ default : "bg-primary text-primary-foreground shadow-sm shadow-black/5 hover:bg-primary/90" ,
14
+ destructive :
15
+ "bg-destructive text-destructive-foreground shadow-sm shadow-black/5 hover:bg-destructive/90" ,
16
+ outline :
17
+ "border border-input bg-background shadow-sm shadow-black/5 hover:bg-accent hover:text-accent-foreground" ,
18
+ secondary :
19
+ "bg-secondary text-secondary-foreground shadow-sm shadow-black/5 hover:bg-secondary/80" ,
20
+ ghost : "hover:bg-accent hover:text-accent-foreground" ,
21
+ link : "text-primary underline-offset-4 hover:underline" ,
19
22
} ,
20
23
size : {
21
- default : 'h-10 px-4 py-2' ,
22
- sm : 'h-9 rounded-md px-3' ,
23
- lg : 'h-11 rounded-md px-8' ,
24
- icon : 'h-10 w-10' ,
24
+ default : "h-9 px-4 py-2" ,
25
+ sm : "h-8 rounded-lg px-3 text-xs" ,
26
+ lg : "h-10 rounded-lg px-8" ,
27
+ icon : "h-9 w-9" ,
25
28
} ,
26
29
} ,
27
30
defaultVariants : {
28
- variant : ' default' ,
29
- size : ' default' ,
31
+ variant : " default" ,
32
+ size : " default" ,
30
33
} ,
31
34
} ,
32
- )
35
+ ) ;
33
36
34
37
export interface ButtonProps
35
38
extends React . ButtonHTMLAttributes < HTMLButtonElement > ,
36
39
VariantProps < typeof buttonVariants > {
37
- asChild ?: boolean
40
+ asChild ?: boolean ;
38
41
}
39
42
40
43
const Button = React . forwardRef < HTMLButtonElement , ButtonProps > (
41
44
( { className, variant, size, asChild = false , ...props } , ref ) => {
42
- const Comp = asChild ? Slot : ' button'
45
+ const Comp = asChild ? Slot : " button" ;
43
46
return (
44
47
< Comp className = { cn ( buttonVariants ( { variant, size, className } ) ) } ref = { ref } { ...props } />
45
- )
48
+ ) ;
46
49
} ,
47
- )
48
- Button . displayName = ' Button'
50
+ ) ;
51
+ Button . displayName = " Button" ;
49
52
50
53
export { Button , buttonVariants } ;
51
-
0 commit comments