@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.
48 lines (45 loc) • 1.78 kB
text/typescript
import React, { ChangeEvent, JSX } 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>;
declare const Input: React.ForwardRefExoticComponent<{
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> & React.RefAttributes<HTMLInputElement>>;
export { type DateRangePickerInputProps, type InputProps, Input as default };