@mui/material 9.0.1 → 9.1.1

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 (228) 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.d.mts +5 -1
  8. package/Autocomplete/Autocomplete.d.ts +5 -1
  9. package/Autocomplete/Autocomplete.js +13 -7
  10. package/Autocomplete/Autocomplete.mjs +13 -7
  11. package/Backdrop/Backdrop.d.mts +2 -2
  12. package/Backdrop/Backdrop.d.ts +2 -2
  13. package/Badge/Badge.js +28 -24
  14. package/Badge/Badge.mjs +28 -24
  15. package/BottomNavigationAction/BottomNavigationAction.js +6 -2
  16. package/BottomNavigationAction/BottomNavigationAction.mjs +6 -2
  17. package/Button/Button.js +11 -15
  18. package/Button/Button.mjs +11 -15
  19. package/ButtonBase/Ripple.js +21 -11
  20. package/ButtonBase/Ripple.mjs +21 -11
  21. package/ButtonBase/TouchRipple.js +252 -108
  22. package/ButtonBase/TouchRipple.mjs +253 -109
  23. package/CHANGELOG.md +122 -0
  24. package/CardActionArea/CardActionArea.js +2 -1
  25. package/CardActionArea/CardActionArea.mjs +2 -1
  26. package/Chip/Chip.js +2 -1
  27. package/Chip/Chip.mjs +2 -1
  28. package/CircularProgress/CircularProgress.js +85 -55
  29. package/CircularProgress/CircularProgress.mjs +84 -55
  30. package/Collapse/Collapse.d.mts +15 -3
  31. package/Collapse/Collapse.d.ts +15 -3
  32. package/Collapse/Collapse.js +44 -31
  33. package/Collapse/Collapse.mjs +43 -30
  34. package/Dialog/Dialog.d.mts +2 -2
  35. package/Dialog/Dialog.d.ts +2 -2
  36. package/Dialog/Dialog.js +2 -0
  37. package/Dialog/Dialog.mjs +2 -0
  38. package/Drawer/Drawer.d.mts +2 -2
  39. package/Drawer/Drawer.d.ts +2 -2
  40. package/Fab/Fab.js +2 -1
  41. package/Fab/Fab.mjs +2 -1
  42. package/Fade/Fade.d.mts +15 -2
  43. package/Fade/Fade.d.ts +15 -2
  44. package/Fade/Fade.js +46 -19
  45. package/Fade/Fade.mjs +45 -18
  46. package/FilledInput/FilledInput.js +4 -3
  47. package/FilledInput/FilledInput.mjs +4 -3
  48. package/Grow/Grow.d.mts +15 -2
  49. package/Grow/Grow.d.ts +15 -2
  50. package/Grow/Grow.js +45 -28
  51. package/Grow/Grow.mjs +44 -27
  52. package/IconButton/IconButton.js +2 -1
  53. package/IconButton/IconButton.mjs +2 -1
  54. package/InitColorSchemeScript/InitColorSchemeScript.d.mts +5 -5
  55. package/InitColorSchemeScript/InitColorSchemeScript.d.ts +5 -5
  56. package/Input/Input.js +3 -2
  57. package/Input/Input.mjs +3 -2
  58. package/InputBase/InputBase.js +2 -1
  59. package/InputBase/InputBase.mjs +2 -1
  60. package/InputLabel/InputLabel.js +2 -1
  61. package/InputLabel/InputLabel.mjs +2 -1
  62. package/LICENSE +1 -1
  63. package/LinearProgress/LinearProgress.js +187 -120
  64. package/LinearProgress/LinearProgress.mjs +186 -120
  65. package/ListItem/ListItem.js +2 -1
  66. package/ListItem/ListItem.mjs +2 -1
  67. package/ListItemButton/ListItemButton.js +2 -1
  68. package/ListItemButton/ListItemButton.mjs +2 -1
  69. package/Menu/Menu.d.mts +1 -1
  70. package/Menu/Menu.d.ts +1 -1
  71. package/MobileStepper/MobileStepper.js +2 -1
  72. package/MobileStepper/MobileStepper.mjs +2 -1
  73. package/OutlinedInput/NotchedOutline.js +4 -3
  74. package/OutlinedInput/NotchedOutline.mjs +4 -3
  75. package/PaginationItem/PaginationItem.js +2 -1
  76. package/PaginationItem/PaginationItem.mjs +2 -1
  77. package/Paper/Paper.js +2 -1
  78. package/Paper/Paper.mjs +2 -1
  79. package/Popover/Popover.d.mts +1 -1
  80. package/Popover/Popover.d.ts +1 -1
  81. package/README.md +3 -2
  82. package/Radio/RadioButtonIcon.js +3 -2
  83. package/Radio/RadioButtonIcon.mjs +3 -2
  84. package/Rating/Rating.js +2 -1
  85. package/Rating/Rating.mjs +2 -1
  86. package/Select/SelectInput.js +115 -25
  87. package/Select/SelectInput.mjs +115 -25
  88. package/Select/utils/SelectFocusSourceContext.d.mts +2 -2
  89. package/Select/utils/SelectFocusSourceContext.d.ts +2 -2
  90. package/Select/utils/closedTypeahead.js +73 -0
  91. package/Select/utils/closedTypeahead.mjs +63 -0
  92. package/Skeleton/Skeleton.js +22 -2
  93. package/Skeleton/Skeleton.mjs +22 -2
  94. package/Slide/Slide.d.mts +15 -2
  95. package/Slide/Slide.d.ts +15 -2
  96. package/Slide/Slide.js +53 -25
  97. package/Slide/Slide.mjs +52 -24
  98. package/Slider/Slider.js +4 -3
  99. package/Slider/Slider.mjs +4 -3
  100. package/Slider/SliderValueLabel.d.mts +2 -2
  101. package/Slider/SliderValueLabel.d.ts +2 -2
  102. package/Slider/useSlider.js +1 -1
  103. package/Slider/useSlider.mjs +1 -1
  104. package/Snackbar/Snackbar.d.mts +2 -2
  105. package/Snackbar/Snackbar.d.ts +2 -2
  106. package/SpeedDial/SpeedDial.d.mts +1 -1
  107. package/SpeedDial/SpeedDial.d.ts +1 -1
  108. package/SpeedDial/SpeedDial.js +6 -2
  109. package/SpeedDial/SpeedDial.mjs +6 -2
  110. package/SpeedDialAction/SpeedDialAction.js +11 -2
  111. package/SpeedDialAction/SpeedDialAction.mjs +12 -3
  112. package/SpeedDialIcon/SpeedDialIcon.js +40 -37
  113. package/SpeedDialIcon/SpeedDialIcon.mjs +40 -37
  114. package/Step/Step.js +47 -15
  115. package/Step/Step.mjs +47 -15
  116. package/Step/StepContext.d.mts +1 -1
  117. package/Step/StepContext.d.ts +1 -1
  118. package/StepButton/StepButton.js +9 -3
  119. package/StepButton/StepButton.mjs +9 -3
  120. package/StepConnector/StepConnector.js +10 -0
  121. package/StepConnector/StepConnector.mjs +10 -0
  122. package/StepContent/StepContent.d.mts +2 -2
  123. package/StepContent/StepContent.d.ts +2 -2
  124. package/StepContent/StepContent.js +26 -2
  125. package/StepContent/StepContent.mjs +26 -2
  126. package/StepIcon/StepIcon.js +2 -1
  127. package/StepIcon/StepIcon.mjs +2 -1
  128. package/StepLabel/StepLabel.js +52 -7
  129. package/StepLabel/StepLabel.mjs +52 -7
  130. package/Stepper/Stepper.d.mts +2 -0
  131. package/Stepper/Stepper.d.ts +2 -0
  132. package/Stepper/Stepper.js +18 -0
  133. package/Stepper/Stepper.mjs +18 -0
  134. package/Stepper/StepperContext.d.mts +1 -1
  135. package/Stepper/StepperContext.d.ts +1 -1
  136. package/SvgIcon/SvgIcon.js +2 -1
  137. package/SvgIcon/SvgIcon.mjs +2 -1
  138. package/SwipeableDrawer/SwipeableDrawer.js +14 -3
  139. package/SwipeableDrawer/SwipeableDrawer.mjs +14 -3
  140. package/Switch/Switch.js +3 -2
  141. package/Switch/Switch.mjs +3 -2
  142. package/TableSortLabel/TableSortLabel.js +2 -1
  143. package/TableSortLabel/TableSortLabel.mjs +2 -1
  144. package/Tabs/Tabs.js +14 -3
  145. package/Tabs/Tabs.mjs +14 -3
  146. package/Tooltip/Tooltip.d.mts +2 -2
  147. package/Tooltip/Tooltip.d.ts +2 -2
  148. package/Tooltip/Tooltip.js +3 -0
  149. package/Tooltip/Tooltip.mjs +3 -0
  150. package/Unstable_TrapFocus/FocusTrap.js +42 -8
  151. package/Unstable_TrapFocus/FocusTrap.mjs +42 -8
  152. package/Zoom/Zoom.d.mts +15 -2
  153. package/Zoom/Zoom.d.ts +15 -2
  154. package/Zoom/Zoom.js +43 -16
  155. package/Zoom/Zoom.mjs +42 -15
  156. package/index.js +1 -1
  157. package/index.mjs +1 -1
  158. package/internal/Transition.d.mts +34 -0
  159. package/internal/Transition.d.ts +34 -0
  160. package/internal/Transition.js +450 -0
  161. package/internal/Transition.mjs +442 -0
  162. package/internal/react-transition-group.d.mts +8 -0
  163. package/internal/react-transition-group.d.ts +8 -0
  164. package/package.json +7 -7
  165. package/styles/ThemeProviderWithVars.d.mts +7 -7
  166. package/styles/ThemeProviderWithVars.d.ts +7 -7
  167. package/styles/createGetSelector.d.mts +2 -2
  168. package/styles/createGetSelector.d.ts +2 -2
  169. package/styles/createMotion.d.mts +8 -0
  170. package/styles/createMotion.d.ts +8 -0
  171. package/styles/createMotion.js +13 -0
  172. package/styles/createMotion.mjs +7 -0
  173. package/styles/createThemeFoundation.d.mts +2 -0
  174. package/styles/createThemeFoundation.d.ts +2 -0
  175. package/styles/createThemeNoVars.d.mts +3 -0
  176. package/styles/createThemeNoVars.d.ts +3 -0
  177. package/styles/createThemeNoVars.js +5 -0
  178. package/styles/createThemeNoVars.mjs +5 -0
  179. package/styles/createTransitions.d.mts +6 -2
  180. package/styles/createTransitions.d.ts +6 -2
  181. package/styles/createTransitions.js +12 -4
  182. package/styles/createTransitions.mjs +12 -4
  183. package/styles/enhanceHighContrast.d.mts +70 -0
  184. package/styles/enhanceHighContrast.d.ts +70 -0
  185. package/styles/enhanceHighContrast.js +502 -0
  186. package/styles/enhanceHighContrast.mjs +495 -0
  187. package/styles/identifier.d.mts +1 -1
  188. package/styles/identifier.d.ts +1 -1
  189. package/styles/index.d.mts +2 -0
  190. package/styles/index.d.ts +2 -0
  191. package/styles/index.js +8 -0
  192. package/styles/index.mjs +1 -0
  193. package/styles/reducedMotion.d.mts +7 -0
  194. package/styles/reducedMotion.d.ts +7 -0
  195. package/styles/reducedMotion.js +21 -0
  196. package/styles/reducedMotion.mjs +14 -0
  197. package/styles/shouldSkipGeneratingVar.js +1 -1
  198. package/styles/shouldSkipGeneratingVar.mjs +1 -1
  199. package/styles/stringifyTheme.js +1 -0
  200. package/styles/stringifyTheme.mjs +1 -0
  201. package/transitions/index.d.mts +1 -1
  202. package/transitions/index.d.ts +1 -1
  203. package/transitions/index.js +0 -11
  204. package/transitions/index.mjs +1 -1
  205. package/transitions/transition.d.mts +1 -12
  206. package/transitions/transition.d.ts +1 -12
  207. package/transitions/types.d.mts +73 -0
  208. package/transitions/types.d.ts +73 -0
  209. package/transitions/useReducedMotion.d.mts +14 -0
  210. package/transitions/useReducedMotion.d.ts +14 -0
  211. package/transitions/useReducedMotion.js +117 -0
  212. package/transitions/useReducedMotion.mjs +110 -0
  213. package/transitions/utils.d.mts +34 -2
  214. package/transitions/utils.d.ts +34 -2
  215. package/transitions/utils.js +33 -4
  216. package/transitions/utils.mjs +31 -4
  217. package/useAutocomplete/useAutocomplete.d.mts +8 -1
  218. package/useAutocomplete/useAutocomplete.d.ts +8 -1
  219. package/useAutocomplete/useAutocomplete.js +66 -4
  220. package/useAutocomplete/useAutocomplete.mjs +66 -4
  221. package/utils/memoTheme.d.mts +1 -1
  222. package/utils/memoTheme.d.ts +1 -1
  223. package/utils/useSlot.d.mts +1 -1
  224. package/utils/useSlot.d.ts +1 -1
  225. package/version/index.js +2 -2
  226. package/version/index.mjs +2 -2
  227. /package/transitions/{transition.js → types.js} +0 -0
  228. /package/transitions/{transition.mjs → types.mjs} +0 -0
package/Slide/Slide.mjs CHANGED
@@ -2,21 +2,23 @@
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 chainPropTypes from '@mui/utils/chainPropTypes';
7
6
  import HTMLElementType from '@mui/utils/HTMLElementType';
8
7
  import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
9
8
  import getReactElementRef from '@mui/utils/getReactElementRef';
9
+ import Transition from "../internal/Transition.mjs";
10
10
  import isLayoutSupported from "../utils/isLayoutSupported.mjs";
11
11
  import debounce from "../utils/debounce.mjs";
12
12
  import useForkRef from "../utils/useForkRef.mjs";
13
13
  import { useTheme } from "../zero-styled/index.mjs";
14
+ import useReducedMotion from "../transitions/useReducedMotion.mjs";
14
15
  import { normalizedTransitionCallback, reflow, getTransitionProps, getTranslateOffsets } from "../transitions/utils.mjs";
15
16
  import { ownerWindow } from "../utils/index.mjs";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  const hiddenStyles = {
18
19
  visibility: 'hidden'
19
20
  };
21
+ const DEFAULT_TRANSLATE_OPTIONS = {};
20
22
 
21
23
  /**
22
24
  * Detects SwipeableDrawer's active-swipe `translate(x, y)` transform.
@@ -26,9 +28,8 @@ function isGestureTranslate(transform) {
26
28
  return typeof transform === 'string' && /^translate\(.+,\s*.+\)$/.test(transform);
27
29
  }
28
30
 
29
- // Translate the node so it can't be seen on the screen.
30
- // Later, we're going to translate the node back to its original location with `none`.
31
- function getTranslateValue(direction, node, resolvedContainer, options = {}) {
31
+ // Move the node off-screen. Later we reset transform to `none` to slide it in.
32
+ function getTranslateValue(direction, node, resolvedContainer, options = DEFAULT_TRANSLATE_OPTIONS) {
32
33
  const {
33
34
  resetInlineTransform = true
34
35
  } = options;
@@ -37,9 +38,9 @@ function getTranslateValue(direction, node, resolvedContainer, options = {}) {
37
38
  let rect;
38
39
  let transform;
39
40
  if (resetInlineTransform) {
40
- // Clear the inline transform and transition before reading layout and computed
41
- // style so we compute from the element's natural position, not its previous
42
- // off-screen translation.
41
+ // Read layout from the element's natural position, not from a previous
42
+ // off-screen transform. Clear transition too, or the browser may report an
43
+ // in-between animated value during exit.
43
44
  const previousTransform = node.style.transform;
44
45
  const previousTransition = node.style.transition;
45
46
  node.style.transition = '';
@@ -96,7 +97,6 @@ export function setTranslateValue(direction, node, containerProp, options) {
96
97
 
97
98
  /**
98
99
  * The Slide transition is used by the [Drawer](/material-ui/react-drawer/) component.
99
- * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
100
100
  */
101
101
  const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
102
102
  const theme = useTheme();
@@ -113,6 +113,7 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
113
113
  appear = true,
114
114
  children,
115
115
  container: containerProp,
116
+ disablePrefersReducedMotion = false,
116
117
  direction = 'down',
117
118
  easing: easingProp = defaultEasing,
118
119
  in: inProp,
@@ -126,12 +127,15 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
126
127
  timeout = defaultTimeout,
127
128
  ...other
128
129
  } = props;
130
+ const reducedMotion = useReducedMotion(theme.motion.reducedMotion, disablePrefersReducedMotion);
129
131
  const childrenRef = React.useRef(null);
130
132
  const preserveInlineTransformRef = React.useRef(false);
131
133
  const handleRef = useForkRef(getReactElementRef(children), childrenRef, ref);
132
134
  const handleEnter = normalizedTransitionCallback(childrenRef, (node, isAppearing) => {
133
135
  setTranslateValue(direction, node, containerProp);
134
- reflow(node);
136
+ if (!reducedMotion.shouldReduceMotion) {
137
+ reflow(node);
138
+ }
135
139
  if (onEnter) {
136
140
  onEnter(node, isAppearing);
137
141
  }
@@ -144,7 +148,15 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
144
148
  }, {
145
149
  mode: 'enter'
146
150
  });
147
- node.style.transition = theme.transitions.create('transform', transitionProps);
151
+ const transitionTiming = reducedMotion.getTransitionTiming({
152
+ duration: transitionProps.duration,
153
+ delay: transitionProps.delay
154
+ });
155
+ node.style.transition = theme.transitions.create('transform', {
156
+ duration: transitionTiming.duration,
157
+ easing: transitionProps.easing,
158
+ delay: transitionTiming.delay
159
+ });
148
160
  node.style.transform = 'none';
149
161
  if (onEntering) {
150
162
  onEntering(node, isAppearing);
@@ -160,7 +172,15 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
160
172
  }, {
161
173
  mode: 'exit'
162
174
  });
163
- node.style.transition = theme.transitions.create('transform', transitionProps);
175
+ const transitionTiming = reducedMotion.getTransitionTiming({
176
+ duration: transitionProps.duration,
177
+ delay: transitionProps.delay
178
+ });
179
+ node.style.transition = theme.transitions.create('transform', {
180
+ duration: transitionTiming.duration,
181
+ easing: transitionProps.easing,
182
+ delay: transitionTiming.delay
183
+ });
164
184
  const preserveInlineTransform = isGestureTranslate(node.style.transform);
165
185
  preserveInlineTransformRef.current = preserveInlineTransform;
166
186
 
@@ -175,25 +195,22 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
175
195
  });
176
196
  const handleExited = normalizedTransitionCallback(childrenRef, node => {
177
197
  preserveInlineTransformRef.current = false;
178
- // No need for transitions when the component is hidden
198
+ // Hidden nodes stay off-screen without animating.
179
199
  node.style.transition = '';
180
200
  if (onExited) {
181
201
  onExited(node);
182
202
  }
183
203
  });
184
- const handleAddEndListener = next => {
185
- if (addEndListener) {
186
- // Old call signature before `react-transition-group` implemented `nodeRef`
187
- addEndListener(childrenRef.current, next);
188
- }
189
- };
204
+ const handleAddEndListener = addEndListener ? next => {
205
+ addEndListener(childrenRef.current, next);
206
+ } : undefined;
190
207
  const updatePosition = React.useCallback(() => {
191
208
  if (childrenRef.current) {
192
209
  setTranslateValue(direction, childrenRef.current, containerProp);
193
210
  }
194
211
  }, [direction, containerProp]);
195
212
  React.useEffect(() => {
196
- // Skip configuration where the position is screen size invariant.
213
+ // Skip resize listeners when the off-screen position does not depend on screen size.
197
214
  if (inProp || direction === 'down' || direction === 'right') {
198
215
  return undefined;
199
216
  }
@@ -211,8 +228,8 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
211
228
  }, [direction, inProp, containerProp]);
212
229
  React.useEffect(() => {
213
230
  if (!inProp && !preserveInlineTransformRef.current) {
214
- // We need to update the position of the drawer when the direction change and
215
- // when it's hidden.
231
+ // While hidden, keep the child at the correct off-screen position if
232
+ // direction or container changes.
216
233
  updatePosition();
217
234
  }
218
235
  }, [inProp, updatePosition]);
@@ -227,12 +244,15 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
227
244
  addEndListener: handleAddEndListener,
228
245
  appear: appear,
229
246
  in: inProp,
247
+ reduceMotion: reducedMotion.shouldReduceMotion,
230
248
  timeout: timeout,
231
249
  ...other,
232
250
  children: (state, {
233
251
  ownerState,
234
252
  ...restChildProps
235
253
  }) => {
254
+ // Do not pass ownerState to a DOM child. ownerState is only for
255
+ // Material UI styling, and React would treat it as an invalid DOM attribute.
236
256
  let childStyle;
237
257
  if (state === 'exited' && !inProp) {
238
258
  childStyle = style || children.props.style ? {
@@ -262,9 +282,12 @@ process.env.NODE_ENV !== "production" ? Slide.propTypes /* remove-proptypes */ =
262
282
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
263
283
  // └─────────────────────────────────────────────────────────────────────┘
264
284
  /**
265
- * Add a custom transition end trigger. Called with the transitioning DOM
266
- * node and a done callback. Allows for more fine grained transition end
267
- * logic. Note: Timeouts are still used as a fallback if provided.
285
+ * Add a custom transition end trigger.
286
+ * Use it when you need custom logic to decide when the transition has ended.
287
+ * Note: Timeouts are still used as a fallback if provided.
288
+ *
289
+ * @param {HTMLElement} node The transitioning DOM node.
290
+ * @param {Function} done Call this when the transition has finished.
268
291
  */
269
292
  addEndListener: PropTypes.func,
270
293
  /**
@@ -302,6 +325,11 @@ process.env.NODE_ENV !== "production" ? Slide.propTypes /* remove-proptypes */ =
302
325
  * @default 'down'
303
326
  */
304
327
  direction: PropTypes.oneOf(['down', 'left', 'right', 'up']),
328
+ /**
329
+ * If `true`, the transition ignores `theme.motion.reducedMotion` and keeps its normal timing.
330
+ * @default false
331
+ */
332
+ disablePrefersReducedMotion: PropTypes.bool,
305
333
  /**
306
334
  * The transition timing function.
307
335
  * You may specify a single easing or a object containing enter and exit values.
package/Slider/Slider.js CHANGED
@@ -24,6 +24,7 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
24
24
  var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
25
25
  var _SliderValueLabel = _interopRequireDefault(require("./SliderValueLabel"));
26
26
  var _sliderClasses = _interopRequireWildcard(require("./sliderClasses"));
27
+ var _utils = require("../transitions/utils");
27
28
  var _jsxRuntime = require("react/jsx-runtime");
28
29
  function Identity(x) {
29
30
  return x;
@@ -183,7 +184,7 @@ const SliderTrack = exports.SliderTrack = (0, _zeroStyled.styled)('span', {
183
184
  borderRadius: 'inherit',
184
185
  border: '1px solid currentColor',
185
186
  backgroundColor: 'currentColor',
186
- transition: theme.transitions.create(['left', 'width', 'bottom', 'height'], {
187
+ ...(0, _utils.getTransitionStyles)(theme, ['left', 'width', 'bottom', 'height'], {
187
188
  duration: theme.transitions.duration.shortest
188
189
  }),
189
190
  variants: [{
@@ -259,7 +260,7 @@ const SliderThumb = exports.SliderThumb = (0, _zeroStyled.styled)('span', {
259
260
  display: 'flex',
260
261
  alignItems: 'center',
261
262
  justifyContent: 'center',
262
- transition: theme.transitions.create(['box-shadow', 'left', 'bottom'], {
263
+ ...(0, _utils.getTransitionStyles)(theme, ['box-shadow', 'left', 'bottom'], {
263
264
  duration: theme.transitions.duration.shortest
264
265
  }),
265
266
  '@media (forced-colors: active)': {
@@ -343,7 +344,7 @@ const SliderValueLabel = exports.SliderValueLabel = (0, _zeroStyled.styled)(_Sli
343
344
  whiteSpace: 'nowrap',
344
345
  ...theme.typography.body2,
345
346
  fontWeight: 500,
346
- transition: theme.transitions.create(['transform'], {
347
+ ...(0, _utils.getTransitionStyles)(theme, ['transform'], {
347
348
  duration: theme.transitions.duration.shortest
348
349
  }),
349
350
  position: 'absolute',
package/Slider/Slider.mjs CHANGED
@@ -17,6 +17,7 @@ import capitalize from "../utils/capitalize.mjs";
17
17
  import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
18
18
  import BaseSliderValueLabel from "./SliderValueLabel.mjs";
19
19
  import sliderClasses, { getSliderUtilityClass } from "./sliderClasses.mjs";
20
+ import { getTransitionStyles } from "../transitions/utils.mjs";
20
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
22
  function Identity(x) {
22
23
  return x;
@@ -176,7 +177,7 @@ export const SliderTrack = styled('span', {
176
177
  borderRadius: 'inherit',
177
178
  border: '1px solid currentColor',
178
179
  backgroundColor: 'currentColor',
179
- transition: theme.transitions.create(['left', 'width', 'bottom', 'height'], {
180
+ ...getTransitionStyles(theme, ['left', 'width', 'bottom', 'height'], {
180
181
  duration: theme.transitions.duration.shortest
181
182
  }),
182
183
  variants: [{
@@ -252,7 +253,7 @@ export const SliderThumb = styled('span', {
252
253
  display: 'flex',
253
254
  alignItems: 'center',
254
255
  justifyContent: 'center',
255
- transition: theme.transitions.create(['box-shadow', 'left', 'bottom'], {
256
+ ...getTransitionStyles(theme, ['box-shadow', 'left', 'bottom'], {
256
257
  duration: theme.transitions.duration.shortest
257
258
  }),
258
259
  '@media (forced-colors: active)': {
@@ -336,7 +337,7 @@ const SliderValueLabel = styled(BaseSliderValueLabel, {
336
337
  whiteSpace: 'nowrap',
337
338
  ...theme.typography.body2,
338
339
  fontWeight: 500,
339
- transition: theme.transitions.create(['transform'], {
340
+ ...getTransitionStyles(theme, ['transform'], {
340
341
  duration: theme.transitions.duration.shortest
341
342
  }),
342
343
  position: 'absolute',
@@ -7,7 +7,7 @@ declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElem
7
7
  className?: string | undefined;
8
8
  children?: React.ReactNode;
9
9
  }, string | React.JSXElementConstructor<any>> | null;
10
+ export default SliderValueLabel;
10
11
  declare namespace SliderValueLabel {
11
12
  var propTypes: any;
12
- }
13
- export default SliderValueLabel;
13
+ }
@@ -7,7 +7,7 @@ declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElem
7
7
  className?: string | undefined;
8
8
  children?: React.ReactNode;
9
9
  }, string | React.JSXElementConstructor<any>> | null;
10
+ export default SliderValueLabel;
10
11
  declare namespace SliderValueLabel {
11
12
  var propTypes: any;
12
- }
13
- export default SliderValueLabel;
13
+ }
@@ -116,8 +116,8 @@ function focusThumb(sliderRef, activeIndex, setActive, focusVisible) {
116
116
  preventScroll: true,
117
117
  // Prevent pointer-driven focus rings in browsers that support this option.
118
118
  // Chrome 144+ supports `focusVisible` in `HTMLElement.focus()` options.
119
- // @ts-expect-error `focusVisible` is not yet in TypeScript's lib.dom FocusOptions.
120
119
  focusVisible
120
+ // Cast can be removed once TypeScript >= 6.0 (added `focusVisible` to lib.dom FocusOptions).
121
121
  });
122
122
  }
123
123
  }
@@ -107,8 +107,8 @@ function focusThumb(sliderRef, activeIndex, setActive, focusVisible) {
107
107
  preventScroll: true,
108
108
  // Prevent pointer-driven focus rings in browsers that support this option.
109
109
  // Chrome 144+ supports `focusVisible` in `HTMLElement.focus()` options.
110
- // @ts-expect-error `focusVisible` is not yet in TypeScript's lib.dom FocusOptions.
111
110
  focusVisible
111
+ // Cast can be removed once TypeScript >= 6.0 (added `focusVisible` to lib.dom FocusOptions).
112
112
  });
113
113
  }
114
114
  }
@@ -4,7 +4,7 @@ import ClickAwayListener from "../ClickAwayListener/index.mjs";
4
4
  import { Theme } from "../styles/index.mjs";
5
5
  import { InternalStandardProps as StandardProps } from "../internal/index.mjs";
6
6
  import { SnackbarContentProps } from "../SnackbarContent/index.mjs";
7
- import { TransitionProps } from "../transitions/transition.mjs";
7
+ import { TransitionProps } from "../transitions/types.mjs";
8
8
  import { SnackbarClasses } from "./snackbarClasses.mjs";
9
9
  import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.mjs";
10
10
  export interface SnackbarSlots {
@@ -25,7 +25,7 @@ export interface SnackbarSlots {
25
25
  clickAwayListener: React.ElementType;
26
26
  /**
27
27
  * The component that renders the transition.
28
- * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
28
+ * [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
29
29
  * @default Grow
30
30
  */
31
31
  transition: React.ElementType;
@@ -4,7 +4,7 @@ import ClickAwayListener from "../ClickAwayListener/index.js";
4
4
  import { Theme } from "../styles/index.js";
5
5
  import { InternalStandardProps as StandardProps } from "../internal/index.js";
6
6
  import { SnackbarContentProps } from "../SnackbarContent/index.js";
7
- import { TransitionProps } from "../transitions/transition.js";
7
+ import { TransitionProps } from "../transitions/types.js";
8
8
  import { SnackbarClasses } from "./snackbarClasses.js";
9
9
  import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.js";
10
10
  export interface SnackbarSlots {
@@ -25,7 +25,7 @@ export interface SnackbarSlots {
25
25
  clickAwayListener: React.ElementType;
26
26
  /**
27
27
  * The component that renders the transition.
28
- * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
28
+ * [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
29
29
  * @default Grow
30
30
  */
31
31
  transition: React.ElementType;
@@ -16,7 +16,7 @@ export interface SpeedDialSlots {
16
16
  root: React.ElementType;
17
17
  /**
18
18
  * The component that renders the transition.
19
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
19
+ * [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
20
20
  * @default Zoom
21
21
  */
22
22
  transition: React.ElementType;
@@ -16,7 +16,7 @@ export interface SpeedDialSlots {
16
16
  root: React.ElementType;
17
17
  /**
18
18
  * The component that renders the transition.
19
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
19
+ * [Follow this guide](/material-ui/transitions/#transition-slots) to learn more about the requirements for this component.
20
20
  * @default Zoom
21
21
  */
22
22
  transition: React.ElementType;
@@ -19,6 +19,7 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
19
19
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
20
20
  var _Zoom = _interopRequireDefault(require("../Zoom"));
21
21
  var _Fab = _interopRequireDefault(require("../Fab"));
22
+ var _utils = require("../transitions/utils");
22
23
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
23
24
  var _isMuiElement = _interopRequireDefault(require("../utils/isMuiElement"));
24
25
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
@@ -131,7 +132,9 @@ const SpeedDialActions = (0, _zeroStyled.styled)('div', {
131
132
  } = props;
132
133
  return [styles.actions, !ownerState.open && styles.actionsClosed];
133
134
  }
134
- })({
135
+ })((0, _memoTheme.default)(({
136
+ theme
137
+ }) => ({
135
138
  display: 'flex',
136
139
  pointerEvents: 'auto',
137
140
  variants: [{
@@ -140,10 +143,11 @@ const SpeedDialActions = (0, _zeroStyled.styled)('div', {
140
143
  }) => !ownerState.open,
141
144
  style: {
142
145
  transition: 'top 0s linear 0.2s',
146
+ ...(0, _utils.getReducedMotionStyles)(theme),
143
147
  pointerEvents: 'none'
144
148
  }
145
149
  }]
146
- });
150
+ })));
147
151
  const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
148
152
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
149
153
  props: inProps,
@@ -12,6 +12,7 @@ import memoTheme from "../utils/memoTheme.mjs";
12
12
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
13
13
  import Zoom from "../Zoom/index.mjs";
14
14
  import Fab from "../Fab/index.mjs";
15
+ import { getReducedMotionStyles } from "../transitions/utils.mjs";
15
16
  import capitalize from "../utils/capitalize.mjs";
16
17
  import isMuiElement from "../utils/isMuiElement.mjs";
17
18
  import useForkRef from "../utils/useForkRef.mjs";
@@ -124,7 +125,9 @@ const SpeedDialActions = styled('div', {
124
125
  } = props;
125
126
  return [styles.actions, !ownerState.open && styles.actionsClosed];
126
127
  }
127
- })({
128
+ })(memoTheme(({
129
+ theme
130
+ }) => ({
128
131
  display: 'flex',
129
132
  pointerEvents: 'auto',
130
133
  variants: [{
@@ -133,10 +136,11 @@ const SpeedDialActions = styled('div', {
133
136
  }) => !ownerState.open,
134
137
  style: {
135
138
  transition: 'top 0s linear 0.2s',
139
+ ...getReducedMotionStyles(theme),
136
140
  pointerEvents: 'none'
137
141
  }
138
142
  }]
139
- });
143
+ })));
140
144
  const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
141
145
  const props = useDefaultProps({
142
146
  props: inProps,
@@ -18,6 +18,8 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
18
18
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
19
19
  var _Fab = _interopRequireDefault(require("../Fab"));
20
20
  var _Tooltip = _interopRequireDefault(require("../Tooltip"));
21
+ var _utils = require("../transitions/utils");
22
+ var _useReducedMotion = _interopRequireDefault(require("../transitions/useReducedMotion"));
21
23
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
22
24
  var _speedDialActionClasses = _interopRequireWildcard(require("./speedDialActionClasses"));
23
25
  var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
@@ -57,6 +59,7 @@ const SpeedDialActionFab = (0, _zeroStyled.styled)(_Fab.default, {
57
59
  transition: `${theme.transitions.create('transform', {
58
60
  duration: theme.transitions.duration.shorter
59
61
  })}, opacity 0.8s`,
62
+ ...(0, _utils.getReducedMotionStyles)(theme),
60
63
  opacity: 1,
61
64
  variants: [{
62
65
  props: ({
@@ -84,7 +87,7 @@ const SpeedDialActionStaticTooltip = (0, _zeroStyled.styled)('span', {
84
87
  display: 'flex',
85
88
  alignItems: 'center',
86
89
  [`& .${_speedDialActionClasses.default.staticTooltipLabel}`]: {
87
- transition: theme.transitions.create(['transform', 'opacity'], {
90
+ ...(0, _utils.getTransitionStyles)(theme, ['transform', 'opacity'], {
88
91
  duration: theme.transitions.duration.shorter
89
92
  }),
90
93
  opacity: 1
@@ -153,6 +156,8 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
153
156
  slotProps = {},
154
157
  ...other
155
158
  } = props;
159
+ const theme = (0, _zeroStyled.useTheme)();
160
+ const reducedMotion = (0, _useReducedMotion.default)(theme.motion.reducedMotion, false);
156
161
  const resolvedTooltipSlotProps = typeof slotProps.tooltip === 'function' ? slotProps.tooltip(props) : slotProps.tooltip ?? {};
157
162
  const tooltipPlacement = resolvedTooltipSlotProps.placement ?? 'left';
158
163
  const ownerState = {
@@ -171,8 +176,12 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
171
176
  const handleTooltipOpen = () => {
172
177
  setTooltipOpen(true);
173
178
  };
179
+ const transitionTiming = reducedMotion.getTransitionTiming({
180
+ duration: 0,
181
+ delay: `${delay}ms`
182
+ });
174
183
  const transitionStyle = {
175
- transitionDelay: `${delay}ms`
184
+ transitionDelay: transitionTiming.delay
176
185
  };
177
186
  const [FabSlot, fabSlotProps] = (0, _useSlot.default)('fab', {
178
187
  elementType: SpeedDialActionFab,
@@ -6,11 +6,13 @@ import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import composeClasses from '@mui/utils/composeClasses';
8
8
  import { emphasize } from '@mui/system/colorManipulator';
9
- import { styled } from "../zero-styled/index.mjs";
9
+ import { styled, useTheme } from "../zero-styled/index.mjs";
10
10
  import memoTheme from "../utils/memoTheme.mjs";
11
11
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
12
12
  import Fab from "../Fab/index.mjs";
13
13
  import Tooltip from "../Tooltip/index.mjs";
14
+ import { getReducedMotionStyles, getTransitionStyles } from "../transitions/utils.mjs";
15
+ import useReducedMotion from "../transitions/useReducedMotion.mjs";
14
16
  import capitalize from "../utils/capitalize.mjs";
15
17
  import speedDialActionClasses, { getSpeedDialActionUtilityClass } from "./speedDialActionClasses.mjs";
16
18
  import useSlot from "../utils/useSlot.mjs";
@@ -50,6 +52,7 @@ const SpeedDialActionFab = styled(Fab, {
50
52
  transition: `${theme.transitions.create('transform', {
51
53
  duration: theme.transitions.duration.shorter
52
54
  })}, opacity 0.8s`,
55
+ ...getReducedMotionStyles(theme),
53
56
  opacity: 1,
54
57
  variants: [{
55
58
  props: ({
@@ -77,7 +80,7 @@ const SpeedDialActionStaticTooltip = styled('span', {
77
80
  display: 'flex',
78
81
  alignItems: 'center',
79
82
  [`& .${speedDialActionClasses.staticTooltipLabel}`]: {
80
- transition: theme.transitions.create(['transform', 'opacity'], {
83
+ ...getTransitionStyles(theme, ['transform', 'opacity'], {
81
84
  duration: theme.transitions.duration.shorter
82
85
  }),
83
86
  opacity: 1
@@ -146,6 +149,8 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
146
149
  slotProps = {},
147
150
  ...other
148
151
  } = props;
152
+ const theme = useTheme();
153
+ const reducedMotion = useReducedMotion(theme.motion.reducedMotion, false);
149
154
  const resolvedTooltipSlotProps = typeof slotProps.tooltip === 'function' ? slotProps.tooltip(props) : slotProps.tooltip ?? {};
150
155
  const tooltipPlacement = resolvedTooltipSlotProps.placement ?? 'left';
151
156
  const ownerState = {
@@ -164,8 +169,12 @@ const SpeedDialAction = /*#__PURE__*/React.forwardRef(function SpeedDialAction(i
164
169
  const handleTooltipOpen = () => {
165
170
  setTooltipOpen(true);
166
171
  };
172
+ const transitionTiming = reducedMotion.getTransitionTiming({
173
+ duration: 0,
174
+ delay: `${delay}ms`
175
+ });
167
176
  const transitionStyle = {
168
- transitionDelay: `${delay}ms`
177
+ transitionDelay: transitionTiming.delay
169
178
  };
170
179
  const [FabSlot, fabSlotProps] = useSlot('fab', {
171
180
  elementType: SpeedDialActionFab,
@@ -16,6 +16,7 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
16
16
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
17
17
  var _Add = _interopRequireDefault(require("../internal/svg-icons/Add"));
18
18
  var _speedDialIconClasses = _interopRequireWildcard(require("./speedDialIconClasses"));
19
+ var _utils = require("../transitions/utils");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  const useUtilityClasses = ownerState => {
21
22
  const {
@@ -51,45 +52,47 @@ const SpeedDialIconRoot = (0, _zeroStyled.styled)('span', {
51
52
  }
52
53
  })((0, _memoTheme.default)(({
53
54
  theme
54
- }) => ({
55
- height: 24,
56
- [`& .${_speedDialIconClasses.default.icon}`]: {
57
- transition: theme.transitions.create(['transform', 'opacity'], {
58
- duration: theme.transitions.duration.short
59
- })
60
- },
61
- [`& .${_speedDialIconClasses.default.openIcon}`]: {
62
- position: 'absolute',
63
- transition: theme.transitions.create(['transform', 'opacity'], {
64
- duration: theme.transitions.duration.short
65
- }),
66
- opacity: 0,
67
- transform: 'rotate(-45deg)'
68
- },
69
- variants: [{
70
- props: ({
71
- ownerState
72
- }) => ownerState.open,
73
- style: {
74
- [`& .${_speedDialIconClasses.default.icon}`]: {
75
- transform: 'rotate(45deg)'
76
- },
77
- [`& .${_speedDialIconClasses.default.openIcon}`]: {
78
- transform: 'rotate(0deg)',
79
- opacity: 1
55
+ }) => {
56
+ return {
57
+ height: 24,
58
+ [`& .${_speedDialIconClasses.default.icon}`]: {
59
+ ...(0, _utils.getTransitionStyles)(theme, ['transform', 'opacity'], {
60
+ duration: theme.transitions.duration.short
61
+ })
62
+ },
63
+ [`& .${_speedDialIconClasses.default.openIcon}`]: {
64
+ position: 'absolute',
65
+ ...(0, _utils.getTransitionStyles)(theme, ['transform', 'opacity'], {
66
+ duration: theme.transitions.duration.short
67
+ }),
68
+ opacity: 0,
69
+ transform: 'rotate(-45deg)'
70
+ },
71
+ variants: [{
72
+ props: ({
73
+ ownerState
74
+ }) => ownerState.open,
75
+ style: {
76
+ [`& .${_speedDialIconClasses.default.icon}`]: {
77
+ transform: 'rotate(45deg)'
78
+ },
79
+ [`& .${_speedDialIconClasses.default.openIcon}`]: {
80
+ transform: 'rotate(0deg)',
81
+ opacity: 1
82
+ }
80
83
  }
81
- }
82
- }, {
83
- props: ({
84
- ownerState
85
- }) => ownerState.open && ownerState.openIcon,
86
- style: {
87
- [`& .${_speedDialIconClasses.default.icon}`]: {
88
- opacity: 0
84
+ }, {
85
+ props: ({
86
+ ownerState
87
+ }) => ownerState.open && ownerState.openIcon,
88
+ style: {
89
+ [`& .${_speedDialIconClasses.default.icon}`]: {
90
+ opacity: 0
91
+ }
89
92
  }
90
- }
91
- }]
92
- })));
93
+ }]
94
+ };
95
+ }));
93
96
  const SpeedDialIcon = /*#__PURE__*/React.forwardRef(function SpeedDialIcon(inProps, ref) {
94
97
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
95
98
  props: inProps,