import { HelpTextProps } from "../HelpText/HelpText.cjs"; import { WidthProp } from "@marigold/system"; import { ComponentPropsWithRef, ElementType, ReactNode } from "react"; import { DistributiveOmit } from "@marigold/types"; import { TextProps } from "react-aria-components/Text"; export interface FieldBaseProps extends WidthProp, Pick { as?: T; /** * Specifies the label of 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; variant?: string; size?: string; children?: ReactNode; /** * Use RAC prop names here so we can directly pass the components via "as" */ isInvalid?: boolean; isRequired?: boolean; isDisabled?: boolean; } /** `TextContext` slots for the help text, as a RAC field publishes them. */ export type HelpTextSlots = Record<'description' | 'errorMessage', TextProps>; interface FieldBaseInternalProps extends FieldBaseProps { /** Id for the addon's static content, when the field wires `aria-describedby` itself. */ addonId?: string; /** Slots for the help text of a plain DOM field, from `useFieldHelpText`. */ helpTextSlots?: HelpTextSlots; } export declare const FieldBase: ({ as: Component, children, label, addon, addonId: addonIdProp, helpTextSlots, size, variant, width, description, errorMessage, className, isInvalid, isRequired, isDisabled, ref, ...rest }: FieldBaseInternalProps & DistributiveOmit, "as">) => import("react").JSX.Element; export {};