@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 @@ var 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 @@ var SliderRoot = styled('span', {
69
69
  }, _defineProperty(_extends2, "&.".concat(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
  }), _defineProperty(_extends2, "&.".concat(sliderClasses.dragging), _defineProperty({}, "& .".concat(sliderClasses.thumb, ", & .").concat(sliderClasses.track), {
74
74
  transition: 'none'
75
75
  })), _extends2));
@@ -163,8 +163,8 @@ var SliderTrack = styled('span', {
163
163
  }, ownerState.track === false && {
164
164
  display: 'none'
165
165
  }, ownerState.track === 'inverted' && {
166
- backgroundColor: color,
167
- borderColor: color
166
+ backgroundColor: theme.vars ? theme.vars.palette.Slider["".concat(ownerState.color, "Track")] : color,
167
+ borderColor: theme.vars ? theme.vars.palette.Slider["".concat(ownerState.color, "Track")] : color
168
168
  });
169
169
  });
170
170
  process.env.NODE_ENV !== "production" ? SliderTrack.propTypes
@@ -223,7 +223,7 @@ var SliderThumb = styled('span', {
223
223
  borderRadius: 'inherit',
224
224
  width: '100%',
225
225
  height: '100%',
226
- boxShadow: theme.shadows[2]
226
+ boxShadow: (theme.vars || theme).shadows[2]
227
227
  }, ownerState.size === 'small' && {
228
228
  boxShadow: 'none'
229
229
  }),
@@ -239,12 +239,12 @@ var SliderThumb = styled('span', {
239
239
  transform: 'translate(-50%, -50%)'
240
240
  }
241
241
  }, _defineProperty(_extends3, "&:hover, &.".concat(sliderClasses.focusVisible), {
242
- boxShadow: "0px 0px 0px 8px ".concat(alpha(theme.palette[ownerState.color].main, 0.16)),
242
+ boxShadow: "0px 0px 0px 8px ".concat(theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.16)") : alpha(theme.palette[ownerState.color].main, 0.16)),
243
243
  '@media (hover: none)': {
244
244
  boxShadow: 'none'
245
245
  }
246
246
  }), _defineProperty(_extends3, "&.".concat(sliderClasses.active), {
247
- boxShadow: "0px 0px 0px 14px ".concat(alpha(theme.palette[ownerState.color].main, 0.16))
247
+ boxShadow: "0px 0px 0px 14px ".concat(theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.16)") : alpha(theme.palette[ownerState.color].main, 0.16))
248
248
  }), _defineProperty(_extends3, "&.".concat(sliderClasses.disabled), {
249
249
  '&:hover': {
250
250
  boxShadow: 'none'
@@ -283,31 +283,44 @@ var SliderValueLabel = styled(SliderValueLabelUnstyled, {
283
283
  transition: theme.transitions.create(['transform'], {
284
284
  duration: theme.transitions.duration.shortest
285
285
  }),
286
- top: -10,
287
286
  transformOrigin: 'bottom center',
288
287
  transform: 'translateY(-100%) scale(0)',
289
288
  position: 'absolute',
290
- backgroundColor: theme.palette.grey[600],
289
+ backgroundColor: (theme.vars || theme).palette.grey[600],
291
290
  borderRadius: 2,
292
- color: theme.palette.common.white,
291
+ color: (theme.vars || theme).palette.common.white,
293
292
  display: 'flex',
294
293
  alignItems: 'center',
295
294
  justifyContent: 'center',
296
295
  padding: '0.25rem 0.75rem'
297
- }, ownerState.size === 'small' && {
298
- fontSize: theme.typography.pxToRem(12),
299
- padding: '0.25rem 0.5rem'
300
- }, {
296
+ }, ownerState.orientation === 'horizontal' && {
297
+ top: '-10px',
301
298
  '&:before': {
302
299
  position: 'absolute',
303
300
  content: '""',
304
301
  width: 8,
305
302
  height: 8,
303
+ transform: 'translate(-50%, 50%) rotate(45deg)',
304
+ backgroundColor: 'inherit',
306
305
  bottom: 0,
307
- left: '50%',
306
+ left: '50%'
307
+ }
308
+ }, ownerState.orientation === 'vertical' && {
309
+ right: '30px',
310
+ top: '25px',
311
+ '&:before': {
312
+ position: 'absolute',
313
+ content: '""',
314
+ width: 8,
315
+ height: 8,
308
316
  transform: 'translate(-50%, 50%) rotate(45deg)',
309
- backgroundColor: 'inherit'
317
+ backgroundColor: 'inherit',
318
+ right: '-20%',
319
+ top: '25%'
310
320
  }
321
+ }, ownerState.size === 'small' && {
322
+ fontSize: theme.typography.pxToRem(12),
323
+ padding: '0.25rem 0.5rem'
311
324
  });
312
325
  });
313
326
  process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
@@ -350,7 +363,7 @@ var SliderMark = styled('span', {
350
363
  left: '50%',
351
364
  transform: 'translate(-50%, 1px)'
352
365
  }, markActive && {
353
- backgroundColor: theme.palette.background.paper,
366
+ backgroundColor: (theme.vars || theme).palette.background.paper,
354
367
  opacity: 0.8
355
368
  });
356
369
  });
@@ -382,7 +395,7 @@ var SliderMarkLabel = styled('span', {
382
395
  ownerState = _ref7.ownerState,
383
396
  markLabelActive = _ref7.markLabelActive;
384
397
  return _extends({}, theme.typography.body2, {
385
- color: theme.palette.text.secondary,
398
+ color: (theme.vars || theme).palette.text.secondary,
386
399
  position: 'absolute',
387
400
  whiteSpace: 'nowrap'
388
401
  }, ownerState.orientation === 'horizontal' && {
@@ -398,7 +411,7 @@ var SliderMarkLabel = styled('span', {
398
411
  left: 44
399
412
  }
400
413
  }, markLabelActive && {
401
- color: theme.palette.text.primary
414
+ color: (theme.vars || theme).palette.text.primary
402
415
  });
403
416
  });
404
417
  process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
@@ -585,12 +598,14 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
585
598
  thumb: PropTypes.object,
586
599
  track: PropTypes.object,
587
600
  valueLabel: PropTypes.shape({
601
+ children: PropTypes.element,
588
602
  className: PropTypes.string,
589
603
  components: PropTypes.shape({
590
604
  Root: PropTypes.elementType
591
605
  }),
606
+ open: PropTypes.bool,
592
607
  style: PropTypes.object,
593
- value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
608
+ value: PropTypes.number,
594
609
  valueLabelDisplay: PropTypes.oneOf(['auto', 'off', 'on'])
595
610
  })
596
611
  }),
@@ -35,17 +35,11 @@ var SnackbarRoot = styled('div', {
35
35
  })(function (_ref) {
36
36
  var theme = _ref.theme,
37
37
  ownerState = _ref.ownerState;
38
-
39
- var center = _extends({}, !ownerState.isRtl && {
38
+ var center = {
40
39
  left: '50%',
41
40
  right: 'auto',
42
41
  transform: 'translateX(-50%)'
43
- }, ownerState.isRtl && {
44
- right: '50%',
45
- left: 'auto',
46
- transform: 'translateX(50%)'
47
- });
48
-
42
+ };
49
43
  return _extends({
50
44
  zIndex: (theme.vars || theme).zIndex.snackbar,
51
45
  position: 'fixed',
@@ -66,19 +60,13 @@ var SnackbarRoot = styled('div', {
66
60
  top: 24
67
61
  } : {
68
62
  bottom: 24
69
- }, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && _extends({}, !ownerState.isRtl && {
63
+ }, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && {
70
64
  left: 24,
71
65
  right: 'auto'
72
- }, ownerState.isRtl && {
73
- right: 24,
74
- left: 'auto'
75
- }), ownerState.anchorOrigin.horizontal === 'right' && _extends({}, !ownerState.isRtl && {
66
+ }, ownerState.anchorOrigin.horizontal === 'right' && {
76
67
  right: 24,
77
68
  left: 'auto'
78
- }, ownerState.isRtl && {
79
- left: 24,
80
- right: 'auto'
81
- }))));
69
+ })));
82
70
  });
83
71
  var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
84
72
  var props = useThemeProps({
@@ -126,14 +114,11 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
126
114
  TransitionProps = _objectWithoutProperties(_props$TransitionProp, ["onEnter", "onExited"]),
127
115
  other = _objectWithoutProperties(props, ["action", "anchorOrigin", "autoHideDuration", "children", "className", "ClickAwayListenerProps", "ContentProps", "disableWindowBlurListener", "message", "onBlur", "onClose", "onFocus", "onMouseEnter", "onMouseLeave", "open", "resumeHideDuration", "TransitionComponent", "transitionDuration", "TransitionProps"]);
128
116
 
129
- var isRtl = theme.direction === 'rtl';
130
-
131
117
  var ownerState = _extends({}, props, {
132
118
  anchorOrigin: {
133
119
  vertical: vertical,
134
120
  horizontal: horizontal
135
- },
136
- isRtl: isRtl
121
+ }
137
122
  });
138
123
 
139
124
  var classes = useUtilityClasses(ownerState);
@@ -34,13 +34,13 @@ var SnackbarContentRoot = styled(Paper, {
34
34
  var emphasis = theme.palette.mode === 'light' ? 0.8 : 0.98;
35
35
  var backgroundColor = emphasize(theme.palette.background.default, emphasis);
36
36
  return _extends({}, theme.typography.body2, _defineProperty({
37
- color: theme.palette.getContrastText(backgroundColor),
38
- backgroundColor: backgroundColor,
37
+ color: theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(backgroundColor),
38
+ backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,
39
39
  display: 'flex',
40
40
  alignItems: 'center',
41
41
  flexWrap: 'wrap',
42
42
  padding: '6px 16px',
43
- borderRadius: theme.shape.borderRadius,
43
+ borderRadius: (theme.vars || theme).shape.borderRadius,
44
44
  flexGrow: 1
45
45
  }, theme.breakpoints.up('sm'), {
46
46
  flexGrow: 'initial',
@@ -41,10 +41,10 @@ var SpeedDialActionFab = styled(Fab, {
41
41
  ownerState = _ref.ownerState;
42
42
  return _extends({
43
43
  margin: 8,
44
- color: theme.palette.text.secondary,
45
- backgroundColor: theme.palette.background.paper,
44
+ color: (theme.vars || theme).palette.text.secondary,
45
+ backgroundColor: (theme.vars || theme).palette.background.paper,
46
46
  '&:hover': {
47
- backgroundColor: emphasize(theme.palette.background.paper, 0.15)
47
+ backgroundColor: theme.vars ? theme.vars.palette.SpeedDialAction.fabHoverBg : emphasize(theme.palette.background.paper, 0.15)
48
48
  },
49
49
  transition: "".concat(theme.transitions.create('transform', {
50
50
  duration: theme.transitions.duration.shorter
@@ -98,10 +98,10 @@ var SpeedDialActionStaticTooltipLabel = styled('span', {
98
98
  return _extends({
99
99
  position: 'absolute'
100
100
  }, theme.typography.body1, {
101
- backgroundColor: theme.palette.background.paper,
102
- borderRadius: theme.shape.borderRadius,
103
- boxShadow: theme.shadows[1],
104
- color: theme.palette.text.secondary,
101
+ backgroundColor: (theme.vars || theme).palette.background.paper,
102
+ borderRadius: (theme.vars || theme).shape.borderRadius,
103
+ boxShadow: (theme.vars || theme).shadows[1],
104
+ color: (theme.vars || theme).palette.text.secondary,
105
105
  padding: '4px 16px',
106
106
  wordBreak: 'keep-all'
107
107
  });
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
3
4
  import _extends from "@babel/runtime/helpers/esm/extends";
4
5
  import * as React from 'react';
5
6
  import PropTypes from 'prop-types';
@@ -61,7 +62,7 @@ export var style = function style(_ref) {
61
62
  if (ownerState.spacing) {
62
63
  var transformer = createUnarySpacing(theme);
63
64
  var base = Object.keys(theme.breakpoints.values).reduce(function (acc, breakpoint) {
64
- if (ownerState.spacing[breakpoint] != null || ownerState.direction[breakpoint] != null) {
65
+ if (_typeof(ownerState.spacing) === 'object' && ownerState.spacing[breakpoint] != null || _typeof(ownerState.direction) === 'object' && ownerState.direction[breakpoint] != null) {
65
66
  acc[breakpoint] = true;
66
67
  }
67
68
 
@@ -57,9 +57,10 @@ var StepConnectorLine = styled('span', {
57
57
  })(function (_ref2) {
58
58
  var ownerState = _ref2.ownerState,
59
59
  theme = _ref2.theme;
60
+ var borderColor = theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600];
60
61
  return _extends({
61
62
  display: 'block',
62
- borderColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
63
+ borderColor: theme.vars ? theme.vars.palette.StepConnector.border : borderColor
63
64
  }, ownerState.orientation === 'horizontal' && {
64
65
  borderTopStyle: 'solid',
65
66
  borderTopWidth: 1
@@ -38,7 +38,7 @@ var StepContentRoot = styled('div', {
38
38
  paddingLeft: 8 + 12,
39
39
  // margin + half icon
40
40
  paddingRight: 8,
41
- borderLeft: "1px solid ".concat(theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600])
41
+ borderLeft: theme.vars ? "1px solid ".concat(theme.vars.palette.StepContent.border) : "1px solid ".concat(theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600])
42
42
  }, ownerState.last && {
43
43
  borderLeft: 'none'
44
44
  });
@@ -124,8 +124,9 @@ var StepIcon = /*#__PURE__*/React.forwardRef(function StepIcon(inProps, ref) {
124
124
  })), /*#__PURE__*/_jsx(StepIconText, {
125
125
  className: classes.text,
126
126
  x: "12",
127
- y: "16",
127
+ y: "12",
128
128
  textAnchor: "middle",
129
+ dominantBaseline: "central",
129
130
  ownerState: ownerState,
130
131
  children: icon
131
132
  })]
@@ -95,18 +95,18 @@ var SwitchSwitchBase = styled(SwitchBase, {
95
95
  left: 0,
96
96
  zIndex: 1,
97
97
  // Render above the focus ripple.
98
- color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300],
98
+ color: theme.vars ? theme.vars.palette.Switch.defaultColor : "".concat(theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]),
99
99
  transition: theme.transitions.create(['left', 'transform'], {
100
100
  duration: theme.transitions.duration.shortest
101
101
  })
102
102
  }, _defineProperty(_ref5, "&.".concat(switchClasses.checked), {
103
103
  transform: 'translateX(20px)'
104
104
  }), _defineProperty(_ref5, "&.".concat(switchClasses.disabled), {
105
- color: theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]
105
+ color: theme.vars ? theme.vars.palette.Switch.defaultDisabledColor : "".concat(theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600])
106
106
  }), _defineProperty(_ref5, "&.".concat(switchClasses.checked, " + .").concat(switchClasses.track), {
107
107
  opacity: 0.5
108
108
  }), _defineProperty(_ref5, "&.".concat(switchClasses.disabled, " + .").concat(switchClasses.track), {
109
- opacity: theme.palette.mode === 'light' ? 0.12 : 0.2
109
+ opacity: theme.vars ? theme.vars.opacity.switchTrackDisabled : "".concat(theme.palette.mode === 'light' ? 0.12 : 0.2)
110
110
  }), _defineProperty(_ref5, "& .".concat(switchClasses.input), {
111
111
  left: '-100%',
112
112
  width: '300%'
@@ -118,24 +118,24 @@ var SwitchSwitchBase = styled(SwitchBase, {
118
118
  ownerState = _ref6.ownerState;
119
119
  return _extends({
120
120
  '&:hover': {
121
- backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
121
+ backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.action.activeChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
122
122
  // Reset on touch devices, it doesn't add specificity
123
123
  '@media (hover: none)': {
124
124
  backgroundColor: 'transparent'
125
125
  }
126
126
  }
127
127
  }, ownerState.color !== 'default' && (_ref7 = {}, _defineProperty(_ref7, "&.".concat(switchClasses.checked), _defineProperty({
128
- color: theme.palette[ownerState.color].main,
128
+ color: (theme.vars || theme).palette[ownerState.color].main,
129
129
  '&:hover': {
130
- backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
130
+ backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
131
131
  '@media (hover: none)': {
132
132
  backgroundColor: 'transparent'
133
133
  }
134
134
  }
135
135
  }, "&.".concat(switchClasses.disabled), {
136
- color: theme.palette.mode === 'light' ? lighten(theme.palette[ownerState.color].main, 0.62) : darken(theme.palette[ownerState.color].main, 0.55)
136
+ color: theme.vars ? theme.vars.palette.Switch["".concat(ownerState.color, "DisabledColor")] : "".concat(theme.palette.mode === 'light' ? lighten(theme.palette[ownerState.color].main, 0.62) : darken(theme.palette[ownerState.color].main, 0.55))
137
137
  })), _defineProperty(_ref7, "&.".concat(switchClasses.checked, " + .").concat(switchClasses.track), {
138
- backgroundColor: theme.palette[ownerState.color].main
138
+ backgroundColor: (theme.vars || theme).palette[ownerState.color].main
139
139
  }), _ref7));
140
140
  });
141
141
  var SwitchTrack = styled('span', {
@@ -154,8 +154,8 @@ var SwitchTrack = styled('span', {
154
154
  transition: theme.transitions.create(['opacity', 'background-color'], {
155
155
  duration: theme.transitions.duration.shortest
156
156
  }),
157
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white,
158
- opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
157
+ backgroundColor: theme.vars ? theme.vars.palette.common.onBackground : "".concat(theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white),
158
+ opacity: theme.vars ? theme.vars.opacity.switchTrack : "".concat(theme.palette.mode === 'light' ? 0.38 : 0.3)
159
159
  };
160
160
  });
161
161
  var SwitchThumb = styled('span', {
@@ -167,7 +167,7 @@ var SwitchThumb = styled('span', {
167
167
  })(function (_ref9) {
168
168
  var theme = _ref9.theme;
169
169
  return {
170
- boxShadow: theme.shadows[1],
170
+ boxShadow: (theme.vars || theme).shadows[1],
171
171
  backgroundColor: 'currentColor',
172
172
  width: 20,
173
173
  height: 20,
@@ -42,17 +42,17 @@ var TableCellRoot = styled('td', {
42
42
  verticalAlign: 'inherit',
43
43
  // Workaround for a rendering bug with spanned columns in Chrome 62.0.
44
44
  // Removes the alpha (sets it to 1), and lightens or darkens the theme color.
45
- borderBottom: "1px solid\n ".concat(theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)),
45
+ borderBottom: theme.vars ? "1px solid ".concat(theme.vars.palette.TableCell.border) : "1px solid\n ".concat(theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)),
46
46
  textAlign: 'left',
47
47
  padding: 16
48
48
  }, ownerState.variant === 'head' && {
49
- color: theme.palette.text.primary,
49
+ color: (theme.vars || theme).palette.text.primary,
50
50
  lineHeight: theme.typography.pxToRem(24),
51
51
  fontWeight: theme.typography.fontWeightMedium
52
52
  }, ownerState.variant === 'body' && {
53
- color: theme.palette.text.primary
53
+ color: (theme.vars || theme).palette.text.primary
54
54
  }, ownerState.variant === 'footer' && {
55
- color: theme.palette.text.secondary,
55
+ color: (theme.vars || theme).palette.text.secondary,
56
56
  lineHeight: theme.typography.pxToRem(21),
57
57
  fontSize: theme.typography.pxToRem(12)
58
58
  }, ownerState.size === 'small' && _defineProperty({
@@ -83,7 +83,7 @@ var TableCellRoot = styled('td', {
83
83
  position: 'sticky',
84
84
  top: 0,
85
85
  zIndex: 2,
86
- backgroundColor: theme.palette.background.default
86
+ backgroundColor: (theme.vars || theme).palette.background.default
87
87
  });
88
88
  });
89
89
  /**
@@ -438,6 +438,12 @@ var Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
438
438
  var tab = children[i];
439
439
 
440
440
  if (totalSize + tab[clientSize] > containerSize) {
441
+ // If the first item is longer than the container size, then only scroll
442
+ // by the container size.
443
+ if (i === 0) {
444
+ totalSize = containerSize;
445
+ }
446
+
441
447
  break;
442
448
  }
443
449
 
@@ -112,7 +112,7 @@ var TooltipTooltip = styled('div', {
112
112
  var theme = _ref3.theme,
113
113
  ownerState = _ref3.ownerState;
114
114
  return _extends({
115
- backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.grey.darkChannel, " / 0.92)") : alpha(theme.palette.grey[700], 0.92),
115
+ backgroundColor: theme.vars ? theme.vars.palette.Tooltip.bg : alpha(theme.palette.grey[700], 0.92),
116
116
  borderRadius: (theme.vars || theme).shape.borderRadius,
117
117
  color: (theme.vars || theme).palette.common.white,
118
118
  fontFamily: theme.typography.fontFamily,
package/legacy/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.
@@ -8,11 +8,14 @@ var defaultTheme = experimental_extendTheme();
8
8
 
9
9
  var _createCssVarsProvide = createCssVarsProvider({
10
10
  theme: defaultTheme,
11
+ attribute: 'data-mui-color-scheme',
12
+ modeStorageKey: 'mui-mode',
13
+ colorSchemeStorageKey: 'mui-color-scheme',
11
14
  defaultColorScheme: {
12
15
  light: 'light',
13
16
  dark: 'dark'
14
17
  },
15
- prefix: 'md',
18
+ prefix: 'mui',
16
19
  resolveTheme: function resolveTheme(theme) {
17
20
  var newTheme = _extends({}, theme, {
18
21
  typography: createTypography(theme.palette, theme.typography)
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
3
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
4
  import { deepmerge } from '@mui/utils';
5
- import { colorChannel } from '@mui/system';
5
+ import { colorChannel, alpha, darken, lighten, emphasize } from '@mui/system';
6
6
  import createThemeWithoutVars from './createTheme';
7
7
  import { getOverlayAlpha } from '../Paper/Paper';
8
8
 
@@ -15,6 +15,18 @@ var defaultDarkOverlays = _toConsumableArray(Array(25)).map(function (_, index)
15
15
  return "linear-gradient(rgba(255 255 255 / ".concat(overlay, "), rgba(255 255 255 / ").concat(overlay, "))");
16
16
  });
17
17
 
18
+ function assignNode(obj, keys) {
19
+ keys.forEach(function (k) {
20
+ if (!obj[k]) {
21
+ obj[k] = {};
22
+ }
23
+ });
24
+ }
25
+
26
+ function setColor(obj, key, defaultValue) {
27
+ obj[key] = obj[key] || defaultValue;
28
+ }
29
+
18
30
  export default function extendTheme() {
19
31
  var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3;
20
32
 
@@ -42,16 +54,20 @@ export default function extendTheme() {
42
54
  light: _extends({}, colorSchemesInput.light, {
43
55
  palette: lightPalette,
44
56
  opacity: _extends({
45
- placeholder: 0.42,
46
- inputTouchBottomLine: 0.42
57
+ inputPlaceholder: 0.42,
58
+ inputTouchBottomLine: 0.42,
59
+ switchTrackDisabled: 0.12,
60
+ switchTrack: 0.38
47
61
  }, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity),
48
62
  overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || []
49
63
  }),
50
64
  dark: _extends({}, colorSchemesInput.dark, {
51
65
  palette: darkPalette,
52
66
  opacity: _extends({
53
- placeholder: 0.5,
54
- inputTouchBottomLine: 0.7
67
+ inputPlaceholder: 0.5,
68
+ inputTouchBottomLine: 0.7,
69
+ switchTrackDisabled: 0.2,
70
+ switchTrack: 0.3
55
71
  }, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
56
72
  overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
57
73
  })
@@ -61,23 +77,98 @@ export default function extendTheme() {
61
77
  Object.keys(theme.colorSchemes).forEach(function (key) {
62
78
  var palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
63
79
 
64
- if (key === 'dark') {
65
- palette.common.background = palette.common.background || '#000';
66
- palette.common.onBackground = palette.common.onBackground || '#fff';
80
+ if (key === 'light') {
81
+ setColor(palette.common, 'background', '#fff');
82
+ setColor(palette.common, 'onBackground', '#000');
83
+ } else {
84
+ setColor(palette.common, 'background', '#000');
85
+ setColor(palette.common, 'onBackground', '#fff');
86
+ } // assign component variables
87
+
88
+
89
+ assignNode(palette, ['AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
90
+
91
+ if (key === 'light') {
92
+ setColor(palette.AppBar, 'defaultBg', 'var(--mui-palette-grey-100)');
93
+ setColor(palette.Avatar, 'defaultBg', 'var(--mui-palette-grey-400)');
94
+ setColor(palette.Chip, 'defaultBorder', 'var(--mui-palette-grey-400)');
95
+ setColor(palette.Chip, 'defaultAvatarColor', 'var(--mui-palette-grey-700)');
96
+ setColor(palette.Chip, 'defaultIconColor', 'var(--mui-palette-grey-700)');
97
+ setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
98
+ setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
99
+ setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
100
+ setColor(palette.LinearProgress, 'primaryBg', lighten(palette.primary.main, 0.62));
101
+ setColor(palette.LinearProgress, 'secondaryBg', lighten(palette.secondary.main, 0.62));
102
+ setColor(palette.LinearProgress, 'errorBg', lighten(palette.error.main, 0.62));
103
+ setColor(palette.LinearProgress, 'infoBg', lighten(palette.info.main, 0.62));
104
+ setColor(palette.LinearProgress, 'successBg', lighten(palette.success.main, 0.62));
105
+ setColor(palette.LinearProgress, 'warningBg', lighten(palette.warning.main, 0.62));
106
+ setColor(palette.Skeleton, 'bg', 'rgba(var(--mui-palette-text-primaryChannel) / 0.11)');
107
+ setColor(palette.Slider, 'primaryTrack', lighten(palette.primary.main, 0.62));
108
+ setColor(palette.Slider, 'secondaryTrack', lighten(palette.secondary.main, 0.62));
109
+ setColor(palette.Slider, 'errorTrack', lighten(palette.error.main, 0.62));
110
+ setColor(palette.Slider, 'infoTrack', lighten(palette.info.main, 0.62));
111
+ setColor(palette.Slider, 'successTrack', lighten(palette.success.main, 0.62));
112
+ setColor(palette.Slider, 'warningTrack', lighten(palette.warning.main, 0.62));
113
+ setColor(palette.SnackbarContent, 'bg', emphasize(palette.background.default, 0.8));
114
+ setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
115
+ setColor(palette.StepConnector, 'border', 'var(--mui-palette-grey-400)');
116
+ setColor(palette.StepContent, 'border', 'var(--mui-palette-grey-400)');
117
+ setColor(palette.Switch, 'defaultColor', 'var(--mui-palette-common-white)');
118
+ setColor(palette.Switch, 'defaultDisabledColor', 'var(--mui-palette-grey-100)');
119
+ setColor(palette.Switch, 'primaryDisabledColor', lighten(palette.primary.main, 0.62));
120
+ setColor(palette.Switch, 'secondaryDisabledColor', lighten(palette.secondary.main, 0.62));
121
+ setColor(palette.Switch, 'errorDisabledColor', lighten(palette.error.main, 0.62));
122
+ setColor(palette.Switch, 'infoDisabledColor', lighten(palette.info.main, 0.62));
123
+ setColor(palette.Switch, 'successDisabledColor', lighten(palette.success.main, 0.62));
124
+ setColor(palette.Switch, 'warningDisabledColor', lighten(palette.warning.main, 0.62));
125
+ setColor(palette.TableCell, 'border', lighten(alpha(palette.divider, 1), 0.88));
126
+ setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
67
127
  } else {
68
- palette.common.background = palette.common.background || '#fff';
69
- palette.common.onBackground = palette.common.onBackground || '#000';
128
+ setColor(palette.AppBar, 'defaultBg', 'var(--mui-palette-grey-900)');
129
+ setColor(palette.AppBar, 'darkBg', 'var(--mui-palette-background-paper)'); // specific for dark mode
130
+
131
+ setColor(palette.AppBar, 'darkColor', 'var(--mui-palette-text-primary)'); // specific for dark mode
132
+
133
+ setColor(palette.Avatar, 'defaultBg', 'var(--mui-palette-grey-600)');
134
+ setColor(palette.Chip, 'defaultBorder', 'var(--mui-palette-grey-700)');
135
+ setColor(palette.Chip, 'defaultAvatarColor', 'var(--mui-palette-grey-300)');
136
+ setColor(palette.Chip, 'defaultIconColor', 'var(--mui-palette-grey-300)');
137
+ setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
138
+ setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
139
+ setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
140
+ setColor(palette.LinearProgress, 'primaryBg', darken(palette.primary.main, 0.5));
141
+ setColor(palette.LinearProgress, 'secondaryBg', darken(palette.secondary.main, 0.5));
142
+ setColor(palette.LinearProgress, 'errorBg', darken(palette.error.main, 0.5));
143
+ setColor(palette.LinearProgress, 'infoBg', darken(palette.info.main, 0.5));
144
+ setColor(palette.LinearProgress, 'successBg', darken(palette.success.main, 0.5));
145
+ setColor(palette.LinearProgress, 'warningBg', darken(palette.warning.main, 0.5));
146
+ setColor(palette.Skeleton, 'bg', 'rgba(var(--mui-palette-text-primaryChannel) / 0.13)');
147
+ setColor(palette.Slider, 'primaryTrack', darken(palette.primary.main, 0.5));
148
+ setColor(palette.Slider, 'secondaryTrack', darken(palette.secondary.main, 0.5));
149
+ setColor(palette.Slider, 'errorTrack', darken(palette.error.main, 0.5));
150
+ setColor(palette.Slider, 'infoTrack', darken(palette.info.main, 0.5));
151
+ setColor(palette.Slider, 'successTrack', darken(palette.success.main, 0.5));
152
+ setColor(palette.Slider, 'warningTrack', darken(palette.warning.main, 0.5));
153
+ setColor(palette.SnackbarContent, 'bg', emphasize(palette.background.default, 0.98));
154
+ setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
155
+ setColor(palette.StepConnector, 'border', 'var(--mui-palette-grey-600)');
156
+ setColor(palette.StepContent, 'border', 'var(--mui-palette-grey-600)');
157
+ setColor(palette.Switch, 'defaultColor', 'var(--mui-palette-grey-300)');
158
+ setColor(palette.Switch, 'defaultDisabledColor', 'var(--mui-palette-grey-600)');
159
+ setColor(palette.Switch, 'primaryDisabledColor', darken(palette.primary.main, 0.55));
160
+ setColor(palette.Switch, 'secondaryDisabledColor', darken(palette.secondary.main, 0.55));
161
+ setColor(palette.Switch, 'errorDisabledColor', darken(palette.error.main, 0.55));
162
+ setColor(palette.Switch, 'infoDisabledColor', darken(palette.info.main, 0.55));
163
+ setColor(palette.Switch, 'successDisabledColor', darken(palette.success.main, 0.55));
164
+ setColor(palette.Switch, 'warningDisabledColor', darken(palette.warning.main, 0.55));
165
+ setColor(palette.TableCell, 'border', darken(alpha(palette.divider, 1), 0.68));
166
+ setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
70
167
  }
71
168
 
72
169
  palette.common.backgroundChannel = colorChannel(palette.common.background);
73
170
  palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
74
- palette.dividerChannel = colorChannel(palette.divider); // special token for Tooltip
75
- // TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
76
-
77
- if (!palette.grey.dark) {
78
- palette.grey.dark = palette.grey[700];
79
- }
80
-
171
+ palette.dividerChannel = colorChannel(palette.divider);
81
172
  Object.keys(palette).forEach(function (color) {
82
173
  var colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
83
174
 
@@ -104,12 +195,16 @@ export default function extendTheme() {
104
195
 
105
196
  if (colors.secondary) {
106
197
  palette[color].secondaryChannel = colorChannel(colors.secondary);
107
- } // Action colors: action.activeChannel
198
+ } // Action colors: action.active, action.selected
108
199
 
109
200
 
110
201
  if (colors.active) {
111
202
  palette[color].activeChannel = colorChannel(colors.active);
112
203
  }
204
+
205
+ if (colors.selected) {
206
+ palette[color].selectedChannel = colorChannel(colors.selected);
207
+ }
113
208
  });
114
209
  });
115
210