Fixed classes on Button to work with all of the current buttons
This commit is contained in:
parent
59c8eba132
commit
b5d9e0608d
1 changed files with 12 additions and 2 deletions
|
|
@ -23,6 +23,7 @@ const buttonVariants = cva(
|
||||||
"border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5",
|
"border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5",
|
||||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||||
link: "underline-offset-4 hover:underline text-primary",
|
link: "underline-offset-4 hover:underline text-primary",
|
||||||
|
none: "",
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
default: "h-10 py-2 px-4",
|
default: "h-10 py-2 px-4",
|
||||||
|
|
@ -30,6 +31,7 @@ const buttonVariants = cva(
|
||||||
xs: "py-0.5 px-3 rounded-md",
|
xs: "py-0.5 px-3 rounded-md",
|
||||||
lg: "h-11 px-8 rounded-md",
|
lg: "h-11 px-8 rounded-md",
|
||||||
icon: "py-1 px-1 rounded-md",
|
icon: "py-1 px-1 rounded-md",
|
||||||
|
none: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
|
|
@ -64,7 +66,11 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
newChildren = toTitleCase(children);
|
newChildren = toTitleCase(children);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Comp className={buttonVariants({ variant, size })} ref={ref} {...props}>
|
<Comp
|
||||||
|
className={buttonVariants({ variant, size: "none" })}
|
||||||
|
ref={ref}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
loading ? "opacity-100" : "opacity-0",
|
loading ? "opacity-100" : "opacity-0",
|
||||||
|
|
@ -76,7 +82,11 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
loading ? "opacity-0" : "opacity-100",
|
loading ? "opacity-0" : "opacity-100",
|
||||||
cn(buttonChildrenClasses, className),
|
buttonVariants({
|
||||||
|
variant: "none",
|
||||||
|
size,
|
||||||
|
className: cn(buttonChildrenClasses, className),
|
||||||
|
}),
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{newChildren}
|
{newChildren}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue