"use client"; import * as React from "react"; import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"; import { cn } from "@/lib/utils"; /** * Context carries the variant/size from the root down to each item so items * pick up consistent styling without the consumer passing props twice. */ interface ToggleGroupContextValue { size: "default" | "sm" | "lg"; variant: "default" | "outline"; } const ToggleGroupContext = React.createContext({ size: "default", variant: "default", }); const ToggleGroup = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & Partial >( ( { className, variant = "default", size = "default", children, ...props }, ref, ) => ( {children} ), ); ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName; const ToggleGroupItem = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( {children} )); ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName; export { ToggleGroup, ToggleGroupItem };