import { type FC, type FunctionComponent } from "react"; import { type IconKey, type IconProps } from "../Icons/types/IconProps.type"; type SwitcherItemBase = { /** * The icon shown in the segment, passed as an icon key (e.g. `"ListIcon"`) * or an icon component. */ icon?: IconKey | FunctionComponent; }; /** * A segment configuration. Either a visible `name` is provided (which serves as * the accessible label), or, for icon-only segments, an `"aria-label"` is * required so screen readers can announce the segment. */ export type SwitcherItemConfig = (SwitcherItemBase & { /** Visible text label rendered next to the icon. */ name: string; /** Optional explicit accessible label; defaults to `name`. */ "aria-label"?: string; }) | (SwitcherItemBase & { name?: never; /** Accessible label, required when there is no visible `name`. */ "aria-label": string; }); export interface SwitcherProps { /** * The list of selectable segments. */ items: SwitcherItemConfig[]; /** * Called with the index of the segment the user selected. */ onChange: (index: number) => void; /** * The index of the currently selected segment. Defaults to `-1` (none). */ selectedIndex?: number; className?: string; itemClassName?: string; } export declare const Switcher: FC; export default Switcher;