import { default as React } from 'react'; import { RadioGroupProps } from '../../.deps/ui/core-web/src'; import { SafeOmit } from '../../.deps/utils/src'; export type SegmentedControlSize = 'lg' | 'md' | 'sm'; export type SegmentedControlMode = 'iconText' | 'textOnly' | 'iconOnly'; export interface SegmentRenderContext { /** Whether this segment is the currently selected one. */ checked: boolean; /** Whether this segment is disabled. */ disabled: boolean; } type RadioGroupPassThroughProps = SafeOmit; export interface SegmentedControlProps extends RadioGroupPassThroughProps { /** * The list of options to render as segments. */ options: T[]; /** * Returns the value that uniquely identifies an option. * Used as the radio input value and for controlled/uncontrolled selection tracking. */ getOptionValue(option: T): V; /** * Returns the visible text label for an option. * Rendered in textOnly and iconText modes. Always used as the accessible name * on the radio input, including in iconOnly mode where the label is not visible. */ getOptionLabel(option: T): string; /** * Returns the icon element (24×24) for an option. * Required for iconText and iconOnly modes. */ getOptionIcon?(option: T): React.ReactNode; /** * Returns whether an option is disabled. * Takes precedence over the group-level `disabled` prop. */ getOptionDisabled?(option: T): boolean; /** * Renders an element appended after the default icon+label content (e.g. a Tag counter, * a status dot, or any other suffix). Use renderOption for full custom layouts. */ renderOptionSuffix?(option: T): React.ReactNode; /** * Fully custom segment content renderer. * When provided, replaces the default icon/label/badge layout. * The RadioGroup.Option.Button (hidden radio input) is always rendered before this. */ renderOption?(option: T, context: SegmentRenderContext): React.ReactNode; /** * Controlled selected value. */ value?: V; /** * Initial selected value for uncontrolled usage. */ defaultValue?: V; /** * Callback fired when the selected segment changes. */ onChange?(value: V): void; /** * When true, all segments are disabled. * Individual options can still be disabled via getOptionDisabled. * @default false */ disabled?: boolean; /** * Size variant matching the Shoptet form scale. * - lg: 48px outer height * - md: 32px outer height * - sm: 26px outer height — textOnly only (icons don't fit) * @default 'md' */ size?: SegmentedControlSize; /** * Display mode shared by all segments. * - iconText: 24×24 icon + label (lg and md only) * - textOnly: label only (all sizes) * - iconOnly: icon only, square segments (lg and md only) * @default 'textOnly' */ mode?: SegmentedControlMode; 'aria-label'?: string; 'aria-labelledby'?: string; className?: string; } export declare function SegmentedControl({ options, getOptionValue, getOptionLabel, getOptionIcon, getOptionDisabled, renderOptionSuffix, renderOption, value, defaultValue, onChange, disabled, size, mode, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabeledBy, className, ...rest }: SegmentedControlProps): React.JSX.Element | null; export {};