({
className,
children,
variant,
size,
...props
}: TogglePrimitive.Props & VariantProps<typeof toggleVariants>)
| 55 | } |
| 56 | |
| 57 | function Toggle({ |
| 58 | className, |
| 59 | children, |
| 60 | variant, |
| 61 | size, |
| 62 | ...props |
| 63 | }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) { |
| 64 | const context = React.useContext(ToggleGroupContext); |
| 65 | |
| 66 | const resolvedVariant = context.variant || variant; |
| 67 | const resolvedSize = context.size || size; |
| 68 | |
| 69 | return ( |
| 70 | <ToggleComponent |
| 71 | className={className} |
| 72 | data-size={resolvedSize} |
| 73 | data-variant={resolvedVariant} |
| 74 | size={resolvedSize} |
| 75 | variant={resolvedVariant} |
| 76 | {...props} |
| 77 | > |
| 78 | {children} |
| 79 | </ToggleComponent> |
| 80 | ); |
| 81 | } |
| 82 | |
| 83 | function ToggleGroupSeparator({ |
| 84 | className, |
nothing calls this directly
no outgoing calls
no test coverage detected