@mui/system 5.6.2 → 5.7.0
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 +18 -1
- package/Box/Box.js +26 -0
- package/Box/Box.spec.d.ts +1 -1
- package/CHANGELOG.md +225 -0
- package/ThemeProvider/ThemeProvider.d.ts +7 -1
- package/ThemeProvider/ThemeProvider.js +9 -2
- package/createBox.js +0 -26
- package/createBox.spec.d.ts +1 -1
- package/createStyled.js +3 -1
- package/createTheme/createSpacing.d.ts +10 -10
- package/cssVars/createCssVarsProvider.d.ts +25 -0
- package/cssVars/createCssVarsProvider.js +74 -57
- package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
- package/cssVars/createGetCssVar.d.ts +5 -5
- package/cssVars/cssVarsParser.d.ts +70 -70
- package/cssVars/cssVarsParser.js +11 -9
- package/cssVars/getInitColorSchemeScript.d.ts +40 -12
- package/cssVars/getInitColorSchemeScript.js +4 -3
- package/cssVars/index.d.ts +2 -2
- package/cssVars/useCurrentColorScheme.d.ts +53 -50
- package/cssVars/useCurrentColorScheme.js +17 -7
- package/esm/Box/Box.js +25 -0
- package/esm/ThemeProvider/ThemeProvider.js +9 -2
- package/esm/createBox.js +0 -25
- package/esm/createStyled.js +3 -1
- package/esm/cssVars/createCssVarsProvider.js +76 -57
- package/esm/cssVars/cssVarsParser.js +11 -9
- package/esm/cssVars/getInitColorSchemeScript.js +4 -3
- package/esm/cssVars/useCurrentColorScheme.js +17 -7
- package/esm/spacing.js +3 -1
- package/esm/style.js +7 -1
- package/index.js +1 -1
- package/index.spec.d.ts +1 -1
- package/legacy/Box/Box.js +25 -0
- package/legacy/ThemeProvider/ThemeProvider.js +9 -2
- package/legacy/createBox.js +0 -25
- package/legacy/createStyled.js +3 -1
- package/legacy/cssVars/createCssVarsProvider.js +83 -55
- package/legacy/cssVars/cssVarsParser.js +11 -7
- package/legacy/cssVars/getInitColorSchemeScript.js +6 -3
- package/legacy/cssVars/useCurrentColorScheme.js +20 -9
- package/legacy/index.js +1 -1
- package/legacy/spacing.js +3 -1
- package/legacy/style.js +5 -1
- package/modern/Box/Box.js +25 -0
- package/modern/ThemeProvider/ThemeProvider.js +9 -2
- package/modern/createBox.js +0 -25
- package/modern/createStyled.js +3 -1
- package/modern/cssVars/createCssVarsProvider.js +76 -55
- package/modern/cssVars/cssVarsParser.js +11 -9
- package/modern/cssVars/getInitColorSchemeScript.js +4 -3
- package/modern/cssVars/useCurrentColorScheme.js +17 -7
- package/modern/index.js +1 -1
- package/modern/spacing.js +1 -1
- package/modern/style.js +7 -1
- package/package.json +5 -5
- package/spacing.js +3 -1
- package/style.js +7 -1
- package/styleFunctionSx/styleFunctionSx.d.ts +3 -1
- package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
package/modern/style.js
CHANGED
|
@@ -15,7 +15,13 @@ export function getPath(obj, path) {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
return path.split('.').reduce((acc, item) =>
|
|
18
|
+
return path.split('.').reduce((acc, item) => {
|
|
19
|
+
if (acc && acc[item] != null) {
|
|
20
|
+
return acc[item];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return null;
|
|
24
|
+
}, obj);
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
function getValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "CSS utilities for rapidly laying out custom designs.",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/runtime": "^7.17.2",
|
|
47
|
-
"@mui/private-theming": "^5.
|
|
48
|
-
"@mui/styled-engine": "^5.
|
|
47
|
+
"@mui/private-theming": "^5.7.0",
|
|
48
|
+
"@mui/styled-engine": "^5.7.0",
|
|
49
49
|
"@mui/types": "^7.1.3",
|
|
50
|
-
"@mui/utils": "^5.
|
|
50
|
+
"@mui/utils": "^5.7.0",
|
|
51
51
|
"clsx": "^1.1.1",
|
|
52
52
|
"csstype": "^3.0.11",
|
|
53
|
-
"prop-types": "^15.
|
|
53
|
+
"prop-types": "^15.8.1"
|
|
54
54
|
},
|
|
55
55
|
"sideEffects": false,
|
|
56
56
|
"publishConfig": {
|
package/spacing.js
CHANGED
|
@@ -64,7 +64,9 @@ const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddin
|
|
|
64
64
|
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
65
65
|
|
|
66
66
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
67
|
-
|
|
67
|
+
var _getPath;
|
|
68
|
+
|
|
69
|
+
const themeSpacing = (_getPath = (0, _style.getPath)(theme, themeKey)) != null ? _getPath : defaultValue;
|
|
68
70
|
|
|
69
71
|
if (typeof themeSpacing === 'number') {
|
|
70
72
|
return abs => {
|
package/style.js
CHANGED
|
@@ -28,7 +28,13 @@ function getPath(obj, path) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
return path.split('.').reduce((acc, item) =>
|
|
31
|
+
return path.split('.').reduce((acc, item) => {
|
|
32
|
+
if (acc && acc[item] != null) {
|
|
33
|
+
return acc[item];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return null;
|
|
37
|
+
}, obj);
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
function getValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
@@ -69,7 +69,9 @@ export type SystemStyleObject<Theme extends object = {}> =
|
|
|
69
69
|
export type SxProps<Theme extends object = {}> =
|
|
70
70
|
| SystemStyleObject<Theme>
|
|
71
71
|
| ((theme: Theme) => SystemStyleObject<Theme>)
|
|
72
|
-
|
|
|
72
|
+
| ReadonlyArray<
|
|
73
|
+
boolean | SystemStyleObject<Theme> | ((theme: Theme) => SystemStyleObject<Theme>)
|
|
74
|
+
>;
|
|
73
75
|
|
|
74
76
|
export interface StyleFunctionSx {
|
|
75
77
|
(props: object): object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|