{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "title": "Toggle",
  "description": "Two-state buttons that sink in when on and ping on press.",
  "dependencies": [
    "class-variance-authority",
    "radix-ui"
  ],
  "registryDependencies": [
    "utils",
    "https://ui.cuelark.com/r/theme.json",
    "https://ui.cuelark.com/r/motion.json"
  ],
  "files": [
    {
      "path": "src/registry/cuelark/ui/toggle.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Toggle as TogglePrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cuePing } from \"@/lib/motion\";\nimport { cn } from \"@/lib/utils\";\n\nconst toggleVariants = cva(\n  \"relative isolate inline-flex items-center justify-center gap-2 overflow-hidden rounded-md text-sm font-medium whitespace-nowrap outline-none transition-[background-color,color,box-shadow] duration-150 ease-cue hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:shadow-pressed [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      variant: {\n        ghost: \"bg-transparent text-muted-foreground\",\n        outline: \"border border-input bg-transparent text-muted-foreground shadow-control data-[state=on]:border-primary/30\",\n      },\n      size: {\n        sm: \"h-ctl-sm min-w-ctl-sm px-2\",\n        md: \"h-ctl-md min-w-ctl-md px-2.5\",\n        lg: \"h-ctl-lg min-w-ctl-lg px-3\",\n      },\n    },\n    defaultVariants: { variant: \"ghost\", size: \"md\" },\n  },\n);\n\n/** A two-state button; it sinks into the surface when on and pings on press. */\nfunction Toggle({ className, variant = \"ghost\", size = \"md\", onPointerDown, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {\n  return (\n    <TogglePrimitive.Root\n      data-slot=\"toggle\"\n      className={cn(toggleVariants({ variant, size }), className)}\n      onPointerDown={(e) => {\n        onPointerDown?.(e);\n        if (!e.defaultPrevented) cuePing(e.currentTarget, e);\n      }}\n      {...props}\n    />\n  );\n}\n\nexport { Toggle, toggleVariants };\n",
      "type": "registry:ui"
    }
  ],
  "docs": "Docs and examples: https://ui.cuelark.com/components/toggle",
  "categories": [
    "forms"
  ],
  "type": "registry:ui"
}