@mui/material 9.0.0 → 9.1.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 (278) hide show
  1. package/Accordion/Accordion.d.mts +2 -2
  2. package/Accordion/Accordion.d.ts +2 -2
  3. package/Accordion/Accordion.js +3 -2
  4. package/Accordion/Accordion.mjs +3 -2
  5. package/AccordionSummary/AccordionSummary.js +27 -29
  6. package/AccordionSummary/AccordionSummary.mjs +27 -29
  7. package/Autocomplete/Autocomplete.js +73 -17
  8. package/Autocomplete/Autocomplete.mjs +73 -17
  9. package/Avatar/Avatar.js +4 -0
  10. package/Avatar/Avatar.mjs +4 -0
  11. package/Backdrop/Backdrop.d.mts +2 -2
  12. package/Backdrop/Backdrop.d.ts +2 -2
  13. package/Badge/Badge.js +31 -24
  14. package/Badge/Badge.mjs +31 -24
  15. package/BottomNavigationAction/BottomNavigationAction.js +6 -2
  16. package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
  17. package/Button/Button.js +19 -6
  18. package/Button/Button.mjs +19 -6
  19. package/ButtonBase/ButtonBase.d.mts +7 -0
  20. package/ButtonBase/ButtonBase.d.ts +7 -0
  21. package/ButtonBase/ButtonBase.js +5 -2
  22. package/ButtonBase/ButtonBase.mjs +5 -2
  23. package/ButtonBase/Ripple.js +21 -11
  24. package/ButtonBase/Ripple.mjs +21 -11
  25. package/ButtonBase/TouchRipple.js +252 -116
  26. package/ButtonBase/TouchRipple.mjs +253 -117
  27. package/CHANGELOG.md +216 -1245
  28. package/CardActionArea/CardActionArea.js +2 -1
  29. package/CardActionArea/CardActionArea.mjs +2 -1
  30. package/Checkbox/Checkbox.js +2 -1
  31. package/Checkbox/Checkbox.mjs +2 -1
  32. package/Chip/Chip.js +2 -1
  33. package/Chip/Chip.mjs +2 -1
  34. package/CircularProgress/CircularProgress.d.mts +12 -2
  35. package/CircularProgress/CircularProgress.d.ts +12 -2
  36. package/CircularProgress/CircularProgress.js +115 -58
  37. package/CircularProgress/CircularProgress.mjs +114 -58
  38. package/ClickAwayListener/ClickAwayListener.js +3 -6
  39. package/ClickAwayListener/ClickAwayListener.mjs +3 -6
  40. package/Collapse/Collapse.d.mts +15 -3
  41. package/Collapse/Collapse.d.ts +15 -3
  42. package/Collapse/Collapse.js +44 -31
  43. package/Collapse/Collapse.mjs +43 -30
  44. package/Dialog/Dialog.d.mts +2 -2
  45. package/Dialog/Dialog.d.ts +2 -2
  46. package/Dialog/Dialog.js +13 -6
  47. package/Dialog/Dialog.mjs +13 -6
  48. package/Drawer/Drawer.d.mts +2 -2
  49. package/Drawer/Drawer.d.ts +2 -2
  50. package/Drawer/Drawer.js +18 -4
  51. package/Drawer/Drawer.mjs +18 -4
  52. package/Fab/Fab.js +9 -2
  53. package/Fab/Fab.mjs +9 -2
  54. package/Fade/Fade.d.mts +15 -2
  55. package/Fade/Fade.d.ts +15 -2
  56. package/Fade/Fade.js +46 -19
  57. package/Fade/Fade.mjs +45 -18
  58. package/FilledInput/FilledInput.d.mts +4 -0
  59. package/FilledInput/FilledInput.d.ts +4 -0
  60. package/FilledInput/FilledInput.js +22 -23
  61. package/FilledInput/FilledInput.mjs +22 -23
  62. package/FormControl/useFormControl.d.mts +12 -2
  63. package/FormControl/useFormControl.d.ts +12 -2
  64. package/FormControl/useFormControl.js +13 -0
  65. package/FormControl/useFormControl.mjs +12 -0
  66. package/FormControlLabel/FormControlLabel.js +5 -8
  67. package/FormControlLabel/FormControlLabel.mjs +5 -8
  68. package/FormGroup/FormGroup.js +2 -5
  69. package/FormGroup/FormGroup.mjs +2 -5
  70. package/FormHelperText/FormHelperText.js +2 -5
  71. package/FormHelperText/FormHelperText.mjs +2 -5
  72. package/FormLabel/FormLabel.js +2 -5
  73. package/FormLabel/FormLabel.mjs +2 -5
  74. package/Grow/Grow.d.mts +15 -2
  75. package/Grow/Grow.d.ts +15 -2
  76. package/Grow/Grow.js +45 -28
  77. package/Grow/Grow.mjs +44 -27
  78. package/IconButton/IconButton.js +3 -9
  79. package/IconButton/IconButton.mjs +3 -9
  80. package/Input/Input.d.mts +4 -0
  81. package/Input/Input.d.ts +4 -0
  82. package/Input/Input.js +9 -2
  83. package/Input/Input.mjs +9 -2
  84. package/InputBase/InputBase.d.mts +2 -1
  85. package/InputBase/InputBase.d.ts +2 -1
  86. package/InputBase/InputBase.js +52 -16
  87. package/InputBase/InputBase.mjs +52 -16
  88. package/InputLabel/InputLabel.js +7 -9
  89. package/InputLabel/InputLabel.mjs +7 -9
  90. package/LICENSE +1 -1
  91. package/LinearProgress/LinearProgress.d.mts +12 -2
  92. package/LinearProgress/LinearProgress.d.ts +12 -2
  93. package/LinearProgress/LinearProgress.js +225 -126
  94. package/LinearProgress/LinearProgress.mjs +224 -126
  95. package/List/List.js +2 -1
  96. package/List/List.mjs +2 -1
  97. package/ListItem/ListItem.js +2 -1
  98. package/ListItem/ListItem.mjs +2 -1
  99. package/ListItemButton/ListItemButton.js +9 -2
  100. package/ListItemButton/ListItemButton.mjs +9 -2
  101. package/Menu/Menu.d.mts +1 -1
  102. package/Menu/Menu.d.ts +1 -1
  103. package/MenuItem/MenuItem.js +7 -1
  104. package/MenuItem/MenuItem.mjs +7 -1
  105. package/MenuList/MenuList.js +2 -1
  106. package/MenuList/MenuList.mjs +2 -1
  107. package/MobileStepper/MobileStepper.js +2 -1
  108. package/MobileStepper/MobileStepper.mjs +2 -1
  109. package/NativeSelect/NativeSelect.js +2 -5
  110. package/NativeSelect/NativeSelect.mjs +2 -5
  111. package/OutlinedInput/NotchedOutline.js +4 -3
  112. package/OutlinedInput/NotchedOutline.mjs +4 -3
  113. package/OutlinedInput/OutlinedInput.js +13 -23
  114. package/OutlinedInput/OutlinedInput.mjs +13 -23
  115. package/PaginationItem/PaginationItem.js +2 -1
  116. package/PaginationItem/PaginationItem.mjs +2 -1
  117. package/Paper/Paper.js +2 -1
  118. package/Paper/Paper.mjs +2 -1
  119. package/PigmentContainer/PigmentContainer.js +0 -1
  120. package/PigmentContainer/PigmentContainer.mjs +0 -1
  121. package/Popover/Popover.d.mts +1 -1
  122. package/Popover/Popover.d.ts +1 -1
  123. package/Popper/BasePopper.js +23 -1
  124. package/Popper/BasePopper.mjs +23 -1
  125. package/README.md +3 -2
  126. package/Radio/RadioButtonIcon.js +3 -2
  127. package/Radio/RadioButtonIcon.mjs +3 -2
  128. package/Rating/Rating.js +2 -1
  129. package/Rating/Rating.mjs +2 -1
  130. package/Select/Select.js +2 -5
  131. package/Select/Select.mjs +2 -5
  132. package/Select/SelectInput.js +276 -24
  133. package/Select/SelectInput.mjs +276 -24
  134. package/Select/utils/closedTypeahead.js +73 -0
  135. package/Select/utils/closedTypeahead.mjs +63 -0
  136. package/Skeleton/Skeleton.js +22 -2
  137. package/Skeleton/Skeleton.mjs +22 -2
  138. package/Slide/Slide.d.mts +15 -2
  139. package/Slide/Slide.d.ts +15 -2
  140. package/Slide/Slide.js +97 -47
  141. package/Slide/Slide.mjs +97 -47
  142. package/Slider/Slider.js +14 -4
  143. package/Slider/Slider.mjs +14 -4
  144. package/Slider/useSlider.js +4 -3
  145. package/Slider/useSlider.mjs +4 -3
  146. package/Snackbar/Snackbar.d.mts +2 -2
  147. package/Snackbar/Snackbar.d.ts +2 -2
  148. package/SpeedDial/SpeedDial.d.mts +1 -1
  149. package/SpeedDial/SpeedDial.d.ts +1 -1
  150. package/SpeedDial/SpeedDial.js +6 -2
  151. package/SpeedDial/SpeedDial.mjs +6 -2
  152. package/SpeedDialAction/SpeedDialAction.js +11 -2
  153. package/SpeedDialAction/SpeedDialAction.mjs +12 -3
  154. package/SpeedDialIcon/SpeedDialIcon.js +40 -37
  155. package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
  156. package/Step/Step.js +47 -15
  157. package/Step/Step.mjs +47 -15
  158. package/StepButton/StepButton.js +9 -3
  159. package/StepButton/StepButton.mjs +9 -3
  160. package/StepConnector/StepConnector.js +10 -0
  161. package/StepConnector/StepConnector.mjs +10 -0
  162. package/StepContent/StepContent.d.mts +2 -2
  163. package/StepContent/StepContent.d.ts +2 -2
  164. package/StepContent/StepContent.js +26 -2
  165. package/StepContent/StepContent.mjs +26 -2
  166. package/StepIcon/StepIcon.js +2 -1
  167. package/StepIcon/StepIcon.mjs +2 -1
  168. package/StepLabel/StepLabel.js +52 -7
  169. package/StepLabel/StepLabel.mjs +52 -7
  170. package/Stepper/Stepper.d.mts +2 -0
  171. package/Stepper/Stepper.d.ts +2 -0
  172. package/Stepper/Stepper.js +18 -0
  173. package/Stepper/Stepper.mjs +18 -0
  174. package/SvgIcon/SvgIcon.js +2 -1
  175. package/SvgIcon/SvgIcon.mjs +2 -1
  176. package/SwipeableDrawer/SwipeableDrawer.js +21 -6
  177. package/SwipeableDrawer/SwipeableDrawer.mjs +21 -6
  178. package/Switch/Switch.js +10 -8
  179. package/Switch/Switch.mjs +10 -8
  180. package/TableSortLabel/TableSortLabel.js +2 -1
  181. package/TableSortLabel/TableSortLabel.mjs +2 -1
  182. package/Tabs/ScrollbarSize.js +2 -1
  183. package/Tabs/ScrollbarSize.mjs +2 -1
  184. package/Tabs/Tabs.js +16 -4
  185. package/Tabs/Tabs.mjs +16 -4
  186. package/Tooltip/Tooltip.d.mts +2 -2
  187. package/Tooltip/Tooltip.d.ts +2 -2
  188. package/Tooltip/Tooltip.js +29 -108
  189. package/Tooltip/Tooltip.mjs +29 -108
  190. package/Unstable_TrapFocus/FocusTrap.js +60 -22
  191. package/Unstable_TrapFocus/FocusTrap.mjs +60 -22
  192. package/Zoom/Zoom.d.mts +15 -2
  193. package/Zoom/Zoom.d.ts +15 -2
  194. package/Zoom/Zoom.js +43 -16
  195. package/Zoom/Zoom.mjs +42 -15
  196. package/index.js +1 -1
  197. package/index.mjs +1 -1
  198. package/internal/Transition.d.mts +34 -0
  199. package/internal/Transition.d.ts +34 -0
  200. package/internal/Transition.js +444 -0
  201. package/internal/Transition.mjs +436 -0
  202. package/internal/react-transition-group.d.mts +8 -0
  203. package/internal/react-transition-group.d.ts +8 -0
  204. package/package.json +50 -50
  205. package/styles/createMotion.d.mts +8 -0
  206. package/styles/createMotion.d.ts +8 -0
  207. package/styles/createMotion.js +13 -0
  208. package/styles/createMotion.mjs +7 -0
  209. package/styles/createThemeFoundation.d.mts +2 -0
  210. package/styles/createThemeFoundation.d.ts +2 -0
  211. package/styles/createThemeNoVars.d.mts +3 -0
  212. package/styles/createThemeNoVars.d.ts +3 -0
  213. package/styles/createThemeNoVars.js +5 -0
  214. package/styles/createThemeNoVars.mjs +5 -0
  215. package/styles/createTransitions.d.mts +6 -2
  216. package/styles/createTransitions.d.ts +6 -2
  217. package/styles/createTransitions.js +12 -4
  218. package/styles/createTransitions.mjs +12 -4
  219. package/styles/enhanceHighContrast.d.mts +70 -0
  220. package/styles/enhanceHighContrast.d.ts +70 -0
  221. package/styles/enhanceHighContrast.js +502 -0
  222. package/styles/enhanceHighContrast.mjs +495 -0
  223. package/styles/index.d.mts +2 -0
  224. package/styles/index.d.ts +2 -0
  225. package/styles/index.js +8 -0
  226. package/styles/index.mjs +1 -0
  227. package/styles/reducedMotion.d.mts +7 -0
  228. package/styles/reducedMotion.d.ts +7 -0
  229. package/styles/reducedMotion.js +21 -0
  230. package/styles/reducedMotion.mjs +14 -0
  231. package/styles/responsiveFontSizes.js +19 -8
  232. package/styles/responsiveFontSizes.mjs +19 -8
  233. package/styles/shouldSkipGeneratingVar.js +1 -1
  234. package/styles/shouldSkipGeneratingVar.mjs +1 -1
  235. package/styles/stringifyTheme.js +1 -0
  236. package/styles/stringifyTheme.mjs +1 -0
  237. package/styles/useThemeProps.d.mts +3 -3
  238. package/styles/useThemeProps.d.ts +3 -3
  239. package/transitions/index.d.mts +1 -1
  240. package/transitions/index.d.ts +1 -1
  241. package/transitions/index.js +0 -11
  242. package/transitions/index.mjs +1 -1
  243. package/transitions/transition.d.mts +1 -12
  244. package/transitions/transition.d.ts +1 -12
  245. package/transitions/types.d.mts +73 -0
  246. package/transitions/types.d.ts +73 -0
  247. package/transitions/useReducedMotion.d.mts +14 -0
  248. package/transitions/useReducedMotion.d.ts +14 -0
  249. package/transitions/useReducedMotion.js +117 -0
  250. package/transitions/useReducedMotion.mjs +110 -0
  251. package/transitions/utils.d.mts +51 -2
  252. package/transitions/utils.d.ts +51 -2
  253. package/transitions/utils.js +97 -4
  254. package/transitions/utils.mjs +94 -4
  255. package/useAutocomplete/useAutocomplete.d.mts +12 -6
  256. package/useAutocomplete/useAutocomplete.d.ts +12 -6
  257. package/useAutocomplete/useAutocomplete.js +230 -55
  258. package/useAutocomplete/useAutocomplete.mjs +230 -55
  259. package/utils/contains.d.mts +2 -0
  260. package/utils/contains.d.ts +2 -0
  261. package/utils/contains.js +9 -0
  262. package/utils/contains.mjs +2 -0
  263. package/utils/focusable.d.mts +7 -0
  264. package/utils/focusable.d.ts +7 -0
  265. package/utils/focusable.js +20 -0
  266. package/utils/focusable.mjs +13 -0
  267. package/utils/getEventTarget.d.mts +2 -0
  268. package/utils/getEventTarget.d.ts +2 -0
  269. package/utils/getEventTarget.js +9 -0
  270. package/utils/getEventTarget.mjs +2 -0
  271. package/utils/mergeSlotProps.js +2 -8
  272. package/utils/mergeSlotProps.mjs +1 -8
  273. package/version/index.js +2 -2
  274. package/version/index.mjs +2 -2
  275. package/FormControl/formControlState.js +0 -21
  276. package/FormControl/formControlState.mjs +0 -15
  277. /package/transitions/{transition.js → types.js} +0 -0
  278. /package/transitions/{transition.mjs → types.mjs} +0 -0
@@ -6,7 +6,7 @@ import { CreateSlotsAndSlotProps, SlotProps } from "../utils/types.js";
6
6
  import { ModalProps } from "../Modal/index.js";
7
7
  import { BackdropProps } from "../Backdrop/index.js";
8
8
  import { PaperProps } from "../Paper/index.js";
9
- import { TransitionProps } from "../transitions/transition.js";
9
+ import { TransitionProps } from "../transitions/types.js";
10
10
  import { DrawerClasses } from "./drawerClasses.js";
11
11
  export interface DrawerRootSlotPropsOverrides {}
12
12
  export interface DrawerDockedSlotPropsOverrides {}
@@ -36,7 +36,7 @@ export interface DrawerSlots {
36
36
  paper: React.ElementType;
37
37
  /**
38
38
  * The component used for the transition.
39
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
39
+ * [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
40
40
  * @default Slide
41
41
  */
42
42
  transition: React.ElementType;
package/Drawer/Drawer.js CHANGED
@@ -23,8 +23,10 @@ var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShoul
23
23
  var _zeroStyled = require("../zero-styled");
24
24
  var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
25
25
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
26
+ var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
26
27
  var _drawerClasses = require("./drawerClasses");
27
28
  var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
29
+ var _focusable = require("../utils/focusable");
28
30
  var _utils = require("../utils");
29
31
  var _jsxRuntime = require("react/jsx-runtime");
30
32
  const overridesResolver = (props, styles) => {
@@ -203,9 +205,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
203
205
  // We use this state is order to skip the appear transition during the
204
206
  // initial mount of the component.
205
207
  const mounted = React.useRef(false);
208
+ const rootRef = React.useRef(null);
209
+ const handleRef = (0, _useForkRef.default)(ref, rootRef);
206
210
  React.useEffect(() => {
207
211
  mounted.current = true;
208
212
  }, []);
213
+
214
+ // Resolve the container lazily so Slide reads the mounted modal root
215
+ // after refs are assigned, rather than the initial null ref during render.
216
+ const resolveSlideContainer = React.useCallback(() => rootRef.current, []);
209
217
  const anchorInvariant = getAnchor({
210
218
  direction: isRtl ? 'rtl' : 'ltr'
211
219
  }, anchorProp);
@@ -229,7 +237,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
229
237
  }
230
238
  };
231
239
  const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
232
- ref,
240
+ ref: handleRef,
233
241
  elementType: DrawerRoot,
234
242
  className: (0, _clsx.default)(classes.root, classes.modal, className),
235
243
  shouldForwardComponentProp: true,
@@ -240,6 +248,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
240
248
  ...ModalProps
241
249
  },
242
250
  additionalProps: {
251
+ closeAfterTransition: true,
243
252
  open,
244
253
  onClose,
245
254
  hideBackdrop,
@@ -262,13 +271,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
262
271
  square: true,
263
272
  ...(variant === 'temporary' && {
264
273
  role: 'dialog',
265
- 'aria-modal': 'true'
274
+ 'aria-modal': 'true',
275
+ [_focusable.FOCUSABLE_ATTRIBUTE]: '',
276
+ tabIndex: -1
266
277
  })
267
278
  }
268
279
  });
269
280
  const [DockedSlot, dockedSlotProps] = (0, _useSlot.default)('docked', {
270
281
  elementType: DrawerDockedRoot,
271
- ref,
282
+ ref: handleRef,
272
283
  className: (0, _clsx.default)(classes.root, classes.docked, className),
273
284
  ownerState,
274
285
  externalForwardedProps,
@@ -282,7 +293,10 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
282
293
  in: open,
283
294
  direction: oppositeDirection[anchorInvariant],
284
295
  timeout: transitionDuration,
285
- appear: mounted.current
296
+ appear: mounted.current,
297
+ ...(variant === 'temporary' && (slots.transition == null || slots.transition === _Slide.default) && {
298
+ container: resolveSlideContainer
299
+ })
286
300
  }
287
301
  });
288
302
  const drawer = /*#__PURE__*/(0, _jsxRuntime.jsx)(PaperSlot, {
package/Drawer/Drawer.mjs CHANGED
@@ -14,8 +14,10 @@ import rootShouldForwardProp from "../styles/rootShouldForwardProp.mjs";
14
14
  import { styled, useTheme } from "../zero-styled/index.mjs";
15
15
  import memoTheme from "../utils/memoTheme.mjs";
16
16
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
17
+ import useForkRef from "../utils/useForkRef.mjs";
17
18
  import { getDrawerUtilityClass } from "./drawerClasses.mjs";
18
19
  import useSlot from "../utils/useSlot.mjs";
20
+ import { FOCUSABLE_ATTRIBUTE } from "../utils/focusable.mjs";
19
21
  import { mergeSlotProps } from "../utils/index.mjs";
20
22
  import { jsx as _jsx } from "react/jsx-runtime";
21
23
  const overridesResolver = (props, styles) => {
@@ -194,9 +196,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
194
196
  // We use this state is order to skip the appear transition during the
195
197
  // initial mount of the component.
196
198
  const mounted = React.useRef(false);
199
+ const rootRef = React.useRef(null);
200
+ const handleRef = useForkRef(ref, rootRef);
197
201
  React.useEffect(() => {
198
202
  mounted.current = true;
199
203
  }, []);
204
+
205
+ // Resolve the container lazily so Slide reads the mounted modal root
206
+ // after refs are assigned, rather than the initial null ref during render.
207
+ const resolveSlideContainer = React.useCallback(() => rootRef.current, []);
200
208
  const anchorInvariant = getAnchor({
201
209
  direction: isRtl ? 'rtl' : 'ltr'
202
210
  }, anchorProp);
@@ -220,7 +228,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
220
228
  }
221
229
  };
222
230
  const [RootSlot, rootSlotProps] = useSlot('root', {
223
- ref,
231
+ ref: handleRef,
224
232
  elementType: DrawerRoot,
225
233
  className: clsx(classes.root, classes.modal, className),
226
234
  shouldForwardComponentProp: true,
@@ -231,6 +239,7 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
231
239
  ...ModalProps
232
240
  },
233
241
  additionalProps: {
242
+ closeAfterTransition: true,
234
243
  open,
235
244
  onClose,
236
245
  hideBackdrop,
@@ -253,13 +262,15 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
253
262
  square: true,
254
263
  ...(variant === 'temporary' && {
255
264
  role: 'dialog',
256
- 'aria-modal': 'true'
265
+ 'aria-modal': 'true',
266
+ [FOCUSABLE_ATTRIBUTE]: '',
267
+ tabIndex: -1
257
268
  })
258
269
  }
259
270
  });
260
271
  const [DockedSlot, dockedSlotProps] = useSlot('docked', {
261
272
  elementType: DrawerDockedRoot,
262
- ref,
273
+ ref: handleRef,
263
274
  className: clsx(classes.root, classes.docked, className),
264
275
  ownerState,
265
276
  externalForwardedProps,
@@ -273,7 +284,10 @@ const Drawer = /*#__PURE__*/React.forwardRef(function Drawer(inProps, ref) {
273
284
  in: open,
274
285
  direction: oppositeDirection[anchorInvariant],
275
286
  timeout: transitionDuration,
276
- appear: mounted.current
287
+ appear: mounted.current,
288
+ ...(variant === 'temporary' && (slots.transition == null || slots.transition === Slide) && {
289
+ container: resolveSlideContainer
290
+ })
277
291
  }
278
292
  });
279
293
  const drawer = /*#__PURE__*/_jsx(PaperSlot, {
package/Fab/Fab.js CHANGED
@@ -19,6 +19,7 @@ var _zeroStyled = require("../zero-styled");
19
19
  var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
20
20
  var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
21
21
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
22
+ var _utils = require("../transitions/utils");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
24
  const useUtilityClasses = ownerState => {
24
25
  const {
@@ -52,7 +53,7 @@ const FabRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
52
53
  }) => ({
53
54
  ...theme.typography.button,
54
55
  minHeight: 36,
55
- transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {
56
+ ...(0, _utils.getTransitionStyles)(theme, ['background-color', 'box-shadow', 'border-color'], {
56
57
  duration: theme.transitions.duration.short
57
58
  }),
58
59
  borderRadius: '50%',
@@ -194,6 +195,12 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
194
195
  variant
195
196
  };
196
197
  const classes = useUtilityClasses(ownerState);
198
+
199
+ // Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
200
+ const {
201
+ root,
202
+ ...forwardedClasses
203
+ } = classes;
197
204
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(FabRoot, {
198
205
  className: (0, _clsx.default)(classes.root, className),
199
206
  component: component,
@@ -204,7 +211,7 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
204
211
  ownerState: ownerState,
205
212
  ref: ref,
206
213
  ...other,
207
- classes: classes,
214
+ classes: forwardedClasses,
208
215
  children: children
209
216
  });
210
217
  });
package/Fab/Fab.mjs CHANGED
@@ -12,6 +12,7 @@ import { styled } from "../zero-styled/index.mjs";
12
12
  import memoTheme from "../utils/memoTheme.mjs";
13
13
  import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
14
14
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
15
+ import { getTransitionStyles } from "../transitions/utils.mjs";
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  const useUtilityClasses = ownerState => {
17
18
  const {
@@ -45,7 +46,7 @@ const FabRoot = styled(ButtonBase, {
45
46
  }) => ({
46
47
  ...theme.typography.button,
47
48
  minHeight: 36,
48
- transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {
49
+ ...getTransitionStyles(theme, ['background-color', 'box-shadow', 'border-color'], {
49
50
  duration: theme.transitions.duration.short
50
51
  }),
51
52
  borderRadius: '50%',
@@ -187,6 +188,12 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
187
188
  variant
188
189
  };
189
190
  const classes = useUtilityClasses(ownerState);
191
+
192
+ // Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
193
+ const {
194
+ root,
195
+ ...forwardedClasses
196
+ } = classes;
190
197
  return /*#__PURE__*/_jsx(FabRoot, {
191
198
  className: clsx(classes.root, className),
192
199
  component: component,
@@ -197,7 +204,7 @@ const Fab = /*#__PURE__*/React.forwardRef(function Fab(inProps, ref) {
197
204
  ownerState: ownerState,
198
205
  ref: ref,
199
206
  ...other,
200
- classes: classes,
207
+ classes: forwardedClasses,
201
208
  children: children
202
209
  });
203
210
  });
package/Fade/Fade.d.mts CHANGED
@@ -1,6 +1,15 @@
1
1
  import * as React from 'react';
2
- import { TransitionProps } from "../transitions/transition.mjs";
2
+ import { TransitionProps } from "../transitions/types.mjs";
3
3
  export interface FadeProps extends Omit<TransitionProps, 'children'> {
4
+ /**
5
+ * Add a custom transition end trigger.
6
+ * Use it when you need custom logic to decide when the transition has ended.
7
+ * Note: Timeouts are still used as a fallback if provided.
8
+ *
9
+ * @param {HTMLElement} node The transitioning DOM node.
10
+ * @param {Function} done Call this when the transition has finished.
11
+ */
12
+ addEndListener?: TransitionProps['addEndListener'] | undefined;
4
13
  /**
5
14
  * Perform the enter transition when it first mounts if `in` is also `true`.
6
15
  * Set this to `false` to disable this behavior.
@@ -11,6 +20,11 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
11
20
  * A single child content element.
12
21
  */
13
22
  children: React.ReactElement<unknown, any>;
23
+ /**
24
+ * If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
25
+ * @default false
26
+ */
27
+ disablePrefersReducedMotion?: boolean | undefined;
14
28
  /**
15
29
  * The transition timing function.
16
30
  * You may specify a single easing or a object containing enter and exit values.
@@ -34,7 +48,6 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
34
48
 
35
49
  /**
36
50
  * The Fade transition is used by the [Modal](https://mui.com/material-ui/react-modal/) component.
37
- * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
38
51
  *
39
52
  * Demos:
40
53
  *
package/Fade/Fade.d.ts CHANGED
@@ -1,6 +1,15 @@
1
1
  import * as React from 'react';
2
- import { TransitionProps } from "../transitions/transition.js";
2
+ import { TransitionProps } from "../transitions/types.js";
3
3
  export interface FadeProps extends Omit<TransitionProps, 'children'> {
4
+ /**
5
+ * Add a custom transition end trigger.
6
+ * Use it when you need custom logic to decide when the transition has ended.
7
+ * Note: Timeouts are still used as a fallback if provided.
8
+ *
9
+ * @param {HTMLElement} node The transitioning DOM node.
10
+ * @param {Function} done Call this when the transition has finished.
11
+ */
12
+ addEndListener?: TransitionProps['addEndListener'] | undefined;
4
13
  /**
5
14
  * Perform the enter transition when it first mounts if `in` is also `true`.
6
15
  * Set this to `false` to disable this behavior.
@@ -11,6 +20,11 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
11
20
  * A single child content element.
12
21
  */
13
22
  children: React.ReactElement<unknown, any>;
23
+ /**
24
+ * If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
25
+ * @default false
26
+ */
27
+ disablePrefersReducedMotion?: boolean | undefined;
14
28
  /**
15
29
  * The transition timing function.
16
30
  * You may specify a single easing or a object containing enter and exit values.
@@ -34,7 +48,6 @@ export interface FadeProps extends Omit<TransitionProps, 'children'> {
34
48
 
35
49
  /**
36
50
  * The Fade transition is used by the [Modal](https://mui.com/material-ui/react-modal/) component.
37
- * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
38
51
  *
39
52
  * Demos:
40
53
  *
package/Fade/Fade.js CHANGED
@@ -9,9 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  exports.default = void 0;
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
- var _reactTransitionGroup = require("react-transition-group");
13
12
  var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcceptingRef"));
14
13
  var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
14
+ var _Transition = _interopRequireDefault(require("../internal/Transition"));
15
+ var _useReducedMotion = _interopRequireDefault(require("../transitions/useReducedMotion"));
15
16
  var _zeroStyled = require("../zero-styled");
16
17
  var _utils = require("../transitions/utils");
17
18
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
@@ -37,7 +38,6 @@ const hiddenStyles = {
37
38
 
38
39
  /**
39
40
  * The Fade transition is used by the [Modal](/material-ui/react-modal/) component.
40
- * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
41
41
  */
42
42
  const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
43
43
  const theme = (0, _zeroStyled.useTheme)();
@@ -49,6 +49,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
49
49
  addEndListener,
50
50
  appear = true,
51
51
  children,
52
+ disablePrefersReducedMotion = false,
52
53
  easing,
53
54
  in: inProp,
54
55
  onEnter,
@@ -61,12 +62,14 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
61
62
  timeout = defaultTimeout,
62
63
  ...other
63
64
  } = props;
65
+ const reducedMotion = (0, _useReducedMotion.default)(theme.motion.reducedMotion, disablePrefersReducedMotion);
64
66
  const nodeRef = React.useRef(null);
65
67
  const handleRef = (0, _useForkRef.default)(nodeRef, (0, _getReactElementRef.default)(children), ref);
66
68
  const handleEntering = (0, _utils.normalizedTransitionCallback)(nodeRef, onEntering);
67
69
  const handleEnter = (0, _utils.normalizedTransitionCallback)(nodeRef, (node, isAppearing) => {
68
- (0, _utils.reflow)(node); // So the animation always start from the start.
69
-
70
+ if (!reducedMotion.shouldReduceMotion) {
71
+ (0, _utils.reflow)(node); // Force layout so the animation starts from the initial styles.
72
+ }
70
73
  const transitionProps = (0, _utils.getTransitionProps)({
71
74
  style,
72
75
  timeout,
@@ -74,7 +77,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
74
77
  }, {
75
78
  mode: 'enter'
76
79
  });
77
- node.style.transition = theme.transitions.create('opacity', transitionProps);
80
+ const transitionTiming = reducedMotion.getTransitionTiming({
81
+ duration: transitionProps.duration,
82
+ delay: transitionProps.delay
83
+ });
84
+ node.style.transition = theme.transitions.create('opacity', {
85
+ duration: transitionTiming.duration,
86
+ easing: transitionProps.easing,
87
+ delay: transitionTiming.delay
88
+ });
78
89
  if (onEnter) {
79
90
  onEnter(node, isAppearing);
80
91
  }
@@ -89,27 +100,32 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
89
100
  }, {
90
101
  mode: 'exit'
91
102
  });
92
- node.style.transition = theme.transitions.create('opacity', transitionProps);
103
+ const transitionTiming = reducedMotion.getTransitionTiming({
104
+ duration: transitionProps.duration,
105
+ delay: transitionProps.delay
106
+ });
107
+ node.style.transition = theme.transitions.create('opacity', {
108
+ duration: transitionTiming.duration,
109
+ easing: transitionProps.easing,
110
+ delay: transitionTiming.delay
111
+ });
93
112
  if (onExit) {
94
113
  onExit(node);
95
114
  }
96
115
  });
97
116
  const handleExited = (0, _utils.normalizedTransitionCallback)(nodeRef, node => {
98
- // Clear the transition CSS to release the compositor layer when the
99
- // element is fully exited (prevents idle CPU usage on fixed elements
100
- // like Backdrop). handleEnter re-sets it on the next open.
117
+ // Clear transition CSS after exit so fixed elements like Backdrop do not
118
+ // keep a compositor layer alive and cause idle CPU usage. handleEnter sets
119
+ // it again on next open.
101
120
  node.style.transition = '';
102
121
  if (onExited) {
103
122
  onExited(node);
104
123
  }
105
124
  });
106
- const handleAddEndListener = next => {
107
- if (addEndListener) {
108
- // Old call signature before `react-transition-group` implemented `nodeRef`
109
- addEndListener(nodeRef.current, next);
110
- }
111
- };
112
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.Transition, {
125
+ const handleAddEndListener = addEndListener ? next => {
126
+ addEndListener(nodeRef.current, next);
127
+ } : undefined;
128
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Transition.default, {
113
129
  appear: appear,
114
130
  in: inProp,
115
131
  nodeRef: nodeRef,
@@ -120,12 +136,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
120
136
  onExited: handleExited,
121
137
  onExiting: handleExiting,
122
138
  addEndListener: handleAddEndListener,
139
+ reduceMotion: reducedMotion.shouldReduceMotion,
123
140
  timeout: timeout,
124
141
  ...other,
125
142
  children: (state, {
126
143
  ownerState,
127
144
  ...restChildProps
128
145
  }) => {
146
+ // Do not pass ownerState to a DOM child. ownerState is only for
147
+ // Material UI styling, and React would treat it as an invalid DOM attribute.
129
148
  const childStyle = (0, _utils.getTransitionChildStyle)(state, inProp, styles, hiddenStyles, style, children.props.style);
130
149
  return /*#__PURE__*/React.cloneElement(children, {
131
150
  style: childStyle,
@@ -141,9 +160,12 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
141
160
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
142
161
  // └─────────────────────────────────────────────────────────────────────┘
143
162
  /**
144
- * Add a custom transition end trigger. Called with the transitioning DOM
145
- * node and a done callback. Allows for more fine grained transition end
146
- * logic. Note: Timeouts are still used as a fallback if provided.
163
+ * Add a custom transition end trigger.
164
+ * Use it when you need custom logic to decide when the transition has ended.
165
+ * Note: Timeouts are still used as a fallback if provided.
166
+ *
167
+ * @param {HTMLElement} node The transitioning DOM node.
168
+ * @param {Function} done Call this when the transition has finished.
147
169
  */
148
170
  addEndListener: _propTypes.default.func,
149
171
  /**
@@ -156,6 +178,11 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
156
178
  * A single child content element.
157
179
  */
158
180
  children: _elementAcceptingRef.default.isRequired,
181
+ /**
182
+ * If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
183
+ * @default false
184
+ */
185
+ disablePrefersReducedMotion: _propTypes.default.bool,
159
186
  /**
160
187
  * The transition timing function.
161
188
  * You may specify a single easing or a object containing enter and exit values.
package/Fade/Fade.mjs CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import { Transition } from 'react-transition-group';
6
5
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
7
6
  import getReactElementRef from '@mui/utils/getReactElementRef';
7
+ import Transition from "../internal/Transition.mjs";
8
+ import useReducedMotion from "../transitions/useReducedMotion.mjs";
8
9
  import { useTheme } from "../zero-styled/index.mjs";
9
10
  import { normalizedTransitionCallback, reflow, getTransitionProps, getTransitionChildStyle } from "../transitions/utils.mjs";
10
11
  import useForkRef from "../utils/useForkRef.mjs";
@@ -30,7 +31,6 @@ const hiddenStyles = {
30
31
 
31
32
  /**
32
33
  * The Fade transition is used by the [Modal](/material-ui/react-modal/) component.
33
- * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
34
34
  */
35
35
  const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
36
36
  const theme = useTheme();
@@ -42,6 +42,7 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
42
42
  addEndListener,
43
43
  appear = true,
44
44
  children,
45
+ disablePrefersReducedMotion = false,
45
46
  easing,
46
47
  in: inProp,
47
48
  onEnter,
@@ -54,12 +55,14 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
54
55
  timeout = defaultTimeout,
55
56
  ...other
56
57
  } = props;
58
+ const reducedMotion = useReducedMotion(theme.motion.reducedMotion, disablePrefersReducedMotion);
57
59
  const nodeRef = React.useRef(null);
58
60
  const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
59
61
  const handleEntering = normalizedTransitionCallback(nodeRef, onEntering);
60
62
  const handleEnter = normalizedTransitionCallback(nodeRef, (node, isAppearing) => {
61
- reflow(node); // So the animation always start from the start.
62
-
63
+ if (!reducedMotion.shouldReduceMotion) {
64
+ reflow(node); // Force layout so the animation starts from the initial styles.
65
+ }
63
66
  const transitionProps = getTransitionProps({
64
67
  style,
65
68
  timeout,
@@ -67,7 +70,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
67
70
  }, {
68
71
  mode: 'enter'
69
72
  });
70
- node.style.transition = theme.transitions.create('opacity', transitionProps);
73
+ const transitionTiming = reducedMotion.getTransitionTiming({
74
+ duration: transitionProps.duration,
75
+ delay: transitionProps.delay
76
+ });
77
+ node.style.transition = theme.transitions.create('opacity', {
78
+ duration: transitionTiming.duration,
79
+ easing: transitionProps.easing,
80
+ delay: transitionTiming.delay
81
+ });
71
82
  if (onEnter) {
72
83
  onEnter(node, isAppearing);
73
84
  }
@@ -82,26 +93,31 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
82
93
  }, {
83
94
  mode: 'exit'
84
95
  });
85
- node.style.transition = theme.transitions.create('opacity', transitionProps);
96
+ const transitionTiming = reducedMotion.getTransitionTiming({
97
+ duration: transitionProps.duration,
98
+ delay: transitionProps.delay
99
+ });
100
+ node.style.transition = theme.transitions.create('opacity', {
101
+ duration: transitionTiming.duration,
102
+ easing: transitionProps.easing,
103
+ delay: transitionTiming.delay
104
+ });
86
105
  if (onExit) {
87
106
  onExit(node);
88
107
  }
89
108
  });
90
109
  const handleExited = normalizedTransitionCallback(nodeRef, node => {
91
- // Clear the transition CSS to release the compositor layer when the
92
- // element is fully exited (prevents idle CPU usage on fixed elements
93
- // like Backdrop). handleEnter re-sets it on the next open.
110
+ // Clear transition CSS after exit so fixed elements like Backdrop do not
111
+ // keep a compositor layer alive and cause idle CPU usage. handleEnter sets
112
+ // it again on next open.
94
113
  node.style.transition = '';
95
114
  if (onExited) {
96
115
  onExited(node);
97
116
  }
98
117
  });
99
- const handleAddEndListener = next => {
100
- if (addEndListener) {
101
- // Old call signature before `react-transition-group` implemented `nodeRef`
102
- addEndListener(nodeRef.current, next);
103
- }
104
- };
118
+ const handleAddEndListener = addEndListener ? next => {
119
+ addEndListener(nodeRef.current, next);
120
+ } : undefined;
105
121
  return /*#__PURE__*/_jsx(Transition, {
106
122
  appear: appear,
107
123
  in: inProp,
@@ -113,12 +129,15 @@ const Fade = /*#__PURE__*/React.forwardRef(function Fade(props, ref) {
113
129
  onExited: handleExited,
114
130
  onExiting: handleExiting,
115
131
  addEndListener: handleAddEndListener,
132
+ reduceMotion: reducedMotion.shouldReduceMotion,
116
133
  timeout: timeout,
117
134
  ...other,
118
135
  children: (state, {
119
136
  ownerState,
120
137
  ...restChildProps
121
138
  }) => {
139
+ // Do not pass ownerState to a DOM child. ownerState is only for
140
+ // Material UI styling, and React would treat it as an invalid DOM attribute.
122
141
  const childStyle = getTransitionChildStyle(state, inProp, styles, hiddenStyles, style, children.props.style);
123
142
  return /*#__PURE__*/React.cloneElement(children, {
124
143
  style: childStyle,
@@ -134,9 +153,12 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
134
153
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
135
154
  // └─────────────────────────────────────────────────────────────────────┘
136
155
  /**
137
- * Add a custom transition end trigger. Called with the transitioning DOM
138
- * node and a done callback. Allows for more fine grained transition end
139
- * logic. Note: Timeouts are still used as a fallback if provided.
156
+ * Add a custom transition end trigger.
157
+ * Use it when you need custom logic to decide when the transition has ended.
158
+ * Note: Timeouts are still used as a fallback if provided.
159
+ *
160
+ * @param {HTMLElement} node The transitioning DOM node.
161
+ * @param {Function} done Call this when the transition has finished.
140
162
  */
141
163
  addEndListener: PropTypes.func,
142
164
  /**
@@ -149,6 +171,11 @@ process.env.NODE_ENV !== "production" ? Fade.propTypes /* remove-proptypes */ =
149
171
  * A single child content element.
150
172
  */
151
173
  children: elementAcceptingRef.isRequired,
174
+ /**
175
+ * If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
176
+ * @default false
177
+ */
178
+ disablePrefersReducedMotion: PropTypes.bool,
152
179
  /**
153
180
  * The transition timing function.
154
181
  * You may specify a single easing or a object containing enter and exit values.
@@ -20,6 +20,10 @@ export interface FilledInputProps extends StandardProps<InputBaseProps> {
20
20
  * @default false
21
21
  */
22
22
  disableUnderline?: boolean | undefined;
23
+ /**
24
+ * @internal
25
+ */
26
+ notched?: boolean | undefined;
23
27
  /**
24
28
  * The system prop that allows defining system overrides as well as additional CSS styles.
25
29
  */
@@ -20,6 +20,10 @@ export interface FilledInputProps extends StandardProps<InputBaseProps> {
20
20
  * @default false
21
21
  */
22
22
  disableUnderline?: boolean | undefined;
23
+ /**
24
+ * @internal
25
+ */
26
+ notched?: boolean | undefined;
23
27
  /**
24
28
  * The system prop that allows defining system overrides as well as additional CSS styles.
25
29
  */