{
  "$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 setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { buttonClasses } from \"./button.shared\";\nimport { isSetStr, oneOfOr, optBoolStr, orUndef, safeRest, safeUrl } from \"../../utils/expr\";\n\ndefineOptions({ name: \"Button\", inheritAttrs: false });\n\nconst props = withDefaults(defineProps<{\n  type?: \"button\" | \"submit\" | \"reset\";\n  href?: string;\n  disabled?: boolean;\n  pressed?: boolean;\n  expanded?: boolean;\n}>(), { pressed: undefined, expanded: undefined });\n\nconst attrs = useAttrs();\nconst callerClass = computed(() => attrs.class as string | undefined);\nconst restAttrs = computed(() => {\n  const { class: _class, ...restEntries } = attrs;\n  return safeRest(restEntries, { blank: [\"aria-label\", \"aria-pressed\", \"aria-expanded\", \"aria-controls\"] });\n});\nconst cls = computed(() => buttonClasses({ className: callerClass.value }));\n</script>\n\n<template>\n  <a v-if=\"isSetStr(props.href)\" :href=\"orUndef(safeUrl(props.href))\" :class=\"cls || undefined\" :aria-expanded=\"orUndef(optBoolStr(props.expanded))\" :aria-disabled=\"props.disabled ? 'true' : undefined\" :tabindex=\"props.disabled ? -1 : undefined\" v-bind=\"restAttrs\">\n    <slot />\n  </a>\n  <button v-else :type=\"oneOfOr(props.type, 'button', 'submit', 'reset')\" :class=\"cls || undefined\" :disabled=\"props.disabled || undefined\" :aria-pressed=\"orUndef(optBoolStr(props.pressed))\" :aria-expanded=\"orUndef(optBoolStr(props.expanded))\" v-bind=\"restAttrs\">\n    <slot />\n  </button>\n</template>\n",
      "path": "kit/ui/button/Button.vue",
      "target": "kit/ui/button/Button.vue"
    },
    {
      "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": [
      "vue",
      "primitive"
    ]
  },
  "name": "kit-button",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "vue",
  "title": "Kit Button",
  "type": "registry:ui"
}
