@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
@@ -17,6 +17,7 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
17
17
  var _cardActionAreaClasses = _interopRequireWildcard(require("./cardActionAreaClasses"));
18
18
  var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
19
19
  var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
20
+ var _utils = require("../transitions/utils");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  const useUtilityClasses = ownerState => {
22
23
  const {
@@ -65,7 +66,7 @@ const CardActionAreaFocusHighlight = (0, _zeroStyled.styled)('span', {
65
66
  borderRadius: 'inherit',
66
67
  opacity: 0,
67
68
  backgroundColor: 'currentcolor',
68
- transition: theme.transitions.create('opacity', {
69
+ ...(0, _utils.getTransitionStyles)(theme, 'opacity', {
69
70
  duration: theme.transitions.duration.short
70
71
  })
71
72
  })));
@@ -10,6 +10,7 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
10
10
  import cardActionAreaClasses, { getCardActionAreaUtilityClass } from "./cardActionAreaClasses.mjs";
11
11
  import ButtonBase from "../ButtonBase/index.mjs";
12
12
  import useSlot from "../utils/useSlot.mjs";
13
+ import { getTransitionStyles } from "../transitions/utils.mjs";
13
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
15
  const useUtilityClasses = ownerState => {
15
16
  const {
@@ -58,7 +59,7 @@ const CardActionAreaFocusHighlight = styled('span', {
58
59
  borderRadius: 'inherit',
59
60
  opacity: 0,
60
61
  backgroundColor: 'currentcolor',
61
- transition: theme.transitions.create('opacity', {
62
+ ...getTransitionStyles(theme, 'opacity', {
62
63
  duration: theme.transitions.duration.short
63
64
  })
64
65
  })));
@@ -158,7 +158,8 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
158
158
  slots,
159
159
  slotProps: {
160
160
  input: (0, _utils.mergeSlotProps)(typeof externalInputProps === 'function' ? externalInputProps(ownerState) : externalInputProps, {
161
- 'data-indeterminate': indeterminate
161
+ 'data-indeterminate': indeterminate,
162
+ 'aria-checked': indeterminate ? 'mixed' : undefined
162
163
  })
163
164
  }
164
165
  }
@@ -151,7 +151,8 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
151
151
  slots,
152
152
  slotProps: {
153
153
  input: mergeSlotProps(typeof externalInputProps === 'function' ? externalInputProps(ownerState) : externalInputProps, {
154
- 'data-indeterminate': indeterminate
154
+ 'data-indeterminate': indeterminate,
155
+ 'aria-checked': indeterminate ? 'mixed' : undefined
155
156
  })
156
157
  }
157
158
  }
package/Chip/Chip.js CHANGED
@@ -23,6 +23,7 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
23
23
  var _rootShouldForwardProp = _interopRequireDefault(require("../styles/rootShouldForwardProp"));
24
24
  var _chipClasses = _interopRequireWildcard(require("./chipClasses"));
25
25
  var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
26
+ var _utils = require("../transitions/utils");
26
27
  var _jsxRuntime = require("react/jsx-runtime");
27
28
  const useUtilityClasses = ownerState => {
28
29
  const {
@@ -83,7 +84,7 @@ const ChipRoot = (0, _zeroStyled.styled)('div', {
83
84
  backgroundColor: (theme.vars || theme).palette.action.selected,
84
85
  borderRadius: 32 / 2,
85
86
  whiteSpace: 'nowrap',
86
- transition: theme.transitions.create(['background-color', 'box-shadow']),
87
+ ...(0, _utils.getTransitionStyles)(theme, ['background-color', 'box-shadow']),
87
88
  // reset cursor explicitly in case ButtonBase is used
88
89
  cursor: 'unset',
89
90
  // We disable the focus ring for mouse, touch and keyboard users.
package/Chip/Chip.mjs CHANGED
@@ -16,6 +16,7 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
16
16
  import rootShouldForwardProp from "../styles/rootShouldForwardProp.mjs";
17
17
  import chipClasses, { getChipUtilityClass } from "./chipClasses.mjs";
18
18
  import useSlot from "../utils/useSlot.mjs";
19
+ import { getTransitionStyles } from "../transitions/utils.mjs";
19
20
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
20
21
  const useUtilityClasses = ownerState => {
21
22
  const {
@@ -76,7 +77,7 @@ const ChipRoot = styled('div', {
76
77
  backgroundColor: (theme.vars || theme).palette.action.selected,
77
78
  borderRadius: 32 / 2,
78
79
  whiteSpace: 'nowrap',
79
- transition: theme.transitions.create(['background-color', 'box-shadow']),
80
+ ...getTransitionStyles(theme, ['background-color', 'box-shadow']),
80
81
  // reset cursor explicitly in case ButtonBase is used
81
82
  cursor: 'unset',
82
83
  // We disable the focus ring for mouse, touch and keyboard users.
@@ -30,6 +30,16 @@ export interface CircularProgressProps extends StandardProps<React.HTMLAttribute
30
30
  * @default false
31
31
  */
32
32
  enableTrackSlot?: boolean | undefined;
33
+ /**
34
+ * The maximum value for the progress indicator for the determinate variant.
35
+ * @default 100
36
+ */
37
+ max?: number | undefined;
38
+ /**
39
+ * The minimum value for the progress indicator for the determinate variant.
40
+ * @default 0
41
+ */
42
+ min?: number | undefined;
33
43
  /**
34
44
  * The size of the component.
35
45
  * If using a number, the pixel unit is assumed.
@@ -48,8 +58,8 @@ export interface CircularProgressProps extends StandardProps<React.HTMLAttribute
48
58
  thickness?: number | undefined;
49
59
  /**
50
60
  * The value of the progress indicator for the determinate variant.
51
- * Value between 0 and 100.
52
- * @default 0
61
+ * Value between `min` and `max`.
62
+ * @default props.min ?? 0
53
63
  */
54
64
  value?: number | undefined;
55
65
  /**
@@ -30,6 +30,16 @@ export interface CircularProgressProps extends StandardProps<React.HTMLAttribute
30
30
  * @default false
31
31
  */
32
32
  enableTrackSlot?: boolean | undefined;
33
+ /**
34
+ * The maximum value for the progress indicator for the determinate variant.
35
+ * @default 100
36
+ */
37
+ max?: number | undefined;
38
+ /**
39
+ * The minimum value for the progress indicator for the determinate variant.
40
+ * @default 0
41
+ */
42
+ min?: number | undefined;
33
43
  /**
34
44
  * The size of the component.
35
45
  * If using a number, the pixel unit is assumed.
@@ -48,8 +58,8 @@ export interface CircularProgressProps extends StandardProps<React.HTMLAttribute
48
58
  thickness?: number | undefined;
49
59
  /**
50
60
  * The value of the progress indicator for the determinate variant.
51
- * Value between 0 and 100.
52
- * @default 0
61
+ * Value between `min` and `max`.
62
+ * @default props.min ?? 0
53
63
  */
54
64
  value?: number | undefined;
55
65
  /**
@@ -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,16 @@ var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
17
18
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
18
19
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
19
20
  var _createSimplePaletteValueFilter = _interopRequireDefault(require("../utils/createSimplePaletteValueFilter"));
21
+ var _utils = require("../transitions/utils");
20
22
  var _circularProgressClasses = require("./circularProgressClasses");
21
23
  var _jsxRuntime = require("react/jsx-runtime");
22
24
  const SIZE = 44;
25
+ let warnedMinMaxWithoutVariant = false;
26
+ let warnedInvalidMinMaxValue = false;
27
+ function resetWarningFlags() {
28
+ warnedMinMaxWithoutVariant = false;
29
+ warnedInvalidMinMaxValue = false;
30
+ }
23
31
  const circularRotateKeyframe = (0, _zeroStyled.keyframes)`
24
32
  0% {
25
33
  transform: rotate(0deg);
@@ -81,31 +89,41 @@ const CircularProgressRoot = (0, _zeroStyled.styled)('span', {
81
89
  }
82
90
  })((0, _memoTheme.default)(({
83
91
  theme
84
- }) => ({
85
- display: 'inline-block',
86
- variants: [{
87
- props: {
88
- variant: 'determinate'
89
- },
90
- style: {
91
- transition: theme.transitions.create('transform')
92
- }
93
- }, {
94
- props: {
95
- variant: 'indeterminate'
96
- },
97
- style: rotateAnimation || {
98
- animation: `${circularRotateKeyframe} 1.4s linear infinite`
99
- }
100
- }, ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
101
- props: {
102
- color
103
- },
104
- style: {
105
- color: (theme.vars || theme).palette[color].main
106
- }
107
- }))]
108
- })));
92
+ }) => {
93
+ const reducedMotionAnimationStyles = (0, _utils.getReducedMotionStyles)(theme, {
94
+ animation: 'none'
95
+ });
96
+ return {
97
+ display: 'inline-block',
98
+ variants: [{
99
+ props: {
100
+ variant: 'determinate'
101
+ },
102
+ style: {
103
+ ...(0, _utils.getTransitionStyles)(theme, 'transform')
104
+ }
105
+ }, {
106
+ props: {
107
+ variant: 'indeterminate'
108
+ },
109
+ style: rotateAnimation || {
110
+ animation: `${circularRotateKeyframe} 1.4s linear infinite`
111
+ }
112
+ }, ...(reducedMotionAnimationStyles ? [{
113
+ props: {
114
+ variant: 'indeterminate'
115
+ },
116
+ style: reducedMotionAnimationStyles
117
+ }] : []), ...Object.entries(theme.palette).filter((0, _createSimplePaletteValueFilter.default)()).map(([color]) => ({
118
+ props: {
119
+ color
120
+ },
121
+ style: {
122
+ color: (theme.vars || theme).palette[color].main
123
+ }
124
+ }))]
125
+ };
126
+ }));
109
127
  const CircularProgressSVG = (0, _zeroStyled.styled)('svg', {
110
128
  name: 'MuiCircularProgress',
111
129
  slot: 'Svg'
@@ -123,34 +141,44 @@ const CircularProgressCircle = (0, _zeroStyled.styled)('circle', {
123
141
  }
124
142
  })((0, _memoTheme.default)(({
125
143
  theme
126
- }) => ({
127
- stroke: 'currentColor',
128
- variants: [{
129
- props: {
130
- variant: 'determinate'
131
- },
132
- style: {
133
- transition: theme.transitions.create('stroke-dashoffset')
134
- }
135
- }, {
136
- props: {
137
- variant: 'indeterminate'
138
- },
139
- style: {
140
- // Some default value that looks fine waiting for the animation to kicks in.
141
- strokeDasharray: '80px, 200px',
142
- strokeDashoffset: 0 // Add the unit to fix a Edge 16 and below bug.
143
- }
144
- }, {
145
- props: ({
146
- ownerState
147
- }) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
148
- style: dashAnimation || {
149
- // At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
150
- animation: `${circularDashKeyframe} 1.4s ease-in-out infinite`
151
- }
152
- }]
153
- })));
144
+ }) => {
145
+ const reducedMotionAnimationStyles = (0, _utils.getReducedMotionStyles)(theme, {
146
+ animation: 'none'
147
+ });
148
+ return {
149
+ stroke: 'currentColor',
150
+ variants: [{
151
+ props: {
152
+ variant: 'determinate'
153
+ },
154
+ style: {
155
+ ...(0, _utils.getTransitionStyles)(theme, 'stroke-dashoffset')
156
+ }
157
+ }, {
158
+ props: {
159
+ variant: 'indeterminate'
160
+ },
161
+ style: {
162
+ // Some default value that looks fine while waiting for the animation to kick in.
163
+ strokeDasharray: '80px, 200px',
164
+ strokeDashoffset: 0 // Add the unit to fix a Edge 16 and below bug.
165
+ }
166
+ }, {
167
+ props: ({
168
+ ownerState
169
+ }) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
170
+ style: dashAnimation || {
171
+ // At runtime for Pigment CSS, `dashAnimation` will be null and the generated keyframe will be used.
172
+ animation: `${circularDashKeyframe} 1.4s ease-in-out infinite`
173
+ }
174
+ }, ...(reducedMotionAnimationStyles ? [{
175
+ props: ({
176
+ ownerState
177
+ }) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
178
+ style: reducedMotionAnimationStyles
179
+ }] : [])]
180
+ };
181
+ }));
154
182
  const CircularProgressTrack = (0, _zeroStyled.styled)('circle', {
155
183
  name: 'MuiCircularProgress',
156
184
  slot: 'Track'
@@ -178,13 +206,23 @@ const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress
178
206
  color = 'primary',
179
207
  disableShrink = false,
180
208
  enableTrackSlot = false,
209
+ min: minProp,
210
+ max: maxProp,
181
211
  size = 40,
182
212
  style,
183
213
  thickness = 3.6,
184
- value = 0,
214
+ value = props.min ?? 0,
185
215
  variant = 'indeterminate',
186
216
  ...other
187
217
  } = props;
218
+ if (process.env.NODE_ENV !== 'production') {
219
+ if (!warnedMinMaxWithoutVariant && variant === 'indeterminate' && (minProp !== undefined || maxProp !== undefined)) {
220
+ console.warn(`MUI: You have provided the \`min\` or \`max\` props with an 'indeterminate' variant. These props will have no effect.`);
221
+ warnedMinMaxWithoutVariant = true;
222
+ }
223
+ }
224
+ const min = minProp ?? 0;
225
+ const max = maxProp ?? 100;
188
226
  const ownerState = {
189
227
  ...props,
190
228
  color,
@@ -201,10 +239,19 @@ const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress
201
239
  const rootProps = {};
202
240
  if (variant === 'determinate') {
203
241
  const circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
242
+ if (process.env.NODE_ENV !== 'production') {
243
+ if (!warnedInvalidMinMaxValue && (value < min || value > max || min >= max)) {
244
+ console.error(`MUI: The min, max, and value props in CircularProgress should be numbers where min < max and min <= value <= max. Received min=${min}, max=${max}, value=${value}.`);
245
+ warnedInvalidMinMaxValue = true;
246
+ }
247
+ }
248
+ const range = max - min;
204
249
  circleStyle.strokeDasharray = circumference.toFixed(3);
205
- rootProps['aria-valuenow'] = Math.round(value);
206
- circleStyle.strokeDashoffset = `${((100 - value) / 100 * circumference).toFixed(3)}px`;
250
+ circleStyle.strokeDashoffset = range > 0 ? `${((max - value) / range * circumference).toFixed(3)}px` : `${circumference.toFixed(3)}px`; // empty-state fallback when range is invalid
207
251
  rootStyle.transform = 'rotate(-90deg)';
252
+ rootProps['aria-valuenow'] = value;
253
+ rootProps['aria-valuemin'] = min;
254
+ rootProps['aria-valuemax'] = max;
208
255
  }
209
256
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(CircularProgressRoot, {
210
257
  className: (0, _clsx.default)(classes.root, className),
@@ -282,6 +329,16 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
282
329
  * @default false
283
330
  */
284
331
  enableTrackSlot: _propTypes.default.bool,
332
+ /**
333
+ * The maximum value for the progress indicator for the determinate variant.
334
+ * @default 100
335
+ */
336
+ max: _propTypes.default.number,
337
+ /**
338
+ * The minimum value for the progress indicator for the determinate variant.
339
+ * @default 0
340
+ */
341
+ min: _propTypes.default.number,
285
342
  /**
286
343
  * The size of the component.
287
344
  * If using a number, the pixel unit is assumed.
@@ -304,8 +361,8 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
304
361
  thickness: _propTypes.default.number,
305
362
  /**
306
363
  * The value of the progress indicator for the determinate variant.
307
- * Value between 0 and 100.
308
- * @default 0
364
+ * Value between `min` and `max`.
365
+ * @default props.min ?? 0
309
366
  */
310
367
  value: _propTypes.default.number,
311
368
  /**
@@ -10,9 +10,16 @@ import memoTheme from "../utils/memoTheme.mjs";
10
10
  import { useDefaultProps } from "../DefaultPropsProvider/index.mjs";
11
11
  import capitalize from "../utils/capitalize.mjs";
12
12
  import createSimplePaletteValueFilter from "../utils/createSimplePaletteValueFilter.mjs";
13
+ import { getReducedMotionStyles, getTransitionStyles } from "../transitions/utils.mjs";
13
14
  import { getCircularProgressUtilityClass } from "./circularProgressClasses.mjs";
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const SIZE = 44;
17
+ let warnedMinMaxWithoutVariant = false;
18
+ let warnedInvalidMinMaxValue = false;
19
+ export function resetWarningFlags() {
20
+ warnedMinMaxWithoutVariant = false;
21
+ warnedInvalidMinMaxValue = false;
22
+ }
16
23
  const circularRotateKeyframe = keyframes`
17
24
  0% {
18
25
  transform: rotate(0deg);
@@ -74,31 +81,41 @@ const CircularProgressRoot = styled('span', {
74
81
  }
75
82
  })(memoTheme(({
76
83
  theme
77
- }) => ({
78
- display: 'inline-block',
79
- variants: [{
80
- props: {
81
- variant: 'determinate'
82
- },
83
- style: {
84
- transition: theme.transitions.create('transform')
85
- }
86
- }, {
87
- props: {
88
- variant: 'indeterminate'
89
- },
90
- style: rotateAnimation || {
91
- animation: `${circularRotateKeyframe} 1.4s linear infinite`
92
- }
93
- }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
94
- props: {
95
- color
96
- },
97
- style: {
98
- color: (theme.vars || theme).palette[color].main
99
- }
100
- }))]
101
- })));
84
+ }) => {
85
+ const reducedMotionAnimationStyles = getReducedMotionStyles(theme, {
86
+ animation: 'none'
87
+ });
88
+ return {
89
+ display: 'inline-block',
90
+ variants: [{
91
+ props: {
92
+ variant: 'determinate'
93
+ },
94
+ style: {
95
+ ...getTransitionStyles(theme, 'transform')
96
+ }
97
+ }, {
98
+ props: {
99
+ variant: 'indeterminate'
100
+ },
101
+ style: rotateAnimation || {
102
+ animation: `${circularRotateKeyframe} 1.4s linear infinite`
103
+ }
104
+ }, ...(reducedMotionAnimationStyles ? [{
105
+ props: {
106
+ variant: 'indeterminate'
107
+ },
108
+ style: reducedMotionAnimationStyles
109
+ }] : []), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({
110
+ props: {
111
+ color
112
+ },
113
+ style: {
114
+ color: (theme.vars || theme).palette[color].main
115
+ }
116
+ }))]
117
+ };
118
+ }));
102
119
  const CircularProgressSVG = styled('svg', {
103
120
  name: 'MuiCircularProgress',
104
121
  slot: 'Svg'
@@ -116,34 +133,44 @@ const CircularProgressCircle = styled('circle', {
116
133
  }
117
134
  })(memoTheme(({
118
135
  theme
119
- }) => ({
120
- stroke: 'currentColor',
121
- variants: [{
122
- props: {
123
- variant: 'determinate'
124
- },
125
- style: {
126
- transition: theme.transitions.create('stroke-dashoffset')
127
- }
128
- }, {
129
- props: {
130
- variant: 'indeterminate'
131
- },
132
- style: {
133
- // Some default value that looks fine waiting for the animation to kicks in.
134
- strokeDasharray: '80px, 200px',
135
- strokeDashoffset: 0 // Add the unit to fix a Edge 16 and below bug.
136
- }
137
- }, {
138
- props: ({
139
- ownerState
140
- }) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
141
- style: dashAnimation || {
142
- // At runtime for Pigment CSS, `bufferAnimation` will be null and the generated keyframe will be used.
143
- animation: `${circularDashKeyframe} 1.4s ease-in-out infinite`
144
- }
145
- }]
146
- })));
136
+ }) => {
137
+ const reducedMotionAnimationStyles = getReducedMotionStyles(theme, {
138
+ animation: 'none'
139
+ });
140
+ return {
141
+ stroke: 'currentColor',
142
+ variants: [{
143
+ props: {
144
+ variant: 'determinate'
145
+ },
146
+ style: {
147
+ ...getTransitionStyles(theme, 'stroke-dashoffset')
148
+ }
149
+ }, {
150
+ props: {
151
+ variant: 'indeterminate'
152
+ },
153
+ style: {
154
+ // Some default value that looks fine while waiting for the animation to kick in.
155
+ strokeDasharray: '80px, 200px',
156
+ strokeDashoffset: 0 // Add the unit to fix a Edge 16 and below bug.
157
+ }
158
+ }, {
159
+ props: ({
160
+ ownerState
161
+ }) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
162
+ style: dashAnimation || {
163
+ // At runtime for Pigment CSS, `dashAnimation` will be null and the generated keyframe will be used.
164
+ animation: `${circularDashKeyframe} 1.4s ease-in-out infinite`
165
+ }
166
+ }, ...(reducedMotionAnimationStyles ? [{
167
+ props: ({
168
+ ownerState
169
+ }) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink,
170
+ style: reducedMotionAnimationStyles
171
+ }] : [])]
172
+ };
173
+ }));
147
174
  const CircularProgressTrack = styled('circle', {
148
175
  name: 'MuiCircularProgress',
149
176
  slot: 'Track'
@@ -171,13 +198,23 @@ const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress
171
198
  color = 'primary',
172
199
  disableShrink = false,
173
200
  enableTrackSlot = false,
201
+ min: minProp,
202
+ max: maxProp,
174
203
  size = 40,
175
204
  style,
176
205
  thickness = 3.6,
177
- value = 0,
206
+ value = props.min ?? 0,
178
207
  variant = 'indeterminate',
179
208
  ...other
180
209
  } = props;
210
+ if (process.env.NODE_ENV !== 'production') {
211
+ if (!warnedMinMaxWithoutVariant && variant === 'indeterminate' && (minProp !== undefined || maxProp !== undefined)) {
212
+ console.warn(`MUI: You have provided the \`min\` or \`max\` props with an 'indeterminate' variant. These props will have no effect.`);
213
+ warnedMinMaxWithoutVariant = true;
214
+ }
215
+ }
216
+ const min = minProp ?? 0;
217
+ const max = maxProp ?? 100;
181
218
  const ownerState = {
182
219
  ...props,
183
220
  color,
@@ -194,10 +231,19 @@ const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress
194
231
  const rootProps = {};
195
232
  if (variant === 'determinate') {
196
233
  const circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
234
+ if (process.env.NODE_ENV !== 'production') {
235
+ if (!warnedInvalidMinMaxValue && (value < min || value > max || min >= max)) {
236
+ console.error(`MUI: The min, max, and value props in CircularProgress should be numbers where min < max and min <= value <= max. Received min=${min}, max=${max}, value=${value}.`);
237
+ warnedInvalidMinMaxValue = true;
238
+ }
239
+ }
240
+ const range = max - min;
197
241
  circleStyle.strokeDasharray = circumference.toFixed(3);
198
- rootProps['aria-valuenow'] = Math.round(value);
199
- circleStyle.strokeDashoffset = `${((100 - value) / 100 * circumference).toFixed(3)}px`;
242
+ circleStyle.strokeDashoffset = range > 0 ? `${((max - value) / range * circumference).toFixed(3)}px` : `${circumference.toFixed(3)}px`; // empty-state fallback when range is invalid
200
243
  rootStyle.transform = 'rotate(-90deg)';
244
+ rootProps['aria-valuenow'] = value;
245
+ rootProps['aria-valuemin'] = min;
246
+ rootProps['aria-valuemax'] = max;
201
247
  }
202
248
  return /*#__PURE__*/_jsx(CircularProgressRoot, {
203
249
  className: clsx(classes.root, className),
@@ -275,6 +321,16 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
275
321
  * @default false
276
322
  */
277
323
  enableTrackSlot: PropTypes.bool,
324
+ /**
325
+ * The maximum value for the progress indicator for the determinate variant.
326
+ * @default 100
327
+ */
328
+ max: PropTypes.number,
329
+ /**
330
+ * The minimum value for the progress indicator for the determinate variant.
331
+ * @default 0
332
+ */
333
+ min: PropTypes.number,
278
334
  /**
279
335
  * The size of the component.
280
336
  * If using a number, the pixel unit is assumed.
@@ -297,8 +353,8 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
297
353
  thickness: PropTypes.number,
298
354
  /**
299
355
  * The value of the progress indicator for the determinate variant.
300
- * Value between 0 and 100.
301
- * @default 0
356
+ * Value between `min` and `max`.
357
+ * @default props.min ?? 0
302
358
  */
303
359
  value: PropTypes.number,
304
360
  /**
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", {
9
9
  exports.ClickAwayListener = ClickAwayListener;
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _contains = _interopRequireDefault(require("@mui/utils/contains"));
12
13
  var _ownerDocument = _interopRequireDefault(require("@mui/utils/ownerDocument"));
13
14
  var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
14
15
  var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
@@ -72,7 +73,7 @@ function ClickAwayListener(props) {
72
73
  syntheticEventRef.current = false;
73
74
  const doc = (0, _ownerDocument.default)(nodeRef.current);
74
75
 
75
- // 1. IE11 support, which trigger the handleClickAway even after the unbind
76
+ // 1. IE 11 support, which trigger the handleClickAway even after the unbind
76
77
  // 2. The child might render null.
77
78
  // 3. Behave like a blur listener.
78
79
  if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {
@@ -90,11 +91,7 @@ function ClickAwayListener(props) {
90
91
  if (event.composedPath) {
91
92
  insideDOM = event.composedPath().includes(nodeRef.current);
92
93
  } else {
93
- insideDOM = !doc.documentElement.contains(
94
- // @ts-expect-error returns `false` as intended when not dispatched from a Node
95
- event.target) || nodeRef.current.contains(
96
- // @ts-expect-error returns `false` as intended when not dispatched from a Node
97
- event.target);
94
+ insideDOM = !(0, _contains.default)(doc.documentElement, event.target) || (0, _contains.default)(nodeRef.current, event.target);
98
95
  }
99
96
  if (!insideDOM && (disableReactTree || !insideReactTree)) {
100
97
  onClickAway(event);