@mui/utils 5.10.6 → 5.10.9

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 +195 -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/useForkRef.js +9 -8
  13. package/exactProp.d.ts +2 -2
  14. package/formatMuiErrorMessage.d.ts +6 -6
  15. package/generateUtilityClass/generateUtilityClass.d.ts +2 -2
  16. package/generateUtilityClass/index.d.ts +2 -2
  17. package/generateUtilityClasses/generateUtilityClasses.d.ts +1 -1
  18. package/generateUtilityClasses/index.d.ts +1 -1
  19. package/getDisplayName.d.ts +8 -8
  20. package/getScrollbarSize.d.ts +1 -1
  21. package/index.d.ts +38 -38
  22. package/index.js +1 -1
  23. package/integerPropType.d.ts +7 -7
  24. package/isMuiElement.d.ts +1 -1
  25. package/legacy/index.js +1 -1
  26. package/legacy/useForkRef.js +15 -8
  27. package/modern/index.js +1 -1
  28. package/modern/useForkRef.js +9 -8
  29. package/ownerDocument.d.ts +1 -1
  30. package/ownerWindow.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/ponyfillGlobal.d.ts +2 -2
  33. package/refType.d.ts +3 -3
  34. package/resolveProps.d.ts +9 -9
  35. package/setRef.d.ts +15 -15
  36. package/useEventCallback.d.ts +4 -4
  37. package/useEventCallback.spec.d.ts +1 -1
  38. package/useForkRef.d.ts +2 -2
  39. package/useForkRef.js +9 -8
  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,200 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.10.9
4
+
5
+ <!-- generated comparing v5.10.8..master -->
6
+
7
+ _Oct 10, 2022_
8
+
9
+ A big thanks to the 7 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 [Joy] Button loading functionality has been added by @kushagra010 (#34658)
12
+ - And more 🐛 bug fixes and 📚 documentation improvements.
13
+
14
+ ### `@mui/material@5.10.9`
15
+
16
+ - &#8203;<!-- 16 -->[Grid v2][system] Handle direction object prop for responsive design (#34574) @vanyaxk
17
+ - &#8203;<!-- 03 -->[Slider] Fix unnecessary accessibility attribute in root element (#34610) @vanyaxk
18
+
19
+ ### `@mui/system@5.10.9`
20
+
21
+ #### BREAKING CHANGE
22
+
23
+ - &#8203;<!-- 17 -->[system] Fix color-scheme implementation (#34639) @siriwatknp
24
+
25
+ The `enableColorScheme` prop has been removed from `CssVarsProvider` and `getInitColorScheme` (both Material UI and Joy UI).
26
+
27
+ Migration:
28
+
29
+ - **Material UI**: you can enable the CSS color scheme via `<CssBaseline enableColorScheme />`.
30
+ - **Joy UI**: it is enabled automatically if you use `<CssBaseline />`, [see the docs](https://mui.com/joy-ui/react-css-baseline/).
31
+
32
+ #### Changes
33
+
34
+ - &#8203;<!-- 02 -->[system] Fix typo in createCssVarsProvider (#34661) @HexM7
35
+
36
+ ### `@mui/base@5.0.0-alpha.101`
37
+
38
+ - &#8203;<!-- 01 -->[TrapFocus] Restore the previously exported type from @mui/material (#34601) @michaldudak
39
+
40
+ ### `@mui/joy@5.0.0-alpha.49`
41
+
42
+ - &#8203;<!-- 04 -->[Joy] Add button loading functionality (#34658) @kushagra010
43
+
44
+ ### Docs
45
+
46
+ - &#8203;<!-- 18 -->[docs] Revert #34541 (#34700) @michaldudak
47
+ - &#8203;<!-- 15 -->[blog] Blog post for MUI X v6 alpha zero (#34424) @joserodolfofreitas
48
+ - &#8203;<!-- 09 -->[docs] Improve Joy UI tutorial demo (#34653) @oliviertassinari
49
+ - &#8203;<!-- 08 -->[docs] Explain how SelectUnstyled renders a hidden input (#34638) @michaldudak
50
+ - &#8203;<!-- 07 -->[docs] Fix Taiwan description (#34611) @oliviertassinari
51
+ - &#8203;<!-- 06 -->[docs] Fix codesandbox export with dayjs (#34619) @oliviertassinari
52
+ - &#8203;<!-- 05 -->[docs] Explain the purpose of renderGroup prop (#34066) @michaldudak
53
+
54
+ ### Core
55
+
56
+ - &#8203;<!-- 14 -->[core] Make useForkRef variadic (#27939) @michaldudak
57
+ - &#8203;<!-- 13 -->[core] Speedup of yarn install in the CI (#34632) @oliviertassinari
58
+ - &#8203;<!-- 12 -->[core] Fix markdown loader on Windows (#34623) @michaldudak
59
+ - &#8203;<!-- 11 -->[core] Update changelog for version v5.10.8 (#34593) @mnajdova
60
+ - &#8203;<!-- 10 -->[core] Update root package.json version (#34592) @mnajdova
61
+
62
+ All contributors of this release in alphabetical order: @HexM7, @joserodolfofreitas, @kushagra010, @michaldudak, @mnajdova, @oliviertassinari, @vanyaxk
63
+
64
+ ## 5.10.8
65
+
66
+ <!-- generated comparing v5.10.7..master -->
67
+
68
+ _Oct 3, 2022_
69
+
70
+ A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
71
+
72
+ - 🚀 [SnackbarUnstyled](https://mui.com/base/react-snackbar/) component & headless hook are added to MUI Base (#33227) @ZeeshanTamboli
73
+ - 📚 [CSS variables documentation](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/) for Material UI has been added by @siriwatknp (#33958)
74
+ - And more 🐛 bug fixes and 📚 documentation improvements.
75
+
76
+ ### `@mui/material@5.10.8`
77
+
78
+ - &#8203;<!-- 28 -->[Autocomplete] Skip filtering when list of options is loading (#33278) @ndebeiss
79
+ - &#8203;<!-- 13 -->[Fab] Add `disabled` class to FAB button (#34245) @meenarama
80
+ - &#8203;<!-- 09 -->[l10n] Add Arabic Saudi Arabia (ar-SA) locale (#33340) @rolule
81
+ - &#8203;<!-- 08 -->[l10n] zhTW refinement (#33391) @Aporim2051
82
+ - &#8203;<!-- 07 -->[Popover] Add `ownerState` on the paper slot (#34445) @kabernardes
83
+ - &#8203;<!-- 05 -->[Slider] Fixed incorrect marks displayed due to duplicate keys in range (#33526) @kskd1804
84
+ - &#8203;<!-- 03 -->[TextField] Fix typo in FormControlLabel declaration file (#34535) @hghmn
85
+
86
+ ### `@mui/base@5.0.0-alpha.100`
87
+
88
+ - &#8203;<!-- 04 -->[SnackbarUnstyled] Create component and `useSnackbar` hook (#33227) @ZeeshanTamboli
89
+
90
+ ### `@mui/joy@5.0.0-alpha.48`
91
+
92
+ - &#8203;<!-- 12 -->[Joy] Fix `variantPlain` classname missing in few components (#34534) @hbjORbj
93
+ - &#8203;<!-- 11 -->[Joy] Fix input decorator color and list padding (#34586) @siriwatknp
94
+ - &#8203;<!-- 10 -->[Joy] Miscellaneous fixes (#34492) @siriwatknp
95
+
96
+ ### Docs
97
+
98
+ - &#8203;<!-- 27 -->[blog] Fix 404 link in base introduction @oliviertassinari
99
+ - &#8203;<!-- 21 -->[docs] Fix CI build (#34589) @mnajdova
100
+ - &#8203;<!-- 20 -->[docs] Temporary remove date picker from home page (#34541) @siriwatknp
101
+ - &#8203;<!-- 19 -->[docs] Revise and expand Joy UI "Tutorial" doc (#34569) @samuelsycamore
102
+ - &#8203;<!-- 18 -->[docs] Fix SEO issues (#34537) @oliviertassinari
103
+ - &#8203;<!-- 17 -->[docs] Add CSS variables documentation for Material UI (#33958) @siriwatknp
104
+ - &#8203;<!-- 16 -->[docs] Capitalize Material Design on the Breakpoints page (#34481) @Dustin-Digitar
105
+ - &#8203;<!-- 15 -->[docs] Able to load doc components inside markdown files (#34243) @flaviendelangle
106
+ - &#8203;<!-- 14 -->[docs] Use mouse pointer on esc button in the search modal (#34485) @minkyngkm
107
+ - &#8203;<!-- 02 -->[website] Fix typo in pricing FAQ @oliviertassinari
108
+ - &#8203;<!-- 01 -->[website] Move the React Engineer role from open to next (#34494) @mnajdova
109
+
110
+ ### Core
111
+
112
+ - &#8203;<!-- 26 -->[core] Update root package.json version (#34592) @mnajdova
113
+ - &#8203;<!-- 25 -->[core] Remove useless comment in fixtures (#34581) @Garz4
114
+ - &#8203;<!-- 24 -->[core] Fix link to CODE_OF_CONDUCT.md (#34543) @peippo
115
+ - &#8203;<!-- 23 -->[core] Remove outdated docsearch.js dependency (#34421) @oliviertassinari
116
+ - &#8203;<!-- 22 -->[core] Add `newFeature` to the typing of MuiPage (#34511) @flaviendelangle
117
+
118
+ All contributors of this release in alphabetical order: @Aporim2051, @Dustin-Digitar, @flaviendelangle, @Garz4, @hbjORbj, @hghmn, @kabernardes, @kskd1804, @meenarama, @minkyngkm, @mnajdova, @ndebeiss, @oliviertassinari, @peippo, @rolule, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
119
+
120
+ ## 5.10.7
121
+
122
+ <!-- generated comparing v5.10.6..master -->
123
+
124
+ _Sep 26, 2022_
125
+
126
+ A big thanks to the 21 contributors who made this release possible. Here are some highlights ✨:
127
+
128
+ - 🚀 [Divider](https://mui.com/joy-ui/react-divider/) component is added to Joy UI (#34403) @siriwatknp
129
+
130
+ ### `@mui/material@5.10.7`
131
+
132
+ - [CssVarsProvider] Exclude dark mode variables from `:root` stylesheet (#34131) @siriwatknp
133
+ - [Chip] Add chip classes (#33801) @pratikkarad
134
+ - [Slider] Fix typo in the comments in the source (#34452) @HexM7
135
+ - [SvgIcon] Fix passing an ownerState to SvgIcon changes the font size (#34429) @ZeeshanTamboli
136
+ - [Stepper] Fix optional label is not centered when `alternativeLabel` is used (#34335) @ZeeshanTamboli
137
+ - [Tooltip] Add undefined, null or false in `title` (#34289) @abhinav-22-tech
138
+ - Make @emotion/\* fully supported in all Material UI components (#34451) @garronej
139
+
140
+ ### `@mui/system@5.10.7`
141
+
142
+ - [system] Fix parsing of hsla colors in getLuminance (#34437) @ptrfrncsmrph
143
+ - [system] Fix incorrect type of `shape.borderRadius` in theme (#34076) @ZeeshanTamboli
144
+ - [system] Replace `enableSystem` with `defaultMode` (#33960) @siriwatknp
145
+
146
+ ### `@mui/material@5.0.0-alpha.101`
147
+
148
+ - [deps] Move @mui/types to dependencies (#34384) @Methuselah96
149
+
150
+ ### `@mui/base@5.0.0-alpha.99`
151
+
152
+ #### Breaking changes
153
+
154
+ - [TrapFocus] Rename TrapFocus to FocusTrap (#34216) @kabernardes
155
+
156
+ ```diff
157
+ - import TrapFocus from ‘@mui/base/TrapFocus’;
158
+ + import FocusTrap from ‘@mui/base/FocusTrap’;
159
+ ```
160
+
161
+ #### Changes
162
+
163
+ - [MultiSelect] Require a single tap to select an item on mobile Chrome (#33932) @michaldudak
164
+
165
+ ### `@mui/joy@5.0.0-alpha.47`
166
+
167
+ - [Checkbox] spread `value`, `required`, and `readOnly` to input (#34477) @siriwatknp
168
+ - [Chip] Fix unbinded `onClick` prop (#34455) @HexM7
169
+ - [Divider] Add `Divider` component (#34403) @siriwatknp
170
+ - [Radio] spread `readOnly` and `required` to input (#34478) @siriwatknp
171
+
172
+ ### Docs
173
+
174
+ - [blog] MUI Base announcement typo fixed (#34409) @prakhargupta1
175
+ - [blog] Fix typo in date-pickers v5 stable (#34386) @alexfauquette
176
+ - [blog] Update date on date pickers v5 release blog post (#34406) @joserodolfofreitas
177
+ - [docs] Update `useMenu` and `useMenuItem` hooks demo (#34166) @ZeeshanTamboli
178
+ - [docs] Update the guide for migrating to TSS (#34417) @garronej
179
+ - [docs] Fix typo in `Grid` docs (#34475) @Dustin-Digitar
180
+ - [docs] Fix typo in `Back to top` section in AppBar docs (#34479) @Dustin-Digitar
181
+ - [docs] Standardize all MUI Core "Installation" pages (#34168) @samuelsycamore
182
+ - [docs] Fix webpack file name to the standard: `webpack.config.js` (#34446) @CodingItWrong
183
+ - [docs] Fix Select `onChange` call (#34408) @siriwatknp
184
+ - [docs] Notification for pickers blog - v5 stable (#34400) @joserodolfofreitas
185
+ - [docs] Improve social sharing of docs pages (#34346) @oliviertassinari
186
+ - [docs] Refine the use of MUI vs. Material UI (#34345) @oliviertassinari
187
+ - [docs] Send feedback directly to a dedicated slack channel (#34196) @alexfauquette
188
+ - [website] Adds Bilal to about page (#34412) @MBilalShafi
189
+ - [website] Add date range picker to pricing table (#34399) @joserodolfofreitas
190
+
191
+ ### Core
192
+
193
+ - [core] Document some types in @mui/styled-engine-sc (#34413) @mnajdova
194
+ - [core] Add yml support to prettier (#33980) @Janpot
195
+
196
+ All contributors of this release in alphabetical order: @abhinav-22-tech, @alexfauquette, @CodingItWrong, @Dustin-Digitar, @garronej, @HexM7, @howlettt, @Janpot, @joserodolfofreitas, @kabernardes, @MBilalShafi, @Methuselah96, @michaldudak, @mnajdova, @oliviertassinari, @prakhargupta1, @pratikkarad, @ptrfrncsmrph, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
197
+
3
198
  ## 5.10.6
4
199
 
5
200
  <!-- generated comparing v5.10.5..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/useForkRef.js CHANGED
@@ -1,19 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import setRef from './setRef';
3
- export default function useForkRef(refA, refB) {
3
+ export default function useForkRef(...refs) {
4
4
  /**
5
- * This will create a new function if the ref props change and are defined.
5
+ * This will create a new function if the refs passed to this hook change and are all defined.
6
6
  * This means react will call the old forkRef with `null` and the new forkRef
7
7
  * with the ref. Cleanup naturally emerges from this behavior.
8
8
  */
9
9
  return React.useMemo(() => {
10
- if (refA == null && refB == null) {
10
+ if (refs.every(ref => ref == null)) {
11
11
  return null;
12
12
  }
13
13
 
14
- return refValue => {
15
- setRef(refA, refValue);
16
- setRef(refB, refValue);
17
- };
18
- }, [refA, refB]);
14
+ return instance => {
15
+ refs.forEach(ref => {
16
+ setRef(ref, instance);
17
+ });
18
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
19
+ }, refs);
19
20
  }
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>;
@@ -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 declare type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'required' | 'selected';
2
- export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
1
+ export declare type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | '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,4 +1,4 @@
1
- /** @license MUI v5.10.6
1
+ /** @license MUI v5.10.9
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -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;
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.10.6
1
+ /** @license MUI v5.10.9
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1,19 +1,26 @@
1
1
  import * as React from 'react';
2
2
  import setRef from './setRef';
3
- export default function useForkRef(refA, refB) {
3
+ export default function useForkRef() {
4
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
5
+ refs[_key] = arguments[_key];
6
+ }
7
+
4
8
  /**
5
- * This will create a new function if the ref props change and are defined.
9
+ * This will create a new function if the refs passed to this hook change and are all defined.
6
10
  * This means react will call the old forkRef with `null` and the new forkRef
7
11
  * with the ref. Cleanup naturally emerges from this behavior.
8
12
  */
9
13
  return React.useMemo(function () {
10
- if (refA == null && refB == null) {
14
+ if (refs.every(function (ref) {
15
+ return ref == null;
16
+ })) {
11
17
  return null;
12
18
  }
13
19
 
14
- return function (refValue) {
15
- setRef(refA, refValue);
16
- setRef(refB, refValue);
17
- };
18
- }, [refA, refB]);
20
+ return function (instance) {
21
+ refs.forEach(function (ref) {
22
+ setRef(ref, instance);
23
+ });
24
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
25
+ }, refs);
19
26
  }
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.10.6
1
+ /** @license MUI v5.10.9
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1,19 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import setRef from './setRef';
3
- export default function useForkRef(refA, refB) {
3
+ export default function useForkRef(...refs) {
4
4
  /**
5
- * This will create a new function if the ref props change and are defined.
5
+ * This will create a new function if the refs passed to this hook change and are all defined.
6
6
  * This means react will call the old forkRef with `null` and the new forkRef
7
7
  * with the ref. Cleanup naturally emerges from this behavior.
8
8
  */
9
9
  return React.useMemo(() => {
10
- if (refA == null && refB == null) {
10
+ if (refs.every(ref => ref == null)) {
11
11
  return null;
12
12
  }
13
13
 
14
- return refValue => {
15
- setRef(refA, refValue);
16
- setRef(refB, refValue);
17
- };
18
- }, [refA, refB]);
14
+ return instance => {
15
+ refs.forEach(ref => {
16
+ setRef(ref, instance);
17
+ });
18
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
19
+ }, refs);
19
20
  }
@@ -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.10.6",
3
+ "version": "5.10.9",
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,9 +1,9 @@
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
- className?: string;
9
- } & 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
+ className?: string;
9
+ } & 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<InstanceA, InstanceB>(refA: React.Ref<InstanceA> | null | undefined, refB: React.Ref<InstanceB> | null | undefined): React.Ref<InstanceA & InstanceB> | null;
1
+ import * as React from 'react';
2
+ export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
package/useForkRef.js CHANGED
@@ -15,20 +15,21 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
15
15
 
16
16
  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; }
17
17
 
18
- function useForkRef(refA, refB) {
18
+ function useForkRef(...refs) {
19
19
  /**
20
- * This will create a new function if the ref props change and are defined.
20
+ * This will create a new function if the refs passed to this hook change and are all defined.
21
21
  * This means react will call the old forkRef with `null` and the new forkRef
22
22
  * with the ref. Cleanup naturally emerges from this behavior.
23
23
  */
24
24
  return React.useMemo(() => {
25
- if (refA == null && refB == null) {
25
+ if (refs.every(ref => ref == null)) {
26
26
  return null;
27
27
  }
28
28
 
29
- return refValue => {
30
- (0, _setRef.default)(refA, refValue);
31
- (0, _setRef.default)(refB, refValue);
32
- };
33
- }, [refA, refB]);
29
+ return instance => {
30
+ refs.forEach(ref => {
31
+ (0, _setRef.default)(ref, instance);
32
+ });
33
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
34
+ }, refs);
34
35
  }
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.Ref<unknown>;
8
+ }
9
+ export default function useIsFocusVisible(): UseIsFocusVisibleResult;
@@ -1,2 +1,2 @@
1
- declare const usePreviousProps: (value: object) => object;
2
- export default usePreviousProps;
1
+ declare const usePreviousProps: (value: object) => object;
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;