{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "title": "Toggle",
  "description": "A two-state pressable button with default and primary variants.",
  "dependencies": [
    "@base-ui/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://ui.ask.mir-ai.it/r/utils.json"
  ],
  "files": [
    {
      "path": "src/registry/ask-ui/components/ui/toggle/toggle.tsx",
      "content": "import { Toggle as TogglePrimitive } from \"@base-ui/react/toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/registry/ask-ui/lib/utils\";\n\nconst toggleVariants = cva(\n  \"group/toggle inline-flex items-center justify-center gap-1.5 rounded-md border text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      variant: {\n        // `bg-secondary`/`text-secondary-foreground` on press, not red:\n        // Figma's updated Toggle frame (2658:8591) is neutral-only across\n        // every type it shows (default/outline/ghost) — --color/secondary\n        // (#f4f4f5) and --color/secondary-foreground (#27272a) map exactly\n        // to our --secondary (ask-neutral-100, L≈0.967) and\n        // --secondary-foreground (ask-neutral-800, L≈0.274) tokens. This\n        // supersedes an earlier ad-hoc request to make `default` pressed\n        // red — no Figma evidence for that once this frame surfaced.\n        default:\n          \"border-input bg-background hover:bg-muted/50 hover:text-foreground aria-pressed:bg-secondary aria-pressed:text-secondary-foreground\",\n        // `primary` isn't in the new neutral-only frame at all — kept as\n        // the solid brand-red press state, still grounded in the separate\n        // \"AI toggle\" frame (2072:19617) that this update doesn't touch.\n        primary:\n          \"border-input bg-background hover:bg-accent hover:text-accent-foreground aria-pressed:border-destructive aria-pressed:bg-primary aria-pressed:text-primary-foreground\",\n        // Same hover/pressed treatment as `primary` (red tint on hover,\n        // solid red fill on press) but never shows a border in any state —\n        // `border-transparent`, not just an absent border color, so the box\n        // size stays identical to the bordered variants (no layout shift).\n        ghost:\n          \"border-transparent bg-transparent hover:bg-accent hover:text-accent-foreground aria-pressed:bg-primary aria-pressed:text-primary-foreground\",\n      },\n      size: {\n        default:\n          \"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n        sm: \"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5\",\n        lg: \"h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n);\n\n/**\n * A two-state pressable button. `default` fills neutral gray when pressed\n * (Figma 2658:8591); `variant=\"primary\"` fills solid brand-red instead and\n * tints its unpressed hover state red too; `variant=\"ghost\"` is `primary`'s\n * same red hover/press colors without ever showing a border. `default` and\n * `primary` keep a visible border in every state, unlike shadcn's stock\n * borderless default.\n */\nfunction Toggle({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  ...props\n}: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {\n  return (\n    <TogglePrimitive\n      data-slot=\"toggle\"\n      className={cn(toggleVariants({ variant, size, className }))}\n      {...props}\n    />\n  );\n}\n\nexport { Toggle };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}