import { ListBoxItemProps } from "../ListBox/ListBoxItem.cjs"; import { SectionProps } from "../ListBox/ListBoxSection.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 = 'children' | 'isInvalid' | 'isDisabled' | 'isOpen' | 'isRequired' | 'style' | 'className' | 'selectionMode'; export interface TagFieldProps extends Omit, RemovedProps>, WidthProp { /** * 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; /** * Children of the tag field (options). */ children?: ReactNode | ((item: T) => ReactNode); /** * Set a label for the field. */ label?: ReactNode; /** * Content after the label, such as a `` or ``. Keeps * the label row's height, and a badge is read as the field's description. */ addon?: ReactNode; /** * Set a description for the field. */ description?: string; /** * Set an error message for the field. */ errorMessage?: string | ((validation: RAC.ValidationResult) => string); /** * Items of the tag field. */ items?: Iterable; /** * 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']; /** * If the field should be required. * @default false */ required?: boolean; /** * If the field should be disabled. * @default false */ disabled?: boolean; /** * If the dropdown should be open. * @default false */ open?: boolean; /** * If the field should show an error state. * @default false */ error?: boolean; /** * Placeholder text when no items are selected. */ placeholder?: string; /** * Provides content to display when there are no items in the list. */ emptyState?: ReactNode; } declare function TagFieldBase({ disabled, required, items, dependencies, variant, size, error, open, children, placeholder, emptyState, ref, ...rest }: TagFieldProps & { ref?: Ref; }): import("react").JSX.Element; export declare const TagField: typeof TagFieldBase & { Option: (props: ListBoxItemProps) => import("react").JSX.Element; Section: ({ header, children, ...props }: SectionProps) => import("react").JSX.Element; }; export {};