@mui/material 6.0.0-alpha.3 → 6.0.0-alpha.5
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 +93 -0
- package/Checkbox/Checkbox.js +51 -20
- package/FormControlLabel/FormControlLabel.d.ts +21 -14
- package/FormControlLabel/FormControlLabel.js +22 -4
- 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/PaginationItem/PaginationItem.d.ts +26 -14
- package/PaginationItem/PaginationItem.js +64 -20
- package/Radio/Radio.js +50 -20
- package/Radio/RadioButtonIcon.js +18 -12
- package/Rating/Rating.js +71 -37
- package/SvgIcon/SvgIcon.js +73 -21
- 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/FormControlLabel/FormControlLabel.js +22 -4
- 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/PaginationItem/PaginationItem.js +64 -20
- package/modern/Radio/Radio.js +50 -20
- package/modern/Radio/RadioButtonIcon.js +18 -12
- package/modern/Rating/Rating.js +71 -37
- package/modern/SvgIcon/SvgIcon.js +73 -21
- 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/FormControlLabel/FormControlLabel.js +23 -5
- 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/PaginationItem/PaginationItem.js +65 -20
- package/node/Radio/Radio.js +52 -22
- package/node/Radio/RadioButtonIcon.js +21 -15
- package/node/Rating/Rating.js +71 -37
- package/node/SvgIcon/SvgIcon.js +79 -24
- 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 +6 -6
- 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 +1223 -583
- 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)({
|
|
@@ -21,9 +21,10 @@ var _FirstPage = _interopRequireDefault(require("../internal/svg-icons/FirstPage
|
|
|
21
21
|
var _LastPage = _interopRequireDefault(require("../internal/svg-icons/LastPage"));
|
|
22
22
|
var _NavigateBefore = _interopRequireDefault(require("../internal/svg-icons/NavigateBefore"));
|
|
23
23
|
var _NavigateNext = _interopRequireDefault(require("../internal/svg-icons/NavigateNext"));
|
|
24
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
24
25
|
var _zeroStyled = require("../zero-styled");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
|
|
27
|
+
const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "slotProps", "type", "variant"];
|
|
27
28
|
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
29
|
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
30
|
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiPaginationItem');
|
|
@@ -274,6 +275,7 @@ const PaginationItemPageIcon = (0, _zeroStyled.styled)('div', {
|
|
|
274
275
|
}]
|
|
275
276
|
}));
|
|
276
277
|
const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inProps, ref) {
|
|
278
|
+
var _slots$previous, _slots$next, _slots$first, _slots$last;
|
|
277
279
|
const props = useThemeProps({
|
|
278
280
|
props: inProps,
|
|
279
281
|
name: 'MuiPaginationItem'
|
|
@@ -289,6 +291,7 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
289
291
|
shape = 'circular',
|
|
290
292
|
size = 'medium',
|
|
291
293
|
slots = {},
|
|
294
|
+
slotProps = {},
|
|
292
295
|
type = 'page',
|
|
293
296
|
variant = 'text'
|
|
294
297
|
} = props,
|
|
@@ -304,18 +307,53 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
304
307
|
});
|
|
305
308
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
306
309
|
const classes = useUtilityClasses(ownerState);
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
first: slots.first || components.first || _FirstPage.default,
|
|
316
|
-
last: slots.last || components.last || _LastPage.default
|
|
310
|
+
const externalForwardedProps = {
|
|
311
|
+
slots: {
|
|
312
|
+
previous: (_slots$previous = slots.previous) != null ? _slots$previous : components.previous,
|
|
313
|
+
next: (_slots$next = slots.next) != null ? _slots$next : components.next,
|
|
314
|
+
first: (_slots$first = slots.first) != null ? _slots$first : components.first,
|
|
315
|
+
last: (_slots$last = slots.last) != null ? _slots$last : components.last
|
|
316
|
+
},
|
|
317
|
+
slotProps
|
|
317
318
|
};
|
|
318
|
-
const
|
|
319
|
+
const [PreviousSlot, previousSlotProps] = (0, _useSlot.default)('previous', {
|
|
320
|
+
elementType: _NavigateBefore.default,
|
|
321
|
+
externalForwardedProps,
|
|
322
|
+
ownerState
|
|
323
|
+
});
|
|
324
|
+
const [NextSlot, nextSlotProps] = (0, _useSlot.default)('next', {
|
|
325
|
+
elementType: _NavigateNext.default,
|
|
326
|
+
externalForwardedProps,
|
|
327
|
+
ownerState
|
|
328
|
+
});
|
|
329
|
+
const [FirstSlot, firstSlotProps] = (0, _useSlot.default)('first', {
|
|
330
|
+
elementType: _FirstPage.default,
|
|
331
|
+
externalForwardedProps,
|
|
332
|
+
ownerState
|
|
333
|
+
});
|
|
334
|
+
const [LastSlot, lastSlotProps] = (0, _useSlot.default)('last', {
|
|
335
|
+
elementType: _LastPage.default,
|
|
336
|
+
externalForwardedProps,
|
|
337
|
+
ownerState
|
|
338
|
+
});
|
|
339
|
+
const rtlAwareType = isRtl ? {
|
|
340
|
+
previous: 'next',
|
|
341
|
+
next: 'previous',
|
|
342
|
+
first: 'last',
|
|
343
|
+
last: 'first'
|
|
344
|
+
}[type] : type;
|
|
345
|
+
const IconSlot = {
|
|
346
|
+
previous: PreviousSlot,
|
|
347
|
+
next: NextSlot,
|
|
348
|
+
first: FirstSlot,
|
|
349
|
+
last: LastSlot
|
|
350
|
+
}[rtlAwareType];
|
|
351
|
+
const iconSlotProps = {
|
|
352
|
+
previous: previousSlotProps,
|
|
353
|
+
next: nextSlotProps,
|
|
354
|
+
first: firstSlotProps,
|
|
355
|
+
last: lastSlotProps
|
|
356
|
+
}[rtlAwareType];
|
|
319
357
|
return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItemEllipsis, {
|
|
320
358
|
ref: ref,
|
|
321
359
|
ownerState: ownerState,
|
|
@@ -328,11 +366,10 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
328
366
|
disabled: disabled,
|
|
329
367
|
className: (0, _clsx.default)(classes.root, className)
|
|
330
368
|
}, other, {
|
|
331
|
-
children: [type === 'page' && page,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}) : null]
|
|
369
|
+
children: [type === 'page' && page, IconSlot ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItemPageIcon, (0, _extends2.default)({}, iconSlotProps, {
|
|
370
|
+
className: classes.icon,
|
|
371
|
+
as: IconSlot
|
|
372
|
+
})) : null]
|
|
336
373
|
}));
|
|
337
374
|
});
|
|
338
375
|
process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-proptypes */ = {
|
|
@@ -371,6 +408,7 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
|
|
|
371
408
|
* It's recommended to use the `slots` prop instead.
|
|
372
409
|
*
|
|
373
410
|
* @default {}
|
|
411
|
+
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
374
412
|
*/
|
|
375
413
|
components: _propTypes.default.shape({
|
|
376
414
|
first: _propTypes.default.elementType,
|
|
@@ -402,11 +440,18 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes /* remove-propt
|
|
|
402
440
|
* @default 'medium'
|
|
403
441
|
*/
|
|
404
442
|
size: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.oneOf(['small', 'medium', 'large']), _propTypes.default.string]),
|
|
443
|
+
/**
|
|
444
|
+
* The props used for each slot inside.
|
|
445
|
+
* @default {}
|
|
446
|
+
*/
|
|
447
|
+
slotProps: _propTypes.default.shape({
|
|
448
|
+
first: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
449
|
+
last: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
450
|
+
next: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
451
|
+
previous: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
452
|
+
}),
|
|
405
453
|
/**
|
|
406
454
|
* The components used for each slot inside.
|
|
407
|
-
*
|
|
408
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
409
|
-
*
|
|
410
455
|
* @default {}
|
|
411
456
|
*/
|
|
412
457
|
slots: _propTypes.default.shape({
|
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
|
*/
|