@@ -16,25 +16,25 @@ const sizes = {
1616const themes = {
1717 primary : cx (
1818 // Base styles
19- "bg-blue-700 dark: border-blue-600 border border -blue-900/60 text-white shadow-sm" ,
19+ "border border-blue-900/60 bg-blue-700 text-white shadow-sm dark:border-blue-600 " ,
2020 // Hover states
2121 "group-hover:bg-blue-800" ,
2222 // Active states
2323 "group-active:bg-blue-900" ,
2424 ) ,
2525 danger : cx (
2626 // Base styles
27- "bg-red-600 text-white border-red-700 shadow-xs shadow-red-200/80 dark:border-red-600 dark:shadow-red-900/20" ,
27+ "border-red-700 bg-red-600 text-white shadow-xs shadow-red-200/80 dark:border-red-600 dark:shadow-red-900/20" ,
2828 // Hover states
29- "group-hover:bg -red-700 group-hover:border -red-800 dark:group-hover:bg -red-700 dark:group-hover:border -red-600 " ,
29+ "group-hover:border -red-800 group-hover:bg -red-700 dark:group-hover:border -red-600 dark:group-hover:bg -red-700 " ,
3030 // Active states
3131 "group-active:bg-red-800 dark:group-active:bg-red-800" ,
3232 // Focus states
3333 "group-focus:ring-red-700 dark:group-focus:ring-red-600" ,
3434 ) ,
3535 light : cx (
3636 // Base styles
37- "bg-white text-black border-slate-800/30 shadow-xs dark:bg -slate-800 dark:border -slate-300/20 dark:text-white" ,
37+ "border-slate-800/30 bg-white text-black shadow-xs dark:border -slate-300/20 dark:bg -slate-800 dark:text-white" ,
3838 // Hover states
3939 "group-hover:bg-blue-50/80 dark:group-hover:bg-slate-700" ,
4040 // Active states
@@ -44,7 +44,7 @@ const themes = {
4444 ) ,
4545 lightDanger : cx (
4646 // Base styles
47- "bg-white text-black border-red-400/60 shadow-xs" ,
47+ "border-red-400/60 bg-white text-black shadow-xs" ,
4848 // Hover states
4949 "group-hover:bg-red-50/80" ,
5050 // Active states
@@ -54,9 +54,9 @@ const themes = {
5454 ) ,
5555 blank : cx (
5656 // Base styles
57- "bg-white/0 text-black border-transparent dark:text-white" ,
57+ "border-transparent bg-white/0 text-black dark:text-white" ,
5858 // Hover states
59- "group-hover:bg-white group-hover: border-slate-800/30 group-hover:shadow-sm dark:group-hover:bg -slate-700 dark:group-hover:border -slate-600 " ,
59+ "group-hover:border-slate-800/30 group-hover:bg-white group-hover: shadow-sm dark:group-hover:border -slate-600 dark:group-hover:bg -slate-700 " ,
6060 // Active states
6161 "group-active:bg-slate-100/80" ,
6262 ) ,
@@ -65,16 +65,16 @@ const themes = {
6565const btnVariants = cva ( {
6666 base : cx (
6767 // Base styles
68- "border rounded-sm select-none" ,
68+ "rounded-sm border select-none" ,
6969 // Size classes
70- "justify-center items-center shrink-0 " ,
70+ "shrink-0 items-center justify-center " ,
7171 // Transition classes
7272 "outline-hidden transition-all duration-200" ,
7373 // Text classes
74- "font-display text-center font-medium leading-tight" ,
74+ "text-center font-display leading-tight font-medium " ,
7575 // States
76- "group-focus:outline-hidden group-focus:ring-2 group-focus:ring-offset-2 group-focus:ring-blue-700 " ,
77- "group-disabled:opacity-50 group-disabled:pointer-events-none " ,
76+ "group-focus:ring-2 group-focus:ring-blue-700 group-focus:ring-offset-2 group-focus:outline-hidden " ,
77+ "group-disabled:pointer-events-none group-disabled:opacity-50 " ,
7878 ) ,
7979
8080 variants : {
@@ -115,8 +115,7 @@ interface ButtonContentPropsType {
115115}
116116
117117function ButtonContent ( props : ButtonContentPropsType ) {
118- const { text, LeadingIcon, TrailingIcon, fullWidth, className, textAlign, loading } =
119- props ;
118+ const { text, LeadingIcon, TrailingIcon, fullWidth, className, textAlign, loading } = props ;
120119
121120 // Based on the size prop, we'll use the corresponding variant classnames
122121 const iconClassName = iconVariants ( props ) ;
@@ -136,9 +135,7 @@ function ButtonContent(props: ButtonContentPropsType) {
136135 < LoadingSpinner className = { cx ( iconClassName , "animate-spin" ) } />
137136 </ div >
138137 ) : (
139- LeadingIcon && (
140- < LeadingIcon className = { cx ( iconClassName , "shrink-0 justify-start" ) } />
141- )
138+ LeadingIcon && < LeadingIcon className = { cx ( iconClassName , "shrink-0 justify-start" ) } />
142139 ) }
143140
144141 { text && typeof text === "string" ? (
@@ -147,9 +144,7 @@ function ButtonContent(props: ButtonContentPropsType) {
147144 text
148145 ) }
149146
150- { TrailingIcon && (
151- < TrailingIcon className = { cx ( iconClassName , "shrink-0 justify-end" ) } />
152- ) }
147+ { TrailingIcon && < TrailingIcon className = { cx ( iconClassName , "shrink-0 justify-end" ) } /> }
153148 </ div >
154149 </ div >
155150 ) ;
@@ -175,7 +170,7 @@ type ButtonPropsType = Pick<
175170export const Button = React . forwardRef < HTMLButtonElement , ButtonPropsType > (
176171 ( { type, disabled, onClick, formNoValidate, loading, fetcher, ...props } , ref ) => {
177172 const classes = cx (
178- "group outline-hidden cursor-pointer" ,
173+ "group cursor-pointer outline-hidden " ,
179174 props . fullWidth ? "w-full" : "" ,
180175 loading ? "pointer-events-none" : "" ,
181176 ) ;
@@ -212,7 +207,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonPropsType>(
212207Button . displayName = "Button" ;
213208
214209type LinkPropsType = Pick < LinkProps , "to" > &
215- React . ComponentProps < typeof ButtonContent > & { disabled ?: boolean , reloadDocument ?: boolean } ;
210+ React . ComponentProps < typeof ButtonContent > & { disabled ?: boolean ; reloadDocument ?: boolean } ;
216211export const LinkButton = ( { to, ...props } : LinkPropsType ) => {
217212 const classes = cx (
218213 "group outline-hidden" ,
@@ -241,7 +236,7 @@ type LabelPropsType = Pick<HTMLLabelElement, "htmlFor"> &
241236 React . ComponentProps < typeof ButtonContent > & { disabled ?: boolean } ;
242237export const LabelButton = ( { htmlFor, ...props } : LabelPropsType ) => {
243238 const classes = cx (
244- "group outline-hidden block cursor-pointer" ,
239+ "group block cursor-pointer outline-hidden " ,
245240 props . disabled ? "pointer-events-none opacity-70!" : "" ,
246241 props . fullWidth ? "w-full" : "" ,
247242 props . loading ? "pointer-events-none" : "" ,
0 commit comments