Skip to content

Commit c19435a

Browse files
authored
v4.3.2 - Update mui-components to 1.1.4, update jsdocs and bug fix for RHFFileUploader and RHFNativeSelect (#78)
* bump pkg version, mui-components to 1.1.4; update README * add jsdoc for ConfigProvider, DefaultRHFMuiConfig; update README * Update JSDoc for countryList and selectAllOptionValue * RHFNativeSelect pass OptionRenderState in renderOptionLabel
1 parent 7db37c3 commit c19435a

13 files changed

Lines changed: 77 additions & 42 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
<b>A suite of 25+ production-ready <a href="https://mui.com/">Material UI</a> components for <a href="https://react-hook-form.com/">react-hook-form</a> — fully typed, tree-shakable, and built to cut form boilerplate down to a handful of props.</b>
1818
</p>
1919

20-
> **Powered by [Mui Components](https://mui-components-docs.vercel.app/)**
20+
> **Powered by [Mui Components](https://mui-components-docs.vercel.app)**
2121
>
22-
> From **v4.2.0** onwards, every component delegates its rendering and core logic to the form-library-agnostic **[@nish1896/mui-components](https://www.npmjs.com/package/@nish1896/mui-components)** the same Material UI components, driven by a plain `value` / `onValueChange` pair instead of RHF bindings.
22+
> From **v4.2.0** onwards, every component delegates its rendering and core logic to the form-library-agnostic **[@nish1896/mui-components](https://www.npmjs.com/package/@nish1896/mui-components)** - the same Material UI components, driven by a plain `value` / `onValueChange` pair instead of RHF bindings.
2323
>
24-
> Worth checking out if you're building forms with plain React state or any other form library, or need Material UI components without wiring custom UI logic for commonly used components.
24+
> Worth checking out if:
25+
> - You're building forms with plain React state or any other form library
26+
> - You want Material UI components for common fields, pre-wired, without writing the binding logic yourself
2527
2628
## ✨ Features
2729

apps/rhf-mui-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nish1896/rhf-mui-demo",
3-
"version": "4.3.1",
3+
"version": "4.3.2",
44
"private": true,
55
"author": "Nishant Kohli",
66
"scripts": {

apps/rhf-mui-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nish1896/rhf-mui-docs",
3-
"version": "4.3.1",
3+
"version": "4.3.2",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",

changelog/v4.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog - v4
22

3+
## [4.3.2](https://github.com/nishkohli96/rhf-mui-components/tree/v4.3.2)
4+
5+
**Released — 28 August, 2026**
6+
7+
### ✨ Enhancements
8+
- Update `mui-components` to `v1.1.4`
9+
- Add JSDoc for `ConfigProvider`, `DefaultRHFMuiConfig`
10+
- Update JSDoc for `countryList` and `selectAllOptionValue`
11+
12+
### 🐞 Bug Fixes
13+
- `RHFFileUploader`: Fixed single-file mode wiping the current value to `null` when a replacement file was rejected (invalid type/size or over `maxFiles`) — the current file is now kept instead.
14+
- `RHFNativeSelect`: Fixed `renderOptionLabel` not receiving the option's `state` (`disabled`/`selected`) — now matches the signature used by `RHFSelect` and other option-based components.
15+
16+
317
## [4.3.1](https://github.com/nishkohli96/rhf-mui-components/tree/v4.3.1)
418

519
**Released — 13 August, 2026**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nish1896/rhf-mui-components-root",
3-
"version": "4.3.1",
3+
"version": "4.3.2",
44
"description": "A suite of 25+ production-ready react-hook-form components built with material-ui. Fully typed, tree-shakable, and optimized for enterprise-grade forms.",
55
"author": "Nishant Kohli",
66
"private": true,

packages/rhf-mui-components/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
<b>A suite of 25+ production-ready <a href="https://mui.com/">Material UI</a> components for <a href="https://react-hook-form.com/">react-hook-form</a> — fully typed, tree-shakable, and built to cut form boilerplate down to a handful of props.</b>
1818
</p>
1919

20-
> **Powered by [Mui Components](https://mui-components-docs.vercel.app/)**
20+
> **Powered by [Mui Components](https://mui-components-docs.vercel.app)**
2121
>
22-
> From **v4.2.0** onwards, every component delegates its rendering and core logic to the form-library-agnostic **[@nish1896/mui-components](https://www.npmjs.com/package/@nish1896/mui-components)** the same Material UI components, driven by a plain `value` / `onValueChange` pair instead of RHF bindings.
22+
> From **v4.2.0** onwards, every component delegates its rendering and core logic to the form-library-agnostic **[@nish1896/mui-components](https://www.npmjs.com/package/@nish1896/mui-components)** - the same Material UI components, driven by a plain `value` / `onValueChange` pair instead of RHF bindings.
2323
>
24-
> Worth checking out if you're building forms with plain React state or any other form library, or need Material UI components without wiring custom UI logic for commonly used components.
24+
> Worth checking out if:
25+
> - You're building forms with plain React state or any other form library
26+
> - You want Material UI components for common fields, pre-wired, without writing the binding logic yourself
2527
2628
## ✨ Features
2729

packages/rhf-mui-components/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nish1896/rhf-mui-components",
3-
"version": "4.3.1",
3+
"version": "4.3.2",
44
"description": "A suite of 25+ production-ready react-hook-form components built with material-ui. Fully typed, tree-shakable, and optimized for enterprise-grade forms.",
55
"author": "Nishant Kohli",
66
"homepage": "https://rhf-mui-components.vercel.app/",
@@ -16,7 +16,7 @@
1616
"type": "module",
1717
"sideEffects": false,
1818
"dependencies": {
19-
"@nish1896/mui-components": "^1.1.2"
19+
"@nish1896/mui-components": "^1.1.4"
2020
},
2121
"devDependencies": {
2222
"@ckeditor/ckeditor5-core": "43.3.0",
@@ -62,11 +62,7 @@
6262
"./mui-pickers/*": "./dist/mui-pickers/*/index.js",
6363
"./misc": "./dist/misc/index.js",
6464
"./misc/*": "./dist/misc/*/index.js",
65-
"./types": "./dist/types/index.js",
66-
"./types/*": {
67-
"types": "./dist/types/*.d.ts",
68-
"default": "./dist/types/index.js"
69-
}
65+
"./types": "./dist/types/index.js"
7066
},
7167
"types": "./index.d.ts",
7268
"keywords": [

packages/rhf-mui-components/src/common/types/components.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export type CustomOnChangeProps<T, V> = T & {
3939
};
4040

4141
/**
42-
* Per-option state handed to `renderOptionLabel` so custom labels can react to
43-
* the option's current status — e.g. dim a disabled option or emphasise the
44-
* selected one.
42+
* Per-option state handed to `renderOptionLabel` so custom labels can react
43+
* to the option's current status — e.g. dim a disabled option or emphasise
44+
* the selected one.
4545
*
4646
* Used by the form-control option components (radio group, checkbox group,
4747
* select). The Autocomplete family passes MUI's `AutocompleteRenderOptionState`
@@ -50,8 +50,8 @@ export type CustomOnChangeProps<T, V> = T & {
5050
*/
5151
export type OptionRenderState = {
5252
/**
53-
* Whether the option is currently non-interactive — either the whole field is
54-
* disabled or the option was disabled via `getOptionDisabled`.
53+
* Whether the option is currently non-interactive — either the whole
54+
* field is disabled or the option was disabled via `getOptionDisabled`.
5555
*/
5656
disabled: boolean;
5757
/** Whether the option is part of the current selection. */

packages/rhf-mui-components/src/config/ConfigProvider.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ type ConfigProviderProps = {
99
export const RHFMuiConfigContext
1010
= createContext<RHFMuiConfig>(DefaultRHFMuiConfig);
1111

12+
/**
13+
* Context provider that sets shared defaults for all `RHF*` components
14+
* mounted beneath it, including default `sx` overrides for `FormLabel`,
15+
* `FormControlLabel`, and `FormHelperText`, a shared `dateAdapter` for
16+
* all pickers, and whether field labels render above their controls by default.
17+
*
18+
* Each config key is merged on top of `DefaultRHFMuiConfig`, so you
19+
* only need to pass the keys you want to override.
20+
*
21+
* Docs: [Customization](https://rhf-mui-components.vercel.app/v4/customization)
22+
*/
1223
export const ConfigProvider = ({
1324
children,
1425
defaultFormHelperTextSx,

packages/rhf-mui-components/src/config/DefaultConfig.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ const DefaultStyles = Object.freeze({
88
},
99
});
1010

11+
/**
12+
* Baseline `RHFMuiConfig` every `RHF*` component falls back to when
13+
* no `ConfigProvider` is mounted, or a given config key is left unset.
14+
*
15+
* Only supplies default `sx` overrides for `FormLabel`/`FormControlLabel`/
16+
* `FormHelperText` spacing — `dateAdapter` and `allLabelsAboveFields` have
17+
* no default and stay `undefined` until a `ConfigProvider` sets them.
18+
*
19+
* Docs: [Customization](https://rhf-mui-components.vercel.app/v4/customization)
20+
*/
1121
export const DefaultRHFMuiConfig: RHFMuiConfig = {
1222
defaultFormLabelSx: { mb: DefaultStyles.margin.bottom },
1323
defaultFormControlLabelSx: {},

0 commit comments

Comments
 (0)