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.

41 lines (40 loc) 1.36 kB
import { FormHelperTextProps, FormLabelProps } from "../../types/mui.js"; import { ReactNode, SyntheticEvent } from "react"; import * as react_jsx_runtime0 from "react/jsx-runtime"; import { Control, FieldValues, Path, RegisterOptions } from "react-hook-form"; import { RatingProps } from "@mui/material/Rating"; //#region src/mui/rating/index.d.ts type InputRatingProps = Omit<RatingProps, 'name' | 'onChange' | 'error' | 'value' | 'defaultValue'>; type RHFRatingProps<T extends FieldValues> = { fieldName: Path<T>; control: Control<T>; registerOptions?: RegisterOptions<T, Path<T>>; required?: boolean; onValueChange?: (newValue: number | null, event: SyntheticEvent<Element, Event>) => void; label?: ReactNode; showLabelAboveFormField?: boolean; formLabelProps?: FormLabelProps; helperText?: ReactNode; errorMessage?: ReactNode; hideErrorMessage?: boolean; formHelperTextProps?: FormHelperTextProps; } & InputRatingProps; declare const RHFRating: <T extends FieldValues>({ fieldName, control, registerOptions, required, onValueChange, disabled: muiDisabled, label, showLabelAboveFormField, formLabelProps, helperText, errorMessage, hideErrorMessage, formHelperTextProps, onBlur, ...rest }: RHFRatingProps<T>) => react_jsx_runtime0.JSX.Element; //#endregion export { RHFRatingProps, RHFRating as default };