import { ElementType, ReactNode, ComponentPropsWithoutRef } from 'react'; import { Color } from '../types.js'; import { SurfaceVariant } from './Surface.js'; export type SwitchSize = 'sm' | 'md'; interface SwitchOwnProps { /** Controlled checked state. Default `false`. */ checked?: boolean; /** Visually dim the switch and disable interaction. */ disabled?: boolean; /** Block toggling without the disabled visual treatment. */ readOnly?: boolean; /** Fires when the user toggles. First arg is the new checked state, second is the raw event. */ onChange?: (checked: boolean, event?: React.ChangeEvent) => void; /** Accent color for the checked state thumb fill. Default: theme accent. */ color?: Color; /** * Polymorphic root element. Defaults to `'label'` so a wrapping `