import React from 'react'; import type { DimensionValue, TextInput as RNTextInput, TextInputProps as RNTextInputProps, } from 'react-native'; import type { ThemeVars } from '@coinbase/cds-common/core/theme'; import type { SharedInputProps } from '@coinbase/cds-common/types/InputBaseProps'; import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps'; import type { SharedProps } from '@coinbase/cds-common/types/SharedProps'; import type { TextAlignProps } from '@coinbase/cds-common/types/TextBaseProps'; import { type InputStackBaseProps } from './InputStack'; export type TextInputSize = 's' | 'm' | 'l'; export type TextInputBaseProps = SharedProps & Pick< SharedAccessibilityProps, 'accessibilityLabel' | 'accessibilityLabelledBy' | 'accessibilityHint' > & Pick< SharedInputProps, 'label' | 'labelFont' | 'labelColor' | 'placeholder' | 'helperText' | 'readOnly' > & Pick< InputStackBaseProps, | 'height' | 'variant' | 'width' | 'disabled' | 'borderRadius' | 'enableColorSurge' | 'focusedBorderWidth' | 'inputBackground' > & { /** * Aligns text inside input and helperText * @default start */ align?: TextAlignProps['align']; /** * Typography font token for the field (passed through to `NativeInput` as `font`), same token family as `align`. * @default body */ font?: ThemeVars.Font; /** * Adds suffix text to the end of input */ suffix?: string; /** Adds content to the start of the inner input. Refer to diagram for location of startNode in InputStack component */ start?: React.ReactNode; /** Adds content to the end of the inner input. Refer to diagram for location of endNode in InputStack component */ end?: React.ReactNode; /** * Add ability to test individual parts of the input */ testIDMap?: { start?: string; end?: string; label?: string; helperText?: string; }; /** * Accessibility label for helper text error icon when variant='negative' * @default 'error' */ helperTextErrorIconAccessibilityLabel?: string; /** * React node to render label. Takes precedence over `label`. * @note if both labelNode and label are provided, label will still be used as accessibility label for the input if no accessibilityLabel is provided. */ labelNode?: React.ReactNode; /** * Determines if the input should have a border. * When set to `false`, focus border styling is disabled by default. * @default true */ bordered?: boolean; /** * Controls overall density of the input field, inside of the border. * @default 'l' */ size?: TextInputSize; /** * Enables compact variation. Prefer `size="s"` or `size="m"` with an explicit `labelVariant`. * * @deprecated Unset and use `size="s"` instead. This will be removed in a future major release. * @deprecationExpectedRemoval v10 */ compact?: boolean; /** * Determines where the provided label/labelNode is rendered. * By default, the label is rendered outisde, above the input element. * When size is `l` (the default), an `inside` label is stacked vertically with the input; otherwise is rendered horizontally. * @default 'outside' */ labelVariant?: 'inside' | 'outside'; }; export type TextInputProps = TextInputBaseProps & Omit & { value?: RNTextInputProps['value']; onChange?: RNTextInputProps['onChange']; onChangeText?: RNTextInputProps['onChangeText']; /** * minimum height of input * @default auto */ minHeight?: DimensionValue; /** * Native TextInput textAlign with the extra unset option to remove the textAlign style. * Use this to workaround the issue where long text does not ellipsis in TextInput */ textAlign?: RNTextInputProps['textAlign'] | 'unset'; }; export declare const TextInput: React.MemoExoticComponent< ({ ref, ..._props }: TextInputProps & { ref?: React.Ref; }) => import('react/jsx-runtime').JSX.Element >; //# sourceMappingURL=TextInput.d.ts.map