import React from "react"; import type { StyleProp, TextStyle, ViewStyle } from "react-native"; import type { FieldError } from "react-hook-form"; import type { IconNames } from "@jobber/design"; export interface InputFieldStyleOverride { prefixLabel?: StyleProp; suffixLabel?: StyleProp; container?: StyleProp; placeholderText?: StyleProp; } export interface InputFieldWrapperProps { /** * Highlights the field red and shows message below (if string) to indicate an error */ readonly invalid?: boolean | string; /** * Disable the input */ readonly disabled?: boolean; /** * Hint text that goes above the value once the field is filled out */ readonly placeholder?: string; /** * Text that goes below the input to help the user understand the input */ readonly assistiveText?: string; /** * Controls how the placeholder text is displayed. * - normal: the placeholder text will be displayed in the normal placeholder position * - mini: the placeholder text will float above the input value * - hidden: the placeholder text will not be displayed * @default "normal" */ readonly placeholderMode?: "normal" | "mini" | "hidden"; readonly hasValue?: boolean; /** * Symbol to display before the text input */ readonly prefix?: { icon?: IconNames; label?: string; }; /** * Symbol to display after the text input */ readonly suffix?: { icon?: IconNames; label?: string; onPress?: () => void; }; readonly error?: FieldError; readonly focused?: boolean; readonly children: React.ReactNode; /** * Adds the ClearAction that will call the onClear handler when pressed */ readonly showClearAction?: boolean; /** * Callback called when the user clicks the ClearAction button. Should clear the value passed. * To disallow clearing set the clearable prop to never */ readonly onClear?: () => void; /** * Custom styling to override default style of the input field */ readonly styleOverride?: InputFieldStyleOverride; /** * Add a toolbar below the input field for actions like rewriting the text. */ readonly toolbar?: React.ReactNode; /** * Change the behaviour of when the toolbar becomes visible. */ readonly toolbarVisibility?: "always" | "while-editing"; /** * Show loading indicator. */ readonly loading?: boolean; /** * Change the type of loading indicator to spinner or glimmer. */ readonly loadingType?: "spinner" | "glimmer"; /** * Whether the input is a multiline input. */ readonly multiline?: boolean; } export declare const INPUT_FIELD_WRAPPER_GLIMMERS_TEST_ID = "ATL-InputFieldWrapper-Glimmers"; export declare const INPUT_FIELD_WRAPPER_SPINNER_TEST_ID = "ATL-InputFieldWrapper-Spinner"; export declare function InputFieldWrapper({ invalid, disabled, placeholder, assistiveText, prefix, suffix, placeholderMode, hasValue, error, focused, children, onClear, showClearAction, styleOverride, toolbar, toolbarVisibility, loading, loadingType, multiline, }: InputFieldWrapperProps): React.JSX.Element;