import React from "react"; import type { FormFieldProps } from "../FormField/FormField"; import type { ActionData } from "./MultiSelect"; import type { PortalProps } from "../../Portal/Portal"; import type { ComboboxSlotProps } from "./-types"; /** Represents an option in a select component. */ export type SelectOption = { value: string; label: string; description?: string; disabled?: boolean; alias?: string; } & Record; export type CommonSelectProps = { /** select element name (to be used in form input) */ name: string; /** placeholder to display when no value is selected */ placeholder?: string; /** Hidden message used within aria-live region, when filtering returns no options */ emptyStateMessage?: string; /** Displays control in error state */ hasError?: boolean; /** Disable control */ disabled?: boolean; /** Array of option objects with custom properties along with following properties * @param value - Option value * @param label - Option label * @param description - Optional description * @param disabled - Set for disabled option * @param alias - Optional alias used for filtering */ options?: SelectOption[]; /** Provide a custom filter function to filter the options list based on input query */ filterMethod?: (options: SelectOption, value: string) => boolean; /** Multiselect: Provide custom label for trigger Tag in multiselect */ formatSelectedOptionsLabel?: (count?: number) => string; onBlur?: () => void; onFocus?: () => void; /** Set max height of options list */ maxHeight?: number; /** Custom width for the options list */ optionsListWidth?: number; privateProps?: { dropdownPlacement?: "up" | "down"; }; /** Multi select combobox */ multiple?: boolean; autoComplete?: string; onChange?: (selectedValues: SelectOption["value"][] & React.ChangeEvent, actionData?: ActionData, e?: React.ChangeEvent) => void; value: string | string[] | null; readOnly?: boolean; "aria-describedby"?: string; } & Pick; type ComboboxMultipleProps = Omit & FormFieldProps & { multiple: true; slotProps: Omit & { tag: NonNullable; }; }; type ComboboxSingleProps = Omit & FormFieldProps & { multiple?: false; slotProps?: Omit & { tag?: never; }; }; export type ComboboxProps = ComboboxMultipleProps | ComboboxSingleProps; export declare function Combobox({ options, name, value, placeholder, emptyStateMessage, hasError, filterMethod, formatSelectedOptionsLabel, onChange, onBlur, onFocus, maxHeight, autoComplete, multiple, privateProps, portalContainer, optionsListWidth, readOnly, errorMessages, hint, slotProps, "aria-describedby": ariaDescribedBy, "data-e2e-test-id": dataE2eTestId, ...rest }: ComboboxProps): React.ReactElement; export {};