Skip to content

Commit

Permalink
feat: add rounded button variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Jul 2, 2024
1 parent 4813dd8 commit 4c9f7c5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/ui/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ const buttonVariants = cva(
lg: 'h-11 px-8',
icon: 'h-10 w-10',
},
rounded: {
full: 'rounded-full',
lg: 'rounded-lg',
md: 'rounded-md',
sm: 'rounded-sm',
},
},
defaultVariants: {
variant: 'default',
size: 'md',
rounded: 'full',
},
}
);
Expand All @@ -42,11 +49,11 @@ export interface ButtonProps
}

const Button = forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
({ className, variant, size, rounded, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
className={cn(buttonVariants({ variant, size, rounded, className }))}
ref={ref}
{...props}
data-testid={props['data-testid'] ?? BaseDataTestId.Button}
Expand Down

0 comments on commit 4c9f7c5

Please sign in to comment.