// Design-system button with variant, size, and loading state support. import { cn } from "../../lib/utils"; import { Spinner } from "./Spinner"; export interface ButtonProps extends React.ButtonHTMLAttributes { loading?: boolean; variant?: "primary" | "secondary" | "ghost" | "danger"; size?: "sm" | "md" | "lg"; /** Full-width block button */ fullWidth?: boolean; } const variantStyles: Record, string> = { primary: "bg-[var(--color-brand-600)] hover:bg-[var(--color-brand-700)] text-white shadow-sm", secondary: "bg-white border border-[var(--color-border)] text-[var(--color-text-primary)] hover:bg-[var(--color-surface-muted)]", ghost: "text-[var(--color-text-muted)] hover:bg-[var(--color-surface-muted)]", danger: "bg-red-600 hover:bg-red-700 text-white", }; const sizeStyles: Record, string> = { sm: "h-8 px-3 text-[12px] gap-1.5", md: "h-10 px-4 text-[13px] gap-2", lg: "h-11 px-6 text-[14px] gap-2", }; /** * @example * * * * */ export function Button({ loading, variant = "primary", size = "md", fullWidth, children, className, disabled, ...rest }: ButtonProps) { return ( ); }