import { GroupBase, Props } from 'react-select'; import { BreakpointCustomizable, Optional, SelectedAriaAttributes } from '../../../types'; import { ComboboxAriaAttribute, ComboboxAriaTranslations, ComboboxFilterOption, ComboboxOption, ComboboxOptionsGroup, ComboboxOptionsOrOptGroups, ComboboxSize } from '../Combobox.utils'; import { DSLanguage } from '../../../utils'; type IncludedReactSelectKeys = 'className' | 'filterOption' | 'form' | 'defaultInputValue' | 'inputValue' | 'menuIsOpen' | 'name' | 'onBlur' | 'onFocus' | 'openMenuOnClick' | 'openMenuOnFocus' | 'tabIndex'; type PickedReactSelectProps> = Optional, IncludedReactSelectKeys>, IncludedReactSelectKeys>; export interface CustomReactSelectProps extends PickedReactSelectProps { /** Unique id for the DSCombobox. */ id: string; /** Label text displayed above the DSCombobox. */ label: string; /** * Defines the options, can be a mixed array of options and option groups. * `type ComboboxOption = {label: string; value: string | number; leadingIconName?: IconName; leadingIconSource?: string; isDisabled?: boolean;}` * `type ComboboxOptionsGroup = {label: string; options: ComboboxOption[];}` * `type ComboboxOptionsOrOptGroups = (ComboboxOption | ComboboxOptionsGroup)[];` * */ options: ComboboxOptionsOrOptGroups; /** ARIA attributes to enhance accessibility. * `{'aria-describedby'?: string; 'aria-labelledby'?: string;}` * * The ids are appended to the ids the component generates internally, e.g. for the label, hint and system feedback. * */ aria?: SelectedAriaAttributes; /** The value of autoComplete to use for the DSCombobox. */ autoComplete?: string; /** Value of the initially selected Option. */ defaultValue?: IsMulti extends true ? ComboboxOption[] : ComboboxOption; /** Disables the DSCombobox, preventing user interaction. * @default false */ disabled?: boolean; /** Custom method to filter whether an option should be displayed in the menu */ filterOption?: ((option: ComboboxFilterOption, inputValue: string) => boolean) | null; /** Hides the DSCombobox label, can be responsive. * `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }` * @default false */ hideLabel?: BreakpointCustomizable; /** Short descriptive text displayed beneath the label. */ hint?: string; /** Marks the DSCombobox as invalid, typically used for form validation. * @default false */ invalid?: boolean; /** Allows selection of multiple options. * @default false */ isMulti: boolean; /** Sets language for screen reader messages, the "No options found" message, * and ICU plural rule resolution. * Use `'de'` or `'en'` for preconfigured translations, or any * [BCP 47 language tag](https://www.rfc-editor.org/info/bcp47) (e.g. `'fr'`, `'pl'`, `'en-GB'`) * when providing a custom `translations` object. * @default 'en' */ lang?: DSLanguage; /** Keeps the menu open or always closed, useful for specific testing scenarios. * @default undefined */ menuIsOpen?: boolean | undefined; /** Shows an info button next to the label that triggers a popover with the passed content. */ popoverContent?: React.ReactNode; /** Popover info button props: * * `data-*`: Custom data attributes. * * `label`: Accessibility label for the default anchor button. * (default) 'Toggle popover' */ popoverInfoButtonProps?: { [key: `data-${string}`]: string | undefined; label?: string; }; /** Indicates that the DSCombobox is required. * @default false */ required?: boolean; /** Size of the Combobox. * @default 'medium' */ size?: ComboboxSize; /** Defines a system feedback message, shown when `invalid={true}`- */ systemFeedback?: string; /** Translations for the DSCombobox. Use our [customization page](/?path=/docs/components-combobox-translations--documentation) for creating custom translations. */ translations?: ComboboxAriaTranslations; /** Value of the DSCombobox. */ value?: IsMulti extends true ? ComboboxOption[] : ComboboxOption; /** Callback function called when the selection of the DSCombobox changes. */ onValueChange?: (newValue: IsMulti extends true ? ComboboxOption[] : ComboboxOption) => void; /** Callback function called when the value of the DSCombobox input changes. */ onInputChange?: (newValue: string) => void; } /** * Internal customized react select component, which is in parts exposed to our consumers * via the DSCombobox component. * */ export declare const CustomReactSelect: import('react').ForwardRefExoticComponent & import('react').RefAttributes>; export {};