import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"; import { toggleVariants } from "@repo/shadcn-ui/components/toggle"; import { cn } from "@repo/shadcn-ui/lib/utils"; import type { VariantProps } from "class-variance-authority"; import * as React from "react"; const ToggleGroupContext = React.createContext< VariantProps & { spacing?: number; orientation?: "horizontal" | "vertical"; } >({ size: "default", variant: "default", spacing: 0, orientation: "horizontal", }); const ToggleGroup = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & VariantProps & { spacing?: number; } >(({ className, variant, size, spacing = 0, children, style, ...props }, ref) => { const orientation = props.orientation ?? "horizontal"; return ( {children} ); }); ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName; const ToggleGroupItem = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & VariantProps >(({ className, children, variant, size, ...props }, ref) => { const context = React.useContext(ToggleGroupContext); return ( {children} ); }); ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName; export { ToggleGroup, ToggleGroupItem };