@@ -5,15 +5,15 @@ import * as React from 'react'
5
5
import { cn } from '#app/utils/misc.tsx'
6
6
7
7
const buttonVariants = cva (
8
- 'inline-flex items-center justify-center rounded-md text-sm font-medium outline-none ring-ring ring- offset-2 ring-offset-background transition-colors focus-within:ring-2 focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50' ,
8
+ 'ring-ring ring-offset-background inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-2 outline-hidden transition-colors focus-within:ring-2 focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50' ,
9
9
{
10
10
variants : {
11
11
variant : {
12
12
default : 'bg-primary text-primary-foreground hover:bg-primary/80' ,
13
13
destructive :
14
14
'bg-destructive text-destructive-foreground hover:bg-destructive/80' ,
15
15
outline :
16
- 'border border -input bg-background hover:bg-accent hover:text-accent-foreground' ,
16
+ 'border-input bg-background hover:bg-accent hover:text-accent-foreground border ' ,
17
17
secondary :
18
18
'bg-secondary text-secondary-foreground hover:bg-secondary/80' ,
19
19
ghost : 'hover:bg-accent hover:text-accent-foreground' ,
@@ -25,7 +25,7 @@ const buttonVariants = cva(
25
25
sm : 'h-9 rounded-md px-3' ,
26
26
lg : 'h-11 rounded-md px-8' ,
27
27
pill : 'px-12 py-3 leading-3' ,
28
- icon : 'h-10 w -10' ,
28
+ icon : 'size -10' ,
29
29
} ,
30
30
} ,
31
31
defaultVariants : {
@@ -35,24 +35,26 @@ const buttonVariants = cva(
35
35
} ,
36
36
)
37
37
38
- export interface ButtonProps
39
- extends React . ButtonHTMLAttributes < HTMLButtonElement > ,
40
- VariantProps < typeof buttonVariants > {
41
- asChild ?: boolean
42
- }
38
+ export type ButtonVariant = VariantProps < typeof buttonVariants >
43
39
44
- const Button = React . forwardRef < HTMLButtonElement , ButtonProps > (
45
- ( { className, variant, size, asChild = false , ...props } , ref ) => {
46
- const Comp = asChild ? Slot : 'button'
47
- return (
48
- < Comp
49
- className = { cn ( buttonVariants ( { variant, size, className } ) ) }
50
- ref = { ref }
51
- { ...props }
52
- />
53
- )
54
- } ,
55
- )
56
- Button . displayName = 'Button'
40
+ const Button = ( {
41
+ className,
42
+ variant,
43
+ size,
44
+ asChild = false ,
45
+ ...props
46
+ } : React . ComponentProps < 'button' > &
47
+ ButtonVariant & {
48
+ asChild ?: boolean
49
+ } ) => {
50
+ const Comp = asChild ? Slot : 'button'
51
+ return (
52
+ < Comp
53
+ data-slot = "button"
54
+ className = { cn ( buttonVariants ( { variant, size, className } ) ) }
55
+ { ...props }
56
+ />
57
+ )
58
+ }
57
59
58
60
export { Button , buttonVariants }
0 commit comments