import type * as CSS from 'csstype'; import type { ReactNode } from 'react'; import type { GroupBase, OptionsOrGroups } from 'react-select'; import type { BehaviorTrackingProps } from '../../core/types/behavior-tracking-props.js'; import { DataTestId } from '../../core/types/data-props.js'; import { StylingProps } from '../../core/types/styling-props.js'; /** * @public */ export type SelectSingleValue = OptionValue | null; /** * @public */ export type SelectMultiValue = OptionValue[]; /** * @internal */ export type SingleOrMultiValue = SelectMultiValue | SelectSingleValue; /** * Internal type for the Option data * * @internal */ export interface BaseOption extends StylingProps, DataTestId, BehaviorTrackingProps { label?: ReactNode; value: OptionValue; isDisabled?: boolean; isSelected?: boolean; /** * Prefix passed to the option */ prefix: { component: ReactNode | null; componentProps?: StylingProps & DataTestId & BehaviorTrackingProps; }; /** * Suffix passed to the option */ suffix: { component: ReactNode | null; componentProps?: StylingProps & DataTestId & BehaviorTrackingProps; }; textValue?: string; 'aria-label'?: string; } /** * Internal type for Group data * @internal */ export interface BaseGroup extends StylingProps, DataTestId, BehaviorTrackingProps { label?: string; options: BaseOption[]; labelProps?: StylingProps & DataTestId & BehaviorTrackingProps; } /** * Internal type combining either Options or groups * * @internal */ export type OptionOrGroup = OptionsOrGroups>; /** * @public */ export type SelectTriggerWidthOptionsType = 'content' | 'full' | CSS.Property.Width; /** * @public */ export type SelectContentWidthOptionsType = 'trigger' | CSS.Property.Width;