{
  "$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<!--\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-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n\n  export type ButtonProps = {\n    type?: \"button\" | \"submit\" | \"reset\";\n    href?: string;\n    disabled?: boolean;\n    pressed?: boolean;\n    expanded?: boolean;\n    class?: string;\n    children?: Snippet;\n    [key: string]: unknown;\n  };\n</script>\n\n<script lang=\"ts\">\n  import { buttonClasses } from \"./button.shared\";\n  import { isSetStr, oneOfOr, optBoolStr, orUndef, safeRest, safeUrl } from \"../../utils/expr\";\n\n  let {\n    type,\n    href,\n    disabled,\n    pressed,\n    expanded,\n    class: className,\n    children,\n    ...rawRest\n  }: ButtonProps = $props();\n\n  const rest = $derived(safeRest(rawRest, { blank: [\"aria-label\", \"aria-pressed\", \"aria-expanded\", \"aria-controls\"] }));\n  const cls = $derived(buttonClasses({ className }));\n</script>\n\n{#if isSetStr(href)}\n  <a href={orUndef(safeUrl(href))} {...(cls ? { class: cls } : {})} aria-expanded={orUndef(optBoolStr(expanded))} aria-disabled={disabled ? \"true\" : undefined} tabindex={disabled ? -1 : undefined} {...rest}>\n    {@render children?.()}\n  </a>\n{:else}\n  <button type={oneOfOr(type, \"button\", \"submit\", \"reset\")} {...(cls ? { class: cls } : {})} disabled={disabled || undefined} aria-pressed={orUndef(optBoolStr(pressed))} aria-expanded={orUndef(optBoolStr(expanded))} {...rest}>\n    {@render children?.()}\n  </button>\n{/if}\n",
      "path": "kit/ui/button/Button.svelte",
      "target": "kit/ui/button/Button.svelte"
    },
    {
      "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"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "svelte",
      "primitive"
    ]
  },
  "name": "kit-button",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "svelte",
  "title": "Kit Button",
  "type": "registry:ui"
}
