{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle-group",
  "type": "registry:component",
  "title": "Toggle Group",
  "description": "Group of toggle buttons for single or multiple selection.",
  "dependencies": [
    "@vllnt/ui@^0.2.1"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/toggle-group/toggle-group.tsx",
      "content": "\"use client\";\n\nimport { createContext, forwardRef, useContext, useMemo } from \"react\";\n\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport type { VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@vllnt/ui\";\nimport { toggleVariants } from \"@vllnt/ui\";\n\nconst ToggleGroupContext = createContext<VariantProps<typeof toggleVariants>>({\n  size: \"default\",\n  variant: \"default\",\n});\n\nconst ToggleGroup = forwardRef<\n  React.ComponentRef<typeof ToggleGroupPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n    VariantProps<typeof toggleVariants>\n>(({ children, className, size, variant, ...props }, ref) => {\n  const contextValue = useMemo(() => ({ size, variant }), [size, variant]);\n\n  return (\n    <ToggleGroupPrimitive.Root\n      className={cn(\"flex items-center justify-center gap-1\", className)}\n      ref={ref}\n      {...props}\n    >\n      <ToggleGroupContext.Provider value={contextValue}>\n        {children}\n      </ToggleGroupContext.Provider>\n    </ToggleGroupPrimitive.Root>\n  );\n});\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = forwardRef<\n  React.ComponentRef<typeof ToggleGroupPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n    VariantProps<typeof toggleVariants>\n>(({ children, className, size, variant, ...props }, ref) => {\n  const context = useContext(ToggleGroupContext);\n\n  return (\n    <ToggleGroupPrimitive.Item\n      className={cn(\n        toggleVariants({\n          size: context.size ?? size,\n          variant: context.variant ?? variant,\n        }),\n        className,\n      )}\n      ref={ref}\n      {...props}\n    >\n      {children}\n    </ToggleGroupPrimitive.Item>\n  );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n",
      "type": "registry:component"
    }
  ],
  "version": "0.2.1",
  "stability": "stable"
}
