@mui/system 6.1.8 → 6.1.9

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,53 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.1.9
4
+
5
+ <!-- generated comparing v6.1.8..master -->
6
+
7
+ _Nov 27, 2024_
8
+
9
+ A big thanks to the 8 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.1.9`
12
+
13
+ - [Select] Omit `placeholder` from props (#44502) @Juneezee
14
+ - [Grid2] Add container class to `Grid2Classes` (#44562) @sai6855
15
+
16
+ ### `@mui/system@6.1.9`
17
+
18
+ - Add ThemeProvider `noSsr` to prevent double rendering (#44451) @siriwatknp
19
+
20
+ ### `@mui/codemod@6.1.9`
21
+
22
+ - [codemod] Fix handling of computed `paragraph` props (#44195) @joshkel
23
+
24
+ ### `@mui/material-pigment-css@6.1.9`
25
+
26
+ - Make @pigment-css/react as peer dependency (#44498) @brijeshb42
27
+
28
+ ### Docs
29
+
30
+ - [material-ui] Add missing required dependencies in dashboard template README (#44476) @mesqueeb
31
+ - [material-ui] Add missing Roboto import to Next.js integration docs (#44462) @StaceyD22
32
+ - [material-ui][Dialog] Fix padding in SimpleDialog demo (#44467) @oliviertassinari
33
+ - Fix template page issues (#44466) @oliviertassinari
34
+ - [examples] Add dark mode example for Material UI + Pigment CSS (#44480) @mnajdova
35
+
36
+ ### Core
37
+
38
+ - Remove TODO line in the changelog (#44484) @mnajdova
39
+ - Polish image display (418e888) @oliviertassinari
40
+ - [core-infra] Add no-relative-packages (#44489) @oliviertassinari
41
+ - [docs-infra] Support CSS variables API info (#44559) @mnajdova
42
+ - [docs-infra] Fix display when ad-block triggers (#44567) @oliviertassinari
43
+ - [docs-infra] Improve locator finding using visible option (#44541) @siriwatknp
44
+ - [docs-infra] Correctly flatten the pages tree (#44514) @oliviertassinari
45
+ - [docs-infra] Fix Sponsor design regression (#44515) @oliviertassinari
46
+ - [test] Remove React.ReactElement<any> from describeConformance.tsx (#44318) @sai6855
47
+ - [test] Do not enforce the presence of `ownerState.className` in `describeConformance` (#44479) @flaviendelangle
48
+
49
+ All contributors of this release in alphabetical order: @brijeshb42, @flaviendelangle, @joshkel, @Juneezee, @mesqueeb, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp, @StaceyD22
50
+
3
51
  ## v6.1.8
4
52
 
5
53
  <!-- generated comparing v6.1.7..master -->
@@ -8,8 +56,6 @@ _Nov 20, 2024_
8
56
 
9
57
  A big thanks to the 10 contributors who made this release possible.
10
58
 
11
- TODO INSERT HIGHLIGHTS
12
-
13
59
  ### `@mui/material@6.1.8`
14
60
 
15
61
  - [Autocomplete] Use `ul` element for the listbox (#44422) @DiegoAndai
@@ -59,7 +59,8 @@ function createCssVarsProvider(options) {
59
59
  colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,
60
60
  disableNestedContext = false,
61
61
  disableStyleSheetGeneration = false,
62
- defaultMode: initialMode = 'system'
62
+ defaultMode: initialMode = 'system',
63
+ noSsr
63
64
  } = props;
64
65
  const hasMounted = React.useRef(false);
65
66
  const upperTheme = (0, _privateTheming.useTheme)();
@@ -100,7 +101,8 @@ function createCssVarsProvider(options) {
100
101
  modeStorageKey,
101
102
  colorSchemeStorageKey,
102
103
  defaultMode,
103
- storageWindow
104
+ storageWindow,
105
+ noSsr
104
106
  });
105
107
  let mode = stateMode;
106
108
  let colorScheme = stateColorScheme;
@@ -286,6 +288,11 @@ function createCssVarsProvider(options) {
286
288
  * The key in the local storage used to store current color scheme.
287
289
  */
288
290
  modeStorageKey: _propTypes.default.string,
291
+ /**
292
+ * If `true`, the mode will be the same value as the storage without an extra rerendering after the hydration.
293
+ * You should use this option in conjuction with `InitColorSchemeScript` component.
294
+ */
295
+ noSsr: _propTypes.default.bool,
289
296
  /**
290
297
  * The window that attaches the 'storage' event listener.
291
298
  * @default window
@@ -48,6 +48,7 @@ interface UseCurrentColoSchemeOptions<SupportedColorScheme extends string> {
48
48
  modeStorageKey?: string;
49
49
  colorSchemeStorageKey?: string;
50
50
  storageWindow?: Window | null;
51
+ noSsr?: boolean;
51
52
  }
52
53
  export default function useCurrentColorScheme<SupportedColorScheme extends string>(options: UseCurrentColoSchemeOptions<SupportedColorScheme>): Result<SupportedColorScheme>;
53
54
  export {};
@@ -64,7 +64,8 @@ function useCurrentColorScheme(options) {
64
64
  supportedColorSchemes = [],
65
65
  modeStorageKey = _InitColorSchemeScript.DEFAULT_MODE_STORAGE_KEY,
66
66
  colorSchemeStorageKey = _InitColorSchemeScript.DEFAULT_COLOR_SCHEME_STORAGE_KEY,
67
- storageWindow = typeof window === 'undefined' ? undefined : window
67
+ storageWindow = typeof window === 'undefined' ? undefined : window,
68
+ noSsr = false
68
69
  } = options;
69
70
  const joinedColorSchemes = supportedColorSchemes.join(',');
70
71
  const isMultiSchemes = supportedColorSchemes.length > 1;
@@ -79,15 +80,10 @@ function useCurrentColorScheme(options) {
79
80
  darkColorScheme
80
81
  };
81
82
  });
82
- // This could be improved with `React.useSyncExternalStore` in the future.
83
- const [, setHasMounted] = React.useState(false);
84
- const hasMounted = React.useRef(false);
83
+ const [isClient, setIsClient] = React.useState(noSsr || !isMultiSchemes);
85
84
  React.useEffect(() => {
86
- if (isMultiSchemes) {
87
- setHasMounted(true); // to rerender the component after hydration
88
- }
89
- hasMounted.current = true;
90
- }, [isMultiSchemes]);
85
+ setIsClient(true); // to rerender the component after hydration
86
+ }, []);
91
87
  const colorScheme = getColorScheme(state);
92
88
  const setMode = React.useCallback(mode => {
93
89
  setState(currentState => {
@@ -251,9 +247,9 @@ function useCurrentColorScheme(options) {
251
247
  }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow, isMultiSchemes]);
252
248
  return {
253
249
  ...state,
254
- mode: hasMounted.current || !isMultiSchemes ? state.mode : undefined,
255
- systemMode: hasMounted.current || !isMultiSchemes ? state.systemMode : undefined,
256
- colorScheme: hasMounted.current || !isMultiSchemes ? colorScheme : undefined,
250
+ mode: isClient ? state.mode : undefined,
251
+ systemMode: isClient ? state.systemMode : undefined,
252
+ colorScheme: isClient ? colorScheme : undefined,
257
253
  setMode,
258
254
  setColorScheme
259
255
  };
@@ -50,7 +50,8 @@ export default function createCssVarsProvider(options) {
50
50
  colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,
51
51
  disableNestedContext = false,
52
52
  disableStyleSheetGeneration = false,
53
- defaultMode: initialMode = 'system'
53
+ defaultMode: initialMode = 'system',
54
+ noSsr
54
55
  } = props;
55
56
  const hasMounted = React.useRef(false);
56
57
  const upperTheme = muiUseTheme();
@@ -91,7 +92,8 @@ export default function createCssVarsProvider(options) {
91
92
  modeStorageKey,
92
93
  colorSchemeStorageKey,
93
94
  defaultMode,
94
- storageWindow
95
+ storageWindow,
96
+ noSsr
95
97
  });
96
98
  let mode = stateMode;
97
99
  let colorScheme = stateColorScheme;
@@ -277,6 +279,11 @@ export default function createCssVarsProvider(options) {
277
279
  * The key in the local storage used to store current color scheme.
278
280
  */
279
281
  modeStorageKey: PropTypes.string,
282
+ /**
283
+ * If `true`, the mode will be the same value as the storage without an extra rerendering after the hydration.
284
+ * You should use this option in conjuction with `InitColorSchemeScript` component.
285
+ */
286
+ noSsr: PropTypes.bool,
280
287
  /**
281
288
  * The window that attaches the 'storage' event listener.
282
289
  * @default window
@@ -56,7 +56,8 @@ export default function useCurrentColorScheme(options) {
56
56
  supportedColorSchemes = [],
57
57
  modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
58
58
  colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
59
- storageWindow = typeof window === 'undefined' ? undefined : window
59
+ storageWindow = typeof window === 'undefined' ? undefined : window,
60
+ noSsr = false
60
61
  } = options;
61
62
  const joinedColorSchemes = supportedColorSchemes.join(',');
62
63
  const isMultiSchemes = supportedColorSchemes.length > 1;
@@ -71,15 +72,10 @@ export default function useCurrentColorScheme(options) {
71
72
  darkColorScheme
72
73
  };
73
74
  });
74
- // This could be improved with `React.useSyncExternalStore` in the future.
75
- const [, setHasMounted] = React.useState(false);
76
- const hasMounted = React.useRef(false);
75
+ const [isClient, setIsClient] = React.useState(noSsr || !isMultiSchemes);
77
76
  React.useEffect(() => {
78
- if (isMultiSchemes) {
79
- setHasMounted(true); // to rerender the component after hydration
80
- }
81
- hasMounted.current = true;
82
- }, [isMultiSchemes]);
77
+ setIsClient(true); // to rerender the component after hydration
78
+ }, []);
83
79
  const colorScheme = getColorScheme(state);
84
80
  const setMode = React.useCallback(mode => {
85
81
  setState(currentState => {
@@ -243,9 +239,9 @@ export default function useCurrentColorScheme(options) {
243
239
  }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow, isMultiSchemes]);
244
240
  return {
245
241
  ...state,
246
- mode: hasMounted.current || !isMultiSchemes ? state.mode : undefined,
247
- systemMode: hasMounted.current || !isMultiSchemes ? state.systemMode : undefined,
248
- colorScheme: hasMounted.current || !isMultiSchemes ? colorScheme : undefined,
242
+ mode: isClient ? state.mode : undefined,
243
+ systemMode: isClient ? state.systemMode : undefined,
244
+ colorScheme: isClient ? colorScheme : undefined,
249
245
  setMode,
250
246
  setColorScheme
251
247
  };
@@ -1,6 +1,6 @@
1
- export const version = "6.1.8";
1
+ export const version = "6.1.9";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("8");
4
+ export const patch = Number("9");
5
5
  export const prerelease = undefined;
6
6
  export default version;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v6.1.8
2
+ * @mui/system v6.1.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -50,7 +50,8 @@ export default function createCssVarsProvider(options) {
50
50
  colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,
51
51
  disableNestedContext = false,
52
52
  disableStyleSheetGeneration = false,
53
- defaultMode: initialMode = 'system'
53
+ defaultMode: initialMode = 'system',
54
+ noSsr
54
55
  } = props;
55
56
  const hasMounted = React.useRef(false);
56
57
  const upperTheme = muiUseTheme();
@@ -91,7 +92,8 @@ export default function createCssVarsProvider(options) {
91
92
  modeStorageKey,
92
93
  colorSchemeStorageKey,
93
94
  defaultMode,
94
- storageWindow
95
+ storageWindow,
96
+ noSsr
95
97
  });
96
98
  let mode = stateMode;
97
99
  let colorScheme = stateColorScheme;
@@ -277,6 +279,11 @@ export default function createCssVarsProvider(options) {
277
279
  * The key in the local storage used to store current color scheme.
278
280
  */
279
281
  modeStorageKey: PropTypes.string,
282
+ /**
283
+ * If `true`, the mode will be the same value as the storage without an extra rerendering after the hydration.
284
+ * You should use this option in conjuction with `InitColorSchemeScript` component.
285
+ */
286
+ noSsr: PropTypes.bool,
280
287
  /**
281
288
  * The window that attaches the 'storage' event listener.
282
289
  * @default window
@@ -56,7 +56,8 @@ export default function useCurrentColorScheme(options) {
56
56
  supportedColorSchemes = [],
57
57
  modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
58
58
  colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
59
- storageWindow = typeof window === 'undefined' ? undefined : window
59
+ storageWindow = typeof window === 'undefined' ? undefined : window,
60
+ noSsr = false
60
61
  } = options;
61
62
  const joinedColorSchemes = supportedColorSchemes.join(',');
62
63
  const isMultiSchemes = supportedColorSchemes.length > 1;
@@ -71,15 +72,10 @@ export default function useCurrentColorScheme(options) {
71
72
  darkColorScheme
72
73
  };
73
74
  });
74
- // This could be improved with `React.useSyncExternalStore` in the future.
75
- const [, setHasMounted] = React.useState(false);
76
- const hasMounted = React.useRef(false);
75
+ const [isClient, setIsClient] = React.useState(noSsr || !isMultiSchemes);
77
76
  React.useEffect(() => {
78
- if (isMultiSchemes) {
79
- setHasMounted(true); // to rerender the component after hydration
80
- }
81
- hasMounted.current = true;
82
- }, [isMultiSchemes]);
77
+ setIsClient(true); // to rerender the component after hydration
78
+ }, []);
83
79
  const colorScheme = getColorScheme(state);
84
80
  const setMode = React.useCallback(mode => {
85
81
  setState(currentState => {
@@ -243,9 +239,9 @@ export default function useCurrentColorScheme(options) {
243
239
  }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow, isMultiSchemes]);
244
240
  return {
245
241
  ...state,
246
- mode: hasMounted.current || !isMultiSchemes ? state.mode : undefined,
247
- systemMode: hasMounted.current || !isMultiSchemes ? state.systemMode : undefined,
248
- colorScheme: hasMounted.current || !isMultiSchemes ? colorScheme : undefined,
242
+ mode: isClient ? state.mode : undefined,
243
+ systemMode: isClient ? state.systemMode : undefined,
244
+ colorScheme: isClient ? colorScheme : undefined,
249
245
  setMode,
250
246
  setColorScheme
251
247
  };
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v6.1.8
2
+ * @mui/system v6.1.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,6 +1,6 @@
1
- export const version = "6.1.8";
1
+ export const version = "6.1.9";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("8");
4
+ export const patch = Number("9");
5
5
  export const prerelease = undefined;
6
6
  export default version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/system",
3
- "version": "6.1.8",
3
+ "version": "6.1.9",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.",
@@ -30,10 +30,10 @@
30
30
  "clsx": "^2.1.1",
31
31
  "csstype": "^3.1.3",
32
32
  "prop-types": "^15.8.1",
33
- "@mui/private-theming": "^6.1.8",
33
+ "@mui/private-theming": "^6.1.9",
34
34
  "@mui/types": "^7.2.19",
35
- "@mui/utils": "^6.1.8",
36
- "@mui/styled-engine": "^6.1.8"
35
+ "@mui/styled-engine": "^6.1.9",
36
+ "@mui/utils": "^6.1.9"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@emotion/react": "^11.5.0",
package/version/index.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
7
- const version = exports.version = "6.1.8";
7
+ const version = exports.version = "6.1.9";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("1");
10
- const patch = exports.patch = Number("8");
10
+ const patch = exports.patch = Number("9");
11
11
  const prerelease = exports.prerelease = undefined;
12
12
  var _default = exports.default = version;