import { type FocusEventHandler, type KeyboardEventHandler, type MouseEventHandler, type Ref } from "react"; import { type IAccessibilityConfigBase } from "../../typings/accessibility.js"; import { type IconType } from "../@types/icon.js"; import { type SizeMedium, type SizeSmall } from "../@types/size.js"; /** * Clickable trailing icon button (e.g. a clear button). Bundles its own * accessible name so the button can never be rendered unnamed. * * @internal */ export interface IUiTextInputIconAfterButton { /** Icon rendered inside the button. */ icon: IconType; /** Fires on click. */ onClick: () => void; /** Accessible name for the icon-only button. */ ariaLabel: string; } /** * @internal */ export interface IUiTextInputProps { /** HTML input `type`. Defaults to `"text"`. */ type?: "text" | "search" | "email" | "url"; /** Current value. */ value: string; /** Fires with the next value on every change. */ onChange: (next: string) => void; /** Optional label rendered above the input. */ label?: string; /** * Height of the field: `"medium"` is 32px, `"small"` is 27px with smaller text. * Defaults to `"medium"`. */ size?: SizeSmall | SizeMedium; /** Placeholder shown when the input is empty. */ placeholder?: string; /** Optional icon rendered inside the input at the start. */ iconBefore?: IconType; /** Optional static (non-interactive) icon rendered inside the input at the end. */ iconAfter?: IconType; /** * Optional interactive trailing icon button (e.g. a clear button). Takes * precedence over `iconAfter`. Carries its own `ariaLabel`, so the button * always has an accessible name. */ onIconAfter?: IUiTextInputIconAfterButton; /** Accessibility config forwarded to the input element. */ accessibilityConfig?: IAccessibilityConfigBase; /** Marks the field invalid: error-colored border plus `aria-invalid`. */ isError?: boolean; disabled?: boolean; autoFocus?: boolean; /** Forwarded to the input element. Use for autocomplete / combobox patterns. */ onKeyDown?: KeyboardEventHandler; /** Forwarded to the input element. */ onFocus?: FocusEventHandler; /** Forwarded to the input element. */ onBlur?: FocusEventHandler; /** Forwarded to the input element. */ onClick?: MouseEventHandler; /** Test id forwarded to the input element. */ dataTestId?: string; inputRef?: Ref; /** Use as the floating-popup anchor when the popup should match the full field width. */ wrapperRef?: Ref; name?: string; /** * Browser-autofill control. Combobox/autocomplete patterns should set * `"off"` so the native dropdown doesn't overlap the listbox. */ autoComplete?: string; autoCapitalize?: string; autoCorrect?: string; } /** * Single-line text input with optional label and leading / trailing icons. * The kit's canonical text-field rendering: 32px height (27px when `size` is `"small"`), 1px * complementary-4 border, inset shadow, primary-blue focus state. * * @internal */ export declare function UiTextInput({ type, value, onChange, label, size, placeholder, iconBefore, iconAfter, onIconAfter, accessibilityConfig, isError, disabled, autoFocus, onKeyDown, onFocus, onBlur, onClick, dataTestId, inputRef, wrapperRef, name, autoComplete, autoCapitalize, autoCorrect, }: IUiTextInputProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=UiTextInput.d.ts.map