@mui/system 5.14.1 → 5.14.4

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 (49) hide show
  1. package/Box/Box.d.ts +15 -9
  2. package/CHANGELOG.md +253 -4
  3. package/Container/Container.d.ts +13 -13
  4. package/Container/ContainerProps.d.ts +40 -40
  5. package/Container/containerClasses.d.ts +22 -22
  6. package/Container/createContainer.d.ts +18 -18
  7. package/GlobalStyles/GlobalStyles.d.ts +13 -13
  8. package/GlobalStyles/index.d.ts +2 -2
  9. package/Stack/Stack.d.ts +14 -14
  10. package/Stack/StackProps.d.ts +53 -53
  11. package/Stack/createStack.d.ts +21 -21
  12. package/Stack/createStack.js +5 -1
  13. package/Stack/index.d.ts +5 -5
  14. package/Stack/stackClasses.d.ts +8 -8
  15. package/Unstable_Grid/Grid.d.ts +12 -12
  16. package/Unstable_Grid/Grid.js +23 -0
  17. package/Unstable_Grid/GridProps.d.ts +185 -185
  18. package/Unstable_Grid/createGrid.d.ts +11 -11
  19. package/Unstable_Grid/gridClasses.d.ts +20 -20
  20. package/Unstable_Grid/gridGenerator.d.ts +33 -33
  21. package/Unstable_Grid/index.d.ts +6 -6
  22. package/Unstable_Grid/traverseBreakpoints.d.ts +7 -7
  23. package/createStyled.d.ts +6 -6
  24. package/createStyled.js +23 -4
  25. package/createTheme/createSpacing.d.ts +10 -10
  26. package/cssVars/createCssVarsTheme.d.ts +15 -15
  27. package/cssVars/createGetCssVar.d.ts +5 -5
  28. package/cssVars/cssVarsParser.d.ts +64 -64
  29. package/cssVars/getInitColorSchemeScript.d.ts +42 -42
  30. package/cssVars/index.d.ts +5 -5
  31. package/cssVars/prepareCssVars.d.ts +16 -16
  32. package/cssVars/useCurrentColorScheme.d.ts +53 -53
  33. package/esm/Stack/createStack.js +5 -1
  34. package/esm/Unstable_Grid/Grid.js +23 -0
  35. package/esm/createStyled.js +24 -5
  36. package/esm/styleFunctionSx/styleFunctionSx.js +2 -0
  37. package/index.js +1 -1
  38. package/legacy/Stack/createStack.js +5 -2
  39. package/legacy/Unstable_Grid/Grid.js +23 -0
  40. package/legacy/createStyled.js +25 -5
  41. package/legacy/index.js +1 -1
  42. package/legacy/styleFunctionSx/styleFunctionSx.js +2 -0
  43. package/modern/Stack/createStack.js +5 -1
  44. package/modern/Unstable_Grid/Grid.js +23 -0
  45. package/modern/createStyled.js +24 -5
  46. package/modern/index.js +1 -1
  47. package/modern/styleFunctionSx/styleFunctionSx.js +2 -0
  48. package/package.json +4 -4
  49. package/styleFunctionSx/styleFunctionSx.js +2 -0
@@ -1,53 +1,53 @@
1
- export type Mode = 'light' | 'dark' | 'system';
2
- export type SystemMode = Exclude<Mode, 'system'>;
3
- export interface State<SupportedColorScheme extends string> {
4
- /**
5
- * User selected mode.
6
- * Note: on the server, mode is always undefined
7
- */
8
- mode: Mode | undefined;
9
- /**
10
- * Only valid if `mode: 'system'`, either 'light' | 'dark'.
11
- */
12
- systemMode: SystemMode | undefined;
13
- /**
14
- * The color scheme for the light mode.
15
- */
16
- lightColorScheme: SupportedColorScheme;
17
- /**
18
- * The color scheme for the dark mode.
19
- */
20
- darkColorScheme: SupportedColorScheme;
21
- }
22
- export type Result<SupportedColorScheme extends string> = State<SupportedColorScheme> & {
23
- /**
24
- * The current application color scheme. It is always `undefined` on the server.
25
- */
26
- colorScheme: SupportedColorScheme | undefined;
27
- /**
28
- * `mode` is saved to internal state and localStorage
29
- * If `mode` is null, it will be reset to the defaultMode
30
- */
31
- setMode: (mode: Mode | null) => void;
32
- /**
33
- * `colorScheme` is saved to internal state and localStorage
34
- * If `colorScheme` is null, it will be reset to the defaultColorScheme (light | dark)
35
- */
36
- setColorScheme: (colorScheme: SupportedColorScheme | Partial<{
37
- light: SupportedColorScheme | null;
38
- dark: SupportedColorScheme | null;
39
- }> | null) => void;
40
- };
41
- export declare function getSystemMode(mode: undefined | string): SystemMode | undefined;
42
- export declare function getColorScheme<SupportedColorScheme extends string>(state: State<SupportedColorScheme>): SupportedColorScheme | undefined;
43
- interface UseCurrentColoSchemeOptions<SupportedColorScheme extends string> {
44
- defaultLightColorScheme: SupportedColorScheme;
45
- defaultDarkColorScheme: SupportedColorScheme;
46
- supportedColorSchemes: Array<SupportedColorScheme>;
47
- defaultMode?: Mode;
48
- modeStorageKey?: string;
49
- colorSchemeStorageKey?: string;
50
- storageWindow?: Window | null;
51
- }
52
- export default function useCurrentColorScheme<SupportedColorScheme extends string>(options: UseCurrentColoSchemeOptions<SupportedColorScheme>): Result<SupportedColorScheme>;
53
- export {};
1
+ export type Mode = 'light' | 'dark' | 'system';
2
+ export type SystemMode = Exclude<Mode, 'system'>;
3
+ export interface State<SupportedColorScheme extends string> {
4
+ /**
5
+ * User selected mode.
6
+ * Note: on the server, mode is always undefined
7
+ */
8
+ mode: Mode | undefined;
9
+ /**
10
+ * Only valid if `mode: 'system'`, either 'light' | 'dark'.
11
+ */
12
+ systemMode: SystemMode | undefined;
13
+ /**
14
+ * The color scheme for the light mode.
15
+ */
16
+ lightColorScheme: SupportedColorScheme;
17
+ /**
18
+ * The color scheme for the dark mode.
19
+ */
20
+ darkColorScheme: SupportedColorScheme;
21
+ }
22
+ export type Result<SupportedColorScheme extends string> = State<SupportedColorScheme> & {
23
+ /**
24
+ * The current application color scheme. It is always `undefined` on the server.
25
+ */
26
+ colorScheme: SupportedColorScheme | undefined;
27
+ /**
28
+ * `mode` is saved to internal state and localStorage
29
+ * If `mode` is null, it will be reset to the defaultMode
30
+ */
31
+ setMode: (mode: Mode | null) => void;
32
+ /**
33
+ * `colorScheme` is saved to internal state and localStorage
34
+ * If `colorScheme` is null, it will be reset to the defaultColorScheme (light | dark)
35
+ */
36
+ setColorScheme: (colorScheme: SupportedColorScheme | Partial<{
37
+ light: SupportedColorScheme | null;
38
+ dark: SupportedColorScheme | null;
39
+ }> | null) => void;
40
+ };
41
+ export declare function getSystemMode(mode: undefined | string): SystemMode | undefined;
42
+ export declare function getColorScheme<SupportedColorScheme extends string>(state: State<SupportedColorScheme>): SupportedColorScheme | undefined;
43
+ interface UseCurrentColoSchemeOptions<SupportedColorScheme extends string> {
44
+ defaultLightColorScheme: SupportedColorScheme;
45
+ defaultDarkColorScheme: SupportedColorScheme;
46
+ supportedColorSchemes: Array<SupportedColorScheme>;
47
+ defaultMode?: Mode;
48
+ modeStorageKey?: string;
49
+ colorSchemeStorageKey?: string;
50
+ storageWindow?: Window | null;
51
+ }
52
+ export default function useCurrentColorScheme<SupportedColorScheme extends string>(options: UseCurrentColoSchemeOptions<SupportedColorScheme>): Result<SupportedColorScheme>;
53
+ export {};
@@ -101,8 +101,12 @@ export const style = ({
101
101
  };
102
102
  }
103
103
  return {
104
+ // The useFlexGap={false} implement relies on each child to give up control of the margin.
105
+ // We need to reset the margin to avoid double spacing.
106
+ '& > :not(style):not(style)': {
107
+ margin: 0
108
+ },
104
109
  '& > :not(style) ~ :not(style)': {
105
- margin: 0,
106
110
  [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)
107
111
  }
108
112
  };
@@ -111,6 +111,29 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
111
111
  * @ignore
112
112
  */
113
113
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
114
+ /**
115
+ * @internal
116
+ * The level of the grid starts from `0`
117
+ * and increases when the grid nests inside another grid regardless of container or item.
118
+ *
119
+ * ```js
120
+ * <Grid> // level 0
121
+ * <Grid> // level 1
122
+ * <Grid> // level 2
123
+ * <Grid> // level 1
124
+ * ```
125
+ *
126
+ * Only consecutive grid is considered nesting.
127
+ * A grid container will start at `0` if there are non-Grid element above it.
128
+ *
129
+ * ```js
130
+ * <Grid> // level 0
131
+ * <div>
132
+ * <Grid> // level 0
133
+ * <Grid> // level 1
134
+ * ```
135
+ */
136
+ unstable_level: PropTypes.number,
114
137
  /**
115
138
  * Defines the `flex-wrap` style property.
116
139
  * It's applied for all screen sizes.
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
4
4
  /* eslint-disable no-underscore-dangle */
5
5
  import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
6
- import { getDisplayName } from '@mui/utils';
6
+ import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
7
7
  import createTheme from './createTheme';
8
8
  import propsToClassKey from './propsToClassKey';
9
9
  import styleFunctionSx from './styleFunctionSx';
@@ -66,6 +66,9 @@ export function shouldForwardProp(prop) {
66
66
  }
67
67
  export const systemDefaultTheme = createTheme();
68
68
  const lowercaseFirstLetter = string => {
69
+ if (!string) {
70
+ return string;
71
+ }
69
72
  return string.charAt(0).toLowerCase() + string.slice(1);
70
73
  };
71
74
  function resolveTheme({
@@ -75,6 +78,12 @@ function resolveTheme({
75
78
  }) {
76
79
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
77
80
  }
81
+ function defaultOverridesResolver(slot) {
82
+ if (!slot) {
83
+ return null;
84
+ }
85
+ return (props, styles) => styles[slot];
86
+ }
78
87
  export default function createStyled(input = {}) {
79
88
  const {
80
89
  themeId,
@@ -99,21 +108,31 @@ export default function createStyled(input = {}) {
99
108
  slot: componentSlot,
100
109
  skipVariantsResolver: inputSkipVariantsResolver,
101
110
  skipSx: inputSkipSx,
102
- overridesResolver
111
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
112
+ // For more details: https://github.com/mui/material-ui/pull/37908
113
+ overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
103
114
  } = inputOptions,
104
115
  options = _objectWithoutPropertiesLoose(inputOptions, _excluded);
105
116
 
106
117
  // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
107
- const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
118
+ const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
119
+ // TODO v6: remove `Root` in the next major release
120
+ // For more details: https://github.com/mui/material-ui/pull/37908
121
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
108
122
  const skipSx = inputSkipSx || false;
109
123
  let label;
110
124
  if (process.env.NODE_ENV !== 'production') {
111
125
  if (componentName) {
126
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
127
+ // For more details: https://github.com/mui/material-ui/pull/37908
112
128
  label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
113
129
  }
114
130
  }
115
131
  let shouldForwardPropOption = shouldForwardProp;
116
- if (componentSlot === 'Root') {
132
+
133
+ // TODO v6: remove `Root` in the next major release
134
+ // For more details: https://github.com/mui/material-ui/pull/37908
135
+ if (componentSlot === 'Root' || componentSlot === 'root') {
117
136
  shouldForwardPropOption = rootShouldForwardProp;
118
137
  } else if (componentSlot) {
119
138
  // any other slot specified
@@ -195,7 +214,7 @@ export default function createStyled(input = {}) {
195
214
  if (process.env.NODE_ENV !== 'production') {
196
215
  let displayName;
197
216
  if (componentName) {
198
- displayName = `${componentName}${componentSlot || ''}`;
217
+ displayName = `${componentName}${capitalize(componentSlot || '')}`;
199
218
  }
200
219
  if (displayName === undefined) {
201
220
  displayName = `Styled(${getDisplayName(tag)})`;
@@ -34,6 +34,8 @@ export function unstable_createStyleFunctionSx() {
34
34
  if (val == null) {
35
35
  return null;
36
36
  }
37
+
38
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
37
39
  if (themeKey === 'typography' && val === 'inherit') {
38
40
  return {
39
41
  [prop]: val
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.14.1
2
+ * @mui/system v5.14.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -105,9 +105,12 @@ export var style = function style(_ref) {
105
105
  };
106
106
  }
107
107
  return {
108
- '& > :not(style) ~ :not(style)': _defineProperty({
108
+ // The useFlexGap={false} implement relies on each child to give up control of the margin.
109
+ // We need to reset the margin to avoid double spacing.
110
+ '& > :not(style):not(style)': {
109
111
  margin: 0
110
- }, "margin".concat(getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)), getValue(transformer, propValue))
112
+ },
113
+ '& > :not(style) ~ :not(style)': _defineProperty({}, "margin".concat(getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)), getValue(transformer, propValue))
111
114
  };
112
115
  };
113
116
  styles = deepmerge(styles, handleBreakpoints({
@@ -111,6 +111,29 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
111
111
  * @ignore
112
112
  */
113
113
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
114
+ /**
115
+ * @internal
116
+ * The level of the grid starts from `0`
117
+ * and increases when the grid nests inside another grid regardless of container or item.
118
+ *
119
+ * ```js
120
+ * <Grid> // level 0
121
+ * <Grid> // level 1
122
+ * <Grid> // level 2
123
+ * <Grid> // level 1
124
+ * ```
125
+ *
126
+ * Only consecutive grid is considered nesting.
127
+ * A grid container will start at `0` if there are non-Grid element above it.
128
+ *
129
+ * ```js
130
+ * <Grid> // level 0
131
+ * <div>
132
+ * <Grid> // level 0
133
+ * <Grid> // level 1
134
+ * ```
135
+ */
136
+ unstable_level: PropTypes.number,
114
137
  /**
115
138
  * Defines the `flex-wrap` style property.
116
139
  * It's applied for all screen sizes.
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  /* eslint-disable no-underscore-dangle */
6
6
  import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
7
- import { getDisplayName } from '@mui/utils';
7
+ import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
8
8
  import createTheme from './createTheme';
9
9
  import propsToClassKey from './propsToClassKey';
10
10
  import styleFunctionSx from './styleFunctionSx';
@@ -66,6 +66,9 @@ export function shouldForwardProp(prop) {
66
66
  }
67
67
  export var systemDefaultTheme = createTheme();
68
68
  var lowercaseFirstLetter = function lowercaseFirstLetter(string) {
69
+ if (!string) {
70
+ return string;
71
+ }
69
72
  return string.charAt(0).toLowerCase() + string.slice(1);
70
73
  };
71
74
  function resolveTheme(_ref) {
@@ -74,6 +77,14 @@ function resolveTheme(_ref) {
74
77
  themeId = _ref.themeId;
75
78
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
76
79
  }
80
+ function defaultOverridesResolver(slot) {
81
+ if (!slot) {
82
+ return null;
83
+ }
84
+ return function (props, styles) {
85
+ return styles[slot];
86
+ };
87
+ }
77
88
  export default function createStyled() {
78
89
  var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
79
90
  var themeId = input.themeId,
@@ -104,18 +115,27 @@ export default function createStyled() {
104
115
  componentSlot = inputOptions.slot,
105
116
  inputSkipVariantsResolver = inputOptions.skipVariantsResolver,
106
117
  inputSkipSx = inputOptions.skipSx,
107
- overridesResolver = inputOptions.overridesResolver,
118
+ _inputOptions$overrid = inputOptions.overridesResolver,
119
+ overridesResolver = _inputOptions$overrid === void 0 ? defaultOverridesResolver(lowercaseFirstLetter(componentSlot)) : _inputOptions$overrid,
108
120
  options = _objectWithoutProperties(inputOptions, ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"]); // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
109
- var skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
121
+ var skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
122
+ // TODO v6: remove `Root` in the next major release
123
+ // For more details: https://github.com/mui/material-ui/pull/37908
124
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
110
125
  var skipSx = inputSkipSx || false;
111
126
  var label;
112
127
  if (process.env.NODE_ENV !== 'production') {
113
128
  if (componentName) {
129
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
130
+ // For more details: https://github.com/mui/material-ui/pull/37908
114
131
  label = "".concat(componentName, "-").concat(lowercaseFirstLetter(componentSlot || 'Root'));
115
132
  }
116
133
  }
117
134
  var shouldForwardPropOption = shouldForwardProp;
118
- if (componentSlot === 'Root') {
135
+
136
+ // TODO v6: remove `Root` in the next major release
137
+ // For more details: https://github.com/mui/material-ui/pull/37908
138
+ if (componentSlot === 'Root' || componentSlot === 'root') {
119
139
  shouldForwardPropOption = rootShouldForwardProp;
120
140
  } else if (componentSlot) {
121
141
  // any other slot specified
@@ -205,7 +225,7 @@ export default function createStyled() {
205
225
  if (process.env.NODE_ENV !== 'production') {
206
226
  var displayName;
207
227
  if (componentName) {
208
- displayName = "".concat(componentName).concat(componentSlot || '');
228
+ displayName = "".concat(componentName).concat(capitalize(componentSlot || ''));
209
229
  }
210
230
  if (displayName === undefined) {
211
231
  displayName = "Styled(".concat(getDisplayName(tag), ")");
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.14.1
2
+ * @mui/system v5.14.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -38,6 +38,8 @@ export function unstable_createStyleFunctionSx() {
38
38
  if (val == null) {
39
39
  return null;
40
40
  }
41
+
42
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
41
43
  if (themeKey === 'typography' && val === 'inherit') {
42
44
  return _defineProperty({}, prop, val);
43
45
  }
@@ -101,8 +101,12 @@ export const style = ({
101
101
  };
102
102
  }
103
103
  return {
104
+ // The useFlexGap={false} implement relies on each child to give up control of the margin.
105
+ // We need to reset the margin to avoid double spacing.
106
+ '& > :not(style):not(style)': {
107
+ margin: 0
108
+ },
104
109
  '& > :not(style) ~ :not(style)': {
105
- margin: 0,
106
110
  [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)
107
111
  }
108
112
  };
@@ -111,6 +111,29 @@ process.env.NODE_ENV !== "production" ? Grid.propTypes /* remove-proptypes */ =
111
111
  * @ignore
112
112
  */
113
113
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
114
+ /**
115
+ * @internal
116
+ * The level of the grid starts from `0`
117
+ * and increases when the grid nests inside another grid regardless of container or item.
118
+ *
119
+ * ```js
120
+ * <Grid> // level 0
121
+ * <Grid> // level 1
122
+ * <Grid> // level 2
123
+ * <Grid> // level 1
124
+ * ```
125
+ *
126
+ * Only consecutive grid is considered nesting.
127
+ * A grid container will start at `0` if there are non-Grid element above it.
128
+ *
129
+ * ```js
130
+ * <Grid> // level 0
131
+ * <div>
132
+ * <Grid> // level 0
133
+ * <Grid> // level 1
134
+ * ```
135
+ */
136
+ unstable_level: PropTypes.number,
114
137
  /**
115
138
  * Defines the `flex-wrap` style property.
116
139
  * It's applied for all screen sizes.
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
4
4
  /* eslint-disable no-underscore-dangle */
5
5
  import styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';
6
- import { getDisplayName } from '@mui/utils';
6
+ import { getDisplayName, unstable_capitalize as capitalize } from '@mui/utils';
7
7
  import createTheme from './createTheme';
8
8
  import propsToClassKey from './propsToClassKey';
9
9
  import styleFunctionSx from './styleFunctionSx';
@@ -65,6 +65,9 @@ export function shouldForwardProp(prop) {
65
65
  }
66
66
  export const systemDefaultTheme = createTheme();
67
67
  const lowercaseFirstLetter = string => {
68
+ if (!string) {
69
+ return string;
70
+ }
68
71
  return string.charAt(0).toLowerCase() + string.slice(1);
69
72
  };
70
73
  function resolveTheme({
@@ -74,6 +77,12 @@ function resolveTheme({
74
77
  }) {
75
78
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
76
79
  }
80
+ function defaultOverridesResolver(slot) {
81
+ if (!slot) {
82
+ return null;
83
+ }
84
+ return (props, styles) => styles[slot];
85
+ }
77
86
  export default function createStyled(input = {}) {
78
87
  const {
79
88
  themeId,
@@ -98,21 +107,31 @@ export default function createStyled(input = {}) {
98
107
  slot: componentSlot,
99
108
  skipVariantsResolver: inputSkipVariantsResolver,
100
109
  skipSx: inputSkipSx,
101
- overridesResolver
110
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
111
+ // For more details: https://github.com/mui/material-ui/pull/37908
112
+ overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
102
113
  } = inputOptions,
103
114
  options = _objectWithoutPropertiesLoose(inputOptions, _excluded);
104
115
 
105
116
  // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
106
- const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
117
+ const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
118
+ // TODO v6: remove `Root` in the next major release
119
+ // For more details: https://github.com/mui/material-ui/pull/37908
120
+ componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
107
121
  const skipSx = inputSkipSx || false;
108
122
  let label;
109
123
  if (process.env.NODE_ENV !== 'production') {
110
124
  if (componentName) {
125
+ // TODO v6: remove `lowercaseFirstLetter()` in the next major release
126
+ // For more details: https://github.com/mui/material-ui/pull/37908
111
127
  label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
112
128
  }
113
129
  }
114
130
  let shouldForwardPropOption = shouldForwardProp;
115
- if (componentSlot === 'Root') {
131
+
132
+ // TODO v6: remove `Root` in the next major release
133
+ // For more details: https://github.com/mui/material-ui/pull/37908
134
+ if (componentSlot === 'Root' || componentSlot === 'root') {
116
135
  shouldForwardPropOption = rootShouldForwardProp;
117
136
  } else if (componentSlot) {
118
137
  // any other slot specified
@@ -194,7 +213,7 @@ export default function createStyled(input = {}) {
194
213
  if (process.env.NODE_ENV !== 'production') {
195
214
  let displayName;
196
215
  if (componentName) {
197
- displayName = `${componentName}${componentSlot || ''}`;
216
+ displayName = `${componentName}${capitalize(componentSlot || '')}`;
198
217
  }
199
218
  if (displayName === undefined) {
200
219
  displayName = `Styled(${getDisplayName(tag)})`;
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.14.1
2
+ * @mui/system v5.14.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -34,6 +34,8 @@ export function unstable_createStyleFunctionSx() {
34
34
  if (val == null) {
35
35
  return null;
36
36
  }
37
+
38
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
37
39
  if (themeKey === 'typography' && val === 'inherit') {
38
40
  return {
39
41
  [prop]: val
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/system",
3
- "version": "5.14.1",
3
+ "version": "5.14.4",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "CSS utilities for rapidly laying out custom designs.",
@@ -44,11 +44,11 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.22.6",
47
- "@mui/private-theming": "^5.13.7",
47
+ "@mui/private-theming": "^5.14.4",
48
48
  "@mui/styled-engine": "^5.13.2",
49
49
  "@mui/types": "^7.2.4",
50
- "@mui/utils": "^5.14.1",
51
- "clsx": "^1.2.1",
50
+ "@mui/utils": "^5.14.4",
51
+ "clsx": "^2.0.0",
52
52
  "csstype": "^3.1.2",
53
53
  "prop-types": "^15.8.1"
54
54
  },
@@ -42,6 +42,8 @@ function unstable_createStyleFunctionSx() {
42
42
  if (val == null) {
43
43
  return null;
44
44
  }
45
+
46
+ // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
45
47
  if (themeKey === 'typography' && val === 'inherit') {
46
48
  return {
47
49
  [prop]: val