@@ -13,19 +13,27 @@ const buttonVariants = cva(
1313
1414 primary : "bg-primary text-text-invers hover:bg-secondary" ,
1515 secondary : "bg-secondary text-text-invers hover:bg-primary" ,
16- ternary : "bg-ternary text-text-invers hover:bg-primary active:bg-secondary" ,
16+ ternary :
17+ "bg-ternary text-text-invers hover:bg-primary active:bg-secondary" ,
1718
18- destructive : "bg-error text-text-invers hover:opacity-90 active:opacity-80" ,
19+ destructive :
20+ "bg-error text-text-invers hover:opacity-90 active:opacity-80" ,
1921
20- outline : "bg-transparent border border-primary text-primary hover:bg-primary hover:text-text-invers" ,
22+ outline :
23+ "bg-transparent border border-primary text-primary hover:bg-primary hover:text-text-invers" ,
2124
22- "outline-primary" : "border border-primary bg-transparent text-primary hover:bg-primary hover:text-text-invers" ,
25+ "outline-primary" :
26+ "border border-primary bg-transparent text-primary hover:bg-primary hover:text-text-invers" ,
2327
24- "outline-destructive" : "border border-error bg-transparent text-error hover:bg-error hover:text-text-invers" ,
28+ "outline-destructive" :
29+ "border border-error bg-transparent text-error hover:bg-error hover:text-text-invers" ,
2530
26- ghost : "bg-transparent text-text hover:bg-surface/70 active:bg-surface/90" ,
27- "ghost-primary" : "bg-transparent text-primary hover:bg-surface/70 active:bg-surface/90" ,
28- "ghost-destructive" : "bg-transparent text-error hover:bg-surface/70 active:bg-surface/90" ,
31+ ghost :
32+ "bg-transparent text-text hover:bg-surface/70 active:bg-surface/90" ,
33+ "ghost-primary" :
34+ "bg-transparent text-primary hover:bg-surface/70 active:bg-surface/90" ,
35+ "ghost-destructive" :
36+ "bg-transparent text-error hover:bg-surface/70 active:bg-surface/90" ,
2937
3038 link : "bg-transparent text-primary underline-offset-4 hover:underline" ,
3139 } ,
@@ -51,32 +59,35 @@ const buttonVariants = cva(
5159 size : "default" ,
5260 rounded : "default" ,
5361 } ,
54- }
62+ } ,
5563) ;
5664
57- const Button = forwardRef ( ( { className, variant, size, rounded, asChild = false , children, ...props } , ref ) => {
58- const buttonClasses = cn ( buttonVariants ( { variant, size, rounded, className } ) ) ;
65+ const Button = forwardRef (
66+ (
67+ { className, variant, size, rounded, asChild = false , children, ...props } ,
68+ ref ,
69+ ) => {
70+ const buttonClasses = cn (
71+ buttonVariants ( { variant, size, rounded, className } ) ,
72+ ) ;
5973
60- if ( asChild && isValidElement ( children ) ) {
61- return cloneElement ( children , {
62- ref,
63- className : cn ( buttonClasses , children . props . className ) ,
64- ...props ,
65- ...children . props ,
66- } ) ;
67- }
74+ if ( asChild && isValidElement ( children ) ) {
75+ return cloneElement ( children , {
76+ ref,
77+ className : cn ( buttonClasses , children . props . className ) ,
78+ ...props ,
79+ ...children . props ,
80+ } ) ;
81+ }
6882
69- return (
70- < AriaButton
71- ref = { ref }
72- className = { buttonClasses }
73- { ...props }
74- >
75- { children }
76- </ AriaButton >
77- ) ;
78- } ) ;
83+ return (
84+ < AriaButton ref = { ref } className = { buttonClasses } { ...props } >
85+ { children }
86+ </ AriaButton >
87+ ) ;
88+ } ,
89+ ) ;
7990
8091Button . displayName = "Button" ;
8192
82- export { Button , buttonVariants } ;
93+ export { Button } ;
0 commit comments