@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.
Files changed (60) hide show
  1. package/Box/Box.d.ts +18 -1
  2. package/Box/Box.js +26 -0
  3. package/Box/Box.spec.d.ts +1 -1
  4. package/CHANGELOG.md +225 -0
  5. package/ThemeProvider/ThemeProvider.d.ts +7 -1
  6. package/ThemeProvider/ThemeProvider.js +9 -2
  7. package/createBox.js +0 -26
  8. package/createBox.spec.d.ts +1 -1
  9. package/createStyled.js +3 -1
  10. package/createTheme/createSpacing.d.ts +10 -10
  11. package/cssVars/createCssVarsProvider.d.ts +25 -0
  12. package/cssVars/createCssVarsProvider.js +74 -57
  13. package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
  14. package/cssVars/createGetCssVar.d.ts +5 -5
  15. package/cssVars/cssVarsParser.d.ts +70 -70
  16. package/cssVars/cssVarsParser.js +11 -9
  17. package/cssVars/getInitColorSchemeScript.d.ts +40 -12
  18. package/cssVars/getInitColorSchemeScript.js +4 -3
  19. package/cssVars/index.d.ts +2 -2
  20. package/cssVars/useCurrentColorScheme.d.ts +53 -50
  21. package/cssVars/useCurrentColorScheme.js +17 -7
  22. package/esm/Box/Box.js +25 -0
  23. package/esm/ThemeProvider/ThemeProvider.js +9 -2
  24. package/esm/createBox.js +0 -25
  25. package/esm/createStyled.js +3 -1
  26. package/esm/cssVars/createCssVarsProvider.js +76 -57
  27. package/esm/cssVars/cssVarsParser.js +11 -9
  28. package/esm/cssVars/getInitColorSchemeScript.js +4 -3
  29. package/esm/cssVars/useCurrentColorScheme.js +17 -7
  30. package/esm/spacing.js +3 -1
  31. package/esm/style.js +7 -1
  32. package/index.js +1 -1
  33. package/index.spec.d.ts +1 -1
  34. package/legacy/Box/Box.js +25 -0
  35. package/legacy/ThemeProvider/ThemeProvider.js +9 -2
  36. package/legacy/createBox.js +0 -25
  37. package/legacy/createStyled.js +3 -1
  38. package/legacy/cssVars/createCssVarsProvider.js +83 -55
  39. package/legacy/cssVars/cssVarsParser.js +11 -7
  40. package/legacy/cssVars/getInitColorSchemeScript.js +6 -3
  41. package/legacy/cssVars/useCurrentColorScheme.js +20 -9
  42. package/legacy/index.js +1 -1
  43. package/legacy/spacing.js +3 -1
  44. package/legacy/style.js +5 -1
  45. package/modern/Box/Box.js +25 -0
  46. package/modern/ThemeProvider/ThemeProvider.js +9 -2
  47. package/modern/createBox.js +0 -25
  48. package/modern/createStyled.js +3 -1
  49. package/modern/cssVars/createCssVarsProvider.js +76 -55
  50. package/modern/cssVars/cssVarsParser.js +11 -9
  51. package/modern/cssVars/getInitColorSchemeScript.js +4 -3
  52. package/modern/cssVars/useCurrentColorScheme.js +17 -7
  53. package/modern/index.js +1 -1
  54. package/modern/spacing.js +1 -1
  55. package/modern/style.js +7 -1
  56. package/package.json +5 -5
  57. package/spacing.js +3 -1
  58. package/style.js +7 -1
  59. package/styleFunctionSx/styleFunctionSx.d.ts +3 -1
  60. 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) => acc && acc[item] ? acc[item] : null, obj);
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.6.2",
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.6.2",
48
- "@mui/styled-engine": "^5.6.1",
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.6.1",
50
+ "@mui/utils": "^5.7.0",
51
51
  "clsx": "^1.1.1",
52
52
  "csstype": "^3.0.11",
53
- "prop-types": "^15.7.2"
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
- const themeSpacing = (0, _style.getPath)(theme, themeKey) || defaultValue;
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) => acc && acc[item] ? acc[item] : null, obj);
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
- | Array<boolean | SystemStyleObject<Theme> | ((theme: Theme) => SystemStyleObject<Theme>)>;
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 {};