@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
64 lines (63 loc) • 2.55 kB
TypeScript
import { IconName } from '../../types';
import { ComboboxProps } from './Combobox';
import { FilterOptionOption, GroupBase, OptionsOrGroups } from 'react-select';
export type ComboboxVariant = 'single' | 'multi';
type ValidationProps = Pick<ComboboxProps, 'id' | 'label' | 'options' | 'hideLabel' | 'popoverContent'>;
export type ComboboxFilterOption<Option> = FilterOptionOption<Option>;
/**
* Validates the given properties of the DSCombobox component for common configuration errors.
* This function is intended to be used in development mode to provide developers with
* warnings about potential misuse of the component.
*
* @param validationProps - The subset of DSCombobox properties to validate. This includes
* id and label.
*/
export declare const validateComboboxProps: ({ id, label, options, hideLabel, popoverContent, }: ValidationProps) => void;
export declare const COMBOBOX_SIZE: readonly ["medium", "small"];
export type ComboboxSize = (typeof COMBOBOX_SIZE)[number];
export interface ComboboxOption {
/** Label text displayed as the option. */
label: string;
/** Value of the option. */
value: string | number;
/** Name of the icon to display. */
leadingIconName?: IconName;
/** Disables the Option, preventing user interaction.
* @default false
*/
isDisabled?: boolean;
}
export type ComboboxOptionsGroup = GroupBase<ComboboxOption>;
export type ComboboxOptionsOrOptGroups = OptionsOrGroups<ComboboxOption, ComboboxOptionsGroup>;
export type ComboboxLanguage = 'de' | 'en';
export type ComboboxAriaTranslations = typeof DS_COMBOBOX_TRANSLATIONS_EN;
export declare const DS_COMBOBOX_TRANSLATIONS_EN: {
placeholder: string;
navigationGuidance: string;
selectGuidance: string;
exitGuidance: string;
tabGuidance: string;
searchGuidance: string;
inputGuidance: string;
selectOptionDisabled: string;
focusValue: string;
of: string;
disabled: string;
selected: string;
deselected: string;
focusSelectedMultiGuidance: string;
valueGuidance: string;
deleteGuidance: string;
clearAllOptions: string;
filterTermHint: string;
filterNoOptions: string;
option_one: string;
option_other: string;
result_one: string;
result_other: string;
resultsAvailable: string;
togglePopover: string;
};
export declare const DS_COMBOBOX_TRANSLATIONS_DE: ComboboxAriaTranslations;
export declare const DS_COMBOBOX_TRANSLATIONS: Record<ComboboxLanguage, ComboboxAriaTranslations>;
export {};