{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "radio-group",
  "type": "registry:item",
  "title": "Radio Group",
  "description": "A set of options where one is chosen, on native radio buttons in a <fieldset>: arrow keys move between them, the choice submits under `name`, and `required` validates. `options` is `[{ value, label, description? }]`; `value` is two-way. `orientation=\"horizontal\"` puts them in a row.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "input"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/radio-group.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/radio-group.js",
      "content": "// Generated by zubra from radio-group.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { id } from '@zubra/runtime';\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"radio-group\";\n\nexport default $define(tag, {\n  props: {\n    \"value\": { attribute: \"value\", default: \"\", required: false, model: true },\n    \"options\": { attribute: \"options\", default: [], required: false },\n    \"label\": { attribute: \"label\", default: \"\", required: false },\n    \"name\": { attribute: \"name\", default: \"\", required: false },\n    \"orientation\": { attribute: \"orientation\", default: \"vertical\", required: false },\n    \"required\": { attribute: \"required\", default: false, required: false },\n    \"disabled\": { attribute: \"disabled\", default: false, required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [],\n  events: [\"valuechange\"],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (radio-group) to ([data-zb-slotted=\\\"radio-group\\\"]) {\\n  :scope { display: block; }\\n  fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }\\n  legend { padding: 0; margin-bottom: 0.6rem; font-weight: 600; font-size: 0.925rem; }\\n  .radios-options { display: grid; gap: 0.6rem; }\\n  .radios-horizontal { display: flex; flex-wrap: wrap; gap: 0.6rem 1.25rem; }\\n  label { display: grid; grid-template-columns: auto 1fr; column-gap: 0.65rem; align-items: start; cursor: pointer; }\\n  input { appearance: none; display: grid; place-content: center; width: 1.15rem; height: 1.15rem; margin: 0.15rem 0 0; border: 1px solid var(--input, #a1a1aa); border-radius: 50%; background: var(--background, #fff); cursor: pointer; }\\n  input::before { content: \\\"\\\"; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--primary, #18181b); transform: scale(0); transition: transform var(--duration-fast, 150ms); }\\n  input:checked { border-color: var(--primary, #18181b); }\\n  input:checked::before { transform: scale(1); }\\n  input:focus-visible { outline: 2px solid var(--ring, #a1a1aa); outline-offset: 2px; }\\n  input:disabled { opacity: 0.55; cursor: not-allowed; }\\n  .radios-label { font-weight: 500; }\\n  small { grid-column: 2; color: color-mix(in oklab, var(--muted-foreground, #71717a) 75%, var(--foreground, #18181b)); }\\n  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; } }\\n}\\n}\\n\",\n  template: \"\\n  <fieldset>\\n    <legend></legend>\\n    <div class=\\\"radios-options\\\">\\n      <!--[--><!--]-->\\n    </div>\\n  </fieldset>\\n\",\n  setup($p, $emit) {\n                                                       \n                                     \n\n  // The radios need a shared name to act as one group; a fallback keeps two unnamed groups apart.\n  const fallback = id()\n  const group = __zubraComputed(() => ($p.name || fallback))\n    return [\n      { path: [0], attribute: \"disabled\", boolean: true, value: () => $p.disabled },\n      { path: [0, 0], text: () => $t($p.label) },\n      { path: [0, 1], toggle: \"radios-horizontal\", value: () => ($p.orientation === \"horizontal\") },\n      { path: [0, 1, 0], each: () => $p.options, key: (option, $index) => $r(option).value, block: { template: \"\\n        <label>\\n          <input type=\\\"radio\\\">\\n          <span class=\\\"radios-label\\\"></span>\\n          <!--[--><!--]-->\\n        </label>\\n      \", parts: (option, $index) => [{ path: [0, 0], attribute: \"name\", value: () => $r(group) }, { path: [0, 0], attribute: \"value\", value: () => $r(option).value }, { path: [0, 0], attribute: \"required\", boolean: true, value: () => $p.required }, { path: [0, 0], attribute: \"checked\", boolean: true, value: () => ($r(option).value === $p.value) }, { path: [0, 0], on: \"change\", handler: () => (() => ($p.value = $r(option).value)) }, { path: [0, 1], text: () => $t($r(option).label) }, { path: [0, 2], when: () => $r(option).description, blocks: [{ template: \"<small></small>\", parts: () => [{ path: [0], text: () => $t($r(option).description) }] }, null] }] } },\n    ];\n  },\n});\n"
    }
  ]
}
