@mui/utils 6.0.0-alpha.6 → 6.0.0-alpha.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,116 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.9
4
+
5
+ <!-- generated comparing v6.0.0-alpha.8..next -->
6
+
7
+ _May 29, 2024_
8
+
9
+ A big thanks to the 23 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 `CssVarsProvider` and `extendTheme` are now stable (#42246) @siriwatknp
12
+
13
+ ### `@mui/material@6.0.0-alpha.9`
14
+
15
+ - &#8203;<!-- 49 -->[AlertTitle] Enable extending Typography props (#42269) @lucasgmelo
16
+ - &#8203;<!-- 48 -->[AvatarGroup] deprecate `componentsProps` for v6 (#42122) @lhilgert9
17
+ - &#8203;<!-- 15 -->[Grid] Deprecate `wrap` prop (#42363) @fedirjh
18
+ - &#8203;<!-- 14 -->[ListItem] Document `*Component` and `*Props` props deprecations (#42263) @aarongarciah
19
+ - &#8203;<!-- 13 -->[ListItem] Deprecate ListItem's components and componentsProps (#42219) @aarongarciah
20
+ - &#8203;<!-- 12 -->[ListItemSecondaryAction] Deprecate component (#42251) @aarongarciah
21
+ - &#8203;<!-- 11 -->Stabilize `CssVarsProvider` and `extendTheme` (#42246) @siriwatknp
22
+ - &#8203;<!-- 10 -->[Popper] Deprecate components and componentProps props for v6 (#42111) @ChronicusUA
23
+ - &#8203;<!-- 09 -->[responsiveFontSizes] Handled undefined variants (#42412) @brijeshb42
24
+ - &#8203;<!-- 08 -->[Slider] Fix wrong CSS value (#42370) @mnajdova
25
+ - &#8203;<!-- 07 -->[Tooltip] Deprecate components and componentProps props for v6 (#42107) @ChronicusUA
26
+
27
+ ### `@mui/system@6.0.0-alpha.9`
28
+
29
+ - &#8203;<!-- 34 -->[createStyled] Intercept `ownerState` coming from `props` and `ownerState` (#42358) @DiegoAndai
30
+
31
+ ### `@mui/codemod@6.0.0-alpha.9`
32
+
33
+ - &#8203;<!-- 41 -->Add `sx` prop for v6 migration (#42153) @siriwatknp
34
+ - &#8203;<!-- 40 -->Add codemod for removing system props (#42282) @siriwatknp
35
+
36
+ ### Docs
37
+
38
+ - &#8203;<!-- 33 -->Remove unused images (#42324) @danilo-leal
39
+ - &#8203;<!-- 32 -->Add Pigment CSS and Base UI logos SVGs (#42322) @danilo-leal
40
+ - &#8203;<!-- 22 -->[joy-ui] Fix template responsiveness (#42422) @j4marcos
41
+ - &#8203;<!-- 21 -->[material-ui] Add the Pashto locale (#42244) @sayoubiaf
42
+ - &#8203;<!-- 20 -->[material-ui] Remove duplicate Design Kits page (#42338) @danilo-leal
43
+ - &#8203;<!-- 19 -->[material-ui] Document callback to access theme in GlobalStyles (#42257) @aarongarciah
44
+ - &#8203;<!-- 18 -->[material-ui] Add minor modifications to the Vertical stepper demo (#42342) @mihilt
45
+ - &#8203;<!-- 17 -->[material-ui][Tabs] Improve the Basic Tabs demo (#42374) @MatheusEli
46
+ - &#8203;<!-- 16 -->[pigment-css] Polish redirection mention @oliviertassinari
47
+
48
+ ### Core
49
+
50
+ - &#8203;<!-- 47 -->[blog] Add fixes and clean ups to the Blog page (#42311) @danilo-leal
51
+ - &#8203;<!-- 46 -->[blog] Add the "Product" tag to the Pigment CSS post (#42365) @danilo-leal
52
+ - &#8203;<!-- 45 -->[code-infra] Simplify .stylelintrc.js @oliviertassinari
53
+ - &#8203;<!-- 44 -->[code-infra] Fix stylelint locally (#42411) @oliviertassinari
54
+ - &#8203;<!-- 43 -->[code-infra] Run corepack enable on all CI jobs (#42331) @Janpot
55
+ - &#8203;<!-- 42 -->[code-infra] Create examples eslint rule (#42170) @oliviertassinari
56
+ - &#8203;<!-- 39 -->[core] Apply React 19 type changes that don't require upcoming `@types/` packages (#42346) @DiegoAndai
57
+ - &#8203;<!-- 38 -->[core] Remove `react-swipeable-views-utils` package from docs (#42378) @ZeeshanTamboli
58
+ - &#8203;<!-- 37 -->[core] Update `@testing-library/react` and `@testing-library/dom` packages (#42349) @ZeeshanTamboli
59
+ - &#8203;<!-- 36 -->[core] Remove `@types/prettier` package (#42339) @ZeeshanTamboli
60
+ - &#8203;<!-- 35 -->[core] Remove `WyW-in-JS` from Renovate config (#42335) @ZeeshanTamboli
61
+ - &#8203;<!-- 31 -->[docs-infra] Split feedback channels per product (#42413) @alexfauquette
62
+ - &#8203;<!-- 30 -->[docs-infra] Avoid cryptic errors when tests don't exist (#42356) @Janpot
63
+ - &#8203;<!-- 29 -->[docs-infra] Make menu styles consistent (#42387) @danilo-leal
64
+ - &#8203;<!-- 28 -->[docs-infra] Display deprecation messages in API pages (#42352) @aarongarciah
65
+ - &#8203;<!-- 27 -->[docs-infra] Standardize API pages Alert styles (#42386) @danilo-leal
66
+ - &#8203;<!-- 26 -->[docs-infra] Fix Toolpad Core API links (#42362) @apedroferreira
67
+ - &#8203;<!-- 25 -->[docs-infra] Tigthen up the header design (#42180) @danilo-leal
68
+ - &#8203;<!-- 24 -->[docs-infra] Add Toolpad to muiNpmOrgs for codesandbox demos (#42316) @Janpot
69
+ - &#8203;<!-- 23 -->[docs-infra] Allow JSDoc tags (#42337) @aarongarciah
70
+ - &#8203;<!-- 06 -->[test] Remove `userAgent` override in `jsdom` env (#42344) @cherniavskii
71
+ - &#8203;<!-- 05 -->[utils] Fix GitHub-reported prototype pollution vulnerability in `deepmerge` (#41652) @tjcouch-sil
72
+ - &#8203;<!-- 04 -->[website] Add Nikita to the about page (#42418) @nikitaa24
73
+ - &#8203;<!-- 03 -->[website] Fix hero spacing changes applying at the wrong breakpoint (#42341) @KenanYusuf
74
+ - &#8203;<!-- 02 -->[website] Adds Kenan Yusuf to about page (#42317) @KenanYusuf
75
+ - &#8203;<!-- 01 -->[website] Improve about page @oliviertassinari
76
+
77
+ All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @apedroferreira, @brijeshb42, @cherniavskii, @ChronicusUA, @danilo-leal, @DiegoAndai, @fedirjh, @j4marcos, @Janpot, @KenanYusuf, @lhilgert9, @lucasgmelo, @MatheusEli, @mihilt, @mnajdova, @nikitaa24, @oliviertassinari, @sayoubiaf, @siriwatknp, @tjcouch-sil, @ZeeshanTamboli
78
+
79
+ ## v6.0.0-alpha.8
80
+
81
+ <!-- generated comparing v6.0.0-alpha.7..next -->
82
+
83
+ _May 21, 2024_
84
+
85
+ A big thanks to the 7 contributors who made this release possible.
86
+ This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
87
+
88
+ ### `@mui/material@6.0.0-alpha.7`
89
+
90
+ - &#8203;<!-- 04 -->[material-ui] Filter only valid theme palette for generating styles (#42147) @siriwatknp
91
+ - &#8203;<!-- 03 -->[material-ui] Remove UMD bundle (#42172) @ZeeshanTamboli
92
+ - &#8203;<!-- 02 -->[material-ui][TextField] Deprecate `*Props` props (#42062) @DiegoAndai
93
+
94
+ ### Docs
95
+
96
+ - &#8203;<!-- 08 -->[docs] Remove Base UI from the README (#42307) @danilo-leal
97
+ - &#8203;<!-- 07 -->[docs][material-ui] Fix typo in style interoperability with Tailwind CSS docs (#42279) @ZeeshanTamboli
98
+ - &#8203;<!-- 06 -->[docs][material-ui] Add supported browsers section to migration guide (#42194) @DiegoAndai
99
+ - &#8203;<!-- 05 -->[docs][material-ui][Pagination] Clarify pagination `page` prop API (#42220) @Mandar-Pandya
100
+
101
+ ### Core
102
+
103
+ - &#8203;<!-- 12 -->[blog] Update blog post OG image (#42270) @danilo-leal
104
+ - &#8203;<!-- 11 -->[blog] Update Pigment CSS post (#42266) @danilo-leal
105
+ - &#8203;<!-- 10 -->[docs] Remove LocalMonero (#42224) @oliviertassinari
106
+ - &#8203;<!-- 08 -->[docs-infra] Fix keyboard navigation on page tabs (#42152) @danilo-leal
107
+ - &#8203;<!-- 10 -->[code-infra] Remove raw-loader (#42275) @Janpot
108
+ - &#8203;<!-- 09 -->[core] Remove outdated Babel plugins (#42140) @ZeeshanTamboli
109
+ - &#8203;<!-- 12 -->[core] Fix a few more key spread issues (#42168) @oliviertassinari
110
+ - &#8203;<!-- 01 -->[website] Avoid duplicate simple vs. rich (#42100) @oliviertassinari
111
+
112
+ All contributors of this release in alphabetical order: @danilo-leal, @DiegoAndai, @Janpot, @Mandar-Pandya, @oliviertassinari, @siriwatknp, @ZeeshanTamboli
113
+
3
114
  ## v6.0.0-alpha.7
4
115
 
5
116
  <!-- generated comparing v6.0.0-alpha.6..next -->
@@ -53,7 +164,7 @@ All contributors of this release in alphabetical order: @aarongarciah, @alexfauq
53
164
 
54
165
  _May 8, 2024_
55
166
 
56
- A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
167
+ A big thanks to the 10 contributors who made this release possible.
57
168
 
58
169
  ### `@mui/material@6.0.0-alpha.6`
59
170
 
@@ -101,7 +212,7 @@ All contributors of this release in alphabetical order: @aarongarciah, @danilo-l
101
212
 
102
213
  _May 1, 2024_
103
214
 
104
- A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
215
+ A big thanks to the 9 contributors who made this release possible.
105
216
 
106
217
  ### `@mui/material@6.0.0-alpha.5`
107
218
 
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  // https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
3
2
  export function isPlainObject(item) {
4
3
  if (typeof item !== 'object' || item === null) {
@@ -20,14 +19,14 @@ function deepClone(source) {
20
19
  export default function deepmerge(target, source, options = {
21
20
  clone: true
22
21
  }) {
23
- const output = options.clone ? _extends({}, target) : target;
22
+ const output = options.clone ? {
23
+ ...target
24
+ } : target;
24
25
  if (isPlainObject(target) && isPlainObject(source)) {
25
26
  Object.keys(source).forEach(key => {
27
+ if (isPlainObject(source[key]) &&
26
28
  // Avoid prototype pollution
27
- if (key === '__proto__') {
28
- return;
29
- }
30
- if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
29
+ Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
31
30
  // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
32
31
  output[key] = deepmerge(target[key], source[key], options);
33
32
  } else if (options.clone) {
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
3
2
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
4
3
  // the module was forked.
@@ -8,7 +7,8 @@ export default function exactProp(propTypes) {
8
7
  if (process.env.NODE_ENV === 'production') {
9
8
  return propTypes;
10
9
  }
11
- return _extends({}, propTypes, {
10
+ return {
11
+ ...propTypes,
12
12
  [specialProperty]: props => {
13
13
  const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
14
14
  if (unsupportedProps.length > 0) {
@@ -16,5 +16,5 @@ export default function exactProp(propTypes) {
16
16
  }
17
17
  return null;
18
18
  }
19
- });
19
+ };
20
20
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.0.0-alpha.6
2
+ * @mui/utils v6.0.0-alpha.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  // https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
3
2
  export function isPlainObject(item) {
4
3
  if (typeof item !== 'object' || item === null) {
@@ -20,14 +19,14 @@ function deepClone(source) {
20
19
  export default function deepmerge(target, source, options = {
21
20
  clone: true
22
21
  }) {
23
- const output = options.clone ? _extends({}, target) : target;
22
+ const output = options.clone ? {
23
+ ...target
24
+ } : target;
24
25
  if (isPlainObject(target) && isPlainObject(source)) {
25
26
  Object.keys(source).forEach(key => {
27
+ if (isPlainObject(source[key]) &&
26
28
  // Avoid prototype pollution
27
- if (key === '__proto__') {
28
- return;
29
- }
30
- if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
29
+ Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
31
30
  // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
32
31
  output[key] = deepmerge(target[key], source[key], options);
33
32
  } else if (options.clone) {
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
3
2
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
4
3
  // the module was forked.
@@ -8,7 +7,8 @@ export default function exactProp(propTypes) {
8
7
  if (process.env.NODE_ENV === 'production') {
9
8
  return propTypes;
10
9
  }
11
- return _extends({}, propTypes, {
10
+ return {
11
+ ...propTypes,
12
12
  [specialProperty]: props => {
13
13
  const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
14
14
  if (unsupportedProps.length > 0) {
@@ -16,5 +16,5 @@ export default function exactProp(propTypes) {
16
16
  }
17
17
  return null;
18
18
  }
19
- });
19
+ };
20
20
  }
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.0.0-alpha.6
2
+ * @mui/utils v6.0.0-alpha.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,11 +1,12 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  export default function requirePropFactory(componentNameInError, Component) {
3
2
  if (process.env.NODE_ENV === 'production') {
4
3
  return () => null;
5
4
  }
6
5
 
7
6
  // eslint-disable-next-line react/forbid-foreign-prop-types
8
- const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;
7
+ const prevPropTypes = Component ? {
8
+ ...Component.propTypes
9
+ } : null;
9
10
  const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
10
11
  const propFullNameSafe = propFullName || propName;
11
12
  const defaultTypeChecker = prevPropTypes?.[propFullNameSafe];
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  /**
3
2
  * Add keys, values of `defaultProps` that does not exist in `props`
4
3
  * @param {object} defaultProps
@@ -6,10 +5,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
6
5
  * @returns {object} resolved props
7
6
  */
8
7
  export default function resolveProps(defaultProps, props) {
9
- const output = _extends({}, props);
8
+ const output = {
9
+ ...props
10
+ };
10
11
  Object.keys(defaultProps).forEach(propName => {
11
12
  if (propName.toString().match(/^(components|slots)$/)) {
12
- output[propName] = _extends({}, defaultProps[propName], output[propName]);
13
+ output[propName] = {
14
+ ...defaultProps[propName],
15
+ ...output[propName]
16
+ };
13
17
  } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
14
18
  const defaultSlotProps = defaultProps[propName] || {};
15
19
  const slotProps = props[propName];
@@ -21,7 +25,9 @@ export default function resolveProps(defaultProps, props) {
21
25
  // Reduce the iteration if the default slot props is empty
22
26
  output[propName] = slotProps;
23
27
  } else {
24
- output[propName] = _extends({}, slotProps);
28
+ output[propName] = {
29
+ ...slotProps
30
+ };
25
31
  Object.keys(defaultSlotProps).forEach(slotPropName => {
26
32
  output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
27
33
  });
@@ -3,21 +3,11 @@
3
3
  import useLazyRef from '../useLazyRef/useLazyRef';
4
4
  import useOnMount from '../useOnMount/useOnMount';
5
5
  export class Timeout {
6
- constructor() {
7
- this.currentId = null;
8
- this.clear = () => {
9
- if (this.currentId !== null) {
10
- clearTimeout(this.currentId);
11
- this.currentId = null;
12
- }
13
- };
14
- this.disposeEffect = () => {
15
- return this.clear;
16
- };
17
- }
18
6
  static create() {
19
7
  return new Timeout();
20
8
  }
9
+ currentId = null;
10
+
21
11
  /**
22
12
  * Executes `fn` after `delay`, clearing any previously scheduled call.
23
13
  */
@@ -28,6 +18,15 @@ export class Timeout {
28
18
  fn();
29
19
  }, delay);
30
20
  }
21
+ clear = () => {
22
+ if (this.currentId !== null) {
23
+ clearTimeout(this.currentId);
24
+ this.currentId = null;
25
+ }
26
+ };
27
+ disposeEffect = () => {
28
+ return this.clear;
29
+ };
31
30
  }
32
31
  export default function useTimeout() {
33
32
  const timeout = useLazyRef(Timeout.create).current;
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = deepmerge;
8
7
  exports.isPlainObject = isPlainObject;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
8
  // https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
11
9
  function isPlainObject(item) {
12
10
  if (typeof item !== 'object' || item === null) {
@@ -28,14 +26,14 @@ function deepClone(source) {
28
26
  function deepmerge(target, source, options = {
29
27
  clone: true
30
28
  }) {
31
- const output = options.clone ? (0, _extends2.default)({}, target) : target;
29
+ const output = options.clone ? {
30
+ ...target
31
+ } : target;
32
32
  if (isPlainObject(target) && isPlainObject(source)) {
33
33
  Object.keys(source).forEach(key => {
34
+ if (isPlainObject(source[key]) &&
34
35
  // Avoid prototype pollution
35
- if (key === '__proto__') {
36
- return;
37
- }
38
- if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
36
+ Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
39
37
  // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
40
38
  output[key] = deepmerge(target[key], source[key], options);
41
39
  } else if (options.clone) {
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = exactProp;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
7
  // This module is based on https://github.com/airbnb/prop-types-exact repository.
10
8
  // However, in order to reduce the number of dependencies and to remove some extra safe checks
11
9
  // the module was forked.
@@ -15,7 +13,8 @@ function exactProp(propTypes) {
15
13
  if (process.env.NODE_ENV === 'production') {
16
14
  return propTypes;
17
15
  }
18
- return (0, _extends2.default)({}, propTypes, {
16
+ return {
17
+ ...propTypes,
19
18
  [specialProperty]: props => {
20
19
  const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
21
20
  if (unsupportedProps.length > 0) {
@@ -23,5 +22,5 @@ function exactProp(propTypes) {
23
22
  }
24
23
  return null;
25
24
  }
26
- });
25
+ };
27
26
  }
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.0.0-alpha.6
2
+ * @mui/utils v6.0.0-alpha.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = requirePropFactory;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
7
  function requirePropFactory(componentNameInError, Component) {
10
8
  if (process.env.NODE_ENV === 'production') {
11
9
  return () => null;
12
10
  }
13
11
 
14
12
  // eslint-disable-next-line react/forbid-foreign-prop-types
15
- const prevPropTypes = Component ? (0, _extends2.default)({}, Component.propTypes) : null;
13
+ const prevPropTypes = Component ? {
14
+ ...Component.propTypes
15
+ } : null;
16
16
  const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
17
17
  const propFullNameSafe = propFullName || propName;
18
18
  const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = resolveProps;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
7
  /**
10
8
  * Add keys, values of `defaultProps` that does not exist in `props`
11
9
  * @param {object} defaultProps
@@ -13,10 +11,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
13
11
  * @returns {object} resolved props
14
12
  */
15
13
  function resolveProps(defaultProps, props) {
16
- const output = (0, _extends2.default)({}, props);
14
+ const output = {
15
+ ...props
16
+ };
17
17
  Object.keys(defaultProps).forEach(propName => {
18
18
  if (propName.toString().match(/^(components|slots)$/)) {
19
- output[propName] = (0, _extends2.default)({}, defaultProps[propName], output[propName]);
19
+ output[propName] = {
20
+ ...defaultProps[propName],
21
+ ...output[propName]
22
+ };
20
23
  } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
21
24
  const defaultSlotProps = defaultProps[propName] || {};
22
25
  const slotProps = props[propName];
@@ -28,7 +31,9 @@ function resolveProps(defaultProps, props) {
28
31
  // Reduce the iteration if the default slot props is empty
29
32
  output[propName] = slotProps;
30
33
  } else {
31
- output[propName] = (0, _extends2.default)({}, slotProps);
34
+ output[propName] = {
35
+ ...slotProps
36
+ };
32
37
  Object.keys(defaultSlotProps).forEach(slotPropName => {
33
38
  output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
34
39
  });
@@ -10,21 +10,11 @@ exports.default = useTimeout;
10
10
  var _useLazyRef = _interopRequireDefault(require("../useLazyRef/useLazyRef"));
11
11
  var _useOnMount = _interopRequireDefault(require("../useOnMount/useOnMount"));
12
12
  class Timeout {
13
- constructor() {
14
- this.currentId = null;
15
- this.clear = () => {
16
- if (this.currentId !== null) {
17
- clearTimeout(this.currentId);
18
- this.currentId = null;
19
- }
20
- };
21
- this.disposeEffect = () => {
22
- return this.clear;
23
- };
24
- }
25
13
  static create() {
26
14
  return new Timeout();
27
15
  }
16
+ currentId = null;
17
+
28
18
  /**
29
19
  * Executes `fn` after `delay`, clearing any previously scheduled call.
30
20
  */
@@ -35,6 +25,15 @@ class Timeout {
35
25
  fn();
36
26
  }, delay);
37
27
  }
28
+ clear = () => {
29
+ if (this.currentId !== null) {
30
+ clearTimeout(this.currentId);
31
+ this.currentId = null;
32
+ }
33
+ };
34
+ disposeEffect = () => {
35
+ return this.clear;
36
+ };
38
37
  }
39
38
  exports.Timeout = Timeout;
40
39
  function useTimeout() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "6.0.0-alpha.6",
3
+ "version": "6.0.0-alpha.9",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -26,7 +26,7 @@
26
26
  "url": "https://opencollective.com/mui-org"
27
27
  },
28
28
  "dependencies": {
29
- "@babel/runtime": "^7.24.5",
29
+ "@babel/runtime": "^7.24.6",
30
30
  "@types/prop-types": "^15.7.12",
31
31
  "prop-types": "^15.8.1",
32
32
  "react-is": "^18.2.0"
@@ -1,11 +1,12 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  export default function requirePropFactory(componentNameInError, Component) {
3
2
  if (process.env.NODE_ENV === 'production') {
4
3
  return () => null;
5
4
  }
6
5
 
7
6
  // eslint-disable-next-line react/forbid-foreign-prop-types
8
- const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;
7
+ const prevPropTypes = Component ? {
8
+ ...Component.propTypes
9
+ } : null;
9
10
  const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
10
11
  const propFullNameSafe = propFullName || propName;
11
12
  const defaultTypeChecker = prevPropTypes?.[propFullNameSafe];
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  /**
3
2
  * Add keys, values of `defaultProps` that does not exist in `props`
4
3
  * @param {object} defaultProps
@@ -6,10 +5,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
6
5
  * @returns {object} resolved props
7
6
  */
8
7
  export default function resolveProps(defaultProps, props) {
9
- const output = _extends({}, props);
8
+ const output = {
9
+ ...props
10
+ };
10
11
  Object.keys(defaultProps).forEach(propName => {
11
12
  if (propName.toString().match(/^(components|slots)$/)) {
12
- output[propName] = _extends({}, defaultProps[propName], output[propName]);
13
+ output[propName] = {
14
+ ...defaultProps[propName],
15
+ ...output[propName]
16
+ };
13
17
  } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
14
18
  const defaultSlotProps = defaultProps[propName] || {};
15
19
  const slotProps = props[propName];
@@ -21,7 +25,9 @@ export default function resolveProps(defaultProps, props) {
21
25
  // Reduce the iteration if the default slot props is empty
22
26
  output[propName] = slotProps;
23
27
  } else {
24
- output[propName] = _extends({}, slotProps);
28
+ output[propName] = {
29
+ ...slotProps
30
+ };
25
31
  Object.keys(defaultSlotProps).forEach(slotPropName => {
26
32
  output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
27
33
  });
@@ -3,21 +3,11 @@
3
3
  import useLazyRef from '../useLazyRef/useLazyRef';
4
4
  import useOnMount from '../useOnMount/useOnMount';
5
5
  export class Timeout {
6
- constructor() {
7
- this.currentId = null;
8
- this.clear = () => {
9
- if (this.currentId !== null) {
10
- clearTimeout(this.currentId);
11
- this.currentId = null;
12
- }
13
- };
14
- this.disposeEffect = () => {
15
- return this.clear;
16
- };
17
- }
18
6
  static create() {
19
7
  return new Timeout();
20
8
  }
9
+ currentId = null;
10
+
21
11
  /**
22
12
  * Executes `fn` after `delay`, clearing any previously scheduled call.
23
13
  */
@@ -28,6 +18,15 @@ export class Timeout {
28
18
  fn();
29
19
  }, delay);
30
20
  }
21
+ clear = () => {
22
+ if (this.currentId !== null) {
23
+ clearTimeout(this.currentId);
24
+ this.currentId = null;
25
+ }
26
+ };
27
+ disposeEffect = () => {
28
+ return this.clear;
29
+ };
31
30
  }
32
31
  export default function useTimeout() {
33
32
  const timeout = useLazyRef(Timeout.create).current;