@mui/utils 6.2.0 → 6.3.0

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,81 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.3.0
4
+
5
+ <!-- generated comparing v6.2.1..master -->
6
+
7
+ _Dec 23, 2024_
8
+
9
+ A big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - Fix invalid HTML structure in the Accordion component (#44408) @ZeeshanTamboli
12
+ The HTML elements of the Accordion summary have been updated:
13
+ - the root element is now button (previously div).
14
+ - summary content and the icon wrapper are now span (previously div).
15
+ This will only impact you if you used the HTML element as selectors in your styles.
16
+
17
+ ### `@mui/material@6.3.0`
18
+
19
+ - [Accordion] Fix invalid HTML inside heading (#44408) @ZeeshanTamboli
20
+ - [useAutocomplete] Improve TS typing of `groupedOptions` prop (#44657) @lewxdev
21
+ - Prevent `ownerState` propagation for transition slots (#44401) @ZeeshanTamboli
22
+ - [StepContent] Add slots and slotProps (#44742) @sai6855
23
+ - [TablePagination] Add the rest of `slots` and `slotProps`. (#44570) @siriwatknp
24
+
25
+ ### `@mui/system@6.3.0`
26
+
27
+ - Set `before` directly without using prepend for global styles (#44648) @siriwatknp
28
+
29
+ ### Docs
30
+
31
+ - [material-ui] Improve `theme.applyStyles()` docs (#44658) @DiegoAndai
32
+ - [material-ui] Update MD callout (#43958) @aarongarciah
33
+
34
+ ### Core
35
+
36
+ - Remove unnecessary conditional around `.muiName =` (#44071) @Janpot
37
+ - [blog] Material UI: 2024 EOY updates blog post (#44722) @alelthomas
38
+ - Fix quickstart command in pigment docs (#44806) @yash49
39
+ - [docs-infra] Remove Next.js production profiler (#44823) @romgrk
40
+ - [docs-infra] Remove no longer support `optimizeFonts` Next.js option (#44802) @LukasTy
41
+
42
+ All contributors of this release in alphabetical order: @aarongarciah, @alelthomas, @DiegoAndai, @Janpot, @lewxdev, @LukasTy, @romgrk, @sai6855, @siriwatknp, @yash49, @ZeeshanTamboli
43
+
44
+ ## 6.2.1
45
+
46
+ <!-- generated comparing v6.2.0..master -->
47
+
48
+ _Dec 17, 2024_
49
+
50
+ A big thanks to the 10 contributors who made this release possible.
51
+
52
+ ### `@mui/material@6.2.1`
53
+
54
+ - Update `overridesResolver` return from object to array of styles (#44752) @siddhantantil39
55
+ - [Pagination] Use correct `aria-current` value (#44753) @jacklaurencegaray
56
+ - [Select] Set `aria-required` & `aria-invalid` on `combobox` instead of hidden input (#44731) @ben-pomelo
57
+
58
+ ### `@mui/system@6.2.1`
59
+
60
+ - Warns if the hex color contains trailing space (#44538) @siriwatknp
61
+
62
+ ### Docs
63
+
64
+ - [material-ui][Dialog] Fix crashing of DraggableDialog demo (#44747) @sai6855
65
+ - [material-ui][TextField] Update `react-number-format` demo to use the recommended prop (#44743) @siriwatknp
66
+ - [material-ui][TextField] Add size default prop to api docs (#44714) @sai6855
67
+ - [material-ui][TextField] Add suffix shrink demo (#44744) @siriwatknp
68
+
69
+ ### Core
70
+
71
+ - [api-docs-builder] Preserve multiline prop descriptions with `rawDescriptions` option (#44737) @vladmoroz
72
+ - Fix running mocha related scripts on Windows locally (#44664) @ChristopherJamesL
73
+ - Update `eslint-plugin-jsx-a11y` (#44701) @ZeeshanTamboli
74
+ - Add documentation to `useThemeProps`, `deepmerge` and `composeClasses` functions (#44703) @JCQuintas
75
+ - [examples] Add Theme Mode Switch to Next.js TS example (#43576) @TurtIeSocks
76
+
77
+ All contributors of this release in alphabetical order: @ben-pomelo, @ChristopherJamesL, @jacklaurencegaray, @JCQuintas, @sai6855, @siddhantantil39, @siriwatknp, @TurtIeSocks, @vladmoroz, @ZeeshanTamboli
78
+
3
79
  ## 6.2.0
4
80
 
5
81
  <!-- generated comparing v6.1.10..master -->
@@ -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.2.0
2
+ * @mui/utils v6.3.0
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.2.0
2
+ * @mui/utils v6.3.0
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.2.0",
3
+ "version": "6.3.0",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Utility functions for React components.",
@@ -31,7 +31,7 @@
31
31
  "clsx": "^2.1.1",
32
32
  "prop-types": "^15.8.1",
33
33
  "react-is": "^19.0.0",
34
- "@mui/types": "^7.2.19"
34
+ "@mui/types": "^7.2.20"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",