UNPKG

@masaischool/lotus

Version:

Masai UI component library designed to work seamlessly with Chakra UI

56 lines (55 loc) 2.33 kB
import { ReactElement } from 'react'; export interface Props { label?: string; /** Placeholder*/ placeholder?: string; /** Type of InputField */ type?: 'text' | 'password' | 'email' | 'url' | 'tel' | 'file'; /** input field with Leading dropdown */ leadingDropdown?: boolean | null; /** input filed with trailing dropdown */ trailingDropdown?: boolean; leadingText?: string; helperText?: string | null; rightIcon?: ReactElement; errorMessage?: string | null; leftIcon?: ReactElement | null; disabled?: boolean; /** The label for the check box */ forVal?: string; /** Text to be displayed when input validation is a success */ validateSuccessText?: string; /** Text to be displayed when input validation is a failure */ validateErrorText?: string; /** Change whether the input is valid or not */ isInvalid?: boolean; /** max length of input */ maxLength?: number; /** InputField getValue callback */ getValueCallback?: ((value: string) => void) | null; /** InputField getFile callback */ getFileCallback?: ((value: File[]) => void) | null; getDropdownValueCallback?: ((value: string) => void) | null; /** Optional width setting */ width?: string; /** Set if form has been submitted and clear value if it has */ isSubmitted?: boolean; /** Prefilled value */ preFilledValue?: string; /** * Disable autofill * added new-password, see * https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#preventing_autofilling_with_autocompletenew-password * */ autocomplete?: 'on' | 'off' | 'new-password'; /** max files */ maxFiles?: 1 | 2 | 3 | 4 | 5; /** min / max */ min?: number; max?: number; isPasswordFiled?: boolean; size?: string; required?: boolean; onClick?: () => void; } export declare const Input: ({ label, placeholder, type, leadingDropdown, trailingDropdown, leadingText, rightIcon, helperText, errorMessage, leftIcon, isInvalid, disabled, forVal, min, max, maxLength, preFilledValue, getValueCallback, autocomplete, isPasswordFiled, width, required, getDropdownValueCallback, onClick, }: Props) => JSX.Element;