@mui/utils 6.1.10 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,82 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.2.1
4
+
5
+ <!-- generated comparing v6.2.0..master -->
6
+
7
+ _Dec 17, 2024_
8
+
9
+ A big thanks to the 10 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.2.1`
12
+
13
+ - Update `overridesResolver` return from object to array of styles (#44752) @siddhantantil39
14
+ - [Pagination] Use correct `aria-current` value (#44753) @jacklaurencegaray
15
+ - [Select] Set `aria-required` & `aria-invalid` on `combobox` instead of hidden input (#44731) @ben-pomelo
16
+
17
+ ### `@mui/system@6.2.1`
18
+
19
+ - Warns if the hex color contains trailing space (#44538) @siriwatknp
20
+
21
+ ### Docs
22
+
23
+ - [material-ui][Dialog] Fix crashing of DraggableDialog demo (#44747) @sai6855
24
+ - [material-ui][TextField] Update `react-number-format` demo to use the recommended prop (#44743) @siriwatknp
25
+ - [material-ui][TextField] Add size default prop to api docs (#44714) @sai6855
26
+ - [material-ui][TextField] Add suffix shrink demo (#44744) @siriwatknp
27
+
28
+ ### Core
29
+
30
+ - [api-docs-builder] Preserve multiline prop descriptions with `rawDescriptions` option (#44737) @vladmoroz
31
+ - Fix running mocha related scripts on Windows locally (#44664) @ChristopherJamesL
32
+ - Update `eslint-plugin-jsx-a11y` (#44701) @ZeeshanTamboli
33
+ - Add documentation to `useThemeProps`, `deepmerge` and `composeClasses` functions (#44703) @JCQuintas
34
+ - [examples] Add Theme Mode Switch to Next.js TS example (#43576) @TurtIeSocks
35
+
36
+ All contributors of this release in alphabetical order: @ben-pomelo, @ChristopherJamesL, @jacklaurencegaray, @JCQuintas, @sai6855, @siddhantantil39, @siriwatknp, @TurtIeSocks, @vladmoroz, @ZeeshanTamboli
37
+
38
+ ## 6.2.0
39
+
40
+ <!-- generated comparing v6.1.10..master -->
41
+
42
+ _Dec 10, 2024_
43
+
44
+ A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
45
+
46
+ - Material UI is now compatible with React 19 (#44672) @DiegoAndai
47
+ - Fixed incorrect `aria-orientation` for vertical sliders. <kbd>ArrowRight</kbd> now increases the value and <kbd>ArrowLeft</kbd> decreases the value in vertical sliders; they were reversed in prior versions. (#44537) @mj12albert
48
+
49
+ ### `@mui/material@6.2.0`
50
+
51
+ - [Box] Add missing `component` to `BoxProps` type (#44643) @DiegoAndai
52
+ - [Grid] Fix spacing when using css variables (#44663) @DiegoAndai
53
+ - [ListItemText] Add `slots` and `slotProps` (#44571) @sai6855
54
+
55
+ ### Docs
56
+
57
+ - Add Toolpad Core template link (#44415) @bharatkashyap
58
+
59
+ ### Core
60
+
61
+ - [docs-infra] Allow custom annotations (#44707) @vladmoroz
62
+ - [Box] Fix `component` prop test (#44651) @DiegoAndai
63
+ - React 19 useRef cleanup (#44704) @DiegoAndai
64
+ - Remove obselete lerna options (#44676) @ZeeshanTamboli
65
+ - Fix Regular Expression Denial of Service (ReDoS) vulnerabilities (#44627) @SuperMaxine
66
+ - Fix number of contributors (#44650) @aarongarciah
67
+ - [docs-infra] Add support for data attributes in the API generation (#44709) @mnajdova
68
+ - [docs-infra] Fix RTL dark mode (#41803) @alexfauquette
69
+ - [Grid] Remove deeply nested imports (#43605) @Janpot
70
+
71
+ All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @bharatkashyap, @DiegoAndai, @Janpot, @mj12albert, @mnajdova, @sai6855, @SuperMaxine, @vladmoroz, @ZeeshanTamboli
72
+
3
73
  ## 6.1.10
4
74
 
5
75
  <!-- generated comparing v6.1.9..master -->
6
76
 
7
77
  _Dec 3, 2024_
8
78
 
9
- A big thanks to the 10 contributors who made this release possible.
79
+ A big thanks to the 11 contributors who made this release possible.
10
80
 
11
81
  ### `@mui/material@6.1.10`
12
82
 
@@ -45,7 +115,7 @@ A big thanks to the 10 contributors who made this release possible.
45
115
  - [docs-infra] Fix TOC RTL padding regression (#44535) @oliviertassinari
46
116
  - [test-utils] Remove leftover React.ReactElement<any> from describeConformance.tsx (#44639) @sai6855
47
117
 
48
- All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @renovate[bot], @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
118
+ All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
49
119
 
50
120
  ## 6.1.9
51
121
 
@@ -1 +1,29 @@
1
+ /**
2
+ * Compose classes from multiple sources.
3
+ *
4
+ * @example
5
+ * ```tsx
6
+ * const slots = {
7
+ * root: ['root', 'primary'],
8
+ * label: ['label'],
9
+ * };
10
+ *
11
+ * const getUtilityClass = (slot) => `MuiButton-${slot}`;
12
+ *
13
+ * const classes = {
14
+ * root: 'my-root-class',
15
+ * };
16
+ *
17
+ * const output = composeClasses(slots, getUtilityClass, classes);
18
+ * // {
19
+ * // root: 'MuiButton-root MuiButton-primary my-root-class',
20
+ * // label: 'MuiButton-label',
21
+ * // }
22
+ * ```
23
+ *
24
+ * @param slots a list of classes for each possible slot
25
+ * @param getUtilityClass a function to resolve the class based on the slot name
26
+ * @param classes the input classes from props
27
+ * @returns the resolved classes for all slots
28
+ */
1
29
  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>;
@@ -9,6 +9,34 @@ exports.default = composeClasses;
9
9
  These rules are preventing the performance optimizations below.
10
10
  */
11
11
 
12
+ /**
13
+ * Compose classes from multiple sources.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * const slots = {
18
+ * root: ['root', 'primary'],
19
+ * label: ['label'],
20
+ * };
21
+ *
22
+ * const getUtilityClass = (slot) => `MuiButton-${slot}`;
23
+ *
24
+ * const classes = {
25
+ * root: 'my-root-class',
26
+ * };
27
+ *
28
+ * const output = composeClasses(slots, getUtilityClass, classes);
29
+ * // {
30
+ * // root: 'MuiButton-root MuiButton-primary my-root-class',
31
+ * // label: 'MuiButton-label',
32
+ * // }
33
+ * ```
34
+ *
35
+ * @param slots a list of classes for each possible slot
36
+ * @param getUtilityClass a function to resolve the class based on the slot name
37
+ * @param classes the input classes from props
38
+ * @returns the resolved classes for all slots
39
+ */
12
40
  function composeClasses(slots, getUtilityClass, classes = undefined) {
13
41
  const output = {};
14
42
  for (const slotName in slots) {
@@ -2,4 +2,22 @@ export declare function isPlainObject(item: unknown): item is Record<keyof any,
2
2
  export interface DeepmergeOptions {
3
3
  clone?: boolean;
4
4
  }
5
+ /**
6
+ * Merge objects deeply.
7
+ * It will shallow copy React elements.
8
+ *
9
+ * If `options.clone` is set to `false` the source object will be merged directly into the target object.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * deepmerge({ a: { b: 1 }, d: 2 }, { a: { c: 2 }, d: 4 });
14
+ * // => { a: { b: 1, c: 2 }, d: 4 }
15
+ * ````
16
+ *
17
+ * @param target The target object.
18
+ * @param source The source object.
19
+ * @param options The merge options.
20
+ * @param options.clone Set to `false` to merge the source object directly into the target object.
21
+ * @returns The merged object.
22
+ */
5
23
  export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
@@ -25,6 +25,25 @@ function deepClone(source) {
25
25
  });
26
26
  return output;
27
27
  }
28
+
29
+ /**
30
+ * Merge objects deeply.
31
+ * It will shallow copy React elements.
32
+ *
33
+ * If `options.clone` is set to `false` the source object will be merged directly into the target object.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * deepmerge({ a: { b: 1 }, d: 2 }, { a: { c: 2 }, d: 4 });
38
+ * // => { a: { b: 1, c: 2 }, d: 4 }
39
+ * ````
40
+ *
41
+ * @param target The target object.
42
+ * @param source The source object.
43
+ * @param options The merge options.
44
+ * @param options.clone Set to `false` to merge the source object directly into the target object.
45
+ * @returns The merged object.
46
+ */
28
47
  function deepmerge(target, source, options = {
29
48
  clone: true
30
49
  }) {
@@ -3,6 +3,34 @@
3
3
  These rules are preventing the performance optimizations below.
4
4
  */
5
5
 
6
+ /**
7
+ * Compose classes from multiple sources.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const slots = {
12
+ * root: ['root', 'primary'],
13
+ * label: ['label'],
14
+ * };
15
+ *
16
+ * const getUtilityClass = (slot) => `MuiButton-${slot}`;
17
+ *
18
+ * const classes = {
19
+ * root: 'my-root-class',
20
+ * };
21
+ *
22
+ * const output = composeClasses(slots, getUtilityClass, classes);
23
+ * // {
24
+ * // root: 'MuiButton-root MuiButton-primary my-root-class',
25
+ * // label: 'MuiButton-label',
26
+ * // }
27
+ * ```
28
+ *
29
+ * @param slots a list of classes for each possible slot
30
+ * @param getUtilityClass a function to resolve the class based on the slot name
31
+ * @param classes the input classes from props
32
+ * @returns the resolved classes for all slots
33
+ */
6
34
  export default function composeClasses(slots, getUtilityClass, classes = undefined) {
7
35
  const output = {};
8
36
  for (const slotName in slots) {
@@ -18,6 +18,25 @@ function deepClone(source) {
18
18
  });
19
19
  return output;
20
20
  }
21
+
22
+ /**
23
+ * Merge objects deeply.
24
+ * It will shallow copy React elements.
25
+ *
26
+ * If `options.clone` is set to `false` the source object will be merged directly into the target object.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * deepmerge({ a: { b: 1 }, d: 2 }, { a: { c: 2 }, d: 4 });
31
+ * // => { a: { b: 1, c: 2 }, d: 4 }
32
+ * ````
33
+ *
34
+ * @param target The target object.
35
+ * @param source The source object.
36
+ * @param options The merge options.
37
+ * @param options.clone Set to `false` to merge the source object directly into the target object.
38
+ * @returns The merged object.
39
+ */
21
40
  export default function deepmerge(target, source, options = {
22
41
  clone: true
23
42
  }) {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.1.10
2
+ * @mui/utils v6.2.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -3,6 +3,34 @@
3
3
  These rules are preventing the performance optimizations below.
4
4
  */
5
5
 
6
+ /**
7
+ * Compose classes from multiple sources.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const slots = {
12
+ * root: ['root', 'primary'],
13
+ * label: ['label'],
14
+ * };
15
+ *
16
+ * const getUtilityClass = (slot) => `MuiButton-${slot}`;
17
+ *
18
+ * const classes = {
19
+ * root: 'my-root-class',
20
+ * };
21
+ *
22
+ * const output = composeClasses(slots, getUtilityClass, classes);
23
+ * // {
24
+ * // root: 'MuiButton-root MuiButton-primary my-root-class',
25
+ * // label: 'MuiButton-label',
26
+ * // }
27
+ * ```
28
+ *
29
+ * @param slots a list of classes for each possible slot
30
+ * @param getUtilityClass a function to resolve the class based on the slot name
31
+ * @param classes the input classes from props
32
+ * @returns the resolved classes for all slots
33
+ */
6
34
  export default function composeClasses(slots, getUtilityClass, classes = undefined) {
7
35
  const output = {};
8
36
  for (const slotName in slots) {
@@ -18,6 +18,25 @@ function deepClone(source) {
18
18
  });
19
19
  return output;
20
20
  }
21
+
22
+ /**
23
+ * Merge objects deeply.
24
+ * It will shallow copy React elements.
25
+ *
26
+ * If `options.clone` is set to `false` the source object will be merged directly into the target object.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * deepmerge({ a: { b: 1 }, d: 2 }, { a: { c: 2 }, d: 4 });
31
+ * // => { a: { b: 1, c: 2 }, d: 4 }
32
+ * ````
33
+ *
34
+ * @param target The target object.
35
+ * @param source The source object.
36
+ * @param options The merge options.
37
+ * @param options.clone Set to `false` to merge the source object directly into the target object.
38
+ * @returns The merged object.
39
+ */
21
40
  export default function deepmerge(target, source, options = {
22
41
  clone: true
23
42
  }) {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/utils v6.1.10
2
+ * @mui/utils v6.2.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/utils",
3
- "version": "6.1.10",
3
+ "version": "6.2.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.26.0",
30
- "@types/prop-types": "^15.7.13",
30
+ "@types/prop-types": "^15.7.14",
31
31
  "clsx": "^2.1.1",
32
32
  "prop-types": "^15.8.1",
33
- "react-is": "^18.3.1",
34
- "@mui/types": "^7.2.19"
33
+ "react-is": "^19.0.0",
34
+ "@mui/types": "^7.2.20"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
@@ -6,4 +6,4 @@ import * as React from 'react';
6
6
  * @usage
7
7
  * const ref = useLazyRef(sortColumns, columns)
8
8
  */
9
- export default function useLazyRef<T, U>(init: (arg?: U) => T, initArg?: U): React.MutableRefObject<T>;
9
+ export default function useLazyRef<T, U>(init: (arg?: U) => T, initArg?: U): React.RefObject<T>;