UNPKG

@start-base/react-form-elements

Version:

Simplify form elements and form management. Selection of user friendly inputs and wide customization abilities to match your design and functionality.

38 lines (34 loc) 1.29 kB
import React, { ChangeEvent } from 'react'; import { FieldError } from 'react-hook-form'; interface DateRangePickerInputProps { from: Date; to: Date; } type InputProps = { name: string; onChange: (e: ChangeEvent<HTMLInputElement>) => void; error?: boolean | string | { message?: string; } | null | undefined | FieldError; label?: string | null; placeholder?: string | undefined; value?: string | boolean | number | Date | Date[] | DateRangePickerInputProps; inputClassName?: string | null; labelClassName?: string | null; errorClassName?: string | null; prepend?: React.ReactNode | JSX.Element | null; prependClassName?: string | null; append?: React.ReactNode | JSX.Element | null; appendClassName?: string | null; disableShrink?: boolean; disabled?: boolean; } & React.InputHTMLAttributes<HTMLInputElement>; interface PhoneInputProps extends InputProps { name: string; onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; value?: string | number; defaultCountry?: string; [key: string]: any; } declare const PhoneInput: React.ForwardRefExoticComponent<Omit<PhoneInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>; export { type PhoneInputProps, PhoneInput as default };