import { Props as ReactInputMaskProps } from '@jefferson-calmon/react-input-mask-fork'; import { ComponentProps, SizeValue } from '../../types'; import { DropdownProps } from '../Dropdown'; import { LoadingProps } from '../Loading'; import { MoneyArgs } from './Input.utils'; export type InputRole = 'default' | 'email' | 'phone' | 'currency' | 'cpf' | 'url' | 'number' | 'password' | 'cnpj'; export type InputAutoComplete = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'family-name' | 'honorific-suffix' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'impp' | 'url' | 'photo'; export interface InputPickerOption { value: string; disabled?: boolean; onClick?: () => void; } export interface InputProps extends Omit, 'ref'> { label?: string | React.ReactNode; mode?: ComponentProps<'input'>['inputMode']; role?: InputRole; mask?: string; autoComplete?: InputAutoComplete; width?: SizeValue; options?: InputPickerOption[]; error?: string; addon?: () => JSX.Element; invalid?: boolean; loading?: boolean; disabled?: boolean; currency?: { trigger?: 'focus' | 'render'; args?: MoneyArgs; }; maskProps?: Omit; dropdownProps?: Omit; loadingProps?: LoadingProps; onChangeValue?: (value: string) => void; onChange?: React.ChangeEventHandler; onFocus?: React.FocusEventHandler; onKeyUp?: React.KeyboardEventHandler; onBlur?: React.FocusEventHandler; children?: React.ReactNode | JSX.Element; ref: React.ForwardedRef; } export interface InputForwardedProps extends ComponentProps<'input'> { } export type InputAttributes = ReactInputMaskProps & Omit, 'theme'>; export type InputError = any;