@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
|
@@ -44,9 +44,8 @@ const ListItemButtonRoot = styled(ButtonBase, {
|
|
|
44
44
|
slot: 'Root',
|
|
45
45
|
overridesResolver
|
|
46
46
|
})(({
|
|
47
|
-
theme
|
|
48
|
-
|
|
49
|
-
}) => _extends({
|
|
47
|
+
theme
|
|
48
|
+
}) => ({
|
|
50
49
|
display: 'flex',
|
|
51
50
|
flexGrow: 1,
|
|
52
51
|
justifyContent: 'flex-start',
|
|
@@ -87,18 +86,39 @@ const ListItemButtonRoot = styled(ButtonBase, {
|
|
|
87
86
|
},
|
|
88
87
|
[`&.${listItemButtonClasses.disabled}`]: {
|
|
89
88
|
opacity: (theme.vars || theme).palette.action.disabledOpacity
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
89
|
+
},
|
|
90
|
+
variants: [{
|
|
91
|
+
props: ({
|
|
92
|
+
ownerState
|
|
93
|
+
}) => ownerState.divider,
|
|
94
|
+
style: {
|
|
95
|
+
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
96
|
+
backgroundClip: 'padding-box'
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
props: {
|
|
100
|
+
alignItems: 'flex-start'
|
|
101
|
+
},
|
|
102
|
+
style: {
|
|
103
|
+
alignItems: 'flex-start'
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
props: ({
|
|
107
|
+
ownerState
|
|
108
|
+
}) => !ownerState.disableGutters,
|
|
109
|
+
style: {
|
|
110
|
+
paddingLeft: 16,
|
|
111
|
+
paddingRight: 16
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
props: ({
|
|
115
|
+
ownerState
|
|
116
|
+
}) => ownerState.dense,
|
|
117
|
+
style: {
|
|
118
|
+
paddingTop: 4,
|
|
119
|
+
paddingBottom: 4
|
|
120
|
+
}
|
|
121
|
+
}]
|
|
102
122
|
}));
|
|
103
123
|
const ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inProps, ref) {
|
|
104
124
|
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 = ["className"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -31,16 +31,20 @@ const ListItemSecondaryActionRoot = styled('div', {
|
|
|
31
31
|
} = props;
|
|
32
32
|
return [styles.root, ownerState.disableGutters && styles.disableGutters];
|
|
33
33
|
}
|
|
34
|
-
})(
|
|
35
|
-
ownerState
|
|
36
|
-
}) => _extends({
|
|
34
|
+
})({
|
|
37
35
|
position: 'absolute',
|
|
38
36
|
right: 16,
|
|
39
37
|
top: '50%',
|
|
40
|
-
transform: 'translateY(-50%)'
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
transform: 'translateY(-50%)',
|
|
39
|
+
variants: [{
|
|
40
|
+
props: ({
|
|
41
|
+
ownerState
|
|
42
|
+
}) => ownerState.disableGutters,
|
|
43
|
+
style: {
|
|
44
|
+
right: 0
|
|
45
|
+
}
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
44
48
|
|
|
45
49
|
/**
|
|
46
50
|
* Must be used as the last child of ListItem to function properly.
|
|
@@ -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 = ["children", "className", "disableTypography", "inset", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -41,19 +41,28 @@ const ListItemTextRoot = styled('div', {
|
|
|
41
41
|
[`& .${listItemTextClasses.secondary}`]: styles.secondary
|
|
42
42
|
}, styles.root, ownerState.inset && styles.inset, ownerState.primary && ownerState.secondary && styles.multiline, ownerState.dense && styles.dense];
|
|
43
43
|
}
|
|
44
|
-
})(
|
|
45
|
-
ownerState
|
|
46
|
-
}) => _extends({
|
|
44
|
+
})({
|
|
47
45
|
flex: '1 1 auto',
|
|
48
46
|
minWidth: 0,
|
|
49
47
|
marginTop: 4,
|
|
50
|
-
marginBottom: 4
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
marginBottom: 4,
|
|
49
|
+
variants: [{
|
|
50
|
+
props: ({
|
|
51
|
+
ownerState
|
|
52
|
+
}) => ownerState.primary && ownerState.secondary,
|
|
53
|
+
style: {
|
|
54
|
+
marginTop: 6,
|
|
55
|
+
marginBottom: 6
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
props: ({
|
|
59
|
+
ownerState
|
|
60
|
+
}) => ownerState.inset,
|
|
61
|
+
style: {
|
|
62
|
+
paddingLeft: 56
|
|
63
|
+
}
|
|
64
|
+
}]
|
|
65
|
+
});
|
|
57
66
|
const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps, ref) {
|
|
58
67
|
const props = useThemeProps({
|
|
59
68
|
props: inProps,
|
|
@@ -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", "color", "component", "disableGutters", "disableSticky", "inset"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -35,30 +35,55 @@ const ListSubheaderRoot = styled('li', {
|
|
|
35
35
|
return [styles.root, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`], !ownerState.disableGutters && styles.gutters, ownerState.inset && styles.inset, !ownerState.disableSticky && styles.sticky];
|
|
36
36
|
}
|
|
37
37
|
})(({
|
|
38
|
-
theme
|
|
39
|
-
|
|
40
|
-
}) => _extends({
|
|
38
|
+
theme
|
|
39
|
+
}) => ({
|
|
41
40
|
boxSizing: 'border-box',
|
|
42
41
|
lineHeight: '48px',
|
|
43
42
|
listStyle: 'none',
|
|
44
43
|
color: (theme.vars || theme).palette.text.secondary,
|
|
45
44
|
fontFamily: theme.typography.fontFamily,
|
|
46
45
|
fontWeight: theme.typography.fontWeightMedium,
|
|
47
|
-
fontSize: theme.typography.pxToRem(14)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
fontSize: theme.typography.pxToRem(14),
|
|
47
|
+
variants: [{
|
|
48
|
+
props: {
|
|
49
|
+
color: 'primary'
|
|
50
|
+
},
|
|
51
|
+
style: {
|
|
52
|
+
color: (theme.vars || theme).palette.primary.main
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
props: {
|
|
56
|
+
color: 'inherit'
|
|
57
|
+
},
|
|
58
|
+
style: {
|
|
59
|
+
color: 'inherit'
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
props: ({
|
|
63
|
+
ownerState
|
|
64
|
+
}) => !ownerState.disableGutters,
|
|
65
|
+
style: {
|
|
66
|
+
paddingLeft: 16,
|
|
67
|
+
paddingRight: 16
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
props: ({
|
|
71
|
+
ownerState
|
|
72
|
+
}) => ownerState.inset,
|
|
73
|
+
style: {
|
|
74
|
+
paddingLeft: 72
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
props: ({
|
|
78
|
+
ownerState
|
|
79
|
+
}) => !ownerState.disableSticky,
|
|
80
|
+
style: {
|
|
81
|
+
position: 'sticky',
|
|
82
|
+
top: 0,
|
|
83
|
+
zIndex: 1,
|
|
84
|
+
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
85
|
+
}
|
|
86
|
+
}]
|
|
62
87
|
}));
|
|
63
88
|
const ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inProps, ref) {
|
|
64
89
|
const props = useThemeProps({
|
package/modern/Radio/Radio.js
CHANGED
|
@@ -10,14 +10,15 @@ import refType from '@mui/utils/refType';
|
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
11
|
import { alpha } from '@mui/system/colorManipulator';
|
|
12
12
|
import SwitchBase from '../internal/SwitchBase';
|
|
13
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
14
13
|
import RadioButtonIcon from './RadioButtonIcon';
|
|
15
14
|
import capitalize from '../utils/capitalize';
|
|
16
15
|
import createChainedFunction from '../utils/createChainedFunction';
|
|
17
16
|
import useRadioGroup from '../RadioGroup/useRadioGroup';
|
|
18
17
|
import radioClasses, { getRadioUtilityClass } from './radioClasses';
|
|
19
|
-
import
|
|
18
|
+
import { rootShouldForwardProp } from '../styles/styled';
|
|
19
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
const useThemeProps = createUseThemeProps('MuiRadio');
|
|
21
22
|
const useUtilityClasses = ownerState => {
|
|
22
23
|
const {
|
|
23
24
|
classes,
|
|
@@ -40,26 +41,55 @@ const RadioRoot = styled(SwitchBase, {
|
|
|
40
41
|
return [styles.root, ownerState.size !== 'medium' && styles[`size${capitalize(ownerState.size)}`], styles[`color${capitalize(ownerState.color)}`]];
|
|
41
42
|
}
|
|
42
43
|
})(({
|
|
43
|
-
theme
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
color: (theme.vars || theme).palette.text.secondary
|
|
47
|
-
}, !ownerState.disableRipple && {
|
|
48
|
-
'&:hover': {
|
|
49
|
-
backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
50
|
-
// Reset on touch devices, it doesn't add specificity
|
|
51
|
-
'@media (hover: none)': {
|
|
52
|
-
backgroundColor: 'transparent'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, ownerState.color !== 'default' && {
|
|
56
|
-
[`&.${radioClasses.checked}`]: {
|
|
57
|
-
color: (theme.vars || theme).palette[ownerState.color].main
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
44
|
+
theme
|
|
45
|
+
}) => ({
|
|
46
|
+
color: (theme.vars || theme).palette.text.secondary,
|
|
60
47
|
[`&.${radioClasses.disabled}`]: {
|
|
61
48
|
color: (theme.vars || theme).palette.action.disabled
|
|
62
|
-
}
|
|
49
|
+
},
|
|
50
|
+
variants: [{
|
|
51
|
+
props: {
|
|
52
|
+
color: 'default',
|
|
53
|
+
disableRipple: false
|
|
54
|
+
},
|
|
55
|
+
style: {
|
|
56
|
+
'&:hover': {
|
|
57
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
|
|
61
|
+
props: {
|
|
62
|
+
color,
|
|
63
|
+
disableRipple: false
|
|
64
|
+
},
|
|
65
|
+
style: {
|
|
66
|
+
'&:hover': {
|
|
67
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
})), ...Object.entries(theme.palette).filter(([, palette]) => palette.main).map(([color]) => ({
|
|
71
|
+
props: {
|
|
72
|
+
color
|
|
73
|
+
},
|
|
74
|
+
style: {
|
|
75
|
+
[`&.${radioClasses.checked}`]: {
|
|
76
|
+
color: (theme.vars || theme).palette[color].main
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
})), {
|
|
80
|
+
// Should be last to override other colors
|
|
81
|
+
props: {
|
|
82
|
+
disableRipple: false
|
|
83
|
+
},
|
|
84
|
+
style: {
|
|
85
|
+
// Reset on touch devices, it doesn't add specificity
|
|
86
|
+
'&:hover': {
|
|
87
|
+
'@media (hover: none)': {
|
|
88
|
+
backgroundColor: 'transparent'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}]
|
|
63
93
|
}));
|
|
64
94
|
function areEqualValues(a, b) {
|
|
65
95
|
if (typeof b === 'object' && b !== null) {
|
|
@@ -5,7 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked';
|
|
7
7
|
import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked';
|
|
8
|
-
import
|
|
8
|
+
import { rootShouldForwardProp } from '../styles/styled';
|
|
9
|
+
import { styled } from '../zero-styled';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const RadioButtonIconRoot = styled('span', {
|
|
11
12
|
shouldForwardProp: rootShouldForwardProp
|
|
@@ -18,22 +19,27 @@ const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon)({
|
|
|
18
19
|
transform: 'scale(1)'
|
|
19
20
|
});
|
|
20
21
|
const RadioButtonIconDot = styled(RadioButtonCheckedIcon)(({
|
|
21
|
-
theme
|
|
22
|
-
|
|
23
|
-
}) => _extends({
|
|
22
|
+
theme
|
|
23
|
+
}) => ({
|
|
24
24
|
left: 0,
|
|
25
25
|
position: 'absolute',
|
|
26
26
|
transform: 'scale(0)',
|
|
27
27
|
transition: theme.transitions.create('transform', {
|
|
28
28
|
easing: theme.transitions.easing.easeIn,
|
|
29
29
|
duration: theme.transitions.duration.shortest
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
}),
|
|
31
|
+
variants: [{
|
|
32
|
+
props: {
|
|
33
|
+
checked: true
|
|
34
|
+
},
|
|
35
|
+
style: {
|
|
36
|
+
transform: 'scale(1)',
|
|
37
|
+
transition: theme.transitions.create('transform', {
|
|
38
|
+
easing: theme.transitions.easing.easeOut,
|
|
39
|
+
duration: theme.transitions.duration.shortest
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}]
|
|
37
43
|
}));
|
|
38
44
|
|
|
39
45
|
/**
|
|
@@ -62,7 +68,7 @@ function RadioButtonIcon(props) {
|
|
|
62
68
|
})]
|
|
63
69
|
});
|
|
64
70
|
}
|
|
65
|
-
process.env.NODE_ENV !== "production" ? RadioButtonIcon.propTypes = {
|
|
71
|
+
process.env.NODE_ENV !== "production" ? RadioButtonIcon.propTypes /* remove-proptypes */ = {
|
|
66
72
|
/**
|
|
67
73
|
* If `true`, the component is checked.
|
|
68
74
|
*/
|
package/modern/Rating/Rating.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 = ["value"],
|
|
6
6
|
_excluded2 = ["className", "defaultValue", "disabled", "emptyIcon", "emptyLabelText", "getLabelText", "highlightSelectedOnly", "icon", "IconContainerComponent", "max", "name", "onChange", "onChangeActive", "onMouseLeave", "onMouseMove", "precision", "readOnly", "size", "value"];
|
|
7
7
|
import * as React from 'react';
|
|
@@ -66,9 +66,8 @@ const RatingRoot = styled('span', {
|
|
|
66
66
|
}, styles.root, styles[`size${capitalize(ownerState.size)}`], ownerState.readOnly && styles.readOnly];
|
|
67
67
|
}
|
|
68
68
|
})(({
|
|
69
|
-
theme
|
|
70
|
-
|
|
71
|
-
}) => _extends({
|
|
69
|
+
theme
|
|
70
|
+
}) => ({
|
|
72
71
|
display: 'inline-flex',
|
|
73
72
|
// Required to position the pristine input absolutely
|
|
74
73
|
position: 'relative',
|
|
@@ -85,13 +84,30 @@ const RatingRoot = styled('span', {
|
|
|
85
84
|
[`&.${ratingClasses.focusVisible} .${ratingClasses.iconActive}`]: {
|
|
86
85
|
outline: '1px solid #999'
|
|
87
86
|
},
|
|
88
|
-
[`& .${ratingClasses.visuallyHidden}`]: visuallyHidden
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
[`& .${ratingClasses.visuallyHidden}`]: visuallyHidden,
|
|
88
|
+
variants: [{
|
|
89
|
+
props: {
|
|
90
|
+
size: 'small'
|
|
91
|
+
},
|
|
92
|
+
style: {
|
|
93
|
+
fontSize: theme.typography.pxToRem(18)
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
props: {
|
|
97
|
+
size: 'large'
|
|
98
|
+
},
|
|
99
|
+
style: {
|
|
100
|
+
fontSize: theme.typography.pxToRem(30)
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
// TODO v6: use the .Mui-readOnly global state class
|
|
104
|
+
props: ({
|
|
105
|
+
ownerState
|
|
106
|
+
}) => ownerState.readOnly,
|
|
107
|
+
style: {
|
|
108
|
+
pointerEvents: 'none'
|
|
109
|
+
}
|
|
110
|
+
}]
|
|
95
111
|
}));
|
|
96
112
|
const RatingLabel = styled('label', {
|
|
97
113
|
name: 'MuiRating',
|
|
@@ -99,17 +115,21 @@ const RatingLabel = styled('label', {
|
|
|
99
115
|
overridesResolver: ({
|
|
100
116
|
ownerState
|
|
101
117
|
}, styles) => [styles.label, ownerState.emptyValueFocused && styles.labelEmptyValueActive]
|
|
102
|
-
})(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
})({
|
|
119
|
+
cursor: 'inherit',
|
|
120
|
+
variants: [{
|
|
121
|
+
props: ({
|
|
122
|
+
ownerState
|
|
123
|
+
}) => ownerState.emptyValueFocused,
|
|
124
|
+
style: {
|
|
125
|
+
top: 0,
|
|
126
|
+
bottom: 0,
|
|
127
|
+
position: 'absolute',
|
|
128
|
+
outline: '1px solid #999',
|
|
129
|
+
width: '100%'
|
|
130
|
+
}
|
|
131
|
+
}]
|
|
132
|
+
});
|
|
113
133
|
const RatingIcon = styled('span', {
|
|
114
134
|
name: 'MuiRating',
|
|
115
135
|
slot: 'Icon',
|
|
@@ -120,9 +140,8 @@ const RatingIcon = styled('span', {
|
|
|
120
140
|
return [styles.icon, ownerState.iconEmpty && styles.iconEmpty, ownerState.iconFilled && styles.iconFilled, ownerState.iconHover && styles.iconHover, ownerState.iconFocus && styles.iconFocus, ownerState.iconActive && styles.iconActive];
|
|
121
141
|
}
|
|
122
142
|
})(({
|
|
123
|
-
theme
|
|
124
|
-
|
|
125
|
-
}) => _extends({
|
|
143
|
+
theme
|
|
144
|
+
}) => ({
|
|
126
145
|
// Fit wrapper to actual icon size.
|
|
127
146
|
display: 'flex',
|
|
128
147
|
transition: theme.transitions.create('transform', {
|
|
@@ -130,11 +149,22 @@ const RatingIcon = styled('span', {
|
|
|
130
149
|
}),
|
|
131
150
|
// Fix mouseLeave issue.
|
|
132
151
|
// https://github.com/facebook/react/issues/4492
|
|
133
|
-
pointerEvents: 'none'
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
152
|
+
pointerEvents: 'none',
|
|
153
|
+
variants: [{
|
|
154
|
+
props: ({
|
|
155
|
+
ownerState
|
|
156
|
+
}) => ownerState.iconActive,
|
|
157
|
+
style: {
|
|
158
|
+
transform: 'scale(1.2)'
|
|
159
|
+
}
|
|
160
|
+
}, {
|
|
161
|
+
props: ({
|
|
162
|
+
ownerState
|
|
163
|
+
}) => ownerState.iconEmpty,
|
|
164
|
+
style: {
|
|
165
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
166
|
+
}
|
|
167
|
+
}]
|
|
138
168
|
}));
|
|
139
169
|
const RatingDecimal = styled('span', {
|
|
140
170
|
name: 'MuiRating',
|
|
@@ -146,13 +176,17 @@ const RatingDecimal = styled('span', {
|
|
|
146
176
|
} = props;
|
|
147
177
|
return [styles.decimal, iconActive && styles.iconActive];
|
|
148
178
|
}
|
|
149
|
-
})(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
179
|
+
})({
|
|
180
|
+
position: 'relative',
|
|
181
|
+
variants: [{
|
|
182
|
+
props: ({
|
|
183
|
+
iconActive
|
|
184
|
+
}) => iconActive,
|
|
185
|
+
style: {
|
|
186
|
+
transform: 'scale(1.2)'
|
|
187
|
+
}
|
|
188
|
+
}]
|
|
189
|
+
});
|
|
156
190
|
function IconContainer(props) {
|
|
157
191
|
const other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
158
192
|
return /*#__PURE__*/_jsx("span", _extends({}, other));
|
package/modern/Table/Table.js
CHANGED
|
@@ -32,9 +32,8 @@ const TableRoot = styled('table', {
|
|
|
32
32
|
return [styles.root, ownerState.stickyHeader && styles.stickyHeader];
|
|
33
33
|
}
|
|
34
34
|
})(({
|
|
35
|
-
theme
|
|
36
|
-
|
|
37
|
-
}) => _extends({
|
|
35
|
+
theme
|
|
36
|
+
}) => ({
|
|
38
37
|
display: 'table',
|
|
39
38
|
width: '100%',
|
|
40
39
|
borderCollapse: 'collapse',
|
|
@@ -44,9 +43,15 @@ const TableRoot = styled('table', {
|
|
|
44
43
|
color: (theme.vars || theme).palette.text.secondary,
|
|
45
44
|
textAlign: 'left',
|
|
46
45
|
captionSide: 'bottom'
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
}),
|
|
47
|
+
variants: [{
|
|
48
|
+
props: ({
|
|
49
|
+
ownerState
|
|
50
|
+
}) => ownerState.stickyHeader,
|
|
51
|
+
style: {
|
|
52
|
+
borderCollapse: 'separate'
|
|
53
|
+
}
|
|
54
|
+
}]
|
|
50
55
|
}));
|
|
51
56
|
const defaultComponent = 'table';
|
|
52
57
|
const Table = /*#__PURE__*/React.forwardRef(function Table(inProps, ref) {
|