@mui/material 6.4.9 → 6.4.11

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.
@@ -93,7 +93,14 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
93
93
  const maxAvatars = Math.min(children.length, clampedMax - 1);
94
94
  const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
95
95
  const extraAvatarsElement = renderSurplus ? renderSurplus(extraAvatars) : `+${extraAvatars}`;
96
- const marginValue = ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined ? SPACINGS[ownerState.spacing] : -ownerState.spacing || -8;
96
+ let marginValue;
97
+ if (ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined) {
98
+ marginValue = SPACINGS[ownerState.spacing];
99
+ } else if (ownerState.spacing === 0) {
100
+ marginValue = 0;
101
+ } else {
102
+ marginValue = -ownerState.spacing || SPACINGS.medium;
103
+ }
97
104
  const externalForwardedProps = {
98
105
  slots,
99
106
  slotProps: {
@@ -118,7 +125,8 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
118
125
  ref: ref,
119
126
  ...other,
120
127
  style: {
121
- '--AvatarGroup-spacing': marginValue ? `${marginValue}px` : undefined,
128
+ '--AvatarGroup-spacing': `${marginValue}px`,
129
+ // marginValue is always defined
122
130
  ...other.style
123
131
  },
124
132
  children: [extraAvatars ? /*#__PURE__*/_jsx(SurplusSlot, {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.4.11
4
+
5
+ _Apr 9, 2025_
6
+
7
+ A big thanks to the 3 contributors who made this release possible.
8
+
9
+ ### `@mui/material@6.4.11`
10
+
11
+ - [AvatarGroup] Fix `spacing` prop ignoring value `0` (#45845) @Kartik-Murthy
12
+ - [Dialog] Deprecate composed classes (#45814) @sai6855
13
+
14
+ ### `@mui/styled-engine@6.4.11`
15
+
16
+ - Add caching to improve performance for running tests with Jest (#45855) @siriwatknp
17
+
18
+ ### Docs
19
+
20
+ - Add missing v7 docs banner (#45842) @DiegoAndai
21
+ - Add v7 is here banner (#45838) @DiegoAndai
22
+ - Fix lab version install instructions (#45770) @DiegoAndai
23
+
24
+ All contributors of this release in alphabetical order: @DiegoAndai, @Kartik-Murthy, @sai6855
25
+
26
+ ## 6.4.10
27
+
28
+ <!-- generated comparing v6.4.9..v6.x -->
29
+
30
+ _Mar 31, 2025_
31
+
32
+ A big thanks to the 4 contributors who made this release possible.
33
+
34
+ ### `@mui/material@6.4.10`
35
+
36
+ - [Autocomplete] Prevent shrink animation in controlled Autocomplete when initial `value` is provided (#45735) @imadx
37
+ - [Popover] Allow `null` in `anchorEl` function return type (#45723) @eduter
38
+
39
+ ### Docs
40
+
41
+ - Fix new React project link, CRA deprecated (#45669) @oliviertassinari
42
+
43
+ ### Core
44
+
45
+ - [utils] Support cleanup callbacks in useForkRef (#45733) @DiegoAndai
46
+
47
+ All contributors of this release in alphabetical order: @DiegoAndai, @eduter, @imadx, @oliviertassinari
48
+
3
49
  ## 6.4.9
4
50
 
5
51
  <!-- generated comparing v6.4.8..v6.x -->
@@ -9,9 +9,13 @@ export interface DialogClasses {
9
9
  container: string;
10
10
  /** Styles applied to the Paper component. */
11
11
  paper: string;
12
- /** Styles applied to the Paper component if `scroll="paper"`. */
12
+ /** Styles applied to the Paper component if `scroll="paper"`.
13
+ * @deprecated Combine the [.MuiDialog-paper](/material-ui/api/dialog/#dialog-classes-paper) and [.MuiDialog-scrollPaper](/material-ui/api/dialog/#dialog-classes-scrollPaper) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
14
+ */
13
15
  paperScrollPaper: string;
14
- /** Styles applied to the Paper component if `scroll="body"`. */
16
+ /** Styles applied to the Paper component if `scroll="body"`.
17
+ * @deprecated Combine the [.MuiDialog-paper](/material-ui/api/dialog/#dialog-classes-paper) and [.MuiDialog-scrollBody](/material-ui/api/dialog/#dialog-classes-scrollBody) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
18
+ */
15
19
  paperScrollBody: string;
16
20
  /** Styles applied to the Paper component if `maxWidth=false`. */
17
21
  paperWidthFalse: string;
@@ -108,9 +108,8 @@ export interface PopoverProps
108
108
  anchorEl?:
109
109
  | null
110
110
  | Element
111
- | (() => Element)
112
111
  | PopoverVirtualElement
113
- | (() => PopoverVirtualElement);
112
+ | (() => Element | PopoverVirtualElement | null);
114
113
  /**
115
114
  * This is the point on the anchor where the popover's
116
115
  * `anchorEl` will attach to. This is not used when the
@@ -276,7 +276,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
276
276
  const handleResize = debounce(() => {
277
277
  setPositioningStyles();
278
278
  });
279
- const containerWindow = ownerWindow(anchorEl);
279
+ const containerWindow = ownerWindow(resolveAnchorEl(anchorEl));
280
280
  containerWindow.addEventListener('resize', handleResize);
281
281
  return () => {
282
282
  handleResize.clear();
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.9
2
+ * @mui/material v6.4.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -93,7 +93,14 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
93
93
  const maxAvatars = Math.min(children.length, clampedMax - 1);
94
94
  const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
95
95
  const extraAvatarsElement = renderSurplus ? renderSurplus(extraAvatars) : `+${extraAvatars}`;
96
- const marginValue = ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined ? SPACINGS[ownerState.spacing] : -ownerState.spacing || -8;
96
+ let marginValue;
97
+ if (ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined) {
98
+ marginValue = SPACINGS[ownerState.spacing];
99
+ } else if (ownerState.spacing === 0) {
100
+ marginValue = 0;
101
+ } else {
102
+ marginValue = -ownerState.spacing || SPACINGS.medium;
103
+ }
97
104
  const externalForwardedProps = {
98
105
  slots,
99
106
  slotProps: {
@@ -118,7 +125,8 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
118
125
  ref: ref,
119
126
  ...other,
120
127
  style: {
121
- '--AvatarGroup-spacing': marginValue ? `${marginValue}px` : undefined,
128
+ '--AvatarGroup-spacing': `${marginValue}px`,
129
+ // marginValue is always defined
122
130
  ...other.style
123
131
  },
124
132
  children: [extraAvatars ? /*#__PURE__*/_jsx(SurplusSlot, {
@@ -276,7 +276,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
276
276
  const handleResize = debounce(() => {
277
277
  setPositioningStyles();
278
278
  });
279
- const containerWindow = ownerWindow(anchorEl);
279
+ const containerWindow = ownerWindow(resolveAnchorEl(anchorEl));
280
280
  containerWindow.addEventListener('resize', handleResize);
281
281
  return () => {
282
282
  handleResize.clear();
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.9
2
+ * @mui/material v6.4.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -121,8 +121,8 @@ function useAutocomplete(props) {
121
121
  const highlightedIndexRef = React.useRef(defaultHighlighted);
122
122
 
123
123
  // Calculate the initial inputValue on mount only.
124
- // Using useRef since defaultValue doesn't need to update inputValue dynamically.
125
- const initialInputValue = React.useRef(getInputValue(defaultValue, multiple, getOptionLabel)).current;
124
+ // useRef ensures it doesn't update dynamically with defaultValue or value props.
125
+ const initialInputValue = React.useRef(getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel)).current;
126
126
  const [value, setValueState] = useControlled({
127
127
  controlled: valueProp,
128
128
  default: defaultValue,
@@ -1,6 +1,6 @@
1
- export const version = "6.4.9";
1
+ export const version = "6.4.11";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("4");
4
- export const patch = Number("9");
4
+ export const patch = Number("11");
5
5
  export const prerelease = undefined;
6
6
  export default version;
@@ -100,7 +100,14 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
100
100
  const maxAvatars = Math.min(children.length, clampedMax - 1);
101
101
  const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
102
102
  const extraAvatarsElement = renderSurplus ? renderSurplus(extraAvatars) : `+${extraAvatars}`;
103
- const marginValue = ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined ? SPACINGS[ownerState.spacing] : -ownerState.spacing || -8;
103
+ let marginValue;
104
+ if (ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined) {
105
+ marginValue = SPACINGS[ownerState.spacing];
106
+ } else if (ownerState.spacing === 0) {
107
+ marginValue = 0;
108
+ } else {
109
+ marginValue = -ownerState.spacing || SPACINGS.medium;
110
+ }
104
111
  const externalForwardedProps = {
105
112
  slots,
106
113
  slotProps: {
@@ -125,7 +132,8 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
125
132
  ref: ref,
126
133
  ...other,
127
134
  style: {
128
- '--AvatarGroup-spacing': marginValue ? `${marginValue}px` : undefined,
135
+ '--AvatarGroup-spacing': `${marginValue}px`,
136
+ // marginValue is always defined
129
137
  ...other.style
130
138
  },
131
139
  children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsx)(SurplusSlot, {
@@ -285,7 +285,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
285
285
  const handleResize = (0, _debounce.default)(() => {
286
286
  setPositioningStyles();
287
287
  });
288
- const containerWindow = (0, _ownerWindow.default)(anchorEl);
288
+ const containerWindow = (0, _ownerWindow.default)(resolveAnchorEl(anchorEl));
289
289
  containerWindow.addEventListener('resize', handleResize);
290
290
  return () => {
291
291
  handleResize.clear();
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.9
2
+ * @mui/material v6.4.11
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -127,8 +127,8 @@ function useAutocomplete(props) {
127
127
  const highlightedIndexRef = React.useRef(defaultHighlighted);
128
128
 
129
129
  // Calculate the initial inputValue on mount only.
130
- // Using useRef since defaultValue doesn't need to update inputValue dynamically.
131
- const initialInputValue = React.useRef(getInputValue(defaultValue, multiple, getOptionLabel)).current;
130
+ // useRef ensures it doesn't update dynamically with defaultValue or value props.
131
+ const initialInputValue = React.useRef(getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel)).current;
132
132
  const [value, setValueState] = (0, _utils.unstable_useControlled)({
133
133
  controlled: valueProp,
134
134
  default: defaultValue,
@@ -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.4.9";
7
+ const version = exports.version = "6.4.11";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("4");
10
- const patch = exports.patch = Number("9");
10
+ const patch = exports.patch = Number("11");
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.4.9",
3
+ "version": "6.4.11",
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": "^19.0.0",
37
37
  "react-transition-group": "^4.4.5",
38
+ "@mui/core-downloads-tracker": "^6.4.11",
39
+ "@mui/system": "^6.4.11",
38
40
  "@mui/types": "~7.2.24",
39
- "@mui/system": "^6.4.9",
40
- "@mui/utils": "^6.4.8",
41
- "@mui/core-downloads-tracker": "^6.4.9"
41
+ "@mui/utils": "^6.4.9"
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.4.9"
49
+ "@mui/material-pigment-css": "^6.4.11"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -121,8 +121,8 @@ function useAutocomplete(props) {
121
121
  const highlightedIndexRef = React.useRef(defaultHighlighted);
122
122
 
123
123
  // Calculate the initial inputValue on mount only.
124
- // Using useRef since defaultValue doesn't need to update inputValue dynamically.
125
- const initialInputValue = React.useRef(getInputValue(defaultValue, multiple, getOptionLabel)).current;
124
+ // useRef ensures it doesn't update dynamically with defaultValue or value props.
125
+ const initialInputValue = React.useRef(getInputValue(defaultValue ?? valueProp, multiple, getOptionLabel)).current;
126
126
  const [value, setValueState] = useControlled({
127
127
  controlled: valueProp,
128
128
  default: defaultValue,
package/version/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export const version = "6.4.9";
1
+ export const version = "6.4.11";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("4");
4
- export const patch = Number("9");
4
+ export const patch = Number("11");
5
5
  export const prerelease = undefined;
6
6
  export default version;