@mui/utils 6.0.0-alpha.5 → 6.0.0-alpha.8

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,12 +1,142 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.8
4
+
5
+ <!-- generated comparing v6.0.0-alpha.7..next -->
6
+
7
+ _May 21, 2024_
8
+
9
+ A big thanks to the 7 contributors who made this release possible.
10
+ This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
11
+
12
+ ### `@mui/material@6.0.0-alpha.7`
13
+
14
+ - &#8203;<!-- 04 -->[material-ui] Filter only valid theme palette for generating styles (#42147) @siriwatknp
15
+ - &#8203;<!-- 03 -->[material-ui] Remove UMD bundle (#42172) @ZeeshanTamboli
16
+ - &#8203;<!-- 02 -->[material-ui][TextField] Deprecate `*Props` props (#42062) @DiegoAndai
17
+
18
+ ### Docs
19
+
20
+ - &#8203;<!-- 08 -->[docs] Remove Base UI from the README (#42307) @danilo-leal
21
+ - &#8203;<!-- 07 -->[docs][material-ui] Fix typo in style interoperability with Tailwind CSS docs (#42279) @ZeeshanTamboli
22
+ - &#8203;<!-- 06 -->[docs][material-ui] Add supported browsers section to migration guide (#42194) @DiegoAndai
23
+ - &#8203;<!-- 05 -->[docs][material-ui][Pagination] Clarify pagination `page` prop API (#42220) @Mandar-Pandya
24
+
25
+ ### Core
26
+
27
+ - &#8203;<!-- 12 -->[blog] Update blog post OG image (#42270) @danilo-leal
28
+ - &#8203;<!-- 11 -->[blog] Update Pigment CSS post (#42266) @danilo-leal
29
+ - &#8203;<!-- 10 -->[docs] Remove LocalMonero (#42224) @oliviertassinari
30
+ - &#8203;<!-- 08 -->[docs-infra] Fix keyboard navigation on page tabs (#42152) @danilo-leal
31
+ - &#8203;<!-- 10 -->[code-infra] Remove raw-loader (#42275) @Janpot
32
+ - &#8203;<!-- 09 -->[core] Remove outdated Babel plugins (#42140) @ZeeshanTamboli
33
+ - &#8203;<!-- 12 -->[core] Fix a few more key spread issues (#42168) @oliviertassinari
34
+ - &#8203;<!-- 01 -->[website] Avoid duplicate simple vs. rich (#42100) @oliviertassinari
35
+
36
+ All contributors of this release in alphabetical order: @danilo-leal, @DiegoAndai, @Janpot, @Mandar-Pandya, @oliviertassinari, @siriwatknp, @ZeeshanTamboli
37
+
38
+ ## v6.0.0-alpha.7
39
+
40
+ <!-- generated comparing v6.0.0-alpha.6..next -->
41
+
42
+ _May 16, 2024_
43
+
44
+ A big thanks to the 14 contributors who made this release possible.
45
+
46
+ ### `@mui/material@6.0.0-alpha.7`
47
+
48
+ - &#8203;<!-- 23 -->[Autocomplete] Deprecate `componentsProps` props (#42179) @lhilgert9
49
+ - &#8203;<!-- 22 -->[Autocomplete] Improve design when there's a start adornment for small autocomplete (#41781) @TahaRhidouani
50
+ - &#8203;<!-- 21 -->[Autocomplete] deprecate `*Component` and `*Props` for v6 (#41875) @lhilgert9
51
+ - &#8203;<!-- 19 -->[CircularProgress] Deprecate composed classes (#42076) @sai6855
52
+ - &#8203;<!-- 05 -->[ToggleButtonGroup] Add missing `selected` class in ToggleButtonGroupClasses type (#42243) @tarunrajput
53
+
54
+ ### `@mui/codemod@6.0.0-alpha.6`
55
+
56
+ - &#8203;<!-- 18 -->[Divider] Only apply codemod if light prop is present (#42098) @DiegoAndai
57
+
58
+ ### Docs
59
+
60
+ - &#8203;<!-- 13 -->Fix 301 to Figma @oliviertassinari
61
+ - &#8203;<!-- 12 -->Fix use of deprecated React API (#42118) @oliviertassinari
62
+ - &#8203;<!-- 11 -->Remove the Base notification (#42191) @danilo-leal
63
+ - &#8203;<!-- 07 -->[material-ui] Improve descriptions for deprecated props (#42221) @aarongarciah
64
+ - &#8203;<!-- 06 -->[material-ui] Fix typo in composition docs (#42195) @aarongarciah
65
+
66
+ ### Core
67
+
68
+ - &#8203;<!-- 20 -->[blog] Introducing Pigment CSS blog post (#42198) @samuelsycamore
69
+ - &#8203;<!-- 17 -->[core] Remove confusing comment @oliviertassinari
70
+ - &#8203;<!-- 16 -->[core] Match other repositories and convention @oliviertassinari
71
+ - &#8203;<!-- 15 -->[core] Fix React 18.3 warnings about spreading keys in the Material UI `Autocomplete` component (#42099) @heath-freenome
72
+ - &#8203;<!-- 14 -->[core] Remove unecessary quotes @oliviertassinari
73
+ - &#8203;<!-- 10 -->[docs-infra] Share code for section title (#42236) @alexfauquette
74
+ - &#8203;<!-- 09 -->[docs-infra] Limit the copy button to the visible code block (#42115) @danilo-leal
75
+ - &#8203;<!-- 08 -->[docs-infra] Make select components with two capital letters (#42004) @alexfauquette
76
+ - &#8203;<!-- 08 -->[docs-infra][toolpad] Fix Page title and SERP title mismatch (#41919) @bharatkashyap
77
+ - &#8203;<!-- 05 -->[website] Add redirection for talk @oliviertassinari
78
+ - &#8203;<!-- 04 -->[website] Adds Arthur Balduini team info (#42193) @arthurbalduini
79
+ - &#8203;<!-- 03 -->[website] Update the role template file (#42192) @danilo-leal
80
+ - &#8203;<!-- 02 -->[website] Update MUI X deps and migrate TreeView demos to v7 API (#42149) @noraleonte
81
+ - &#8203;<!-- 01 -->[website] Fix pricing casing (#42178) @aarongarciah
82
+
83
+ All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @arthurbalduini, @bharatkashyap, @danilo-leal, @DiegoAndai, @heath-freenome, @lhilgert9, @noraleonte, @oliviertassinari, @sai6855, @samuelsycamore, @TahaRhidouani, @tarunrajput
84
+
85
+ ## v6.0.0-alpha.6
86
+
87
+ <!-- generated comparing v6.0.0-alpha.5..next -->
88
+
89
+ _May 8, 2024_
90
+
91
+ A big thanks to the 10 contributors who made this release possible.
92
+
93
+ ### `@mui/material@6.0.0-alpha.6`
94
+
95
+ - [Chip] Add colorDefault class to chipClasses (#42067) @sai6855
96
+ - Migrate components to support CSS extraction (#42001) @siriwatknp
97
+ - [SpeedDial] Deprecate TransitionComponent (#40698) @harry-whorlow
98
+
99
+ ### `@mui/codemod@6.0.0-alpha.6`
100
+
101
+ - Add `theme-v6` migration (#42056) @siriwatknp
102
+
103
+ ### `@mui/icons-material@6.0.0-alpha.6`
104
+
105
+ - Add the Emergency icon (#42080) @danilo-leal
106
+
107
+ ### Docs
108
+
109
+ - [autocomplete] Fix duplicate autocomplete id (#42086) @oliviertassinari
110
+ - Fix SEO redirection issues @oliviertassinari
111
+ - [material-ui] Fix broken link (#42142) @aarongarciah
112
+ - [material-ui][docs] Fix link on the Sync page (#42088) @danilo-leal
113
+
114
+ ### Core
115
+
116
+ - [blog] Shorten title to fit @oliviertassinari
117
+ - [blog] Update Sync post OG image (#42114) @danilo-leal
118
+ - [blog] A few tweaks in introducing-sync-plugin (#42092) @oliviertassinari
119
+ - [code-infra] Add canary release scripts (#41949) @michaldudak
120
+ - [code-infra] Move ComponentLinkHeader to @mui/docs (#42061) @Janpot
121
+ - [code-infra] Bump node image used by CI in docker (#42079) @LukasTy
122
+ - [core] Restrict import path with ESLint (#41970) @oliviertassinari
123
+ - [docs-infra] Add design and formatting improvements (#42063) @danilo-leal
124
+ - [docs-infra] Fix HTML structure violations (#42085) @oliviertassinari
125
+ - [website] Componentize a few Careers page sections (#42102) @danilo-leal
126
+ - [website] Refine the InfoCard design (#42116) @danilo-leal
127
+ - [website] Fix home page slider's track position (#42141) @aarongarciah
128
+ - [website] Closing the survey @oliviertassinari
129
+ - [website] Remove Survey banner from website and Core docs (#42104) @joserodolfofreitas
130
+
131
+ All contributors of this release in alphabetical order: @aarongarciah, @danilo-leal, @harry-whorlow, @Janpot, @joserodolfofreitas, @LukasTy, @michaldudak, @oliviertassinari, @sai6855, @siriwatknp
132
+
3
133
  ## v6.0.0-alpha.5
4
134
 
5
135
  <!-- generated comparing v6.0.0-alpha.4..next -->
6
136
 
7
137
  _May 1, 2024_
8
138
 
9
- A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
139
+ A big thanks to the 9 contributors who made this release possible.
10
140
 
11
141
  ### `@mui/material@6.0.0-alpha.5`
12
142
 
@@ -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,7 +19,9 @@ 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 => {
26
27
  // Avoid prototype pollution
@@ -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.5
2
+ * @mui/utils v6.0.0-alpha.8
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,7 +19,9 @@ 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 => {
26
27
  // Avoid prototype pollution
@@ -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.5
2
+ * @mui/utils v6.0.0-alpha.8
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,7 +26,9 @@ 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
34
  // Avoid prototype pollution
@@ -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.5
2
+ * @mui/utils v6.0.0-alpha.8
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.5",
3
+ "version": "6.0.0-alpha.8",
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.4",
29
+ "@babel/runtime": "^7.24.5",
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;