@mui/material 5.8.2 → 5.8.5

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 (154) hide show
  1. package/Alert/Alert.js +3 -1
  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 +225 -8
  9. package/Checkbox/Checkbox.js +4 -4
  10. package/Chip/Chip.js +31 -30
  11. package/Dialog/Dialog.js +11 -6
  12. package/FilledInput/FilledInput.js +28 -13
  13. package/Grid/Grid.d.ts +73 -52
  14. package/Grid/Grid.js +94 -40
  15. package/Grow/Grow.js +1 -2
  16. package/Hidden/withWidth.js +0 -2
  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 +25 -10
  25. package/Popover/Popover.d.ts +7 -0
  26. package/Popover/index.js +1 -0
  27. package/README.md +13 -12
  28. package/Skeleton/Skeleton.js +8 -3
  29. package/Slider/Slider.d.ts +3 -1
  30. package/Slider/Slider.js +35 -20
  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 +6 -0
  42. package/Tooltip/Tooltip.js +1 -1
  43. package/index.js +1 -1
  44. package/legacy/Alert/Alert.js +3 -1
  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/Checkbox/Checkbox.js +4 -4
  50. package/legacy/Chip/Chip.js +31 -30
  51. package/legacy/Dialog/Dialog.js +11 -6
  52. package/legacy/FilledInput/FilledInput.js +28 -14
  53. package/legacy/Grid/Grid.js +97 -48
  54. package/legacy/Grow/Grow.js +1 -2
  55. package/legacy/Hidden/withWidth.js +0 -2
  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 +21 -9
  62. package/legacy/Popover/index.js +1 -0
  63. package/legacy/Skeleton/Skeleton.js +2 -2
  64. package/legacy/Slider/Slider.js +35 -20
  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 +6 -0
  75. package/legacy/Tooltip/Tooltip.js +1 -1
  76. package/legacy/index.js +1 -1
  77. package/legacy/styles/CssVarsProvider.js +4 -1
  78. package/legacy/styles/experimental_extendTheme.js +113 -18
  79. package/modern/Alert/Alert.js +3 -1
  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/Checkbox/Checkbox.js +4 -4
  85. package/modern/Chip/Chip.js +31 -30
  86. package/modern/Dialog/Dialog.js +11 -6
  87. package/modern/FilledInput/FilledInput.js +27 -12
  88. package/modern/Grid/Grid.js +94 -40
  89. package/modern/Grow/Grow.js +1 -2
  90. package/modern/Hidden/withWidth.js +0 -2
  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 +25 -10
  97. package/modern/Popover/index.js +1 -0
  98. package/modern/Skeleton/Skeleton.js +7 -2
  99. package/modern/Slider/Slider.js +35 -20
  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 +6 -0
  110. package/modern/Tooltip/Tooltip.js +1 -1
  111. package/modern/index.js +1 -1
  112. package/modern/styles/CssVarsProvider.js +4 -1
  113. package/modern/styles/experimental_extendTheme.js +114 -18
  114. package/node/Alert/Alert.js +3 -1
  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/Checkbox/Checkbox.js +4 -4
  120. package/node/Chip/Chip.js +31 -30
  121. package/node/Dialog/Dialog.js +11 -6
  122. package/node/FilledInput/FilledInput.js +28 -13
  123. package/node/Grid/Grid.js +95 -40
  124. package/node/Grow/Grow.js +1 -2
  125. package/node/Hidden/withWidth.js +0 -3
  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 +25 -10
  132. package/node/Popover/index.js +13 -3
  133. package/node/Skeleton/Skeleton.js +7 -2
  134. package/node/Slider/Slider.js +35 -20
  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 +6 -0
  145. package/node/Tooltip/Tooltip.js +1 -1
  146. package/node/index.js +1 -1
  147. package/node/styles/CssVarsProvider.js +4 -1
  148. package/node/styles/experimental_extendTheme.js +112 -17
  149. package/package.json +6 -7
  150. package/styles/CssVarsProvider.js +4 -1
  151. package/styles/createPalette.d.ts +65 -2
  152. package/styles/experimental_extendTheme.js +114 -18
  153. package/umd/material-ui.development.js +767 -414
  154. package/umd/material-ui.production.min.js +27 -22
@@ -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': {
@@ -284,31 +284,44 @@ const SliderValueLabel = styled(SliderValueLabelUnstyled, {
284
284
  transition: theme.transitions.create(['transform'], {
285
285
  duration: theme.transitions.duration.shortest
286
286
  }),
287
- top: -10,
288
287
  transformOrigin: 'bottom center',
289
288
  transform: 'translateY(-100%) scale(0)',
290
289
  position: 'absolute',
291
- backgroundColor: theme.palette.grey[600],
290
+ backgroundColor: (theme.vars || theme).palette.grey[600],
292
291
  borderRadius: 2,
293
- color: theme.palette.common.white,
292
+ color: (theme.vars || theme).palette.common.white,
294
293
  display: 'flex',
295
294
  alignItems: 'center',
296
295
  justifyContent: 'center',
297
296
  padding: '0.25rem 0.75rem'
298
- }, ownerState.size === 'small' && {
299
- fontSize: theme.typography.pxToRem(12),
300
- padding: '0.25rem 0.5rem'
301
- }, {
297
+ }, ownerState.orientation === 'horizontal' && {
298
+ top: '-10px',
302
299
  '&:before': {
303
300
  position: 'absolute',
304
301
  content: '""',
305
302
  width: 8,
306
303
  height: 8,
304
+ transform: 'translate(-50%, 50%) rotate(45deg)',
305
+ backgroundColor: 'inherit',
307
306
  bottom: 0,
308
- left: '50%',
307
+ left: '50%'
308
+ }
309
+ }, ownerState.orientation === 'vertical' && {
310
+ right: '30px',
311
+ top: '25px',
312
+ '&:before': {
313
+ position: 'absolute',
314
+ content: '""',
315
+ width: 8,
316
+ height: 8,
309
317
  transform: 'translate(-50%, 50%) rotate(45deg)',
310
- backgroundColor: 'inherit'
318
+ backgroundColor: 'inherit',
319
+ right: '-20%',
320
+ top: '25%'
311
321
  }
322
+ }, ownerState.size === 'small' && {
323
+ fontSize: theme.typography.pxToRem(12),
324
+ padding: '0.25rem 0.5rem'
312
325
  }));
313
326
  process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
314
327
  /* remove-proptypes */
@@ -346,7 +359,7 @@ const SliderMark = styled('span', {
346
359
  left: '50%',
347
360
  transform: 'translate(-50%, 1px)'
348
361
  }, markActive && {
349
- backgroundColor: theme.palette.background.paper,
362
+ backgroundColor: (theme.vars || theme).palette.background.paper,
350
363
  opacity: 0.8
351
364
  }));
352
365
  process.env.NODE_ENV !== "production" ? SliderMark.propTypes
@@ -373,7 +386,7 @@ const SliderMarkLabel = styled('span', {
373
386
  ownerState,
374
387
  markLabelActive
375
388
  }) => _extends({}, theme.typography.body2, {
376
- color: theme.palette.text.secondary,
389
+ color: (theme.vars || theme).palette.text.secondary,
377
390
  position: 'absolute',
378
391
  whiteSpace: 'nowrap'
379
392
  }, ownerState.orientation === 'horizontal' && {
@@ -389,7 +402,7 @@ const SliderMarkLabel = styled('span', {
389
402
  left: 44
390
403
  }
391
404
  }, markLabelActive && {
392
- color: theme.palette.text.primary
405
+ color: (theme.vars || theme).palette.text.primary
393
406
  }));
394
407
  process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
395
408
  /* remove-proptypes */
@@ -572,12 +585,14 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
572
585
  thumb: PropTypes.object,
573
586
  track: PropTypes.object,
574
587
  valueLabel: PropTypes.shape({
588
+ children: PropTypes.element,
575
589
  className: PropTypes.string,
576
590
  components: PropTypes.shape({
577
591
  Root: PropTypes.elementType
578
592
  }),
593
+ open: PropTypes.bool,
579
594
  style: PropTypes.object,
580
- value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
595
+ value: PropTypes.number,
581
596
  valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on'])
582
597
  })
583
598
  }),
@@ -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
  }));
@@ -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
  })]
@@ -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,
@@ -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
@@ -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
 
@@ -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/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.8.2
1
+ /** @license MUI v5.8.5
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.
@@ -11,11 +11,14 @@ const {
11
11
  getInitColorSchemeScript
12
12
  } = createCssVarsProvider({
13
13
  theme: defaultTheme,
14
+ attribute: 'data-mui-color-scheme',
15
+ modeStorageKey: 'mui-mode',
16
+ colorSchemeStorageKey: 'mui-color-scheme',
14
17
  defaultColorScheme: {
15
18
  light: 'light',
16
19
  dark: 'dark'
17
20
  },
18
- prefix: 'md',
21
+ prefix: 'mui',
19
22
  resolveTheme: theme => {
20
23
  const newTheme = _extends({}, theme, {
21
24
  typography: createTypography(theme.palette, theme.typography)