@mui/system 6.0.0-alpha.10 → 6.0.0-alpha.12

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 (55) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/DefaultPropsProvider/DefaultPropsProvider.d.ts +12 -0
  3. package/DefaultPropsProvider/DefaultPropsProvider.js +64 -0
  4. package/DefaultPropsProvider/index.d.ts +1 -0
  5. package/DefaultPropsProvider/index.js +1 -0
  6. package/DefaultPropsProvider/package.json +6 -0
  7. package/{cssVars/getInitColorSchemeScript.d.ts → InitColorSchemeScript/InitColorSchemeScript.d.ts} +9 -2
  8. package/{cssVars/getInitColorSchemeScript.js → InitColorSchemeScript/InitColorSchemeScript.js} +9 -2
  9. package/InitColorSchemeScript/index.d.ts +2 -0
  10. package/InitColorSchemeScript/index.js +1 -0
  11. package/InitColorSchemeScript/package.json +6 -0
  12. package/ThemeProvider/ThemeProvider.js +5 -1
  13. package/Unstable_Grid/Grid.js +0 -4
  14. package/Unstable_Grid/GridProps.d.ts +0 -4
  15. package/Unstable_Grid/createGrid.js +2 -27
  16. package/Unstable_Grid/gridGenerator.d.ts +1 -3
  17. package/Unstable_Grid/gridGenerator.js +5 -14
  18. package/cssContainerQueries/cssContainerQueries.js +4 -4
  19. package/cssVars/createCssVarsProvider.d.ts +2 -2
  20. package/cssVars/createCssVarsProvider.js +2 -2
  21. package/cssVars/index.d.ts +0 -1
  22. package/cssVars/index.js +0 -1
  23. package/cssVars/useCurrentColorScheme.js +1 -1
  24. package/index.js +1 -1
  25. package/modern/DefaultPropsProvider/DefaultPropsProvider.js +64 -0
  26. package/modern/DefaultPropsProvider/index.js +1 -0
  27. package/modern/{cssVars/getInitColorSchemeScript.js → InitColorSchemeScript/InitColorSchemeScript.js} +9 -2
  28. package/modern/InitColorSchemeScript/index.js +1 -0
  29. package/modern/ThemeProvider/ThemeProvider.js +5 -1
  30. package/modern/Unstable_Grid/Grid.js +0 -4
  31. package/modern/Unstable_Grid/createGrid.js +2 -27
  32. package/modern/Unstable_Grid/gridGenerator.js +5 -14
  33. package/modern/cssContainerQueries/cssContainerQueries.js +4 -4
  34. package/modern/cssVars/createCssVarsProvider.js +2 -2
  35. package/modern/cssVars/index.js +0 -1
  36. package/modern/cssVars/useCurrentColorScheme.js +1 -1
  37. package/modern/index.js +1 -1
  38. package/modern/useMediaQuery/useMediaQuery.js +5 -27
  39. package/node/DefaultPropsProvider/DefaultPropsProvider.js +73 -0
  40. package/node/DefaultPropsProvider/index.js +20 -0
  41. package/node/{cssVars/getInitColorSchemeScript.js → InitColorSchemeScript/InitColorSchemeScript.js} +11 -3
  42. package/node/InitColorSchemeScript/index.js +13 -0
  43. package/node/ThemeProvider/ThemeProvider.js +5 -1
  44. package/node/Unstable_Grid/Grid.js +0 -4
  45. package/node/Unstable_Grid/createGrid.js +3 -28
  46. package/node/Unstable_Grid/gridGenerator.js +5 -14
  47. package/node/cssContainerQueries/cssContainerQueries.js +4 -4
  48. package/node/cssVars/createCssVarsProvider.js +5 -5
  49. package/node/cssVars/index.js +0 -7
  50. package/node/cssVars/useCurrentColorScheme.js +3 -3
  51. package/node/index.js +1 -1
  52. package/node/useMediaQuery/useMediaQuery.js +5 -26
  53. package/package.json +5 -5
  54. package/useMediaQuery/useMediaQuery.d.ts +0 -18
  55. package/useMediaQuery/useMediaQuery.js +5 -27
package/CHANGELOG.md CHANGED
@@ -1,5 +1,150 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.12
4
+
5
+ <!-- generated comparing v6.0.0-alpha.11..next -->
6
+
7
+ _Jun 24, 2024_
8
+
9
+ A big thanks to the 17 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.0.0-alpha.12`
12
+
13
+ - Add `InitColorSchemeScript` for Next.js App Router (#42247) @siriwatknp
14
+ - [Autocomplete] Fix renderOption props type (#42689) @DiegoAndai
15
+ - [Autocomplete] Fix React 18.3 key spread warnings in Autocomplete demos (#42691) @aarongarciah
16
+ - Support Pigment CSS for `CssBaseline`, `ScopedCssBaseline` and `Popper` (#42640) @siriwatknp
17
+ - Add `DefaultPropsProvider` for Pigment CSS integration (#42638) @siriwatknp
18
+ - [Stepper] Generate class for nonLinear prop (#42620) @alexismo
19
+ - [Tab] Fix failing test (#42686) @aarongarciah
20
+ - [Tab] Deprecate iconWrapper class for icon class (#42647) @sai6855
21
+ - [TableSortLabel] Deprecate composed classes (#42281) @sai6855
22
+ - [usePagination] Update pagination `siblingsEnd` calculation logic (#42667) @Mini-ghost
23
+
24
+ ### `@mui/codemod@6.0.0-alpha.12`
25
+
26
+ - Support dynamic props styled transformation (#42683) @siriwatknp
27
+
28
+ ### `@mui/system@6.0.0-alpha.12`
29
+
30
+ - Fix issues reported by react compiler in `mui-system` package (#42637) @sai6855
31
+ - [useMediaQuery] Remove deprecated types (#42560) @aarongarciah
32
+
33
+ ### `@mui/joy@5.0.0-beta.45`
34
+
35
+ - Fix issues reported by the React Compiler (#42671) @anuujj
36
+ - [Autocomplete] Fix React spread key warning (#42741) @aarongarciah
37
+
38
+ ### `@mui/lab@6.0.0-alpha.12`
39
+
40
+ - [LoadingButton] Apply wrapping element to prevent React crash on Google page translation (#35198) @BartJanvanAssen
41
+
42
+ ### Docs
43
+
44
+ - Fix git diff format in migration to v6 (#42711) @oliviertassinari
45
+ - Use new email for sponsoring @oliviertassinari
46
+ - Fix 301 links (#42697) @alexfauquette
47
+ - Normalize the capitalization of Design Kit @oliviertassinari
48
+ - Recommend setting HTML attribute instead of DOM property for RTL (#42599) @aarongarciah
49
+ - [material-ui][Select] Fix the `SelectAutoWidth` demo menu item value (#42648) @Danielkhakbaz
50
+
51
+ ### Core
52
+
53
+ - [code-infra] Try disabling animations when taking screenshots (#42537) @Janpot
54
+ - [code-infra] Fix benchmark package (#42553) @Janpot
55
+ - [core] Replace enzyme in describeConformance (#42447) @DiegoAndai
56
+ - [docs-infra] Fix layout shift demo toolbar (#42743) @oliviertassinari
57
+ - [docs-infra] Fix visual look of in-house ad (#42735) @oliviertassinari
58
+ - [docs-infra] Add stray design polish (#42646) @danilo-leal
59
+ - [docs-infra] Fix wrong migration (#42675) @siriwatknp
60
+ - [docs-infra] Fine tune markdown elements design (#42643) @danilo-leal
61
+ - [docs-infra] Revamp the product switcher design (#42603) @danilo-leal
62
+ - [docs-infra] Allow Link component to receive the `role` attribute (#42629) @danilo-leal
63
+ - [infra] Add support donation button (#42499) @oliviertassinari
64
+ - [infra] Raise `tsconfig`/`tsc` target to `es2022` (#42645) @LukasTy
65
+ - [test] Fix tests on CI (#42670) @michaldudak
66
+ - [test] Fix issues reported by react-compiler in test packages (#42626) @sai6855
67
+ - [website] Add Armin to the team members (#42679) @arminmeh
68
+ - [website] Open Staff Engineer role for Pigment CSS (#42531) @mnajdova
69
+
70
+ All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @alexismo, @anuujj, @arminmeh, @BartJanvanAssen, @Danielkhakbaz, @danilo-leal, @DiegoAndai, @Janpot, @LukasTy, @michaldudak, @Mini-ghost, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp
71
+
72
+ ## v6.0.0-alpha.11
73
+
74
+ <!-- generated comparing v6.0.0-alpha.10..next -->
75
+
76
+ _Jun 11, 2024_
77
+
78
+ A big thanks to the 18 contributors who made this release possible.
79
+
80
+ ### `@mui/material@6.0.0-alpha.11`
81
+
82
+ - &#8203;<!-- 38 -->[Autocomplete] Shouldn't resize when hovering (#42452) @ZeeshanTamboli
83
+ - &#8203;<!-- 37 -->[Chip] Fix focus issue related with the Escape event (#41578) @shrilsharma
84
+ - &#8203;<!-- 12 -->[Grid] Fix support for CSS variables (#42574) @oliviertassinari
85
+ - &#8203;<!-- 11 -->[InputBase] Use `globalCss` for Pigment integration (#42431) @siriwatknp
86
+ - &#8203;<!-- 10 -->Change React.ReactElement type from `any` to `unknown` (#42473) @sai6855
87
+ - &#8203;<!-- 09 -->Integrate `extendSxProp` adapter (#42543) @siriwatknp
88
+ - &#8203;<!-- 08 -->[Tab] Fix applying `iconWrapper` styles from theme and update its description (#42549) @sai6855
89
+ - &#8203;<!-- 08 -->[pigment-css] Add `stringifyTheme` for Pigment CSS integration (#42476) @siriwatknp
90
+
91
+ ### `@mui/system@6.0.0-alpha.11`
92
+
93
+ - &#8203;<!-- 11 -->[Grid] Remove `disableEqualOverflow` by using `gap` (#42526) @DiegoAndai
94
+ - &#8203;<!-- 07 -->[useMediaQuery] Drop Safari < 14 support (#42464) @aarongarciah
95
+
96
+ ### `@mui/utils@6.0.0-alpha.11`
97
+
98
+ - &#8203;<!-- 04 -->Allow passing `NaN` as `defaultValue` to `useControlled` (#41559) @iammminzzy
99
+
100
+ ### `@mui/codemod@6.0.0-alpha.11`
101
+
102
+ - &#8203;<!-- 39 -->Improve styled and sx prop transformation (#42598) @siriwatknp
103
+ - &#8203;<!-- 36 -->Support more cases for sx-prop transformation (#42527) @siriwatknp
104
+
105
+ ### `@mui/private-theming@6.0.0-alpha.11`
106
+
107
+ - &#8203;<!-- 09 -->Fix issues reported by react compiler in `mui-private-theming` components (#42619) @sai6855
108
+
109
+ ### Docs
110
+
111
+ - &#8203;<!-- 31 -->Add `theme.applyStyles` and migrate docs (#42498) @siriwatknp
112
+ - &#8203;<!-- 29 -->Fix dashboard template console error (#42594) @oliviertassinari
113
+ - &#8203;<!-- 28 -->Migrate system props to `sx` prop (#42475) @siriwatknp
114
+ - &#8203;<!-- 27 -->[material-ui]Fix duplicated sentence (#42521) @alexfauquette
115
+ - &#8203;<!-- 22 -->[Grid] Fix docs spacing (#42573) @oliviertassinari
116
+ - &#8203;<!-- 21 -->[joy-ui] Add Next.js App Router instructions on how to prevent flickering (#42514) @devnyxie
117
+ - &#8203;<!-- 20 -->[joy-ui] Fix HTML tag without preformatting (#42525) @jacobmoshipco
118
+ - &#8203;<!-- 19 -->[material-ui] Add docs for complementary stepper components (#41900) @anle9650
119
+ - &#8203;<!-- 18 -->[material-ui] Fix typo on Sign-in/Sign-up templates (#42605) @zanivan
120
+ - &#8203;<!-- 17 -->[material-ui] Add container queries docs (#42434) @siriwatknp
121
+ - &#8203;<!-- 16 -->[material-ui] Fix ESLint error in Stepper demo (#42559) @aarongarciah
122
+ - &#8203;<!-- 15 -->[material-ui] Shorten useMediaQuery subheading (#42561) @aarongarciah
123
+ - &#8203;<!-- 14 -->[material-ui] Add a Refine example project (#42461) @necatiozmen
124
+
125
+ ### Core
126
+
127
+ - &#8203;<!-- 39 -->[website] Move the `React Engineer - X` role to future roles (#42532) @DanailH
128
+ - &#8203;<!-- 35 -->[core] Allow `for..of` loops (#42600) @michaldudak
129
+ - &#8203;<!-- 34 -->[core] Add comment about Object.js @oliviertassinari
130
+ - &#8203;<!-- 33 -->[core] Disable eslint-plugin-react-compiler for Base (#42563) @aarongarciah
131
+ - &#8203;<!-- 33 -->[core] Group Pigment CSS dependencies (#42174) @siriwatknp
132
+ - &#8203;<!-- 32 -->[core] Configure eslint-plugin-react-compiler (#42555) @aarongarciah
133
+ - &#8203;<!-- 31 -->[core] Skip charts animation for visual regression test (#42530) @alexfauquette
134
+ - &#8203;<!-- 26 -->[docs-infra] Simplify click header (#42593) @oliviertassinari
135
+ - &#8203;<!-- 25 -->[docs-infra] Add configurable jsdoc host variable (#42472) @tonygravell
136
+ - &#8203;<!-- 25 -->[docs-infra] Add the Base UI logo with copy functionality (#42446) @danilo-leal
137
+ - &#8203;<!-- 24 -->[docs-infra] Prevent link anchor when selecting text (#41994) @alexfauquette
138
+ - &#8203;<!-- 23 -->[docs-infra] Add the Base UI logo with copy functionality (#42446) @danilo-leal
139
+ - &#8203;<!-- 13 -->[examples] Remove Pigment CSS examples (#42471) @sai6855
140
+ - &#8203;<!-- 06 -->[test] Restore pnpm tc command (#42572) @oliviertassinari
141
+ - &#8203;<!-- 05 -->[test] Restore testing internal packages (#42519) @michaldudak
142
+ - &#8203;<!-- 03 -->[website] Close Developer Advocate / Content Engineer role @oliviertassinari
143
+ - &#8203;<!-- 02 -->[website] Remove blank line @oliviertassinari
144
+ - &#8203;<!-- 01 -->[website] Fix mobile layout shift @oliviertassinari
145
+
146
+ All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @anle9650, @DanailH, @danilo-leal, @devnyxie, @DiegoAndai, @iammminzzy, @jacobmoshipco, @michaldudak, @necatiozmen, @oliviertassinari, @sai6855, @shrilsharma, @siriwatknp, @tonygravell, @zanivan, @ZeeshanTamboli
147
+
3
148
  ## v6.0.0-alpha.10
4
149
 
5
150
  <!-- generated comparing v6.0.0-alpha.9..next -->
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ declare function DefaultPropsProvider({ value, children, }: React.PropsWithChildren<{
3
+ value: Record<string, any> | undefined;
4
+ }>): React.JSX.Element;
5
+ declare namespace DefaultPropsProvider {
6
+ var propTypes: any;
7
+ }
8
+ export declare function useDefaultProps<Props>({ props, name }: {
9
+ props: Props;
10
+ name: string;
11
+ }): Props;
12
+ export default DefaultPropsProvider;
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import resolveProps from '@mui/utils/resolveProps';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const PropsContext = /*#__PURE__*/React.createContext(undefined);
8
+ function DefaultPropsProvider({
9
+ value,
10
+ children
11
+ }) {
12
+ return /*#__PURE__*/_jsx(PropsContext.Provider, {
13
+ value: value,
14
+ children: children
15
+ });
16
+ }
17
+ process.env.NODE_ENV !== "production" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {
18
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
19
+ // │ These PropTypes are generated from the TypeScript type definitions. │
20
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
21
+ // └─────────────────────────────────────────────────────────────────────┘
22
+ /**
23
+ * @ignore
24
+ */
25
+ children: PropTypes.node,
26
+ /**
27
+ * @ignore
28
+ */
29
+ value: PropTypes.object
30
+ } : void 0;
31
+ function getThemeProps(params) {
32
+ const {
33
+ theme,
34
+ name,
35
+ props
36
+ } = params;
37
+ if (!theme || !theme.components || !theme.components[name]) {
38
+ return props;
39
+ }
40
+ const config = theme.components[name];
41
+ if (config.defaultProps) {
42
+ // compatible with v5 signature
43
+ return resolveProps(config.defaultProps, props);
44
+ }
45
+ if (!config.styleOverrides && !config.variants) {
46
+ // v6 signature, no property 'defaultProps'
47
+ return resolveProps(config, props);
48
+ }
49
+ return props;
50
+ }
51
+ export function useDefaultProps({
52
+ props,
53
+ name
54
+ }) {
55
+ const ctx = React.useContext(PropsContext);
56
+ return getThemeProps({
57
+ props,
58
+ name,
59
+ theme: {
60
+ components: ctx
61
+ }
62
+ });
63
+ }
64
+ export default DefaultPropsProvider;
@@ -0,0 +1 @@
1
+ export { default, useDefaultProps } from './DefaultPropsProvider';
@@ -0,0 +1 @@
1
+ export { default, useDefaultProps } from './DefaultPropsProvider';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/DefaultPropsProvider/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -1,8 +1,11 @@
1
+ /**
2
+ * Split this component for RSC import
3
+ */
1
4
  import * as React from 'react';
2
5
  export declare const DEFAULT_MODE_STORAGE_KEY = "mode";
3
6
  export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "color-scheme";
4
7
  export declare const DEFAULT_ATTRIBUTE = "data-color-scheme";
5
- export interface GetInitColorSchemeScriptOptions {
8
+ export interface InitColorSchemeScriptProps {
6
9
  /**
7
10
  * The mode to be used for the first visit
8
11
  * @default 'light'
@@ -38,5 +41,9 @@ export interface GetInitColorSchemeScriptOptions {
38
41
  * @default 'data-color-scheme'
39
42
  */
40
43
  attribute?: string;
44
+ /**
45
+ * Nonce string to pass to the inline script for CSP headers
46
+ */
47
+ nonce?: string | undefined;
41
48
  }
42
- export default function getInitColorSchemeScript(options?: GetInitColorSchemeScriptOptions): React.JSX.Element;
49
+ export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): React.JSX.Element;
@@ -1,9 +1,12 @@
1
+ /**
2
+ * Split this component for RSC import
3
+ */
1
4
  import * as React from 'react';
2
5
  import { jsx as _jsx } from "react/jsx-runtime";
3
6
  export const DEFAULT_MODE_STORAGE_KEY = 'mode';
4
7
  export const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
5
8
  export const DEFAULT_ATTRIBUTE = 'data-color-scheme';
6
- export default function getInitColorSchemeScript(options) {
9
+ export default function InitColorSchemeScript(options) {
7
10
  const {
8
11
  defaultMode = 'light',
9
12
  defaultLightColorScheme = 'light',
@@ -11,10 +14,14 @@ export default function getInitColorSchemeScript(options) {
11
14
  modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
12
15
  colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
13
16
  attribute = DEFAULT_ATTRIBUTE,
14
- colorSchemeNode = 'document.documentElement'
17
+ colorSchemeNode = 'document.documentElement',
18
+ nonce
15
19
  } = options || {};
16
20
  return /*#__PURE__*/_jsx("script", {
21
+ suppressHydrationWarning: true,
22
+ nonce: typeof window === 'undefined' ? nonce : ''
17
23
  // eslint-disable-next-line react/no-danger
24
+ ,
18
25
  dangerouslySetInnerHTML: {
19
26
  __html: `(function() {
20
27
  try {
@@ -0,0 +1,2 @@
1
+ export { default } from './InitColorSchemeScript';
2
+ export type { InitColorSchemeScriptProps } from './InitColorSchemeScript';
@@ -0,0 +1 @@
1
+ export { default } from './InitColorSchemeScript';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/InitColorSchemeScript/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -7,6 +7,7 @@ import exactProp from '@mui/utils/exactProp';
7
7
  import { ThemeContext as StyledEngineThemeContext } from '@mui/styled-engine';
8
8
  import useThemeWithoutDefault from '../useThemeWithoutDefault';
9
9
  import RtlProvider from '../RtlProvider';
10
+ import DefaultPropsProvider from '../DefaultPropsProvider';
10
11
  import { jsx as _jsx } from "react/jsx-runtime";
11
12
  const EMPTY_THEME = {};
12
13
  function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
@@ -64,7 +65,10 @@ function ThemeProvider(props) {
64
65
  value: engineTheme,
65
66
  children: /*#__PURE__*/_jsx(RtlProvider, {
66
67
  value: rtlValue,
67
- children: children
68
+ children: /*#__PURE__*/_jsx(DefaultPropsProvider, {
69
+ value: engineTheme?.components,
70
+ children: children
71
+ })
68
72
  })
69
73
  })
70
74
  });
@@ -45,10 +45,6 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
45
45
  * @default 'row'
46
46
  */
47
47
  direction: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
48
- /**
49
- * If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
50
- */
51
- disableEqualOverflow: PropTypes.bool,
52
48
  /**
53
49
  * If a number, it sets the number of columns the grid item uses.
54
50
  * It can't be greater than the total number of columns of the container (12 by default).
@@ -123,10 +123,6 @@ export interface GridBaseProps extends Breakpoints {
123
123
  * @default 'row'
124
124
  */
125
125
  direction?: ResponsiveStyleValue<GridDirection>;
126
- /**
127
- * If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
128
- */
129
- disableEqualOverflow?: boolean;
130
126
  /**
131
127
  * @internal
132
128
  * The level of the grid starts from `0`
@@ -33,10 +33,6 @@ export default function createGrid(options = {}) {
33
33
  useThemeProps = useThemePropsDefault,
34
34
  componentName = 'MuiGrid'
35
35
  } = options;
36
- const GridOverflowContext = /*#__PURE__*/React.createContext(undefined);
37
- if (process.env.NODE_ENV !== 'production') {
38
- GridOverflowContext.displayName = 'GridOverflowContext';
39
- }
40
36
  const useUtilityClasses = (ownerState, theme) => {
41
37
  const {
42
38
  container,
@@ -55,7 +51,6 @@ export default function createGrid(options = {}) {
55
51
  const theme = useTheme();
56
52
  const themeProps = useThemeProps(inProps);
57
53
  const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
58
- const overflow = React.useContext(GridOverflowContext);
59
54
  const {
60
55
  className,
61
56
  children,
@@ -67,15 +62,9 @@ export default function createGrid(options = {}) {
67
62
  spacing: spacingProp = 0,
68
63
  rowSpacing: rowSpacingProp = spacingProp,
69
64
  columnSpacing: columnSpacingProp = spacingProp,
70
- disableEqualOverflow: themeDisableEqualOverflow,
71
65
  unstable_level: level = 0,
72
66
  ...rest
73
67
  } = props;
74
- // Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead.
75
- let disableEqualOverflow = themeDisableEqualOverflow;
76
- if (level && themeDisableEqualOverflow !== undefined) {
77
- disableEqualOverflow = inProps.disableEqualOverflow;
78
- }
79
68
  // collect breakpoints related props because they can be customized from the theme.
80
69
  const gridSize = {};
81
70
  const gridOffset = {};
@@ -104,13 +93,10 @@ export default function createGrid(options = {}) {
104
93
  rowSpacing,
105
94
  columnSpacing,
106
95
  gridSize,
107
- gridOffset,
108
- disableEqualOverflow: disableEqualOverflow ?? overflow ?? false,
109
- // use context value if exists.
110
- parentDisableEqualOverflow: overflow // for nested grid
96
+ gridOffset
111
97
  };
112
98
  const classes = useUtilityClasses(ownerState, theme);
113
- let result = /*#__PURE__*/_jsx(GridRoot, {
99
+ return /*#__PURE__*/_jsx(GridRoot, {
114
100
  ref: ref,
115
101
  as: component,
116
102
  ownerState: ownerState,
@@ -125,16 +111,6 @@ export default function createGrid(options = {}) {
125
111
  return child;
126
112
  })
127
113
  });
128
- if (disableEqualOverflow !== undefined && disableEqualOverflow !== (overflow ?? false)) {
129
- // There are 2 possibilities that should wrap with the GridOverflowContext to communicate with the nested grids:
130
- // 1. It is the root grid with `disableEqualOverflow`.
131
- // 2. It is a nested grid with different `disableEqualOverflow` from the context.
132
- result = /*#__PURE__*/_jsx(GridOverflowContext.Provider, {
133
- value: disableEqualOverflow,
134
- children: result
135
- });
136
- }
137
- return result;
138
114
  });
139
115
  process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ = {
140
116
  children: PropTypes.node,
@@ -144,7 +120,6 @@ export default function createGrid(options = {}) {
144
120
  component: PropTypes.elementType,
145
121
  container: PropTypes.bool,
146
122
  direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
147
- disableEqualOverflow: PropTypes.bool,
148
123
  lg: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
149
124
  lgOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
150
125
  md: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
@@ -7,9 +7,7 @@ interface Props {
7
7
  breakpoints: Breakpoints;
8
8
  spacing?: Spacing;
9
9
  };
10
- ownerState: GridOwnerState & {
11
- parentDisableEqualOverflow?: boolean;
12
- };
10
+ ownerState: GridOwnerState;
13
11
  }
14
12
  export declare const generateGridSizeStyles: ({ theme, ownerState }: Props) => {};
15
13
  export declare const generateGridOffsetStyles: ({ theme, ownerState }: Props) => {};
@@ -31,7 +31,7 @@ export const generateGridSizeStyles = ({
31
31
  theme,
32
32
  ownerState
33
33
  }) => {
34
- const getSelfSpacing = createGetSelfSpacing(ownerState);
34
+ const getParentSpacing = createGetParentSpacing(ownerState);
35
35
  const styles = {};
36
36
  traverseBreakpoints(theme.breakpoints, ownerState.gridSize, (appendStyle, value) => {
37
37
  let style = {};
@@ -55,7 +55,7 @@ export const generateGridSizeStyles = ({
55
55
  style = {
56
56
  flexGrow: 0,
57
57
  flexBasis: 'auto',
58
- width: `calc(100% * ${value} / ${getParentColumns(ownerState)}${isNestedContainer(ownerState) ? ` + ${getSelfSpacing('column')}` : ''})`
58
+ width: `calc(100% * ${value} / ${getParentColumns(ownerState)} - (${getParentColumns(ownerState)} - ${value}) * (${getParentSpacing('column')} / ${getParentColumns(ownerState)}))`
59
59
  };
60
60
  }
61
61
  appendStyle(styles, style);
@@ -66,6 +66,7 @@ export const generateGridOffsetStyles = ({
66
66
  theme,
67
67
  ownerState
68
68
  }) => {
69
+ const getParentSpacing = createGetParentSpacing(ownerState);
69
70
  const styles = {};
70
71
  traverseBreakpoints(theme.breakpoints, ownerState.gridOffset, (appendStyle, value) => {
71
72
  let style = {};
@@ -76,7 +77,7 @@ export const generateGridOffsetStyles = ({
76
77
  }
77
78
  if (typeof value === 'number') {
78
79
  style = {
79
- marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / ${getParentColumns(ownerState)})`
80
+ marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / ${getParentColumns(ownerState)} + ${getParentSpacing('column')} * ${value} / ${getParentColumns(ownerState)})`
80
81
  };
81
82
  }
82
83
  appendStyle(styles, style);
@@ -161,7 +162,6 @@ export const generateGridStyles = ({
161
162
  ownerState
162
163
  }) => {
163
164
  const getSelfSpacing = createGetSelfSpacing(ownerState);
164
- const getParentSpacing = createGetParentSpacing(ownerState);
165
165
  return {
166
166
  minWidth: 0,
167
167
  boxSizing: 'border-box',
@@ -171,16 +171,7 @@ export const generateGridStyles = ({
171
171
  ...(ownerState.wrap && ownerState.wrap !== 'wrap' && {
172
172
  flexWrap: ownerState.wrap
173
173
  }),
174
- margin: `calc(${getSelfSpacing('row')} / -2) calc(${getSelfSpacing('column')} / -2)`,
175
- ...(ownerState.disableEqualOverflow && {
176
- margin: `calc(${getSelfSpacing('row')} * -1) 0px 0px calc(${getSelfSpacing('column')} * -1)`
177
- })
178
- }),
179
- ...((!ownerState.container || isNestedContainer(ownerState)) && {
180
- padding: `calc(${getParentSpacing('row')} / 2) calc(${getParentSpacing('column')} / 2)`,
181
- ...((ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && {
182
- padding: `${getParentSpacing('row')} 0px 0px ${getParentSpacing('column')}`
183
- })
174
+ gap: `${getSelfSpacing('row')} ${getSelfSpacing('column')}`
184
175
  })
185
176
  };
186
177
  };
@@ -26,10 +26,10 @@ export function sortContainerQueries(theme, css) {
26
26
  });
27
27
  }
28
28
  export function isCqShorthand(breakpointKeys, value) {
29
- return value.startsWith('@') && (breakpointKeys.some(key => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
29
+ return value === '@' || value.startsWith('@') && (breakpointKeys.some(key => value.startsWith(`@${key}`)) || !!value.match(/^@\d/));
30
30
  }
31
31
  export function getContainerQuery(theme, shorthand) {
32
- const matches = shorthand.match(/^@([^/]+)\/?(.+)?$/);
32
+ const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
33
33
  if (!matches) {
34
34
  if (process.env.NODE_ENV !== 'production') {
35
35
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
@@ -38,7 +38,7 @@ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.` : _formatMuiErrorMessag
38
38
  return null;
39
39
  }
40
40
  const [, containerQuery, containerName] = matches;
41
- const value = Number.isNaN(+containerQuery) ? containerQuery : +containerQuery;
41
+ const value = Number.isNaN(+containerQuery) ? containerQuery || 0 : +containerQuery;
42
42
  return theme.containerQueries(containerName).up(value);
43
43
  }
44
44
  export default function cssContainerQueries(themeInput) {
@@ -52,7 +52,7 @@ export default function cssContainerQueries(themeInput) {
52
52
  const result = toContainerQuery(themeInput.breakpoints.not(...args), name);
53
53
  if (result.includes('not all and')) {
54
54
  // `@container` does not work with `not all and`, so need to invert the logic
55
- return result.replace('not all and ', '').replace('min-width:', 'width<').replace('max-width:', 'width>');
55
+ return result.replace('not all and ', '').replace('min-width:', 'width<').replace('max-width:', 'width>').replace('and', 'or');
56
56
  }
57
57
  return result;
58
58
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import getInitColorSchemeScript from './getInitColorSchemeScript';
2
+ import InitColorSchemeScript from '../InitColorSchemeScript';
3
3
  import { Mode, Result } from './useCurrentColorScheme';
4
4
 
5
5
  export interface ColorSchemeContextValue<SupportedColorScheme extends string>
@@ -92,7 +92,7 @@ export interface CreateCssVarsProviderResult<
92
92
  >,
93
93
  ) => React.ReactElement<any>;
94
94
  useColorScheme: () => ColorSchemeContextValue<ColorScheme>;
95
- getInitColorSchemeScript: typeof getInitColorSchemeScript;
95
+ getInitColorSchemeScript: typeof InitColorSchemeScript;
96
96
  }
97
97
 
98
98
  export default function createCssVarsProvider<
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { GlobalStyles } from '@mui/styled-engine';
5
5
  import { useTheme as muiUseTheme } from '@mui/private-theming';
6
6
  import ThemeProvider from '../ThemeProvider';
7
- import systemGetInitColorSchemeScript, { DEFAULT_ATTRIBUTE, DEFAULT_COLOR_SCHEME_STORAGE_KEY, DEFAULT_MODE_STORAGE_KEY } from './getInitColorSchemeScript';
7
+ import InitColorSchemeScript, { DEFAULT_ATTRIBUTE, DEFAULT_COLOR_SCHEME_STORAGE_KEY, DEFAULT_MODE_STORAGE_KEY } from '../InitColorSchemeScript/InitColorSchemeScript';
8
8
  import useCurrentColorScheme from './useCurrentColorScheme';
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  export const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
@@ -299,7 +299,7 @@ export default function createCssVarsProvider(options) {
299
299
  } : void 0;
300
300
  const defaultLightColorScheme = typeof designSystemColorScheme === 'string' ? designSystemColorScheme : designSystemColorScheme.light;
301
301
  const defaultDarkColorScheme = typeof designSystemColorScheme === 'string' ? designSystemColorScheme : designSystemColorScheme.dark;
302
- const getInitColorSchemeScript = params => systemGetInitColorSchemeScript({
302
+ const getInitColorSchemeScript = params => InitColorSchemeScript({
303
303
  attribute: defaultAttribute,
304
304
  colorSchemeStorageKey: defaultColorSchemeStorageKey,
305
305
  defaultMode: designSystemMode,
@@ -1,6 +1,5 @@
1
1
  export { default } from './createCssVarsProvider';
2
2
  export type { CreateCssVarsProviderResult, CssVarsProviderConfig, ColorSchemeContextValue, } from './createCssVarsProvider';
3
- export { default as getInitColorSchemeScript } from './getInitColorSchemeScript';
4
3
  export { default as prepareCssVars } from './prepareCssVars';
5
4
  export { default as prepareTypographyVars } from './prepareTypographyVars';
6
5
  export type { ExtractTypographyTokens } from './prepareTypographyVars';
package/cssVars/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  export { default } from './createCssVarsProvider';
4
- export { default as getInitColorSchemeScript } from './getInitColorSchemeScript';
5
4
  export { default as prepareCssVars } from './prepareCssVars';
6
5
  export { default as prepareTypographyVars } from './prepareTypographyVars';
7
6
  export { default as createCssVarsTheme } from './createCssVarsTheme';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from './getInitColorSchemeScript';
4
+ import { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from '../InitColorSchemeScript/InitColorSchemeScript';
5
5
  export function getSystemMode(mode) {
6
6
  if (typeof window !== 'undefined' && mode === 'system') {
7
7
  const mql = window.matchMedia('(prefers-color-scheme: dark)');
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v6.0.0-alpha.10
2
+ * @mui/system v6.0.0-alpha.12
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the