UNPKG

@project44-manifest/react

Version:

Manifest Design System react components

87 lines 2.68 kB
import * as React from 'react'; import type { AriaComboBoxProps } from '@react-types/combobox'; import { As, Options, Props } from '../../system'; import type { StyleProps } from '../../types'; import { Placement } from '../Overlay'; export declare type ComboboxElement = 'div'; export interface ComboboxOptions<T extends As = ComboboxElement> extends Options<T>, AriaComboBoxProps<object>, StyleProps { /** * The ref of the element to append the overlay to. */ containerRef?: React.RefObject<HTMLElement>; /** * Helper text to append to the form control input element. */ helperText?: React.ReactNode; /** * Props passed to the helper text. */ helperTextProps?: React.HTMLAttributes<HTMLElement>; /** * Label of the input element */ label?: React.ReactNode; /** * Props passed to the label. */ labelProps?: React.HTMLAttributes<HTMLElement>; /** * The maxHeight specified for the overlay element. * By default, it will take all space up to the current viewport height. */ maxHeight?: number; /** * The additional offset applied along the main axis between the element and its * anchor element. * * @default 4 */ offset?: number; /** * The placement of the element with respect to its anchor element. * * @default 'bottom' */ placement?: Placement; /** * Whether the element should flip its orientation (e.g. top to bottom or left to right) when * there is insufficient room for it to render completely. * * @default true */ shouldFlip?: boolean; /** * The size of the combobox * * @default 'medium' */ size?: 'medium' | 'small'; /** * Icon displayed at the start of the combobox. */ startIcon?: React.ReactElement; /** * Combobox variant */ variant?: 'autocomplete' | 'dropdown'; /** * Specifies if the component is in a loading state */ loading?: boolean; /** * Specifies the loading state content for the combobox. If not provided * no text will be displayed in the loading state */ loadingText?: string; /** * Specifies the no results ui elements for the combobox */ noResultsChildren?: React.ReactElement | React.ReactElement[]; /** * Custom popover width with max-width as 400px */ wide?: boolean; } export declare type ComboboxProps<T extends As = ComboboxElement> = Props<ComboboxOptions<T>>; export declare const Combobox: import("../../system").Component<ComboboxOptions<"div">>; //# sourceMappingURL=Combobox.d.ts.map