@@ -5,15 +5,15 @@ import * as React from 'react'
55import { cn } from '#app/utils/misc.tsx'
66
77const 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' ,
99 {
1010 variants : {
1111 variant : {
1212 default : 'bg-primary text-primary-foreground hover:bg-primary/80' ,
1313 destructive :
1414 'bg-destructive text-destructive-foreground hover:bg-destructive/80' ,
1515 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 ' ,
1717 secondary :
1818 'bg-secondary text-secondary-foreground hover:bg-secondary/80' ,
1919 ghost : 'hover:bg-accent hover:text-accent-foreground' ,
@@ -25,7 +25,7 @@ const buttonVariants = cva(
2525 sm : 'h-9 rounded-md px-3' ,
2626 lg : 'h-11 rounded-md px-8' ,
2727 pill : 'px-12 py-3 leading-3' ,
28- icon : 'h-10 w -10' ,
28+ icon : 'size -10' ,
2929 } ,
3030 } ,
3131 defaultVariants : {
@@ -35,24 +35,26 @@ const buttonVariants = cva(
3535 } ,
3636)
3737
38- export interface ButtonProps
39- extends React . ButtonHTMLAttributes < HTMLButtonElement > ,
40- VariantProps < typeof buttonVariants > {
41- asChild ?: boolean
42- }
38+ export type ButtonVariant = VariantProps < typeof buttonVariants >
4339
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+ }
5759
5860export { Button , buttonVariants }
0 commit comments