import React, { ReactNode } from 'react'; import { ControllerStateAndHelpers } from 'downshift'; export type Item = { /** @deprecated */ id?: string | number; /** Element shown next to label */ icon?: ReactNode; /** Value of the option */ value: string; /** Label of the option for users */ label: string; /** Rest Props */ [rest: string]: any; }; interface Props { /** Id of the component */ id?: string; /** Name of the component */ name?: string; /** Label of the component */ label?: string; /** Error message of the component */ error?: string | null; /** The currently selected item */ selectedItem?: Item | null; /** Select items */ items?: Item[]; /** @deprecated Please use `items` */ itemList?: Item[]; /** For backward compatible only, append `data-required` to the select if it is `true` */ required?: boolean; /** Disable the select if it is `true` */ disabled?: boolean; /** * Callback function, to be executed when user selected an item and it has changed * * @param {any} selectedItem * @param {object} stateAndHelpers */ onChange?: (selectedItem: Item | null, stateAndHelpers: ControllerStateAndHelpers) => void; /** * Callback function, to be executed when user trigger to open select dropdown * * @param {SyntheticEvent} event https://reactjs.org/docs/events.html */ onFocus?: (_e?: React.ChangeEvent) => void; /** * Callback function, to be executed when user leave the select dropdown * * @param {SyntheticEvent} event https://reactjs.org/docs/events.html */ onBlur?: (_e?: React.ChangeEvent) => void; /** * absolute: render items with absolute css (default) * portal: render items in a React Portal, breaking out of the DOM tree */ renderStrategy?: 'absolute' | 'portal'; /** * Prevents list from extending out of the viewport */ preventOverflowViewport?: boolean; /** * Override the default zIndex */ listZIndex?: number; /** Rest Props */ [rest: string]: any; } declare const Select: ({ id, name, label, error, selectedItem, items, itemList, required, disabled, onChange, onFocus: superOnFocus, onBlur: superOnBlur, renderStrategy, preventOverflowViewport, listZIndex, ...rest }: Props) => import("@emotion/react/jsx-runtime").JSX.Element; export default Select; export type SelectProps = Props;