import { type ReactNode, type RefObject } from "react"; import type { SX } from "../../theme"; import type { FormSearchInputProps } from "../Form/FormSearchInput"; import { type IconProps } from "../Icon"; type Variant = "attached" | "detached" | "detached-connected"; export interface ComboBoxProps { children: ReactNode; /** * Variant defines the appearance and behavior of the ComboBox * - "detached" - the dropdown is hiding or appearing according to user focus on the input * - "detached-connected" - same as "detached" but the dropdown is connected to the input visually * - "attached" - dropdown is connected to the input both visually and functionally (it's always shown) */ variant?: Variant; /** * Aligns content above the input or below * Supports only "detached*" variants */ side?: "top" | "bottom"; sx?: SX; /** * Controls the visibility of the list * Enables "detached*" variants to be controlled from the outside */ isOpen?: boolean; /** * Callback to be called when the list is closed * Enables "detached*" variants to be controlled from the outside */ onClose?: () => void; /** * Refs to elements that should not close the list when clicked */ dropdownRefs?: RefObject[]; /** * Enables a translucent grey overlay that appears when the list is open * Supports only "detached*" variants */ overlay?: boolean; /** * Force no FormInput, to not display input borders twice. * Useful when you want to add FormInputField over ComboBox manually * ie. to display an error message or description. * In the future, we should create FormComboBox component that wraps ComboBox into FormInputField. * Tech debt ticket: https://linear.app/prismic/issue/PBD-1867/editor-ui-refactor-combobox-and-select-components */ forceNoFormInput?: boolean; } export declare const ComboBox: (props: ComboBoxProps & import("react").RefAttributes) => import("react").ReactElement> | null; interface ComboBoxContentProps { children: ReactNode; /** * Adds padding to the top and bottom of the content */ paddingBlock?: 0 | 2 | 4; /** * Maximum height of the content */ maxHeight?: 200 | "full"; /** * Disable default onClick handler. * Useful when you want to handle click events manually, * ie. with a Link component to make cmd+click work. */ disableOnClick?: boolean; } export declare const ComboBoxContent: (props: ComboBoxContentProps & import("react").RefAttributes) => import("react").ReactElement> | null; type ComboBoxItemProps = { value: string; checked?: boolean; onCheckedChange?: (checked: boolean) => void; disabled?: boolean; children: ReactNode; iconStyle?: Pick; /** * Changes the style of the item * "action-list-item" styles the item as if it was an ActionListItem component */ variant?: "default" | "action-list-item"; }; export declare const ComboBoxItem: (props: ComboBoxItemProps & import("react").RefAttributes) => import("react").ReactElement> | null; interface ComboBoxInputProps extends Pick { value: string; onValueChange: (search: string) => void; id?: string; placeholder?: string; /** * Auto focuses the input when variant is "attached". * Needed when ComboBox is nested within Popovers */ autoFocus?: boolean; /** * Callback to be called when the input is focused * Returning false will prevent the list from opening */ onFocus?: () => boolean; maxLength?: number; startAdornment?: boolean; endAdornment?: boolean; } export declare const ComboBoxInput: (props: ComboBoxInputProps & import("react").RefAttributes) => import("react").ReactElement> | null; interface ComboBoxActionProps { children: ReactNode; } export declare function ComboboxAction(props: ComboBoxActionProps): JSX.Element; export {};