@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
package/node/Modal/Modal.js
CHANGED
|
@@ -29,7 +29,7 @@ var _Backdrop = _interopRequireDefault(require("../Backdrop"));
|
|
|
29
29
|
|
|
30
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
31
|
|
|
32
|
-
const _excluded = ["BackdropComponent", "closeAfterTransition", "children", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted"];
|
|
32
|
+
const _excluded = ["BackdropComponent", "BackdropProps", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "theme"];
|
|
33
33
|
|
|
34
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
35
|
|
|
@@ -88,7 +88,7 @@ const ModalBackdrop = (0, _styled.default)(_Backdrop.default, {
|
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
90
|
const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
91
|
-
var
|
|
91
|
+
var _ref, _components$Root;
|
|
92
92
|
|
|
93
93
|
const props = (0, _useThemeProps.default)({
|
|
94
94
|
name: 'MuiModal',
|
|
@@ -96,8 +96,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
96
96
|
});
|
|
97
97
|
const {
|
|
98
98
|
BackdropComponent = ModalBackdrop,
|
|
99
|
+
BackdropProps,
|
|
99
100
|
closeAfterTransition = false,
|
|
100
101
|
children,
|
|
102
|
+
component,
|
|
101
103
|
components = {},
|
|
102
104
|
componentsProps = {},
|
|
103
105
|
disableAutoFocus = false,
|
|
@@ -107,7 +109,9 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
107
109
|
disableRestoreFocus = false,
|
|
108
110
|
disableScrollLock = false,
|
|
109
111
|
hideBackdrop = false,
|
|
110
|
-
keepMounted = false
|
|
112
|
+
keepMounted = false,
|
|
113
|
+
// eslint-disable-next-line react/prop-types
|
|
114
|
+
theme
|
|
111
115
|
} = props,
|
|
112
116
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
113
117
|
const [exited, setExited] = React.useState(true);
|
|
@@ -126,16 +130,19 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
126
130
|
exited
|
|
127
131
|
});
|
|
128
132
|
const classes = extendUtilityClasses(ownerState);
|
|
133
|
+
const Root = (_ref = (_components$Root = components.Root) != null ? _components$Root : component) != null ? _ref : ModalRoot;
|
|
129
134
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalUnstyled.default, (0, _extends2.default)({
|
|
130
135
|
components: (0, _extends2.default)({
|
|
131
|
-
Root
|
|
136
|
+
Root,
|
|
137
|
+
Backdrop: BackdropComponent
|
|
132
138
|
}, components),
|
|
133
139
|
componentsProps: {
|
|
134
|
-
root: (0, _extends2.default)({}, componentsProps.root,
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
root: (0, _extends2.default)({}, componentsProps.root, !(0, _base.isHostComponent)(Root) && {
|
|
141
|
+
as: component,
|
|
142
|
+
theme
|
|
143
|
+
}),
|
|
144
|
+
backdrop: (0, _extends2.default)({}, BackdropProps, componentsProps.backdrop)
|
|
137
145
|
},
|
|
138
|
-
BackdropComponent: BackdropComponent,
|
|
139
146
|
onTransitionEnter: () => setExited(false),
|
|
140
147
|
onTransitionExited: () => setExited(true),
|
|
141
148
|
ref: ref
|
|
@@ -155,6 +162,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
155
162
|
|
|
156
163
|
/**
|
|
157
164
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
165
|
+
* @deprecated Use `components.Backdrop` instead.
|
|
158
166
|
* @default styled(Backdrop, {
|
|
159
167
|
* name: 'MuiModal',
|
|
160
168
|
* slot: 'Backdrop',
|
|
@@ -169,6 +177,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
169
177
|
|
|
170
178
|
/**
|
|
171
179
|
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
|
|
180
|
+
* @deprecated Use `componentsProps.backdrop` instead.
|
|
172
181
|
*/
|
|
173
182
|
BackdropProps: _propTypes.default.object,
|
|
174
183
|
|
|
@@ -188,12 +197,19 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
188
197
|
*/
|
|
189
198
|
closeAfterTransition: _propTypes.default.bool,
|
|
190
199
|
|
|
200
|
+
/**
|
|
201
|
+
* The component used for the root node.
|
|
202
|
+
* Either a string to use a HTML element or a component.
|
|
203
|
+
*/
|
|
204
|
+
component: _propTypes.default.elementType,
|
|
205
|
+
|
|
191
206
|
/**
|
|
192
207
|
* The components used for each slot inside the Modal.
|
|
193
208
|
* Either a string to use a HTML element or a component.
|
|
194
209
|
* @default {}
|
|
195
210
|
*/
|
|
196
211
|
components: _propTypes.default.shape({
|
|
212
|
+
Backdrop: _propTypes.default.elementType,
|
|
197
213
|
Root: _propTypes.default.elementType
|
|
198
214
|
}),
|
|
199
215
|
|
|
@@ -202,6 +218,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
202
218
|
* @default {}
|
|
203
219
|
*/
|
|
204
220
|
componentsProps: _propTypes.default.shape({
|
|
221
|
+
backdrop: _propTypes.default.object,
|
|
205
222
|
root: _propTypes.default.object
|
|
206
223
|
}),
|
|
207
224
|
|
|
@@ -66,25 +66,25 @@ const OutlinedInputRoot = (0, _styled.default)(_InputBase.InputBaseRoot, {
|
|
|
66
66
|
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
67
67
|
return (0, _extends2.default)({
|
|
68
68
|
position: 'relative',
|
|
69
|
-
borderRadius: theme.shape.borderRadius,
|
|
69
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
70
70
|
[`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
71
|
-
borderColor: theme.palette.text.primary
|
|
71
|
+
borderColor: (theme.vars || theme).palette.text.primary
|
|
72
72
|
},
|
|
73
73
|
// Reset on touch devices, it doesn't add specificity
|
|
74
74
|
'@media (hover: none)': {
|
|
75
75
|
[`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
76
|
-
borderColor
|
|
76
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
[`&.${_outlinedInputClasses.default.focused} .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
80
|
-
borderColor: theme.palette[ownerState.color].main,
|
|
80
|
+
borderColor: (theme.vars || theme).palette[ownerState.color].main,
|
|
81
81
|
borderWidth: 2
|
|
82
82
|
},
|
|
83
83
|
[`&.${_outlinedInputClasses.default.error} .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
84
|
-
borderColor: theme.palette.error.main
|
|
84
|
+
borderColor: (theme.vars || theme).palette.error.main
|
|
85
85
|
},
|
|
86
86
|
[`&.${_outlinedInputClasses.default.disabled} .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
87
|
-
borderColor: theme.palette.action.disabled
|
|
87
|
+
borderColor: (theme.vars || theme).palette.action.disabled
|
|
88
88
|
}
|
|
89
89
|
}, ownerState.startAdornment && {
|
|
90
90
|
paddingLeft: 14
|
|
@@ -102,9 +102,12 @@ const NotchedOutlineRoot = (0, _styled.default)(_NotchedOutline.default, {
|
|
|
102
102
|
overridesResolver: (props, styles) => styles.notchedOutline
|
|
103
103
|
})(({
|
|
104
104
|
theme
|
|
105
|
-
}) =>
|
|
106
|
-
borderColor
|
|
107
|
-
|
|
105
|
+
}) => {
|
|
106
|
+
const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
|
|
107
|
+
return {
|
|
108
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
109
|
+
};
|
|
110
|
+
});
|
|
108
111
|
const OutlinedInputInput = (0, _styled.default)(_InputBase.InputBaseComponent, {
|
|
109
112
|
name: 'MuiOutlinedInput',
|
|
110
113
|
slot: 'Input',
|
|
@@ -113,13 +116,25 @@ const OutlinedInputInput = (0, _styled.default)(_InputBase.InputBaseComponent, {
|
|
|
113
116
|
theme,
|
|
114
117
|
ownerState
|
|
115
118
|
}) => (0, _extends2.default)({
|
|
116
|
-
padding: '16.5px 14px'
|
|
119
|
+
padding: '16.5px 14px'
|
|
120
|
+
}, !theme.vars && {
|
|
117
121
|
'&:-webkit-autofill': {
|
|
118
122
|
WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset',
|
|
119
123
|
WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff',
|
|
120
124
|
caretColor: theme.palette.mode === 'light' ? null : '#fff',
|
|
121
125
|
borderRadius: 'inherit'
|
|
122
126
|
}
|
|
127
|
+
}, theme.vars && {
|
|
128
|
+
'&:-webkit-autofill': {
|
|
129
|
+
borderRadius: 'inherit'
|
|
130
|
+
},
|
|
131
|
+
[theme.getColorSchemeSelector('dark')]: {
|
|
132
|
+
'&:-webkit-autofill': {
|
|
133
|
+
WebkitBoxShadow: '0 0 0 100px #266798 inset',
|
|
134
|
+
WebkitTextFillColor: '#fff',
|
|
135
|
+
caretColor: '#fff'
|
|
136
|
+
}
|
|
137
|
+
}
|
|
123
138
|
}, ownerState.size === 'small' && {
|
|
124
139
|
padding: '8.5px 14px'
|
|
125
140
|
}, ownerState.multiline && {
|
|
@@ -97,7 +97,7 @@ const SkeletonRoot = (0, _styled.default)('span', {
|
|
|
97
97
|
return (0, _extends2.default)({
|
|
98
98
|
display: 'block',
|
|
99
99
|
// Create a "on paper" color with sufficient contrast retaining the color
|
|
100
|
-
backgroundColor: (0, _styles.alpha)(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
100
|
+
backgroundColor: theme.vars ? theme.vars.palette.Skeleton.bg : (0, _styles.alpha)(theme.palette.text.primary, theme.palette.mode === 'light' ? 0.11 : 0.13),
|
|
101
101
|
height: '1.2em'
|
|
102
102
|
}, ownerState.variant === 'text' && {
|
|
103
103
|
marginTop: 0,
|
|
@@ -136,7 +136,12 @@ const SkeletonRoot = (0, _styled.default)('span', {
|
|
|
136
136
|
|
|
137
137
|
&::after {
|
|
138
138
|
animation: ${waveKeyframe} 1.6s linear 0.5s infinite;
|
|
139
|
-
background: linear-gradient(
|
|
139
|
+
background: linear-gradient(
|
|
140
|
+
90deg,
|
|
141
|
+
transparent,
|
|
142
|
+
${(theme.vars || theme).palette.action.hover},
|
|
143
|
+
transparent
|
|
144
|
+
);
|
|
140
145
|
content: '';
|
|
141
146
|
position: absolute;
|
|
142
147
|
transform: translateX(-100%); /* Avoid flash during server-side hydration */
|
package/node/Slider/Slider.js
CHANGED
|
@@ -64,7 +64,7 @@ const SliderRoot = (0, _styled.default)('span', {
|
|
|
64
64
|
position: 'relative',
|
|
65
65
|
cursor: 'pointer',
|
|
66
66
|
touchAction: 'none',
|
|
67
|
-
color: theme.palette[ownerState.color].main,
|
|
67
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
68
68
|
WebkitTapHighlightColor: 'transparent'
|
|
69
69
|
}, ownerState.orientation === 'horizontal' && (0, _extends2.default)({
|
|
70
70
|
height: 4,
|
|
@@ -99,7 +99,7 @@ const SliderRoot = (0, _styled.default)('span', {
|
|
|
99
99
|
[`&.${sliderClasses.disabled}`]: {
|
|
100
100
|
pointerEvents: 'none',
|
|
101
101
|
cursor: 'default',
|
|
102
|
-
color: theme.palette.grey[400]
|
|
102
|
+
color: (theme.vars || theme).palette.grey[400]
|
|
103
103
|
},
|
|
104
104
|
[`&.${sliderClasses.dragging}`]: {
|
|
105
105
|
[`& .${sliderClasses.thumb}, & .${sliderClasses.track}`]: {
|
|
@@ -192,8 +192,8 @@ const SliderTrack = (0, _styled.default)('span', {
|
|
|
192
192
|
}, ownerState.track === false && {
|
|
193
193
|
display: 'none'
|
|
194
194
|
}, ownerState.track === 'inverted' && {
|
|
195
|
-
backgroundColor: color,
|
|
196
|
-
borderColor: color
|
|
195
|
+
backgroundColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color,
|
|
196
|
+
borderColor: theme.vars ? theme.vars.palette.Slider[`${ownerState.color}Track`] : color
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
exports.SliderTrack = SliderTrack;
|
|
@@ -252,7 +252,7 @@ const SliderThumb = (0, _styled.default)('span', {
|
|
|
252
252
|
borderRadius: 'inherit',
|
|
253
253
|
width: '100%',
|
|
254
254
|
height: '100%',
|
|
255
|
-
boxShadow: theme.shadows[2]
|
|
255
|
+
boxShadow: (theme.vars || theme).shadows[2]
|
|
256
256
|
}, ownerState.size === 'small' && {
|
|
257
257
|
boxShadow: 'none'
|
|
258
258
|
}),
|
|
@@ -268,13 +268,13 @@ const SliderThumb = (0, _styled.default)('span', {
|
|
|
268
268
|
transform: 'translate(-50%, -50%)'
|
|
269
269
|
},
|
|
270
270
|
[`&:hover, &.${sliderClasses.focusVisible}`]: {
|
|
271
|
-
boxShadow: `0px 0px 0px 8px ${(0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`,
|
|
271
|
+
boxShadow: `0px 0px 0px 8px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`,
|
|
272
272
|
'@media (hover: none)': {
|
|
273
273
|
boxShadow: 'none'
|
|
274
274
|
}
|
|
275
275
|
},
|
|
276
276
|
[`&.${sliderClasses.active}`]: {
|
|
277
|
-
boxShadow: `0px 0px 0px 14px ${(0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`
|
|
277
|
+
boxShadow: `0px 0px 0px 14px ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.16)` : (0, _system.alpha)(theme.palette[ownerState.color].main, 0.16)}`
|
|
278
278
|
},
|
|
279
279
|
[`&.${sliderClasses.disabled}`]: {
|
|
280
280
|
'&:hover': {
|
|
@@ -317,9 +317,9 @@ const SliderValueLabel = (0, _styled.default)(_SliderUnstyled.SliderValueLabelUn
|
|
|
317
317
|
transformOrigin: 'bottom center',
|
|
318
318
|
transform: 'translateY(-100%) scale(0)',
|
|
319
319
|
position: 'absolute',
|
|
320
|
-
backgroundColor: theme.palette.grey[600],
|
|
320
|
+
backgroundColor: (theme.vars || theme).palette.grey[600],
|
|
321
321
|
borderRadius: 2,
|
|
322
|
-
color: theme.palette.common.white,
|
|
322
|
+
color: (theme.vars || theme).palette.common.white,
|
|
323
323
|
display: 'flex',
|
|
324
324
|
alignItems: 'center',
|
|
325
325
|
justifyContent: 'center',
|
|
@@ -389,7 +389,7 @@ const SliderMark = (0, _styled.default)('span', {
|
|
|
389
389
|
left: '50%',
|
|
390
390
|
transform: 'translate(-50%, 1px)'
|
|
391
391
|
}, markActive && {
|
|
392
|
-
backgroundColor: theme.palette.background.paper,
|
|
392
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
393
393
|
opacity: 0.8
|
|
394
394
|
}));
|
|
395
395
|
exports.SliderMark = SliderMark;
|
|
@@ -416,7 +416,7 @@ const SliderMarkLabel = (0, _styled.default)('span', {
|
|
|
416
416
|
ownerState,
|
|
417
417
|
markLabelActive
|
|
418
418
|
}) => (0, _extends2.default)({}, theme.typography.body2, {
|
|
419
|
-
color: theme.palette.text.secondary,
|
|
419
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
420
420
|
position: 'absolute',
|
|
421
421
|
whiteSpace: 'nowrap'
|
|
422
422
|
}, ownerState.orientation === 'horizontal' && {
|
|
@@ -432,7 +432,7 @@ const SliderMarkLabel = (0, _styled.default)('span', {
|
|
|
432
432
|
left: 44
|
|
433
433
|
}
|
|
434
434
|
}, markLabelActive && {
|
|
435
|
-
color: theme.palette.text.primary
|
|
435
|
+
color: (theme.vars || theme).palette.text.primary
|
|
436
436
|
}));
|
|
437
437
|
exports.SliderMarkLabel = SliderMarkLabel;
|
|
438
438
|
process.env.NODE_ENV !== "production" ? SliderMarkLabel.propTypes
|
|
@@ -59,13 +59,13 @@ const SnackbarContentRoot = (0, _styled.default)(_Paper.default, {
|
|
|
59
59
|
const emphasis = theme.palette.mode === 'light' ? 0.8 : 0.98;
|
|
60
60
|
const backgroundColor = (0, _system.emphasize)(theme.palette.background.default, emphasis);
|
|
61
61
|
return (0, _extends2.default)({}, theme.typography.body2, {
|
|
62
|
-
color: theme.palette.getContrastText(backgroundColor),
|
|
63
|
-
backgroundColor,
|
|
62
|
+
color: theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(backgroundColor),
|
|
63
|
+
backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,
|
|
64
64
|
display: 'flex',
|
|
65
65
|
alignItems: 'center',
|
|
66
66
|
flexWrap: 'wrap',
|
|
67
67
|
padding: '6px 16px',
|
|
68
|
-
borderRadius: theme.shape.borderRadius,
|
|
68
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
69
69
|
flexGrow: 1,
|
|
70
70
|
[theme.breakpoints.up('sm')]: {
|
|
71
71
|
flexGrow: 'initial',
|
|
@@ -70,10 +70,10 @@ const SpeedDialActionFab = (0, _styled.default)(_Fab.default, {
|
|
|
70
70
|
ownerState
|
|
71
71
|
}) => (0, _extends2.default)({
|
|
72
72
|
margin: 8,
|
|
73
|
-
color: theme.palette.text.secondary,
|
|
74
|
-
backgroundColor: theme.palette.background.paper,
|
|
73
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
74
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
75
75
|
'&:hover': {
|
|
76
|
-
backgroundColor: (0, _system.emphasize)(theme.palette.background.paper, 0.15)
|
|
76
|
+
backgroundColor: theme.vars ? theme.vars.palette.SpeedDialAction.fabHoverBg : (0, _system.emphasize)(theme.palette.background.paper, 0.15)
|
|
77
77
|
},
|
|
78
78
|
transition: `${theme.transitions.create('transform', {
|
|
79
79
|
duration: theme.transitions.duration.shorter
|
|
@@ -126,10 +126,10 @@ const SpeedDialActionStaticTooltipLabel = (0, _styled.default)('span', {
|
|
|
126
126
|
}) => (0, _extends2.default)({
|
|
127
127
|
position: 'absolute'
|
|
128
128
|
}, theme.typography.body1, {
|
|
129
|
-
backgroundColor: theme.palette.background.paper,
|
|
130
|
-
borderRadius: theme.shape.borderRadius,
|
|
131
|
-
boxShadow: theme.shadows[1],
|
|
132
|
-
color: theme.palette.text.secondary,
|
|
129
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
130
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
131
|
+
boxShadow: (theme.vars || theme).shadows[1],
|
|
132
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
133
133
|
padding: '4px 16px',
|
|
134
134
|
wordBreak: 'keep-all'
|
|
135
135
|
}));
|
|
@@ -89,17 +89,20 @@ const StepConnectorLine = (0, _styled.default)('span', {
|
|
|
89
89
|
})(({
|
|
90
90
|
ownerState,
|
|
91
91
|
theme
|
|
92
|
-
}) =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
}) => {
|
|
93
|
+
const borderColor = theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600];
|
|
94
|
+
return (0, _extends2.default)({
|
|
95
|
+
display: 'block',
|
|
96
|
+
borderColor: theme.vars ? theme.vars.palette.StepConnector.border : borderColor
|
|
97
|
+
}, ownerState.orientation === 'horizontal' && {
|
|
98
|
+
borderTopStyle: 'solid',
|
|
99
|
+
borderTopWidth: 1
|
|
100
|
+
}, ownerState.orientation === 'vertical' && {
|
|
101
|
+
borderLeftStyle: 'solid',
|
|
102
|
+
borderLeftWidth: 1,
|
|
103
|
+
minHeight: 24
|
|
104
|
+
});
|
|
105
|
+
});
|
|
103
106
|
const StepConnector = /*#__PURE__*/React.forwardRef(function StepConnector(inProps, ref) {
|
|
104
107
|
const props = (0, _useThemeProps.default)({
|
|
105
108
|
props: inProps,
|
|
@@ -69,7 +69,7 @@ const StepContentRoot = (0, _styled.default)('div', {
|
|
|
69
69
|
paddingLeft: 8 + 12,
|
|
70
70
|
// margin + half icon
|
|
71
71
|
paddingRight: 8,
|
|
72
|
-
borderLeft: `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
|
|
72
|
+
borderLeft: theme.vars ? `1px solid ${theme.vars.palette.StepContent.border}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
|
|
73
73
|
}, ownerState.last && {
|
|
74
74
|
borderLeft: 'none'
|
|
75
75
|
}));
|
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
|
|
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