{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "dependencies": [
    "react-aria-components",
    "tailwind-variants"
  ],
  "registryDependencies": [
    "https://taki-ui.com/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/switch.tsx",
      "content": "\"use client\"\n\nimport React from \"react\"\nimport {\n  Switch as AriaSwitch,\n  SwitchProps as AriaSwitchProps,\n  composeRenderProps,\n} from \"react-aria-components\"\nimport { tv } from \"tailwind-variants\"\n\nimport { cn } from \"../lib/utils\"\n\nexport interface SwitchProps extends Omit<AriaSwitchProps, \"children\"> {\n  children: React.ReactNode\n}\n\nconst track = tv({\n  base: \"inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none\",\n  variants: {\n    isSelected: {\n      false: \"bg-input dark:bg-input/80\",\n      true: \"bg-primary\",\n    },\n    isFocusVisible: {\n      true: \"border-ring ring-ring/50 ring-[3px]\",\n    },\n    isDisabled: {\n      true: \"cursor-not-allowed opacity-50\",\n      false: \"cursor-default\",\n    },\n  },\n})\n\nconst handle = tv({\n  base: \"pointer-events-none block size-4 rounded-full ring-0 transition-transform\",\n  variants: {\n    isSelected: {\n      false: \"translate-x-0 bg-background dark:bg-foreground\",\n      true: \"translate-x-[calc(100%-2px)] bg-background dark:bg-primary-foreground\",\n    },\n  },\n})\n\nexport function Switch({ children, ...props }: SwitchProps) {\n  return (\n    <AriaSwitch\n      {...props}\n      className={composeRenderProps(props.className, (className) =>\n        cn(\n          \"group relative flex items-center gap-2 text-sm transition disabled:cursor-not-allowed\",\n          className\n        )\n      )}\n    >\n      {(renderProps) => (\n        <>\n          <div className={track(renderProps)}>\n            <span className={handle(renderProps)} />\n          </div>\n          {children}\n        </>\n      )}\n    </AriaSwitch>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}