{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle-group",
  "title": "Toggle Group",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-react/components/toggle-group/toggle-group.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group'\nimport { cn } from '@/lib/utils'\nimport { toggleVariants, type ToggleVariants } from '../toggle/toggle.variants'\n\n// Make variant/size/spacing reachable from items without each consumer having\n// to pass it manually — the React equivalent of the Vue provide('toggleGroup').\ntype ToggleGroupContextValue = {\n  variant?: ToggleVariants['variant']\n  size?: ToggleVariants['size']\n  spacing?: number\n}\n\nconst ToggleGroupContext = React.createContext<ToggleGroupContextValue>({})\n\nexport type ToggleGroupProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n  ToggleVariants & {\n    spacing?: number\n  }\n\nconst ToggleGroup = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Root>, ToggleGroupProps>(\n  ({ className, variant, size, spacing = 0, children, ...props }, ref) => (\n    <ToggleGroupPrimitive.Root\n      ref={ref}\n      data-uipkge=\"\"\n      data-slot=\"toggle-group\"\n      data-size={size}\n      data-variant={variant}\n      data-spacing={spacing}\n      style={{ '--gap': spacing } as React.CSSProperties}\n      className={cn(\n        'group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs',\n        className,\n      )}\n      {...props}\n    >\n      <ToggleGroupContext.Provider value={{ variant, size, spacing }}>{children}</ToggleGroupContext.Provider>\n    </ToggleGroupPrimitive.Root>\n  ),\n)\nToggleGroup.displayName = 'ToggleGroup'\n\nexport type ToggleGroupItemProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & ToggleVariants\n\nconst ToggleGroupItem = React.forwardRef<React.ElementRef<typeof ToggleGroupPrimitive.Item>, ToggleGroupItemProps>(\n  ({ className, variant, size, children, ...props }, ref) => {\n    const context = React.useContext(ToggleGroupContext)\n    return (\n      <ToggleGroupPrimitive.Item\n        ref={ref}\n        data-uipkge=\"\"\n        data-slot=\"toggle-group-item\"\n        data-variant={context.variant || variant}\n        data-size={context.size || size}\n        data-spacing={context.spacing}\n        className={cn(\n          toggleVariants({\n            variant: context.variant || variant,\n            size: context.size || size,\n          }),\n          'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10',\n          'data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l',\n          className,\n        )}\n        {...props}\n      >\n        {children}\n      </ToggleGroupPrimitive.Item>\n    )\n  },\n)\nToggleGroupItem.displayName = 'ToggleGroupItem'\n\nexport { ToggleGroup, ToggleGroupItem }\n",
      "type": "registry:ui",
      "target": "~/components/ui/toggle-group/toggle-group.tsx"
    },
    {
      "path": "packages/registry-react/components/toggle-group/index.ts",
      "content": "export { ToggleGroup, ToggleGroupItem, type ToggleGroupProps, type ToggleGroupItemProps } from './toggle-group'\n",
      "type": "registry:ui",
      "target": "~/components/ui/toggle-group/index.ts"
    }
  ],
  "dependencies": [
    "class-variance-authority",
    "@radix-ui/react-toggle-group"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/toggle.json"
  ],
  "description": "Group of `Toggle` buttons that act as a single-select or multi-select control. Use for view-mode pickers (grid/list), text-format toolbars, and any \"pick one of N\" button bar.",
  "categories": [
    "action"
  ]
}