{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"toggle","title":"Toggle","author":"brijr","description":"A two-state button, built on UI SDK.","dependencies":["@ui-sdk/react","@ui-sdk/core","class-variance-authority","cn"],"files":[{"path":"components/ui/toggle.tsx","content":"import * as React from \"react\"\nimport { Toggle as TogglePrimitive } from \"@ui-sdk/react/toggle\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"cn\"\n\nconst toggleVariants = cva(\n  \"relative inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap transition outline-none not-data-disabled:hover:bg-muted not-data-disabled:hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:ring-destructive/60 data-pressed:bg-foreground/10 data-pressed:text-foreground dark:data-pressed:bg-foreground/15 pointer-coarse:after:absolute data-disabled:cursor-not-allowed data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-transparent\",\n        outline:\n          \"border border-input bg-transparent shadow-(--elevation-control) not-data-disabled:hover:bg-muted not-data-disabled:hover:text-foreground dark:bg-input/30 dark:not-data-disabled:hover:bg-input/50\",\n      },\n      size: {\n        default: \"h-9 min-w-9 px-2.5 pointer-coarse:after:-inset-1.25\",\n        sm: \"h-8 min-w-8 px-2 pointer-coarse:after:-inset-1.75\",\n        lg: \"h-10 min-w-10 px-3 pointer-coarse:after:-inset-0.75\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\n// A toggle is a button, so it submits nothing: `name` is left out of the props\n// on purpose. To submit pressed values, use a ToggleGroup with a `name`.\nfunction Toggle({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  ...props\n}: Omit<React.ComponentProps<typeof TogglePrimitive>, \"className\" | \"name\"> &\n  VariantProps<typeof toggleVariants> & { className?: string }) {\n  return (\n    <TogglePrimitive\n      className={cn(toggleVariants({ variant, size }), className)}\n      {...props}\n    />\n  )\n}\n\nexport { Toggle, toggleVariants }\n","type":"registry:ui"}],"type":"registry:ui"}