import { type Dispatch, type ElementType, type FocusEventHandler, type HTMLAttributes, type SetStateAction } from "react"; import { type FormActivationIndicatorProps } from "./FormActivationIndicator"; import { type FormHelperTextProps } from "./FormHelperText"; import { type FormLabelProps } from "./FormLabel"; import type { NecessityIndicatorOptions } from "./NecessityIndicator"; import type { StatusIndicatorProps } from "./StatusIndicator"; export type FormFieldLabelPlacement = "top" | "left"; export type FormFieldHelperTextPlacement = "bottom" | "tooltip"; export type FormFieldValidationStatus = "error" | "warning"; export interface A11yValueProps extends Pick { /** * If `true`, the FormField will be disabled. */ disabled?: boolean; /** id of the helper text node */ helperTextId?: string; /** id of the label node */ labelId?: string; /** * The FormField value is Readonly */ readOnly?: boolean; /** * Whether the form field needs to render helper text */ renderHelperText?: boolean; } export interface FormFieldLegacyProps extends HTMLAttributes, A11yValueProps { /** * The component used for activation indicator. Default to `FormActivationIndicator`. */ ActivationIndicatorComponent?: ElementType; /** * Outer focus ring focus will not be applied. Defaults to false. */ disableFocusRing?: boolean; /** * Whether the form field is occupying full width. */ fullWidth?: boolean; /** * Whether to show the StatusIndicator component for validation states. */ hasStatusIndicator?: boolean; /** * The helper text content */ helperText?: string; /** * The component used for the helper text. Default to `FormHelperText`. */ HelperTextComponent?: ElementType; /** * Location the helperText, values: 'bottom' (default) or 'tooltip'. */ helperTextPlacement?: FormFieldHelperTextPlacement; /** * Props to be applied to the `HelperTextComponent`. * * Generic on `FormHelperTextProps` is omitted. */ HelperTextProps?: Partial; /** * The label value for the FormField */ label?: string; /** * The component used for the label. Default to `FormLabel`. */ LabelComponent?: ElementType; /** * Location the label, values: 'top' (default) or 'left' */ labelPlacement?: FormFieldLabelPlacement; /** * Props to be applied to the `LabelComponent` */ LabelProps?: Partial; /** * Override props to be used with the StatusIndicator component */ StatusIndicatorProps?: Partial; /** * The state for the FormField: Must be one of: 'error'|'warning'|undefined */ validationStatus?: FormFieldValidationStatus; /** * FormField variants; defaults to primary. * * **Deprecated:** The 'tertiary' variant has been deprecated */ variant?: "primary" | "secondary" | "tertiary"; } export interface useA11yValueValue { "aria-labelledby": A11yValueProps["labelId"]; "aria-required": A11yValueProps["required"]; "aria-describedby": A11yValueProps["helperTextId"] | undefined; disabled: A11yValueProps["disabled"]; readOnly: A11yValueProps["readOnly"]; } export declare const useFormFieldLegacy: ({ onBlur, onFocus, }: { onBlur?: FocusEventHandler; onFocus?: FocusEventHandler; }) => [{ focused: boolean; }, { setFocused: Dispatch>; }, { onBlur: FocusEventHandler; onFocus: FocusEventHandler; }]; export declare const FormFieldLegacy: import("react").ForwardRefExoticComponent>;