import React from 'react'; import type { TextInputProps as RNTextInputProps, StyleProp, ViewStyle, TextStyle, TextInput as RNTextInput, BlurEvent, FocusEvent } from 'react-native'; import type { Theme } from '../../theme'; import type { State } from './StyledTextInput'; import type { IconName } from '../Icon'; export type TextInputHandles = Pick; type TextInputVariant = 'text' | 'textarea'; type NativeTextInputProps = Omit & { onFocus?: (event?: FocusEvent) => void | undefined; onBlur?: (event?: BlurEvent) => void | undefined; }; interface TextInputRef { focus: () => void; blur: () => void; clear: () => void; isFocused: () => boolean; setNativeProps?: (props: RNTextInputProps) => void; } export interface TextInputProps extends NativeTextInputProps { /** * Field label. */ label?: string; /** * Name of Icon or ReactElement to render on the left side of the input, before the user's cursor. */ prefix?: IconName | React.ReactElement; /** * Name of Icon or ReactElement to render on the right side of the input. */ suffix?: IconName | React.ReactElement; /** * Additional wrapper style. */ style?: StyleProp; /** * Input text style. */ textStyle?: StyleProp; /** * Testing id of the component. */ testID?: string; /** * Accessibility label for the input (Android). */ accessibilityLabelledBy?: string; /** * Error message to display. */ error?: string; /** * Whether the input is required, if true, an asterisk will be appended to the label. */ required?: boolean; /** * Placeholder text to display. * */ placeholder?: string; /** * Whether the input is editable. * */ editable?: boolean; /** * Whether the input is disabled. */ disabled?: boolean; /** * Whether the input is loading. */ loading?: boolean; /** * The max length of the input. * If the max length is set, the input will display the current length and the max length. * */ maxLength?: number; /** * Whether to hide the character count. * */ hideCharacterCount?: boolean; /** * The helper text to display. */ helpText?: string; /** * Customise input value renderer */ renderInputValue?: (inputProps: NativeTextInputProps, ref?: React.ForwardedRef) => React.ReactNode; /** * Component ref. */ ref?: React.Ref; /** * Component variant. */ variant?: TextInputVariant; } export declare const getState: ({ disabled, error, editable, loading, isEmptyValue, }: { disabled?: boolean; error?: string; editable?: boolean; loading: boolean; isFocused?: boolean; isEmptyValue?: boolean; }) => State; export declare const LABEL_ANIMATION_DURATION = 150; export declare const renderErrorOrHelpText: ({ error, helpText, }: { error?: string; helpText?: string; }) => false | React.JSX.Element; export declare const renderInput: ({ variant, nativeInputProps, renderInputValue, ref, theme, state, }: { variant: TextInputVariant; nativeInputProps: NativeTextInputProps; multiline?: boolean; renderInputValue?: (inputProps: NativeTextInputProps, ref?: React.Ref) => React.ReactNode; ref?: React.Ref; theme: Theme; state: State; }) => string | number | bigint | boolean | Iterable | Promise> | Iterable | null | undefined> | React.JSX.Element | null | undefined; export declare const renderSuffix: ({ state, loading, suffix, }: { state: State; loading: boolean; suffix?: IconName | React.ReactElement; }) => "number" | "search" | "bold" | "filter" | "swag" | "wallet" | React.JSX.Element | "menu" | "image" | "switch" | "activate" | "add-emoji" | "add-person" | "adjustment" | "alignment" | "antenna" | "archive" | "assignment-warning" | "bank" | "bell" | "billing" | "bolt" | "bookmark-added" | "bookmark-checked" | "bookmark" | "box-check" | "box" | "bpay" | "buildings" | "cake" | "calendar-clock" | "calendar" | "candy-box-menu" | "caret-down-small" | "caret-down" | "caret-left-small" | "caret-left" | "caret-right-small" | "caret-right" | "caret-up-small" | "caret-up" | "check-radio" | "circle-add" | "circle-cancel" | "circle-check" | "circle-down" | "circle-info" | "circle-left" | "circle-ok" | "circle-pencil" | "circle-question" | "circle-remove" | "circle-right" | "circle-up" | "circle-warning" | "clock-3" | "clock" | "cloud-download" | "cloud-upload" | "cog" | "coin" | "contacts" | "credit-card" | "diamond" | "direction-arrows" | "directory" | "document" | "dollar-coin-shine" | "dot" | "double-buildings" | "edit-template" | "envelope" | "exclude" | "expand-content" | "expense" | "explore_nearby" | "eye-circle" | "eye-invisible" | "eye" | "face-meh" | "face-sad" | "face-smiley" | "feed" | "feedbacks" | "file-certified" | "file-clone" | "file-copy" | "file-csv" | "file-dispose" | "file-doc" | "file-excel" | "file-export" | "file-lock" | "file-pdf" | "file-powerpoint" | "file-search" | "file-secured" | "file-sheets" | "file-slide" | "file-verified" | "file-word" | "file" | "folder-user" | "folder" | "format-bold" | "format-heading1" | "format-heading2" | "format-italic" | "format-list-bulleted" | "format-list-numbered" | "format-underlined" | "funnel-filter" | "global-dollar" | "global-pound" | "globe" | "graduation-cap" | "graph" | "happy-sun" | "health-bag" | "heart" | "hero-points" | "home" | "import" | "incident-siren" | "instapay-daily" | "instapay-now" | "instapay" | "list" | "loading-2" | "loading" | "location-on" | "location" | "lock" | "looks-one" | "looks-two" | "media-content" | "money-notes" | "moneybag" | "moon" | "multiple-stars" | "multiple-users" | "near-me" | "node" | "open-folder" | "paperclip-vertical" | "paperclip" | "payment-summary" | "pencil" | "phone" | "piggy-bank" | "plane-up" | "plane" | "play-arrow" | "play-circle" | "pound-coin-shine" | "pound-sign" | "print" | "raising-hands" | "reply-arrow" | "reply" | "reschedule" | "rocket-launch" | "rostering" | "salary-sacrifice" | "save" | "schedule-send" | "schedule" | "search-person" | "send" | "speaker-active" | "speaker" | "star-award" | "star-badge" | "star-circle" | "star-medal" | "star" | "steps-circle" | "stopwatch" | "suitcase" | "surfing" | "survey" | "swag-pillar-benefit" | "swag-pillar-career" | "swag-pillar-money" | "swag-pillar-work" | "swipe-right" | "tag" | "target" | "teams" | "thumb-down" | "thumb-up" | "timesheet" | "touch-id" | "trash-bin" | "unlock" | "user" | "video-1" | "video-2" | "warning" | "academic-hat-outlined" | "accommodation-outlined" | "activate-outlined" | "add-credit-card-outlined" | "add-person-outlined" | "add-section-outlined" | "add-time-outlined" | "add" | "adjustment-outlined" | "afternoon-outlined" | "ai-outlined" | "alignment-2-outlined" | "alignment-outlined" | "all-caps" | "application-outlined" | "arrow-down" | "arrow-downwards" | "arrow-left" | "arrow-leftwards" | "arrow-right" | "arrow-rightwards" | "arrow-up" | "arrow-upwards" | "article-outlined" | "at-sign" | "auto-graph-outlined" | "automotive-outlined" | "bakery-outlined" | "bar-outlined" | "beauty-outlined" | "beer-outlined" | "bell-active-outlined" | "bell-outlined" | "bell-slash-outlined" | "bill-management-outlined" | "billing-outlined" | "body-outlined" | "bolt-outlined" | "book-outlined" | "bookmark-added-outlined" | "bookmark-checked-outlined" | "bookmark-outlined" | "box-1-outlined" | "box-check-outlined" | "box-outlined" | "bullet-points" | "cake-outlined" | "calculator-outlined" | "calendar-dates-outlined" | "calendar-edit-outlined" | "calendar-star-outlined" | "call-outlined" | "call-split-outlined" | "camera-outlined" | "cancel" | "car-forward-outlined" | "cashback-outlined" | "charging-station-outlined" | "chat-bubble-outlined" | "chat-unread-outlined" | "checkmark" | "circle-add-outlined" | "circle-cancel-outlined" | "circle-down-outlined" | "circle-info-outlined" | "circle-left-outlined" | "circle-ok-outlined" | "circle-question-outlined" | "circle-remove-outlined" | "circle-right-outlined" | "circle-up-outlined" | "circle-warning-outlined" | "clock-2-outlined" | "clock-in-outlined" | "clock-out-outlined" | "clock-outlined" | "cog-outlined" | "coin-outlined" | "coin-super-outlined" | "comment-outlined" | "contacts-outlined" | "contacts-user-outlined" | "credit-card-outlined" | "cultural-site-outlined" | "cup-outlined" | "dentistry-outlined" | "diamond-outlined" | "direction-arrows-outlined" | "directory-outlined" | "document-outlined" | "dollar-box-outlined" | "dollar-card-outlined" | "dollar-coin-shine-outlined" | "dollar-credit-card-outlined" | "dollar-sign" | "double-buildings-outlined" | "double-left-arrows" | "double-right-arrows" | "download-box-outlined" | "download-outlined" | "edit-template-outlined" | "edit-user-outlined" | "electronics-outlined" | "email-outlined" | "end-break-outlined" | "enter-arrow" | "entertainment-outlined" | "envelope-outlined" | "evening-outlined" | "expense-approval-outlined" | "expense-outlined" | "explore-outlined" | "extension-outlined" | "external-link" | "eye-invisible-outlined" | "eye-outlined" | "face-id" | "face-meh-outlined" | "face-open-smiley-outlined" | "face-sad-outlined" | "face-smiley-outlined" | "fastfood-outlined" | "feed-outlined" | "feedbacks-outlined" | "file-certified-outlined" | "file-clone-outlined" | "file-copy-outlined" | "file-dispose-outlined" | "file-dollar-certified-outlined" | "file-dollar-outlined" | "file-download-outlined" | "file-export-outlined" | "file-lock-outlined" | "file-outlined" | "file-pound-outlined" | "file-search-outlined" | "file-secured-outlined" | "file-statutory-outlined" | "file-verified-outlined" | "filter-outlined" | "fitness-outlined" | "folder-outlined" | "folder-upload-outlined" | "folder-user-outlined" | "form-outlined" | "funnel-filter-outline" | "goal-outlined" | "graph-outlined" | "grocery-outlined" | "hand-holding-user-outlined" | "handshake-outlined" | "happy-sun-outlined" | "health-bag-outlined" | "heart-outlined" | "history-outlined" | "home-active-outlined" | "home-outlined" | "id-card-outlined" | "image-outlined" | "import-outlined" | "instapay-outlined" | "italic" | "job-search-outlined" | "leave-approval-outlined" | "lighting-outlined" | "link-1" | "link-2" | "list-outlined" | "live-help-outlined" | "local_mall_outlined" | "location-on-outlined" | "location-outlined" | "lock-outlined" | "locked-file-outlined" | "log-out" | "mail-outlined" | "map-outlined" | "media-content-outlined" | "menu-close" | "menu-expand" | "menu-fold-outlined" | "menu-unfold-outlined" | "moneybag-outlined" | "moon-outlined" | "more-horizontal" | "more-vertical" | "morning-outlined" | "multiple-folders-outlined" | "multiple-users-outlined" | "near-me-outlined" | "node-outlined" | "number-points" | "overview-outlined" | "park-outlined" | "payment-summary-outlined" | "payslip-outlined" | "pencil-outlined" | "percentage" | "phone-outlined" | "piggy-bank-outlined" | "plane-outlined" | "play-circle-outlined" | "pound-box-outlined" | "pound-card-outlined" | "pound-coin-shine-outlined" | "pound-credit-card-outlined" | "print-outlined" | "profile-2user-outlined" | "propane-tank-outlined" | "qr-code-outlined" | "qualification-outlined" | "question-mark" | "re-assign" | "redeem" | "refresh" | "remove" | "reply-outlined" | "restart" | "restaurant-outlined" | "resume-outlined" | "return-arrow" | "rocket-launch-outlined" | "rostering-outlined" | "safety-outlined" | "save-outlined" | "schedule-outlined" | "search-outlined" | "search-secured-outlined" | "send-outlined" | "share-1" | "share-2" | "share-outlined-2" | "share-outlined" | "shield-check-outlined" | "shop-outlined" | "shopping_basket_outlined" | "show-chart-outlined" | "single-down-arrow" | "single-left-arrow" | "single-right-arrow" | "single-up-arrow" | "smart-match-outlined" | "sparkle-2-outlined" | "sparkle-outlined" | "speaker-active-outlined" | "speaker-outlined" | "star-circle-outlined" | "star-outlined" | "start-break-outlined" | "stash-outlined" | "stopwatch-outlined" | "strikethrough" | "styler-outlined" | "suitcase-clock-outlined" | "suitcase-outlined" | "survey-outlined" | "switch-outlined" | "sync" | "tag-outlined" | "target-outlined" | "tennis-outlined" | "thumb-down-outlined" | "thumb-up-outlined" | "ticket-outlined" | "timesheet-outlined" | "timesheets-outlined" | "today-outlined" | "transfer" | "transportation-outlined" | "trash-bin-outlined" | "umbrela-outlined" | "unavailability-outlined" | "unavailable" | "underline" | "union-outlined" | "unlock-outlined" | "upload-outlined" | "user-add-outlined" | "user-circle-outlined" | "user-gear-outlined" | "user-out-outlined" | "user-outlined" | "user-rectangle-outlined" | "video-1-outlined" | "video-2-outlined" | "volunteer-outlined" | "wallet-outlined" | "wellness-outlined" | undefined; export declare const renderPrefix: ({ state, prefix, }: { state: State; prefix?: IconName | React.ReactElement; }) => React.JSX.Element | undefined; export declare const renderMaxLengthMessage: ({ maxLength, state, currentLength, hideCharacterCount, }: { state: State; currentLength: number; maxLength?: number; hideCharacterCount: boolean; }) => false | React.JSX.Element; declare const TextInput: React.ForwardRefExoticComponent & React.RefAttributes>; export default TextInput;