import { BoxProps, ChakraComponent, ChakraProps } from '@chakra-ui/react'; import { default as React } from 'react'; import { HelperErrorTextType } from '../HelperErrorText/HelperErrorText'; import { AutoCompleteValues } from '../../utils/constantValues'; export declare const textInputTypesArray: readonly ["email", "hidden", "number", "password", "text", "textarea", "tel", "url"]; export type TextInputTypes = typeof textInputTypesArray[number]; export declare const TextInputFormats: { email: string; hidden: string; password: string; text: string; tel: string; textarea: string; url: string; }; export type TextInputVariants = "default" | "searchBar" | "searchBarSelect"; type InputElementProps = Omit, "color" | "height" | "width">; type TextAreaElementProps = Omit, "color" | "height" | "width">; interface BaseTextInputProps extends Pick { type?: TextInputTypes; } export type TextInputPropsWithHTML = BaseTextInputProps & (BaseTextInputProps["type"] extends "textarea" ? TextAreaElementProps : InputElementProps); export interface InputProps extends TextInputPropsWithHTML { /** FOR INTERNAL DS USE ONLY: Adds an aria-label or appends to an existing aria-label for screen readers.*/ additionalAriaLabel?: string; /** FOR INTERNAL DS USE ONLY: additional helper text id(s) to be used for the input's `aria-describedby` value. * If more than one, separate each with a space */ additionalHelperTextIds?: string; /** String value used to set the autocomplete attribute. */ autoComplete?: AutoCompleteValues; /** Populates the HelperErrorText for the standard state */ helperText?: HelperErrorTextType; /** Populates the HelperErrorText for the error state */ invalidText?: HelperErrorTextType; /** Adds a button to clear existing text in the input field. */ isClearable?: boolean; /** The callback function that is called when the clear button is clicked. */ isClearableCallback?: () => void; /** Adds the `disabled` and `aria-disabled` prop to the input when true */ isDisabled?: boolean; /** Adds errored styling to the input/textarea and helper text elements */ isInvalid?: boolean; /** Will add `required` and `aria-required` props to the input/textarea elements */ isRequired?: boolean; /** Provides text for a `Label` component if `showLabel` is set to true; * populates an `aria-label` attribute if `showLabel` is set to false. */ labelText: string | JSX.Element; /** Allows the '(required)' text to be changed for language purposes * Note: Parenthesis will be added automatically by the component */ requiredLabelText?: string; /** Offers the ability to hide the helper/invalid text. */ showHelperInvalidText?: boolean; /** Offers the ability to show the label onscreen or hide it. Refer to the * `labelText` property for more information. */ showLabel?: boolean; /** Whether or not to display the "(required)" text in the label text. * True by default. */ showRequiredLabel?: boolean; /** FOR INTERNAL DS USE ONLY: the input variant to display. */ textInputVariant?: TextInputVariants; } /** * The type used for `ref`s. We want to extend both `input` and `textarea` * since both are available to create through `TextInput`. */ export type TextInputRefType = HTMLInputElement & HTMLTextAreaElement; /** * Renders either an `input` element with a specified type or a `textarea` * element. All types will render an accessible `Label` component and an * optional `HelperErrorText` component. */ export declare const TextInput: ChakraComponent>, InputProps>; export default TextInput;