import { ChangeEvent, CSSProperties, FocusEvent, HTMLAttributes, InputHTMLAttributes, ReactNode, Ref } from 'react'; import { UiCoreLocale } from '../../../helpers/uiCoreLocale'; import { FieldLabelPlacement, FieldSize, FieldWidth } from '../field-styles'; interface InputSlot { startAdornment?: ReactNode; endAdornment?: ReactNode; className?: string; style?: CSSProperties; ref?: Ref; [key: string]: unknown; } type HtmlInputSlot = InputHTMLAttributes & { ref?: Ref; }; /** * @figmaNode wXrXt5uKNNzV2DnQCgyYZH#15561-37391 * Figma "Input field" component. The Figma **State** property (Enabled/Hovered/Active-Focused/ * Error/Disabled/Read only) is driven by native focus/hover + the `error`/`disabled`/`readOnly` * props; **Filled** (on/off) is derived from `value`/`defaultValue`. **Unify** and **Mixed state** * are Figma-authoring properties with no React counterpart. Non-annotated props are behavioral / */ export interface StyledInputFieldProps { /** @figmaProp none — test hook */ dataTest: string; /** @figmaProp Label element */ label?: ReactNode; /** * `above` (default): the label sits above the field and wraps. `floating`: inside the field, only * where a label above has no room, such as the search field (field width pattern §10). */ labelPlacement?: FieldLabelPlacement; /** @figmaProp Filled = (value != '')→"on" | else→"off" */ value?: string | number; /** @figmaProp Filled = (defaultValue != '')→"on" | else→"off" */ defaultValue?: string | number; onChange?: (event: ChangeEvent) => void; onBlur?: (event: FocusEvent) => void; onFocus?: (event: FocusEvent) => void; /** @figmaProp State = true→"Error" */ error?: boolean; /** @figmaProp Helper text element */ helperText?: ReactNode; reserveHelperText?: boolean; expandHelperText?: boolean; /** Character limit; also readable from `slotProps.htmlInput.maxLength`. */ maxLength?: number; /** * Count against `maxLength`, on by default whenever the field has a limit (WID-12). Pass `false` * for a fixed format such as a postal code, whose length the label or hint already states. */ counter?: boolean; /** Language of the counter text. */ locale?: UiCoreLocale; /** @figmaProp State = true→"Disabled" */ disabled?: boolean; /** @figmaProp State = true→"Read only" */ readOnly?: boolean; /** * @figmaProp State = set→"Locked". A field the user normally edits here whose editing is paused * for now (disabled-states DIS-9): read-only, with a lock icon at the end, the default cursor and a * focus ring. The reason opens on hover, focus and tap and is the field's description. */ lockedReason?: ReactNode; /** * @figmaProp State = set→"Read only". A single value inside a form the user is editing that they * cannot change here but can change elsewhere (disabled-states DIS-6): text-like, without border or * fill, focusable and selectable with a focus ring and the default cursor. The reason says where it * can be changed; it opens on hover, focus and tap and is the field's description. `lockedReason` wins. */ readOnlyReason?: ReactNode; required?: boolean; allowClear?: boolean; onClear?: () => void; type?: string; placeholder?: string; name?: string; id?: string; /** * Standard HTML `autocomplete`. Left unset the browser decides, which is what a plain text field * wants; a component that owns its own suggestion list (a combobox) must pass `'off'` so the * browser's dropdown doesn't cover it. Also readable from `slotProps.htmlInput.autoComplete`. */ autoComplete?: string; autoFocus?: boolean; multiline?: boolean; rows?: number; minRows?: number; maxRows?: number; size?: FieldSize; /** Accepted for API parity; the design always renders outlined. */ variant?: string; /** Field width pattern step, `width: 100%; max-width: `. Full fills the form column. */ width?: FieldWidth; /** @deprecated Fields are Full by default; use `width`. */ fullWidth?: boolean; className?: string; style?: CSSProperties; sx?: unknown; inputRef?: Ref; slotProps?: { input?: InputSlot; htmlInput?: HtmlInputSlot; inputLabel?: HTMLAttributes & Record; formHelperText?: { sx?: unknown; className?: string; hideErrorIcon?: boolean; }; }; /** Legacy MUI adornment slot (still used by ~22 call sites). */ InputProps?: InputSlot; onKeyDown?: (event: React.KeyboardEvent) => void; /** Forwarded to the field root (MUI `TextField` parity); e.g. to stop clicks bubbling to a sortable header. */ onClick?: (event: React.MouseEvent) => void; } /** * Outlined text field with its label above it (replaces MUI `TextField`). Self-contained: manages its * own focus/value state to drive the shared field styling ([[field-styles]]); supports multiline, * start/end adornments, an optional clear button, and error/helper text. Public props preserved * * ponytail: `variant` is accepted but always renders outlined — a known ceiling; Chromatic in CI is * the visual gate. Multiline auto-grows between `minRows` and `maxRows` (a fixed `rows` pins the height) * and scrolls once the content exceeds the cap; `readOnly` ignores the cap and shows the whole value. */ export declare const StyledInputField: ({ dataTest, label, labelPlacement, value, defaultValue, onChange, onBlur, onFocus, error, helperText, reserveHelperText, expandHelperText, maxLength, counter, locale, disabled, readOnly: readOnlyProp, lockedReason, readOnlyReason, required, allowClear, onClear, type, placeholder, name, id, autoComplete, autoFocus, multiline, rows, minRows, maxRows, size, width, fullWidth: _fullWidth, className, style, sx, inputRef, slotProps, InputProps, onKeyDown, onClick, variant: _variant, }: StyledInputFieldProps) => JSX.Element; export {};