UNPKG

react-fatless-form

Version:

A lightweight React form package designed for simplicity that simplifies form handling and validation without unnecessary complexity or bloat.

164 lines (163 loc) 3.46 kB
import React from "react"; declare const DefaultInput: React.ForwardRefExoticComponent<(({ type: "file"; accept?: string; multiple?: boolean; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "date"; minDate?: Date; maxDate?: Date; timePicker?: boolean; placeholder?: string; rightIcon?: React.JSX.Element; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "time"; minTime?: string; maxTime?: string; placeholder?: string; rightIcon?: React.JSX.Element; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "select"; options: { label: string; value: string | number; }[]; loading?: boolean; multiple?: boolean; placeholder?: string; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "checkbox"; checked?: boolean; options?: { label: string; value: string | number; }[]; slider?: "rounded" | "default"; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "radio"; options: { label: string; value: string | number; }[]; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "textarea"; cols?: number; rows?: number; wrap?: "hard" | "soft"; readonly?: boolean; maxlength?: number; placeholder?: string; autofocus?: boolean; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | ({ type: "password"; placeholder?: string; showStrengthIndicator?: boolean; passwordPolicy?: (password: string) => { strength: number; message: string; }; showIcon?: React.ReactNode; hideIcon?: React.ReactNode; autofocus?: boolean; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }) | Omit<{ type: "text" | "number" | "email" | "tel" | "url"; placeholder?: string; autofocus?: boolean; autocomplete?: "on" | "off"; minlength?: number; maxlength?: number; pattern?: string; readOnly?: boolean; ref?: React.Ref<HTMLInputElement>; } & { id?: string; name: string; label: string; disabled?: boolean; required?: boolean; className?: string; style?: React.CSSProperties; } & { error?: string; }, "ref">) & React.RefAttributes<HTMLInputElement>>; export default DefaultInput;