{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button",
  "title": "Button",
  "description": "Triggers an action, in solid, gradient, outline, secondary, ghost, soft and destructive variants, in sizes that follow the theme's control height.",
  "dependencies": [
    "class-variance-authority",
    "radix-ui"
  ],
  "registryDependencies": [
    "https://www.gliakit.com/r/tokens.json"
  ],
  "files": [
    {
      "path": "src/components/ui/button.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n  // rounded-md (8px) per the design system: buttons + inputs share the same\n  // radius. Borderless base — only the outline variant carries a border.\n  \"group/button inline-flex max-w-full shrink-0 items-center justify-center rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-solid focus-visible:outline-primary-ink active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg[role=status]]:text-current\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"shadow-glossy bg-primary-strong text-primary-foreground hover:bg-primary-strong/90\",\n        // Signature CTA: violet fill, violet->cyan gradient on hover.\n        // One of the three sanctioned uses of the signature gradient.\n        gradient:\n          \"shadow-glossy bg-primary-strong text-primary-foreground transition-[background,box-shadow] hover:bg-[image:var(--gradient-signal)]\",\n        outline:\n          \"border border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground focus-visible:border-ring aria-invalid:border-destructive dark:border-input dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50\",\n        // Hover is the same grey a step deeper. Mixed in oklab: oklch turns the hue on the way between two\n        // near-greys, which tinted the hover pink.\n        secondary:\n          \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n        ghost:\n          \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n        // A quiet brand tint: secondary actions that still read as the brand.\n        soft: \"bg-primary/10 text-primary-ink hover:bg-primary/15 aria-expanded:bg-primary/15\",\n        destructive:\n          \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:outline-destructive dark:bg-destructive/20 dark:hover:bg-destructive/30\",\n        link: \"text-primary-ink underline-offset-4 hover:underline\",\n      },\n      size: {\n        // Heights follow the theme's control size (h-control, globals.css), so buttons match inputs.\n        default:\n          \"h-control gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n        xs: \"h-6 gap-1 px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n        sm: \"h-control-sm gap-1 px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n        lg: \"h-control-lg gap-1.5 px-3.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n        // Marketing-scale CTA — fully rounded pill.\n        xl: \"h-11 gap-2 rounded-full px-6 text-sm has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5\",\n        icon: \"size-control\",\n        \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n        \"icon-sm\": \"size-control-sm\",\n        \"icon-lg\": \"size-control-lg\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nfunction Button({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  asChild = false,\n  children,\n  ...props\n}: React.ComponentProps<\"button\"> &\n  VariantProps<typeof buttonVariants> & {\n    asChild?: boolean\n  }) {\n  const Comp = asChild ? Slot.Root : \"button\"\n\n  return (\n    <Comp\n      data-slot=\"button\"\n      data-variant={variant}\n      data-size={size}\n      className={cn(buttonVariants({ variant, size, className }))}\n      {...props}\n    >\n      {/* A label longer than the room it has ends in an ellipsis; the button never outgrows its container. */}\n      {asChild\n        ? children\n        : React.Children.map(children, (c) =>\n            typeof c === \"string\" || typeof c === \"number\" ? <span className=\"min-w-0 truncate\">{c}</span> : c,\n          )}\n    </Comp>\n  )\n}\n\nexport { Button, buttonVariants }\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "actions"
  ],
  "type": "registry:ui"
}
