import { ListBoxItemProps } from "../ListBox/ListBoxItem.cjs"; import { SectionProps } from "../ListBox/ListBoxSection.cjs"; import { FieldBaseProps } from "../FieldBase/FieldBase.cjs"; import { ListBoxProps } from "../ListBox/ListBox.cjs"; import { WidthProp } from "@marigold/system"; import { ReactNode, Ref } from "react"; import RAC from "react-aria-components"; type RemovedProps = 'className' | 'style' | 'children' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'defaultInputValue' | 'inputValue' | 'onInputChange'; export interface ComboBoxProps extends Omit, RemovedProps>, Pick, 'label' | 'addon' | 'description' | 'errorMessage'> { /** * Visual variant of the component. Which values exist is defined by the theme * and listed in the "Appearance" section of the component's documentation. */ variant?: string; /** * Size of the component. Which values exist is defined by the theme and listed * in the "Appearance" section of the component's documentation. */ size?: string; /** * Sets the width of the field. You can see allowed tokens here: https://tailwindcss.com/docs/width * Note: `"fit"` is not supported because the virtualizer controls item sizing. */ width?: Exclude; /** * If `true`, the input is disabled. * @default false */ disabled?: RAC.ComboBoxProps['isDisabled']; /** * If `true`, the input is required. * @default false */ required?: RAC.ComboBoxProps['isRequired']; /** * If `true`, the input is readOnly. * @default false */ readOnly?: RAC.ComboBoxProps['isReadOnly']; /** * If `true`, the field is considered invalid and if set the `errorMessage` is shown instead of the `description`. * @default false */ error?: RAC.ComboBoxProps['isInvalid']; /** * The value of the input (uncontrolled). */ defaultValue?: RAC.ComboBoxProps['defaultInputValue']; /** * The value of the input (controlled). */ value?: RAC.ComboBoxProps['inputValue']; /** * Called when the input value changes. */ onChange?: RAC.ComboBoxProps['onInputChange']; /** * ReactNode or function to render the list of items. */ children?: ReactNode | ((item: any) => ReactNode); /** * Values that invalidate the cached items, like a hook's dependency array. * Only needed for `items` plus a render function: rendered items are cached * per item object, so anything the function reads from outside the item — * state, a lookup, a prop — has to be listed here or it renders stale. */ dependencies?: ListBoxProps['dependencies']; /** * Set the placeholder for the select. */ placeholder?: string; /** * Provides content to display when there are no items in the list. */ emptyState?: ReactNode; /** * If `true`, a loading spinner will show up. * @default false */ loading?: boolean; } export declare const ComboBox: (({ variant, size, required, disabled, readOnly, error, defaultValue, value, emptyState, onChange, children, dependencies, loading, ref, ...rest }: ComboBoxProps & { ref?: Ref; }) => import("react").JSX.Element) & { Option: (props: ListBoxItemProps) => import("react").JSX.Element; Section: ({ header, children, ...props }: SectionProps) => import("react").JSX.Element; }; export {};