@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
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;
@@ -138,6 +139,10 @@ const SliderRail = exports.SliderRail = (0, _zeroStyled.styled)('span', {
138
139
  borderRadius: 'inherit',
139
140
  backgroundColor: 'currentColor',
140
141
  opacity: 0.38,
142
+ '@media (forced-colors: active)': {
143
+ border: '1px solid transparent',
144
+ boxSizing: 'border-box'
145
+ },
141
146
  variants: [{
142
147
  props: {
143
148
  orientation: 'horizontal'
@@ -179,7 +184,7 @@ const SliderTrack = exports.SliderTrack = (0, _zeroStyled.styled)('span', {
179
184
  borderRadius: 'inherit',
180
185
  border: '1px solid currentColor',
181
186
  backgroundColor: 'currentColor',
182
- transition: theme.transitions.create(['left', 'width', 'bottom', 'height'], {
187
+ ...(0, _utils.getTransitionStyles)(theme, ['left', 'width', 'bottom', 'height'], {
183
188
  duration: theme.transitions.duration.shortest
184
189
  }),
185
190
  variants: [{
@@ -187,7 +192,9 @@ const SliderTrack = exports.SliderTrack = (0, _zeroStyled.styled)('span', {
187
192
  size: 'small'
188
193
  },
189
194
  style: {
190
- border: 'none'
195
+ '@media (forced-colors: none)': {
196
+ border: 'none'
197
+ }
191
198
  }
192
199
  }, {
193
200
  props: {
@@ -253,9 +260,12 @@ const SliderThumb = exports.SliderThumb = (0, _zeroStyled.styled)('span', {
253
260
  display: 'flex',
254
261
  alignItems: 'center',
255
262
  justifyContent: 'center',
256
- transition: theme.transitions.create(['box-shadow', 'left', 'bottom'], {
263
+ ...(0, _utils.getTransitionStyles)(theme, ['box-shadow', 'left', 'bottom'], {
257
264
  duration: theme.transitions.duration.shortest
258
265
  }),
266
+ '@media (forced-colors: active)': {
267
+ border: '1px solid ButtonBorder'
268
+ },
259
269
  '&::before': {
260
270
  position: 'absolute',
261
271
  content: '""',
@@ -334,7 +344,7 @@ const SliderValueLabel = exports.SliderValueLabel = (0, _zeroStyled.styled)(_Sli
334
344
  whiteSpace: 'nowrap',
335
345
  ...theme.typography.body2,
336
346
  fontWeight: 500,
337
- transition: theme.transitions.create(['transform'], {
347
+ ...(0, _utils.getTransitionStyles)(theme, ['transform'], {
338
348
  duration: theme.transitions.duration.shortest
339
349
  }),
340
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;
@@ -131,6 +132,10 @@ export const SliderRail = styled('span', {
131
132
  borderRadius: 'inherit',
132
133
  backgroundColor: 'currentColor',
133
134
  opacity: 0.38,
135
+ '@media (forced-colors: active)': {
136
+ border: '1px solid transparent',
137
+ boxSizing: 'border-box'
138
+ },
134
139
  variants: [{
135
140
  props: {
136
141
  orientation: 'horizontal'
@@ -172,7 +177,7 @@ export const SliderTrack = styled('span', {
172
177
  borderRadius: 'inherit',
173
178
  border: '1px solid currentColor',
174
179
  backgroundColor: 'currentColor',
175
- transition: theme.transitions.create(['left', 'width', 'bottom', 'height'], {
180
+ ...getTransitionStyles(theme, ['left', 'width', 'bottom', 'height'], {
176
181
  duration: theme.transitions.duration.shortest
177
182
  }),
178
183
  variants: [{
@@ -180,7 +185,9 @@ export const SliderTrack = styled('span', {
180
185
  size: 'small'
181
186
  },
182
187
  style: {
183
- border: 'none'
188
+ '@media (forced-colors: none)': {
189
+ border: 'none'
190
+ }
184
191
  }
185
192
  }, {
186
193
  props: {
@@ -246,9 +253,12 @@ export const SliderThumb = styled('span', {
246
253
  display: 'flex',
247
254
  alignItems: 'center',
248
255
  justifyContent: 'center',
249
- transition: theme.transitions.create(['box-shadow', 'left', 'bottom'], {
256
+ ...getTransitionStyles(theme, ['box-shadow', 'left', 'bottom'], {
250
257
  duration: theme.transitions.duration.shortest
251
258
  }),
259
+ '@media (forced-colors: active)': {
260
+ border: '1px solid ButtonBorder'
261
+ },
252
262
  '&::before': {
253
263
  position: 'absolute',
254
264
  content: '""',
@@ -327,7 +337,7 @@ const SliderValueLabel = styled(BaseSliderValueLabel, {
327
337
  whiteSpace: 'nowrap',
328
338
  ...theme.typography.body2,
329
339
  fontWeight: 500,
330
- transition: theme.transitions.create(['transform'], {
340
+ ...getTransitionStyles(theme, ['transform'], {
331
341
  duration: theme.transitions.duration.shortest
332
342
  }),
333
343
  position: 'absolute',
@@ -20,6 +20,7 @@ var _visuallyHidden = _interopRequireDefault(require("@mui/utils/visuallyHidden"
20
20
  var _clamp = _interopRequireDefault(require("@mui/utils/clamp"));
21
21
  var _extractEventHandlers = _interopRequireDefault(require("@mui/utils/extractEventHandlers"));
22
22
  var _areArraysEqual = _interopRequireDefault(require("../utils/areArraysEqual"));
23
+ var _contains = _interopRequireDefault(require("../utils/contains"));
23
24
  var _getActiveElement = _interopRequireDefault(require("../utils/getActiveElement"));
24
25
  const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
25
26
  const EMPTY_MARKS = [];
@@ -103,7 +104,7 @@ function setValueIndex(values, newValue, index) {
103
104
  function focusThumb(sliderRef, activeIndex, setActive, focusVisible) {
104
105
  const doc = (0, _ownerDocument.default)(sliderRef.current);
105
106
  const activeElement = (0, _getActiveElement.default)(doc);
106
- if (!sliderRef.current?.contains(activeElement) || Number(activeElement?.getAttribute('data-index')) !== activeIndex) {
107
+ if (!(0, _contains.default)(sliderRef.current, activeElement) || Number(activeElement?.getAttribute('data-index')) !== activeIndex) {
107
108
  const input = sliderRef.current?.querySelector(`[type="range"][data-index="${activeIndex}"]`);
108
109
  if (input != null) {
109
110
  if (focusVisible == null) {
@@ -115,8 +116,8 @@ function focusThumb(sliderRef, activeIndex, setActive, focusVisible) {
115
116
  preventScroll: true,
116
117
  // Prevent pointer-driven focus rings in browsers that support this option.
117
118
  // Chrome 144+ supports `focusVisible` in `HTMLElement.focus()` options.
118
- // @ts-expect-error `focusVisible` is not yet in TypeScript's lib.dom FocusOptions.
119
119
  focusVisible
120
+ // Cast can be removed once TypeScript >= 6.0 (added `focusVisible` to lib.dom FocusOptions).
120
121
  });
121
122
  }
122
123
  }
@@ -388,7 +389,7 @@ function useSlider(parameters) {
388
389
  };
389
390
  (0, _useEnhancedEffect.default)(() => {
390
391
  const activeElement = (0, _getActiveElement.default)((0, _ownerDocument.default)(sliderRef.current));
391
- if (disabled && sliderRef.current?.contains(activeElement)) {
392
+ if (disabled && (0, _contains.default)(sliderRef.current, activeElement)) {
392
393
  // This is necessary because Firefox and Safari will keep focus
393
394
  // on a disabled element:
394
395
  // https://codesandbox.io/p/sandbox/mui-pr-22247-forked-h151h?file=/src/App.js
@@ -11,6 +11,7 @@ import visuallyHidden from '@mui/utils/visuallyHidden';
11
11
  import clamp from '@mui/utils/clamp';
12
12
  import extractEventHandlers from '@mui/utils/extractEventHandlers';
13
13
  import areArraysEqual from "../utils/areArraysEqual.mjs";
14
+ import contains from "../utils/contains.mjs";
14
15
  import getActiveElement from "../utils/getActiveElement.mjs";
15
16
  const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
16
17
  const EMPTY_MARKS = [];
@@ -94,7 +95,7 @@ function setValueIndex(values, newValue, index) {
94
95
  function focusThumb(sliderRef, activeIndex, setActive, focusVisible) {
95
96
  const doc = ownerDocument(sliderRef.current);
96
97
  const activeElement = getActiveElement(doc);
97
- if (!sliderRef.current?.contains(activeElement) || Number(activeElement?.getAttribute('data-index')) !== activeIndex) {
98
+ if (!contains(sliderRef.current, activeElement) || Number(activeElement?.getAttribute('data-index')) !== activeIndex) {
98
99
  const input = sliderRef.current?.querySelector(`[type="range"][data-index="${activeIndex}"]`);
99
100
  if (input != null) {
100
101
  if (focusVisible == null) {
@@ -106,8 +107,8 @@ function focusThumb(sliderRef, activeIndex, setActive, focusVisible) {
106
107
  preventScroll: true,
107
108
  // Prevent pointer-driven focus rings in browsers that support this option.
108
109
  // Chrome 144+ supports `focusVisible` in `HTMLElement.focus()` options.
109
- // @ts-expect-error `focusVisible` is not yet in TypeScript's lib.dom FocusOptions.
110
110
  focusVisible
111
+ // Cast can be removed once TypeScript >= 6.0 (added `focusVisible` to lib.dom FocusOptions).
111
112
  });
112
113
  }
113
114
  }
@@ -378,7 +379,7 @@ export function useSlider(parameters) {
378
379
  };
379
380
  useEnhancedEffect(() => {
380
381
  const activeElement = getActiveElement(ownerDocument(sliderRef.current));
381
- if (disabled && sliderRef.current?.contains(activeElement)) {
382
+ if (disabled && contains(sliderRef.current, activeElement)) {
382
383
  // This is necessary because Firefox and Safari will keep focus
383
384
  // on a disabled element:
384
385
  // https://codesandbox.io/p/sandbox/mui-pr-22247-forked-h151h?file=/src/App.js
@@ -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,
@@ -9,6 +9,7 @@ import memoTheme from "../utils/memoTheme.mjs";
9
9
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
10
10
  import AddIcon from "../internal/svg-icons/Add.mjs";
11
11
  import speedDialIconClasses, { getSpeedDialIconUtilityClass } from "./speedDialIconClasses.mjs";
12
+ import { getTransitionStyles } from "../transitions/utils.mjs";
12
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  const useUtilityClasses = ownerState => {
14
15
  const {
@@ -44,45 +45,47 @@ const SpeedDialIconRoot = styled('span', {
44
45
  }
45
46
  })(memoTheme(({
46
47
  theme
47
- }) => ({
48
- height: 24,
49
- [`& .${speedDialIconClasses.icon}`]: {
50
- transition: theme.transitions.create(['transform', 'opacity'], {
51
- duration: theme.transitions.duration.short
52
- })
53
- },
54
- [`& .${speedDialIconClasses.openIcon}`]: {
55
- position: 'absolute',
56
- transition: theme.transitions.create(['transform', 'opacity'], {
57
- duration: theme.transitions.duration.short
58
- }),
59
- opacity: 0,
60
- transform: 'rotate(-45deg)'
61
- },
62
- variants: [{
63
- props: ({
64
- ownerState
65
- }) => ownerState.open,
66
- style: {
67
- [`& .${speedDialIconClasses.icon}`]: {
68
- transform: 'rotate(45deg)'
69
- },
70
- [`& .${speedDialIconClasses.openIcon}`]: {
71
- transform: 'rotate(0deg)',
72
- opacity: 1
48
+ }) => {
49
+ return {
50
+ height: 24,
51
+ [`& .${speedDialIconClasses.icon}`]: {
52
+ ...getTransitionStyles(theme, ['transform', 'opacity'], {
53
+ duration: theme.transitions.duration.short
54
+ })
55
+ },
56
+ [`& .${speedDialIconClasses.openIcon}`]: {
57
+ position: 'absolute',
58
+ ...getTransitionStyles(theme, ['transform', 'opacity'], {
59
+ duration: theme.transitions.duration.short
60
+ }),
61
+ opacity: 0,
62
+ transform: 'rotate(-45deg)'
63
+ },
64
+ variants: [{
65
+ props: ({
66
+ ownerState
67
+ }) => ownerState.open,
68
+ style: {
69
+ [`& .${speedDialIconClasses.icon}`]: {
70
+ transform: 'rotate(45deg)'
71
+ },
72
+ [`& .${speedDialIconClasses.openIcon}`]: {
73
+ transform: 'rotate(0deg)',
74
+ opacity: 1
75
+ }
73
76
  }
74
- }
75
- }, {
76
- props: ({
77
- ownerState
78
- }) => ownerState.open && ownerState.openIcon,
79
- style: {
80
- [`& .${speedDialIconClasses.icon}`]: {
81
- opacity: 0
77
+ }, {
78
+ props: ({
79
+ ownerState
80
+ }) => ownerState.open && ownerState.openIcon,
81
+ style: {
82
+ [`& .${speedDialIconClasses.icon}`]: {
83
+ opacity: 0
84
+ }
82
85
  }
83
- }
84
- }]
85
- })));
86
+ }]
87
+ };
88
+ }));
86
89
  const SpeedDialIcon = /*#__PURE__*/React.forwardRef(function SpeedDialIcon(inProps, ref) {
87
90
  const props = useDefaultProps({
88
91
  props: inProps,