{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "UI8Kit 3 Button primitive (unstyled), from @ui8kit/registry",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n// ui.button — shared TypeScript contract (types + classes helpers)\n\nimport { cn } from \"../../utils\";\n\n/** Button renders a button element, or an anchor when Href is set. */\nexport type ButtonBaseProps = {\n  type?: \"button\" | \"submit\" | \"reset\";\n  href?: string;\n  disabled?: boolean;\n  pressed?: boolean;\n  expanded?: boolean;\n};\n\nexport type ButtonClassesInput = {\n  className?: string;\n};\n\n/** Compose Button classes without rendering — the cross-runtime `asChild` substitute. */\nexport function buttonClasses(input: ButtonClassesInput = {}): string {\n  return cn(input.className);\n}\n",
      "path": "kit/ui/button/button.shared.ts",
      "target": "kit/ui/button/button.shared.ts"
    },
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n/**\n * Button triggers an action. With `href` it renders an anchor (navigation that\n * looks like an action). Event handlers (onClick) flow through attrs/rest.\n * Pressed / Expanded are the semantic ARIA state props (toggle, disclosure).\n */\n\nimport { splitProps, type JSX, type Component } from \"solid-js\";\nimport { buttonClasses } from \"./button.shared\";\nimport { isSetStr, oneOfOr, optBoolStr, orUndef, safeRest, safeUrl } from \"../../utils/expr\";\n\n/**\n * Button renders a button element, or an anchor when Href is set.\n * Type/Form apply only in button mode; Disabled on anchors uses aria-disabled.\n * Pressed (button mode) and Expanded print aria-pressed / aria-expanded as \"true\"/\"false\";\n * unset omits the attribute.\n */\nexport type ButtonProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"class\" | \"className\" | \"children\" | \"type\" | \"href\" | \"disabled\" | \"pressed\" | \"expanded\" | \"ref\"> & {\n  type?: \"button\" | \"submit\" | \"reset\";\n  href?: string;\n  disabled?: boolean;\n  pressed?: boolean;\n  expanded?: boolean;\n  class?: string;\n  className?: string;\n  children?: JSX.Element;\n  ref?: (el: HTMLElement) => void;\n};\n\nexport const Button: Component<ButtonProps> = (props) => {\n  const [local, rest] = splitProps(props, [\"type\", \"href\", \"disabled\", \"pressed\", \"expanded\", \"class\", \"className\", \"children\"]);\n  const cls = () => buttonClasses({ className: local.class ?? local.className });\n  return (\n    <>\n      {isSetStr(local.href) ? (\n        <a href={orUndef(safeUrl(local.href))} {...(cls() ? { class: cls() } : {})} aria-expanded={orUndef(optBoolStr(local.expanded))} aria-disabled={local.disabled ? \"true\" : undefined} tabIndex={local.disabled ? -1 : undefined} {...safeRest(rest, { blank: [\"aria-label\", \"aria-pressed\", \"aria-expanded\", \"aria-controls\"] })}>\n          {local.children}\n        </a>\n      ) : (\n        <button type={oneOfOr(local.type, \"button\", \"submit\", \"reset\")} {...(cls() ? { class: cls() } : {})} disabled={local.disabled || undefined} aria-pressed={orUndef(optBoolStr(local.pressed))} aria-expanded={orUndef(optBoolStr(local.expanded))} {...safeRest(rest, { blank: [\"aria-label\", \"aria-pressed\", \"aria-expanded\", \"aria-controls\"] })}>\n          {local.children}\n        </button>\n      )}\n    </>\n  );\n};\n",
      "path": "kit/ui/button/button.solid.tsx",
      "target": "kit/ui/button/button.solid.tsx"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "solid",
      "primitive"
    ]
  },
  "name": "kit-button",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "solid",
  "title": "Kit Button",
  "type": "registry:ui"
}
