@mui/material 5.8.4 → 5.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/Alert.js +19 -11
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/AppBar.js +22 -5
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/Autocomplete.d.ts +2 -0
- package/Autocomplete/Autocomplete.js +12 -8
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/Avatar.js +7 -4
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.js +2 -2
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +185 -4
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/Chip.js +31 -30
- package/Chip/chipClasses.d.ts +80 -80
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/Dialog.js +11 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/FilledInput.js +28 -13
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +26 -26
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/Input.js +1 -1
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/InputBase.js +2 -2
- package/InputBase/inputBaseClasses.d.ts +44 -44
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/LinearProgress.js +6 -2
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/Modal/Modal.d.ts +2 -0
- package/Modal/Modal.js +25 -8
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/OutlinedInput.js +40 -10
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +29 -29
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +1 -1
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/Skeleton.js +8 -3
- package/Skeleton/skeletonClasses.d.ts +24 -24
- package/Slider/Slider.js +21 -21
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/SnackbarContent.js +3 -3
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/SpeedDialAction.js +7 -7
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/StepConnector.js +14 -11
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/StepContent.js +1 -1
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +24 -24
- package/Switch/Switch.js +11 -11
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/TableCell.js +5 -5
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/Tabs.js +16 -18
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/Tooltip.js +1 -1
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Alert/Alert.js +19 -11
- package/legacy/AppBar/AppBar.js +23 -4
- package/legacy/Autocomplete/Autocomplete.js +12 -8
- package/legacy/Avatar/Avatar.js +7 -4
- package/legacy/Badge/Badge.js +2 -2
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Chip/Chip.js +31 -30
- package/legacy/Dialog/Dialog.js +11 -6
- package/legacy/FilledInput/FilledInput.js +28 -14
- package/legacy/Input/Input.js +1 -1
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/LinearProgress/LinearProgress.js +6 -2
- package/legacy/Modal/Modal.js +23 -7
- package/legacy/OutlinedInput/OutlinedInput.js +36 -9
- package/legacy/Select/Select.js +1 -1
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Slider/Slider.js +21 -21
- package/legacy/SnackbarContent/SnackbarContent.js +3 -3
- package/legacy/SpeedDialAction/SpeedDialAction.js +7 -7
- package/legacy/StepConnector/StepConnector.js +2 -1
- package/legacy/StepContent/StepContent.js +1 -1
- package/legacy/Switch/Switch.js +11 -11
- package/legacy/TableCell/TableCell.js +5 -5
- package/legacy/Tabs/Tabs.js +16 -18
- package/legacy/Tooltip/Tooltip.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +10 -8
- package/legacy/styles/experimental_extendTheme.js +170 -19
- package/locale/index.d.ts +71 -71
- package/modern/Alert/Alert.js +19 -11
- package/modern/AppBar/AppBar.js +22 -5
- package/modern/Autocomplete/Autocomplete.js +11 -7
- package/modern/Avatar/Avatar.js +7 -4
- package/modern/Badge/Badge.js +2 -2
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Chip/Chip.js +31 -30
- package/modern/Dialog/Dialog.js +11 -6
- package/modern/FilledInput/FilledInput.js +27 -12
- package/modern/Input/Input.js +1 -1
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/LinearProgress/LinearProgress.js +6 -2
- package/modern/Modal/Modal.js +24 -7
- package/modern/OutlinedInput/OutlinedInput.js +40 -10
- package/modern/Select/Select.js +1 -1
- package/modern/Skeleton/Skeleton.js +7 -2
- package/modern/Slider/Slider.js +21 -21
- package/modern/SnackbarContent/SnackbarContent.js +3 -3
- package/modern/SpeedDialAction/SpeedDialAction.js +7 -7
- package/modern/StepConnector/StepConnector.js +14 -11
- package/modern/StepContent/StepContent.js +1 -1
- package/modern/Switch/Switch.js +11 -11
- package/modern/TableCell/TableCell.js +5 -5
- package/modern/Tabs/Tabs.js +16 -18
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +6 -6
- package/modern/styles/experimental_extendTheme.js +166 -20
- package/node/Alert/Alert.js +19 -11
- package/node/AppBar/AppBar.js +22 -5
- package/node/Autocomplete/Autocomplete.js +12 -8
- package/node/Avatar/Avatar.js +7 -4
- package/node/Badge/Badge.js +2 -2
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Chip/Chip.js +31 -30
- package/node/Dialog/Dialog.js +11 -6
- package/node/FilledInput/FilledInput.js +28 -13
- package/node/Input/Input.js +1 -1
- package/node/InputBase/InputBase.js +2 -2
- package/node/LinearProgress/LinearProgress.js +6 -2
- package/node/Modal/Modal.js +25 -8
- package/node/OutlinedInput/OutlinedInput.js +38 -10
- package/node/Select/Select.js +1 -1
- package/node/Skeleton/Skeleton.js +7 -2
- package/node/Slider/Slider.js +21 -21
- package/node/SnackbarContent/SnackbarContent.js +3 -3
- package/node/SpeedDialAction/SpeedDialAction.js +7 -7
- package/node/StepConnector/StepConnector.js +14 -11
- package/node/StepContent/StepContent.js +1 -1
- package/node/Switch/Switch.js +11 -11
- package/node/TableCell/TableCell.js +5 -5
- package/node/Tabs/Tabs.js +16 -18
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +11 -6
- package/node/styles/experimental_extendTheme.js +167 -19
- package/package.json +7 -7
- package/styles/CssVarsProvider.d.ts +14 -28
- package/styles/CssVarsProvider.js +10 -6
- package/styles/createPalette.d.ts +0 -26
- package/styles/experimental_extendTheme.d.ts +238 -35
- package/styles/experimental_extendTheme.js +166 -20
- package/styles/index.d.ts +24 -1
- package/themeCssVarsAugmentation/index.d.ts +30 -0
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/umd/material-ui.development.js +954 -471
- package/umd/material-ui.production.min.js +27 -22
- package/useMediaQuery/useMediaQuery.d.ts +31 -31
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import { ThemeOptions as SystemThemeOptions, Theme as SystemTheme } from '@mui/system';
|
|
3
2
|
import { OverridableStringUnion } from '@mui/types';
|
|
4
|
-
import {
|
|
3
|
+
import { ThemeOptions, Theme } from './createTheme';
|
|
5
4
|
import { Palette, PaletteOptions } from './createPalette';
|
|
6
|
-
import { Typography, TypographyOptions } from './createTypography';
|
|
7
5
|
import { Shadows } from './shadows';
|
|
8
|
-
import {
|
|
9
|
-
import { ZIndex, ZIndexOptions } from './zIndex';
|
|
6
|
+
import { ZIndex } from './zIndex';
|
|
10
7
|
import { Components } from './components';
|
|
11
8
|
|
|
12
9
|
/**
|
|
@@ -35,8 +32,8 @@ export type ExtendedColorScheme = OverridableStringUnion<never, ColorSchemeOverr
|
|
|
35
32
|
export type SupportedColorScheme = DefaultColorScheme | ExtendedColorScheme;
|
|
36
33
|
|
|
37
34
|
export interface Opacity {
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
inputPlaceholder: number;
|
|
36
|
+
inputUnderline: number;
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
export type Overlays = [
|
|
@@ -67,45 +64,248 @@ export type Overlays = [
|
|
|
67
64
|
string | undefined,
|
|
68
65
|
];
|
|
69
66
|
|
|
70
|
-
export interface
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
export interface PaletteCommonChannel {
|
|
68
|
+
background: string;
|
|
69
|
+
backgroundChannel: string;
|
|
70
|
+
onBackground: string;
|
|
71
|
+
onBackgroundChannel: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface PaletteColorChannel {
|
|
75
|
+
mainChannel: string;
|
|
76
|
+
lightChannel: string;
|
|
77
|
+
darkChannel: string;
|
|
78
|
+
contrastTextChannel: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface PaletteActionChannel {
|
|
82
|
+
activeChannel: string;
|
|
83
|
+
selectedChannel: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface PaletteTextChannel {
|
|
87
|
+
primaryChannel: string;
|
|
88
|
+
secondaryChannel: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface PaletteAlert {
|
|
92
|
+
errorColor: string;
|
|
93
|
+
infoColor: string;
|
|
94
|
+
successColor: string;
|
|
95
|
+
warningColor: string;
|
|
96
|
+
errorFilledBg: string;
|
|
97
|
+
infoFilledBg: string;
|
|
98
|
+
successFilledBg: string;
|
|
99
|
+
warningFilledBg: string;
|
|
100
|
+
errorFilledColor: string;
|
|
101
|
+
infoFilledColor: string;
|
|
102
|
+
successFilledColor: string;
|
|
103
|
+
warningFilledColor: string;
|
|
104
|
+
errorStandardBg: string;
|
|
105
|
+
infoStandardBg: string;
|
|
106
|
+
successStandardBg: string;
|
|
107
|
+
warningStandardBg: string;
|
|
108
|
+
errorIconColor: string;
|
|
109
|
+
infoIconColor: string;
|
|
110
|
+
successIconColor: string;
|
|
111
|
+
warningIconColor: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface PaletteAppBar {
|
|
115
|
+
defaultBg: string;
|
|
116
|
+
darkBg: string;
|
|
117
|
+
darkColor: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface PaletteAvatar {
|
|
121
|
+
defaultBg: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface PaletteChip {
|
|
125
|
+
defaultBorder: string;
|
|
126
|
+
defaultAvatarColor: string;
|
|
127
|
+
defaultIconColor: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface PaletteFilledInput {
|
|
131
|
+
bg: string;
|
|
132
|
+
hoverBg: string;
|
|
133
|
+
disabledBg: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface PaletteLinearProgress {
|
|
137
|
+
primaryBg: string;
|
|
138
|
+
secondaryBg: string;
|
|
139
|
+
errorBg: string;
|
|
140
|
+
infoBg: string;
|
|
141
|
+
successBg: string;
|
|
142
|
+
warningBg: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface PaletteSkeleton {
|
|
146
|
+
bg: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface PaletteSlider {
|
|
150
|
+
primaryTrack: string;
|
|
151
|
+
secondaryTrack: string;
|
|
152
|
+
errorTrack: string;
|
|
153
|
+
infoTrack: string;
|
|
154
|
+
successTrack: string;
|
|
155
|
+
warningTrack: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface PaletteSnackbarContent {
|
|
159
|
+
bg: string;
|
|
160
|
+
color: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface PaletteSpeedDialAction {
|
|
164
|
+
fabHoverBg: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface PaletteStepConnector {
|
|
168
|
+
border: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface PaletteStepContent {
|
|
172
|
+
border: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface PaletteSwitch {
|
|
176
|
+
defaultColor: string;
|
|
177
|
+
defaultDisabledColor: string;
|
|
178
|
+
primaryDisabledColor: string;
|
|
179
|
+
secondaryDisabledColor: string;
|
|
180
|
+
errorDisabledColor: string;
|
|
181
|
+
infoDisabledColor: string;
|
|
182
|
+
successDisabledColor: string;
|
|
183
|
+
warningDisabledColor: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface PaletteTableCell {
|
|
187
|
+
border: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface PaletteTooltip {
|
|
191
|
+
bg: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// The Palette should be sync with `../themeCssVarsAugmentation/index.d.ts`
|
|
195
|
+
export interface ColorSystemOptions {
|
|
196
|
+
palette?: Omit<PaletteOptions, 'mode'> & {
|
|
197
|
+
common?: Partial<PaletteCommonChannel>;
|
|
198
|
+
primary?: Partial<PaletteColorChannel>;
|
|
199
|
+
secondary?: Partial<PaletteColorChannel>;
|
|
200
|
+
error?: Partial<PaletteColorChannel>;
|
|
201
|
+
info?: Partial<PaletteColorChannel>;
|
|
202
|
+
success?: Partial<PaletteColorChannel>;
|
|
203
|
+
text?: Partial<PaletteTextChannel>;
|
|
204
|
+
dividerChannel?: Partial<string>;
|
|
205
|
+
action?: Partial<PaletteActionChannel>;
|
|
206
|
+
Alert?: Partial<PaletteAlert>;
|
|
207
|
+
AppBar?: Partial<PaletteAppBar>;
|
|
208
|
+
Avatar?: Partial<PaletteAvatar>;
|
|
209
|
+
Chip?: Partial<PaletteChip>;
|
|
210
|
+
FilledInput?: Partial<PaletteFilledInput>;
|
|
211
|
+
LinearProgress?: Partial<PaletteLinearProgress>;
|
|
212
|
+
Skeleton?: Partial<PaletteSkeleton>;
|
|
213
|
+
Slider?: Partial<PaletteSlider>;
|
|
214
|
+
SnackbarContent?: Partial<PaletteSnackbarContent>;
|
|
215
|
+
SpeedDialAction?: Partial<PaletteSpeedDialAction>;
|
|
216
|
+
StepConnector?: Partial<PaletteStepConnector>;
|
|
217
|
+
StepContent?: Partial<PaletteStepContent>;
|
|
218
|
+
Switch?: Partial<PaletteSwitch>;
|
|
219
|
+
TableCell?: Partial<PaletteTableCell>;
|
|
220
|
+
Tooltip?: Partial<PaletteTooltip>;
|
|
221
|
+
};
|
|
222
|
+
opacity?: Partial<Opacity>;
|
|
223
|
+
overlays?: Overlays;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface CssVarsPalette {
|
|
227
|
+
colorScheme: SupportedColorScheme;
|
|
228
|
+
common: PaletteCommonChannel;
|
|
229
|
+
primary: PaletteColorChannel;
|
|
230
|
+
secondary: PaletteColorChannel;
|
|
231
|
+
error: PaletteColorChannel;
|
|
232
|
+
info: PaletteColorChannel;
|
|
233
|
+
success: PaletteColorChannel;
|
|
234
|
+
text: PaletteTextChannel;
|
|
235
|
+
dividerChannel: string;
|
|
236
|
+
action: PaletteActionChannel;
|
|
237
|
+
Alert: PaletteAlert;
|
|
238
|
+
AppBar: PaletteAppBar;
|
|
239
|
+
Avatar: PaletteAvatar;
|
|
240
|
+
Chip: PaletteChip;
|
|
241
|
+
FilledInput: PaletteFilledInput;
|
|
242
|
+
LinearProgress: PaletteLinearProgress;
|
|
243
|
+
Skeleton: PaletteSkeleton;
|
|
244
|
+
Slider: PaletteSlider;
|
|
245
|
+
SnackbarContent: PaletteSnackbarContent;
|
|
246
|
+
SpeedDialAction: PaletteSpeedDialAction;
|
|
247
|
+
StepConnector: PaletteStepConnector;
|
|
248
|
+
StepContent: PaletteStepContent;
|
|
249
|
+
Switch: PaletteSwitch;
|
|
250
|
+
TableCell: PaletteTableCell;
|
|
251
|
+
Tooltip: PaletteTooltip;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface ColorSystem {
|
|
255
|
+
palette: Palette & CssVarsPalette;
|
|
256
|
+
opacity: Opacity;
|
|
257
|
+
overlays: Overlays;
|
|
86
258
|
}
|
|
87
259
|
|
|
88
|
-
interface
|
|
89
|
-
|
|
90
|
-
|
|
260
|
+
export interface CssVarsThemeOptions extends Omit<ThemeOptions, 'palette' | 'components'> {
|
|
261
|
+
/**
|
|
262
|
+
* Prefix of the generated CSS variables
|
|
263
|
+
* @default 'mui'
|
|
264
|
+
*/
|
|
265
|
+
cssVarPrefix?: string;
|
|
266
|
+
/**
|
|
267
|
+
* Theme components
|
|
268
|
+
*/
|
|
269
|
+
components?: Components<Omit<Theme, 'components' | 'palette'> & CssVarsTheme>;
|
|
270
|
+
/**
|
|
271
|
+
* Color schemes configuration
|
|
272
|
+
*/
|
|
273
|
+
colorSchemes?: Partial<Record<SupportedColorScheme, ColorSystemOptions>>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// should not include keys defined in `shouldSkipGeneratingVar` and have value typeof function
|
|
277
|
+
interface ThemeVars {
|
|
278
|
+
palette: Omit<
|
|
279
|
+
ColorSystem['palette'],
|
|
280
|
+
| 'colorScheme'
|
|
281
|
+
| 'mode'
|
|
282
|
+
| 'contrastThreshold'
|
|
283
|
+
| 'tonalOffset'
|
|
284
|
+
| 'getContrastText'
|
|
285
|
+
| 'augmentColor'
|
|
286
|
+
>;
|
|
91
287
|
opacity: Opacity;
|
|
92
288
|
overlays: Overlays;
|
|
93
289
|
shadows: Shadows;
|
|
94
|
-
transitions: Transitions;
|
|
95
|
-
typography: Typography;
|
|
96
290
|
zIndex: ZIndex;
|
|
97
|
-
|
|
98
|
-
colorSchemes: Record<string, { palette: Palette }>;
|
|
291
|
+
shape: Theme['shape'];
|
|
99
292
|
}
|
|
100
293
|
|
|
101
|
-
// shut off automatic exporting for the `
|
|
294
|
+
// shut off automatic exporting for the `ThemeVars` above
|
|
102
295
|
export {};
|
|
103
296
|
|
|
104
297
|
/**
|
|
105
|
-
*
|
|
298
|
+
* Theme properties generated by extendTheme and CssVarsProvider
|
|
106
299
|
*/
|
|
107
|
-
export interface
|
|
108
|
-
|
|
300
|
+
export interface CssVarsTheme extends ColorSystem {
|
|
301
|
+
colorSchemes: Record<SupportedColorScheme, ColorSystem>;
|
|
302
|
+
cssVarPrefix: string;
|
|
303
|
+
vars: ThemeVars;
|
|
304
|
+
getCssVar: <CustomVar extends string = never>(
|
|
305
|
+
field: string | CustomVar,
|
|
306
|
+
...vars: Array<string | CustomVar>
|
|
307
|
+
) => string;
|
|
308
|
+
getColorSchemeSelector: (colorScheme: SupportedColorScheme) => string;
|
|
109
309
|
}
|
|
110
310
|
|
|
111
311
|
/**
|
|
@@ -114,4 +314,7 @@ export interface Theme extends BaseTheme {
|
|
|
114
314
|
* @param args Deep merge the arguments with the about to be returned theme.
|
|
115
315
|
* @returns A complete, ready-to-use theme object.
|
|
116
316
|
*/
|
|
117
|
-
export default function experimental_extendTheme(
|
|
317
|
+
export default function experimental_extendTheme(
|
|
318
|
+
options?: CssVarsThemeOptions,
|
|
319
|
+
...args: object[]
|
|
320
|
+
): Omit<Theme, 'palette'> & CssVarsTheme;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["colorSchemes"],
|
|
3
|
+
const _excluded = ["colorSchemes", "cssVarPrefix"],
|
|
4
4
|
_excluded2 = ["palette"];
|
|
5
5
|
import { deepmerge } from '@mui/utils';
|
|
6
|
-
import { colorChannel } from '@mui/system';
|
|
6
|
+
import { colorChannel, alpha, darken, lighten, emphasize, unstable_createGetCssVar as systemCreateGetCssVar } from '@mui/system';
|
|
7
7
|
import createThemeWithoutVars from './createTheme';
|
|
8
8
|
import { getOverlayAlpha } from '../Paper/Paper';
|
|
9
9
|
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
@@ -14,14 +14,31 @@ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
|
14
14
|
const overlay = getOverlayAlpha(index);
|
|
15
15
|
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
16
16
|
});
|
|
17
|
+
|
|
18
|
+
function assignNode(obj, keys) {
|
|
19
|
+
keys.forEach(k => {
|
|
20
|
+
if (!obj[k]) {
|
|
21
|
+
obj[k] = {};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function setColor(obj, key, defaultValue) {
|
|
27
|
+
obj[key] = obj[key] || defaultValue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const createGetCssVar = (cssVarPrefix = 'mui') => systemCreateGetCssVar(cssVarPrefix);
|
|
17
31
|
export default function extendTheme(options = {}, ...args) {
|
|
18
32
|
var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3;
|
|
19
33
|
|
|
20
34
|
const {
|
|
21
|
-
colorSchemes: colorSchemesInput = {}
|
|
35
|
+
colorSchemes: colorSchemesInput = {},
|
|
36
|
+
cssVarPrefix = 'mui'
|
|
22
37
|
} = options,
|
|
23
38
|
input = _objectWithoutPropertiesLoose(options, _excluded);
|
|
24
39
|
|
|
40
|
+
const getCssVar = createGetCssVar(cssVarPrefix);
|
|
41
|
+
|
|
25
42
|
const _createThemeWithoutVa = createThemeWithoutVars(_extends({}, input, colorSchemesInput.light && {
|
|
26
43
|
palette: (_colorSchemesInput$li = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li.palette
|
|
27
44
|
})),
|
|
@@ -39,20 +56,26 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
39
56
|
});
|
|
40
57
|
|
|
41
58
|
let theme = _extends({}, muiTheme, {
|
|
59
|
+
cssVarPrefix,
|
|
60
|
+
getCssVar,
|
|
42
61
|
colorSchemes: _extends({}, colorSchemesInput, {
|
|
43
62
|
light: _extends({}, colorSchemesInput.light, {
|
|
44
63
|
palette: lightPalette,
|
|
45
64
|
opacity: _extends({
|
|
46
|
-
|
|
47
|
-
|
|
65
|
+
inputPlaceholder: 0.42,
|
|
66
|
+
inputUnderline: 0.42,
|
|
67
|
+
switchTrackDisabled: 0.12,
|
|
68
|
+
switchTrack: 0.38
|
|
48
69
|
}, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity),
|
|
49
70
|
overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || []
|
|
50
71
|
}),
|
|
51
72
|
dark: _extends({}, colorSchemesInput.dark, {
|
|
52
73
|
palette: darkPalette,
|
|
53
74
|
opacity: _extends({
|
|
54
|
-
|
|
55
|
-
|
|
75
|
+
inputPlaceholder: 0.5,
|
|
76
|
+
inputUnderline: 0.7,
|
|
77
|
+
switchTrackDisabled: 0.2,
|
|
78
|
+
switchTrack: 0.3
|
|
56
79
|
}, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
|
|
57
80
|
overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
|
|
58
81
|
})
|
|
@@ -62,23 +85,142 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
62
85
|
Object.keys(theme.colorSchemes).forEach(key => {
|
|
63
86
|
const palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
|
|
64
87
|
|
|
65
|
-
if (key === '
|
|
66
|
-
palette.common
|
|
67
|
-
palette.common
|
|
88
|
+
if (key === 'light') {
|
|
89
|
+
setColor(palette.common, 'background', '#fff');
|
|
90
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
68
91
|
} else {
|
|
69
|
-
palette.common
|
|
70
|
-
palette.common
|
|
71
|
-
}
|
|
92
|
+
setColor(palette.common, 'background', '#000');
|
|
93
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
94
|
+
} // assign component variables
|
|
72
95
|
|
|
73
|
-
palette.common.backgroundChannel = colorChannel(palette.common.background);
|
|
74
|
-
palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
|
|
75
|
-
palette.dividerChannel = colorChannel(palette.divider); // special token for Tooltip
|
|
76
|
-
// TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
|
|
77
96
|
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
98
|
+
|
|
99
|
+
if (key === 'light') {
|
|
100
|
+
setColor(palette.Alert, 'errorColor', darken(palette.error.light, 0.6));
|
|
101
|
+
setColor(palette.Alert, 'infoColor', darken(palette.info.light, 0.6));
|
|
102
|
+
setColor(palette.Alert, 'successColor', darken(palette.success.light, 0.6));
|
|
103
|
+
setColor(palette.Alert, 'warningColor', darken(palette.warning.light, 0.6));
|
|
104
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-main'));
|
|
105
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-main'));
|
|
106
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-main'));
|
|
107
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-main'));
|
|
108
|
+
setColor(palette.Alert, 'errorFilledColor', lightPalette.getContrastText(palette.error.main));
|
|
109
|
+
setColor(palette.Alert, 'infoFilledColor', lightPalette.getContrastText(palette.info.main));
|
|
110
|
+
setColor(palette.Alert, 'successFilledColor', lightPalette.getContrastText(palette.success.main));
|
|
111
|
+
setColor(palette.Alert, 'warningFilledColor', lightPalette.getContrastText(palette.warning.main));
|
|
112
|
+
setColor(palette.Alert, 'errorStandardBg', lighten(palette.error.light, 0.9));
|
|
113
|
+
setColor(palette.Alert, 'infoStandardBg', lighten(palette.info.light, 0.9));
|
|
114
|
+
setColor(palette.Alert, 'successStandardBg', lighten(palette.success.light, 0.9));
|
|
115
|
+
setColor(palette.Alert, 'warningStandardBg', lighten(palette.warning.light, 0.9));
|
|
116
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-light'));
|
|
117
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-light'));
|
|
118
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-light'));
|
|
119
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-light'));
|
|
120
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-100'));
|
|
121
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-400'));
|
|
122
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-400'));
|
|
123
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-700'));
|
|
124
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-700'));
|
|
125
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
126
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
127
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
128
|
+
setColor(palette.LinearProgress, 'primaryBg', lighten(palette.primary.main, 0.62));
|
|
129
|
+
setColor(palette.LinearProgress, 'secondaryBg', lighten(palette.secondary.main, 0.62));
|
|
130
|
+
setColor(palette.LinearProgress, 'errorBg', lighten(palette.error.main, 0.62));
|
|
131
|
+
setColor(palette.LinearProgress, 'infoBg', lighten(palette.info.main, 0.62));
|
|
132
|
+
setColor(palette.LinearProgress, 'successBg', lighten(palette.success.main, 0.62));
|
|
133
|
+
setColor(palette.LinearProgress, 'warningBg', lighten(palette.warning.main, 0.62));
|
|
134
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.11)`);
|
|
135
|
+
setColor(palette.Slider, 'primaryTrack', lighten(palette.primary.main, 0.62));
|
|
136
|
+
setColor(palette.Slider, 'secondaryTrack', lighten(palette.secondary.main, 0.62));
|
|
137
|
+
setColor(palette.Slider, 'errorTrack', lighten(palette.error.main, 0.62));
|
|
138
|
+
setColor(palette.Slider, 'infoTrack', lighten(palette.info.main, 0.62));
|
|
139
|
+
setColor(palette.Slider, 'successTrack', lighten(palette.success.main, 0.62));
|
|
140
|
+
setColor(palette.Slider, 'warningTrack', lighten(palette.warning.main, 0.62));
|
|
141
|
+
const snackbarContentBackground = emphasize(palette.background.default, 0.8);
|
|
142
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
143
|
+
setColor(palette.SnackbarContent, 'color', lightPalette.getContrastText(snackbarContentBackground));
|
|
144
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
145
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-400'));
|
|
146
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-400'));
|
|
147
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-common-white'));
|
|
148
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-100'));
|
|
149
|
+
setColor(palette.Switch, 'primaryDisabledColor', lighten(palette.primary.main, 0.62));
|
|
150
|
+
setColor(palette.Switch, 'secondaryDisabledColor', lighten(palette.secondary.main, 0.62));
|
|
151
|
+
setColor(palette.Switch, 'errorDisabledColor', lighten(palette.error.main, 0.62));
|
|
152
|
+
setColor(palette.Switch, 'infoDisabledColor', lighten(palette.info.main, 0.62));
|
|
153
|
+
setColor(palette.Switch, 'successDisabledColor', lighten(palette.success.main, 0.62));
|
|
154
|
+
setColor(palette.Switch, 'warningDisabledColor', lighten(palette.warning.main, 0.62));
|
|
155
|
+
setColor(palette.TableCell, 'border', lighten(alpha(palette.divider, 1), 0.88));
|
|
156
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
157
|
+
} else {
|
|
158
|
+
setColor(palette.Alert, 'errorColor', lighten(palette.error.light, 0.6));
|
|
159
|
+
setColor(palette.Alert, 'infoColor', lighten(palette.info.light, 0.6));
|
|
160
|
+
setColor(palette.Alert, 'successColor', lighten(palette.success.light, 0.6));
|
|
161
|
+
setColor(palette.Alert, 'warningColor', lighten(palette.warning.light, 0.6));
|
|
162
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-dark'));
|
|
163
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-dark'));
|
|
164
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-dark'));
|
|
165
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-dark'));
|
|
166
|
+
setColor(palette.Alert, 'errorFilledColor', darkPalette.getContrastText(palette.error.dark));
|
|
167
|
+
setColor(palette.Alert, 'infoFilledColor', darkPalette.getContrastText(palette.info.dark));
|
|
168
|
+
setColor(palette.Alert, 'successFilledColor', darkPalette.getContrastText(palette.success.dark));
|
|
169
|
+
setColor(palette.Alert, 'warningFilledColor', darkPalette.getContrastText(palette.warning.dark));
|
|
170
|
+
setColor(palette.Alert, 'errorStandardBg', darken(palette.error.light, 0.9));
|
|
171
|
+
setColor(palette.Alert, 'infoStandardBg', darken(palette.info.light, 0.9));
|
|
172
|
+
setColor(palette.Alert, 'successStandardBg', darken(palette.success.light, 0.9));
|
|
173
|
+
setColor(palette.Alert, 'warningStandardBg', darken(palette.warning.light, 0.9));
|
|
174
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-main'));
|
|
175
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-main'));
|
|
176
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-main'));
|
|
177
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-main'));
|
|
178
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-900'));
|
|
179
|
+
setColor(palette.AppBar, 'darkBg', getCssVar('palette-background-paper')); // specific for dark mode
|
|
180
|
+
|
|
181
|
+
setColor(palette.AppBar, 'darkColor', getCssVar('palette-text-primary')); // specific for dark mode
|
|
182
|
+
|
|
183
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-600'));
|
|
184
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-700'));
|
|
185
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-300'));
|
|
186
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-300'));
|
|
187
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
188
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
189
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
190
|
+
setColor(palette.LinearProgress, 'primaryBg', darken(palette.primary.main, 0.5));
|
|
191
|
+
setColor(palette.LinearProgress, 'secondaryBg', darken(palette.secondary.main, 0.5));
|
|
192
|
+
setColor(palette.LinearProgress, 'errorBg', darken(palette.error.main, 0.5));
|
|
193
|
+
setColor(palette.LinearProgress, 'infoBg', darken(palette.info.main, 0.5));
|
|
194
|
+
setColor(palette.LinearProgress, 'successBg', darken(palette.success.main, 0.5));
|
|
195
|
+
setColor(palette.LinearProgress, 'warningBg', darken(palette.warning.main, 0.5));
|
|
196
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.13)`);
|
|
197
|
+
setColor(palette.Slider, 'primaryTrack', darken(palette.primary.main, 0.5));
|
|
198
|
+
setColor(palette.Slider, 'secondaryTrack', darken(palette.secondary.main, 0.5));
|
|
199
|
+
setColor(palette.Slider, 'errorTrack', darken(palette.error.main, 0.5));
|
|
200
|
+
setColor(palette.Slider, 'infoTrack', darken(palette.info.main, 0.5));
|
|
201
|
+
setColor(palette.Slider, 'successTrack', darken(palette.success.main, 0.5));
|
|
202
|
+
setColor(palette.Slider, 'warningTrack', darken(palette.warning.main, 0.5));
|
|
203
|
+
const snackbarContentBackground = emphasize(palette.background.default, 0.98);
|
|
204
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
205
|
+
setColor(palette.SnackbarContent, 'color', darkPalette.getContrastText(snackbarContentBackground));
|
|
206
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
207
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-600'));
|
|
208
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-600'));
|
|
209
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-grey-300'));
|
|
210
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-600'));
|
|
211
|
+
setColor(palette.Switch, 'primaryDisabledColor', darken(palette.primary.main, 0.55));
|
|
212
|
+
setColor(palette.Switch, 'secondaryDisabledColor', darken(palette.secondary.main, 0.55));
|
|
213
|
+
setColor(palette.Switch, 'errorDisabledColor', darken(palette.error.main, 0.55));
|
|
214
|
+
setColor(palette.Switch, 'infoDisabledColor', darken(palette.info.main, 0.55));
|
|
215
|
+
setColor(palette.Switch, 'successDisabledColor', darken(palette.success.main, 0.55));
|
|
216
|
+
setColor(palette.Switch, 'warningDisabledColor', darken(palette.warning.main, 0.55));
|
|
217
|
+
setColor(palette.TableCell, 'border', darken(alpha(palette.divider, 1), 0.68));
|
|
218
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
80
219
|
}
|
|
81
220
|
|
|
221
|
+
palette.common.backgroundChannel = colorChannel(palette.common.background);
|
|
222
|
+
palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
|
|
223
|
+
palette.dividerChannel = colorChannel(palette.divider);
|
|
82
224
|
Object.keys(palette).forEach(color => {
|
|
83
225
|
const colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
|
|
84
226
|
|
|
@@ -105,12 +247,16 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
105
247
|
|
|
106
248
|
if (colors.secondary) {
|
|
107
249
|
palette[color].secondaryChannel = colorChannel(colors.secondary);
|
|
108
|
-
} // Action colors: action.
|
|
250
|
+
} // Action colors: action.active, action.selected
|
|
109
251
|
|
|
110
252
|
|
|
111
253
|
if (colors.active) {
|
|
112
254
|
palette[color].activeChannel = colorChannel(colors.active);
|
|
113
255
|
}
|
|
256
|
+
|
|
257
|
+
if (colors.selected) {
|
|
258
|
+
palette[color].selectedChannel = colorChannel(colors.selected);
|
|
259
|
+
}
|
|
114
260
|
});
|
|
115
261
|
});
|
|
116
262
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
package/styles/index.d.ts
CHANGED
|
@@ -94,4 +94,27 @@ export { default as withTheme } from './withTheme';
|
|
|
94
94
|
export * from './CssVarsProvider';
|
|
95
95
|
|
|
96
96
|
export { default as experimental_extendTheme } from './experimental_extendTheme';
|
|
97
|
-
export
|
|
97
|
+
export type {
|
|
98
|
+
ColorSchemeOverrides,
|
|
99
|
+
SupportedColorScheme,
|
|
100
|
+
Opacity,
|
|
101
|
+
Overlays,
|
|
102
|
+
PaletteActionChannel,
|
|
103
|
+
PaletteAppBar,
|
|
104
|
+
PaletteAvatar,
|
|
105
|
+
PaletteChip,
|
|
106
|
+
PaletteColorChannel,
|
|
107
|
+
PaletteCommonChannel,
|
|
108
|
+
PaletteFilledInput,
|
|
109
|
+
PaletteLinearProgress,
|
|
110
|
+
PaletteSlider,
|
|
111
|
+
PaletteSnackbarContent,
|
|
112
|
+
PaletteStepConnector,
|
|
113
|
+
PaletteStepContent,
|
|
114
|
+
PaletteSwitch,
|
|
115
|
+
PaletteTableCell,
|
|
116
|
+
PaletteTextChannel,
|
|
117
|
+
PaletteTooltip,
|
|
118
|
+
CssVarsThemeOptions,
|
|
119
|
+
CssVarsTheme,
|
|
120
|
+
} from './experimental_extendTheme';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CssVarsTheme,
|
|
3
|
+
CssVarsPalette,
|
|
4
|
+
PaletteCommonChannel,
|
|
5
|
+
PaletteColorChannel,
|
|
6
|
+
PaletteTextChannel,
|
|
7
|
+
PaletteActionChannel,
|
|
8
|
+
} from '../styles/experimental_extendTheme';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Enhance the theme types to include new properties from the CssVarsProvider.
|
|
12
|
+
* The theme is typed with CSS variables in `styled`, `sx`, `useTheme`, etc.
|
|
13
|
+
*/
|
|
14
|
+
declare module '@mui/material/styles' {
|
|
15
|
+
// The palette must be extended in each node.
|
|
16
|
+
interface Theme extends Omit<CssVarsTheme, 'palette'> {}
|
|
17
|
+
|
|
18
|
+
// The extended Palette should be in sync with `extendTheme`
|
|
19
|
+
interface Palette extends CssVarsPalette {}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module '@mui/material/styles/createPalette' {
|
|
23
|
+
interface CommonColors extends PaletteCommonChannel {}
|
|
24
|
+
|
|
25
|
+
interface PaletteColor extends PaletteColorChannel {}
|
|
26
|
+
|
|
27
|
+
interface TypeText extends PaletteTextChannel {}
|
|
28
|
+
|
|
29
|
+
interface TypeAction extends PaletteActionChannel {}
|
|
30
|
+
}
|
package/transitions/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './transition';
|
|
1
|
+
export * from './transition';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TransitionProps as _TransitionProps, TransitionActions } from 'react-transition-group/Transition';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
export declare type TransitionHandlerKeys = 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited';
|
|
4
|
-
export declare type TransitionHandlerProps = Pick<_TransitionProps, TransitionHandlerKeys>;
|
|
5
|
-
export interface EasingProps {
|
|
6
|
-
easing: string | {
|
|
7
|
-
enter?: string;
|
|
8
|
-
exit?: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare type TransitionKeys = 'in' | 'mountOnEnter' | 'unmountOnExit' | 'timeout' | 'easing' | 'addEndListener' | TransitionHandlerKeys;
|
|
12
|
-
export interface TransitionProps extends TransitionActions, Partial<Pick<_TransitionProps & EasingProps, TransitionKeys>>, React.HTMLAttributes<HTMLElement> {
|
|
13
|
-
}
|
|
1
|
+
import { TransitionProps as _TransitionProps, TransitionActions } from 'react-transition-group/Transition';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare type TransitionHandlerKeys = 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited';
|
|
4
|
+
export declare type TransitionHandlerProps = Pick<_TransitionProps, TransitionHandlerKeys>;
|
|
5
|
+
export interface EasingProps {
|
|
6
|
+
easing: string | {
|
|
7
|
+
enter?: string;
|
|
8
|
+
exit?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare type TransitionKeys = 'in' | 'mountOnEnter' | 'unmountOnExit' | 'timeout' | 'easing' | 'addEndListener' | TransitionHandlerKeys;
|
|
12
|
+
export interface TransitionProps extends TransitionActions, Partial<Pick<_TransitionProps & EasingProps, TransitionKeys>>, React.HTMLAttributes<HTMLElement> {
|
|
13
|
+
}
|