import type { ControlSize } from "../../Theme/tokens/primitives/controlSizes"; /** Whole-track height on the button control scale (sm 32 · md 40 · lg 48px); defaults to "sm". */ export type SegmentedControlSize = Exclude; /** brandSlide = primary view switcher; underlineSlide = dense toolbar; default = plain buttons. */ export type SegmentedControlVariant = "default" | "brandSlide" | "underlineSlide"; /** Stacking axis of the track; vertical keeps each segment's own height and lets the track's width follow its widest option. Defaults to "horizontal". */ export type SegmentedControlOrientation = "horizontal" | "vertical"; /** One selectable segment; disabled options are skipped by keyboard nav (arrows/Home/End). */ export type SegmentedControlOption = { /** Identity of the option; compared to the top-level `value` to mark it selected and passed to `onChange`. */ value: T; /** Visible segment text and its accessible name; `shortLabel` may replace it on narrow screens. */ label: string; /** Shown instead of label below the "md" breakpoint, when set; the full label stays the segment's accessible name. */ shortLabel?: string; /** Rendered before the label. */ icon?: JSX.Element; /** Dims the segment to 50%, blocks clicks and removes it from keyboard navigation. */ isDisabled?: boolean; /** Badge after the label, capped at 99+; omit or pass null/undefined to hide it. */ count?: number | null; }; /** Props for SegmentedControl; T narrows options/value/onChange to the caller's literal union. */ export type SegmentedControlProps = { /** Two to five mutually exclusive options. Beyond five, use a Select. */ options: SegmentedControlOption[]; /** Controlled selection; a value matching no option selects nothing. */ value: T; /** Fires on click and on arrow/Home/End keys; not called for disabled options. */ onChange: (value: T) => void; /** Defaults to "sm". */ size?: SegmentedControlSize; /** Stretches the track to its container and splits it evenly between segments. */ isFullWidth?: boolean; /** brandSlide = primary view switcher; underlineSlide = dense toolbars/headers. */ variant?: SegmentedControlVariant; /** Stacks segments top-to-bottom instead of side-by-side. Defaults to "horizontal"; fully opt-in. */ orientation?: SegmentedControlOrientation; /** Background this sits on. Optional: the track is opaque on any backdrop; pass it only to aim the plate's hairline edge at the real backdrop. */ surface?: string; /** Required accessible name of the radiogroup, e.g. "View mode". */ "aria-label": string; };