{
  "name": "button",
  "type": "registry:ui",
  "title": "Button",
  "description": "Every click that isn't a row or a pad. Machined edge, 1px of real travel; strength is structure, never glow.",
  "dependencies": [
    "@candlelight-ds/tokens",
    "class-variance-authority",
    "clsx",
    "tailwind-merge"
  ],
  "registryDependencies": [
    "kbd",
    "utils"
  ],
  "files": [
    {
      "path": "components/ui/Button.tsx",
      "type": "registry:ui",
      "content": "'use client'\n\n/**\n * Button — every click that isn't a row or a pad.\n *\n * Use when: forms, headers, overlays, empty-state actions.\n * Don't use when: persistent surface controls (TransportButton),\n * one-shots (Pad), or status tokens (Chip).\n *\n * G7 corollary: control strength is structure — rim, weight, contrast.\n * A strong button is machined, not radiant; only the accent warms.\n * Exactly one `primary` per view region (C3).\n */\n\nimport * as React from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { Kbd } from './Kbd'\n\nconst buttonVariants = cva(\n  // Every key travels 1px under the thumb (the console physics);\n  // only the accent warms — heat is affordance, and it grades the hierarchy.\n  'inline-flex items-center justify-center gap-2 rounded-sm font-medium transition-[color,background-color,border-color,transform] duration-instant active:translate-y-px focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brass focus-visible:ring-offset-2 focus-visible:ring-offset-stage disabled:pointer-events-none disabled:opacity-40',\n  {\n    variants: {\n      variant: {\n        /** Primary — machined accent. One per view region (C3). */\n        primary: 'key-brass bg-brass text-stage hover:bg-brass-hot',\n        /** Destructive stays cold — red never invites (G4). */\n        destructive: 'bg-danger text-ink hover:bg-danger/85',\n        outline:\n          'border border-hairline bg-fill-rest text-ink-mute hover:border-hairline-strong hover:bg-fill-hover hover:text-ink',\n        secondary: 'bg-surface-3 text-ink hover:bg-fill-active',\n        quiet: 'text-ink-mute hover:bg-fill-hover hover:text-ink',\n        link: 'text-brass underline-offset-4 hover:text-brass-hot hover:underline',\n      },\n      size: {\n        // Density (§2.6) is ambient, never a prop: under a\n        // data-density=\"performance\" ancestor the default hit targets\n        // grow to 48px / 14px text (hands on keys, low light); sm/iconSm\n        // are explicitly small and hold their size in both postures.\n        default:\n          'h-10 px-4 py-2 text-body [[data-density=performance]_&]:h-12 [[data-density=performance]_&]:px-5 [[data-density=performance]_&]:text-body-lg',\n        sm: 'h-8 px-3 text-meta',\n        lg: 'h-11 px-6 text-body-lg [[data-density=performance]_&]:h-12',\n        icon: 'h-10 w-10 [[data-density=performance]_&]:h-12 [[data-density=performance]_&]:w-12',\n        iconSm: 'h-8 w-8',\n      },\n    },\n    defaultVariants: {\n      variant: 'primary',\n      size: 'default',\n    },\n  }\n)\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n    VariantProps<typeof buttonVariants> {\n  /** Printed key (grammar G2). Renders a Kbd chip after the label. */\n  kbd?: string\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n  ({ className, variant, size, kbd, children, ...props }, ref) => {\n    return (\n      <button\n        className={cn(buttonVariants({ variant, size, className }))}\n        ref={ref}\n        {...props}\n      >\n        {children}\n        {kbd ? (\n          <Kbd tone={variant === 'primary' || variant == null ? 'onBrass' : 'default'}>\n            {kbd}\n          </Kbd>\n        ) : null}\n      </button>\n    )\n  }\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n",
      "target": "components/ui/Button.tsx"
    }
  ],
  "meta": {
    "candlelight": {
      "category": "primitive",
      "gRules": [
        "G2",
        "G7",
        "C3"
      ],
      "useWhen": "Forms, headers, overlays, empty-state actions.",
      "dontUseWhen": "Persistent surface controls (TransportButton), one-shots (Pad), or status tokens (Chip).",
      "states": [
        "primary",
        "destructive",
        "outline",
        "secondary",
        "quiet",
        "link",
        "disabled",
        "with printed key"
      ],
      "keyboard": [
        {
          "keys": "Enter/Space",
          "does": "activates (native button)"
        }
      ],
      "acceptanceTests": [
        "Exactly one primary per view region (C3).",
        "Every variant travels 1px on press.",
        "Destructive wears the cold danger tone — red never invites."
      ]
    }
  }
}