{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "title": "Switch",
  "description": "A block that slides across a cut track and lights, with its state printed beside it.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/switch.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Switch as SdkSwitch, SwitchThumb } from \"@ui-sdk/react/switch\"\nimport \"@/registry/cyber/ui/cyber/switch.css\"\n\n// A two-state latch: a block that slides across a cut track and lights when\n// it lands. The row is a label, so the text toggles it too, and its state is\n// printed beside it (ON or OFF) so it never rests on color alone.\nfunction Switch({\n  label,\n  ...props\n}: Omit<React.ComponentProps<typeof SdkSwitch>, \"children\"> & { label: string }) {\n  return (\n    <label data-kit=\"switch-row\">\n      <span data-kit=\"label\">{label}</span>\n      <SdkSwitch data-kit=\"switch\" data-frame=\"tl br\" {...props}>\n        <SwitchThumb data-kit=\"switch-thumb\" data-frame=\"tl br\" />\n        <span data-kit=\"switch-state\" aria-hidden />\n      </SdkSwitch>\n    </label>\n  )\n}\n\nexport { Switch }\n",
      "type": "registry:ui",
      "target": "@ui/switch.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/switch.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  [data-skin=\"cyber\"] [data-kit=\"switch-row\"] {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 16px;\n    width: 100%;\n    min-height: var(--cy-h);\n    cursor: pointer;\n\n    &:has([data-disabled]) {\n      cursor: not-allowed;\n\n      & [data-kit=\"label\"] {\n        color: var(--cy-ink-mute);\n      }\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"switch\"] {\n    --frame-cut: 5px;\n    --frame-line: var(--cy-line-ctl);\n    --frame-fill: var(--cy-panel);\n    --w: 58px;\n    --thumb: 20px;\n\n    flex: none;\n    display: block;\n    width: var(--w);\n    height: 24px;\n    padding: 0;\n    cursor: inherit;\n    transition:\n      background-color var(--cy-t) var(--cy-ease-snap),\n      border-color var(--cy-t) var(--cy-ease-snap);\n\n    @media (hover: hover) {\n      &:hover:not([data-disabled]) {\n        --frame-line: var(--cy-line-hot);\n        --frame-fill: var(--cy-fill-hover);\n      }\n    }\n\n    &[data-checked] {\n      --frame-line: var(--cy-line-hot);\n      --frame-fill: var(--cy-fill-active);\n    }\n\n    &[data-disabled] {\n      --frame-line: var(--cy-line-deco);\n      --frame-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--cy-line-deco) 5px 6px);\n    }\n  }\n\n  /* The block. Hollow while off, solid and lit while on. */\n  [data-skin=\"cyber\"] [data-kit=\"switch-thumb\"] {\n    --frame-cut: 4px;\n    --frame-line: var(--cy-line-ctl);\n    --frame-fill: transparent;\n    --frame-image: none;\n\n    position: absolute;\n    inset-block: 3px;\n    inset-inline-start: 3px;\n    width: var(--thumb);\n    transition:\n      translate var(--cy-t) var(--cy-ease-snap),\n      background-color var(--cy-t-fast) linear;\n\n    &[data-checked] {\n      translate: calc(var(--w) - var(--thumb) - 8px) 0;\n      --frame-line: var(--cy-ink-hi);\n      --frame-fill: var(--cy-ink-hi);\n    }\n\n    &[data-disabled] {\n      --frame-line: var(--cy-line-deco);\n    }\n\n    &:dir(rtl)[data-checked] {\n      translate: calc((var(--w) - var(--thumb) - 8px) * -1) 0;\n    }\n  }\n\n  /* ON / OFF, printed in the half of the track the block isn't in. */\n  [data-skin=\"cyber\"] [data-kit=\"switch-state\"] {\n    position: absolute;\n    inset-block: 0;\n    inset-inline-end: 5px;\n    display: grid;\n    place-items: center;\n    font-family: var(--cy-mono);\n    font-size: 9px;\n    font-weight: 500;\n    letter-spacing: 0.04em;\n    color: var(--cy-ink-mute);\n\n    &::before {\n      content: \"OFF\";\n    }\n\n    [data-checked] > & {\n      inset-inline: 6px auto;\n      color: var(--cy-ink-hi);\n\n      &::before {\n        content: \"ON\";\n      }\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/switch.css"
    }
  ],
  "type": "registry:ui"
}
