@mui/material 6.4.7 → 6.4.9

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 (222) hide show
  1. package/Accordion/Accordion.d.ts +20 -5
  2. package/Accordion/Accordion.js +18 -6
  3. package/AccordionActions/AccordionActions.d.ts +2 -2
  4. package/AccordionDetails/AccordionDetails.d.ts +2 -2
  5. package/AccordionSummary/AccordionSummary.d.ts +62 -7
  6. package/AccordionSummary/AccordionSummary.js +67 -16
  7. package/Alert/Alert.d.ts +3 -3
  8. package/AlertTitle/AlertTitle.d.ts +3 -3
  9. package/AppBar/AppBar.d.ts +3 -3
  10. package/Autocomplete/Autocomplete.d.ts +2 -2
  11. package/Autocomplete/Autocomplete.js +1 -1
  12. package/Avatar/Avatar.d.ts +2 -2
  13. package/AvatarGroup/AvatarGroup.d.ts +2 -2
  14. package/Backdrop/Backdrop.d.ts +3 -3
  15. package/Badge/Badge.d.ts +3 -3
  16. package/BottomNavigation/BottomNavigation.d.ts +2 -2
  17. package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
  18. package/Box/Box.d.ts +2 -2
  19. package/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  20. package/Button/Button.d.ts +4 -4
  21. package/ButtonBase/ButtonBase.d.ts +2 -2
  22. package/ButtonGroup/ButtonGroup.d.ts +2 -2
  23. package/CHANGELOG.md +78 -4
  24. package/Card/Card.d.ts +3 -3
  25. package/CardActionArea/CardActionArea.d.ts +3 -3
  26. package/CardActions/CardActions.d.ts +2 -2
  27. package/CardContent/CardContent.d.ts +2 -2
  28. package/CardHeader/CardHeader.d.ts +2 -2
  29. package/CardMedia/CardMedia.d.ts +2 -2
  30. package/Checkbox/Checkbox.d.ts +4 -4
  31. package/Chip/Chip.d.ts +2 -2
  32. package/CircularProgress/CircularProgress.d.ts +2 -2
  33. package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
  34. package/ClickAwayListener/ClickAwayListener.js +3 -3
  35. package/Collapse/Collapse.d.ts +5 -5
  36. package/Container/Container.d.ts +2 -2
  37. package/CssBaseline/CssBaseline.d.ts +2 -2
  38. package/Dialog/Dialog.d.ts +3 -3
  39. package/DialogActions/DialogActions.d.ts +2 -2
  40. package/DialogContent/DialogContent.d.ts +2 -2
  41. package/DialogContentText/DialogContentText.d.ts +3 -3
  42. package/DialogTitle/DialogTitle.d.ts +3 -3
  43. package/Divider/Divider.d.ts +3 -3
  44. package/Drawer/Drawer.d.ts +3 -3
  45. package/Fab/Fab.d.ts +3 -3
  46. package/Fade/Fade.d.ts +3 -3
  47. package/FilledInput/FilledInput.d.ts +3 -3
  48. package/FormControl/FormControl.d.ts +6 -6
  49. package/FormControlLabel/FormControlLabel.d.ts +4 -4
  50. package/FormGroup/FormGroup.d.ts +3 -3
  51. package/FormHelperText/FormHelperText.d.ts +2 -2
  52. package/FormLabel/FormLabel.d.ts +4 -4
  53. package/GlobalStyles/GlobalStyles.d.ts +2 -2
  54. package/Grid/Grid.d.ts +2 -2
  55. package/Grid2/Grid2.d.ts +2 -2
  56. package/Grid2/Grid2.js +2 -2
  57. package/Grow/Grow.d.ts +5 -5
  58. package/Hidden/Hidden.d.ts +2 -2
  59. package/Icon/Icon.d.ts +3 -3
  60. package/IconButton/IconButton.d.ts +4 -4
  61. package/ImageList/ImageList.d.ts +2 -2
  62. package/ImageListItem/ImageListItem.d.ts +2 -2
  63. package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
  64. package/Input/Input.d.ts +3 -3
  65. package/InputAdornment/InputAdornment.d.ts +2 -2
  66. package/InputBase/InputBase.d.ts +2 -2
  67. package/InputLabel/InputLabel.d.ts +3 -3
  68. package/LinearProgress/LinearProgress.d.ts +2 -2
  69. package/Link/Link.d.ts +4 -4
  70. package/List/List.d.ts +3 -3
  71. package/ListItem/ListItem.d.ts +3 -3
  72. package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
  73. package/ListItemButton/ListItemButton.d.ts +3 -3
  74. package/ListItemIcon/ListItemIcon.d.ts +2 -2
  75. package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
  76. package/ListItemText/ListItemText.d.ts +12 -2
  77. package/ListItemText/ListItemText.js +14 -5
  78. package/ListSubheader/ListSubheader.d.ts +2 -2
  79. package/Menu/Menu.d.ts +4 -4
  80. package/MenuItem/MenuItem.d.ts +3 -3
  81. package/MenuList/MenuList.d.ts +4 -4
  82. package/MobileStepper/MobileStepper.d.ts +3 -3
  83. package/Modal/Modal.d.ts +7 -7
  84. package/NativeSelect/NativeSelect.d.ts +3 -3
  85. package/NoSsr/NoSsr.d.ts +2 -2
  86. package/NoSsr/NoSsr.js +2 -2
  87. package/OutlinedInput/OutlinedInput.d.ts +3 -3
  88. package/Pagination/Pagination.d.ts +2 -2
  89. package/PaginationItem/PaginationItem.d.ts +2 -2
  90. package/Paper/Paper.d.ts +3 -3
  91. package/PigmentContainer/PigmentContainer.d.ts +2 -2
  92. package/PigmentContainer/PigmentContainer.js +2 -2
  93. package/PigmentGrid/PigmentGrid.d.ts +2 -2
  94. package/PigmentGrid/PigmentGrid.js +2 -2
  95. package/PigmentHidden/PigmentHidden.d.ts +2 -2
  96. package/PigmentHidden/PigmentHidden.js +2 -2
  97. package/PigmentStack/PigmentStack.d.ts +2 -2
  98. package/PigmentStack/PigmentStack.js +2 -2
  99. package/Popover/Popover.d.ts +4 -4
  100. package/Popper/Popper.d.ts +4 -4
  101. package/Popper/Popper.js +4 -4
  102. package/Portal/Portal.d.ts +2 -2
  103. package/Portal/Portal.js +2 -2
  104. package/README.md +4 -2
  105. package/Radio/Radio.d.ts +3 -3
  106. package/RadioGroup/RadioGroup.d.ts +3 -3
  107. package/Rating/Rating.d.ts +2 -2
  108. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
  109. package/Select/Select.d.ts +3 -3
  110. package/Skeleton/Skeleton.d.ts +2 -2
  111. package/Slide/Slide.d.ts +4 -4
  112. package/Slider/Slider.d.ts +2 -2
  113. package/Snackbar/Snackbar.d.ts +2 -2
  114. package/Snackbar/Snackbar.js +7 -1
  115. package/SnackbarContent/SnackbarContent.d.ts +3 -3
  116. package/SpeedDial/SpeedDial.d.ts +12 -2
  117. package/SpeedDial/SpeedDial.js +40 -11
  118. package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
  119. package/SpeedDialAction/SpeedDialAction.js +1 -1
  120. package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
  121. package/Stack/Stack.d.ts +2 -2
  122. package/Step/Step.d.ts +2 -2
  123. package/StepButton/StepButton.d.ts +3 -3
  124. package/StepConnector/StepConnector.d.ts +2 -2
  125. package/StepContent/StepContent.d.ts +2 -2
  126. package/StepIcon/StepIcon.d.ts +3 -3
  127. package/StepLabel/StepLabel.d.ts +21 -3
  128. package/StepLabel/StepLabel.js +14 -5
  129. package/Stepper/Stepper.d.ts +2 -2
  130. package/SvgIcon/SvgIcon.d.ts +3 -3
  131. package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
  132. package/Switch/Switch.d.ts +78 -5
  133. package/Switch/Switch.js +71 -9
  134. package/Tab/Tab.d.ts +3 -3
  135. package/TabScrollButton/TabScrollButton.d.ts +2 -2
  136. package/Table/Table.d.ts +2 -2
  137. package/TableBody/TableBody.d.ts +2 -2
  138. package/TableCell/TableCell.d.ts +2 -2
  139. package/TableContainer/TableContainer.d.ts +2 -2
  140. package/TableFooter/TableFooter.d.ts +2 -2
  141. package/TableHead/TableHead.d.ts +2 -2
  142. package/TablePagination/TablePagination.d.ts +4 -4
  143. package/TableRow/TableRow.d.ts +2 -2
  144. package/TableSortLabel/TableSortLabel.d.ts +3 -3
  145. package/Tabs/Tabs.d.ts +2 -2
  146. package/Tabs/Tabs.js +4 -0
  147. package/TextField/TextField.d.ts +40 -10
  148. package/TextField/TextField.js +22 -11
  149. package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
  150. package/TextareaAutosize/TextareaAutosize.js +28 -17
  151. package/ToggleButton/ToggleButton.d.ts +3 -3
  152. package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
  153. package/Toolbar/Toolbar.d.ts +2 -2
  154. package/Tooltip/Tooltip.d.ts +3 -15
  155. package/Tooltip/Tooltip.js +1 -1
  156. package/Typography/Typography.d.ts +3 -3
  157. package/Zoom/Zoom.d.ts +3 -3
  158. package/index.js +1 -1
  159. package/modern/Accordion/Accordion.js +18 -6
  160. package/modern/AccordionSummary/AccordionSummary.js +67 -16
  161. package/modern/Autocomplete/Autocomplete.js +1 -1
  162. package/modern/ClickAwayListener/ClickAwayListener.js +3 -3
  163. package/modern/Grid2/Grid2.js +2 -2
  164. package/modern/ListItemText/ListItemText.js +14 -5
  165. package/modern/NoSsr/NoSsr.js +2 -2
  166. package/modern/PigmentContainer/PigmentContainer.js +2 -2
  167. package/modern/PigmentGrid/PigmentGrid.js +2 -2
  168. package/modern/PigmentHidden/PigmentHidden.js +2 -2
  169. package/modern/PigmentStack/PigmentStack.js +2 -2
  170. package/modern/Popper/Popper.js +4 -4
  171. package/modern/Portal/Portal.js +2 -2
  172. package/modern/Snackbar/Snackbar.js +7 -1
  173. package/modern/SpeedDial/SpeedDial.js +40 -11
  174. package/modern/SpeedDialAction/SpeedDialAction.js +1 -1
  175. package/modern/StepLabel/StepLabel.js +14 -5
  176. package/modern/Switch/Switch.js +71 -9
  177. package/modern/Tabs/Tabs.js +4 -0
  178. package/modern/TextField/TextField.js +22 -11
  179. package/modern/TextareaAutosize/TextareaAutosize.js +28 -17
  180. package/modern/Tooltip/Tooltip.js +1 -1
  181. package/modern/index.js +1 -1
  182. package/modern/styles/ThemeProvider.js +11 -0
  183. package/modern/styles/createThemeNoVars.js +1 -3
  184. package/modern/useAutocomplete/useAutocomplete.js +3 -3
  185. package/modern/useScrollTrigger/useScrollTrigger.js +3 -0
  186. package/modern/version/index.js +2 -2
  187. package/node/Accordion/Accordion.js +18 -6
  188. package/node/AccordionSummary/AccordionSummary.js +67 -16
  189. package/node/Autocomplete/Autocomplete.js +1 -1
  190. package/node/ClickAwayListener/ClickAwayListener.js +3 -3
  191. package/node/Grid2/Grid2.js +2 -2
  192. package/node/ListItemText/ListItemText.js +14 -5
  193. package/node/NoSsr/NoSsr.js +2 -2
  194. package/node/PigmentContainer/PigmentContainer.js +2 -2
  195. package/node/PigmentGrid/PigmentGrid.js +2 -2
  196. package/node/PigmentHidden/PigmentHidden.js +2 -2
  197. package/node/PigmentStack/PigmentStack.js +2 -2
  198. package/node/Popper/Popper.js +4 -4
  199. package/node/Portal/Portal.js +2 -2
  200. package/node/Snackbar/Snackbar.js +7 -1
  201. package/node/SpeedDial/SpeedDial.js +40 -11
  202. package/node/SpeedDialAction/SpeedDialAction.js +1 -1
  203. package/node/StepLabel/StepLabel.js +14 -5
  204. package/node/Switch/Switch.js +71 -9
  205. package/node/Tabs/Tabs.js +4 -0
  206. package/node/TextField/TextField.js +22 -11
  207. package/node/TextareaAutosize/TextareaAutosize.js +27 -16
  208. package/node/Tooltip/Tooltip.js +1 -1
  209. package/node/index.js +1 -1
  210. package/node/styles/ThemeProvider.js +11 -0
  211. package/node/styles/createThemeNoVars.js +1 -3
  212. package/node/useAutocomplete/useAutocomplete.js +3 -3
  213. package/node/useScrollTrigger/useScrollTrigger.js +3 -0
  214. package/node/version/index.js +2 -2
  215. package/package.json +6 -6
  216. package/styles/ThemeProvider.js +11 -0
  217. package/styles/createThemeNoVars.js +1 -3
  218. package/useAutocomplete/useAutocomplete.d.ts +2 -2
  219. package/useAutocomplete/useAutocomplete.js +3 -3
  220. package/useScrollTrigger/useScrollTrigger.d.ts +1 -1
  221. package/useScrollTrigger/useScrollTrigger.js +3 -0
  222. package/version/index.js +2 -2
@@ -167,6 +167,25 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
167
167
  }
168
168
  inputAdditionalProps['aria-describedby'] = undefined;
169
169
  }
170
+ const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
171
+ elementType: TextFieldRoot,
172
+ shouldForwardComponentProp: true,
173
+ externalForwardedProps: {
174
+ ...externalForwardedProps,
175
+ ...other
176
+ },
177
+ ownerState,
178
+ className: (0, _clsx.default)(classes.root, className),
179
+ ref,
180
+ additionalProps: {
181
+ disabled,
182
+ error,
183
+ fullWidth,
184
+ required,
185
+ color,
186
+ variant
187
+ }
188
+ });
170
189
  const [InputSlot, inputProps] = (0, _useSlot.default)('input', {
171
190
  elementType: InputComponent,
172
191
  externalForwardedProps,
@@ -218,17 +237,8 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
218
237
  },
219
238
  ...inputProps
220
239
  });
221
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextFieldRoot, {
222
- className: (0, _clsx.default)(classes.root, className),
223
- disabled: disabled,
224
- error: error,
225
- fullWidth: fullWidth,
226
- ref: ref,
227
- required: required,
228
- color: color,
229
- variant: variant,
230
- ownerState: ownerState,
231
- ...other,
240
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
241
+ ...rootProps,
232
242
  children: [label != null && label !== '' && /*#__PURE__*/(0, _jsxRuntime.jsx)(InputLabelSlot, {
233
243
  htmlFor: id,
234
244
  id: inputLabelId,
@@ -430,6 +440,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
430
440
  htmlInput: _propTypes.default.elementType,
431
441
  input: _propTypes.default.elementType,
432
442
  inputLabel: _propTypes.default.elementType,
443
+ root: _propTypes.default.elementType,
433
444
  select: _propTypes.default.elementType
434
445
  }),
435
446
  /**
@@ -44,11 +44,11 @@ function isEmpty(obj) {
44
44
  *
45
45
  * Demos:
46
46
  *
47
- * - [Textarea Autosize](https://mui.com/material-ui/react-textarea-autosize/)
47
+ * - [Textarea Autosize](https://v6.mui.com/material-ui/react-textarea-autosize/)
48
48
  *
49
49
  * API:
50
50
  *
51
- * - [TextareaAutosize API](https://mui.com/material-ui/api/textarea-autosize/)
51
+ * - [TextareaAutosize API](https://v6.mui.com/material-ui/api/textarea-autosize/)
52
52
  */
53
53
  const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize(props, forwardedRef) {
54
54
  const {
@@ -119,6 +119,15 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
119
119
  overflowing
120
120
  };
121
121
  }, [maxRows, minRows, props.placeholder]);
122
+ const didHeightChange = (0, _utils.unstable_useEventCallback)(() => {
123
+ const textarea = textareaRef.current;
124
+ const textareaStyles = calculateTextareaStyles();
125
+ if (!textarea || !textareaStyles || isEmpty(textareaStyles)) {
126
+ return false;
127
+ }
128
+ const outerHeightStyle = textareaStyles.outerHeightStyle;
129
+ return heightRef.current != null && heightRef.current !== outerHeightStyle;
130
+ });
122
131
  const syncHeight = React.useCallback(() => {
123
132
  const textarea = textareaRef.current;
124
133
  const textareaStyles = calculateTextareaStyles();
@@ -134,37 +143,39 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
134
143
  }, [calculateTextareaStyles]);
135
144
  const frameRef = React.useRef(-1);
136
145
  (0, _utils.unstable_useEnhancedEffect)(() => {
137
- const debounceHandleResize = (0, _utils.unstable_debounce)(() => syncHeight());
146
+ const debouncedHandleResize = (0, _utils.unstable_debounce)(syncHeight);
138
147
  const textarea = textareaRef?.current;
139
148
  if (!textarea) {
140
149
  return undefined;
141
150
  }
142
151
  const containerWindow = (0, _utils.unstable_ownerWindow)(textarea);
143
- containerWindow.addEventListener('resize', debounceHandleResize);
152
+ containerWindow.addEventListener('resize', debouncedHandleResize);
144
153
  let resizeObserver;
145
154
  if (typeof ResizeObserver !== 'undefined') {
146
155
  resizeObserver = new ResizeObserver(() => {
147
- // avoid "ResizeObserver loop completed with undelivered notifications" error
148
- // by temporarily unobserving the textarea element while manipulating the height
149
- // and reobserving one frame later
150
- resizeObserver.unobserve(textarea);
151
- cancelAnimationFrame(frameRef.current);
152
- syncHeight();
153
- frameRef.current = requestAnimationFrame(() => {
154
- resizeObserver.observe(textarea);
155
- });
156
+ if (didHeightChange()) {
157
+ // avoid "ResizeObserver loop completed with undelivered notifications" error
158
+ // by temporarily unobserving the textarea element while manipulating the height
159
+ // and reobserving one frame later
160
+ resizeObserver.unobserve(textarea);
161
+ cancelAnimationFrame(frameRef.current);
162
+ syncHeight();
163
+ frameRef.current = requestAnimationFrame(() => {
164
+ resizeObserver.observe(textarea);
165
+ });
166
+ }
156
167
  });
157
168
  resizeObserver.observe(textarea);
158
169
  }
159
170
  return () => {
160
- debounceHandleResize.clear();
171
+ debouncedHandleResize.clear();
161
172
  cancelAnimationFrame(frameRef.current);
162
- containerWindow.removeEventListener('resize', debounceHandleResize);
173
+ containerWindow.removeEventListener('resize', debouncedHandleResize);
163
174
  if (resizeObserver) {
164
175
  resizeObserver.disconnect();
165
176
  }
166
177
  };
167
- }, [calculateTextareaStyles, syncHeight]);
178
+ }, [calculateTextareaStyles, syncHeight, didHeightChange]);
168
179
  (0, _utils.unstable_useEnhancedEffect)(() => {
169
180
  syncHeight();
170
181
  });
@@ -849,7 +849,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
849
849
  * Tooltip placement.
850
850
  * @default 'bottom'
851
851
  */
852
- placement: _propTypes.default.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
852
+ placement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
853
853
  /**
854
854
  * The component used for the popper.
855
855
  * @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.7
2
+ * @mui/material v6.4.9
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -24,6 +24,17 @@ function ThemeProvider({
24
24
  }
25
25
  const muiTheme = _identifier.default in theme ? theme[_identifier.default] : theme;
26
26
  if (!('colorSchemes' in muiTheme)) {
27
+ if (!('vars' in muiTheme)) {
28
+ // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
29
+ // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
31
+ theme: {
32
+ ...theme,
33
+ vars: null
34
+ },
35
+ ...props
36
+ });
37
+ }
27
38
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
28
39
  theme: theme,
29
40
  ...props
@@ -34,9 +34,7 @@ function createThemeNoVars(options = {}, ...args) {
34
34
  // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
35
35
  // `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
36
36
  options.generateThemeVars === undefined) {
37
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' +
38
- // #host-reference
39
- 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : (0, _formatMuiErrorMessage2.default)(20));
37
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : (0, _formatMuiErrorMessage2.default)(20));
40
38
  }
41
39
  const palette = (0, _createPalette.default)(paletteInput);
42
40
  const systemTheme = (0, _createTheme.default)(options);
@@ -244,7 +244,7 @@ function useAutocomplete(props) {
244
244
  const setHighlightedIndex = (0, _utils.unstable_useEventCallback)(({
245
245
  event,
246
246
  index,
247
- reason = 'auto'
247
+ reason
248
248
  }) => {
249
249
  highlightedIndexRef.current = index;
250
250
 
@@ -254,7 +254,7 @@ function useAutocomplete(props) {
254
254
  } else {
255
255
  inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
256
256
  }
257
- if (onHighlightChange) {
257
+ if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
258
258
  onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
259
259
  }
260
260
  if (!listboxRef.current) {
@@ -307,7 +307,7 @@ function useAutocomplete(props) {
307
307
  event,
308
308
  diff,
309
309
  direction = 'next',
310
- reason = 'auto'
310
+ reason
311
311
  }) => {
312
312
  if (!popupOpen) {
313
313
  return;
@@ -35,6 +35,9 @@ function useScrollTrigger(options = {}) {
35
35
  const store = React.useRef();
36
36
  const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
37
37
  React.useEffect(() => {
38
+ if (target === null) {
39
+ return setTrigger(false);
40
+ }
38
41
  const handleScroll = () => {
39
42
  setTrigger(getTrigger(store, {
40
43
  target,
@@ -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.7";
7
+ const version = exports.version = "6.4.9";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("4");
10
- const patch = exports.patch = Number("7");
10
+ const patch = exports.patch = Number("9");
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.7",
3
+ "version": "6.4.9",
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/utils": "^6.4.6",
39
- "@mui/system": "^6.4.7",
40
- "@mui/types": "^7.2.21",
41
- "@mui/core-downloads-tracker": "^6.4.7"
38
+ "@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"
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.7"
49
+ "@mui/material-pigment-css": "^6.4.9"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -17,6 +17,17 @@ export default function ThemeProvider({
17
17
  }
18
18
  const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
19
19
  if (!('colorSchemes' in muiTheme)) {
20
+ if (!('vars' in muiTheme)) {
21
+ // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
22
+ // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
23
+ return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
24
+ theme: {
25
+ ...theme,
26
+ vars: null
27
+ },
28
+ ...props
29
+ });
30
+ }
20
31
  return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
21
32
  theme: theme,
22
33
  ...props
@@ -25,9 +25,7 @@ function createThemeNoVars(options = {}, ...args) {
25
25
  // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
26
26
  // `generateThemeVars` is the closest identifier for checking that the `options` is a result of `createTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
27
27
  options.generateThemeVars === undefined) {
28
- throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' +
29
- // #host-reference
30
- 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : _formatMuiErrorMessage(20));
28
+ throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.' : _formatMuiErrorMessage(20));
31
29
  }
32
30
  const palette = createPalette(paletteInput);
33
31
  const systemTheme = systemCreateTheme(options);
@@ -246,7 +246,7 @@ export interface UseAutocompleteProps<
246
246
  *
247
247
  * @param {React.SyntheticEvent} event The event source of the callback.
248
248
  * @param {Value} option The highlighted option.
249
- * @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
249
+ * @param {string} reason Can be: `"keyboard"`, `"mouse"`, `"touch"`.
250
250
  */
251
251
  onHighlightChange?: (
252
252
  event: React.SyntheticEvent,
@@ -312,7 +312,7 @@ export interface UseAutocompleteParameters<
312
312
  FreeSolo extends boolean | undefined,
313
313
  > extends UseAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo> {}
314
314
 
315
- export type AutocompleteHighlightChangeReason = 'keyboard' | 'mouse' | 'auto' | 'touch';
315
+ export type AutocompleteHighlightChangeReason = 'keyboard' | 'mouse' | 'touch';
316
316
 
317
317
  export type AutocompleteChangeReason =
318
318
  | 'createOption'
@@ -238,7 +238,7 @@ function useAutocomplete(props) {
238
238
  const setHighlightedIndex = useEventCallback(({
239
239
  event,
240
240
  index,
241
- reason = 'auto'
241
+ reason
242
242
  }) => {
243
243
  highlightedIndexRef.current = index;
244
244
 
@@ -248,7 +248,7 @@ function useAutocomplete(props) {
248
248
  } else {
249
249
  inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
250
250
  }
251
- if (onHighlightChange) {
251
+ if (onHighlightChange && ['mouse', 'keyboard', 'touch'].includes(reason)) {
252
252
  onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
253
253
  }
254
254
  if (!listboxRef.current) {
@@ -301,7 +301,7 @@ function useAutocomplete(props) {
301
301
  event,
302
302
  diff,
303
303
  direction = 'next',
304
- reason = 'auto'
304
+ reason
305
305
  }) => {
306
306
  if (!popupOpen) {
307
307
  return;
@@ -1,6 +1,6 @@
1
1
  export interface UseScrollTriggerOptions {
2
2
  disableHysteresis?: boolean;
3
- target?: Node | Window;
3
+ target?: Node | Window | null;
4
4
  threshold?: number;
5
5
  }
6
6
 
@@ -29,6 +29,9 @@ export default function useScrollTrigger(options = {}) {
29
29
  const store = React.useRef();
30
30
  const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
31
31
  React.useEffect(() => {
32
+ if (target === null) {
33
+ return setTrigger(false);
34
+ }
32
35
  const handleScroll = () => {
33
36
  setTrigger(getTrigger(store, {
34
37
  target,
package/version/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export const version = "6.4.7";
1
+ export const version = "6.4.9";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("4");
4
- export const patch = Number("7");
4
+ export const patch = Number("9");
5
5
  export const prerelease = undefined;
6
6
  export default version;