import { default as React, ReactElement } from 'react'; import { BorderColor, ElementBorder, ElementDensity, ElementFont, ElementShape, SemanticColor } from '../../utils'; /** Visual variant of the field control. */ type FieldVariant = 'filled' | 'outlined' | 'classic'; /** * Props for the FieldBase component. * * Supports controlled and uncontrolled usage, floating and static labels, * leading and trailing slots, and validation messaging. * * @category Base components */ export interface FieldBaseProps extends Omit, 'color' | 'children' | 'rows' | 'size' | 'accept' | 'capture' | 'checked' | 'defaultChecked' | 'alt' | 'src' | 'width' | 'height' | 'formAction' | 'formEncType' | 'formMethod' | 'formNoValidate' | 'formTarget' | 'min' | 'max' | 'step' | 'multiple'> { /** Semantic color used as the control accent when active. Default: primary */ color?: SemanticColor; /** Required root class name. */ elementClass: string; /** Visual density of the field. */ density?: ElementDensity; /** Text label for the field. */ label?: string; /** Font style applied to the label in its floating position. Default: bodySmall */ labelFont?: ElementFont; /** Validation message. Marks the control invalid and replaces the description. */ error?: string; /** When true, renders the error icon in the trailing slot while `error` is set. */ showErrorIcon?: boolean; /** Icon rendered in the trailing slot while `error` is set. Default: ErrorIcon */ errorIcon?: ReactElement; /** When true, renders the control that clears the value while the field is not empty. */ showClear?: boolean; /** Icon of the control that clears the value. Default: CancelIcon */ clearIcon?: ReactElement; /** Accessible label of the control that clears the value. Default: Clear */ clearLabel?: string; /** Marks the control as read-only. Suppresses the affordances that change the value. */ readOnly?: boolean; /** Supporting text displayed below control. */ description?: string; /** Visual field variant. Takes precedence over boolean variant shortcuts. */ variant?: FieldVariant; /** Shortcut for `variant="outlined"`. */ outlined?: boolean; /** Shortcut for `variant="filled"`. */ filled?: boolean; /** Shortcut for `variant="classic"`. */ classic?: boolean; /** Expands field to full width. */ fullWidth?: boolean; /** Control shape variant. Default: smooth */ shape?: ElementShape; /** Border width of the control. Default: 1 for outlined and classic */ border?: ElementBorder; /** Border color override. Default: onSurfaceVariant, outline for classic */ borderColor?: BorderColor; /** Placeholder text shown while the field is empty. */ placeholder?: string; /** Renders the control as a multi-line text area. */ multiline?: boolean; /** Minimum number of visible text lines the area grows from when `multiline` is set. Default: 3 */ lines?: number; /** Maximum number of visible text lines the area grows to when `multiline` is set. Default: unlimited */ maxLines?: number; /** Content rendered before the input. */ leading?: React.ReactNode; /** Content rendered after the input. */ trailing?: React.ReactNode; /** Icon rendered before the leading content. */ icon?: React.ReactNode; /** Icon rendered after the trailing content. */ endIcon?: React.ReactNode; /** Controlled value of the input. */ value?: string; /** Initial value for uncontrolled usage. */ defaultValue?: string; /** Font style applied to the control and to the resting label. Default: bodyLarge */ font?: ElementFont; /** Marks the control as required (visual indicator only). */ required?: boolean; } /** * Base input control shared by all field components. * * @remarks * The `filled` and `outlined` variants float the label above the input once it is * focused or filled, while `classic` renders it as a static label above the control. * The value is uncontrolled unless `value` is provided. * * @example * * * @example * * * @category Base components */ export declare const FieldBase: React.ForwardRefExoticComponent>; export {};