{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-aria-phosphor",
  "type": "registry:ui",
  "title": "Button (React Aria, Phosphor)",
  "description": "A button with five variants, four sizes and a loading state that keeps focus and announces progress, on Radix, Base UI or React Aria.",
  "author": "Design From Labs <https://labs.designfrom.com>",
  "categories": [
    "actions",
    "aria",
    "phosphor"
  ],
  "docs": "Installed `Button`. Import it from `@/components/ui/button`.\n\n- `variant`: default, secondary, outline, ghost, destructive.\n- `loading` shows a spinner and keeps focus on the button.\n\nColors come from your theme tokens (`--primary`, `--ring`, ...). Install `designfrom-theme` for the Design From palette.\n\nDocs and every variant: https://labs.designfrom.com/ui/button",
  "dependencies": [
    "class-variance-authority@^0.7",
    "react-aria-components@^1",
    "@phosphor-icons/react@^2"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/button-aria-phosphor/button.tsx",
      "type": "registry:ui",
      "content": "\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { CircleNotchIcon } from \"@phosphor-icons/react/ssr\";\nimport type * as React from \"react\";\nimport {\n  Button as ButtonPrimitive,\n  type ButtonProps as ButtonPrimitiveProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"@/lib/utils\";\n\n/**\n * @dfl-header: v1, generated by labs.designfrom.com at build time\n * Item: button-aria-phosphor (Button: React Aria, Phosphor)\n * What: A button with five variants, four sizes and a loading state that\n *    keeps focus and announces progress, on Radix, Base UI or React Aria.\n * Status: ready. License: MIT. Author: Design From Labs\n *    <https://labs.designfrom.com>\n * Source: https://github.com/Design-from-labs/labs @ 803b92c1a30e (examples/button)\n * Credits: S-003 React (MIT); S-004 shadcn/ui and its registry schema (MIT);\n *    S-005 Lucide icons (ISC); S-006 Phosphor Icons (MIT); S-008\n *    Tailwind CSS (MIT); S-018 class-variance-authority (Apache-2.0);\n *    S-032 Radix Primitives (the unified radix-ui package) (MIT);\n *    S-033 Base UI (@base-ui/react) (MIT); S-034 React Aria Components\n *    (react-aria-components) (Apache-2.0)\n * Install: npx shadcn@latest add https://labs.designfrom.com/r/button-aria-phosphor.json\n *   npx shadcn@latest add @designfrom/button-aria-phosphor\n *   npx designfrom add button --primitive aria --icons phosphor\n *   npm i @designfrom/react, then import { Button, buttonVariants } from \"@designfrom/react/aria/button/phosphor\";\n * Requires: class-variance-authority, react-aria-components, @phosphor-icons/react, registry: utils\n * Docs: https://labs.designfrom.com/ui/button (index: https://labs.designfrom.com/llms.txt)\n */\n\n// Every color comes from the shared token layer (primary, accent, ring...),\n// so the button follows whatever theme the host project defines.\nconst buttonVariants = cva(\n  \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,background-color,box-shadow] duration-150 data-focus-visible:ring-2 data-focus-visible:ring-ring data-focus-visible:ring-offset-2 data-focus-visible:ring-offset-background data-disabled:pointer-events-none data-disabled:opacity-50 data-pending:cursor-progress motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n        secondary:\n          \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n        outline:\n          \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n        ghost: \"hover:bg-accent hover:text-accent-foreground\",\n        destructive:\n          \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n      },\n      size: {\n        sm: \"h-8 px-3 text-xs\",\n        md: \"h-9 px-4\",\n        lg: \"h-10 px-6\",\n        icon: \"size-9\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"md\",\n    },\n  },\n);\n\nexport interface ButtonProps\n  extends Omit<ButtonPrimitiveProps, \"className\" | \"children\">,\n    VariantProps<typeof buttonVariants> {\n  className?: string;\n  children?: React.ReactNode;\n  /**\n   * Shows a spinner while true. Maps to React Aria's isPending, which keeps\n   * focus, ignores presses and announces the pending state.\n   */\n  loading?: boolean;\n}\n\nfunction Button({\n  className,\n  variant,\n  size,\n  loading = false,\n  isPending,\n  children,\n  ...props\n}: ButtonProps) {\n  const pending = loading || isPending;\n  return (\n    <ButtonPrimitive\n      data-slot=\"button\"\n      isPending={pending}\n      className={cn(buttonVariants({ variant, size }), className)}\n      {...props}\n    >\n      {pending ? (\n        <CircleNotchIcon aria-hidden=\"true\" className=\"motion-safe:animate-spin\" />\n      ) : null}\n      {children}\n    </ButtonPrimitive>\n  );\n}\n\nexport { Button, buttonVariants };\n"
    }
  ],
  "meta": {
    "status": "ready",
    "license": "MIT",
    "author": "Design From Labs <https://labs.designfrom.com>",
    "source": {
      "repo": "https://github.com/Design-from-labs/labs",
      "commit": "803b92c1a30e0d513e1cb1ff5ca984b2a5f9b492",
      "path": "examples/button"
    },
    "credits": [
      "S-003",
      "S-004",
      "S-005",
      "S-006",
      "S-008",
      "S-018",
      "S-032",
      "S-033",
      "S-034"
    ],
    "component": "button",
    "kind": "component",
    "primitive": "aria",
    "iconSet": "phosphor",
    "page": "https://labs.designfrom.com/ui/button"
  }
}
