@mui/system 5.11.9 → 5.11.12
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.spec.d.ts +1 -1
- package/CHANGELOG.md +279 -1
- 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/Stack/Stack.d.ts +13 -13
- package/Stack/Stack.js +5 -0
- package/Stack/StackProps.d.ts +42 -42
- 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 +173 -173
- 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 +5 -5
- package/createBox.spec.d.ts +1 -1
- package/createTheme/createSpacing.d.ts +10 -10
- package/cssVars/createCssVarsProvider.d.ts +0 -8
- package/cssVars/createCssVarsProvider.js +8 -16
- package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
- package/cssVars/createCssVarsTheme.d.ts +10 -0
- package/cssVars/createCssVarsTheme.js +24 -0
- package/cssVars/createGetCssVar.d.ts +5 -5
- package/cssVars/createGetCssVar.js +1 -1
- package/cssVars/cssVarsParser.d.ts +64 -63
- package/cssVars/cssVarsParser.js +4 -1
- package/cssVars/getInitColorSchemeScript.d.ts +42 -42
- package/cssVars/index.d.ts +5 -3
- package/cssVars/index.js +15 -1
- package/cssVars/prepareCssVars.d.ts +11 -0
- package/cssVars/prepareCssVars.js +70 -0
- package/cssVars/useCurrentColorScheme.d.ts +53 -53
- package/esm/Stack/Stack.js +5 -0
- package/esm/cssVars/createCssVarsProvider.js +8 -16
- package/esm/cssVars/createCssVarsTheme.js +16 -0
- package/esm/cssVars/createGetCssVar.js +1 -1
- package/esm/cssVars/cssVarsParser.js +4 -1
- package/esm/cssVars/index.js +3 -1
- package/esm/cssVars/prepareCssVars.js +62 -0
- package/esm/index.js +3 -0
- package/index.d.ts +3 -0
- package/index.js +25 -1
- package/index.spec.d.ts +1 -1
- package/legacy/Stack/Stack.js +5 -0
- package/legacy/cssVars/createCssVarsProvider.js +15 -21
- package/legacy/cssVars/createCssVarsTheme.js +13 -0
- package/legacy/cssVars/createGetCssVar.js +1 -1
- package/legacy/cssVars/cssVarsParser.js +4 -1
- package/legacy/cssVars/index.js +3 -1
- package/legacy/cssVars/prepareCssVars.js +59 -0
- package/legacy/index.js +4 -1
- package/modern/Stack/Stack.js +5 -0
- package/modern/cssVars/createCssVarsProvider.js +8 -16
- package/modern/cssVars/createCssVarsTheme.js +16 -0
- package/modern/cssVars/createGetCssVar.js +1 -1
- package/modern/cssVars/cssVarsParser.js +4 -1
- package/modern/cssVars/index.js +3 -1
- package/modern/cssVars/prepareCssVars.js +62 -0
- package/modern/index.js +4 -1
- package/package.json +5 -5
- package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
|
@@ -105,6 +105,7 @@ export default function cssVarsParser(theme, options) {
|
|
|
105
105
|
} = options || {};
|
|
106
106
|
const css = {};
|
|
107
107
|
const vars = {};
|
|
108
|
+
const varsWithDefaults = {};
|
|
108
109
|
walkObjectDeep(theme, (keys, value, arrayKeys) => {
|
|
109
110
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
110
111
|
if (!shouldSkipGeneratingVar || !shouldSkipGeneratingVar(keys, value)) {
|
|
@@ -114,6 +115,7 @@ export default function cssVarsParser(theme, options) {
|
|
|
114
115
|
[cssVar]: getCssValue(keys, value)
|
|
115
116
|
});
|
|
116
117
|
assignNestedKeys(vars, keys, `var(${cssVar})`, arrayKeys);
|
|
118
|
+
assignNestedKeys(varsWithDefaults, keys, `var(${cssVar}, ${value})`, arrayKeys);
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
}, keys => keys[0] === 'vars' // skip 'vars/*' paths
|
|
@@ -121,6 +123,7 @@ export default function cssVarsParser(theme, options) {
|
|
|
121
123
|
|
|
122
124
|
return {
|
|
123
125
|
css,
|
|
124
|
-
vars
|
|
126
|
+
vars,
|
|
127
|
+
varsWithDefaults
|
|
125
128
|
};
|
|
126
129
|
}
|
package/modern/cssVars/index.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default } from './createCssVarsProvider';
|
|
2
|
-
export { default as getInitColorSchemeScript } from './getInitColorSchemeScript';
|
|
2
|
+
export { default as getInitColorSchemeScript } from './getInitColorSchemeScript';
|
|
3
|
+
export { default as prepareCssVars } from './prepareCssVars';
|
|
4
|
+
export { default as createCssVarsTheme } from './createCssVarsTheme';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
const _excluded = ["colorSchemes", "components"],
|
|
3
|
+
_excluded2 = ["light"];
|
|
4
|
+
import { deepmerge } from '@mui/utils';
|
|
5
|
+
import cssVarsParser from './cssVarsParser';
|
|
6
|
+
function prepareCssVars(theme, parserConfig) {
|
|
7
|
+
// @ts-ignore - ignore components do not exist
|
|
8
|
+
const {
|
|
9
|
+
colorSchemes = {}
|
|
10
|
+
} = theme,
|
|
11
|
+
otherTheme = _objectWithoutPropertiesLoose(theme, _excluded);
|
|
12
|
+
const {
|
|
13
|
+
vars: rootVars,
|
|
14
|
+
css: rootCss,
|
|
15
|
+
varsWithDefaults: rootVarsWithDefaults
|
|
16
|
+
} = cssVarsParser(otherTheme, parserConfig);
|
|
17
|
+
let themeVars = rootVarsWithDefaults;
|
|
18
|
+
const colorSchemesMap = {};
|
|
19
|
+
const {
|
|
20
|
+
light
|
|
21
|
+
} = colorSchemes,
|
|
22
|
+
otherColorSchemes = _objectWithoutPropertiesLoose(colorSchemes, _excluded2);
|
|
23
|
+
Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {
|
|
24
|
+
const {
|
|
25
|
+
vars,
|
|
26
|
+
css,
|
|
27
|
+
varsWithDefaults
|
|
28
|
+
} = cssVarsParser(scheme, parserConfig);
|
|
29
|
+
themeVars = deepmerge(themeVars, varsWithDefaults);
|
|
30
|
+
colorSchemesMap[key] = {
|
|
31
|
+
css,
|
|
32
|
+
vars
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
if (light) {
|
|
36
|
+
// light color scheme vars should be merged last to set as default
|
|
37
|
+
const {
|
|
38
|
+
css,
|
|
39
|
+
vars,
|
|
40
|
+
varsWithDefaults
|
|
41
|
+
} = cssVarsParser(light, parserConfig);
|
|
42
|
+
themeVars = deepmerge(themeVars, varsWithDefaults);
|
|
43
|
+
colorSchemesMap.light = {
|
|
44
|
+
css,
|
|
45
|
+
vars
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const generateCssVars = colorScheme => {
|
|
49
|
+
if (!colorScheme) {
|
|
50
|
+
return {
|
|
51
|
+
css: rootCss,
|
|
52
|
+
vars: rootVars
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return colorSchemesMap[colorScheme];
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
vars: themeVars,
|
|
59
|
+
generateCssVars
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export default prepareCssVars;
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/system v5.11.
|
|
2
|
+
* @mui/system v5.11.12
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -52,6 +52,9 @@ export * from './colorManipulator';
|
|
|
52
52
|
export { default as ThemeProvider } from './ThemeProvider';
|
|
53
53
|
export { default as unstable_createCssVarsProvider } from './cssVars/createCssVarsProvider';
|
|
54
54
|
export { default as unstable_createGetCssVar } from './cssVars/createGetCssVar';
|
|
55
|
+
export { default as unstable_cssVarsParser } from './cssVars/cssVarsParser';
|
|
56
|
+
export { default as unstable_prepareCssVars } from './cssVars/prepareCssVars';
|
|
57
|
+
export { default as unstable_createCssVarsTheme } from './cssVars/createCssVarsTheme';
|
|
55
58
|
export { default as responsivePropType } from './responsivePropType';
|
|
56
59
|
|
|
57
60
|
/** ----------------- */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/system",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "CSS utilities for rapidly laying out custom designs.",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@babel/runtime": "^7.
|
|
47
|
-
"@mui/private-theming": "^5.11.
|
|
48
|
-
"@mui/styled-engine": "^5.11.
|
|
46
|
+
"@babel/runtime": "^7.21.0",
|
|
47
|
+
"@mui/private-theming": "^5.11.12",
|
|
48
|
+
"@mui/styled-engine": "^5.11.11",
|
|
49
49
|
"@mui/types": "^7.2.3",
|
|
50
|
-
"@mui/utils": "^5.11.
|
|
50
|
+
"@mui/utils": "^5.11.12",
|
|
51
51
|
"clsx": "^1.2.1",
|
|
52
52
|
"csstype": "^3.1.1",
|
|
53
53
|
"prop-types": "^15.8.1"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|