UNPKG

@nish1896/rhf-mui-components

Version:

A suite of 20+ production-ready react-hook-form components built with material-ui. Fully typed, tree-shakable, and optimized for enterprise-grade forms.

37 lines (36 loc) 1.2 kB
import { FormHelperTextProps, FormLabelProps, TextFieldProps } from "../../types/mui.js"; import { ChangeEvent, ReactNode } from "react"; import * as react_jsx_runtime0 from "react/jsx-runtime"; import { Control, FieldValues, Path, RegisterOptions } from "react-hook-form"; //#region src/mui/textfield/index.d.ts type RHFTextFieldProps<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; errorMessage?: ReactNode; hideErrorMessage?: boolean; formHelperTextProps?: FormHelperTextProps; } & TextFieldProps; declare const RHFTextField: <T extends FieldValues>({ fieldName, control, registerOptions, onValueChange, disabled: muiDisabled, label, showLabelAboveFormField, formLabelProps, required, helperText, errorMessage, hideErrorMessage, formHelperTextProps, onBlur, autoComplete, ...rest }: RHFTextFieldProps<T>) => react_jsx_runtime0.JSX.Element; //#endregion export { RHFTextFieldProps, RHFTextField as default };