@mui/material 6.0.0-alpha.3 → 6.0.0-alpha.4
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/CHANGELOG.md +55 -0
- package/Checkbox/Checkbox.js +51 -20
- package/FormHelperText/FormHelperText.js +18 -8
- package/IconButton/IconButton.js +97 -40
- package/ImageList/ImageList.js +16 -14
- package/ImageListItem/ImageListItem.js +37 -22
- package/ImageListItemBar/ImageListItemBar.js +65 -32
- package/ListItem/ListItem.js +94 -50
- package/ListItemAvatar/ListItemAvatar.js +12 -8
- package/ListItemButton/ListItemButton.js +35 -15
- package/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
- package/ListItemText/ListItemText.js +20 -11
- package/ListSubheader/ListSubheader.js +44 -19
- package/Radio/Radio.js +50 -20
- package/Radio/RadioButtonIcon.js +18 -12
- package/Rating/Rating.js +71 -37
- package/Table/Table.js +11 -6
- package/TableCell/TableCell.js +96 -41
- package/TableSortLabel/TableSortLabel.js +19 -9
- package/Toolbar/Toolbar.js +33 -17
- package/Typography/Typography.js +3 -2
- package/index.js +1 -1
- package/modern/Checkbox/Checkbox.js +51 -20
- package/modern/FormHelperText/FormHelperText.js +18 -8
- package/modern/IconButton/IconButton.js +97 -40
- package/modern/ImageList/ImageList.js +16 -14
- package/modern/ImageListItem/ImageListItem.js +37 -22
- package/modern/ImageListItemBar/ImageListItemBar.js +65 -32
- package/modern/ListItem/ListItem.js +94 -50
- package/modern/ListItemAvatar/ListItemAvatar.js +12 -8
- package/modern/ListItemButton/ListItemButton.js +35 -15
- package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
- package/modern/ListItemText/ListItemText.js +20 -11
- package/modern/ListSubheader/ListSubheader.js +44 -19
- package/modern/Radio/Radio.js +50 -20
- package/modern/Radio/RadioButtonIcon.js +18 -12
- package/modern/Rating/Rating.js +71 -37
- package/modern/Table/Table.js +11 -6
- package/modern/TableCell/TableCell.js +96 -41
- package/modern/TableSortLabel/TableSortLabel.js +19 -9
- package/modern/Toolbar/Toolbar.js +33 -17
- package/modern/Typography/Typography.js +3 -2
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +2 -1
- package/modern/styles/getOverlayAlpha.js +3 -4
- package/node/Checkbox/Checkbox.js +54 -23
- package/node/FormHelperText/FormHelperText.js +18 -8
- package/node/IconButton/IconButton.js +99 -43
- package/node/ImageList/ImageList.js +16 -14
- package/node/ImageListItem/ImageListItem.js +37 -22
- package/node/ImageListItemBar/ImageListItemBar.js +65 -32
- package/node/ListItem/ListItem.js +94 -50
- package/node/ListItemAvatar/ListItemAvatar.js +12 -8
- package/node/ListItemButton/ListItemButton.js +35 -15
- package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
- package/node/ListItemText/ListItemText.js +20 -11
- package/node/ListSubheader/ListSubheader.js +44 -19
- package/node/Radio/Radio.js +52 -22
- package/node/Radio/RadioButtonIcon.js +21 -15
- package/node/Rating/Rating.js +71 -37
- package/node/Table/Table.js +11 -6
- package/node/TableCell/TableCell.js +96 -41
- package/node/TableSortLabel/TableSortLabel.js +19 -9
- package/node/Toolbar/Toolbar.js +33 -17
- package/node/Typography/Typography.js +3 -2
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +1 -0
- package/node/styles/getOverlayAlpha.js +4 -5
- package/package.json +4 -4
- package/styles/experimental_extendTheme.d.ts +2 -0
- package/styles/experimental_extendTheme.js +2 -1
- package/styles/getOverlayAlpha.d.ts +1 -2
- package/styles/getOverlayAlpha.js +3 -4
- package/umd/material-ui.development.js +1028 -533
- package/umd/material-ui.production.min.js +4 -4
|
@@ -53,9 +53,8 @@ const ListItemButtonRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
53
53
|
slot: 'Root',
|
|
54
54
|
overridesResolver
|
|
55
55
|
})(({
|
|
56
|
-
theme
|
|
57
|
-
|
|
58
|
-
}) => (0, _extends2.default)({
|
|
56
|
+
theme
|
|
57
|
+
}) => ({
|
|
59
58
|
display: 'flex',
|
|
60
59
|
flexGrow: 1,
|
|
61
60
|
justifyContent: 'flex-start',
|
|
@@ -96,18 +95,39 @@ const ListItemButtonRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
96
95
|
},
|
|
97
96
|
[`&.${_listItemButtonClasses.default.disabled}`]: {
|
|
98
97
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
},
|
|
99
|
+
variants: [{
|
|
100
|
+
props: ({
|
|
101
|
+
ownerState
|
|
102
|
+
}) => ownerState.divider,
|
|
103
|
+
style: {
|
|
104
|
+
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
105
|
+
backgroundClip: 'padding-box'
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
props: {
|
|
109
|
+
alignItems: 'flex-start'
|
|
110
|
+
},
|
|
111
|
+
style: {
|
|
112
|
+
alignItems: 'flex-start'
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
props: ({
|
|
116
|
+
ownerState
|
|
117
|
+
}) => !ownerState.disableGutters,
|
|
118
|
+
style: {
|
|
119
|
+
paddingLeft: 16,
|
|
120
|
+
paddingRight: 16
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
props: ({
|
|
124
|
+
ownerState
|
|
125
|
+
}) => ownerState.dense,
|
|
126
|
+
style: {
|
|
127
|
+
paddingTop: 4,
|
|
128
|
+
paddingBottom: 4
|
|
129
|
+
}
|
|
130
|
+
}]
|
|
111
131
|
}));
|
|
112
132
|
const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inProps, ref) {
|
|
113
133
|
const props = (0, _useThemeProps.default)({
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -39,16 +39,20 @@ const ListItemSecondaryActionRoot = (0, _styled.default)('div', {
|
|
|
39
39
|
} = props;
|
|
40
40
|
return [styles.root, ownerState.disableGutters && styles.disableGutters];
|
|
41
41
|
}
|
|
42
|
-
})(
|
|
43
|
-
ownerState
|
|
44
|
-
}) => (0, _extends2.default)({
|
|
42
|
+
})({
|
|
45
43
|
position: 'absolute',
|
|
46
44
|
right: 16,
|
|
47
45
|
top: '50%',
|
|
48
|
-
transform: 'translateY(-50%)'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
transform: 'translateY(-50%)',
|
|
47
|
+
variants: [{
|
|
48
|
+
props: ({
|
|
49
|
+
ownerState
|
|
50
|
+
}) => ownerState.disableGutters,
|
|
51
|
+
style: {
|
|
52
|
+
right: 0
|
|
53
|
+
}
|
|
54
|
+
}]
|
|
55
|
+
});
|
|
52
56
|
|
|
53
57
|
/**
|
|
54
58
|
* Must be used as the last child of ListItem to function properly.
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -49,19 +49,28 @@ const ListItemTextRoot = (0, _styled.default)('div', {
|
|
|
49
49
|
[`& .${_listItemTextClasses.default.secondary}`]: styles.secondary
|
|
50
50
|
}, styles.root, ownerState.inset && styles.inset, ownerState.primary && ownerState.secondary && styles.multiline, ownerState.dense && styles.dense];
|
|
51
51
|
}
|
|
52
|
-
})(
|
|
53
|
-
ownerState
|
|
54
|
-
}) => (0, _extends2.default)({
|
|
52
|
+
})({
|
|
55
53
|
flex: '1 1 auto',
|
|
56
54
|
minWidth: 0,
|
|
57
55
|
marginTop: 4,
|
|
58
|
-
marginBottom: 4
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
marginBottom: 4,
|
|
57
|
+
variants: [{
|
|
58
|
+
props: ({
|
|
59
|
+
ownerState
|
|
60
|
+
}) => ownerState.primary && ownerState.secondary,
|
|
61
|
+
style: {
|
|
62
|
+
marginTop: 6,
|
|
63
|
+
marginBottom: 6
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
props: ({
|
|
67
|
+
ownerState
|
|
68
|
+
}) => ownerState.inset,
|
|
69
|
+
style: {
|
|
70
|
+
paddingLeft: 56
|
|
71
|
+
}
|
|
72
|
+
}]
|
|
73
|
+
});
|
|
65
74
|
const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps, ref) {
|
|
66
75
|
const props = (0, _useThemeProps.default)({
|
|
67
76
|
props: inProps,
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -43,30 +43,55 @@ const ListSubheaderRoot = (0, _styled.default)('li', {
|
|
|
43
43
|
return [styles.root, ownerState.color !== 'default' && styles[`color${(0, _capitalize.default)(ownerState.color)}`], !ownerState.disableGutters && styles.gutters, ownerState.inset && styles.inset, !ownerState.disableSticky && styles.sticky];
|
|
44
44
|
}
|
|
45
45
|
})(({
|
|
46
|
-
theme
|
|
47
|
-
|
|
48
|
-
}) => (0, _extends2.default)({
|
|
46
|
+
theme
|
|
47
|
+
}) => ({
|
|
49
48
|
boxSizing: 'border-box',
|
|
50
49
|
lineHeight: '48px',
|
|
51
50
|
listStyle: 'none',
|
|
52
51
|
color: (theme.vars || theme).palette.text.secondary,
|
|
53
52
|
fontFamily: theme.typography.fontFamily,
|
|
54
53
|
fontWeight: theme.typography.fontWeightMedium,
|
|
55
|
-
fontSize: theme.typography.pxToRem(14)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
fontSize: theme.typography.pxToRem(14),
|
|
55
|
+
variants: [{
|
|
56
|
+
props: {
|
|
57
|
+
color: 'primary'
|
|
58
|
+
},
|
|
59
|
+
style: {
|
|
60
|
+
color: (theme.vars || theme).palette.primary.main
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
props: {
|
|
64
|
+
color: 'inherit'
|
|
65
|
+
},
|
|
66
|
+
style: {
|
|
67
|
+
color: 'inherit'
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
props: ({
|
|
71
|
+
ownerState
|
|
72
|
+
}) => !ownerState.disableGutters,
|
|
73
|
+
style: {
|
|
74
|
+
paddingLeft: 16,
|
|
75
|
+
paddingRight: 16
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
props: ({
|
|
79
|
+
ownerState
|
|
80
|
+
}) => ownerState.inset,
|
|
81
|
+
style: {
|
|
82
|
+
paddingLeft: 72
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
props: ({
|
|
86
|
+
ownerState
|
|
87
|
+
}) => !ownerState.disableSticky,
|
|
88
|
+
style: {
|
|
89
|
+
position: 'sticky',
|
|
90
|
+
top: 0,
|
|
91
|
+
zIndex: 1,
|
|
92
|
+
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
93
|
+
}
|
|
94
|
+
}]
|
|
70
95
|
}));
|
|
71
96
|
const ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inProps, ref) {
|
|
72
97
|
const props = (0, _useThemeProps.default)({
|
package/node/Radio/Radio.js
CHANGED
|
@@ -15,17 +15,18 @@ var _refType = _interopRequireDefault(require("@mui/utils/refType"));
|
|
|
15
15
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
16
16
|
var _colorManipulator = require("@mui/system/colorManipulator");
|
|
17
17
|
var _SwitchBase = _interopRequireDefault(require("../internal/SwitchBase"));
|
|
18
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
19
18
|
var _RadioButtonIcon = _interopRequireDefault(require("./RadioButtonIcon"));
|
|
20
19
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
21
20
|
var _createChainedFunction = _interopRequireDefault(require("../utils/createChainedFunction"));
|
|
22
21
|
var _useRadioGroup = _interopRequireDefault(require("../RadioGroup/useRadioGroup"));
|
|
23
22
|
var _radioClasses = _interopRequireWildcard(require("./radioClasses"));
|
|
24
|
-
var _styled =
|
|
23
|
+
var _styled = require("../styles/styled");
|
|
24
|
+
var _zeroStyled = require("../zero-styled");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
26
|
const _excluded = ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size", "className"];
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiRadio');
|
|
29
30
|
const useUtilityClasses = ownerState => {
|
|
30
31
|
const {
|
|
31
32
|
classes,
|
|
@@ -37,7 +38,7 @@ const useUtilityClasses = ownerState => {
|
|
|
37
38
|
};
|
|
38
39
|
return (0, _extends2.default)({}, classes, (0, _composeClasses.default)(slots, _radioClasses.getRadioUtilityClass, classes));
|
|
39
40
|
};
|
|
40
|
-
const RadioRoot = (0,
|
|
41
|
+
const RadioRoot = (0, _zeroStyled.styled)(_SwitchBase.default, {
|
|
41
42
|
shouldForwardProp: prop => (0, _styled.rootShouldForwardProp)(prop) || prop === 'classes',
|
|
42
43
|
name: 'MuiRadio',
|
|
43
44
|
slot: 'Root',
|
|
@@ -48,26 +49,55 @@ const RadioRoot = (0, _styled.default)(_SwitchBase.default, {
|
|
|
48
49
|
return [styles.root, ownerState.size !== 'medium' && styles[`size${(0, _capitalize.default)(ownerState.size)}`], styles[`color${(0, _capitalize.default)(ownerState.color)}`]];
|
|
49
50
|
}
|
|
50
51
|
})(({
|
|
51
|
-
theme
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
color: (theme.vars || theme).palette.text.secondary
|
|
55
|
-
}, !ownerState.disableRipple && {
|
|
56
|
-
'&:hover': {
|
|
57
|
-
backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
58
|
-
// Reset on touch devices, it doesn't add specificity
|
|
59
|
-
'@media (hover: none)': {
|
|
60
|
-
backgroundColor: 'transparent'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}, ownerState.color !== 'default' && {
|
|
64
|
-
[`&.${_radioClasses.default.checked}`]: {
|
|
65
|
-
color: (theme.vars || theme).palette[ownerState.color].main
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
52
|
+
theme
|
|
53
|
+
}) => ({
|
|
54
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
68
55
|
[`&.${_radioClasses.default.disabled}`]: {
|
|
69
56
|
color: (theme.vars || theme).palette.action.disabled
|
|
70
|
-
}
|
|
57
|
+
},
|
|
58
|
+
variants: [{
|
|
59
|
+
props: {
|
|
60
|
+
color: 'default',
|
|
61
|
+
disableRipple: false
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
'&:hover': {
|
|
65
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette.action.active, theme.palette.action.hoverOpacity)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
|
|
69
|
+
props: {
|
|
70
|
+
color,
|
|
71
|
+
disableRipple: false
|
|
72
|
+
},
|
|
73
|
+
style: {
|
|
74
|
+
'&:hover': {
|
|
75
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
})), ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
|
|
79
|
+
props: {
|
|
80
|
+
color
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
[`&.${_radioClasses.default.checked}`]: {
|
|
84
|
+
color: (theme.vars || theme).palette[color].main
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})), {
|
|
88
|
+
// Should be last to override other colors
|
|
89
|
+
props: {
|
|
90
|
+
disableRipple: false
|
|
91
|
+
},
|
|
92
|
+
style: {
|
|
93
|
+
// Reset on touch devices, it doesn't add specificity
|
|
94
|
+
'&:hover': {
|
|
95
|
+
'@media (hover: none)': {
|
|
96
|
+
backgroundColor: 'transparent'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}]
|
|
71
101
|
}));
|
|
72
102
|
function areEqualValues(a, b) {
|
|
73
103
|
if (typeof b === 'object' && b !== null) {
|
|
@@ -83,7 +113,7 @@ const defaultCheckedIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadioButtonIcon.de
|
|
|
83
113
|
const defaultIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadioButtonIcon.default, {});
|
|
84
114
|
const Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) {
|
|
85
115
|
var _defaultIcon$props$fo, _defaultCheckedIcon$p;
|
|
86
|
-
const props = (
|
|
116
|
+
const props = useThemeProps({
|
|
87
117
|
props: inProps,
|
|
88
118
|
name: 'MuiRadio'
|
|
89
119
|
});
|
|
@@ -11,37 +11,43 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _RadioButtonUnchecked = _interopRequireDefault(require("../internal/svg-icons/RadioButtonUnchecked"));
|
|
13
13
|
var _RadioButtonChecked = _interopRequireDefault(require("../internal/svg-icons/RadioButtonChecked"));
|
|
14
|
-
var _styled =
|
|
14
|
+
var _styled = require("../styles/styled");
|
|
15
|
+
var _zeroStyled = require("../zero-styled");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
const RadioButtonIconRoot = (0,
|
|
19
|
+
const RadioButtonIconRoot = (0, _zeroStyled.styled)('span', {
|
|
19
20
|
shouldForwardProp: _styled.rootShouldForwardProp
|
|
20
21
|
})({
|
|
21
22
|
position: 'relative',
|
|
22
23
|
display: 'flex'
|
|
23
24
|
});
|
|
24
|
-
const RadioButtonIconBackground = (0,
|
|
25
|
+
const RadioButtonIconBackground = (0, _zeroStyled.styled)(_RadioButtonUnchecked.default)({
|
|
25
26
|
// Scale applied to prevent dot misalignment in Safari
|
|
26
27
|
transform: 'scale(1)'
|
|
27
28
|
});
|
|
28
|
-
const RadioButtonIconDot = (0,
|
|
29
|
-
theme
|
|
30
|
-
|
|
31
|
-
}) => (0, _extends2.default)({
|
|
29
|
+
const RadioButtonIconDot = (0, _zeroStyled.styled)(_RadioButtonChecked.default)(({
|
|
30
|
+
theme
|
|
31
|
+
}) => ({
|
|
32
32
|
left: 0,
|
|
33
33
|
position: 'absolute',
|
|
34
34
|
transform: 'scale(0)',
|
|
35
35
|
transition: theme.transitions.create('transform', {
|
|
36
36
|
easing: theme.transitions.easing.easeIn,
|
|
37
37
|
duration: theme.transitions.duration.shortest
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
}),
|
|
39
|
+
variants: [{
|
|
40
|
+
props: {
|
|
41
|
+
checked: true
|
|
42
|
+
},
|
|
43
|
+
style: {
|
|
44
|
+
transform: 'scale(1)',
|
|
45
|
+
transition: theme.transitions.create('transform', {
|
|
46
|
+
easing: theme.transitions.easing.easeOut,
|
|
47
|
+
duration: theme.transitions.duration.shortest
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
}]
|
|
45
51
|
}));
|
|
46
52
|
|
|
47
53
|
/**
|
|
@@ -70,7 +76,7 @@ function RadioButtonIcon(props) {
|
|
|
70
76
|
})]
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
|
-
process.env.NODE_ENV !== "production" ? RadioButtonIcon.propTypes = {
|
|
79
|
+
process.env.NODE_ENV !== "production" ? RadioButtonIcon.propTypes /* remove-proptypes */ = {
|
|
74
80
|
/**
|
|
75
81
|
* If `true`, the component is checked.
|
|
76
82
|
*/
|
package/node/Rating/Rating.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
@@ -74,9 +74,8 @@ const RatingRoot = (0, _styled.default)('span', {
|
|
|
74
74
|
}, styles.root, styles[`size${(0, _utils.capitalize)(ownerState.size)}`], ownerState.readOnly && styles.readOnly];
|
|
75
75
|
}
|
|
76
76
|
})(({
|
|
77
|
-
theme
|
|
78
|
-
|
|
79
|
-
}) => (0, _extends2.default)({
|
|
77
|
+
theme
|
|
78
|
+
}) => ({
|
|
80
79
|
display: 'inline-flex',
|
|
81
80
|
// Required to position the pristine input absolutely
|
|
82
81
|
position: 'relative',
|
|
@@ -93,13 +92,30 @@ const RatingRoot = (0, _styled.default)('span', {
|
|
|
93
92
|
[`&.${_ratingClasses.default.focusVisible} .${_ratingClasses.default.iconActive}`]: {
|
|
94
93
|
outline: '1px solid #999'
|
|
95
94
|
},
|
|
96
|
-
[`& .${_ratingClasses.default.visuallyHidden}`]: _visuallyHidden.default
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
[`& .${_ratingClasses.default.visuallyHidden}`]: _visuallyHidden.default,
|
|
96
|
+
variants: [{
|
|
97
|
+
props: {
|
|
98
|
+
size: 'small'
|
|
99
|
+
},
|
|
100
|
+
style: {
|
|
101
|
+
fontSize: theme.typography.pxToRem(18)
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
props: {
|
|
105
|
+
size: 'large'
|
|
106
|
+
},
|
|
107
|
+
style: {
|
|
108
|
+
fontSize: theme.typography.pxToRem(30)
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
// TODO v6: use the .Mui-readOnly global state class
|
|
112
|
+
props: ({
|
|
113
|
+
ownerState
|
|
114
|
+
}) => ownerState.readOnly,
|
|
115
|
+
style: {
|
|
116
|
+
pointerEvents: 'none'
|
|
117
|
+
}
|
|
118
|
+
}]
|
|
103
119
|
}));
|
|
104
120
|
const RatingLabel = (0, _styled.default)('label', {
|
|
105
121
|
name: 'MuiRating',
|
|
@@ -107,17 +123,21 @@ const RatingLabel = (0, _styled.default)('label', {
|
|
|
107
123
|
overridesResolver: ({
|
|
108
124
|
ownerState
|
|
109
125
|
}, styles) => [styles.label, ownerState.emptyValueFocused && styles.labelEmptyValueActive]
|
|
110
|
-
})(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
})({
|
|
127
|
+
cursor: 'inherit',
|
|
128
|
+
variants: [{
|
|
129
|
+
props: ({
|
|
130
|
+
ownerState
|
|
131
|
+
}) => ownerState.emptyValueFocused,
|
|
132
|
+
style: {
|
|
133
|
+
top: 0,
|
|
134
|
+
bottom: 0,
|
|
135
|
+
position: 'absolute',
|
|
136
|
+
outline: '1px solid #999',
|
|
137
|
+
width: '100%'
|
|
138
|
+
}
|
|
139
|
+
}]
|
|
140
|
+
});
|
|
121
141
|
const RatingIcon = (0, _styled.default)('span', {
|
|
122
142
|
name: 'MuiRating',
|
|
123
143
|
slot: 'Icon',
|
|
@@ -128,9 +148,8 @@ const RatingIcon = (0, _styled.default)('span', {
|
|
|
128
148
|
return [styles.icon, ownerState.iconEmpty && styles.iconEmpty, ownerState.iconFilled && styles.iconFilled, ownerState.iconHover && styles.iconHover, ownerState.iconFocus && styles.iconFocus, ownerState.iconActive && styles.iconActive];
|
|
129
149
|
}
|
|
130
150
|
})(({
|
|
131
|
-
theme
|
|
132
|
-
|
|
133
|
-
}) => (0, _extends2.default)({
|
|
151
|
+
theme
|
|
152
|
+
}) => ({
|
|
134
153
|
// Fit wrapper to actual icon size.
|
|
135
154
|
display: 'flex',
|
|
136
155
|
transition: theme.transitions.create('transform', {
|
|
@@ -138,11 +157,22 @@ const RatingIcon = (0, _styled.default)('span', {
|
|
|
138
157
|
}),
|
|
139
158
|
// Fix mouseLeave issue.
|
|
140
159
|
// https://github.com/facebook/react/issues/4492
|
|
141
|
-
pointerEvents: 'none'
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
160
|
+
pointerEvents: 'none',
|
|
161
|
+
variants: [{
|
|
162
|
+
props: ({
|
|
163
|
+
ownerState
|
|
164
|
+
}) => ownerState.iconActive,
|
|
165
|
+
style: {
|
|
166
|
+
transform: 'scale(1.2)'
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
props: ({
|
|
170
|
+
ownerState
|
|
171
|
+
}) => ownerState.iconEmpty,
|
|
172
|
+
style: {
|
|
173
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
174
|
+
}
|
|
175
|
+
}]
|
|
146
176
|
}));
|
|
147
177
|
const RatingDecimal = (0, _styled.default)('span', {
|
|
148
178
|
name: 'MuiRating',
|
|
@@ -154,13 +184,17 @@ const RatingDecimal = (0, _styled.default)('span', {
|
|
|
154
184
|
} = props;
|
|
155
185
|
return [styles.decimal, iconActive && styles.iconActive];
|
|
156
186
|
}
|
|
157
|
-
})(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
187
|
+
})({
|
|
188
|
+
position: 'relative',
|
|
189
|
+
variants: [{
|
|
190
|
+
props: ({
|
|
191
|
+
iconActive
|
|
192
|
+
}) => iconActive,
|
|
193
|
+
style: {
|
|
194
|
+
transform: 'scale(1.2)'
|
|
195
|
+
}
|
|
196
|
+
}]
|
|
197
|
+
});
|
|
164
198
|
function IconContainer(props) {
|
|
165
199
|
const other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
166
200
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", (0, _extends2.default)({}, other));
|
package/node/Table/Table.js
CHANGED
|
@@ -40,9 +40,8 @@ const TableRoot = (0, _styled.default)('table', {
|
|
|
40
40
|
return [styles.root, ownerState.stickyHeader && styles.stickyHeader];
|
|
41
41
|
}
|
|
42
42
|
})(({
|
|
43
|
-
theme
|
|
44
|
-
|
|
45
|
-
}) => (0, _extends2.default)({
|
|
43
|
+
theme
|
|
44
|
+
}) => ({
|
|
46
45
|
display: 'table',
|
|
47
46
|
width: '100%',
|
|
48
47
|
borderCollapse: 'collapse',
|
|
@@ -52,9 +51,15 @@ const TableRoot = (0, _styled.default)('table', {
|
|
|
52
51
|
color: (theme.vars || theme).palette.text.secondary,
|
|
53
52
|
textAlign: 'left',
|
|
54
53
|
captionSide: 'bottom'
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
}),
|
|
55
|
+
variants: [{
|
|
56
|
+
props: ({
|
|
57
|
+
ownerState
|
|
58
|
+
}) => ownerState.stickyHeader,
|
|
59
|
+
style: {
|
|
60
|
+
borderCollapse: 'separate'
|
|
61
|
+
}
|
|
62
|
+
}]
|
|
58
63
|
}));
|
|
59
64
|
const defaultComponent = 'table';
|
|
60
65
|
const Table = /*#__PURE__*/React.forwardRef(function Table(inProps, ref) {
|