@mui/material 5.8.0 → 5.8.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 (197) 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/Alert.js +1 -0
  6. package/Alert/alertClasses.d.ts +44 -44
  7. package/AlertTitle/alertTitleClasses.d.ts +8 -8
  8. package/AppBar/appBarClasses.d.ts +28 -28
  9. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  10. package/Avatar/avatarClasses.d.ts +20 -20
  11. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  12. package/Backdrop/backdropClasses.d.ts +10 -10
  13. package/Badge/badgeClasses.d.ts +56 -56
  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/TouchRipple.js +5 -5
  20. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  21. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  22. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  23. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  24. package/CHANGELOG.md +68 -0
  25. package/Card/cardClasses.d.ts +8 -8
  26. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  27. package/CardActions/cardActionsClasses.d.ts +10 -10
  28. package/CardContent/cardContentClasses.d.ts +8 -8
  29. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  30. package/CardMedia/cardMediaClasses.d.ts +12 -12
  31. package/Checkbox/checkboxClasses.d.ts +18 -18
  32. package/Chip/chipClasses.d.ts +80 -80
  33. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  34. package/ClickAwayListener/index.d.ts +2 -2
  35. package/Collapse/collapseClasses.d.ts +18 -18
  36. package/Container/containerClasses.d.ts +6 -6
  37. package/Dialog/DialogContext.d.ts +6 -6
  38. package/Dialog/dialogClasses.d.ts +36 -36
  39. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  40. package/DialogContent/dialogContentClasses.d.ts +10 -10
  41. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  42. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  43. package/Divider/dividerClasses.d.ts +34 -34
  44. package/Drawer/drawerClasses.d.ts +30 -30
  45. package/Fab/Fab.js +3 -1
  46. package/Fab/fabClasses.d.ts +26 -26
  47. package/FilledInput/filledInputClasses.d.ts +40 -40
  48. package/FormControl/formControlClasses.d.ts +14 -14
  49. package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
  50. package/FormGroup/formGroupClasses.d.ts +12 -12
  51. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  52. package/FormLabel/formLabelClasses.d.ts +22 -22
  53. package/Grid/gridClasses.d.ts +48 -48
  54. package/Icon/iconClasses.d.ts +24 -24
  55. package/IconButton/iconButtonClasses.d.ts +26 -26
  56. package/ImageList/imageListClasses.d.ts +16 -16
  57. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  58. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  59. package/Input/inputClasses.d.ts +34 -34
  60. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  61. package/InputBase/inputBaseClasses.d.ts +44 -44
  62. package/InputLabel/inputLabelClasses.d.ts +32 -32
  63. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  64. package/Link/linkClasses.d.ts +18 -18
  65. package/List/listClasses.d.ts +14 -14
  66. package/ListItem/listItemClasses.d.ts +30 -30
  67. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  68. package/ListItemButton/ListItemButton.js +7 -1
  69. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  70. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  71. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  72. package/ListItemText/listItemTextClasses.d.ts +18 -18
  73. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  74. package/Menu/menuClasses.d.ts +12 -12
  75. package/MenuItem/menuItemClasses.d.ts +20 -20
  76. package/MenuList/MenuList.d.ts +1 -1
  77. package/MenuList/MenuList.js +1 -1
  78. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  79. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  80. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  81. package/Pagination/paginationClasses.d.ts +14 -14
  82. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  83. package/Paper/Paper.js +20 -15
  84. package/Paper/index.d.ts +1 -1
  85. package/Paper/paperClasses.d.ts +39 -39
  86. package/Popover/popoverClasses.d.ts +10 -10
  87. package/Popper/Popper.d.ts +29 -29
  88. package/Radio/Radio.js +4 -4
  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/ratingClasses.d.ts +40 -40
  93. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  94. package/Select/SelectInput.js +2 -2
  95. package/Select/selectClasses.d.ts +30 -30
  96. package/Skeleton/skeletonClasses.d.ts +24 -24
  97. package/Slider/Slider.js +1 -5
  98. package/Snackbar/snackbarClasses.d.ts +20 -20
  99. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  100. package/SpeedDial/speedDialClasses.d.ts +22 -22
  101. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  102. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  103. package/Step/StepContext.d.ts +20 -20
  104. package/Step/stepClasses.d.ts +16 -16
  105. package/StepButton/stepButtonClasses.d.ts +14 -14
  106. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  107. package/StepContent/stepContentClasses.d.ts +12 -12
  108. package/StepIcon/stepIconClasses.d.ts +16 -16
  109. package/StepLabel/stepLabelClasses.d.ts +28 -28
  110. package/Stepper/StepperContext.d.ts +18 -18
  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/Tabs.js +2 -2
  126. package/Tabs/tabsClasses.d.ts +32 -32
  127. package/TextField/textFieldClasses.d.ts +8 -8
  128. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  129. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  130. package/Toolbar/toolbarClasses.d.ts +14 -14
  131. package/Tooltip/tooltipClasses.d.ts +30 -30
  132. package/Typography/typographyClasses.d.ts +50 -50
  133. package/className/index.d.ts +1 -1
  134. package/darkScrollbar/index.d.ts +28 -28
  135. package/index.js +1 -1
  136. package/internal/switchBaseClasses.d.ts +12 -12
  137. package/legacy/Alert/Alert.js +1 -0
  138. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  139. package/legacy/ButtonBase/TouchRipple.js +5 -5
  140. package/legacy/Fab/Fab.js +3 -1
  141. package/legacy/ListItemButton/ListItemButton.js +7 -1
  142. package/legacy/MenuList/MenuList.js +1 -1
  143. package/legacy/Paper/Paper.js +10 -7
  144. package/legacy/Radio/Radio.js +4 -4
  145. package/legacy/Select/SelectInput.js +2 -2
  146. package/legacy/Slider/Slider.js +1 -10
  147. package/legacy/Tabs/Tabs.js +2 -2
  148. package/legacy/index.js +1 -1
  149. package/legacy/styles/createMixins.js +4 -2
  150. package/legacy/styles/experimental_extendTheme.js +22 -3
  151. package/locale/index.d.ts +71 -71
  152. package/modern/Alert/Alert.js +1 -0
  153. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  154. package/modern/ButtonBase/TouchRipple.js +5 -5
  155. package/modern/Fab/Fab.js +3 -1
  156. package/modern/ListItemButton/ListItemButton.js +7 -1
  157. package/modern/MenuList/MenuList.js +1 -1
  158. package/modern/Paper/Paper.js +8 -7
  159. package/modern/Radio/Radio.js +4 -4
  160. package/modern/Select/SelectInput.js +2 -2
  161. package/modern/Slider/Slider.js +1 -5
  162. package/modern/Tabs/Tabs.js +2 -2
  163. package/modern/index.js +1 -1
  164. package/modern/styles/createMixins.js +4 -2
  165. package/modern/styles/experimental_extendTheme.js +18 -2
  166. package/node/Alert/Alert.js +1 -0
  167. package/node/BottomNavigation/BottomNavigation.js +0 -0
  168. package/node/ButtonBase/TouchRipple.js +5 -5
  169. package/node/Fab/Fab.js +3 -1
  170. package/node/ListItemButton/ListItemButton.js +7 -1
  171. package/node/MenuList/MenuList.js +1 -1
  172. package/node/Paper/Paper.js +22 -14
  173. package/node/Radio/Radio.js +4 -4
  174. package/node/Select/SelectInput.js +2 -2
  175. package/node/Slider/Slider.js +1 -5
  176. package/node/Tabs/Tabs.js +2 -2
  177. package/node/index.js +1 -1
  178. package/node/styles/createMixins.js +4 -2
  179. package/node/styles/experimental_extendTheme.js +20 -3
  180. package/package.json +3 -3
  181. package/styles/createMixins.js +4 -2
  182. package/styles/createPalette.d.ts +1 -1
  183. package/styles/experimental_extendTheme.d.ts +30 -0
  184. package/styles/experimental_extendTheme.js +19 -3
  185. package/styles/index.d.ts +1 -0
  186. package/transitions/index.d.ts +1 -1
  187. package/transitions/transition.d.ts +13 -13
  188. package/transitions/utils.d.ts +23 -23
  189. package/umd/material-ui.development.js +244 -213
  190. package/umd/material-ui.production.min.js +20 -20
  191. package/useMediaQuery/useMediaQuery.d.ts +31 -31
  192. package/useTouchRipple/index.d.ts +1 -1
  193. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  194. package/utils/getScrollbarSize.d.ts +2 -2
  195. package/utils/ownerDocument.d.ts +2 -2
  196. package/utils/ownerWindow.d.ts +2 -2
  197. package/utils/setRef.d.ts +2 -2
File without changes
@@ -192,12 +192,12 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
192
192
 
193
193
  } = options;
194
194
 
195
- if (event.type === 'mousedown' && ignoringMouseDown.current) {
195
+ if (event?.type === 'mousedown' && ignoringMouseDown.current) {
196
196
  ignoringMouseDown.current = false;
197
197
  return;
198
198
  }
199
199
 
200
- if (event.type === 'touchstart') {
200
+ if (event?.type === 'touchstart') {
201
201
  ignoringMouseDown.current = true;
202
202
  }
203
203
 
@@ -213,7 +213,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
213
213
  let rippleY;
214
214
  let rippleSize;
215
215
 
216
- if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
216
+ if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
217
217
  rippleX = Math.round(rect.width / 2);
218
218
  rippleY = Math.round(rect.height / 2);
219
219
  } else {
@@ -238,7 +238,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
238
238
  } // Touche devices
239
239
 
240
240
 
241
- if (event.touches) {
241
+ if (event?.touches) {
242
242
  // check that this isn't another touchstart due to multitouch
243
243
  // otherwise we will only clear a single timer when unmounting while two
244
244
  // are running
@@ -281,7 +281,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
281
281
  clearTimeout(startTimer.current); // The touch interaction occurs too quickly.
282
282
  // We still want to show ripple effect.
283
283
 
284
- if (event.type === 'touchend' && startTimerCommit.current) {
284
+ if (event?.type === 'touchend' && startTimerCommit.current) {
285
285
  startTimerCommit.current();
286
286
  startTimerCommit.current = null;
287
287
  startTimer.current = setTimeout(() => {
package/modern/Fab/Fab.js CHANGED
@@ -181,7 +181,9 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
181
181
  * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
182
182
  * @default 'default'
183
183
  */
184
- color: PropTypes.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
184
+ color: PropTypes
185
+ /* @typescript-to-proptypes-ignore */
186
+ .oneOfType([PropTypes.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']), PropTypes.string]),
185
187
 
186
188
  /**
187
189
  * The component used for the root node.
@@ -150,7 +150,8 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
150
150
  value: childContext,
151
151
  children: /*#__PURE__*/_jsx(ListItemButtonRoot, _extends({
152
152
  ref: handleRef,
153
- component: component,
153
+ href: other.href || other.to,
154
+ component: (other.href || other.to) && component === 'div' ? 'a' : component,
154
155
  focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
155
156
  ownerState: ownerState
156
157
  }, other, {
@@ -232,6 +233,11 @@ process.env.NODE_ENV !== "production" ? ListItemButton.propTypes
232
233
  */
233
234
  focusVisibleClassName: PropTypes.string,
234
235
 
236
+ /**
237
+ * @ignore
238
+ */
239
+ href: PropTypes.string,
240
+
235
241
  /**
236
242
  * Use to apply selected styling.
237
243
  * @default false
@@ -89,7 +89,7 @@ function moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable,
89
89
  return false;
90
90
  }
91
91
  /**
92
- * A permanently displayed menu following https://www.w3.org/TR/wai-aria-practices/#menubutton.
92
+ * A permanently displayed menu following https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/.
93
93
  * It's exposed to help customization of the [`Menu`](/material-ui/api/menu/) component if you
94
94
  * use it separately you need to move focus into the component manually. Once
95
95
  * the focus is placed inside the component it is fully keyboard accessible.
@@ -13,8 +13,7 @@ import useTheme from '../styles/useTheme';
13
13
  import { getPaperUtilityClass } from './paperClasses'; // Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61
14
14
 
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
-
17
- const getOverlayAlpha = elevation => {
16
+ export const getOverlayAlpha = elevation => {
18
17
  let alphaValue;
19
18
 
20
19
  if (elevation < 1) {
@@ -52,17 +51,19 @@ const PaperRoot = styled('div', {
52
51
  theme,
53
52
  ownerState
54
53
  }) => _extends({
55
- backgroundColor: theme.palette.background.paper,
56
- color: theme.palette.text.primary,
54
+ backgroundColor: (theme.vars || theme).palette.background.paper,
55
+ color: (theme.vars || theme).palette.text.primary,
57
56
  transition: theme.transitions.create('box-shadow')
58
57
  }, !ownerState.square && {
59
58
  borderRadius: theme.shape.borderRadius
60
59
  }, ownerState.variant === 'outlined' && {
61
- border: `1px solid ${theme.palette.divider}`
60
+ border: `1px solid ${(theme.vars || theme).palette.divider}`
62
61
  }, ownerState.variant === 'elevation' && _extends({
63
- boxShadow: theme.shadows[ownerState.elevation]
64
- }, theme.palette.mode === 'dark' && {
62
+ boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
63
+ }, !theme.vars && theme.palette.mode === 'dark' && {
65
64
  backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`
65
+ }, theme.vars && {
66
+ backgroundImage: theme.vars.overlays?.[ownerState.elevation]
66
67
  })));
67
68
  const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
68
69
  const props = useThemeProps({
@@ -41,9 +41,9 @@ const RadioRoot = styled(SwitchBase, {
41
41
  theme,
42
42
  ownerState
43
43
  }) => _extends({
44
- color: theme.palette.text.secondary,
44
+ color: (theme.vars || theme).palette.text.secondary,
45
45
  '&:hover': {
46
- backgroundColor: alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
46
+ backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
47
47
  // Reset on touch devices, it doesn't add specificity
48
48
  '@media (hover: none)': {
49
49
  backgroundColor: 'transparent'
@@ -51,11 +51,11 @@ const RadioRoot = styled(SwitchBase, {
51
51
  }
52
52
  }, ownerState.color !== 'default' && {
53
53
  [`&.${radioClasses.checked}`]: {
54
- color: theme.palette[ownerState.color].main
54
+ color: (theme.vars || theme).palette[ownerState.color].main
55
55
  }
56
56
  }, {
57
57
  [`&.${radioClasses.disabled}`]: {
58
- color: theme.palette.action.disabled
58
+ color: (theme.vars || theme).palette.action.disabled
59
59
  }
60
60
  }));
61
61
 
@@ -311,8 +311,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
311
311
 
312
312
  const handleKeyDown = event => {
313
313
  if (!readOnly) {
314
- const validKeys = [' ', 'ArrowUp', 'ArrowDown', // The native select doesn't respond to enter on MacOS, but it's recommended by
315
- // https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html
314
+ const validKeys = [' ', 'ArrowUp', 'ArrowDown', // The native select doesn't respond to enter on macOS, but it's recommended by
315
+ // https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
316
316
  'Enter'];
317
317
 
318
318
  if (validKeys.indexOf(event.key) !== -1) {
@@ -22,11 +22,7 @@ const SliderRoot = styled('span', {
22
22
  const {
23
23
  ownerState
24
24
  } = props;
25
- const marks = ownerState.marksProp === true && ownerState.step !== null ? [...Array(Math.floor((ownerState.max - ownerState.min) / ownerState.step) + 1)].map((_, index) => ({
26
- value: ownerState.min + ownerState.step * index
27
- })) : ownerState.marksProp || [];
28
- const marked = marks.length > 0 && marks.some(mark => mark.label);
29
- return [styles.root, styles[`color${capitalize(ownerState.color)}`], ownerState.size !== 'medium' && styles[`size${capitalize(ownerState.size)}`], marked && styles.marked, ownerState.orientation === 'vertical' && styles.vertical, ownerState.track === 'inverted' && styles.trackInverted, ownerState.track === false && styles.trackFalse];
25
+ return [styles.root, styles[`color${capitalize(ownerState.color)}`], ownerState.size !== 'medium' && styles[`size${capitalize(ownerState.size)}`], ownerState.marked && styles.marked, ownerState.orientation === 'vertical' && styles.vertical, ownerState.track === 'inverted' && styles.trackInverted, ownerState.track === false && styles.trackFalse];
30
26
  }
31
27
  })(({
32
28
  theme,
@@ -147,7 +147,7 @@ const TabsScroller = styled('div', {
147
147
  overflowX: 'hidden',
148
148
  width: '100%'
149
149
  }, ownerState.hideScrollbar && {
150
- // Hide dimensionless scrollbar on MacOS
150
+ // Hide dimensionless scrollbar on macOS
151
151
  scrollbarWidth: 'none',
152
152
  // Firefox
153
153
  '&::-webkit-scrollbar': {
@@ -207,7 +207,7 @@ const TabsScrollbarSize = styled(ScrollbarSize, {
207
207
  })({
208
208
  overflowX: 'auto',
209
209
  overflowY: 'hidden',
210
- // Hide dimensionless scrollbar on MacOS
210
+ // Hide dimensionless scrollbar on macOS
211
211
  scrollbarWidth: 'none',
212
212
  // Firefox
213
213
  '&::-webkit-scrollbar': {
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.0
1
+ /** @license MUI v5.8.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.
@@ -3,8 +3,10 @@ export default function createMixins(breakpoints, mixins) {
3
3
  return _extends({
4
4
  toolbar: {
5
5
  minHeight: 56,
6
- [`${breakpoints.up('xs')} and (orientation: landscape)`]: {
7
- minHeight: 48
6
+ [breakpoints.up('xs')]: {
7
+ '@media (orientation: landscape)': {
8
+ minHeight: 48
9
+ }
8
10
  },
9
11
  [breakpoints.up('sm')]: {
10
12
  minHeight: 64
@@ -5,6 +5,15 @@ const _excluded = ["colorSchemes"],
5
5
  import { deepmerge } from '@mui/utils';
6
6
  import { colorChannel } from '@mui/system';
7
7
  import createThemeWithoutVars from './createTheme';
8
+ import { getOverlayAlpha } from '../Paper/Paper';
9
+ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
10
+ if (index === 0) {
11
+ return undefined;
12
+ }
13
+
14
+ const overlay = getOverlayAlpha(index);
15
+ return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
16
+ });
8
17
  export default function extendTheme(options = {}, ...args) {
9
18
  const {
10
19
  colorSchemes: colorSchemesInput = {}
@@ -34,14 +43,16 @@ export default function extendTheme(options = {}, ...args) {
34
43
  opacity: _extends({
35
44
  placeholder: 0.42,
36
45
  inputTouchBottomLine: 0.42
37
- }, colorSchemesInput.light?.opacity)
46
+ }, colorSchemesInput.light?.opacity),
47
+ overlays: colorSchemesInput.light?.overlays || []
38
48
  }),
39
49
  dark: _extends({}, colorSchemesInput.dark, {
40
50
  palette: darkPalette,
41
51
  opacity: _extends({
42
52
  placeholder: 0.5,
43
53
  inputTouchBottomLine: 0.7
44
- }, colorSchemesInput.dark?.opacity)
54
+ }, colorSchemesInput.dark?.opacity),
55
+ overlays: colorSchemesInput.dark?.overlays || defaultDarkOverlays
45
56
  })
46
57
  })
47
58
  });
@@ -92,6 +103,11 @@ export default function extendTheme(options = {}, ...args) {
92
103
 
93
104
  if (colors.secondary) {
94
105
  palette[color].secondaryChannel = colorChannel(colors.secondary);
106
+ } // Action colors: action.activeChannel
107
+
108
+
109
+ if (colors.active) {
110
+ palette[color].activeChannel = colorChannel(colors.active);
95
111
  }
96
112
  });
97
113
  });
@@ -191,6 +191,7 @@ const Alert = /*#__PURE__*/React.forwardRef(function Alert(inProps, ref) {
191
191
  className: classes.message,
192
192
  children: children
193
193
  }), action != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AlertAction, {
194
+ ownerState: ownerState,
194
195
  className: classes.action,
195
196
  children: action
196
197
  }) : null, action == null && onClose ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AlertAction, {
File without changes
@@ -219,12 +219,12 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
219
219
 
220
220
  } = options;
221
221
 
222
- if (event.type === 'mousedown' && ignoringMouseDown.current) {
222
+ if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {
223
223
  ignoringMouseDown.current = false;
224
224
  return;
225
225
  }
226
226
 
227
- if (event.type === 'touchstart') {
227
+ if ((event == null ? void 0 : event.type) === 'touchstart') {
228
228
  ignoringMouseDown.current = true;
229
229
  }
230
230
 
@@ -240,7 +240,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
240
240
  let rippleY;
241
241
  let rippleSize;
242
242
 
243
- if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
243
+ if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
244
244
  rippleX = Math.round(rect.width / 2);
245
245
  rippleY = Math.round(rect.height / 2);
246
246
  } else {
@@ -265,7 +265,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
265
265
  } // Touche devices
266
266
 
267
267
 
268
- if (event.touches) {
268
+ if (event != null && event.touches) {
269
269
  // check that this isn't another touchstart due to multitouch
270
270
  // otherwise we will only clear a single timer when unmounting while two
271
271
  // are running
@@ -308,7 +308,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
308
308
  clearTimeout(startTimer.current); // The touch interaction occurs too quickly.
309
309
  // We still want to show ripple effect.
310
310
 
311
- if (event.type === 'touchend' && startTimerCommit.current) {
311
+ if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {
312
312
  startTimerCommit.current();
313
313
  startTimerCommit.current = null;
314
314
  startTimer.current = setTimeout(() => {
package/node/Fab/Fab.js CHANGED
@@ -207,7 +207,9 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
207
207
  * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
208
208
  * @default 'default'
209
209
  */
210
- color: _propTypes.default.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
210
+ color: _propTypes.default
211
+ /* @typescript-to-proptypes-ignore */
212
+ .oneOfType([_propTypes.default.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']), _propTypes.default.string]),
211
213
 
212
214
  /**
213
215
  * The component used for the root node.
@@ -177,7 +177,8 @@ const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inP
177
177
  value: childContext,
178
178
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ListItemButtonRoot, (0, _extends2.default)({
179
179
  ref: handleRef,
180
- component: component,
180
+ href: other.href || other.to,
181
+ component: (other.href || other.to) && component === 'div' ? 'a' : component,
181
182
  focusVisibleClassName: (0, _clsx.default)(classes.focusVisible, focusVisibleClassName),
182
183
  ownerState: ownerState
183
184
  }, other, {
@@ -259,6 +260,11 @@ process.env.NODE_ENV !== "production" ? ListItemButton.propTypes
259
260
  */
260
261
  focusVisibleClassName: _propTypes.default.string,
261
262
 
263
+ /**
264
+ * @ignore
265
+ */
266
+ href: _propTypes.default.string,
267
+
262
268
  /**
263
269
  * Use to apply selected styling.
264
270
  * @default false
@@ -113,7 +113,7 @@ function moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable,
113
113
  return false;
114
114
  }
115
115
  /**
116
- * A permanently displayed menu following https://www.w3.org/TR/wai-aria-practices/#menubutton.
116
+ * A permanently displayed menu following https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/.
117
117
  * It's exposed to help customization of the [`Menu`](/material-ui/api/menu/) component if you
118
118
  * use it separately you need to move focus into the component manually. Once
119
119
  * the focus is placed inside the component it is fully keyboard accessible.
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.getOverlayAlpha = exports.default = void 0;
9
9
 
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
 
@@ -52,6 +52,8 @@ const getOverlayAlpha = elevation => {
52
52
  return (alphaValue / 100).toFixed(2);
53
53
  };
54
54
 
55
+ exports.getOverlayAlpha = getOverlayAlpha;
56
+
55
57
  const useUtilityClasses = ownerState => {
56
58
  const {
57
59
  square,
@@ -77,19 +79,25 @@ const PaperRoot = (0, _styled.default)('div', {
77
79
  })(({
78
80
  theme,
79
81
  ownerState
80
- }) => (0, _extends2.default)({
81
- backgroundColor: theme.palette.background.paper,
82
- color: theme.palette.text.primary,
83
- transition: theme.transitions.create('box-shadow')
84
- }, !ownerState.square && {
85
- borderRadius: theme.shape.borderRadius
86
- }, ownerState.variant === 'outlined' && {
87
- border: `1px solid ${theme.palette.divider}`
88
- }, ownerState.variant === 'elevation' && (0, _extends2.default)({
89
- boxShadow: theme.shadows[ownerState.elevation]
90
- }, theme.palette.mode === 'dark' && {
91
- backgroundImage: `linear-gradient(${(0, _system.alpha)('#fff', getOverlayAlpha(ownerState.elevation))}, ${(0, _system.alpha)('#fff', getOverlayAlpha(ownerState.elevation))})`
92
- })));
82
+ }) => {
83
+ var _theme$vars$overlays;
84
+
85
+ return (0, _extends2.default)({
86
+ backgroundColor: (theme.vars || theme).palette.background.paper,
87
+ color: (theme.vars || theme).palette.text.primary,
88
+ transition: theme.transitions.create('box-shadow')
89
+ }, !ownerState.square && {
90
+ borderRadius: theme.shape.borderRadius
91
+ }, ownerState.variant === 'outlined' && {
92
+ border: `1px solid ${(theme.vars || theme).palette.divider}`
93
+ }, ownerState.variant === 'elevation' && (0, _extends2.default)({
94
+ boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
95
+ }, !theme.vars && theme.palette.mode === 'dark' && {
96
+ backgroundImage: `linear-gradient(${(0, _system.alpha)('#fff', getOverlayAlpha(ownerState.elevation))}, ${(0, _system.alpha)('#fff', getOverlayAlpha(ownerState.elevation))})`
97
+ }, theme.vars && {
98
+ backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]
99
+ }));
100
+ });
93
101
  const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
94
102
  const props = (0, _useThemeProps.default)({
95
103
  props: inProps,
@@ -70,9 +70,9 @@ const RadioRoot = (0, _styled.default)(_SwitchBase.default, {
70
70
  theme,
71
71
  ownerState
72
72
  }) => (0, _extends2.default)({
73
- color: theme.palette.text.secondary,
73
+ color: (theme.vars || theme).palette.text.secondary,
74
74
  '&:hover': {
75
- backgroundColor: (0, _system.alpha)(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
75
+ backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
76
76
  // Reset on touch devices, it doesn't add specificity
77
77
  '@media (hover: none)': {
78
78
  backgroundColor: 'transparent'
@@ -80,11 +80,11 @@ const RadioRoot = (0, _styled.default)(_SwitchBase.default, {
80
80
  }
81
81
  }, ownerState.color !== 'default' && {
82
82
  [`&.${_radioClasses.default.checked}`]: {
83
- color: theme.palette[ownerState.color].main
83
+ color: (theme.vars || theme).palette[ownerState.color].main
84
84
  }
85
85
  }, {
86
86
  [`&.${_radioClasses.default.disabled}`]: {
87
- color: theme.palette.action.disabled
87
+ color: (theme.vars || theme).palette.action.disabled
88
88
  }
89
89
  }));
90
90
 
@@ -339,8 +339,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
339
339
 
340
340
  const handleKeyDown = event => {
341
341
  if (!readOnly) {
342
- const validKeys = [' ', 'ArrowUp', 'ArrowDown', // The native select doesn't respond to enter on MacOS, but it's recommended by
343
- // https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html
342
+ const validKeys = [' ', 'ArrowUp', 'ArrowDown', // The native select doesn't respond to enter on macOS, but it's recommended by
343
+ // https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
344
344
  'Enter'];
345
345
 
346
346
  if (validKeys.indexOf(event.key) !== -1) {
@@ -52,11 +52,7 @@ const SliderRoot = (0, _styled.default)('span', {
52
52
  const {
53
53
  ownerState
54
54
  } = props;
55
- const marks = ownerState.marksProp === true && ownerState.step !== null ? [...Array(Math.floor((ownerState.max - ownerState.min) / ownerState.step) + 1)].map((_, index) => ({
56
- value: ownerState.min + ownerState.step * index
57
- })) : ownerState.marksProp || [];
58
- const marked = marks.length > 0 && marks.some(mark => mark.label);
59
- return [styles.root, styles[`color${(0, _capitalize.default)(ownerState.color)}`], ownerState.size !== 'medium' && styles[`size${(0, _capitalize.default)(ownerState.size)}`], marked && styles.marked, ownerState.orientation === 'vertical' && styles.vertical, ownerState.track === 'inverted' && styles.trackInverted, ownerState.track === false && styles.trackFalse];
55
+ return [styles.root, styles[`color${(0, _capitalize.default)(ownerState.color)}`], ownerState.size !== 'medium' && styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.marked && styles.marked, ownerState.orientation === 'vertical' && styles.vertical, ownerState.track === 'inverted' && styles.trackInverted, ownerState.track === false && styles.trackFalse];
60
56
  }
61
57
  })(({
62
58
  theme,
package/node/Tabs/Tabs.js CHANGED
@@ -180,7 +180,7 @@ const TabsScroller = (0, _styled.default)('div', {
180
180
  overflowX: 'hidden',
181
181
  width: '100%'
182
182
  }, ownerState.hideScrollbar && {
183
- // Hide dimensionless scrollbar on MacOS
183
+ // Hide dimensionless scrollbar on macOS
184
184
  scrollbarWidth: 'none',
185
185
  // Firefox
186
186
  '&::-webkit-scrollbar': {
@@ -240,7 +240,7 @@ const TabsScrollbarSize = (0, _styled.default)(_ScrollbarSize.default, {
240
240
  })({
241
241
  overflowX: 'auto',
242
242
  overflowY: 'hidden',
243
- // Hide dimensionless scrollbar on MacOS
243
+ // Hide dimensionless scrollbar on macOS
244
244
  scrollbarWidth: 'none',
245
245
  // Firefox
246
246
  '&::-webkit-scrollbar': {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.0
1
+ /** @license MUI v5.8.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.
@@ -13,8 +13,10 @@ function createMixins(breakpoints, mixins) {
13
13
  return (0, _extends2.default)({
14
14
  toolbar: {
15
15
  minHeight: 56,
16
- [`${breakpoints.up('xs')} and (orientation: landscape)`]: {
17
- minHeight: 48
16
+ [breakpoints.up('xs')]: {
17
+ '@media (orientation: landscape)': {
18
+ minHeight: 48
19
+ }
18
20
  },
19
21
  [breakpoints.up('sm')]: {
20
22
  minHeight: 64
@@ -17,11 +17,21 @@ var _system = require("@mui/system");
17
17
 
18
18
  var _createTheme = _interopRequireDefault(require("./createTheme"));
19
19
 
20
+ var _Paper = require("../Paper/Paper");
21
+
20
22
  const _excluded = ["colorSchemes"],
21
23
  _excluded2 = ["palette"];
24
+ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
25
+ if (index === 0) {
26
+ return undefined;
27
+ }
28
+
29
+ const overlay = (0, _Paper.getOverlayAlpha)(index);
30
+ return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
31
+ });
22
32
 
23
33
  function extendTheme(options = {}, ...args) {
24
- var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$da2;
34
+ var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3;
25
35
 
26
36
  const {
27
37
  colorSchemes: colorSchemesInput = {}
@@ -50,14 +60,16 @@ function extendTheme(options = {}, ...args) {
50
60
  opacity: (0, _extends2.default)({
51
61
  placeholder: 0.42,
52
62
  inputTouchBottomLine: 0.42
53
- }, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity)
63
+ }, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity),
64
+ overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || []
54
65
  }),
55
66
  dark: (0, _extends2.default)({}, colorSchemesInput.dark, {
56
67
  palette: darkPalette,
57
68
  opacity: (0, _extends2.default)({
58
69
  placeholder: 0.5,
59
70
  inputTouchBottomLine: 0.7
60
- }, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity)
71
+ }, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
72
+ overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
61
73
  })
62
74
  })
63
75
  });
@@ -107,6 +119,11 @@ function extendTheme(options = {}, ...args) {
107
119
 
108
120
  if (colors.secondary) {
109
121
  palette[color].secondaryChannel = (0, _system.colorChannel)(colors.secondary);
122
+ } // Action colors: action.activeChannel
123
+
124
+
125
+ if (colors.active) {
126
+ palette[color].activeChannel = (0, _system.colorChannel)(colors.active);
110
127
  }
111
128
  });
112
129
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.8.0",
3
+ "version": "5.8.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "React components that implement Google's Material Design.",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.17.2",
49
- "@mui/base": "5.0.0-alpha.81",
50
- "@mui/system": "^5.8.0",
49
+ "@mui/base": "5.0.0-alpha.82",
50
+ "@mui/system": "^5.8.1",
51
51
  "@mui/types": "^7.1.3",
52
52
  "@mui/utils": "^5.8.0",
53
53
  "@types/react-transition-group": "^4.4.4",
@@ -3,8 +3,10 @@ export default function createMixins(breakpoints, mixins) {
3
3
  return _extends({
4
4
  toolbar: {
5
5
  minHeight: 56,
6
- [`${breakpoints.up('xs')} and (orientation: landscape)`]: {
7
- minHeight: 48
6
+ [breakpoints.up('xs')]: {
7
+ '@media (orientation: landscape)': {
8
+ minHeight: 48
9
+ }
8
10
  },
9
11
  [breakpoints.up('sm')]: {
10
12
  minHeight: 64
@@ -125,7 +125,7 @@ export interface PaletteWithChannels {
125
125
  text: TypeText & { primaryChannel: string; secondaryChannel: string; disabledChannel: string };
126
126
  divider: TypeDivider;
127
127
  dividerChannel: TypeDivider;
128
- action: TypeAction & { disabledChannel: string };
128
+ action: TypeAction & { disabledChannel: string; activeChannel: string };
129
129
  background: TypeBackground;
130
130
  getContrastText: (background: string) => string;
131
131
  augmentColor: (options: PaletteAugmentColorOptions) => PaletteColor;