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'
4
4
5
- import { cn } from " ~/lib/utils"
5
+ import { cn } from ' ~/lib/utils'
6
6
7
7
const buttonVariants = cva (
8
- " inline-flex items-center justify-center 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" ,
8
+ ' inline-flex items-center justify-center 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' ,
9
9
{
10
10
variants : {
11
11
variant : {
12
- default : " bg-primary text-primary-foreground hover:bg-primary/90" ,
12
+ default : ' bg-primary text-primary-foreground hover:bg-primary/90' ,
13
13
destructive :
14
- " bg-destructive text-destructive-foreground hover:bg-destructive/90" ,
14
+ ' bg-destructive text-destructive-foreground hover:bg-destructive/90' ,
15
15
outline :
16
- " border border-input bg-background hover:bg-accent hover:text-accent-foreground" ,
16
+ ' border border-input bg-background hover:bg-accent hover:text-accent-foreground' ,
17
17
secondary :
18
- " bg-secondary text-secondary-foreground hover:bg-secondary/80" ,
19
- ghost : " hover:bg-accent hover:text-accent-foreground" ,
20
- link : " text-primary underline-offset-4 hover:underline" ,
18
+ ' bg-secondary text-secondary-foreground hover:bg-secondary/80' ,
19
+ ghost : ' hover:bg-accent hover:text-accent-foreground' ,
20
+ link : ' text-primary underline-offset-4 hover:underline' ,
21
21
} ,
22
22
size : {
23
- default : " h-10 px-4 py-2" ,
24
- sm : " h-9 rounded-md px-3" ,
25
- lg : " h-11 rounded-md px-8" ,
26
- icon : " h-10 w-10" ,
23
+ default : ' h-10 px-4 py-2' ,
24
+ sm : ' h-9 rounded-md px-3' ,
25
+ lg : ' h-11 rounded-md px-8' ,
26
+ icon : ' h-10 w-10' ,
27
27
} ,
28
28
} ,
29
29
defaultVariants : {
30
- variant : " default" ,
31
- size : " default" ,
30
+ variant : ' default' ,
31
+ size : ' default' ,
32
32
} ,
33
33
}
34
34
)
@@ -41,7 +41,7 @@ export interface ButtonProps
41
41
42
42
const Button = React . forwardRef < HTMLButtonElement , ButtonProps > (
43
43
( { className, variant, size, asChild = false , ...props } , ref ) => {
44
- const Comp = asChild ? Slot : " button"
44
+ const Comp = asChild ? Slot : ' button'
45
45
return (
46
46
< Comp
47
47
className = { cn ( buttonVariants ( { variant, size, className } ) ) }
@@ -51,6 +51,6 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
51
51
)
52
52
}
53
53
)
54
- Button . displayName = " Button"
54
+ Button . displayName = ' Button'
55
55
56
56
export { Button , buttonVariants }
0 commit comments