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.

36 lines (35 loc) 1.18 kB
import { CheckboxProps, FormControlLabelProps, FormHelperTextProps } 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/checkbox/index.d.ts type RHFCheckboxProps<T extends FieldValues> = { fieldName: Path<T>; control: Control<T>; registerOptions?: RegisterOptions<T, Path<T>>; onValueChange?: (isChecked: boolean, event: ChangeEvent<HTMLInputElement>) => void; label?: ReactNode; formControlLabelProps?: FormControlLabelProps; helperText?: ReactNode; errorMessage?: ReactNode; hideErrorMessage?: boolean; formHelperTextProps?: FormHelperTextProps; } & CheckboxProps; declare const RHFCheckbox: <T extends FieldValues>({ fieldName, control, registerOptions, onValueChange, disabled: muiDisabled, label, formControlLabelProps, helperText, errorMessage, hideErrorMessage, formHelperTextProps, onBlur, slotProps: muiSlotProps, ...rest }: RHFCheckboxProps<T>) => react_jsx_runtime0.JSX.Element; //#endregion export { RHFCheckboxProps, RHFCheckbox as default };