@mui/material 6.1.9 → 6.2.0

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 (77) hide show
  1. package/Avatar/Avatar.js +7 -6
  2. package/Box/Box.d.ts +3 -1
  3. package/ButtonBase/ButtonBase.js +21 -22
  4. package/CHANGELOG.md +82 -0
  5. package/ClickAwayListener/ClickAwayListener.js +1 -4
  6. package/FilledInput/FilledInput.js +1 -1
  7. package/FormHelperText/FormHelperText.js +1 -0
  8. package/Grid/Grid.js +2 -2
  9. package/Grid2/Grid2.js +9 -2
  10. package/Hidden/HiddenJs.js +4 -8
  11. package/InputAdornment/InputAdornment.js +1 -0
  12. package/ListItemText/ListItemText.d.ts +36 -1
  13. package/ListItemText/ListItemText.js +46 -7
  14. package/Modal/useModal.js +3 -2
  15. package/Modal/useModal.types.d.ts +5 -1
  16. package/NoSsr/NoSsr.js +2 -5
  17. package/OutlinedInput/NotchedOutline.js +1 -0
  18. package/PigmentGrid/PigmentGrid.js +1 -1
  19. package/Portal/Portal.js +2 -7
  20. package/Select/SelectInput.js +1 -0
  21. package/Slider/SliderValueLabel.d.ts +4 -1
  22. package/Slider/SliderValueLabel.types.d.ts +4 -1
  23. package/Slider/useSlider.js +64 -10
  24. package/Tabs/ScrollbarSize.js +2 -2
  25. package/Unstable_TrapFocus/FocusTrap.types.d.ts +4 -1
  26. package/index.js +1 -1
  27. package/modern/Avatar/Avatar.js +7 -6
  28. package/modern/ButtonBase/ButtonBase.js +21 -22
  29. package/modern/ClickAwayListener/ClickAwayListener.js +1 -4
  30. package/modern/FilledInput/FilledInput.js +1 -1
  31. package/modern/FormHelperText/FormHelperText.js +1 -0
  32. package/modern/Grid/Grid.js +2 -2
  33. package/modern/Grid2/Grid2.js +9 -2
  34. package/modern/Hidden/HiddenJs.js +4 -8
  35. package/modern/InputAdornment/InputAdornment.js +1 -0
  36. package/modern/ListItemText/ListItemText.js +46 -7
  37. package/modern/Modal/useModal.js +3 -2
  38. package/modern/NoSsr/NoSsr.js +2 -5
  39. package/modern/OutlinedInput/NotchedOutline.js +1 -0
  40. package/modern/PigmentGrid/PigmentGrid.js +1 -1
  41. package/modern/Portal/Portal.js +2 -7
  42. package/modern/Select/SelectInput.js +1 -0
  43. package/modern/Slider/useSlider.js +64 -10
  44. package/modern/Tabs/ScrollbarSize.js +2 -2
  45. package/modern/index.js +1 -1
  46. package/modern/styles/createThemeWithVars.js +2 -2
  47. package/modern/utils/useSlot.js +1 -10
  48. package/modern/version/index.js +3 -3
  49. package/node/Avatar/Avatar.js +7 -6
  50. package/node/ButtonBase/ButtonBase.js +21 -22
  51. package/node/ClickAwayListener/ClickAwayListener.js +1 -4
  52. package/node/FilledInput/FilledInput.js +1 -1
  53. package/node/FormHelperText/FormHelperText.js +1 -0
  54. package/node/Grid/Grid.js +2 -2
  55. package/node/Grid2/Grid2.js +9 -2
  56. package/node/Hidden/HiddenJs.js +7 -10
  57. package/node/InputAdornment/InputAdornment.js +1 -0
  58. package/node/ListItemText/ListItemText.js +46 -7
  59. package/node/Modal/useModal.js +3 -2
  60. package/node/NoSsr/NoSsr.js +2 -5
  61. package/node/OutlinedInput/NotchedOutline.js +1 -0
  62. package/node/PigmentGrid/PigmentGrid.js +2 -2
  63. package/node/Portal/Portal.js +2 -7
  64. package/node/Select/SelectInput.js +1 -0
  65. package/node/Slider/useSlider.js +64 -10
  66. package/node/Tabs/ScrollbarSize.js +2 -2
  67. package/node/index.js +1 -1
  68. package/node/styles/createThemeWithVars.js +2 -2
  69. package/node/utils/useSlot.js +1 -10
  70. package/node/version/index.js +3 -3
  71. package/package.json +7 -7
  72. package/styles/createThemeWithVars.js +2 -2
  73. package/useLazyRipple/useLazyRipple.d.ts +1 -1
  74. package/utils/memoTheme.d.ts +1 -1
  75. package/utils/useSlot.d.ts +0 -7
  76. package/utils/useSlot.js +1 -10
  77. package/version/index.js +3 -3
@@ -5,6 +5,9 @@ import { unstable_ownerDocument as ownerDocument, unstable_useControlled as useC
5
5
  import extractEventHandlers from '@mui/utils/extractEventHandlers';
6
6
  import areArraysEqual from "../utils/areArraysEqual.js";
7
7
  const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
8
+ function getNewValue(currentValue, step, direction, min, max) {
9
+ return direction === 1 ? Math.min(currentValue + step, max) : Math.max(currentValue - step, min);
10
+ }
8
11
  function asc(a, b) {
9
12
  return a - b;
10
13
  }
@@ -280,20 +283,65 @@ export function useSlider(parameters) {
280
283
  }
281
284
  };
282
285
  const createHandleHiddenInputKeyDown = otherHandlers => event => {
283
- // The Shift + Up/Down keyboard shortcuts for moving the slider makes sense to be supported
284
- // only if the step is defined. If the step is null, this means tha the marks are used for specifying the valid values.
285
- if (step !== null) {
286
+ if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'PageUp', 'PageDown', 'Home', 'End'].includes(event.key)) {
287
+ event.preventDefault();
286
288
  const index = Number(event.currentTarget.getAttribute('data-index'));
287
289
  const value = values[index];
288
290
  let newValue = null;
289
- if ((event.key === 'ArrowLeft' || event.key === 'ArrowDown') && event.shiftKey || event.key === 'PageDown') {
290
- newValue = Math.max(value - shiftStep, min);
291
- } else if ((event.key === 'ArrowRight' || event.key === 'ArrowUp') && event.shiftKey || event.key === 'PageUp') {
292
- newValue = Math.min(value + shiftStep, max);
291
+ // Keys actions that change the value by more than the most granular `step`
292
+ // value are only applied if the step not `null`.
293
+ // When step is `null`, the `marks` prop is used instead to define valid values.
294
+ if (step != null) {
295
+ const stepSize = event.shiftKey ? shiftStep : step;
296
+ switch (event.key) {
297
+ case 'ArrowUp':
298
+ newValue = getNewValue(value, stepSize, 1, min, max);
299
+ break;
300
+ case 'ArrowRight':
301
+ newValue = getNewValue(value, stepSize, isRtl ? -1 : 1, min, max);
302
+ break;
303
+ case 'ArrowDown':
304
+ newValue = getNewValue(value, stepSize, -1, min, max);
305
+ break;
306
+ case 'ArrowLeft':
307
+ newValue = getNewValue(value, stepSize, isRtl ? 1 : -1, min, max);
308
+ break;
309
+ case 'PageUp':
310
+ newValue = getNewValue(value, shiftStep, 1, min, max);
311
+ break;
312
+ case 'PageDown':
313
+ newValue = getNewValue(value, shiftStep, -1, min, max);
314
+ break;
315
+ case 'Home':
316
+ newValue = min;
317
+ break;
318
+ case 'End':
319
+ newValue = max;
320
+ break;
321
+ default:
322
+ break;
323
+ }
324
+ } else if (marks) {
325
+ const maxMarksValue = marksValues[marksValues.length - 1];
326
+ const currentMarkIndex = marksValues.indexOf(value);
327
+ const decrementKeys = [isRtl ? 'ArrowRight' : 'ArrowLeft', 'ArrowDown', 'PageDown', 'Home'];
328
+ const incrementKeys = [isRtl ? 'ArrowLeft' : 'ArrowRight', 'ArrowUp', 'PageUp', 'End'];
329
+ if (decrementKeys.includes(event.key)) {
330
+ if (currentMarkIndex === 0) {
331
+ newValue = marksValues[0];
332
+ } else {
333
+ newValue = marksValues[currentMarkIndex - 1];
334
+ }
335
+ } else if (incrementKeys.includes(event.key)) {
336
+ if (currentMarkIndex === marksValues.length - 1) {
337
+ newValue = maxMarksValue;
338
+ } else {
339
+ newValue = marksValues[currentMarkIndex + 1];
340
+ }
341
+ }
293
342
  }
294
- if (newValue !== null) {
343
+ if (newValue != null) {
295
344
  changeValue(event, newValue);
296
- event.preventDefault();
297
345
  }
298
346
  }
299
347
  otherHandlers?.onKeyDown?.(event);
@@ -315,6 +363,7 @@ export function useSlider(parameters) {
315
363
  }
316
364
  const createHandleHiddenInputChange = otherHandlers => event => {
317
365
  otherHandlers.onChange?.(event);
366
+ // this handles value change by Pointer or Touch events
318
367
  // @ts-ignore
319
368
  changeValue(event, event.target.valueAsNumber);
320
369
  };
@@ -591,6 +640,10 @@ export function useSlider(parameters) {
591
640
  pointerEvents: active !== -1 && active !== index ? 'none' : undefined
592
641
  };
593
642
  };
643
+ let cssWritingMode;
644
+ if (orientation === 'vertical') {
645
+ cssWritingMode = isRtl ? 'vertical-rl' : 'vertical-lr';
646
+ }
594
647
  const getHiddenInputProps = (externalProps = {}) => {
595
648
  const externalHandlers = extractEventHandlers(externalProps);
596
649
  const ownEventHandlers = {
@@ -622,7 +675,8 @@ export function useSlider(parameters) {
622
675
  direction: isRtl ? 'rtl' : 'ltr',
623
676
  // So that VoiceOver's focus indicator matches the thumb's dimensions
624
677
  width: '100%',
625
- height: '100%'
678
+ height: '100%',
679
+ writingMode: cssWritingMode
626
680
  }
627
681
  };
628
682
  };
@@ -49,8 +49,8 @@ export default function ScrollbarSize(props) {
49
49
  }, [onChange]);
50
50
  return /*#__PURE__*/_jsx("div", {
51
51
  style: styles,
52
- ref: nodeRef,
53
- ...other
52
+ ...other,
53
+ ref: nodeRef
54
54
  });
55
55
  }
56
56
  process.env.NODE_ENV !== "production" ? ScrollbarSize.propTypes = {
@@ -23,7 +23,10 @@ export interface FocusTrapProps {
23
23
  /**
24
24
  * A single child content element.
25
25
  */
26
- children: React.ReactElement<any>;
26
+ children: React.ReactElement<{
27
+ onFocus?: React.FocusEventHandler;
28
+ ref?: React.RefCallback<any> | null;
29
+ }>;
27
30
  /**
28
31
  * If `true`, the focus trap will not automatically shift focus to itself when it opens, and
29
32
  * replace it to the last focused element when it closes.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.9
2
+ * @mui/material v6.2.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -161,21 +161,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
161
161
  ...other
162
162
  } = props;
163
163
  let children = null;
164
+ const ownerState = {
165
+ ...props,
166
+ component,
167
+ variant
168
+ };
164
169
 
165
170
  // Use a hook instead of onError on the img element to support server-side rendering.
166
171
  const loaded = useLoaded({
167
172
  ...imgProps,
173
+ ...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
168
174
  src,
169
175
  srcSet
170
176
  });
171
177
  const hasImg = src || srcSet;
172
178
  const hasImgNotFailing = hasImg && loaded !== 'error';
173
- const ownerState = {
174
- ...props,
175
- colorDefault: !hasImgNotFailing,
176
- component,
177
- variant
178
- };
179
+ ownerState.colorDefault = !hasImgNotFailing;
179
180
  // This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
180
181
  delete ownerState.ownerState;
181
182
  const classes = useUtilityClasses(ownerState);
@@ -136,34 +136,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
136
136
  ripple.pulsate();
137
137
  }
138
138
  }, [disableRipple, focusRipple, focusVisible, ripple]);
139
- function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
140
- return useEventCallback(event => {
141
- if (eventCallback) {
142
- eventCallback(event);
143
- }
144
- const ignore = skipRippleAction;
145
- if (!ignore) {
146
- ripple[rippleAction](event);
147
- }
148
- return true;
149
- });
150
- }
151
- const handleMouseDown = useRippleHandler('start', onMouseDown);
152
- const handleContextMenu = useRippleHandler('stop', onContextMenu);
153
- const handleDragLeave = useRippleHandler('stop', onDragLeave);
154
- const handleMouseUp = useRippleHandler('stop', onMouseUp);
155
- const handleMouseLeave = useRippleHandler('stop', event => {
139
+ const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
140
+ const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
141
+ const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
142
+ const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
143
+ const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
156
144
  if (focusVisible) {
157
145
  event.preventDefault();
158
146
  }
159
147
  if (onMouseLeave) {
160
148
  onMouseLeave(event);
161
149
  }
162
- });
163
- const handleTouchStart = useRippleHandler('start', onTouchStart);
164
- const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
165
- const handleTouchMove = useRippleHandler('stop', onTouchMove);
166
- const handleBlur = useRippleHandler('stop', event => {
150
+ }, disableTouchRipple);
151
+ const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
152
+ const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
153
+ const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
154
+ const handleBlur = useRippleHandler(ripple, 'stop', event => {
167
155
  if (!isFocusVisible(event.target)) {
168
156
  setFocusVisible(false);
169
157
  }
@@ -287,6 +275,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
287
275
  }) : null]
288
276
  });
289
277
  });
278
+ function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
279
+ return useEventCallback(event => {
280
+ if (eventCallback) {
281
+ eventCallback(event);
282
+ }
283
+ if (!skipRippleAction) {
284
+ ripple[rippleAction](event);
285
+ }
286
+ return true;
287
+ });
288
+ }
290
289
  process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
291
290
  // ┌────────────────────────────── Warning ──────────────────────────────┐
292
291
  // │ These PropTypes are generated from the TypeScript type definitions. │
@@ -6,7 +6,6 @@ import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument
6
6
  import getReactElementRef from '@mui/utils/getReactElementRef';
7
7
 
8
8
  // TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
9
  function mapEventPropToEvent(eventProp) {
11
10
  return eventProp.substring(2).toLowerCase();
12
11
  }
@@ -136,9 +135,7 @@ function ClickAwayListener(props) {
136
135
  }
137
136
  return undefined;
138
137
  }, [handleClickAway, mouseEvent]);
139
- return /*#__PURE__*/_jsx(React.Fragment, {
140
- children: /*#__PURE__*/React.cloneElement(children, childrenProps)
141
- });
138
+ return /*#__PURE__*/React.cloneElement(children, childrenProps);
142
139
  }
143
140
  process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
144
141
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -310,7 +310,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
310
310
  root: RootSlot,
311
311
  input: InputSlot
312
312
  },
313
- componentsProps: componentsProps,
313
+ slotProps: componentsProps,
314
314
  fullWidth: fullWidth,
315
315
  inputComponent: inputComponent,
316
316
  multiline: multiline,
@@ -120,6 +120,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
120
120
  children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
121
121
  _span || (_span = /*#__PURE__*/_jsx("span", {
122
122
  className: "notranslate",
123
+ "aria-hidden": true,
123
124
  children: "\u200B"
124
125
  })) : children
125
126
  });
@@ -167,7 +167,7 @@ export function generateRowGap({
167
167
  const themeSpacing = theme.spacing(propValue);
168
168
  if (themeSpacing !== '0px') {
169
169
  return {
170
- marginTop: `-${themeSpacing}`,
170
+ marginTop: `calc(-1 * ${themeSpacing})`,
171
171
  [`& > .${gridClasses.item}`]: {
172
172
  paddingTop: themeSpacing
173
173
  }
@@ -212,7 +212,7 @@ export function generateColumnGap({
212
212
  }, columnSpacingValues, (propValue, breakpoint) => {
213
213
  const themeSpacing = theme.spacing(propValue);
214
214
  if (themeSpacing !== '0px') {
215
- const negativeValue = `-${themeSpacing}`;
215
+ const negativeValue = `calc(-1 * ${themeSpacing})`;
216
216
  return {
217
217
  width: `calc(100% + ${themeSpacing})`,
218
218
  marginLeft: negativeValue,
@@ -5,6 +5,7 @@ import { createGrid as createGrid2 } from '@mui/system/Grid';
5
5
  import requirePropFactory from "../utils/requirePropFactory.js";
6
6
  import { styled } from "../styles/index.js";
7
7
  import { useDefaultProps } from "../DefaultPropsProvider/index.js";
8
+ import useTheme from "../styles/useTheme.js";
8
9
  /**
9
10
  *
10
11
  * Demos:
@@ -19,13 +20,19 @@ const Grid2 = createGrid2({
19
20
  createStyledComponent: styled('div', {
20
21
  name: 'MuiGrid2',
21
22
  slot: 'Root',
22
- overridesResolver: (props, styles) => styles.root
23
+ overridesResolver: (props, styles) => {
24
+ const {
25
+ ownerState
26
+ } = props;
27
+ return [styles.root, ownerState.container && styles.container];
28
+ }
23
29
  }),
24
30
  componentName: 'MuiGrid2',
25
31
  useThemeProps: inProps => useDefaultProps({
26
32
  props: inProps,
27
33
  name: 'MuiGrid2'
28
- })
34
+ }),
35
+ useTheme
29
36
  });
30
37
  process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ = {
31
38
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
 
3
- import * as React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import exactProp from '@mui/utils/exactProp';
6
5
  import withWidth, { isWidthDown, isWidthUp } from "./withWidth.js";
@@ -9,7 +8,6 @@ import useTheme from "../styles/useTheme.js";
9
8
  /**
10
9
  * @ignore - internal component.
11
10
  */
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
11
  function HiddenJs(props) {
14
12
  const {
15
13
  children,
@@ -50,11 +48,9 @@ function HiddenJs(props) {
50
48
  if (!visible) {
51
49
  return null;
52
50
  }
53
- return /*#__PURE__*/_jsx(React.Fragment, {
54
- children: children
55
- });
51
+ return children;
56
52
  }
57
- process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
53
+ HiddenJs.propTypes = {
58
54
  /**
59
55
  * The content of the component.
60
56
  */
@@ -118,8 +114,8 @@ process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
118
114
  */
119
115
  // eslint-disable-next-line react/no-unused-prop-types
120
116
  xsUp: PropTypes.bool
121
- } : void 0;
117
+ };
122
118
  if (process.env.NODE_ENV !== 'production') {
123
- process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = exactProp(HiddenJs.propTypes) : void 0;
119
+ HiddenJs.propTypes = exactProp(HiddenJs.propTypes);
124
120
  }
125
121
  export default withWidth()(HiddenJs);
@@ -128,6 +128,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
128
128
  }) : /*#__PURE__*/_jsxs(React.Fragment, {
129
129
  children: [position === 'start' ? (/* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/_jsx("span", {
130
130
  className: "notranslate",
131
+ "aria-hidden": true,
131
132
  children: "\u200B"
132
133
  }))) : null, children]
133
134
  })
@@ -9,6 +9,7 @@ import ListContext from "../List/ListContext.js";
9
9
  import { styled } from "../zero-styled/index.js";
10
10
  import { useDefaultProps } from "../DefaultPropsProvider/index.js";
11
11
  import listItemTextClasses, { getListItemTextUtilityClass } from "./listItemTextClasses.js";
12
+ import useSlot from "../utils/useSlot.js";
12
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  const useUtilityClasses = ownerState => {
14
15
  const {
@@ -80,6 +81,8 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
80
81
  primaryTypographyProps,
81
82
  secondary: secondaryProp,
82
83
  secondaryTypographyProps,
84
+ slots = {},
85
+ slotProps = {},
83
86
  ...other
84
87
  } = props;
85
88
  const {
@@ -96,21 +99,39 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
96
99
  dense
97
100
  };
98
101
  const classes = useUtilityClasses(ownerState);
102
+ const externalForwardedProps = {
103
+ slots,
104
+ slotProps: {
105
+ primary: primaryTypographyProps,
106
+ secondary: secondaryTypographyProps,
107
+ ...slotProps
108
+ }
109
+ };
110
+ const [PrimarySlot, primarySlotProps] = useSlot('primary', {
111
+ className: classes.primary,
112
+ elementType: Typography,
113
+ externalForwardedProps,
114
+ ownerState
115
+ });
116
+ const [SecondarySlot, secondarySlotProps] = useSlot('secondary', {
117
+ className: classes.secondary,
118
+ elementType: Typography,
119
+ externalForwardedProps,
120
+ ownerState
121
+ });
99
122
  if (primary != null && primary.type !== Typography && !disableTypography) {
100
- primary = /*#__PURE__*/_jsx(Typography, {
123
+ primary = /*#__PURE__*/_jsx(PrimarySlot, {
101
124
  variant: dense ? 'body2' : 'body1',
102
- className: classes.primary,
103
- component: primaryTypographyProps?.variant ? undefined : 'span',
104
- ...primaryTypographyProps,
125
+ component: primarySlotProps?.variant ? undefined : 'span',
126
+ ...primarySlotProps,
105
127
  children: primary
106
128
  });
107
129
  }
108
130
  if (secondary != null && secondary.type !== Typography && !disableTypography) {
109
- secondary = /*#__PURE__*/_jsx(Typography, {
131
+ secondary = /*#__PURE__*/_jsx(SecondarySlot, {
110
132
  variant: "body2",
111
- className: classes.secondary,
112
133
  color: "textSecondary",
113
- ...secondaryTypographyProps,
134
+ ...secondarySlotProps,
114
135
  children: secondary
115
136
  });
116
137
  }
@@ -160,6 +181,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
160
181
  /**
161
182
  * These props will be forwarded to the primary typography component
162
183
  * (as long as disableTypography is not `true`).
184
+ * @deprecated Use `slotProps.primary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
163
185
  */
164
186
  primaryTypographyProps: PropTypes.object,
165
187
  /**
@@ -169,8 +191,25 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
169
191
  /**
170
192
  * These props will be forwarded to the secondary typography component
171
193
  * (as long as disableTypography is not `true`).
194
+ * @deprecated Use `slotProps.secondary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
172
195
  */
173
196
  secondaryTypographyProps: PropTypes.object,
197
+ /**
198
+ * The props used for each slot inside.
199
+ * @default {}
200
+ */
201
+ slotProps: PropTypes.shape({
202
+ primary: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
203
+ secondary: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
204
+ }),
205
+ /**
206
+ * The components used for each slot inside.
207
+ * @default {}
208
+ */
209
+ slots: PropTypes.shape({
210
+ primary: PropTypes.elementType,
211
+ secondary: PropTypes.elementType
212
+ }),
174
213
  /**
175
214
  * The system prop that allows defining system overrides as well as additional CSS styles.
176
215
  */
@@ -10,6 +10,7 @@ function getContainer(container) {
10
10
  function getHasTransition(children) {
11
11
  return children ? children.props.hasOwnProperty('in') : false;
12
12
  }
13
+ const noop = () => {};
13
14
 
14
15
  // A modal manager used to track and manage the state of open Modals.
15
16
  // Modals don't open on the server so this won't conflict with concurrent requests.
@@ -181,8 +182,8 @@ function useModal(parameters) {
181
182
  }
182
183
  };
183
184
  return {
184
- onEnter: createChainedFunction(handleEnter, children?.props.onEnter),
185
- onExited: createChainedFunction(handleExited, children?.props.onExited)
185
+ onEnter: createChainedFunction(handleEnter, children?.props.onEnter ?? noop),
186
+ onExited: createChainedFunction(handleExited, children?.props.onExited ?? noop)
186
187
  };
187
188
  };
188
189
  return {
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { exactProp, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
6
  /**
8
7
  * NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
9
8
  *
@@ -40,10 +39,8 @@ function NoSsr(props) {
40
39
  }
41
40
  }, [defer]);
42
41
 
43
- // We need the Fragment here to force react-docgen to recognise NoSsr as a component.
44
- return /*#__PURE__*/_jsx(React.Fragment, {
45
- children: mountedState ? children : fallback
46
- });
42
+ // TODO casting won't be needed at one point https://github.com/DefinitelyTyped/DefinitelyTyped/pull/65135
43
+ return mountedState ? children : fallback;
47
44
  }
48
45
  process.env.NODE_ENV !== "production" ? NoSsr.propTypes /* remove-proptypes */ = {
49
46
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -120,6 +120,7 @@ export default function NotchedOutline(props) {
120
120
  }) : // notranslate needed while Google Translate will not fix zero-width space issue
121
121
  _span || (_span = /*#__PURE__*/_jsx("span", {
122
122
  className: "notranslate",
123
+ "aria-hidden": true,
123
124
  children: "\u200B"
124
125
  }))
125
126
  })
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import Grid from '@mui/material-pigment-css/Grid';
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
7
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
8
- import { generateDirectionClasses, generateSizeClassNames, generateSpacingClassNames } from '@mui/system/Grid/gridGenerator';
8
+ import { unstable_generateDirectionClasses as generateDirectionClasses, unstable_generateSizeClassNames as generateSizeClassNames, unstable_generateSpacingClassNames as generateSpacingClassNames } from '@mui/system/Grid';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  const useUtilityClasses = ownerState => {
11
11
  const {
@@ -4,7 +4,6 @@ import * as React from 'react';
4
4
  import * as ReactDOM from 'react-dom';
5
5
  import PropTypes from 'prop-types';
6
6
  import { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef, unstable_getReactElementRef as getReactElementRef } from '@mui/utils';
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
7
  function getContainer(container) {
9
8
  return typeof container === 'function' ? container() : container;
10
9
  }
@@ -50,13 +49,9 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef
50
49
  };
51
50
  return /*#__PURE__*/React.cloneElement(children, newProps);
52
51
  }
53
- return /*#__PURE__*/_jsx(React.Fragment, {
54
- children: children
55
- });
52
+ return children;
56
53
  }
57
- return /*#__PURE__*/_jsx(React.Fragment, {
58
- children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode
59
- });
54
+ return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;
60
55
  });
61
56
  process.env.NODE_ENV !== "production" ? Portal.propTypes /* remove-proptypes */ = {
62
57
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -462,6 +462,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
462
462
  children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
463
463
  _span || (_span = /*#__PURE__*/_jsx("span", {
464
464
  className: "notranslate",
465
+ "aria-hidden": true,
465
466
  children: "\u200B"
466
467
  })) : display
467
468
  }), /*#__PURE__*/_jsx(SelectNativeInput, {