@mui/utils 6.0.0-beta.6 → 6.0.0-rc.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 +73 -0
- package/composeClasses/composeClasses.js +17 -15
- package/esm/composeClasses/composeClasses.js +17 -15
- package/getValidReactChildren/getValidReactChildren.d.ts +1 -1
- package/index.js +1 -1
- package/isHostComponent/isHostComponent.d.ts +1 -1
- package/modern/composeClasses/composeClasses.js +17 -15
- package/modern/index.js +1 -1
- package/package.json +1 -1
- package/useSlotProps/useSlotProps.d.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.0.0-rc.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.0.0-beta.6..next -->
|
|
6
|
+
|
|
7
|
+
_Aug 22, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- ⚡ Rendering performance improvements
|
|
12
|
+
|
|
13
|
+
### `@mui/material@6.0.0-rc.0`
|
|
14
|
+
|
|
15
|
+
#### Breaking changes
|
|
16
|
+
|
|
17
|
+
- [Box] Remove `component` from `BoxOwnProps` (#43384) @DiegoAndai
|
|
18
|
+
|
|
19
|
+
The `component` prop has been removed from the `BoxOwnProps` as it is already included in the `Box` type.
|
|
20
|
+
This might affect your code if you are using the `styled` function with the `Box` component.
|
|
21
|
+
If this is the case, use a `div` element instead of `Box`:
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
-const StyledBox = styled(Box)`
|
|
25
|
+
+const StyledDiv = styled('div')`
|
|
26
|
+
color: white;
|
|
27
|
+
`;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This yields the same end result.
|
|
31
|
+
If this doesn't work for you, you can also cast the `styled` returned value to `typeof Box`:
|
|
32
|
+
|
|
33
|
+
```diff
|
|
34
|
+
const StyledBox = styled(Box)`
|
|
35
|
+
color: white;
|
|
36
|
+
-`;
|
|
37
|
+
+` as typeof Box;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Changes
|
|
41
|
+
|
|
42
|
+
- [ListItem] Remove unnecessary TypeScript test (#43359) @sai6855
|
|
43
|
+
- Skip generating CSS variables for a custom spacing function (#43389) @siriwatknp
|
|
44
|
+
- Revert visual regressions from #42283 (#43364) @ZeeshanTamboli
|
|
45
|
+
|
|
46
|
+
### `@mui/codemod@6.0.0-rc.0`
|
|
47
|
+
|
|
48
|
+
- Add Grid2 to removeSystemProps codemod (#43302) @DiegoAndai
|
|
49
|
+
|
|
50
|
+
### Docs
|
|
51
|
+
|
|
52
|
+
- [blog] Add video to the Pigment CSS blog post (#42500) @oliviertassinari
|
|
53
|
+
- Fix broken link to milestones (#43379) @oliviertassinari
|
|
54
|
+
- Update CSS theme variables related content (#43130) @siriwatknp
|
|
55
|
+
- Fix link to createTheme source (#43332) @oliviertassinari
|
|
56
|
+
- Add cache to avoid unnecessary jsx dynamic import and theme getting (#43139) @Vxee
|
|
57
|
+
- Fix broken link to Next.js docs @oliviertassinari
|
|
58
|
+
- [material-ui] Revamp `Composition` guide (#43266) @ZeeshanTamboli
|
|
59
|
+
- [material-ui][Menu] Replace `PaperProps` with `slotProps.paper` in demos (#43354) @sai6855
|
|
60
|
+
|
|
61
|
+
### Core
|
|
62
|
+
|
|
63
|
+
- [code-infra] Change docs:start script to serve the exports folder (#43375) @Janpot
|
|
64
|
+
- [core] Fix typescript-next CI workflow (#43394) @aarongarciah
|
|
65
|
+
- [core] Run `@mui/system` TypeScript module augmentation tests in CI (#43386) @ZeeshanTamboli
|
|
66
|
+
- [core] Enable manage-package-manager-versions pnpm flag (#43366) @aarongarciah
|
|
67
|
+
- [core] Replace `indexOf` with `includes` (#42883) @k-rajat19
|
|
68
|
+
- [docs-infra] Add GitHub source link to components (#43228) @Jay-Karia
|
|
69
|
+
- [docs-infra] Fix copy shortcut (#43361) @oliviertassinari
|
|
70
|
+
- [perf] Remove theme/styling allocations (#43372) @romgrk
|
|
71
|
+
- [perf] Improve `composeClasses` (#43363) @romgrk
|
|
72
|
+
- [perf] Remove system allocations (#43306) @romgrk
|
|
73
|
+
|
|
74
|
+
All contributors of this release in alphabetical order: @aarongarciah, @DiegoAndai, @Janpot, @Jay-Karia, @k-rajat19, @oliviertassinari, @rluzists1, @romgrk, @sai6855, @siriwatknp, @Vxee, @ZeeshanTamboli
|
|
75
|
+
|
|
3
76
|
## 6.0.0-beta.6
|
|
4
77
|
|
|
5
78
|
<!-- generated comparing v6.0.0-beta.5..next -->
|
|
@@ -4,24 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = composeClasses;
|
|
7
|
+
/* eslint no-restricted-syntax: 0, prefer-template: 0, guard-for-in: 0
|
|
8
|
+
---
|
|
9
|
+
These rules are preventing the performance optimizations below.
|
|
10
|
+
*/
|
|
11
|
+
|
|
7
12
|
function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
8
13
|
const output = {};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (classes && classes[key]) {
|
|
20
|
-
acc.push(classes[key]);
|
|
14
|
+
for (const slotName in slots) {
|
|
15
|
+
const slot = slots[slotName];
|
|
16
|
+
let buffer = '';
|
|
17
|
+
for (let i = 0; i < slot.length; i += 1) {
|
|
18
|
+
const value = slot[i];
|
|
19
|
+
if (value) {
|
|
20
|
+
buffer += getUtilityClass(value) + ' ';
|
|
21
|
+
if (classes && classes[value]) {
|
|
22
|
+
buffer += classes[value] + ' ';
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
|
+
output[slotName] = buffer;
|
|
27
|
+
}
|
|
26
28
|
return output;
|
|
27
29
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
/* eslint no-restricted-syntax: 0, prefer-template: 0, guard-for-in: 0
|
|
2
|
+
---
|
|
3
|
+
These rules are preventing the performance optimizations below.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
export default function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
2
7
|
const output = {};
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (classes && classes[key]) {
|
|
14
|
-
acc.push(classes[key]);
|
|
8
|
+
for (const slotName in slots) {
|
|
9
|
+
const slot = slots[slotName];
|
|
10
|
+
let buffer = '';
|
|
11
|
+
for (let i = 0; i < slot.length; i += 1) {
|
|
12
|
+
const value = slot[i];
|
|
13
|
+
if (value) {
|
|
14
|
+
buffer += getUtilityClass(value) + ' ';
|
|
15
|
+
if (classes && classes[value]) {
|
|
16
|
+
buffer += classes[value] + ' ';
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
output[slotName] = buffer;
|
|
21
|
+
}
|
|
20
22
|
return output;
|
|
21
23
|
}
|
|
@@ -5,4 +5,4 @@ import * as React from 'react';
|
|
|
5
5
|
*
|
|
6
6
|
* @param children the children
|
|
7
7
|
*/
|
|
8
|
-
export default function getValidReactChildren(children: React.ReactNode): React.ReactElement<any
|
|
8
|
+
export default function getValidReactChildren(children: React.ReactNode): React.ReactElement<any>[];
|
package/index.js
CHANGED
|
@@ -2,5 +2,5 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Determines if a given element is a DOM element name (i.e. not a React component).
|
|
4
4
|
*/
|
|
5
|
-
declare function isHostComponent(element: React.ElementType):
|
|
5
|
+
declare function isHostComponent(element: React.ElementType): element is "symbol" | "object" | "center" | "button" | "meter" | "textarea" | "style" | "progress" | "text" | "ruby" | "table" | "small" | "sub" | "circle" | "embed" | "pre" | "caption" | "menu" | "clipPath" | "filter" | "menuitem" | "mask" | "marker" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "canvas" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "meta" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "q" | "rp" | "rt" | "s" | "samp" | "search" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "sup" | "template" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view";
|
|
6
6
|
export default isHostComponent;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
/* eslint no-restricted-syntax: 0, prefer-template: 0, guard-for-in: 0
|
|
2
|
+
---
|
|
3
|
+
These rules are preventing the performance optimizations below.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
export default function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
2
7
|
const output = {};
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (classes && classes[key]) {
|
|
14
|
-
acc.push(classes[key]);
|
|
8
|
+
for (const slotName in slots) {
|
|
9
|
+
const slot = slots[slotName];
|
|
10
|
+
let buffer = '';
|
|
11
|
+
for (let i = 0; i < slot.length; i += 1) {
|
|
12
|
+
const value = slot[i];
|
|
13
|
+
if (value) {
|
|
14
|
+
buffer += getUtilityClass(value) + ' ';
|
|
15
|
+
if (classes && classes[value]) {
|
|
16
|
+
buffer += classes[value] + ' ';
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
output[slotName] = buffer;
|
|
21
|
+
}
|
|
20
22
|
return output;
|
|
21
23
|
}
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -31,10 +31,10 @@ export type UseSlotPropsResult<ElementType extends React.ElementType, SlotProps,
|
|
|
31
31
|
* @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.
|
|
32
32
|
*/
|
|
33
33
|
declare function useSlotProps<ElementType extends React.ElementType, SlotProps, AdditionalProps, OwnerState>(parameters: UseSlotPropsParameters<ElementType, SlotProps, object, WithCommonProps<Record<string, any>>, AdditionalProps, OwnerState>): import("@mui/types").Simplify<import("@mui/types").Simplify<SlotProps & object & AdditionalProps & {
|
|
34
|
-
className?: string
|
|
35
|
-
style?: React.CSSProperties
|
|
34
|
+
className?: string;
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
36
|
}> & {
|
|
37
|
-
ref: ((instance: any) => void) | null;
|
|
37
|
+
ref: ((instance: any | null) => void) | null;
|
|
38
38
|
} & {
|
|
39
39
|
ownerState: ElementType extends React.ComponentType<any> ? OwnerState : ElementType extends keyof React.JSX.IntrinsicElements ? undefined : OwnerState | undefined;
|
|
40
40
|
}>;
|