@mui/utils 5.12.0 → 5.12.3

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 (43) hide show
  1. package/CHANGELOG.md +262 -0
  2. package/ClassNameGenerator/ClassNameGenerator.d.ts +6 -6
  3. package/ClassNameGenerator/index.d.ts +1 -1
  4. package/HTMLElementType.d.ts +3 -3
  5. package/chainPropTypes.d.ts +2 -2
  6. package/composeClasses/composeClasses.d.ts +1 -1
  7. package/composeClasses/index.d.ts +1 -1
  8. package/createChainedFunction.d.ts +7 -7
  9. package/deepmerge.d.ts +5 -5
  10. package/elementAcceptingRef.d.ts +3 -3
  11. package/elementTypeAcceptingRef.d.ts +3 -3
  12. package/esm/exactProp.js +0 -1
  13. package/exactProp.d.ts +2 -2
  14. package/exactProp.js +0 -1
  15. package/formatMuiErrorMessage.d.ts +6 -6
  16. package/generateUtilityClass/generateUtilityClass.d.ts +2 -2
  17. package/generateUtilityClass/index.d.ts +2 -2
  18. package/generateUtilityClasses/generateUtilityClasses.d.ts +1 -1
  19. package/generateUtilityClasses/index.d.ts +1 -1
  20. package/getDisplayName.d.ts +8 -8
  21. package/getScrollbarSize.d.ts +1 -1
  22. package/index.d.ts +38 -38
  23. package/index.js +1 -1
  24. package/integerPropType.d.ts +7 -7
  25. package/isMuiElement.d.ts +1 -1
  26. package/legacy/exactProp.js +0 -1
  27. package/legacy/index.js +1 -1
  28. package/modern/exactProp.js +0 -1
  29. package/modern/index.js +1 -1
  30. package/ownerDocument.d.ts +1 -1
  31. package/ownerWindow.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/ponyfillGlobal.d.ts +2 -2
  34. package/refType.d.ts +3 -3
  35. package/resolveProps.d.ts +12 -12
  36. package/setRef.d.ts +15 -15
  37. package/useEventCallback.d.ts +4 -4
  38. package/useEventCallback.spec.d.ts +1 -1
  39. package/useForkRef.d.ts +2 -2
  40. package/useId.d.ts +7 -7
  41. package/useIsFocusVisible.d.ts +9 -9
  42. package/usePreviousProps.d.ts +2 -2
  43. package/visuallyHidden.d.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,267 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.12.3
4
+
5
+ <!-- generated comparing v5.12.2..master -->
6
+
7
+ _May 2, 2023_
8
+
9
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - all planned breaking changes for Base UI are done. The first beta release should come next week 🎉
12
+ - 🐛 bug fixes and 📚 documentation improvements.
13
+
14
+ ### `@mui/material@5.12.3`
15
+
16
+ - &#8203;<!-- 43 -->[Accordion] Add missing `component` type (#37111) @sai6855
17
+ - &#8203;<!-- 23 -->[ButtonGroup] Should not retain divider color when it is disabled and variant is `text` (#36967) @DavidBoyer11
18
+ - &#8203;<!-- 21 -->[Divider] Fix styles on dividers with text (#35072) @maxdestors
19
+ - &#8203;<!-- 04 -->[TextField] Improve IntelliSense support for props (#36737) @sai6855
20
+ - &#8203;<!-- 03 -->[TextField] Fix running click event on disabled (#36892) @sai6855
21
+
22
+ ### `@mui/joy@5.0.0-alpha.78`
23
+
24
+ - &#8203;<!-- 09 -->[Joy] Miscellaneous fixes and docs improvement (#37026) @siriwatknp
25
+
26
+ ### `@mui/base@5.0.0-alpha.128`
27
+
28
+ #### Breaking changes
29
+
30
+ - The `component` prop is no longer supported because it can be replaced with the slots API. This is how the transformation will look like:
31
+
32
+ ```diff
33
+ <Button
34
+ - component="span"
35
+ + slots={{ root: "span" }}
36
+ />
37
+ ```
38
+
39
+ If using TypeScript, the custom component type should be added as a generic on the `Button` component.
40
+
41
+ ```diff
42
+ -<Button
43
+ +<Button<typeof CustomComponent>
44
+ slots={{ root: CustomComponent }}
45
+ customProp="foo"
46
+ />
47
+ ```
48
+
49
+ There is codemod that you can run in your project to do the transformation:
50
+
51
+ ```sh
52
+ npx @mui/codemod v5.0.0/base-remove-component-prop <path>
53
+ ```
54
+
55
+ The full documentation about the codemod can be found [here](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#base-remove-component-prop).
56
+
57
+ This is the list of PR related to this change:
58
+
59
+ - &#8203;<!-- 40 -->[Button][base] Drop `component` prop (#36677) @mnajdova
60
+ - &#8203;<!-- 42 -->[Badge][base] Drop `component` prop (#37028) @hbjORbj
61
+ - &#8203;<!-- 37 -->[FormControl][base] Drop component prop (#37031) @hbjORbj
62
+ - &#8203;<!-- 35 -->[Input][base] Drop component prop (#37057) @hbjORbj
63
+ - &#8203;<!-- 34 -->[Menu][base] Drop component prop (#37033) @hbjORbj
64
+ - &#8203;<!-- 33 -->[MenuItem][base] Drop component prop (#37032) @hbjORbj
65
+ - &#8203;<!-- 32 -->[Modal][base] Drop component prop (#37058) @hbjORbj
66
+ - &#8203;<!-- 31 -->[Option][base] Drop component prop (#37052) @hbjORbj
67
+ - &#8203;<!-- 30 -->[OptionGroup][base] Drop component prop (#37055) @hbjORbj
68
+ - &#8203;<!-- 31 -->[Popper][base] Drop component prop (#37084) @hbjORbj
69
+ - &#8203;<!-- 29 -->[Select][base] Drop component prop (#37035) @hbjORbj
70
+ - &#8203;<!-- 28 -->[Slider][base] Drop component prop (#37056) @hbjORbj
71
+ - &#8203;<!-- 27 -->[Snackbar][base] Drop component prop (#37041) @nicolas-ot
72
+ - &#8203;<!-- 26 -->[Switch][base] Drop component prop (#37053) @hbjORbj
73
+ - &#8203;<!-- 25 -->[Tab][base] Drop component prop (#36768) @sai6855
74
+ - &#8203;<!-- 24 -->[Tabs][base] Drop component prop (#36770) @sai6855
75
+ - &#8203;<!-- 08 -->[TablePagination][base] Drop component prop (#37059) @sai6855
76
+ - &#8203;<!-- 07 -->[TabPanel][base] Drop component prop (#37054) @sai6855
77
+ - &#8203;<!-- 06 -->[TabsList][base] Drop component prop (#37042) @sai6855
78
+
79
+ - &#8203;<!-- 41 -->[base] Improve API consistency (#36970) @michaldudak
80
+
81
+ Brought consistency to Base UI components and hooks' parameters and return values:
82
+
83
+ 1. Whenever a hook needs a ref, it's now called `<slot_name>Ref`, which matches the `get<slot_name>Props` in the return value.
84
+ 2. All hooks that accept external refs now return merged refs, making combining multiple hooks on one element easier. This was proven necessary in several compound components (like menuItem being both a button and a list item). The type of this value is `React.RefCallback` as using the more general `React.Ref` caused variance issues.
85
+ 3. Type of accepted refs is standardized to `React.Ref<Element>`
86
+ 4. Naming and typing of the forwarded ref in unstyled components were standardized - it's forwardedRef: React.ForwardedRef<Element> (unless a more specific type is needed).
87
+ 5. The shape of the definition of unstyled components was standardized - it's React.forwardRef(function Component(props: Props, forwardedRef: React.Ref<Element>) { ... });. Specifically, the generic parameters of forwardRef were removed as they are specified in function arguments.
88
+
89
+ #### Changes
90
+
91
+ - &#8203;<!-- 36 -->[FormControl][base] Do not use optional fields in useFormControlContext's return value (#37037) @michaldudak
92
+
93
+ ### Docs
94
+
95
+ - &#8203;<!-- 39 -->[base][docs] Add Base UI Quickstart Guide (#36717) @mj12albert
96
+ - &#8203;<!-- 20 -->[docs] Fix Material UI's API linking to Base UI (#37121) @mnajdova
97
+ - &#8203;<!-- 19 -->[docs] Fix pagination in the DataGrid demo (#37114) @cherniavskii
98
+ - &#8203;<!-- 18 -->[docs] Add notification to the release of the new Time Picker UI (#37065) @joserodolfofreitas
99
+ - &#8203;<!-- 17 -->[docs] Specify "Material UI" (not "MUI") where appropriate throughout the docs (#37066) @samuelsycamore
100
+ - &#8203;<!-- 16 -->[docs] Use focus-visible instead of focus for Menu demos (#36847) @michaldudak
101
+ - &#8203;<!-- 15 -->[docs] Fix small regressions API pages (#36972) @oliviertassinari
102
+ - &#8203;<!-- 14 -->[docs] Handle a few docs-feedback (#36977) @oliviertassinari
103
+ - &#8203;<!-- 13 -->[docs] Fix anchor link in customization (#37004) @oliviertassinari
104
+ - &#8203;<!-- 12 -->[docs] Add a note about minimal required version for theme merging to the guides (#36973) @jakub-stastny
105
+ - &#8203;<!-- 11 -->[docs] smooth scrolling added for `back to top` (#37011) @PunitSoniME
106
+ - &#8203;<!-- 10 -->[docs] Remove `useFormControl` return values from demos page (#37036) @ZeeshanTamboli
107
+ - &#8203;<!-- 47 --> [docs][base] Move styles to the bottom of demos code for `SwitchUnstyled` (#36720) @varunmulay22
108
+ - &#8203;<!-- 46 --> [docs][base] Move styles to the bottom of demos code for `InputUnstyled` (#36724) @varunmulay22
109
+ - &#8203;<!-- 45 --> [docs][base] Move styles to the bottom of demos code for `SliderUnstyled` (#36721) @varunmulay22
110
+ - &#8203;<!-- 44 --> [docs][base] Move styles to the bottom of demos code for `Snackbar` (#36719) @varunmulay22
111
+ - &#8203;<!-- 38 -->[docs][base] Move styles to the bottom of demos code for `SelectUnstyled` (#36718) @varunmulay22
112
+ - &#8203;<!-- 05 -->[templates] Image not displayed in blog layout of React template. (#36991) @navedqb
113
+ - &#8203;<!-- 02 -->[website] Take the design role offline @oliviertassinari
114
+ - &#8203;<!-- 01 -->[website] Fix URL convention @oliviertassinari
115
+ - &#8203;<!-- 21 -->[docs] Turn off job banner on docs (#36080) @joserodolfofreitas
116
+
117
+ ### Core
118
+
119
+ - &#8203;<!-- 22 -->[core] Allow type alias as well in hooks API docs generation (#37034) @ZeeshanTamboli
120
+
121
+ All contributors of this release in alphabetical order: @cherniavskii, @DavidBoyer11, @hbjORbj, @jakub-stastny, @joserodolfofreitas, @maxdestors, @michaldudak, @mj12albert, @mnajdova, @navedqb, @nicolas-ot, @oliviertassinari, @PunitSoniME, @sai6855, @samuelsycamore, @siriwatknp, @varunmulay22, @ZeeshanTamboli
122
+
123
+ ## 5.12.2
124
+
125
+ <!-- generated comparing v5.12.1..master -->
126
+
127
+ _Apr 25, 2023_
128
+
129
+ A big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
130
+
131
+ - ⚠️ **[BREAKING CHANGE]** The `Unstyled` suffix has been removed from Base UI component names, including names of types and other related identifiers – a codemod script is provided to assist with the change.
132
+ - 🐛 bug fixes and 📚 documentation improvements.
133
+
134
+ ### `@mui/material@5.12.2`
135
+
136
+ - &#8203;<!-- 10 -->[FormControl] Fix `filled` when value is set through `inputProps` (#36741) @sai6855
137
+ - &#8203;<!-- 07 -->[Slider] `onChange` handler should be called only when value has changed (#36706) @gitstart
138
+ - &#8203;<!-- 06 -->[Table] Fix `Sorting & Selecting` tables (#36898) @oliviertassinari
139
+
140
+ ### `@mui/base@5.0.0-alpha.127`
141
+
142
+ #### Breaking changes
143
+
144
+ - &#8203;<!-- 27 -->[base] Remove unstyled suffix from Base components + Codemod script (#36873) @hbjORbj
145
+
146
+ The `Unstyled` suffix has been removed from all Base UI component names, including names of types and other related identifiers.
147
+
148
+ 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:
149
+
150
+ ```sh
151
+ npx @mui/codemod v5.0.0/base-remove-unstyled-suffix <path>
152
+ ```
153
+
154
+ #### Changes
155
+
156
+ - &#8203;<!-- 26 -->[codemod][base] Improve the removal of `component` prop codemod script (#36952) @hbjORbj
157
+ - &#8203;<!-- 25 -->[codemod][base] Write a migration script for removal of `component` prop from components (#36831) @hbjORbj
158
+ - &#8203;<!-- 24 -->[Base][useButton] Allow useButton params to be completely optional (#36922) @mj12albert
159
+
160
+ ### `@mui/joy@5.0.0-alpha.77`
161
+
162
+ - &#8203;<!-- 23 -->[Joy][Chip] Chip button not showing up in Firefox browser (#36930) @TakhyunKim
163
+ - &#8203;<!-- 09 -->[Joy] Add `invertedColors` to Menu and Alert (#36975) @siriwatknp
164
+ - &#8203;<!-- 08 -->[joy][Select] Set focus visible on select options when navigating with arrow keys (#36689) @gitstart
165
+
166
+ ### Docs
167
+
168
+ - &#8203;<!-- 21 -->[docs] Fix console error introduced by #36408 (#36980) @alexfauquette
169
+ - &#8203;<!-- 20 -->[docs] Add stray Joy UI documentation improvements (#36921) @danilo-leal
170
+ - &#8203;<!-- 19 -->[docs] Add Joy profile dashboard template (#36931) @siriwatknp
171
+ - &#8203;<!-- 18 -->[docs] Fix 404 links (#36969) @oliviertassinari
172
+ - &#8203;<!-- 17 -->[docs] Clarify when bundle size optimization is needed (#36823) @oliviertassinari
173
+ - &#8203;<!-- 16 -->[docs] Fix Chakra UI theme scoping typo (#36950) @mj12albert
174
+ - &#8203;<!-- 15 -->[docs] Add snackbar example using sonner (#36926) @PupoSDC
175
+ - &#8203;<!-- 14 -->[docs] Adjust the Material Icons page design and formatting (#36937) @danilo-leal
176
+ - &#8203;<!-- 13 -->[docs] Allows to customize menu with any icon (#36408) @alexfauquette
177
+ - &#8203;<!-- 12 -->[docs] Add info about passing ref to input element (#36913) @tomaskebrle
178
+ - &#8203;<!-- 11 -->[docs][material] Tabs API section cleanup (#36942) @mnajdova
179
+
180
+ ### Core
181
+
182
+ - &#8203;<!-- 22 -->[core] Fix CI failure on `master` (#37016) @hbjORbj
183
+ - &#8203;<!-- 05 -->[typescript] Add the missing explicit component return types (#36924) @michaldudak
184
+ - &#8203;<!-- 04 -->[website] Update main data grid demo on X landing page (#37001) @cherniavskii
185
+ - &#8203;<!-- 03 -->[website] Design role updates (#36997) @danilo-leal
186
+ - &#8203;<!-- 02 -->[website] X component section improvements (#36598) @danilo-leal
187
+ - &#8203;<!-- 01 -->[website] Developer Advocate role filled @oliviertassinari
188
+
189
+ All contributors of this release in alphabetical order: @alexfauquette, @cherniavskii, @danilo-leal, @gitstart, @hbjORbj, @michaldudak, @mj12albert, @mnajdova, @oliviertassinari, @PupoSDC, @sai6855, @siriwatknp, @TakhyunKim, @tomaskebrle
190
+
191
+ ## 5.12.1
192
+
193
+ <!-- generated comparing v5.12.0..master -->
194
+
195
+ _Apr 17, 2023_
196
+
197
+ A big thanks to the 16 contributors who made this release possible. This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
198
+
199
+ ### `@mui/material@5.12.1`
200
+
201
+ - &#8203;<!-- 24 -->[Autocomplete] Fix autocomplete left padding (#36649) @mj12albert
202
+ - &#8203;<!-- 17 -->[Button] Fix contained with inherit prop not adapting on dark mode (#34508) @jesrodri
203
+ - &#8203;<!-- 07 -->[FormControlLabel] Add `required` prop (#34207) @emlai
204
+ - &#8203;<!-- 04 -->[Tabs] Fix null reference in ScrollbarSize after unmounting (#36485) @rkdrnf
205
+ - &#8203;<!-- 03 -->[TextField] Fix type error when using `inputTypeSearch` class for `outlined` and `filled` inputs (#36740) @sai6855
206
+ - &#8203;<!-- 02 -->[ThemeProvider] Fix theme proptypes (#36852) @siriwatknp
207
+
208
+ ### `@mui/system@5.12.1`
209
+
210
+ #### Breaking changes
211
+
212
+ - &#8203;<!-- 06 -->[Grid2] Replace context with `cloneElement` (#36399) @siriwatknp
213
+
214
+ `Grid2` now uses `React.cloneElement` instead of React context for passing the spacing and columns to the next container. The change is close to how CSS flexbox behaves.
215
+
216
+ #### Changes
217
+
218
+ - &#8203;<!-- 14 -->[CssVarsProvider] Always generate new `css` object (#36853) @siriwatknp
219
+
220
+ ### `@mui/base@5.0.0-alpha.126`
221
+
222
+ #### Breaking changes
223
+
224
+ - &#8203;<!-- 23 -->[base] Refactor the compound components building blocks (#36400) @michaldudak
225
+ Components affected by the changes are:
226
+ - Menu
227
+ - `MenuUnstyledContext` is replaced by `MenuProvider`. The value to pass to the provider is returned by the `useMenu` hook.
228
+ - MenuUnstyled's `onClose` prop is replaced by `onOpenChange`. It has the `open` parameter and is called when a menu is opened or closed
229
+ - Select
230
+ - `SelectUnstyledContext` is replaced by `SelectProvider`. The value to pass to the provider is returned by the `useSelect` hook.
231
+ - `SelectUnstyled`'s popup is permanently mounted.
232
+ - The `defaultOpen` prop was added to the SelectUnstyled. The open/close state can now be controlled or uncontrolled, as a `value`.
233
+ - Tabs
234
+ - `TabsContext` is replaced by `TabsProvider`. The value to pass to the provider is returned by the `useTabs` hook.
235
+ - To deselect all tabs, pass in `null` to Tabs' `value` prop, instead of `false`. This is consistent with how Select works.
236
+ - The `value` prop is still technically not mandatory on TabUnstyled and TabPanel, but when omitted, the contents of the selected tab panel will not be rendered during SSR.
237
+
238
+ ### `@mui/joy@5.0.0-alpha.76`
239
+
240
+ - &#8203;<!-- 05 -->[Table][Joy] Replace uses of css selector `*-child` to `*-of-type` (#36839) @keyvanm
241
+
242
+ ### Docs
243
+
244
+ - &#8203;<!-- 25 --> [docs][base] Move styles to the bottom of demos code for `BadgeUnstyled` (#36723) @varunmulay22
245
+ - &#8203;<!-- 22 -->[docs][base] Mention that the hook does not accept any parameters in the `Parameters` section of the API docs (#36773) @ZeeshanTamboli
246
+ - &#8203;<!-- 21 -->[docs][base] Move styles to the bottom of demos code for `ModalUnstyled` (#36580) @gitstart
247
+ - &#8203;<!-- 20 -->[docs][base] Move styles to the bottom of demos code for `Tabs` (#36577) @gitstart
248
+ - &#8203;<!-- 19 -->[docs][base] Move styles to the bottom of demos code for `Popper` (#36578) @gitstart
249
+ - &#8203;<!-- 18 -->[docs][base] Move styles to the bottom of demos code for `TablePagination` (#36593) @gitstart
250
+ - &#8203;<!-- 13 -->[docs] Remove the incorrect info about useButton's ref parameter (#36883) @michaldudak
251
+ - &#8203;<!-- 12 -->[docs] Sync <Stack> between projects (#36785) @oliviertassinari
252
+ - &#8203;<!-- 11 -->[docs] Add guides to overriding component structure in Base UI and Joy UI docs (#34990) @samuelsycamore
253
+ - &#8203;<!-- 10 -->[docs] Content changed from 'row' to 'orientation=horizontal' (#36858) @navedqb
254
+ - &#8203;<!-- 09 -->[docs][Joy] `component`, `slots`, `slotProps` must be visible in Prop table in API docs (#36666) @hbjORbj
255
+ - &#8203;<!-- 08 -->[docs][Select] Fix duplicate ID in small size Select demo (#36792) @sai6855
256
+
257
+ ### Core
258
+
259
+ - &#8203;<!-- 16 -->[core] Use glob to find the test files in parseTest (#36305) @flaviendelangle
260
+ - &#8203;<!-- 15 -->[core] Fix minor SEO issues @oliviertassinari
261
+ - &#8203;<!-- 01 -->[website] Fix visual bug appbar (#36875) @oliviertassinari
262
+
263
+ All contributors of this release in alphabetical order: @emlai, @flaviendelangle, @gitstart, @hbjORbj, @jesrodri, @keyvanm, @michaldudak, @mj12albert, @navedqb, @oliviertassinari, @rkdrnf, @sai6855, @samuelsycamore, @siriwatknp, @varunmulay22, @ZeeshanTamboli
264
+
3
265
  ## 5.12.0
4
266
 
5
267
  <!-- generated comparing v5.11.16..master -->
@@ -1,6 +1,6 @@
1
- declare const ClassNameGenerator: {
2
- configure(generator: (componentName: string) => string): void;
3
- generate(componentName: string): string;
4
- reset(): void;
5
- };
6
- export default ClassNameGenerator;
1
+ declare const ClassNameGenerator: {
2
+ configure(generator: (componentName: string) => string): void;
3
+ generate(componentName: string): string;
4
+ reset(): void;
5
+ };
6
+ export default ClassNameGenerator;
@@ -1 +1 @@
1
- export { default } from './ClassNameGenerator';
1
+ export { default } from './ClassNameGenerator';
@@ -1,3 +1,3 @@
1
- export default function HTMLElementType(props: {
2
- [key: string]: unknown;
3
- }, propName: string, componentName: string, location: string, propFullName: string): Error | null;
1
+ export default function HTMLElementType(props: {
2
+ [key: string]: unknown;
3
+ }, propName: string, componentName: string, location: string, propFullName: string): Error | null;
@@ -1,2 +1,2 @@
1
- import PropTypes from 'prop-types';
2
- export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
1
+ import PropTypes from 'prop-types';
2
+ export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
@@ -1 +1 @@
1
- export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes?: Record<string, string> | undefined): Record<ClassKey, string>;
1
+ export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes?: Record<string, string> | undefined): Record<ClassKey, string>;
@@ -1 +1 @@
1
- export { default } from './composeClasses';
1
+ export { default } from './composeClasses';
@@ -1,7 +1,7 @@
1
- /**
2
- * Safe chained function.
3
- *
4
- * Will only create a new function if needed,
5
- * otherwise will pass back existing functions or null.
6
- */
7
- export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
1
+ /**
2
+ * Safe chained function.
3
+ *
4
+ * Will only create a new function if needed,
5
+ * otherwise will pass back existing functions or null.
6
+ */
7
+ export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
package/deepmerge.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
2
- export interface DeepmergeOptions {
3
- clone?: boolean;
4
- }
5
- export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
1
+ export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
2
+ export interface DeepmergeOptions {
3
+ clone?: boolean;
4
+ }
5
+ export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
@@ -1,3 +1,3 @@
1
- import PropTypes from 'prop-types';
2
- declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
3
- export default elementAcceptingRef;
1
+ import PropTypes from 'prop-types';
2
+ declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
3
+ export default elementAcceptingRef;
@@ -1,3 +1,3 @@
1
- import PropTypes from 'prop-types';
2
- declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
3
- export default _default;
1
+ import PropTypes from 'prop-types';
2
+ declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
3
+ export default _default;
package/esm/exactProp.js CHANGED
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
3
3
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
4
4
  // the module was forked.
5
-
6
5
  const specialProperty = 'exact-prop: \u200b';
7
6
  export default function exactProp(propTypes) {
8
7
  if (process.env.NODE_ENV === 'production') {
package/exactProp.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { ValidationMap } from 'prop-types';
2
- export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
1
+ import { ValidationMap } from 'prop-types';
2
+ export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
package/exactProp.js CHANGED
@@ -9,7 +9,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
10
10
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
11
11
  // the module was forked.
12
-
13
12
  const specialProperty = 'exact-prop: \u200b';
14
13
  function exactProp(propTypes) {
15
14
  if (process.env.NODE_ENV === 'production') {
@@ -1,6 +1,6 @@
1
- /**
2
- * WARNING: Don't import this directly.
3
- * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
4
- * @param {number} code
5
- */
6
- export default function formatMuiErrorMessage(code: number): string;
1
+ /**
2
+ * WARNING: Don't import this directly.
3
+ * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
4
+ * @param {number} code
5
+ */
6
+ export default function formatMuiErrorMessage(code: number): string;
@@ -1,2 +1,2 @@
1
- export type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'readOnly' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'required' | 'selected';
2
- export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
1
+ export type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'readOnly' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'required' | 'selected';
2
+ export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
@@ -1,2 +1,2 @@
1
- export { default } from './generateUtilityClass';
2
- export * from './generateUtilityClass';
1
+ export { default } from './generateUtilityClass';
2
+ export * from './generateUtilityClass';
@@ -1 +1 @@
1
- export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>;
1
+ export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>;
@@ -1 +1 @@
1
- export { default } from './generateUtilityClasses';
1
+ export { default } from './generateUtilityClasses';
@@ -1,8 +1,8 @@
1
- import * as React from 'react';
2
- export declare function getFunctionName(fn: Function): string;
3
- /**
4
- * cherry-pick from
5
- * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
6
- * originally forked from recompose/getDisplayName with added IE11 support
7
- */
8
- export default function getDisplayName(Component: React.ElementType): string | undefined;
1
+ import * as React from 'react';
2
+ export declare function getFunctionName(fn: Function): string;
3
+ /**
4
+ * cherry-pick from
5
+ * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
6
+ * originally forked from recompose/getDisplayName with added IE11 support
7
+ */
8
+ export default function getDisplayName(Component: React.ElementType): string | undefined;
@@ -1 +1 @@
1
- export default function getScrollbarSize(doc: Document): number;
1
+ export default function getScrollbarSize(doc: Document): number;
package/index.d.ts CHANGED
@@ -1,38 +1,38 @@
1
- export { default as chainPropTypes } from './chainPropTypes';
2
- export { default as deepmerge } from './deepmerge';
3
- export { isPlainObject } from './deepmerge';
4
- export { default as elementAcceptingRef } from './elementAcceptingRef';
5
- export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
6
- export { default as exactProp } from './exactProp';
7
- export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
8
- export { default as getDisplayName } from './getDisplayName';
9
- export { default as HTMLElementType } from './HTMLElementType';
10
- export { default as ponyfillGlobal } from './ponyfillGlobal';
11
- export { default as refType } from './refType';
12
- export { default as unstable_capitalize } from './capitalize';
13
- export { default as unstable_createChainedFunction } from './createChainedFunction';
14
- export { default as unstable_debounce } from './debounce';
15
- export { default as unstable_deprecatedPropType } from './deprecatedPropType';
16
- export { default as unstable_isMuiElement } from './isMuiElement';
17
- export { default as unstable_ownerDocument } from './ownerDocument';
18
- export { default as unstable_ownerWindow } from './ownerWindow';
19
- export { default as unstable_requirePropFactory } from './requirePropFactory';
20
- export { default as unstable_setRef } from './setRef';
21
- export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
22
- export { default as unstable_useId } from './useId';
23
- export { default as unstable_unsupportedProp } from './unsupportedProp';
24
- export { default as unstable_useControlled } from './useControlled';
25
- export { default as unstable_useEventCallback } from './useEventCallback';
26
- export { default as unstable_useForkRef } from './useForkRef';
27
- export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
28
- export { default as unstable_getScrollbarSize } from './getScrollbarSize';
29
- export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
30
- export { default as usePreviousProps } from './usePreviousProps';
31
- export { default as visuallyHidden } from './visuallyHidden';
32
- export { default as integerPropType } from './integerPropType';
33
- export { default as internal_resolveProps } from './resolveProps';
34
- export { default as unstable_composeClasses } from './composeClasses';
35
- export { default as unstable_generateUtilityClass } from './generateUtilityClass';
36
- export * from './generateUtilityClass';
37
- export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
38
- export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
1
+ export { default as chainPropTypes } from './chainPropTypes';
2
+ export { default as deepmerge } from './deepmerge';
3
+ export { isPlainObject } from './deepmerge';
4
+ export { default as elementAcceptingRef } from './elementAcceptingRef';
5
+ export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
6
+ export { default as exactProp } from './exactProp';
7
+ export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
8
+ export { default as getDisplayName } from './getDisplayName';
9
+ export { default as HTMLElementType } from './HTMLElementType';
10
+ export { default as ponyfillGlobal } from './ponyfillGlobal';
11
+ export { default as refType } from './refType';
12
+ export { default as unstable_capitalize } from './capitalize';
13
+ export { default as unstable_createChainedFunction } from './createChainedFunction';
14
+ export { default as unstable_debounce } from './debounce';
15
+ export { default as unstable_deprecatedPropType } from './deprecatedPropType';
16
+ export { default as unstable_isMuiElement } from './isMuiElement';
17
+ export { default as unstable_ownerDocument } from './ownerDocument';
18
+ export { default as unstable_ownerWindow } from './ownerWindow';
19
+ export { default as unstable_requirePropFactory } from './requirePropFactory';
20
+ export { default as unstable_setRef } from './setRef';
21
+ export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
22
+ export { default as unstable_useId } from './useId';
23
+ export { default as unstable_unsupportedProp } from './unsupportedProp';
24
+ export { default as unstable_useControlled } from './useControlled';
25
+ export { default as unstable_useEventCallback } from './useEventCallback';
26
+ export { default as unstable_useForkRef } from './useForkRef';
27
+ export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
28
+ export { default as unstable_getScrollbarSize } from './getScrollbarSize';
29
+ export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
30
+ export { default as usePreviousProps } from './usePreviousProps';
31
+ export { default as visuallyHidden } from './visuallyHidden';
32
+ export { default as integerPropType } from './integerPropType';
33
+ export { default as internal_resolveProps } from './resolveProps';
34
+ export { default as unstable_composeClasses } from './composeClasses';
35
+ export { default as unstable_generateUtilityClass } from './generateUtilityClass';
36
+ export * from './generateUtilityClass';
37
+ export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
38
+ export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.12.0
2
+ * @mui/utils v5.12.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,7 +1,7 @@
1
- export function getTypeByValue(value: any): any;
2
- declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
3
- declare namespace _default {
4
- export { requiredInteger as isRequired };
5
- }
6
- export default _default;
7
- declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
1
+ export function getTypeByValue(value: any): any;
2
+ declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
3
+ declare namespace _default {
4
+ export { requiredInteger as isRequired };
5
+ }
6
+ export default _default;
7
+ declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
package/isMuiElement.d.ts CHANGED
@@ -1 +1 @@
1
- export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
1
+ export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
@@ -3,7 +3,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
4
4
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
5
5
  // the module was forked.
6
-
7
6
  var specialProperty = "exact-prop: \u200B";
8
7
  export default function exactProp(propTypes) {
9
8
  if (process.env.NODE_ENV === 'production') {
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.12.0
2
+ * @mui/utils v5.12.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
3
3
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
4
4
  // the module was forked.
5
-
6
5
  const specialProperty = 'exact-prop: \u200b';
7
6
  export default function exactProp(propTypes) {
8
7
  if (process.env.NODE_ENV === 'production') {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v5.12.0
2
+ * @mui/utils v5.12.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1 +1 @@
1
- export default function ownerDocument(node: Node | null | undefined): Document;
1
+ export default function ownerDocument(node: Node | null | undefined): Document;
package/ownerWindow.d.ts CHANGED
@@ -1 +1 @@
1
- export default function ownerWindow(node: Node | undefined): Window;
1
+ export default function ownerWindow(node: Node | undefined): Window;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "5.12.0",
3
+ "version": "5.12.3",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -1,2 +1,2 @@
1
- declare const _default: any;
2
- export default _default;
1
+ declare const _default: any;
2
+ export default _default;
package/refType.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import PropTypes from 'prop-types';
2
- declare const refType: PropTypes.Requireable<object>;
3
- export default refType;
1
+ import PropTypes from 'prop-types';
2
+ declare const refType: PropTypes.Requireable<object>;
3
+ export default refType;
package/resolveProps.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- /**
2
- * Add keys, values of `defaultProps` that does not exist in `props`
3
- * @param {object} defaultProps
4
- * @param {object} props
5
- * @returns {object} resolved props
6
- */
7
- export default function resolveProps<T extends {
8
- components?: Record<string, unknown>;
9
- componentsProps?: Record<string, unknown>;
10
- slots?: Record<string, unknown>;
11
- slotProps?: Record<string, unknown>;
12
- } & Record<string, unknown>>(defaultProps: T, props: T): T;
1
+ /**
2
+ * Add keys, values of `defaultProps` that does not exist in `props`
3
+ * @param {object} defaultProps
4
+ * @param {object} props
5
+ * @returns {object} resolved props
6
+ */
7
+ export default function resolveProps<T extends {
8
+ components?: Record<string, unknown>;
9
+ componentsProps?: Record<string, unknown>;
10
+ slots?: Record<string, unknown>;
11
+ slotProps?: Record<string, unknown>;
12
+ } & Record<string, unknown>>(defaultProps: T, props: T): T;
package/setRef.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import * as React from 'react';
2
- /**
3
- * TODO v5: consider making it private
4
- *
5
- * passes {value} to {ref}
6
- *
7
- * WARNING: Be sure to only call this inside a callback that is passed as a ref.
8
- * Otherwise, make sure to cleanup the previous {ref} if it changes. See
9
- * https://github.com/mui/material-ui/issues/13539
10
- *
11
- * Useful if you want to expose the ref of an inner component to the public API
12
- * while still using it inside the component.
13
- * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
14
- */
15
- export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
1
+ import * as React from 'react';
2
+ /**
3
+ * TODO v5: consider making it private
4
+ *
5
+ * passes {value} to {ref}
6
+ *
7
+ * WARNING: Be sure to only call this inside a callback that is passed as a ref.
8
+ * Otherwise, make sure to cleanup the previous {ref} if it changes. See
9
+ * https://github.com/mui/material-ui/issues/13539
10
+ *
11
+ * Useful if you want to expose the ref of an inner component to the public API
12
+ * while still using it inside the component.
13
+ * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
14
+ */
15
+ export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
@@ -1,4 +1,4 @@
1
- /**
2
- * https://github.com/facebook/react/issues/14099#issuecomment-440013892
3
- */
4
- export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
1
+ /**
2
+ * https://github.com/facebook/react/issues/14099#issuecomment-440013892
3
+ */
4
+ export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/useForkRef.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import * as React from 'react';
2
- export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
1
+ import * as React from 'react';
2
+ export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
package/useId.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- /**
2
- *
3
- * @example <div id={useId()} />
4
- * @param idOverride
5
- * @returns {string}
6
- */
7
- export default function useId(idOverride?: string): string | undefined;
1
+ /**
2
+ *
3
+ * @example <div id={useId()} />
4
+ * @param idOverride
5
+ * @returns {string}
6
+ */
7
+ export default function useId(idOverride?: string): string | undefined;
@@ -1,9 +1,9 @@
1
- import * as React from 'react';
2
- export declare function teardown(doc: Document): void;
3
- export interface UseIsFocusVisibleResult {
4
- isFocusVisibleRef: React.MutableRefObject<boolean>;
5
- onBlur: (event: React.FocusEvent<any>) => void;
6
- onFocus: (event: React.FocusEvent<any>) => void;
7
- ref: React.Ref<unknown>;
8
- }
9
- export default function useIsFocusVisible(): UseIsFocusVisibleResult;
1
+ import * as React from 'react';
2
+ export declare function teardown(doc: Document): void;
3
+ export interface UseIsFocusVisibleResult {
4
+ isFocusVisibleRef: React.MutableRefObject<boolean>;
5
+ onBlur: (event: React.FocusEvent<any>) => void;
6
+ onFocus: (event: React.FocusEvent<any>) => void;
7
+ ref: React.RefCallback<Element>;
8
+ }
9
+ export default function useIsFocusVisible(): UseIsFocusVisibleResult;
@@ -1,2 +1,2 @@
1
- declare const usePreviousProps: <T>(value: T) => Partial<T>;
2
- export default usePreviousProps;
1
+ declare const usePreviousProps: <T>(value: T) => Partial<T>;
2
+ export default usePreviousProps;
@@ -1,2 +1,2 @@
1
- declare const visuallyHidden: import('react').CSSProperties;
2
- export default visuallyHidden;
1
+ declare const visuallyHidden: import('react').CSSProperties;
2
+ export default visuallyHidden;