import type { ChangeEvent, FocusEventHandler } from "react"; /** Track/knob size preset; exact widths and travel live in ToggleSwitch.tsx's SIZES map. */ export type ToggleSwitchSize = "sm" | "md" | "lg"; /** Which theme scale fills the "on" track, via `resolveFilledSurface`. Defaults to "primary". */ export type ToggleSwitchColorScheme = "primary" | "secondary" | "tertiary" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink"; type Naming = { label: string; "aria-label"?: string; fieldLabel?: string; } | { label?: undefined; "aria-label": string; fieldLabel?: string; } | { label?: undefined; "aria-label"?: undefined; fieldLabel: string; }; /** Controlled when `isChecked` is passed, else uncontrolled from `defaultChecked`. Needs a visible `label`/`fieldLabel` or an `aria-label`. `error` replaces `helperText`. */ export type ToggleSwitchProps = Naming & { /** Omit for an uncontrolled switch driven by `defaultChecked`. */ isChecked?: boolean; /** Initial state for an uncontrolled switch; ignored once `isChecked` is passed. */ defaultChecked?: boolean; /** Fires with the next state; the native change event comes second. Optional when uncontrolled with no listener. */ onChange?: (checked: boolean, event: ChangeEvent) => void; /** Also dims the whole field to 50% opacity. */ isDisabled?: boolean; /** Stays focusable and announces `aria-readonly`, but ignores clicks and keys — unlike `isDisabled`. */ isReadOnly?: boolean; /** Defaults to "md". */ size?: ToggleSwitchSize; /** Fill colour when on. Defaults to "primary". */ colorScheme?: ToggleSwitchColorScheme; /** Input id; generated when omitted, and the base for message/label ids. */ id?: string; /** Merged with the helper/error message id, never replaced by it. */ "aria-describedby"?: string; /** Label side relative to the track; defaults to "end". */ labelPosition?: "start" | "end"; /** Field label above the switch, its own `