@mui/system 9.1.1 → 9.2.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.
Files changed (116) hide show
  1. package/Box/Box.d.mts +15 -19
  2. package/Box/Box.d.ts +15 -19
  3. package/Box/Box.js +16 -1
  4. package/Box/Box.mjs +17 -1
  5. package/Box/index.js +12 -2
  6. package/Box/index.mjs +1 -0
  7. package/CHANGELOG.md +74 -0
  8. package/Container/index.d.mts +1 -1
  9. package/Container/index.d.ts +1 -1
  10. package/Grid/Grid.js +0 -1
  11. package/Grid/Grid.mjs +0 -1
  12. package/Grid/GridProps.d.mts +0 -1
  13. package/Grid/GridProps.d.ts +0 -1
  14. package/InitColorSchemeScript/InitColorSchemeScript.d.mts +2 -1
  15. package/InitColorSchemeScript/InitColorSchemeScript.d.ts +2 -1
  16. package/InitColorSchemeScript/InitColorSchemeScript.js +34 -1
  17. package/InitColorSchemeScript/InitColorSchemeScript.mjs +33 -1
  18. package/Stack/Stack.js +1 -1
  19. package/Stack/Stack.mjs +1 -1
  20. package/Stack/StackProps.d.mts +1 -1
  21. package/Stack/StackProps.d.ts +1 -1
  22. package/ThemeProvider/ThemeProvider.d.mts +9 -6
  23. package/ThemeProvider/ThemeProvider.d.ts +9 -6
  24. package/ThemeProvider/ThemeProvider.js +3 -2
  25. package/ThemeProvider/ThemeProvider.mjs +3 -2
  26. package/ThemeProvider/index.d.mts +1 -1
  27. package/ThemeProvider/index.d.ts +1 -1
  28. package/borders/borders.d.mts +14 -12
  29. package/borders/borders.d.ts +14 -12
  30. package/borders/borders.js +2 -4
  31. package/borders/borders.mjs +3 -4
  32. package/breakpoints/breakpoints.d.mts +13 -16
  33. package/breakpoints/breakpoints.d.ts +13 -16
  34. package/breakpoints/breakpoints.js +17 -16
  35. package/breakpoints/breakpoints.mjs +17 -16
  36. package/compose/compose.d.mts +3 -10
  37. package/compose/compose.d.ts +3 -10
  38. package/compose/compose.js +0 -2
  39. package/compose/compose.mjs +0 -2
  40. package/createBox/createBox.d.mts +4 -4
  41. package/createBox/createBox.d.ts +4 -4
  42. package/createBreakpoints/createBreakpoints.d.mts +3 -54
  43. package/createBreakpoints/createBreakpoints.d.ts +3 -54
  44. package/createBreakpoints/createBreakpoints.js +6 -8
  45. package/createBreakpoints/createBreakpoints.mjs +6 -8
  46. package/createBreakpoints/index.d.mts +0 -1
  47. package/createBreakpoints/index.d.ts +0 -1
  48. package/createTheme/shape.d.mts +2 -2
  49. package/createTheme/shape.d.ts +2 -2
  50. package/cssGrid/cssGrid.d.mts +13 -13
  51. package/cssGrid/cssGrid.d.ts +13 -13
  52. package/cssGrid/cssGrid.js +0 -8
  53. package/cssGrid/cssGrid.mjs +0 -9
  54. package/cssVars/createCssVarsProvider.js +2 -2
  55. package/cssVars/createCssVarsProvider.mjs +2 -2
  56. package/cssVars/useCurrentColorScheme.js +1 -0
  57. package/cssVars/useCurrentColorScheme.mjs +1 -0
  58. package/display/display.d.mts +49 -1
  59. package/display/display.d.ts +49 -1
  60. package/display/display.js +2 -1
  61. package/display/display.mjs +2 -1
  62. package/flexbox/flexbox.d.mts +14 -14
  63. package/flexbox/flexbox.d.ts +14 -14
  64. package/getThemeValue/getThemeValue.d.mts +2 -1
  65. package/getThemeValue/getThemeValue.d.ts +2 -1
  66. package/getThemeValue/getThemeValue.js +6 -2
  67. package/getThemeValue/getThemeValue.mjs +7 -3
  68. package/index.js +1 -1
  69. package/index.mjs +1 -1
  70. package/memoize/memoize.d.mts +1 -1
  71. package/memoize/memoize.d.ts +1 -1
  72. package/package.json +59 -59
  73. package/palette/palette.d.mts +4 -3
  74. package/palette/palette.d.ts +4 -3
  75. package/palette/palette.js +1 -0
  76. package/palette/palette.mjs +2 -0
  77. package/positions/positions.d.mts +49 -1
  78. package/positions/positions.d.ts +49 -1
  79. package/positions/positions.js +2 -1
  80. package/positions/positions.mjs +2 -1
  81. package/propsToClassKey/propsToClassKey.d.mts +5 -0
  82. package/propsToClassKey/propsToClassKey.d.ts +5 -0
  83. package/propsToClassKey/propsToClassKey.js +1 -1
  84. package/propsToClassKey/propsToClassKey.mjs +1 -1
  85. package/shadows/shadows.d.mts +4 -4
  86. package/shadows/shadows.d.ts +4 -4
  87. package/sizing/sizing.d.mts +10 -10
  88. package/sizing/sizing.d.ts +10 -10
  89. package/sizing/sizing.js +7 -2
  90. package/sizing/sizing.mjs +5 -1
  91. package/spacing/spacing.d.mts +10 -14
  92. package/spacing/spacing.d.ts +10 -14
  93. package/spacing/spacing.js +17 -13
  94. package/spacing/spacing.mjs +16 -9
  95. package/styleFunctionSx/defaultSxConfig.d.mts +1 -1
  96. package/styleFunctionSx/defaultSxConfig.d.ts +1 -1
  97. package/styleFunctionSx/extendSxProp.d.mts +4 -2
  98. package/styleFunctionSx/extendSxProp.d.ts +4 -2
  99. package/styled/styled.d.mts +1 -1
  100. package/styled/styled.d.ts +1 -1
  101. package/typography/typography.d.mts +10 -10
  102. package/typography/typography.d.ts +10 -10
  103. package/useTheme/useTheme.d.mts +4 -2
  104. package/useTheme/useTheme.d.ts +4 -2
  105. package/useThemeProps/getThemeProps.d.mts +2 -2
  106. package/useThemeProps/getThemeProps.d.ts +2 -2
  107. package/useThemeProps/index.d.mts +1 -1
  108. package/useThemeProps/index.d.ts +1 -1
  109. package/useThemeProps/useThemeProps.js +7 -6
  110. package/useThemeProps/useThemeProps.mjs +7 -6
  111. package/useThemeWithoutDefault/useThemeWithoutDefault.d.mts +2 -1
  112. package/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +2 -1
  113. package/useThemeWithoutDefault/useThemeWithoutDefault.js +2 -2
  114. package/useThemeWithoutDefault/useThemeWithoutDefault.mjs +2 -2
  115. package/version/index.js +3 -3
  116. package/version/index.mjs +3 -3
package/Box/Box.d.mts CHANGED
@@ -1,24 +1,21 @@
1
1
  import * as React from 'react';
2
- import { OverridableComponent, OverrideProps } from '@mui/types';
3
- import { Theme as SystemTheme } from "../createTheme/index.mjs";
4
- import { SxProps, AllSystemCSSProperties, ResponsiveStyleValue, OverwriteCSSProperties, AliasesCSSProperties } from "../styleFunctionSx/index.mjs";
5
- import { PropsFor } from "../style/index.mjs";
6
- import { ComposedStyleFunction } from "../compose/index.mjs";
7
- import borders from "../borders/index.mjs";
8
- import display from "../display/index.mjs";
9
- import flexbox from "../flexbox/index.mjs";
10
- import grid from "../cssGrid/index.mjs";
11
- import palette from "../palette/index.mjs";
12
- import positions from "../positions/index.mjs";
13
- import shadows from "../shadows/index.mjs";
14
- import sizing from "../sizing/index.mjs";
15
- import spacing from "../spacing/index.mjs";
16
- import typography from "../typography/index.mjs";
2
+ import type { OverridableComponent, OverrideProps } from '@mui/types';
3
+ import type { SxProps, AllSystemCSSProperties, ResponsiveStyleValue, OverwriteCSSProperties, AliasesCSSProperties } from "../styleFunctionSx/index.mjs";
4
+ import type { PropsFor } from "../style/index.mjs";
5
+ import type { ComposedStyleFunction } from "../compose/index.mjs";
6
+ import type { Theme as SystemTheme } from "../createTheme/index.mjs";
7
+ import type borders from "../borders/index.mjs";
8
+ import type display from "../display/index.mjs";
9
+ import type flexbox from "../flexbox/index.mjs";
10
+ import type grid from "../cssGrid/index.mjs";
11
+ import type palette from "../palette/index.mjs";
12
+ import type positions from "../positions/index.mjs";
13
+ import type shadows from "../shadows/index.mjs";
14
+ import type sizing from "../sizing/index.mjs";
15
+ import type spacing from "../spacing/index.mjs";
16
+ import type typography from "../typography/index.mjs";
17
17
  export interface CustomSystemProps extends AliasesCSSProperties, OverwriteCSSProperties {}
18
18
  export type SimpleSystemKeys = keyof PropsFor<ComposedStyleFunction<[typeof borders, typeof display, typeof flexbox, typeof grid, typeof palette, typeof positions, typeof shadows, typeof sizing, typeof spacing, typeof typography]>>;
19
-
20
- // The SimpleSystemKeys are subset of the AllSystemCSSProperties, so this should be ok
21
- // This is needed as these are used as keys inside AllSystemCSSProperties
22
19
  type StandardSystemKeys = Extract<SimpleSystemKeys, keyof AllSystemCSSProperties>;
23
20
  export type SystemProps<Theme extends object = {}> = { [K in StandardSystemKeys]?: ResponsiveStyleValue<AllSystemCSSProperties[K]> | ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>) };
24
21
  export interface BoxOwnProps<Theme extends object = SystemTheme> {
@@ -33,7 +30,6 @@ export interface BoxTypeMap<AdditionalProps = {}, RootComponent extends React.El
33
30
  props: AdditionalProps & BoxOwnProps<Theme>;
34
31
  defaultComponent: RootComponent;
35
32
  }
36
-
37
33
  /**
38
34
  *
39
35
  * Demos:
package/Box/Box.d.ts CHANGED
@@ -1,24 +1,21 @@
1
1
  import * as React from 'react';
2
- import { OverridableComponent, OverrideProps } from '@mui/types';
3
- import { Theme as SystemTheme } from "../createTheme/index.js";
4
- import { SxProps, AllSystemCSSProperties, ResponsiveStyleValue, OverwriteCSSProperties, AliasesCSSProperties } from "../styleFunctionSx/index.js";
5
- import { PropsFor } from "../style/index.js";
6
- import { ComposedStyleFunction } from "../compose/index.js";
7
- import borders from "../borders/index.js";
8
- import display from "../display/index.js";
9
- import flexbox from "../flexbox/index.js";
10
- import grid from "../cssGrid/index.js";
11
- import palette from "../palette/index.js";
12
- import positions from "../positions/index.js";
13
- import shadows from "../shadows/index.js";
14
- import sizing from "../sizing/index.js";
15
- import spacing from "../spacing/index.js";
16
- import typography from "../typography/index.js";
2
+ import type { OverridableComponent, OverrideProps } from '@mui/types';
3
+ import type { SxProps, AllSystemCSSProperties, ResponsiveStyleValue, OverwriteCSSProperties, AliasesCSSProperties } from "../styleFunctionSx/index.js";
4
+ import type { PropsFor } from "../style/index.js";
5
+ import type { ComposedStyleFunction } from "../compose/index.js";
6
+ import type { Theme as SystemTheme } from "../createTheme/index.js";
7
+ import type borders from "../borders/index.js";
8
+ import type display from "../display/index.js";
9
+ import type flexbox from "../flexbox/index.js";
10
+ import type grid from "../cssGrid/index.js";
11
+ import type palette from "../palette/index.js";
12
+ import type positions from "../positions/index.js";
13
+ import type shadows from "../shadows/index.js";
14
+ import type sizing from "../sizing/index.js";
15
+ import type spacing from "../spacing/index.js";
16
+ import type typography from "../typography/index.js";
17
17
  export interface CustomSystemProps extends AliasesCSSProperties, OverwriteCSSProperties {}
18
18
  export type SimpleSystemKeys = keyof PropsFor<ComposedStyleFunction<[typeof borders, typeof display, typeof flexbox, typeof grid, typeof palette, typeof positions, typeof shadows, typeof sizing, typeof spacing, typeof typography]>>;
19
-
20
- // The SimpleSystemKeys are subset of the AllSystemCSSProperties, so this should be ok
21
- // This is needed as these are used as keys inside AllSystemCSSProperties
22
19
  type StandardSystemKeys = Extract<SimpleSystemKeys, keyof AllSystemCSSProperties>;
23
20
  export type SystemProps<Theme extends object = {}> = { [K in StandardSystemKeys]?: ResponsiveStyleValue<AllSystemCSSProperties[K]> | ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>) };
24
21
  export interface BoxOwnProps<Theme extends object = SystemTheme> {
@@ -33,7 +30,6 @@ export interface BoxTypeMap<AdditionalProps = {}, RootComponent extends React.El
33
30
  props: AdditionalProps & BoxOwnProps<Theme>;
34
31
  defaultComponent: RootComponent;
35
32
  }
36
-
37
33
  /**
38
34
  *
39
35
  * Demos:
package/Box/Box.js CHANGED
@@ -10,6 +10,21 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _ClassNameGenerator = _interopRequireDefault(require("@mui/utils/ClassNameGenerator"));
11
11
  var _createBox = _interopRequireDefault(require("../createBox"));
12
12
  var _boxClasses = _interopRequireDefault(require("./boxClasses"));
13
+ // The SimpleSystemKeys are subset of the AllSystemCSSProperties, so this should be ok
14
+ // This is needed as these are used as keys inside AllSystemCSSProperties
15
+
16
+ /**
17
+ *
18
+ * Demos:
19
+ *
20
+ * - [Box (Material UI)](https://mui.com/material-ui/react-box/)
21
+ * - [Menubar (Material UI)](https://mui.com/material-ui/react-menubar/)
22
+ * - [Box (MUI System)](https://mui.com/system/react-box/)
23
+ *
24
+ * API:
25
+ *
26
+ * - [Box API](https://mui.com/system/api/box/)
27
+ */
13
28
  const Box = (0, _createBox.default)({
14
29
  defaultClassName: _boxClasses.default.root,
15
30
  generateClassName: _ClassNameGenerator.default.generate
@@ -17,7 +32,7 @@ const Box = (0, _createBox.default)({
17
32
  process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
18
33
  // ┌────────────────────────────── Warning ──────────────────────────────┐
19
34
  // │ These PropTypes are generated from the TypeScript type definitions. │
20
- // │ To update them, edit the d.ts file and run `pnpm proptypes`.
35
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`.
21
36
  // └─────────────────────────────────────────────────────────────────────┘
22
37
  /**
23
38
  * @ignore
package/Box/Box.mjs CHANGED
@@ -4,6 +4,22 @@ import PropTypes from 'prop-types';
4
4
  import ClassNameGenerator from '@mui/utils/ClassNameGenerator';
5
5
  import createBox from "../createBox/index.mjs";
6
6
  import boxClasses from "./boxClasses.mjs";
7
+
8
+ // The SimpleSystemKeys are subset of the AllSystemCSSProperties, so this should be ok
9
+ // This is needed as these are used as keys inside AllSystemCSSProperties
10
+
11
+ /**
12
+ *
13
+ * Demos:
14
+ *
15
+ * - [Box (Material UI)](https://mui.com/material-ui/react-box/)
16
+ * - [Menubar (Material UI)](https://mui.com/material-ui/react-menubar/)
17
+ * - [Box (MUI System)](https://mui.com/system/react-box/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [Box API](https://mui.com/system/api/box/)
22
+ */
7
23
  const Box = createBox({
8
24
  defaultClassName: boxClasses.root,
9
25
  generateClassName: ClassNameGenerator.generate
@@ -11,7 +27,7 @@ const Box = createBox({
11
27
  process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
12
28
  // ┌────────────────────────────── Warning ──────────────────────────────┐
13
29
  // │ These PropTypes are generated from the TypeScript type definitions. │
14
- // │ To update them, edit the d.ts file and run `pnpm proptypes`.
30
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`.
15
31
  // └─────────────────────────────────────────────────────────────────────┘
16
32
  /**
17
33
  * @ignore
package/Box/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -20,7 +19,18 @@ Object.defineProperty(exports, "default", {
20
19
  return _Box.default;
21
20
  }
22
21
  });
23
- var _Box = _interopRequireDefault(require("./Box"));
22
+ var _Box = _interopRequireWildcard(require("./Box"));
23
+ Object.keys(_Box).forEach(function (key) {
24
+ if (key === "default" || key === "__esModule") return;
25
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
+ if (key in exports && exports[key] === _Box[key]) return;
27
+ Object.defineProperty(exports, key, {
28
+ enumerable: true,
29
+ get: function () {
30
+ return _Box[key];
31
+ }
32
+ });
33
+ });
24
34
  var _boxClasses = _interopRequireWildcard(require("./boxClasses"));
25
35
  Object.keys(_boxClasses).forEach(function (key) {
26
36
  if (key === "default" || key === "__esModule") return;
package/Box/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default } from "./Box.mjs";
2
+ export * from "./Box.mjs";
2
3
  export { default as boxClasses } from "./boxClasses.mjs";
3
4
  export * from "./boxClasses.mjs";
package/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # [Versions](https://mui.com/material-ui/getting-started/versions/)
2
2
 
3
+ ## 9.2.0
4
+
5
+ <!-- generated comparing v9.1.2..master -->
6
+
7
+ _Jul 2, 2026_
8
+
9
+ A big thanks to the 9 contributors who made this release possible.
10
+
11
+ - ⚙️ Add support for [`data-*` attributes on `slotProps`](https://mui.com/material-ui/guides/typescript/#allowing-data-attributes-on-slotprops).
12
+
13
+ ### `@mui/material@9.1.3`
14
+
15
+ - [l10n] Add missing MuiPagination localization to zh-CN locale (#48741) @greymoth-jp
16
+ - [select] Guard display ref during mouse down (#48744) @michelengelen
17
+
18
+ ### `@mui/utils@9.1.3`
19
+
20
+ - [utils] Add opt-in `DataAttributesOverrides` augmentation for slot props (#48554) @LukasTy
21
+
22
+ ### Docs
23
+
24
+ - [docs] Improve Icon Dialog responsiveness on small screens (#48639) @Prakash1185
25
+ - [docs] Fix invalid UTF-8 in skill references (#48739) @mturac
26
+
27
+ ### Core
28
+
29
+ - [code-infra] Resolve Renovate dashboard warnings (#48700) @Sushantplive
30
+ - [code-infra] Validate npm publishing through dry run (#48691) @brijeshb42
31
+ - [code-infra] Run prettier after renovate update (#48754) @Janpot
32
+ - [code-infra] Fix 'A11y results committed?' check on react-pinned nightly jobs (#48740) @Janpot
33
+ - [core] Remove leftover Joy UI references (#48719) @siriwatknp
34
+ - [code-infra] Bump react-router to 7.15.1 (#48725) @Janpot
35
+ - [docs-infra] Drive docs analytics IDs via ANALYTICS_ENV (#48694) @Janpot
36
+ - [docs-infra] Pre-render API page descriptions (#48693) @brijeshb42
37
+ - [code-infra][icons-material] Build lib/package.json with code-infra --no-expand (#48689) @Janpot
38
+ - [code-infra] Fix react@18/next nightly workflow (#48635) @Janpot
39
+
40
+ All contributors of this release in alphabetical order: @brijeshb42, @greymoth-jp, @Janpot, @LukasTy, @michelengelen, @mturac, @Prakash1185, @siriwatknp, @Sushantplive
41
+
42
+ ## 9.1.2
43
+
44
+ <!-- generated comparing v9.1.1..master -->
45
+
46
+ _Jun 23, 2026_
47
+
48
+ A big thanks to the 5 contributors who made this release possible.
49
+
50
+ ### `@mui/material@9.1.2`
51
+
52
+ - [autocomplete] Don't submit forms when committing `freeSolo` value with Enter key (#48679) @mj12albert
53
+ - [transitions] Fix RTG import in ESM (#48645) @mj12albert
54
+
55
+ ### `@mui/system@9.1.2`
56
+
57
+ - [InitColorSchemeScript] Fix script tag warning in Next.js 16 dev mode (#48671) @siriwatknp
58
+
59
+ ### Docs
60
+
61
+ - Fix typos in release instructions (#48687) @brijeshb42
62
+ - Update @mui/x-\* packages to latest (#48661) @Janpot
63
+
64
+ ### Core
65
+
66
+ - [code-infra] Convert leaf @mui/system .js+.d.ts pairs to TypeScript (part 1) (#48578) @Janpot
67
+ - [code-infra] Bump to latest code-infra packages (#48672) @brijeshb42
68
+ - [code-infra] Resolve remaining minimatch advisory (#48662) @Janpot
69
+ - [code-infra] Bump nx to resolve minimatch advisory (#48658) @Janpot
70
+ - [core] Drop @babel/\* pnpm overrides (#48710) @Janpot
71
+ - [docs-infra] Revert "Pin StackBlitz demo vite to v7 and plugin-react to v5" (#48709) @Janpot
72
+ - [docs-infra] Fix code-block copy button broken on direct page load (#48653) @brijeshb42
73
+ - [test] Stabilize Data Grid demo data in Argos screenshots (#48654) @LukasTy
74
+
75
+ All contributors of this release in alphabetical order: @brijeshb42, @Janpot, @LukasTy, @mj12albert, @siriwatknp
76
+
3
77
  ## 9.1.1
4
78
 
5
79
  <!-- generated comparing v9.1.0..master -->
@@ -1,4 +1,4 @@
1
1
  export { default } from "./Container.mjs";
2
- export * from "./ContainerProps.mjs";
2
+ export type * from "./ContainerProps.mjs";
3
3
  export { default as containerClasses } from "./containerClasses.mjs";
4
4
  export * from "./containerClasses.mjs";
@@ -1,4 +1,4 @@
1
1
  export { default } from "./Container.js";
2
- export * from "./ContainerProps.js";
2
+ export type * from "./ContainerProps.js";
3
3
  export { default as containerClasses } from "./containerClasses.js";
4
4
  export * from "./containerClasses.js";
package/Grid/Grid.js CHANGED
@@ -79,7 +79,6 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
79
79
  */
80
80
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
81
81
  /**
82
- * @internal
83
82
  * The level of the grid starts from `0` and increases when the grid nests
84
83
  * inside another grid. Nesting is defined as a container Grid being a direct
85
84
  * child of a container Grid.
package/Grid/Grid.mjs CHANGED
@@ -73,7 +73,6 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
73
73
  */
74
74
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
75
75
  /**
76
- * @internal
77
76
  * The level of the grid starts from `0` and increases when the grid nests
78
77
  * inside another grid. Nesting is defined as a container Grid being a direct
79
78
  * child of a container Grid.
@@ -45,7 +45,6 @@ export interface GridBaseProps {
45
45
  */
46
46
  offset?: ResponsiveStyleValue<GridOffset> | undefined;
47
47
  /**
48
- * @internal
49
48
  * The level of the grid starts from `0` and increases when the grid nests
50
49
  * inside another grid. Nesting is defined as a container Grid being a direct
51
50
  * child of a container Grid.
@@ -45,7 +45,6 @@ export interface GridBaseProps {
45
45
  */
46
46
  offset?: ResponsiveStyleValue<GridOffset> | undefined;
47
47
  /**
48
- * @internal
49
48
  * The level of the grid starts from `0` and increases when the grid nests
50
49
  * inside another grid. Nesting is defined as a container Grid being a direct
51
50
  * child of a container Grid.
@@ -44,4 +44,5 @@ export interface InitColorSchemeScriptProps {
44
44
  */
45
45
  nonce?: string | undefined;
46
46
  }
47
- export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare function buildInitColorSchemeScript(options?: InitColorSchemeScriptProps): import("react/jsx-runtime").JSX.Element;
48
+ export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): import("react/jsx-runtime").JSX.Element | null;
@@ -44,4 +44,5 @@ export interface InitColorSchemeScriptProps {
44
44
  */
45
45
  nonce?: string | undefined;
46
46
  }
47
- export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): import("react/jsx-runtime").JSX.Element;
47
+ export declare function buildInitColorSchemeScript(options?: InitColorSchemeScriptProps): import("react/jsx-runtime").JSX.Element;
48
+ export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,15 +1,41 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_ATTRIBUTE = void 0;
9
+ exports.buildInitColorSchemeScript = buildInitColorSchemeScript;
7
10
  exports.default = InitColorSchemeScript;
11
+ var React = _interopRequireWildcard(require("react"));
8
12
  var _jsxRuntime = require("react/jsx-runtime");
9
13
  const DEFAULT_MODE_STORAGE_KEY = exports.DEFAULT_MODE_STORAGE_KEY = 'mode';
10
14
  const DEFAULT_COLOR_SCHEME_STORAGE_KEY = exports.DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
11
15
  const DEFAULT_ATTRIBUTE = exports.DEFAULT_ATTRIBUTE = 'data-color-scheme';
12
- function InitColorSchemeScript(options) {
16
+ // React 17 has no `useSyncExternalStore`; spread into a plain object so reading the
17
+ // missing property returns `undefined` instead of throwing under strict ESM. See #41190 (comment).
18
+ const safeReact = {
19
+ ...React
20
+ };
21
+ const maybeReactUseSyncExternalStore = safeReact.useSyncExternalStore;
22
+ const subscribe = () => () => {};
23
+
24
+ /**
25
+ * `true` during the server render and the matching hydration render, `false`
26
+ * on every client render afterwards. React warns when a `<script>` is
27
+ * created during a client render (such scripts never execute), so the inline
28
+ * script is only emitted on the server pass and dropped after hydration — the
29
+ * attribute it already set on the document persists. React <18 has no
30
+ * `useSyncExternalStore` and no such warning, so the script is always emitted.
31
+ */
32
+ function useIsServerRender() {
33
+ if (maybeReactUseSyncExternalStore === undefined) {
34
+ return true;
35
+ }
36
+ return maybeReactUseSyncExternalStore(subscribe, () => false, () => true);
37
+ }
38
+ function buildInitColorSchemeScript(options) {
13
39
  const {
14
40
  defaultMode = 'system',
15
41
  defaultLightColorScheme = 'light',
@@ -78,4 +104,11 @@ try {
78
104
  } catch(e){}})();`
79
105
  }
80
106
  }, "mui-color-scheme-init");
107
+ }
108
+ function InitColorSchemeScript(options) {
109
+ const isServerRender = useIsServerRender();
110
+ if (!isServerRender) {
111
+ return null;
112
+ }
113
+ return buildInitColorSchemeScript(options);
81
114
  }
@@ -1,8 +1,33 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
1
4
  import { jsx as _jsx } from "react/jsx-runtime";
2
5
  export const DEFAULT_MODE_STORAGE_KEY = 'mode';
3
6
  export const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
4
7
  export const DEFAULT_ATTRIBUTE = 'data-color-scheme';
5
- export default function InitColorSchemeScript(options) {
8
+ // React 17 has no `useSyncExternalStore`; spread into a plain object so reading the
9
+ // missing property returns `undefined` instead of throwing under strict ESM. See #41190 (comment).
10
+ const safeReact = {
11
+ ...React
12
+ };
13
+ const maybeReactUseSyncExternalStore = safeReact.useSyncExternalStore;
14
+ const subscribe = () => () => {};
15
+
16
+ /**
17
+ * `true` during the server render and the matching hydration render, `false`
18
+ * on every client render afterwards. React warns when a `<script>` is
19
+ * created during a client render (such scripts never execute), so the inline
20
+ * script is only emitted on the server pass and dropped after hydration — the
21
+ * attribute it already set on the document persists. React <18 has no
22
+ * `useSyncExternalStore` and no such warning, so the script is always emitted.
23
+ */
24
+ function useIsServerRender() {
25
+ if (maybeReactUseSyncExternalStore === undefined) {
26
+ return true;
27
+ }
28
+ return maybeReactUseSyncExternalStore(subscribe, () => false, () => true);
29
+ }
30
+ export function buildInitColorSchemeScript(options) {
6
31
  const {
7
32
  defaultMode = 'system',
8
33
  defaultLightColorScheme = 'light',
@@ -71,4 +96,11 @@ try {
71
96
  } catch(e){}})();`
72
97
  }
73
98
  }, "mui-color-scheme-init");
99
+ }
100
+ export default function InitColorSchemeScript(options) {
101
+ const isServerRender = useIsServerRender();
102
+ if (!isServerRender) {
103
+ return null;
104
+ }
105
+ return buildInitColorSchemeScript(options);
74
106
  }
package/Stack/Stack.js CHANGED
@@ -56,7 +56,7 @@ process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ =
56
56
  /**
57
57
  * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
58
58
  *
59
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
59
+ * While CSS `gap` removes the known limitations,
60
60
  * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
61
61
  *
62
62
  * To enable this flag globally, follow the theme's default props configuration.
package/Stack/Stack.mjs CHANGED
@@ -50,7 +50,7 @@ process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ =
50
50
  /**
51
51
  * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
52
52
  *
53
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
53
+ * While CSS `gap` removes the known limitations,
54
54
  * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
55
55
  *
56
56
  * To enable this flag globally, follow the theme's default props configuration.
@@ -25,7 +25,7 @@ export interface StackBaseProps {
25
25
  /**
26
26
  * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
27
27
  *
28
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
28
+ * While CSS `gap` removes the known limitations,
29
29
  * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
30
30
  *
31
31
  * To enable this flag globally, follow the theme's default props configuration.
@@ -25,7 +25,7 @@ export interface StackBaseProps {
25
25
  /**
26
26
  * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
27
27
  *
28
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
28
+ * While CSS `gap` removes the known limitations,
29
29
  * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
30
30
  *
31
31
  * To enable this flag globally, follow the theme's default props configuration.
@@ -1,4 +1,5 @@
1
- import { DefaultTheme } from '@mui/private-theming';
1
+ import * as React from 'react';
2
+ import { type DefaultTheme } from '@mui/private-theming';
2
3
  export interface ThemeProviderProps<Theme = DefaultTheme> {
3
4
  /**
4
5
  * Your component tree.
@@ -13,13 +14,15 @@ export interface ThemeProviderProps<Theme = DefaultTheme> {
13
14
  */
14
15
  theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
15
16
  }
16
-
17
- // #host-reference
18
17
  /**
19
18
  * This component makes the `theme` available down the React tree.
20
19
  * It should preferably be used at **the root of your component tree**.
21
- * API:
22
20
  *
23
- * - [ThemeProvider API](https://mui.com/material-ui/customization/theming/#themeprovider)
21
+ * <ThemeProvider theme={theme}> // existing use case
22
+ * <ThemeProvider theme={{ id: theme }}> // theme scoping
24
23
  */
25
- export default function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
24
+ declare function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
25
+ declare namespace ThemeProvider {
26
+ var propTypes: any;
27
+ }
28
+ export default ThemeProvider;
@@ -1,4 +1,5 @@
1
- import { DefaultTheme } from '@mui/private-theming';
1
+ import * as React from 'react';
2
+ import { type DefaultTheme } from '@mui/private-theming';
2
3
  export interface ThemeProviderProps<Theme = DefaultTheme> {
3
4
  /**
4
5
  * Your component tree.
@@ -13,13 +14,15 @@ export interface ThemeProviderProps<Theme = DefaultTheme> {
13
14
  */
14
15
  theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
15
16
  }
16
-
17
- // #host-reference
18
17
  /**
19
18
  * This component makes the `theme` available down the React tree.
20
19
  * It should preferably be used at **the root of your component tree**.
21
- * API:
22
20
  *
23
- * - [ThemeProvider API](https://mui.com/material-ui/customization/theming/#themeprovider)
21
+ * <ThemeProvider theme={theme}> // existing use case
22
+ * <ThemeProvider theme={{ id: theme }}> // theme scoping
24
23
  */
25
- export default function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
24
+ declare function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
25
+ declare namespace ThemeProvider {
26
+ var propTypes: any;
27
+ }
28
+ export default ThemeProvider;
@@ -85,7 +85,7 @@ function ThemeProvider(props) {
85
85
  process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-proptypes */ = {
86
86
  // ┌────────────────────────────── Warning ──────────────────────────────┐
87
87
  // │ These PropTypes are generated from the TypeScript type definitions. │
88
- // │ To update them, edit the d.ts file and run `pnpm proptypes`.
88
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`.
89
89
  // └─────────────────────────────────────────────────────────────────────┘
90
90
  /**
91
91
  * Your component tree.
@@ -101,6 +101,7 @@ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-propty
101
101
  themeId: _propTypes.default.string
102
102
  } : void 0;
103
103
  if (process.env.NODE_ENV !== 'production') {
104
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = (0, _exactProp.default)(ThemeProvider.propTypes) : void 0;
104
+ // eslint-disable-next-line
105
+ ThemeProvider['propTypes' + ''] = (0, _exactProp.default)(ThemeProvider.propTypes);
105
106
  }
106
107
  var _default = exports.default = ThemeProvider;
@@ -78,7 +78,7 @@ function ThemeProvider(props) {
78
78
  process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-proptypes */ = {
79
79
  // ┌────────────────────────────── Warning ──────────────────────────────┐
80
80
  // │ These PropTypes are generated from the TypeScript type definitions. │
81
- // │ To update them, edit the d.ts file and run `pnpm proptypes`.
81
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`.
82
82
  // └─────────────────────────────────────────────────────────────────────┘
83
83
  /**
84
84
  * Your component tree.
@@ -94,6 +94,7 @@ process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes /* remove-propty
94
94
  themeId: PropTypes.string
95
95
  } : void 0;
96
96
  if (process.env.NODE_ENV !== 'production') {
97
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;
97
+ // eslint-disable-next-line
98
+ ThemeProvider['propTypes' + ''] = exactProp(ThemeProvider.propTypes);
98
99
  }
99
100
  export default ThemeProvider;
@@ -1,2 +1,2 @@
1
1
  export { default } from "./ThemeProvider.mjs";
2
- export * from "./ThemeProvider.mjs";
2
+ export type * from "./ThemeProvider.mjs";
@@ -1,2 +1,2 @@
1
1
  export { default } from "./ThemeProvider.js";
2
- export * from "./ThemeProvider.js";
2
+ export type * from "./ThemeProvider.js";
@@ -1,15 +1,17 @@
1
- import { PropsFor, SimpleStyleFunction } from "../style/index.mjs";
2
- export const border: SimpleStyleFunction<'border'>;
3
- export const borderTop: SimpleStyleFunction<'borderTop'>;
4
- export const borderRight: SimpleStyleFunction<'borderRight'>;
5
- export const borderBottom: SimpleStyleFunction<'borderBottom'>;
6
- export const borderLeft: SimpleStyleFunction<'borderLeft'>;
7
- export const borderColor: SimpleStyleFunction<'borderColor'>;
8
- export const borderTopColor: SimpleStyleFunction<'borderTopColor'>;
9
- export const borderRightColor: SimpleStyleFunction<'borderRightColor'>;
10
- export const borderBottomColor: SimpleStyleFunction<'borderBottomColor'>;
11
- export const borderLeftColor: SimpleStyleFunction<'borderLeftColor'>;
12
- export const borderRadius: SimpleStyleFunction<'borderRadius'>;
1
+ import type { PropsFor, SimpleStyleFunction } from "../style/index.mjs";
2
+ export declare const border: SimpleStyleFunction<"border">;
3
+ export declare const borderTop: SimpleStyleFunction<"borderTop">;
4
+ export declare const borderRight: SimpleStyleFunction<"borderRight">;
5
+ export declare const borderBottom: SimpleStyleFunction<"borderBottom">;
6
+ export declare const borderLeft: SimpleStyleFunction<"borderLeft">;
7
+ export declare const borderColor: SimpleStyleFunction<"borderColor">;
8
+ export declare const borderTopColor: SimpleStyleFunction<"borderTopColor">;
9
+ export declare const borderRightColor: SimpleStyleFunction<"borderRightColor">;
10
+ export declare const borderBottomColor: SimpleStyleFunction<"borderBottomColor">;
11
+ export declare const borderLeftColor: SimpleStyleFunction<"borderLeftColor">;
12
+ export declare const outline: SimpleStyleFunction<"outline">;
13
+ export declare const outlineColor: SimpleStyleFunction<"outlineColor">;
14
+ export declare const borderRadius: SimpleStyleFunction<'borderRadius'>;
13
15
  declare const borders: SimpleStyleFunction<'border' | 'borderTop' | 'borderRight' | 'borderBottom' | 'borderLeft' | 'borderColor' | 'borderRadius'>;
14
16
  export type BordersProps = PropsFor<typeof borders>;
15
17
  export default borders;