@mui/system 5.11.12 → 5.11.14

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 (38) hide show
  1. package/Box/Box.spec.d.ts +1 -1
  2. package/CHANGELOG.md +114 -5
  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/Stack/Stack.d.ts +13 -13
  8. package/Stack/StackProps.d.ts +42 -42
  9. package/Stack/createStack.d.ts +21 -21
  10. package/Stack/index.d.ts +5 -5
  11. package/Stack/stackClasses.d.ts +8 -8
  12. package/Unstable_Grid/Grid.d.ts +12 -12
  13. package/Unstable_Grid/GridProps.d.ts +173 -173
  14. package/Unstable_Grid/createGrid.d.ts +11 -11
  15. package/Unstable_Grid/gridClasses.d.ts +20 -20
  16. package/Unstable_Grid/gridGenerator.d.ts +33 -33
  17. package/Unstable_Grid/index.d.ts +5 -5
  18. package/createBox.spec.d.ts +1 -1
  19. package/createTheme/createSpacing.d.ts +10 -10
  20. package/cssVars/createCssVarsProvider.d.ts +0 -42
  21. package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
  22. package/cssVars/createCssVarsTheme.d.ts +13 -10
  23. package/cssVars/createGetCssVar.d.ts +5 -5
  24. package/cssVars/cssVarsParser.d.ts +64 -64
  25. package/cssVars/getInitColorSchemeScript.d.ts +42 -42
  26. package/cssVars/index.d.ts +5 -5
  27. package/cssVars/prepareCssVars.d.ts +14 -11
  28. package/cssVars/useCurrentColorScheme.d.ts +53 -53
  29. package/esm/styleFunctionSx/defaultSxConfig.js +38 -3
  30. package/index.js +1 -1
  31. package/index.spec.d.ts +1 -1
  32. package/legacy/index.js +1 -1
  33. package/legacy/styleFunctionSx/defaultSxConfig.js +38 -3
  34. package/modern/index.js +1 -1
  35. package/modern/styleFunctionSx/defaultSxConfig.js +35 -3
  36. package/package.json +3 -3
  37. package/styleFunctionSx/defaultSxConfig.js +38 -3
  38. package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
@@ -4,11 +4,43 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _utils = require("@mui/utils");
7
8
  var _spacing = require("../spacing");
9
+ var _breakpoints = require("../breakpoints");
8
10
  var _borders = require("../borders");
9
11
  var _cssGrid = require("../cssGrid");
10
12
  var _palette = require("../palette");
11
13
  var _sizing = require("../sizing");
14
+ const createFontStyleFunction = prop => {
15
+ return props => {
16
+ if (props[prop] !== undefined && props[prop] !== null) {
17
+ const styleFromPropValue = propValue => {
18
+ var _props$theme$typograp;
19
+ // fetch the value directly defined in the theme, like fontWeightLight
20
+ let value = (_props$theme$typograp = props.theme.typography) == null ? void 0 : _props$theme$typograp[propValue];
21
+ if (typeof value === 'object') {
22
+ // typography variant was pulled, but these props can't be an object
23
+ value = null;
24
+ }
25
+ if (!value) {
26
+ var _props$theme$typograp2, _props$prop;
27
+ // fetch fontWeightLight when the value is 'light'
28
+ value = (_props$theme$typograp2 = props.theme.typography) == null ? void 0 : _props$theme$typograp2[`${prop}${props[prop] === 'default' || props[prop] === prop ? '' : (0, _utils.unstable_capitalize)((_props$prop = props[prop]) == null ? void 0 : _props$prop.toString())}`];
29
+ }
30
+ if (!value) {
31
+ var _props$theme$typograp3, _props$theme$typograp4, _props$theme$typograp5;
32
+ // fetch the value from the typography variant or default to the propValue
33
+ value = (_props$theme$typograp3 = (_props$theme$typograp4 = props.theme.typography) == null ? void 0 : (_props$theme$typograp5 = _props$theme$typograp4[propValue]) == null ? void 0 : _props$theme$typograp5[prop]) != null ? _props$theme$typograp3 : propValue;
34
+ }
35
+ return {
36
+ [prop]: value
37
+ };
38
+ };
39
+ return (0, _breakpoints.handleBreakpoints)(props, props[prop], styleFromPropValue);
40
+ }
41
+ return null;
42
+ };
43
+ };
12
44
  const defaultSxConfig = {
13
45
  // borders
14
46
  border: {
@@ -267,16 +299,19 @@ const defaultSxConfig = {
267
299
  boxSizing: {},
268
300
  // typography
269
301
  fontFamily: {
270
- themeKey: 'typography'
302
+ themeKey: 'typography',
303
+ style: createFontStyleFunction('fontFamily')
271
304
  },
272
305
  fontSize: {
273
- themeKey: 'typography'
306
+ themeKey: 'typography',
307
+ style: createFontStyleFunction('fontSize')
274
308
  },
275
309
  fontStyle: {
276
310
  themeKey: 'typography'
277
311
  },
278
312
  fontWeight: {
279
- themeKey: 'typography'
313
+ themeKey: 'typography',
314
+ style: createFontStyleFunction('fontWeight')
280
315
  },
281
316
  letterSpacing: {},
282
317
  textTransform: {},
@@ -1 +1 @@
1
- export {};
1
+ export {};