@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
package/node/Switch/Switch.js
CHANGED
|
@@ -126,7 +126,7 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
126
126
|
left: 0,
|
|
127
127
|
zIndex: 1,
|
|
128
128
|
// Render above the focus ripple.
|
|
129
|
-
color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]
|
|
129
|
+
color: theme.vars ? theme.vars.palette.Switch.defaultColor : `${theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300]}`,
|
|
130
130
|
transition: theme.transitions.create(['left', 'transform'], {
|
|
131
131
|
duration: theme.transitions.duration.shortest
|
|
132
132
|
}),
|
|
@@ -134,13 +134,13 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
134
134
|
transform: 'translateX(20px)'
|
|
135
135
|
},
|
|
136
136
|
[`&.${_switchClasses.default.disabled}`]: {
|
|
137
|
-
color: theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]
|
|
137
|
+
color: theme.vars ? theme.vars.palette.Switch.defaultDisabledColor : `${theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]}`
|
|
138
138
|
},
|
|
139
139
|
[`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
|
|
140
140
|
opacity: 0.5
|
|
141
141
|
},
|
|
142
142
|
[`&.${_switchClasses.default.disabled} + .${_switchClasses.default.track}`]: {
|
|
143
|
-
opacity: theme.palette.mode === 'light' ? 0.12 : 0.2
|
|
143
|
+
opacity: theme.vars ? theme.vars.opacity.switchTrackDisabled : `${theme.palette.mode === 'light' ? 0.12 : 0.2}`
|
|
144
144
|
},
|
|
145
145
|
[`& .${_switchClasses.default.input}`]: {
|
|
146
146
|
left: '-100%',
|
|
@@ -151,7 +151,7 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
151
151
|
ownerState
|
|
152
152
|
}) => (0, _extends2.default)({
|
|
153
153
|
'&:hover': {
|
|
154
|
-
backgroundColor: (0, _system.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
154
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
155
155
|
// Reset on touch devices, it doesn't add specificity
|
|
156
156
|
'@media (hover: none)': {
|
|
157
157
|
backgroundColor: 'transparent'
|
|
@@ -159,19 +159,19 @@ const SwitchSwitchBase = (0, _styled.default)(_SwitchBase.default, {
|
|
|
159
159
|
}
|
|
160
160
|
}, ownerState.color !== 'default' && {
|
|
161
161
|
[`&.${_switchClasses.default.checked}`]: {
|
|
162
|
-
color: theme.palette[ownerState.color].main,
|
|
162
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
163
163
|
'&:hover': {
|
|
164
|
-
backgroundColor: (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
164
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _system.alpha)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
165
165
|
'@media (hover: none)': {
|
|
166
166
|
backgroundColor: 'transparent'
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
[`&.${_switchClasses.default.disabled}`]: {
|
|
170
|
-
color: theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[ownerState.color].main, 0.62) : (0, _system.darken)(theme.palette[ownerState.color].main, 0.55)
|
|
170
|
+
color: theme.vars ? theme.vars.palette.Switch[`${ownerState.color}DisabledColor`] : `${theme.palette.mode === 'light' ? (0, _system.lighten)(theme.palette[ownerState.color].main, 0.62) : (0, _system.darken)(theme.palette[ownerState.color].main, 0.55)}`
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
[`&.${_switchClasses.default.checked} + .${_switchClasses.default.track}`]: {
|
|
174
|
-
backgroundColor: theme.palette[ownerState.color].main
|
|
174
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
175
175
|
}
|
|
176
176
|
}));
|
|
177
177
|
const SwitchTrack = (0, _styled.default)('span', {
|
|
@@ -188,8 +188,8 @@ const SwitchTrack = (0, _styled.default)('span', {
|
|
|
188
188
|
transition: theme.transitions.create(['opacity', 'background-color'], {
|
|
189
189
|
duration: theme.transitions.duration.shortest
|
|
190
190
|
}),
|
|
191
|
-
backgroundColor: theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white
|
|
192
|
-
opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
|
|
191
|
+
backgroundColor: theme.vars ? theme.vars.palette.common.onBackground : `${theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white}`,
|
|
192
|
+
opacity: theme.vars ? theme.vars.opacity.switchTrack : `${theme.palette.mode === 'light' ? 0.38 : 0.3}`
|
|
193
193
|
}));
|
|
194
194
|
const SwitchThumb = (0, _styled.default)('span', {
|
|
195
195
|
name: 'MuiSwitch',
|
|
@@ -198,7 +198,7 @@ const SwitchThumb = (0, _styled.default)('span', {
|
|
|
198
198
|
})(({
|
|
199
199
|
theme
|
|
200
200
|
}) => ({
|
|
201
|
-
boxShadow: theme.shadows[1],
|
|
201
|
+
boxShadow: (theme.vars || theme).shadows[1],
|
|
202
202
|
backgroundColor: 'currentColor',
|
|
203
203
|
width: 20,
|
|
204
204
|
height: 20,
|
|
@@ -73,18 +73,18 @@ const TableCellRoot = (0, _styled.default)('td', {
|
|
|
73
73
|
verticalAlign: 'inherit',
|
|
74
74
|
// Workaround for a rendering bug with spanned columns in Chrome 62.0.
|
|
75
75
|
// Removes the alpha (sets it to 1), and lightens or darkens the theme color.
|
|
76
|
-
borderBottom: `1px solid
|
|
76
|
+
borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
|
|
77
77
|
${theme.palette.mode === 'light' ? (0, _system.lighten)((0, _system.alpha)(theme.palette.divider, 1), 0.88) : (0, _system.darken)((0, _system.alpha)(theme.palette.divider, 1), 0.68)}`,
|
|
78
78
|
textAlign: 'left',
|
|
79
79
|
padding: 16
|
|
80
80
|
}, ownerState.variant === 'head' && {
|
|
81
|
-
color: theme.palette.text.primary,
|
|
81
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
82
82
|
lineHeight: theme.typography.pxToRem(24),
|
|
83
83
|
fontWeight: theme.typography.fontWeightMedium
|
|
84
84
|
}, ownerState.variant === 'body' && {
|
|
85
|
-
color: theme.palette.text.primary
|
|
85
|
+
color: (theme.vars || theme).palette.text.primary
|
|
86
86
|
}, ownerState.variant === 'footer' && {
|
|
87
|
-
color: theme.palette.text.secondary,
|
|
87
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
88
88
|
lineHeight: theme.typography.pxToRem(21),
|
|
89
89
|
fontSize: theme.typography.pxToRem(12)
|
|
90
90
|
}, ownerState.size === 'small' && {
|
|
@@ -116,7 +116,7 @@ const TableCellRoot = (0, _styled.default)('td', {
|
|
|
116
116
|
position: 'sticky',
|
|
117
117
|
top: 0,
|
|
118
118
|
zIndex: 2,
|
|
119
|
-
backgroundColor: theme.palette.background.default
|
|
119
|
+
backgroundColor: (theme.vars || theme).palette.background.default
|
|
120
120
|
}));
|
|
121
121
|
/**
|
|
122
122
|
* The component renders a `<th>` element when the parent context is a header
|
package/node/Tabs/Tabs.js
CHANGED
|
@@ -446,31 +446,21 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
446
446
|
scroll(scrollValue);
|
|
447
447
|
};
|
|
448
448
|
|
|
449
|
-
const getFirstVisibleTab = tabs => {
|
|
450
|
-
const containerSize = tabsRef.current[clientSize];
|
|
451
|
-
const containerStartBound = Math.round(tabsRef.current[scrollStart]);
|
|
452
|
-
const containerEndBound = Math.round(containerStartBound + containerSize);
|
|
453
|
-
const offset = vertical ? 'offsetTop' : 'offsetLeft';
|
|
454
|
-
return tabs.find(tab => {
|
|
455
|
-
const centerPoint = tab[offset] + tab[clientSize] / 2;
|
|
456
|
-
return centerPoint >= containerStartBound && centerPoint <= containerEndBound;
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
|
-
|
|
460
449
|
const getScrollSize = () => {
|
|
461
450
|
const containerSize = tabsRef.current[clientSize];
|
|
462
451
|
let totalSize = 0;
|
|
463
452
|
const children = Array.from(tabListRef.current.children);
|
|
464
|
-
const firstVisibleTab = getFirstVisibleTab(children);
|
|
465
|
-
|
|
466
|
-
if (firstVisibleTab && firstVisibleTab[clientSize] > containerSize) {
|
|
467
|
-
return firstVisibleTab[clientSize];
|
|
468
|
-
}
|
|
469
453
|
|
|
470
454
|
for (let i = 0; i < children.length; i += 1) {
|
|
471
455
|
const tab = children[i];
|
|
472
456
|
|
|
473
457
|
if (totalSize + tab[clientSize] > containerSize) {
|
|
458
|
+
// If the first item is longer than the container size, then only scroll
|
|
459
|
+
// by the container size.
|
|
460
|
+
if (i === 0) {
|
|
461
|
+
totalSize = containerSize;
|
|
462
|
+
}
|
|
463
|
+
|
|
474
464
|
break;
|
|
475
465
|
}
|
|
476
466
|
|
|
@@ -580,8 +570,16 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
580
570
|
});
|
|
581
571
|
React.useEffect(() => {
|
|
582
572
|
const handleResize = (0, _debounce.default)(() => {
|
|
583
|
-
|
|
584
|
-
|
|
573
|
+
// If the Tabs component is replaced by Suspense with a fallback, the last
|
|
574
|
+
// ResizeObserver's handler that runs because of the change in the layout is trying to
|
|
575
|
+
// access a dom node that is no longer there (as the fallback component is being shown instead).
|
|
576
|
+
// See https://github.com/mui/material-ui/issues/33276
|
|
577
|
+
// TODO: Add tests that will ensure the component is not failing when
|
|
578
|
+
// replaced by Suspense with a fallback, once React is updated to version 18
|
|
579
|
+
if (tabsRef.current) {
|
|
580
|
+
updateIndicatorState();
|
|
581
|
+
updateScrollButtonState();
|
|
582
|
+
}
|
|
585
583
|
});
|
|
586
584
|
const win = (0, _ownerWindow.default)(tabsRef.current);
|
|
587
585
|
win.addEventListener('resize', handleResize);
|
package/node/Tooltip/Tooltip.js
CHANGED
|
@@ -151,7 +151,7 @@ const TooltipTooltip = (0, _styled.default)('div', {
|
|
|
151
151
|
theme,
|
|
152
152
|
ownerState
|
|
153
153
|
}) => (0, _extends2.default)({
|
|
154
|
-
backgroundColor: theme.vars ?
|
|
154
|
+
backgroundColor: theme.vars ? theme.vars.palette.Tooltip.bg : (0, _system.alpha)(theme.palette.grey[700], 0.92),
|
|
155
155
|
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
156
156
|
color: (theme.vars || theme).palette.common.white,
|
|
157
157
|
fontFamily: theme.typography.fontFamily,
|
package/node/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.useColorScheme = exports.getInitColorSchemeScript = exports.Experimental_CssVarsProvider = void 0;
|
|
8
|
+
exports.useColorScheme = exports.shouldSkipGeneratingVar = exports.getInitColorSchemeScript = exports.Experimental_CssVarsProvider = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -15,10 +15,16 @@ var _experimental_extendTheme = _interopRequireDefault(require("./experimental_e
|
|
|
15
15
|
|
|
16
16
|
var _createTypography = _interopRequireDefault(require("./createTypography"));
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const shouldSkipGeneratingVar = keys => {
|
|
19
|
+
var _keys$;
|
|
20
|
+
|
|
21
|
+
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.shouldSkipGeneratingVar = shouldSkipGeneratingVar;
|
|
19
25
|
const defaultTheme = (0, _experimental_extendTheme.default)();
|
|
20
26
|
const {
|
|
21
|
-
CssVarsProvider
|
|
27
|
+
CssVarsProvider,
|
|
22
28
|
useColorScheme,
|
|
23
29
|
getInitColorSchemeScript
|
|
24
30
|
} = (0, _system.unstable_createCssVarsProvider)({
|
|
@@ -30,15 +36,14 @@ const {
|
|
|
30
36
|
light: 'light',
|
|
31
37
|
dark: 'dark'
|
|
32
38
|
},
|
|
33
|
-
prefix: 'md',
|
|
34
39
|
resolveTheme: theme => {
|
|
35
40
|
const newTheme = (0, _extends2.default)({}, theme, {
|
|
36
41
|
typography: (0, _createTypography.default)(theme.palette, theme.typography)
|
|
37
42
|
});
|
|
38
43
|
return newTheme;
|
|
39
44
|
},
|
|
40
|
-
shouldSkipGeneratingVar
|
|
45
|
+
shouldSkipGeneratingVar
|
|
41
46
|
});
|
|
42
47
|
exports.getInitColorSchemeScript = getInitColorSchemeScript;
|
|
43
48
|
exports.useColorScheme = useColorScheme;
|
|
44
|
-
exports.Experimental_CssVarsProvider =
|
|
49
|
+
exports.Experimental_CssVarsProvider = CssVarsProvider;
|
|
@@ -5,6 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.createGetCssVar = void 0;
|
|
8
9
|
exports.default = extendTheme;
|
|
9
10
|
|
|
10
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -19,7 +20,7 @@ var _createTheme = _interopRequireDefault(require("./createTheme"));
|
|
|
19
20
|
|
|
20
21
|
var _Paper = require("../Paper/Paper");
|
|
21
22
|
|
|
22
|
-
const _excluded = ["colorSchemes"],
|
|
23
|
+
const _excluded = ["colorSchemes", "cssVarPrefix"],
|
|
23
24
|
_excluded2 = ["palette"];
|
|
24
25
|
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
25
26
|
if (index === 0) {
|
|
@@ -30,13 +31,31 @@ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
|
30
31
|
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
31
32
|
});
|
|
32
33
|
|
|
34
|
+
function assignNode(obj, keys) {
|
|
35
|
+
keys.forEach(k => {
|
|
36
|
+
if (!obj[k]) {
|
|
37
|
+
obj[k] = {};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function setColor(obj, key, defaultValue) {
|
|
43
|
+
obj[key] = obj[key] || defaultValue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const createGetCssVar = (cssVarPrefix = 'mui') => (0, _system.unstable_createGetCssVar)(cssVarPrefix);
|
|
47
|
+
|
|
48
|
+
exports.createGetCssVar = createGetCssVar;
|
|
49
|
+
|
|
33
50
|
function extendTheme(options = {}, ...args) {
|
|
34
51
|
var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3;
|
|
35
52
|
|
|
36
53
|
const {
|
|
37
|
-
colorSchemes: colorSchemesInput = {}
|
|
54
|
+
colorSchemes: colorSchemesInput = {},
|
|
55
|
+
cssVarPrefix = 'mui'
|
|
38
56
|
} = options,
|
|
39
57
|
input = (0, _objectWithoutPropertiesLoose2.default)(options, _excluded);
|
|
58
|
+
const getCssVar = createGetCssVar(cssVarPrefix);
|
|
40
59
|
|
|
41
60
|
const _createThemeWithoutVa = (0, _createTheme.default)((0, _extends2.default)({}, input, colorSchemesInput.light && {
|
|
42
61
|
palette: (_colorSchemesInput$li = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li.palette
|
|
@@ -54,20 +73,26 @@ function extendTheme(options = {}, ...args) {
|
|
|
54
73
|
}, (_colorSchemesInput$da = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da.palette)
|
|
55
74
|
});
|
|
56
75
|
let theme = (0, _extends2.default)({}, muiTheme, {
|
|
76
|
+
cssVarPrefix,
|
|
77
|
+
getCssVar,
|
|
57
78
|
colorSchemes: (0, _extends2.default)({}, colorSchemesInput, {
|
|
58
79
|
light: (0, _extends2.default)({}, colorSchemesInput.light, {
|
|
59
80
|
palette: lightPalette,
|
|
60
81
|
opacity: (0, _extends2.default)({
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
inputPlaceholder: 0.42,
|
|
83
|
+
inputUnderline: 0.42,
|
|
84
|
+
switchTrackDisabled: 0.12,
|
|
85
|
+
switchTrack: 0.38
|
|
63
86
|
}, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity),
|
|
64
87
|
overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || []
|
|
65
88
|
}),
|
|
66
89
|
dark: (0, _extends2.default)({}, colorSchemesInput.dark, {
|
|
67
90
|
palette: darkPalette,
|
|
68
91
|
opacity: (0, _extends2.default)({
|
|
69
|
-
|
|
70
|
-
|
|
92
|
+
inputPlaceholder: 0.5,
|
|
93
|
+
inputUnderline: 0.7,
|
|
94
|
+
switchTrackDisabled: 0.2,
|
|
95
|
+
switchTrack: 0.3
|
|
71
96
|
}, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
|
|
72
97
|
overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
|
|
73
98
|
})
|
|
@@ -76,23 +101,142 @@ function extendTheme(options = {}, ...args) {
|
|
|
76
101
|
Object.keys(theme.colorSchemes).forEach(key => {
|
|
77
102
|
const palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
|
|
78
103
|
|
|
79
|
-
if (key === '
|
|
80
|
-
palette.common
|
|
81
|
-
palette.common
|
|
104
|
+
if (key === 'light') {
|
|
105
|
+
setColor(palette.common, 'background', '#fff');
|
|
106
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
82
107
|
} else {
|
|
83
|
-
palette.common
|
|
84
|
-
palette.common
|
|
85
|
-
}
|
|
108
|
+
setColor(palette.common, 'background', '#000');
|
|
109
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
110
|
+
} // assign component variables
|
|
86
111
|
|
|
87
|
-
palette.common.backgroundChannel = (0, _system.colorChannel)(palette.common.background);
|
|
88
|
-
palette.common.onBackgroundChannel = (0, _system.colorChannel)(palette.common.onBackground);
|
|
89
|
-
palette.dividerChannel = (0, _system.colorChannel)(palette.divider); // special token for Tooltip
|
|
90
|
-
// TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
|
|
91
112
|
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
114
|
+
|
|
115
|
+
if (key === 'light') {
|
|
116
|
+
setColor(palette.Alert, 'errorColor', (0, _system.darken)(palette.error.light, 0.6));
|
|
117
|
+
setColor(palette.Alert, 'infoColor', (0, _system.darken)(palette.info.light, 0.6));
|
|
118
|
+
setColor(palette.Alert, 'successColor', (0, _system.darken)(palette.success.light, 0.6));
|
|
119
|
+
setColor(palette.Alert, 'warningColor', (0, _system.darken)(palette.warning.light, 0.6));
|
|
120
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-main'));
|
|
121
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-main'));
|
|
122
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-main'));
|
|
123
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-main'));
|
|
124
|
+
setColor(palette.Alert, 'errorFilledColor', lightPalette.getContrastText(palette.error.main));
|
|
125
|
+
setColor(palette.Alert, 'infoFilledColor', lightPalette.getContrastText(palette.info.main));
|
|
126
|
+
setColor(palette.Alert, 'successFilledColor', lightPalette.getContrastText(palette.success.main));
|
|
127
|
+
setColor(palette.Alert, 'warningFilledColor', lightPalette.getContrastText(palette.warning.main));
|
|
128
|
+
setColor(palette.Alert, 'errorStandardBg', (0, _system.lighten)(palette.error.light, 0.9));
|
|
129
|
+
setColor(palette.Alert, 'infoStandardBg', (0, _system.lighten)(palette.info.light, 0.9));
|
|
130
|
+
setColor(palette.Alert, 'successStandardBg', (0, _system.lighten)(palette.success.light, 0.9));
|
|
131
|
+
setColor(palette.Alert, 'warningStandardBg', (0, _system.lighten)(palette.warning.light, 0.9));
|
|
132
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-light'));
|
|
133
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-light'));
|
|
134
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-light'));
|
|
135
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-light'));
|
|
136
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-100'));
|
|
137
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-400'));
|
|
138
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-400'));
|
|
139
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-700'));
|
|
140
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-700'));
|
|
141
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
142
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
143
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
144
|
+
setColor(palette.LinearProgress, 'primaryBg', (0, _system.lighten)(palette.primary.main, 0.62));
|
|
145
|
+
setColor(palette.LinearProgress, 'secondaryBg', (0, _system.lighten)(palette.secondary.main, 0.62));
|
|
146
|
+
setColor(palette.LinearProgress, 'errorBg', (0, _system.lighten)(palette.error.main, 0.62));
|
|
147
|
+
setColor(palette.LinearProgress, 'infoBg', (0, _system.lighten)(palette.info.main, 0.62));
|
|
148
|
+
setColor(palette.LinearProgress, 'successBg', (0, _system.lighten)(palette.success.main, 0.62));
|
|
149
|
+
setColor(palette.LinearProgress, 'warningBg', (0, _system.lighten)(palette.warning.main, 0.62));
|
|
150
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.11)`);
|
|
151
|
+
setColor(palette.Slider, 'primaryTrack', (0, _system.lighten)(palette.primary.main, 0.62));
|
|
152
|
+
setColor(palette.Slider, 'secondaryTrack', (0, _system.lighten)(palette.secondary.main, 0.62));
|
|
153
|
+
setColor(palette.Slider, 'errorTrack', (0, _system.lighten)(palette.error.main, 0.62));
|
|
154
|
+
setColor(palette.Slider, 'infoTrack', (0, _system.lighten)(palette.info.main, 0.62));
|
|
155
|
+
setColor(palette.Slider, 'successTrack', (0, _system.lighten)(palette.success.main, 0.62));
|
|
156
|
+
setColor(palette.Slider, 'warningTrack', (0, _system.lighten)(palette.warning.main, 0.62));
|
|
157
|
+
const snackbarContentBackground = (0, _system.emphasize)(palette.background.default, 0.8);
|
|
158
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
159
|
+
setColor(palette.SnackbarContent, 'color', lightPalette.getContrastText(snackbarContentBackground));
|
|
160
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', (0, _system.emphasize)(palette.background.paper, 0.15));
|
|
161
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-400'));
|
|
162
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-400'));
|
|
163
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-common-white'));
|
|
164
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-100'));
|
|
165
|
+
setColor(palette.Switch, 'primaryDisabledColor', (0, _system.lighten)(palette.primary.main, 0.62));
|
|
166
|
+
setColor(palette.Switch, 'secondaryDisabledColor', (0, _system.lighten)(palette.secondary.main, 0.62));
|
|
167
|
+
setColor(palette.Switch, 'errorDisabledColor', (0, _system.lighten)(palette.error.main, 0.62));
|
|
168
|
+
setColor(palette.Switch, 'infoDisabledColor', (0, _system.lighten)(palette.info.main, 0.62));
|
|
169
|
+
setColor(palette.Switch, 'successDisabledColor', (0, _system.lighten)(palette.success.main, 0.62));
|
|
170
|
+
setColor(palette.Switch, 'warningDisabledColor', (0, _system.lighten)(palette.warning.main, 0.62));
|
|
171
|
+
setColor(palette.TableCell, 'border', (0, _system.lighten)((0, _system.alpha)(palette.divider, 1), 0.88));
|
|
172
|
+
setColor(palette.Tooltip, 'bg', (0, _system.alpha)(palette.grey[700], 0.92));
|
|
173
|
+
} else {
|
|
174
|
+
setColor(palette.Alert, 'errorColor', (0, _system.lighten)(palette.error.light, 0.6));
|
|
175
|
+
setColor(palette.Alert, 'infoColor', (0, _system.lighten)(palette.info.light, 0.6));
|
|
176
|
+
setColor(palette.Alert, 'successColor', (0, _system.lighten)(palette.success.light, 0.6));
|
|
177
|
+
setColor(palette.Alert, 'warningColor', (0, _system.lighten)(palette.warning.light, 0.6));
|
|
178
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-dark'));
|
|
179
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-dark'));
|
|
180
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-dark'));
|
|
181
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-dark'));
|
|
182
|
+
setColor(palette.Alert, 'errorFilledColor', darkPalette.getContrastText(palette.error.dark));
|
|
183
|
+
setColor(palette.Alert, 'infoFilledColor', darkPalette.getContrastText(palette.info.dark));
|
|
184
|
+
setColor(palette.Alert, 'successFilledColor', darkPalette.getContrastText(palette.success.dark));
|
|
185
|
+
setColor(palette.Alert, 'warningFilledColor', darkPalette.getContrastText(palette.warning.dark));
|
|
186
|
+
setColor(palette.Alert, 'errorStandardBg', (0, _system.darken)(palette.error.light, 0.9));
|
|
187
|
+
setColor(palette.Alert, 'infoStandardBg', (0, _system.darken)(palette.info.light, 0.9));
|
|
188
|
+
setColor(palette.Alert, 'successStandardBg', (0, _system.darken)(palette.success.light, 0.9));
|
|
189
|
+
setColor(palette.Alert, 'warningStandardBg', (0, _system.darken)(palette.warning.light, 0.9));
|
|
190
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-main'));
|
|
191
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-main'));
|
|
192
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-main'));
|
|
193
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-main'));
|
|
194
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-900'));
|
|
195
|
+
setColor(palette.AppBar, 'darkBg', getCssVar('palette-background-paper')); // specific for dark mode
|
|
196
|
+
|
|
197
|
+
setColor(palette.AppBar, 'darkColor', getCssVar('palette-text-primary')); // specific for dark mode
|
|
198
|
+
|
|
199
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-600'));
|
|
200
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-700'));
|
|
201
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-300'));
|
|
202
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-300'));
|
|
203
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
204
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
205
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
206
|
+
setColor(palette.LinearProgress, 'primaryBg', (0, _system.darken)(palette.primary.main, 0.5));
|
|
207
|
+
setColor(palette.LinearProgress, 'secondaryBg', (0, _system.darken)(palette.secondary.main, 0.5));
|
|
208
|
+
setColor(palette.LinearProgress, 'errorBg', (0, _system.darken)(palette.error.main, 0.5));
|
|
209
|
+
setColor(palette.LinearProgress, 'infoBg', (0, _system.darken)(palette.info.main, 0.5));
|
|
210
|
+
setColor(palette.LinearProgress, 'successBg', (0, _system.darken)(palette.success.main, 0.5));
|
|
211
|
+
setColor(palette.LinearProgress, 'warningBg', (0, _system.darken)(palette.warning.main, 0.5));
|
|
212
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.13)`);
|
|
213
|
+
setColor(palette.Slider, 'primaryTrack', (0, _system.darken)(palette.primary.main, 0.5));
|
|
214
|
+
setColor(palette.Slider, 'secondaryTrack', (0, _system.darken)(palette.secondary.main, 0.5));
|
|
215
|
+
setColor(palette.Slider, 'errorTrack', (0, _system.darken)(palette.error.main, 0.5));
|
|
216
|
+
setColor(palette.Slider, 'infoTrack', (0, _system.darken)(palette.info.main, 0.5));
|
|
217
|
+
setColor(palette.Slider, 'successTrack', (0, _system.darken)(palette.success.main, 0.5));
|
|
218
|
+
setColor(palette.Slider, 'warningTrack', (0, _system.darken)(palette.warning.main, 0.5));
|
|
219
|
+
const snackbarContentBackground = (0, _system.emphasize)(palette.background.default, 0.98);
|
|
220
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
221
|
+
setColor(palette.SnackbarContent, 'color', darkPalette.getContrastText(snackbarContentBackground));
|
|
222
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', (0, _system.emphasize)(palette.background.paper, 0.15));
|
|
223
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-600'));
|
|
224
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-600'));
|
|
225
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-grey-300'));
|
|
226
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-600'));
|
|
227
|
+
setColor(palette.Switch, 'primaryDisabledColor', (0, _system.darken)(palette.primary.main, 0.55));
|
|
228
|
+
setColor(palette.Switch, 'secondaryDisabledColor', (0, _system.darken)(palette.secondary.main, 0.55));
|
|
229
|
+
setColor(palette.Switch, 'errorDisabledColor', (0, _system.darken)(palette.error.main, 0.55));
|
|
230
|
+
setColor(palette.Switch, 'infoDisabledColor', (0, _system.darken)(palette.info.main, 0.55));
|
|
231
|
+
setColor(palette.Switch, 'successDisabledColor', (0, _system.darken)(palette.success.main, 0.55));
|
|
232
|
+
setColor(palette.Switch, 'warningDisabledColor', (0, _system.darken)(palette.warning.main, 0.55));
|
|
233
|
+
setColor(palette.TableCell, 'border', (0, _system.darken)((0, _system.alpha)(palette.divider, 1), 0.68));
|
|
234
|
+
setColor(palette.Tooltip, 'bg', (0, _system.alpha)(palette.grey[700], 0.92));
|
|
94
235
|
}
|
|
95
236
|
|
|
237
|
+
palette.common.backgroundChannel = (0, _system.colorChannel)(palette.common.background);
|
|
238
|
+
palette.common.onBackgroundChannel = (0, _system.colorChannel)(palette.common.onBackground);
|
|
239
|
+
palette.dividerChannel = (0, _system.colorChannel)(palette.divider);
|
|
96
240
|
Object.keys(palette).forEach(color => {
|
|
97
241
|
const colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
|
|
98
242
|
|
|
@@ -119,12 +263,16 @@ function extendTheme(options = {}, ...args) {
|
|
|
119
263
|
|
|
120
264
|
if (colors.secondary) {
|
|
121
265
|
palette[color].secondaryChannel = (0, _system.colorChannel)(colors.secondary);
|
|
122
|
-
} // Action colors: action.
|
|
266
|
+
} // Action colors: action.active, action.selected
|
|
123
267
|
|
|
124
268
|
|
|
125
269
|
if (colors.active) {
|
|
126
270
|
palette[color].activeChannel = (0, _system.colorChannel)(colors.active);
|
|
127
271
|
}
|
|
272
|
+
|
|
273
|
+
if (colors.selected) {
|
|
274
|
+
palette[color].selectedChannel = (0, _system.colorChannel)(colors.selected);
|
|
275
|
+
}
|
|
128
276
|
});
|
|
129
277
|
});
|
|
130
278
|
theme = args.reduce((acc, argument) => (0, _utils.deepmerge)(acc, argument), theme);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/mui/material-ui/issues"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://mui.com/material-ui/getting-started/
|
|
24
|
+
"homepage": "https://mui.com/material-ui/getting-started/overview/",
|
|
25
25
|
"funding": {
|
|
26
26
|
"type": "opencollective",
|
|
27
27
|
"url": "https://opencollective.com/mui"
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.17.2",
|
|
49
|
-
"@mui/base": "5.0.0-alpha.
|
|
50
|
-
"@mui/system": "^5.8.
|
|
49
|
+
"@mui/base": "5.0.0-alpha.88",
|
|
50
|
+
"@mui/system": "^5.8.7",
|
|
51
51
|
"@mui/types": "^7.1.4",
|
|
52
|
-
"@mui/utils": "^5.8.
|
|
53
|
-
"@types/react-transition-group": "^4.4.
|
|
54
|
-
"clsx": "^1.
|
|
52
|
+
"@mui/utils": "^5.8.6",
|
|
53
|
+
"@types/react-transition-group": "^4.4.5",
|
|
54
|
+
"clsx": "^1.2.0",
|
|
55
55
|
"csstype": "^3.1.0",
|
|
56
56
|
"prop-types": "^15.8.1",
|
|
57
57
|
"react-is": "^17.0.2",
|
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
type MDCreateCssVarsProviderResult = CreateCssVarsProviderResult<SupportedColorScheme, ThemeInput>;
|
|
18
|
-
|
|
19
|
-
declare const useColorScheme: MDCreateCssVarsProviderResult['useColorScheme'];
|
|
20
|
-
declare const getInitColorSchemeScript: MDCreateCssVarsProviderResult['getInitColorSchemeScript'];
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* This component is an experimental Theme Provider that generates CSS variabels out of the theme tokens.
|
|
24
|
-
* It should preferably be used at **the root of your component tree**.
|
|
25
|
-
*/
|
|
26
|
-
declare const Experimental_CssVarsProvider: MDCreateCssVarsProviderResult['CssVarsProvider'];
|
|
27
|
-
|
|
28
|
-
export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SupportedColorScheme } from './experimental_extendTheme';
|
|
3
|
+
declare const shouldSkipGeneratingVar: (keys: string[]) => boolean;
|
|
4
|
+
declare const CssVarsProvider: (props: import("react").PropsWithChildren<Partial<import("@mui/system").CssVarsProviderConfig<SupportedColorScheme>> & {
|
|
5
|
+
theme?: {
|
|
6
|
+
cssVarPrefix?: string | undefined;
|
|
7
|
+
colorSchemes: Record<SupportedColorScheme, Record<string, any>>;
|
|
8
|
+
} | undefined;
|
|
9
|
+
documentNode?: Document | null | undefined;
|
|
10
|
+
colorSchemeNode?: Document | HTMLElement | null | undefined;
|
|
11
|
+
colorSchemeSelector?: string | undefined;
|
|
12
|
+
storageWindow?: Window | null | undefined;
|
|
13
|
+
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, useColorScheme: () => import("@mui/system").ColorSchemeContextValue<SupportedColorScheme>, getInitColorSchemeScript: typeof import("@mui/system").getInitColorSchemeScript;
|
|
14
|
+
export { useColorScheme, getInitColorSchemeScript, shouldSkipGeneratingVar, CssVarsProvider as Experimental_CssVarsProvider, };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
4
2
|
import { unstable_createCssVarsProvider as createCssVarsProvider } from '@mui/system';
|
|
5
3
|
import experimental_extendTheme from './experimental_extendTheme';
|
|
6
4
|
import createTypography from './createTypography';
|
|
5
|
+
|
|
6
|
+
const shouldSkipGeneratingVar = keys => {
|
|
7
|
+
var _keys$;
|
|
8
|
+
|
|
9
|
+
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
10
|
+
};
|
|
11
|
+
|
|
7
12
|
const defaultTheme = experimental_extendTheme();
|
|
8
13
|
const {
|
|
9
|
-
CssVarsProvider
|
|
14
|
+
CssVarsProvider,
|
|
10
15
|
useColorScheme,
|
|
11
16
|
getInitColorSchemeScript
|
|
12
17
|
} = createCssVarsProvider({
|
|
@@ -18,7 +23,6 @@ const {
|
|
|
18
23
|
light: 'light',
|
|
19
24
|
dark: 'dark'
|
|
20
25
|
},
|
|
21
|
-
prefix: 'md',
|
|
22
26
|
resolveTheme: theme => {
|
|
23
27
|
const newTheme = _extends({}, theme, {
|
|
24
28
|
typography: createTypography(theme.palette, theme.typography)
|
|
@@ -26,6 +30,6 @@ const {
|
|
|
26
30
|
|
|
27
31
|
return newTheme;
|
|
28
32
|
},
|
|
29
|
-
shouldSkipGeneratingVar
|
|
33
|
+
shouldSkipGeneratingVar
|
|
30
34
|
});
|
|
31
|
-
export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
|
|
35
|
+
export { useColorScheme, getInitColorSchemeScript, shouldSkipGeneratingVar, CssVarsProvider as Experimental_CssVarsProvider };
|
|
@@ -105,32 +105,6 @@ export interface Channels {
|
|
|
105
105
|
contrastTextChannel: string;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
export interface PaletteWithChannels {
|
|
109
|
-
common: CommonColors & {
|
|
110
|
-
background: string;
|
|
111
|
-
onBackground: string;
|
|
112
|
-
backgroundChannel: string;
|
|
113
|
-
onBackgroundChannel: string;
|
|
114
|
-
};
|
|
115
|
-
mode: PaletteMode;
|
|
116
|
-
contrastThreshold: number;
|
|
117
|
-
tonalOffset: PaletteTonalOffset;
|
|
118
|
-
primary: PaletteColor & Channels;
|
|
119
|
-
secondary: PaletteColor & Channels;
|
|
120
|
-
error: PaletteColor & Channels;
|
|
121
|
-
warning: PaletteColor & Channels;
|
|
122
|
-
info: PaletteColor & Channels;
|
|
123
|
-
success: PaletteColor & Channels;
|
|
124
|
-
grey: Color & { darkChannel: string };
|
|
125
|
-
text: TypeText & { primaryChannel: string; secondaryChannel: string; disabledChannel: string };
|
|
126
|
-
divider: TypeDivider;
|
|
127
|
-
dividerChannel: TypeDivider;
|
|
128
|
-
action: TypeAction & { disabledChannel: string; activeChannel: string };
|
|
129
|
-
background: TypeBackground;
|
|
130
|
-
getContrastText: (background: string) => string;
|
|
131
|
-
augmentColor: (options: PaletteAugmentColorOptions) => PaletteColor;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
108
|
export type PartialTypeObject = { [P in keyof TypeObject]?: Partial<TypeObject[P]> };
|
|
135
109
|
|
|
136
110
|
export interface PaletteOptions {
|