{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "switch", "type": "registry:ui", "title": "Switch", "files": [ { "path": "ui/switch.tsrx", "type": "registry:ui", "target": "components/ui/switch.tsrx", "content": "// Base UI base switch — runs on the @octanejs/base-ui `Switch` primitive.\n//\n// TWO ATTRIBUTE DIALECTS DIFFER FROM THE RADIX BASE, both verified by rendering the primitive:\n//\n// 1. Checked state. Radix publishes `data-state=\"checked\"`, Base UI publishes bare\n// `data-checked` / `data-unchecked` attributes:\n// radix: `data-[state=checked]:bg-primary`\n// base-ui: `data-checked:bg-primary`\n// Copying the radix form would leave the switch permanently showing its unchecked colours\n// and the thumb never translating — the exact symptom of a wrong-base copy.\n//\n// 2. Disabled. Switch.Root renders a ``, never `:disabled`, so\n// `disabled:` cannot match; the primitive emits `data-disabled` instead.\n//\n// UNVERIFIED PROVENANCE: the non-conditional utilities come from this package's radix base\n// rather than upstream's Base UI source.\nimport { Switch as SwitchPrimitive } from '@octanejs/base-ui/switch';\n\nimport { cn } from '@/lib/utils';\n\nexport interface SwitchProps extends Record {\n\tclassName?: string;\n\tsize?: 'sm' | 'default';\n}\n\nexport function Switch({ className, size = 'default', ...props }: SwitchProps) @{\n\t\n\t\t\n\t\n}\n" } ], "dependencies": [ "@octanejs/base-ui@0.1.33" ], "registryDependencies": [ "@octane/utils" ] }