{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "segmented-control",
  "type": "registry:item",
  "title": "Segmented Control",
  "description": "A row of mutually exclusive options. `options` is `[{ value, label }]`.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "input"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/segmented-control.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/segmented-control.js",
      "content": "// Generated by zubra from segmented-control.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\n\nexport const tag = \"segmented-control\";\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    \"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 (segmented-control) to ([data-zb-slotted=\\\"segmented-control\\\"]) {\\n  :scope { display: inline-block; }\\n  div { display: inline-flex; flex-wrap: wrap; padding: 0.2rem; border-radius: calc(var(--radius, 0.625rem) * 1.12); background: var(--muted, #f3f4f7); gap: 0.2rem; }\\n  button { padding: 0.35rem 0.8rem; border: 0; border-radius: calc(var(--radius, 0.625rem) * 0.8); background: none; color: color-mix(in oklab, var(--muted-foreground, #71717a) 75%, var(--foreground, #18181b)); font: inherit; font-weight: 600; cursor: pointer; }\\n  button:disabled { opacity: 0.55; cursor: not-allowed; }\\n  button[aria-pressed=true] { background: var(--card, #ffffff); color: var(--foreground, #1d2130); box-shadow: 0 1px 2px #0002; }\\n}\\n}\\n\",\n  template: \"\\n  <div role=\\\"group\\\">\\n    <!--[--><!--]-->\\n  </div>\\n\",\n  setup($p, $emit) {\n  function pick(option) {\n    if (option.value === $p.value) return\n    $p.value = option.value\n  }\n    return [\n      { path: [0], attribute: \"aria-label\", value: () => $p.label },\n      { path: [0, 0], each: () => $p.options, key: (option, $index) => $r(option).value, block: { template: \"\\n      <button type=\\\"button\\\"></button>\\n    \", parts: (option, $index) => [{ path: [0], attribute: \"aria-pressed\", value: () => (($r(option).value === $p.value) ? \"true\" : \"false\") }, { path: [0], attribute: \"data-value\", value: () => $r(option).value }, { path: [0], attribute: \"disabled\", boolean: true, value: () => $p.disabled }, { path: [0], on: \"click\", handler: () => (() => pick($r(option))) }, { path: [0], text: () => $t($r(option).label) }] } },\n    ];\n  },\n});\n"
    }
  ]
}
