import type { FC, ReactNode, ComponentType, ReactElement } from 'react'; import type { Action, ExcludeStrict, ForwardProps, OmitStrict, TestIdProp } from '../../types'; import type { FlexProps } from '../Flex'; import type { FormControlProps } from '../FormControl'; import type { LabelProps } from '../Label'; import type { elements } from './FormField.test-ids'; export interface FormFieldProps extends OmitStrict, TestIdProp { /** Pass a single form control component i.e. Input | TextArea | Select | etc.. */ children: ReactElement | ReactElement[]; /** * An id is required to connect a FormField's wrapping element, control element and info(aria-describedby) live region. * A random id will be generated if none is provided. * Since MOST FormControls should possess an id(excl. i.e RadioCheckGroup and others) this can be used. * The id prop will be used to generate the following: * - FormControl <-> Label association via a Label's htmlFor prop. * - FormField's wrapping element id {id}-field. * - FormField info element id ${id}-info. */ id?: string; /** * Determines how the wrapping label should be rendered. * @default 'label' */ labelAs?: LabelProps['as']; /** * Overrides the for attribute on the label. If this is not set it will default to the forms id. * @default undefined */ labelFor?: LabelProps['htmlFor']; /** * Sets the id of the label. * @default undefined */ labelId?: LabelProps['id']; /** * Visually hides the label region. * @default false */ labelHidden?: boolean; /** * Visually places the label after the input. * @default false */ labelAfter?: boolean; /** * Property used to check whether input type is radio to handle styling for RadioCheck * @default false */ isRadioCheck?: boolean; /** * Wrapping HTML element tag. Renders as a fieldset for grouped elements i.e. RadioButtons/CheckboxGroup * @default 'div' */ as?: 'div' | 'fieldset' | ComponentType; /** * Layout field elements inline in a row. * @default false */ inline?: boolean; /** Optionally utilized by Input or Select. */ actions?: Action[]; /** Enables Flex container prop pass through. */ container?: ExcludeStrict; /** Character remaining count. Typically used on Textareas only */ charLimitDisplay?: ReactNode; /** Id of additional describing element. */ 'aria-describedby'?: string; /** Callback invoked when the clear button is clicked. If provided will render the clear button. */ onClear?: () => void; /** Suppresses announcements for status changes. */ suppressAnnouncements?: boolean; } export declare const StyledFormFieldInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute, HTMLDivElement>, Pick & Pick & { $infoAbove?: boolean; }>> & string; export declare const StyledLabelRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute, HTMLDivElement>, { inline: boolean; }>> & string; export declare const StyledFormField: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute, HTMLDivElement>, FormFieldProps & { asFieldset: boolean; showAdditionalInfo: boolean; }>> & string; declare const _default: FC & { getTestIds: (testIdProp?: TestIdProp["testId"]) => import("../../types").TestIdsRecord; }; export default _default; //# sourceMappingURL=FormField.d.ts.map