{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comp-180",
  "type": "registry:component",
  "title": "Comp 180",
  "description": "Comp 180",
  "files": [
    {
      "path": "registry/ui-basic/comp-180.tsx",
      "content": "\"use client\";\n\nimport { useId, useState } from \"react\";\n\nimport { Switch } from \"@/components/ui/switch\";\n\nexport default function Component() {\n\tconst id = useId();\n\tconst [checked, setChecked] = useState(false);\n\n\tconst toggleSwitch = () => setChecked((prev) => !prev);\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"group inline-flex items-center gap-2\"\n\t\t\tdata-state={checked ? \"checked\" : \"unchecked\"}\n\t\t>\n\t\t\t<span\n\t\t\t\tid={`${id}-off`}\n\t\t\t\tclassName=\"group-data-[state=checked]:text-muted-foreground/70 flex-1 cursor-pointer text-right text-sm font-medium\"\n\t\t\t\taria-controls={id}\n\t\t\t\tonClick={() => setChecked(false)}\n\t\t\t>\n\t\t\t\tOff\n\t\t\t</span>\n\t\t\t<Switch\n\t\t\t\tid={id}\n\t\t\t\tchecked={checked}\n\t\t\t\tonCheckedChange={toggleSwitch}\n\t\t\t\taria-labelledby={`${id}-off ${id}-on`}\n\t\t\t/>\n\t\t\t<span\n\t\t\t\tid={`${id}-on`}\n\t\t\t\tclassName=\"group-data-[state=unchecked]:text-muted-foreground/70 flex-1 cursor-pointer text-left text-sm font-medium\"\n\t\t\t\taria-controls={id}\n\t\t\t\tonClick={() => setChecked(true)}\n\t\t\t>\n\t\t\t\tOn\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/switch.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\r\n\r\nconst Switch = React.forwardRef<\r\n\tReact.ElementRef<typeof SwitchPrimitives.Root>,\r\n\tReact.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\r\n>(({ className, ...props }, ref) => (\r\n\t<SwitchPrimitives.Root\r\n\t\tclassName={cn(\r\n\t\t\t\"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\r\n\t\t\tclassName\r\n\t\t)}\r\n\t\t{...props}\r\n\t\tref={ref}\r\n\t>\r\n\t\t<SwitchPrimitives.Thumb\r\n\t\t\tclassName={cn(\r\n\t\t\t\t\"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\r\n\t\t\t)}\r\n\t\t/>\r\n\t</SwitchPrimitives.Root>\r\n));\r\nSwitch.displayName = SwitchPrimitives.Root.displayName;\r\n\r\nexport { Switch };\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    }
  ]
}