"use client"; 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"; const button = cva( "inline-flex items-center justify-center gap-2 font-semibold cursor-pointer " + "transition-all duration-200 ease-glass disabled:opacity-45 " + "disabled:cursor-default disabled:pointer-events-none select-none " + "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-accent-soft", { variants: { variant: { // Solid accent. The label is near-black because the accent is clamped // to a light-ish luminance in lib/colour.ts — the two decisions have // to stay in step or this button becomes unreadable on some albums. primary: "bg-accent text-[#08090d] shadow-[var(--e1)] hover:brightness-110 " + "active:scale-[0.97] active:brightness-95", ghost: "glass-hi text-ink hover:border-accent-line hover:bg-accent-soft active:scale-[0.97]", outline: "bg-transparent border border-edge-hi text-ink hover:border-accent-line " + "hover:bg-accent-soft hover:text-accent active:scale-[0.95]", quiet: "bg-transparent border border-edge-hi text-dim hover:text-ink hover:border-accent-line", }, size: { sm: "text-caption px-3 py-1.5 rounded-pill", md: "text-callout px-4.5 py-2.5 rounded-control", pill: "text-callout px-4 py-2 rounded-pill", }, }, defaultVariants: { variant: "primary", size: "md" }, }, ); export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean; } export const Button = React.forwardRef( ({ className, variant, size, asChild, ...props }, ref) => { const Comp = asChild ? Slot : "button"; return ( ); }, ); Button.displayName = "Button";