@mui/material 6.1.2 → 6.1.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.
Files changed (58) hide show
  1. package/Badge/Badge.d.ts +2 -2
  2. package/Badge/Badge.js +12 -8
  3. package/CHANGELOG.md +81 -7
  4. package/Grid2/Grid2.d.ts +16 -11
  5. package/Grid2/Grid2.js +29 -11
  6. package/InputBase/InputBase.js +1 -1
  7. package/Modal/useModal.js +6 -0
  8. package/OutlinedInput/OutlinedInput.js +6 -6
  9. package/PigmentGrid/PigmentGrid.d.ts +0 -23
  10. package/PigmentGrid/PigmentGrid.js +0 -23
  11. package/Select/SelectInput.js +1 -1
  12. package/index.js +1 -1
  13. package/modern/Badge/Badge.js +12 -8
  14. package/modern/Grid2/Grid2.js +29 -11
  15. package/modern/InputBase/InputBase.js +1 -1
  16. package/modern/Modal/useModal.js +6 -0
  17. package/modern/OutlinedInput/OutlinedInput.js +6 -6
  18. package/modern/PigmentGrid/PigmentGrid.js +0 -23
  19. package/modern/Select/SelectInput.js +1 -1
  20. package/modern/index.js +1 -1
  21. package/modern/styles/createPalette.js +2 -16
  22. package/modern/styles/createThemeNoVars.js +1 -2
  23. package/modern/styles/index.js +1 -1
  24. package/modern/styles/makeStyles.js +1 -3
  25. package/modern/styles/responsiveFontSizes.js +1 -2
  26. package/modern/styles/withStyles.js +1 -3
  27. package/modern/styles/withTheme.js +1 -3
  28. package/modern/utils/memoTheme.js +3 -24
  29. package/modern/version/index.js +2 -2
  30. package/node/Badge/Badge.js +12 -8
  31. package/node/Grid2/Grid2.js +29 -11
  32. package/node/InputBase/InputBase.js +1 -1
  33. package/node/Modal/useModal.js +6 -0
  34. package/node/OutlinedInput/OutlinedInput.js +6 -6
  35. package/node/PigmentGrid/PigmentGrid.js +0 -23
  36. package/node/Select/SelectInput.js +1 -1
  37. package/node/index.js +1 -1
  38. package/node/styles/createPalette.js +2 -16
  39. package/node/styles/createThemeNoVars.js +1 -2
  40. package/node/styles/index.js +1 -1
  41. package/node/styles/makeStyles.js +1 -3
  42. package/node/styles/responsiveFontSizes.js +1 -2
  43. package/node/styles/withStyles.js +1 -3
  44. package/node/styles/withTheme.js +1 -3
  45. package/node/utils/memoTheme.js +4 -25
  46. package/node/version/index.js +2 -2
  47. package/package.json +6 -6
  48. package/styles/ThemeProviderWithVars.d.ts +1 -1
  49. package/styles/createPalette.js +2 -16
  50. package/styles/createThemeNoVars.js +1 -2
  51. package/styles/index.js +1 -1
  52. package/styles/makeStyles.js +1 -3
  53. package/styles/responsiveFontSizes.js +1 -2
  54. package/styles/withStyles.js +1 -3
  55. package/styles/withTheme.js +1 -3
  56. package/utils/memoTheme.d.ts +4 -10
  57. package/utils/memoTheme.js +3 -24
  58. package/version/index.js +2 -2
@@ -212,24 +212,10 @@ export default function createPalette(palette) {
212
212
  color.main = color[mainShade];
213
213
  }
214
214
  if (!color.hasOwnProperty('main')) {
215
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
216
- The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
215
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
217
216
  }
218
217
  if (typeof color.main !== 'string') {
219
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
220
- \`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
221
-
222
- Did you intend to use one of the following approaches?
223
-
224
- import { green } from "@mui/material/colors";
225
-
226
- const theme1 = createTheme({ palette: {
227
- primary: green,
228
- } });
229
-
230
- const theme2 = createTheme({ palette: {
231
- primary: { main: green[500] },
232
- } });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
218
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
233
219
  }
234
220
  addLightOrDark(color, 'light', lightShade, tonalOffset);
235
221
  addLightOrDark(color, 'dark', darkShade, tonalOffset);
@@ -21,8 +21,7 @@ function createThemeNoVars(options = {}, ...args) {
21
21
  ...other
22
22
  } = options;
23
23
  if (options.vars) {
24
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
25
- Please use another name.` : _formatMuiErrorMessage(20));
24
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.' : _formatMuiErrorMessage(20));
26
25
  }
27
26
  const palette = createPalette(paletteInput);
28
27
  const systemTheme = systemCreateTheme(options);
@@ -6,7 +6,7 @@ export { unstable_createBreakpoints } from '@mui/system/createBreakpoints';
6
6
  // TODO: Remove this function in v6.
7
7
  // eslint-disable-next-line @typescript-eslint/naming-convention
8
8
  export function experimental_sx() {
9
- 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.` : _formatMuiErrorMessage(19));
9
+ 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.' : _formatMuiErrorMessage(19));
10
10
  }
11
11
  export { default as createTheme, createMuiTheme } from "./createTheme.js";
12
12
  export { default as unstable_createMuiStrictModeTheme } from "./createMuiStrictModeTheme.js";
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function makeStyles() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(14));
6
4
  }
@@ -34,8 +34,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
34
34
  lineHeight
35
35
  } = style;
36
36
  if (!isUnitless(lineHeight) && !disableAlign) {
37
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported non-unitless line height with grid alignment.
38
- Use unitless line heights instead.` : _formatMuiErrorMessage(6));
37
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : _formatMuiErrorMessage(6));
39
38
  }
40
39
  if (!isUnitless(lineHeight)) {
41
40
  // make it unitless
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function withStyles() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(15));
6
4
  }
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function withTheme() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(16));
6
4
  }
@@ -1,24 +1,3 @@
1
- // We need to pass an argument as `{ theme }` for PigmentCSS, but we don't want to
2
- // allocate more objects.
3
- const arg = {
4
- theme: undefined
5
- };
6
-
7
- /**
8
- * Memoize style function on theme.
9
- * Intended to be used in styled() calls that only need access to the theme.
10
- */
11
- export default function memoTheme(styleFn) {
12
- let lastValue;
13
- let lastTheme;
14
- return props => {
15
- let value = lastValue;
16
- if (value === undefined || props.theme !== lastTheme) {
17
- arg.theme = props.theme;
18
- value = styleFn(arg);
19
- lastValue = value;
20
- lastTheme = props.theme;
21
- }
22
- return value;
23
- };
24
- }
1
+ import { unstable_memoTheme } from '@mui/system';
2
+ const memoTheme = unstable_memoTheme;
3
+ export default memoTheme;
@@ -1,6 +1,6 @@
1
- export const version = "6.1.2";
1
+ export const version = "6.1.3";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("2");
4
+ export const patch = Number("3");
5
5
  export const prerelease = undefined;
6
6
  export default version;
@@ -217,16 +217,19 @@ const BadgeBadge = (0, _zeroStyled.styled)('span', {
217
217
  }
218
218
  }]
219
219
  })));
220
+ function getAnchorOrigin(anchorOrigin) {
221
+ return {
222
+ vertical: anchorOrigin?.vertical ?? 'top',
223
+ horizontal: anchorOrigin?.horizontal ?? 'right'
224
+ };
225
+ }
220
226
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
221
227
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
222
228
  props: inProps,
223
229
  name: 'MuiBadge'
224
230
  });
225
231
  const {
226
- anchorOrigin: anchorOriginProp = {
227
- vertical: 'top',
228
- horizontal: 'right'
229
- },
232
+ anchorOrigin: anchorOriginProp,
230
233
  className,
231
234
  classes: classesProp,
232
235
  component,
@@ -256,7 +259,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
256
259
  showZero
257
260
  });
258
261
  const prevProps = (0, _usePreviousProps.default)({
259
- anchorOrigin: anchorOriginProp,
262
+ anchorOrigin: getAnchorOrigin(anchorOriginProp),
260
263
  color: colorProp,
261
264
  overlap: overlapProp,
262
265
  variant: variantProp,
@@ -266,9 +269,10 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
266
269
  const {
267
270
  color = colorProp,
268
271
  overlap = overlapProp,
269
- anchorOrigin = anchorOriginProp,
272
+ anchorOrigin: anchorOriginPropProp,
270
273
  variant = variantProp
271
274
  } = invisible ? prevProps : props;
275
+ const anchorOrigin = getAnchorOrigin(anchorOriginPropProp);
272
276
  const displayValue = variant !== 'dot' ? displayValueFromHook : undefined;
273
277
  const ownerState = {
274
278
  ...props,
@@ -327,8 +331,8 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ =
327
331
  * }
328
332
  */
329
333
  anchorOrigin: _propTypes.default.shape({
330
- horizontal: _propTypes.default.oneOf(['left', 'right']).isRequired,
331
- vertical: _propTypes.default.oneOf(['bottom', 'top']).isRequired
334
+ horizontal: _propTypes.default.oneOf(['left', 'right']),
335
+ vertical: _propTypes.default.oneOf(['bottom', 'top'])
332
336
  }),
333
337
  /**
334
338
  * The content rendered within the badge.
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _Grid = require("@mui/system/Grid");
11
+ var _requirePropFactory = _interopRequireDefault(require("../utils/requirePropFactory"));
11
12
  var _styles = require("../styles");
12
13
  /**
13
14
  *
@@ -87,24 +88,29 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
87
88
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
88
89
  /**
89
90
  * @internal
90
- * The level of the grid starts from `0`
91
- * and increases when the grid nests inside another grid regardless of container or item.
91
+ * The level of the grid starts from `0` and increases when the grid nests
92
+ * inside another grid. Nesting is defined as a container Grid being a direct
93
+ * child of a container Grid.
92
94
  *
93
95
  * ```js
94
- * <Grid> // level 0
95
- * <Grid> // level 1
96
- * <Grid> // level 2
97
- * <Grid> // level 1
96
+ * <Grid container> // level 0
97
+ * <Grid container> // level 1
98
+ * <Grid container> // level 2
98
99
  * ```
99
100
  *
100
- * Only consecutive grid is considered nesting.
101
- * A grid container will start at `0` if there are non-Grid element above it.
101
+ * Only consecutive grid is considered nesting. A grid container will start at
102
+ * `0` if there are non-Grid container element above it.
102
103
  *
103
104
  * ```js
104
- * <Grid> // level 0
105
+ * <Grid container> // level 0
105
106
  * <div>
106
- * <Grid> // level 0
107
- * <Grid> // level 1
107
+ * <Grid container> // level 0
108
+ * ```
109
+ *
110
+ * ```js
111
+ * <Grid container> // level 0
112
+ * <Grid>
113
+ * <Grid container> // level 0
108
114
  * ```
109
115
  */
110
116
  unstable_level: _propTypes.default.number,
@@ -115,4 +121,16 @@ process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ =
115
121
  */
116
122
  wrap: _propTypes.default.oneOf(['nowrap', 'wrap-reverse', 'wrap'])
117
123
  } : void 0;
124
+ if (process.env.NODE_ENV !== 'production') {
125
+ const Component = Grid2;
126
+ const requireProp = (0, _requirePropFactory.default)('Grid2', Component);
127
+ // eslint-disable-next-line no-useless-concat
128
+ Component['propTypes' + ''] = {
129
+ // eslint-disable-next-line react/forbid-foreign-prop-types
130
+ ...Component.propTypes,
131
+ direction: requireProp('container'),
132
+ spacing: requireProp('container'),
133
+ wrap: requireProp('container')
134
+ };
135
+ }
118
136
  var _default = exports.default = Grid2;
@@ -381,7 +381,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
381
381
  if (!isControlled) {
382
382
  const element = event.target || inputRef.current;
383
383
  if (element == null) {
384
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Expected valid input target. Did you use a custom \`inputComponent\` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info.` : (0, _formatMuiErrorMessage2.default)(1));
384
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.' : (0, _formatMuiErrorMessage2.default)(1));
385
385
  }
386
386
  checkDirty({
387
387
  value: element.value
@@ -150,6 +150,12 @@ function useModal(parameters) {
150
150
  ...otherHandlers
151
151
  };
152
152
  return {
153
+ /*
154
+ * Marking an element with the role presentation indicates to assistive technology
155
+ * that this element should be ignored; it exists to support the web application and
156
+ * is not meant for humans to interact with directly.
157
+ * https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
158
+ */
153
159
  role: 'presentation',
154
160
  ...externalEventHandlers,
155
161
  onKeyDown: createHandleKeyDown(externalEventHandlers),
@@ -53,6 +53,12 @@ const OutlinedInputRoot = (0, _zeroStyled.styled)(_InputBase.InputBaseRoot, {
53
53
  [`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
54
54
  borderColor: (theme.vars || theme).palette.text.primary
55
55
  },
56
+ // Reset on touch devices, it doesn't add specificity
57
+ '@media (hover: none)': {
58
+ [`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
59
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
60
+ }
61
+ },
56
62
  [`&.${_outlinedInputClasses.default.focused} .${_outlinedInputClasses.default.notchedOutline}`]: {
57
63
  borderWidth: 2
58
64
  },
@@ -69,12 +75,6 @@ const OutlinedInputRoot = (0, _zeroStyled.styled)(_InputBase.InputBaseRoot, {
69
75
  props: {},
70
76
  // to overide the above style
71
77
  style: {
72
- // Reset on touch devices, it doesn't add specificity
73
- '@media (hover: none)': {
74
- [`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
75
- borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
76
- }
77
- },
78
78
  [`&.${_outlinedInputClasses.default.error} .${_outlinedInputClasses.default.notchedOutline}`]: {
79
79
  borderColor: (theme.vars || theme).palette.error.main
80
80
  },
@@ -122,29 +122,6 @@ process.env.NODE_ENV !== "production" ? PigmentGrid.propTypes /* remove-proptype
122
122
  * @ignore
123
123
  */
124
124
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
125
- /**
126
- * @internal
127
- * The level of the grid starts from `0`
128
- * and increases when the grid nests inside another grid regardless of container or item.
129
- *
130
- * ```js
131
- * <Grid> // level 0
132
- * <Grid> // level 1
133
- * <Grid> // level 2
134
- * <Grid> // level 1
135
- * ```
136
- *
137
- * Only consecutive grid is considered nesting.
138
- * A grid container will start at `0` if there are non-Grid element above it.
139
- *
140
- * ```js
141
- * <Grid> // level 0
142
- * <div>
143
- * <Grid> // level 0
144
- * <Grid> // level 1
145
- * ```
146
- */
147
- unstable_level: _propTypes.default.number,
148
125
  /**
149
126
  * Defines the `flex-wrap` style property.
150
127
  * It's applied for all screen sizes.
@@ -354,7 +354,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
354
354
  let selected;
355
355
  if (multiple) {
356
356
  if (!Array.isArray(value)) {
357
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`value\` prop must be an array when using the \`Select\` component with \`multiple\`.` : (0, _formatMuiErrorMessage2.default)(2));
357
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `value` prop must be an array ' + 'when using the `Select` component with `multiple`.' : (0, _formatMuiErrorMessage2.default)(2));
358
358
  }
359
359
  selected = value.some(v => areEqualValues(v, child.props.value));
360
360
  if (selected && computeDisplay) {
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.2
2
+ * @mui/material v6.1.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -221,24 +221,10 @@ function createPalette(palette) {
221
221
  color.main = color[mainShade];
222
222
  }
223
223
  if (!color.hasOwnProperty('main')) {
224
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
225
- The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : (0, _formatMuiErrorMessage2.default)(11, name ? ` (${name})` : '', mainShade));
224
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : (0, _formatMuiErrorMessage2.default)(11, name ? ` (${name})` : '', mainShade));
226
225
  }
227
226
  if (typeof color.main !== 'string') {
228
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
229
- \`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
230
-
231
- Did you intend to use one of the following approaches?
232
-
233
- import { green } from "@mui/material/colors";
234
-
235
- const theme1 = createTheme({ palette: {
236
- primary: green,
237
- } });
238
-
239
- const theme2 = createTheme({ palette: {
240
- primary: { main: green[500] },
241
- } });` : (0, _formatMuiErrorMessage2.default)(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
227
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : (0, _formatMuiErrorMessage2.default)(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
242
228
  }
243
229
  addLightOrDark(color, 'light', lightShade, tonalOffset);
244
230
  addLightOrDark(color, 'dark', darkShade, tonalOffset);
@@ -30,8 +30,7 @@ function createThemeNoVars(options = {}, ...args) {
30
30
  ...other
31
31
  } = options;
32
32
  if (options.vars) {
33
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
34
- Please use another name.` : (0, _formatMuiErrorMessage2.default)(20));
33
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.' : (0, _formatMuiErrorMessage2.default)(20));
35
34
  }
36
35
  const palette = (0, _createPalette.default)(paletteInput);
37
36
  const systemTheme = (0, _createTheme.default)(options);
@@ -351,7 +351,7 @@ var _excludeVariablesFromRoot = _interopRequireDefault(require("./excludeVariabl
351
351
  // TODO: Remove this function in v6.
352
352
  // eslint-disable-next-line @typescript-eslint/naming-convention
353
353
  function experimental_sx() {
354
- 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)(19));
354
+ 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)(19));
355
355
  }
356
356
 
357
357
  // The legacy utilities from @mui/styles
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = makeStyles;
8
8
  var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
9
9
  function makeStyles() {
10
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is no longer exported from @mui/material/styles.
11
- You have to import it from @mui/styles.
12
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _formatMuiErrorMessage2.default)(14));
10
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : (0, _formatMuiErrorMessage2.default)(14));
13
11
  }
@@ -41,8 +41,7 @@ function responsiveFontSizes(themeInput, options = {}) {
41
41
  lineHeight
42
42
  } = style;
43
43
  if (!(0, _cssUtils.isUnitless)(lineHeight) && !disableAlign) {
44
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported non-unitless line height with grid alignment.
45
- Use unitless line heights instead.` : (0, _formatMuiErrorMessage2.default)(6));
44
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : (0, _formatMuiErrorMessage2.default)(6));
46
45
  }
47
46
  if (!(0, _cssUtils.isUnitless)(lineHeight)) {
48
47
  // make it unitless
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = withStyles;
8
8
  var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
9
9
  function withStyles() {
10
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is no longer exported from @mui/material/styles.
11
- You have to import it from @mui/styles.
12
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _formatMuiErrorMessage2.default)(15));
10
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : (0, _formatMuiErrorMessage2.default)(15));
13
11
  }
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = withTheme;
8
8
  var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
9
9
  function withTheme() {
10
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is no longer exported from @mui/material/styles.
11
- You have to import it from @mui/styles.
12
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _formatMuiErrorMessage2.default)(16));
10
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : (0, _formatMuiErrorMessage2.default)(16));
13
11
  }
@@ -3,28 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = memoTheme;
7
- // We need to pass an argument as `{ theme }` for PigmentCSS, but we don't want to
8
- // allocate more objects.
9
- const arg = {
10
- theme: undefined
11
- };
12
-
13
- /**
14
- * Memoize style function on theme.
15
- * Intended to be used in styled() calls that only need access to the theme.
16
- */
17
- function memoTheme(styleFn) {
18
- let lastValue;
19
- let lastTheme;
20
- return props => {
21
- let value = lastValue;
22
- if (value === undefined || props.theme !== lastTheme) {
23
- arg.theme = props.theme;
24
- value = styleFn(arg);
25
- lastValue = value;
26
- lastTheme = props.theme;
27
- }
28
- return value;
29
- };
30
- }
6
+ exports.default = void 0;
7
+ var _system = require("@mui/system");
8
+ const memoTheme = _system.unstable_memoTheme;
9
+ var _default = exports.default = memoTheme;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
7
- const version = exports.version = "6.1.2";
7
+ const version = exports.version = "6.1.3";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("1");
10
- const patch = exports.patch = Number("2");
10
+ const patch = exports.patch = Number("3");
11
11
  const prerelease = exports.prerelease = undefined;
12
12
  var _default = exports.default = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "6.1.2",
3
+ "version": "6.1.3",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
@@ -35,10 +35,10 @@
35
35
  "prop-types": "^15.8.1",
36
36
  "react-is": "^18.3.1",
37
37
  "react-transition-group": "^4.4.5",
38
- "@mui/core-downloads-tracker": "^6.1.2",
39
- "@mui/system": "^6.1.2",
40
- "@mui/types": "^7.2.17",
41
- "@mui/utils": "^6.1.2"
38
+ "@mui/core-downloads-tracker": "^6.1.3",
39
+ "@mui/system": "^6.1.3",
40
+ "@mui/types": "^7.2.18",
41
+ "@mui/utils": "^6.1.3"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@emotion/react": "^11.5.0",
@@ -46,7 +46,7 @@
46
46
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
47
47
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
48
48
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
49
- "@mui/material-pigment-css": "^6.1.2"
49
+ "@mui/material-pigment-css": "^6.1.3"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -46,5 +46,5 @@ export declare const CssVarsProvider: (props: React.PropsWithChildren<Partial<im
46
46
  storageWindow?: Window | null;
47
47
  disableNestedContext?: boolean;
48
48
  disableStyleSheetGeneration?: boolean;
49
- }>) => React.ReactElement<any>;
49
+ }>) => React.JSX.Element;
50
50
  export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
@@ -212,24 +212,10 @@ export default function createPalette(palette) {
212
212
  color.main = color[mainShade];
213
213
  }
214
214
  if (!color.hasOwnProperty('main')) {
215
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
216
- The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
215
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
217
216
  }
218
217
  if (typeof color.main !== 'string') {
219
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
220
- \`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
221
-
222
- Did you intend to use one of the following approaches?
223
-
224
- import { green } from "@mui/material/colors";
225
-
226
- const theme1 = createTheme({ palette: {
227
- primary: green,
228
- } });
229
-
230
- const theme2 = createTheme({ palette: {
231
- primary: { main: green[500] },
232
- } });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
218
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
233
219
  }
234
220
  addLightOrDark(color, 'light', lightShade, tonalOffset);
235
221
  addLightOrDark(color, 'dark', darkShade, tonalOffset);
@@ -21,8 +21,7 @@ function createThemeNoVars(options = {}, ...args) {
21
21
  ...other
22
22
  } = options;
23
23
  if (options.vars) {
24
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
25
- Please use another name.` : _formatMuiErrorMessage(20));
24
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.' : _formatMuiErrorMessage(20));
26
25
  }
27
26
  const palette = createPalette(paletteInput);
28
27
  const systemTheme = systemCreateTheme(options);
package/styles/index.js CHANGED
@@ -6,7 +6,7 @@ export { unstable_createBreakpoints } from '@mui/system/createBreakpoints';
6
6
  // TODO: Remove this function in v6.
7
7
  // eslint-disable-next-line @typescript-eslint/naming-convention
8
8
  export function experimental_sx() {
9
- 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.` : _formatMuiErrorMessage(19));
9
+ 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.' : _formatMuiErrorMessage(19));
10
10
  }
11
11
  export { default as createTheme, createMuiTheme } from "./createTheme.js";
12
12
  export { default as unstable_createMuiStrictModeTheme } from "./createMuiStrictModeTheme.js";
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function makeStyles() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(14));
6
4
  }
@@ -34,8 +34,7 @@ export default function responsiveFontSizes(themeInput, options = {}) {
34
34
  lineHeight
35
35
  } = style;
36
36
  if (!isUnitless(lineHeight) && !disableAlign) {
37
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported non-unitless line height with grid alignment.
38
- Use unitless line heights instead.` : _formatMuiErrorMessage(6));
37
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : _formatMuiErrorMessage(6));
39
38
  }
40
39
  if (!isUnitless(lineHeight)) {
41
40
  // make it unitless
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function withStyles() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(15));
6
4
  }
@@ -1,6 +1,4 @@
1
1
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
2
2
  export default function withTheme() {
3
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is no longer exported from @mui/material/styles.
4
- You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
3
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : _formatMuiErrorMessage(16));
6
4
  }