@mui/material 5.8.4 → 5.8.7
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/Accordion/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/Alert.js +19 -11
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/AppBar.js +22 -5
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/Autocomplete.d.ts +2 -0
- package/Autocomplete/Autocomplete.js +12 -8
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/Avatar.js +7 -4
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.js +2 -2
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +185 -4
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/Chip.js +31 -30
- package/Chip/chipClasses.d.ts +80 -80
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/Dialog.js +11 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/FilledInput.js +28 -13
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +26 -26
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/Input.js +1 -1
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/InputBase.js +2 -2
- package/InputBase/inputBaseClasses.d.ts +44 -44
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/LinearProgress.js +6 -2
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/Modal/Modal.d.ts +2 -0
- package/Modal/Modal.js +25 -8
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/OutlinedInput.js +40 -10
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +29 -29
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +1 -1
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/Skeleton.js +8 -3
- package/Skeleton/skeletonClasses.d.ts +24 -24
- package/Slider/Slider.js +21 -21
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/SnackbarContent.js +3 -3
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/SpeedDialAction.js +7 -7
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/StepConnector.js +14 -11
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/StepContent.js +1 -1
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +24 -24
- package/Switch/Switch.js +11 -11
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/TableCell.js +5 -5
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/Tabs.js +16 -18
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/Tooltip.js +1 -1
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Alert/Alert.js +19 -11
- package/legacy/AppBar/AppBar.js +23 -4
- package/legacy/Autocomplete/Autocomplete.js +12 -8
- package/legacy/Avatar/Avatar.js +7 -4
- package/legacy/Badge/Badge.js +2 -2
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Chip/Chip.js +31 -30
- package/legacy/Dialog/Dialog.js +11 -6
- package/legacy/FilledInput/FilledInput.js +28 -14
- package/legacy/Input/Input.js +1 -1
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/LinearProgress/LinearProgress.js +6 -2
- package/legacy/Modal/Modal.js +23 -7
- package/legacy/OutlinedInput/OutlinedInput.js +36 -9
- package/legacy/Select/Select.js +1 -1
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Slider/Slider.js +21 -21
- package/legacy/SnackbarContent/SnackbarContent.js +3 -3
- package/legacy/SpeedDialAction/SpeedDialAction.js +7 -7
- package/legacy/StepConnector/StepConnector.js +2 -1
- package/legacy/StepContent/StepContent.js +1 -1
- package/legacy/Switch/Switch.js +11 -11
- package/legacy/TableCell/TableCell.js +5 -5
- package/legacy/Tabs/Tabs.js +16 -18
- package/legacy/Tooltip/Tooltip.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +10 -8
- package/legacy/styles/experimental_extendTheme.js +170 -19
- package/locale/index.d.ts +71 -71
- package/modern/Alert/Alert.js +19 -11
- package/modern/AppBar/AppBar.js +22 -5
- package/modern/Autocomplete/Autocomplete.js +11 -7
- package/modern/Avatar/Avatar.js +7 -4
- package/modern/Badge/Badge.js +2 -2
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Chip/Chip.js +31 -30
- package/modern/Dialog/Dialog.js +11 -6
- package/modern/FilledInput/FilledInput.js +27 -12
- package/modern/Input/Input.js +1 -1
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/LinearProgress/LinearProgress.js +6 -2
- package/modern/Modal/Modal.js +24 -7
- package/modern/OutlinedInput/OutlinedInput.js +40 -10
- package/modern/Select/Select.js +1 -1
- package/modern/Skeleton/Skeleton.js +7 -2
- package/modern/Slider/Slider.js +21 -21
- package/modern/SnackbarContent/SnackbarContent.js +3 -3
- package/modern/SpeedDialAction/SpeedDialAction.js +7 -7
- package/modern/StepConnector/StepConnector.js +14 -11
- package/modern/StepContent/StepContent.js +1 -1
- package/modern/Switch/Switch.js +11 -11
- package/modern/TableCell/TableCell.js +5 -5
- package/modern/Tabs/Tabs.js +16 -18
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +6 -6
- package/modern/styles/experimental_extendTheme.js +166 -20
- package/node/Alert/Alert.js +19 -11
- package/node/AppBar/AppBar.js +22 -5
- package/node/Autocomplete/Autocomplete.js +12 -8
- package/node/Avatar/Avatar.js +7 -4
- package/node/Badge/Badge.js +2 -2
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Chip/Chip.js +31 -30
- package/node/Dialog/Dialog.js +11 -6
- package/node/FilledInput/FilledInput.js +28 -13
- package/node/Input/Input.js +1 -1
- package/node/InputBase/InputBase.js +2 -2
- package/node/LinearProgress/LinearProgress.js +6 -2
- package/node/Modal/Modal.js +25 -8
- package/node/OutlinedInput/OutlinedInput.js +38 -10
- package/node/Select/Select.js +1 -1
- package/node/Skeleton/Skeleton.js +7 -2
- package/node/Slider/Slider.js +21 -21
- package/node/SnackbarContent/SnackbarContent.js +3 -3
- package/node/SpeedDialAction/SpeedDialAction.js +7 -7
- package/node/StepConnector/StepConnector.js +14 -11
- package/node/StepContent/StepContent.js +1 -1
- package/node/Switch/Switch.js +11 -11
- package/node/TableCell/TableCell.js +5 -5
- package/node/Tabs/Tabs.js +16 -18
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +11 -6
- package/node/styles/experimental_extendTheme.js +167 -19
- package/package.json +7 -7
- package/styles/CssVarsProvider.d.ts +14 -28
- package/styles/CssVarsProvider.js +10 -6
- package/styles/createPalette.d.ts +0 -26
- package/styles/experimental_extendTheme.d.ts +238 -35
- package/styles/experimental_extendTheme.js +166 -20
- package/styles/index.d.ts +24 -1
- package/themeCssVarsAugmentation/index.d.ts +30 -0
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/umd/material-ui.development.js +954 -471
- package/umd/material-ui.production.min.js +27 -22
- package/useMediaQuery/useMediaQuery.d.ts +31 -31
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["colorSchemes"],
|
|
3
|
+
const _excluded = ["colorSchemes", "cssVarPrefix"],
|
|
4
4
|
_excluded2 = ["palette"];
|
|
5
5
|
import { deepmerge } from '@mui/utils';
|
|
6
|
-
import { colorChannel } from '@mui/system';
|
|
6
|
+
import { colorChannel, alpha, darken, lighten, emphasize, unstable_createGetCssVar as systemCreateGetCssVar } from '@mui/system';
|
|
7
7
|
import createThemeWithoutVars from './createTheme';
|
|
8
8
|
import { getOverlayAlpha } from '../Paper/Paper';
|
|
9
9
|
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
@@ -14,12 +14,29 @@ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
|
14
14
|
const overlay = getOverlayAlpha(index);
|
|
15
15
|
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
16
16
|
});
|
|
17
|
+
|
|
18
|
+
function assignNode(obj, keys) {
|
|
19
|
+
keys.forEach(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
|
+
|
|
30
|
+
export const createGetCssVar = (cssVarPrefix = 'mui') => systemCreateGetCssVar(cssVarPrefix);
|
|
17
31
|
export default function extendTheme(options = {}, ...args) {
|
|
18
32
|
const {
|
|
19
|
-
colorSchemes: colorSchemesInput = {}
|
|
33
|
+
colorSchemes: colorSchemesInput = {},
|
|
34
|
+
cssVarPrefix = 'mui'
|
|
20
35
|
} = options,
|
|
21
36
|
input = _objectWithoutPropertiesLoose(options, _excluded);
|
|
22
37
|
|
|
38
|
+
const getCssVar = createGetCssVar(cssVarPrefix);
|
|
39
|
+
|
|
23
40
|
const _createThemeWithoutVa = createThemeWithoutVars(_extends({}, input, colorSchemesInput.light && {
|
|
24
41
|
palette: colorSchemesInput.light?.palette
|
|
25
42
|
})),
|
|
@@ -37,20 +54,26 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
37
54
|
});
|
|
38
55
|
|
|
39
56
|
let theme = _extends({}, muiTheme, {
|
|
57
|
+
cssVarPrefix,
|
|
58
|
+
getCssVar,
|
|
40
59
|
colorSchemes: _extends({}, colorSchemesInput, {
|
|
41
60
|
light: _extends({}, colorSchemesInput.light, {
|
|
42
61
|
palette: lightPalette,
|
|
43
62
|
opacity: _extends({
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
inputPlaceholder: 0.42,
|
|
64
|
+
inputUnderline: 0.42,
|
|
65
|
+
switchTrackDisabled: 0.12,
|
|
66
|
+
switchTrack: 0.38
|
|
46
67
|
}, colorSchemesInput.light?.opacity),
|
|
47
68
|
overlays: colorSchemesInput.light?.overlays || []
|
|
48
69
|
}),
|
|
49
70
|
dark: _extends({}, colorSchemesInput.dark, {
|
|
50
71
|
palette: darkPalette,
|
|
51
72
|
opacity: _extends({
|
|
52
|
-
|
|
53
|
-
|
|
73
|
+
inputPlaceholder: 0.5,
|
|
74
|
+
inputUnderline: 0.7,
|
|
75
|
+
switchTrackDisabled: 0.2,
|
|
76
|
+
switchTrack: 0.3
|
|
54
77
|
}, colorSchemesInput.dark?.opacity),
|
|
55
78
|
overlays: colorSchemesInput.dark?.overlays || defaultDarkOverlays
|
|
56
79
|
})
|
|
@@ -60,23 +83,142 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
60
83
|
Object.keys(theme.colorSchemes).forEach(key => {
|
|
61
84
|
const palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
|
|
62
85
|
|
|
63
|
-
if (key === '
|
|
64
|
-
palette.common
|
|
65
|
-
palette.common
|
|
86
|
+
if (key === 'light') {
|
|
87
|
+
setColor(palette.common, 'background', '#fff');
|
|
88
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
66
89
|
} else {
|
|
67
|
-
palette.common
|
|
68
|
-
palette.common
|
|
69
|
-
}
|
|
90
|
+
setColor(palette.common, 'background', '#000');
|
|
91
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
92
|
+
} // assign component variables
|
|
70
93
|
|
|
71
|
-
palette.common.backgroundChannel = colorChannel(palette.common.background);
|
|
72
|
-
palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
|
|
73
|
-
palette.dividerChannel = colorChannel(palette.divider); // special token for Tooltip
|
|
74
|
-
// TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
|
|
75
94
|
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
96
|
+
|
|
97
|
+
if (key === 'light') {
|
|
98
|
+
setColor(palette.Alert, 'errorColor', darken(palette.error.light, 0.6));
|
|
99
|
+
setColor(palette.Alert, 'infoColor', darken(palette.info.light, 0.6));
|
|
100
|
+
setColor(palette.Alert, 'successColor', darken(palette.success.light, 0.6));
|
|
101
|
+
setColor(palette.Alert, 'warningColor', darken(palette.warning.light, 0.6));
|
|
102
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-main'));
|
|
103
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-main'));
|
|
104
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-main'));
|
|
105
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-main'));
|
|
106
|
+
setColor(palette.Alert, 'errorFilledColor', lightPalette.getContrastText(palette.error.main));
|
|
107
|
+
setColor(palette.Alert, 'infoFilledColor', lightPalette.getContrastText(palette.info.main));
|
|
108
|
+
setColor(palette.Alert, 'successFilledColor', lightPalette.getContrastText(palette.success.main));
|
|
109
|
+
setColor(palette.Alert, 'warningFilledColor', lightPalette.getContrastText(palette.warning.main));
|
|
110
|
+
setColor(palette.Alert, 'errorStandardBg', lighten(palette.error.light, 0.9));
|
|
111
|
+
setColor(palette.Alert, 'infoStandardBg', lighten(palette.info.light, 0.9));
|
|
112
|
+
setColor(palette.Alert, 'successStandardBg', lighten(palette.success.light, 0.9));
|
|
113
|
+
setColor(palette.Alert, 'warningStandardBg', lighten(palette.warning.light, 0.9));
|
|
114
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-light'));
|
|
115
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-light'));
|
|
116
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-light'));
|
|
117
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-light'));
|
|
118
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-100'));
|
|
119
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-400'));
|
|
120
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-400'));
|
|
121
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-700'));
|
|
122
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-700'));
|
|
123
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
124
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
125
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
126
|
+
setColor(palette.LinearProgress, 'primaryBg', lighten(palette.primary.main, 0.62));
|
|
127
|
+
setColor(palette.LinearProgress, 'secondaryBg', lighten(palette.secondary.main, 0.62));
|
|
128
|
+
setColor(palette.LinearProgress, 'errorBg', lighten(palette.error.main, 0.62));
|
|
129
|
+
setColor(palette.LinearProgress, 'infoBg', lighten(palette.info.main, 0.62));
|
|
130
|
+
setColor(palette.LinearProgress, 'successBg', lighten(palette.success.main, 0.62));
|
|
131
|
+
setColor(palette.LinearProgress, 'warningBg', lighten(palette.warning.main, 0.62));
|
|
132
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.11)`);
|
|
133
|
+
setColor(palette.Slider, 'primaryTrack', lighten(palette.primary.main, 0.62));
|
|
134
|
+
setColor(palette.Slider, 'secondaryTrack', lighten(palette.secondary.main, 0.62));
|
|
135
|
+
setColor(palette.Slider, 'errorTrack', lighten(palette.error.main, 0.62));
|
|
136
|
+
setColor(palette.Slider, 'infoTrack', lighten(palette.info.main, 0.62));
|
|
137
|
+
setColor(palette.Slider, 'successTrack', lighten(palette.success.main, 0.62));
|
|
138
|
+
setColor(palette.Slider, 'warningTrack', lighten(palette.warning.main, 0.62));
|
|
139
|
+
const snackbarContentBackground = emphasize(palette.background.default, 0.8);
|
|
140
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
141
|
+
setColor(palette.SnackbarContent, 'color', lightPalette.getContrastText(snackbarContentBackground));
|
|
142
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
143
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-400'));
|
|
144
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-400'));
|
|
145
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-common-white'));
|
|
146
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-100'));
|
|
147
|
+
setColor(palette.Switch, 'primaryDisabledColor', lighten(palette.primary.main, 0.62));
|
|
148
|
+
setColor(palette.Switch, 'secondaryDisabledColor', lighten(palette.secondary.main, 0.62));
|
|
149
|
+
setColor(palette.Switch, 'errorDisabledColor', lighten(palette.error.main, 0.62));
|
|
150
|
+
setColor(palette.Switch, 'infoDisabledColor', lighten(palette.info.main, 0.62));
|
|
151
|
+
setColor(palette.Switch, 'successDisabledColor', lighten(palette.success.main, 0.62));
|
|
152
|
+
setColor(palette.Switch, 'warningDisabledColor', lighten(palette.warning.main, 0.62));
|
|
153
|
+
setColor(palette.TableCell, 'border', lighten(alpha(palette.divider, 1), 0.88));
|
|
154
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
155
|
+
} else {
|
|
156
|
+
setColor(palette.Alert, 'errorColor', lighten(palette.error.light, 0.6));
|
|
157
|
+
setColor(palette.Alert, 'infoColor', lighten(palette.info.light, 0.6));
|
|
158
|
+
setColor(palette.Alert, 'successColor', lighten(palette.success.light, 0.6));
|
|
159
|
+
setColor(palette.Alert, 'warningColor', lighten(palette.warning.light, 0.6));
|
|
160
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-dark'));
|
|
161
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-dark'));
|
|
162
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-dark'));
|
|
163
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-dark'));
|
|
164
|
+
setColor(palette.Alert, 'errorFilledColor', darkPalette.getContrastText(palette.error.dark));
|
|
165
|
+
setColor(palette.Alert, 'infoFilledColor', darkPalette.getContrastText(palette.info.dark));
|
|
166
|
+
setColor(palette.Alert, 'successFilledColor', darkPalette.getContrastText(palette.success.dark));
|
|
167
|
+
setColor(palette.Alert, 'warningFilledColor', darkPalette.getContrastText(palette.warning.dark));
|
|
168
|
+
setColor(palette.Alert, 'errorStandardBg', darken(palette.error.light, 0.9));
|
|
169
|
+
setColor(palette.Alert, 'infoStandardBg', darken(palette.info.light, 0.9));
|
|
170
|
+
setColor(palette.Alert, 'successStandardBg', darken(palette.success.light, 0.9));
|
|
171
|
+
setColor(palette.Alert, 'warningStandardBg', darken(palette.warning.light, 0.9));
|
|
172
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-main'));
|
|
173
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-main'));
|
|
174
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-main'));
|
|
175
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-main'));
|
|
176
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-900'));
|
|
177
|
+
setColor(palette.AppBar, 'darkBg', getCssVar('palette-background-paper')); // specific for dark mode
|
|
178
|
+
|
|
179
|
+
setColor(palette.AppBar, 'darkColor', getCssVar('palette-text-primary')); // specific for dark mode
|
|
180
|
+
|
|
181
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-600'));
|
|
182
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-700'));
|
|
183
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-300'));
|
|
184
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-300'));
|
|
185
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
186
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
187
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
188
|
+
setColor(palette.LinearProgress, 'primaryBg', darken(palette.primary.main, 0.5));
|
|
189
|
+
setColor(palette.LinearProgress, 'secondaryBg', darken(palette.secondary.main, 0.5));
|
|
190
|
+
setColor(palette.LinearProgress, 'errorBg', darken(palette.error.main, 0.5));
|
|
191
|
+
setColor(palette.LinearProgress, 'infoBg', darken(palette.info.main, 0.5));
|
|
192
|
+
setColor(palette.LinearProgress, 'successBg', darken(palette.success.main, 0.5));
|
|
193
|
+
setColor(palette.LinearProgress, 'warningBg', darken(palette.warning.main, 0.5));
|
|
194
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.13)`);
|
|
195
|
+
setColor(palette.Slider, 'primaryTrack', darken(palette.primary.main, 0.5));
|
|
196
|
+
setColor(palette.Slider, 'secondaryTrack', darken(palette.secondary.main, 0.5));
|
|
197
|
+
setColor(palette.Slider, 'errorTrack', darken(palette.error.main, 0.5));
|
|
198
|
+
setColor(palette.Slider, 'infoTrack', darken(palette.info.main, 0.5));
|
|
199
|
+
setColor(palette.Slider, 'successTrack', darken(palette.success.main, 0.5));
|
|
200
|
+
setColor(palette.Slider, 'warningTrack', darken(palette.warning.main, 0.5));
|
|
201
|
+
const snackbarContentBackground = emphasize(palette.background.default, 0.98);
|
|
202
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
203
|
+
setColor(palette.SnackbarContent, 'color', darkPalette.getContrastText(snackbarContentBackground));
|
|
204
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
205
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-600'));
|
|
206
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-600'));
|
|
207
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-grey-300'));
|
|
208
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-600'));
|
|
209
|
+
setColor(palette.Switch, 'primaryDisabledColor', darken(palette.primary.main, 0.55));
|
|
210
|
+
setColor(palette.Switch, 'secondaryDisabledColor', darken(palette.secondary.main, 0.55));
|
|
211
|
+
setColor(palette.Switch, 'errorDisabledColor', darken(palette.error.main, 0.55));
|
|
212
|
+
setColor(palette.Switch, 'infoDisabledColor', darken(palette.info.main, 0.55));
|
|
213
|
+
setColor(palette.Switch, 'successDisabledColor', darken(palette.success.main, 0.55));
|
|
214
|
+
setColor(palette.Switch, 'warningDisabledColor', darken(palette.warning.main, 0.55));
|
|
215
|
+
setColor(palette.TableCell, 'border', darken(alpha(palette.divider, 1), 0.68));
|
|
216
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
78
217
|
}
|
|
79
218
|
|
|
219
|
+
palette.common.backgroundChannel = colorChannel(palette.common.background);
|
|
220
|
+
palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
|
|
221
|
+
palette.dividerChannel = colorChannel(palette.divider);
|
|
80
222
|
Object.keys(palette).forEach(color => {
|
|
81
223
|
const colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
|
|
82
224
|
|
|
@@ -103,12 +245,16 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
103
245
|
|
|
104
246
|
if (colors.secondary) {
|
|
105
247
|
palette[color].secondaryChannel = colorChannel(colors.secondary);
|
|
106
|
-
} // Action colors: action.
|
|
248
|
+
} // Action colors: action.active, action.selected
|
|
107
249
|
|
|
108
250
|
|
|
109
251
|
if (colors.active) {
|
|
110
252
|
palette[color].activeChannel = colorChannel(colors.active);
|
|
111
253
|
}
|
|
254
|
+
|
|
255
|
+
if (colors.selected) {
|
|
256
|
+
palette[color].selectedChannel = colorChannel(colors.selected);
|
|
257
|
+
}
|
|
112
258
|
});
|
|
113
259
|
});
|
|
114
260
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
package/node/Alert/Alert.js
CHANGED
|
@@ -90,22 +90,30 @@ const AlertRoot = (0, _styled.default)(_Paper.default, {
|
|
|
90
90
|
display: 'flex',
|
|
91
91
|
padding: '6px 16px'
|
|
92
92
|
}, color && ownerState.variant === 'standard' && {
|
|
93
|
-
color: getColor(theme.palette[color].light, 0.6),
|
|
94
|
-
backgroundColor: getBackgroundColor(theme.palette[color].light, 0.9),
|
|
95
|
-
[`& .${_alertClasses.default.icon}`]: {
|
|
93
|
+
color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
|
|
94
|
+
backgroundColor: theme.vars ? theme.vars.palette.Alert[`${color}StandardBg`] : getBackgroundColor(theme.palette[color].light, 0.9),
|
|
95
|
+
[`& .${_alertClasses.default.icon}`]: theme.vars ? {
|
|
96
|
+
color: theme.vars.palette.Alert[`${color}IconColor`]
|
|
97
|
+
} : {
|
|
96
98
|
color: theme.palette.mode === 'dark' ? theme.palette[color].main : theme.palette[color].light
|
|
97
99
|
}
|
|
98
100
|
}, color && ownerState.variant === 'outlined' && {
|
|
99
|
-
color: getColor(theme.palette[color].light, 0.6),
|
|
100
|
-
border: `1px solid ${theme.palette[color].light}`,
|
|
101
|
-
[`& .${_alertClasses.default.icon}`]: {
|
|
101
|
+
color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
|
|
102
|
+
border: `1px solid ${(theme.vars || theme).palette[color].light}`,
|
|
103
|
+
[`& .${_alertClasses.default.icon}`]: theme.vars ? {
|
|
104
|
+
color: theme.vars.palette.Alert[`${color}IconColor`]
|
|
105
|
+
} : {
|
|
102
106
|
color: theme.palette.mode === 'dark' ? theme.palette[color].main : theme.palette[color].light
|
|
103
107
|
}
|
|
104
|
-
}, color && ownerState.variant === 'filled' && {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
}, color && ownerState.variant === 'filled' && (0, _extends2.default)({
|
|
109
|
+
fontWeight: theme.typography.fontWeightMedium
|
|
110
|
+
}, theme.vars ? {
|
|
111
|
+
color: theme.vars.palette.Alert[`${color}FilledColor`],
|
|
112
|
+
backgroundColor: theme.vars.palette.Alert[`${color}FilledBg`]
|
|
113
|
+
} : {
|
|
114
|
+
backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
|
|
115
|
+
color: theme.palette.getContrastText(theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main)
|
|
116
|
+
}));
|
|
109
117
|
});
|
|
110
118
|
const AlertIcon = (0, _styled.default)('div', {
|
|
111
119
|
name: 'MuiAlert',
|
package/node/AppBar/AppBar.js
CHANGED
|
@@ -47,7 +47,11 @@ const useUtilityClasses = ownerState => {
|
|
|
47
47
|
root: ['root', `color${(0, _capitalize.default)(color)}`, `position${(0, _capitalize.default)(position)}`]
|
|
48
48
|
};
|
|
49
49
|
return (0, _base.unstable_composeClasses)(slots, _appBarClasses.getAppBarUtilityClass, classes);
|
|
50
|
-
};
|
|
50
|
+
}; // var2 is the fallback.
|
|
51
|
+
// Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
const joinVars = (var1, var2) => `${var1 == null ? void 0 : var1.replace(')', '')}, ${var2})`;
|
|
51
55
|
|
|
52
56
|
const AppBarRoot = (0, _styled.default)(_Paper.default, {
|
|
53
57
|
name: 'MuiAppBar',
|
|
@@ -72,7 +76,7 @@ const AppBarRoot = (0, _styled.default)(_Paper.default, {
|
|
|
72
76
|
flexShrink: 0
|
|
73
77
|
}, ownerState.position === 'fixed' && {
|
|
74
78
|
position: 'fixed',
|
|
75
|
-
zIndex: theme.zIndex.appBar,
|
|
79
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
76
80
|
top: 0,
|
|
77
81
|
left: 'auto',
|
|
78
82
|
right: 0,
|
|
@@ -82,14 +86,14 @@ const AppBarRoot = (0, _styled.default)(_Paper.default, {
|
|
|
82
86
|
}
|
|
83
87
|
}, ownerState.position === 'absolute' && {
|
|
84
88
|
position: 'absolute',
|
|
85
|
-
zIndex: theme.zIndex.appBar,
|
|
89
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
86
90
|
top: 0,
|
|
87
91
|
left: 'auto',
|
|
88
92
|
right: 0
|
|
89
93
|
}, ownerState.position === 'sticky' && {
|
|
90
94
|
// ⚠️ sticky is not supported by IE11.
|
|
91
95
|
position: 'sticky',
|
|
92
|
-
zIndex: theme.zIndex.appBar,
|
|
96
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
93
97
|
top: 0,
|
|
94
98
|
left: 'auto',
|
|
95
99
|
right: 0
|
|
@@ -97,7 +101,7 @@ const AppBarRoot = (0, _styled.default)(_Paper.default, {
|
|
|
97
101
|
position: 'static'
|
|
98
102
|
}, ownerState.position === 'relative' && {
|
|
99
103
|
position: 'relative'
|
|
100
|
-
}, ownerState.color === 'default' && {
|
|
104
|
+
}, !theme.vars && (0, _extends2.default)({}, ownerState.color === 'default' && {
|
|
101
105
|
backgroundColor: backgroundColorDefault,
|
|
102
106
|
color: theme.palette.getContrastText(backgroundColorDefault)
|
|
103
107
|
}, ownerState.color && ownerState.color !== 'default' && ownerState.color !== 'inherit' && ownerState.color !== 'transparent' && {
|
|
@@ -113,6 +117,19 @@ const AppBarRoot = (0, _styled.default)(_Paper.default, {
|
|
|
113
117
|
color: 'inherit'
|
|
114
118
|
}, theme.palette.mode === 'dark' && {
|
|
115
119
|
backgroundImage: 'none'
|
|
120
|
+
})), theme.vars && (0, _extends2.default)({}, ownerState.color === 'default' && {
|
|
121
|
+
'--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette.AppBar.defaultBg : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette.AppBar.defaultBg),
|
|
122
|
+
'--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette.text.primary : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette.text.primary)
|
|
123
|
+
}, ownerState.color && !ownerState.color.match(/^(default|inherit|transparent)$/) && {
|
|
124
|
+
'--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].main : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette[ownerState.color].main),
|
|
125
|
+
'--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].contrastText : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette[ownerState.color].contrastText)
|
|
126
|
+
}, {
|
|
127
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
128
|
+
color: ownerState.color === 'inherit' ? 'inherit' : 'var(--AppBar-color)'
|
|
129
|
+
}, ownerState.color === 'transparent' && {
|
|
130
|
+
backgroundImage: 'none',
|
|
131
|
+
backgroundColor: 'transparent',
|
|
132
|
+
color: 'inherit'
|
|
116
133
|
}));
|
|
117
134
|
});
|
|
118
135
|
const AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {
|
|
@@ -389,7 +389,7 @@ const AutocompleteGroupUl = (0, _styled.default)('ul', {
|
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
392
|
-
var _componentsProps$clea, _componentsProps$pape;
|
|
392
|
+
var _componentsProps$clea, _componentsProps$popu, _componentsProps$popp, _componentsProps$pape;
|
|
393
393
|
|
|
394
394
|
const props = (0, _useThemeProps.default)({
|
|
395
395
|
props: inProps,
|
|
@@ -588,8 +588,9 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
588
588
|
disabled: disabled,
|
|
589
589
|
"aria-label": popupOpen ? closeText : openText,
|
|
590
590
|
title: popupOpen ? closeText : openText,
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
ownerState: ownerState
|
|
592
|
+
}, componentsProps.popupIndicator, {
|
|
593
|
+
className: (0, _clsx.default)(classes.popupIndicator, (_componentsProps$popu = componentsProps.popupIndicator) == null ? void 0 : _componentsProps$popu.className),
|
|
593
594
|
children: popupIcon
|
|
594
595
|
})) : null]
|
|
595
596
|
})
|
|
@@ -600,9 +601,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
600
601
|
readOnly
|
|
601
602
|
}, getInputProps())
|
|
602
603
|
})
|
|
603
|
-
})), popupOpen && anchorEl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, {
|
|
604
|
+
})), popupOpen && anchorEl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, (0, _extends2.default)({
|
|
604
605
|
as: PopperComponent,
|
|
605
|
-
className: (0, _clsx.default)(classes.popper),
|
|
606
606
|
disablePortal: disablePortal,
|
|
607
607
|
style: {
|
|
608
608
|
width: anchorEl ? anchorEl.clientWidth : null
|
|
@@ -610,7 +610,9 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
610
610
|
ownerState: ownerState,
|
|
611
611
|
role: "presentation",
|
|
612
612
|
anchorEl: anchorEl,
|
|
613
|
-
open: true
|
|
613
|
+
open: true
|
|
614
|
+
}, componentsProps.popper, {
|
|
615
|
+
className: (0, _clsx.default)(classes.popper, (_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className),
|
|
614
616
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(AutocompletePaper, (0, _extends2.default)({
|
|
615
617
|
ownerState: ownerState,
|
|
616
618
|
as: PaperComponent
|
|
@@ -647,7 +649,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
647
649
|
})
|
|
648
650
|
})) : null]
|
|
649
651
|
}))
|
|
650
|
-
}) : null]
|
|
652
|
+
})) : null]
|
|
651
653
|
});
|
|
652
654
|
});
|
|
653
655
|
process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
@@ -749,7 +751,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
749
751
|
*/
|
|
750
752
|
componentsProps: _propTypes.default.shape({
|
|
751
753
|
clearIndicator: _propTypes.default.object,
|
|
752
|
-
paper: _propTypes.default.object
|
|
754
|
+
paper: _propTypes.default.object,
|
|
755
|
+
popper: _propTypes.default.object,
|
|
756
|
+
popupIndicator: _propTypes.default.object
|
|
753
757
|
}),
|
|
754
758
|
|
|
755
759
|
/**
|
package/node/Avatar/Avatar.js
CHANGED
|
@@ -76,13 +76,16 @@ const AvatarRoot = (0, _styled.default)('div', {
|
|
|
76
76
|
overflow: 'hidden',
|
|
77
77
|
userSelect: 'none'
|
|
78
78
|
}, ownerState.variant === 'rounded' && {
|
|
79
|
-
borderRadius: theme.shape.borderRadius
|
|
79
|
+
borderRadius: (theme.vars || theme).shape.borderRadius
|
|
80
80
|
}, ownerState.variant === 'square' && {
|
|
81
81
|
borderRadius: 0
|
|
82
|
-
}, ownerState.colorDefault && {
|
|
83
|
-
color: theme.palette.background.default
|
|
82
|
+
}, ownerState.colorDefault && (0, _extends2.default)({
|
|
83
|
+
color: (theme.vars || theme).palette.background.default
|
|
84
|
+
}, theme.vars ? {
|
|
85
|
+
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
|
86
|
+
} : {
|
|
84
87
|
backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
|
|
85
|
-
}));
|
|
88
|
+
})));
|
|
86
89
|
const AvatarImg = (0, _styled.default)('img', {
|
|
87
90
|
name: 'MuiAvatar',
|
|
88
91
|
slot: 'Img',
|
package/node/Badge/Badge.js
CHANGED
|
@@ -347,8 +347,8 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
347
347
|
* @default {}
|
|
348
348
|
*/
|
|
349
349
|
componentsProps: _propTypes.default.shape({
|
|
350
|
-
badge: _propTypes.default.object,
|
|
351
|
-
root: _propTypes.default.object
|
|
350
|
+
badge: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
351
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
352
352
|
}),
|
|
353
353
|
|
|
354
354
|
/**
|
|
File without changes
|
package/node/Chip/Chip.js
CHANGED
|
@@ -106,6 +106,7 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
106
106
|
ownerState
|
|
107
107
|
}) => {
|
|
108
108
|
const deleteIconColor = (0, _system.alpha)(theme.palette.text.primary, 0.26);
|
|
109
|
+
const textColor = theme.palette.mode === 'light' ? theme.palette.grey[700] : theme.palette.grey[300];
|
|
109
110
|
return (0, _extends2.default)({
|
|
110
111
|
maxWidth: '100%',
|
|
111
112
|
fontFamily: theme.typography.fontFamily,
|
|
@@ -114,8 +115,8 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
114
115
|
alignItems: 'center',
|
|
115
116
|
justifyContent: 'center',
|
|
116
117
|
height: 32,
|
|
117
|
-
color: theme.palette.text.primary,
|
|
118
|
-
backgroundColor: theme.palette.action.selected,
|
|
118
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
119
|
+
backgroundColor: (theme.vars || theme).palette.action.selected,
|
|
119
120
|
borderRadius: 32 / 2,
|
|
120
121
|
whiteSpace: 'nowrap',
|
|
121
122
|
transition: theme.transitions.create(['background-color', 'box-shadow']),
|
|
@@ -131,7 +132,7 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
131
132
|
verticalAlign: 'middle',
|
|
132
133
|
boxSizing: 'border-box',
|
|
133
134
|
[`&.${_chipClasses.default.disabled}`]: {
|
|
134
|
-
opacity: theme.palette.action.disabledOpacity,
|
|
135
|
+
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
|
135
136
|
pointerEvents: 'none'
|
|
136
137
|
},
|
|
137
138
|
[`& .${_chipClasses.default.avatar}`]: {
|
|
@@ -139,16 +140,16 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
139
140
|
marginRight: -6,
|
|
140
141
|
width: 24,
|
|
141
142
|
height: 24,
|
|
142
|
-
color: theme.
|
|
143
|
+
color: theme.vars ? theme.vars.palette.Chip.defaultAvatarColor : textColor,
|
|
143
144
|
fontSize: theme.typography.pxToRem(12)
|
|
144
145
|
},
|
|
145
146
|
[`& .${_chipClasses.default.avatarColorPrimary}`]: {
|
|
146
|
-
color: theme.palette.primary.contrastText,
|
|
147
|
-
backgroundColor: theme.palette.primary.dark
|
|
147
|
+
color: (theme.vars || theme).palette.primary.contrastText,
|
|
148
|
+
backgroundColor: (theme.vars || theme).palette.primary.dark
|
|
148
149
|
},
|
|
149
150
|
[`& .${_chipClasses.default.avatarColorSecondary}`]: {
|
|
150
|
-
color: theme.palette.secondary.contrastText,
|
|
151
|
-
backgroundColor: theme.palette.secondary.dark
|
|
151
|
+
color: (theme.vars || theme).palette.secondary.contrastText,
|
|
152
|
+
backgroundColor: (theme.vars || theme).palette.secondary.dark
|
|
152
153
|
},
|
|
153
154
|
[`& .${_chipClasses.default.avatarSmall}`]: {
|
|
154
155
|
marginLeft: 4,
|
|
@@ -158,7 +159,7 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
158
159
|
fontSize: theme.typography.pxToRem(10)
|
|
159
160
|
},
|
|
160
161
|
[`& .${_chipClasses.default.icon}`]: (0, _extends2.default)({
|
|
161
|
-
color: theme.
|
|
162
|
+
color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor,
|
|
162
163
|
marginLeft: 5,
|
|
163
164
|
marginRight: -6
|
|
164
165
|
}, ownerState.size === 'small' && {
|
|
@@ -170,35 +171,35 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
170
171
|
}),
|
|
171
172
|
[`& .${_chipClasses.default.deleteIcon}`]: (0, _extends2.default)({
|
|
172
173
|
WebkitTapHighlightColor: 'transparent',
|
|
173
|
-
color: deleteIconColor,
|
|
174
|
+
color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.26)` : deleteIconColor,
|
|
174
175
|
fontSize: 22,
|
|
175
176
|
cursor: 'pointer',
|
|
176
177
|
margin: '0 5px 0 -6px',
|
|
177
178
|
'&:hover': {
|
|
178
|
-
color: (0, _system.alpha)(deleteIconColor, 0.4)
|
|
179
|
+
color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.4)` : (0, _system.alpha)(deleteIconColor, 0.4)
|
|
179
180
|
}
|
|
180
181
|
}, ownerState.size === 'small' && {
|
|
181
182
|
fontSize: 16,
|
|
182
183
|
marginRight: 4,
|
|
183
184
|
marginLeft: -4
|
|
184
185
|
}, ownerState.color !== 'default' && {
|
|
185
|
-
color: (0, _system.alpha)(theme.palette[ownerState.color].contrastText, 0.7),
|
|
186
|
+
color: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].contrastTextChannel} / 0.7)` : (0, _system.alpha)(theme.palette[ownerState.color].contrastText, 0.7),
|
|
186
187
|
'&:hover, &:active': {
|
|
187
|
-
color: theme.palette[ownerState.color].contrastText
|
|
188
|
+
color: (theme.vars || theme).palette[ownerState.color].contrastText
|
|
188
189
|
}
|
|
189
190
|
})
|
|
190
191
|
}, ownerState.size === 'small' && {
|
|
191
192
|
height: 24
|
|
192
193
|
}, ownerState.color !== 'default' && {
|
|
193
|
-
backgroundColor: theme.palette[ownerState.color].main,
|
|
194
|
-
color: theme.palette[ownerState.color].contrastText
|
|
194
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main,
|
|
195
|
+
color: (theme.vars || theme).palette[ownerState.color].contrastText
|
|
195
196
|
}, ownerState.onDelete && {
|
|
196
197
|
[`&.${_chipClasses.default.focusVisible}`]: {
|
|
197
|
-
backgroundColor: (0, _system.alpha)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
198
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity + theme.vars.palette.action.focusOpacity}))` : (0, _system.alpha)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
198
199
|
}
|
|
199
200
|
}, ownerState.onDelete && ownerState.color !== 'default' && {
|
|
200
201
|
[`&.${_chipClasses.default.focusVisible}`]: {
|
|
201
|
-
backgroundColor: theme.palette[ownerState.color].dark
|
|
202
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].dark
|
|
202
203
|
}
|
|
203
204
|
});
|
|
204
205
|
}, ({
|
|
@@ -209,29 +210,29 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
209
210
|
WebkitTapHighlightColor: 'transparent',
|
|
210
211
|
cursor: 'pointer',
|
|
211
212
|
'&:hover': {
|
|
212
|
-
backgroundColor: (0, _system.alpha)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
|
213
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity + theme.vars.palette.action.hoverOpacity}))` : (0, _system.alpha)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
|
213
214
|
},
|
|
214
215
|
[`&.${_chipClasses.default.focusVisible}`]: {
|
|
215
|
-
backgroundColor: (0, _system.alpha)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
216
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity + theme.vars.palette.action.focusOpacity}))` : (0, _system.alpha)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
216
217
|
},
|
|
217
218
|
'&:active': {
|
|
218
|
-
boxShadow: theme.shadows[1]
|
|
219
|
+
boxShadow: (theme.vars || theme).shadows[1]
|
|
219
220
|
}
|
|
220
221
|
}, ownerState.clickable && ownerState.color !== 'default' && {
|
|
221
222
|
[`&:hover, &.${_chipClasses.default.focusVisible}`]: {
|
|
222
|
-
backgroundColor: theme.palette[ownerState.color].dark
|
|
223
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].dark
|
|
223
224
|
}
|
|
224
225
|
}), ({
|
|
225
226
|
theme,
|
|
226
227
|
ownerState
|
|
227
228
|
}) => (0, _extends2.default)({}, ownerState.variant === 'outlined' && {
|
|
228
229
|
backgroundColor: 'transparent',
|
|
229
|
-
border: `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700]}`,
|
|
230
|
+
border: theme.vars ? `1px solid ${theme.vars.palette.Chip.defaultBorder}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700]}`,
|
|
230
231
|
[`&.${_chipClasses.default.clickable}:hover`]: {
|
|
231
|
-
backgroundColor: theme.palette.action.hover
|
|
232
|
+
backgroundColor: (theme.vars || theme).palette.action.hover
|
|
232
233
|
},
|
|
233
234
|
[`&.${_chipClasses.default.focusVisible}`]: {
|
|
234
|
-
backgroundColor: theme.palette.action.focus
|
|
235
|
+
backgroundColor: (theme.vars || theme).palette.action.focus
|
|
235
236
|
},
|
|
236
237
|
[`& .${_chipClasses.default.avatar}`]: {
|
|
237
238
|
marginLeft: 4
|
|
@@ -252,18 +253,18 @@ const ChipRoot = (0, _styled.default)('div', {
|
|
|
252
253
|
marginRight: 3
|
|
253
254
|
}
|
|
254
255
|
}, ownerState.variant === 'outlined' && ownerState.color !== 'default' && {
|
|
255
|
-
color: theme.palette[ownerState.color].main,
|
|
256
|
-
border: `1px solid ${(0, _system.alpha)(theme.palette[ownerState.color].main, 0.7)}`,
|
|
256
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
257
|
+
border: `1px solid ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.7)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.7)}`,
|
|
257
258
|
[`&.${_chipClasses.default.clickable}:hover`]: {
|
|
258
|
-
backgroundColor: (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity)
|
|
259
|
+
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)
|
|
259
260
|
},
|
|
260
261
|
[`&.${_chipClasses.default.focusVisible}`]: {
|
|
261
|
-
backgroundColor: (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.focusOpacity)
|
|
262
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.focusOpacity)
|
|
262
263
|
},
|
|
263
264
|
[`& .${_chipClasses.default.deleteIcon}`]: {
|
|
264
|
-
color: (0, _system.alpha)(theme.palette[ownerState.color].main, 0.7),
|
|
265
|
+
color: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.7)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.7),
|
|
265
266
|
'&:hover, &:active': {
|
|
266
|
-
color: theme.palette[ownerState.color].main
|
|
267
|
+
color: (theme.vars || theme).palette[ownerState.color].main
|
|
267
268
|
}
|
|
268
269
|
}
|
|
269
270
|
}));
|