@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
package/darkScrollbar/index.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export default function darkScrollbar(options?: {
|
|
2
|
-
track: string;
|
|
3
|
-
thumb: string;
|
|
4
|
-
active: string;
|
|
5
|
-
}): {
|
|
6
|
-
scrollbarColor: string;
|
|
7
|
-
'&::-webkit-scrollbar, & *::-webkit-scrollbar': {
|
|
8
|
-
backgroundColor: string;
|
|
9
|
-
};
|
|
10
|
-
'&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb': {
|
|
11
|
-
borderRadius: number;
|
|
12
|
-
backgroundColor: string;
|
|
13
|
-
minHeight: number;
|
|
14
|
-
border: string;
|
|
15
|
-
};
|
|
16
|
-
'&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus': {
|
|
17
|
-
backgroundColor: string;
|
|
18
|
-
};
|
|
19
|
-
'&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active': {
|
|
20
|
-
backgroundColor: string;
|
|
21
|
-
};
|
|
22
|
-
'&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover': {
|
|
23
|
-
backgroundColor: string;
|
|
24
|
-
};
|
|
25
|
-
'&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner': {
|
|
26
|
-
backgroundColor: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
1
|
+
export default function darkScrollbar(options?: {
|
|
2
|
+
track: string;
|
|
3
|
+
thumb: string;
|
|
4
|
+
active: string;
|
|
5
|
+
}): {
|
|
6
|
+
scrollbarColor: string;
|
|
7
|
+
'&::-webkit-scrollbar, & *::-webkit-scrollbar': {
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
};
|
|
10
|
+
'&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb': {
|
|
11
|
+
borderRadius: number;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
minHeight: number;
|
|
14
|
+
border: string;
|
|
15
|
+
};
|
|
16
|
+
'&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus': {
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
};
|
|
19
|
+
'&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active': {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
};
|
|
22
|
+
'&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover': {
|
|
23
|
+
backgroundColor: string;
|
|
24
|
+
};
|
|
25
|
+
'&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner': {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface SwitchBaseClasses {
|
|
2
|
-
root: string;
|
|
3
|
-
checked: string;
|
|
4
|
-
disabled: string;
|
|
5
|
-
input: string;
|
|
6
|
-
edgeStart: string;
|
|
7
|
-
edgeEnd: string;
|
|
8
|
-
}
|
|
9
|
-
export declare type SwitchBaseClassKey = keyof SwitchBaseClasses;
|
|
10
|
-
export declare function getSwitchBaseUtilityClass(slot: string): string;
|
|
11
|
-
declare const switchBaseClasses: SwitchBaseClasses;
|
|
12
|
-
export default switchBaseClasses;
|
|
1
|
+
export interface SwitchBaseClasses {
|
|
2
|
+
root: string;
|
|
3
|
+
checked: string;
|
|
4
|
+
disabled: string;
|
|
5
|
+
input: string;
|
|
6
|
+
edgeStart: string;
|
|
7
|
+
edgeEnd: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type SwitchBaseClassKey = keyof SwitchBaseClasses;
|
|
10
|
+
export declare function getSwitchBaseUtilityClass(slot: string): string;
|
|
11
|
+
declare const switchBaseClasses: SwitchBaseClasses;
|
|
12
|
+
export default switchBaseClasses;
|
package/legacy/Badge/Badge.js
CHANGED
|
@@ -5,27 +5,28 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { usePreviousProps } from '@mui/utils';
|
|
8
|
-
import
|
|
9
|
-
import BadgeUnstyled, { badgeUnstyledClasses, getBadgeUtilityClass } from '@mui/base/BadgeUnstyled';
|
|
8
|
+
import BadgeUnstyled from '@mui/base/BadgeUnstyled';
|
|
10
9
|
import styled from '../styles/styled';
|
|
11
10
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
11
|
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
13
12
|
import capitalize from '../utils/capitalize';
|
|
13
|
+
import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
export var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
16
|
-
'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']));
|
|
17
15
|
var RADIUS_STANDARD = 10;
|
|
18
16
|
var RADIUS_DOT = 4;
|
|
19
17
|
|
|
20
18
|
var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
21
19
|
var color = ownerState.color,
|
|
22
20
|
anchorOrigin = ownerState.anchorOrigin,
|
|
21
|
+
invisible = ownerState.invisible,
|
|
23
22
|
overlap = ownerState.overlap,
|
|
23
|
+
variant = ownerState.variant,
|
|
24
24
|
_ownerState$classes = ownerState.classes,
|
|
25
25
|
classes = _ownerState$classes === void 0 ? {} : _ownerState$classes;
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
return {
|
|
27
|
+
root: clsx(classes.root, 'root'),
|
|
28
|
+
badge: clsx(classes.badge, getBadgeUtilityClass('badge'), getBadgeUtilityClass(variant), "anchorOrigin".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)), getBadgeUtilityClass("anchorOrigin".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)).concat(capitalize(overlap))), getBadgeUtilityClass("overlap".concat(capitalize(overlap))), color !== 'default' && [getBadgeUtilityClass("color".concat(capitalize(color))), classes["color".concat(capitalize(color))]], invisible && getBadgeUtilityClass('invisible'))
|
|
29
|
+
};
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
var BadgeRoot = styled('span', {
|
|
@@ -146,7 +147,7 @@ var BadgeBadge = styled('span', {
|
|
|
146
147
|
});
|
|
147
148
|
});
|
|
148
149
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
149
|
-
var _componentsProps$root, _componentsProps$badg;
|
|
150
|
+
var _componentsProps$root, _componentsProps$root2, _componentsProps$badg, _componentsProps$badg2;
|
|
150
151
|
|
|
151
152
|
var props = useThemeProps({
|
|
152
153
|
props: inProps,
|
|
@@ -158,6 +159,7 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
158
159
|
vertical: 'top',
|
|
159
160
|
horizontal: 'right'
|
|
160
161
|
} : _props$anchorOrigin,
|
|
162
|
+
className = props.className,
|
|
161
163
|
_props$component = props.component,
|
|
162
164
|
component = _props$component === void 0 ? 'span' : _props$component,
|
|
163
165
|
_props$components = props.components,
|
|
@@ -170,17 +172,19 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
170
172
|
colorProp = _props$color === void 0 ? 'default' : _props$color,
|
|
171
173
|
_props$invisible = props.invisible,
|
|
172
174
|
invisibleProp = _props$invisible === void 0 ? false : _props$invisible,
|
|
175
|
+
max = props.max,
|
|
173
176
|
badgeContentProp = props.badgeContent,
|
|
174
177
|
_props$showZero = props.showZero,
|
|
175
178
|
showZero = _props$showZero === void 0 ? false : _props$showZero,
|
|
176
179
|
_props$variant = props.variant,
|
|
177
180
|
variantProp = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
178
|
-
other = _objectWithoutProperties(props, ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"]);
|
|
181
|
+
other = _objectWithoutProperties(props, ["anchorOrigin", "className", "component", "components", "componentsProps", "overlap", "color", "invisible", "max", "badgeContent", "showZero", "variant"]);
|
|
179
182
|
|
|
180
183
|
var prevProps = usePreviousProps({
|
|
181
184
|
anchorOrigin: anchorOriginProp,
|
|
182
185
|
color: colorProp,
|
|
183
|
-
overlap: overlapProp
|
|
186
|
+
overlap: overlapProp,
|
|
187
|
+
variant: variantProp
|
|
184
188
|
});
|
|
185
189
|
var invisible = invisibleProp;
|
|
186
190
|
|
|
@@ -194,43 +198,57 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
194
198
|
_ref10$overlap = _ref10.overlap,
|
|
195
199
|
overlap = _ref10$overlap === void 0 ? overlapProp : _ref10$overlap,
|
|
196
200
|
_ref10$anchorOrigin = _ref10.anchorOrigin,
|
|
197
|
-
anchorOrigin = _ref10$anchorOrigin === void 0 ? anchorOriginProp : _ref10$anchorOrigin
|
|
201
|
+
anchorOrigin = _ref10$anchorOrigin === void 0 ? anchorOriginProp : _ref10$anchorOrigin,
|
|
202
|
+
_ref10$variant = _ref10.variant,
|
|
203
|
+
variant = _ref10$variant === void 0 ? variantProp : _ref10$variant;
|
|
198
204
|
|
|
199
205
|
var ownerState = _extends({}, props, {
|
|
200
206
|
anchorOrigin: anchorOrigin,
|
|
201
207
|
invisible: invisible,
|
|
202
208
|
color: color,
|
|
203
|
-
overlap: overlap
|
|
209
|
+
overlap: overlap,
|
|
210
|
+
variant: variant
|
|
204
211
|
});
|
|
205
212
|
|
|
206
213
|
var classes = extendUtilityClasses(ownerState);
|
|
214
|
+
var displayValue;
|
|
215
|
+
|
|
216
|
+
if (variant !== 'dot') {
|
|
217
|
+
displayValue = badgeContentProp && Number(badgeContentProp) > max ? "".concat(max, "+") : badgeContentProp;
|
|
218
|
+
}
|
|
219
|
+
|
|
207
220
|
return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
|
|
208
|
-
anchorOrigin: anchorOrigin,
|
|
209
221
|
invisible: invisibleProp,
|
|
210
|
-
badgeContent:
|
|
222
|
+
badgeContent: displayValue,
|
|
211
223
|
showZero: showZero,
|
|
212
|
-
|
|
224
|
+
max: max
|
|
213
225
|
}, other, {
|
|
214
226
|
components: _extends({
|
|
215
227
|
Root: BadgeRoot,
|
|
216
228
|
Badge: BadgeBadge
|
|
217
229
|
}, components),
|
|
230
|
+
className: clsx(className, classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className),
|
|
218
231
|
componentsProps: {
|
|
219
232
|
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
220
233
|
as: component,
|
|
221
|
-
ownerState: _extends({}, (_componentsProps$
|
|
234
|
+
ownerState: _extends({}, (_componentsProps$root2 = componentsProps.root) == null ? void 0 : _componentsProps$root2.ownerState, {
|
|
235
|
+
anchorOrigin: anchorOrigin,
|
|
222
236
|
color: color,
|
|
223
|
-
overlap: overlap
|
|
237
|
+
overlap: overlap,
|
|
238
|
+
variant: variant
|
|
224
239
|
})
|
|
225
240
|
}),
|
|
226
|
-
badge: _extends({}, componentsProps.badge,
|
|
227
|
-
|
|
241
|
+
badge: _extends({}, componentsProps.badge, {
|
|
242
|
+
className: clsx(classes.badge, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.className)
|
|
243
|
+
}, shouldSpreadAdditionalProps(components.Badge) && {
|
|
244
|
+
ownerState: _extends({}, (_componentsProps$badg2 = componentsProps.badge) == null ? void 0 : _componentsProps$badg2.ownerState, {
|
|
245
|
+
anchorOrigin: anchorOrigin,
|
|
228
246
|
color: color,
|
|
229
|
-
overlap: overlap
|
|
247
|
+
overlap: overlap,
|
|
248
|
+
variant: variant
|
|
230
249
|
})
|
|
231
250
|
})
|
|
232
251
|
},
|
|
233
|
-
classes: classes,
|
|
234
252
|
ref: ref
|
|
235
253
|
}));
|
|
236
254
|
});
|
|
@@ -269,6 +287,11 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
269
287
|
*/
|
|
270
288
|
classes: PropTypes.object,
|
|
271
289
|
|
|
290
|
+
/**
|
|
291
|
+
* @ignore
|
|
292
|
+
*/
|
|
293
|
+
className: PropTypes.string,
|
|
294
|
+
|
|
272
295
|
/**
|
|
273
296
|
* The color of the component.
|
|
274
297
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import generateUtilityClasses from '@mui/base/generateUtilityClasses';
|
|
2
|
+
import generateUtilityClass from '@mui/base/generateUtilityClass';
|
|
3
|
+
export function getBadgeUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiBadge', slot);
|
|
5
|
+
}
|
|
6
|
+
var 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
|
|
7
|
+
'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']);
|
|
8
|
+
export default badgeClasses;
|
package/legacy/Badge/index.js
CHANGED
|
File without changes
|
package/legacy/Button/Button.js
CHANGED
|
@@ -60,84 +60,85 @@ var ButtonRoot = styled(ButtonBase, {
|
|
|
60
60
|
return [styles.root, styles[ownerState.variant], styles["".concat(ownerState.variant).concat(capitalize(ownerState.color))], styles["size".concat(capitalize(ownerState.size))], styles["".concat(ownerState.variant, "Size").concat(capitalize(ownerState.size))], ownerState.color === 'inherit' && styles.colorInherit, ownerState.disableElevation && styles.disableElevation, ownerState.fullWidth && styles.fullWidth];
|
|
61
61
|
}
|
|
62
62
|
})(function (_ref) {
|
|
63
|
-
var _extends2;
|
|
63
|
+
var _extends2, _theme$palette$getCon, _theme$palette;
|
|
64
64
|
|
|
65
65
|
var theme = _ref.theme,
|
|
66
66
|
ownerState = _ref.ownerState;
|
|
67
67
|
return _extends({}, theme.typography.button, (_extends2 = {
|
|
68
68
|
minWidth: 64,
|
|
69
69
|
padding: '6px 16px',
|
|
70
|
-
borderRadius: theme.shape.borderRadius,
|
|
70
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
71
71
|
transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], {
|
|
72
72
|
duration: theme.transitions.duration.short
|
|
73
73
|
}),
|
|
74
74
|
'&:hover': _extends({
|
|
75
75
|
textDecoration: 'none',
|
|
76
|
-
backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
|
76
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.text.primaryChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
|
|
77
77
|
// Reset on touch devices, it doesn't add specificity
|
|
78
78
|
'@media (hover: none)': {
|
|
79
79
|
backgroundColor: 'transparent'
|
|
80
80
|
}
|
|
81
81
|
}, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
|
|
82
|
-
backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
82
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
83
83
|
// Reset on touch devices, it doesn't add specificity
|
|
84
84
|
'@media (hover: none)': {
|
|
85
85
|
backgroundColor: 'transparent'
|
|
86
86
|
}
|
|
87
87
|
}, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
|
|
88
|
-
border: "1px solid ".concat(theme.palette[ownerState.color].main),
|
|
89
|
-
backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
88
|
+
border: "1px solid ".concat((theme.vars || theme).palette[ownerState.color].main),
|
|
89
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
90
90
|
// Reset on touch devices, it doesn't add specificity
|
|
91
91
|
'@media (hover: none)': {
|
|
92
92
|
backgroundColor: 'transparent'
|
|
93
93
|
}
|
|
94
94
|
}, ownerState.variant === 'contained' && {
|
|
95
|
-
backgroundColor: theme.palette.grey.A100,
|
|
96
|
-
boxShadow: theme.shadows[4],
|
|
95
|
+
backgroundColor: (theme.vars || theme).palette.grey.A100,
|
|
96
|
+
boxShadow: (theme.vars || theme).shadows[4],
|
|
97
97
|
// Reset on touch devices, it doesn't add specificity
|
|
98
98
|
'@media (hover: none)': {
|
|
99
|
-
boxShadow: theme.shadows[2],
|
|
100
|
-
backgroundColor: theme.palette.grey[300]
|
|
99
|
+
boxShadow: (theme.vars || theme).shadows[2],
|
|
100
|
+
backgroundColor: (theme.vars || theme).palette.grey[300]
|
|
101
101
|
}
|
|
102
102
|
}, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
|
|
103
|
-
backgroundColor: theme.palette[ownerState.color].dark,
|
|
103
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].dark,
|
|
104
104
|
// Reset on touch devices, it doesn't add specificity
|
|
105
105
|
'@media (hover: none)': {
|
|
106
|
-
backgroundColor: theme.palette[ownerState.color].main
|
|
106
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
107
107
|
}
|
|
108
108
|
}),
|
|
109
109
|
'&:active': _extends({}, ownerState.variant === 'contained' && {
|
|
110
|
-
boxShadow: theme.shadows[8]
|
|
110
|
+
boxShadow: (theme.vars || theme).shadows[8]
|
|
111
111
|
})
|
|
112
112
|
}, _defineProperty(_extends2, "&.".concat(buttonClasses.focusVisible), _extends({}, ownerState.variant === 'contained' && {
|
|
113
|
-
boxShadow: theme.shadows[6]
|
|
113
|
+
boxShadow: (theme.vars || theme).shadows[6]
|
|
114
114
|
})), _defineProperty(_extends2, "&.".concat(buttonClasses.disabled), _extends({
|
|
115
|
-
color: theme.palette.action.disabled
|
|
115
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
116
116
|
}, ownerState.variant === 'outlined' && {
|
|
117
|
-
border: "1px solid ".concat(theme.palette.action.disabledBackground)
|
|
117
|
+
border: "1px solid ".concat((theme.vars || theme).palette.action.disabledBackground)
|
|
118
118
|
}, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
|
|
119
|
-
border: "1px solid ".concat(theme.palette.action.disabled)
|
|
119
|
+
border: "1px solid ".concat((theme.vars || theme).palette.action.disabled)
|
|
120
120
|
}, ownerState.variant === 'contained' && {
|
|
121
|
-
color: theme.palette.action.disabled,
|
|
122
|
-
boxShadow: theme.shadows[0],
|
|
123
|
-
backgroundColor: theme.palette.action.disabledBackground
|
|
121
|
+
color: (theme.vars || theme).palette.action.disabled,
|
|
122
|
+
boxShadow: (theme.vars || theme).shadows[0],
|
|
123
|
+
backgroundColor: (theme.vars || theme).palette.action.disabledBackground
|
|
124
124
|
})), _extends2), ownerState.variant === 'text' && {
|
|
125
125
|
padding: '6px 8px'
|
|
126
126
|
}, ownerState.variant === 'text' && ownerState.color !== 'inherit' && {
|
|
127
|
-
color: theme.palette[ownerState.color].main
|
|
127
|
+
color: (theme.vars || theme).palette[ownerState.color].main
|
|
128
128
|
}, ownerState.variant === 'outlined' && {
|
|
129
129
|
padding: '5px 15px',
|
|
130
|
-
border:
|
|
130
|
+
border: '1px solid currentColor'
|
|
131
131
|
}, ownerState.variant === 'outlined' && ownerState.color !== 'inherit' && {
|
|
132
|
-
color: theme.palette[ownerState.color].main,
|
|
133
|
-
border: "1px solid ".concat(alpha(theme.palette[ownerState.color].main, 0.5))
|
|
132
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
133
|
+
border: theme.vars ? "1px solid rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.5)") : "1px solid ".concat(alpha(theme.palette[ownerState.color].main, 0.5))
|
|
134
134
|
}, ownerState.variant === 'contained' && {
|
|
135
|
-
color: theme.
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
color: theme.vars ? // this is safe because grey does not change between default light/dark mode
|
|
136
|
+
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]),
|
|
137
|
+
backgroundColor: (theme.vars || theme).palette.grey[300],
|
|
138
|
+
boxShadow: (theme.vars || theme).shadows[2]
|
|
138
139
|
}, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
|
|
139
|
-
color: theme.palette[ownerState.color].contrastText,
|
|
140
|
-
backgroundColor: theme.palette[ownerState.color].main
|
|
140
|
+
color: (theme.vars || theme).palette[ownerState.color].contrastText,
|
|
141
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
141
142
|
}, ownerState.color === 'inherit' && {
|
|
142
143
|
color: 'inherit',
|
|
143
144
|
borderColor: 'currentColor'
|
package/legacy/Link/Link.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
@@ -9,6 +10,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
|
9
10
|
import { alpha, getPath } from '@mui/system';
|
|
10
11
|
import capitalize from '../utils/capitalize';
|
|
11
12
|
import styled from '../styles/styled';
|
|
13
|
+
import useTheme from '../styles/useTheme';
|
|
12
14
|
import useThemeProps from '../styles/useThemeProps';
|
|
13
15
|
import useIsFocusVisible from '../utils/useIsFocusVisible';
|
|
14
16
|
import useForkRef from '../utils/useForkRef';
|
|
@@ -91,6 +93,7 @@ var LinkRoot = styled(Typography, {
|
|
|
91
93
|
}));
|
|
92
94
|
});
|
|
93
95
|
var Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
96
|
+
var theme = useTheme();
|
|
94
97
|
var props = useThemeProps({
|
|
95
98
|
props: inProps,
|
|
96
99
|
name: 'MuiLink'
|
|
@@ -108,7 +111,8 @@ var Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
|
108
111
|
underline = _props$underline === void 0 ? 'always' : _props$underline,
|
|
109
112
|
_props$variant = props.variant,
|
|
110
113
|
variant = _props$variant === void 0 ? 'inherit' : _props$variant,
|
|
111
|
-
|
|
114
|
+
sx = props.sx,
|
|
115
|
+
other = _objectWithoutProperties(props, ["className", "color", "component", "onBlur", "onFocus", "TypographyClasses", "underline", "variant", "sx"]);
|
|
112
116
|
|
|
113
117
|
var _useIsFocusVisible = useIsFocusVisible(),
|
|
114
118
|
isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef,
|
|
@@ -147,7 +151,9 @@ var Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
|
147
151
|
};
|
|
148
152
|
|
|
149
153
|
var ownerState = _extends({}, props, {
|
|
150
|
-
|
|
154
|
+
// It is too complex to support any types of `sx`.
|
|
155
|
+
// Need to find a better way to get rid of the color manipulation for `textDecorationColor`.
|
|
156
|
+
color: (typeof sx === 'function' ? sx(theme).color : sx == null ? void 0 : sx.color) || color,
|
|
151
157
|
component: component,
|
|
152
158
|
focusVisible: focusVisible,
|
|
153
159
|
underline: underline,
|
|
@@ -158,13 +164,15 @@ var Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
|
|
|
158
164
|
return /*#__PURE__*/_jsx(LinkRoot, _extends({
|
|
159
165
|
className: clsx(classes.root, className),
|
|
160
166
|
classes: TypographyClasses,
|
|
161
|
-
color: color,
|
|
162
167
|
component: component,
|
|
163
168
|
onBlur: handleBlur,
|
|
164
169
|
onFocus: handleFocus,
|
|
165
170
|
ref: handlerRef,
|
|
166
171
|
ownerState: ownerState,
|
|
167
|
-
variant: variant
|
|
172
|
+
variant: variant,
|
|
173
|
+
sx: [{
|
|
174
|
+
color: colorTransformations[color] || color
|
|
175
|
+
}].concat(_toConsumableArray(Array.isArray(sx) ? sx : [sx]))
|
|
168
176
|
}, other));
|
|
169
177
|
});
|
|
170
178
|
process.env.NODE_ENV !== "production" ? Link.propTypes
|
package/legacy/index.js
CHANGED