import React from "react"; import { MarginProps } from "styled-system"; import { InputProps } from "../../../../__internal__/input"; import { ValidationProps } from "../../../../__internal__/validations"; import { TagProps } from "../../../../__internal__/utils/helpers/tags"; export interface TextInputProps extends Omit, MarginProps, Omit, TagProps { /** * @private @internal @ignore * Sets the input's text alignment. Does not affect the position of the input's prefix or suffix icons. */ align?: "left" | "right"; /** * The ID of the element(s) that describe the input, typically used to reference the hint and/or * validation message(s) associated with the input. Can be a space-separated list of IDs if there * are multiple descriptive elements. */ "aria-describedby"?: string; /** * The ID of the element that labels the input, typically used to reference the input's label when * the label is not properly associated with the input via the htmlFor attribute. */ "aria-labelledby"?: string; /** * If true, the input will automatically receive focus when the component is mounted. */ autoFocus?: boolean; /** * Unique identifier for the input. * Label id will be based on it, using following pattern: [id]-label. * Will use a randomly generated GUID if none is provided */ /** * @private @internal @ignore * `data-component` attribute to be added to the component's root element for testing and tracking purposes. */ "data-component"?: string; /** * @private @internal @ignore * `data-is-open` attribute to be added to the component's root element when rendered as part of Select. */ "data-is-open"?: boolean; /** * Sets the input's id attribute, is not set a unique id will be generated and used. * The label's htmlFor attribute will be set to match the input's id to ensure they are properly associated. */ id?: string; /** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input */ inputHint?: string; /** * @internal @private @ignore * An Icon to be rendered next to the input * */ inputIcon?: React.ReactNode; /** The width of the input as a percentage (e.g., 50 for 50%) */ inputWidth?: number; /** Label content */ label: string; /** When true label is inline */ labelInline?: boolean; /** * Slot to render additional content to the left of the input, such as a prefix. */ leftChildren?: React.ReactNode; /** The maximum width of the component container */ maxWidth?: string; /** * @param ev - React's mouse event for the input element * Callback called when mouse is clicked down on the input, but before it receives focus. */ onMouseDown?: (ev: React.MouseEvent) => void; /** * @param ev - React's mouse event for the input element * Callback called when the input is clicked. */ onClick?: (ev: React.MouseEvent) => void; /** Size of an input */ size?: "small" | "medium" | "large"; /** * The type of the input, e.g., "text", "email", "password". This prop is passed directly * to the underlying input element, so any valid HTML input type is accepted. * The default value is "text". */ type?: string; /** * @private @internal @ignore * If true, the validation message will be rendered above the input, otherwise it will be rendered below. */ validationMessagePositionTop?: boolean; } export declare const TextInput: React.ForwardRefExoticComponent>; export default TextInput;