import type { HTMLAttributes, ReactNode } from 'react'; import type { IconComponent } from '~/components/Icon/types'; import type { InlineHelpTextProps } from '~/components/InlineHelpText'; import type { BaseProps } from '~/types/component'; import type { Corners } from '~/types/corners'; import type { ValueOrResponsive } from '~/utilities/opaque-responsive'; type Size = 'sm' | 'md'; type TextAlign = 'left' | 'center' | 'right'; type InputType = 'email' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'number' | 'date' | 'time' | 'datetime-local'; type DisabledVariant = 'default' | 'static'; type Variant = 'outlined' | 'solid' | 'transparent'; type BaseWithAria = BaseProps & Pick; type Affix = string | JSX.Element | IconComponent; export interface TextInputBaseProps extends BaseWithAria, Omit { /** * Enables browser autocompletion. For a list of available autocompletion * options, view the * [docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) */ autoComplete?: string; /** * Indicates to the browser that the input should receive focus as soon as * it mounts. See * [docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautofocus) */ autoFocus?: boolean; /** * Specifies border radius for button. Default is `rounded`. */ corners?: Corners; /** * Indicates the user should not be able to interact with the input. See * [docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefdisabled) */ disabled?: boolean; /** * Determines the styling when the input is disabled. */ disabledVariant?: DisabledVariant; /** * Hides the label from view and sets `aria-label` on the input for * accessibility. A label should always be provided. */ hideLabel?: boolean; /** * Sets `display: inline-block;` on the outer node for inline usage. */ inline?: boolean; /** * Sets the label for the input; required. To hide the label, see * `hideLabel` prop. */ label: ReactNode; /** * Sets a maximum number of characters for the input. When combined with * `characterCount`, displays the maximum number next to the current * character count. */ maxLength?: number; /** * Enables multiline editing and renders a