@mui/system 5.14.3 → 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.
- package/Box/Box.d.ts +20 -9
- package/CHANGELOG.md +102 -4
- package/Container/Container.d.ts +13 -13
- package/Container/ContainerProps.d.ts +40 -40
- package/Container/containerClasses.d.ts +22 -22
- package/Container/createContainer.d.ts +18 -18
- package/GlobalStyles/GlobalStyles.d.ts +13 -13
- package/GlobalStyles/index.d.ts +2 -2
- package/Stack/Stack.d.ts +14 -14
- package/Stack/StackProps.d.ts +53 -53
- package/Stack/createStack.d.ts +21 -21
- package/Stack/index.d.ts +5 -5
- package/Stack/stackClasses.d.ts +8 -8
- package/Unstable_Grid/Grid.d.ts +12 -12
- package/Unstable_Grid/GridProps.d.ts +185 -185
- package/Unstable_Grid/createGrid.d.ts +11 -11
- package/Unstable_Grid/gridClasses.d.ts +20 -20
- package/Unstable_Grid/gridGenerator.d.ts +33 -33
- package/Unstable_Grid/index.d.ts +6 -6
- package/Unstable_Grid/traverseBreakpoints.d.ts +7 -7
- package/createStyled.d.ts +6 -6
- package/createStyled.js +23 -4
- package/createTheme/createSpacing.d.ts +10 -10
- package/cssVars/createCssVarsTheme.d.ts +15 -15
- package/cssVars/createGetCssVar.d.ts +5 -5
- package/cssVars/cssVarsParser.d.ts +64 -64
- package/cssVars/getInitColorSchemeScript.d.ts +42 -42
- package/cssVars/index.d.ts +5 -5
- package/cssVars/prepareCssVars.d.ts +16 -16
- package/cssVars/useCurrentColorScheme.d.ts +53 -53
- package/esm/createStyled.js +24 -5
- package/esm/styleFunctionSx/styleFunctionSx.js +2 -0
- package/index.js +1 -1
- package/legacy/createStyled.js +25 -5
- package/legacy/index.js +1 -1
- package/legacy/styleFunctionSx/styleFunctionSx.js +2 -0
- package/modern/createStyled.js +24 -5
- package/modern/index.js +1 -1
- package/modern/styleFunctionSx/styleFunctionSx.js +2 -0
- package/package.json +3 -3
- package/styleFunctionSx/styleFunctionSx.js +2 -0
package/modern/createStyled.js
CHANGED
|
@@ -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
|
-
|
|
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 :
|
|
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
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "5.14.
|
|
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,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/runtime": "^7.22.6",
|
|
47
|
-
"@mui/private-theming": "^5.
|
|
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.
|
|
50
|
+
"@mui/utils": "^5.14.4",
|
|
51
51
|
"clsx": "^2.0.0",
|
|
52
52
|
"csstype": "^3.1.2",
|
|
53
53
|
"prop-types": "^15.8.1"
|