{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch",
  "title": "switch",
  "description": "An on/off setting that applies at once. Off, the track takes the input's 3:1 edge colour; on, it fills with the primary colour. size default (36 by 20px) or sm (28 by 16px).",
  "dependencies": [
    "@radix-ui/react-switch@^1",
    "class-variance-authority@^0.7"
  ],
  "registryDependencies": [
    "@dwellir/dwellir-theme",
    "@dwellir/utils"
  ],
  "files": [
    {
      "path": "components/ui/switch.tsx",
      "content": "'use client';\n\nimport * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\nimport { cn } from '@/lib/utils';\n\n/*\n * A setting that applies at once, such as email alerts. Off, the track takes\n * the strong 3:1 edge colour (the calm field edge would leave it faint); on, it fills with the primary colour and the\n * thumb turns to the primary ink, as the Checkbox's check does.\n */\nconst switchVariants = cva(\n  'peer group/switch inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-[background-color] duration-200 outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:outline-destructive data-[state=checked]:bg-primary data-[state=checked]:hover:bg-primary-hover data-[state=unchecked]:bg-input-strong data-[state=unchecked]:hover:bg-muted-foreground motion-reduce:transition-none',\n  {\n    variants: {\n      size: {\n        default: 'h-5 w-9',\n        /* Dense rows, such as a table's settings column. */\n        sm: 'h-4 w-7',\n      },\n    },\n    defaultVariants: { size: 'default' },\n  },\n);\n\nconst switchThumbVariants = cva(\n  'pointer-events-none block rounded-full bg-background shadow-xs transition-transform duration-200 data-[state=checked]:bg-primary-foreground data-[state=unchecked]:translate-x-0 motion-reduce:transition-none',\n  {\n    variants: {\n      size: {\n        default: 'size-4 data-[state=checked]:translate-x-4',\n        sm: 'size-3 data-[state=checked]:translate-x-3',\n      },\n    },\n    defaultVariants: { size: 'default' },\n  },\n);\n\nfunction Switch({\n  className,\n  size,\n  ...props\n}: ComponentProps<typeof SwitchPrimitive.Root> & VariantProps<typeof switchVariants>) {\n  return (\n    <SwitchPrimitive.Root\n      data-slot=\"switch\"\n      data-size={size ?? 'default'}\n      className={cn(switchVariants({ size }), className)}\n      {...props}\n    >\n      <SwitchPrimitive.Thumb data-slot=\"switch-thumb\" className={switchThumbVariants({ size })} />\n    </SwitchPrimitive.Root>\n  );\n}\n\nexport { Switch, switchVariants };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}