@mui/utils 5.13.7 → 5.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +164 -7
  2. package/esm/index.js +2 -0
  3. package/esm/useControlled/index.js +2 -0
  4. package/esm/useControlled/useControlled.js +2 -0
  5. package/esm/useEnhancedEffect/index.js +2 -0
  6. package/esm/useEnhancedEffect/useEnhancedEffect.js +2 -0
  7. package/esm/useEventCallback/index.js +2 -0
  8. package/esm/useEventCallback/useEventCallback.js +6 -2
  9. package/esm/useForkRef/index.js +2 -0
  10. package/esm/useForkRef/useForkRef.js +2 -0
  11. package/esm/useId/index.js +2 -0
  12. package/esm/useId/useId.js +2 -0
  13. package/esm/useIsFocusVisible.js +2 -0
  14. package/esm/usePreviousProps.js +2 -0
  15. package/index.js +2 -1
  16. package/legacy/index.js +3 -1
  17. package/legacy/useControlled/index.js +2 -0
  18. package/legacy/useControlled/useControlled.js +2 -0
  19. package/legacy/useEnhancedEffect/index.js +2 -0
  20. package/legacy/useEnhancedEffect/useEnhancedEffect.js +2 -0
  21. package/legacy/useEventCallback/index.js +2 -0
  22. package/legacy/useEventCallback/useEventCallback.js +6 -2
  23. package/legacy/useForkRef/index.js +2 -0
  24. package/legacy/useForkRef/useForkRef.js +2 -0
  25. package/legacy/useId/index.js +2 -0
  26. package/legacy/useId/useId.js +2 -0
  27. package/legacy/useIsFocusVisible.js +2 -0
  28. package/legacy/usePreviousProps.js +2 -0
  29. package/modern/index.js +3 -1
  30. package/modern/useControlled/index.js +2 -0
  31. package/modern/useControlled/useControlled.js +2 -0
  32. package/modern/useEnhancedEffect/index.js +2 -0
  33. package/modern/useEnhancedEffect/useEnhancedEffect.js +2 -0
  34. package/modern/useEventCallback/index.js +2 -0
  35. package/modern/useEventCallback/useEventCallback.js +6 -2
  36. package/modern/useForkRef/index.js +2 -0
  37. package/modern/useForkRef/useForkRef.js +2 -0
  38. package/modern/useId/index.js +2 -0
  39. package/modern/useId/useId.js +2 -0
  40. package/modern/useIsFocusVisible.js +2 -0
  41. package/modern/usePreviousProps.js +2 -0
  42. package/package.json +2 -2
  43. package/useControlled/index.js +1 -0
  44. package/useControlled/useControlled.js +2 -2
  45. package/useEnhancedEffect/index.js +1 -0
  46. package/useEnhancedEffect/useEnhancedEffect.js +1 -0
  47. package/useEventCallback/index.js +1 -0
  48. package/useEventCallback/useEventCallback.d.ts +3 -1
  49. package/useEventCallback/useEventCallback.js +6 -2
  50. package/useForkRef/index.js +1 -0
  51. package/useForkRef/useForkRef.js +1 -0
  52. package/useId/index.js +1 -0
  53. package/useId/useId.js +1 -0
  54. package/useIsFocusVisible.js +2 -2
  55. package/usePreviousProps.js +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,162 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.14.1
4
+
5
+ <!-- generated comparing v5.14.0..master -->
6
+
7
+ _Jul 19, 2023_
8
+
9
+ A big thanks to the 24 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 💫 Introducing some new components for Joy UI:
12
+ - [Skeleton](https://mui.com/joy-ui/react-skeleton/) component (#37893) @siriwatknp
13
+ - [ToggleButton](https://mui.com/joy-ui/react-toggle-button-group/) (#37716) @siriwatknp
14
+ - 🎉 Base UI has its own [landing page](https://www.mui.com/base-ui)!
15
+ - 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements.
16
+
17
+ ### `@mui/material@5.14.1`
18
+
19
+ - &#8203;<!-- 14 -->[FormControlLabel] Fix misplaced asterisk when `labelPlacement` is provided (#37831) @ZeeshanTamboli
20
+ - &#8203;<!-- 11 -->[Slider][material] Fix type dependency on @types/prop-types (#37853) @Methuselah96
21
+ - &#8203;<!-- 10 -->[Menu] Add MuiMenuList to createTheme components key (#37956) @mj12albert
22
+ - &#8203;<!-- 09 -->[Modal] Remove deprecated `BackdropComponent` and `BackdropProps` from tests (#38018) @sai6855
23
+
24
+ ### `@mui/material-next@6.0.0-alpha.93`
25
+
26
+ - &#8203;<!-- 54 -->[Slider][material-next] Add use client directive to useSliderElementsOverlap (#37955) @mj12albert
27
+ - &#8203;<!-- 47 -->[Button][material-next] Fix some event handlers being ignored (#37647) @DiegoAndai
28
+
29
+ ### `@mui/base@5.0.0-beta.8`
30
+
31
+ - &#8203;<!-- 53 -->[Autocomplete] Make touch and click behavior on an option consistent (#37972) @divyammadhok
32
+
33
+ ### `@mui/joy@5.0.0-alpha.88`
34
+
35
+ - &#8203;<!-- 13 -->[Joy][Select] Fix type error caused by custom variant (#37996) @OmPr366
36
+ - &#8203;<!-- 12 -->[ToggleButton][Joy] Add `ToggleButton` component (#37716) @siriwatknp
37
+ - &#8203;<!-- 07 -->[Skeleton] Add Joy UI `Skeleton` component (#37893) @siriwatknp
38
+
39
+ ### `@mui/utils@5.14.1`
40
+
41
+ - &#8203;<!-- 06 -->[utils] Add function overload for `useEventCallback` (#37827) @cherniavskii
42
+
43
+ ### Docs
44
+
45
+ - &#8203;<!-- 52 -->[docs][base] Add Tailwind CSS & plain CSS demo on the form control page (#37914) @mnajdova
46
+ - &#8203;<!-- 51 -->[docs][base] Make Base UI Select demos denser (#37836) @zanivan
47
+ - &#8203;<!-- 38 -->[docs] Link Material UI from the landing page (#37971) @oliviertassinari
48
+ - &#8203;<!-- 37 -->[docs] Fix the empty /components page (#38010) @brijeshb42
49
+ - &#8203;<!-- 36 -->[docs] Checkout template follows user's color scheme preference (#37928) @OndrejHj04
50
+ - &#8203;<!-- 35 -->[docs] Disable ad for onboarding pages (#37998) @oliviertassinari
51
+ - &#8203;<!-- 34 -->[docs] Fix broken link to Base UI Next.js App Router (#37973) @oliviertassinari
52
+ - &#8203;<!-- 33 -->[docs] Fix typo in next-js-app-router.md (#37974) @ericbrian
53
+ - &#8203;<!-- 32 -->[docs] Add pnpm commands to Material UI Installation page (#36650) @officialrajdeepsingh
54
+ - &#8203;<!-- 31 -->[docs] Link charts in the roadmap (#37944) @oliviertassinari
55
+ - &#8203;<!-- 30 -->[docs] Improve changelog @oliviertassinari
56
+ - &#8203;<!-- 29 -->[docs] Improve the Select docs (#37279) @michaldudak
57
+ - &#8203;<!-- 16 -->[docs][menu] Add Tailwind CSS & plain CSS demo on the Menu page (#37856) @mnajdova
58
+ - &#8203;<!-- 15 -->[example] Update EmotionCacheProvider to work with GlobalStyles (#37962) @siriwatknp
59
+
60
+ ### Core
61
+
62
+ - &#8203;<!-- 50 -->[blog] Add blog post about support for Next.js App Router (#37929) @samuelsycamore
63
+ - &#8203;<!-- 49 -->[blog] Blog MUI X pro statement removed (#38015) @prakhargupta1
64
+ - &#8203;<!-- 48 -->[blog] Add Toolpad beta announcement blog (#37799) @prakhargupta1
65
+ - &#8203;<!-- 46 -->[core] Increase space available for sidenav @oliviertassinari
66
+ - &#8203;<!-- 45 -->[core] Adds `component` prop to `OverrideProps` type (#35924) @sai6855
67
+ - &#8203;<!-- 44 -->[core] Fix rsc build step in CI (#38019) @mj12albert
68
+ - &#8203;<!-- 43 -->[core] Remove nx dependency (#37964) @Janpot
69
+ - &#8203;<!-- 42 -->[core] Lock `@types/node` to v18 (#37965) @ZeeshanTamboli
70
+ - &#8203;<!-- 41 -->[core] Update priority support issue template and prompt (#37824) @DanailH
71
+ - &#8203;<!-- 40 -->[core] Remove warnings in docs:api (#37858) @alexfauquette
72
+ - &#8203;<!-- 39 -->[core] Make rimraf work after a major update (#37930) @michaldudak
73
+ - &#8203;<!-- 28 -->[docs-infra] Change the Diamond Sponsor block positioning on the side nav (#37933) @danilo-leal
74
+ - &#8203;<!-- 27 -->[docs-infra] Support backticks in the codeblocks (#37950) @cherniavskii
75
+ - &#8203;<!-- 26 -->[docs-infra] Improve performance hideToolbar: true (#37969) @oliviertassinari
76
+ - &#8203;<!-- 25 -->[docs-infra] Fix button label on mobile (#37997) @oliviertassinari
77
+ - &#8203;<!-- 24 -->[docs-infra] Square drawer corners (#37970) @oliviertassinari
78
+ - &#8203;<!-- 23 -->[docs-infra] Improve tab contrast in codeblock (#38000) @oliviertassinari
79
+ - &#8203;<!-- 22 -->[docs-infra] Fix API generation for Base UI (#37941) @oliviertassinari
80
+ - &#8203;<!-- 21 -->[docs-infra] Fix layout shift on xGrid (#37954) @oliviertassinari
81
+ - &#8203;<!-- 20 -->[docs-infra] Update installation commands to use the new tabs code component (#37927) @danilo-leal
82
+ - &#8203;<!-- 19 -->[docs-infra] Improve disableToc={true} support (#37931) @oliviertassinari
83
+ - &#8203;<!-- 18 -->[docs-infra] Remove icons and tweak the design of the side nav (#37860) @danilo-leal
84
+ - &#8203;<!-- 17 -->[docs-infra] Fix TypeScrit error in demo export (#37830) @oliviertassinari
85
+ - &#8203;<!-- 08 -->[notifications] Add notification for first Charts release (#37679) @joserodolfofreitas
86
+ - &#8203;<!-- 05 -->[website] Add Base UI marketing page (#36622) @siriwatknp
87
+ - &#8203;<!-- 04 -->[website] Update MUI X landing page (#37966) @cherniavskii
88
+ - &#8203;<!-- 03 -->[website] Fix a11y issues (#37999) @oliviertassinari
89
+ - &#8203;<!-- 02 -->[website] Make the Core page refer to group of products (#37608) @danilo-leal
90
+ - &#8203;<!-- 01 -->[website] Add perpetual option to pricing page (#35504) @joserodolfofreitas
91
+
92
+ All contributors of this release in alphabetical order: @alexfauquette, @brijeshb42, @cherniavskii, @DanailH, @danilo-leal, @DiegoAndai, @divyammadhok, @ericbrian, @Janpot, @joserodolfofreitas, @Methuselah96, @michaldudak, @mj12albert, @mnajdova, @officialrajdeepsingh, @oliviertassinari, @OmPr366, @OndrejHj04, @prakhargupta1, @sai6855, @samuelsycamore, @siriwatknp, @zanivan, @ZeeshanTamboli
93
+
94
+ ## 5.14.0
95
+
96
+ <!-- generated comparing v5.13.7..master -->
97
+
98
+ _Jul 11, 2023_
99
+
100
+ A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
101
+
102
+ - 💫 Material UI, Joy UI, and Base UI are compatible with [NextJS App Router](https://nextjs.org/docs/app) (#37656) @mj12albert
103
+ - 📚 Added new guides for integrating with Next.js 13 App Router (#37656) @mj12albert
104
+ - Ⓜ️ [Material UI guide](https://mui.com/material-ui/guides/next-js-app-router/)
105
+ - 🅙 [Joy UI guide](https://mui.com/joy-ui/guides/next-js-app-router/)
106
+ - 🅱️ [Base UI guide](https://mui.com/base-ui/guides/next-js-app-router/)
107
+ - 🐛 bug fixes, 📚 documentation, and ⚙️ infrastructure improvements.
108
+
109
+ ### `@mui/material@5.14.0`
110
+
111
+ - [Autocomplete] Enable global customization of different options (#36971) @nicolas-ot
112
+
113
+ ### `@mui/material-next@6.0.0-alpha.92`
114
+
115
+ - [Slider][material-next] Slider restructure and style improvements (#37644) @DiegoAndai
116
+
117
+ ### `@mui/joy@5.0.0-alpha.87`
118
+
119
+ - [ButtonGroup] Fix style for single Button (#37692) @MaybePixem
120
+ - Fix theme typography fallback value (#37845) @siriwatknp
121
+
122
+ ### `@mui/icons-material@5.14.0`
123
+
124
+ - [icons-material] Rebuild icons with `"use client"` (#37894) @mj12albert
125
+
126
+ ### Docs
127
+
128
+ - [docs] Polish Ukraine banner (#37905) @oliviertassinari
129
+ - [docs] Reduce Ukraine banner size (#34795) @oliviertassinari
130
+ - [docs] Add callouts about controlled vs uncontrolled components in Core docs (#37849) @samuelsycamore
131
+ - [docs] Add missing Portal elements to Tailwind CSS interoperability guide (#37807) @enrique-ramirez
132
+ - [docs] Small pickers migration improvement (#37815) @alexfauquette
133
+ - [docs] Fix pickers product name (#37825) @LukasTy
134
+ - [docs][Joy][Link] Set `variant` and `color` defaults for the playground (#37817) @Studio384
135
+ - [docs][Joy][Table] Add `undefined` as an option to `stripe` (#37816) @Studio384
136
+ - [docs][base] Add Tailwind CSS & plain CSS demo on the Snackbar page (#37812) @mnajdova
137
+ - [docs][base] Add Tailwind CSS & plain CSS demo on Badge page (#37768) @mnajdova
138
+ - [docs][base] Fix Nested modal demo positioning (#37506) @gitstart
139
+ - [docs][base] Add Tailwind CSS & plain CSS demo on the Switch page (#37728) @mnajdova
140
+ - [docs-infra] Remove code tags in ToC (#37834) @cherniavskii
141
+ - [docs-infra] Fixes in API pages generation (#37813) @mnajdova
142
+ - [docs-infra] Add test case when using sh (#37818) @oliviertassinari
143
+ - [docs-infra] Use icons instead of words for the code copy button (#37664) @danilo-leal
144
+ - [docs-infra] Fix code parser (#37828) @alexfauquette
145
+ - [docs-infra] Fix `marked` deprecation warning (#37769) @alexfauquette
146
+ - [docs-infra] Allows to use codeblock in the docs (#37643) @alexfauquette
147
+ - [docs-infra][joy] Change Joy UI's playground variant selector (#37821) @danilo-leal
148
+
149
+ ### Core
150
+
151
+ - [core] Prepend "use-client" directive + add docs and examples for using MUI libraries with Next.js App Router (#37656) @mj12albert
152
+ - [core] Fix imports to React (#37863) @oliviertassinari
153
+ - [core] Disambiguate eslint plugin name @oliviertassinari
154
+ - [core] Sync the lint script name with the other repositories @oliviertassinari
155
+ - [core] Point to Crowdin directly @oliviertassinari
156
+ - [website] Sync career page (#37847) @oliviertassinari
157
+
158
+ All contributors of this release in alphabetical order: @alexfauquette, @cherniavskii, @danilo-leal, @DiegoAndai, @enrique-ramirez, @gitstart, @LukasTy, @MaybePixem, @mj12albert, @mnajdova, @nicolas-ot, @oliviertassinari, @samuelsycamore, @siriwatknp, @Studio384
159
+
3
160
  ## 5.13.7
4
161
 
5
162
  <!-- generated comparing v5.13.6..master -->
@@ -521,7 +678,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
521
678
 
522
679
  There is codemod that you can run in your project to do the transformation:
523
680
 
524
- ```sh
681
+ ```bash
525
682
  npx @mui/codemod v5.0.0/base-remove-component-prop <path>
526
683
  ```
527
684
 
@@ -620,7 +777,7 @@ A big thanks to the 12 contributors who made this release possible. Here are som
620
777
 
621
778
  You can use this [codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/src/v5.0.0/base-remove-unstyled-suffix.js) to help with the migration:
622
779
 
623
- ```sh
780
+ ```bash
624
781
  npx @mui/codemod v5.0.0/base-remove-unstyled-suffix <path>
625
782
  ```
626
783
 
@@ -6265,7 +6422,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
6265
6422
 
6266
6423
  replace `@material-ui/*` prefix with `@mui/*`:
6267
6424
 
6268
- ```sh
6425
+ ```bash
6269
6426
  @material-ui/system -> @mui/system
6270
6427
  @material-ui/styles -> @mui/styles
6271
6428
  @material-ui/lab -> @mui/lab
@@ -6278,7 +6435,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
6278
6435
 
6279
6436
  except these 3 packages that are renamed.
6280
6437
 
6281
- ```sh
6438
+ ```bash
6282
6439
  @material-ui/core => @mui/material // represents Material Design components.
6283
6440
  @material-ui/icons => @mui/icons-material // represents Material Design icons.
6284
6441
  @material-ui/unstyled => @mui/base // fully functional components with minimum styles.
@@ -9940,7 +10097,7 @@ _Nov 14, 2020_
9940
10097
  A big thanks to the 34 contributors who made this release possible. Here are some highlights ✨:
9941
10098
 
9942
10099
  - 📅 Migrate the date picker to the lab (#22692) @dmtrKovalenko.
9943
- We have integrated the components with the code infrastructure. Next we will migrate all the GitHub issues from [material-ui-pickers](https://github.com/mui/material-ui-pickers) and archive the repository. This migration will help provide first-class support for the date picker components. The component will stay in the lab as long as necessary to reach the high quality bar we have for core components. You can find the [new documentation here](https://mui.com/components/pickers/).
10100
+ We have integrated the components with the code infrastructure. Next we will migrate all the GitHub issues from [material-ui-pickers](https://github.com/mui/material-ui-pickers) and archive the repository. This migration will help provide first-class support for the date picker components. The component will stay in the lab as long as necessary to reach the high-quality bar we have for core components. You can find the [new documentation here](https://mui.com/components/pickers/).
9944
10101
 
9945
10102
  While the source code is currently hosted in the [main repository](https://github.com/mui/material-ui), we might move it to the [x repository](https://github.com/mui/mui-x) in the future, depending on what is easier for the commercial date range picker. The date picker will stay open source no matter what.
9946
10103
 
@@ -10973,13 +11130,13 @@ Here are some highlights ✨:
10973
11130
 
10974
11131
  Before:
10975
11132
 
10976
- ```sh
11133
+ ```bash
10977
11134
  theme.spacing(2) => 16
10978
11135
  ```
10979
11136
 
10980
11137
  After:
10981
11138
 
10982
- ```sh
11139
+ ```bash
10983
11140
  theme.spacing(2) => '16px'
10984
11141
  ```
10985
11142
 
package/esm/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  export { default as chainPropTypes } from './chainPropTypes';
2
4
  export { default as deepmerge } from './deepmerge';
3
5
  export { isPlainObject } from './deepmerge';
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useControlled';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
2
4
  import * as React from 'react';
3
5
  export default function useControlled({
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useEnhancedEffect';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
3
5
  export default useEnhancedEffect;
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useEventCallback';
@@ -1,10 +1,13 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import useEnhancedEffect from '../useEnhancedEffect';
3
5
 
4
6
  /**
5
7
  * https://github.com/facebook/react/issues/14099#issuecomment-440013892
6
8
  */
7
- export default function useEventCallback(fn) {
9
+
10
+ function useEventCallback(fn) {
8
11
  const ref = React.useRef(fn);
9
12
  useEnhancedEffect(() => {
10
13
  ref.current = fn;
@@ -13,4 +16,5 @@ export default function useEventCallback(fn) {
13
16
  // @ts-expect-error hide `this`
14
17
  // tslint:disable-next-line:ban-comma-operator
15
18
  (0, ref.current)(...args), []);
16
- }
19
+ }
20
+ export default useEventCallback;
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useForkRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import setRef from '../setRef';
3
5
  export default function useForkRef(...refs) {
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useId';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  let globalId = 0;
3
5
  function useGlobalId(idOverride) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
2
4
  import * as React from 'react';
3
5
  let hadKeyboardEvent = true;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const usePreviousProps = value => {
3
5
  const ref = React.useRef({});
package/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  /**
2
- * @mui/utils v5.13.7
2
+ * @mui/utils v5.14.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  "use strict";
9
+ 'use client';
9
10
 
10
11
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
11
12
  Object.defineProperty(exports, "__esModule", {
package/legacy/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  /**
2
- * @mui/utils v5.13.7
2
+ * @mui/utils v5.14.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
+ 'use client';
9
+
8
10
  export { default as chainPropTypes } from './chainPropTypes';
9
11
  export { default as deepmerge } from './deepmerge';
10
12
  export { isPlainObject } from './deepmerge';
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useControlled';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
2
4
  import * as React from 'react';
3
5
  export default function useControlled(_ref) {
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useEnhancedEffect';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  var useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
3
5
  export default useEnhancedEffect;
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useEventCallback';
@@ -1,10 +1,13 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import useEnhancedEffect from '../useEnhancedEffect';
3
5
 
4
6
  /**
5
7
  * https://github.com/facebook/react/issues/14099#issuecomment-440013892
6
8
  */
7
- export default function useEventCallback(fn) {
9
+
10
+ function useEventCallback(fn) {
8
11
  var ref = React.useRef(fn);
9
12
  useEnhancedEffect(function () {
10
13
  ref.current = fn;
@@ -16,4 +19,5 @@ export default function useEventCallback(fn) {
16
19
  (0, ref.current).apply(void 0, arguments)
17
20
  );
18
21
  }, []);
19
- }
22
+ }
23
+ export default useEventCallback;
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useForkRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import setRef from '../setRef';
3
5
  export default function useForkRef() {
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useId';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  var globalId = 0;
3
5
  function useGlobalId(idOverride) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
2
4
  import * as React from 'react';
3
5
  var hadKeyboardEvent = true;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  var usePreviousProps = function usePreviousProps(value) {
3
5
  var ref = React.useRef({});
package/modern/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  /**
2
- * @mui/utils v5.13.7
2
+ * @mui/utils v5.14.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
+ 'use client';
9
+
8
10
  export { default as chainPropTypes } from './chainPropTypes';
9
11
  export { default as deepmerge } from './deepmerge';
10
12
  export { isPlainObject } from './deepmerge';
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useControlled';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
2
4
  import * as React from 'react';
3
5
  export default function useControlled({
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useEnhancedEffect';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
3
5
  export default useEnhancedEffect;
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useEventCallback';
@@ -1,10 +1,13 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import useEnhancedEffect from '../useEnhancedEffect';
3
5
 
4
6
  /**
5
7
  * https://github.com/facebook/react/issues/14099#issuecomment-440013892
6
8
  */
7
- export default function useEventCallback(fn) {
9
+
10
+ function useEventCallback(fn) {
8
11
  const ref = React.useRef(fn);
9
12
  useEnhancedEffect(() => {
10
13
  ref.current = fn;
@@ -13,4 +16,5 @@ export default function useEventCallback(fn) {
13
16
  // @ts-expect-error hide `this`
14
17
  // tslint:disable-next-line:ban-comma-operator
15
18
  (0, ref.current)(...args), []);
16
- }
19
+ }
20
+ export default useEventCallback;
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useForkRef';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import setRef from '../setRef';
3
5
  export default function useForkRef(...refs) {
@@ -1 +1,3 @@
1
+ 'use client';
2
+
1
3
  export { default } from './useId';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  let globalId = 0;
3
5
  function useGlobalId(idOverride) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
2
4
  import * as React from 'react';
3
5
  let hadKeyboardEvent = true;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const usePreviousProps = value => {
3
5
  const ref = React.useRef({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "5.13.7",
3
+ "version": "5.14.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -29,7 +29,7 @@
29
29
  "react": "^17.0.0 || ^18.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@babel/runtime": "^7.22.5",
32
+ "@babel/runtime": "^7.22.6",
33
33
  "@types/prop-types": "^15.7.5",
34
34
  "@types/react-is": "^18.2.1",
35
35
  "prop-types": "^15.8.1",
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
4
+ /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -7,8 +9,6 @@ exports.default = useControlled;
7
9
  var React = _interopRequireWildcard(require("react"));
8
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
- /* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
11
-
12
12
  function useControlled({
13
13
  controlled,
14
14
  default: defaultProp,
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1,4 +1,6 @@
1
1
  /**
2
2
  * https://github.com/facebook/react/issues/14099#issuecomment-440013892
3
3
  */
4
- export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
4
+ declare function useEventCallback<Fn extends (...args: any[]) => any = (...args: unknown[]) => unknown>(fn: Fn): Fn;
5
+ declare function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
6
+ export default useEventCallback;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
- exports.default = useEventCallback;
8
+ exports.default = void 0;
8
9
  var React = _interopRequireWildcard(require("react"));
9
10
  var _useEnhancedEffect = _interopRequireDefault(require("../useEnhancedEffect"));
10
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -12,6 +13,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
12
13
  /**
13
14
  * https://github.com/facebook/react/issues/14099#issuecomment-440013892
14
15
  */
16
+
15
17
  function useEventCallback(fn) {
16
18
  const ref = React.useRef(fn);
17
19
  (0, _useEnhancedEffect.default)(() => {
@@ -21,4 +23,6 @@ function useEventCallback(fn) {
21
23
  // @ts-expect-error hide `this`
22
24
  // tslint:disable-next-line:ban-comma-operator
23
25
  (0, ref.current)(...args), []);
24
- }
26
+ }
27
+ var _default = useEventCallback;
28
+ exports.default = _default;
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
package/useId/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
package/useId/useId.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
4
+ // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -8,8 +10,6 @@ exports.teardown = teardown;
8
10
  var React = _interopRequireWildcard(require("react"));
9
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
- // based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
12
-
13
13
  let hadKeyboardEvent = true;
14
14
  let hadFocusVisibleRecently = false;
15
15
  let hadFocusVisibleRecentlyTimeout;
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true