@mui/system 6.0.0-alpha.6 → 6.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +113 -2
  2. package/Container/createContainer.js +41 -35
  3. package/RtlProvider/index.js +8 -11
  4. package/Stack/createStack.js +24 -26
  5. package/ThemeProvider/ThemeProvider.js +9 -5
  6. package/Unstable_Grid/createGrid.js +21 -23
  7. package/Unstable_Grid/gridGenerator.js +20 -17
  8. package/breakpoints/breakpoints.js +7 -6
  9. package/createBox/createBox.js +9 -12
  10. package/createStyled/createStyled.js +56 -51
  11. package/createTheme/applyStyles.d.ts +1 -1
  12. package/createTheme/applyStyles.js +1 -1
  13. package/createTheme/createBreakpoints.js +24 -25
  14. package/createTheme/createTheme.js +18 -14
  15. package/cssContainerQueries/cssContainerQueries.js +6 -4
  16. package/cssVars/createCssVarsProvider.d.ts +1 -1
  17. package/cssVars/createCssVarsProvider.js +17 -16
  18. package/cssVars/createCssVarsTheme.js +3 -3
  19. package/cssVars/prepareCssVars.js +30 -25
  20. package/cssVars/useCurrentColorScheme.js +18 -11
  21. package/index.js +1 -1
  22. package/modern/Container/createContainer.js +41 -35
  23. package/modern/RtlProvider/index.js +8 -11
  24. package/modern/Stack/createStack.js +24 -26
  25. package/modern/ThemeProvider/ThemeProvider.js +9 -5
  26. package/modern/Unstable_Grid/createGrid.js +21 -23
  27. package/modern/Unstable_Grid/gridGenerator.js +20 -17
  28. package/modern/breakpoints/breakpoints.js +7 -6
  29. package/modern/createBox/createBox.js +9 -12
  30. package/modern/createStyled/createStyled.js +56 -51
  31. package/modern/createTheme/applyStyles.js +1 -1
  32. package/modern/createTheme/createBreakpoints.js +24 -25
  33. package/modern/createTheme/createTheme.js +18 -14
  34. package/modern/cssContainerQueries/cssContainerQueries.js +6 -4
  35. package/modern/cssVars/createCssVarsProvider.js +17 -16
  36. package/modern/cssVars/createCssVarsTheme.js +3 -3
  37. package/modern/cssVars/prepareCssVars.js +30 -25
  38. package/modern/cssVars/useCurrentColorScheme.js +18 -11
  39. package/modern/index.js +1 -1
  40. package/modern/propsToClassKey/propsToClassKey.js +3 -5
  41. package/modern/styleFunctionSx/extendSxProp.js +14 -10
  42. package/node/Container/createContainer.js +41 -35
  43. package/node/RtlProvider/index.js +8 -11
  44. package/node/Stack/createStack.js +24 -26
  45. package/node/ThemeProvider/ThemeProvider.js +9 -5
  46. package/node/Unstable_Grid/createGrid.js +23 -25
  47. package/node/Unstable_Grid/gridGenerator.js +20 -18
  48. package/node/breakpoints/breakpoints.js +7 -6
  49. package/node/createBox/createBox.js +9 -12
  50. package/node/createStyled/createStyled.js +58 -52
  51. package/node/createTheme/applyStyles.js +1 -1
  52. package/node/createTheme/createBreakpoints.js +24 -26
  53. package/node/createTheme/createTheme.js +18 -14
  54. package/node/cssContainerQueries/cssContainerQueries.js +6 -4
  55. package/node/cssVars/createCssVarsProvider.js +17 -16
  56. package/node/cssVars/createCssVarsTheme.js +3 -3
  57. package/node/cssVars/prepareCssVars.js +30 -25
  58. package/node/cssVars/useCurrentColorScheme.js +18 -12
  59. package/node/index.js +1 -1
  60. package/node/propsToClassKey/propsToClassKey.js +3 -5
  61. package/node/styleFunctionSx/extendSxProp.js +14 -10
  62. package/package.json +5 -5
  63. package/propsToClassKey/propsToClassKey.js +3 -5
  64. package/styleFunctionSx/extendSxProp.js +14 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,116 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.9
4
+
5
+ <!-- generated comparing v6.0.0-alpha.8..next -->
6
+
7
+ _May 29, 2024_
8
+
9
+ A big thanks to the 23 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 `CssVarsProvider` and `extendTheme` are now stable (#42246) @siriwatknp
12
+
13
+ ### `@mui/material@6.0.0-alpha.9`
14
+
15
+ - &#8203;<!-- 49 -->[AlertTitle] Enable extending Typography props (#42269) @lucasgmelo
16
+ - &#8203;<!-- 48 -->[AvatarGroup] deprecate `componentsProps` for v6 (#42122) @lhilgert9
17
+ - &#8203;<!-- 15 -->[Grid] Deprecate `wrap` prop (#42363) @fedirjh
18
+ - &#8203;<!-- 14 -->[ListItem] Document `*Component` and `*Props` props deprecations (#42263) @aarongarciah
19
+ - &#8203;<!-- 13 -->[ListItem] Deprecate ListItem's components and componentsProps (#42219) @aarongarciah
20
+ - &#8203;<!-- 12 -->[ListItemSecondaryAction] Deprecate component (#42251) @aarongarciah
21
+ - &#8203;<!-- 11 -->Stabilize `CssVarsProvider` and `extendTheme` (#42246) @siriwatknp
22
+ - &#8203;<!-- 10 -->[Popper] Deprecate components and componentProps props for v6 (#42111) @ChronicusUA
23
+ - &#8203;<!-- 09 -->[responsiveFontSizes] Handled undefined variants (#42412) @brijeshb42
24
+ - &#8203;<!-- 08 -->[Slider] Fix wrong CSS value (#42370) @mnajdova
25
+ - &#8203;<!-- 07 -->[Tooltip] Deprecate components and componentProps props for v6 (#42107) @ChronicusUA
26
+
27
+ ### `@mui/system@6.0.0-alpha.9`
28
+
29
+ - &#8203;<!-- 34 -->[createStyled] Intercept `ownerState` coming from `props` and `ownerState` (#42358) @DiegoAndai
30
+
31
+ ### `@mui/codemod@6.0.0-alpha.9`
32
+
33
+ - &#8203;<!-- 41 -->Add `sx` prop for v6 migration (#42153) @siriwatknp
34
+ - &#8203;<!-- 40 -->Add codemod for removing system props (#42282) @siriwatknp
35
+
36
+ ### Docs
37
+
38
+ - &#8203;<!-- 33 -->Remove unused images (#42324) @danilo-leal
39
+ - &#8203;<!-- 32 -->Add Pigment CSS and Base UI logos SVGs (#42322) @danilo-leal
40
+ - &#8203;<!-- 22 -->[joy-ui] Fix template responsiveness (#42422) @j4marcos
41
+ - &#8203;<!-- 21 -->[material-ui] Add the Pashto locale (#42244) @sayoubiaf
42
+ - &#8203;<!-- 20 -->[material-ui] Remove duplicate Design Kits page (#42338) @danilo-leal
43
+ - &#8203;<!-- 19 -->[material-ui] Document callback to access theme in GlobalStyles (#42257) @aarongarciah
44
+ - &#8203;<!-- 18 -->[material-ui] Add minor modifications to the Vertical stepper demo (#42342) @mihilt
45
+ - &#8203;<!-- 17 -->[material-ui][Tabs] Improve the Basic Tabs demo (#42374) @MatheusEli
46
+ - &#8203;<!-- 16 -->[pigment-css] Polish redirection mention @oliviertassinari
47
+
48
+ ### Core
49
+
50
+ - &#8203;<!-- 47 -->[blog] Add fixes and clean ups to the Blog page (#42311) @danilo-leal
51
+ - &#8203;<!-- 46 -->[blog] Add the "Product" tag to the Pigment CSS post (#42365) @danilo-leal
52
+ - &#8203;<!-- 45 -->[code-infra] Simplify .stylelintrc.js @oliviertassinari
53
+ - &#8203;<!-- 44 -->[code-infra] Fix stylelint locally (#42411) @oliviertassinari
54
+ - &#8203;<!-- 43 -->[code-infra] Run corepack enable on all CI jobs (#42331) @Janpot
55
+ - &#8203;<!-- 42 -->[code-infra] Create examples eslint rule (#42170) @oliviertassinari
56
+ - &#8203;<!-- 39 -->[core] Apply React 19 type changes that don't require upcoming `@types/` packages (#42346) @DiegoAndai
57
+ - &#8203;<!-- 38 -->[core] Remove `react-swipeable-views-utils` package from docs (#42378) @ZeeshanTamboli
58
+ - &#8203;<!-- 37 -->[core] Update `@testing-library/react` and `@testing-library/dom` packages (#42349) @ZeeshanTamboli
59
+ - &#8203;<!-- 36 -->[core] Remove `@types/prettier` package (#42339) @ZeeshanTamboli
60
+ - &#8203;<!-- 35 -->[core] Remove `WyW-in-JS` from Renovate config (#42335) @ZeeshanTamboli
61
+ - &#8203;<!-- 31 -->[docs-infra] Split feedback channels per product (#42413) @alexfauquette
62
+ - &#8203;<!-- 30 -->[docs-infra] Avoid cryptic errors when tests don't exist (#42356) @Janpot
63
+ - &#8203;<!-- 29 -->[docs-infra] Make menu styles consistent (#42387) @danilo-leal
64
+ - &#8203;<!-- 28 -->[docs-infra] Display deprecation messages in API pages (#42352) @aarongarciah
65
+ - &#8203;<!-- 27 -->[docs-infra] Standardize API pages Alert styles (#42386) @danilo-leal
66
+ - &#8203;<!-- 26 -->[docs-infra] Fix Toolpad Core API links (#42362) @apedroferreira
67
+ - &#8203;<!-- 25 -->[docs-infra] Tigthen up the header design (#42180) @danilo-leal
68
+ - &#8203;<!-- 24 -->[docs-infra] Add Toolpad to muiNpmOrgs for codesandbox demos (#42316) @Janpot
69
+ - &#8203;<!-- 23 -->[docs-infra] Allow JSDoc tags (#42337) @aarongarciah
70
+ - &#8203;<!-- 06 -->[test] Remove `userAgent` override in `jsdom` env (#42344) @cherniavskii
71
+ - &#8203;<!-- 05 -->[utils] Fix GitHub-reported prototype pollution vulnerability in `deepmerge` (#41652) @tjcouch-sil
72
+ - &#8203;<!-- 04 -->[website] Add Nikita to the about page (#42418) @nikitaa24
73
+ - &#8203;<!-- 03 -->[website] Fix hero spacing changes applying at the wrong breakpoint (#42341) @KenanYusuf
74
+ - &#8203;<!-- 02 -->[website] Adds Kenan Yusuf to about page (#42317) @KenanYusuf
75
+ - &#8203;<!-- 01 -->[website] Improve about page @oliviertassinari
76
+
77
+ All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @apedroferreira, @brijeshb42, @cherniavskii, @ChronicusUA, @danilo-leal, @DiegoAndai, @fedirjh, @j4marcos, @Janpot, @KenanYusuf, @lhilgert9, @lucasgmelo, @MatheusEli, @mihilt, @mnajdova, @nikitaa24, @oliviertassinari, @sayoubiaf, @siriwatknp, @tjcouch-sil, @ZeeshanTamboli
78
+
79
+ ## v6.0.0-alpha.8
80
+
81
+ <!-- generated comparing v6.0.0-alpha.7..next -->
82
+
83
+ _May 21, 2024_
84
+
85
+ A big thanks to the 7 contributors who made this release possible.
86
+ This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
87
+
88
+ ### `@mui/material@6.0.0-alpha.7`
89
+
90
+ - &#8203;<!-- 04 -->[material-ui] Filter only valid theme palette for generating styles (#42147) @siriwatknp
91
+ - &#8203;<!-- 03 -->[material-ui] Remove UMD bundle (#42172) @ZeeshanTamboli
92
+ - &#8203;<!-- 02 -->[material-ui][TextField] Deprecate `*Props` props (#42062) @DiegoAndai
93
+
94
+ ### Docs
95
+
96
+ - &#8203;<!-- 08 -->[docs] Remove Base UI from the README (#42307) @danilo-leal
97
+ - &#8203;<!-- 07 -->[docs][material-ui] Fix typo in style interoperability with Tailwind CSS docs (#42279) @ZeeshanTamboli
98
+ - &#8203;<!-- 06 -->[docs][material-ui] Add supported browsers section to migration guide (#42194) @DiegoAndai
99
+ - &#8203;<!-- 05 -->[docs][material-ui][Pagination] Clarify pagination `page` prop API (#42220) @Mandar-Pandya
100
+
101
+ ### Core
102
+
103
+ - &#8203;<!-- 12 -->[blog] Update blog post OG image (#42270) @danilo-leal
104
+ - &#8203;<!-- 11 -->[blog] Update Pigment CSS post (#42266) @danilo-leal
105
+ - &#8203;<!-- 10 -->[docs] Remove LocalMonero (#42224) @oliviertassinari
106
+ - &#8203;<!-- 08 -->[docs-infra] Fix keyboard navigation on page tabs (#42152) @danilo-leal
107
+ - &#8203;<!-- 10 -->[code-infra] Remove raw-loader (#42275) @Janpot
108
+ - &#8203;<!-- 09 -->[core] Remove outdated Babel plugins (#42140) @ZeeshanTamboli
109
+ - &#8203;<!-- 12 -->[core] Fix a few more key spread issues (#42168) @oliviertassinari
110
+ - &#8203;<!-- 01 -->[website] Avoid duplicate simple vs. rich (#42100) @oliviertassinari
111
+
112
+ All contributors of this release in alphabetical order: @danilo-leal, @DiegoAndai, @Janpot, @Mandar-Pandya, @oliviertassinari, @siriwatknp, @ZeeshanTamboli
113
+
3
114
  ## v6.0.0-alpha.7
4
115
 
5
116
  <!-- generated comparing v6.0.0-alpha.6..next -->
@@ -53,7 +164,7 @@ All contributors of this release in alphabetical order: @aarongarciah, @alexfauq
53
164
 
54
165
  _May 8, 2024_
55
166
 
56
- A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
167
+ A big thanks to the 10 contributors who made this release possible.
57
168
 
58
169
  ### `@mui/material@6.0.0-alpha.6`
59
170
 
@@ -101,7 +212,7 @@ All contributors of this release in alphabetical order: @aarongarciah, @danilo-l
101
212
 
102
213
  _May 1, 2024_
103
214
 
104
- A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
215
+ A big thanks to the 9 contributors who made this release possible.
105
216
 
106
217
  ### `@mui/material@6.0.0-alpha.5`
107
218
 
@@ -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,22 @@ 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
+ display: 'block',
58
+ // Fix IE11 layout when used with main.
59
+ ...(!ownerState.disableGutters && {
60
+ paddingLeft: theme.spacing(2),
61
+ paddingRight: theme.spacing(2),
62
+ // @ts-ignore module augmentation fails if custom breakpoints are used
63
+ [theme.breakpoints.up('sm')]: {
64
+ paddingLeft: theme.spacing(3),
65
+ paddingRight: theme.spacing(3)
66
+ }
67
+ })
69
68
  }), ({
70
69
  theme,
71
70
  ownerState
@@ -82,51 +81,58 @@ export default function createContainer(options = {}) {
82
81
  }, {}), ({
83
82
  theme,
84
83
  ownerState
85
- }) => _extends({}, ownerState.maxWidth === 'xs' && {
84
+ }) => ({
86
85
  // @ts-ignore module augmentation fails if custom breakpoints are used
87
- [theme.breakpoints.up('xs')]: {
86
+ ...(ownerState.maxWidth === 'xs' && {
88
87
  // @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' && {
88
+ [theme.breakpoints.up('xs')]: {
89
+ // @ts-ignore module augmentation fails if custom breakpoints are used
90
+ maxWidth: Math.max(theme.breakpoints.values.xs, 444)
91
+ }
92
+ }),
93
+ ...(ownerState.maxWidth &&
94
94
  // @ts-ignore module augmentation fails if custom breakpoints are used
95
- [theme.breakpoints.up(ownerState.maxWidth)]: {
95
+ ownerState.maxWidth !== 'xs' && {
96
96
  // @ts-ignore module augmentation fails if custom breakpoints are used
97
- maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
98
- }
97
+ [theme.breakpoints.up(ownerState.maxWidth)]: {
98
+ // @ts-ignore module augmentation fails if custom breakpoints are used
99
+ maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
100
+ }
101
+ })
99
102
  }));
100
103
  const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {
101
104
  const props = useThemeProps(inProps);
102
105
  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, {
106
+ className,
107
+ component = 'div',
108
+ disableGutters = false,
109
+ fixed = false,
110
+ maxWidth = 'lg',
111
+ classes: classesProp,
112
+ ...other
113
+ } = props;
114
+ const ownerState = {
115
+ ...props,
111
116
  component,
112
117
  disableGutters,
113
118
  fixed,
114
119
  maxWidth
115
- });
120
+ };
116
121
 
117
122
  // @ts-ignore module augmentation fails if custom breakpoints are used
118
123
  const classes = useUtilityClasses(ownerState, componentName);
119
124
  return (
120
125
  /*#__PURE__*/
121
126
  // @ts-ignore theme is injected by the styled util
122
- _jsx(ContainerRoot, _extends({
127
+ _jsx(ContainerRoot, {
123
128
  as: component
124
129
  // @ts-ignore module augmentation fails if custom breakpoints are used
125
130
  ,
126
131
  ownerState: ownerState,
127
132
  className: clsx(classes.root, className),
128
- ref: ref
129
- }, other))
133
+ ref: ref,
134
+ ...other
135
+ })
130
136
  );
131
137
  });
132
138
  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 = [];
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import PropTypes from 'prop-types';
3
2
  import deepmerge from '@mui/utils/deepmerge';
4
3
  import merge from '../merge';
@@ -76,21 +75,23 @@ function breakpoints(styleFunction) {
76
75
  const extended = themeBreakpoints.keys.reduce((acc, key) => {
77
76
  if (props[key]) {
78
77
  acc = acc || {};
79
- acc[themeBreakpoints.up(key)] = styleFunction(_extends({
80
- theme
81
- }, props[key]));
78
+ acc[themeBreakpoints.up(key)] = styleFunction({
79
+ theme,
80
+ ...props[key]
81
+ });
82
82
  }
83
83
  return acc;
84
84
  }, null);
85
85
  return merge(base, extended);
86
86
  };
87
- newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {
87
+ newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? {
88
+ ...styleFunction.propTypes,
88
89
  xs: PropTypes.object,
89
90
  sm: PropTypes.object,
90
91
  md: PropTypes.object,
91
92
  lg: PropTypes.object,
92
93
  xl: PropTypes.object
93
- }) : {};
94
+ } : {};
94
95
  newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];
95
96
  return newStyleFunction;
96
97
  }
@@ -1,8 +1,5 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["className", "component"];
6
3
  import * as React from 'react';
7
4
  import clsx from 'clsx';
8
5
  import styled from '@mui/styled-engine';
@@ -21,18 +18,18 @@ export default function createBox(options = {}) {
21
18
  })(styleFunctionSx);
22
19
  const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {
23
20
  const theme = useTheme(defaultTheme);
24
- const _extendSxProp = extendSxProp(inProps),
25
- {
26
- className,
27
- component = 'div'
28
- } = _extendSxProp,
29
- other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded);
30
- return /*#__PURE__*/_jsx(BoxRoot, _extends({
21
+ const {
22
+ className,
23
+ component = 'div',
24
+ ...other
25
+ } = extendSxProp(inProps);
26
+ return /*#__PURE__*/_jsx(BoxRoot, {
31
27
  as: component,
32
28
  ref: ref,
33
29
  className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
34
- theme: themeId ? theme[themeId] || theme : theme
35
- }, other));
30
+ theme: themeId ? theme[themeId] || theme : theme,
31
+ ...other
32
+ });
36
33
  });
37
34
  return Box;
38
35
  }