{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "description": "switch (ui)",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/default/ui/switch.tsx",
      "content": "\"use client\";\n\nimport { Switch as SwitchPrimitive } from \"@base-ui/react/switch\";\nimport type React from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\nconst ease = \"ease-[cubic-bezier(0.2,0,0,1)]\";\n\nexport interface SwitchProps extends SwitchPrimitive.Root.Props {\n  icons?: \"checked\" | \"both\";\n  size?: \"sm\" | \"default\" | \"lg\";\n}\n\nexport function Switch({\n  className,\n  icons,\n  size = \"default\",\n  ...props\n}: SwitchProps): React.ReactElement {\n  return (\n    <SwitchPrimitive.Root\n      className={cn(\n        \"group/switch relative isolate inline-flex h-(--h) w-[calc(var(--h)*1.625)] shrink-0 cursor-pointer items-center rounded-full bg-[color-mix(in_oklab,var(--color-background),var(--color-foreground)_8%)] outline-none\",\n        \"before:absolute before:inset-0 before:rounded-full before:bg-primary before:opacity-0 before:transition-opacity before:duration-200 data-checked:before:opacity-100 motion-reduce:before:transition-none\",\n        \"inset-ring-2 inset-ring-[color-mix(in_oklab,var(--color-background),var(--color-muted-foreground)_60%)] data-checked:inset-ring-transparent\",\n        \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-2\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n        \"data-disabled:cursor-not-allowed data-disabled:opacity-38\",\n        size === \"sm\" && \"[--h:--spacing(6)]\",\n        size === \"default\" && \"[--h:--spacing(8)]\",\n        size === \"lg\" && \"[--h:--spacing(10)]\",\n        ease,\n        className,\n      )}\n      data-slot=\"switch\"\n      {...props}\n    >\n      <SwitchPrimitive.Thumb\n        className={cn(\n          \"group/thumb pointer-events-none relative grid aspect-square h-full place-items-center rounded-full\",\n          \"[transition:translate_280ms_cubic-bezier(0.2,0,0,1)] motion-reduce:transition-none\",\n          \"data-checked:translate-x-[calc(var(--h)*0.625)]\",\n          \"[--disc:0.5] data-checked:[--disc:0.75]\",\n          icons === \"both\" && \"data-unchecked:[--disc:0.75]\",\n          \"group-active/switch:not-group-data-disabled/switch:[--disc-active:0.875]\",\n          \"in-[[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:[--disc-active:0.875]\",\n          \"before:absolute before:-inset-[12.5%] before:rounded-full before:bg-foreground before:opacity-0 before:transition-opacity before:duration-150\",\n          \"group-hover/switch:before:opacity-8 group-focus-visible/switch:before:opacity-10\",\n          \"group-active/switch:not-group-data-disabled/switch:before:opacity-12\",\n          \"data-checked:before:bg-primary group-data-disabled/switch:before:hidden\",\n        )}\n        data-slot=\"switch-thumb\"\n      >\n        <span\n          aria-hidden=\"true\"\n          className={cn(\n            \"absolute inset-0 rounded-full bg-muted-foreground\",\n            \"scale-(--disc-active,var(--disc))\",\n            \"transition-[scale] duration-280 motion-reduce:transition-none\",\n            \"group-data-checked/thumb:bg-primary-foreground\",\n            \"group-active/switch:not-group-data-disabled/switch:duration-150\",\n            ease,\n          )}\n        />\n\n        {icons && (\n          <span className=\"relative z-10 grid size-1/2 place-items-center\">\n            <svg\n              aria-hidden=\"true\"\n              className={cn(\n                \"col-start-1 row-start-1 size-full fill-primary opacity-0 transition-[opacity,rotate] duration-200 group-data-checked/thumb:opacity-100 motion-reduce:transition-none\",\n                icons === \"checked\" &&\n                  \"-rotate-45 group-data-checked/thumb:rotate-0\",\n                ease,\n              )}\n              viewBox=\"0 0 24 24\"\n            >\n              <path d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n            </svg>\n            {icons === \"both\" && (\n              <svg\n                aria-hidden=\"true\"\n                className=\"col-start-1 row-start-1 size-full fill-background transition-opacity duration-150 group-data-checked/thumb:opacity-0 motion-reduce:transition-none\"\n                viewBox=\"0 0 24 24\"\n              >\n                <path d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n              </svg>\n            )}\n          </span>\n        )}\n      </SwitchPrimitive.Thumb>\n    </SwitchPrimitive.Root>\n  );\n}\n\nexport { SwitchPrimitive };\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}