mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-08 06:02:49 +00:00
separate thumb class name
This commit is contained in:
parent
100787a349
commit
764e32c40f
|
@ -4,7 +4,9 @@ import { forwardRef } from 'react';
|
|||
|
||||
export interface SwitchProps
|
||||
extends VariantProps<typeof switchStyles>,
|
||||
SwitchPrimitive.SwitchProps {}
|
||||
SwitchPrimitive.SwitchProps {
|
||||
thumbClassName?: string;
|
||||
}
|
||||
|
||||
const switchStyles = cva(
|
||||
[
|
||||
|
@ -46,9 +48,9 @@ const thumbStyles = cva(
|
|||
);
|
||||
|
||||
export const Switch = forwardRef<HTMLButtonElement, SwitchProps>(
|
||||
({ size, className, ...props }, ref) => (
|
||||
({ size, className, thumbClassName, ...props }, ref) => (
|
||||
<SwitchPrimitive.Root {...props} ref={ref} className={switchStyles({ size, className })}>
|
||||
<SwitchPrimitive.Thumb className={thumbStyles({ size, className })} />
|
||||
<SwitchPrimitive.Thumb className={thumbStyles({ size, className: thumbClassName })} />
|
||||
</SwitchPrimitive.Root>
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue