import type * as CSS from 'csstype'; import type { ReactNode } from 'react'; import type { GroupBase, OptionsOrGroups } from 'react-select'; import { type DataTestId, type StylingProps } from '@dynatrace/strato-components/core'; /** * @public */ export type SelectV2SingleValue = OptionValue | null; /** * @public */ export type SelectV2MultiValue = OptionValue[]; /** * @internal */ export type SingleOrMultiValue = SelectV2MultiValue | SelectV2SingleValue; /** * Internal type for the Option data * * @internal */ export interface BaseOption extends StylingProps, DataTestId { label?: ReactNode; value: OptionValue; isDisabled?: boolean; isSelected?: boolean; /** * Prefix passed to the option */ prefix: { component: ReactNode | null; componentProps?: StylingProps & DataTestId; }; /** * Suffix passed to the option */ suffix: { component: ReactNode | null; componentProps?: StylingProps & DataTestId; }; textValue?: string; 'aria-label'?: string; } /** * Internal type for Group data * @internal */ export interface BaseGroup extends StylingProps, DataTestId { label?: string; options: BaseOption[]; labelProps?: StylingProps & DataTestId; } /** * 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;