UNPKG

@yamada-ui/autocomplete

Version:

Yamada UI autocomplete component

94 lines (91 loc) 3.08 kB
import * as _yamada_ui_core from '@yamada-ui/core'; import { ThemeProps, HTMLUIProps } from '@yamada-ui/core'; import { MotionProps } from '@yamada-ui/motion'; import { PortalProps } from '@yamada-ui/portal'; import { FC, ReactNode } from 'react'; import { AutocompleteCreateProps } from './autocomplete-create.js'; import { AutocompleteEmptyProps } from './autocomplete-empty.js'; import { AutocompleteIconProps } from './autocomplete-icon.js'; import { AutocompleteListProps } from './autocomplete-list.js'; import { UseAutocompleteProps } from './use-autocomplete.js'; import '@yamada-ui/use-descendant'; import '@yamada-ui/form-control'; import '@yamada-ui/popover'; import '@yamada-ui/utils'; import './autocomplete-option.js'; import './use-autocomplete-option.js'; import './autocomplete-option-group.js'; import './use-autocomplete-option-group.js'; interface AutocompleteOptions { /** * The border color when the input is invalid. */ errorBorderColor?: string; /** * The border color when the input is focused. */ focusBorderColor?: string; /** * The footer of the autocomplete content element. */ footer?: FC<{ value: string | undefined; onClose: () => void; }> | ReactNode; /** * The header of the autocomplete content element. */ header?: FC<{ value: string | undefined; onClose: () => void; }> | ReactNode; /** * Props for autocomplete container element. */ containerProps?: Omit<HTMLUIProps, "children">; /** * Props for autocomplete content element. */ contentProps?: Omit<MotionProps, "children">; /** * Props for autocomplete create element. */ createProps?: Omit<AutocompleteCreateProps, "children">; /** * Props for autocomplete empty element. */ emptyProps?: Omit<AutocompleteEmptyProps, "children">; /** * Props for autocomplete field element. */ fieldProps?: Omit<AutocompleteFieldProps, "children" | "inputProps">; /** * Props for autocomplete icon element. */ iconProps?: AutocompleteIconProps; /** * Props for autocomplete input element. */ inputProps?: HTMLUIProps<"input">; /** * Props for autocomplete list element. */ listProps?: Omit<AutocompleteListProps, "children">; /** * Props to be forwarded to the portal component. * * @default '{ disabled: true }' */ portalProps?: Omit<PortalProps, "children">; } interface AutocompleteProps extends ThemeProps<"Autocomplete">, Omit<UseAutocompleteProps, "maxSelectValues" | "omitSelectedValues">, AutocompleteOptions { } /** * `Autocomplete` is a component used to display suggestions in response to user text input. * * @see Docs https://yamada-ui.com/components/forms/autocomplete */ declare const Autocomplete: _yamada_ui_core.Component<"input", AutocompleteProps>; interface AutocompleteFieldProps extends HTMLUIProps, Pick<AutocompleteProps, "inputProps"> { } export { Autocomplete, type AutocompleteProps };