@mui/material 5.8.3 → 5.8.6
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/Alert/Alert.js +19 -11
- package/AppBar/AppBar.js +22 -5
- package/Autocomplete/autocompleteClasses.d.ts +1 -1
- package/Avatar/Avatar.js +7 -4
- package/Badge/Badge.js +2 -2
- package/Button/buttonClasses.d.ts +24 -0
- package/Button/buttonClasses.js +1 -1
- package/CHANGELOG.md +224 -14
- package/Chip/Chip.js +31 -30
- package/Dialog/Dialog.js +11 -6
- package/FilledInput/FilledInput.js +28 -13
- package/Grid/Grid.d.ts +73 -52
- package/Grid/Grid.js +94 -40
- package/Grow/Grow.js +1 -2
- package/Hidden/withWidth.js +0 -2
- package/Input/Input.js +1 -1
- package/InputBase/InputBase.js +2 -2
- package/LinearProgress/LinearProgress.js +6 -2
- package/Link/Link.js +10 -17
- package/Link/getTextDecoration.d.ts +15 -0
- package/Link/getTextDecoration.js +29 -0
- package/Modal/Modal.d.ts +2 -0
- package/Modal/Modal.js +25 -8
- package/OutlinedInput/OutlinedInput.js +40 -10
- package/Popover/Popover.d.ts +7 -0
- package/Popover/index.js +1 -0
- package/README.md +6 -9
- package/Skeleton/Skeleton.js +8 -3
- package/Slider/Slider.d.ts +3 -1
- package/Slider/Slider.js +24 -22
- package/Snackbar/Snackbar.js +6 -20
- package/SnackbarContent/SnackbarContent.js +3 -3
- package/SpeedDialAction/SpeedDialAction.js +7 -7
- package/Stack/Stack.js +1 -1
- package/StepConnector/StepConnector.js +14 -11
- package/StepContent/StepContent.js +1 -1
- package/StepIcon/StepIcon.js +2 -1
- package/Switch/Switch.js +11 -11
- package/Tab/Tab.d.ts +0 -1
- package/TableCell/TableCell.js +5 -5
- package/Tabs/Tabs.js +16 -2
- package/Tooltip/Tooltip.js +1 -1
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +19 -11
- package/legacy/AppBar/AppBar.js +23 -4
- package/legacy/Avatar/Avatar.js +7 -4
- package/legacy/Badge/Badge.js +2 -2
- package/legacy/Button/buttonClasses.js +1 -1
- package/legacy/Chip/Chip.js +31 -30
- package/legacy/Dialog/Dialog.js +11 -6
- package/legacy/FilledInput/FilledInput.js +28 -14
- package/legacy/Grid/Grid.js +97 -48
- package/legacy/Grow/Grow.js +1 -2
- package/legacy/Hidden/withWidth.js +0 -2
- package/legacy/Input/Input.js +1 -1
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/LinearProgress/LinearProgress.js +6 -2
- package/legacy/Link/Link.js +10 -17
- package/legacy/Link/getTextDecoration.js +28 -0
- package/legacy/Modal/Modal.js +23 -7
- package/legacy/OutlinedInput/OutlinedInput.js +36 -9
- package/legacy/Popover/index.js +1 -0
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/Slider/Slider.js +24 -22
- package/legacy/Snackbar/Snackbar.js +6 -21
- package/legacy/SnackbarContent/SnackbarContent.js +3 -3
- package/legacy/SpeedDialAction/SpeedDialAction.js +7 -7
- package/legacy/Stack/Stack.js +2 -1
- package/legacy/StepConnector/StepConnector.js +2 -1
- package/legacy/StepContent/StepContent.js +1 -1
- package/legacy/StepIcon/StepIcon.js +2 -1
- package/legacy/Switch/Switch.js +11 -11
- package/legacy/TableCell/TableCell.js +5 -5
- package/legacy/Tabs/Tabs.js +16 -2
- package/legacy/Tooltip/Tooltip.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +4 -2
- package/legacy/styles/experimental_extendTheme.js +153 -18
- package/modern/Alert/Alert.js +19 -11
- package/modern/AppBar/AppBar.js +22 -5
- package/modern/Avatar/Avatar.js +7 -4
- package/modern/Badge/Badge.js +2 -2
- package/modern/Button/buttonClasses.js +1 -1
- package/modern/Chip/Chip.js +31 -30
- package/modern/Dialog/Dialog.js +11 -6
- package/modern/FilledInput/FilledInput.js +27 -12
- package/modern/Grid/Grid.js +94 -40
- package/modern/Grow/Grow.js +1 -2
- package/modern/Hidden/withWidth.js +0 -2
- package/modern/Input/Input.js +1 -1
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/LinearProgress/LinearProgress.js +6 -2
- package/modern/Link/Link.js +10 -17
- package/modern/Link/getTextDecoration.js +29 -0
- package/modern/Modal/Modal.js +24 -7
- package/modern/OutlinedInput/OutlinedInput.js +40 -10
- package/modern/Popover/index.js +1 -0
- package/modern/Skeleton/Skeleton.js +7 -2
- package/modern/Slider/Slider.js +24 -22
- package/modern/Snackbar/Snackbar.js +6 -20
- package/modern/SnackbarContent/SnackbarContent.js +3 -3
- package/modern/SpeedDialAction/SpeedDialAction.js +7 -7
- package/modern/Stack/Stack.js +1 -1
- package/modern/StepConnector/StepConnector.js +14 -11
- package/modern/StepContent/StepContent.js +1 -1
- package/modern/StepIcon/StepIcon.js +2 -1
- package/modern/Switch/Switch.js +11 -11
- package/modern/TableCell/TableCell.js +5 -5
- package/modern/Tabs/Tabs.js +16 -2
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +2 -2
- package/modern/styles/experimental_extendTheme.js +154 -18
- package/node/Alert/Alert.js +19 -11
- package/node/AppBar/AppBar.js +22 -5
- package/node/Avatar/Avatar.js +7 -4
- package/node/Badge/Badge.js +2 -2
- package/node/Button/buttonClasses.js +1 -1
- package/node/Chip/Chip.js +31 -30
- package/node/Dialog/Dialog.js +11 -6
- package/node/FilledInput/FilledInput.js +28 -13
- package/node/Grid/Grid.js +95 -40
- package/node/Grow/Grow.js +1 -2
- package/node/Hidden/withWidth.js +0 -3
- package/node/Input/Input.js +1 -1
- package/node/InputBase/InputBase.js +2 -2
- package/node/LinearProgress/LinearProgress.js +6 -2
- package/node/Link/Link.js +12 -20
- package/node/Link/getTextDecoration.js +39 -0
- package/node/Modal/Modal.js +25 -8
- package/node/OutlinedInput/OutlinedInput.js +38 -10
- package/node/Popover/index.js +13 -3
- package/node/Skeleton/Skeleton.js +7 -2
- package/node/Slider/Slider.js +24 -22
- package/node/Snackbar/Snackbar.js +6 -18
- package/node/SnackbarContent/SnackbarContent.js +3 -3
- package/node/SpeedDialAction/SpeedDialAction.js +7 -7
- package/node/Stack/Stack.js +1 -1
- package/node/StepConnector/StepConnector.js +14 -11
- package/node/StepContent/StepContent.js +1 -1
- package/node/StepIcon/StepIcon.js +2 -1
- package/node/Switch/Switch.js +11 -11
- package/node/TableCell/TableCell.js +5 -5
- package/node/Tabs/Tabs.js +16 -2
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +6 -2
- package/node/styles/experimental_extendTheme.js +152 -17
- package/package.json +6 -7
- package/styles/CssVarsProvider.d.ts +10 -28
- package/styles/CssVarsProvider.js +6 -2
- package/styles/createPalette.d.ts +0 -26
- package/styles/experimental_extendTheme.d.ts +225 -37
- package/styles/experimental_extendTheme.js +154 -18
- package/styles/index.d.ts +24 -1
- package/themeCssVarsAugmentation/index.d.ts +61 -0
- package/umd/material-ui.development.js +1048 -541
- package/umd/material-ui.production.min.js +27 -22
package/legacy/AppBar/AppBar.js
CHANGED
|
@@ -19,6 +19,12 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
19
19
|
root: ['root', "color".concat(capitalize(color)), "position".concat(capitalize(position))]
|
|
20
20
|
};
|
|
21
21
|
return composeClasses(slots, getAppBarUtilityClass, classes);
|
|
22
|
+
}; // var2 is the fallback.
|
|
23
|
+
// Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var joinVars = function joinVars(var1, var2) {
|
|
27
|
+
return "".concat(var1 == null ? void 0 : var1.replace(')', ''), ", ").concat(var2, ")");
|
|
22
28
|
};
|
|
23
29
|
|
|
24
30
|
var AppBarRoot = styled(Paper, {
|
|
@@ -41,7 +47,7 @@ var AppBarRoot = styled(Paper, {
|
|
|
41
47
|
flexShrink: 0
|
|
42
48
|
}, ownerState.position === 'fixed' && {
|
|
43
49
|
position: 'fixed',
|
|
44
|
-
zIndex: theme.zIndex.appBar,
|
|
50
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
45
51
|
top: 0,
|
|
46
52
|
left: 'auto',
|
|
47
53
|
right: 0,
|
|
@@ -51,14 +57,14 @@ var AppBarRoot = styled(Paper, {
|
|
|
51
57
|
}
|
|
52
58
|
}, ownerState.position === 'absolute' && {
|
|
53
59
|
position: 'absolute',
|
|
54
|
-
zIndex: theme.zIndex.appBar,
|
|
60
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
55
61
|
top: 0,
|
|
56
62
|
left: 'auto',
|
|
57
63
|
right: 0
|
|
58
64
|
}, ownerState.position === 'sticky' && {
|
|
59
65
|
// ⚠️ sticky is not supported by IE11.
|
|
60
66
|
position: 'sticky',
|
|
61
|
-
zIndex: theme.zIndex.appBar,
|
|
67
|
+
zIndex: (theme.vars || theme).zIndex.appBar,
|
|
62
68
|
top: 0,
|
|
63
69
|
left: 'auto',
|
|
64
70
|
right: 0
|
|
@@ -66,7 +72,7 @@ var AppBarRoot = styled(Paper, {
|
|
|
66
72
|
position: 'static'
|
|
67
73
|
}, ownerState.position === 'relative' && {
|
|
68
74
|
position: 'relative'
|
|
69
|
-
}, ownerState.color === 'default' && {
|
|
75
|
+
}, !theme.vars && _extends({}, ownerState.color === 'default' && {
|
|
70
76
|
backgroundColor: backgroundColorDefault,
|
|
71
77
|
color: theme.palette.getContrastText(backgroundColorDefault)
|
|
72
78
|
}, ownerState.color && ownerState.color !== 'default' && ownerState.color !== 'inherit' && ownerState.color !== 'transparent' && {
|
|
@@ -82,6 +88,19 @@ var AppBarRoot = styled(Paper, {
|
|
|
82
88
|
color: 'inherit'
|
|
83
89
|
}, theme.palette.mode === 'dark' && {
|
|
84
90
|
backgroundImage: 'none'
|
|
91
|
+
})), theme.vars && _extends({}, ownerState.color === 'default' && {
|
|
92
|
+
'--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette.AppBar.defaultBg : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette.AppBar.defaultBg),
|
|
93
|
+
'--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette.text.primary : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette.text.primary)
|
|
94
|
+
}, ownerState.color && !ownerState.color.match(/^(default|inherit|transparent)$/) && {
|
|
95
|
+
'--AppBar-background': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].main : joinVars(theme.vars.palette.AppBar.darkBg, theme.vars.palette[ownerState.color].main),
|
|
96
|
+
'--AppBar-color': ownerState.enableColorOnDark ? theme.vars.palette[ownerState.color].contrastText : joinVars(theme.vars.palette.AppBar.darkColor, theme.vars.palette[ownerState.color].contrastText)
|
|
97
|
+
}, {
|
|
98
|
+
backgroundColor: 'var(--AppBar-background)',
|
|
99
|
+
color: ownerState.color === 'inherit' ? 'inherit' : 'var(--AppBar-color)'
|
|
100
|
+
}, ownerState.color === 'transparent' && {
|
|
101
|
+
backgroundImage: 'none',
|
|
102
|
+
backgroundColor: 'transparent',
|
|
103
|
+
color: 'inherit'
|
|
85
104
|
}));
|
|
86
105
|
});
|
|
87
106
|
var AppBar = /*#__PURE__*/React.forwardRef(function AppBar(inProps, ref) {
|
package/legacy/Avatar/Avatar.js
CHANGED
|
@@ -47,13 +47,16 @@ var AvatarRoot = styled('div', {
|
|
|
47
47
|
overflow: 'hidden',
|
|
48
48
|
userSelect: 'none'
|
|
49
49
|
}, ownerState.variant === 'rounded' && {
|
|
50
|
-
borderRadius: theme.shape.borderRadius
|
|
50
|
+
borderRadius: (theme.vars || theme).shape.borderRadius
|
|
51
51
|
}, ownerState.variant === 'square' && {
|
|
52
52
|
borderRadius: 0
|
|
53
|
-
}, ownerState.colorDefault && {
|
|
54
|
-
color: theme.palette.background.default
|
|
53
|
+
}, ownerState.colorDefault && _extends({
|
|
54
|
+
color: (theme.vars || theme).palette.background.default
|
|
55
|
+
}, theme.vars ? {
|
|
56
|
+
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
|
57
|
+
} : {
|
|
55
58
|
backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
|
|
56
|
-
});
|
|
59
|
+
}));
|
|
57
60
|
});
|
|
58
61
|
var AvatarImg = styled('img', {
|
|
59
62
|
name: 'MuiAvatar',
|
package/legacy/Badge/Badge.js
CHANGED
|
@@ -325,8 +325,8 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
325
325
|
* @default {}
|
|
326
326
|
*/
|
|
327
327
|
componentsProps: PropTypes.shape({
|
|
328
|
-
badge: PropTypes.object,
|
|
329
|
-
root: PropTypes.object
|
|
328
|
+
badge: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
329
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
330
330
|
}),
|
|
331
331
|
|
|
332
332
|
/**
|
|
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
|
|
|
2
2
|
export function getButtonUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiButton', slot);
|
|
4
4
|
}
|
|
5
|
-
var buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
5
|
+
var buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
6
6
|
export default buttonClasses;
|
package/legacy/Chip/Chip.js
CHANGED
|
@@ -53,6 +53,7 @@ var ChipRoot = styled('div', {
|
|
|
53
53
|
var theme = _ref11.theme,
|
|
54
54
|
ownerState = _ref11.ownerState;
|
|
55
55
|
var deleteIconColor = alpha(theme.palette.text.primary, 0.26);
|
|
56
|
+
var textColor = theme.palette.mode === 'light' ? theme.palette.grey[700] : theme.palette.grey[300];
|
|
56
57
|
return _extends((_extends2 = {
|
|
57
58
|
maxWidth: '100%',
|
|
58
59
|
fontFamily: theme.typography.fontFamily,
|
|
@@ -61,8 +62,8 @@ var ChipRoot = styled('div', {
|
|
|
61
62
|
alignItems: 'center',
|
|
62
63
|
justifyContent: 'center',
|
|
63
64
|
height: 32,
|
|
64
|
-
color: theme.palette.text.primary,
|
|
65
|
-
backgroundColor: theme.palette.action.selected,
|
|
65
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
66
|
+
backgroundColor: (theme.vars || theme).palette.action.selected,
|
|
66
67
|
borderRadius: 32 / 2,
|
|
67
68
|
whiteSpace: 'nowrap',
|
|
68
69
|
transition: theme.transitions.create(['background-color', 'box-shadow']),
|
|
@@ -78,21 +79,21 @@ var ChipRoot = styled('div', {
|
|
|
78
79
|
verticalAlign: 'middle',
|
|
79
80
|
boxSizing: 'border-box'
|
|
80
81
|
}, _defineProperty(_extends2, "&.".concat(chipClasses.disabled), {
|
|
81
|
-
opacity: theme.palette.action.disabledOpacity,
|
|
82
|
+
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
|
82
83
|
pointerEvents: 'none'
|
|
83
84
|
}), _defineProperty(_extends2, "& .".concat(chipClasses.avatar), {
|
|
84
85
|
marginLeft: 5,
|
|
85
86
|
marginRight: -6,
|
|
86
87
|
width: 24,
|
|
87
88
|
height: 24,
|
|
88
|
-
color: theme.
|
|
89
|
+
color: theme.vars ? theme.vars.palette.Chip.defaultAvatarColor : textColor,
|
|
89
90
|
fontSize: theme.typography.pxToRem(12)
|
|
90
91
|
}), _defineProperty(_extends2, "& .".concat(chipClasses.avatarColorPrimary), {
|
|
91
|
-
color: theme.palette.primary.contrastText,
|
|
92
|
-
backgroundColor: theme.palette.primary.dark
|
|
92
|
+
color: (theme.vars || theme).palette.primary.contrastText,
|
|
93
|
+
backgroundColor: (theme.vars || theme).palette.primary.dark
|
|
93
94
|
}), _defineProperty(_extends2, "& .".concat(chipClasses.avatarColorSecondary), {
|
|
94
|
-
color: theme.palette.secondary.contrastText,
|
|
95
|
-
backgroundColor: theme.palette.secondary.dark
|
|
95
|
+
color: (theme.vars || theme).palette.secondary.contrastText,
|
|
96
|
+
backgroundColor: (theme.vars || theme).palette.secondary.dark
|
|
96
97
|
}), _defineProperty(_extends2, "& .".concat(chipClasses.avatarSmall), {
|
|
97
98
|
marginLeft: 4,
|
|
98
99
|
marginRight: -4,
|
|
@@ -100,7 +101,7 @@ var ChipRoot = styled('div', {
|
|
|
100
101
|
height: 18,
|
|
101
102
|
fontSize: theme.typography.pxToRem(10)
|
|
102
103
|
}), _defineProperty(_extends2, "& .".concat(chipClasses.icon), _extends({
|
|
103
|
-
color: theme.
|
|
104
|
+
color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor,
|
|
104
105
|
marginLeft: 5,
|
|
105
106
|
marginRight: -6
|
|
106
107
|
}, ownerState.size === 'small' && {
|
|
@@ -111,31 +112,31 @@ var ChipRoot = styled('div', {
|
|
|
111
112
|
color: 'inherit'
|
|
112
113
|
})), _defineProperty(_extends2, "& .".concat(chipClasses.deleteIcon), _extends({
|
|
113
114
|
WebkitTapHighlightColor: 'transparent',
|
|
114
|
-
color: deleteIconColor,
|
|
115
|
+
color: theme.vars ? "rgba(".concat(theme.vars.palette.text.primaryChannel, " / 0.26)") : deleteIconColor,
|
|
115
116
|
fontSize: 22,
|
|
116
117
|
cursor: 'pointer',
|
|
117
118
|
margin: '0 5px 0 -6px',
|
|
118
119
|
'&:hover': {
|
|
119
|
-
color: alpha(deleteIconColor, 0.4)
|
|
120
|
+
color: theme.vars ? "rgba(".concat(theme.vars.palette.text.primaryChannel, " / 0.4)") : alpha(deleteIconColor, 0.4)
|
|
120
121
|
}
|
|
121
122
|
}, ownerState.size === 'small' && {
|
|
122
123
|
fontSize: 16,
|
|
123
124
|
marginRight: 4,
|
|
124
125
|
marginLeft: -4
|
|
125
126
|
}, ownerState.color !== 'default' && {
|
|
126
|
-
color: alpha(theme.palette[ownerState.color].contrastText, 0.7),
|
|
127
|
+
color: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].contrastTextChannel, " / 0.7)") : alpha(theme.palette[ownerState.color].contrastText, 0.7),
|
|
127
128
|
'&:hover, &:active': {
|
|
128
|
-
color: theme.palette[ownerState.color].contrastText
|
|
129
|
+
color: (theme.vars || theme).palette[ownerState.color].contrastText
|
|
129
130
|
}
|
|
130
131
|
})), _extends2), ownerState.size === 'small' && {
|
|
131
132
|
height: 24
|
|
132
133
|
}, ownerState.color !== 'default' && {
|
|
133
|
-
backgroundColor: theme.palette[ownerState.color].main,
|
|
134
|
-
color: theme.palette[ownerState.color].contrastText
|
|
134
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].main,
|
|
135
|
+
color: (theme.vars || theme).palette[ownerState.color].contrastText
|
|
135
136
|
}, ownerState.onDelete && _defineProperty({}, "&.".concat(chipClasses.focusVisible), {
|
|
136
|
-
backgroundColor: alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
137
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.action.selectedChannel, " / calc(").concat(theme.vars.palette.action.selectedOpacity + theme.vars.palette.action.focusOpacity, "))") : alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
137
138
|
}), ownerState.onDelete && ownerState.color !== 'default' && _defineProperty({}, "&.".concat(chipClasses.focusVisible), {
|
|
138
|
-
backgroundColor: theme.palette[ownerState.color].dark
|
|
139
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].dark
|
|
139
140
|
}));
|
|
140
141
|
}, function (_ref14) {
|
|
141
142
|
var _ref15;
|
|
@@ -147,14 +148,14 @@ var ChipRoot = styled('div', {
|
|
|
147
148
|
WebkitTapHighlightColor: 'transparent',
|
|
148
149
|
cursor: 'pointer',
|
|
149
150
|
'&:hover': {
|
|
150
|
-
backgroundColor: alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
|
151
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.action.selectedChannel, " / calc(").concat(theme.vars.palette.action.selectedOpacity + theme.vars.palette.action.hoverOpacity, "))") : alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
|
|
151
152
|
}
|
|
152
153
|
}, _defineProperty(_ref15, "&.".concat(chipClasses.focusVisible), {
|
|
153
|
-
backgroundColor: alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
154
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette.action.selectedChannel, " / calc(").concat(theme.vars.palette.action.selectedOpacity + theme.vars.palette.action.focusOpacity, "))") : alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
|
|
154
155
|
}), _defineProperty(_ref15, '&:active', {
|
|
155
|
-
boxShadow: theme.shadows[1]
|
|
156
|
+
boxShadow: (theme.vars || theme).shadows[1]
|
|
156
157
|
}), _ref15), ownerState.clickable && ownerState.color !== 'default' && _defineProperty({}, "&:hover, &.".concat(chipClasses.focusVisible), {
|
|
157
|
-
backgroundColor: theme.palette[ownerState.color].dark
|
|
158
|
+
backgroundColor: (theme.vars || theme).palette[ownerState.color].dark
|
|
158
159
|
}));
|
|
159
160
|
}, function (_ref17) {
|
|
160
161
|
var _ref18, _ref19;
|
|
@@ -163,11 +164,11 @@ var ChipRoot = styled('div', {
|
|
|
163
164
|
ownerState = _ref17.ownerState;
|
|
164
165
|
return _extends({}, ownerState.variant === 'outlined' && (_ref18 = {
|
|
165
166
|
backgroundColor: 'transparent',
|
|
166
|
-
border: "1px solid ".concat(theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700])
|
|
167
|
+
border: theme.vars ? "1px solid ".concat(theme.vars.palette.Chip.defaultBorder) : "1px solid ".concat(theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700])
|
|
167
168
|
}, _defineProperty(_ref18, "&.".concat(chipClasses.clickable, ":hover"), {
|
|
168
|
-
backgroundColor: theme.palette.action.hover
|
|
169
|
+
backgroundColor: (theme.vars || theme).palette.action.hover
|
|
169
170
|
}), _defineProperty(_ref18, "&.".concat(chipClasses.focusVisible), {
|
|
170
|
-
backgroundColor: theme.palette.action.focus
|
|
171
|
+
backgroundColor: (theme.vars || theme).palette.action.focus
|
|
171
172
|
}), _defineProperty(_ref18, "& .".concat(chipClasses.avatar), {
|
|
172
173
|
marginLeft: 4
|
|
173
174
|
}), _defineProperty(_ref18, "& .".concat(chipClasses.avatarSmall), {
|
|
@@ -181,16 +182,16 @@ var ChipRoot = styled('div', {
|
|
|
181
182
|
}), _defineProperty(_ref18, "& .".concat(chipClasses.deleteIconSmall), {
|
|
182
183
|
marginRight: 3
|
|
183
184
|
}), _ref18), ownerState.variant === 'outlined' && ownerState.color !== 'default' && (_ref19 = {
|
|
184
|
-
color: theme.palette[ownerState.color].main,
|
|
185
|
-
border: "1px solid ".concat(alpha(theme.palette[ownerState.color].main, 0.7))
|
|
185
|
+
color: (theme.vars || theme).palette[ownerState.color].main,
|
|
186
|
+
border: "1px solid ".concat(theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.7)") : alpha(theme.palette[ownerState.color].main, 0.7))
|
|
186
187
|
}, _defineProperty(_ref19, "&.".concat(chipClasses.clickable, ":hover"), {
|
|
187
|
-
backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity)
|
|
188
|
+
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)
|
|
188
189
|
}), _defineProperty(_ref19, "&.".concat(chipClasses.focusVisible), {
|
|
189
|
-
backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.focusOpacity)
|
|
190
|
+
backgroundColor: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / ").concat(theme.vars.palette.action.focusOpacity, ")") : alpha(theme.palette[ownerState.color].main, theme.palette.action.focusOpacity)
|
|
190
191
|
}), _defineProperty(_ref19, "& .".concat(chipClasses.deleteIcon), {
|
|
191
|
-
color: alpha(theme.palette[ownerState.color].main, 0.7),
|
|
192
|
+
color: theme.vars ? "rgba(".concat(theme.vars.palette[ownerState.color].mainChannel, " / 0.7)") : alpha(theme.palette[ownerState.color].main, 0.7),
|
|
192
193
|
'&:hover, &:active': {
|
|
193
|
-
color: theme.palette[ownerState.color].main
|
|
194
|
+
color: (theme.vars || theme).palette[ownerState.color].main
|
|
194
195
|
}
|
|
195
196
|
}), _ref19));
|
|
196
197
|
});
|
package/legacy/Dialog/Dialog.js
CHANGED
|
@@ -121,7 +121,7 @@ var DialogPaper = styled(Paper, {
|
|
|
121
121
|
maxWidth: theme.breakpoints.unit === 'px' ? Math.max(theme.breakpoints.values.xs, 444) : "".concat(theme.breakpoints.values.xs).concat(theme.breakpoints.unit)
|
|
122
122
|
}, "&.".concat(dialogClasses.paperScrollBody), _defineProperty({}, theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 444) + 32 * 2), {
|
|
123
123
|
maxWidth: 'calc(100% - 64px)'
|
|
124
|
-
})), ownerState.maxWidth !== 'xs' && _defineProperty({
|
|
124
|
+
})), ownerState.maxWidth && ownerState.maxWidth !== 'xs' && _defineProperty({
|
|
125
125
|
maxWidth: "".concat(theme.breakpoints.values[ownerState.maxWidth]).concat(theme.breakpoints.unit)
|
|
126
126
|
}, "&.".concat(dialogClasses.paperScrollBody), _defineProperty({}, theme.breakpoints.down(theme.breakpoints.values[ownerState.maxWidth] + 32 * 2), {
|
|
127
127
|
maxWidth: 'calc(100% - 64px)'
|
|
@@ -226,12 +226,16 @@ var Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
|
|
|
226
226
|
}, [ariaLabelledby]);
|
|
227
227
|
return /*#__PURE__*/_jsx(DialogRoot, _extends({
|
|
228
228
|
className: clsx(classes.root, className),
|
|
229
|
-
BackdropProps: _extends({
|
|
230
|
-
transitionDuration: transitionDuration,
|
|
231
|
-
as: BackdropComponent
|
|
232
|
-
}, BackdropProps),
|
|
233
229
|
closeAfterTransition: true,
|
|
234
|
-
|
|
230
|
+
components: {
|
|
231
|
+
Backdrop: DialogBackdrop
|
|
232
|
+
},
|
|
233
|
+
componentsProps: {
|
|
234
|
+
backdrop: _extends({
|
|
235
|
+
transitionDuration: transitionDuration,
|
|
236
|
+
as: BackdropComponent
|
|
237
|
+
}, BackdropProps)
|
|
238
|
+
},
|
|
235
239
|
disableEscapeKeyDown: disableEscapeKeyDown,
|
|
236
240
|
onClose: onClose,
|
|
237
241
|
open: open,
|
|
@@ -287,6 +291,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes
|
|
|
287
291
|
|
|
288
292
|
/**
|
|
289
293
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
294
|
+
* @deprecated Use `components.Backdrop` instead.
|
|
290
295
|
* @default styled(Backdrop, {
|
|
291
296
|
* name: 'MuiModal',
|
|
292
297
|
* slot: 'Backdrop',
|
|
@@ -35,36 +35,38 @@ var FilledInputRoot = styled(InputBaseRoot, {
|
|
|
35
35
|
return [].concat(_toConsumableArray(inputBaseRootOverridesResolver(props, styles)), [!ownerState.disableUnderline && styles.underline]);
|
|
36
36
|
}
|
|
37
37
|
})(function (_ref) {
|
|
38
|
-
var _extends2,
|
|
38
|
+
var _extends2, _palette, _ref2;
|
|
39
39
|
|
|
40
40
|
var theme = _ref.theme,
|
|
41
41
|
ownerState = _ref.ownerState;
|
|
42
42
|
var light = theme.palette.mode === 'light';
|
|
43
43
|
var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
|
|
44
44
|
var backgroundColor = light ? 'rgba(0, 0, 0, 0.06)' : 'rgba(255, 255, 255, 0.09)';
|
|
45
|
+
var hoverBackground = light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.13)';
|
|
46
|
+
var disabledBackground = light ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)';
|
|
45
47
|
return _extends((_extends2 = {
|
|
46
48
|
position: 'relative',
|
|
47
|
-
backgroundColor: backgroundColor,
|
|
48
|
-
borderTopLeftRadius: theme.shape.borderRadius,
|
|
49
|
-
borderTopRightRadius: theme.shape.borderRadius,
|
|
49
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor,
|
|
50
|
+
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
51
|
+
borderTopRightRadius: (theme.vars || theme).shape.borderRadius,
|
|
50
52
|
transition: theme.transitions.create('background-color', {
|
|
51
53
|
duration: theme.transitions.duration.shorter,
|
|
52
54
|
easing: theme.transitions.easing.easeOut
|
|
53
55
|
}),
|
|
54
56
|
'&:hover': {
|
|
55
|
-
backgroundColor:
|
|
57
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.hoverBg : hoverBackground,
|
|
56
58
|
// Reset on touch devices, it doesn't add specificity
|
|
57
59
|
'@media (hover: none)': {
|
|
58
|
-
backgroundColor: backgroundColor
|
|
60
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
}, _defineProperty(_extends2, "&.".concat(filledInputClasses.focused), {
|
|
62
|
-
backgroundColor: backgroundColor
|
|
64
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
|
63
65
|
}), _defineProperty(_extends2, "&.".concat(filledInputClasses.disabled), {
|
|
64
|
-
backgroundColor:
|
|
66
|
+
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.disabledBg : disabledBackground
|
|
65
67
|
}), _extends2), !ownerState.disableUnderline && (_ref2 = {
|
|
66
68
|
'&:after': {
|
|
67
|
-
borderBottom: "2px solid ".concat((
|
|
69
|
+
borderBottom: "2px solid ".concat((_palette = (theme.vars || theme).palette[ownerState.color || 'primary']) == null ? void 0 : _palette.main),
|
|
68
70
|
left: 0,
|
|
69
71
|
bottom: 0,
|
|
70
72
|
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
@@ -84,11 +86,11 @@ var FilledInputRoot = styled(InputBaseRoot, {
|
|
|
84
86
|
// See https://github.com/mui/material-ui/issues/31766
|
|
85
87
|
transform: 'scaleX(1) translateX(0)'
|
|
86
88
|
}), _defineProperty(_ref2, "&.".concat(filledInputClasses.error, ":after"), {
|
|
87
|
-
borderBottomColor: theme.palette.error.main,
|
|
89
|
+
borderBottomColor: (theme.vars || theme).palette.error.main,
|
|
88
90
|
transform: 'scaleX(1)' // error is always underlined in red
|
|
89
91
|
|
|
90
92
|
}), _defineProperty(_ref2, '&:before', {
|
|
91
|
-
borderBottom: "1px solid ".concat(bottomLineColor),
|
|
93
|
+
borderBottom: "1px solid ".concat(theme.vars ? "rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / ").concat(theme.vars.opacity.inputUnderline, ")") : bottomLineColor),
|
|
92
94
|
left: 0,
|
|
93
95
|
bottom: 0,
|
|
94
96
|
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
|
@@ -101,7 +103,7 @@ var FilledInputRoot = styled(InputBaseRoot, {
|
|
|
101
103
|
pointerEvents: 'none' // Transparent to the hover style.
|
|
102
104
|
|
|
103
105
|
}), _defineProperty(_ref2, "&:hover:not(.".concat(filledInputClasses.disabled, "):before"), {
|
|
104
|
-
borderBottom: "1px solid ".concat(theme.palette.text.primary)
|
|
106
|
+
borderBottom: "1px solid ".concat((theme.vars || theme).palette.text.primary)
|
|
105
107
|
}), _defineProperty(_ref2, "&.".concat(filledInputClasses.disabled, ":before"), {
|
|
106
108
|
borderBottomStyle: 'dotted'
|
|
107
109
|
}), _ref2), ownerState.startAdornment && {
|
|
@@ -129,7 +131,8 @@ var FilledInputInput = styled(InputBaseInput, {
|
|
|
129
131
|
paddingTop: 25,
|
|
130
132
|
paddingRight: 12,
|
|
131
133
|
paddingBottom: 8,
|
|
132
|
-
paddingLeft: 12
|
|
134
|
+
paddingLeft: 12
|
|
135
|
+
}, !theme.vars && {
|
|
133
136
|
'&:-webkit-autofill': {
|
|
134
137
|
WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset',
|
|
135
138
|
WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff',
|
|
@@ -137,7 +140,18 @@ var FilledInputInput = styled(InputBaseInput, {
|
|
|
137
140
|
borderTopLeftRadius: 'inherit',
|
|
138
141
|
borderTopRightRadius: 'inherit'
|
|
139
142
|
}
|
|
140
|
-
},
|
|
143
|
+
}, theme.vars && _defineProperty({
|
|
144
|
+
'&:-webkit-autofill': {
|
|
145
|
+
borderTopLeftRadius: 'inherit',
|
|
146
|
+
borderTopRightRadius: 'inherit'
|
|
147
|
+
}
|
|
148
|
+
}, theme.getColorSchemeSelector('dark'), {
|
|
149
|
+
'&:-webkit-autofill': {
|
|
150
|
+
WebkitBoxShadow: '0 0 0 100px #266798 inset',
|
|
151
|
+
WebkitTextFillColor: '#fff',
|
|
152
|
+
caretColor: '#fff'
|
|
153
|
+
}
|
|
154
|
+
}), ownerState.size === 'small' && {
|
|
141
155
|
paddingTop: 21,
|
|
142
156
|
paddingBottom: 4
|
|
143
157
|
}, ownerState.hiddenLabel && {
|
package/legacy/Grid/Grid.js
CHANGED
|
@@ -21,6 +21,7 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
|
21
21
|
import requirePropFactory from '../utils/requirePropFactory';
|
|
22
22
|
import styled from '../styles/styled';
|
|
23
23
|
import useThemeProps from '../styles/useThemeProps';
|
|
24
|
+
import useTheme from '../styles/useTheme';
|
|
24
25
|
import GridContext from './GridContext';
|
|
25
26
|
import gridClasses, { getGridUtilityClass } from './gridClasses';
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -193,26 +194,29 @@ export function generateColumnGap(_ref5) {
|
|
|
193
194
|
|
|
194
195
|
return styles;
|
|
195
196
|
}
|
|
196
|
-
export function
|
|
197
|
+
export function resolveSpacingStyles(spacing, breakpoints) {
|
|
197
198
|
var styles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
198
199
|
|
|
199
|
-
//
|
|
200
|
-
if (!
|
|
200
|
+
// undefined/null or `spacing` <= 0
|
|
201
|
+
if (!spacing || spacing <= 0) {
|
|
201
202
|
return [];
|
|
202
203
|
} // in case of string/number `spacing`
|
|
203
204
|
|
|
204
205
|
|
|
205
206
|
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
206
|
-
return [styles["spacing-xs-".concat(String(spacing))]
|
|
207
|
+
return [styles["spacing-xs-".concat(String(spacing))]];
|
|
207
208
|
} // in case of object `spacing`
|
|
208
209
|
|
|
209
210
|
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
var spacingStyles = [];
|
|
212
|
+
breakpoints.forEach(function (breakpoint) {
|
|
213
|
+
var value = spacing[breakpoint];
|
|
214
|
+
|
|
215
|
+
if (Number(value) > 0) {
|
|
216
|
+
spacingStyles.push(styles["spacing-".concat(breakpoint, "-").concat(String(value))]);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
return spacingStyles;
|
|
216
220
|
} // Default CSS values
|
|
217
221
|
// flex: '0 1 auto',
|
|
218
222
|
// flexDirection: 'row',
|
|
@@ -224,19 +228,29 @@ var GridRoot = styled('div', {
|
|
|
224
228
|
name: 'MuiGrid',
|
|
225
229
|
slot: 'Root',
|
|
226
230
|
overridesResolver: function overridesResolver(props, styles) {
|
|
227
|
-
var
|
|
228
|
-
|
|
229
|
-
direction =
|
|
230
|
-
item =
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
231
|
+
var ownerState = props.ownerState;
|
|
232
|
+
var container = ownerState.container,
|
|
233
|
+
direction = ownerState.direction,
|
|
234
|
+
item = ownerState.item,
|
|
235
|
+
spacing = ownerState.spacing,
|
|
236
|
+
wrap = ownerState.wrap,
|
|
237
|
+
zeroMinWidth = ownerState.zeroMinWidth,
|
|
238
|
+
breakpoints = ownerState.breakpoints;
|
|
239
|
+
var spacingStyles = []; // in case of grid item
|
|
240
|
+
|
|
241
|
+
if (container) {
|
|
242
|
+
spacingStyles = resolveSpacingStyles(spacing, breakpoints, styles);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
var breakpointsStyles = [];
|
|
246
|
+
breakpoints.forEach(function (breakpoint) {
|
|
247
|
+
var value = ownerState[breakpoint];
|
|
248
|
+
|
|
249
|
+
if (value) {
|
|
250
|
+
breakpointsStyles.push(styles["grid-".concat(breakpoint, "-").concat(String(value))]);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth].concat(_toConsumableArray(spacingStyles), [direction !== 'row' && styles["direction-xs-".concat(String(direction))], wrap !== 'wrap' && styles["wrap-xs-".concat(String(wrap))]], breakpointsStyles);
|
|
240
254
|
}
|
|
241
255
|
})(function (_ref7) {
|
|
242
256
|
var ownerState = _ref7.ownerState;
|
|
@@ -255,22 +269,55 @@ var GridRoot = styled('div', {
|
|
|
255
269
|
flexWrap: ownerState.wrap
|
|
256
270
|
});
|
|
257
271
|
}, generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
272
|
+
export function resolveSpacingClasses(spacing, breakpoints) {
|
|
273
|
+
// undefined/null or `spacing` <= 0
|
|
274
|
+
if (!spacing || spacing <= 0) {
|
|
275
|
+
return [];
|
|
276
|
+
} // in case of string/number `spacing`
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
|
|
280
|
+
return ["spacing-xs-".concat(String(spacing))];
|
|
281
|
+
} // in case of object `spacing`
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
var classes = [];
|
|
285
|
+
breakpoints.forEach(function (breakpoint) {
|
|
286
|
+
var value = spacing[breakpoint];
|
|
287
|
+
|
|
288
|
+
if (Number(value) > 0) {
|
|
289
|
+
var className = "spacing-".concat(breakpoint, "-").concat(String(value));
|
|
290
|
+
classes.push(className);
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
return classes;
|
|
294
|
+
}
|
|
258
295
|
|
|
259
296
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
260
297
|
var classes = ownerState.classes,
|
|
261
298
|
container = ownerState.container,
|
|
262
299
|
direction = ownerState.direction,
|
|
263
300
|
item = ownerState.item,
|
|
264
|
-
lg = ownerState.lg,
|
|
265
|
-
md = ownerState.md,
|
|
266
|
-
sm = ownerState.sm,
|
|
267
301
|
spacing = ownerState.spacing,
|
|
268
302
|
wrap = ownerState.wrap,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
303
|
+
zeroMinWidth = ownerState.zeroMinWidth,
|
|
304
|
+
breakpoints = ownerState.breakpoints;
|
|
305
|
+
var spacingClasses = []; // in case of grid item
|
|
306
|
+
|
|
307
|
+
if (container) {
|
|
308
|
+
spacingClasses = resolveSpacingClasses(spacing, breakpoints);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
var breakpointsClasses = [];
|
|
312
|
+
breakpoints.forEach(function (breakpoint) {
|
|
313
|
+
var value = ownerState[breakpoint];
|
|
314
|
+
|
|
315
|
+
if (value) {
|
|
316
|
+
breakpointsClasses.push("grid-".concat(breakpoint, "-").concat(String(value)));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
272
319
|
var slots = {
|
|
273
|
-
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth'].concat(_toConsumableArray(
|
|
320
|
+
root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth'].concat(_toConsumableArray(spacingClasses), [direction !== 'row' && "direction-xs-".concat(String(direction)), wrap !== 'wrap' && "wrap-xs-".concat(String(wrap))], breakpointsClasses)
|
|
274
321
|
};
|
|
275
322
|
return composeClasses(slots, getGridUtilityClass, classes);
|
|
276
323
|
};
|
|
@@ -280,6 +327,10 @@ var Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
280
327
|
props: inProps,
|
|
281
328
|
name: 'MuiGrid'
|
|
282
329
|
});
|
|
330
|
+
|
|
331
|
+
var _useTheme = useTheme(),
|
|
332
|
+
breakpoints = _useTheme.breakpoints;
|
|
333
|
+
|
|
283
334
|
var props = extendSxProp(themeProps);
|
|
284
335
|
|
|
285
336
|
var className = props.className,
|
|
@@ -293,45 +344,43 @@ var Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
293
344
|
direction = _props$direction === void 0 ? 'row' : _props$direction,
|
|
294
345
|
_props$item = props.item,
|
|
295
346
|
item = _props$item === void 0 ? false : _props$item,
|
|
296
|
-
_props$lg = props.lg,
|
|
297
|
-
lg = _props$lg === void 0 ? false : _props$lg,
|
|
298
|
-
_props$md = props.md,
|
|
299
|
-
md = _props$md === void 0 ? false : _props$md,
|
|
300
347
|
rowSpacingProp = props.rowSpacing,
|
|
301
|
-
_props$sm = props.sm,
|
|
302
|
-
sm = _props$sm === void 0 ? false : _props$sm,
|
|
303
348
|
_props$spacing = props.spacing,
|
|
304
349
|
spacing = _props$spacing === void 0 ? 0 : _props$spacing,
|
|
305
350
|
_props$wrap = props.wrap,
|
|
306
351
|
wrap = _props$wrap === void 0 ? 'wrap' : _props$wrap,
|
|
307
|
-
_props$xl = props.xl,
|
|
308
|
-
xl = _props$xl === void 0 ? false : _props$xl,
|
|
309
|
-
_props$xs = props.xs,
|
|
310
|
-
xs = _props$xs === void 0 ? false : _props$xs,
|
|
311
352
|
_props$zeroMinWidth = props.zeroMinWidth,
|
|
312
353
|
zeroMinWidth = _props$zeroMinWidth === void 0 ? false : _props$zeroMinWidth,
|
|
313
|
-
other = _objectWithoutProperties(props, ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "
|
|
354
|
+
other = _objectWithoutProperties(props, ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"]);
|
|
314
355
|
|
|
315
356
|
var rowSpacing = rowSpacingProp || spacing;
|
|
316
357
|
var columnSpacing = columnSpacingProp || spacing;
|
|
317
358
|
var columnsContext = React.useContext(GridContext); // columns set with default breakpoint unit of 12
|
|
318
359
|
|
|
319
360
|
var columns = container ? columnsProp || 12 : columnsContext;
|
|
361
|
+
var breakpointsValues = {};
|
|
362
|
+
|
|
363
|
+
var otherFiltered = _extends({}, other);
|
|
364
|
+
|
|
365
|
+
breakpoints.keys.forEach(function (breakpoint) {
|
|
366
|
+
if (other[breakpoint] != null) {
|
|
367
|
+
breakpointsValues[breakpoint] = other[breakpoint];
|
|
368
|
+
delete otherFiltered[breakpoint];
|
|
369
|
+
}
|
|
370
|
+
});
|
|
320
371
|
|
|
321
372
|
var ownerState = _extends({}, props, {
|
|
322
373
|
columns: columns,
|
|
323
374
|
container: container,
|
|
324
375
|
direction: direction,
|
|
325
376
|
item: item,
|
|
326
|
-
lg: lg,
|
|
327
|
-
md: md,
|
|
328
|
-
sm: sm,
|
|
329
377
|
rowSpacing: rowSpacing,
|
|
330
378
|
columnSpacing: columnSpacing,
|
|
331
379
|
wrap: wrap,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
380
|
+
zeroMinWidth: zeroMinWidth,
|
|
381
|
+
spacing: spacing
|
|
382
|
+
}, breakpointsValues, {
|
|
383
|
+
breakpoints: breakpoints.keys
|
|
335
384
|
});
|
|
336
385
|
|
|
337
386
|
var classes = useUtilityClasses(ownerState);
|
|
@@ -342,7 +391,7 @@ var Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
|
342
391
|
className: clsx(classes.root, className),
|
|
343
392
|
as: component,
|
|
344
393
|
ref: ref
|
|
345
|
-
},
|
|
394
|
+
}, otherFiltered))
|
|
346
395
|
});
|
|
347
396
|
});
|
|
348
397
|
process.env.NODE_ENV !== "production" ? Grid.propTypes
|