@mui/material 5.4.0 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/Accordion/accordionClasses.d.ts +18 -18
  2. package/AccordionActions/accordionActionsClasses.d.ts +10 -10
  3. package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
  4. package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
  5. package/Alert/alertClasses.d.ts +44 -44
  6. package/AlertTitle/alertTitleClasses.d.ts +8 -8
  7. package/AppBar/appBarClasses.d.ts +28 -28
  8. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  9. package/Avatar/avatarClasses.d.ts +20 -20
  10. package/AvatarGroup/AvatarGroup.d.ts +10 -0
  11. package/AvatarGroup/AvatarGroup.js +19 -7
  12. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  13. package/Badge/Badge.js +3 -2
  14. package/BottomNavigation/BottomNavigation.js +0 -0
  15. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  16. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  17. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  18. package/Button/buttonClasses.d.ts +76 -76
  19. package/ButtonBase/ButtonBase.d.ts +5 -1
  20. package/ButtonBase/ButtonBase.js +15 -2
  21. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  22. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  23. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  24. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  25. package/CHANGELOG.md +100 -28
  26. package/Card/cardClasses.d.ts +8 -8
  27. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  28. package/CardActions/cardActionsClasses.d.ts +10 -10
  29. package/CardContent/cardContentClasses.d.ts +8 -8
  30. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  31. package/CardMedia/cardMediaClasses.d.ts +12 -12
  32. package/Checkbox/checkboxClasses.d.ts +18 -18
  33. package/Chip/chipClasses.d.ts +80 -80
  34. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  35. package/ClickAwayListener/index.d.ts +2 -2
  36. package/Collapse/collapseClasses.d.ts +18 -18
  37. package/Container/containerClasses.d.ts +22 -22
  38. package/Dialog/DialogContext.d.ts +6 -6
  39. package/Dialog/dialogClasses.d.ts +36 -36
  40. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  41. package/DialogContent/dialogContentClasses.d.ts +10 -10
  42. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  43. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  44. package/Divider/dividerClasses.d.ts +34 -34
  45. package/Drawer/drawerClasses.d.ts +30 -30
  46. package/Fab/Fab.d.ts +4 -1
  47. package/Fab/Fab.js +8 -20
  48. package/Fab/fabClasses.d.ts +26 -26
  49. package/Fab/fabClasses.js +1 -1
  50. package/FilledInput/filledInputClasses.d.ts +40 -40
  51. package/FormControl/formControlClasses.d.ts +14 -14
  52. package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
  53. package/FormGroup/formGroupClasses.d.ts +12 -12
  54. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  55. package/FormLabel/formLabelClasses.d.ts +22 -22
  56. package/Grid/gridClasses.d.ts +48 -48
  57. package/Icon/iconClasses.d.ts +24 -24
  58. package/IconButton/iconButtonClasses.d.ts +26 -26
  59. package/ImageList/ImageList.js +3 -1
  60. package/ImageList/imageListClasses.d.ts +16 -16
  61. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  62. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  63. package/Input/inputClasses.d.ts +34 -34
  64. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  65. package/InputBase/inputBaseClasses.d.ts +44 -44
  66. package/InputLabel/inputLabelClasses.d.ts +32 -32
  67. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  68. package/Link/linkClasses.d.ts +18 -18
  69. package/List/listClasses.d.ts +14 -14
  70. package/ListItem/listItemClasses.d.ts +30 -30
  71. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  72. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  73. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  74. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  75. package/ListItemText/listItemTextClasses.d.ts +18 -18
  76. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  77. package/Menu/menuClasses.d.ts +12 -12
  78. package/MenuItem/menuItemClasses.d.ts +20 -20
  79. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  80. package/Modal/Modal.js +1 -1
  81. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  82. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  83. package/Pagination/paginationClasses.d.ts +14 -14
  84. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  85. package/Paper/paperClasses.d.ts +39 -39
  86. package/Popover/popoverClasses.d.ts +10 -10
  87. package/Popper/Popper.d.ts +17 -17
  88. package/README.md +6 -6
  89. package/Radio/radioClasses.d.ts +16 -16
  90. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  91. package/RadioGroup/useRadioGroup.d.ts +4 -4
  92. package/Rating/Rating.js +1 -1
  93. package/Rating/ratingClasses.d.ts +40 -40
  94. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  95. package/Select/SelectInput.js +5 -1
  96. package/Select/selectClasses.d.ts +30 -30
  97. package/Skeleton/skeletonClasses.d.ts +24 -24
  98. package/Slider/Slider.js +3 -1
  99. package/Snackbar/Snackbar.js +4 -1
  100. package/Snackbar/snackbarClasses.d.ts +20 -20
  101. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  102. package/SpeedDial/speedDialClasses.d.ts +22 -22
  103. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  104. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  105. package/Step/stepClasses.d.ts +16 -16
  106. package/StepButton/stepButtonClasses.d.ts +14 -14
  107. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  108. package/StepContent/stepContentClasses.d.ts +12 -12
  109. package/StepIcon/stepIconClasses.d.ts +16 -16
  110. package/StepLabel/stepLabelClasses.d.ts +28 -28
  111. package/Stepper/stepperClasses.d.ts +14 -14
  112. package/SvgIcon/svgIconClasses.d.ts +24 -24
  113. package/Switch/switchClasses.d.ts +32 -32
  114. package/Tab/tabClasses.d.ts +26 -26
  115. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  116. package/Table/tableClasses.d.ts +10 -10
  117. package/TableBody/tableBodyClasses.d.ts +8 -8
  118. package/TableCell/tableCellClasses.d.ts +32 -32
  119. package/TableContainer/tableContainerClasses.d.ts +8 -8
  120. package/TableFooter/tableFooterClasses.d.ts +8 -8
  121. package/TableHead/tableHeadClasses.d.ts +8 -8
  122. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  123. package/TableRow/tableRowClasses.d.ts +16 -16
  124. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  125. package/Tabs/tabsClasses.d.ts +32 -32
  126. package/TextField/textFieldClasses.d.ts +8 -8
  127. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  128. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  129. package/Toolbar/toolbarClasses.d.ts +14 -14
  130. package/Tooltip/tooltipClasses.d.ts +30 -30
  131. package/Typography/typographyClasses.d.ts +50 -50
  132. package/darkScrollbar/index.d.ts +28 -28
  133. package/index.d.ts +1 -1
  134. package/index.js +1 -1
  135. package/internal/switchBaseClasses.d.ts +12 -12
  136. package/legacy/AvatarGroup/AvatarGroup.js +20 -7
  137. package/legacy/Badge/Badge.js +4 -2
  138. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  139. package/legacy/ButtonBase/ButtonBase.js +15 -2
  140. package/legacy/Fab/Fab.js +8 -20
  141. package/legacy/Fab/fabClasses.js +1 -1
  142. package/legacy/ImageList/ImageList.js +3 -1
  143. package/legacy/Modal/Modal.js +1 -1
  144. package/legacy/Rating/Rating.js +1 -1
  145. package/legacy/Select/SelectInput.js +5 -1
  146. package/legacy/Slider/Slider.js +3 -1
  147. package/legacy/Snackbar/Snackbar.js +4 -1
  148. package/legacy/index.js +1 -1
  149. package/legacy/styles/makeStyles.js +1 -1
  150. package/legacy/styles/withStyles.js +1 -1
  151. package/legacy/styles/withTheme.js +1 -1
  152. package/legacy/useMediaQuery/useMediaQuery.js +1 -1
  153. package/locale/index.d.ts +68 -68
  154. package/modern/AvatarGroup/AvatarGroup.js +17 -7
  155. package/modern/Badge/Badge.js +3 -2
  156. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  157. package/modern/ButtonBase/ButtonBase.js +15 -2
  158. package/modern/Fab/Fab.js +8 -20
  159. package/modern/Fab/fabClasses.js +1 -1
  160. package/modern/ImageList/ImageList.js +3 -1
  161. package/modern/Modal/Modal.js +1 -1
  162. package/modern/Rating/Rating.js +1 -1
  163. package/modern/Select/SelectInput.js +5 -1
  164. package/modern/Slider/Slider.js +3 -1
  165. package/modern/Snackbar/Snackbar.js +4 -1
  166. package/modern/index.js +1 -1
  167. package/modern/styles/makeStyles.js +1 -1
  168. package/modern/styles/withStyles.js +1 -1
  169. package/modern/styles/withTheme.js +1 -1
  170. package/modern/useMediaQuery/useMediaQuery.js +1 -1
  171. package/node/AvatarGroup/AvatarGroup.js +19 -7
  172. package/node/Badge/Badge.js +3 -2
  173. package/node/BottomNavigation/BottomNavigation.js +0 -0
  174. package/node/ButtonBase/ButtonBase.js +15 -2
  175. package/node/Fab/Fab.js +8 -20
  176. package/node/Fab/fabClasses.js +1 -1
  177. package/node/ImageList/ImageList.js +3 -1
  178. package/node/Modal/Modal.js +1 -1
  179. package/node/Rating/Rating.js +1 -1
  180. package/node/Select/SelectInput.js +5 -1
  181. package/node/Slider/Slider.js +3 -1
  182. package/node/Snackbar/Snackbar.js +4 -1
  183. package/node/index.js +1 -1
  184. package/node/styles/makeStyles.js +1 -1
  185. package/node/styles/withStyles.js +1 -1
  186. package/node/styles/withTheme.js +1 -1
  187. package/node/useMediaQuery/useMediaQuery.js +1 -1
  188. package/package.json +8 -8
  189. package/styles/makeStyles.js +1 -1
  190. package/styles/withStyles.js +1 -1
  191. package/styles/withTheme.js +1 -1
  192. package/transitions/index.d.ts +1 -1
  193. package/transitions/transition.d.ts +13 -13
  194. package/transitions/utils.d.ts +23 -23
  195. package/umd/material-ui.development.js +96 -50
  196. package/umd/material-ui.production.min.js +20 -20
  197. package/useMediaQuery/useMediaQuery.d.ts +31 -31
  198. package/useMediaQuery/useMediaQuery.js +1 -1
  199. package/useTouchRipple/index.d.ts +1 -1
  200. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  201. package/utils/getScrollbarSize.d.ts +2 -2
  202. package/utils/ownerDocument.d.ts +2 -2
  203. package/utils/ownerWindow.d.ts +2 -2
  204. package/utils/setRef.d.ts +2 -2
package/modern/Fab/Fab.js CHANGED
@@ -20,7 +20,7 @@ const useUtilityClasses = ownerState => {
20
20
  size
21
21
  } = ownerState;
22
22
  const slots = {
23
- root: ['root', variant, `size${capitalize(size)}`, color === 'inherit' && 'colorInherit', color === 'primary' && 'primary', color === 'secondary' && 'secondary']
23
+ root: ['root', variant, `size${capitalize(size)}`, color === 'inherit' ? 'colorInherit' : color]
24
24
  };
25
25
  return composeClasses(slots, getFabUtilityClass, classes);
26
26
  };
@@ -32,7 +32,7 @@ const FabRoot = styled(ButtonBase, {
32
32
  const {
33
33
  ownerState
34
34
  } = props;
35
- return [styles.root, styles[ownerState.variant], styles[`size${capitalize(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, ownerState.color === 'primary' && styles.primary, ownerState.color === 'secondary' && styles.secondary];
35
+ return [styles.root, styles[ownerState.variant], styles[`size${capitalize(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, styles[capitalize(ownerState.size)], styles[ownerState.color]];
36
36
  }
37
37
  })(({
38
38
  theme,
@@ -99,24 +99,14 @@ const FabRoot = styled(ButtonBase, {
99
99
  }), ({
100
100
  theme,
101
101
  ownerState
102
- }) => _extends({}, ownerState.color === 'primary' && {
103
- color: theme.palette.primary.contrastText,
104
- backgroundColor: theme.palette.primary.main,
102
+ }) => _extends({}, ownerState.color !== 'inherit' && ownerState.color !== 'default' && theme.palette[ownerState.color] != null && {
103
+ color: theme.palette[ownerState.color].contrastText,
104
+ backgroundColor: theme.palette[ownerState.color].main,
105
105
  '&:hover': {
106
- backgroundColor: theme.palette.primary.dark,
106
+ backgroundColor: theme.palette[ownerState.color].dark,
107
107
  // Reset on touch devices, it doesn't add specificity
108
108
  '@media (hover: none)': {
109
- backgroundColor: theme.palette.primary.main
110
- }
111
- }
112
- }, ownerState.color === 'secondary' && {
113
- color: theme.palette.secondary.contrastText,
114
- backgroundColor: theme.palette.secondary.main,
115
- '&:hover': {
116
- backgroundColor: theme.palette.secondary.dark,
117
- // Reset on touch devices, it doesn't add specificity
118
- '@media (hover: none)': {
119
- backgroundColor: theme.palette.secondary.main
109
+ backgroundColor: theme.palette[ownerState.color].main
120
110
  }
121
111
  }
122
112
  }));
@@ -188,9 +178,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
188
178
  * The color of the component. It supports those theme colors that make sense for this component.
189
179
  * @default 'default'
190
180
  */
191
- color: PropTypes
192
- /* @typescript-to-proptypes-ignore */
193
- .oneOfType([PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']), PropTypes.string]),
181
+ color: PropTypes.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
194
182
 
195
183
  /**
196
184
  * The component used for the root node.
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
2
2
  export function getFabUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiFab', slot);
4
4
  }
5
- const fabClasses = generateUtilityClasses('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
5
+ const fabClasses = generateUtilityClasses('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'info', 'error', 'warning', 'success']);
6
6
  export default fabClasses;
@@ -169,6 +169,8 @@ process.env.NODE_ENV !== "production" ? ImageList.propTypes
169
169
  * The variant to use.
170
170
  * @default 'standard'
171
171
  */
172
- variant: PropTypes.oneOf(['masonry', 'quilted', 'standard', 'woven'])
172
+ variant: PropTypes
173
+ /* @typescript-to-proptypes-ignore */
174
+ .oneOfType([PropTypes.oneOf(['masonry', 'quilted', 'standard', 'woven']), PropTypes.string])
173
175
  } : void 0;
174
176
  export default ImageList;
@@ -226,7 +226,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
226
226
 
227
227
  /**
228
228
  * If `true`, the modal will not restore focus to previously focused element once
229
- * modal is hidden.
229
+ * modal is hidden or unmounted.
230
230
  * @default false
231
231
  */
232
232
  disableRestoreFocus: PropTypes.bool,
@@ -405,7 +405,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
405
405
 
406
406
  const handleChange = event => {
407
407
  let newValue = event.target.value === '' ? null : parseFloat(event.target.value); // Give mouse priority over keyboard
408
- // Fix https://github.com/mui-org/material-ui/issues/22827
408
+ // Fix https://github.com/mui/material-ui/issues/22827
409
409
 
410
410
  if (hover !== -1) {
411
411
  newValue = hover;
@@ -189,6 +189,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
189
189
  }
190
190
  }, [autoFocus]);
191
191
  React.useEffect(() => {
192
+ if (!labelId) {
193
+ return undefined;
194
+ }
195
+
192
196
  const label = ownerDocument(displayRef.current).getElementById(labelId);
193
197
 
194
198
  if (label) {
@@ -285,7 +289,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
285
289
  if (onChange) {
286
290
  // Redefine target to allow name and value to be read.
287
291
  // This allows seamless integration with the most popular form libraries.
288
- // https://github.com/mui-org/material-ui/issues/13485#issuecomment-676048492
292
+ // https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
289
293
  // Clone the event to not override `target` of the original event.
290
294
  const nativeEvent = event.nativeEvent || event;
291
295
  const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
@@ -689,7 +689,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
689
689
  * The size of the slider.
690
690
  * @default 'medium'
691
691
  */
692
- size: PropTypes.oneOf(['small', 'medium']),
692
+ size: PropTypes
693
+ /* @typescript-to-proptypes-ignore */
694
+ .oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
693
695
 
694
696
  /**
695
697
  * The granularity with which the slider can step through values. (A "discrete" slider.)
@@ -290,7 +290,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
290
290
  onMouseEnter: handleMouseEnter,
291
291
  onMouseLeave: handleMouseLeave,
292
292
  ownerState: ownerState,
293
- ref: ref
293
+ ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
294
+ // See https://github.com/mui-org/material-ui/issues/29080
295
+ ,
296
+ role: "presentation"
294
297
  }, other, {
295
298
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
296
299
  appear: true,
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.4.0
1
+ /** @license MUI v5.4.1
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
2
  export default function makeStyles() {
3
3
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is not longer exported from @mui/material/styles.
4
4
  You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(14));
5
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
6
6
  }
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
2
  export default function withStyles() {
3
3
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is not longer exported from @mui/material/styles.
4
4
  You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(15));
5
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
6
6
  }
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
2
  export default function withTheme() {
3
3
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is not longer exported from @mui/material/styles.
4
4
  You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(16));
5
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
6
6
  }
@@ -32,7 +32,7 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
32
32
  const updateMatch = () => {
33
33
  // Workaround Safari wrong implementation of matchMedia
34
34
  // TODO can we remove it?
35
- // https://github.com/mui-org/material-ui/pull/17315#issuecomment-528286677
35
+ // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677
36
36
  if (active) {
37
37
  setMatch(queryList.matches);
38
38
  }
@@ -33,7 +33,7 @@ var _avatarGroupClasses = _interopRequireWildcard(require("./avatarGroupClasses"
33
33
 
34
34
  var _jsxRuntime = require("react/jsx-runtime");
35
35
 
36
- const _excluded = ["children", "className", "max", "spacing", "total", "variant"];
36
+ const _excluded = ["children", "className", "componentsProps", "max", "spacing", "total", "variant"];
37
37
 
38
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
39
 
@@ -90,6 +90,8 @@ const AvatarGroupAvatar = (0, _styled.default)(_Avatar.default, {
90
90
  }
91
91
  }));
92
92
  const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
93
+ var _componentsProps$addi, _componentsProps$addi2;
94
+
93
95
  const props = (0, _useThemeProps.default)({
94
96
  props: inProps,
95
97
  name: 'MuiAvatarGroup'
@@ -97,6 +99,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
97
99
  const {
98
100
  children: childrenProp,
99
101
  className,
102
+ componentsProps = {},
100
103
  max = 5,
101
104
  spacing = 'medium',
102
105
  total,
@@ -134,15 +137,16 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
134
137
  className: (0, _clsx.default)(classes.root, className),
135
138
  ref: ref
136
139
  }, other, {
137
- children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(AvatarGroupAvatar, {
140
+ children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(AvatarGroupAvatar, (0, _extends2.default)({
138
141
  ownerState: ownerState,
139
- className: classes.avatar,
140
- style: {
142
+ variant: variant
143
+ }, componentsProps.additionalAvatar, {
144
+ className: (0, _clsx.default)(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
145
+ style: (0, _extends2.default)({
141
146
  marginLeft
142
- },
143
- variant: variant,
147
+ }, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
144
148
  children: ["+", extraAvatars]
145
- }) : null, children.slice(0, maxAvatars).reverse().map(child => {
149
+ })) : null, children.slice(0, maxAvatars).reverse().map(child => {
146
150
  return /*#__PURE__*/React.cloneElement(child, {
147
151
  className: (0, _clsx.default)(child.props.className, classes.avatar),
148
152
  style: (0, _extends2.default)({
@@ -176,6 +180,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
176
180
  */
177
181
  className: _propTypes.default.string,
178
182
 
183
+ /**
184
+ * The props used for each slot inside the AvatarGroup.
185
+ * @default {}
186
+ */
187
+ componentsProps: _propTypes.default.shape({
188
+ additionalAvatar: _propTypes.default.object
189
+ }),
190
+
179
191
  /**
180
192
  * Max avatars to show before +x.
181
193
  * @default 5
@@ -198,7 +198,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
198
198
  componentsProps = {},
199
199
  overlap: overlapProp = 'rectangular',
200
200
  color: colorProp = 'default',
201
- invisible: invisibleProp,
201
+ invisible: invisibleProp = false,
202
202
  badgeContent: badgeContentProp,
203
203
  showZero = false,
204
204
  variant: variantProp = 'standard'
@@ -211,7 +211,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
211
211
  });
212
212
  let invisible = invisibleProp;
213
213
 
214
- if (invisibleProp == null && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
214
+ if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
215
215
  invisible = true;
216
216
  }
217
217
 
@@ -327,6 +327,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
327
327
 
328
328
  /**
329
329
  * If `true`, the badge is invisible.
330
+ * @default false
330
331
  */
331
332
  invisible: _propTypes.default.bool,
332
333
 
File without changes
@@ -37,7 +37,7 @@ var _buttonBaseClasses = _interopRequireWildcard(require("./buttonBaseClasses"))
37
37
 
38
38
  var _jsxRuntime = require("react/jsx-runtime");
39
39
 
40
- const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "type"];
40
+ const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
41
41
 
42
42
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
43
 
@@ -145,11 +145,13 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
145
145
  onTouchStart,
146
146
  tabIndex = 0,
147
147
  TouchRippleProps,
148
+ touchRippleRef,
148
149
  type
149
150
  } = props,
150
151
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
151
152
  const buttonRef = React.useRef(null);
152
153
  const rippleRef = React.useRef(null);
154
+ const handleRippleRef = (0, _useForkRef.default)(rippleRef, touchRippleRef);
153
155
  const {
154
156
  isFocusVisibleRef,
155
157
  onFocus: handleFocusVisible,
@@ -368,7 +370,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
368
370
 
369
371
  /* TouchRipple is only needed client-side, x2 boost on the server. */
370
372
  (0, _jsxRuntime.jsx)(_TouchRipple.default, (0, _extends2.default)({
371
- ref: rippleRef,
373
+ ref: handleRippleRef,
372
374
  center: centerRipple
373
375
  }, TouchRippleProps)) : null]
374
376
  }));
@@ -551,6 +553,17 @@ process.env.NODE_ENV !== "production" ? ButtonBase.propTypes
551
553
  */
552
554
  TouchRippleProps: _propTypes.default.object,
553
555
 
556
+ /**
557
+ * A ref that points to the `TouchRippple` element.
558
+ */
559
+ touchRippleRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
560
+ current: _propTypes.default.shape({
561
+ pulsate: _propTypes.default.func.isRequired,
562
+ start: _propTypes.default.func.isRequired,
563
+ stop: _propTypes.default.func.isRequired
564
+ })
565
+ })]),
566
+
554
567
  /**
555
568
  * @ignore
556
569
  */
package/node/Fab/Fab.js CHANGED
@@ -45,7 +45,7 @@ const useUtilityClasses = ownerState => {
45
45
  size
46
46
  } = ownerState;
47
47
  const slots = {
48
- root: ['root', variant, `size${(0, _capitalize.default)(size)}`, color === 'inherit' && 'colorInherit', color === 'primary' && 'primary', color === 'secondary' && 'secondary']
48
+ root: ['root', variant, `size${(0, _capitalize.default)(size)}`, color === 'inherit' ? 'colorInherit' : color]
49
49
  };
50
50
  return (0, _base.unstable_composeClasses)(slots, _fabClasses.getFabUtilityClass, classes);
51
51
  };
@@ -57,7 +57,7 @@ const FabRoot = (0, _styled.default)(_ButtonBase.default, {
57
57
  const {
58
58
  ownerState
59
59
  } = props;
60
- return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, ownerState.color === 'primary' && styles.primary, ownerState.color === 'secondary' && styles.secondary];
60
+ return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, styles[(0, _capitalize.default)(ownerState.size)], styles[ownerState.color]];
61
61
  }
62
62
  })(({
63
63
  theme,
@@ -124,24 +124,14 @@ const FabRoot = (0, _styled.default)(_ButtonBase.default, {
124
124
  }), ({
125
125
  theme,
126
126
  ownerState
127
- }) => (0, _extends2.default)({}, ownerState.color === 'primary' && {
128
- color: theme.palette.primary.contrastText,
129
- backgroundColor: theme.palette.primary.main,
127
+ }) => (0, _extends2.default)({}, ownerState.color !== 'inherit' && ownerState.color !== 'default' && theme.palette[ownerState.color] != null && {
128
+ color: theme.palette[ownerState.color].contrastText,
129
+ backgroundColor: theme.palette[ownerState.color].main,
130
130
  '&:hover': {
131
- backgroundColor: theme.palette.primary.dark,
131
+ backgroundColor: theme.palette[ownerState.color].dark,
132
132
  // Reset on touch devices, it doesn't add specificity
133
133
  '@media (hover: none)': {
134
- backgroundColor: theme.palette.primary.main
135
- }
136
- }
137
- }, ownerState.color === 'secondary' && {
138
- color: theme.palette.secondary.contrastText,
139
- backgroundColor: theme.palette.secondary.main,
140
- '&:hover': {
141
- backgroundColor: theme.palette.secondary.dark,
142
- // Reset on touch devices, it doesn't add specificity
143
- '@media (hover: none)': {
144
- backgroundColor: theme.palette.secondary.main
134
+ backgroundColor: theme.palette[ownerState.color].main
145
135
  }
146
136
  }
147
137
  }));
@@ -210,9 +200,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
210
200
  * The color of the component. It supports those theme colors that make sense for this component.
211
201
  * @default 'default'
212
202
  */
213
- color: _propTypes.default
214
- /* @typescript-to-proptypes-ignore */
215
- .oneOfType([_propTypes.default.oneOf(['default', 'inherit', 'primary', 'secondary']), _propTypes.default.string]),
203
+ color: _propTypes.default.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
216
204
 
217
205
  /**
218
206
  * The component used for the root node.
@@ -12,6 +12,6 @@ function getFabUtilityClass(slot) {
12
12
  return (0, _base.generateUtilityClass)('MuiFab', slot);
13
13
  }
14
14
 
15
- const fabClasses = (0, _base.generateUtilityClasses)('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
15
+ const fabClasses = (0, _base.generateUtilityClasses)('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'info', 'error', 'warning', 'success']);
16
16
  var _default = fabClasses;
17
17
  exports.default = _default;
@@ -190,7 +190,9 @@ process.env.NODE_ENV !== "production" ? ImageList.propTypes
190
190
  * The variant to use.
191
191
  * @default 'standard'
192
192
  */
193
- variant: _propTypes.default.oneOf(['masonry', 'quilted', 'standard', 'woven'])
193
+ variant: _propTypes.default
194
+ /* @typescript-to-proptypes-ignore */
195
+ .oneOfType([_propTypes.default.oneOf(['masonry', 'quilted', 'standard', 'woven']), _propTypes.default.string])
194
196
  } : void 0;
195
197
  var _default = ImageList;
196
198
  exports.default = _default;
@@ -250,7 +250,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
250
250
 
251
251
  /**
252
252
  * If `true`, the modal will not restore focus to previously focused element once
253
- * modal is hidden.
253
+ * modal is hidden or unmounted.
254
254
  * @default false
255
255
  */
256
256
  disableRestoreFocus: _propTypes.default.bool,
@@ -426,7 +426,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
426
426
 
427
427
  const handleChange = event => {
428
428
  let newValue = event.target.value === '' ? null : parseFloat(event.target.value); // Give mouse priority over keyboard
429
- // Fix https://github.com/mui-org/material-ui/issues/22827
429
+ // Fix https://github.com/mui/material-ui/issues/22827
430
430
 
431
431
  if (hover !== -1) {
432
432
  newValue = hover;
@@ -217,6 +217,10 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
217
217
  }
218
218
  }, [autoFocus]);
219
219
  React.useEffect(() => {
220
+ if (!labelId) {
221
+ return undefined;
222
+ }
223
+
220
224
  const label = (0, _ownerDocument.default)(displayRef.current).getElementById(labelId);
221
225
 
222
226
  if (label) {
@@ -313,7 +317,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
313
317
  if (onChange) {
314
318
  // Redefine target to allow name and value to be read.
315
319
  // This allows seamless integration with the most popular form libraries.
316
- // https://github.com/mui-org/material-ui/issues/13485#issuecomment-676048492
320
+ // https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
317
321
  // Clone the event to not override `target` of the original event.
318
322
  const nativeEvent = event.nativeEvent || event;
319
323
  const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
@@ -718,7 +718,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
718
718
  * The size of the slider.
719
719
  * @default 'medium'
720
720
  */
721
- size: _propTypes.default.oneOf(['small', 'medium']),
721
+ size: _propTypes.default
722
+ /* @typescript-to-proptypes-ignore */
723
+ .oneOfType([_propTypes.default.oneOf(['small', 'medium']), _propTypes.default.string]),
722
724
 
723
725
  /**
724
726
  * The granularity with which the slider can step through values. (A "discrete" slider.)
@@ -315,7 +315,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
315
315
  onMouseEnter: handleMouseEnter,
316
316
  onMouseLeave: handleMouseLeave,
317
317
  ownerState: ownerState,
318
- ref: ref
318
+ ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
319
+ // See https://github.com/mui-org/material-ui/issues/29080
320
+ ,
321
+ role: "presentation"
319
322
  }, other, {
320
323
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionComponent, (0, _extends2.default)({
321
324
  appear: true,
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.4.0
1
+ /** @license MUI v5.4.1
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -10,5 +10,5 @@ var _utils = require("@mui/utils");
10
10
  function makeStyles() {
11
11
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is not longer exported from @mui/material/styles.
12
12
  You have to import it from @mui/styles.
13
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : (0, _utils.formatMuiErrorMessage)(14));
13
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _utils.formatMuiErrorMessage)(14));
14
14
  }
@@ -10,5 +10,5 @@ var _utils = require("@mui/utils");
10
10
  function withStyles() {
11
11
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is not longer exported from @mui/material/styles.
12
12
  You have to import it from @mui/styles.
13
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : (0, _utils.formatMuiErrorMessage)(15));
13
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _utils.formatMuiErrorMessage)(15));
14
14
  }
@@ -10,5 +10,5 @@ var _utils = require("@mui/utils");
10
10
  function withTheme() {
11
11
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is not longer exported from @mui/material/styles.
12
12
  You have to import it from @mui/styles.
13
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : (0, _utils.formatMuiErrorMessage)(16));
13
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _utils.formatMuiErrorMessage)(16));
14
14
  }
@@ -44,7 +44,7 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
44
44
  const updateMatch = () => {
45
45
  // Workaround Safari wrong implementation of matchMedia
46
46
  // TODO can we remove it?
47
- // https://github.com/mui-org/material-ui/pull/17315#issuecomment-528286677
47
+ // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677
48
48
  if (active) {
49
49
  setMatch(queryList.matches);
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.4.0",
3
+ "version": "5.4.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.",
@@ -14,12 +14,12 @@
14
14
  ],
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/mui-org/material-ui.git",
17
+ "url": "https://github.com/mui/material-ui.git",
18
18
  "directory": "packages/mui-material"
19
19
  },
20
20
  "license": "MIT",
21
21
  "bugs": {
22
- "url": "https://github.com/mui-org/material-ui/issues"
22
+ "url": "https://github.com/mui/material-ui/issues"
23
23
  },
24
24
  "homepage": "https://mui.com/",
25
25
  "funding": {
@@ -45,11 +45,11 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@babel/runtime": "^7.16.7",
49
- "@mui/base": "5.0.0-alpha.67",
50
- "@mui/system": "^5.4.0",
51
- "@mui/types": "^7.1.0",
52
- "@mui/utils": "^5.3.0",
48
+ "@babel/runtime": "^7.17.0",
49
+ "@mui/base": "5.0.0-alpha.68",
50
+ "@mui/system": "^5.4.1",
51
+ "@mui/types": "^7.1.1",
52
+ "@mui/utils": "^5.4.1",
53
53
  "@types/react-transition-group": "^4.4.4",
54
54
  "clsx": "^1.1.1",
55
55
  "csstype": "^3.0.10",
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
2
  export default function makeStyles() {
3
3
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is not longer exported from @mui/material/styles.
4
4
  You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(14));
5
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
6
6
  }
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
2
  export default function withStyles() {
3
3
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is not longer exported from @mui/material/styles.
4
4
  You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(15));
5
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
6
6
  }
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
2
  export default function withTheme() {
3
3
  throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is not longer exported from @mui/material/styles.
4
4
  You have to import it from @mui/styles.
5
- See https://mui.com/r/migration-v4/#material-ui-core-styles for more details.` : _formatMuiErrorMessage(16));
5
+ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
6
6
  }
@@ -1 +1 @@
1
- export * from './transition';
1
+ export * from './transition';
@@ -1,13 +1,13 @@
1
- import { TransitionProps as _TransitionProps, TransitionActions } from 'react-transition-group/Transition';
2
- import * as React from 'react';
3
- export declare type TransitionHandlerKeys = 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited';
4
- export declare type TransitionHandlerProps = Pick<_TransitionProps, TransitionHandlerKeys>;
5
- export interface EasingProps {
6
- easing: string | {
7
- enter?: string;
8
- exit?: string;
9
- };
10
- }
11
- export declare type TransitionKeys = 'in' | 'mountOnEnter' | 'unmountOnExit' | 'timeout' | 'easing' | 'addEndListener' | TransitionHandlerKeys;
12
- export interface TransitionProps extends TransitionActions, Partial<Pick<_TransitionProps & EasingProps, TransitionKeys>>, React.HTMLAttributes<HTMLElement> {
13
- }
1
+ import { TransitionProps as _TransitionProps, TransitionActions } from 'react-transition-group/Transition';
2
+ import * as React from 'react';
3
+ export declare type TransitionHandlerKeys = 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited';
4
+ export declare type TransitionHandlerProps = Pick<_TransitionProps, TransitionHandlerKeys>;
5
+ export interface EasingProps {
6
+ easing: string | {
7
+ enter?: string;
8
+ exit?: string;
9
+ };
10
+ }
11
+ export declare type TransitionKeys = 'in' | 'mountOnEnter' | 'unmountOnExit' | 'timeout' | 'easing' | 'addEndListener' | TransitionHandlerKeys;
12
+ export interface TransitionProps extends TransitionActions, Partial<Pick<_TransitionProps & EasingProps, TransitionKeys>>, React.HTMLAttributes<HTMLElement> {
13
+ }