@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
@@ -10,9 +10,23 @@ import memoTheme from "../utils/memoTheme.mjs";
10
10
  import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
11
11
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
12
12
  import capitalize from "../utils/capitalize.mjs";
13
+ import { getReducedMotionStyles, getTransitionStyles } from "../transitions/utils.mjs";
13
14
  import { getLinearProgressUtilityClass } from "./linearProgressClasses.mjs";
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const TRANSITION_DURATION = 4; // seconds
17
+ const EMPTY_STYLE = {};
18
+ let warnedMinMaxWithoutVariant = false;
19
+ let warnedInvalidMinMaxValue = false;
20
+ let warnedValueRequired = false;
21
+ let warnedInvalidMinMaxValueBuffer = false;
22
+ let warnedValueBufferRequired = false;
23
+ export function resetWarningFlags() {
24
+ warnedMinMaxWithoutVariant = false;
25
+ warnedInvalidMinMaxValue = false;
26
+ warnedValueRequired = false;
27
+ warnedInvalidMinMaxValueBuffer = false;
28
+ warnedValueBufferRequired = false;
29
+ }
16
30
  const indeterminate1Keyframe = keyframes`
17
31
  0% {
18
32
  left: -35%;
@@ -188,7 +202,11 @@ const LinearProgressDashed = styled('span', {
188
202
  })), bufferAnimation || {
189
203
  // At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
190
204
  animation: `${bufferKeyframe} 3s infinite linear`
191
- });
205
+ }, memoTheme(({
206
+ theme
207
+ }) => getReducedMotionStyles(theme, {
208
+ animation: 'none'
209
+ }) || EMPTY_STYLE));
192
210
  const LinearProgressBar1 = styled('span', {
193
211
  name: 'MuiLinearProgress',
194
212
  slot: 'Bar1',
@@ -197,59 +215,81 @@ const LinearProgressBar1 = styled('span', {
197
215
  }
198
216
  })(memoTheme(({
199
217
  theme
200
- }) => ({
201
- width: '100%',
202
- position: 'absolute',
203
- left: 0,
204
- bottom: 0,
205
- top: 0,
206
- transition: 'transform 0.2s linear',
207
- transformOrigin: 'left',
208
- variants: [{
209
- props: {
210
- color: 'inherit'
211
- },
212
- style: {
213
- backgroundColor: 'currentColor'
214
- }
215
- }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
216
- props: {
217
- color
218
- },
219
- style: {
220
- backgroundColor: (theme.vars || theme).palette[color].main
221
- }
222
- })), {
223
- props: {
224
- variant: 'determinate'
225
- },
226
- style: {
227
- transition: `transform .${TRANSITION_DURATION}s linear`
228
- }
229
- }, {
230
- props: {
231
- variant: 'buffer'
232
- },
233
- style: {
234
- zIndex: 1,
235
- transition: `transform .${TRANSITION_DURATION}s linear`
236
- }
237
- }, {
238
- props: ({
239
- ownerState
240
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
241
- style: {
242
- width: 'auto'
243
- }
244
- }, {
245
- props: ({
246
- ownerState
247
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
248
- style: indeterminate1Animation || {
249
- animation: `${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`
250
- }
251
- }]
252
- })));
218
+ }) => {
219
+ const reducedMotionIndeterminateStyles = getReducedMotionStyles(theme, {
220
+ animation: 'none',
221
+ left: '30%',
222
+ right: 'auto',
223
+ width: '40%'
224
+ });
225
+ return {
226
+ width: '100%',
227
+ position: 'absolute',
228
+ left: 0,
229
+ bottom: 0,
230
+ top: 0,
231
+ ...getTransitionStyles(theme, 'transform', {
232
+ duration: '0.2s',
233
+ easing: 'linear'
234
+ }),
235
+ transformOrigin: 'left',
236
+ variants: [{
237
+ props: {
238
+ color: 'inherit'
239
+ },
240
+ style: {
241
+ backgroundColor: 'currentColor'
242
+ }
243
+ }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
244
+ props: {
245
+ color
246
+ },
247
+ style: {
248
+ backgroundColor: (theme.vars || theme).palette[color].main
249
+ }
250
+ })), {
251
+ props: {
252
+ variant: 'determinate'
253
+ },
254
+ style: {
255
+ ...getTransitionStyles(theme, 'transform', {
256
+ duration: `.${TRANSITION_DURATION}s`,
257
+ easing: 'linear'
258
+ })
259
+ }
260
+ }, {
261
+ props: {
262
+ variant: 'buffer'
263
+ },
264
+ style: {
265
+ zIndex: 1,
266
+ ...getTransitionStyles(theme, 'transform', {
267
+ duration: `.${TRANSITION_DURATION}s`,
268
+ easing: 'linear'
269
+ })
270
+ }
271
+ }, {
272
+ props: ({
273
+ ownerState
274
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
275
+ style: {
276
+ width: 'auto'
277
+ }
278
+ }, {
279
+ props: ({
280
+ ownerState
281
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
282
+ style: indeterminate1Animation || {
283
+ animation: `${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`
284
+ }
285
+ }, ...(reducedMotionIndeterminateStyles ? [{
286
+ props: ({
287
+ ownerState
288
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
289
+ style: reducedMotionIndeterminateStyles
290
+ }] : [])]
291
+ };
292
+ }));
253
293
  const LinearProgressBar2 = styled('span', {
254
294
  name: 'MuiLinearProgress',
255
295
  slot: 'Bar2',
@@ -258,67 +298,84 @@ const LinearProgressBar2 = styled('span', {
258
298
  }
259
299
  })(memoTheme(({
260
300
  theme
261
- }) => ({
262
- width: '100%',
263
- position: 'absolute',
264
- left: 0,
265
- bottom: 0,
266
- top: 0,
267
- transition: 'transform 0.2s linear',
268
- transformOrigin: 'left',
269
- variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
270
- props: {
271
- color
272
- },
273
- style: {
274
- '--LinearProgressBar2-barColor': (theme.vars || theme).palette[color].main
275
- }
276
- })), {
277
- props: ({
278
- ownerState
279
- }) => ownerState.variant !== 'buffer' && ownerState.color !== 'inherit',
280
- style: {
281
- backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
282
- }
283
- }, {
284
- props: ({
285
- ownerState
286
- }) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
287
- style: {
288
- backgroundColor: 'currentColor'
289
- }
290
- }, {
291
- props: {
292
- color: 'inherit'
293
- },
294
- style: {
295
- opacity: 0.3
296
- }
297
- }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
298
- props: {
299
- color,
300
- variant: 'buffer'
301
- },
302
- style: {
303
- backgroundColor: getColorShade(theme, color),
304
- transition: `transform .${TRANSITION_DURATION}s linear`
305
- }
306
- })), {
307
- props: ({
308
- ownerState
309
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
310
- style: {
311
- width: 'auto'
312
- }
313
- }, {
314
- props: ({
315
- ownerState
316
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
317
- style: indeterminate2Animation || {
318
- animation: `${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`
319
- }
320
- }]
321
- })));
301
+ }) => {
302
+ const reducedMotionIndeterminateStyles = getReducedMotionStyles(theme, {
303
+ animation: 'none',
304
+ display: 'none'
305
+ });
306
+ return {
307
+ width: '100%',
308
+ position: 'absolute',
309
+ left: 0,
310
+ bottom: 0,
311
+ top: 0,
312
+ ...getTransitionStyles(theme, 'transform', {
313
+ duration: '0.2s',
314
+ easing: 'linear'
315
+ }),
316
+ transformOrigin: 'left',
317
+ variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
318
+ props: {
319
+ color
320
+ },
321
+ style: {
322
+ '--LinearProgressBar2-barColor': (theme.vars || theme).palette[color].main
323
+ }
324
+ })), {
325
+ props: ({
326
+ ownerState
327
+ }) => ownerState.variant !== 'buffer' && ownerState.color !== 'inherit',
328
+ style: {
329
+ backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
330
+ }
331
+ }, {
332
+ props: ({
333
+ ownerState
334
+ }) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
335
+ style: {
336
+ backgroundColor: 'currentColor'
337
+ }
338
+ }, {
339
+ props: {
340
+ color: 'inherit'
341
+ },
342
+ style: {
343
+ opacity: 0.3
344
+ }
345
+ }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
346
+ props: {
347
+ color,
348
+ variant: 'buffer'
349
+ },
350
+ style: {
351
+ backgroundColor: getColorShade(theme, color),
352
+ ...getTransitionStyles(theme, 'transform', {
353
+ duration: `.${TRANSITION_DURATION}s`,
354
+ easing: 'linear'
355
+ })
356
+ }
357
+ })), {
358
+ props: ({
359
+ ownerState
360
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
361
+ style: {
362
+ width: 'auto'
363
+ }
364
+ }, {
365
+ props: ({
366
+ ownerState
367
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
368
+ style: indeterminate2Animation || {
369
+ animation: `${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`
370
+ }
371
+ }, ...(reducedMotionIndeterminateStyles ? [{
372
+ props: ({
373
+ ownerState
374
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
375
+ style: reducedMotionIndeterminateStyles
376
+ }] : [])]
377
+ };
378
+ }));
322
379
 
323
380
  /**
324
381
  * ## ARIA
@@ -335,6 +392,8 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
335
392
  const {
336
393
  className,
337
394
  color = 'primary',
395
+ max: maxProp,
396
+ min: minProp,
338
397
  value,
339
398
  valueBuffer,
340
399
  variant = 'indeterminate',
@@ -345,6 +404,14 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
345
404
  color,
346
405
  variant
347
406
  };
407
+ if (process.env.NODE_ENV !== 'production') {
408
+ if (!warnedMinMaxWithoutVariant && ['indeterminate', 'query'].includes(variant) && (minProp !== undefined || maxProp !== undefined)) {
409
+ console.warn(`MUI: You have provided the \`min\` or \`max\` props with an 'indeterminate' or 'query' variant. These props will have no effect.`);
410
+ warnedMinMaxWithoutVariant = true;
411
+ }
412
+ }
413
+ const min = minProp ?? 0;
414
+ const max = maxProp ?? 100;
348
415
  const classes = useUtilityClasses(ownerState);
349
416
  const isRtl = useRtl();
350
417
  const rootProps = {};
@@ -354,27 +421,48 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
354
421
  };
355
422
  if (variant === 'determinate' || variant === 'buffer') {
356
423
  if (value !== undefined) {
357
- rootProps['aria-valuenow'] = Math.round(value);
358
- rootProps['aria-valuemin'] = 0;
359
- rootProps['aria-valuemax'] = 100;
360
- let transform = value - 100;
424
+ if (process.env.NODE_ENV !== 'production') {
425
+ if (!warnedInvalidMinMaxValue && (value < min || value > max || min >= max)) {
426
+ console.error(`MUI: The min, max, and value props in LinearProgress should be numbers where min < max and min <= value <= max. Received min=${min}, max=${max}, value=${value}.`);
427
+ warnedInvalidMinMaxValue = true;
428
+ }
429
+ }
430
+ const range = max - min;
431
+ let transform = (value - min) / range * 100 - 100;
361
432
  if (isRtl) {
362
433
  transform = -transform;
363
434
  }
364
- inlineStyles.bar1.transform = `translateX(${transform}%)`;
435
+ inlineStyles.bar1.transform = range > 0 ? `translateX(${transform}%)` : 'translateX(-100%)'; // empty-state fallback when range is invalid
436
+
437
+ rootProps['aria-valuenow'] = value;
438
+ rootProps['aria-valuemin'] = min;
439
+ rootProps['aria-valuemax'] = max;
365
440
  } else if (process.env.NODE_ENV !== 'production') {
366
- console.error('MUI: You need to provide a value prop ' + 'when using the determinate or buffer variant of LinearProgress .');
441
+ if (!warnedValueRequired) {
442
+ console.error('MUI: You need to provide a value prop when using the determinate or buffer variant of LinearProgress.');
443
+ warnedValueRequired = true;
444
+ }
367
445
  }
368
446
  }
369
447
  if (variant === 'buffer') {
370
448
  if (valueBuffer !== undefined) {
371
- let transform = (valueBuffer || 0) - 100;
449
+ if (process.env.NODE_ENV !== 'production') {
450
+ if (!warnedInvalidMinMaxValueBuffer && (valueBuffer < min || valueBuffer > max || valueBuffer < value || min >= max)) {
451
+ console.error(`MUI: The min, max, value, and valueBuffer props in LinearProgress should be numbers where min < max and min <= value <= valueBuffer <= max. Received min=${min}, max=${max}, value=${value}, valueBuffer=${valueBuffer}.`);
452
+ warnedInvalidMinMaxValueBuffer = true;
453
+ }
454
+ }
455
+ const range = max - min;
456
+ let transform = (valueBuffer - min) / range * 100 - 100;
372
457
  if (isRtl) {
373
458
  transform = -transform;
374
459
  }
375
- inlineStyles.bar2.transform = `translateX(${transform}%)`;
460
+ inlineStyles.bar2.transform = range > 0 ? `translateX(${transform}%)` : 'translateX(-100%)'; // empty-state fallback when range is invalid
376
461
  } else if (process.env.NODE_ENV !== 'production') {
377
- console.error('MUI: You need to provide a valueBuffer prop ' + 'when using the buffer variant of LinearProgress.');
462
+ if (!warnedValueBufferRequired) {
463
+ console.error('MUI: You need to provide a valueBuffer prop when using the buffer variant of LinearProgress.');
464
+ warnedValueBufferRequired = true;
465
+ }
378
466
  }
379
467
  }
380
468
  return /*#__PURE__*/_jsxs(LinearProgressRoot, {
@@ -418,18 +506,28 @@ process.env.NODE_ENV !== "production" ? LinearProgress.propTypes /* remove-propt
418
506
  * @default 'primary'
419
507
  */
420
508
  color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary']), PropTypes.string]),
509
+ /**
510
+ * The maximum value for the progress indicator for the determinate and buffer variants.
511
+ * @default 100
512
+ */
513
+ max: PropTypes.number,
514
+ /**
515
+ * The minimum value for the progress indicator for the determinate and buffer variants.
516
+ * @default 0
517
+ */
518
+ min: PropTypes.number,
421
519
  /**
422
520
  * The system prop that allows defining system overrides as well as additional CSS styles.
423
521
  */
424
522
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
425
523
  /**
426
524
  * The value of the progress indicator for the determinate and buffer variants.
427
- * Value between 0 and 100.
525
+ * Value between `min` and `max`.
428
526
  */
429
527
  value: PropTypes.number,
430
528
  /**
431
529
  * The value for the buffer variant.
432
- * Value between 0 and 100.
530
+ * Value between `min` and `max`.
433
531
  */
434
532
  valueBuffer: PropTypes.number,
435
533
  /**
package/List/List.js CHANGED
@@ -55,7 +55,8 @@ const ListRoot = (0, _zeroStyled.styled)('ul', {
55
55
  ownerState
56
56
  }) => ownerState.subheader,
57
57
  style: {
58
- paddingTop: 0
58
+ paddingTop: 0,
59
+ isolation: 'isolate' // Prevent overlap with iOS overlay scrollbars.
59
60
  }
60
61
  }]
61
62
  });
package/List/List.mjs CHANGED
@@ -48,7 +48,8 @@ const ListRoot = styled('ul', {
48
48
  ownerState
49
49
  }) => ownerState.subheader,
50
50
  style: {
51
- paddingTop: 0
51
+ paddingTop: 0,
52
+ isolation: 'isolate' // Prevent overlap with iOS overlay scrollbars.
52
53
  }
53
54
  }]
54
55
  });
@@ -19,6 +19,7 @@ var _ListContext = _interopRequireDefault(require("../List/ListContext"));
19
19
  var _listItemClasses = require("./listItemClasses");
20
20
  var _ListItemButton = require("../ListItemButton");
21
21
  var _ListItemSecondaryAction = _interopRequireDefault(require("../ListItemSecondaryAction"));
22
+ var _utils = require("../transitions/utils");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
24
  const overridesResolver = (props, styles) => {
24
25
  const {
@@ -119,7 +120,7 @@ const ListItemRoot = exports.ListItemRoot = (0, _zeroStyled.styled)('div', {
119
120
  ownerState
120
121
  }) => ownerState.button,
121
122
  style: {
122
- transition: theme.transitions.create('background-color', {
123
+ ...(0, _utils.getTransitionStyles)(theme, 'background-color', {
123
124
  duration: theme.transitions.duration.shortest
124
125
  }),
125
126
  '&:hover': {
@@ -12,6 +12,7 @@ import ListContext from "../List/ListContext.mjs";
12
12
  import { getListItemUtilityClass } from "./listItemClasses.mjs";
13
13
  import { listItemButtonClasses } from "../ListItemButton/index.mjs";
14
14
  import ListItemSecondaryAction from "../ListItemSecondaryAction/index.mjs";
15
+ import { getTransitionStyles } from "../transitions/utils.mjs";
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  export const overridesResolver = (props, styles) => {
17
18
  const {
@@ -111,7 +112,7 @@ export const ListItemRoot = styled('div', {
111
112
  ownerState
112
113
  }) => ownerState.button,
113
114
  style: {
114
- transition: theme.transitions.create('background-color', {
115
+ ...getTransitionStyles(theme, 'background-color', {
115
116
  duration: theme.transitions.duration.shortest
116
117
  }),
117
118
  '&:hover': {
@@ -20,6 +20,7 @@ var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEff
20
20
  var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
21
21
  var _ListContext = _interopRequireDefault(require("../List/ListContext"));
22
22
  var _listItemButtonClasses = _interopRequireWildcard(require("./listItemButtonClasses"));
23
+ var _utils = require("../transitions/utils");
23
24
  var _jsxRuntime = require("react/jsx-runtime");
24
25
  const overridesResolver = (props, styles) => {
25
26
  const {
@@ -66,7 +67,7 @@ const ListItemButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
66
67
  textAlign: 'left',
67
68
  paddingTop: 8,
68
69
  paddingBottom: 8,
69
- transition: theme.transitions.create('background-color', {
70
+ ...(0, _utils.getTransitionStyles)(theme, 'background-color', {
70
71
  duration: theme.transitions.duration.shortest
71
72
  }),
72
73
  '&:hover': {
@@ -172,6 +173,12 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
172
173
  selected
173
174
  };
174
175
  const classes = useUtilityClasses(ownerState);
176
+
177
+ // Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
178
+ const {
179
+ root,
180
+ ...forwardedClasses
181
+ } = classes;
175
182
  const handleRef = (0, _useForkRef.default)(listItemRef, ref);
176
183
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListContext.default.Provider, {
177
184
  value: childContext,
@@ -186,7 +193,7 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
186
193
  ownerState: ownerState,
187
194
  className: (0, _clsx.default)(classes.root, className),
188
195
  ...other,
189
- classes: classes,
196
+ classes: forwardedClasses,
190
197
  children: children
191
198
  })
192
199
  });
@@ -13,6 +13,7 @@ import useEnhancedEffect from "../utils/useEnhancedEffect.mjs";
13
13
  import useForkRef from "../utils/useForkRef.mjs";
14
14
  import ListContext from "../List/ListContext.mjs";
15
15
  import listItemButtonClasses, { getListItemButtonUtilityClass } from "./listItemButtonClasses.mjs";
16
+ import { getTransitionStyles } from "../transitions/utils.mjs";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  export const overridesResolver = (props, styles) => {
18
19
  const {
@@ -58,7 +59,7 @@ const ListItemButtonRoot = styled(ButtonBase, {
58
59
  textAlign: 'left',
59
60
  paddingTop: 8,
60
61
  paddingBottom: 8,
61
- transition: theme.transitions.create('background-color', {
62
+ ...getTransitionStyles(theme, 'background-color', {
62
63
  duration: theme.transitions.duration.shortest
63
64
  }),
64
65
  '&:hover': {
@@ -164,6 +165,12 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
164
165
  selected
165
166
  };
166
167
  const classes = useUtilityClasses(ownerState);
168
+
169
+ // Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
170
+ const {
171
+ root,
172
+ ...forwardedClasses
173
+ } = classes;
167
174
  const handleRef = useForkRef(listItemRef, ref);
168
175
  return /*#__PURE__*/_jsx(ListContext.Provider, {
169
176
  value: childContext,
@@ -178,7 +185,7 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
178
185
  ownerState: ownerState,
179
186
  className: clsx(classes.root, className),
180
187
  ...other,
181
- classes: classes,
188
+ classes: forwardedClasses,
182
189
  children: children
183
190
  })
184
191
  });
package/Menu/Menu.d.mts CHANGED
@@ -7,7 +7,7 @@ import { PopoverProps } from "../Popover/index.mjs";
7
7
  import { MenuListProps } from "../MenuList/index.mjs";
8
8
  import { ModalProps } from "../Modal/index.mjs";
9
9
  import { BackdropProps } from "../Backdrop/index.mjs";
10
- import { TransitionProps } from "../transitions/transition.mjs";
10
+ import { TransitionProps } from "../transitions/types.mjs";
11
11
  import { MenuClasses } from "./menuClasses.mjs";
12
12
  import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.mjs";
13
13
  export interface MenuRootSlotPropsOverrides {}
package/Menu/Menu.d.ts CHANGED
@@ -7,7 +7,7 @@ import { PopoverProps } from "../Popover/index.js";
7
7
  import { MenuListProps } from "../MenuList/index.js";
8
8
  import { ModalProps } from "../Modal/index.js";
9
9
  import { BackdropProps } from "../Backdrop/index.js";
10
- import { TransitionProps } from "../transitions/transition.js";
10
+ import { TransitionProps } from "../transitions/types.js";
11
11
  import { MenuClasses } from "./menuClasses.js";
12
12
  import { CreateSlotsAndSlotProps, SlotComponentProps, SlotProps } from "../utils/types.js";
13
13
  export interface MenuRootSlotPropsOverrides {}
@@ -206,6 +206,12 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
206
206
  disableGutters
207
207
  };
208
208
  const classes = useUtilityClasses(props);
209
+
210
+ // Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
211
+ const {
212
+ root,
213
+ ...forwardedClasses
214
+ } = classes;
209
215
  const rovingItemProps = (0, _useRovingTabIndex.useRovingTabIndexItem)({
210
216
  id: rovingItemId,
211
217
  ref,
@@ -238,7 +244,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
238
244
  className: (0, _clsx.default)(classes.root, className),
239
245
  ...other,
240
246
  ownerState: ownerState,
241
- classes: classes
247
+ classes: forwardedClasses
242
248
  })
243
249
  });
244
250
  });
@@ -198,6 +198,12 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
198
198
  disableGutters
199
199
  };
200
200
  const classes = useUtilityClasses(props);
201
+
202
+ // Don't forward the 'root' class to the ButtonBase, as it will get duplicated with the one passed to the className prop.
203
+ const {
204
+ root,
205
+ ...forwardedClasses
206
+ } = classes;
201
207
  const rovingItemProps = useRovingTabIndexItem({
202
208
  id: rovingItemId,
203
209
  ref,
@@ -230,7 +236,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
230
236
  className: clsx(classes.root, className),
231
237
  ...other,
232
238
  ownerState: ownerState,
233
- classes: classes
239
+ classes: forwardedClasses
234
240
  })
235
241
  });
236
242
  });
@@ -10,6 +10,7 @@ exports.default = void 0;
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
12
  var _useRovingTabIndex = require("@mui/utils/useRovingTabIndex");
13
+ var _contains = _interopRequireDefault(require("../utils/contains"));
13
14
  var _ownerDocument = _interopRequireDefault(require("../utils/ownerDocument"));
14
15
  var _getActiveElement = _interopRequireDefault(require("../utils/getActiveElement"));
15
16
  var _getScrollbarSize = _interopRequireDefault(require("../utils/getScrollbarSize"));
@@ -185,7 +186,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
185
186
  return null;
186
187
  }
187
188
  const currentFocus = (0, _getActiveElement.default)((0, _ownerDocument.default)(listRef.current));
188
- if (currentFocus && listRef.current.contains(currentFocus)) {
189
+ if (currentFocus && (0, _contains.default)(listRef.current, currentFocus)) {
189
190
  return currentFocus;
190
191
  }
191
192
  return focusInitialTarget(true);