@mui/material 5.8.4 → 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/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/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/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 +69 -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/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 +25 -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/selectClasses.d.ts +30 -30
- package/Skeleton/Skeleton.js +8 -3
- package/Skeleton/skeletonClasses.d.ts +24 -24
- package/Slider/Slider.js +12 -12
- 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 +6 -16
- 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/AppBar/AppBar.js +23 -4
- 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/InputBase/InputBase.js +2 -2
- package/legacy/LinearProgress/LinearProgress.js +6 -2
- package/legacy/Modal/Modal.js +23 -7
- package/legacy/OutlinedInput/OutlinedInput.js +21 -9
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Slider/Slider.js +12 -12
- 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 +6 -16
- package/legacy/Tooltip/Tooltip.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +113 -18
- package/locale/index.d.ts +71 -71
- package/modern/AppBar/AppBar.js +22 -5
- 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/InputBase/InputBase.js +2 -2
- package/modern/LinearProgress/LinearProgress.js +6 -2
- package/modern/Modal/Modal.js +24 -7
- package/modern/OutlinedInput/OutlinedInput.js +25 -10
- package/modern/Skeleton/Skeleton.js +7 -2
- package/modern/Slider/Slider.js +12 -12
- 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 +6 -16
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +1 -1
- package/modern/styles/experimental_extendTheme.js +114 -18
- package/node/AppBar/AppBar.js +22 -5
- 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/InputBase/InputBase.js +2 -2
- package/node/LinearProgress/LinearProgress.js +6 -2
- package/node/Modal/Modal.js +25 -8
- package/node/OutlinedInput/OutlinedInput.js +25 -10
- package/node/Skeleton/Skeleton.js +7 -2
- package/node/Slider/Slider.js +12 -12
- 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 +6 -16
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +1 -1
- package/node/styles/experimental_extendTheme.js +112 -17
- package/package.json +4 -4
- package/styles/CssVarsProvider.js +1 -1
- package/styles/createPalette.d.ts +65 -2
- package/styles/experimental_extendTheme.js +114 -18
- 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 +548 -240
- 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
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["colorSchemes"],
|
|
4
4
|
_excluded2 = ["palette"];
|
|
5
5
|
import { deepmerge } from '@mui/utils';
|
|
6
|
-
import { colorChannel } from '@mui/system';
|
|
6
|
+
import { colorChannel, alpha, darken, lighten, emphasize } 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,6 +14,19 @@ 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
|
+
|
|
17
30
|
export default function extendTheme(options = {}, ...args) {
|
|
18
31
|
const {
|
|
19
32
|
colorSchemes: colorSchemesInput = {}
|
|
@@ -41,16 +54,20 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
41
54
|
light: _extends({}, colorSchemesInput.light, {
|
|
42
55
|
palette: lightPalette,
|
|
43
56
|
opacity: _extends({
|
|
44
|
-
|
|
45
|
-
inputTouchBottomLine: 0.42
|
|
57
|
+
inputPlaceholder: 0.42,
|
|
58
|
+
inputTouchBottomLine: 0.42,
|
|
59
|
+
switchTrackDisabled: 0.12,
|
|
60
|
+
switchTrack: 0.38
|
|
46
61
|
}, colorSchemesInput.light?.opacity),
|
|
47
62
|
overlays: colorSchemesInput.light?.overlays || []
|
|
48
63
|
}),
|
|
49
64
|
dark: _extends({}, colorSchemesInput.dark, {
|
|
50
65
|
palette: darkPalette,
|
|
51
66
|
opacity: _extends({
|
|
52
|
-
|
|
53
|
-
inputTouchBottomLine: 0.7
|
|
67
|
+
inputPlaceholder: 0.5,
|
|
68
|
+
inputTouchBottomLine: 0.7,
|
|
69
|
+
switchTrackDisabled: 0.2,
|
|
70
|
+
switchTrack: 0.3
|
|
54
71
|
}, colorSchemesInput.dark?.opacity),
|
|
55
72
|
overlays: colorSchemesInput.dark?.overlays || defaultDarkOverlays
|
|
56
73
|
})
|
|
@@ -60,23 +77,98 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
60
77
|
Object.keys(theme.colorSchemes).forEach(key => {
|
|
61
78
|
const palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
|
|
62
79
|
|
|
63
|
-
if (key === '
|
|
64
|
-
palette.common
|
|
65
|
-
palette.common
|
|
80
|
+
if (key === 'light') {
|
|
81
|
+
setColor(palette.common, 'background', '#fff');
|
|
82
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
83
|
+
} else {
|
|
84
|
+
setColor(palette.common, 'background', '#000');
|
|
85
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
86
|
+
} // assign component variables
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
assignNode(palette, ['AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
90
|
+
|
|
91
|
+
if (key === 'light') {
|
|
92
|
+
setColor(palette.AppBar, 'defaultBg', 'var(--mui-palette-grey-100)');
|
|
93
|
+
setColor(palette.Avatar, 'defaultBg', 'var(--mui-palette-grey-400)');
|
|
94
|
+
setColor(palette.Chip, 'defaultBorder', 'var(--mui-palette-grey-400)');
|
|
95
|
+
setColor(palette.Chip, 'defaultAvatarColor', 'var(--mui-palette-grey-700)');
|
|
96
|
+
setColor(palette.Chip, 'defaultIconColor', 'var(--mui-palette-grey-700)');
|
|
97
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
98
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
99
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
100
|
+
setColor(palette.LinearProgress, 'primaryBg', lighten(palette.primary.main, 0.62));
|
|
101
|
+
setColor(palette.LinearProgress, 'secondaryBg', lighten(palette.secondary.main, 0.62));
|
|
102
|
+
setColor(palette.LinearProgress, 'errorBg', lighten(palette.error.main, 0.62));
|
|
103
|
+
setColor(palette.LinearProgress, 'infoBg', lighten(palette.info.main, 0.62));
|
|
104
|
+
setColor(palette.LinearProgress, 'successBg', lighten(palette.success.main, 0.62));
|
|
105
|
+
setColor(palette.LinearProgress, 'warningBg', lighten(palette.warning.main, 0.62));
|
|
106
|
+
setColor(palette.Skeleton, 'bg', 'rgba(var(--mui-palette-text-primaryChannel) / 0.11)');
|
|
107
|
+
setColor(palette.Slider, 'primaryTrack', lighten(palette.primary.main, 0.62));
|
|
108
|
+
setColor(palette.Slider, 'secondaryTrack', lighten(palette.secondary.main, 0.62));
|
|
109
|
+
setColor(palette.Slider, 'errorTrack', lighten(palette.error.main, 0.62));
|
|
110
|
+
setColor(palette.Slider, 'infoTrack', lighten(palette.info.main, 0.62));
|
|
111
|
+
setColor(palette.Slider, 'successTrack', lighten(palette.success.main, 0.62));
|
|
112
|
+
setColor(palette.Slider, 'warningTrack', lighten(palette.warning.main, 0.62));
|
|
113
|
+
setColor(palette.SnackbarContent, 'bg', emphasize(palette.background.default, 0.8));
|
|
114
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
115
|
+
setColor(palette.StepConnector, 'border', 'var(--mui-palette-grey-400)');
|
|
116
|
+
setColor(palette.StepContent, 'border', 'var(--mui-palette-grey-400)');
|
|
117
|
+
setColor(palette.Switch, 'defaultColor', 'var(--mui-palette-common-white)');
|
|
118
|
+
setColor(palette.Switch, 'defaultDisabledColor', 'var(--mui-palette-grey-100)');
|
|
119
|
+
setColor(palette.Switch, 'primaryDisabledColor', lighten(palette.primary.main, 0.62));
|
|
120
|
+
setColor(palette.Switch, 'secondaryDisabledColor', lighten(palette.secondary.main, 0.62));
|
|
121
|
+
setColor(palette.Switch, 'errorDisabledColor', lighten(palette.error.main, 0.62));
|
|
122
|
+
setColor(palette.Switch, 'infoDisabledColor', lighten(palette.info.main, 0.62));
|
|
123
|
+
setColor(palette.Switch, 'successDisabledColor', lighten(palette.success.main, 0.62));
|
|
124
|
+
setColor(palette.Switch, 'warningDisabledColor', lighten(palette.warning.main, 0.62));
|
|
125
|
+
setColor(palette.TableCell, 'border', lighten(alpha(palette.divider, 1), 0.88));
|
|
126
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
66
127
|
} else {
|
|
67
|
-
palette.
|
|
68
|
-
palette.
|
|
128
|
+
setColor(palette.AppBar, 'defaultBg', 'var(--mui-palette-grey-900)');
|
|
129
|
+
setColor(palette.AppBar, 'darkBg', 'var(--mui-palette-background-paper)'); // specific for dark mode
|
|
130
|
+
|
|
131
|
+
setColor(palette.AppBar, 'darkColor', 'var(--mui-palette-text-primary)'); // specific for dark mode
|
|
132
|
+
|
|
133
|
+
setColor(palette.Avatar, 'defaultBg', 'var(--mui-palette-grey-600)');
|
|
134
|
+
setColor(palette.Chip, 'defaultBorder', 'var(--mui-palette-grey-700)');
|
|
135
|
+
setColor(palette.Chip, 'defaultAvatarColor', 'var(--mui-palette-grey-300)');
|
|
136
|
+
setColor(palette.Chip, 'defaultIconColor', 'var(--mui-palette-grey-300)');
|
|
137
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
138
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
139
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
140
|
+
setColor(palette.LinearProgress, 'primaryBg', darken(palette.primary.main, 0.5));
|
|
141
|
+
setColor(palette.LinearProgress, 'secondaryBg', darken(palette.secondary.main, 0.5));
|
|
142
|
+
setColor(palette.LinearProgress, 'errorBg', darken(palette.error.main, 0.5));
|
|
143
|
+
setColor(palette.LinearProgress, 'infoBg', darken(palette.info.main, 0.5));
|
|
144
|
+
setColor(palette.LinearProgress, 'successBg', darken(palette.success.main, 0.5));
|
|
145
|
+
setColor(palette.LinearProgress, 'warningBg', darken(palette.warning.main, 0.5));
|
|
146
|
+
setColor(palette.Skeleton, 'bg', 'rgba(var(--mui-palette-text-primaryChannel) / 0.13)');
|
|
147
|
+
setColor(palette.Slider, 'primaryTrack', darken(palette.primary.main, 0.5));
|
|
148
|
+
setColor(palette.Slider, 'secondaryTrack', darken(palette.secondary.main, 0.5));
|
|
149
|
+
setColor(palette.Slider, 'errorTrack', darken(palette.error.main, 0.5));
|
|
150
|
+
setColor(palette.Slider, 'infoTrack', darken(palette.info.main, 0.5));
|
|
151
|
+
setColor(palette.Slider, 'successTrack', darken(palette.success.main, 0.5));
|
|
152
|
+
setColor(palette.Slider, 'warningTrack', darken(palette.warning.main, 0.5));
|
|
153
|
+
setColor(palette.SnackbarContent, 'bg', emphasize(palette.background.default, 0.98));
|
|
154
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
155
|
+
setColor(palette.StepConnector, 'border', 'var(--mui-palette-grey-600)');
|
|
156
|
+
setColor(palette.StepContent, 'border', 'var(--mui-palette-grey-600)');
|
|
157
|
+
setColor(palette.Switch, 'defaultColor', 'var(--mui-palette-grey-300)');
|
|
158
|
+
setColor(palette.Switch, 'defaultDisabledColor', 'var(--mui-palette-grey-600)');
|
|
159
|
+
setColor(palette.Switch, 'primaryDisabledColor', darken(palette.primary.main, 0.55));
|
|
160
|
+
setColor(palette.Switch, 'secondaryDisabledColor', darken(palette.secondary.main, 0.55));
|
|
161
|
+
setColor(palette.Switch, 'errorDisabledColor', darken(palette.error.main, 0.55));
|
|
162
|
+
setColor(palette.Switch, 'infoDisabledColor', darken(palette.info.main, 0.55));
|
|
163
|
+
setColor(palette.Switch, 'successDisabledColor', darken(palette.success.main, 0.55));
|
|
164
|
+
setColor(palette.Switch, 'warningDisabledColor', darken(palette.warning.main, 0.55));
|
|
165
|
+
setColor(palette.TableCell, 'border', darken(alpha(palette.divider, 1), 0.68));
|
|
166
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
69
167
|
}
|
|
70
168
|
|
|
71
169
|
palette.common.backgroundChannel = colorChannel(palette.common.background);
|
|
72
170
|
palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
|
|
73
|
-
palette.dividerChannel = colorChannel(palette.divider);
|
|
74
|
-
// TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
|
|
75
|
-
|
|
76
|
-
if (!palette.grey.dark) {
|
|
77
|
-
palette.grey.dark = palette.grey[700];
|
|
78
|
-
}
|
|
79
|
-
|
|
171
|
+
palette.dividerChannel = colorChannel(palette.divider);
|
|
80
172
|
Object.keys(palette).forEach(color => {
|
|
81
173
|
const colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
|
|
82
174
|
|
|
@@ -103,12 +195,16 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
103
195
|
|
|
104
196
|
if (colors.secondary) {
|
|
105
197
|
palette[color].secondaryChannel = colorChannel(colors.secondary);
|
|
106
|
-
} // Action colors: action.
|
|
198
|
+
} // Action colors: action.active, action.selected
|
|
107
199
|
|
|
108
200
|
|
|
109
201
|
if (colors.active) {
|
|
110
202
|
palette[color].activeChannel = colorChannel(colors.active);
|
|
111
203
|
}
|
|
204
|
+
|
|
205
|
+
if (colors.selected) {
|
|
206
|
+
palette[color].selectedChannel = colorChannel(colors.selected);
|
|
207
|
+
}
|
|
112
208
|
});
|
|
113
209
|
});
|
|
114
210
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
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) {
|
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
|
}));
|
package/node/Dialog/Dialog.js
CHANGED
|
@@ -157,7 +157,7 @@ const DialogPaper = (0, _styled.default)(_Paper.default, {
|
|
|
157
157
|
maxWidth: 'calc(100% - 64px)'
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
}, ownerState.maxWidth !== 'xs' && {
|
|
160
|
+
}, ownerState.maxWidth && ownerState.maxWidth !== 'xs' && {
|
|
161
161
|
maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`,
|
|
162
162
|
[`&.${_dialogClasses.default.paperScrollBody}`]: {
|
|
163
163
|
[theme.breakpoints.down(theme.breakpoints.values[ownerState.maxWidth] + 32 * 2)]: {
|
|
@@ -255,12 +255,16 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
255
255
|
}, [ariaLabelledby]);
|
|
256
256
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogRoot, (0, _extends2.default)({
|
|
257
257
|
className: (0, _clsx.default)(classes.root, className),
|
|
258
|
-
BackdropProps: (0, _extends2.default)({
|
|
259
|
-
transitionDuration,
|
|
260
|
-
as: BackdropComponent
|
|
261
|
-
}, BackdropProps),
|
|
262
258
|
closeAfterTransition: true,
|
|
263
|
-
|
|
259
|
+
components: {
|
|
260
|
+
Backdrop: DialogBackdrop
|
|
261
|
+
},
|
|
262
|
+
componentsProps: {
|
|
263
|
+
backdrop: (0, _extends2.default)({
|
|
264
|
+
transitionDuration,
|
|
265
|
+
as: BackdropComponent
|
|
266
|
+
}, BackdropProps)
|
|
267
|
+
},
|
|
264
268
|
disableEscapeKeyDown: disableEscapeKeyDown,
|
|
265
269
|
onClose: onClose,
|
|
266
270
|
open: open,
|
|
@@ -316,6 +320,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes
|
|
|
316
320
|
|
|
317
321
|
/**
|
|
318
322
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
323
|
+
* @deprecated Use `components.Backdrop` instead.
|
|
319
324
|
* @default styled(Backdrop, {
|
|
320
325
|
* name: 'MuiModal',
|
|
321
326
|
* slot: 'Backdrop',
|
|
@@ -64,36 +64,38 @@ const FilledInputRoot = (0, _styled.default)(_InputBase2.InputBaseRoot, {
|
|
|
64
64
|
theme,
|
|
65
65
|
ownerState
|
|
66
66
|
}) => {
|
|
67
|
-
var
|
|
67
|
+
var _palette;
|
|
68
68
|
|
|
69
69
|
const light = theme.palette.mode === 'light';
|
|
70
70
|
const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
71
71
|
const backgroundColor = light ? 'rgba(0, 0, 0, 0.06)' : 'rgba(255, 255, 255, 0.09)';
|
|
72
|
+
const hoverBackground = light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.13)';
|
|
73
|
+
const disabledBackground = light ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)';
|
|
72
74
|
return (0, _extends2.default)({
|
|
73
75
|
position: 'relative',
|
|
74
|
-
backgroundColor,
|
|
75
|
-
borderTopLeftRadius: theme.shape.borderRadius,
|
|
76
|
-
borderTopRightRadius: theme.shape.borderRadius,
|
|
76
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor,
|
|
77
|
+
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
78
|
+
borderTopRightRadius: (theme.vars || theme).shape.borderRadius,
|
|
77
79
|
transition: theme.transitions.create('background-color', {
|
|
78
80
|
duration: theme.transitions.duration.shorter,
|
|
79
81
|
easing: theme.transitions.easing.easeOut
|
|
80
82
|
}),
|
|
81
83
|
'&:hover': {
|
|
82
|
-
backgroundColor:
|
|
84
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.hoverBg : hoverBackground,
|
|
83
85
|
// Reset on touch devices, it doesn't add specificity
|
|
84
86
|
'@media (hover: none)': {
|
|
85
|
-
backgroundColor
|
|
87
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
|
86
88
|
}
|
|
87
89
|
},
|
|
88
90
|
[`&.${_filledInputClasses.default.focused}`]: {
|
|
89
|
-
backgroundColor
|
|
91
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
|
90
92
|
},
|
|
91
93
|
[`&.${_filledInputClasses.default.disabled}`]: {
|
|
92
|
-
backgroundColor:
|
|
94
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.disabledBg : disabledBackground
|
|
93
95
|
}
|
|
94
96
|
}, !ownerState.disableUnderline && {
|
|
95
97
|
'&:after': {
|
|
96
|
-
borderBottom: `2px solid ${(
|
|
98
|
+
borderBottom: `2px solid ${(_palette = (theme.vars || theme).palette[ownerState.color || 'primary']) == null ? void 0 : _palette.main}`,
|
|
97
99
|
left: 0,
|
|
98
100
|
bottom: 0,
|
|
99
101
|
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
@@ -114,12 +116,12 @@ const FilledInputRoot = (0, _styled.default)(_InputBase2.InputBaseRoot, {
|
|
|
114
116
|
transform: 'scaleX(1) translateX(0)'
|
|
115
117
|
},
|
|
116
118
|
[`&.${_filledInputClasses.default.error}:after`]: {
|
|
117
|
-
borderBottomColor: theme.palette.error.main,
|
|
119
|
+
borderBottomColor: (theme.vars || theme).palette.error.main,
|
|
118
120
|
transform: 'scaleX(1)' // error is always underlined in red
|
|
119
121
|
|
|
120
122
|
},
|
|
121
123
|
'&:before': {
|
|
122
|
-
borderBottom: `1px solid ${bottomLineColor}`,
|
|
124
|
+
borderBottom: `1px solid ${theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputTouchBottomLine})` : bottomLineColor}`,
|
|
123
125
|
left: 0,
|
|
124
126
|
bottom: 0,
|
|
125
127
|
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
@@ -133,7 +135,7 @@ const FilledInputRoot = (0, _styled.default)(_InputBase2.InputBaseRoot, {
|
|
|
133
135
|
|
|
134
136
|
},
|
|
135
137
|
[`&:hover:not(.${_filledInputClasses.default.disabled}):before`]: {
|
|
136
|
-
borderBottom: `1px solid ${theme.palette.text.primary}`
|
|
138
|
+
borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`
|
|
137
139
|
},
|
|
138
140
|
[`&.${_filledInputClasses.default.disabled}:before`]: {
|
|
139
141
|
borderBottomStyle: 'dotted'
|
|
@@ -163,7 +165,8 @@ const FilledInputInput = (0, _styled.default)(_InputBase2.InputBaseComponent, {
|
|
|
163
165
|
paddingTop: 25,
|
|
164
166
|
paddingRight: 12,
|
|
165
167
|
paddingBottom: 8,
|
|
166
|
-
paddingLeft: 12
|
|
168
|
+
paddingLeft: 12
|
|
169
|
+
}, !theme.vars && {
|
|
167
170
|
'&:-webkit-autofill': {
|
|
168
171
|
WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset',
|
|
169
172
|
WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff',
|
|
@@ -171,6 +174,18 @@ const FilledInputInput = (0, _styled.default)(_InputBase2.InputBaseComponent, {
|
|
|
171
174
|
borderTopLeftRadius: 'inherit',
|
|
172
175
|
borderTopRightRadius: 'inherit'
|
|
173
176
|
}
|
|
177
|
+
}, theme.vars && {
|
|
178
|
+
'&:-webkit-autofill': {
|
|
179
|
+
borderTopLeftRadius: 'inherit',
|
|
180
|
+
borderTopRightRadius: 'inherit'
|
|
181
|
+
},
|
|
182
|
+
[theme.getColorSchemeSelector('dark')]: {
|
|
183
|
+
'&:-webkit-autofill': {
|
|
184
|
+
WebkitBoxShadow: '0 0 0 100px #266798 inset',
|
|
185
|
+
WebkitTextFillColor: '#fff',
|
|
186
|
+
caretColor: '#fff'
|
|
187
|
+
}
|
|
188
|
+
}
|
|
174
189
|
}, ownerState.size === 'small' && {
|
|
175
190
|
paddingTop: 21,
|
|
176
191
|
paddingBottom: 4
|
|
@@ -133,7 +133,7 @@ const InputBaseComponent = (0, _styled.default)('input', {
|
|
|
133
133
|
const placeholder = (0, _extends2.default)({
|
|
134
134
|
color: 'currentColor'
|
|
135
135
|
}, theme.vars ? {
|
|
136
|
-
opacity: theme.vars.opacity.
|
|
136
|
+
opacity: theme.vars.opacity.inputPlaceholder
|
|
137
137
|
} : {
|
|
138
138
|
opacity: light ? 0.42 : 0.5
|
|
139
139
|
}, {
|
|
@@ -145,7 +145,7 @@ const InputBaseComponent = (0, _styled.default)('input', {
|
|
|
145
145
|
opacity: '0 !important'
|
|
146
146
|
};
|
|
147
147
|
const placeholderVisible = theme.vars ? {
|
|
148
|
-
opacity: theme.vars.opacity.
|
|
148
|
+
opacity: theme.vars.opacity.inputPlaceholder
|
|
149
149
|
} : {
|
|
150
150
|
opacity: light ? 0.42 : 0.5
|
|
151
151
|
};
|
|
@@ -110,6 +110,10 @@ const getColorShade = (theme, color) => {
|
|
|
110
110
|
return 'currentColor';
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
if (theme.vars) {
|
|
114
|
+
return theme.vars.palette.LinearProgress[`${color}Bg`];
|
|
115
|
+
}
|
|
116
|
+
|
|
113
117
|
return theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[color].main, 0.62) : (0, _system.darken)(theme.palette[color].main, 0.5);
|
|
114
118
|
};
|
|
115
119
|
|
|
@@ -202,7 +206,7 @@ const LinearProgressBar1 = (0, _styled.default)('span', {
|
|
|
202
206
|
top: 0,
|
|
203
207
|
transition: 'transform 0.2s linear',
|
|
204
208
|
transformOrigin: 'left',
|
|
205
|
-
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : theme.palette[ownerState.color].main
|
|
209
|
+
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : (theme.vars || theme).palette[ownerState.color].main
|
|
206
210
|
}, ownerState.variant === 'determinate' && {
|
|
207
211
|
transition: `transform .${TRANSITION_DURATION}s linear`
|
|
208
212
|
}, ownerState.variant === 'buffer' && {
|
|
@@ -235,7 +239,7 @@ const LinearProgressBar2 = (0, _styled.default)('span', {
|
|
|
235
239
|
transition: 'transform 0.2s linear',
|
|
236
240
|
transformOrigin: 'left'
|
|
237
241
|
}, ownerState.variant !== 'buffer' && {
|
|
238
|
-
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : theme.palette[ownerState.color].main
|
|
242
|
+
backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : (theme.vars || theme).palette[ownerState.color].main
|
|
239
243
|
}, ownerState.color === 'inherit' && {
|
|
240
244
|
opacity: 0.3
|
|
241
245
|
}, ownerState.variant === 'buffer' && {
|