{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "title": "Switch",
  "author": "AniBT <https://anibt.net>",
  "description": "AniBT candy switch: a 36x20 sunk track that turns candy, with a white knob that springs across; a 28x16 small size.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "@anibt/theme"
  ],
  "files": [
    {
      "path": "registry/anibt/ui/switch.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Switch as SwitchPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * Switch — A's candy switch (AniBT 「贴纸手账」).\n *\n * A 36×20 track, sunk and ringed off, candy on, with a 16px white knob that\n * springs across. The track carries the state; focus is a 2px `--ring`\n * outline outside it. `size=\"sm\"` is a 28×16 track with a 12px knob for a\n * dense row. Disabled keeps the position readable: the sunk track in both\n * positions and a grey knob — never an opacity wash.\n *\n * The paint is the `anibt-switch` / `anibt-switch-on` recipe spelled out in\n * classes, so the disabled compounds win by order.\n */\nfunction Switch({\n  className,\n  size = \"default\",\n  ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root> & {\n  size?: \"sm\" | \"default\"\n}) {\n  return (\n    <SwitchPrimitive.Root\n      data-slot=\"switch\"\n      data-size={size}\n      className={cn(\n        \"group/switch peer relative inline-flex shrink-0 items-center rounded-full bg-muted p-0.5 shadow-[inset_0_0_0_1.5px_var(--input)] outline-hidden transition-[background-color,box-shadow] duration-200 after:absolute after:-inset-x-2 after:-inset-y-2\",\n        \"data-[size=default]:h-5 data-[size=default]:w-9 data-[size=sm]:h-4 data-[size=sm]:w-7\",\n        \"enabled:hover:data-[state=unchecked]:shadow-[inset_0_0_0_1.5px_var(--anibt-wash-line)]\",\n        \"data-[state=checked]:bg-anibt-candy-edge data-[state=checked]:bg-(image:--anibt-candy) data-[state=checked]:shadow-[0_1px_0_var(--anibt-candy-edge)]\",\n        \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid\",\n        \"aria-invalid:outline-2 aria-invalid:outline-offset-2 aria-invalid:outline-anibt-danger-fill aria-invalid:outline-solid\",\n        \"disabled:cursor-not-allowed disabled:shadow-[inset_0_0_0_1.5px_var(--border)] disabled:data-[state=checked]:bg-anibt-deep2 disabled:data-[state=checked]:bg-none disabled:data-[state=checked]:shadow-[inset_0_0_0_1.5px_var(--border)]\",\n        className\n      )}\n      {...props}\n    >\n      <SwitchPrimitive.Thumb\n        data-slot=\"switch-thumb\"\n        className={cn(\n          \"pointer-events-none block rounded-full bg-white shadow-(--anibt-shadow-sticker) transition-transform duration-[350ms] ease-anibt-spring\",\n          \"group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3\",\n          \"data-[state=unchecked]:translate-x-0 group-data-[size=default]/switch:data-[state=checked]:translate-x-4 group-data-[size=sm]/switch:data-[state=checked]:translate-x-3\",\n          \"group-disabled/switch:bg-input group-disabled/switch:shadow-none\"\n        )}\n      />\n    </SwitchPrimitive.Root>\n  )\n}\n\nexport { Switch }\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "forms"
  ],
  "type": "registry:ui"
}