@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.
- package/Alert/Alert.js +3 -1
- package/AppBar/AppBar.js +22 -5
- package/Autocomplete/autocompleteClasses.d.ts +1 -1
- package/Avatar/Avatar.js +7 -4
- package/Badge/Badge.js +2 -2
- package/Button/buttonClasses.d.ts +24 -0
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +225 -8
- package/Checkbox/Checkbox.js +4 -4
- package/Chip/Chip.js +31 -30
- package/Dialog/Dialog.js +11 -6
- package/FilledInput/FilledInput.js +28 -13
- package/Grid/Grid.d.ts +73 -52
- package/Grid/Grid.js +94 -40
- package/Grow/Grow.js +1 -2
- package/Hidden/withWidth.js +0 -2
- package/InputBase/InputBase.js +2 -2
- package/LinearProgress/LinearProgress.js +6 -2
- package/Link/Link.js +10 -17
- package/Link/getTextDecoration.d.ts +15 -0
- package/Link/getTextDecoration.js +29 -0
- package/Modal/Modal.d.ts +2 -0
- package/Modal/Modal.js +25 -8
- package/OutlinedInput/OutlinedInput.js +25 -10
- package/Popover/Popover.d.ts +7 -0
- package/Popover/index.js +1 -0
- package/README.md +13 -12
- package/Skeleton/Skeleton.js +8 -3
- package/Slider/Slider.d.ts +3 -1
- package/Slider/Slider.js +35 -20
- package/Snackbar/Snackbar.js +6 -20
- package/SnackbarContent/SnackbarContent.js +3 -3
- package/SpeedDialAction/SpeedDialAction.js +7 -7
- package/Stack/Stack.js +1 -1
- package/StepConnector/StepConnector.js +14 -11
- package/StepContent/StepContent.js +1 -1
- package/StepIcon/StepIcon.js +2 -1
- package/Switch/Switch.js +11 -11
- package/Tab/Tab.d.ts +0 -1
- package/TableCell/TableCell.js +5 -5
- package/Tabs/Tabs.js +6 -0
- package/Tooltip/Tooltip.js +1 -1
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +3 -1
- package/legacy/AppBar/AppBar.js +23 -4
- package/legacy/Avatar/Avatar.js +7 -4
- package/legacy/Badge/Badge.js +2 -2
- package/legacy/Button/buttonClasses.js +1 -1
- package/legacy/Checkbox/Checkbox.js +4 -4
- package/legacy/Chip/Chip.js +31 -30
- package/legacy/Dialog/Dialog.js +11 -6
- package/legacy/FilledInput/FilledInput.js +28 -14
- package/legacy/Grid/Grid.js +97 -48
- package/legacy/Grow/Grow.js +1 -2
- package/legacy/Hidden/withWidth.js +0 -2
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/LinearProgress/LinearProgress.js +6 -2
- package/legacy/Link/Link.js +10 -17
- package/legacy/Link/getTextDecoration.js +28 -0
- package/legacy/Modal/Modal.js +23 -7
- package/legacy/OutlinedInput/OutlinedInput.js +21 -9
- package/legacy/Popover/index.js +1 -0
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Slider/Slider.js +35 -20
- package/legacy/Snackbar/Snackbar.js +6 -21
- package/legacy/SnackbarContent/SnackbarContent.js +3 -3
- package/legacy/SpeedDialAction/SpeedDialAction.js +7 -7
- package/legacy/Stack/Stack.js +2 -1
- package/legacy/StepConnector/StepConnector.js +2 -1
- package/legacy/StepContent/StepContent.js +1 -1
- package/legacy/StepIcon/StepIcon.js +2 -1
- package/legacy/Switch/Switch.js +11 -11
- package/legacy/TableCell/TableCell.js +5 -5
- package/legacy/Tabs/Tabs.js +6 -0
- package/legacy/Tooltip/Tooltip.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +4 -1
- package/legacy/styles/experimental_extendTheme.js +113 -18
- package/modern/Alert/Alert.js +3 -1
- package/modern/AppBar/AppBar.js +22 -5
- package/modern/Avatar/Avatar.js +7 -4
- package/modern/Badge/Badge.js +2 -2
- package/modern/Button/buttonClasses.js +1 -1
- package/modern/Checkbox/Checkbox.js +4 -4
- package/modern/Chip/Chip.js +31 -30
- package/modern/Dialog/Dialog.js +11 -6
- package/modern/FilledInput/FilledInput.js +27 -12
- package/modern/Grid/Grid.js +94 -40
- package/modern/Grow/Grow.js +1 -2
- package/modern/Hidden/withWidth.js +0 -2
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/LinearProgress/LinearProgress.js +6 -2
- package/modern/Link/Link.js +10 -17
- package/modern/Link/getTextDecoration.js +29 -0
- package/modern/Modal/Modal.js +24 -7
- package/modern/OutlinedInput/OutlinedInput.js +25 -10
- package/modern/Popover/index.js +1 -0
- package/modern/Skeleton/Skeleton.js +7 -2
- package/modern/Slider/Slider.js +35 -20
- package/modern/Snackbar/Snackbar.js +6 -20
- package/modern/SnackbarContent/SnackbarContent.js +3 -3
- package/modern/SpeedDialAction/SpeedDialAction.js +7 -7
- package/modern/Stack/Stack.js +1 -1
- package/modern/StepConnector/StepConnector.js +14 -11
- package/modern/StepContent/StepContent.js +1 -1
- package/modern/StepIcon/StepIcon.js +2 -1
- package/modern/Switch/Switch.js +11 -11
- package/modern/TableCell/TableCell.js +5 -5
- package/modern/Tabs/Tabs.js +6 -0
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +4 -1
- package/modern/styles/experimental_extendTheme.js +114 -18
- package/node/Alert/Alert.js +3 -1
- package/node/AppBar/AppBar.js +22 -5
- package/node/Avatar/Avatar.js +7 -4
- package/node/Badge/Badge.js +2 -2
- package/node/Button/buttonClasses.js +1 -1
- package/node/Checkbox/Checkbox.js +4 -4
- package/node/Chip/Chip.js +31 -30
- package/node/Dialog/Dialog.js +11 -6
- package/node/FilledInput/FilledInput.js +28 -13
- package/node/Grid/Grid.js +95 -40
- package/node/Grow/Grow.js +1 -2
- package/node/Hidden/withWidth.js +0 -3
- package/node/InputBase/InputBase.js +2 -2
- package/node/LinearProgress/LinearProgress.js +6 -2
- package/node/Link/Link.js +12 -20
- package/node/Link/getTextDecoration.js +39 -0
- package/node/Modal/Modal.js +25 -8
- package/node/OutlinedInput/OutlinedInput.js +25 -10
- package/node/Popover/index.js +13 -3
- package/node/Skeleton/Skeleton.js +7 -2
- package/node/Slider/Slider.js +35 -20
- package/node/Snackbar/Snackbar.js +6 -18
- package/node/SnackbarContent/SnackbarContent.js +3 -3
- package/node/SpeedDialAction/SpeedDialAction.js +7 -7
- package/node/Stack/Stack.js +1 -1
- package/node/StepConnector/StepConnector.js +14 -11
- package/node/StepContent/StepContent.js +1 -1
- package/node/StepIcon/StepIcon.js +2 -1
- package/node/Switch/Switch.js +11 -11
- package/node/TableCell/TableCell.js +5 -5
- package/node/Tabs/Tabs.js +6 -0
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +4 -1
- package/node/styles/experimental_extendTheme.js +112 -17
- package/package.json +6 -7
- package/styles/CssVarsProvider.js +4 -1
- package/styles/createPalette.d.ts +65 -2
- package/styles/experimental_extendTheme.js +114 -18
- package/umd/material-ui.development.js +767 -414
- package/umd/material-ui.production.min.js +27 -22
package/node/Slider/Slider.js
CHANGED
|
@@ -64,7 +64,7 @@ const SliderRoot = (0, _styled.default)('span', {
|
|
|
64
64
|
position: 'relative',
|
|
65
65
|
cursor: 'pointer',
|
|
66
66
|
touchAction: 'none',
|
|
67
|
-
color: theme.palette[ownerState.color].main,
|
|
67
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
68
68
|
WebkitTapHighlightColor: 'transparent'
|
|
69
69
|
}, ownerState.orientation === 'horizontal' && (0, _extends2.default)({
|
|
70
70
|
height: 4,
|
|
@@ -99,7 +99,7 @@ const SliderRoot = (0, _styled.default)('span', {
|
|
|
99
99
|
[`&.${sliderClasses.disabled}`]: {
|
|
100
100
|
pointerEvents: 'none',
|
|
101
101
|
cursor: 'default',
|
|
102
|
-
color: theme.palette.grey[400]
|
|
102
|
+
color: (theme.vars || theme).palette.grey[400]
|
|
103
103
|
},
|
|
104
104
|
[`&.${sliderClasses.dragging}`]: {
|
|
105
105
|
[`& .${sliderClasses.thumb}, & .${sliderClasses.track}`]: {
|
|
@@ -192,8 +192,8 @@ const SliderTrack = (0, _styled.default)('span', {
|
|
|
192
192
|
}, ownerState.track === false && {
|
|
193
193
|
display: 'none'
|
|
194
194
|
}, ownerState.track === 'inverted' && {
|
|
195
|
-
backgroundColor: color,
|
|
196
|
-
borderColor: color
|
|
195
|
+
backgroundColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color,
|
|
196
|
+
borderColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
exports.SliderTrack = SliderTrack;
|
|
@@ -252,7 +252,7 @@ const SliderThumb = (0, _styled.default)('span', {
|
|
|
252
252
|
borderRadius: 'inherit',
|
|
253
253
|
width: '100%',
|
|
254
254
|
height: '100%',
|
|
255
|
-
boxShadow: theme.shadows[2]
|
|
255
|
+
boxShadow: (theme.vars || theme).shadows[2]
|
|
256
256
|
}, ownerState.size === 'small' && {
|
|
257
257
|
boxShadow: 'none'
|
|
258
258
|
}),
|
|
@@ -268,13 +268,13 @@ const SliderThumb = (0, _styled.default)('span', {
|
|
|
268
268
|
transform: 'translate(-50%, -50%)'
|
|
269
269
|
},
|
|
270
270
|
[`&:hover, &.${sliderClasses.focusVisible}`]: {
|
|
271
|
-
boxShadow: `0px 0px 0px 8px ${(0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`,
|
|
271
|
+
boxShadow: `0px 0px 0px 8px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`,
|
|
272
272
|
'@media (hover: none)': {
|
|
273
273
|
boxShadow: 'none'
|
|
274
274
|
}
|
|
275
275
|
},
|
|
276
276
|
[`&.${sliderClasses.active}`]: {
|
|
277
|
-
boxShadow: `0px 0px 0px 14px ${(0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`
|
|
277
|
+
boxShadow: `0px 0px 0px 14px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`
|
|
278
278
|
},
|
|
279
279
|
[`&.${sliderClasses.disabled}`]: {
|
|
280
280
|
'&:hover': {
|
|
@@ -314,31 +314,44 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
314
314
|
transition: theme.transitions.create(['transform'], {
|
|
315
315
|
duration: theme.transitions.duration.shortest
|
|
316
316
|
}),
|
|
317
|
-
top: -10,
|
|
318
317
|
transformOrigin: 'bottom center',
|
|
319
318
|
transform: 'translateY(-100%) scale(0)',
|
|
320
319
|
position: 'absolute',
|
|
321
|
-
backgroundColor: theme.palette.grey[600],
|
|
320
|
+
backgroundColor: (theme.vars || theme).palette.grey[600],
|
|
322
321
|
borderRadius: 2,
|
|
323
|
-
color: theme.palette.common.white,
|
|
322
|
+
color: (theme.vars || theme).palette.common.white,
|
|
324
323
|
display: 'flex',
|
|
325
324
|
alignItems: 'center',
|
|
326
325
|
justifyContent: 'center',
|
|
327
326
|
padding: '0.25rem 0.75rem'
|
|
328
|
-
}, ownerState.
|
|
329
|
-
|
|
330
|
-
padding: '0.25rem 0.5rem'
|
|
331
|
-
}, {
|
|
327
|
+
}, ownerState.orientation === 'horizontal' && {
|
|
328
|
+
top: '-10px',
|
|
332
329
|
'&:before': {
|
|
333
330
|
position: 'absolute',
|
|
334
331
|
content: '""',
|
|
335
332
|
width: 8,
|
|
336
333
|
height: 8,
|
|
334
|
+
transform: 'translate(-50%, 50%) rotate(45deg)',
|
|
335
|
+
backgroundColor: 'inherit',
|
|
337
336
|
bottom: 0,
|
|
338
|
-
left: '50%'
|
|
337
|
+
left: '50%'
|
|
338
|
+
}
|
|
339
|
+
}, ownerState.orientation === 'vertical' && {
|
|
340
|
+
right: '30px',
|
|
341
|
+
top: '25px',
|
|
342
|
+
'&:before': {
|
|
343
|
+
position: 'absolute',
|
|
344
|
+
content: '""',
|
|
345
|
+
width: 8,
|
|
346
|
+
height: 8,
|
|
339
347
|
transform: 'translate(-50%, 50%) rotate(45deg)',
|
|
340
|
-
backgroundColor: 'inherit'
|
|
348
|
+
backgroundColor: 'inherit',
|
|
349
|
+
right: '-20%',
|
|
350
|
+
top: '25%'
|
|
341
351
|
}
|
|
352
|
+
}, ownerState.size === 'small' && {
|
|
353
|
+
fontSize: theme.typography.pxToRem(12),
|
|
354
|
+
padding: '0.25rem 0.5rem'
|
|
342
355
|
}));
|
|
343
356
|
exports.SliderValueLabel = SliderValueLabel;
|
|
344
357
|
process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes
|
|
@@ -376,7 +389,7 @@ const SliderMark = (0, _styled.default)('span', {
|
|
|
376
389
|
left: '50%',
|
|
377
390
|
transform: 'translate(-50%, 1px)'
|
|
378
391
|
}, markActive && {
|
|
379
|
-
backgroundColor: theme.palette.background.paper,
|
|
392
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
380
393
|
opacity: 0.8
|
|
381
394
|
}));
|
|
382
395
|
exports.SliderMark = SliderMark;
|
|
@@ -403,7 +416,7 @@ const SliderMarkLabel = (0, _styled.default)('span', {
|
|
|
403
416
|
ownerState,
|
|
404
417
|
markLabelActive
|
|
405
418
|
}) => (0, _extends2.default)({}, theme.typography.body2, {
|
|
406
|
-
color: theme.palette.text.secondary,
|
|
419
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
407
420
|
position: 'absolute',
|
|
408
421
|
whiteSpace: 'nowrap'
|
|
409
422
|
}, ownerState.orientation === 'horizontal' && {
|
|
@@ -419,7 +432,7 @@ const SliderMarkLabel = (0, _styled.default)('span', {
|
|
|
419
432
|
left: 44
|
|
420
433
|
}
|
|
421
434
|
}, markLabelActive && {
|
|
422
|
-
color: theme.palette.text.primary
|
|
435
|
+
color: (theme.vars || theme).palette.text.primary
|
|
423
436
|
}));
|
|
424
437
|
exports.SliderMarkLabel = SliderMarkLabel;
|
|
425
438
|
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
|
|
@@ -601,12 +614,14 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
601
614
|
thumb: _propTypes.default.object,
|
|
602
615
|
track: _propTypes.default.object,
|
|
603
616
|
valueLabel: _propTypes.default.shape({
|
|
617
|
+
children: _propTypes.default.element,
|
|
604
618
|
className: _propTypes.default.string,
|
|
605
619
|
components: _propTypes.default.shape({
|
|
606
620
|
Root: _propTypes.default.elementType
|
|
607
621
|
}),
|
|
622
|
+
open: _propTypes.default.bool,
|
|
608
623
|
style: _propTypes.default.object,
|
|
609
|
-
value: _propTypes.default.
|
|
624
|
+
value: _propTypes.default.number,
|
|
610
625
|
valueLabelDisplay: _propTypes.default.oneOf(['auto', 'off', 'on'])
|
|
611
626
|
})
|
|
612
627
|
}),
|
|
@@ -70,15 +70,11 @@ const SnackbarRoot = (0, _styled.default)('div', {
|
|
|
70
70
|
theme,
|
|
71
71
|
ownerState
|
|
72
72
|
}) => {
|
|
73
|
-
const center =
|
|
73
|
+
const center = {
|
|
74
74
|
left: '50%',
|
|
75
75
|
right: 'auto',
|
|
76
76
|
transform: 'translateX(-50%)'
|
|
77
|
-
}
|
|
78
|
-
right: '50%',
|
|
79
|
-
left: 'auto',
|
|
80
|
-
transform: 'translateX(50%)'
|
|
81
|
-
});
|
|
77
|
+
};
|
|
82
78
|
return (0, _extends2.default)({
|
|
83
79
|
zIndex: (theme.vars || theme).zIndex.snackbar,
|
|
84
80
|
position: 'fixed',
|
|
@@ -100,19 +96,13 @@ const SnackbarRoot = (0, _styled.default)('div', {
|
|
|
100
96
|
top: 24
|
|
101
97
|
} : {
|
|
102
98
|
bottom: 24
|
|
103
|
-
}, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' &&
|
|
99
|
+
}, ownerState.anchorOrigin.horizontal === 'center' && center, ownerState.anchorOrigin.horizontal === 'left' && {
|
|
104
100
|
left: 24,
|
|
105
101
|
right: 'auto'
|
|
106
|
-
}, ownerState.
|
|
102
|
+
}, ownerState.anchorOrigin.horizontal === 'right' && {
|
|
107
103
|
right: 24,
|
|
108
104
|
left: 'auto'
|
|
109
|
-
})
|
|
110
|
-
right: 24,
|
|
111
|
-
left: 'auto'
|
|
112
|
-
}, ownerState.isRtl && {
|
|
113
|
-
left: 24,
|
|
114
|
-
right: 'auto'
|
|
115
|
-
}))
|
|
105
|
+
})
|
|
116
106
|
});
|
|
117
107
|
});
|
|
118
108
|
const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
@@ -157,13 +147,11 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
157
147
|
} = props,
|
|
158
148
|
TransitionProps = (0, _objectWithoutPropertiesLoose2.default)(props.TransitionProps, _excluded),
|
|
159
149
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
160
|
-
const isRtl = theme.direction === 'rtl';
|
|
161
150
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
162
151
|
anchorOrigin: {
|
|
163
152
|
vertical,
|
|
164
153
|
horizontal
|
|
165
|
-
}
|
|
166
|
-
isRtl
|
|
154
|
+
}
|
|
167
155
|
});
|
|
168
156
|
const classes = useUtilityClasses(ownerState);
|
|
169
157
|
const timerAutoHide = React.useRef();
|
|
@@ -59,13 +59,13 @@ const SnackbarContentRoot = (0, _styled.default)(_Paper.default, {
|
|
|
59
59
|
const emphasis = theme.palette.mode === 'light' ? 0.8 : 0.98;
|
|
60
60
|
const backgroundColor = (0, _system.emphasize)(theme.palette.background.default, emphasis);
|
|
61
61
|
return (0, _extends2.default)({}, theme.typography.body2, {
|
|
62
|
-
color: theme.palette.getContrastText(backgroundColor),
|
|
63
|
-
backgroundColor,
|
|
62
|
+
color: theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(backgroundColor),
|
|
63
|
+
backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,
|
|
64
64
|
display: 'flex',
|
|
65
65
|
alignItems: 'center',
|
|
66
66
|
flexWrap: 'wrap',
|
|
67
67
|
padding: '6px 16px',
|
|
68
|
-
borderRadius: theme.shape.borderRadius,
|
|
68
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
69
69
|
flexGrow: 1,
|
|
70
70
|
[theme.breakpoints.up('sm')]: {
|
|
71
71
|
flexGrow: 'initial',
|
|
@@ -70,10 +70,10 @@ const SpeedDialActionFab = (0, _styled.default)(_Fab.default, {
|
|
|
70
70
|
ownerState
|
|
71
71
|
}) => (0, _extends2.default)({
|
|
72
72
|
margin: 8,
|
|
73
|
-
color: theme.palette.text.secondary,
|
|
74
|
-
backgroundColor: theme.palette.background.paper,
|
|
73
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
74
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
75
75
|
'&:hover': {
|
|
76
|
-
backgroundColor: (0, _system.emphasize)(theme.palette.background.paper, 0.15)
|
|
76
|
+
backgroundColor: theme.vars ? theme.vars.palette.SpeedDialAction.fabHoverBg : (0, _system.emphasize)(theme.palette.background.paper, 0.15)
|
|
77
77
|
},
|
|
78
78
|
transition: `${theme.transitions.create('transform', {
|
|
79
79
|
duration: theme.transitions.duration.shorter
|
|
@@ -126,10 +126,10 @@ const SpeedDialActionStaticTooltipLabel = (0, _styled.default)('span', {
|
|
|
126
126
|
}) => (0, _extends2.default)({
|
|
127
127
|
position: 'absolute'
|
|
128
128
|
}, theme.typography.body1, {
|
|
129
|
-
backgroundColor: theme.palette.background.paper,
|
|
130
|
-
borderRadius: theme.shape.borderRadius,
|
|
131
|
-
boxShadow: theme.shadows[1],
|
|
132
|
-
color: theme.palette.text.secondary,
|
|
129
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
130
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
131
|
+
boxShadow: (theme.vars || theme).shadows[1],
|
|
132
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
133
133
|
padding: '4px 16px',
|
|
134
134
|
wordBreak: 'keep-all'
|
|
135
135
|
}));
|
package/node/Stack/Stack.js
CHANGED
|
@@ -80,7 +80,7 @@ const style = ({
|
|
|
80
80
|
if (ownerState.spacing) {
|
|
81
81
|
const transformer = (0, _system.createUnarySpacing)(theme);
|
|
82
82
|
const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
|
|
83
|
-
if (ownerState.spacing[breakpoint] != null || ownerState.direction[breakpoint] != null) {
|
|
83
|
+
if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
|
|
84
84
|
acc[breakpoint] = true;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -89,17 +89,20 @@ const StepConnectorLine = (0, _styled.default)('span', {
|
|
|
89
89
|
})(({
|
|
90
90
|
ownerState,
|
|
91
91
|
theme
|
|
92
|
-
}) =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
}) => {
|
|
93
|
+
const borderColor = theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600];
|
|
94
|
+
return (0, _extends2.default)({
|
|
95
|
+
display: 'block',
|
|
96
|
+
borderColor: theme.vars ? theme.vars.palette.StepConnector.border : borderColor
|
|
97
|
+
}, ownerState.orientation === 'horizontal' && {
|
|
98
|
+
borderTopStyle: 'solid',
|
|
99
|
+
borderTopWidth: 1
|
|
100
|
+
}, ownerState.orientation === 'vertical' && {
|
|
101
|
+
borderLeftStyle: 'solid',
|
|
102
|
+
borderLeftWidth: 1,
|
|
103
|
+
minHeight: 24
|
|
104
|
+
});
|
|
105
|
+
});
|
|
103
106
|
const StepConnector = /*#__PURE__*/React.forwardRef(function StepConnector(inProps, ref) {
|
|
104
107
|
const props = (0, _useThemeProps.default)({
|
|
105
108
|
props: inProps,
|
|
@@ -69,7 +69,7 @@ const StepContentRoot = (0, _styled.default)('div', {
|
|
|
69
69
|
paddingLeft: 8 + 12,
|
|
70
70
|
// margin + half icon
|
|
71
71
|
paddingRight: 8,
|
|
72
|
-
borderLeft: `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
|
|
72
|
+
borderLeft: theme.vars ? `1px solid ${theme.vars.palette.StepContent.border}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
|
|
73
73
|
}, ownerState.last && {
|
|
74
74
|
borderLeft: 'none'
|
|
75
75
|
}));
|
|
@@ -141,8 +141,9 @@ const StepIcon = /*#__PURE__*/React.forwardRef(function StepIcon(inProps, ref) {
|
|
|
141
141
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(StepIconText, {
|
|
142
142
|
className: classes.text,
|
|
143
143
|
x: "12",
|
|
144
|
-
y: "
|
|
144
|
+
y: "12",
|
|
145
145
|
textAnchor: "middle",
|
|
146
|
+
dominantBaseline: "central",
|
|
146
147
|
ownerState: ownerState,
|
|
147
148
|
children: icon
|
|
148
149
|
})]
|
package/node/Switch/Switch.js
CHANGED
|
@@ -126,7 +126,7 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
126
126
|
left: 0,
|
|
127
127
|
zIndex: 1,
|
|
128
128
|
// Render above the focus ripple.
|
|
129
|
-
color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]
|
|
129
|
+
color: theme.vars ? theme.vars.palette.Switch.defaultColor : `${theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]}`,
|
|
130
130
|
transition: theme.transitions.create(['left', 'transform'], {
|
|
131
131
|
duration: theme.transitions.duration.shortest
|
|
132
132
|
}),
|
|
@@ -134,13 +134,13 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
134
134
|
transform: 'translateX(20px)'
|
|
135
135
|
},
|
|
136
136
|
[`&.${_switchClasses.default.disabled}`]: {
|
|
137
|
-
color: theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]
|
|
137
|
+
color: theme.vars ? theme.vars.palette.Switch.defaultDisabledColor : `${theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]}`
|
|
138
138
|
},
|
|
139
139
|
[`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
|
|
140
140
|
opacity: 0.5
|
|
141
141
|
},
|
|
142
142
|
[`&.${_switchClasses.default.disabled} + .${_switchClasses.default.track}`]: {
|
|
143
|
-
opacity: theme.palette.mode === 'light' ? 0.12 : 0.2
|
|
143
|
+
opacity: theme.vars ? theme.vars.opacity.switchTrackDisabled : `${theme.palette.mode === 'light' ? 0.12 : 0.2}`
|
|
144
144
|
},
|
|
145
145
|
[`& .${_switchClasses.default.input}`]: {
|
|
146
146
|
left: '-100%',
|
|
@@ -151,7 +151,7 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
151
151
|
ownerState
|
|
152
152
|
}) => (0, _extends2.default)({
|
|
153
153
|
'&:hover': {
|
|
154
|
-
backgroundColor: (0, _system.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
154
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
155
155
|
// Reset on touch devices, it doesn't add specificity
|
|
156
156
|
'@media (hover: none)': {
|
|
157
157
|
backgroundColor: 'transparent'
|
|
@@ -159,19 +159,19 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
159
159
|
}
|
|
160
160
|
}, ownerState.color !== 'default' && {
|
|
161
161
|
[`&.${_switchClasses.default.checked}`]: {
|
|
162
|
-
color: theme.palette[ownerState.color].main,
|
|
162
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
163
163
|
'&:hover': {
|
|
164
|
-
backgroundColor: (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
164
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
165
165
|
'@media (hover: none)': {
|
|
166
166
|
backgroundColor: 'transparent'
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
[`&.${_switchClasses.default.disabled}`]: {
|
|
170
|
-
color: theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[ownerState.color].main, 0.62) : (0, _system.darken)(theme.palette[ownerState.color].main, 0.55)
|
|
170
|
+
color: theme.vars ? theme.vars.palette.Switch[`${ownerState.color}DisabledColor`] : `${theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[ownerState.color].main, 0.62) : (0, _system.darken)(theme.palette[ownerState.color].main, 0.55)}`
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
[`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
|
|
174
|
-
backgroundColor: theme.palette[ownerState.color].main
|
|
174
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
175
175
|
}
|
|
176
176
|
}));
|
|
177
177
|
const SwitchTrack = (0, _styled.default)('span', {
|
|
@@ -188,8 +188,8 @@ const SwitchTrack = (0, _styled.default)('span', {
|
|
|
188
188
|
transition: theme.transitions.create(['opacity', 'background-color'], {
|
|
189
189
|
duration: theme.transitions.duration.shortest
|
|
190
190
|
}),
|
|
191
|
-
backgroundColor: theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white
|
|
192
|
-
opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
|
|
191
|
+
backgroundColor: theme.vars ? theme.vars.palette.common.onBackground : `${theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white}`,
|
|
192
|
+
opacity: theme.vars ? theme.vars.opacity.switchTrack : `${theme.palette.mode === 'light' ? 0.38 : 0.3}`
|
|
193
193
|
}));
|
|
194
194
|
const SwitchThumb = (0, _styled.default)('span', {
|
|
195
195
|
name: 'MuiSwitch',
|
|
@@ -198,7 +198,7 @@ const SwitchThumb = (0, _styled.default)('span', {
|
|
|
198
198
|
})(({
|
|
199
199
|
theme
|
|
200
200
|
}) => ({
|
|
201
|
-
boxShadow: theme.shadows[1],
|
|
201
|
+
boxShadow: (theme.vars || theme).shadows[1],
|
|
202
202
|
backgroundColor: 'currentColor',
|
|
203
203
|
width: 20,
|
|
204
204
|
height: 20,
|
|
@@ -73,18 +73,18 @@ const TableCellRoot = (0, _styled.default)('td', {
|
|
|
73
73
|
verticalAlign: 'inherit',
|
|
74
74
|
// Workaround for a rendering bug with spanned columns in Chrome 62.0.
|
|
75
75
|
// Removes the alpha (sets it to 1), and lightens or darkens the theme color.
|
|
76
|
-
borderBottom: `1px solid
|
|
76
|
+
borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
|
|
77
77
|
${theme.palette.mode === 'light' ? (0, _system.lighten)((0, _system.alpha)(theme.palette.divider, 1), 0.88) : (0, _system.darken)((0, _system.alpha)(theme.palette.divider, 1), 0.68)}`,
|
|
78
78
|
textAlign: 'left',
|
|
79
79
|
padding: 16
|
|
80
80
|
}, ownerState.variant === 'head' && {
|
|
81
|
-
color: theme.palette.text.primary,
|
|
81
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
82
82
|
lineHeight: theme.typography.pxToRem(24),
|
|
83
83
|
fontWeight: theme.typography.fontWeightMedium
|
|
84
84
|
}, ownerState.variant === 'body' && {
|
|
85
|
-
color: theme.palette.text.primary
|
|
85
|
+
color: (theme.vars || theme).palette.text.primary
|
|
86
86
|
}, ownerState.variant === 'footer' && {
|
|
87
|
-
color: theme.palette.text.secondary,
|
|
87
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
88
88
|
lineHeight: theme.typography.pxToRem(21),
|
|
89
89
|
fontSize: theme.typography.pxToRem(12)
|
|
90
90
|
}, ownerState.size === 'small' && {
|
|
@@ -116,7 +116,7 @@ const TableCellRoot = (0, _styled.default)('td', {
|
|
|
116
116
|
position: 'sticky',
|
|
117
117
|
top: 0,
|
|
118
118
|
zIndex: 2,
|
|
119
|
-
backgroundColor: theme.palette.background.default
|
|
119
|
+
backgroundColor: (theme.vars || theme).palette.background.default
|
|
120
120
|
}));
|
|
121
121
|
/**
|
|
122
122
|
* The component renders a `<th>` element when the parent context is a header
|
package/node/Tabs/Tabs.js
CHANGED
|
@@ -455,6 +455,12 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
455
455
|
const tab = children[i];
|
|
456
456
|
|
|
457
457
|
if (totalSize + tab[clientSize] > containerSize) {
|
|
458
|
+
// If the first item is longer than the container size, then only scroll
|
|
459
|
+
// by the container size.
|
|
460
|
+
if (i === 0) {
|
|
461
|
+
totalSize = containerSize;
|
|
462
|
+
}
|
|
463
|
+
|
|
458
464
|
break;
|
|
459
465
|
}
|
|
460
466
|
|
package/node/Tooltip/Tooltip.js
CHANGED
|
@@ -151,7 +151,7 @@ const TooltipTooltip = (0, _styled.default)('div', {
|
|
|
151
151
|
theme,
|
|
152
152
|
ownerState
|
|
153
153
|
}) => (0, _extends2.default)({
|
|
154
|
-
backgroundColor: theme.vars ?
|
|
154
|
+
backgroundColor: theme.vars ? theme.vars.palette.Tooltip.bg : (0, _system.alpha)(theme.palette.grey[700], 0.92),
|
|
155
155
|
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
156
156
|
color: (theme.vars || theme).palette.common.white,
|
|
157
157
|
fontFamily: theme.typography.fontFamily,
|
package/node/index.js
CHANGED
|
@@ -23,11 +23,14 @@ const {
|
|
|
23
23
|
getInitColorSchemeScript
|
|
24
24
|
} = (0, _system.unstable_createCssVarsProvider)({
|
|
25
25
|
theme: defaultTheme,
|
|
26
|
+
attribute: 'data-mui-color-scheme',
|
|
27
|
+
modeStorageKey: 'mui-mode',
|
|
28
|
+
colorSchemeStorageKey: 'mui-color-scheme',
|
|
26
29
|
defaultColorScheme: {
|
|
27
30
|
light: 'light',
|
|
28
31
|
dark: 'dark'
|
|
29
32
|
},
|
|
30
|
-
prefix: '
|
|
33
|
+
prefix: 'mui',
|
|
31
34
|
resolveTheme: theme => {
|
|
32
35
|
const newTheme = (0, _extends2.default)({}, theme, {
|
|
33
36
|
typography: (0, _createTypography.default)(theme.palette, theme.typography)
|
|
@@ -30,6 +30,18 @@ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
|
30
30
|
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
+
function assignNode(obj, keys) {
|
|
34
|
+
keys.forEach(k => {
|
|
35
|
+
if (!obj[k]) {
|
|
36
|
+
obj[k] = {};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function setColor(obj, key, defaultValue) {
|
|
42
|
+
obj[key] = obj[key] || defaultValue;
|
|
43
|
+
}
|
|
44
|
+
|
|
33
45
|
function extendTheme(options = {}, ...args) {
|
|
34
46
|
var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3;
|
|
35
47
|
|
|
@@ -58,16 +70,20 @@ function extendTheme(options = {}, ...args) {
|
|
|
58
70
|
light: (0, _extends2.default)({}, colorSchemesInput.light, {
|
|
59
71
|
palette: lightPalette,
|
|
60
72
|
opacity: (0, _extends2.default)({
|
|
61
|
-
|
|
62
|
-
inputTouchBottomLine: 0.42
|
|
73
|
+
inputPlaceholder: 0.42,
|
|
74
|
+
inputTouchBottomLine: 0.42,
|
|
75
|
+
switchTrackDisabled: 0.12,
|
|
76
|
+
switchTrack: 0.38
|
|
63
77
|
}, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity),
|
|
64
78
|
overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || []
|
|
65
79
|
}),
|
|
66
80
|
dark: (0, _extends2.default)({}, colorSchemesInput.dark, {
|
|
67
81
|
palette: darkPalette,
|
|
68
82
|
opacity: (0, _extends2.default)({
|
|
69
|
-
|
|
70
|
-
inputTouchBottomLine: 0.7
|
|
83
|
+
inputPlaceholder: 0.5,
|
|
84
|
+
inputTouchBottomLine: 0.7,
|
|
85
|
+
switchTrackDisabled: 0.2,
|
|
86
|
+
switchTrack: 0.3
|
|
71
87
|
}, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
|
|
72
88
|
overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
|
|
73
89
|
})
|
|
@@ -76,23 +92,98 @@ function extendTheme(options = {}, ...args) {
|
|
|
76
92
|
Object.keys(theme.colorSchemes).forEach(key => {
|
|
77
93
|
const palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
|
|
78
94
|
|
|
79
|
-
if (key === '
|
|
80
|
-
palette.common
|
|
81
|
-
palette.common
|
|
95
|
+
if (key === 'light') {
|
|
96
|
+
setColor(palette.common, 'background', '#fff');
|
|
97
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
98
|
+
} else {
|
|
99
|
+
setColor(palette.common, 'background', '#000');
|
|
100
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
101
|
+
} // assign component variables
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
assignNode(palette, ['AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
105
|
+
|
|
106
|
+
if (key === 'light') {
|
|
107
|
+
setColor(palette.AppBar, 'defaultBg', 'var(--mui-palette-grey-100)');
|
|
108
|
+
setColor(palette.Avatar, 'defaultBg', 'var(--mui-palette-grey-400)');
|
|
109
|
+
setColor(palette.Chip, 'defaultBorder', 'var(--mui-palette-grey-400)');
|
|
110
|
+
setColor(palette.Chip, 'defaultAvatarColor', 'var(--mui-palette-grey-700)');
|
|
111
|
+
setColor(palette.Chip, 'defaultIconColor', 'var(--mui-palette-grey-700)');
|
|
112
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
113
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
114
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
115
|
+
setColor(palette.LinearProgress, 'primaryBg', (0, _system.lighten)(palette.primary.main, 0.62));
|
|
116
|
+
setColor(palette.LinearProgress, 'secondaryBg', (0, _system.lighten)(palette.secondary.main, 0.62));
|
|
117
|
+
setColor(palette.LinearProgress, 'errorBg', (0, _system.lighten)(palette.error.main, 0.62));
|
|
118
|
+
setColor(palette.LinearProgress, 'infoBg', (0, _system.lighten)(palette.info.main, 0.62));
|
|
119
|
+
setColor(palette.LinearProgress, 'successBg', (0, _system.lighten)(palette.success.main, 0.62));
|
|
120
|
+
setColor(palette.LinearProgress, 'warningBg', (0, _system.lighten)(palette.warning.main, 0.62));
|
|
121
|
+
setColor(palette.Skeleton, 'bg', 'rgba(var(--mui-palette-text-primaryChannel) / 0.11)');
|
|
122
|
+
setColor(palette.Slider, 'primaryTrack', (0, _system.lighten)(palette.primary.main, 0.62));
|
|
123
|
+
setColor(palette.Slider, 'secondaryTrack', (0, _system.lighten)(palette.secondary.main, 0.62));
|
|
124
|
+
setColor(palette.Slider, 'errorTrack', (0, _system.lighten)(palette.error.main, 0.62));
|
|
125
|
+
setColor(palette.Slider, 'infoTrack', (0, _system.lighten)(palette.info.main, 0.62));
|
|
126
|
+
setColor(palette.Slider, 'successTrack', (0, _system.lighten)(palette.success.main, 0.62));
|
|
127
|
+
setColor(palette.Slider, 'warningTrack', (0, _system.lighten)(palette.warning.main, 0.62));
|
|
128
|
+
setColor(palette.SnackbarContent, 'bg', (0, _system.emphasize)(palette.background.default, 0.8));
|
|
129
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', (0, _system.emphasize)(palette.background.paper, 0.15));
|
|
130
|
+
setColor(palette.StepConnector, 'border', 'var(--mui-palette-grey-400)');
|
|
131
|
+
setColor(palette.StepContent, 'border', 'var(--mui-palette-grey-400)');
|
|
132
|
+
setColor(palette.Switch, 'defaultColor', 'var(--mui-palette-common-white)');
|
|
133
|
+
setColor(palette.Switch, 'defaultDisabledColor', 'var(--mui-palette-grey-100)');
|
|
134
|
+
setColor(palette.Switch, 'primaryDisabledColor', (0, _system.lighten)(palette.primary.main, 0.62));
|
|
135
|
+
setColor(palette.Switch, 'secondaryDisabledColor', (0, _system.lighten)(palette.secondary.main, 0.62));
|
|
136
|
+
setColor(palette.Switch, 'errorDisabledColor', (0, _system.lighten)(palette.error.main, 0.62));
|
|
137
|
+
setColor(palette.Switch, 'infoDisabledColor', (0, _system.lighten)(palette.info.main, 0.62));
|
|
138
|
+
setColor(palette.Switch, 'successDisabledColor', (0, _system.lighten)(palette.success.main, 0.62));
|
|
139
|
+
setColor(palette.Switch, 'warningDisabledColor', (0, _system.lighten)(palette.warning.main, 0.62));
|
|
140
|
+
setColor(palette.TableCell, 'border', (0, _system.lighten)((0, _system.alpha)(palette.divider, 1), 0.88));
|
|
141
|
+
setColor(palette.Tooltip, 'bg', (0, _system.alpha)(palette.grey[700], 0.92));
|
|
82
142
|
} else {
|
|
83
|
-
palette.
|
|
84
|
-
palette.
|
|
143
|
+
setColor(palette.AppBar, 'defaultBg', 'var(--mui-palette-grey-900)');
|
|
144
|
+
setColor(palette.AppBar, 'darkBg', 'var(--mui-palette-background-paper)'); // specific for dark mode
|
|
145
|
+
|
|
146
|
+
setColor(palette.AppBar, 'darkColor', 'var(--mui-palette-text-primary)'); // specific for dark mode
|
|
147
|
+
|
|
148
|
+
setColor(palette.Avatar, 'defaultBg', 'var(--mui-palette-grey-600)');
|
|
149
|
+
setColor(palette.Chip, 'defaultBorder', 'var(--mui-palette-grey-700)');
|
|
150
|
+
setColor(palette.Chip, 'defaultAvatarColor', 'var(--mui-palette-grey-300)');
|
|
151
|
+
setColor(palette.Chip, 'defaultIconColor', 'var(--mui-palette-grey-300)');
|
|
152
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
153
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
154
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
155
|
+
setColor(palette.LinearProgress, 'primaryBg', (0, _system.darken)(palette.primary.main, 0.5));
|
|
156
|
+
setColor(palette.LinearProgress, 'secondaryBg', (0, _system.darken)(palette.secondary.main, 0.5));
|
|
157
|
+
setColor(palette.LinearProgress, 'errorBg', (0, _system.darken)(palette.error.main, 0.5));
|
|
158
|
+
setColor(palette.LinearProgress, 'infoBg', (0, _system.darken)(palette.info.main, 0.5));
|
|
159
|
+
setColor(palette.LinearProgress, 'successBg', (0, _system.darken)(palette.success.main, 0.5));
|
|
160
|
+
setColor(palette.LinearProgress, 'warningBg', (0, _system.darken)(palette.warning.main, 0.5));
|
|
161
|
+
setColor(palette.Skeleton, 'bg', 'rgba(var(--mui-palette-text-primaryChannel) / 0.13)');
|
|
162
|
+
setColor(palette.Slider, 'primaryTrack', (0, _system.darken)(palette.primary.main, 0.5));
|
|
163
|
+
setColor(palette.Slider, 'secondaryTrack', (0, _system.darken)(palette.secondary.main, 0.5));
|
|
164
|
+
setColor(palette.Slider, 'errorTrack', (0, _system.darken)(palette.error.main, 0.5));
|
|
165
|
+
setColor(palette.Slider, 'infoTrack', (0, _system.darken)(palette.info.main, 0.5));
|
|
166
|
+
setColor(palette.Slider, 'successTrack', (0, _system.darken)(palette.success.main, 0.5));
|
|
167
|
+
setColor(palette.Slider, 'warningTrack', (0, _system.darken)(palette.warning.main, 0.5));
|
|
168
|
+
setColor(palette.SnackbarContent, 'bg', (0, _system.emphasize)(palette.background.default, 0.98));
|
|
169
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', (0, _system.emphasize)(palette.background.paper, 0.15));
|
|
170
|
+
setColor(palette.StepConnector, 'border', 'var(--mui-palette-grey-600)');
|
|
171
|
+
setColor(palette.StepContent, 'border', 'var(--mui-palette-grey-600)');
|
|
172
|
+
setColor(palette.Switch, 'defaultColor', 'var(--mui-palette-grey-300)');
|
|
173
|
+
setColor(palette.Switch, 'defaultDisabledColor', 'var(--mui-palette-grey-600)');
|
|
174
|
+
setColor(palette.Switch, 'primaryDisabledColor', (0, _system.darken)(palette.primary.main, 0.55));
|
|
175
|
+
setColor(palette.Switch, 'secondaryDisabledColor', (0, _system.darken)(palette.secondary.main, 0.55));
|
|
176
|
+
setColor(palette.Switch, 'errorDisabledColor', (0, _system.darken)(palette.error.main, 0.55));
|
|
177
|
+
setColor(palette.Switch, 'infoDisabledColor', (0, _system.darken)(palette.info.main, 0.55));
|
|
178
|
+
setColor(palette.Switch, 'successDisabledColor', (0, _system.darken)(palette.success.main, 0.55));
|
|
179
|
+
setColor(palette.Switch, 'warningDisabledColor', (0, _system.darken)(palette.warning.main, 0.55));
|
|
180
|
+
setColor(palette.TableCell, 'border', (0, _system.darken)((0, _system.alpha)(palette.divider, 1), 0.68));
|
|
181
|
+
setColor(palette.Tooltip, 'bg', (0, _system.alpha)(palette.grey[700], 0.92));
|
|
85
182
|
}
|
|
86
183
|
|
|
87
184
|
palette.common.backgroundChannel = (0, _system.colorChannel)(palette.common.background);
|
|
88
185
|
palette.common.onBackgroundChannel = (0, _system.colorChannel)(palette.common.onBackground);
|
|
89
|
-
palette.dividerChannel = (0, _system.colorChannel)(palette.divider);
|
|
90
|
-
// TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
|
|
91
|
-
|
|
92
|
-
if (!palette.grey.dark) {
|
|
93
|
-
palette.grey.dark = palette.grey[700];
|
|
94
|
-
}
|
|
95
|
-
|
|
186
|
+
palette.dividerChannel = (0, _system.colorChannel)(palette.divider);
|
|
96
187
|
Object.keys(palette).forEach(color => {
|
|
97
188
|
const colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
|
|
98
189
|
|
|
@@ -119,12 +210,16 @@ function extendTheme(options = {}, ...args) {
|
|
|
119
210
|
|
|
120
211
|
if (colors.secondary) {
|
|
121
212
|
palette[color].secondaryChannel = (0, _system.colorChannel)(colors.secondary);
|
|
122
|
-
} // Action colors: action.
|
|
213
|
+
} // Action colors: action.active, action.selected
|
|
123
214
|
|
|
124
215
|
|
|
125
216
|
if (colors.active) {
|
|
126
217
|
palette[color].activeChannel = (0, _system.colorChannel)(colors.active);
|
|
127
218
|
}
|
|
219
|
+
|
|
220
|
+
if (colors.selected) {
|
|
221
|
+
palette[color].selectedChannel = (0, _system.colorChannel)(colors.selected);
|
|
222
|
+
}
|
|
128
223
|
});
|
|
129
224
|
});
|
|
130
225
|
theme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), theme);
|