import * as TogglePrimitive from '@radix-ui/react-switch' import { cva, type VariantProps } from 'class-variance-authority' import type * as React from 'react' import { cn } from '../../utils' const toggleVariants = cva('', { variants: { size: { default: 'h-[30px] w-[52px] [&_span]:size-6 [&_span]:data-[state=checked]:translate-x-6 [&_span]:data-[state=unchecked]:translate-x-[2px]', sm: 'h-[22px] w-[40px] [&_span]:size-4 [&_span]:data-[state=checked]:translate-x-[20px] [&_span]:data-[state=unchecked]:translate-x-[2px]', }, }, defaultVariants: { size: 'default', }, }) export interface ToggleProps extends React.ComponentPropsWithoutRef, VariantProps { ref?: React.Ref> } const Toggle = ({ className, size, ref, ...props }: ToggleProps) => ( ) Toggle.displayName = 'Toggle' export { Toggle }