import type { HTMLAttributes, ReactElement, ReactNode } from 'react';
import type { SxProp } from '../Layout/sx.js';
export type FieldValidationState = 'default' | 'danger' | 'warning' | 'success';
export interface FieldProps extends Omit, 'children'> {
/** Label text. */
label?: ReactNode;
/** Helper copy shown under the control. */
hint?: ReactNode;
/** Error message — overrides `hint` and applies danger styling to the control. */
error?: ReactNode;
/** Show a red asterisk next to the label. */
required?: boolean;
/** Show a muted "(optional)" tag next to the label. */
optional?: boolean;
/** Character counter — pass the current length. Pair with `maxLength`. */
counter?: number;
/** Max characters; when `counter` >= this, the counter flips to danger. */
maxLength?: number;
/** Override validation styling explicitly. */
state?: FieldValidationState;
/**
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
* merges into inline style; responsive sx injects a scoped class. Applied
* to the outer field wrapper.
*/
sx?: SxProp;
/** Single form control element. The `id` is threaded to the label and aria-describedby. */
children: ReactElement;
}
/**
* Field — the canonical wrapper for form controls. Handles:
* • Label + required asterisk / optional tag
* • Helper / error text (error overrides hint)
* • Character counter with auto-danger when > maxLength
* • ARIA wiring: `htmlFor`, `aria-describedby`, `aria-invalid`
* • Validation state propagation to the child control via className
*/
export declare function Field({ label, hint, error, required, optional, counter, maxLength, state, className, style, sx, children, ...rest }: FieldProps): import("react/jsx-runtime").JSX.Element;