UNPKG

@trail-ui/react

Version:
49 lines (46 loc) 1.51 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { SlotsToClasses, SelectComboBoxSlots } from '@trail-ui/theme'; import { ReactNode, ForwardedRef, ReactElement } from 'react'; import { ComboBoxProps } from 'react-aria-components'; import { ListBoxItemProps } from '../listbox/listbox-item.js'; interface SelectComboboxProps<T extends object> extends Omit<ComboBoxProps<T>, 'children'> { /** * The label of the select combobox */ label?: string; /** * The placeholder of the select combobox */ placeholder?: string; /** * The id of the error message */ errorId?: string; /** * The error icon of the select combobox */ errorIcon?: ReactNode; /** * The error message of the select combobox */ errorMessage?: string; /** * The items of the select combobox */ children: ReactNode | ((item: T) => ReactNode); /** * The classname of slots of the select combobox */ classNames?: SlotsToClasses<SelectComboBoxSlots>; /** * The current ListBox item that has focus */ currentFocusedItem?: string; } declare function SelectComboboxItem(props: ListBoxItemProps & { children: React.ReactNode; }): react_jsx_runtime.JSX.Element; declare const _SelectCombobox: <T extends object>(props: SelectComboboxProps<T> & { ref?: ForwardedRef<HTMLDivElement>; }) => ReactElement; export { _SelectCombobox as SelectCombobox, SelectComboboxItem, SelectComboboxProps };