1- import * as React from " react"
2- import { Slot } from " @radix-ui/react-slot"
3- import { cva , type VariantProps } from " class-variance-authority"
1+ import * as React from ' react'
2+ import { Slot } from ' @radix-ui/react-slot'
3+ import { cva , type VariantProps } from ' class-variance-authority'
44
5- import { cn } from " @/lib/utils"
5+ import { cn } from ' @/lib/utils'
66
77const buttonVariants = cva (
8- " inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0" ,
8+ ' inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0' ,
99 {
1010 variants : {
1111 variant : {
12- default :
13- "bg-primary text-primary-foreground shadow hover:bg-primary/90" ,
14- destructive :
15- "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90" ,
12+ default : 'bg-primary text-primary-foreground shadow hover:bg-primary/90' ,
13+ destructive : 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90' ,
1614 outline :
17- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground" ,
18- secondary :
19- "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80" ,
20- ghost : "hover:bg-accent hover:text-accent-foreground" ,
21- link : "text-primary underline-offset-4 hover:underline" ,
15+ 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground' ,
16+ secondary : 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80' ,
17+ ghost : 'hover:bg-accent hover:text-accent-foreground' ,
18+ link : 'text-primary underline-offset-4 hover:underline'
2219 } ,
2320 size : {
24- default : " h-9 px-4 py-2" ,
25- sm : " h-8 rounded-md px-3 text-xs" ,
26- lg : " h-10 rounded-md px-8" ,
27- icon : " h-9 w-9" ,
28- } ,
21+ default : ' h-9 px-4 py-2' ,
22+ sm : ' h-8 rounded-md px-3 text-xs' ,
23+ lg : ' h-10 rounded-md px-8' ,
24+ icon : ' h-9 w-9'
25+ }
2926 } ,
3027 defaultVariants : {
31- variant : " default" ,
32- size : " default" ,
33- } ,
28+ variant : ' default' ,
29+ size : ' default'
30+ }
3431 }
3532)
3633
@@ -42,16 +39,12 @@ export interface ButtonProps
4239
4340const Button = React . forwardRef < HTMLButtonElement , ButtonProps > (
4441 ( { className, variant, size, asChild = false , ...props } , ref ) => {
45- const Comp = asChild ? Slot : " button"
42+ const Comp = asChild ? Slot : ' button'
4643 return (
47- < Comp
48- className = { cn ( buttonVariants ( { variant, size, className } ) ) }
49- ref = { ref }
50- { ...props }
51- />
44+ < Comp className = { cn ( buttonVariants ( { variant, size, className } ) ) } ref = { ref } { ...props } />
5245 )
5346 }
5447)
55- Button . displayName = " Button"
48+ Button . displayName = ' Button'
5649
5750export { Button , buttonVariants }
0 commit comments