{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "title": "Ninaero toggle",
  "dependencies": [
    "@base-ui/react@^1.9.0",
    "class-variance-authority@^0.7.1",
    "cn@^0.4.0"
  ],
  "registryDependencies": [
    "https://ninaero.pages.dev/r/theme.json",
    "https://ninaero.pages.dev/r/sound-provider.json"
  ],
  "files": [
    {
      "path": "registry/ninaero/ui/toggle.tsx",
      "content": "\"use client\";\n\nimport { Toggle as TogglePrimitive } from \"@base-ui/react/toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"cn\";\n\nimport { useControlSound, HoverSound } from \"./sound-feedback\";\n\nconst toggleVariants = cva(\n  \"ninaero-toggle group/toggle inline-flex items-center justify-center gap-1 text-sm type-label whitespace-nowrap select-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      variant: {\n        default: \"\",\n        outline: \"ninaero-toggle--outline\",\n      },\n      size: {\n        default:\n          \"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n        sm: \"h-7 min-w-7 [--toggle-corner:0.75rem] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n        lg: \"h-9 min-w-9 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\nfunction Toggle({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  onPressedChange,\n  sound = true,\n  ...props\n}: TogglePrimitive.Props & VariantProps<typeof toggleVariants> & { sound?: boolean }) {\n  const { play } = useControlSound(sound);\n  return (\n    <HoverSound sound={sound}>\n      <TogglePrimitive\n        data-slot=\"toggle\"\n        className={cn(toggleVariants({ variant, size, className }))}\n        {...props}\n        onPressedChange={(pressed, details) => {\n          onPressedChange?.(pressed, details);\n          if (sound && !details.isCanceled) play(pressed ? \"on\" : \"off\");\n        }}\n      />\n    </HoverSound>\n  );\n}\n\nexport { Toggle, toggleVariants };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}