mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-18 15:29:11 +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
|
export interface SwitchProps
|
||||||
extends VariantProps<typeof switchStyles>,
|
extends VariantProps<typeof switchStyles>,
|
||||||
SwitchPrimitive.SwitchProps {}
|
SwitchPrimitive.SwitchProps {
|
||||||
|
thumbClassName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
const switchStyles = cva(
|
const switchStyles = cva(
|
||||||
[
|
[
|
||||||
|
@ -46,9 +48,9 @@ const thumbStyles = cva(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const Switch = forwardRef<HTMLButtonElement, SwitchProps>(
|
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.Root {...props} ref={ref} className={switchStyles({ size, className })}>
|
||||||
<SwitchPrimitive.Thumb className={thumbStyles({ size, className })} />
|
<SwitchPrimitive.Thumb className={thumbStyles({ size, className: thumbClassName })} />
|
||||||
</SwitchPrimitive.Root>
|
</SwitchPrimitive.Root>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue