UNPKG

@nish1896/rhf-mui-components

Version:

A suite of 20+ reusable Material UI components for React Hook Form to minimize your time and effort in creating and styling forms

20 lines (19 loc) 1.25 kB
import { type ChangeEvent, type ReactNode } from 'react'; import { type FieldValues, type Path, type Control, type RegisterOptions } from 'react-hook-form'; import type { FormLabelProps, FormHelperTextProps, TextFieldProps } from '../../types'; type InputPasswordProps = Omit<TextFieldProps, 'type' | 'InputProps'>; export type RHFPasswordInputProps<T extends FieldValues> = { fieldName: Path<T>; control: Control<T>; registerOptions?: RegisterOptions<T, Path<T>>; onValueChange?: (value: string, event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void; showLabelAboveFormField?: boolean; formLabelProps?: FormLabelProps; showPasswordIcon?: ReactNode; hidePasswordIcon?: ReactNode; errorMessage?: ReactNode; hideErrorMessage?: boolean; formHelperTextProps?: FormHelperTextProps; } & InputPasswordProps; declare const RHFPasswordInput: <T extends FieldValues>({ fieldName, control, registerOptions, onValueChange, label, showLabelAboveFormField, formLabelProps, showPasswordIcon, hidePasswordIcon, required, helperText, errorMessage, hideErrorMessage, formHelperTextProps, slotProps, ...rest }: RHFPasswordInputProps<T>) => import("react/jsx-runtime").JSX.Element; export default RHFPasswordInput;