{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "check-box",
  "type": "registry:item",
  "title": "Check Box",
  "description": "A checkbox with a label and an optional description, on a native <input type=\"checkbox\">: it submits `value` under its `name` when checked, takes `required`, and the whole label is the target. `indeterminate` shows the mixed state (for a \"select all\" over a partial selection). `checked` is two-way.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "input"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/check-box.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/check-box.js",
      "content": "// Generated by zubra from check-box.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { effect, id } from '@zubra/runtime';\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"check-box\";\n\nexport default $define(tag, {\n  props: {\n    \"checked\": { attribute: \"checked\", default: false, required: false, model: true },\n    \"indeterminate\": { attribute: \"indeterminate\", default: false, required: false },\n    \"label\": { attribute: \"label\", default: \"\", required: false },\n    \"description\": { attribute: \"description\", default: \"\", required: false },\n    \"name\": { attribute: \"name\", default: \"\", required: false },\n    \"value\": { attribute: \"value\", default: \"on\", 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: [\"checkedchange\"],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (check-box) to ([data-zb-slotted=\\\"check-box\\\"]) {\\n  :scope { display: block; }\\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: calc(var(--radius, 0.625rem) * 0.48); background: var(--background, #fff); cursor: pointer; transition: background var(--duration-fast, 150ms), border-color var(--duration-fast, 150ms); }\\n  input::before { content: \\\"\\\"; width: 0.65rem; height: 0.65rem; background: var(--primary-foreground, #fafafa); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transform: scale(0); transition: transform var(--duration-fast, 150ms); }\\n  input:checked, input:indeterminate { border-color: var(--primary, #18181b); background: var(--primary, #18181b); }\\n  input:checked::before { transform: scale(1); }\\n  input:indeterminate::before { clip-path: inset(40% 5%); transform: scale(1); }\\n  input:focus-visible { outline: 2px solid var(--ring, #a1a1aa); outline-offset: 2px; }\\n  input:disabled, input:disabled + .checkbox-text { opacity: 0.55; cursor: not-allowed; }\\n  .checkbox-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  <label>\\n    <input type=\\\"checkbox\\\">\\n    <span class=\\\"checkbox-text\\\"><span class=\\\"checkbox-label\\\"></span></span>\\n    <!--[--><!--]-->\\n  </label>\\n\",\n  setup($p, $emit) {\nfunction __zubraAssign(signal, value) { signal.set(value); return value }\nfunction __zubraUpdate(signal, delta, prefix) { const old = signal.get(); signal.set(old + delta); return prefix ? old + delta : old }\n                                             \n\n  const helpId = id()\n  const box = __zubraState(null)\n  // `indeterminate` is a property of the input, never an attribute.\n  effect(() => {\n    if (box.get()) box.get().indeterminate = $p.indeterminate\n  })\n  function change(event) {\n    $p.checked = event.target.checked\n    $p.indeterminate = false\n  }\n    return [\n      { path: [0, 0], ref: () => (($el) => (__zubraAssign(box, $el))) },\n      { path: [0, 0], attribute: \"name\", value: () => ($p.name || null) },\n      { path: [0, 0], attribute: \"value\", value: () => $p.value },\n      { path: [0, 0], attribute: \"required\", boolean: true, value: () => $p.required },\n      { path: [0, 0], attribute: \"disabled\", boolean: true, value: () => $p.disabled },\n      { path: [0, 0], attribute: \"checked\", boolean: true, value: () => $p.checked },\n      { path: [0, 0], attribute: \"aria-describedby\", value: () => ($p.description ? $r(helpId) : null) },\n      { path: [0, 0], on: \"change\", handler: () => $r(change) },\n      { path: [0, 1, 0], text: () => $t($p.label) },\n      { path: [0, 2], when: () => $p.description, blocks: [{ template: \"<small></small>\", parts: () => [{ path: [0], attribute: \"id\", value: () => $r(helpId) }, { path: [0], text: () => $t($p.description) }] }, null] },\n    ];\n  },\n});\n"
    }
  ]
}
