{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch-14",
  "title": "Wide labelled switch",
  "description": "A wide rounded square switch that reads On or Off on the free half.",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/switch/switch-14.tsx",
      "content": "import { Switch as SwitchPrimitive } from '@base-ui/react/switch';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nconst TRACK = [\n  'group/switch relative inline-grid h-8 shrink-0 cursor-pointer grid-cols-2 items-center rounded-lg bg-foreground/15 p-0.5 outline-none transition-colors duration-200',\n  'data-checked:bg-primary focus-visible:ring-[3px] focus-visible:ring-ring/25 data-disabled:cursor-not-allowed data-disabled:opacity-50',\n].join(' ');\n\nconst THUMB = [\n  'pointer-events-none absolute inset-y-0.5 start-0.5 w-[calc(50%-2px)] rounded-md bg-white shadow-[0_1px_2px_rgb(0_0_0/0.2),0_0_0_var(--hairline)_rgb(0_0_0/0.04)]',\n  'transition-[translate] duration-300 ease-(--ease-out-quint) data-checked:translate-x-full',\n].join(' ');\n\nconst STATE_TEXT =\n  'pointer-events-none flex h-full w-9 items-center justify-center text-[11px] font-medium uppercase transition-opacity duration-200';\n\nexport default function Switch14() {\n  return (\n    <SwitchPrimitive.Root\n      defaultChecked\n      aria-label='Auto-renew'\n      className={TRACK}\n    >\n      <SwitchPrimitive.Thumb className={THUMB} />\n      <span\n        aria-hidden='true'\n        className={cn(\n          STATE_TEXT,\n          'text-primary-foreground opacity-0 group-data-checked/switch:opacity-100'\n        )}\n      >\n        On\n      </span>\n      <span\n        aria-hidden='true'\n        className={cn(\n          STATE_TEXT,\n          'text-muted-foreground group-data-checked/switch:opacity-0'\n        )}\n      >\n        Off\n      </span>\n    </SwitchPrimitive.Root>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "components",
    "switch"
  ],
  "type": "registry:component"
}