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

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 (199) hide show
  1. package/CHANGELOG.md +591 -6
  2. package/Container/Container.d.ts +1 -1
  3. package/Container/createContainer.js +39 -35
  4. package/RtlProvider/index.js +8 -11
  5. package/Stack/Stack.d.ts +1 -1
  6. package/Stack/createStack.d.ts +1 -1
  7. package/Stack/createStack.js +24 -26
  8. package/ThemeProvider/ThemeProvider.js +9 -5
  9. package/Unstable_Grid/Grid.d.ts +1 -1
  10. package/Unstable_Grid/createGrid.d.ts +1 -1
  11. package/Unstable_Grid/createGrid.js +21 -23
  12. package/Unstable_Grid/gridGenerator.js +20 -17
  13. package/breakpoints/breakpoints.js +26 -7
  14. package/createBox/createBox.js +9 -12
  15. package/createStyled/createStyled.js +56 -51
  16. package/createTheme/applyStyles.d.ts +1 -1
  17. package/createTheme/applyStyles.js +1 -1
  18. package/createTheme/createBreakpoints.js +24 -25
  19. package/createTheme/createSpacing.d.ts +2 -2
  20. package/createTheme/createSpacing.js +7 -8
  21. package/createTheme/createTheme.d.ts +2 -1
  22. package/createTheme/createTheme.js +20 -14
  23. package/cssContainerQueries/cssContainerQueries.d.ts +24 -0
  24. package/cssContainerQueries/cssContainerQueries.js +70 -0
  25. package/cssContainerQueries/index.d.ts +3 -0
  26. package/cssContainerQueries/index.js +2 -0
  27. package/cssContainerQueries/package.json +6 -0
  28. package/cssVars/createCssVarsProvider.d.ts +1 -1
  29. package/cssVars/createCssVarsProvider.js +20 -16
  30. package/cssVars/createCssVarsTheme.js +3 -3
  31. package/cssVars/cssVarsParser.d.ts +1 -1
  32. package/cssVars/cssVarsParser.js +3 -2
  33. package/cssVars/index.d.ts +2 -0
  34. package/cssVars/index.js +1 -0
  35. package/cssVars/prepareCssVars.js +30 -25
  36. package/cssVars/prepareTypographyVars.d.ts +8 -0
  37. package/cssVars/prepareTypographyVars.js +11 -0
  38. package/cssVars/useCurrentColorScheme.js +18 -11
  39. package/index.d.ts +2 -0
  40. package/index.js +2 -1
  41. package/modern/Container/createContainer.js +39 -35
  42. package/modern/RtlProvider/index.js +8 -11
  43. package/modern/Stack/createStack.js +24 -26
  44. package/modern/ThemeProvider/ThemeProvider.js +9 -5
  45. package/modern/Unstable_Grid/createGrid.js +21 -23
  46. package/modern/Unstable_Grid/gridGenerator.js +20 -17
  47. package/modern/breakpoints/breakpoints.js +26 -7
  48. package/modern/createBox/createBox.js +9 -12
  49. package/modern/createStyled/createStyled.js +56 -51
  50. package/modern/createTheme/applyStyles.js +1 -1
  51. package/modern/createTheme/createBreakpoints.js +24 -25
  52. package/modern/createTheme/createSpacing.js +7 -8
  53. package/modern/createTheme/createTheme.js +20 -14
  54. package/modern/cssContainerQueries/cssContainerQueries.js +70 -0
  55. package/modern/cssContainerQueries/index.js +2 -0
  56. package/modern/cssVars/createCssVarsProvider.js +20 -16
  57. package/modern/cssVars/createCssVarsTheme.js +3 -3
  58. package/modern/cssVars/cssVarsParser.js +3 -2
  59. package/modern/cssVars/index.js +1 -0
  60. package/modern/cssVars/prepareCssVars.js +30 -25
  61. package/modern/cssVars/prepareTypographyVars.js +11 -0
  62. package/modern/cssVars/useCurrentColorScheme.js +18 -11
  63. package/modern/index.js +2 -1
  64. package/modern/propsToClassKey/propsToClassKey.js +3 -5
  65. package/modern/spacing/spacing.js +24 -21
  66. package/modern/styleFunctionSx/defaultSxConfig.js +3 -0
  67. package/modern/styleFunctionSx/extendSxProp.js +14 -10
  68. package/modern/styleFunctionSx/styleFunctionSx.js +2 -1
  69. package/node/Container/createContainer.js +39 -35
  70. package/node/RtlProvider/index.js +8 -11
  71. package/node/Stack/createStack.js +24 -26
  72. package/node/ThemeProvider/ThemeProvider.js +9 -5
  73. package/node/Unstable_Grid/createGrid.js +23 -25
  74. package/node/Unstable_Grid/gridGenerator.js +20 -18
  75. package/node/breakpoints/breakpoints.js +26 -7
  76. package/node/createBox/createBox.js +9 -12
  77. package/node/createStyled/createStyled.js +58 -52
  78. package/node/createTheme/applyStyles.js +1 -1
  79. package/node/createTheme/createBreakpoints.js +24 -26
  80. package/node/createTheme/createSpacing.js +7 -8
  81. package/node/createTheme/createTheme.js +20 -14
  82. package/node/cssContainerQueries/cssContainerQueries.js +81 -0
  83. package/node/cssContainerQueries/index.js +32 -0
  84. package/node/cssVars/createCssVarsProvider.js +20 -16
  85. package/node/cssVars/createCssVarsTheme.js +3 -3
  86. package/node/cssVars/cssVarsParser.js +3 -2
  87. package/node/cssVars/index.js +7 -0
  88. package/node/cssVars/prepareCssVars.js +30 -25
  89. package/node/cssVars/prepareTypographyVars.js +17 -0
  90. package/node/cssVars/useCurrentColorScheme.js +18 -12
  91. package/node/index.js +9 -1
  92. package/node/propsToClassKey/propsToClassKey.js +3 -5
  93. package/node/spacing/spacing.js +24 -21
  94. package/node/styleFunctionSx/defaultSxConfig.js +3 -0
  95. package/node/styleFunctionSx/extendSxProp.js +14 -10
  96. package/node/styleFunctionSx/styleFunctionSx.js +2 -1
  97. package/package.json +6 -6
  98. package/propsToClassKey/propsToClassKey.js +3 -5
  99. package/spacing/spacing.js +24 -21
  100. package/styleFunctionSx/defaultSxConfig.js +3 -0
  101. package/styleFunctionSx/extendSxProp.js +14 -10
  102. package/styleFunctionSx/styleFunctionSx.js +2 -1
  103. package/legacy/Box/Box.js +0 -30
  104. package/legacy/Box/boxClasses.js +0 -3
  105. package/legacy/Box/index.js +0 -5
  106. package/legacy/Container/Container.js +0 -61
  107. package/legacy/Container/ContainerProps.js +0 -1
  108. package/legacy/Container/containerClasses.js +0 -7
  109. package/legacy/Container/createContainer.js +0 -140
  110. package/legacy/Container/index.js +0 -5
  111. package/legacy/GlobalStyles/GlobalStyles.js +0 -37
  112. package/legacy/GlobalStyles/index.js +0 -4
  113. package/legacy/RtlProvider/index.js +0 -22
  114. package/legacy/Stack/Stack.js +0 -62
  115. package/legacy/Stack/StackProps.js +0 -1
  116. package/legacy/Stack/createStack.js +0 -180
  117. package/legacy/Stack/index.js +0 -7
  118. package/legacy/Stack/stackClasses.js +0 -7
  119. package/legacy/ThemeProvider/ThemeProvider.js +0 -87
  120. package/legacy/ThemeProvider/index.js +0 -3
  121. package/legacy/Unstable_Grid/Grid.js +0 -177
  122. package/legacy/Unstable_Grid/GridProps.js +0 -1
  123. package/legacy/Unstable_Grid/createGrid.js +0 -184
  124. package/legacy/Unstable_Grid/gridClasses.js +0 -28
  125. package/legacy/Unstable_Grid/gridGenerator.js +0 -216
  126. package/legacy/Unstable_Grid/index.js +0 -8
  127. package/legacy/Unstable_Grid/traverseBreakpoints.js +0 -48
  128. package/legacy/borders/borders.js +0 -51
  129. package/legacy/borders/index.js +0 -4
  130. package/legacy/breakpoints/breakpoints.js +0 -162
  131. package/legacy/breakpoints/index.js +0 -4
  132. package/legacy/colorManipulator/colorManipulator.js +0 -356
  133. package/legacy/colorManipulator/index.js +0 -3
  134. package/legacy/compose/compose.js +0 -32
  135. package/legacy/compose/index.js +0 -3
  136. package/legacy/createBox/createBox.js +0 -38
  137. package/legacy/createBox/index.js +0 -3
  138. package/legacy/createStyled/createStyled.js +0 -250
  139. package/legacy/createStyled/index.js +0 -4
  140. package/legacy/createTheme/applyStyles.js +0 -73
  141. package/legacy/createTheme/createBreakpoints.js +0 -83
  142. package/legacy/createTheme/createSpacing.js +0 -36
  143. package/legacy/createTheme/createTheme.js +0 -49
  144. package/legacy/createTheme/index.js +0 -3
  145. package/legacy/createTheme/shape.js +0 -4
  146. package/legacy/cssGrid/cssGrid.js +0 -91
  147. package/legacy/cssGrid/index.js +0 -4
  148. package/legacy/cssVars/createCssVarsProvider.js +0 -335
  149. package/legacy/cssVars/createCssVarsTheme.js +0 -13
  150. package/legacy/cssVars/createGetCssVar.js +0 -30
  151. package/legacy/cssVars/cssVarsParser.js +0 -140
  152. package/legacy/cssVars/getInitColorSchemeScript.js +0 -28
  153. package/legacy/cssVars/index.js +0 -6
  154. package/legacy/cssVars/prepareCssVars.js +0 -92
  155. package/legacy/cssVars/useCurrentColorScheme.js +0 -237
  156. package/legacy/display/display.js +0 -29
  157. package/legacy/display/index.js +0 -4
  158. package/legacy/flexbox/flexbox.js +0 -43
  159. package/legacy/flexbox/index.js +0 -4
  160. package/legacy/getThemeValue/getThemeValue.js +0 -47
  161. package/legacy/getThemeValue/index.js +0 -4
  162. package/legacy/index.js +0 -72
  163. package/legacy/memoize/index.js +0 -3
  164. package/legacy/memoize/memoize.js +0 -9
  165. package/legacy/merge/index.js +0 -3
  166. package/legacy/merge/merge.js +0 -10
  167. package/legacy/palette/index.js +0 -4
  168. package/legacy/palette/palette.js +0 -26
  169. package/legacy/positions/index.js +0 -4
  170. package/legacy/positions/positions.js +0 -22
  171. package/legacy/propsToClassKey/index.js +0 -3
  172. package/legacy/propsToClassKey/propsToClassKey.js +0 -24
  173. package/legacy/responsivePropType/index.js +0 -3
  174. package/legacy/responsivePropType/responsivePropType.js +0 -3
  175. package/legacy/shadows/index.js +0 -3
  176. package/legacy/shadows/shadows.js +0 -6
  177. package/legacy/sizing/index.js +0 -4
  178. package/legacy/sizing/sizing.js +0 -65
  179. package/legacy/spacing/index.js +0 -4
  180. package/legacy/spacing/spacing.js +0 -158
  181. package/legacy/style/index.js +0 -4
  182. package/legacy/style/style.js +0 -73
  183. package/legacy/styleFunctionSx/defaultSxConfig.js +0 -293
  184. package/legacy/styleFunctionSx/extendSxProp.js +0 -45
  185. package/legacy/styleFunctionSx/index.js +0 -4
  186. package/legacy/styleFunctionSx/styleFunctionSx.js +0 -126
  187. package/legacy/styled/index.js +0 -3
  188. package/legacy/styled/styled.js +0 -3
  189. package/legacy/typography/index.js +0 -4
  190. package/legacy/typography/typography.js +0 -37
  191. package/legacy/useMediaQuery/index.js +0 -2
  192. package/legacy/useMediaQuery/useMediaQuery.js +0 -145
  193. package/legacy/useTheme/index.js +0 -4
  194. package/legacy/useTheme/useTheme.js +0 -10
  195. package/legacy/useThemeProps/getThemeProps.js +0 -10
  196. package/legacy/useThemeProps/index.js +0 -4
  197. package/legacy/useThemeProps/useThemeProps.js +0 -20
  198. package/legacy/useThemeWithoutDefault/index.js +0 -3
  199. package/legacy/useThemeWithoutDefault/useThemeWithoutDefault.js +0 -13
package/cssVars/index.js CHANGED
@@ -3,4 +3,5 @@
3
3
  export { default } from './createCssVarsProvider';
4
4
  export { default as getInitColorSchemeScript } from './getInitColorSchemeScript';
5
5
  export { default as prepareCssVars } from './prepareCssVars';
6
+ export { default as prepareTypographyVars } from './prepareTypographyVars';
6
7
  export { default as createCssVarsTheme } from './createCssVarsTheme';
@@ -1,21 +1,16 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
3
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
- const _excluded = ["getSelector"],
5
- _excluded2 = ["colorSchemes", "components", "defaultColorScheme"];
6
1
  import deepmerge from '@mui/utils/deepmerge';
7
2
  import cssVarsParser from './cssVarsParser';
8
- function prepareCssVars(theme, _ref = {}) {
9
- let {
10
- getSelector
11
- } = _ref,
12
- parserConfig = _objectWithoutPropertiesLoose(_ref, _excluded);
3
+ function prepareCssVars(theme, {
4
+ getSelector,
5
+ ...parserConfig
6
+ } = {}) {
13
7
  // @ts-ignore - ignore components do not exist
14
8
  const {
15
- colorSchemes = {},
16
- defaultColorScheme = 'light'
17
- } = theme,
18
- otherTheme = _objectWithoutPropertiesLoose(theme, _excluded2);
9
+ colorSchemes = {},
10
+ components,
11
+ defaultColorScheme = 'light',
12
+ ...otherTheme
13
+ } = theme;
19
14
  const {
20
15
  vars: rootVars,
21
16
  css: rootCss,
@@ -24,9 +19,9 @@ function prepareCssVars(theme, _ref = {}) {
24
19
  let themeVars = rootVarsWithDefaults;
25
20
  const colorSchemesMap = {};
26
21
  const {
27
- [defaultColorScheme]: defaultScheme
28
- } = colorSchemes,
29
- otherColorSchemes = _objectWithoutPropertiesLoose(colorSchemes, [defaultColorScheme].map(_toPropertyKey));
22
+ [defaultColorScheme]: defaultScheme,
23
+ ...otherColorSchemes
24
+ } = colorSchemes;
30
25
  Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {
31
26
  const {
32
27
  vars,
@@ -53,7 +48,9 @@ function prepareCssVars(theme, _ref = {}) {
53
48
  };
54
49
  }
55
50
  const generateThemeVars = () => {
56
- let vars = _extends({}, rootVars);
51
+ let vars = {
52
+ ...rootVars
53
+ };
57
54
  Object.entries(colorSchemesMap).forEach(([, {
58
55
  vars: schemeVars
59
56
  }]) => {
@@ -67,26 +64,34 @@ function prepareCssVars(theme, _ref = {}) {
67
64
  function insertStyleSheet(selector, css) {
68
65
  if (Object.keys(css).length) {
69
66
  stylesheets.push(typeof selector === 'string' ? {
70
- [selector]: _extends({}, css)
67
+ [selector]: {
68
+ ...css
69
+ }
71
70
  } : selector);
72
71
  }
73
72
  }
74
- insertStyleSheet(getSelector?.(undefined, _extends({}, rootCss)) || ':root', rootCss);
73
+ insertStyleSheet(getSelector?.(undefined, {
74
+ ...rootCss
75
+ }) || ':root', rootCss);
75
76
  const {
76
- [colorScheme]: defaultSchemeVal
77
- } = colorSchemesMap,
78
- rest = _objectWithoutPropertiesLoose(colorSchemesMap, [colorScheme].map(_toPropertyKey));
77
+ [colorScheme]: defaultSchemeVal,
78
+ ...rest
79
+ } = colorSchemesMap;
79
80
  if (defaultSchemeVal) {
80
81
  // default color scheme has to come before other color schemes
81
82
  const {
82
83
  css
83
84
  } = defaultSchemeVal;
84
- insertStyleSheet(getSelector?.(colorScheme, _extends({}, css)) || `[${theme.attribute || 'data-color-scheme'}="${colorScheme}"]`, css);
85
+ insertStyleSheet(getSelector?.(colorScheme, {
86
+ ...css
87
+ }) || `[${theme.attribute || 'data-color-scheme'}="${colorScheme}"]`, css);
85
88
  }
86
89
  Object.entries(rest).forEach(([key, {
87
90
  css
88
91
  }]) => {
89
- insertStyleSheet(getSelector?.(key, _extends({}, css)) || `[${theme.attribute || 'data-color-scheme'}="${key}"]`, css);
92
+ insertStyleSheet(getSelector?.(key, {
93
+ ...css
94
+ }) || `[${theme.attribute || 'data-color-scheme'}="${key}"]`, css);
90
95
  });
91
96
  return stylesheets;
92
97
  };
@@ -0,0 +1,8 @@
1
+ type RecordPropertyNames<T> = {
2
+ [K in keyof T]: T[K] extends Function ? never : T[K] extends Record<string, any> ? K : never;
3
+ }[keyof T];
4
+ export type ExtractTypographyTokens<T> = {
5
+ [K in RecordPropertyNames<T>]: string;
6
+ };
7
+ export default function prepareTypographyVars<T extends Record<string, any>>(typography: T): ExtractTypographyTokens<T>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ export default function prepareTypographyVars(typography) {
2
+ const vars = {};
3
+ const entries = Object.entries(typography);
4
+ entries.forEach(entry => {
5
+ const [key, value] = entry;
6
+ if (typeof value === 'object') {
7
+ vars[key] = `${value.fontStyle ? `${value.fontStyle} ` : ''}${value.fontVariant ? `${value.fontVariant} ` : ''}${value.fontWeight ? `${value.fontWeight} ` : ''}${value.fontStretch ? `${value.fontStretch} ` : ''}${value.fontSize || ''}${value.lineHeight ? `/${value.lineHeight} ` : ''}${value.fontFamily || ''}`;
8
+ }
9
+ });
10
+ return vars;
11
+ }
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
3
  import * as React from 'react';
5
4
  import { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from './getInitColorSchemeScript';
6
5
  export function getSystemMode(mode) {
@@ -84,10 +83,11 @@ export default function useCurrentColorScheme(options) {
84
83
  } catch (e) {
85
84
  // Unsupported
86
85
  }
87
- return _extends({}, currentState, {
86
+ return {
87
+ ...currentState,
88
88
  mode: newMode,
89
89
  systemMode: getSystemMode(newMode)
90
- });
90
+ };
91
91
  });
92
92
  }, [modeStorageKey, defaultMode]);
93
93
  const setColorScheme = React.useCallback(value => {
@@ -99,17 +99,20 @@ export default function useCurrentColorScheme(options) {
99
99
  } catch (e) {
100
100
  // Unsupported
101
101
  }
102
- return _extends({}, currentState, {
102
+ return {
103
+ ...currentState,
103
104
  lightColorScheme: defaultLightColorScheme,
104
105
  darkColorScheme: defaultDarkColorScheme
105
- });
106
+ };
106
107
  });
107
108
  } else if (typeof value === 'string') {
108
109
  if (value && !joinedColorSchemes.includes(value)) {
109
110
  console.error(`\`${value}\` does not exist in \`theme.colorSchemes\`.`);
110
111
  } else {
111
112
  setState(currentState => {
112
- const newState = _extends({}, currentState);
113
+ const newState = {
114
+ ...currentState
115
+ };
113
116
  processState(currentState, mode => {
114
117
  try {
115
118
  localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);
@@ -128,7 +131,9 @@ export default function useCurrentColorScheme(options) {
128
131
  }
129
132
  } else {
130
133
  setState(currentState => {
131
- const newState = _extends({}, currentState);
134
+ const newState = {
135
+ ...currentState
136
+ };
132
137
  const newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;
133
138
  const newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;
134
139
  if (newLightColorScheme) {
@@ -168,9 +173,10 @@ export default function useCurrentColorScheme(options) {
168
173
  if (currentState.systemMode === systemMode) {
169
174
  return currentState;
170
175
  }
171
- return _extends({}, currentState, {
176
+ return {
177
+ ...currentState,
172
178
  systemMode
173
- });
179
+ };
174
180
  });
175
181
  }
176
182
  }, [state.mode]);
@@ -222,9 +228,10 @@ export default function useCurrentColorScheme(options) {
222
228
  }
223
229
  return undefined;
224
230
  }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]);
225
- return _extends({}, state, {
231
+ return {
232
+ ...state,
226
233
  colorScheme,
227
234
  setMode,
228
235
  setColorScheme
229
- });
236
+ };
230
237
  }
package/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export * from './borders';
5
5
 
6
6
  export { default as breakpoints, handleBreakpoints, mergeBreakpointsInOrder } from './breakpoints';
7
7
 
8
+ export { default as cssContainerQueries, type CssContainerQueries } from './cssContainerQueries';
9
+
8
10
  export { default as compose } from './compose';
9
11
 
10
12
  export * from './display';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v6.0.0-alpha.0
2
+ * @mui/system v6.0.0-alpha.10
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,6 +11,7 @@ export { default as GlobalStyles } from './GlobalStyles';
11
11
  export { default as borders } from './borders';
12
12
  export * from './borders';
13
13
  export { default as breakpoints } from './breakpoints';
14
+ export { default as cssContainerQueries } from './cssContainerQueries';
14
15
  export { handleBreakpoints, mergeBreakpointsInOrder, resolveBreakpointValues as unstable_resolveBreakpointValues } from './breakpoints';
15
16
  export { default as compose } from './compose';
16
17
  export { default as display } from './display';
@@ -1,6 +1,3 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["className", "component", "disableGutters", "fixed", "maxWidth", "classes"];
4
1
  import * as React from 'react';
5
2
  import PropTypes from 'prop-types';
6
3
  import clsx from 'clsx';
@@ -52,20 +49,20 @@ export default function createContainer(options = {}) {
52
49
  const ContainerRoot = createStyledComponent(({
53
50
  theme,
54
51
  ownerState
55
- }) => _extends({
52
+ }) => ({
56
53
  width: '100%',
57
54
  marginLeft: 'auto',
58
55
  boxSizing: 'border-box',
59
56
  marginRight: 'auto',
60
- display: 'block'
61
- }, !ownerState.disableGutters && {
62
- paddingLeft: theme.spacing(2),
63
- paddingRight: theme.spacing(2),
64
- // @ts-ignore module augmentation fails if custom breakpoints are used
65
- [theme.breakpoints.up('sm')]: {
66
- paddingLeft: theme.spacing(3),
67
- paddingRight: theme.spacing(3)
68
- }
57
+ ...(!ownerState.disableGutters && {
58
+ paddingLeft: theme.spacing(2),
59
+ paddingRight: theme.spacing(2),
60
+ // @ts-ignore module augmentation fails if custom breakpoints are used
61
+ [theme.breakpoints.up('sm')]: {
62
+ paddingLeft: theme.spacing(3),
63
+ paddingRight: theme.spacing(3)
64
+ }
65
+ })
69
66
  }), ({
70
67
  theme,
71
68
  ownerState
@@ -82,51 +79,58 @@ export default function createContainer(options = {}) {
82
79
  }, {}), ({
83
80
  theme,
84
81
  ownerState
85
- }) => _extends({}, ownerState.maxWidth === 'xs' && {
82
+ }) => ({
86
83
  // @ts-ignore module augmentation fails if custom breakpoints are used
87
- [theme.breakpoints.up('xs')]: {
84
+ ...(ownerState.maxWidth === 'xs' && {
88
85
  // @ts-ignore module augmentation fails if custom breakpoints are used
89
- maxWidth: Math.max(theme.breakpoints.values.xs, 444)
90
- }
91
- }, ownerState.maxWidth &&
92
- // @ts-ignore module augmentation fails if custom breakpoints are used
93
- ownerState.maxWidth !== 'xs' && {
86
+ [theme.breakpoints.up('xs')]: {
87
+ // @ts-ignore module augmentation fails if custom breakpoints are used
88
+ maxWidth: Math.max(theme.breakpoints.values.xs, 444)
89
+ }
90
+ }),
91
+ ...(ownerState.maxWidth &&
94
92
  // @ts-ignore module augmentation fails if custom breakpoints are used
95
- [theme.breakpoints.up(ownerState.maxWidth)]: {
93
+ ownerState.maxWidth !== 'xs' && {
96
94
  // @ts-ignore module augmentation fails if custom breakpoints are used
97
- maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
98
- }
95
+ [theme.breakpoints.up(ownerState.maxWidth)]: {
96
+ // @ts-ignore module augmentation fails if custom breakpoints are used
97
+ maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
98
+ }
99
+ })
99
100
  }));
100
101
  const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {
101
102
  const props = useThemeProps(inProps);
102
103
  const {
103
- className,
104
- component = 'div',
105
- disableGutters = false,
106
- fixed = false,
107
- maxWidth = 'lg'
108
- } = props,
109
- other = _objectWithoutPropertiesLoose(props, _excluded);
110
- const ownerState = _extends({}, props, {
104
+ className,
105
+ component = 'div',
106
+ disableGutters = false,
107
+ fixed = false,
108
+ maxWidth = 'lg',
109
+ classes: classesProp,
110
+ ...other
111
+ } = props;
112
+ const ownerState = {
113
+ ...props,
111
114
  component,
112
115
  disableGutters,
113
116
  fixed,
114
117
  maxWidth
115
- });
118
+ };
116
119
 
117
120
  // @ts-ignore module augmentation fails if custom breakpoints are used
118
121
  const classes = useUtilityClasses(ownerState, componentName);
119
122
  return (
120
123
  /*#__PURE__*/
121
124
  // @ts-ignore theme is injected by the styled util
122
- _jsx(ContainerRoot, _extends({
125
+ _jsx(ContainerRoot, {
123
126
  as: component
124
127
  // @ts-ignore module augmentation fails if custom breakpoints are used
125
128
  ,
126
129
  ownerState: ownerState,
127
130
  className: clsx(classes.root, className),
128
- ref: ref
129
- }, other))
131
+ ref: ref,
132
+ ...other
133
+ })
130
134
  );
131
135
  });
132
136
  process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes */ = {
@@ -1,18 +1,15 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["value"];
4
1
  import * as React from 'react';
5
2
  import PropTypes from 'prop-types';
6
3
  import { jsx as _jsx } from "react/jsx-runtime";
7
4
  const RtlContext = /*#__PURE__*/React.createContext();
8
- function RtlProvider(_ref) {
9
- let {
10
- value
11
- } = _ref,
12
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
13
- return /*#__PURE__*/_jsx(RtlContext.Provider, _extends({
14
- value: value ?? true
15
- }, props));
5
+ function RtlProvider({
6
+ value,
7
+ ...props
8
+ }) {
9
+ return /*#__PURE__*/_jsx(RtlContext.Provider, {
10
+ value: value ?? true,
11
+ ...props
12
+ });
16
13
  }
17
14
  process.env.NODE_ENV !== "production" ? RtlProvider.propTypes = {
18
15
  children: PropTypes.node,
@@ -1,6 +1,3 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"];
4
1
  import * as React from 'react';
5
2
  import PropTypes from 'prop-types';
6
3
  import clsx from 'clsx';
@@ -60,17 +57,18 @@ export const style = ({
60
57
  ownerState,
61
58
  theme
62
59
  }) => {
63
- let styles = _extends({
60
+ let styles = {
64
61
  display: 'flex',
65
- flexDirection: 'column'
66
- }, handleBreakpoints({
67
- theme
68
- }, resolveBreakpointValues({
69
- values: ownerState.direction,
70
- breakpoints: theme.breakpoints.values
71
- }), propValue => ({
72
- flexDirection: propValue
73
- })));
62
+ flexDirection: 'column',
63
+ ...handleBreakpoints({
64
+ theme
65
+ }, resolveBreakpointValues({
66
+ values: ownerState.direction,
67
+ breakpoints: theme.breakpoints.values
68
+ }), propValue => ({
69
+ flexDirection: propValue
70
+ }))
71
+ };
74
72
  if (ownerState.spacing) {
75
73
  const transformer = createUnarySpacing(theme);
76
74
  const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
@@ -138,29 +136,29 @@ export default function createStack(options = {}) {
138
136
  const themeProps = useThemeProps(inProps);
139
137
  const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
140
138
  const {
141
- component = 'div',
142
- direction = 'column',
143
- spacing = 0,
144
- divider,
145
- children,
146
- className,
147
- useFlexGap = false
148
- } = props,
149
- other = _objectWithoutPropertiesLoose(props, _excluded);
139
+ component = 'div',
140
+ direction = 'column',
141
+ spacing = 0,
142
+ divider,
143
+ children,
144
+ className,
145
+ useFlexGap = false,
146
+ ...other
147
+ } = props;
150
148
  const ownerState = {
151
149
  direction,
152
150
  spacing,
153
151
  useFlexGap
154
152
  };
155
153
  const classes = useUtilityClasses();
156
- return /*#__PURE__*/_jsx(StackRoot, _extends({
154
+ return /*#__PURE__*/_jsx(StackRoot, {
157
155
  as: component,
158
156
  ownerState: ownerState,
159
157
  ref: ref,
160
- className: clsx(classes.root, className)
161
- }, other, {
158
+ className: clsx(classes.root, className),
159
+ ...other,
162
160
  children: divider ? joinChildren(children, divider) : children
163
- }));
161
+ });
164
162
  });
165
163
  process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
166
164
  children: PropTypes.node,
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
3
  import * as React from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import { ThemeProvider as MuiThemeProvider, useTheme as usePrivateTheme } from '@mui/private-theming';
@@ -15,9 +14,10 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
15
14
  const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
16
15
  if (typeof localTheme === 'function') {
17
16
  const mergedTheme = localTheme(resolvedTheme);
18
- const result = themeId ? _extends({}, upperTheme, {
17
+ const result = themeId ? {
18
+ ...upperTheme,
19
19
  [themeId]: mergedTheme
20
- }) : mergedTheme;
20
+ } : mergedTheme;
21
21
  // must return a function for the private theme to NOT merge with the upper theme.
22
22
  // see the test case "use provided theme from a callback" in ThemeProvider.test.js
23
23
  if (isPrivate) {
@@ -25,9 +25,13 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
25
25
  }
26
26
  return result;
27
27
  }
28
- return themeId ? _extends({}, upperTheme, {
28
+ return themeId ? {
29
+ ...upperTheme,
29
30
  [themeId]: localTheme
30
- }) : _extends({}, upperTheme, localTheme);
31
+ } : {
32
+ ...upperTheme,
33
+ ...localTheme
34
+ };
31
35
  }, [themeId, upperTheme, localTheme, isPrivate]);
32
36
  }
33
37
 
@@ -1,6 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["className", "children", "columns", "container", "component", "direction", "wrap", "spacing", "rowSpacing", "columnSpacing", "disableEqualOverflow", "unstable_level"];
4
1
  import * as React from 'react';
5
2
  import PropTypes from 'prop-types';
6
3
  import clsx from 'clsx';
@@ -60,20 +57,20 @@ export default function createGrid(options = {}) {
60
57
  const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
61
58
  const overflow = React.useContext(GridOverflowContext);
62
59
  const {
63
- className,
64
- children,
65
- columns: columnsProp = 12,
66
- container = false,
67
- component = 'div',
68
- direction = 'row',
69
- wrap = 'wrap',
70
- spacing: spacingProp = 0,
71
- rowSpacing: rowSpacingProp = spacingProp,
72
- columnSpacing: columnSpacingProp = spacingProp,
73
- disableEqualOverflow: themeDisableEqualOverflow,
74
- unstable_level: level = 0
75
- } = props,
76
- rest = _objectWithoutPropertiesLoose(props, _excluded);
60
+ className,
61
+ children,
62
+ columns: columnsProp = 12,
63
+ container = false,
64
+ component = 'div',
65
+ direction = 'row',
66
+ wrap = 'wrap',
67
+ spacing: spacingProp = 0,
68
+ rowSpacing: rowSpacingProp = spacingProp,
69
+ columnSpacing: columnSpacingProp = spacingProp,
70
+ disableEqualOverflow: themeDisableEqualOverflow,
71
+ unstable_level: level = 0,
72
+ ...rest
73
+ } = props;
77
74
  // Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead.
78
75
  let disableEqualOverflow = themeDisableEqualOverflow;
79
76
  if (level && themeDisableEqualOverflow !== undefined) {
@@ -96,7 +93,8 @@ export default function createGrid(options = {}) {
96
93
  const spacing = inProps.spacing ?? (level ? undefined : spacingProp);
97
94
  const rowSpacing = inProps.rowSpacing ?? inProps.spacing ?? (level ? undefined : rowSpacingProp);
98
95
  const columnSpacing = inProps.columnSpacing ?? inProps.spacing ?? (level ? undefined : columnSpacingProp);
99
- const ownerState = _extends({}, props, {
96
+ const ownerState = {
97
+ ...props,
100
98
  level,
101
99
  columns,
102
100
  container,
@@ -110,14 +108,14 @@ export default function createGrid(options = {}) {
110
108
  disableEqualOverflow: disableEqualOverflow ?? overflow ?? false,
111
109
  // use context value if exists.
112
110
  parentDisableEqualOverflow: overflow // for nested grid
113
- });
111
+ };
114
112
  const classes = useUtilityClasses(ownerState, theme);
115
- let result = /*#__PURE__*/_jsx(GridRoot, _extends({
113
+ let result = /*#__PURE__*/_jsx(GridRoot, {
116
114
  ref: ref,
117
115
  as: component,
118
116
  ownerState: ownerState,
119
- className: clsx(classes.root, className)
120
- }, other, {
117
+ className: clsx(classes.root, className),
118
+ ...other,
121
119
  children: React.Children.map(children, child => {
122
120
  if ( /*#__PURE__*/React.isValidElement(child) && isMuiElement(child, ['Grid'])) {
123
121
  return /*#__PURE__*/React.cloneElement(child, {
@@ -126,7 +124,7 @@ export default function createGrid(options = {}) {
126
124
  }
127
125
  return child;
128
126
  })
129
- }));
127
+ });
130
128
  if (disableEqualOverflow !== undefined && disableEqualOverflow !== (overflow ?? false)) {
131
129
  // There are 2 possibilities that should wrap with the GridOverflowContext to communicate with the nested grids:
132
130
  // 1. It is the root grid with `disableEqualOverflow`.
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { traverseBreakpoints } from './traverseBreakpoints';
3
2
  function appendLevel(level) {
4
3
  if (!level) {
@@ -163,23 +162,27 @@ export const generateGridStyles = ({
163
162
  }) => {
164
163
  const getSelfSpacing = createGetSelfSpacing(ownerState);
165
164
  const getParentSpacing = createGetParentSpacing(ownerState);
166
- return _extends({
165
+ return {
167
166
  minWidth: 0,
168
- boxSizing: 'border-box'
169
- }, ownerState.container && _extends({
170
- display: 'flex',
171
- flexWrap: 'wrap'
172
- }, ownerState.wrap && ownerState.wrap !== 'wrap' && {
173
- flexWrap: ownerState.wrap
174
- }, {
175
- margin: `calc(${getSelfSpacing('row')} / -2) calc(${getSelfSpacing('column')} / -2)`
176
- }, ownerState.disableEqualOverflow && {
177
- margin: `calc(${getSelfSpacing('row')} * -1) 0px 0px calc(${getSelfSpacing('column')} * -1)`
178
- }), (!ownerState.container || isNestedContainer(ownerState)) && _extends({
179
- padding: `calc(${getParentSpacing('row')} / 2) calc(${getParentSpacing('column')} / 2)`
180
- }, (ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && {
181
- padding: `${getParentSpacing('row')} 0px 0px ${getParentSpacing('column')}`
182
- }));
167
+ boxSizing: 'border-box',
168
+ ...(ownerState.container && {
169
+ display: 'flex',
170
+ flexWrap: 'wrap',
171
+ ...(ownerState.wrap && ownerState.wrap !== 'wrap' && {
172
+ flexWrap: ownerState.wrap
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
+ })
184
+ })
185
+ };
183
186
  };
184
187
  export const generateSizeClassNames = gridSize => {
185
188
  const classNames = [];