import type { ControlSize } from "../../Theme/tokens/primitives/controlSizes"; /** Prefer `Select` with `native={false}` for new work — not a drop-in: its combobox is the text input itself. See COMPONENT-GOTCHAS.md ("Which select component"). */ export type SelectSearchProps = { /** Choices; filtered locally by label as the user types. */ options: selectOptions[]; /** @deprecated Never read — the search input always renders. */ isSearchEnabled?: boolean; /** Seeds state once on mount (useState initializer) — changing it later does not update the selection; no sync effect. */ initialSelectedOption?: selectOptions | null; /** Single mode only; fires on pick and writes the option label into the input. */ onOptionSelect?: (option: selectOptions) => void; /** Multi mode only; receives the full selection after each toggle or chip removal. */ onOptionMultiSelect?: (option: selectOptions[]) => void; /** Fires on every keystroke, undebounced; local label filtering runs regardless. */ inputOnchange: (value: string | number) => void; /** Id of the text input; the label's `for` and the message ids derive from it. Auto-generated when omitted. */ id?: string; /** Name attribute of the text input, so a form submits the typed text, not the selection. */ name?: string; /** Label above the input. */ label?: string; /** Inline style on the text input. */ inputStyle?: React.CSSProperties; /** `sx` on the wrapper around label, chips, input and popup. */ boxStyle?: React.CSSProperties; /** Replaces the whole option list with a spinner and `loadingText`. */ isOptionLoading?: boolean; /** Defaults to "loading" (lowercase). */ loadingText?: string; /** Defaults to "Select Option"; also the listbox's accessible name when `label` is absent. */ placeholder?: string; /** Seeds the input text once on mount; later changes are ignored. */ searchQuery: string | null; /** Info icon beside the label; needs `label` and `informationMessage` too. */ isInformation?: boolean; /** Tooltip text for the info icon; ignored unless `isInformation` is true. */ informationMessage?: string; /** Decorative only — rendered with `pointerEvents: none`, so it can't be clicked. */ rightIcon?: React.ReactNode; /** Inline style on the right-icon slot; ignored without `rightIcon`. */ rightElementStyle?: object; /** Multi mode: chips above the input, selected options hidden from the list. */ isMultipleSelect?: boolean; /** Label asterisk + `aria-required` only; never blocks submission. */ isRequired?: boolean | undefined; /** Marks the field invalid and swaps `helperText` for `errorMessage`. */ error?: boolean | undefined; /** Prefixes each row with an avatar built from `profileUrl` (falls back to label initials). */ isProfile?: boolean | undefined; /** Prefixes each row with a dot filled with the option's `color`. */ isColorOptions?: boolean | undefined; /** Rendered only while `error` is true. */ errorMessage?: string | undefined; /** Hint under the field; replaced by `errorMessage` while `error` is true. */ helperText?: string; /** Height on the field control scale (xs 32 · sm 38 · md 40 · lg 48px). Defaults to `sm`. */ size?: ControlSize; /** Shows a sticky "Add New"-style footer row, the listbox's last option; required for all Bottom* props. */ isBottomIcon?: boolean | undefined; /** Footer icon element; omit for a plus icon — `true` renders no icon at all. */ BottomIcon?: boolean | undefined | JSX.Element; /** @deprecated Never read by the component. */ BottomIconStyle?: React.CSSProperties; /** Footer text. Defaults to "Add New". */ BottomText?: string | number; /** Despite the CSSProperties type, pass a plain color string (e.g. "red") — used directly as one, not spread as styles. */ BottomTextColor?: React.CSSProperties; /** Fires when the footer row is clicked or activated with Enter or Space; the popup stays open. */ handleBottomClick?: () => void; }; /** Option shape for SelectSearch; `email`/`profileUrl` back `isProfile` rows, `color` backs `isColorOptions` rows. */ export type selectOptions = { /** Unique key of the option. */ id: string; /** Row text; the local filter matches against it, and its initials back the avatar when `profileUrl` is missing. */ label: string; /** Muted second line under the label. */ email?: string; /** Avatar image in `isProfile` rows. */ profileUrl?: string; /** Fill of the dot in `isColorOptions` rows. */ color?: string; };