@mui/material 5.8.3 → 5.8.6

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 (158) hide show
  1. package/Alert/Alert.js +19 -11
  2. package/AppBar/AppBar.js +22 -5
  3. package/Autocomplete/autocompleteClasses.d.ts +1 -1
  4. package/Avatar/Avatar.js +7 -4
  5. package/Badge/Badge.js +2 -2
  6. package/Button/buttonClasses.d.ts +24 -0
  7. package/Button/buttonClasses.js +1 -1
  8. package/CHANGELOG.md +224 -14
  9. package/Chip/Chip.js +31 -30
  10. package/Dialog/Dialog.js +11 -6
  11. package/FilledInput/FilledInput.js +28 -13
  12. package/Grid/Grid.d.ts +73 -52
  13. package/Grid/Grid.js +94 -40
  14. package/Grow/Grow.js +1 -2
  15. package/Hidden/withWidth.js +0 -2
  16. package/Input/Input.js +1 -1
  17. package/InputBase/InputBase.js +2 -2
  18. package/LinearProgress/LinearProgress.js +6 -2
  19. package/Link/Link.js +10 -17
  20. package/Link/getTextDecoration.d.ts +15 -0
  21. package/Link/getTextDecoration.js +29 -0
  22. package/Modal/Modal.d.ts +2 -0
  23. package/Modal/Modal.js +25 -8
  24. package/OutlinedInput/OutlinedInput.js +40 -10
  25. package/Popover/Popover.d.ts +7 -0
  26. package/Popover/index.js +1 -0
  27. package/README.md +6 -9
  28. package/Skeleton/Skeleton.js +8 -3
  29. package/Slider/Slider.d.ts +3 -1
  30. package/Slider/Slider.js +24 -22
  31. package/Snackbar/Snackbar.js +6 -20
  32. package/SnackbarContent/SnackbarContent.js +3 -3
  33. package/SpeedDialAction/SpeedDialAction.js +7 -7
  34. package/Stack/Stack.js +1 -1
  35. package/StepConnector/StepConnector.js +14 -11
  36. package/StepContent/StepContent.js +1 -1
  37. package/StepIcon/StepIcon.js +2 -1
  38. package/Switch/Switch.js +11 -11
  39. package/Tab/Tab.d.ts +0 -1
  40. package/TableCell/TableCell.js +5 -5
  41. package/Tabs/Tabs.js +16 -2
  42. package/Tooltip/Tooltip.js +1 -1
  43. package/index.js +1 -1
  44. package/legacy/Alert/Alert.js +19 -11
  45. package/legacy/AppBar/AppBar.js +23 -4
  46. package/legacy/Avatar/Avatar.js +7 -4
  47. package/legacy/Badge/Badge.js +2 -2
  48. package/legacy/Button/buttonClasses.js +1 -1
  49. package/legacy/Chip/Chip.js +31 -30
  50. package/legacy/Dialog/Dialog.js +11 -6
  51. package/legacy/FilledInput/FilledInput.js +28 -14
  52. package/legacy/Grid/Grid.js +97 -48
  53. package/legacy/Grow/Grow.js +1 -2
  54. package/legacy/Hidden/withWidth.js +0 -2
  55. package/legacy/Input/Input.js +1 -1
  56. package/legacy/InputBase/InputBase.js +2 -2
  57. package/legacy/LinearProgress/LinearProgress.js +6 -2
  58. package/legacy/Link/Link.js +10 -17
  59. package/legacy/Link/getTextDecoration.js +28 -0
  60. package/legacy/Modal/Modal.js +23 -7
  61. package/legacy/OutlinedInput/OutlinedInput.js +36 -9
  62. package/legacy/Popover/index.js +1 -0
  63. package/legacy/Skeleton/Skeleton.js +2 -2
  64. package/legacy/Slider/Slider.js +24 -22
  65. package/legacy/Snackbar/Snackbar.js +6 -21
  66. package/legacy/SnackbarContent/SnackbarContent.js +3 -3
  67. package/legacy/SpeedDialAction/SpeedDialAction.js +7 -7
  68. package/legacy/Stack/Stack.js +2 -1
  69. package/legacy/StepConnector/StepConnector.js +2 -1
  70. package/legacy/StepContent/StepContent.js +1 -1
  71. package/legacy/StepIcon/StepIcon.js +2 -1
  72. package/legacy/Switch/Switch.js +11 -11
  73. package/legacy/TableCell/TableCell.js +5 -5
  74. package/legacy/Tabs/Tabs.js +16 -2
  75. package/legacy/Tooltip/Tooltip.js +1 -1
  76. package/legacy/index.js +1 -1
  77. package/legacy/styles/CssVarsProvider.js +4 -2
  78. package/legacy/styles/experimental_extendTheme.js +153 -18
  79. package/modern/Alert/Alert.js +19 -11
  80. package/modern/AppBar/AppBar.js +22 -5
  81. package/modern/Avatar/Avatar.js +7 -4
  82. package/modern/Badge/Badge.js +2 -2
  83. package/modern/Button/buttonClasses.js +1 -1
  84. package/modern/Chip/Chip.js +31 -30
  85. package/modern/Dialog/Dialog.js +11 -6
  86. package/modern/FilledInput/FilledInput.js +27 -12
  87. package/modern/Grid/Grid.js +94 -40
  88. package/modern/Grow/Grow.js +1 -2
  89. package/modern/Hidden/withWidth.js +0 -2
  90. package/modern/Input/Input.js +1 -1
  91. package/modern/InputBase/InputBase.js +2 -2
  92. package/modern/LinearProgress/LinearProgress.js +6 -2
  93. package/modern/Link/Link.js +10 -17
  94. package/modern/Link/getTextDecoration.js +29 -0
  95. package/modern/Modal/Modal.js +24 -7
  96. package/modern/OutlinedInput/OutlinedInput.js +40 -10
  97. package/modern/Popover/index.js +1 -0
  98. package/modern/Skeleton/Skeleton.js +7 -2
  99. package/modern/Slider/Slider.js +24 -22
  100. package/modern/Snackbar/Snackbar.js +6 -20
  101. package/modern/SnackbarContent/SnackbarContent.js +3 -3
  102. package/modern/SpeedDialAction/SpeedDialAction.js +7 -7
  103. package/modern/Stack/Stack.js +1 -1
  104. package/modern/StepConnector/StepConnector.js +14 -11
  105. package/modern/StepContent/StepContent.js +1 -1
  106. package/modern/StepIcon/StepIcon.js +2 -1
  107. package/modern/Switch/Switch.js +11 -11
  108. package/modern/TableCell/TableCell.js +5 -5
  109. package/modern/Tabs/Tabs.js +16 -2
  110. package/modern/Tooltip/Tooltip.js +1 -1
  111. package/modern/index.js +1 -1
  112. package/modern/styles/CssVarsProvider.js +2 -2
  113. package/modern/styles/experimental_extendTheme.js +154 -18
  114. package/node/Alert/Alert.js +19 -11
  115. package/node/AppBar/AppBar.js +22 -5
  116. package/node/Avatar/Avatar.js +7 -4
  117. package/node/Badge/Badge.js +2 -2
  118. package/node/Button/buttonClasses.js +1 -1
  119. package/node/Chip/Chip.js +31 -30
  120. package/node/Dialog/Dialog.js +11 -6
  121. package/node/FilledInput/FilledInput.js +28 -13
  122. package/node/Grid/Grid.js +95 -40
  123. package/node/Grow/Grow.js +1 -2
  124. package/node/Hidden/withWidth.js +0 -3
  125. package/node/Input/Input.js +1 -1
  126. package/node/InputBase/InputBase.js +2 -2
  127. package/node/LinearProgress/LinearProgress.js +6 -2
  128. package/node/Link/Link.js +12 -20
  129. package/node/Link/getTextDecoration.js +39 -0
  130. package/node/Modal/Modal.js +25 -8
  131. package/node/OutlinedInput/OutlinedInput.js +38 -10
  132. package/node/Popover/index.js +13 -3
  133. package/node/Skeleton/Skeleton.js +7 -2
  134. package/node/Slider/Slider.js +24 -22
  135. package/node/Snackbar/Snackbar.js +6 -18
  136. package/node/SnackbarContent/SnackbarContent.js +3 -3
  137. package/node/SpeedDialAction/SpeedDialAction.js +7 -7
  138. package/node/Stack/Stack.js +1 -1
  139. package/node/StepConnector/StepConnector.js +14 -11
  140. package/node/StepContent/StepContent.js +1 -1
  141. package/node/StepIcon/StepIcon.js +2 -1
  142. package/node/Switch/Switch.js +11 -11
  143. package/node/TableCell/TableCell.js +5 -5
  144. package/node/Tabs/Tabs.js +16 -2
  145. package/node/Tooltip/Tooltip.js +1 -1
  146. package/node/index.js +1 -1
  147. package/node/styles/CssVarsProvider.js +6 -2
  148. package/node/styles/experimental_extendTheme.js +152 -17
  149. package/package.json +6 -7
  150. package/styles/CssVarsProvider.d.ts +10 -28
  151. package/styles/CssVarsProvider.js +6 -2
  152. package/styles/createPalette.d.ts +0 -26
  153. package/styles/experimental_extendTheme.d.ts +225 -37
  154. package/styles/experimental_extendTheme.js +154 -18
  155. package/styles/index.d.ts +24 -1
  156. package/themeCssVarsAugmentation/index.d.ts +61 -0
  157. package/umd/material-ui.development.js +1048 -541
  158. package/umd/material-ui.production.min.js +27 -22
package/README.md CHANGED
@@ -7,11 +7,13 @@
7
7
 
8
8
  **MUI Core** contains foundational React UI component libraries for shipping new features faster.
9
9
 
10
- - _Material UI_ is a comprehensive library of components that features our implementation of Google's [Material Design](https://material.io/design/introduction/) system.
10
+ - [_Material UI_](https://mui.com/material-ui/getting-started/overview/) is a comprehensive library of components that features our implementation of Google's [Material Design](https://material.io/design/introduction/) system.
11
11
 
12
- - _MUI Base_ is our library of "unstyled" components and low-level hooks. With Base, you gain complete control over your app's CSS and accessibility features.
12
+ - [_Joy UI_](https://mui.com/joy-ui/getting-started/overview/) is a beautifully designed library of React UI components.
13
13
 
14
- - _MUI System_ is a collection of CSS utilities to help you rapidly lay out custom designs.
14
+ - [_MUI Base_](https://mui.com/base/getting-started/overview/) is our library of "unstyled" components and low-level hooks. With Base, you gain complete control over your app's CSS and accessibility features.
15
+
16
+ - [_MUI System_](https://mui.com/system/basics/) is a collection of CSS utilities to help you rapidly lay out custom designs.
15
17
 
16
18
  <div align="center">
17
19
 
@@ -134,15 +136,10 @@ Here is an example of a basic app using Material UI's `Button` component:
134
136
 
135
137
  ```jsx
136
138
  import * as React from 'react';
137
- import ReactDOM from 'react-dom';
138
139
  import Button from '@mui/material/Button';
139
140
 
140
141
  function App() {
141
- return (
142
- <Button variant="contained" color="primary">
143
- Hello World
144
- </Button>
145
- );
142
+ return <Button variant="contained">Hello World</Button>;
146
143
  }
147
144
  ```
148
145
 
@@ -79,7 +79,7 @@ const SkeletonRoot = styled('span', {
79
79
  return _extends({
80
80
  display: 'block',
81
81
  // Create a "on paper" color with sufficient contrast retaining the color
82
- backgroundColor: alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
82
+ backgroundColor: theme.vars ? theme.vars.palette.Skeleton.bg : alpha(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
83
83
  height: '1.2em'
84
84
  }, ownerState.variant === 'text' && {
85
85
  marginTop: 0,
@@ -118,7 +118,12 @@ const SkeletonRoot = styled('span', {
118
118
 
119
119
  &::after {
120
120
  animation: ${0} 1.6s linear 0.5s infinite;
121
- background: linear-gradient(90deg, transparent, ${0}, transparent);
121
+ background: linear-gradient(
122
+ 90deg,
123
+ transparent,
124
+ ${0},
125
+ transparent
126
+ );
122
127
  content: '';
123
128
  position: absolute;
124
129
  transform: translateX(-100%); /* Avoid flash during server-side hydration */
@@ -127,7 +132,7 @@ const SkeletonRoot = styled('span', {
127
132
  right: 0;
128
133
  top: 0;
129
134
  }
130
- `), waveKeyframe, theme.palette.action.hover));
135
+ `), waveKeyframe, (theme.vars || theme).palette.action.hover));
131
136
  const Skeleton = /*#__PURE__*/React.forwardRef(function Skeleton(inProps, ref) {
132
137
  const props = useThemeProps({
133
138
  props: inProps,
@@ -3,6 +3,7 @@ import {
3
3
  ExtendSliderUnstyledTypeMap,
4
4
  ExtendSliderUnstyled,
5
5
  SliderUnstyledTypeMap,
6
+ SliderValueLabelProps,
6
7
  } from '@mui/base/SliderUnstyled';
7
8
  import { SxProps } from '@mui/system';
8
9
  import { OverridableStringUnion } from '@mui/types';
@@ -55,13 +56,14 @@ export type SliderTypeMap<
55
56
  defaultComponent: D;
56
57
  }>;
57
58
 
59
+ export { SliderValueLabelProps } from '@mui/base/SliderUnstyled';
60
+
58
61
  type SliderRootProps = NonNullable<SliderTypeMap['props']['componentsProps']>['root'];
59
62
  type SliderMarkProps = NonNullable<SliderTypeMap['props']['componentsProps']>['mark'];
60
63
  type SliderMarkLabelProps = NonNullable<SliderTypeMap['props']['componentsProps']>['markLabel'];
61
64
  type SliderRailProps = NonNullable<SliderTypeMap['props']['componentsProps']>['rail'];
62
65
  type SliderTrackProps = NonNullable<SliderTypeMap['props']['componentsProps']>['track'];
63
66
  type SliderThumbProps = NonNullable<SliderTypeMap['props']['componentsProps']>['thumb'];
64
- type SliderValueLabelProps = NonNullable<SliderTypeMap['props']['componentsProps']>['valueLabel'];
65
67
  type SliderInputProps = NonNullable<SliderTypeMap['props']['componentsProps']>['input'];
66
68
 
67
69
  export const SliderRoot: React.FC<SliderRootProps>;
package/Slider/Slider.js CHANGED
@@ -34,7 +34,7 @@ const SliderRoot = styled('span', {
34
34
  position: 'relative',
35
35
  cursor: 'pointer',
36
36
  touchAction: 'none',
37
- color: theme.palette[ownerState.color].main,
37
+ color: (theme.vars || theme).palette[ownerState.color].main,
38
38
  WebkitTapHighlightColor: 'transparent'
39
39
  }, ownerState.orientation === 'horizontal' && _extends({
40
40
  height: 4,
@@ -69,7 +69,7 @@ const SliderRoot = styled('span', {
69
69
  [`&.${sliderClasses.disabled}`]: {
70
70
  pointerEvents: 'none',
71
71
  cursor: 'default',
72
- color: theme.palette.grey[400]
72
+ color: (theme.vars || theme).palette.grey[400]
73
73
  },
74
74
  [`&.${sliderClasses.dragging}`]: {
75
75
  [`& .${sliderClasses.thumb}, & .${sliderClasses.track}`]: {
@@ -162,8 +162,8 @@ const SliderTrack = styled('span', {
162
162
  }, ownerState.track === false && {
163
163
  display: 'none'
164
164
  }, ownerState.track === 'inverted' && {
165
- backgroundColor: color,
166
- borderColor: color
165
+ backgroundColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color,
166
+ borderColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color
167
167
  });
168
168
  });
169
169
  process.env.NODE_ENV !== "production" ? SliderTrack.propTypes
@@ -222,7 +222,7 @@ const SliderThumb = styled('span', {
222
222
  borderRadius: 'inherit',
223
223
  width: '100%',
224
224
  height: '100%',
225
- boxShadow: theme.shadows[2]
225
+ boxShadow: (theme.vars || theme).shadows[2]
226
226
  }, ownerState.size === 'small' && {
227
227
  boxShadow: 'none'
228
228
  }),
@@ -238,13 +238,13 @@ const SliderThumb = styled('span', {
238
238
  transform: 'translate(-50%, -50%)'
239
239
  },
240
240
  [`&:hover, &.${sliderClasses.focusVisible}`]: {
241
- boxShadow: `0px 0px 0px 8px ${alpha(theme.palette[ownerState.color].main, 0.16)}`,
241
+ boxShadow: `0px 0px 0px 8px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : alpha(theme.palette[ownerState.color].main, 0.16)}`,
242
242
  '@media (hover: none)': {
243
243
  boxShadow: 'none'
244
244
  }
245
245
  },
246
246
  [`&.${sliderClasses.active}`]: {
247
- boxShadow: `0px 0px 0px 14px ${alpha(theme.palette[ownerState.color].main, 0.16)}`
247
+ boxShadow: `0px 0px 0px 14px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : alpha(theme.palette[ownerState.color].main, 0.16)}`
248
248
  },
249
249
  [`&.${sliderClasses.disabled}`]: {
250
250
  '&:hover': {
@@ -287,9 +287,9 @@ const SliderValueLabel = styled(SliderValueLabelUnstyled, {
287
287
  transformOrigin: 'bottom center',
288
288
  transform: 'translateY(-100%) scale(0)',
289
289
  position: 'absolute',
290
- backgroundColor: theme.palette.grey[600],
290
+ backgroundColor: (theme.vars || theme).palette.grey[600],
291
291
  borderRadius: 2,
292
- color: theme.palette.common.white,
292
+ color: (theme.vars || theme).palette.common.white,
293
293
  display: 'flex',
294
294
  alignItems: 'center',
295
295
  justifyContent: 'center',
@@ -359,7 +359,7 @@ const SliderMark = styled('span', {
359
359
  left: '50%',
360
360
  transform: 'translate(-50%, 1px)'
361
361
  }, markActive && {
362
- backgroundColor: theme.palette.background.paper,
362
+ backgroundColor: (theme.vars || theme).palette.background.paper,
363
363
  opacity: 0.8
364
364
  }));
365
365
  process.env.NODE_ENV !== "production" ? SliderMark.propTypes
@@ -386,7 +386,7 @@ const SliderMarkLabel = styled('span', {
386
386
  ownerState,
387
387
  markLabelActive
388
388
  }) => _extends({}, theme.typography.body2, {
389
- color: theme.palette.text.secondary,
389
+ color: (theme.vars || theme).palette.text.secondary,
390
390
  position: 'absolute',
391
391
  whiteSpace: 'nowrap'
392
392
  }, ownerState.orientation === 'horizontal' && {
@@ -402,7 +402,7 @@ const SliderMarkLabel = styled('span', {
402
402
  left: 44
403
403
  }
404
404
  }, markLabelActive && {
405
- color: theme.palette.text.primary
405
+ color: (theme.vars || theme).palette.text.primary
406
406
  }));
407
407
  process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
408
408
  /* remove-proptypes */
@@ -579,22 +579,24 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
579
579
  * @default {}
580
580
  */
581
581
  componentsProps: PropTypes.shape({
582
- input: PropTypes.object,
583
- mark: PropTypes.object,
584
- markLabel: PropTypes.object,
585
- rail: PropTypes.object,
586
- root: PropTypes.object,
587
- thumb: PropTypes.object,
588
- track: PropTypes.object,
589
- valueLabel: PropTypes.shape({
582
+ input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
583
+ mark: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
584
+ markLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
585
+ rail: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
586
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
587
+ thumb: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
588
+ track: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
589
+ valueLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
590
+ children: PropTypes.element,
590
591
  className: PropTypes.string,
591
592
  components: PropTypes.shape({
592
593
  Root: PropTypes.elementType
593
594
  }),
595
+ open: PropTypes.bool,
594
596
  style: PropTypes.object,
595
- value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
597
+ value: PropTypes.number,
596
598
  valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on'])
597
- })
599
+ })])
598
600
  }),
599
601
 
600
602
  /**
@@ -41,16 +41,11 @@ const SnackbarRoot = styled('div', {
41
41
  theme,
42
42
  ownerState
43
43
  }) => {
44
- const center = _extends({}, !ownerState.isRtl && {
44
+ const center = {
45
45
  left: '50%',
46
46
  right: 'auto',
47
47
  transform: 'translateX(-50%)'
48
- }, ownerState.isRtl && {
49
- right: '50%',
50
- left: 'auto',
51
- transform: 'translateX(50%)'
52
- });
53
-
48
+ };
54
49
  return _extends({
55
50
  zIndex: (theme.vars || theme).zIndex.snackbar,
56
51
  position: 'fixed',
@@ -72,19 +67,13 @@ const SnackbarRoot = styled('div', {
72
67
  top: 24
73
68
  } : {
74
69
  bottom: 24
75
- }, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && _extends({}, !ownerState.isRtl && {
70
+ }, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && {
76
71
  left: 24,
77
72
  right: 'auto'
78
- }, ownerState.isRtl && {
73
+ }, ownerState.anchorOrigin.horizontal === 'right' && {
79
74
  right: 24,
80
75
  left: 'auto'
81
- }), ownerState.anchorOrigin.horizontal === 'right' && _extends({}, !ownerState.isRtl && {
82
- right: 24,
83
- left: 'auto'
84
- }, ownerState.isRtl && {
85
- left: 24,
86
- right: 'auto'
87
- }))
76
+ })
88
77
  });
89
78
  });
90
79
  const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
@@ -131,14 +120,11 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
131
120
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
132
121
  other = _objectWithoutPropertiesLoose(props, _excluded2);
133
122
 
134
- const isRtl = theme.direction === 'rtl';
135
-
136
123
  const ownerState = _extends({}, props, {
137
124
  anchorOrigin: {
138
125
  vertical,
139
126
  horizontal
140
- },
141
- isRtl
127
+ }
142
128
  });
143
129
 
144
130
  const classes = useUtilityClasses(ownerState);
@@ -35,13 +35,13 @@ const SnackbarContentRoot = styled(Paper, {
35
35
  const emphasis = theme.palette.mode === 'light' ? 0.8 : 0.98;
36
36
  const backgroundColor = emphasize(theme.palette.background.default, emphasis);
37
37
  return _extends({}, theme.typography.body2, {
38
- color: theme.palette.getContrastText(backgroundColor),
39
- backgroundColor,
38
+ color: theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(backgroundColor),
39
+ backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,
40
40
  display: 'flex',
41
41
  alignItems: 'center',
42
42
  flexWrap: 'wrap',
43
43
  padding: '6px 16px',
44
- borderRadius: theme.shape.borderRadius,
44
+ borderRadius: (theme.vars || theme).shape.borderRadius,
45
45
  flexGrow: 1,
46
46
  [theme.breakpoints.up('sm')]: {
47
47
  flexGrow: 'initial',
@@ -45,10 +45,10 @@ const SpeedDialActionFab = styled(Fab, {
45
45
  ownerState
46
46
  }) => _extends({
47
47
  margin: 8,
48
- color: theme.palette.text.secondary,
49
- backgroundColor: theme.palette.background.paper,
48
+ color: (theme.vars || theme).palette.text.secondary,
49
+ backgroundColor: (theme.vars || theme).palette.background.paper,
50
50
  '&:hover': {
51
- backgroundColor: emphasize(theme.palette.background.paper, 0.15)
51
+ backgroundColor: theme.vars ? theme.vars.palette.SpeedDialAction.fabHoverBg : emphasize(theme.palette.background.paper, 0.15)
52
52
  },
53
53
  transition: `${theme.transitions.create('transform', {
54
54
  duration: theme.transitions.duration.shorter
@@ -101,10 +101,10 @@ const SpeedDialActionStaticTooltipLabel = styled('span', {
101
101
  }) => _extends({
102
102
  position: 'absolute'
103
103
  }, theme.typography.body1, {
104
- backgroundColor: theme.palette.background.paper,
105
- borderRadius: theme.shape.borderRadius,
106
- boxShadow: theme.shadows[1],
107
- color: theme.palette.text.secondary,
104
+ backgroundColor: (theme.vars || theme).palette.background.paper,
105
+ borderRadius: (theme.vars || theme).shape.borderRadius,
106
+ boxShadow: (theme.vars || theme).shadows[1],
107
+ color: (theme.vars || theme).palette.text.secondary,
108
108
  padding: '4px 16px',
109
109
  wordBreak: 'keep-all'
110
110
  }));
package/Stack/Stack.js CHANGED
@@ -59,7 +59,7 @@ export const style = ({
59
59
  if (ownerState.spacing) {
60
60
  const transformer = createUnarySpacing(theme);
61
61
  const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
62
- if (ownerState.spacing[breakpoint] != null || ownerState.direction[breakpoint] != null) {
62
+ if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
63
63
  acc[breakpoint] = true;
64
64
  }
65
65
 
@@ -63,17 +63,20 @@ const StepConnectorLine = styled('span', {
63
63
  })(({
64
64
  ownerState,
65
65
  theme
66
- }) => _extends({
67
- display: 'block',
68
- borderColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
69
- }, ownerState.orientation === 'horizontal' && {
70
- borderTopStyle: 'solid',
71
- borderTopWidth: 1
72
- }, ownerState.orientation === 'vertical' && {
73
- borderLeftStyle: 'solid',
74
- borderLeftWidth: 1,
75
- minHeight: 24
76
- }));
66
+ }) => {
67
+ const borderColor = theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600];
68
+ return _extends({
69
+ display: 'block',
70
+ borderColor: theme.vars ? theme.vars.palette.StepConnector.border : borderColor
71
+ }, ownerState.orientation === 'horizontal' && {
72
+ borderTopStyle: 'solid',
73
+ borderTopWidth: 1
74
+ }, ownerState.orientation === 'vertical' && {
75
+ borderLeftStyle: 'solid',
76
+ borderLeftWidth: 1,
77
+ minHeight: 24
78
+ });
79
+ });
77
80
  const StepConnector = /*#__PURE__*/React.forwardRef(function StepConnector(inProps, ref) {
78
81
  const props = useThemeProps({
79
82
  props: inProps,
@@ -43,7 +43,7 @@ const StepContentRoot = styled('div', {
43
43
  paddingLeft: 8 + 12,
44
44
  // margin + half icon
45
45
  paddingRight: 8,
46
- borderLeft: `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
46
+ borderLeft: theme.vars ? `1px solid ${theme.vars.palette.StepContent.border}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
47
47
  }, ownerState.last && {
48
48
  borderLeft: 'none'
49
49
  }));
@@ -120,8 +120,9 @@ const StepIcon = /*#__PURE__*/React.forwardRef(function StepIcon(inProps, ref) {
120
120
  })), /*#__PURE__*/_jsx(StepIconText, {
121
121
  className: classes.text,
122
122
  x: "12",
123
- y: "16",
123
+ y: "12",
124
124
  textAnchor: "middle",
125
+ dominantBaseline: "central",
125
126
  ownerState: ownerState,
126
127
  children: icon
127
128
  })]
package/Switch/Switch.js CHANGED
@@ -101,7 +101,7 @@ const SwitchSwitchBase = styled(SwitchBase, {
101
101
  left: 0,
102
102
  zIndex: 1,
103
103
  // Render above the focus ripple.
104
- color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300],
104
+ color: theme.vars ? theme.vars.palette.Switch.defaultColor : `${theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]}`,
105
105
  transition: theme.transitions.create(['left', 'transform'], {
106
106
  duration: theme.transitions.duration.shortest
107
107
  }),
@@ -109,13 +109,13 @@ const SwitchSwitchBase = styled(SwitchBase, {
109
109
  transform: 'translateX(20px)'
110
110
  },
111
111
  [`&.${switchClasses.disabled}`]: {
112
- color: theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]
112
+ color: theme.vars ? theme.vars.palette.Switch.defaultDisabledColor : `${theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]}`
113
113
  },
114
114
  [`&.${switchClasses.checked} + .${switchClasses.track}`]: {
115
115
  opacity: 0.5
116
116
  },
117
117
  [`&.${switchClasses.disabled} + .${switchClasses.track}`]: {
118
- opacity: theme.palette.mode === 'light' ? 0.12 : 0.2
118
+ opacity: theme.vars ? theme.vars.opacity.switchTrackDisabled : `${theme.palette.mode === 'light' ? 0.12 : 0.2}`
119
119
  },
120
120
  [`& .${switchClasses.input}`]: {
121
121
  left: '-100%',
@@ -126,7 +126,7 @@ const SwitchSwitchBase = styled(SwitchBase, {
126
126
  ownerState
127
127
  }) => _extends({
128
128
  '&:hover': {
129
- backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
129
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
130
130
  // Reset on touch devices, it doesn't add specificity
131
131
  '@media (hover: none)': {
132
132
  backgroundColor: 'transparent'
@@ -134,19 +134,19 @@ const SwitchSwitchBase = styled(SwitchBase, {
134
134
  }
135
135
  }, ownerState.color !== 'default' && {
136
136
  [`&.${switchClasses.checked}`]: {
137
- color: theme.palette[ownerState.color].main,
137
+ color: (theme.vars || theme).palette[ownerState.color].main,
138
138
  '&:hover': {
139
- backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
139
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
140
140
  '@media (hover: none)': {
141
141
  backgroundColor: 'transparent'
142
142
  }
143
143
  },
144
144
  [`&.${switchClasses.disabled}`]: {
145
- color: theme.palette.mode === 'light' ? lighten(theme.palette[ownerState.color].main, 0.62) : darken(theme.palette[ownerState.color].main, 0.55)
145
+ color: theme.vars ? theme.vars.palette.Switch[`${ownerState.color}DisabledColor`] : `${theme.palette.mode === 'light' ? lighten(theme.palette[ownerState.color].main, 0.62) : darken(theme.palette[ownerState.color].main, 0.55)}`
146
146
  }
147
147
  },
148
148
  [`&.${switchClasses.checked} + .${switchClasses.track}`]: {
149
- backgroundColor: theme.palette[ownerState.color].main
149
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].main
150
150
  }
151
151
  }));
152
152
  const SwitchTrack = styled('span', {
@@ -163,8 +163,8 @@ const SwitchTrack = styled('span', {
163
163
  transition: theme.transitions.create(['opacity', 'background-color'], {
164
164
  duration: theme.transitions.duration.shortest
165
165
  }),
166
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white,
167
- opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
166
+ backgroundColor: theme.vars ? theme.vars.palette.common.onBackground : `${theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white}`,
167
+ opacity: theme.vars ? theme.vars.opacity.switchTrack : `${theme.palette.mode === 'light' ? 0.38 : 0.3}`
168
168
  }));
169
169
  const SwitchThumb = styled('span', {
170
170
  name: 'MuiSwitch',
@@ -173,7 +173,7 @@ const SwitchThumb = styled('span', {
173
173
  })(({
174
174
  theme
175
175
  }) => ({
176
- boxShadow: theme.shadows[1],
176
+ boxShadow: (theme.vars || theme).shadows[1],
177
177
  backgroundColor: 'currentColor',
178
178
  width: 20,
179
179
  height: 20,
package/Tab/Tab.d.ts CHANGED
@@ -30,7 +30,6 @@ export type TabTypeMap<P = {}, D extends React.ElementType = 'div'> = ExtendButt
30
30
  * The icon to display.
31
31
  */
32
32
  icon?: string | React.ReactElement;
33
-
34
33
  /**
35
34
  * The position of the icon relative to the label.
36
35
  * @default 'top'
@@ -46,18 +46,18 @@ const TableCellRoot = styled('td', {
46
46
  verticalAlign: 'inherit',
47
47
  // Workaround for a rendering bug with spanned columns in Chrome 62.0.
48
48
  // Removes the alpha (sets it to 1), and lightens or darkens the theme color.
49
- borderBottom: `1px solid
49
+ borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
50
50
  ${theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)}`,
51
51
  textAlign: 'left',
52
52
  padding: 16
53
53
  }, ownerState.variant === 'head' && {
54
- color: theme.palette.text.primary,
54
+ color: (theme.vars || theme).palette.text.primary,
55
55
  lineHeight: theme.typography.pxToRem(24),
56
56
  fontWeight: theme.typography.fontWeightMedium
57
57
  }, ownerState.variant === 'body' && {
58
- color: theme.palette.text.primary
58
+ color: (theme.vars || theme).palette.text.primary
59
59
  }, ownerState.variant === 'footer' && {
60
- color: theme.palette.text.secondary,
60
+ color: (theme.vars || theme).palette.text.secondary,
61
61
  lineHeight: theme.typography.pxToRem(21),
62
62
  fontSize: theme.typography.pxToRem(12)
63
63
  }, ownerState.size === 'small' && {
@@ -89,7 +89,7 @@ const TableCellRoot = styled('td', {
89
89
  position: 'sticky',
90
90
  top: 0,
91
91
  zIndex: 2,
92
- backgroundColor: theme.palette.background.default
92
+ backgroundColor: (theme.vars || theme).palette.background.default
93
93
  }));
94
94
  /**
95
95
  * The component renders a `<th>` element when the parent context is a header
package/Tabs/Tabs.js CHANGED
@@ -426,6 +426,12 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
426
426
  const tab = children[i];
427
427
 
428
428
  if (totalSize + tab[clientSize] > containerSize) {
429
+ // If the first item is longer than the container size, then only scroll
430
+ // by the container size.
431
+ if (i === 0) {
432
+ totalSize = containerSize;
433
+ }
434
+
429
435
  break;
430
436
  }
431
437
 
@@ -535,8 +541,16 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
535
541
  });
536
542
  React.useEffect(() => {
537
543
  const handleResize = debounce(() => {
538
- updateIndicatorState();
539
- updateScrollButtonState();
544
+ // If the Tabs component is replaced by Suspense with a fallback, the last
545
+ // ResizeObserver's handler that runs because of the change in the layout is trying to
546
+ // access a dom node that is no longer there (as the fallback component is being shown instead).
547
+ // See https://github.com/mui/material-ui/issues/33276
548
+ // TODO: Add tests that will ensure the component is not failing when
549
+ // replaced by Suspense with a fallback, once React is updated to version 18
550
+ if (tabsRef.current) {
551
+ updateIndicatorState();
552
+ updateScrollButtonState();
553
+ }
540
554
  });
541
555
  const win = ownerWindow(tabsRef.current);
542
556
  win.addEventListener('resize', handleResize);
@@ -117,7 +117,7 @@ const TooltipTooltip = styled('div', {
117
117
  theme,
118
118
  ownerState
119
119
  }) => _extends({
120
- backgroundColor: theme.vars ? `rgba(${theme.vars.palette.grey.darkChannel} / 0.92)` : alpha(theme.palette.grey[700], 0.92),
120
+ backgroundColor: theme.vars ? theme.vars.palette.Tooltip.bg : alpha(theme.palette.grey[700], 0.92),
121
121
  borderRadius: (theme.vars || theme).shape.borderRadius,
122
122
  color: (theme.vars || theme).palette.common.white,
123
123
  fontFamily: theme.typography.fontFamily,
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.3
1
+ /** @license MUI v5.8.6
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.
@@ -55,20 +55,28 @@ var AlertRoot = styled(Paper, {
55
55
  display: 'flex',
56
56
  padding: '6px 16px'
57
57
  }, color && ownerState.variant === 'standard' && _defineProperty({
58
- color: getColor(theme.palette[color].light, 0.6),
59
- backgroundColor: getBackgroundColor(theme.palette[color].light, 0.9)
60
- }, "& .".concat(alertClasses.icon), {
58
+ color: theme.vars ? theme.vars.palette.Alert["".concat(color, "Color")] : getColor(theme.palette[color].light, 0.6),
59
+ backgroundColor: theme.vars ? theme.vars.palette.Alert["".concat(color, "StandardBg")] : getBackgroundColor(theme.palette[color].light, 0.9)
60
+ }, "& .".concat(alertClasses.icon), theme.vars ? {
61
+ color: theme.vars.palette.Alert["".concat(color, "IconColor")]
62
+ } : {
61
63
  color: theme.palette.mode === 'dark' ? theme.palette[color].main : theme.palette[color].light
62
64
  }), color && ownerState.variant === 'outlined' && _defineProperty({
63
- color: getColor(theme.palette[color].light, 0.6),
64
- border: "1px solid ".concat(theme.palette[color].light)
65
- }, "& .".concat(alertClasses.icon), {
65
+ color: theme.vars ? theme.vars.palette.Alert["".concat(color, "Color")] : getColor(theme.palette[color].light, 0.6),
66
+ border: "1px solid ".concat((theme.vars || theme).palette[color].light)
67
+ }, "& .".concat(alertClasses.icon), theme.vars ? {
68
+ color: theme.vars.palette.Alert["".concat(color, "IconColor")]
69
+ } : {
66
70
  color: theme.palette.mode === 'dark' ? theme.palette[color].main : theme.palette[color].light
67
- }), color && ownerState.variant === 'filled' && {
68
- color: '#fff',
69
- fontWeight: theme.typography.fontWeightMedium,
70
- backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main
71
- });
71
+ }), color && ownerState.variant === 'filled' && _extends({
72
+ fontWeight: theme.typography.fontWeightMedium
73
+ }, theme.vars ? {
74
+ color: theme.vars.palette.Alert["".concat(color, "FilledColor")],
75
+ backgroundColor: theme.vars.palette.Alert["".concat(color, "FilledBg")]
76
+ } : {
77
+ backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
78
+ color: theme.palette.getContrastText(theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main)
79
+ }));
72
80
  });
73
81
  var AlertIcon = styled('div', {
74
82
  name: 'MuiAlert',