@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
@@ -46,6 +46,12 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
46
46
  [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
47
47
  borderColor: (theme.vars || theme).palette.text.primary
48
48
  },
49
+ // Reset on touch devices, it doesn't add specificity
50
+ '@media (hover: none)': {
51
+ [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
52
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
53
+ }
54
+ },
49
55
  [`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
50
56
  borderWidth: 2
51
57
  },
@@ -62,12 +68,6 @@ const OutlinedInputRoot = styled(InputBaseRoot, {
62
68
  props: {},
63
69
  // to overide the above style
64
70
  style: {
65
- // Reset on touch devices, it doesn't add specificity
66
- '@media (hover: none)': {
67
- [`&:hover .${outlinedInputClasses.notchedOutline}`]: {
68
- borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
69
- }
70
- },
71
71
  [`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
72
72
  borderColor: (theme.vars || theme).palette.error.main
73
73
  },
@@ -113,29 +113,6 @@ process.env.NODE_ENV !== "production" ? PigmentGrid.propTypes /* remove-proptype
113
113
  * @ignore
114
114
  */
115
115
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
116
- /**
117
- * @internal
118
- * The level of the grid starts from `0`
119
- * and increases when the grid nests inside another grid regardless of container or item.
120
- *
121
- * ```js
122
- * <Grid> // level 0
123
- * <Grid> // level 1
124
- * <Grid> // level 2
125
- * <Grid> // level 1
126
- * ```
127
- *
128
- * Only consecutive grid is considered nesting.
129
- * A grid container will start at `0` if there are non-Grid element above it.
130
- *
131
- * ```js
132
- * <Grid> // level 0
133
- * <div>
134
- * <Grid> // level 0
135
- * <Grid> // level 1
136
- * ```
137
- */
138
- unstable_level: PropTypes.number,
139
116
  /**
140
117
  * Defines the `flex-wrap` style property.
141
118
  * It's applied for all screen sizes.
@@ -166,6 +166,7 @@ process.env.NODE_ENV !== "production" ? HiddenCss.propTypes /* remove-proptypes
166
166
  */
167
167
  xsUp: PropTypes.bool
168
168
  } : void 0;
169
+
169
170
  /**
170
171
  *
171
172
  * Demos:
@@ -347,7 +347,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
347
347
  let selected;
348
348
  if (multiple) {
349
349
  if (!Array.isArray(value)) {
350
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`value\` prop must be an array when using the \`Select\` component with \`multiple\`.` : _formatMuiErrorMessage(2));
350
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `value` prop must be an array ' + 'when using the `Select` component with `multiple`.' : _formatMuiErrorMessage(2));
351
351
  }
352
352
  selected = value.some(v => areEqualValues(v, child.props.value));
353
353
  if (selected && computeDisplay) {
@@ -335,7 +335,7 @@ export const SliderThumb = styled('span', {
335
335
  }
336
336
  }))]
337
337
  })));
338
- export const SliderValueLabel = styled(BaseSliderValueLabel, {
338
+ const SliderValueLabel = styled(BaseSliderValueLabel, {
339
339
  name: 'MuiSlider',
340
340
  slot: 'ValueLabel',
341
341
  overridesResolver: (props, styles) => styles.valueLabel
@@ -420,6 +420,29 @@ export const SliderValueLabel = styled(BaseSliderValueLabel, {
420
420
  }
421
421
  }]
422
422
  })));
423
+ process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-proptypes */ = {
424
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
425
+ // │ These PropTypes are generated from the TypeScript type definitions. │
426
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
427
+ // └─────────────────────────────────────────────────────────────────────┘
428
+ /**
429
+ * @ignore
430
+ */
431
+ children: PropTypes.element.isRequired,
432
+ /**
433
+ * @ignore
434
+ */
435
+ index: PropTypes.number.isRequired,
436
+ /**
437
+ * @ignore
438
+ */
439
+ open: PropTypes.bool.isRequired,
440
+ /**
441
+ * @ignore
442
+ */
443
+ value: PropTypes.number.isRequired
444
+ } : void 0;
445
+ export { SliderValueLabel };
423
446
  export const SliderMark = styled('span', {
424
447
  name: 'MuiSlider',
425
448
  slot: 'Mark',
@@ -759,40 +782,36 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
759
782
  const percent = valueToPercent(value, min, max);
760
783
  const style = axisProps[axis].offset(percent);
761
784
  const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
762
- return (
763
- /*#__PURE__*/
764
- /* 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. */
765
- _jsx(ValueLabelComponent, {
766
- ...(!isHostComponent(ValueLabelComponent) && {
767
- valueLabelFormat,
768
- valueLabelDisplay,
769
- value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
770
- index,
771
- open: open === index || active === index || valueLabelDisplay === 'on',
772
- disabled
773
- }),
774
- ...valueLabelProps,
775
- children: /*#__PURE__*/_jsx(ThumbSlot, {
785
+ 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. */_jsx(ValueLabelComponent, {
786
+ ...(!isHostComponent(ValueLabelComponent) && {
787
+ valueLabelFormat,
788
+ valueLabelDisplay,
789
+ value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
790
+ index,
791
+ open: open === index || active === index || valueLabelDisplay === 'on',
792
+ disabled
793
+ }),
794
+ ...valueLabelProps,
795
+ children: /*#__PURE__*/_jsx(ThumbSlot, {
796
+ "data-index": index,
797
+ ...thumbProps,
798
+ className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
799
+ style: {
800
+ ...style,
801
+ ...getThumbStyle(index),
802
+ ...thumbProps.style
803
+ },
804
+ children: /*#__PURE__*/_jsx(InputSlot, {
776
805
  "data-index": index,
777
- ...thumbProps,
778
- className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
779
- style: {
780
- ...style,
781
- ...getThumbStyle(index),
782
- ...thumbProps.style
783
- },
784
- children: /*#__PURE__*/_jsx(InputSlot, {
785
- "data-index": index,
786
- "aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
787
- "aria-valuenow": scale(value),
788
- "aria-labelledby": ariaLabelledby,
789
- "aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
790
- value: values[index],
791
- ...inputSliderProps
792
- })
806
+ "aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
807
+ "aria-valuenow": scale(value),
808
+ "aria-labelledby": ariaLabelledby,
809
+ "aria-valuetext": getAriaValueText ? getAriaValueText(scale(value), index) : ariaValuetext,
810
+ value: values[index],
811
+ ...inputSliderProps
793
812
  })
794
- }, index)
795
- );
813
+ })
814
+ }, index);
796
815
  })]
797
816
  });
798
817
  });
package/modern/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
@@ -9,70 +9,76 @@ import orange from "../colors/orange.js";
9
9
  import blue from "../colors/blue.js";
10
10
  import lightBlue from "../colors/lightBlue.js";
11
11
  import green from "../colors/green.js";
12
- export const light = {
13
- // The colors used to style the text.
14
- text: {
15
- // The most important text.
16
- primary: 'rgba(0, 0, 0, 0.87)',
17
- // Secondary text.
18
- secondary: 'rgba(0, 0, 0, 0.6)',
19
- // Disabled text have even lower visual prominence.
20
- disabled: 'rgba(0, 0, 0, 0.38)'
21
- },
22
- // The color used to divide different elements.
23
- divider: 'rgba(0, 0, 0, 0.12)',
24
- // The background colors used to style the surfaces.
25
- // Consistency between these values is important.
26
- background: {
27
- paper: common.white,
28
- default: common.white
29
- },
30
- // The colors used to style the action elements.
31
- action: {
32
- // The color of an active action like an icon button.
33
- active: 'rgba(0, 0, 0, 0.54)',
34
- // The color of an hovered action.
35
- hover: 'rgba(0, 0, 0, 0.04)',
36
- hoverOpacity: 0.04,
37
- // The color of a selected action.
38
- selected: 'rgba(0, 0, 0, 0.08)',
39
- selectedOpacity: 0.08,
40
- // The color of a disabled action.
41
- disabled: 'rgba(0, 0, 0, 0.26)',
42
- // The background color of a disabled action.
43
- disabledBackground: 'rgba(0, 0, 0, 0.12)',
44
- disabledOpacity: 0.38,
45
- focus: 'rgba(0, 0, 0, 0.12)',
46
- focusOpacity: 0.12,
47
- activatedOpacity: 0.12
48
- }
49
- };
50
- export const dark = {
51
- text: {
52
- primary: common.white,
53
- secondary: 'rgba(255, 255, 255, 0.7)',
54
- disabled: 'rgba(255, 255, 255, 0.5)',
55
- icon: 'rgba(255, 255, 255, 0.5)'
56
- },
57
- divider: 'rgba(255, 255, 255, 0.12)',
58
- background: {
59
- paper: '#121212',
60
- default: '#121212'
61
- },
62
- action: {
63
- active: common.white,
64
- hover: 'rgba(255, 255, 255, 0.08)',
65
- hoverOpacity: 0.08,
66
- selected: 'rgba(255, 255, 255, 0.16)',
67
- selectedOpacity: 0.16,
68
- disabled: 'rgba(255, 255, 255, 0.3)',
69
- disabledBackground: 'rgba(255, 255, 255, 0.12)',
70
- disabledOpacity: 0.38,
71
- focus: 'rgba(255, 255, 255, 0.12)',
72
- focusOpacity: 0.12,
73
- activatedOpacity: 0.24
74
- }
75
- };
12
+ function getLight() {
13
+ return {
14
+ // The colors used to style the text.
15
+ text: {
16
+ // The most important text.
17
+ primary: 'rgba(0, 0, 0, 0.87)',
18
+ // Secondary text.
19
+ secondary: 'rgba(0, 0, 0, 0.6)',
20
+ // Disabled text have even lower visual prominence.
21
+ disabled: 'rgba(0, 0, 0, 0.38)'
22
+ },
23
+ // The color used to divide different elements.
24
+ divider: 'rgba(0, 0, 0, 0.12)',
25
+ // The background colors used to style the surfaces.
26
+ // Consistency between these values is important.
27
+ background: {
28
+ paper: common.white,
29
+ default: common.white
30
+ },
31
+ // The colors used to style the action elements.
32
+ action: {
33
+ // The color of an active action like an icon button.
34
+ active: 'rgba(0, 0, 0, 0.54)',
35
+ // The color of an hovered action.
36
+ hover: 'rgba(0, 0, 0, 0.04)',
37
+ hoverOpacity: 0.04,
38
+ // The color of a selected action.
39
+ selected: 'rgba(0, 0, 0, 0.08)',
40
+ selectedOpacity: 0.08,
41
+ // The color of a disabled action.
42
+ disabled: 'rgba(0, 0, 0, 0.26)',
43
+ // The background color of a disabled action.
44
+ disabledBackground: 'rgba(0, 0, 0, 0.12)',
45
+ disabledOpacity: 0.38,
46
+ focus: 'rgba(0, 0, 0, 0.12)',
47
+ focusOpacity: 0.12,
48
+ activatedOpacity: 0.12
49
+ }
50
+ };
51
+ }
52
+ export const light = getLight();
53
+ function getDark() {
54
+ return {
55
+ text: {
56
+ primary: common.white,
57
+ secondary: 'rgba(255, 255, 255, 0.7)',
58
+ disabled: 'rgba(255, 255, 255, 0.5)',
59
+ icon: 'rgba(255, 255, 255, 0.5)'
60
+ },
61
+ divider: 'rgba(255, 255, 255, 0.12)',
62
+ background: {
63
+ paper: '#121212',
64
+ default: '#121212'
65
+ },
66
+ action: {
67
+ active: common.white,
68
+ hover: 'rgba(255, 255, 255, 0.08)',
69
+ hoverOpacity: 0.08,
70
+ selected: 'rgba(255, 255, 255, 0.16)',
71
+ selectedOpacity: 0.16,
72
+ disabled: 'rgba(255, 255, 255, 0.3)',
73
+ disabledBackground: 'rgba(255, 255, 255, 0.12)',
74
+ disabledOpacity: 0.38,
75
+ focus: 'rgba(255, 255, 255, 0.12)',
76
+ focusOpacity: 0.12,
77
+ activatedOpacity: 0.24
78
+ }
79
+ };
80
+ }
81
+ export const dark = getDark();
76
82
  function addLightOrDark(intent, direction, shade, tonalOffset) {
77
83
  const tonalOffsetLight = tonalOffset.light || tonalOffset;
78
84
  const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
@@ -212,24 +218,10 @@ export default function createPalette(palette) {
212
218
  color.main = color[mainShade];
213
219
  }
214
220
  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));
221
+ 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
222
  }
218
223
  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)));
224
+ 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
225
  }
234
226
  addLightOrDark(color, 'light', lightShade, tonalOffset);
235
227
  addLightOrDark(color, 'dark', darkShade, tonalOffset);
@@ -238,12 +230,14 @@ const theme2 = createTheme({ palette: {
238
230
  }
239
231
  return color;
240
232
  };
241
- const modes = {
242
- dark,
243
- light
244
- };
233
+ let modeHydrated;
234
+ if (mode === 'light') {
235
+ modeHydrated = getLight();
236
+ } else if (mode === 'dark') {
237
+ modeHydrated = getDark();
238
+ }
245
239
  if (process.env.NODE_ENV !== 'production') {
246
- if (!modes[mode]) {
240
+ if (!modeHydrated) {
247
241
  console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
248
242
  }
249
243
  }
@@ -302,7 +296,7 @@ const theme2 = createTheme({ palette: {
302
296
  // E.g., shift from Red 500 to Red 300 or Red 700.
303
297
  tonalOffset,
304
298
  // The light and dark mode object.
305
- ...modes[mode]
299
+ ...modeHydrated
306
300
  }, other);
307
301
  return paletteOutput;
308
302
  }
@@ -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.4";
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("4");
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.
@@ -148,6 +148,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
148
148
  ownerState: ownerState,
149
149
  ref: ref,
150
150
  className: (0, _clsx.default)(classes.root, className),
151
+ disableRipple: disableRipple,
151
152
  ...other,
152
153
  classes: classes
153
154
  });
@@ -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;