@mui/material 6.1.2 → 6.1.4

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 (70) hide show
  1. package/Badge/Badge.d.ts +2 -2
  2. package/Badge/Badge.js +12 -8
  3. package/CHANGELOG.md +357 -310
  4. package/Checkbox/Checkbox.js +1 -0
  5. package/Grid2/Grid2.d.ts +16 -11
  6. package/Grid2/Grid2.js +29 -11
  7. package/IconButton/IconButton.js +5 -16
  8. package/InputBase/InputBase.js +1 -1
  9. package/Modal/useModal.js +6 -0
  10. package/OutlinedInput/OutlinedInput.js +6 -6
  11. package/PigmentGrid/PigmentGrid.d.ts +0 -23
  12. package/PigmentGrid/PigmentGrid.js +0 -23
  13. package/PigmentHidden/PigmentHidden.js +1 -0
  14. package/Select/SelectInput.js +1 -1
  15. package/Slider/Slider.js +52 -33
  16. package/index.js +1 -1
  17. package/modern/Badge/Badge.js +12 -8
  18. package/modern/Checkbox/Checkbox.js +1 -0
  19. package/modern/Grid2/Grid2.js +29 -11
  20. package/modern/IconButton/IconButton.js +5 -16
  21. package/modern/InputBase/InputBase.js +1 -1
  22. package/modern/Modal/useModal.js +6 -0
  23. package/modern/OutlinedInput/OutlinedInput.js +6 -6
  24. package/modern/PigmentGrid/PigmentGrid.js +0 -23
  25. package/modern/PigmentHidden/PigmentHidden.js +1 -0
  26. package/modern/Select/SelectInput.js +1 -1
  27. package/modern/Slider/Slider.js +52 -33
  28. package/modern/index.js +1 -1
  29. package/modern/styles/createPalette.js +80 -86
  30. package/modern/styles/createThemeNoVars.js +1 -2
  31. package/modern/styles/index.js +1 -1
  32. package/modern/styles/makeStyles.js +1 -3
  33. package/modern/styles/responsiveFontSizes.js +1 -2
  34. package/modern/styles/withStyles.js +1 -3
  35. package/modern/styles/withTheme.js +1 -3
  36. package/modern/utils/memoTheme.js +3 -24
  37. package/modern/version/index.js +2 -2
  38. package/node/Badge/Badge.js +12 -8
  39. package/node/Checkbox/Checkbox.js +1 -0
  40. package/node/Grid2/Grid2.js +29 -11
  41. package/node/IconButton/IconButton.js +5 -16
  42. package/node/InputBase/InputBase.js +1 -1
  43. package/node/Modal/useModal.js +6 -0
  44. package/node/OutlinedInput/OutlinedInput.js +6 -6
  45. package/node/PigmentGrid/PigmentGrid.js +0 -23
  46. package/node/PigmentHidden/PigmentHidden.js +1 -0
  47. package/node/Select/SelectInput.js +1 -1
  48. package/node/Slider/Slider.js +50 -32
  49. package/node/index.js +1 -1
  50. package/node/styles/createPalette.js +80 -86
  51. package/node/styles/createThemeNoVars.js +1 -2
  52. package/node/styles/index.js +1 -1
  53. package/node/styles/makeStyles.js +1 -3
  54. package/node/styles/responsiveFontSizes.js +1 -2
  55. package/node/styles/withStyles.js +1 -3
  56. package/node/styles/withTheme.js +1 -3
  57. package/node/utils/memoTheme.js +4 -25
  58. package/node/version/index.js +2 -2
  59. package/package.json +7 -7
  60. package/styles/ThemeProviderWithVars.d.ts +1 -1
  61. package/styles/createPalette.js +80 -86
  62. package/styles/createThemeNoVars.js +1 -2
  63. package/styles/index.js +1 -1
  64. package/styles/makeStyles.js +1 -3
  65. package/styles/responsiveFontSizes.js +1 -2
  66. package/styles/withStyles.js +1 -3
  67. package/styles/withTheme.js +1 -3
  68. package/utils/memoTheme.d.ts +4 -10
  69. package/utils/memoTheme.js +3 -24
  70. package/version/index.js +2 -2
@@ -56,12 +56,11 @@ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
56
56
  duration: theme.transitions.duration.shortest
57
57
  }),
58
58
  variants: [{
59
- props: {
60
- disableRipple: false
61
- },
59
+ props: props => !props.disableRipple,
62
60
  style: {
61
+ '--IconButton-hoverBg': theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
63
62
  '&:hover': {
64
- backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
63
+ backgroundColor: 'var(--IconButton-hoverBg)',
65
64
  // Reset on touch devices, it doesn't add specificity
66
65
  '@media (hover: none)': {
67
66
  backgroundColor: 'transparent'
@@ -120,17 +119,10 @@ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
120
119
  })), ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()) // check all the used fields in the style below
121
120
  .map(([color]) => ({
122
121
  props: {
123
- color,
124
- disableRipple: false
122
+ color
125
123
  },
126
124
  style: {
127
- '&:hover': {
128
- backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
129
- // Reset on touch devices, it doesn't add specificity
130
- '@media (hover: none)': {
131
- backgroundColor: 'transparent'
132
- }
133
- }
125
+ '--IconButton-hoverBg': theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity)
134
126
  }
135
127
  })), {
136
128
  props: {
@@ -171,7 +163,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
171
163
  color = 'default',
172
164
  disabled = false,
173
165
  disableFocusRipple = false,
174
- disableRipple = false,
175
166
  size = 'medium',
176
167
  ...other
177
168
  } = props;
@@ -181,7 +172,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
181
172
  color,
182
173
  disabled,
183
174
  disableFocusRipple,
184
- disableRipple,
185
175
  size
186
176
  };
187
177
  const classes = useUtilityClasses(ownerState);
@@ -190,7 +180,6 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
190
180
  centerRipple: true,
191
181
  focusRipple: !disableFocusRipple,
192
182
  disabled: disabled,
193
- disableRipple: disableRipple,
194
183
  ref: ref,
195
184
  ...other,
196
185
  ownerState: ownerState,
@@ -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.
@@ -174,6 +174,7 @@ process.env.NODE_ENV !== "production" ? HiddenCss.propTypes /* remove-proptypes
174
174
  */
175
175
  xsUp: _propTypes.default.bool
176
176
  } : void 0;
177
+
177
178
  /**
178
179
  *
179
180
  * Demos:
@@ -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) {
@@ -427,6 +427,28 @@ const SliderValueLabel = exports.SliderValueLabel = (0, _zeroStyled.styled)(_Sli
427
427
  }
428
428
  }]
429
429
  })));
430
+ process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-proptypes */ = {
431
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
432
+ // │ These PropTypes are generated from the TypeScript type definitions. │
433
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
434
+ // └─────────────────────────────────────────────────────────────────────┘
435
+ /**
436
+ * @ignore
437
+ */
438
+ children: _propTypes.default.element.isRequired,
439
+ /**
440
+ * @ignore
441
+ */
442
+ index: _propTypes.default.number.isRequired,
443
+ /**
444
+ * @ignore
445
+ */
446
+ open: _propTypes.default.bool.isRequired,
447
+ /**
448
+ * @ignore
449
+ */
450
+ value: _propTypes.default.number.isRequired
451
+ } : void 0;
430
452
  const SliderMark = exports.SliderMark = (0, _zeroStyled.styled)('span', {
431
453
  name: 'MuiSlider',
432
454
  slot: 'Mark',
@@ -766,40 +788,36 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
766
788
  const percent = (0, _useSlider.valueToPercent)(value, min, max);
767
789
  const style = axisProps[axis].offset(percent);
768
790
  const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
769
- return (
770
- /*#__PURE__*/
771
- /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */
772
- (0, _jsxRuntime.jsx)(ValueLabelComponent, {
773
- ...(!(0, _isHostComponent.default)(ValueLabelComponent) && {
774
- valueLabelFormat,
775
- valueLabelDisplay,
776
- value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
777
- index,
778
- open: open === index || active === index || valueLabelDisplay === 'on',
779
- disabled
780
- }),
781
- ...valueLabelProps,
782
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbSlot, {
791
+ return /*#__PURE__*/ /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */(0, _jsxRuntime.jsx)(ValueLabelComponent, {
792
+ ...(!(0, _isHostComponent.default)(ValueLabelComponent) && {
793
+ valueLabelFormat,
794
+ valueLabelDisplay,
795
+ value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
796
+ index,
797
+ open: open === index || active === index || valueLabelDisplay === 'on',
798
+ disabled
799
+ }),
800
+ ...valueLabelProps,
801
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbSlot, {
802
+ "data-index": index,
803
+ ...thumbProps,
804
+ className: (0, _clsx.default)(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
805
+ style: {
806
+ ...style,
807
+ ...getThumbStyle(index),
808
+ ...thumbProps.style
809
+ },
810
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InputSlot, {
783
811
  "data-index": index,
784
- ...thumbProps,
785
- className: (0, _clsx.default)(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
786
- style: {
787
- ...style,
788
- ...getThumbStyle(index),
789
- ...thumbProps.style
790
- },
791
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InputSlot, {
792
- "data-index": index,
793
- "aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
794
- "aria-valuenow": scale(value),
795
- "aria-labelledby": ariaLabelledby,
796
- "aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
797
- value: values[index],
798
- ...inputSliderProps
799
- })
812
+ "aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
813
+ "aria-valuenow": scale(value),
814
+ "aria-labelledby": ariaLabelledby,
815
+ "aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
816
+ value: values[index],
817
+ ...inputSliderProps
800
818
  })
801
- }, index)
802
- );
819
+ })
820
+ }, index);
803
821
  })]
804
822
  });
805
823
  });
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.2
2
+ * @mui/material v6.1.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -18,70 +18,76 @@ var _orange = _interopRequireDefault(require("../colors/orange"));
18
18
  var _blue = _interopRequireDefault(require("../colors/blue"));
19
19
  var _lightBlue = _interopRequireDefault(require("../colors/lightBlue"));
20
20
  var _green = _interopRequireDefault(require("../colors/green"));
21
- const light = exports.light = {
22
- // The colors used to style the text.
23
- text: {
24
- // The most important text.
25
- primary: 'rgba(0, 0, 0, 0.87)',
26
- // Secondary text.
27
- secondary: 'rgba(0, 0, 0, 0.6)',
28
- // Disabled text have even lower visual prominence.
29
- disabled: 'rgba(0, 0, 0, 0.38)'
30
- },
31
- // The color used to divide different elements.
32
- divider: 'rgba(0, 0, 0, 0.12)',
33
- // The background colors used to style the surfaces.
34
- // Consistency between these values is important.
35
- background: {
36
- paper: _common.default.white,
37
- default: _common.default.white
38
- },
39
- // The colors used to style the action elements.
40
- action: {
41
- // The color of an active action like an icon button.
42
- active: 'rgba(0, 0, 0, 0.54)',
43
- // The color of an hovered action.
44
- hover: 'rgba(0, 0, 0, 0.04)',
45
- hoverOpacity: 0.04,
46
- // The color of a selected action.
47
- selected: 'rgba(0, 0, 0, 0.08)',
48
- selectedOpacity: 0.08,
49
- // The color of a disabled action.
50
- disabled: 'rgba(0, 0, 0, 0.26)',
51
- // The background color of a disabled action.
52
- disabledBackground: 'rgba(0, 0, 0, 0.12)',
53
- disabledOpacity: 0.38,
54
- focus: 'rgba(0, 0, 0, 0.12)',
55
- focusOpacity: 0.12,
56
- activatedOpacity: 0.12
57
- }
58
- };
59
- const dark = exports.dark = {
60
- text: {
61
- primary: _common.default.white,
62
- secondary: 'rgba(255, 255, 255, 0.7)',
63
- disabled: 'rgba(255, 255, 255, 0.5)',
64
- icon: 'rgba(255, 255, 255, 0.5)'
65
- },
66
- divider: 'rgba(255, 255, 255, 0.12)',
67
- background: {
68
- paper: '#121212',
69
- default: '#121212'
70
- },
71
- action: {
72
- active: _common.default.white,
73
- hover: 'rgba(255, 255, 255, 0.08)',
74
- hoverOpacity: 0.08,
75
- selected: 'rgba(255, 255, 255, 0.16)',
76
- selectedOpacity: 0.16,
77
- disabled: 'rgba(255, 255, 255, 0.3)',
78
- disabledBackground: 'rgba(255, 255, 255, 0.12)',
79
- disabledOpacity: 0.38,
80
- focus: 'rgba(255, 255, 255, 0.12)',
81
- focusOpacity: 0.12,
82
- activatedOpacity: 0.24
83
- }
84
- };
21
+ function getLight() {
22
+ return {
23
+ // The colors used to style the text.
24
+ text: {
25
+ // The most important text.
26
+ primary: 'rgba(0, 0, 0, 0.87)',
27
+ // Secondary text.
28
+ secondary: 'rgba(0, 0, 0, 0.6)',
29
+ // Disabled text have even lower visual prominence.
30
+ disabled: 'rgba(0, 0, 0, 0.38)'
31
+ },
32
+ // The color used to divide different elements.
33
+ divider: 'rgba(0, 0, 0, 0.12)',
34
+ // The background colors used to style the surfaces.
35
+ // Consistency between these values is important.
36
+ background: {
37
+ paper: _common.default.white,
38
+ default: _common.default.white
39
+ },
40
+ // The colors used to style the action elements.
41
+ action: {
42
+ // The color of an active action like an icon button.
43
+ active: 'rgba(0, 0, 0, 0.54)',
44
+ // The color of an hovered action.
45
+ hover: 'rgba(0, 0, 0, 0.04)',
46
+ hoverOpacity: 0.04,
47
+ // The color of a selected action.
48
+ selected: 'rgba(0, 0, 0, 0.08)',
49
+ selectedOpacity: 0.08,
50
+ // The color of a disabled action.
51
+ disabled: 'rgba(0, 0, 0, 0.26)',
52
+ // The background color of a disabled action.
53
+ disabledBackground: 'rgba(0, 0, 0, 0.12)',
54
+ disabledOpacity: 0.38,
55
+ focus: 'rgba(0, 0, 0, 0.12)',
56
+ focusOpacity: 0.12,
57
+ activatedOpacity: 0.12
58
+ }
59
+ };
60
+ }
61
+ const light = exports.light = getLight();
62
+ function getDark() {
63
+ return {
64
+ text: {
65
+ primary: _common.default.white,
66
+ secondary: 'rgba(255, 255, 255, 0.7)',
67
+ disabled: 'rgba(255, 255, 255, 0.5)',
68
+ icon: 'rgba(255, 255, 255, 0.5)'
69
+ },
70
+ divider: 'rgba(255, 255, 255, 0.12)',
71
+ background: {
72
+ paper: '#121212',
73
+ default: '#121212'
74
+ },
75
+ action: {
76
+ active: _common.default.white,
77
+ hover: 'rgba(255, 255, 255, 0.08)',
78
+ hoverOpacity: 0.08,
79
+ selected: 'rgba(255, 255, 255, 0.16)',
80
+ selectedOpacity: 0.16,
81
+ disabled: 'rgba(255, 255, 255, 0.3)',
82
+ disabledBackground: 'rgba(255, 255, 255, 0.12)',
83
+ disabledOpacity: 0.38,
84
+ focus: 'rgba(255, 255, 255, 0.12)',
85
+ focusOpacity: 0.12,
86
+ activatedOpacity: 0.24
87
+ }
88
+ };
89
+ }
90
+ const dark = exports.dark = getDark();
85
91
  function addLightOrDark(intent, direction, shade, tonalOffset) {
86
92
  const tonalOffsetLight = tonalOffset.light || tonalOffset;
87
93
  const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
@@ -221,24 +227,10 @@ function createPalette(palette) {
221
227
  color.main = color[mainShade];
222
228
  }
223
229
  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));
230
+ 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
231
  }
227
232
  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)));
233
+ 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
234
  }
243
235
  addLightOrDark(color, 'light', lightShade, tonalOffset);
244
236
  addLightOrDark(color, 'dark', darkShade, tonalOffset);
@@ -247,12 +239,14 @@ const theme2 = createTheme({ palette: {
247
239
  }
248
240
  return color;
249
241
  };
250
- const modes = {
251
- dark,
252
- light
253
- };
242
+ let modeHydrated;
243
+ if (mode === 'light') {
244
+ modeHydrated = getLight();
245
+ } else if (mode === 'dark') {
246
+ modeHydrated = getDark();
247
+ }
254
248
  if (process.env.NODE_ENV !== 'production') {
255
- if (!modes[mode]) {
249
+ if (!modeHydrated) {
256
250
  console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
257
251
  }
258
252
  }
@@ -311,7 +305,7 @@ const theme2 = createTheme({ palette: {
311
305
  // E.g., shift from Red 500 to Red 300 or Red 700.
312
306
  tonalOffset,
313
307
  // The light and dark mode object.
314
- ...modes[mode]
308
+ ...modeHydrated
315
309
  }, other);
316
310
  return paletteOutput;
317
311
  }
@@ -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.4";
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("4");
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.4",
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.",
@@ -27,7 +27,7 @@
27
27
  "url": "https://opencollective.com/mui-org"
28
28
  },
29
29
  "dependencies": {
30
- "@babel/runtime": "^7.25.6",
30
+ "@babel/runtime": "^7.25.7",
31
31
  "@popperjs/core": "^2.11.8",
32
32
  "@types/react-transition-group": "^4.4.11",
33
33
  "clsx": "^2.1.1",
@@ -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.4",
39
+ "@mui/system": "^6.1.4",
40
+ "@mui/types": "^7.2.18",
41
+ "@mui/utils": "^6.1.4"
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.4"
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 };