@mui/styled-engine 6.4.9 → 6.5.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,117 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.5.0
4
+
5
+ <!-- generated comparing v6.4.12..v6.x -->
6
+
7
+ _Jul 2, 2025_
8
+
9
+ A big thanks to the 2 contributors who made this release possible.
10
+
11
+ CSS layers make it easier to override styles by splitting a single style sheet into multiple layers.
12
+ To learn more, check out the [CSS layers documentation](https://v6.mui.com/material-ui/customization/css-layers/).
13
+
14
+ ### `@mui/material@6.5.0`
15
+
16
+ - [Dialog] Add codemod for deprecated props (#46335) @sai6855
17
+
18
+ ### `@mui/system@6.5.0`
19
+
20
+ - Backport CSS layers feature from v7 (#46283) @siriwatknp
21
+
22
+ ### `@mui/material-nextjs@6.5.0`
23
+
24
+ - Backport CSS layers feature from v7 (#46283) @siriwatknp
25
+
26
+ ### Docs
27
+
28
+ - Add ListItemButton to make the deprecation clear (#46357) @sai6855
29
+
30
+ All contributors of this release in alphabetical order: @sai6855, @siriwatknp
31
+
32
+ ## 6.4.12
33
+
34
+ <!-- generated comparing v6.4.11..v6.x -->
35
+
36
+ _May 30, 2025_
37
+
38
+ A big thanks to the 7 contributors who made this release possible.
39
+
40
+ ### `@mui/material@6.4.12`
41
+
42
+ - [Badge] Replace useSlotProps with useSlot hook (#45876) @sai6855
43
+ - [BottomNavigationAction] Add slots and slotProps (#45875) @sai6855
44
+ - [CardActionArea] Add slots and slotProps (#45877) @sai6855
45
+ - [OutlinedInput] Add missing `notchedOutline` slot (#45938) @siriwatknp
46
+ - [useMediaQuery] Add warning and docs for using `useMediaQuery('print')` (#45886) @good-jinu
47
+ - Fix theme object changes between renders (#45874) @siriwatknp
48
+
49
+ ### `@mui/material-nextjs@6.4.12`
50
+
51
+ - Do not wrap `@layer` order rules in App Router (#45870) @Nayeem-XTREME
52
+
53
+ ### `@mui/system@6.4.12`
54
+
55
+ - Skip styled component from being transformed (#46184) @siriwatknp
56
+
57
+ ### Docs
58
+
59
+ - [Dialog] Remove deprecated props usage in demos (#45928) @sai6855
60
+ - [Grid] Update grid migration guide (#46153) @sai6855
61
+ - [Menu] Update `paper` slot JSDoc default from `Paper` to `PopoverPaper` (@andreachiera) (#45865) @andreachiera
62
+ - Update CSS variable usage in migration guide for Pigment CSS (#46038) @sai6855
63
+ - Remove outdated StackOverflow tag (9b9f96b) @oliviertassinari
64
+ - Update `@mui/icons-material` install command to use 6.x version (#45810) @Nickknack
65
+ - Add AccordionSummary to the breaking change migration (#45973) @siriwatknp
66
+
67
+ All contributors of this release in alphabetical order: @andreachiera, @good-jinu, @Nayeem-XTREME, @Nickknack, @oliviertassinari, @sai6855, @siriwatknp
68
+
69
+ ## 6.4.11
70
+
71
+ _Apr 9, 2025_
72
+
73
+ A big thanks to the 3 contributors who made this release possible.
74
+
75
+ ### `@mui/material@6.4.11`
76
+
77
+ - [AvatarGroup] Fix `spacing` prop ignoring value `0` (#45845) @Kartik-Murthy
78
+ - [Dialog] Deprecate composed classes (#45814) @sai6855
79
+
80
+ ### `@mui/styled-engine@6.4.11`
81
+
82
+ - Add caching to improve performance for running tests with Jest (#45855) @siriwatknp
83
+
84
+ ### Docs
85
+
86
+ - Add missing v7 docs banner (#45842) @DiegoAndai
87
+ - Add v7 is here banner (#45838) @DiegoAndai
88
+ - Fix lab version install instructions (#45770) @DiegoAndai
89
+
90
+ All contributors of this release in alphabetical order: @DiegoAndai, @Kartik-Murthy, @sai6855
91
+
92
+ ## 6.4.10
93
+
94
+ <!-- generated comparing v6.4.9..v6.x -->
95
+
96
+ _Mar 31, 2025_
97
+
98
+ A big thanks to the 4 contributors who made this release possible.
99
+
100
+ ### `@mui/material@6.4.10`
101
+
102
+ - [Autocomplete] Prevent shrink animation in controlled Autocomplete when initial `value` is provided (#45735) @imadx
103
+ - [Popover] Allow `null` in `anchorEl` function return type (#45723) @eduter
104
+
105
+ ### Docs
106
+
107
+ - Fix new React project link, CRA deprecated (#45669) @oliviertassinari
108
+
109
+ ### Core
110
+
111
+ - [utils] Support cleanup callbacks in useForkRef (#45733) @DiegoAndai
112
+
113
+ All contributors of this release in alphabetical order: @DiegoAndai, @eduter, @imadx, @oliviertassinari
114
+
3
115
  ## 6.4.9
4
116
 
5
117
  <!-- generated comparing v6.4.8..v6.x -->
@@ -6,10 +6,13 @@ import { CacheProvider } from '@emotion/react';
6
6
  import createCache from '@emotion/cache';
7
7
  import { StyleSheet } from '@emotion/sheet';
8
8
 
9
+ // To fix [Jest performance](https://github.com/mui/material-ui/issues/45638).
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const cacheMap = new Map();
12
+
9
13
  // Need to add a private variable to test the generated CSS from Emotion, this is the simplest way to do it.
10
14
  // We can't test the CSS from `style` tag easily because the `speedy: true` (produce empty text content) is enabled by Emotion.
11
15
  // Even if we disable it, JSDOM needs extra configuration to be able to parse `@layer` CSS.
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
16
  export const TEST_INTERNALS_DO_NOT_USE = {
14
17
  /**
15
18
  * to intercept the generated CSS before inserting to the style tag, so that we can check the generated CSS.
@@ -80,7 +83,7 @@ function getCache(injectFirst, enableCssLayer) {
80
83
  if (enableCssLayer) {
81
84
  const prevInsert = emotionCache.insert;
82
85
  emotionCache.insert = (...args) => {
83
- if (!args[1].styles.startsWith('@layer')) {
86
+ if (!args[1].styles.match(/^@layer\s+[^{]*$/)) {
84
87
  // avoid nested @layer
85
88
  args[1].styles = `@layer mui {${args[1].styles}}`;
86
89
  }
@@ -97,7 +100,15 @@ export default function StyledEngineProvider(props) {
97
100
  enableCssLayer,
98
101
  children
99
102
  } = props;
100
- const cache = React.useMemo(() => getCache(injectFirst, enableCssLayer), [injectFirst, enableCssLayer]);
103
+ const cache = React.useMemo(() => {
104
+ const cacheKey = `${injectFirst}-${enableCssLayer}`;
105
+ if (typeof document === 'object' && cacheMap.has(cacheKey)) {
106
+ return cacheMap.get(cacheKey);
107
+ }
108
+ const fresh = getCache(injectFirst, enableCssLayer);
109
+ cacheMap.set(cacheKey, fresh);
110
+ return fresh;
111
+ }, [injectFirst, enableCssLayer]);
101
112
  return cache ? /*#__PURE__*/_jsx(CacheProvider, {
102
113
  value: cache,
103
114
  children: children
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v6.4.9
2
+ * @mui/styled-engine v6.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -6,10 +6,13 @@ import { CacheProvider } from '@emotion/react';
6
6
  import createCache from '@emotion/cache';
7
7
  import { StyleSheet } from '@emotion/sheet';
8
8
 
9
+ // To fix [Jest performance](https://github.com/mui/material-ui/issues/45638).
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const cacheMap = new Map();
12
+
9
13
  // Need to add a private variable to test the generated CSS from Emotion, this is the simplest way to do it.
10
14
  // We can't test the CSS from `style` tag easily because the `speedy: true` (produce empty text content) is enabled by Emotion.
11
15
  // Even if we disable it, JSDOM needs extra configuration to be able to parse `@layer` CSS.
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
16
  export const TEST_INTERNALS_DO_NOT_USE = {
14
17
  /**
15
18
  * to intercept the generated CSS before inserting to the style tag, so that we can check the generated CSS.
@@ -80,7 +83,7 @@ function getCache(injectFirst, enableCssLayer) {
80
83
  if (enableCssLayer) {
81
84
  const prevInsert = emotionCache.insert;
82
85
  emotionCache.insert = (...args) => {
83
- if (!args[1].styles.startsWith('@layer')) {
86
+ if (!args[1].styles.match(/^@layer\s+[^{]*$/)) {
84
87
  // avoid nested @layer
85
88
  args[1].styles = `@layer mui {${args[1].styles}}`;
86
89
  }
@@ -97,7 +100,15 @@ export default function StyledEngineProvider(props) {
97
100
  enableCssLayer,
98
101
  children
99
102
  } = props;
100
- const cache = React.useMemo(() => getCache(injectFirst, enableCssLayer), [injectFirst, enableCssLayer]);
103
+ const cache = React.useMemo(() => {
104
+ const cacheKey = `${injectFirst}-${enableCssLayer}`;
105
+ if (typeof document === 'object' && cacheMap.has(cacheKey)) {
106
+ return cacheMap.get(cacheKey);
107
+ }
108
+ const fresh = getCache(injectFirst, enableCssLayer);
109
+ cacheMap.set(cacheKey, fresh);
110
+ return fresh;
111
+ }, [injectFirst, enableCssLayer]);
101
112
  return cache ? /*#__PURE__*/_jsx(CacheProvider, {
102
113
  value: cache,
103
114
  children: children
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v6.4.9
2
+ * @mui/styled-engine v6.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -14,6 +14,9 @@ var _react2 = require("@emotion/react");
14
14
  var _cache = _interopRequireDefault(require("@emotion/cache"));
15
15
  var _sheet = require("@emotion/sheet");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
+ // To fix [Jest performance](https://github.com/mui/material-ui/issues/45638).
18
+ const cacheMap = new Map();
19
+
17
20
  // Need to add a private variable to test the generated CSS from Emotion, this is the simplest way to do it.
18
21
  // We can't test the CSS from `style` tag easily because the `speedy: true` (produce empty text content) is enabled by Emotion.
19
22
  // Even if we disable it, JSDOM needs extra configuration to be able to parse `@layer` CSS.
@@ -87,7 +90,7 @@ function getCache(injectFirst, enableCssLayer) {
87
90
  if (enableCssLayer) {
88
91
  const prevInsert = emotionCache.insert;
89
92
  emotionCache.insert = (...args) => {
90
- if (!args[1].styles.startsWith('@layer')) {
93
+ if (!args[1].styles.match(/^@layer\s+[^{]*$/)) {
91
94
  // avoid nested @layer
92
95
  args[1].styles = `@layer mui {${args[1].styles}}`;
93
96
  }
@@ -104,7 +107,15 @@ function StyledEngineProvider(props) {
104
107
  enableCssLayer,
105
108
  children
106
109
  } = props;
107
- const cache = React.useMemo(() => getCache(injectFirst, enableCssLayer), [injectFirst, enableCssLayer]);
110
+ const cache = React.useMemo(() => {
111
+ const cacheKey = `${injectFirst}-${enableCssLayer}`;
112
+ if (typeof document === 'object' && cacheMap.has(cacheKey)) {
113
+ return cacheMap.get(cacheKey);
114
+ }
115
+ const fresh = getCache(injectFirst, enableCssLayer);
116
+ cacheMap.set(cacheKey, fresh);
117
+ return fresh;
118
+ }, [injectFirst, enableCssLayer]);
108
119
  return cache ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.CacheProvider, {
109
120
  value: cache,
110
121
  children: children
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v6.4.9
2
+ * @mui/styled-engine v6.5.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/styled-engine",
3
- "version": "6.4.9",
3
+ "version": "6.5.0",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "styled() API wrapper package for emotion.",