@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
package/TableCell/TableCell.js
CHANGED
|
@@ -39,8 +39,7 @@ const TableCellRoot = styled('td', {
|
|
|
39
39
|
return [styles.root, styles[ownerState.variant], styles[`size${capitalize(ownerState.size)}`], ownerState.padding !== 'normal' && styles[`padding${capitalize(ownerState.padding)}`], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.stickyHeader && styles.stickyHeader];
|
|
40
40
|
}
|
|
41
41
|
})(({
|
|
42
|
-
theme
|
|
43
|
-
ownerState
|
|
42
|
+
theme
|
|
44
43
|
}) => _extends({}, theme.typography.body2, {
|
|
45
44
|
display: 'table-cell',
|
|
46
45
|
verticalAlign: 'inherit',
|
|
@@ -49,47 +48,103 @@ const TableCellRoot = styled('td', {
|
|
|
49
48
|
borderBottom: theme.vars ? `1px solid ${theme.vars.palette.TableCell.border}` : `1px solid
|
|
50
49
|
${theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)}`,
|
|
51
50
|
textAlign: 'left',
|
|
52
|
-
padding: 16
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
padding: 16,
|
|
52
|
+
variants: [{
|
|
53
|
+
props: {
|
|
54
|
+
variant: 'head'
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
58
|
+
lineHeight: theme.typography.pxToRem(24),
|
|
59
|
+
fontWeight: theme.typography.fontWeightMedium
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
props: {
|
|
63
|
+
variant: 'body'
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
color: (theme.vars || theme).palette.text.primary
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
props: {
|
|
70
|
+
variant: 'footer'
|
|
71
|
+
},
|
|
72
|
+
style: {
|
|
73
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
74
|
+
lineHeight: theme.typography.pxToRem(21),
|
|
75
|
+
fontSize: theme.typography.pxToRem(12)
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
props: {
|
|
79
|
+
size: 'small'
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
padding: '6px 16px',
|
|
83
|
+
[`&.${tableCellClasses.paddingCheckbox}`]: {
|
|
84
|
+
width: 24,
|
|
85
|
+
// prevent the checkbox column from growing
|
|
86
|
+
padding: '0 12px 0 16px',
|
|
87
|
+
'& > *': {
|
|
88
|
+
padding: 0
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
props: {
|
|
94
|
+
padding: 'checkbox'
|
|
95
|
+
},
|
|
96
|
+
style: {
|
|
97
|
+
width: 48,
|
|
98
|
+
// prevent the checkbox column from growing
|
|
99
|
+
padding: '0 0 0 4px'
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
props: {
|
|
103
|
+
padding: 'none'
|
|
104
|
+
},
|
|
105
|
+
style: {
|
|
70
106
|
padding: 0
|
|
71
107
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
108
|
+
}, {
|
|
109
|
+
props: {
|
|
110
|
+
align: 'left'
|
|
111
|
+
},
|
|
112
|
+
style: {
|
|
113
|
+
textAlign: 'left'
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
props: {
|
|
117
|
+
align: 'center'
|
|
118
|
+
},
|
|
119
|
+
style: {
|
|
120
|
+
textAlign: 'center'
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
props: {
|
|
124
|
+
align: 'right'
|
|
125
|
+
},
|
|
126
|
+
style: {
|
|
127
|
+
textAlign: 'right',
|
|
128
|
+
flexDirection: 'row-reverse'
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
props: {
|
|
132
|
+
align: 'justify'
|
|
133
|
+
},
|
|
134
|
+
style: {
|
|
135
|
+
textAlign: 'justify'
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
props: ({
|
|
139
|
+
ownerState
|
|
140
|
+
}) => ownerState.stickyHeader,
|
|
141
|
+
style: {
|
|
142
|
+
position: 'sticky',
|
|
143
|
+
top: 0,
|
|
144
|
+
zIndex: 2,
|
|
145
|
+
backgroundColor: (theme.vars || theme).palette.background.default
|
|
146
|
+
}
|
|
147
|
+
}]
|
|
93
148
|
}));
|
|
94
149
|
|
|
95
150
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["active", "children", "className", "direction", "hideSortIcon", "IconComponent"];
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -70,9 +70,8 @@ const TableSortLabelIcon = styled('span', {
|
|
|
70
70
|
return [styles.icon, styles[`iconDirection${capitalize(ownerState.direction)}`]];
|
|
71
71
|
}
|
|
72
72
|
})(({
|
|
73
|
-
theme
|
|
74
|
-
|
|
75
|
-
}) => _extends({
|
|
73
|
+
theme
|
|
74
|
+
}) => ({
|
|
76
75
|
fontSize: 18,
|
|
77
76
|
marginRight: 4,
|
|
78
77
|
marginLeft: 4,
|
|
@@ -80,11 +79,22 @@ const TableSortLabelIcon = styled('span', {
|
|
|
80
79
|
transition: theme.transitions.create(['opacity', 'transform'], {
|
|
81
80
|
duration: theme.transitions.duration.shorter
|
|
82
81
|
}),
|
|
83
|
-
userSelect: 'none'
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
userSelect: 'none',
|
|
83
|
+
variants: [{
|
|
84
|
+
props: {
|
|
85
|
+
direction: 'desc'
|
|
86
|
+
},
|
|
87
|
+
style: {
|
|
88
|
+
transform: 'rotate(0deg)'
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
props: {
|
|
92
|
+
direction: 'asc'
|
|
93
|
+
},
|
|
94
|
+
style: {
|
|
95
|
+
transform: 'rotate(180deg)'
|
|
96
|
+
}
|
|
97
|
+
}]
|
|
88
98
|
}));
|
|
89
99
|
|
|
90
100
|
/**
|
package/Toolbar/Toolbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["className", "component", "disableGutters", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -32,25 +32,41 @@ const ToolbarRoot = styled('div', {
|
|
|
32
32
|
return [styles.root, !ownerState.disableGutters && styles.gutters, styles[ownerState.variant]];
|
|
33
33
|
}
|
|
34
34
|
})(({
|
|
35
|
-
theme
|
|
36
|
-
|
|
37
|
-
}) => _extends({
|
|
35
|
+
theme
|
|
36
|
+
}) => ({
|
|
38
37
|
position: 'relative',
|
|
39
38
|
display: 'flex',
|
|
40
|
-
alignItems: 'center'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
variants: [{
|
|
41
|
+
props: ({
|
|
42
|
+
ownerState
|
|
43
|
+
}) => !ownerState.disableGutters,
|
|
44
|
+
style: {
|
|
45
|
+
paddingLeft: theme.spacing(2),
|
|
46
|
+
paddingRight: theme.spacing(2),
|
|
47
|
+
[theme.breakpoints.up('sm')]: {
|
|
48
|
+
paddingLeft: theme.spacing(3),
|
|
49
|
+
paddingRight: theme.spacing(3)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
props: {
|
|
54
|
+
variant: 'dense'
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
minHeight: 48
|
|
58
|
+
}
|
|
59
|
+
}]
|
|
50
60
|
}), ({
|
|
51
|
-
theme
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
theme
|
|
62
|
+
}) => ({
|
|
63
|
+
variants: [{
|
|
64
|
+
props: {
|
|
65
|
+
variant: 'regular'
|
|
66
|
+
},
|
|
67
|
+
style: theme.mixins.toolbar
|
|
68
|
+
}]
|
|
69
|
+
}));
|
|
54
70
|
const Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {
|
|
55
71
|
const props = useThemeProps({
|
|
56
72
|
props: inProps,
|
package/Typography/Typography.js
CHANGED
|
@@ -118,9 +118,10 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
|
|
|
118
118
|
return /*#__PURE__*/_jsx(TypographyRoot, _extends({
|
|
119
119
|
as: Component,
|
|
120
120
|
ref: ref,
|
|
121
|
-
ownerState: ownerState,
|
|
122
121
|
className: clsx(classes.root, className)
|
|
123
|
-
}, other
|
|
122
|
+
}, other, {
|
|
123
|
+
ownerState: ownerState
|
|
124
|
+
}));
|
|
124
125
|
});
|
|
125
126
|
process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
|
|
126
127
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
package/index.js
CHANGED
|
@@ -14,10 +14,11 @@ import CheckBoxOutlineBlankIcon from '../internal/svg-icons/CheckBoxOutlineBlank
|
|
|
14
14
|
import CheckBoxIcon from '../internal/svg-icons/CheckBox';
|
|
15
15
|
import IndeterminateCheckBoxIcon from '../internal/svg-icons/IndeterminateCheckBox';
|
|
16
16
|
import capitalize from '../utils/capitalize';
|
|
17
|
-
import
|
|
18
|
-
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
17
|
+
import rootShouldForwardProp from '../styles/rootShouldForwardProp';
|
|
19
18
|
import checkboxClasses, { getCheckboxUtilityClass } from './checkboxClasses';
|
|
19
|
+
import { createUseThemeProps, styled } from '../zero-styled';
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
const useThemeProps = createUseThemeProps('MuiCheckbox');
|
|
21
22
|
const useUtilityClasses = ownerState => {
|
|
22
23
|
const {
|
|
23
24
|
classes,
|
|
@@ -42,25 +43,55 @@ const CheckboxRoot = styled(SwitchBase, {
|
|
|
42
43
|
return [styles.root, ownerState.indeterminate && styles.indeterminate, styles[`size${capitalize(ownerState.size)}`], ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];
|
|
43
44
|
}
|
|
44
45
|
})(({
|
|
45
|
-
theme
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
theme
|
|
47
|
+
}) => ({
|
|
48
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
49
|
+
variants: [{
|
|
50
|
+
props: {
|
|
51
|
+
color: 'default',
|
|
52
|
+
disableRipple: false
|
|
53
|
+
},
|
|
54
|
+
style: {
|
|
55
|
+
'&:hover': {
|
|
56
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)
|
|
57
|
+
}
|
|
55
58
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
}, ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
|
|
60
|
+
props: {
|
|
61
|
+
color,
|
|
62
|
+
disableRipple: false
|
|
63
|
+
},
|
|
64
|
+
style: {
|
|
65
|
+
'&:hover': {
|
|
66
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
})), ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
|
|
70
|
+
props: {
|
|
71
|
+
color
|
|
72
|
+
},
|
|
73
|
+
style: {
|
|
74
|
+
[`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]: {
|
|
75
|
+
color: (theme.vars || theme).palette[color].main
|
|
76
|
+
},
|
|
77
|
+
[`&.${checkboxClasses.disabled}`]: {
|
|
78
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
})), {
|
|
82
|
+
// Should be last to override other colors
|
|
83
|
+
props: {
|
|
84
|
+
disableRipple: false
|
|
85
|
+
},
|
|
86
|
+
style: {
|
|
87
|
+
// Reset on touch devices, it doesn't add specificity
|
|
88
|
+
'&:hover': {
|
|
89
|
+
'@media (hover: none)': {
|
|
90
|
+
backgroundColor: 'transparent'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}]
|
|
64
95
|
}));
|
|
65
96
|
const defaultCheckedIcon = /*#__PURE__*/_jsx(CheckBoxIcon, {});
|
|
66
97
|
const defaultIcon = /*#__PURE__*/_jsx(CheckBoxOutlineBlankIcon, {});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"];
|
|
5
|
+
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slots", "slotProps", "value"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -15,6 +15,7 @@ import Typography from '../Typography';
|
|
|
15
15
|
import capitalize from '../utils/capitalize';
|
|
16
16
|
import formControlLabelClasses, { getFormControlLabelUtilityClasses } from './formControlLabelClasses';
|
|
17
17
|
import formControlState from '../FormControl/formControlState';
|
|
18
|
+
import useSlot from '../utils/useSlot';
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const useThemeProps = createUseThemeProps('MuiFormControlLabel');
|
|
20
21
|
const useUtilityClasses = ownerState => {
|
|
@@ -124,6 +125,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
124
125
|
label: labelProp,
|
|
125
126
|
labelPlacement = 'end',
|
|
126
127
|
required: requiredProp,
|
|
128
|
+
slots = {},
|
|
127
129
|
slotProps = {}
|
|
128
130
|
} = props,
|
|
129
131
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -151,10 +153,18 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
151
153
|
error: fcs.error
|
|
152
154
|
});
|
|
153
155
|
const classes = useUtilityClasses(ownerState);
|
|
154
|
-
const
|
|
156
|
+
const externalForwardedProps = {
|
|
157
|
+
slots,
|
|
158
|
+
slotProps: _extends({}, componentsProps, slotProps)
|
|
159
|
+
};
|
|
160
|
+
const [TypographySlot, typographySlotProps] = useSlot('typography', {
|
|
161
|
+
elementType: Typography,
|
|
162
|
+
externalForwardedProps,
|
|
163
|
+
ownerState
|
|
164
|
+
});
|
|
155
165
|
let label = labelProp;
|
|
156
166
|
if (label != null && label.type !== Typography && !disableTypography) {
|
|
157
|
-
label = /*#__PURE__*/_jsx(
|
|
167
|
+
label = /*#__PURE__*/_jsx(TypographySlot, _extends({
|
|
158
168
|
component: "span"
|
|
159
169
|
}, typographySlotProps, {
|
|
160
170
|
className: clsx(classes.label, typographySlotProps?.className),
|
|
@@ -197,6 +207,7 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
197
207
|
/**
|
|
198
208
|
* The props used for each slot inside.
|
|
199
209
|
* @default {}
|
|
210
|
+
* @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
|
|
200
211
|
*/
|
|
201
212
|
componentsProps: PropTypes.shape({
|
|
202
213
|
typography: PropTypes.object
|
|
@@ -246,7 +257,14 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
246
257
|
* @default {}
|
|
247
258
|
*/
|
|
248
259
|
slotProps: PropTypes.shape({
|
|
249
|
-
typography: PropTypes.object
|
|
260
|
+
typography: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
261
|
+
}),
|
|
262
|
+
/**
|
|
263
|
+
* The components used for each slot inside.
|
|
264
|
+
* @default {}
|
|
265
|
+
*/
|
|
266
|
+
slots: PropTypes.shape({
|
|
267
|
+
typography: PropTypes.elementType
|
|
250
268
|
}),
|
|
251
269
|
/**
|
|
252
270
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
@@ -41,8 +41,7 @@ const FormHelperTextRoot = styled('p', {
|
|
|
41
41
|
return [styles.root, ownerState.size && styles[`size${capitalize(ownerState.size)}`], ownerState.contained && styles.contained, ownerState.filled && styles.filled];
|
|
42
42
|
}
|
|
43
43
|
})(({
|
|
44
|
-
theme
|
|
45
|
-
ownerState
|
|
44
|
+
theme
|
|
46
45
|
}) => _extends({
|
|
47
46
|
color: (theme.vars || theme).palette.text.secondary
|
|
48
47
|
}, theme.typography.caption, {
|
|
@@ -56,12 +55,23 @@ const FormHelperTextRoot = styled('p', {
|
|
|
56
55
|
},
|
|
57
56
|
[`&.${formHelperTextClasses.error}`]: {
|
|
58
57
|
color: (theme.vars || theme).palette.error.main
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
},
|
|
59
|
+
variants: [{
|
|
60
|
+
props: {
|
|
61
|
+
size: 'small'
|
|
62
|
+
},
|
|
63
|
+
style: {
|
|
64
|
+
marginTop: 4
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
props: ({
|
|
68
|
+
ownerState
|
|
69
|
+
}) => ownerState.contained,
|
|
70
|
+
style: {
|
|
71
|
+
marginLeft: 14,
|
|
72
|
+
marginRight: 14
|
|
73
|
+
}
|
|
74
|
+
}]
|
|
65
75
|
}));
|
|
66
76
|
const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inProps, ref) {
|
|
67
77
|
const props = useThemeProps({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -9,12 +9,12 @@ import clsx from 'clsx';
|
|
|
9
9
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import { alpha } from '@mui/system/colorManipulator';
|
|
12
|
-
import styled from '../
|
|
13
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
13
|
import ButtonBase from '../ButtonBase';
|
|
15
14
|
import capitalize from '../utils/capitalize';
|
|
16
15
|
import iconButtonClasses, { getIconButtonUtilityClass } from './iconButtonClasses';
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const useThemeProps = createUseThemeProps('MuiIconButton');
|
|
18
18
|
const useUtilityClasses = ownerState => {
|
|
19
19
|
const {
|
|
20
20
|
classes,
|
|
@@ -38,9 +38,8 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
38
38
|
return [styles.root, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`], ownerState.edge && styles[`edge${capitalize(ownerState.edge)}`], styles[`size${capitalize(ownerState.size)}`]];
|
|
39
39
|
}
|
|
40
40
|
})(({
|
|
41
|
-
theme
|
|
42
|
-
|
|
43
|
-
}) => _extends({
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
44
43
|
textAlign: 'center',
|
|
45
44
|
flex: '0 0 auto',
|
|
46
45
|
fontSize: theme.typography.pxToRem(24),
|
|
@@ -51,49 +50,107 @@ const IconButtonRoot = styled(ButtonBase, {
|
|
|
51
50
|
color: (theme.vars || theme).palette.action.active,
|
|
52
51
|
transition: theme.transitions.create('background-color', {
|
|
53
52
|
duration: theme.transitions.duration.shortest
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
}),
|
|
54
|
+
variants: [{
|
|
55
|
+
props: {
|
|
56
|
+
disableRipple: false
|
|
57
|
+
},
|
|
58
|
+
style: {
|
|
59
|
+
'&:hover': {
|
|
60
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
61
|
+
// Reset on touch devices, it doesn't add specificity
|
|
62
|
+
'@media (hover: none)': {
|
|
63
|
+
backgroundColor: 'transparent'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
61
66
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
+
}, {
|
|
68
|
+
props: {
|
|
69
|
+
edge: 'start'
|
|
70
|
+
},
|
|
71
|
+
style: {
|
|
72
|
+
marginLeft: -12
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
props: {
|
|
76
|
+
edge: 'start',
|
|
77
|
+
size: 'small'
|
|
78
|
+
},
|
|
79
|
+
style: {
|
|
80
|
+
marginLeft: -3
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
props: {
|
|
84
|
+
edge: 'end'
|
|
85
|
+
},
|
|
86
|
+
style: {
|
|
87
|
+
marginRight: -12
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
props: {
|
|
91
|
+
edge: 'end',
|
|
92
|
+
size: 'small'
|
|
93
|
+
},
|
|
94
|
+
style: {
|
|
95
|
+
marginRight: -3
|
|
96
|
+
}
|
|
97
|
+
}]
|
|
67
98
|
}), ({
|
|
68
|
-
theme
|
|
69
|
-
ownerState
|
|
99
|
+
theme
|
|
70
100
|
}) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
return {
|
|
102
|
+
variants: [{
|
|
103
|
+
props: {
|
|
104
|
+
color: 'inherit'
|
|
105
|
+
},
|
|
106
|
+
style: {
|
|
107
|
+
color: 'inherit'
|
|
108
|
+
}
|
|
109
|
+
}, ...Object.entries(theme.palette).filter(([, value]) => value.main) // check all the used fields in the style below
|
|
110
|
+
.map(([color]) => ({
|
|
111
|
+
props: {
|
|
112
|
+
color
|
|
113
|
+
},
|
|
114
|
+
style: {
|
|
115
|
+
color: (theme.vars || theme).palette[color].main
|
|
116
|
+
}
|
|
117
|
+
})), ...Object.entries(theme.palette).filter(([, value]) => value.main) // check all the used fields in the style below
|
|
118
|
+
.map(([color]) => ({
|
|
119
|
+
props: {
|
|
120
|
+
color,
|
|
121
|
+
disableRipple: false
|
|
122
|
+
},
|
|
123
|
+
style: {
|
|
124
|
+
'&:hover': {
|
|
125
|
+
backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
|
|
126
|
+
// Reset on touch devices, it doesn't add specificity
|
|
127
|
+
'@media (hover: none)': {
|
|
128
|
+
backgroundColor: 'transparent'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
})), {
|
|
133
|
+
props: {
|
|
134
|
+
size: 'small'
|
|
135
|
+
},
|
|
136
|
+
style: {
|
|
137
|
+
padding: 5,
|
|
138
|
+
fontSize: theme.typography.pxToRem(18)
|
|
139
|
+
}
|
|
79
140
|
}, {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
141
|
+
props: {
|
|
142
|
+
size: 'large'
|
|
143
|
+
},
|
|
144
|
+
style: {
|
|
145
|
+
padding: 12,
|
|
146
|
+
fontSize: theme.typography.pxToRem(28)
|
|
83
147
|
}
|
|
84
|
-
}
|
|
85
|
-
}), ownerState.size === 'small' && {
|
|
86
|
-
padding: 5,
|
|
87
|
-
fontSize: theme.typography.pxToRem(18)
|
|
88
|
-
}, ownerState.size === 'large' && {
|
|
89
|
-
padding: 12,
|
|
90
|
-
fontSize: theme.typography.pxToRem(28)
|
|
91
|
-
}, {
|
|
148
|
+
}],
|
|
92
149
|
[`&.${iconButtonClasses.disabled}`]: {
|
|
93
150
|
backgroundColor: 'transparent',
|
|
94
151
|
color: (theme.vars || theme).palette.action.disabled
|
|
95
152
|
}
|
|
96
|
-
}
|
|
153
|
+
};
|
|
97
154
|
});
|
|
98
155
|
|
|
99
156
|
/**
|