import * as React from "react" import { Slot } from "@radix-ui/react-slot" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" // Button == lux.cloud's `.btn`: 10px radius, 14px medium label, a hairline // `border-strong` outline over transparent, lifting to a 5%-ink wash on hover. // `default` is `.btn.primary` — solid ink, inverted label. Shadows are gone // for the same reason as on Card: they render as nothing on black and as grime // on white. const buttonVariants = cva( "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { variant: { default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: "border border-border-strong bg-transparent hover:border-foreground/30 hover:bg-foreground/5", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-foreground/5 hover:text-foreground", link: "text-foreground underline-offset-4 hover:underline", }, size: { default: "h-9 px-3.5 py-2", sm: "h-8 px-3 text-xs", lg: "h-10 px-8", xl: "h-12 px-10 text-base", icon: "h-9 w-9", }, }, defaultVariants: { variant: "default", size: "default", }, } ) export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button" return } ) Button.displayName = "Button" export { Button, buttonVariants }