refactor: update button and badge styles for improved theming and consistency

This commit is contained in:
2026-01-14 11:07:43 -06:00
parent 4cdccc0323
commit 4ccaca192d
14 changed files with 85 additions and 68 deletions

View File

@@ -1,8 +1,8 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva } from "class-variance-authority"
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva } from "class-variance-authority";
import { cn } from "@/lib/utils"
import { cn } from "@/lib/utils";
const buttonVariants = cva("btn", {
variants: {
@@ -11,10 +11,10 @@ const buttonVariants = cva("btn", {
secondary: "btn-secondary",
ghost: "btn-ghost",
outline: "btn-outline",
"outline-destructive": "btn-outline-destructive",
accent: "btn-accent",
destructive: "btn-destructive",
link: "btn-link",
},
size: {
default: "btn-md",
@@ -27,18 +27,20 @@ const buttonVariants = cva("btn", {
variant: "default",
size: "default",
},
})
});
const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ variant, size }), className)}
ref={ref}
{...props}
/>
)
})
Button.displayName = "Button"
const Button = React.forwardRef(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(buttonVariants({ variant, size }), className)}
ref={ref}
{...props}
/>
);
}
);
Button.displayName = "Button";
export { Button, buttonVariants }
export { Button, buttonVariants };