@mui/material 5.5.3 → 5.6.0
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/appBarClasses.d.ts +28 -28
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.d.ts +20 -7
- package/Badge/Badge.js +43 -21
- package/Badge/badgeClasses.d.ts +24 -0
- package/Badge/badgeClasses.js +8 -0
- package/Badge/index.d.ts +3 -0
- package/Badge/index.js +2 -1
- 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/Button.js +101 -96
- package/Button/buttonClasses.d.ts +76 -76
- 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 +74 -0
- 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/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 +22 -22
- 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/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/inputBaseClasses.d.ts +44 -44
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/Link.js +12 -5
- 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/ListItemButton.js +1 -0
- 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/NativeSelect/nativeSelectClasses.d.ts +32 -32
- 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/skeletonClasses.d.ts +24 -24
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- 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/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +24 -24
- 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/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/tabsClasses.d.ts +32 -32
- package/TextField/TextField.d.ts +0 -1
- 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/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/className/index.d.ts +8 -8
- package/darkScrollbar/index.d.ts +28 -28
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Badge/Badge.js +44 -21
- package/legacy/Badge/badgeClasses.js +8 -0
- package/legacy/Badge/index.js +2 -1
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Button/Button.js +30 -29
- package/legacy/Link/Link.js +12 -4
- package/legacy/ListItemButton/ListItemButton.js +1 -0
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +115 -111
- package/legacy/styles/CssVarsProvider.js +31 -0
- package/legacy/styles/experimental_extendTheme.js +96 -0
- package/legacy/styles/index.js +3 -1
- package/locale/index.d.ts +71 -71
- package/locale/index.js +6 -3
- package/modern/Badge/Badge.js +40 -18
- package/modern/Badge/badgeClasses.js +8 -0
- package/modern/Badge/index.js +2 -1
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Button/Button.js +29 -28
- package/modern/Link/Link.js +12 -5
- package/modern/ListItemButton/ListItemButton.js +1 -0
- package/modern/index.js +1 -1
- package/modern/locale/index.js +6 -3
- package/modern/styles/CssVarsProvider.js +28 -0
- package/modern/styles/experimental_extendTheme.js +89 -0
- package/modern/styles/index.js +3 -1
- package/node/Badge/Badge.js +53 -32
- package/node/Badge/badgeClasses.js +22 -0
- package/node/Badge/index.js +17 -5
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Button/Button.js +101 -96
- package/node/Link/Link.js +13 -5
- package/node/ListItemButton/ListItemButton.js +1 -0
- package/node/index.js +1 -1
- package/node/locale/index.js +6 -3
- package/node/styles/CssVarsProvider.js +41 -0
- package/node/styles/experimental_extendTheme.js +105 -0
- package/node/styles/index.js +58 -0
- package/package.json +7 -7
- package/styles/CssVarsProvider.d.ts +28 -0
- package/styles/CssVarsProvider.js +28 -0
- package/styles/createPalette.d.ts +26 -0
- package/styles/experimental_extendTheme.d.ts +90 -0
- package/styles/experimental_extendTheme.js +91 -0
- package/styles/index.d.ts +5 -0
- package/styles/index.js +3 -1
- 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 +1075 -258
- package/umd/material-ui.production.min.js +21 -21
- 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,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.6.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -6449,7 +6449,7 @@
|
|
|
6449
6449
|
styleFunctionSx.filterProps = ['sx'];
|
|
6450
6450
|
var defaultStyleFunctionSx = styleFunctionSx;
|
|
6451
6451
|
|
|
6452
|
-
const _excluded$
|
|
6452
|
+
const _excluded$2l = ["sx"];
|
|
6453
6453
|
|
|
6454
6454
|
const splitProps = props => {
|
|
6455
6455
|
const result = {
|
|
@@ -6470,7 +6470,7 @@
|
|
|
6470
6470
|
const {
|
|
6471
6471
|
sx: inSx
|
|
6472
6472
|
} = props,
|
|
6473
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6473
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2l);
|
|
6474
6474
|
|
|
6475
6475
|
const {
|
|
6476
6476
|
systemProps,
|
|
@@ -6549,7 +6549,7 @@
|
|
|
6549
6549
|
return str;
|
|
6550
6550
|
}
|
|
6551
6551
|
|
|
6552
|
-
const _excluded$
|
|
6552
|
+
const _excluded$2k = ["values", "unit", "step"];
|
|
6553
6553
|
|
|
6554
6554
|
const sortBreakpointsValues = values => {
|
|
6555
6555
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
@@ -6585,7 +6585,7 @@
|
|
|
6585
6585
|
unit = 'px',
|
|
6586
6586
|
step = 5
|
|
6587
6587
|
} = breakpoints,
|
|
6588
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
6588
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$2k);
|
|
6589
6589
|
|
|
6590
6590
|
const sortedValues = sortBreakpointsValues(values);
|
|
6591
6591
|
const keys = Object.keys(sortedValues);
|
|
@@ -6677,16 +6677,16 @@
|
|
|
6677
6677
|
return spacing;
|
|
6678
6678
|
}
|
|
6679
6679
|
|
|
6680
|
-
const _excluded$
|
|
6680
|
+
const _excluded$2j = ["breakpoints", "palette", "spacing", "shape"];
|
|
6681
6681
|
|
|
6682
|
-
function createTheme$
|
|
6682
|
+
function createTheme$2(options = {}, ...args) {
|
|
6683
6683
|
const {
|
|
6684
6684
|
breakpoints: breakpointsInput = {},
|
|
6685
6685
|
palette: paletteInput = {},
|
|
6686
6686
|
spacing: spacingInput,
|
|
6687
6687
|
shape: shapeInput = {}
|
|
6688
6688
|
} = options,
|
|
6689
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6689
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$2j);
|
|
6690
6690
|
|
|
6691
6691
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
6692
6692
|
const spacing = createSpacing(spacingInput);
|
|
@@ -6802,13 +6802,13 @@
|
|
|
6802
6802
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
6803
6803
|
}
|
|
6804
6804
|
|
|
6805
|
-
const systemDefaultTheme$1 = createTheme$
|
|
6805
|
+
const systemDefaultTheme$1 = createTheme$2();
|
|
6806
6806
|
|
|
6807
6807
|
function useTheme$1(defaultTheme = systemDefaultTheme$1) {
|
|
6808
6808
|
return useTheme$2(defaultTheme);
|
|
6809
6809
|
}
|
|
6810
6810
|
|
|
6811
|
-
const _excluded$
|
|
6811
|
+
const _excluded$2i = ["className", "component"];
|
|
6812
6812
|
function createBox(options = {}) {
|
|
6813
6813
|
const {
|
|
6814
6814
|
defaultTheme,
|
|
@@ -6825,7 +6825,7 @@
|
|
|
6825
6825
|
className,
|
|
6826
6826
|
component = 'div'
|
|
6827
6827
|
} = _extendSxProp,
|
|
6828
|
-
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$
|
|
6828
|
+
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$2i);
|
|
6829
6829
|
|
|
6830
6830
|
return /*#__PURE__*/jsxRuntime_1(BoxRoot, _extends({
|
|
6831
6831
|
as: component,
|
|
@@ -6861,7 +6861,7 @@
|
|
|
6861
6861
|
return Box;
|
|
6862
6862
|
}
|
|
6863
6863
|
|
|
6864
|
-
const _excluded$
|
|
6864
|
+
const _excluded$2h = ["variant"];
|
|
6865
6865
|
|
|
6866
6866
|
function isEmpty$2(string) {
|
|
6867
6867
|
return string.length === 0;
|
|
@@ -6877,7 +6877,7 @@
|
|
|
6877
6877
|
const {
|
|
6878
6878
|
variant
|
|
6879
6879
|
} = props,
|
|
6880
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6880
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2h);
|
|
6881
6881
|
|
|
6882
6882
|
let classKey = variant || '';
|
|
6883
6883
|
Object.keys(other).sort().forEach(key => {
|
|
@@ -6890,9 +6890,9 @@
|
|
|
6890
6890
|
return classKey;
|
|
6891
6891
|
}
|
|
6892
6892
|
|
|
6893
|
-
const _excluded$
|
|
6894
|
-
_excluded2$
|
|
6895
|
-
_excluded3$
|
|
6893
|
+
const _excluded$2g = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"],
|
|
6894
|
+
_excluded2$d = ["theme"],
|
|
6895
|
+
_excluded3$2 = ["theme"];
|
|
6896
6896
|
|
|
6897
6897
|
function isEmpty$1(obj) {
|
|
6898
6898
|
return Object.keys(obj).length === 0;
|
|
@@ -6952,7 +6952,7 @@
|
|
|
6952
6952
|
function shouldForwardProp(prop) {
|
|
6953
6953
|
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
6954
6954
|
}
|
|
6955
|
-
const systemDefaultTheme = createTheme$
|
|
6955
|
+
const systemDefaultTheme = createTheme$2();
|
|
6956
6956
|
|
|
6957
6957
|
const lowercaseFirstLetter = string => {
|
|
6958
6958
|
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
@@ -6973,7 +6973,7 @@
|
|
|
6973
6973
|
skipSx: inputSkipSx,
|
|
6974
6974
|
overridesResolver
|
|
6975
6975
|
} = inputOptions,
|
|
6976
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
6976
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$2g); // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6977
6977
|
|
|
6978
6978
|
|
|
6979
6979
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -7010,7 +7010,7 @@
|
|
|
7010
7010
|
let {
|
|
7011
7011
|
theme: themeInput
|
|
7012
7012
|
} = _ref,
|
|
7013
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded2$
|
|
7013
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded2$d);
|
|
7014
7014
|
|
|
7015
7015
|
return stylesArg(_extends({
|
|
7016
7016
|
theme: isEmpty$1(themeInput) ? defaultTheme : themeInput
|
|
@@ -7069,7 +7069,7 @@
|
|
|
7069
7069
|
let {
|
|
7070
7070
|
theme: themeInput
|
|
7071
7071
|
} = _ref2,
|
|
7072
|
-
other = _objectWithoutPropertiesLoose(_ref2, _excluded3$
|
|
7072
|
+
other = _objectWithoutPropertiesLoose(_ref2, _excluded3$2);
|
|
7073
7073
|
|
|
7074
7074
|
return styleArg(_extends({
|
|
7075
7075
|
theme: isEmpty$1(themeInput) ? defaultTheme : themeInput
|
|
@@ -7226,6 +7226,17 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
7226
7226
|
colorSpace
|
|
7227
7227
|
};
|
|
7228
7228
|
}
|
|
7229
|
+
/**
|
|
7230
|
+
* Returns a channel created from the input color.
|
|
7231
|
+
*
|
|
7232
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
7233
|
+
* @returns {string} - The channel for the color, that can be used in rgba or hsla colors
|
|
7234
|
+
*/
|
|
7235
|
+
|
|
7236
|
+
const colorChannel = color => {
|
|
7237
|
+
const decomposedColor = decomposeColor(color);
|
|
7238
|
+
return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');
|
|
7239
|
+
};
|
|
7229
7240
|
/**
|
|
7230
7241
|
* Converts a color object with type and values to a string.
|
|
7231
7242
|
* @param {object} color - Decomposed color
|
|
@@ -7473,8 +7484,720 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
7473
7484
|
ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) ;
|
|
7474
7485
|
}
|
|
7475
7486
|
|
|
7476
|
-
|
|
7477
|
-
|
|
7487
|
+
/**
|
|
7488
|
+
* This function create an object from keys, value and then assign to target
|
|
7489
|
+
*
|
|
7490
|
+
* @param {Object} obj : the target object to be assigned
|
|
7491
|
+
* @param {string[]} keys
|
|
7492
|
+
* @param {string | number} value
|
|
7493
|
+
*
|
|
7494
|
+
* @example
|
|
7495
|
+
* const source = {}
|
|
7496
|
+
* assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')
|
|
7497
|
+
* console.log(source) // { palette: { primary: 'var(--palette-primary)' } }
|
|
7498
|
+
*
|
|
7499
|
+
* @example
|
|
7500
|
+
* const source = { palette: { primary: 'var(--palette-primary)' } }
|
|
7501
|
+
* assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')
|
|
7502
|
+
* console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }
|
|
7503
|
+
*/
|
|
7504
|
+
const assignNestedKeys = (obj, keys, value) => {
|
|
7505
|
+
let temp = obj;
|
|
7506
|
+
keys.forEach((k, index) => {
|
|
7507
|
+
if (index === keys.length - 1) {
|
|
7508
|
+
if (temp && typeof temp === 'object') {
|
|
7509
|
+
temp[k] = value;
|
|
7510
|
+
}
|
|
7511
|
+
} else if (temp && typeof temp === 'object') {
|
|
7512
|
+
if (!temp[k]) {
|
|
7513
|
+
temp[k] = {};
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7516
|
+
temp = temp[k];
|
|
7517
|
+
}
|
|
7518
|
+
});
|
|
7519
|
+
};
|
|
7520
|
+
/**
|
|
7521
|
+
*
|
|
7522
|
+
* @param {Object} obj : source object
|
|
7523
|
+
* @param {Function} callback : a function that will be called when
|
|
7524
|
+
* - the deepest key in source object is reached
|
|
7525
|
+
* - the value of the deepest key is NOT `undefined` | `null`
|
|
7526
|
+
*
|
|
7527
|
+
* @example
|
|
7528
|
+
* walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)
|
|
7529
|
+
* // ['palette', 'primary', 'main'] '#000000'
|
|
7530
|
+
*/
|
|
7531
|
+
|
|
7532
|
+
const walkObjectDeep = (obj, callback, shouldSkipPaths) => {
|
|
7533
|
+
function recurse(object, parentKeys = []) {
|
|
7534
|
+
Object.entries(object).forEach(([key, value]) => {
|
|
7535
|
+
if (!shouldSkipPaths || shouldSkipPaths && !shouldSkipPaths([...parentKeys, key])) {
|
|
7536
|
+
if (value !== undefined && value !== null) {
|
|
7537
|
+
if (typeof value === 'object' && Object.keys(value).length > 0) {
|
|
7538
|
+
recurse(value, [...parentKeys, key]);
|
|
7539
|
+
} else {
|
|
7540
|
+
callback([...parentKeys, key], value, object);
|
|
7541
|
+
}
|
|
7542
|
+
}
|
|
7543
|
+
}
|
|
7544
|
+
});
|
|
7545
|
+
}
|
|
7546
|
+
|
|
7547
|
+
recurse(obj);
|
|
7548
|
+
};
|
|
7549
|
+
|
|
7550
|
+
const getCssValue = (keys, value) => {
|
|
7551
|
+
if (typeof value === 'number') {
|
|
7552
|
+
if (['lineHeight', 'fontWeight', 'opacity', 'zIndex'].some(prop => keys.includes(prop))) {
|
|
7553
|
+
// CSS property that are unitless
|
|
7554
|
+
return value;
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
const lastKey = keys[keys.length - 1];
|
|
7558
|
+
|
|
7559
|
+
if (lastKey.toLowerCase().indexOf('opacity') >= 0) {
|
|
7560
|
+
// opacity values are unitless
|
|
7561
|
+
return value;
|
|
7562
|
+
}
|
|
7563
|
+
|
|
7564
|
+
return `${value}px`;
|
|
7565
|
+
}
|
|
7566
|
+
|
|
7567
|
+
return value;
|
|
7568
|
+
};
|
|
7569
|
+
/**
|
|
7570
|
+
* a function that parse theme and return { css, vars }
|
|
7571
|
+
*
|
|
7572
|
+
* @param {Object} theme
|
|
7573
|
+
* @param {{
|
|
7574
|
+
* prefix?: string,
|
|
7575
|
+
* basePrefix?: string,
|
|
7576
|
+
* shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean
|
|
7577
|
+
* }} options.
|
|
7578
|
+
* `basePrefix`: defined by design system.
|
|
7579
|
+
* `prefix`: defined by application
|
|
7580
|
+
*
|
|
7581
|
+
* the CSS variable value will be adjusted based on the provided `basePrefix` & `prefix` which can be found in `parsedTheme`.
|
|
7582
|
+
*
|
|
7583
|
+
* @returns {{ css: Object, vars: Object, parsedTheme: typeof theme }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme), and `parsedTheme` is the cloned version of theme.
|
|
7584
|
+
*
|
|
7585
|
+
* @example
|
|
7586
|
+
* const { css, vars, parsedTheme } = parser({
|
|
7587
|
+
* fontSize: 12,
|
|
7588
|
+
* lineHeight: 1.2,
|
|
7589
|
+
* palette: { primary: { 500: 'var(--color)' } }
|
|
7590
|
+
* }, { prefix: 'foo' })
|
|
7591
|
+
*
|
|
7592
|
+
* console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--foo-color)' }
|
|
7593
|
+
* console.log(vars) // { fontSize: '--foo-fontSize', lineHeight: '--foo-lineHeight', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }
|
|
7594
|
+
* console.log(parsedTheme) // { fontSize: 12, lineHeight: 1.2, palette: { primary: { 500: 'var(--foo-color)' } } }
|
|
7595
|
+
*/
|
|
7596
|
+
|
|
7597
|
+
|
|
7598
|
+
function cssVarsParser(theme, options) {
|
|
7599
|
+
const {
|
|
7600
|
+
prefix,
|
|
7601
|
+
basePrefix = '',
|
|
7602
|
+
shouldSkipGeneratingVar
|
|
7603
|
+
} = options || {};
|
|
7604
|
+
const css = {};
|
|
7605
|
+
const vars = {};
|
|
7606
|
+
const parsedTheme = {};
|
|
7607
|
+
walkObjectDeep(theme, (keys, value) => {
|
|
7608
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
7609
|
+
if (typeof value === 'string' && value.match(/var\(\s*--/)) {
|
|
7610
|
+
// for CSS variable, apply prefix or remove basePrefix from the variable
|
|
7611
|
+
if (!basePrefix && prefix) {
|
|
7612
|
+
value = value.replace(/var\(\s*--/g, `var(--${prefix}-`);
|
|
7613
|
+
} else {
|
|
7614
|
+
value = prefix ? value.replace(new RegExp(`var\\(\\s*--${basePrefix}`, 'g'), `var(--${prefix}`) // removing spaces
|
|
7615
|
+
: value.replace(new RegExp(`var\\(\\s*--${basePrefix}-`, 'g'), 'var(--');
|
|
7616
|
+
}
|
|
7617
|
+
}
|
|
7618
|
+
|
|
7619
|
+
if (!shouldSkipGeneratingVar || shouldSkipGeneratingVar && !shouldSkipGeneratingVar(keys, value)) {
|
|
7620
|
+
// only create css & var if `shouldSkipGeneratingVar` return false
|
|
7621
|
+
const cssVar = `--${prefix ? `${prefix}-` : ''}${keys.join('-')}`;
|
|
7622
|
+
Object.assign(css, {
|
|
7623
|
+
[cssVar]: getCssValue(keys, value)
|
|
7624
|
+
});
|
|
7625
|
+
assignNestedKeys(vars, keys, `var(${cssVar})`);
|
|
7626
|
+
}
|
|
7627
|
+
}
|
|
7628
|
+
|
|
7629
|
+
assignNestedKeys(parsedTheme, keys, value);
|
|
7630
|
+
}, keys => keys[0] === 'vars' // skip 'vars/*' paths
|
|
7631
|
+
);
|
|
7632
|
+
return {
|
|
7633
|
+
css,
|
|
7634
|
+
vars,
|
|
7635
|
+
parsedTheme
|
|
7636
|
+
};
|
|
7637
|
+
}
|
|
7638
|
+
|
|
7639
|
+
const DEFAULT_MODE_STORAGE_KEY = 'mui-mode';
|
|
7640
|
+
const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'mui-color-scheme';
|
|
7641
|
+
const DEFAULT_ATTRIBUTE = 'data-mui-color-scheme';
|
|
7642
|
+
function getInitColorSchemeScript$1(options) {
|
|
7643
|
+
const {
|
|
7644
|
+
enableSystem,
|
|
7645
|
+
defaultLightColorScheme = 'light',
|
|
7646
|
+
defaultDarkColorScheme = 'dark',
|
|
7647
|
+
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
|
|
7648
|
+
colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
|
|
7649
|
+
attribute = DEFAULT_ATTRIBUTE
|
|
7650
|
+
} = options || {};
|
|
7651
|
+
return /*#__PURE__*/jsxRuntime_1("script", {
|
|
7652
|
+
// eslint-disable-next-line react/no-danger
|
|
7653
|
+
dangerouslySetInnerHTML: {
|
|
7654
|
+
__html: `(function() { try {
|
|
7655
|
+
var mode = localStorage.getItem('${modeStorageKey}');
|
|
7656
|
+
var colorScheme = '';
|
|
7657
|
+
if (mode === 'system' || (!mode && !!${enableSystem})) {
|
|
7658
|
+
// handle system mode
|
|
7659
|
+
var mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
7660
|
+
if (mql.matches) {
|
|
7661
|
+
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
|
|
7662
|
+
} else {
|
|
7663
|
+
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
|
|
7664
|
+
}
|
|
7665
|
+
}
|
|
7666
|
+
if (mode === 'light') {
|
|
7667
|
+
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
|
|
7668
|
+
}
|
|
7669
|
+
if (mode === 'dark') {
|
|
7670
|
+
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
|
|
7671
|
+
}
|
|
7672
|
+
if (colorScheme) {
|
|
7673
|
+
document.documentElement.setAttribute('${attribute}', colorScheme);
|
|
7674
|
+
}
|
|
7675
|
+
} catch (e) {} })();`
|
|
7676
|
+
}
|
|
7677
|
+
});
|
|
7678
|
+
}
|
|
7679
|
+
|
|
7680
|
+
function getSystemMode(mode) {
|
|
7681
|
+
if (typeof window !== 'undefined' && mode === 'system') {
|
|
7682
|
+
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
7683
|
+
|
|
7684
|
+
if (mql.matches) {
|
|
7685
|
+
return 'dark';
|
|
7686
|
+
}
|
|
7687
|
+
|
|
7688
|
+
return 'light';
|
|
7689
|
+
}
|
|
7690
|
+
|
|
7691
|
+
return undefined;
|
|
7692
|
+
}
|
|
7693
|
+
|
|
7694
|
+
function processState(state, callback) {
|
|
7695
|
+
if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') {
|
|
7696
|
+
return callback('light');
|
|
7697
|
+
}
|
|
7698
|
+
|
|
7699
|
+
if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') {
|
|
7700
|
+
return callback('dark');
|
|
7701
|
+
}
|
|
7702
|
+
|
|
7703
|
+
return undefined;
|
|
7704
|
+
}
|
|
7705
|
+
|
|
7706
|
+
function getColorScheme(state) {
|
|
7707
|
+
return processState(state, mode => {
|
|
7708
|
+
if (mode === 'light') {
|
|
7709
|
+
return state.lightColorScheme;
|
|
7710
|
+
}
|
|
7711
|
+
|
|
7712
|
+
if (mode === 'dark') {
|
|
7713
|
+
return state.darkColorScheme;
|
|
7714
|
+
}
|
|
7715
|
+
|
|
7716
|
+
return undefined;
|
|
7717
|
+
});
|
|
7718
|
+
}
|
|
7719
|
+
|
|
7720
|
+
function resolveValue(key, defaultValue) {
|
|
7721
|
+
if (typeof window === 'undefined') {
|
|
7722
|
+
return undefined;
|
|
7723
|
+
}
|
|
7724
|
+
|
|
7725
|
+
let value;
|
|
7726
|
+
|
|
7727
|
+
try {
|
|
7728
|
+
value = localStorage.getItem(key) || undefined;
|
|
7729
|
+
} catch (e) {// Unsupported
|
|
7730
|
+
}
|
|
7731
|
+
|
|
7732
|
+
return value || defaultValue;
|
|
7733
|
+
}
|
|
7734
|
+
|
|
7735
|
+
function useCurrentColorScheme(options) {
|
|
7736
|
+
const {
|
|
7737
|
+
defaultMode = 'light',
|
|
7738
|
+
defaultLightColorScheme,
|
|
7739
|
+
defaultDarkColorScheme,
|
|
7740
|
+
supportedColorSchemes = [],
|
|
7741
|
+
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
|
|
7742
|
+
colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY
|
|
7743
|
+
} = options;
|
|
7744
|
+
const joinedColorSchemes = supportedColorSchemes.join(',');
|
|
7745
|
+
const [state, setState] = React__namespace.useState(() => {
|
|
7746
|
+
const initialMode = resolveValue(modeStorageKey, defaultMode);
|
|
7747
|
+
return {
|
|
7748
|
+
mode: initialMode,
|
|
7749
|
+
systemMode: getSystemMode(initialMode),
|
|
7750
|
+
lightColorScheme: resolveValue(`${colorSchemeStorageKey}-light`) || defaultLightColorScheme,
|
|
7751
|
+
darkColorScheme: resolveValue(`${colorSchemeStorageKey}-dark`) || defaultDarkColorScheme
|
|
7752
|
+
};
|
|
7753
|
+
});
|
|
7754
|
+
const colorScheme = getColorScheme(state);
|
|
7755
|
+
const setMode = React__namespace.useCallback(mode => {
|
|
7756
|
+
setState(currentState => {
|
|
7757
|
+
const newMode = !mode ? defaultMode : mode;
|
|
7758
|
+
|
|
7759
|
+
if (typeof localStorage !== 'undefined') {
|
|
7760
|
+
localStorage.setItem(modeStorageKey, newMode);
|
|
7761
|
+
}
|
|
7762
|
+
|
|
7763
|
+
return _extends({}, currentState, {
|
|
7764
|
+
mode: newMode,
|
|
7765
|
+
systemMode: getSystemMode(newMode)
|
|
7766
|
+
});
|
|
7767
|
+
});
|
|
7768
|
+
}, [modeStorageKey, defaultMode]);
|
|
7769
|
+
const setColorScheme = React__namespace.useCallback(value => {
|
|
7770
|
+
if (!value || typeof value === 'string') {
|
|
7771
|
+
if (value && !supportedColorSchemes.includes(value)) {
|
|
7772
|
+
console.error(`\`${value}\` does not exist in \`theme.colorSchemes\`.`);
|
|
7773
|
+
} else {
|
|
7774
|
+
setState(currentState => {
|
|
7775
|
+
const newState = _extends({}, currentState);
|
|
7776
|
+
|
|
7777
|
+
if (!value) {
|
|
7778
|
+
// reset to default color scheme
|
|
7779
|
+
newState.lightColorScheme = defaultLightColorScheme;
|
|
7780
|
+
newState.darkColorScheme = defaultDarkColorScheme;
|
|
7781
|
+
return newState;
|
|
7782
|
+
}
|
|
7783
|
+
|
|
7784
|
+
processState(currentState, mode => {
|
|
7785
|
+
localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);
|
|
7786
|
+
|
|
7787
|
+
if (mode === 'light') {
|
|
7788
|
+
newState.lightColorScheme = value;
|
|
7789
|
+
}
|
|
7790
|
+
|
|
7791
|
+
if (mode === 'dark') {
|
|
7792
|
+
newState.darkColorScheme = value;
|
|
7793
|
+
}
|
|
7794
|
+
});
|
|
7795
|
+
return newState;
|
|
7796
|
+
});
|
|
7797
|
+
}
|
|
7798
|
+
} else if (value.light && !supportedColorSchemes.includes(value.light) || value.dark && !supportedColorSchemes.includes(value.dark)) {
|
|
7799
|
+
console.error(`\`${value}\` does not exist in \`theme.colorSchemes\`.`);
|
|
7800
|
+
} else {
|
|
7801
|
+
setState(currentState => {
|
|
7802
|
+
const newState = _extends({}, currentState);
|
|
7803
|
+
|
|
7804
|
+
if (value.light || value.light === null) {
|
|
7805
|
+
newState.lightColorScheme = value.light === null ? defaultLightColorScheme : value.light;
|
|
7806
|
+
}
|
|
7807
|
+
|
|
7808
|
+
if (value.dark || value.dark === null) {
|
|
7809
|
+
newState.darkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;
|
|
7810
|
+
}
|
|
7811
|
+
|
|
7812
|
+
return newState;
|
|
7813
|
+
});
|
|
7814
|
+
|
|
7815
|
+
if (value.light) {
|
|
7816
|
+
localStorage.setItem(`${colorSchemeStorageKey}-light`, value.light);
|
|
7817
|
+
}
|
|
7818
|
+
|
|
7819
|
+
if (value.dark) {
|
|
7820
|
+
localStorage.setItem(`${colorSchemeStorageKey}-dark`, value.dark);
|
|
7821
|
+
}
|
|
7822
|
+
}
|
|
7823
|
+
}, [colorSchemeStorageKey, supportedColorSchemes, defaultLightColorScheme, defaultDarkColorScheme]);
|
|
7824
|
+
const handleMediaQuery = React__namespace.useCallback(e => {
|
|
7825
|
+
if (state.mode === 'system') {
|
|
7826
|
+
setState(currentState => _extends({}, currentState, {
|
|
7827
|
+
systemMode: e.matches ? 'dark' : 'light'
|
|
7828
|
+
}));
|
|
7829
|
+
}
|
|
7830
|
+
}, [state.mode]); // Ref hack to avoid adding handleMediaQuery as a dep
|
|
7831
|
+
|
|
7832
|
+
const mediaListener = React__namespace.useRef(handleMediaQuery);
|
|
7833
|
+
mediaListener.current = handleMediaQuery;
|
|
7834
|
+
React__namespace.useEffect(() => {
|
|
7835
|
+
const handler = (...args) => mediaListener.current(...args); // Always listen to System preference
|
|
7836
|
+
|
|
7837
|
+
|
|
7838
|
+
const media = window.matchMedia('(prefers-color-scheme: dark)'); // Intentionally use deprecated listener methods to support iOS & old browsers
|
|
7839
|
+
|
|
7840
|
+
media.addListener(handler);
|
|
7841
|
+
handler(media);
|
|
7842
|
+
return () => media.removeListener(handler);
|
|
7843
|
+
}, []); // Save mode, lightColorScheme & darkColorScheme to localStorage
|
|
7844
|
+
|
|
7845
|
+
React__namespace.useEffect(() => {
|
|
7846
|
+
if (state.mode) {
|
|
7847
|
+
localStorage.setItem(modeStorageKey, state.mode);
|
|
7848
|
+
}
|
|
7849
|
+
|
|
7850
|
+
processState(state, mode => {
|
|
7851
|
+
if (mode === 'light') {
|
|
7852
|
+
localStorage.setItem(`${colorSchemeStorageKey}-light`, state.lightColorScheme);
|
|
7853
|
+
}
|
|
7854
|
+
|
|
7855
|
+
if (mode === 'dark') {
|
|
7856
|
+
localStorage.setItem(`${colorSchemeStorageKey}-dark`, state.darkColorScheme);
|
|
7857
|
+
}
|
|
7858
|
+
});
|
|
7859
|
+
}, [state, colorSchemeStorageKey, modeStorageKey]); // Handle when localStorage has changed
|
|
7860
|
+
|
|
7861
|
+
React__namespace.useEffect(() => {
|
|
7862
|
+
const handleStorage = event => {
|
|
7863
|
+
const value = event.newValue;
|
|
7864
|
+
|
|
7865
|
+
if (typeof event.key === 'string' && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) {
|
|
7866
|
+
// If the key is deleted, value will be null then reset color scheme to the default one.
|
|
7867
|
+
if (event.key.endsWith('light')) {
|
|
7868
|
+
setColorScheme({
|
|
7869
|
+
light: value
|
|
7870
|
+
});
|
|
7871
|
+
}
|
|
7872
|
+
|
|
7873
|
+
if (event.key.endsWith('dark')) {
|
|
7874
|
+
setColorScheme({
|
|
7875
|
+
dark: value
|
|
7876
|
+
});
|
|
7877
|
+
}
|
|
7878
|
+
}
|
|
7879
|
+
|
|
7880
|
+
if (event.key === modeStorageKey && (!value || ['light', 'dark', 'system'].includes(value))) {
|
|
7881
|
+
setMode(value || defaultMode);
|
|
7882
|
+
}
|
|
7883
|
+
};
|
|
7884
|
+
|
|
7885
|
+
window.addEventListener('storage', handleStorage);
|
|
7886
|
+
return () => window.removeEventListener('storage', handleStorage);
|
|
7887
|
+
}, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode]);
|
|
7888
|
+
return _extends({}, state, {
|
|
7889
|
+
colorScheme,
|
|
7890
|
+
setMode,
|
|
7891
|
+
setColorScheme
|
|
7892
|
+
});
|
|
7893
|
+
}
|
|
7894
|
+
|
|
7895
|
+
/**
|
|
7896
|
+
* The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
|
|
7897
|
+
* and they does not need to remember the prefix (defined once).
|
|
7898
|
+
*/
|
|
7899
|
+
function createGetCssVar(prefix = '') {
|
|
7900
|
+
function appendVar(...vars) {
|
|
7901
|
+
if (!vars.length) {
|
|
7902
|
+
return '';
|
|
7903
|
+
}
|
|
7904
|
+
|
|
7905
|
+
const value = vars[0];
|
|
7906
|
+
|
|
7907
|
+
if (typeof value === 'string' && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))/)) {
|
|
7908
|
+
return `, var(--${prefix ? `${prefix}-` : ''}${value}${appendVar(...vars.slice(1))})`;
|
|
7909
|
+
}
|
|
7910
|
+
|
|
7911
|
+
return `, ${value}`;
|
|
7912
|
+
} // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
|
|
7913
|
+
|
|
7914
|
+
|
|
7915
|
+
const getCssVar = (field, ...vars) => {
|
|
7916
|
+
return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
|
|
7917
|
+
};
|
|
7918
|
+
|
|
7919
|
+
return getCssVar;
|
|
7920
|
+
}
|
|
7921
|
+
|
|
7922
|
+
const _excluded$2f = ["colorSchemes"],
|
|
7923
|
+
_excluded2$c = ["colorSchemes"],
|
|
7924
|
+
_excluded3$1 = ["components"];
|
|
7925
|
+
const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
|
|
7926
|
+
function createCssVarsProvider(options) {
|
|
7927
|
+
var _baseTheme$breakpoint;
|
|
7928
|
+
|
|
7929
|
+
const {
|
|
7930
|
+
theme: baseTheme = {},
|
|
7931
|
+
defaultMode: desisgnSystemMode = 'light',
|
|
7932
|
+
defaultColorScheme: designSystemColorScheme,
|
|
7933
|
+
disableTransitionOnChange: designSystemTransitionOnChange = false,
|
|
7934
|
+
enableColorScheme: designSystemEnableColorScheme = true,
|
|
7935
|
+
prefix: designSystemPrefix = '',
|
|
7936
|
+
shouldSkipGeneratingVar,
|
|
7937
|
+
resolveTheme
|
|
7938
|
+
} = options;
|
|
7939
|
+
const systemSpacing = createSpacing(baseTheme.spacing);
|
|
7940
|
+
const systemBreakpoints = createBreakpoints((_baseTheme$breakpoint = baseTheme.breakpoints) != null ? _baseTheme$breakpoint : {});
|
|
7941
|
+
|
|
7942
|
+
if (!baseTheme.colorSchemes || typeof designSystemColorScheme === 'string' && !baseTheme.colorSchemes[designSystemColorScheme] || typeof designSystemColorScheme === 'object' && !baseTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.light] || typeof designSystemColorScheme === 'object' && !baseTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.dark]) {
|
|
7943
|
+
console.error(`MUI: \`${designSystemColorScheme}\` does not exist in \`theme.colorSchemes\`.`);
|
|
7944
|
+
}
|
|
7945
|
+
|
|
7946
|
+
const ColorSchemeContext = /*#__PURE__*/React__namespace.createContext(undefined);
|
|
7947
|
+
|
|
7948
|
+
const useColorScheme = () => {
|
|
7949
|
+
const value = React__namespace.useContext(ColorSchemeContext);
|
|
7950
|
+
|
|
7951
|
+
if (!value) {
|
|
7952
|
+
throw new Error(`MUI: \`useColorScheme\` must be called under <CssVarsProvider />` );
|
|
7953
|
+
}
|
|
7954
|
+
|
|
7955
|
+
return value;
|
|
7956
|
+
};
|
|
7957
|
+
|
|
7958
|
+
function CssVarsProvider({
|
|
7959
|
+
children,
|
|
7960
|
+
theme: themeProp = {},
|
|
7961
|
+
prefix = designSystemPrefix,
|
|
7962
|
+
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
|
|
7963
|
+
attribute = DEFAULT_ATTRIBUTE,
|
|
7964
|
+
defaultMode = desisgnSystemMode,
|
|
7965
|
+
defaultColorScheme = designSystemColorScheme,
|
|
7966
|
+
disableTransitionOnChange = designSystemTransitionOnChange,
|
|
7967
|
+
enableColorScheme = designSystemEnableColorScheme
|
|
7968
|
+
}) {
|
|
7969
|
+
const {
|
|
7970
|
+
colorSchemes: baseColorSchemes = {}
|
|
7971
|
+
} = baseTheme,
|
|
7972
|
+
restBaseTheme = _objectWithoutPropertiesLoose(baseTheme, _excluded$2f);
|
|
7973
|
+
|
|
7974
|
+
const {
|
|
7975
|
+
colorSchemes: colorSchemesProp = {}
|
|
7976
|
+
} = themeProp,
|
|
7977
|
+
restThemeProp = _objectWithoutPropertiesLoose(themeProp, _excluded2$c);
|
|
7978
|
+
|
|
7979
|
+
const hasMounted = React__namespace.useRef(false); // eslint-disable-next-line prefer-const
|
|
7980
|
+
|
|
7981
|
+
let _deepmerge = deepmerge(restBaseTheme, restThemeProp),
|
|
7982
|
+
{
|
|
7983
|
+
components = {}
|
|
7984
|
+
} = _deepmerge,
|
|
7985
|
+
mergedTheme = _objectWithoutPropertiesLoose(_deepmerge, _excluded3$1);
|
|
7986
|
+
|
|
7987
|
+
const colorSchemes = deepmerge(baseColorSchemes, colorSchemesProp);
|
|
7988
|
+
const allColorSchemes = Object.keys(colorSchemes);
|
|
7989
|
+
const defaultLightColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.light;
|
|
7990
|
+
const defaultDarkColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.dark;
|
|
7991
|
+
const {
|
|
7992
|
+
mode,
|
|
7993
|
+
setMode,
|
|
7994
|
+
systemMode,
|
|
7995
|
+
lightColorScheme,
|
|
7996
|
+
darkColorScheme,
|
|
7997
|
+
colorScheme,
|
|
7998
|
+
setColorScheme
|
|
7999
|
+
} = useCurrentColorScheme({
|
|
8000
|
+
supportedColorSchemes: allColorSchemes,
|
|
8001
|
+
defaultLightColorScheme,
|
|
8002
|
+
defaultDarkColorScheme,
|
|
8003
|
+
modeStorageKey,
|
|
8004
|
+
defaultMode
|
|
8005
|
+
});
|
|
8006
|
+
|
|
8007
|
+
const resolvedColorScheme = (() => {
|
|
8008
|
+
if (!colorScheme) {
|
|
8009
|
+
// This scope occurs on the server
|
|
8010
|
+
if (defaultMode === 'dark') {
|
|
8011
|
+
return defaultDarkColorScheme;
|
|
8012
|
+
} // use light color scheme, if default mode is 'light' | 'auto'
|
|
8013
|
+
|
|
8014
|
+
|
|
8015
|
+
return defaultLightColorScheme;
|
|
8016
|
+
}
|
|
8017
|
+
|
|
8018
|
+
return colorScheme;
|
|
8019
|
+
})();
|
|
8020
|
+
|
|
8021
|
+
const {
|
|
8022
|
+
css: rootCss,
|
|
8023
|
+
vars: rootVars,
|
|
8024
|
+
parsedTheme
|
|
8025
|
+
} = cssVarsParser(mergedTheme, {
|
|
8026
|
+
prefix,
|
|
8027
|
+
basePrefix: designSystemPrefix,
|
|
8028
|
+
shouldSkipGeneratingVar
|
|
8029
|
+
});
|
|
8030
|
+
mergedTheme = _extends({}, parsedTheme, {
|
|
8031
|
+
components,
|
|
8032
|
+
colorSchemes,
|
|
8033
|
+
prefix,
|
|
8034
|
+
vars: rootVars,
|
|
8035
|
+
spacing: themeProp.spacing ? createSpacing(themeProp.spacing) : systemSpacing,
|
|
8036
|
+
breakpoints: themeProp.breakpoints ? createBreakpoints(themeProp.breakpoints) : systemBreakpoints,
|
|
8037
|
+
getCssVar: createGetCssVar(prefix)
|
|
8038
|
+
});
|
|
8039
|
+
const styleSheet = {};
|
|
8040
|
+
Object.entries(colorSchemes).forEach(([key, scheme]) => {
|
|
8041
|
+
const {
|
|
8042
|
+
css,
|
|
8043
|
+
vars,
|
|
8044
|
+
parsedTheme: parsedScheme
|
|
8045
|
+
} = cssVarsParser(scheme, {
|
|
8046
|
+
prefix,
|
|
8047
|
+
basePrefix: designSystemPrefix,
|
|
8048
|
+
shouldSkipGeneratingVar
|
|
8049
|
+
});
|
|
8050
|
+
mergedTheme.vars = deepmerge(mergedTheme.vars, vars);
|
|
8051
|
+
|
|
8052
|
+
if (key === resolvedColorScheme) {
|
|
8053
|
+
mergedTheme = _extends({}, mergedTheme, parsedScheme);
|
|
8054
|
+
}
|
|
8055
|
+
|
|
8056
|
+
const resolvedDefaultColorScheme = (() => {
|
|
8057
|
+
if (typeof defaultColorScheme === 'string') {
|
|
8058
|
+
return defaultColorScheme;
|
|
8059
|
+
}
|
|
8060
|
+
|
|
8061
|
+
if (defaultMode === 'dark') {
|
|
8062
|
+
return defaultColorScheme.dark;
|
|
8063
|
+
}
|
|
8064
|
+
|
|
8065
|
+
return defaultColorScheme.light;
|
|
8066
|
+
})();
|
|
8067
|
+
|
|
8068
|
+
if (key === resolvedDefaultColorScheme) {
|
|
8069
|
+
styleSheet[':root'] = css;
|
|
8070
|
+
} else {
|
|
8071
|
+
styleSheet[`[${attribute}="${key}"]`] = css;
|
|
8072
|
+
}
|
|
8073
|
+
});
|
|
8074
|
+
React__namespace.useEffect(() => {
|
|
8075
|
+
if (colorScheme) {
|
|
8076
|
+
// attaches attribute to <html> because the css variables are attached to :root (html)
|
|
8077
|
+
document.documentElement.setAttribute(attribute, colorScheme);
|
|
8078
|
+
}
|
|
8079
|
+
}, [colorScheme, attribute]);
|
|
8080
|
+
useEnhancedEffect$1(() => {
|
|
8081
|
+
if (!mode || !enableColorScheme) {
|
|
8082
|
+
return undefined;
|
|
8083
|
+
}
|
|
8084
|
+
|
|
8085
|
+
const priorColorScheme = document.documentElement.style.getPropertyValue('color-scheme'); // `color-scheme` tells browser to render built-in elements according to its value: `light` or `dark`
|
|
8086
|
+
|
|
8087
|
+
if (mode === 'system') {
|
|
8088
|
+
document.documentElement.style.setProperty('color-scheme', systemMode);
|
|
8089
|
+
} else {
|
|
8090
|
+
document.documentElement.style.setProperty('color-scheme', mode);
|
|
8091
|
+
}
|
|
8092
|
+
|
|
8093
|
+
return () => {
|
|
8094
|
+
document.documentElement.style.setProperty('color-scheme', priorColorScheme);
|
|
8095
|
+
};
|
|
8096
|
+
}, [mode, systemMode, enableColorScheme]);
|
|
8097
|
+
React__namespace.useEffect(() => {
|
|
8098
|
+
let timer;
|
|
8099
|
+
|
|
8100
|
+
if (disableTransitionOnChange && hasMounted.current) {
|
|
8101
|
+
// credit: https://github.com/pacocoursey/next-themes/blob/b5c2bad50de2d61ad7b52a9c5cdc801a78507d7a/index.tsx#L313
|
|
8102
|
+
const css = document.createElement('style');
|
|
8103
|
+
css.appendChild(document.createTextNode(DISABLE_CSS_TRANSITION));
|
|
8104
|
+
document.head.appendChild(css); // Force browser repaint
|
|
8105
|
+
|
|
8106
|
+
(() => window.getComputedStyle(document.body))();
|
|
8107
|
+
|
|
8108
|
+
timer = setTimeout(() => {
|
|
8109
|
+
document.head.removeChild(css);
|
|
8110
|
+
}, 1);
|
|
8111
|
+
}
|
|
8112
|
+
|
|
8113
|
+
return () => {
|
|
8114
|
+
clearTimeout(timer);
|
|
8115
|
+
};
|
|
8116
|
+
}, [colorScheme, disableTransitionOnChange]);
|
|
8117
|
+
React__namespace.useEffect(() => {
|
|
8118
|
+
hasMounted.current = true;
|
|
8119
|
+
return () => {
|
|
8120
|
+
hasMounted.current = false;
|
|
8121
|
+
};
|
|
8122
|
+
}, []);
|
|
8123
|
+
return /*#__PURE__*/jsxRuntime_2(ColorSchemeContext.Provider, {
|
|
8124
|
+
value: {
|
|
8125
|
+
mode,
|
|
8126
|
+
setMode,
|
|
8127
|
+
lightColorScheme,
|
|
8128
|
+
darkColorScheme,
|
|
8129
|
+
colorScheme,
|
|
8130
|
+
setColorScheme,
|
|
8131
|
+
allColorSchemes
|
|
8132
|
+
},
|
|
8133
|
+
children: [/*#__PURE__*/jsxRuntime_1(GlobalStyles$1, {
|
|
8134
|
+
styles: {
|
|
8135
|
+
':root': rootCss
|
|
8136
|
+
}
|
|
8137
|
+
}), /*#__PURE__*/jsxRuntime_1(GlobalStyles$1, {
|
|
8138
|
+
styles: styleSheet
|
|
8139
|
+
}), /*#__PURE__*/jsxRuntime_1(ThemeProvider, {
|
|
8140
|
+
theme: resolveTheme ? resolveTheme(mergedTheme) : mergedTheme,
|
|
8141
|
+
children: children
|
|
8142
|
+
})]
|
|
8143
|
+
});
|
|
8144
|
+
}
|
|
8145
|
+
|
|
8146
|
+
CssVarsProvider.propTypes = {
|
|
8147
|
+
/**
|
|
8148
|
+
* The body attribute name to attach colorScheme.
|
|
8149
|
+
*/
|
|
8150
|
+
attribute: PropTypes.string,
|
|
8151
|
+
|
|
8152
|
+
/**
|
|
8153
|
+
* The component tree.
|
|
8154
|
+
*/
|
|
8155
|
+
children: PropTypes.node,
|
|
8156
|
+
|
|
8157
|
+
/**
|
|
8158
|
+
* The initial color scheme used.
|
|
8159
|
+
*/
|
|
8160
|
+
defaultColorScheme: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
8161
|
+
|
|
8162
|
+
/**
|
|
8163
|
+
* The initial mode used.
|
|
8164
|
+
*/
|
|
8165
|
+
defaultMode: PropTypes.string,
|
|
8166
|
+
|
|
8167
|
+
/**
|
|
8168
|
+
* Disable CSS transitions when switching between modes or color schemes
|
|
8169
|
+
*/
|
|
8170
|
+
disableTransitionOnChange: PropTypes.bool,
|
|
8171
|
+
|
|
8172
|
+
/**
|
|
8173
|
+
* Indicate to the browser which color scheme is used (light or dark) for rendering built-in UI
|
|
8174
|
+
*/
|
|
8175
|
+
enableColorScheme: PropTypes.bool,
|
|
8176
|
+
|
|
8177
|
+
/**
|
|
8178
|
+
* The key in the local storage used to store current color scheme.
|
|
8179
|
+
*/
|
|
8180
|
+
modeStorageKey: PropTypes.string,
|
|
8181
|
+
|
|
8182
|
+
/**
|
|
8183
|
+
* CSS variable prefix.
|
|
8184
|
+
*/
|
|
8185
|
+
prefix: PropTypes.string,
|
|
8186
|
+
|
|
8187
|
+
/**
|
|
8188
|
+
* The calculated theme object that will be passed through context.
|
|
8189
|
+
*/
|
|
8190
|
+
theme: PropTypes.object
|
|
8191
|
+
} ;
|
|
8192
|
+
return {
|
|
8193
|
+
CssVarsProvider,
|
|
8194
|
+
useColorScheme,
|
|
8195
|
+
getInitColorSchemeScript: getInitColorSchemeScript$1
|
|
8196
|
+
};
|
|
8197
|
+
}
|
|
8198
|
+
|
|
8199
|
+
const _excluded$2e = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
8200
|
+
_excluded2$b = ["type", "mode"];
|
|
7478
8201
|
function adaptV4Theme(inputTheme) {
|
|
7479
8202
|
{
|
|
7480
8203
|
console.warn(['MUI: adaptV4Theme() is deprecated.', 'Follow the upgrade guide on https://mui.com/r/migration-v4#theme.'].join('\n'));
|
|
@@ -7488,7 +8211,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
7488
8211
|
props = {},
|
|
7489
8212
|
styleOverrides = {}
|
|
7490
8213
|
} = inputTheme,
|
|
7491
|
-
other = _objectWithoutPropertiesLoose(inputTheme, _excluded$
|
|
8214
|
+
other = _objectWithoutPropertiesLoose(inputTheme, _excluded$2e);
|
|
7492
8215
|
|
|
7493
8216
|
const theme = _extends({}, other, {
|
|
7494
8217
|
components: {}
|
|
@@ -7539,7 +8262,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
7539
8262
|
type: typeInput,
|
|
7540
8263
|
mode: modeInput
|
|
7541
8264
|
} = palette,
|
|
7542
|
-
paletteRest = _objectWithoutPropertiesLoose(palette, _excluded2$
|
|
8265
|
+
paletteRest = _objectWithoutPropertiesLoose(palette, _excluded2$b);
|
|
7543
8266
|
|
|
7544
8267
|
const finalMode = modeInput || typeInput || 'light';
|
|
7545
8268
|
theme.palette = _extends({
|
|
@@ -8635,46 +9358,30 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8635
9358
|
|
|
8636
9359
|
function useBadge(props) {
|
|
8637
9360
|
const {
|
|
8638
|
-
anchorOrigin: anchorOriginProp = {
|
|
8639
|
-
vertical: 'top',
|
|
8640
|
-
horizontal: 'right'
|
|
8641
|
-
},
|
|
8642
9361
|
badgeContent: badgeContentProp,
|
|
8643
9362
|
invisible: invisibleProp = false,
|
|
8644
9363
|
max: maxProp = 99,
|
|
8645
|
-
showZero = false
|
|
8646
|
-
variant: variantProp = 'standard'
|
|
9364
|
+
showZero = false
|
|
8647
9365
|
} = props;
|
|
8648
9366
|
const prevProps = usePreviousProps$1({
|
|
8649
|
-
anchorOrigin: anchorOriginProp,
|
|
8650
9367
|
badgeContent: badgeContentProp,
|
|
8651
|
-
max: maxProp
|
|
8652
|
-
variant: variantProp
|
|
9368
|
+
max: maxProp
|
|
8653
9369
|
});
|
|
8654
9370
|
let invisible = invisibleProp;
|
|
8655
9371
|
|
|
8656
|
-
if (invisibleProp === false &&
|
|
9372
|
+
if (invisibleProp === false && badgeContentProp === 0 && !showZero) {
|
|
8657
9373
|
invisible = true;
|
|
8658
9374
|
}
|
|
8659
9375
|
|
|
8660
9376
|
const {
|
|
8661
|
-
anchorOrigin = anchorOriginProp,
|
|
8662
9377
|
badgeContent,
|
|
8663
|
-
max = maxProp
|
|
8664
|
-
variant = variantProp
|
|
9378
|
+
max = maxProp
|
|
8665
9379
|
} = invisible ? prevProps : props;
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
if (variant !== 'dot') {
|
|
8669
|
-
displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;
|
|
8670
|
-
}
|
|
8671
|
-
|
|
9380
|
+
const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;
|
|
8672
9381
|
return {
|
|
8673
|
-
anchorOrigin,
|
|
8674
9382
|
badgeContent,
|
|
8675
9383
|
invisible,
|
|
8676
9384
|
max,
|
|
8677
|
-
variant,
|
|
8678
9385
|
displayValue
|
|
8679
9386
|
};
|
|
8680
9387
|
}
|
|
@@ -8727,66 +9434,49 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8727
9434
|
return result;
|
|
8728
9435
|
}
|
|
8729
9436
|
|
|
8730
|
-
function getBadgeUtilityClass(slot) {
|
|
8731
|
-
return generateUtilityClass('
|
|
9437
|
+
function getBadgeUtilityClass$1(slot) {
|
|
9438
|
+
return generateUtilityClass('BaseBadge', slot);
|
|
8732
9439
|
}
|
|
8733
|
-
|
|
8734
|
-
var badgeUnstyledClasses$1 = badgeUnstyledClasses;
|
|
9440
|
+
generateUtilityClasses('BaseBadge', ['root', 'badge', 'invisible']);
|
|
8735
9441
|
|
|
8736
|
-
const _excluded$
|
|
9442
|
+
const _excluded$2d = ["badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "showZero"];
|
|
8737
9443
|
|
|
8738
9444
|
const useUtilityClasses$1O = ownerState => {
|
|
8739
9445
|
const {
|
|
8740
|
-
|
|
8741
|
-
anchorOrigin,
|
|
8742
|
-
invisible,
|
|
8743
|
-
classes
|
|
9446
|
+
invisible
|
|
8744
9447
|
} = ownerState;
|
|
8745
9448
|
const slots = {
|
|
8746
9449
|
root: ['root'],
|
|
8747
|
-
badge: ['badge',
|
|
9450
|
+
badge: ['badge', invisible && 'invisible']
|
|
8748
9451
|
};
|
|
8749
|
-
return composeClasses(slots, getBadgeUtilityClass,
|
|
9452
|
+
return composeClasses(slots, getBadgeUtilityClass$1, undefined);
|
|
8750
9453
|
};
|
|
8751
9454
|
|
|
8752
9455
|
const BadgeUnstyled = /*#__PURE__*/React__namespace.forwardRef(function BadgeUnstyled(props, ref) {
|
|
8753
9456
|
const {
|
|
8754
|
-
anchorOrigin: anchorOriginProp = {
|
|
8755
|
-
vertical: 'top',
|
|
8756
|
-
horizontal: 'right'
|
|
8757
|
-
},
|
|
8758
|
-
classes: classesProp,
|
|
8759
9457
|
component,
|
|
8760
9458
|
children,
|
|
8761
9459
|
className,
|
|
8762
9460
|
components = {},
|
|
8763
9461
|
componentsProps = {},
|
|
8764
9462
|
max: maxProp = 99,
|
|
8765
|
-
showZero = false
|
|
8766
|
-
variant: variantProp = 'standard'
|
|
9463
|
+
showZero = false
|
|
8767
9464
|
} = props,
|
|
8768
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
9465
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2d);
|
|
8769
9466
|
|
|
8770
9467
|
const {
|
|
8771
|
-
anchorOrigin,
|
|
8772
9468
|
badgeContent,
|
|
8773
9469
|
max,
|
|
8774
|
-
variant,
|
|
8775
9470
|
displayValue,
|
|
8776
9471
|
invisible
|
|
8777
9472
|
} = useBadge(_extends({}, props, {
|
|
8778
|
-
|
|
8779
|
-
max: maxProp,
|
|
8780
|
-
variant: variantProp
|
|
9473
|
+
max: maxProp
|
|
8781
9474
|
}));
|
|
8782
9475
|
|
|
8783
9476
|
const ownerState = _extends({}, props, {
|
|
8784
|
-
anchorOrigin,
|
|
8785
9477
|
badgeContent,
|
|
8786
|
-
classes: classesProp,
|
|
8787
9478
|
invisible,
|
|
8788
9479
|
max,
|
|
8789
|
-
variant,
|
|
8790
9480
|
showZero
|
|
8791
9481
|
});
|
|
8792
9482
|
|
|
@@ -8813,18 +9503,6 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8813
9503
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
8814
9504
|
// ----------------------------------------------------------------------
|
|
8815
9505
|
|
|
8816
|
-
/**
|
|
8817
|
-
* The anchor of the badge.
|
|
8818
|
-
* @default {
|
|
8819
|
-
* vertical: 'top',
|
|
8820
|
-
* horizontal: 'right',
|
|
8821
|
-
* }
|
|
8822
|
-
*/
|
|
8823
|
-
anchorOrigin: PropTypes.shape({
|
|
8824
|
-
horizontal: PropTypes.oneOf(['left', 'right']).isRequired,
|
|
8825
|
-
vertical: PropTypes.oneOf(['bottom', 'top']).isRequired
|
|
8826
|
-
}),
|
|
8827
|
-
|
|
8828
9506
|
/**
|
|
8829
9507
|
* The content rendered within the badge.
|
|
8830
9508
|
*/
|
|
@@ -8835,11 +9513,6 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8835
9513
|
*/
|
|
8836
9514
|
children: PropTypes.node,
|
|
8837
9515
|
|
|
8838
|
-
/**
|
|
8839
|
-
* Override or extend the styles applied to the component.
|
|
8840
|
-
*/
|
|
8841
|
-
classes: PropTypes.object,
|
|
8842
|
-
|
|
8843
9516
|
/**
|
|
8844
9517
|
* @ignore
|
|
8845
9518
|
*/
|
|
@@ -8886,13 +9559,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8886
9559
|
* Controls whether the badge is hidden when `badgeContent` is zero.
|
|
8887
9560
|
* @default false
|
|
8888
9561
|
*/
|
|
8889
|
-
showZero: PropTypes.bool
|
|
8890
|
-
|
|
8891
|
-
/**
|
|
8892
|
-
* The variant to use.
|
|
8893
|
-
* @default 'standard'
|
|
8894
|
-
*/
|
|
8895
|
-
variant: PropTypes.string
|
|
9562
|
+
showZero: PropTypes.bool
|
|
8896
9563
|
} ;
|
|
8897
9564
|
var BadgeUnstyled$1 = BadgeUnstyled;
|
|
8898
9565
|
|
|
@@ -8910,9 +9577,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
8910
9577
|
*
|
|
8911
9578
|
* Demos:
|
|
8912
9579
|
*
|
|
8913
|
-
* - [Click Away Listener](https://mui.com/base/
|
|
8914
|
-
* - [Click Away Listener](https://mui.com/material-ui/react-click-away-listener/)
|
|
8915
|
-
* - [Menus](https://mui.com/material-ui/react-menu/)
|
|
9580
|
+
* - [Click Away Listener](https://mui.com/base/react-click-away-listener/)
|
|
8916
9581
|
*
|
|
8917
9582
|
* API:
|
|
8918
9583
|
*
|
|
@@ -11129,8 +11794,8 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
11129
11794
|
|
|
11130
11795
|
var Portal$1 = Portal;
|
|
11131
11796
|
|
|
11132
|
-
const _excluded$
|
|
11133
|
-
_excluded2$
|
|
11797
|
+
const _excluded$2c = ["anchorEl", "children", "direction", "disablePortal", "modifiers", "open", "ownerState", "placement", "popperOptions", "popperRef", "TransitionProps"],
|
|
11798
|
+
_excluded2$a = ["anchorEl", "children", "container", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition"];
|
|
11134
11799
|
|
|
11135
11800
|
function flipPlacement(placement, direction) {
|
|
11136
11801
|
if (direction === 'ltr') {
|
|
@@ -11175,7 +11840,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
11175
11840
|
popperRef: popperRefProp,
|
|
11176
11841
|
TransitionProps
|
|
11177
11842
|
} = props,
|
|
11178
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
11843
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2c);
|
|
11179
11844
|
|
|
11180
11845
|
const tooltipRef = React__namespace.useRef(null);
|
|
11181
11846
|
const ownRef = useForkRef(tooltipRef, ref);
|
|
@@ -11296,7 +11961,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
11296
11961
|
style,
|
|
11297
11962
|
transition = false
|
|
11298
11963
|
} = props,
|
|
11299
|
-
other = _objectWithoutPropertiesLoose(props, _excluded2$
|
|
11964
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2$a);
|
|
11300
11965
|
|
|
11301
11966
|
const [exited, setExited] = React__namespace.useState(true);
|
|
11302
11967
|
|
|
@@ -12065,7 +12730,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
12065
12730
|
const modalUnstyledClasses = generateUtilityClasses('MuiModal', ['root', 'hidden']);
|
|
12066
12731
|
var modalUnstyledClasses$1 = modalUnstyledClasses;
|
|
12067
12732
|
|
|
12068
|
-
const _excluded$
|
|
12733
|
+
const _excluded$2b = ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"];
|
|
12069
12734
|
|
|
12070
12735
|
const useUtilityClasses$1N = ownerState => {
|
|
12071
12736
|
const {
|
|
@@ -12137,7 +12802,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
12137
12802
|
onTransitionEnter,
|
|
12138
12803
|
onTransitionExited
|
|
12139
12804
|
} = props,
|
|
12140
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
12805
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2b);
|
|
12141
12806
|
|
|
12142
12807
|
const [exited, setExited] = React__namespace.useState(true);
|
|
12143
12808
|
const modal = React__namespace.useRef({});
|
|
@@ -13285,7 +13950,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
13285
13950
|
};
|
|
13286
13951
|
}
|
|
13287
13952
|
|
|
13288
|
-
const _excluded$
|
|
13953
|
+
const _excluded$2a = ["aria-label", "aria-valuetext", "className", "component", "classes", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps"];
|
|
13289
13954
|
|
|
13290
13955
|
const Identity = x => x;
|
|
13291
13956
|
|
|
@@ -13346,7 +14011,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
13346
14011
|
components = {},
|
|
13347
14012
|
componentsProps = {}
|
|
13348
14013
|
} = props,
|
|
13349
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14014
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2a); // all props with defaults
|
|
13350
14015
|
// consider extracting to hook an reusing the lint rule for the varints
|
|
13351
14016
|
|
|
13352
14017
|
|
|
@@ -13745,7 +14410,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
13745
14410
|
} ;
|
|
13746
14411
|
var SliderUnstyled$1 = SliderUnstyled;
|
|
13747
14412
|
|
|
13748
|
-
const _excluded$
|
|
14413
|
+
const _excluded$29 = ["onChange", "maxRows", "minRows", "style", "value"];
|
|
13749
14414
|
|
|
13750
14415
|
function getStyleValue(computedStyle, property) {
|
|
13751
14416
|
return parseInt(computedStyle[property], 10) || 0;
|
|
@@ -13774,7 +14439,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
13774
14439
|
style,
|
|
13775
14440
|
value
|
|
13776
14441
|
} = props,
|
|
13777
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
14442
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$29);
|
|
13778
14443
|
|
|
13779
14444
|
const {
|
|
13780
14445
|
current: isControlled
|
|
@@ -13974,7 +14639,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
13974
14639
|
}, mixins);
|
|
13975
14640
|
}
|
|
13976
14641
|
|
|
13977
|
-
const _excluded$
|
|
14642
|
+
const _excluded$28 = ["mode", "contrastThreshold", "tonalOffset"];
|
|
13978
14643
|
const light = {
|
|
13979
14644
|
// The colors used to style the text.
|
|
13980
14645
|
text: {
|
|
@@ -14158,7 +14823,7 @@ The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rg
|
|
|
14158
14823
|
contrastThreshold = 3,
|
|
14159
14824
|
tonalOffset = 0.2
|
|
14160
14825
|
} = palette,
|
|
14161
|
-
other = _objectWithoutPropertiesLoose(palette, _excluded$
|
|
14826
|
+
other = _objectWithoutPropertiesLoose(palette, _excluded$28);
|
|
14162
14827
|
|
|
14163
14828
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
14164
14829
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
@@ -14294,7 +14959,7 @@ const theme2 = createTheme({ palette: {
|
|
|
14294
14959
|
return paletteOutput;
|
|
14295
14960
|
}
|
|
14296
14961
|
|
|
14297
|
-
const _excluded$
|
|
14962
|
+
const _excluded$27 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
14298
14963
|
|
|
14299
14964
|
function round$1(value) {
|
|
14300
14965
|
return Math.round(value * 1e5) / 1e5;
|
|
@@ -14327,7 +14992,7 @@ const theme2 = createTheme({ palette: {
|
|
|
14327
14992
|
allVariants,
|
|
14328
14993
|
pxToRem: pxToRem2
|
|
14329
14994
|
} = _ref,
|
|
14330
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
14995
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$27);
|
|
14331
14996
|
|
|
14332
14997
|
{
|
|
14333
14998
|
if (typeof fontSize !== 'number') {
|
|
@@ -14395,7 +15060,7 @@ const theme2 = createTheme({ palette: {
|
|
|
14395
15060
|
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
14396
15061
|
var shadows$1 = shadows;
|
|
14397
15062
|
|
|
14398
|
-
const _excluded$
|
|
15063
|
+
const _excluded$26 = ["duration", "easing", "delay"];
|
|
14399
15064
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
14400
15065
|
// to learn the context in which each easing should be used.
|
|
14401
15066
|
const easing = {
|
|
@@ -14450,7 +15115,7 @@ const theme2 = createTheme({ palette: {
|
|
|
14450
15115
|
easing: easingOption = mergedEasing.easeInOut,
|
|
14451
15116
|
delay = 0
|
|
14452
15117
|
} = options,
|
|
14453
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
15118
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$26);
|
|
14454
15119
|
|
|
14455
15120
|
{
|
|
14456
15121
|
const isString = value => typeof value === 'string'; // IE11 support, replace with Number.isNaN
|
|
@@ -14506,19 +15171,19 @@ const theme2 = createTheme({ palette: {
|
|
|
14506
15171
|
};
|
|
14507
15172
|
var zIndex$1 = zIndex;
|
|
14508
15173
|
|
|
14509
|
-
const _excluded$
|
|
15174
|
+
const _excluded$25 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
14510
15175
|
|
|
14511
|
-
function createTheme(options = {}, ...args) {
|
|
15176
|
+
function createTheme$1(options = {}, ...args) {
|
|
14512
15177
|
const {
|
|
14513
15178
|
mixins: mixinsInput = {},
|
|
14514
15179
|
palette: paletteInput = {},
|
|
14515
15180
|
transitions: transitionsInput = {},
|
|
14516
15181
|
typography: typographyInput = {}
|
|
14517
15182
|
} = options,
|
|
14518
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
15183
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$25);
|
|
14519
15184
|
|
|
14520
15185
|
const palette = createPalette(paletteInput);
|
|
14521
|
-
const systemTheme = createTheme$
|
|
15186
|
+
const systemTheme = createTheme$2(options);
|
|
14522
15187
|
let muiTheme = deepmerge(systemTheme, {
|
|
14523
15188
|
mixins: createMixins(systemTheme.breakpoints, systemTheme.spacing, mixinsInput),
|
|
14524
15189
|
palette,
|
|
@@ -14577,11 +15242,11 @@ const theme2 = createTheme({ palette: {
|
|
|
14577
15242
|
}
|
|
14578
15243
|
}
|
|
14579
15244
|
|
|
14580
|
-
return createTheme(...args);
|
|
15245
|
+
return createTheme$1(...args);
|
|
14581
15246
|
}
|
|
14582
15247
|
|
|
14583
15248
|
function createMuiStrictModeTheme(options, ...args) {
|
|
14584
|
-
return createTheme(deepmerge({
|
|
15249
|
+
return createTheme$1(deepmerge({
|
|
14585
15250
|
unstable_strictMode: true
|
|
14586
15251
|
}, options), ...args);
|
|
14587
15252
|
}
|
|
@@ -14788,11 +15453,11 @@ Use unitless line heights instead.` );
|
|
|
14788
15453
|
return theme;
|
|
14789
15454
|
}
|
|
14790
15455
|
|
|
14791
|
-
const defaultTheme$
|
|
14792
|
-
var defaultTheme$
|
|
15456
|
+
const defaultTheme$2 = createTheme$1();
|
|
15457
|
+
var defaultTheme$3 = defaultTheme$2;
|
|
14793
15458
|
|
|
14794
15459
|
function useTheme() {
|
|
14795
|
-
const theme = useTheme$1(defaultTheme$
|
|
15460
|
+
const theme = useTheme$1(defaultTheme$3);
|
|
14796
15461
|
|
|
14797
15462
|
{
|
|
14798
15463
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -14809,14 +15474,14 @@ Use unitless line heights instead.` );
|
|
|
14809
15474
|
return useThemeProps$1({
|
|
14810
15475
|
props,
|
|
14811
15476
|
name,
|
|
14812
|
-
defaultTheme: defaultTheme$
|
|
15477
|
+
defaultTheme: defaultTheme$3
|
|
14813
15478
|
});
|
|
14814
15479
|
}
|
|
14815
15480
|
|
|
14816
15481
|
const rootShouldForwardProp = prop => shouldForwardProp(prop) && prop !== 'classes';
|
|
14817
15482
|
const slotShouldForwardProp = shouldForwardProp;
|
|
14818
15483
|
const styled = createStyled({
|
|
14819
|
-
defaultTheme: defaultTheme$
|
|
15484
|
+
defaultTheme: defaultTheme$3,
|
|
14820
15485
|
rootShouldForwardProp
|
|
14821
15486
|
});
|
|
14822
15487
|
var styled$1 = styled;
|
|
@@ -14839,6 +15504,112 @@ You have to import it from @mui/styles.
|
|
|
14839
15504
|
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
14840
15505
|
}
|
|
14841
15506
|
|
|
15507
|
+
const _excluded$24 = ["colorSchemes", "opacity"],
|
|
15508
|
+
_excluded2$9 = ["palette"];
|
|
15509
|
+
const defaultOpacity = {
|
|
15510
|
+
active: 0.54,
|
|
15511
|
+
hover: 0.04,
|
|
15512
|
+
selected: 0.08,
|
|
15513
|
+
disabled: 0.26,
|
|
15514
|
+
focus: 0.12
|
|
15515
|
+
};
|
|
15516
|
+
|
|
15517
|
+
function createTheme(options = {}, ...args) {
|
|
15518
|
+
var _colorSchemesInput$li, _colorSchemesInput$da;
|
|
15519
|
+
|
|
15520
|
+
const {
|
|
15521
|
+
colorSchemes: colorSchemesInput = {},
|
|
15522
|
+
opacity: opacityInput = {}
|
|
15523
|
+
} = options,
|
|
15524
|
+
input = _objectWithoutPropertiesLoose(options, _excluded$24); // eslint-disable-next-line prefer-const
|
|
15525
|
+
|
|
15526
|
+
|
|
15527
|
+
let _createThemeWithoutVa = createTheme$1(_extends({}, input, colorSchemesInput.light && {
|
|
15528
|
+
palette: (_colorSchemesInput$li = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li.palette
|
|
15529
|
+
})),
|
|
15530
|
+
{
|
|
15531
|
+
palette: lightPalette
|
|
15532
|
+
} = _createThemeWithoutVa,
|
|
15533
|
+
muiTheme = _objectWithoutPropertiesLoose(_createThemeWithoutVa, _excluded2$9);
|
|
15534
|
+
|
|
15535
|
+
const {
|
|
15536
|
+
palette: darkPalette
|
|
15537
|
+
} = createTheme$1({
|
|
15538
|
+
palette: _extends({
|
|
15539
|
+
mode: 'dark'
|
|
15540
|
+
}, (_colorSchemesInput$da = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da.palette)
|
|
15541
|
+
});
|
|
15542
|
+
colorSchemesInput.light = {
|
|
15543
|
+
palette: lightPalette
|
|
15544
|
+
};
|
|
15545
|
+
colorSchemesInput.dark = {
|
|
15546
|
+
palette: darkPalette
|
|
15547
|
+
};
|
|
15548
|
+
const colorSchemes = {};
|
|
15549
|
+
Object.keys(colorSchemesInput).forEach(key => {
|
|
15550
|
+
const palette = createPalette(colorSchemesInput[key].palette);
|
|
15551
|
+
Object.keys(palette).forEach(color => {
|
|
15552
|
+
const colors = palette[color];
|
|
15553
|
+
|
|
15554
|
+
if (colors.main) {
|
|
15555
|
+
palette[color].mainChannel = colorChannel(colors.main);
|
|
15556
|
+
}
|
|
15557
|
+
|
|
15558
|
+
if (colors.light) {
|
|
15559
|
+
palette[color].lightChannel = colorChannel(colors.light);
|
|
15560
|
+
}
|
|
15561
|
+
|
|
15562
|
+
if (colors.dark) {
|
|
15563
|
+
palette[color].darkChannel = colorChannel(colors.dark);
|
|
15564
|
+
}
|
|
15565
|
+
|
|
15566
|
+
if (colors.primary) {
|
|
15567
|
+
palette[color].primaryChannel = colorChannel(colors.primary);
|
|
15568
|
+
}
|
|
15569
|
+
|
|
15570
|
+
if (colors.secondary) {
|
|
15571
|
+
palette[color].secondaryChannel = colorChannel(colors.secondary);
|
|
15572
|
+
}
|
|
15573
|
+
|
|
15574
|
+
if (colors.disabled) {
|
|
15575
|
+
palette[color].disabledChannel = colorChannel(colors.disabled);
|
|
15576
|
+
}
|
|
15577
|
+
});
|
|
15578
|
+
colorSchemes[key] = {
|
|
15579
|
+
palette
|
|
15580
|
+
};
|
|
15581
|
+
});
|
|
15582
|
+
|
|
15583
|
+
const opacity = _extends({}, defaultOpacity, opacityInput);
|
|
15584
|
+
|
|
15585
|
+
muiTheme.colorSchemes = colorSchemes;
|
|
15586
|
+
muiTheme.opacity = opacity;
|
|
15587
|
+
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
15588
|
+
return muiTheme;
|
|
15589
|
+
}
|
|
15590
|
+
|
|
15591
|
+
const defaultTheme$1 = createTheme();
|
|
15592
|
+
const {
|
|
15593
|
+
CssVarsProvider: Experimental_CssVarsProvider,
|
|
15594
|
+
useColorScheme,
|
|
15595
|
+
getInitColorSchemeScript
|
|
15596
|
+
} = createCssVarsProvider({
|
|
15597
|
+
theme: defaultTheme$1,
|
|
15598
|
+
defaultColorScheme: {
|
|
15599
|
+
light: 'light',
|
|
15600
|
+
dark: 'dark'
|
|
15601
|
+
},
|
|
15602
|
+
prefix: 'md',
|
|
15603
|
+
resolveTheme: theme => {
|
|
15604
|
+
const newTheme = _extends({}, theme, {
|
|
15605
|
+
typography: createTypography(theme.palette, theme.typography)
|
|
15606
|
+
});
|
|
15607
|
+
|
|
15608
|
+
return newTheme;
|
|
15609
|
+
},
|
|
15610
|
+
shouldSkipGeneratingVar: keys => !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/)
|
|
15611
|
+
});
|
|
15612
|
+
|
|
14842
15613
|
function getSvgIconUtilityClass(slot) {
|
|
14843
15614
|
return generateUtilityClass('MuiSvgIcon', slot);
|
|
14844
15615
|
}
|
|
@@ -20078,7 +20849,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
20078
20849
|
|
|
20079
20850
|
function GlobalStyles(props) {
|
|
20080
20851
|
return /*#__PURE__*/jsxRuntime_1(GlobalStyles$1, _extends({}, props, {
|
|
20081
|
-
defaultTheme: defaultTheme$
|
|
20852
|
+
defaultTheme: defaultTheme$3
|
|
20082
20853
|
}));
|
|
20083
20854
|
}
|
|
20084
20855
|
|
|
@@ -22788,9 +23559,14 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22788
23559
|
|
|
22789
23560
|
var shouldSpreadAdditionalProps$1 = shouldSpreadAdditionalProps;
|
|
22790
23561
|
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
23562
|
+
function getBadgeUtilityClass(slot) {
|
|
23563
|
+
return generateUtilityClass('MuiBadge', slot);
|
|
23564
|
+
}
|
|
23565
|
+
const badgeClasses = generateUtilityClasses('MuiBadge', ['root', 'badge', 'dot', 'standard', 'anchorOriginTopRight', 'anchorOriginBottomRight', 'anchorOriginTopLeft', 'anchorOriginBottomLeft', 'invisible', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
23566
|
+
'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']);
|
|
23567
|
+
var badgeClasses$1 = badgeClasses;
|
|
23568
|
+
|
|
23569
|
+
const _excluded$1J = ["anchorOrigin", "className", "component", "components", "componentsProps", "overlap", "color", "invisible", "max", "badgeContent", "showZero", "variant"];
|
|
22794
23570
|
const RADIUS_STANDARD = 10;
|
|
22795
23571
|
const RADIUS_DOT = 4;
|
|
22796
23572
|
|
|
@@ -22798,12 +23574,15 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22798
23574
|
const {
|
|
22799
23575
|
color,
|
|
22800
23576
|
anchorOrigin,
|
|
23577
|
+
invisible,
|
|
22801
23578
|
overlap,
|
|
23579
|
+
variant,
|
|
22802
23580
|
classes = {}
|
|
22803
23581
|
} = ownerState;
|
|
22804
|
-
return
|
|
22805
|
-
|
|
22806
|
-
|
|
23582
|
+
return {
|
|
23583
|
+
root: clsx(classes.root, 'root'),
|
|
23584
|
+
badge: clsx(classes.badge, getBadgeUtilityClass('badge'), getBadgeUtilityClass(variant), `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}`, getBadgeUtilityClass(`anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`), getBadgeUtilityClass(`overlap${capitalize(overlap)}`), color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]], invisible && getBadgeUtilityClass('invisible'))
|
|
23585
|
+
};
|
|
22807
23586
|
};
|
|
22808
23587
|
|
|
22809
23588
|
const BadgeRoot = styled$1('span', {
|
|
@@ -22865,7 +23644,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22865
23644
|
right: 0,
|
|
22866
23645
|
transform: 'scale(1) translate(50%, -50%)',
|
|
22867
23646
|
transformOrigin: '100% 0%',
|
|
22868
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23647
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22869
23648
|
transform: 'scale(0) translate(50%, -50%)'
|
|
22870
23649
|
}
|
|
22871
23650
|
}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'rectangular' && {
|
|
@@ -22873,7 +23652,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22873
23652
|
right: 0,
|
|
22874
23653
|
transform: 'scale(1) translate(50%, 50%)',
|
|
22875
23654
|
transformOrigin: '100% 100%',
|
|
22876
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23655
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22877
23656
|
transform: 'scale(0) translate(50%, 50%)'
|
|
22878
23657
|
}
|
|
22879
23658
|
}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'rectangular' && {
|
|
@@ -22881,7 +23660,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22881
23660
|
left: 0,
|
|
22882
23661
|
transform: 'scale(1) translate(-50%, -50%)',
|
|
22883
23662
|
transformOrigin: '0% 0%',
|
|
22884
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23663
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22885
23664
|
transform: 'scale(0) translate(-50%, -50%)'
|
|
22886
23665
|
}
|
|
22887
23666
|
}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'rectangular' && {
|
|
@@ -22889,7 +23668,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22889
23668
|
left: 0,
|
|
22890
23669
|
transform: 'scale(1) translate(-50%, 50%)',
|
|
22891
23670
|
transformOrigin: '0% 100%',
|
|
22892
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23671
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22893
23672
|
transform: 'scale(0) translate(-50%, 50%)'
|
|
22894
23673
|
}
|
|
22895
23674
|
}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'circular' && {
|
|
@@ -22897,7 +23676,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22897
23676
|
right: '14%',
|
|
22898
23677
|
transform: 'scale(1) translate(50%, -50%)',
|
|
22899
23678
|
transformOrigin: '100% 0%',
|
|
22900
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23679
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22901
23680
|
transform: 'scale(0) translate(50%, -50%)'
|
|
22902
23681
|
}
|
|
22903
23682
|
}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'circular' && {
|
|
@@ -22905,7 +23684,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22905
23684
|
right: '14%',
|
|
22906
23685
|
transform: 'scale(1) translate(50%, 50%)',
|
|
22907
23686
|
transformOrigin: '100% 100%',
|
|
22908
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23687
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22909
23688
|
transform: 'scale(0) translate(50%, 50%)'
|
|
22910
23689
|
}
|
|
22911
23690
|
}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'circular' && {
|
|
@@ -22913,7 +23692,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22913
23692
|
left: '14%',
|
|
22914
23693
|
transform: 'scale(1) translate(-50%, -50%)',
|
|
22915
23694
|
transformOrigin: '0% 0%',
|
|
22916
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23695
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22917
23696
|
transform: 'scale(0) translate(-50%, -50%)'
|
|
22918
23697
|
}
|
|
22919
23698
|
}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'circular' && {
|
|
@@ -22921,7 +23700,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22921
23700
|
left: '14%',
|
|
22922
23701
|
transform: 'scale(1) translate(-50%, 50%)',
|
|
22923
23702
|
transformOrigin: '0% 100%',
|
|
22924
|
-
[`&.${badgeClasses.invisible}`]: {
|
|
23703
|
+
[`&.${badgeClasses$1.invisible}`]: {
|
|
22925
23704
|
transform: 'scale(0) translate(-50%, 50%)'
|
|
22926
23705
|
}
|
|
22927
23706
|
}, ownerState.invisible && {
|
|
@@ -22931,7 +23710,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22931
23710
|
})
|
|
22932
23711
|
}));
|
|
22933
23712
|
const Badge = /*#__PURE__*/React__namespace.forwardRef(function Badge(inProps, ref) {
|
|
22934
|
-
var _componentsProps$root, _componentsProps$badg;
|
|
23713
|
+
var _componentsProps$root, _componentsProps$root2, _componentsProps$badg, _componentsProps$badg2;
|
|
22935
23714
|
|
|
22936
23715
|
const props = useThemeProps({
|
|
22937
23716
|
props: inProps,
|
|
@@ -22943,12 +23722,14 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22943
23722
|
vertical: 'top',
|
|
22944
23723
|
horizontal: 'right'
|
|
22945
23724
|
},
|
|
23725
|
+
className,
|
|
22946
23726
|
component = 'span',
|
|
22947
23727
|
components = {},
|
|
22948
23728
|
componentsProps = {},
|
|
22949
23729
|
overlap: overlapProp = 'rectangular',
|
|
22950
23730
|
color: colorProp = 'default',
|
|
22951
23731
|
invisible: invisibleProp = false,
|
|
23732
|
+
max,
|
|
22952
23733
|
badgeContent: badgeContentProp,
|
|
22953
23734
|
showZero = false,
|
|
22954
23735
|
variant: variantProp = 'standard'
|
|
@@ -22958,7 +23739,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22958
23739
|
const prevProps = usePreviousProps$1({
|
|
22959
23740
|
anchorOrigin: anchorOriginProp,
|
|
22960
23741
|
color: colorProp,
|
|
22961
|
-
overlap: overlapProp
|
|
23742
|
+
overlap: overlapProp,
|
|
23743
|
+
variant: variantProp
|
|
22962
23744
|
});
|
|
22963
23745
|
let invisible = invisibleProp;
|
|
22964
23746
|
|
|
@@ -22969,44 +23751,57 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
22969
23751
|
const {
|
|
22970
23752
|
color = colorProp,
|
|
22971
23753
|
overlap = overlapProp,
|
|
22972
|
-
anchorOrigin = anchorOriginProp
|
|
23754
|
+
anchorOrigin = anchorOriginProp,
|
|
23755
|
+
variant = variantProp
|
|
22973
23756
|
} = invisible ? prevProps : props;
|
|
22974
23757
|
|
|
22975
23758
|
const ownerState = _extends({}, props, {
|
|
22976
23759
|
anchorOrigin,
|
|
22977
23760
|
invisible,
|
|
22978
23761
|
color,
|
|
22979
|
-
overlap
|
|
23762
|
+
overlap,
|
|
23763
|
+
variant
|
|
22980
23764
|
});
|
|
22981
23765
|
|
|
22982
23766
|
const classes = extendUtilityClasses$2(ownerState);
|
|
23767
|
+
let displayValue;
|
|
23768
|
+
|
|
23769
|
+
if (variant !== 'dot') {
|
|
23770
|
+
displayValue = badgeContentProp && Number(badgeContentProp) > max ? `${max}+` : badgeContentProp;
|
|
23771
|
+
}
|
|
23772
|
+
|
|
22983
23773
|
return /*#__PURE__*/jsxRuntime_1(BadgeUnstyled$1, _extends({
|
|
22984
|
-
anchorOrigin: anchorOrigin,
|
|
22985
23774
|
invisible: invisibleProp,
|
|
22986
|
-
badgeContent:
|
|
23775
|
+
badgeContent: displayValue,
|
|
22987
23776
|
showZero: showZero,
|
|
22988
|
-
|
|
23777
|
+
max: max
|
|
22989
23778
|
}, other, {
|
|
22990
23779
|
components: _extends({
|
|
22991
23780
|
Root: BadgeRoot,
|
|
22992
23781
|
Badge: BadgeBadge
|
|
22993
23782
|
}, components),
|
|
23783
|
+
className: clsx(className, classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className),
|
|
22994
23784
|
componentsProps: {
|
|
22995
23785
|
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps$1(components.Root) && {
|
|
22996
23786
|
as: component,
|
|
22997
|
-
ownerState: _extends({}, (_componentsProps$
|
|
23787
|
+
ownerState: _extends({}, (_componentsProps$root2 = componentsProps.root) == null ? void 0 : _componentsProps$root2.ownerState, {
|
|
23788
|
+
anchorOrigin,
|
|
22998
23789
|
color,
|
|
22999
|
-
overlap
|
|
23790
|
+
overlap,
|
|
23791
|
+
variant
|
|
23000
23792
|
})
|
|
23001
23793
|
}),
|
|
23002
|
-
badge: _extends({}, componentsProps.badge,
|
|
23003
|
-
|
|
23794
|
+
badge: _extends({}, componentsProps.badge, {
|
|
23795
|
+
className: clsx(classes.badge, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.className)
|
|
23796
|
+
}, shouldSpreadAdditionalProps$1(components.Badge) && {
|
|
23797
|
+
ownerState: _extends({}, (_componentsProps$badg2 = componentsProps.badge) == null ? void 0 : _componentsProps$badg2.ownerState, {
|
|
23798
|
+
anchorOrigin,
|
|
23004
23799
|
color,
|
|
23005
|
-
overlap
|
|
23800
|
+
overlap,
|
|
23801
|
+
variant
|
|
23006
23802
|
})
|
|
23007
23803
|
})
|
|
23008
23804
|
},
|
|
23009
|
-
classes: classes,
|
|
23010
23805
|
ref: ref
|
|
23011
23806
|
}));
|
|
23012
23807
|
});
|
|
@@ -23045,6 +23840,11 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
23045
23840
|
*/
|
|
23046
23841
|
classes: PropTypes.object,
|
|
23047
23842
|
|
|
23843
|
+
/**
|
|
23844
|
+
* @ignore
|
|
23845
|
+
*/
|
|
23846
|
+
className: PropTypes.string,
|
|
23847
|
+
|
|
23048
23848
|
/**
|
|
23049
23849
|
* The color of the component.
|
|
23050
23850
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -23434,7 +24234,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
23434
24234
|
} ;
|
|
23435
24235
|
var BottomNavigationAction$1 = BottomNavigationAction;
|
|
23436
24236
|
|
|
23437
|
-
const defaultTheme = createTheme();
|
|
24237
|
+
const defaultTheme = createTheme$1();
|
|
23438
24238
|
/**
|
|
23439
24239
|
* @ignore - do not document.
|
|
23440
24240
|
*/
|
|
@@ -23801,106 +24601,111 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
23801
24601
|
})(({
|
|
23802
24602
|
theme,
|
|
23803
24603
|
ownerState
|
|
23804
|
-
}) =>
|
|
23805
|
-
|
|
23806
|
-
|
|
23807
|
-
|
|
23808
|
-
|
|
23809
|
-
|
|
23810
|
-
|
|
23811
|
-
|
|
23812
|
-
|
|
23813
|
-
|
|
23814
|
-
|
|
23815
|
-
|
|
23816
|
-
backgroundColor:
|
|
23817
|
-
|
|
24604
|
+
}) => {
|
|
24605
|
+
var _theme$palette$getCon, _theme$palette;
|
|
24606
|
+
|
|
24607
|
+
return _extends({}, theme.typography.button, {
|
|
24608
|
+
minWidth: 64,
|
|
24609
|
+
padding: '6px 16px',
|
|
24610
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
24611
|
+
transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {
|
|
24612
|
+
duration: theme.transitions.duration.short
|
|
24613
|
+
}),
|
|
24614
|
+
'&:hover': _extends({
|
|
24615
|
+
textDecoration: 'none',
|
|
24616
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
|
24617
|
+
// Reset on touch devices, it doesn't add specificity
|
|
24618
|
+
'@media (hover: none)': {
|
|
24619
|
+
backgroundColor: 'transparent'
|
|
24620
|
+
}
|
|
24621
|
+
}, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
|
|
24622
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
24623
|
+
// Reset on touch devices, it doesn't add specificity
|
|
24624
|
+
'@media (hover: none)': {
|
|
24625
|
+
backgroundColor: 'transparent'
|
|
24626
|
+
}
|
|
24627
|
+
}, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
|
|
24628
|
+
border: `1px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
|
|
24629
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
24630
|
+
// Reset on touch devices, it doesn't add specificity
|
|
24631
|
+
'@media (hover: none)': {
|
|
24632
|
+
backgroundColor: 'transparent'
|
|
24633
|
+
}
|
|
24634
|
+
}, ownerState.variant === 'contained' && {
|
|
24635
|
+
backgroundColor: (theme.vars || theme).palette.grey.A100,
|
|
24636
|
+
boxShadow: (theme.vars || theme).shadows[4],
|
|
24637
|
+
// Reset on touch devices, it doesn't add specificity
|
|
24638
|
+
'@media (hover: none)': {
|
|
24639
|
+
boxShadow: (theme.vars || theme).shadows[2],
|
|
24640
|
+
backgroundColor: (theme.vars || theme).palette.grey[300]
|
|
24641
|
+
}
|
|
24642
|
+
}, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
|
|
24643
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,
|
|
24644
|
+
// Reset on touch devices, it doesn't add specificity
|
|
24645
|
+
'@media (hover: none)': {
|
|
24646
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
24647
|
+
}
|
|
24648
|
+
}),
|
|
24649
|
+
'&:active': _extends({}, ownerState.variant === 'contained' && {
|
|
24650
|
+
boxShadow: (theme.vars || theme).shadows[8]
|
|
24651
|
+
}),
|
|
24652
|
+
[`&.${buttonClasses$1.focusVisible}`]: _extends({}, ownerState.variant === 'contained' && {
|
|
24653
|
+
boxShadow: (theme.vars || theme).shadows[6]
|
|
24654
|
+
}),
|
|
24655
|
+
[`&.${buttonClasses$1.disabled}`]: _extends({
|
|
24656
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
24657
|
+
}, ownerState.variant === 'outlined' && {
|
|
24658
|
+
border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
|
|
24659
|
+
}, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
|
|
24660
|
+
border: `1px solid ${(theme.vars || theme).palette.action.disabled}`
|
|
24661
|
+
}, ownerState.variant === 'contained' && {
|
|
24662
|
+
color: (theme.vars || theme).palette.action.disabled,
|
|
24663
|
+
boxShadow: (theme.vars || theme).shadows[0],
|
|
24664
|
+
backgroundColor: (theme.vars || theme).palette.action.disabledBackground
|
|
24665
|
+
})
|
|
24666
|
+
}, ownerState.variant === 'text' && {
|
|
24667
|
+
padding: '6px 8px'
|
|
23818
24668
|
}, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
|
|
23819
|
-
|
|
23820
|
-
|
|
23821
|
-
|
|
23822
|
-
|
|
23823
|
-
}
|
|
24669
|
+
color: (theme.vars || theme).palette[ownerState.color].main
|
|
24670
|
+
}, ownerState.variant === 'outlined' && {
|
|
24671
|
+
padding: '5px 15px',
|
|
24672
|
+
border: '1px solid currentColor'
|
|
23824
24673
|
}, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
|
|
23825
|
-
|
|
23826
|
-
|
|
23827
|
-
// Reset on touch devices, it doesn't add specificity
|
|
23828
|
-
'@media (hover: none)': {
|
|
23829
|
-
backgroundColor: 'transparent'
|
|
23830
|
-
}
|
|
24674
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
24675
|
+
border: theme.vars ? `1px solid rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.5)` : `1px solid ${alpha(theme.palette[ownerState.color].main, 0.5)}`
|
|
23831
24676
|
}, ownerState.variant === 'contained' && {
|
|
23832
|
-
|
|
23833
|
-
|
|
23834
|
-
|
|
23835
|
-
|
|
23836
|
-
boxShadow: theme.shadows[2],
|
|
23837
|
-
backgroundColor: theme.palette.grey[300]
|
|
23838
|
-
}
|
|
24677
|
+
color: theme.vars ? // this is safe because grey does not change between default light/dark mode
|
|
24678
|
+
theme.vars.palette.text.primary : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),
|
|
24679
|
+
backgroundColor: (theme.vars || theme).palette.grey[300],
|
|
24680
|
+
boxShadow: (theme.vars || theme).shadows[2]
|
|
23839
24681
|
}, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
|
|
23840
|
-
|
|
23841
|
-
|
|
23842
|
-
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
}
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
}
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
}
|
|
23852
|
-
|
|
23853
|
-
|
|
23854
|
-
}, ownerState.variant === 'outlined' && {
|
|
23855
|
-
|
|
23856
|
-
|
|
23857
|
-
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
|
|
23861
|
-
|
|
23862
|
-
|
|
23863
|
-
|
|
23864
|
-
|
|
23865
|
-
|
|
23866
|
-
|
|
23867
|
-
}, ownerState.variant === 'outlined' && {
|
|
23868
|
-
padding: '5px 15px',
|
|
23869
|
-
border: `1px solid ${theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'}`
|
|
23870
|
-
}, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
|
|
23871
|
-
color: theme.palette[ownerState.color].main,
|
|
23872
|
-
border: `1px solid ${alpha(theme.palette[ownerState.color].main, 0.5)}`
|
|
23873
|
-
}, ownerState.variant === 'contained' && {
|
|
23874
|
-
color: theme.palette.getContrastText(theme.palette.grey[300]),
|
|
23875
|
-
backgroundColor: theme.palette.grey[300],
|
|
23876
|
-
boxShadow: theme.shadows[2]
|
|
23877
|
-
}, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
|
|
23878
|
-
color: theme.palette[ownerState.color].contrastText,
|
|
23879
|
-
backgroundColor: theme.palette[ownerState.color].main
|
|
23880
|
-
}, ownerState.color === 'inherit' && {
|
|
23881
|
-
color: 'inherit',
|
|
23882
|
-
borderColor: 'currentColor'
|
|
23883
|
-
}, ownerState.size === 'small' && ownerState.variant === 'text' && {
|
|
23884
|
-
padding: '4px 5px',
|
|
23885
|
-
fontSize: theme.typography.pxToRem(13)
|
|
23886
|
-
}, ownerState.size === 'large' && ownerState.variant === 'text' && {
|
|
23887
|
-
padding: '8px 11px',
|
|
23888
|
-
fontSize: theme.typography.pxToRem(15)
|
|
23889
|
-
}, ownerState.size === 'small' && ownerState.variant === 'outlined' && {
|
|
23890
|
-
padding: '3px 9px',
|
|
23891
|
-
fontSize: theme.typography.pxToRem(13)
|
|
23892
|
-
}, ownerState.size === 'large' && ownerState.variant === 'outlined' && {
|
|
23893
|
-
padding: '7px 21px',
|
|
23894
|
-
fontSize: theme.typography.pxToRem(15)
|
|
23895
|
-
}, ownerState.size === 'small' && ownerState.variant === 'contained' && {
|
|
23896
|
-
padding: '4px 10px',
|
|
23897
|
-
fontSize: theme.typography.pxToRem(13)
|
|
23898
|
-
}, ownerState.size === 'large' && ownerState.variant === 'contained' && {
|
|
23899
|
-
padding: '8px 22px',
|
|
23900
|
-
fontSize: theme.typography.pxToRem(15)
|
|
23901
|
-
}, ownerState.fullWidth && {
|
|
23902
|
-
width: '100%'
|
|
23903
|
-
}), ({
|
|
24682
|
+
color: (theme.vars || theme).palette[ownerState.color].contrastText,
|
|
24683
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
24684
|
+
}, ownerState.color === 'inherit' && {
|
|
24685
|
+
color: 'inherit',
|
|
24686
|
+
borderColor: 'currentColor'
|
|
24687
|
+
}, ownerState.size === 'small' && ownerState.variant === 'text' && {
|
|
24688
|
+
padding: '4px 5px',
|
|
24689
|
+
fontSize: theme.typography.pxToRem(13)
|
|
24690
|
+
}, ownerState.size === 'large' && ownerState.variant === 'text' && {
|
|
24691
|
+
padding: '8px 11px',
|
|
24692
|
+
fontSize: theme.typography.pxToRem(15)
|
|
24693
|
+
}, ownerState.size === 'small' && ownerState.variant === 'outlined' && {
|
|
24694
|
+
padding: '3px 9px',
|
|
24695
|
+
fontSize: theme.typography.pxToRem(13)
|
|
24696
|
+
}, ownerState.size === 'large' && ownerState.variant === 'outlined' && {
|
|
24697
|
+
padding: '7px 21px',
|
|
24698
|
+
fontSize: theme.typography.pxToRem(15)
|
|
24699
|
+
}, ownerState.size === 'small' && ownerState.variant === 'contained' && {
|
|
24700
|
+
padding: '4px 10px',
|
|
24701
|
+
fontSize: theme.typography.pxToRem(13)
|
|
24702
|
+
}, ownerState.size === 'large' && ownerState.variant === 'contained' && {
|
|
24703
|
+
padding: '8px 22px',
|
|
24704
|
+
fontSize: theme.typography.pxToRem(15)
|
|
24705
|
+
}, ownerState.fullWidth && {
|
|
24706
|
+
width: '100%'
|
|
24707
|
+
});
|
|
24708
|
+
}, ({
|
|
23904
24709
|
ownerState
|
|
23905
24710
|
}) => ownerState.disableElevation && {
|
|
23906
24711
|
boxShadow: 'none',
|
|
@@ -33296,7 +34101,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
33296
34101
|
const linkClasses = generateUtilityClasses('MuiLink', ['root', 'underlineNone', 'underlineHover', 'underlineAlways', 'button', 'focusVisible']);
|
|
33297
34102
|
var linkClasses$1 = linkClasses;
|
|
33298
34103
|
|
|
33299
|
-
const _excluded$10 = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant"];
|
|
34104
|
+
const _excluded$10 = ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"];
|
|
33300
34105
|
const colorTransformations = {
|
|
33301
34106
|
primary: 'primary.main',
|
|
33302
34107
|
textPrimary: 'text.primary',
|
|
@@ -33379,6 +34184,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
33379
34184
|
});
|
|
33380
34185
|
});
|
|
33381
34186
|
const Link = /*#__PURE__*/React__namespace.forwardRef(function Link(inProps, ref) {
|
|
34187
|
+
const theme = useTheme();
|
|
33382
34188
|
const props = useThemeProps({
|
|
33383
34189
|
props: inProps,
|
|
33384
34190
|
name: 'MuiLink'
|
|
@@ -33392,7 +34198,8 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
33392
34198
|
onFocus,
|
|
33393
34199
|
TypographyClasses,
|
|
33394
34200
|
underline = 'always',
|
|
33395
|
-
variant = 'inherit'
|
|
34201
|
+
variant = 'inherit',
|
|
34202
|
+
sx
|
|
33396
34203
|
} = props,
|
|
33397
34204
|
other = _objectWithoutPropertiesLoose(props, _excluded$10);
|
|
33398
34205
|
|
|
@@ -33430,7 +34237,9 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
33430
34237
|
};
|
|
33431
34238
|
|
|
33432
34239
|
const ownerState = _extends({}, props, {
|
|
33433
|
-
|
|
34240
|
+
// It is too complex to support any types of `sx`.
|
|
34241
|
+
// Need to find a better way to get rid of the color manipulation for `textDecorationColor`.
|
|
34242
|
+
color: (typeof sx === 'function' ? sx(theme).color : sx == null ? void 0 : sx.color) || color,
|
|
33434
34243
|
component,
|
|
33435
34244
|
focusVisible,
|
|
33436
34245
|
underline,
|
|
@@ -33441,13 +34250,15 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
33441
34250
|
return /*#__PURE__*/jsxRuntime_1(LinkRoot, _extends({
|
|
33442
34251
|
className: clsx(classes.root, className),
|
|
33443
34252
|
classes: TypographyClasses,
|
|
33444
|
-
color: color,
|
|
33445
34253
|
component: component,
|
|
33446
34254
|
onBlur: handleBlur,
|
|
33447
34255
|
onFocus: handleFocus,
|
|
33448
34256
|
ref: handlerRef,
|
|
33449
34257
|
ownerState: ownerState,
|
|
33450
|
-
variant: variant
|
|
34258
|
+
variant: variant,
|
|
34259
|
+
sx: [{
|
|
34260
|
+
color: colorTransformations[color] || color
|
|
34261
|
+
}, ...(Array.isArray(sx) ? sx : [sx])]
|
|
33451
34262
|
}, other));
|
|
33452
34263
|
});
|
|
33453
34264
|
Link.propTypes
|
|
@@ -33724,6 +34535,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
33724
34535
|
alignItems: 'center',
|
|
33725
34536
|
position: 'relative',
|
|
33726
34537
|
textDecoration: 'none',
|
|
34538
|
+
minWidth: 0,
|
|
33727
34539
|
boxSizing: 'border-box',
|
|
33728
34540
|
textAlign: 'left',
|
|
33729
34541
|
paddingTop: 8,
|
|
@@ -50189,6 +51001,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50189
51001
|
exports.DialogTitle = DialogTitle$1;
|
|
50190
51002
|
exports.Divider = Divider$1;
|
|
50191
51003
|
exports.Drawer = Drawer$1;
|
|
51004
|
+
exports.Experimental_CssVarsProvider = Experimental_CssVarsProvider;
|
|
50192
51005
|
exports.Fab = Fab$1;
|
|
50193
51006
|
exports.Fade = Fade$1;
|
|
50194
51007
|
exports.FilledInput = FilledInput$1;
|
|
@@ -50303,7 +51116,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50303
51116
|
exports.avatarClasses = avatarClasses$1;
|
|
50304
51117
|
exports.avatarGroupClasses = avatarGroupClasses$1;
|
|
50305
51118
|
exports.backdropClasses = backdropClasses$1;
|
|
50306
|
-
exports.badgeClasses = badgeClasses;
|
|
51119
|
+
exports.badgeClasses = badgeClasses$1;
|
|
50307
51120
|
exports.bottomNavigationActionClasses = bottomNavigationActionClasses$1;
|
|
50308
51121
|
exports.bottomNavigationClasses = bottomNavigationClasses$1;
|
|
50309
51122
|
exports.breadcrumbsClasses = breadcrumbsClasses$1;
|
|
@@ -50328,7 +51141,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50328
51141
|
exports.createMuiTheme = createMuiTheme;
|
|
50329
51142
|
exports.createStyles = createStyles;
|
|
50330
51143
|
exports.createSvgIcon = createSvgIcon;
|
|
50331
|
-
exports.createTheme = createTheme;
|
|
51144
|
+
exports.createTheme = createTheme$1;
|
|
50332
51145
|
exports.css = css;
|
|
50333
51146
|
exports.darkScrollbar = darkScrollbar;
|
|
50334
51147
|
exports.darken = darken;
|
|
@@ -50346,6 +51159,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50346
51159
|
exports.easing = easing;
|
|
50347
51160
|
exports.emphasize = emphasize;
|
|
50348
51161
|
exports.experimentalStyled = styled$1;
|
|
51162
|
+
exports.experimental_extendTheme = createTheme;
|
|
50349
51163
|
exports.experimental_sx = sx;
|
|
50350
51164
|
exports.fabClasses = fabClasses$1;
|
|
50351
51165
|
exports.filledInputClasses = filledInputClasses$1;
|
|
@@ -50367,6 +51181,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50367
51181
|
exports.getAvatarGroupUtilityClass = getAvatarGroupUtilityClass;
|
|
50368
51182
|
exports.getAvatarUtilityClass = getAvatarUtilityClass;
|
|
50369
51183
|
exports.getBackdropUtilityClass = getBackdropUtilityClass;
|
|
51184
|
+
exports.getBadgeUtilityClass = getBadgeUtilityClass;
|
|
50370
51185
|
exports.getBottomNavigationActionUtilityClass = getBottomNavigationActionUtilityClass;
|
|
50371
51186
|
exports.getBottomNavigationUtilityClass = getBottomNavigationUtilityClass;
|
|
50372
51187
|
exports.getBreadcrumbsUtilityClass = getBreadcrumbsUtilityClass;
|
|
@@ -50405,6 +51220,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50405
51220
|
exports.getImageListItemBarUtilityClass = getImageListItemBarUtilityClass;
|
|
50406
51221
|
exports.getImageListItemUtilityClass = getImageListItemUtilityClass;
|
|
50407
51222
|
exports.getImageListUtilityClass = getImageListUtilityClass;
|
|
51223
|
+
exports.getInitColorSchemeScript = getInitColorSchemeScript;
|
|
50408
51224
|
exports.getInputAdornmentUtilityClass = getInputAdornmentUtilityClass;
|
|
50409
51225
|
exports.getInputBaseUtilityClass = getInputBaseUtilityClass;
|
|
50410
51226
|
exports.getInputLabelUtilityClasses = getInputLabelUtilityClasses;
|
|
@@ -50561,6 +51377,7 @@ See https://mui.com/r/migration-v4/#mui-material-styles for more details.` );
|
|
|
50561
51377
|
exports.unstable_useId = useId;
|
|
50562
51378
|
exports.unsupportedProp = unsupportedProp;
|
|
50563
51379
|
exports.useAutocomplete = useAutocomplete;
|
|
51380
|
+
exports.useColorScheme = useColorScheme;
|
|
50564
51381
|
exports.useControlled = useControlled;
|
|
50565
51382
|
exports.useEventCallback = useEventCallback;
|
|
50566
51383
|
exports.useForkRef = useForkRef;
|