import React from 'react';
import type { AriaTextFieldProps } from 'react-aria';
export type InputSize = 'sm' | 'md' | 'lg';
/**
* The plain `` attributes that React Aria has no opinion about —
* `title`, `list`, `onClick`, `style` and the rest.
*
* `AriaTextFieldProps` wins every overlap: it is omitted from this side, so
* `value`, `onChange`, `placeholder` and friends keep React Aria's types and
* semantics rather than the DOM's. Without this, spreading the rest props onto
* the element was pointless — the runtime would forward attributes the type
* refused to accept, so no caller could pass them in the first place.
*/
type InputDOMProps = Omit, keyof AriaTextFieldProps | 'size' | 'autoCapitalize' | 'disabled'>;
export interface InputProps extends AriaTextFieldProps, InputDOMProps {
/** Matches the Figma `Size` variant: Small, Medium, Large. */
size?: InputSize;
/**
* Narrower than React's own typing, which also allows any `string`.
* `autoCapitalize` is declared on `AriaTextFieldOptions` rather than
* `AriaTextFieldProps`, so `keyof AriaTextFieldProps` above cannot omit it —
* and the wide DOM version does not satisfy what `useTextField` accepts.
*/
autoCapitalize?: 'none' | 'off' | 'on' | 'sentences' | 'words' | 'characters';
/** Leading icon. Figma's `Show Leading Icon` + `Leading Icon` swap. */
leadingIcon?: React.ReactNode;
/** Trailing icon. Figma's `Show Trailing Icon` + `Trailing Icon` swap. */
trailingIcon?: React.ReactNode;
/**
* A segment butted against the left of the control, sharing its outline —
* Figma's `Input/Phone` (80:372) country-code block.
*
* Distinct from `leadingIcon`, which sits *inside* the box: an addon has its
* own surface and border and is a sibling of the control, so the two cannot
* be the same slot. It lives here rather than in `PhoneInput` because the
* `.ion-field` wrapper has to enclose the addon and the control together —
* building it outside would put the label above only half the control and
* break the `aria-labelledby` wiring `useTextField` sets up.
*
* Phone is the only addon Figma specifies. This is a slot, not a system:
* resist growing a trailing counterpart or an addon variant ladder until a
* design actually calls for one.
*/
leadingAddon?: React.ReactNode;
/**
* @deprecated Use `isDisabled`. Accepted as an alias for one minor version.
*/
disabled?: boolean;
/**
* Class names for the control box (`.ion-input`). Always lands here —
* never on the form-field wrapper. Use `wrapperClassName` for that.
*/
className?: string;
/** Class names for the `.ion-field` wrapper when a label or helper is shown. */
wrapperClassName?: string;
}
/**
* Input covers both Figma components on the Input page: the field itself
* (`Input`, 80:275) and the label/helper stack around it (`Form Field`,
* 80:330). They are separate there because a Figma component cannot make a
* slot optional without a boolean; here the wrapper simply isn't rendered when
* there is nothing to put in it.
*
* `useTextField` owns the wiring that is tedious and easy to get subtly wrong:
* it generates the ids, points `aria-labelledby` at the label and
* `aria-describedby` at whichever of the helper or error message is actually
* showing, and sets `aria-invalid`. Hand-rolling that is where form fields
* usually lose their accessibility.
*
* Figma's seven states map to three props and three CSS states. Hover and Focus
* are interaction; Filled is the placeholder distinction, which CSS already
* expresses; Default, Invalid, Disabled and Read-only are props.
*/
export declare const Input: React.ForwardRefExoticComponent>;
export {};
//# sourceMappingURL=Input.d.ts.map