@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
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
9
  exports.default = void 0;
10
+ exports.resetWarningFlags = resetWarningFlags;
10
11
  var React = _interopRequireWildcard(require("react"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -17,9 +18,23 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
17
18
  var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
18
19
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
19
20
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
21
+ var _utils = require("../transitions/utils");
20
22
  var _linearProgressClasses = require("./linearProgressClasses");
21
23
  var _jsxRuntime = require("react/jsx-runtime");
22
24
  const TRANSITION_DURATION = 4; // seconds
25
+ const EMPTY_STYLE = {};
26
+ let warnedMinMaxWithoutVariant = false;
27
+ let warnedInvalidMinMaxValue = false;
28
+ let warnedValueRequired = false;
29
+ let warnedInvalidMinMaxValueBuffer = false;
30
+ let warnedValueBufferRequired = false;
31
+ function resetWarningFlags() {
32
+ warnedMinMaxWithoutVariant = false;
33
+ warnedInvalidMinMaxValue = false;
34
+ warnedValueRequired = false;
35
+ warnedInvalidMinMaxValueBuffer = false;
36
+ warnedValueBufferRequired = false;
37
+ }
23
38
  const indeterminate1Keyframe = (0, _zeroStyled.keyframes)`
24
39
  0% {
25
40
  left: -35%;
@@ -195,7 +210,11 @@ const LinearProgressDashed = (0, _zeroStyled.styled)('span', {
195
210
  })), bufferAnimation || {
196
211
  // At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
197
212
  animation: `${bufferKeyframe} 3s infinite linear`
198
- });
213
+ }, (0, _memoTheme.default)(({
214
+ theme
215
+ }) => (0, _utils.getReducedMotionStyles)(theme, {
216
+ animation: 'none'
217
+ }) || EMPTY_STYLE));
199
218
  const LinearProgressBar1 = (0, _zeroStyled.styled)('span', {
200
219
  name: 'MuiLinearProgress',
201
220
  slot: 'Bar1',
@@ -204,59 +223,81 @@ const LinearProgressBar1 = (0, _zeroStyled.styled)('span', {
204
223
  }
205
224
  })((0, _memoTheme.default)(({
206
225
  theme
207
- }) => ({
208
- width: '100%',
209
- position: 'absolute',
210
- left: 0,
211
- bottom: 0,
212
- top: 0,
213
- transition: 'transform 0.2s linear',
214
- transformOrigin: 'left',
215
- variants: [{
216
- props: {
217
- color: 'inherit'
218
- },
219
- style: {
220
- backgroundColor: 'currentColor'
221
- }
222
- }, ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
223
- props: {
224
- color
225
- },
226
- style: {
227
- backgroundColor: (theme.vars || theme).palette[color].main
228
- }
229
- })), {
230
- props: {
231
- variant: 'determinate'
232
- },
233
- style: {
234
- transition: `transform .${TRANSITION_DURATION}s linear`
235
- }
236
- }, {
237
- props: {
238
- variant: 'buffer'
239
- },
240
- style: {
241
- zIndex: 1,
242
- transition: `transform .${TRANSITION_DURATION}s linear`
243
- }
244
- }, {
245
- props: ({
246
- ownerState
247
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
248
- style: {
249
- width: 'auto'
250
- }
251
- }, {
252
- props: ({
253
- ownerState
254
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
255
- style: indeterminate1Animation || {
256
- animation: `${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`
257
- }
258
- }]
259
- })));
226
+ }) => {
227
+ const reducedMotionIndeterminateStyles = (0, _utils.getReducedMotionStyles)(theme, {
228
+ animation: 'none',
229
+ left: '30%',
230
+ right: 'auto',
231
+ width: '40%'
232
+ });
233
+ return {
234
+ width: '100%',
235
+ position: 'absolute',
236
+ left: 0,
237
+ bottom: 0,
238
+ top: 0,
239
+ ...(0, _utils.getTransitionStyles)(theme, 'transform', {
240
+ duration: '0.2s',
241
+ easing: 'linear'
242
+ }),
243
+ transformOrigin: 'left',
244
+ variants: [{
245
+ props: {
246
+ color: 'inherit'
247
+ },
248
+ style: {
249
+ backgroundColor: 'currentColor'
250
+ }
251
+ }, ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
252
+ props: {
253
+ color
254
+ },
255
+ style: {
256
+ backgroundColor: (theme.vars || theme).palette[color].main
257
+ }
258
+ })), {
259
+ props: {
260
+ variant: 'determinate'
261
+ },
262
+ style: {
263
+ ...(0, _utils.getTransitionStyles)(theme, 'transform', {
264
+ duration: `.${TRANSITION_DURATION}s`,
265
+ easing: 'linear'
266
+ })
267
+ }
268
+ }, {
269
+ props: {
270
+ variant: 'buffer'
271
+ },
272
+ style: {
273
+ zIndex: 1,
274
+ ...(0, _utils.getTransitionStyles)(theme, 'transform', {
275
+ duration: `.${TRANSITION_DURATION}s`,
276
+ easing: 'linear'
277
+ })
278
+ }
279
+ }, {
280
+ props: ({
281
+ ownerState
282
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
283
+ style: {
284
+ width: 'auto'
285
+ }
286
+ }, {
287
+ props: ({
288
+ ownerState
289
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
290
+ style: indeterminate1Animation || {
291
+ animation: `${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`
292
+ }
293
+ }, ...(reducedMotionIndeterminateStyles ? [{
294
+ props: ({
295
+ ownerState
296
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
297
+ style: reducedMotionIndeterminateStyles
298
+ }] : [])]
299
+ };
300
+ }));
260
301
  const LinearProgressBar2 = (0, _zeroStyled.styled)('span', {
261
302
  name: 'MuiLinearProgress',
262
303
  slot: 'Bar2',
@@ -265,67 +306,84 @@ const LinearProgressBar2 = (0, _zeroStyled.styled)('span', {
265
306
  }
266
307
  })((0, _memoTheme.default)(({
267
308
  theme
268
- }) => ({
269
- width: '100%',
270
- position: 'absolute',
271
- left: 0,
272
- bottom: 0,
273
- top: 0,
274
- transition: 'transform 0.2s linear',
275
- transformOrigin: 'left',
276
- variants: [...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
277
- props: {
278
- color
279
- },
280
- style: {
281
- '--LinearProgressBar2-barColor': (theme.vars || theme).palette[color].main
282
- }
283
- })), {
284
- props: ({
285
- ownerState
286
- }) => ownerState.variant !== 'buffer' && ownerState.color !== 'inherit',
287
- style: {
288
- backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
289
- }
290
- }, {
291
- props: ({
292
- ownerState
293
- }) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
294
- style: {
295
- backgroundColor: 'currentColor'
296
- }
297
- }, {
298
- props: {
299
- color: 'inherit'
300
- },
301
- style: {
302
- opacity: 0.3
303
- }
304
- }, ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
305
- props: {
306
- color,
307
- variant: 'buffer'
308
- },
309
- style: {
310
- backgroundColor: getColorShade(theme, color),
311
- transition: `transform .${TRANSITION_DURATION}s linear`
312
- }
313
- })), {
314
- props: ({
315
- ownerState
316
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
317
- style: {
318
- width: 'auto'
319
- }
320
- }, {
321
- props: ({
322
- ownerState
323
- }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
324
- style: indeterminate2Animation || {
325
- animation: `${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`
326
- }
327
- }]
328
- })));
309
+ }) => {
310
+ const reducedMotionIndeterminateStyles = (0, _utils.getReducedMotionStyles)(theme, {
311
+ animation: 'none',
312
+ display: 'none'
313
+ });
314
+ return {
315
+ width: '100%',
316
+ position: 'absolute',
317
+ left: 0,
318
+ bottom: 0,
319
+ top: 0,
320
+ ...(0, _utils.getTransitionStyles)(theme, 'transform', {
321
+ duration: '0.2s',
322
+ easing: 'linear'
323
+ }),
324
+ transformOrigin: 'left',
325
+ variants: [...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
326
+ props: {
327
+ color
328
+ },
329
+ style: {
330
+ '--LinearProgressBar2-barColor': (theme.vars || theme).palette[color].main
331
+ }
332
+ })), {
333
+ props: ({
334
+ ownerState
335
+ }) => ownerState.variant !== 'buffer' && ownerState.color !== 'inherit',
336
+ style: {
337
+ backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
338
+ }
339
+ }, {
340
+ props: ({
341
+ ownerState
342
+ }) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
343
+ style: {
344
+ backgroundColor: 'currentColor'
345
+ }
346
+ }, {
347
+ props: {
348
+ color: 'inherit'
349
+ },
350
+ style: {
351
+ opacity: 0.3
352
+ }
353
+ }, ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
354
+ props: {
355
+ color,
356
+ variant: 'buffer'
357
+ },
358
+ style: {
359
+ backgroundColor: getColorShade(theme, color),
360
+ ...(0, _utils.getTransitionStyles)(theme, 'transform', {
361
+ duration: `.${TRANSITION_DURATION}s`,
362
+ easing: 'linear'
363
+ })
364
+ }
365
+ })), {
366
+ props: ({
367
+ ownerState
368
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
369
+ style: {
370
+ width: 'auto'
371
+ }
372
+ }, {
373
+ props: ({
374
+ ownerState
375
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
376
+ style: indeterminate2Animation || {
377
+ animation: `${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`
378
+ }
379
+ }, ...(reducedMotionIndeterminateStyles ? [{
380
+ props: ({
381
+ ownerState
382
+ }) => ownerState.variant === 'indeterminate' || ownerState.variant === 'query',
383
+ style: reducedMotionIndeterminateStyles
384
+ }] : [])]
385
+ };
386
+ }));
329
387
 
330
388
  /**
331
389
  * ## ARIA
@@ -342,6 +400,8 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
342
400
  const {
343
401
  className,
344
402
  color = 'primary',
403
+ max: maxProp,
404
+ min: minProp,
345
405
  value,
346
406
  valueBuffer,
347
407
  variant = 'indeterminate',
@@ -352,6 +412,14 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
352
412
  color,
353
413
  variant
354
414
  };
415
+ if (process.env.NODE_ENV !== 'production') {
416
+ if (!warnedMinMaxWithoutVariant && ['indeterminate', 'query'].includes(variant) && (minProp !== undefined || maxProp !== undefined)) {
417
+ console.warn(`MUI: You have provided the \`min\` or \`max\` props with an 'indeterminate' or 'query' variant. These props will have no effect.`);
418
+ warnedMinMaxWithoutVariant = true;
419
+ }
420
+ }
421
+ const min = minProp ?? 0;
422
+ const max = maxProp ?? 100;
355
423
  const classes = useUtilityClasses(ownerState);
356
424
  const isRtl = (0, _RtlProvider.useRtl)();
357
425
  const rootProps = {};
@@ -361,27 +429,48 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
361
429
  };
362
430
  if (variant === 'determinate' || variant === 'buffer') {
363
431
  if (value !== undefined) {
364
- rootProps['aria-valuenow'] = Math.round(value);
365
- rootProps['aria-valuemin'] = 0;
366
- rootProps['aria-valuemax'] = 100;
367
- let transform = value - 100;
432
+ if (process.env.NODE_ENV !== 'production') {
433
+ if (!warnedInvalidMinMaxValue && (value < min || value > max || min >= max)) {
434
+ 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}.`);
435
+ warnedInvalidMinMaxValue = true;
436
+ }
437
+ }
438
+ const range = max - min;
439
+ let transform = (value - min) / range * 100 - 100;
368
440
  if (isRtl) {
369
441
  transform = -transform;
370
442
  }
371
- inlineStyles.bar1.transform = `translateX(${transform}%)`;
443
+ inlineStyles.bar1.transform = range > 0 ? `translateX(${transform}%)` : 'translateX(-100%)'; // empty-state fallback when range is invalid
444
+
445
+ rootProps['aria-valuenow'] = value;
446
+ rootProps['aria-valuemin'] = min;
447
+ rootProps['aria-valuemax'] = max;
372
448
  } else if (process.env.NODE_ENV !== 'production') {
373
- console.error('MUI: You need to provide a value prop ' + 'when using the determinate or buffer variant of LinearProgress .');
449
+ if (!warnedValueRequired) {
450
+ console.error('MUI: You need to provide a value prop when using the determinate or buffer variant of LinearProgress.');
451
+ warnedValueRequired = true;
452
+ }
374
453
  }
375
454
  }
376
455
  if (variant === 'buffer') {
377
456
  if (valueBuffer !== undefined) {
378
- let transform = (valueBuffer || 0) - 100;
457
+ if (process.env.NODE_ENV !== 'production') {
458
+ if (!warnedInvalidMinMaxValueBuffer && (valueBuffer < min || valueBuffer > max || valueBuffer < value || min >= max)) {
459
+ 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}.`);
460
+ warnedInvalidMinMaxValueBuffer = true;
461
+ }
462
+ }
463
+ const range = max - min;
464
+ let transform = (valueBuffer - min) / range * 100 - 100;
379
465
  if (isRtl) {
380
466
  transform = -transform;
381
467
  }
382
- inlineStyles.bar2.transform = `translateX(${transform}%)`;
468
+ inlineStyles.bar2.transform = range > 0 ? `translateX(${transform}%)` : 'translateX(-100%)'; // empty-state fallback when range is invalid
383
469
  } else if (process.env.NODE_ENV !== 'production') {
384
- console.error('MUI: You need to provide a valueBuffer prop ' + 'when using the buffer variant of LinearProgress.');
470
+ if (!warnedValueBufferRequired) {
471
+ console.error('MUI: You need to provide a valueBuffer prop when using the buffer variant of LinearProgress.');
472
+ warnedValueBufferRequired = true;
473
+ }
385
474
  }
386
475
  }
387
476
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinearProgressRoot, {
@@ -425,18 +514,28 @@ process.env.NODE_ENV !== "production" ? LinearProgress.propTypes /* remove-propt
425
514
  * @default 'primary'
426
515
  */
427
516
  color: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['inherit', 'primary', 'secondary']), _propTypes.default.string]),
517
+ /**
518
+ * The maximum value for the progress indicator for the determinate and buffer variants.
519
+ * @default 100
520
+ */
521
+ max: _propTypes.default.number,
522
+ /**
523
+ * The minimum value for the progress indicator for the determinate and buffer variants.
524
+ * @default 0
525
+ */
526
+ min: _propTypes.default.number,
428
527
  /**
429
528
  * The system prop that allows defining system overrides as well as additional CSS styles.
430
529
  */
431
530
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
432
531
  /**
433
532
  * The value of the progress indicator for the determinate and buffer variants.
434
- * Value between 0 and 100.
533
+ * Value between `min` and `max`.
435
534
  */
436
535
  value: _propTypes.default.number,
437
536
  /**
438
537
  * The value for the buffer variant.
439
- * Value between 0 and 100.
538
+ * Value between `min` and `max`.
440
539
  */
441
540
  valueBuffer: _propTypes.default.number,
442
541
  /**