import { type GestureResponderEvent, type Insets, type TextInput as RNTextInput, type TextInputProps as RNTextInputProps } from "react-native"; import { type LayoutStyle, type MeasureProps } from "../../style/index.js"; import { type IconName } from "../icon/icon.js"; import { type InputSkin, type Size } from "./input.styles.js"; export declare const ACTION_GAP = 8; /** * The touch slop of each pressable trailing glyph, in order (the clear glyph, then the eye). * Each reaches the minimum (ACTION_HIT_SLOP a side) except where it faces a neighbor: the * first faces the value the user is editing across `textGap`, and two glyphs face each other * across ACTION_GAP. There the gap is split (src/style/touch-seam.ts): React Native gives a * point two touch areas admit to the later sibling, so the eye's whole slop took taps on the * clear glyph (and revealed the password), and the clear glyph's took taps on the end of the * text. The value asks for no slop, so the first glyph may take that whole gap and no more. */ export declare function actionSlops(count: number, textGap: number): Array; /** * The touch slop the grouped box carries for its trailing actions. The box clips (it * squares the addons into its rounded corners), and React Native hit-tests a clipping view * only inside its own bounds plus its own slop, so the part of an action's slop that * reaches past the box would be cut. A glyph sits centered in the box, so its slop overhangs * the top and bottom where the glyph plus its slop is taller than the box: the 36pt iOS * small field under a 20pt glyph. The gutter's end inset already covers the slop sideways * on every skin (test/touch-target-clips.test.tsx holds that), so the overhang is vertical. */ export declare function actionOverhang(iconSize: number, boxHeight: number): Insets | undefined; /** * The curated slice of React Native's TextInput behavior forwarded by Input and * Textarea. Styling stays semantic (the kit's boolean props); BEHAVIOR — what * keyboard appears, how text is captured, focus/submit events — belongs to the * consumer, and hiding it made real forms (login, search, OTP) impossible to * build. Typed via Pick so the props track react-native's own definitions. */ export type TextEntryProps = Pick; export interface InputProps extends TextEntryProps, MeasureProps { /** Current text value (controlled). Omit and use `defaultValue` for uncontrolled use. */ value?: string; /** Called with the new text on each keystroke. */ onChangeText?: (text: string) => void; /** Placeholder shown while the field is empty. */ placeholder?: string; /** * The field's persistent label. Its placement is platform-adaptive: * * iOS and * web render it ABOVE the field (the static title the Field/Form composers * produce today); Android renders the Material 3 in-container FLOATING label * (centered like a placeholder at rest, floating to the top once the field is * focused or filled). * * * iOS renders it ABOVE the field (the static title the Field/Form composers produce today). * * * Android renders the Material 3 in-container FLOATING label (centered like a * placeholder at rest, floating to the top once the field is focused or filled). * * The label is the field's programmatic name (wired via * both accessibilityLabel and aria-labelledby), so a placeholder is no longer * needed for the accessible name. */ label?: string; /** A toolbar search field with a magnifier and a tracked uppercase empty prompt on web. */ search?: boolean; /** Dense uppercase eyebrow label where the skin offers it. */ eyebrow?: boolean; /** Preserve the system focus outline on a framed field. */ systemFocus?: boolean; /** Use the brand’s softer entry-well fill where the skin provides it. */ soft?: boolean; /** * Marks the field as required: appends a destructive "*" to the label (decorative, * never in the accessible name) and announces the field as required, * * through * aria-required on the web and with the word in its name ("Full name, required") * on iOS and Android. * * * with the word in its name ("Full name, required"). * * The star takes effect only alongside `label`. */ required?: boolean; error?: boolean; invalid?: boolean; disabled?: boolean; /** Read-only: shows the value but blocks editing without the dimmed look. */ readOnly?: boolean; small?: boolean; large?: boolean; /** A compact outlined well: 40 high with a 14px value by default; small is 32/13, * large is 48/16. Keeps the platform's field corner and places labels above. */ compact?: boolean; /** Leading addon content (e.g. "https://", "$", an icon glyph). */ prefix?: string; /** Trailing addon content (e.g. "@canvas.dev", "USD", "Copy"). */ suffix?: string; /** Render `icon` as a passive glyph inside the left of the field. */ leadingIcon?: boolean; /** Render `icon` as a passive glyph inside the right of the field. */ trailingIcon?: boolean; /** Glyph name for leadingIcon/trailingIcon: any Canvas glyph (e.g. "search", "mail", "lock", "phone", "calendar", "creditCard"). */ icon?: IconName; /** Render the suffix as a pressable action button rather than a passive label. */ action?: boolean; /** Called when the action suffix is pressed (action only). */ onActionPress?: (event: GestureResponderEvent) => void; /** * A trailing eye button that reveals and re-masks a `secureTextEntry` value (the * password field's show/hide toggle). The field starts masked; the button is * announced as "Show password" / "Hide password". Takes effect only with * `secureTextEntry`. */ passwordToggle?: boolean; /** * A trailing clear button (a circled x) that empties the field, shown while the * field holds text (the search field's clear affordance). Works in both the * controlled and the uncontrolled mode: it clears the native field and reports * "" through `onChangeText`. */ clearable?: boolean; /** * A keyboard shortcut hint at the field's end: a compact flat keycap (``, * the 20 px `tiny` cap on a `small` field) after the value and any inline suffix, before * the trailing glyphs, the hint a search field shows for the key that focuses it * (`shortcut="⌘K"`). Pass the keys as Kbd's `keys` takes them: `"⌘K"` is one cap, `"⌘ K"` * two. A hint only: bind the key yourself. */ shortcut?: string; /** * Accessible name for the field when there is no programmatically-associated * visible label. Maps to accessibilityLabel + the aria-label web alias on the * underlying TextInput, so a Form/Field control is announced with its name. */ accessibilityLabel?: string; /** * ID of the visible label element that names this field (its `nativeID`). * react-native-web forwards aria-labelledby to the DOM input; prefer this over * accessibilityLabel when a visible label is present so the label and * field are programmatically linked. */ "aria-labelledby"?: string; /** * ID of the helper/error text that describes this field (its `nativeID`), so a * screen reader reads the hint after the field name. */ "aria-describedby"?: string; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } export declare function sizeOf(p: InputProps): Size; /** Build an Input component from a platform skin. */ export declare function createInput(platformSkin: InputSkin): import("react").ForwardRefExoticComponent>; //# sourceMappingURL=input.shared.d.ts.map