/**
 * @file TextInput.tsx
 * @input Uses React, useId, ChangeEvent, Field, Icon, InputGroupContext
 * @output Exports TextInput component, TextInputProps
 * @position Core implementation; consumed by index.ts, tested by TextInput.test.tsx
 *
 * SYNC: When modified, update these files to stay in sync:
 * - /packages/core/src/TextInput/TextInput.doc.mjs (props table, features, implementation notes)
 * - /packages/core/src/TextInput/TextInput.test.tsx (tests for new/changed behavior)
 * - /packages/core/src/TextInput/index.ts (exports if types change)
 * - /apps/storybook/stories/TextInput.stories.tsx (storybook stories)
 * - /packages/cli/assets/templates/blocks/components/TextInput/ (showcase blocks)
 */
import { type ChangeEvent, type KeyboardEvent, type ReactNode } from 'react';
import * as stylex from '@stylexjs/stylex';
import { type InputStatus, type FieldStatusVariant } from '../Field';
import { type IconType } from '../Icon';
declare const sizeStyles: Readonly<{
    readonly sm: Readonly<{
        readonly height: stylex.StyleXClassNameFor<"height", "28px">;
    }>;
    readonly md: Readonly<{
        readonly height: stylex.StyleXClassNameFor<"height", "32px">;
    }>;
    readonly lg: Readonly<{
        readonly height: stylex.StyleXClassNameFor<"height", "36px">;
    }>;
}>;
export type TextInputSize = keyof typeof sizeStyles;
export type { InputStatus as TextInputStatus, InputStatusType as TextInputStatusType, } from '../Field';
import type { BaseProps } from '../BaseProps';
import type { SizeValue } from '../utils/types';
export type TextInputType = 'text' | 'password' | 'email';
export interface TextInputProps extends Omit<BaseProps, 'onChange' | 'defaultValue'> {
    /** Ref forwarded to the root element */
    ref?: React.Ref<HTMLInputElement>;
    /**
     * The HTML input type.
     * @default 'text'
     */
    type?: TextInputType;
    /**
     * Label text for the input (always rendered for accessibility).
     */
    label: string;
    /**
     * Whether to visually hide the label (still accessible to screen readers).
     * @default false
     */
    isLabelHidden?: boolean;
    /**
     * Description text displayed between the label and input.
     */
    description?: string;
    /**
     * Whether the field is optional. Mutually exclusive with isRequired.
     * @default false
     */
    isOptional?: boolean;
    /**
     * Whether the field is required. Mutually exclusive with isOptional.
     * @default false
     */
    isRequired?: boolean;
    /**
     * Whether the input is disabled.
     * @default false
     */
    isDisabled?: boolean;
    /**
     * Whether the input is read-only.
     * The value is shown at full opacity and still submits with the form, but
     * cannot be edited. Unlike `isDisabled`, a read-only input is not dimmed and
     * stays in the tab order — use it for a value the user should see and send
     * but not change. `isDisabled` takes precedence when both are set.
     * @default false
     */
    isReadOnly?: boolean;
    /**
     * Explains why the input is disabled. When set together with `isDisabled`,
     * the input shows a tooltip with this text on hover and keyboard focus, and
     * stays focusable (via `aria-disabled`) so the reason is discoverable by
     * keyboard and assistive technology. The field cannot be edited (it becomes
     * read-only) while disabled.
     *
     * Use this instead of wrapping a disabled input in `Tooltip` — disabled
     * controls don't emit the pointer events an external tooltip needs.
     *
     * @example
     * ```
     * <TextInput
     *   label="Owner"
     *   value={owner}
     *   isDisabled
     *   disabledMessage="You need the Editor role to change this"
     * />
     * ```
     */
    disabledMessage?: string;
    /**
     * Icon to display at the start of the input.
     * Accepts a ReactNode (e.g. `<Icon icon={SearchIcon} />`) or an SVG icon component directly.
     */
    startIcon?: ReactNode | IconType;
    /**
     * Status indicator for the input.
     * When set, displays a colored border and status icon.
     * If message is provided, displays a floating message box below the input.
     */
    status?: InputStatus;
    /**
     * How the status message is placed relative to the input.
     * - 'attached': message overlaps directly below the input (bordered treatment)
     * - 'detached': message floats below as a separate element with spacing
     * - 'tooltip': no message box; the status icon becomes a focusable info-tip button that reveals the message on hover, keyboard focus, or tap
     * @default 'attached'
     */
    statusVariant?: FieldStatusVariant;
    /**
     * The size of the input.
     * - 'sm': Compact size (18px height)
     * - 'md': Default size (26px height)
     * @default 'md'
     */
    size?: TextInputSize;
    /**
     * Callback fired when the input value changes.
     */
    onChange?: (value: string, e: ChangeEvent<HTMLInputElement>) => void;
    /** Async action on change. Fires after onChange if not prevented. */
    changeAction?: (value: string, e: ChangeEvent<HTMLInputElement>) => void | Promise<void>;
    /** Whether the input is in a loading state. @default false */
    isLoading?: boolean;
    /**
     * The current value of the input.
     */
    value: string;
    /**
     * Placeholder text shown when the input is empty.
     */
    placeholder?: string;
    /**
     * Width of the field. Numbers are treated as pixels, strings are used as-is
     * (e.g. `'100%'`). Sizes the whole field (label, control, and status) so they
     * stay aligned, unlike setting width via `xstyle`/`className`/`style`.
     */
    width?: SizeValue;
    /**
     * Tooltip text to display in an info icon at the end of the label.
     */
    labelTooltip?: string;
    /**
     * Whether to show a clear button when a value is set.
     * When clicked, resets the value to an empty string and returns focus to the input.
     * @default false
     */
    hasClear?: boolean;
    /**
     * Whether to automatically focus the input on mount.
     * @default false
     */
    hasAutoFocus?: boolean;
    /**
     * The HTML name attribute for the input.
     * Useful for form submissions.
     */
    htmlName?: string;
    /**
     * Callback fired when the user presses the Enter key.
     */
    onEnter?: () => void;
    /**
     * Callback fired on keydown events on the input.
     */
    onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
}
/**
 * A text input component for collecting user input.
 *
 * @example
 * ```
 * <TextInput label="Name" value={name} onChange={setName} />
 * <TextInput label="Search" isLabelHidden value={query} onChange={setQuery} />
 * ```
 */
export declare function TextInput({ type, label, isLabelHidden, description, isOptional, isRequired, isDisabled, isReadOnly, disabledMessage, startIcon, status, statusVariant, size: sizeProp, onChange, changeAction, isLoading, value, placeholder, labelTooltip, hasClear, hasAutoFocus, htmlName, onEnter, onKeyDown, width, xstyle, className, style, ref, ...rest }: TextInputProps): import("react").JSX.Element;
export declare namespace TextInput {
    var displayName: string;
}
//# sourceMappingURL=TextInput.d.ts.map