import { default as React } from 'react'; import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types.js'; import { FormValidator } from '../../services/formValidation/index.js'; export type InputDropdownSlots = 'root' | 'dropdown' | 'item' | 'empty'; export interface InputDropdownLabels { /** Shown when nothing matches the typed text and `allowCustomValue` is off (default `No matches`). */ empty?: string; } export interface InputDropdownItem { label?: string; value: string; } export interface InputDropdownProps extends Omit { label?: string; value?: string; formValidator?: FormValidator | null; error?: string; isRequired?: boolean; items?: InputDropdownItem[]; /** * Allow values that are not part of `items`. When true, the typed text is * emitted via `onChange`/`onSelect`/the form validator on every keystroke, * instead of only when an item is picked from the list. */ allowCustomValue?: boolean; /** * Maximum number of filtered items rendered in the list. Matches beyond this * are dropped (the user narrows by typing, not by scrolling). `0` renders all * matches. Default `100`. */ maxItems?: number; onSelect?: (value: string) => void; onChange?: (value: unknown) => void; placeholder?: string; readOnly?: boolean; /** Overrides the text InputDropdown renders of its own. Merged per key. */ labels?: InputDropdownLabels; className?: string; style?: React.CSSProperties; classNames?: SlotClassNames; styles?: SlotStyles; }