@mui/system 5.15.1 → 5.15.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,137 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.15.3
4
+
5
+ <!-- generated comparing v5.15.2..master -->
6
+
7
+ _Jan 3, 2024_
8
+
9
+ A big thanks to the 11 contributors who made this release possible.
10
+ This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
11
+
12
+ ### `@mui/material-nextjs@5.15.3`
13
+
14
+ - &#8203;<!-- 06 -->[material-nextjs] Fix order of emotion server (#40409) @siriwatknp
15
+
16
+ ### `@mui/base@5.0.0-beta.30`
17
+
18
+ - &#8203;<!-- 40 -->[useSlider] Rearrange passive option in eventlisteners (#40235) @Kamino0
19
+
20
+ ### `@mui/lab@5.0.0-alpha.159`
21
+
22
+ - &#8203;<!-- 14 -->Add use client directive (#40358) @DiegoAndai
23
+
24
+ ### `@mui/material-next@6.0.0-alpha.116`
25
+
26
+ - &#8203;<!-- 13 -->[List] Copy all List\* components to material-next package (#40367) @sai6855
27
+ - &#8203;<!-- 12 -->Update CONTRIBUTING guide given v6/v7 rescheduling (#40363) @DiegoAndai
28
+ - &#8203;<!-- 11 -->[MenuItem] Fix spec import (#40271) @DiegoAndai
29
+ - &#8203;<!-- 10 -->[Option] Add Option component (#40270) @DiegoAndai
30
+ - &#8203;<!-- 09 -->[Slider] Replace lodash with internal utils (#40261) @DiegoAndai
31
+ - &#8203;<!-- 08 -->[Switch] Change files to TypeScript (#39894) @lhilgert9
32
+ - &#8203;<!-- 07 -->[theme] Move ref palette out of color schemes (#40341) @DiegoAndai
33
+
34
+ ### Docs
35
+
36
+ - &#8203;<!-- 41 -->[base-ui] Polish the Table Pagination demos (#40281) @danilo-leal
37
+ - &#8203;<!-- 22 -->[joy-ui] Fix dashboard template console errors (#40316) @oliviertassinari
38
+ - &#8203;<!-- 21 -->[joy-ui] Fix image size on the Files template (#40315) @oliviertassinari
39
+ - &#8203;<!-- 20 -->[material-ui] Revise the Divider page (#40356) @danilo-leal
40
+ - &#8203;<!-- 19 -->[material-ui] Polish the Next.js integration page (#40317) @oliviertassinari
41
+ - &#8203;<!-- 18 -->[material-ui] Adding autoFocus on Virtual Popover (#40239) @aacevski
42
+ - &#8203;<!-- 17 -->[material-ui] Revise the Roadmap page (#40054) @danilo-leal
43
+ - &#8203;<!-- 16 -->[material-ui] Update the "showing and hiding" section on the Tooltip page (#40283) @anle9650
44
+ - &#8203;<!-- 05 -->[material-ui] Fix Slider's customized iOS demo to use updated official colors (#39813) @Super-Kenil
45
+ - &#8203;<!-- 15 -->[examples] Simplify Next.js example (#40318) @oliviertassinari
46
+
47
+ ### Core
48
+
49
+ - &#8203;<!-- 39 -->[blog] Update open-graph cards for all posts (#40328) @danilo-leal
50
+ - &#8203;<!-- 38 -->[blog] Correct git diff @oliviertassinari
51
+ - &#8203;<!-- 37 -->[code-infra] Update lerna and unpin its version (#40399) @michaldudak
52
+ - &#8203;<!-- 36 -->[code-infra] Break package dependency cycle between @mui/material and @mui/icons-material (#40400) @michaldudak
53
+ - &#8203;<!-- 35 -->[code-infra] Break package dependency cycles (#40398) @michaldudak
54
+ - &#8203;<!-- 34 -->[code-infra] Sync bug issue template (#40305) @oliviertassinari
55
+ - &#8203;<!-- 33 -->[docs] Fix 301 link to Base UI (#40396) @oliviertassinari
56
+ - &#8203;<!-- 32 -->[docs] Link new MUI X components in sidnav (#40345) @oliviertassinari
57
+ - &#8203;<!-- 31 -->[docs] Fix 301 links to Toolpad @oliviertassinari
58
+ - &#8203;<!-- 30 -->[docs] Remove old notifications @oliviertassinari
59
+ - &#8203;<!-- 29 -->[docs] Always mention the npm tag with npx (#40335) @oliviertassinari
60
+ - &#8203;<!-- 28 -->[docs] Reduce network use on the All Components pages (#40313) @oliviertassinari
61
+ - &#8203;<!-- 27 -->[docs-infra] Fix missing button aria-label (#40394) @oliviertassinari
62
+ - &#8203;<!-- 26 -->[docs-infra] Fix a11y violation rule (#40393) @oliviertassinari
63
+ - &#8203;<!-- 25 -->[docs-infra] Prefetch pages on hover (#40314) @oliviertassinari
64
+ - &#8203;<!-- 24 -->[docs-infra] Fix footer links to link to the main domain (#40373) @oliviertassinari
65
+ - &#8203;<!-- 23 -->[docs-infra] Add stray design adjustments (#40347) @danilo-leal
66
+ - &#8203;<!-- 04 -->[website] Fix Base UI page's component section imports & styles (#40231) @danilo-leal
67
+ - &#8203;<!-- 03 -->[website] Fix outdated Nhost image link @oliviertassinari
68
+ - &#8203;<!-- 02 -->[website] Shorten Joy UI description, 7 chars too long @oliviertassinari
69
+ - &#8203;<!-- 01 -->[website] Update some social preview images (#40282) @danilo-leal
70
+
71
+ All contributors of this release in alphabetical order: @aacevski, @anle9650, @danilo-leal, @DiegoAndai, @Kamino0, @lhilgert9, @michaldudak, @oliviertassinari, @sai6855, @siriwatknp, @Super-Kenil
72
+
73
+ ## 5.15.2
74
+
75
+ <!-- generated comparing v5.15.1..master -->
76
+
77
+ _Dec 25, 2023_
78
+
79
+ A big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
80
+
81
+ - 🚀 Added support for callbacks in the [variant's props definition](https://mui.com/material-ui/customization/theme-components/#creating-new-component-variants) (#40094) @mnajdova
82
+ - 💫 Published a [blogpost](https://mui.com/blog/2023-material-ui-v6-and-beyond/) for the 2024's plan about Material UI
83
+
84
+ ### `@mui/material@5.15.2`
85
+
86
+ - &#8203;<!-- 31 -->[Badge] Use the variants API in the styled call (#40213) @mnajdova
87
+ - &#8203;<!-- 04 -->[Paper] Add missing Paper classes descriptions (#40300) @sai6855
88
+
89
+ ### `@mui/system@5.15.2`
90
+
91
+ - &#8203;<!-- 03 -->Support props callback in the variant's definition (#40094) @mnajdova
92
+
93
+ ### `@mui/base@5.0.0-beta.29`
94
+
95
+ - &#8203;<!-- 29 -->[Popup] Use context-based transition API (#39326) @michaldudak
96
+ - &#8203;<!-- 28 -->[Popup] Popup no longer opens outside viewport (#39827) @adamhylander
97
+ - &#8203;<!-- 27 -->[useSelect] Refactor to use DOM focus management instead of active descendant (#39675) @DiegoAndai
98
+
99
+ ### `@mui/material-next@6.0.0-alpha.115`
100
+
101
+ - &#8203;<!-- 15 -->[material-next][Divider]Divider ts support (#40307) @sai6855
102
+
103
+ ### Docs
104
+
105
+ - &#8203;<!-- 30 -->[base-ui] Fix form submission Select demo (#40014) @ZeeshanTamboli
106
+ - &#8203;<!-- 24 -->[blog] Add Material UI v6 and beyond blog post (#40242) @mnajdova
107
+ - &#8203;<!-- 10 -->[material-ui] Fix broken links in the All components page (#40303) @muazaqdas
108
+ - &#8203;<!-- 09 -->[material-ui] Fix broken links on the All components page (#40279) @danilo-leal
109
+ - &#8203;<!-- 08 -->[material-ui] Add aria-current for nav tabs demo (#39594) @Kimzify
110
+ - &#8203;<!-- 07 -->[material-ui] Add an "All components" page (#40256) @danilo-leal
111
+ - &#8203;<!-- 06 -->[material-ui][Tooltip] Add demo to show how to change distance between tooltip and its anchor (#40087) @anle9650
112
+
113
+ ### Core
114
+
115
+ - &#8203;<!-- 26 -->[blog] Fix 301 redirection @oliviertassinari
116
+ - &#8203;<!-- 25 -->[blog] Reduce max image size @oliviertassinari
117
+ - &#8203;<!-- 23 -->[code-infra] Extract Babel macro from mui-utils (#40262) @michaldudak
118
+ - &#8203;<!-- 22 -->[core] Simplify a bit the release instructions @oliviertassinari
119
+ - &#8203;<!-- 21 -->[core] Push force to deploy is not unexpected @oliviertassinari
120
+ - &#8203;<!-- 20 -->[core] Fix CSS2 vs. CSS3 ::after syntax @oliviertassinari
121
+ - &#8203;<!-- 19 -->[core] Fix CSS2 vs. CSS3 ::before syntax @oliviertassinari
122
+ - &#8203;<!-- 05 -->[core] Use direct import from utils package (#40254) @siriwatknp
123
+ - &#8203;<!-- 18 -->[core] Yaml format match most common convention @oliviertassinari
124
+ - &#8203;<!-- 17 -->[core] Polish docs-feedback issue template @oliviertassinari
125
+ - &#8203;<!-- 16 -->[core] Pin Node version on GitHub Actions to 18.18 (#40187) @michaldudak
126
+ - &#8203;<!-- 14 -->[docs] Fix SEO regression (#40306) @oliviertassinari
127
+ - &#8203;<!-- 13 -->[docs] Fix docs redirections @oliviertassinari
128
+ - &#8203;<!-- 12 -->[docs] Update the Contributing guide to give more guidance on documentation (#40274) @samuelsycamore
129
+ - &#8203;<!-- 11 -->[docs-infra] Add polish to the inline code block (#40260) @danilo-leal
130
+ - &#8203;<!-- 02 -->[website] Update Gold sponsors: add RxDB, standardize formatting (#40273) @samuelsycamore
131
+ - &#8203;<!-- 01 -->[website] Revert change to homepage SEO attributes @oliviertassinari
132
+
133
+ All contributors of this release in alphabetical order: @adamhylander, @anle9650, @danilo-leal, @DiegoAndai, @Kimzify, @michaldudak, @mnajdova, @muazaqdas, @oliviertassinari, @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
134
+
3
135
  ## 5.15.1
4
136
 
5
137
  <!-- generated comparing v5.15.0..master -->
@@ -1307,7 +1439,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
1307
1439
  A codemod is provided to help with the migration:
1308
1440
 
1309
1441
  ```bash
1310
- npx @mui/codemod v5.0.0/base-use-named-exports <path>
1442
+ npx @mui/codemod@latest v5.0.0/base-use-named-exports <path>
1311
1443
  ```
1312
1444
 
1313
1445
  #### Changes
@@ -2189,7 +2321,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som
2189
2321
  There is codemod that you can run in your project to do the transformation:
2190
2322
 
2191
2323
  ```bash
2192
- npx @mui/codemod v5.0.0/base-remove-component-prop <path>
2324
+ npx @mui/codemod@latest v5.0.0/base-remove-component-prop <path>
2193
2325
  ```
2194
2326
 
2195
2327
  The full documentation about the codemod can be found [here](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#base-remove-component-prop).
@@ -2288,7 +2420,7 @@ A big thanks to the 12 contributors who made this release possible. Here are som
2288
2420
  You can use this [codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/src/v5.0.0/base-remove-unstyled-suffix.js) to help with the migration:
2289
2421
 
2290
2422
  ```bash
2291
- npx @mui/codemod v5.0.0/base-remove-unstyled-suffix <path>
2423
+ npx @mui/codemod@latest v5.0.0/base-remove-unstyled-suffix <path>
2292
2424
  ```
2293
2425
 
2294
2426
  #### Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MUI System
2
2
 
3
- MUI System is a collection of CSS utilities to help you rapidly lay out custom designs.
3
+ MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.
4
4
 
5
5
  ## Installation
6
6
 
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -20,7 +21,7 @@ exports.private_safeEmphasize = private_safeEmphasize;
20
21
  exports.private_safeLighten = private_safeLighten;
21
22
  exports.recomposeColor = recomposeColor;
22
23
  exports.rgbToHex = rgbToHex;
23
- var _utils = require("@mui/utils");
24
+ var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
24
25
  /* eslint-disable @typescript-eslint/naming-convention */
25
26
 
26
27
  /**
@@ -79,7 +80,7 @@ function decomposeColor(color) {
79
80
  const type = color.substring(0, marker);
80
81
  if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {
81
82
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported \`${color}\` color.
82
- The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _utils.formatMuiErrorMessage)(9, color));
83
+ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));
83
84
  }
84
85
  let values = color.substring(marker + 1, color.length - 1);
85
86
  let colorSpace;
@@ -91,7 +92,7 @@ The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
91
92
  }
92
93
  if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {
93
94
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: unsupported \`${colorSpace}\` color space.
94
- The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _utils.formatMuiErrorMessage)(10, colorSpace));
95
+ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));
95
96
  }
96
97
  } else {
97
98
  values = values.split(',');
package/createStyled.js CHANGED
@@ -37,10 +37,17 @@ const getStyleOverrides = (name, theme) => {
37
37
  return null;
38
38
  };
39
39
  const transformVariants = variants => {
40
+ let numOfCallbacks = 0;
40
41
  const variantsStyles = {};
41
42
  if (variants) {
42
43
  variants.forEach(definition => {
43
- const key = (0, _propsToClassKey.default)(definition.props);
44
+ let key = '';
45
+ if (typeof definition.props === 'function') {
46
+ key = `callback${numOfCallbacks}`;
47
+ numOfCallbacks += 1;
48
+ } else {
49
+ key = (0, _propsToClassKey.default)(definition.props);
50
+ }
44
51
  variantsStyles[key] = definition.style;
45
52
  });
46
53
  }
@@ -58,16 +65,29 @@ const variantsResolver = (props, styles, variants) => {
58
65
  ownerState = {}
59
66
  } = props;
60
67
  const variantsStyles = [];
68
+ let numOfCallbacks = 0;
61
69
  if (variants) {
62
70
  variants.forEach(variant => {
63
71
  let isMatch = true;
64
- Object.keys(variant.props).forEach(key => {
65
- if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
66
- isMatch = false;
67
- }
68
- });
72
+ if (typeof variant.props === 'function') {
73
+ const propsToCheck = (0, _extends2.default)({}, props, ownerState);
74
+ isMatch = variant.props(propsToCheck);
75
+ } else {
76
+ Object.keys(variant.props).forEach(key => {
77
+ if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
78
+ isMatch = false;
79
+ }
80
+ });
81
+ }
69
82
  if (isMatch) {
70
- variantsStyles.push(styles[(0, _propsToClassKey.default)(variant.props)]);
83
+ if (typeof variant.props === 'function') {
84
+ variantsStyles.push(styles[`callback${numOfCallbacks}`]);
85
+ } else {
86
+ variantsStyles.push(styles[(0, _propsToClassKey.default)(variant.props)]);
87
+ }
88
+ }
89
+ if (typeof variant.props === 'function') {
90
+ numOfCallbacks += 1;
71
91
  }
72
92
  });
73
93
  }
@@ -10,4 +10,11 @@ Object.defineProperty(exports, "default", {
10
10
  return _createTheme.default;
11
11
  }
12
12
  });
13
- var _createTheme = _interopRequireDefault(require("./createTheme"));
13
+ Object.defineProperty(exports, "private_createBreakpoints", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _createBreakpoints.default;
17
+ }
18
+ });
19
+ var _createTheme = _interopRequireDefault(require("./createTheme"));
20
+ var _createBreakpoints = _interopRequireDefault(require("./createBreakpoints"));
@@ -8,9 +8,10 @@ exports.DISABLE_CSS_TRANSITION = void 0;
8
8
  exports.default = createCssVarsProvider;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
- var _utils = require("@mui/utils");
11
+ var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _utils = require("@mui/utils");
14
15
  var _styledEngine = require("@mui/styled-engine");
15
16
  var _privateTheming = require("@mui/private-theming");
16
17
  var _ThemeProvider = _interopRequireDefault(require("../ThemeProvider"));
@@ -47,7 +48,7 @@ function createCssVarsProvider(options) {
47
48
  const useColorScheme = () => {
48
49
  const value = React.useContext(ColorSchemeContext);
49
50
  if (!value) {
50
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`useColorScheme\` must be called under <CssVarsProvider />` : (0, _utils.formatMuiErrorMessage)(19));
51
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`useColorScheme\` must be called under <CssVarsProvider />` : (0, _formatMuiErrorMessage2.default)(19));
51
52
  }
52
53
  return value;
53
54
  };
@@ -1,4 +1,4 @@
1
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
1
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  /* eslint-disable @typescript-eslint/naming-convention */
3
3
  /**
4
4
  * Returns a number whose value is limited to the given range.
@@ -26,10 +26,17 @@ const getStyleOverrides = (name, theme) => {
26
26
  return null;
27
27
  };
28
28
  const transformVariants = variants => {
29
+ let numOfCallbacks = 0;
29
30
  const variantsStyles = {};
30
31
  if (variants) {
31
32
  variants.forEach(definition => {
32
- const key = propsToClassKey(definition.props);
33
+ let key = '';
34
+ if (typeof definition.props === 'function') {
35
+ key = `callback${numOfCallbacks}`;
36
+ numOfCallbacks += 1;
37
+ } else {
38
+ key = propsToClassKey(definition.props);
39
+ }
33
40
  variantsStyles[key] = definition.style;
34
41
  });
35
42
  }
@@ -47,16 +54,29 @@ const variantsResolver = (props, styles, variants) => {
47
54
  ownerState = {}
48
55
  } = props;
49
56
  const variantsStyles = [];
57
+ let numOfCallbacks = 0;
50
58
  if (variants) {
51
59
  variants.forEach(variant => {
52
60
  let isMatch = true;
53
- Object.keys(variant.props).forEach(key => {
54
- if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
55
- isMatch = false;
56
- }
57
- });
61
+ if (typeof variant.props === 'function') {
62
+ const propsToCheck = _extends({}, props, ownerState);
63
+ isMatch = variant.props(propsToCheck);
64
+ } else {
65
+ Object.keys(variant.props).forEach(key => {
66
+ if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
67
+ isMatch = false;
68
+ }
69
+ });
70
+ }
58
71
  if (isMatch) {
59
- variantsStyles.push(styles[propsToClassKey(variant.props)]);
72
+ if (typeof variant.props === 'function') {
73
+ variantsStyles.push(styles[`callback${numOfCallbacks}`]);
74
+ } else {
75
+ variantsStyles.push(styles[propsToClassKey(variant.props)]);
76
+ }
77
+ }
78
+ if (typeof variant.props === 'function') {
79
+ numOfCallbacks += 1;
60
80
  }
61
81
  });
62
82
  }
@@ -1 +1,2 @@
1
- export { default } from './createTheme';
1
+ export { default } from './createTheme';
2
+ export { default as private_createBreakpoints } from './createBreakpoints';
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
3
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
4
4
  const _excluded = ["colorSchemes", "components", "generateCssVars", "cssVarPrefix"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
3
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
4
4
  export { css, keyframes, StyledEngineProvider } from '@mui/styled-engine';
5
5
  export { default as GlobalStyles } from './GlobalStyles';
6
6
  export { default as borders } from './borders';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.15.1
2
+ * @mui/system v5.15.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -366,7 +366,7 @@ Object.defineProperty(exports, "useThemeWithoutDefault", {
366
366
  return _useThemeWithoutDefault.default;
367
367
  }
368
368
  });
369
- var _utils = require("@mui/utils");
369
+ var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
370
370
  var _styledEngine = require("@mui/styled-engine");
371
371
  var _GlobalStyles = _interopRequireDefault(require("./GlobalStyles"));
372
372
  var _borders = _interopRequireWildcard(require("./borders"));
@@ -557,7 +557,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
557
557
  // TODO: Remove this function in v6
558
558
  // eslint-disable-next-line @typescript-eslint/naming-convention
559
559
  function experimental_sx() {
560
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`experimental_sx\` has been moved to \`theme.unstable_sx\`.For more details, see https://github.com/mui/material-ui/pull/35150.` : (0, _utils.formatMuiErrorMessage)(20));
560
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`experimental_sx\` has been moved to \`theme.unstable_sx\`.For more details, see https://github.com/mui/material-ui/pull/35150.` : (0, _formatMuiErrorMessage2.default)(20));
561
561
  }
562
562
 
563
563
  /** ----------------- */
@@ -1,4 +1,4 @@
1
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
1
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  /* eslint-disable @typescript-eslint/naming-convention */
3
3
  /**
4
4
  * Returns a number whose value is limited to the given range.
@@ -27,10 +27,17 @@ var getStyleOverrides = function getStyleOverrides(name, theme) {
27
27
  return null;
28
28
  };
29
29
  var transformVariants = function transformVariants(variants) {
30
+ var numOfCallbacks = 0;
30
31
  var variantsStyles = {};
31
32
  if (variants) {
32
33
  variants.forEach(function (definition) {
33
- var key = propsToClassKey(definition.props);
34
+ var key = '';
35
+ if (typeof definition.props === 'function') {
36
+ key = "callback".concat(numOfCallbacks);
37
+ numOfCallbacks += 1;
38
+ } else {
39
+ key = propsToClassKey(definition.props);
40
+ }
34
41
  variantsStyles[key] = definition.style;
35
42
  });
36
43
  }
@@ -47,16 +54,29 @@ var variantsResolver = function variantsResolver(props, styles, variants) {
47
54
  var _props$ownerState = props.ownerState,
48
55
  ownerState = _props$ownerState === void 0 ? {} : _props$ownerState;
49
56
  var variantsStyles = [];
57
+ var numOfCallbacks = 0;
50
58
  if (variants) {
51
59
  variants.forEach(function (variant) {
52
60
  var isMatch = true;
53
- Object.keys(variant.props).forEach(function (key) {
54
- if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
55
- isMatch = false;
56
- }
57
- });
61
+ if (typeof variant.props === 'function') {
62
+ var propsToCheck = _extends({}, props, ownerState);
63
+ isMatch = variant.props(propsToCheck);
64
+ } else {
65
+ Object.keys(variant.props).forEach(function (key) {
66
+ if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
67
+ isMatch = false;
68
+ }
69
+ });
70
+ }
58
71
  if (isMatch) {
59
- variantsStyles.push(styles[propsToClassKey(variant.props)]);
72
+ if (typeof variant.props === 'function') {
73
+ variantsStyles.push(styles["callback".concat(numOfCallbacks)]);
74
+ } else {
75
+ variantsStyles.push(styles[propsToClassKey(variant.props)]);
76
+ }
77
+ }
78
+ if (typeof variant.props === 'function') {
79
+ numOfCallbacks += 1;
60
80
  }
61
81
  });
62
82
  }
@@ -1 +1,2 @@
1
- export { default } from './createTheme';
1
+ export { default } from './createTheme';
2
+ export { default as private_createBreakpoints } from './createBreakpoints';
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  import _typeof from "@babel/runtime/helpers/esm/typeof";
6
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
6
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import { deepmerge } from '@mui/utils';
package/legacy/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.15.1
2
+ * @mui/system v5.15.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -7,7 +7,7 @@
7
7
  */
8
8
  'use client';
9
9
 
10
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
10
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
11
11
  export { css, keyframes, StyledEngineProvider } from '@mui/styled-engine';
12
12
  export { default as GlobalStyles } from './GlobalStyles';
13
13
  export { default as borders } from './borders';
@@ -1,4 +1,4 @@
1
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
1
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  /* eslint-disable @typescript-eslint/naming-convention */
3
3
  /**
4
4
  * Returns a number whose value is limited to the given range.
@@ -26,10 +26,17 @@ const getStyleOverrides = (name, theme) => {
26
26
  return null;
27
27
  };
28
28
  const transformVariants = variants => {
29
+ let numOfCallbacks = 0;
29
30
  const variantsStyles = {};
30
31
  if (variants) {
31
32
  variants.forEach(definition => {
32
- const key = propsToClassKey(definition.props);
33
+ let key = '';
34
+ if (typeof definition.props === 'function') {
35
+ key = `callback${numOfCallbacks}`;
36
+ numOfCallbacks += 1;
37
+ } else {
38
+ key = propsToClassKey(definition.props);
39
+ }
33
40
  variantsStyles[key] = definition.style;
34
41
  });
35
42
  }
@@ -47,16 +54,29 @@ const variantsResolver = (props, styles, variants) => {
47
54
  ownerState = {}
48
55
  } = props;
49
56
  const variantsStyles = [];
57
+ let numOfCallbacks = 0;
50
58
  if (variants) {
51
59
  variants.forEach(variant => {
52
60
  let isMatch = true;
53
- Object.keys(variant.props).forEach(key => {
54
- if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
55
- isMatch = false;
56
- }
57
- });
61
+ if (typeof variant.props === 'function') {
62
+ const propsToCheck = _extends({}, props, ownerState);
63
+ isMatch = variant.props(propsToCheck);
64
+ } else {
65
+ Object.keys(variant.props).forEach(key => {
66
+ if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
67
+ isMatch = false;
68
+ }
69
+ });
70
+ }
58
71
  if (isMatch) {
59
- variantsStyles.push(styles[propsToClassKey(variant.props)]);
72
+ if (typeof variant.props === 'function') {
73
+ variantsStyles.push(styles[`callback${numOfCallbacks}`]);
74
+ } else {
75
+ variantsStyles.push(styles[propsToClassKey(variant.props)]);
76
+ }
77
+ }
78
+ if (typeof variant.props === 'function') {
79
+ numOfCallbacks += 1;
60
80
  }
61
81
  });
62
82
  }
@@ -1 +1,2 @@
1
- export { default } from './createTheme';
1
+ export { default } from './createTheme';
2
+ export { default as private_createBreakpoints } from './createBreakpoints';
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
3
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
4
4
  const _excluded = ["colorSchemes", "components", "generateCssVars", "cssVarPrefix"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/system v5.15.1
2
+ * @mui/system v5.15.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -7,7 +7,7 @@
7
7
  */
8
8
  'use client';
9
9
 
10
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
10
+ import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
11
11
  export { css, keyframes, StyledEngineProvider } from '@mui/styled-engine';
12
12
  export { default as GlobalStyles } from './GlobalStyles';
13
13
  export { default as borders } from './borders';
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@mui/system",
3
- "version": "5.15.1",
3
+ "version": "5.15.3",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
- "description": "CSS utilities for rapidly laying out custom designs.",
6
+ "description": "MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.",
7
7
  "main": "./index.js",
8
8
  "keywords": [
9
9
  "react",
@@ -26,11 +26,11 @@
26
26
  "url": "https://opencollective.com/mui-org"
27
27
  },
28
28
  "dependencies": {
29
- "@babel/runtime": "^7.23.5",
30
- "@mui/private-theming": "^5.15.1",
31
- "@mui/styled-engine": "^5.15.1",
32
- "@mui/types": "^7.2.11",
33
- "@mui/utils": "^5.15.1",
29
+ "@babel/runtime": "^7.23.6",
30
+ "@mui/private-theming": "^5.15.3",
31
+ "@mui/styled-engine": "^5.15.3",
32
+ "@mui/types": "^7.2.12",
33
+ "@mui/utils": "^5.15.3",
34
34
  "clsx": "^2.0.0",
35
35
  "csstype": "^3.1.2",
36
36
  "prop-types": "^15.8.1"