@mui/material 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.0.2
4
+
5
+ <!-- generated comparing v6.0.1..master -->
6
+
7
+ _Sep 3, 2024_
8
+
9
+ A big thanks to the 11 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.0.2`
12
+
13
+ - &#8203;<!-- 07 -->Fix `createTheme` with just color schemes (#43518) @siriwatknp
14
+ - &#8203;<!-- 06 -->[Menu,Popover] Fix Backdrop props descriptions (#43503) @Michael-Hutchinson
15
+ - &#8203;<!-- 05 -->[MenuList] Do not react to an event with modifier key pressed (#43505) @MateuszGroth
16
+
17
+ ### `@mui/system@6.0.2`
18
+
19
+ - &#8203;<!-- 08 -->[InitColorSchemeScript] Use `let/const` instead of `var` (#43468) @ishon19
20
+ - &#8203;<!-- 04 -->Fix composeClasses v6 behavior change (#43537) @oliviertassinari
21
+
22
+ ### `@mui/codemod@6.0.2`
23
+
24
+ - &#8203;<!-- 19 -->Skip `ListItemButton` import for unrelated files (#43532) @siriwatknp
25
+
26
+ ### Docs
27
+
28
+ - &#8203;<!-- 10 -->[figma] Clarity state or Figma Plugin component export (#43543) @oliviertassinari
29
+ - &#8203;<!-- 09 -->[material-ui] Fix template shadow tokens (#43514) @zanivan
30
+ - &#8203;<!-- 15 -->Update version support range (#43565) @oliviertassinari
31
+ - &#8203;<!-- 14 -->Polish Material UI Sync plugin code format @oliviertassinari
32
+
33
+ ### Core
34
+
35
+ - &#8203;<!-- 24 -->[blog] Update Material UI v6 blog post link to reflect correct section title (#43535) @Michael-Hutchinson
36
+ - &#8203;<!-- 23 -->[blog] Makes the v5 name change clearer @oliviertassinari
37
+ - &#8203;<!-- 22 -->[blog] Fix typo in Material UI v6 blog post (#43502) @iamandrewluca
38
+ - &#8203;<!-- 21 -->[code-infra] Add missing @babel/runtime dependency to @mui/material-pigment-css (#43473) @Janpot
39
+ - &#8203;<!-- 20 -->[code-infra] Remove permissions in publish-canaries.yml (#43491) @oliviertassinari
40
+ - &#8203;<!-- 18 -->[core] Fix CodeQL scan (#43547) @oliviertassinari
41
+ - &#8203;<!-- 17 -->[core] Fix CHANGELOG `@mui/material@6.0.1` version (#43516) @DiegoAndai
42
+ - &#8203;<!-- 14 -->[docs-infra] Reduce description max-length (#43562) @oliviertassinari
43
+ - &#8203;<!-- 13 -->[docs-infra] Crash on invalid callout type (#43546) @oliviertassinari
44
+ - &#8203;<!-- 12 -->[docs-infra] Fix GitHub source link redirection (#43534) @oliviertassinari
45
+ - &#8203;<!-- 09 -->[infra] Fixed workflow file path (#43528) @michelengelen
46
+ - &#8203;<!-- 03 -->[typescript] Fix missing `Theme` generic (#43523) @siriwatknp
47
+ - &#8203;<!-- 02 -->[website] Match pricing label with page @oliviertassinari
48
+ - &#8203;<!-- 01 -->[website] Update Premium price and remove any mention to cap (#43466) @joserodolfofreitas
49
+
50
+ All contributors of this release in alphabetical order: @DiegoAndai, @iamandrewluca, @ishon19, @Janpot, @joserodolfofreitas, @MateuszGroth, @Michael-Hutchinson, @michelengelen, @oliviertassinari, @siriwatknp, @zanivan
51
+
3
52
  ## v6.0.1
4
53
 
5
54
  <!-- generated comparing v6.0.0..master -->
@@ -8,7 +57,7 @@ _Aug 29, 2024_
8
57
 
9
58
  A big thanks to the 12 contributors who made this release possible. It contains bug fixes and documentation improvements.
10
59
 
11
- ### `@mui/material@6.0.0`
60
+ ### `@mui/material@6.0.1`
12
61
 
13
62
  - Attach default light color scheme when enabling CSS theme variables (#43493) @siriwatknp
14
63
  - [Skeleton] Apply the wave animation to the correct element (#43474) @mnajdova
@@ -121,6 +121,14 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
121
121
  const handleKeyDown = event => {
122
122
  const list = listRef.current;
123
123
  const key = event.key;
124
+ const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
125
+ if (isModifierKeyPressed) {
126
+ if (onKeyDown) {
127
+ onKeyDown(event);
128
+ }
129
+ return;
130
+ }
131
+
124
132
  /**
125
133
  * @type {Element} - will always be defined since we are in a keydown handler
126
134
  * attached to an element. A keydown event is either dispatched to the activeElement
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
- import { InternalStandardProps as StandardProps } from '..';
3
+ import { BackdropProps, InternalStandardProps as StandardProps } from '..';
4
4
  import Paper, { PaperProps } from '../Paper';
5
5
  import Modal, { ModalOwnerState, ModalProps } from '../Modal';
6
6
  import { Theme } from '../styles';
@@ -39,7 +39,10 @@ interface PopoverVirtualElement {
39
39
  }
40
40
 
41
41
  export interface PopoverProps
42
- extends StandardProps<Omit<ModalProps, 'slots' | 'slotProps'>, 'children'>,
42
+ extends StandardProps<
43
+ Omit<ModalProps, 'slots' | 'slotProps' | 'BackdropProps' | 'BackdropComponent'>,
44
+ 'children'
45
+ >,
43
46
  PopoverSlotsAndSlotProps {
44
47
  /**
45
48
  * A ref for imperative actions.
@@ -82,6 +85,26 @@ export interface PopoverProps
82
85
  * @default 'anchorEl'
83
86
  */
84
87
  anchorReference?: PopoverReference;
88
+ /**
89
+ * A backdrop component. This prop enables custom backdrop rendering.
90
+ * @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
91
+ * Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
92
+ * @default styled(Backdrop, {
93
+ * name: 'MuiModal',
94
+ * slot: 'Backdrop',
95
+ * overridesResolver: (props, styles) => {
96
+ * return styles.backdrop;
97
+ * },
98
+ * })({
99
+ * zIndex: -1,
100
+ * })
101
+ */
102
+ BackdropComponent?: React.ElementType<BackdropProps>;
103
+ /**
104
+ * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
105
+ * @deprecated Use `slotProps.root.slotProps.backdrop` instead.
106
+ */
107
+ BackdropProps?: Partial<BackdropProps>;
85
108
  /**
86
109
  * The content of the component.
87
110
  */
@@ -419,6 +419,26 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
419
419
  * @default 'anchorEl'
420
420
  */
421
421
  anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
422
+ /**
423
+ * A backdrop component. This prop enables custom backdrop rendering.
424
+ * @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
425
+ * Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
426
+ * @default styled(Backdrop, {
427
+ * name: 'MuiModal',
428
+ * slot: 'Backdrop',
429
+ * overridesResolver: (props, styles) => {
430
+ * return styles.backdrop;
431
+ * },
432
+ * })({
433
+ * zIndex: -1,
434
+ * })
435
+ */
436
+ BackdropComponent: PropTypes.elementType,
437
+ /**
438
+ * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
439
+ * @deprecated Use `slotProps.root.slotProps.backdrop` instead.
440
+ */
441
+ BackdropProps: PropTypes.object,
422
442
  /**
423
443
  * The content of the component.
424
444
  */
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.1
2
+ * @mui/material v6.0.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -121,6 +121,14 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
121
121
  const handleKeyDown = event => {
122
122
  const list = listRef.current;
123
123
  const key = event.key;
124
+ const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
125
+ if (isModifierKeyPressed) {
126
+ if (onKeyDown) {
127
+ onKeyDown(event);
128
+ }
129
+ return;
130
+ }
131
+
124
132
  /**
125
133
  * @type {Element} - will always be defined since we are in a keydown handler
126
134
  * attached to an element. A keydown event is either dispatched to the activeElement
@@ -419,6 +419,26 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
419
419
  * @default 'anchorEl'
420
420
  */
421
421
  anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
422
+ /**
423
+ * A backdrop component. This prop enables custom backdrop rendering.
424
+ * @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
425
+ * Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
426
+ * @default styled(Backdrop, {
427
+ * name: 'MuiModal',
428
+ * slot: 'Backdrop',
429
+ * overridesResolver: (props, styles) => {
430
+ * return styles.backdrop;
431
+ * },
432
+ * })({
433
+ * zIndex: -1,
434
+ * })
435
+ */
436
+ BackdropComponent: PropTypes.elementType,
437
+ /**
438
+ * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
439
+ * @deprecated Use `slotProps.root.slotProps.backdrop` instead.
440
+ */
441
+ BackdropProps: PropTypes.object,
422
442
  /**
423
443
  * The content of the component.
424
444
  */
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.1
2
+ * @mui/material v6.0.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,7 +11,7 @@ function attachColorScheme(theme, scheme, colorScheme) {
11
11
  theme.colorSchemes[scheme] = {
12
12
  ...(colorScheme !== true && colorScheme),
13
13
  palette: createPalette({
14
- ...(colorScheme === true ? {} : colorScheme),
14
+ ...(colorScheme === true ? {} : colorScheme.palette),
15
15
  mode: scheme
16
16
  }) // cast type to skip module augmentation test
17
17
  };
@@ -48,20 +48,39 @@ export default function createTheme(options = {},
48
48
  } : undefined)
49
49
  };
50
50
  if (cssVariables === false) {
51
- const theme = createThemeNoVars(options, ...args);
52
51
  if (!('colorSchemes' in options)) {
53
- return theme;
52
+ // Behaves exactly as v5
53
+ return createThemeNoVars(options, ...args);
54
54
  }
55
+ let paletteOptions = palette;
56
+ if (!('palette' in options)) {
57
+ if (colorSchemesInput[defaultColorSchemeInput]) {
58
+ if (colorSchemesInput[defaultColorSchemeInput] !== true) {
59
+ paletteOptions = colorSchemesInput[defaultColorSchemeInput].palette;
60
+ } else if (defaultColorSchemeInput === 'dark') {
61
+ // @ts-ignore to prevent the module augmentation test from failing
62
+ paletteOptions = {
63
+ mode: 'dark'
64
+ };
65
+ }
66
+ }
67
+ }
68
+ const theme = createThemeNoVars({
69
+ ...options,
70
+ palette: paletteOptions
71
+ }, ...args);
55
72
  theme.defaultColorScheme = defaultColorSchemeInput;
56
73
  theme.colorSchemes = colorSchemesInput;
57
74
  if (theme.palette.mode === 'light') {
58
75
  theme.colorSchemes.light = {
76
+ ...(colorSchemesInput.light !== true && colorSchemesInput.light),
59
77
  palette: theme.palette
60
78
  };
61
79
  attachColorScheme(theme, 'dark', colorSchemesInput.dark);
62
80
  }
63
81
  if (theme.palette.mode === 'dark') {
64
82
  theme.colorSchemes.dark = {
83
+ ...(colorSchemesInput.dark !== true && colorSchemesInput.dark),
65
84
  palette: theme.palette
66
85
  };
67
86
  attachColorScheme(theme, 'light', colorSchemesInput.light);
@@ -1,7 +1,7 @@
1
- export const version = "6.0.1";
1
+ export const version = "6.0.2";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("0");
4
- export const patch = Number("1");
4
+ export const patch = Number("2");
5
5
  export const preReleaseLabel = undefined || null;
6
6
  export const preReleaseNumber = Number(undefined) || null;
7
7
  export default version;
@@ -128,6 +128,14 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
128
128
  const handleKeyDown = event => {
129
129
  const list = listRef.current;
130
130
  const key = event.key;
131
+ const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;
132
+ if (isModifierKeyPressed) {
133
+ if (onKeyDown) {
134
+ onKeyDown(event);
135
+ }
136
+ return;
137
+ }
138
+
131
139
  /**
132
140
  * @type {Element} - will always be defined since we are in a keydown handler
133
141
  * attached to an element. A keydown event is either dispatched to the activeElement
@@ -428,6 +428,26 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
428
428
  * @default 'anchorEl'
429
429
  */
430
430
  anchorReference: _propTypes.default.oneOf(['anchorEl', 'anchorPosition', 'none']),
431
+ /**
432
+ * A backdrop component. This prop enables custom backdrop rendering.
433
+ * @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
434
+ * Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
435
+ * @default styled(Backdrop, {
436
+ * name: 'MuiModal',
437
+ * slot: 'Backdrop',
438
+ * overridesResolver: (props, styles) => {
439
+ * return styles.backdrop;
440
+ * },
441
+ * })({
442
+ * zIndex: -1,
443
+ * })
444
+ */
445
+ BackdropComponent: _propTypes.default.elementType,
446
+ /**
447
+ * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
448
+ * @deprecated Use `slotProps.root.slotProps.backdrop` instead.
449
+ */
450
+ BackdropProps: _propTypes.default.object,
431
451
  /**
432
452
  * The content of the component.
433
453
  */
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.1
2
+ * @mui/material v6.0.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -24,7 +24,7 @@ function attachColorScheme(theme, scheme, colorScheme) {
24
24
  theme.colorSchemes[scheme] = {
25
25
  ...(colorScheme !== true && colorScheme),
26
26
  palette: (0, _createPalette.default)({
27
- ...(colorScheme === true ? {} : colorScheme),
27
+ ...(colorScheme === true ? {} : colorScheme.palette),
28
28
  mode: scheme
29
29
  }) // cast type to skip module augmentation test
30
30
  };
@@ -61,20 +61,39 @@ function createTheme(options = {},
61
61
  } : undefined)
62
62
  };
63
63
  if (cssVariables === false) {
64
- const theme = (0, _createThemeNoVars.default)(options, ...args);
65
64
  if (!('colorSchemes' in options)) {
66
- return theme;
65
+ // Behaves exactly as v5
66
+ return (0, _createThemeNoVars.default)(options, ...args);
67
67
  }
68
+ let paletteOptions = palette;
69
+ if (!('palette' in options)) {
70
+ if (colorSchemesInput[defaultColorSchemeInput]) {
71
+ if (colorSchemesInput[defaultColorSchemeInput] !== true) {
72
+ paletteOptions = colorSchemesInput[defaultColorSchemeInput].palette;
73
+ } else if (defaultColorSchemeInput === 'dark') {
74
+ // @ts-ignore to prevent the module augmentation test from failing
75
+ paletteOptions = {
76
+ mode: 'dark'
77
+ };
78
+ }
79
+ }
80
+ }
81
+ const theme = (0, _createThemeNoVars.default)({
82
+ ...options,
83
+ palette: paletteOptions
84
+ }, ...args);
68
85
  theme.defaultColorScheme = defaultColorSchemeInput;
69
86
  theme.colorSchemes = colorSchemesInput;
70
87
  if (theme.palette.mode === 'light') {
71
88
  theme.colorSchemes.light = {
89
+ ...(colorSchemesInput.light !== true && colorSchemesInput.light),
72
90
  palette: theme.palette
73
91
  };
74
92
  attachColorScheme(theme, 'dark', colorSchemesInput.dark);
75
93
  }
76
94
  if (theme.palette.mode === 'dark') {
77
95
  theme.colorSchemes.dark = {
96
+ ...(colorSchemesInput.dark !== true && colorSchemesInput.dark),
78
97
  palette: theme.palette
79
98
  };
80
99
  attachColorScheme(theme, 'light', colorSchemesInput.light);
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.preReleaseNumber = exports.preReleaseLabel = exports.patch = exports.minor = exports.major = exports.default = void 0;
7
- const version = exports.version = "6.0.1";
7
+ const version = exports.version = "6.0.2";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("0");
10
- const patch = exports.patch = Number("1");
10
+ const patch = exports.patch = Number("2");
11
11
  const preReleaseLabel = exports.preReleaseLabel = undefined || null;
12
12
  const preReleaseNumber = exports.preReleaseNumber = Number(undefined) || null;
13
13
  var _default = exports.default = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "6.0.1",
3
+ "version": "6.0.2",
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.0.1",
39
- "@mui/system": "^6.0.1",
38
+ "@mui/core-downloads-tracker": "^6.0.2",
40
39
  "@mui/types": "^7.2.16",
41
- "@mui/utils": "^6.0.1"
40
+ "@mui/utils": "^6.0.2",
41
+ "@mui/system": "^6.0.2"
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.0.1"
49
+ "@mui/material-pigment-css": "^6.0.2"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -11,7 +11,7 @@ function attachColorScheme(theme, scheme, colorScheme) {
11
11
  theme.colorSchemes[scheme] = {
12
12
  ...(colorScheme !== true && colorScheme),
13
13
  palette: createPalette({
14
- ...(colorScheme === true ? {} : colorScheme),
14
+ ...(colorScheme === true ? {} : colorScheme.palette),
15
15
  mode: scheme
16
16
  }) // cast type to skip module augmentation test
17
17
  };
@@ -48,20 +48,39 @@ export default function createTheme(options = {},
48
48
  } : undefined)
49
49
  };
50
50
  if (cssVariables === false) {
51
- const theme = createThemeNoVars(options, ...args);
52
51
  if (!('colorSchemes' in options)) {
53
- return theme;
52
+ // Behaves exactly as v5
53
+ return createThemeNoVars(options, ...args);
54
54
  }
55
+ let paletteOptions = palette;
56
+ if (!('palette' in options)) {
57
+ if (colorSchemesInput[defaultColorSchemeInput]) {
58
+ if (colorSchemesInput[defaultColorSchemeInput] !== true) {
59
+ paletteOptions = colorSchemesInput[defaultColorSchemeInput].palette;
60
+ } else if (defaultColorSchemeInput === 'dark') {
61
+ // @ts-ignore to prevent the module augmentation test from failing
62
+ paletteOptions = {
63
+ mode: 'dark'
64
+ };
65
+ }
66
+ }
67
+ }
68
+ const theme = createThemeNoVars({
69
+ ...options,
70
+ palette: paletteOptions
71
+ }, ...args);
55
72
  theme.defaultColorScheme = defaultColorSchemeInput;
56
73
  theme.colorSchemes = colorSchemesInput;
57
74
  if (theme.palette.mode === 'light') {
58
75
  theme.colorSchemes.light = {
76
+ ...(colorSchemesInput.light !== true && colorSchemesInput.light),
59
77
  palette: theme.palette
60
78
  };
61
79
  attachColorScheme(theme, 'dark', colorSchemesInput.dark);
62
80
  }
63
81
  if (theme.palette.mode === 'dark') {
64
82
  theme.colorSchemes.dark = {
83
+ ...(colorSchemesInput.dark !== true && colorSchemesInput.dark),
65
84
  palette: theme.palette
66
85
  };
67
86
  attachColorScheme(theme, 'light', colorSchemesInput.light);
package/utils/types.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import { SxProps } from '@mui/system';
2
2
  import { SlotComponentProps } from '@mui/utils';
3
+ import { Theme } from '../styles';
3
4
  export type { EventHandlers, WithOptionalOwnerState, SlotComponentProps, SlotComponentPropsWithSlotState, } from '@mui/utils';
4
5
  export type SlotCommonProps = {
5
6
  component?: React.ElementType;
6
- sx?: SxProps;
7
+ sx?: SxProps<Theme>;
7
8
  };
8
9
  export type SlotProps<TSlotComponent extends React.ElementType, TOverrides, TOwnerState> = SlotComponentProps<TSlotComponent, SlotCommonProps & TOverrides, TOwnerState>;
9
10
  /**
package/version/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export const version = "6.0.1";
1
+ export const version = "6.0.2";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("0");
4
- export const patch = Number("1");
4
+ export const patch = Number("2");
5
5
  export const preReleaseLabel = undefined || null;
6
6
  export const preReleaseNumber = Number(undefined) || null;
7
7
  export default version;