@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.
Files changed (86) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/Checkbox/Checkbox.js +51 -20
  3. package/FormControlLabel/FormControlLabel.d.ts +21 -14
  4. package/FormControlLabel/FormControlLabel.js +22 -4
  5. package/FormHelperText/FormHelperText.js +18 -8
  6. package/IconButton/IconButton.js +97 -40
  7. package/ImageList/ImageList.js +16 -14
  8. package/ImageListItem/ImageListItem.js +37 -22
  9. package/ImageListItemBar/ImageListItemBar.js +65 -32
  10. package/ListItem/ListItem.js +94 -50
  11. package/ListItemAvatar/ListItemAvatar.js +12 -8
  12. package/ListItemButton/ListItemButton.js +35 -15
  13. package/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  14. package/ListItemText/ListItemText.js +20 -11
  15. package/ListSubheader/ListSubheader.js +44 -19
  16. package/PaginationItem/PaginationItem.d.ts +26 -14
  17. package/PaginationItem/PaginationItem.js +64 -20
  18. package/Radio/Radio.js +50 -20
  19. package/Radio/RadioButtonIcon.js +18 -12
  20. package/Rating/Rating.js +71 -37
  21. package/SvgIcon/SvgIcon.js +73 -21
  22. package/Table/Table.js +11 -6
  23. package/TableCell/TableCell.js +96 -41
  24. package/TableSortLabel/TableSortLabel.js +19 -9
  25. package/Toolbar/Toolbar.js +33 -17
  26. package/Typography/Typography.js +3 -2
  27. package/index.js +1 -1
  28. package/modern/Checkbox/Checkbox.js +51 -20
  29. package/modern/FormControlLabel/FormControlLabel.js +22 -4
  30. package/modern/FormHelperText/FormHelperText.js +18 -8
  31. package/modern/IconButton/IconButton.js +97 -40
  32. package/modern/ImageList/ImageList.js +16 -14
  33. package/modern/ImageListItem/ImageListItem.js +37 -22
  34. package/modern/ImageListItemBar/ImageListItemBar.js +65 -32
  35. package/modern/ListItem/ListItem.js +94 -50
  36. package/modern/ListItemAvatar/ListItemAvatar.js +12 -8
  37. package/modern/ListItemButton/ListItemButton.js +35 -15
  38. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  39. package/modern/ListItemText/ListItemText.js +20 -11
  40. package/modern/ListSubheader/ListSubheader.js +44 -19
  41. package/modern/PaginationItem/PaginationItem.js +64 -20
  42. package/modern/Radio/Radio.js +50 -20
  43. package/modern/Radio/RadioButtonIcon.js +18 -12
  44. package/modern/Rating/Rating.js +71 -37
  45. package/modern/SvgIcon/SvgIcon.js +73 -21
  46. package/modern/Table/Table.js +11 -6
  47. package/modern/TableCell/TableCell.js +96 -41
  48. package/modern/TableSortLabel/TableSortLabel.js +19 -9
  49. package/modern/Toolbar/Toolbar.js +33 -17
  50. package/modern/Typography/Typography.js +3 -2
  51. package/modern/index.js +1 -1
  52. package/modern/styles/experimental_extendTheme.js +2 -1
  53. package/modern/styles/getOverlayAlpha.js +3 -4
  54. package/node/Checkbox/Checkbox.js +54 -23
  55. package/node/FormControlLabel/FormControlLabel.js +23 -5
  56. package/node/FormHelperText/FormHelperText.js +18 -8
  57. package/node/IconButton/IconButton.js +99 -43
  58. package/node/ImageList/ImageList.js +16 -14
  59. package/node/ImageListItem/ImageListItem.js +37 -22
  60. package/node/ImageListItemBar/ImageListItemBar.js +65 -32
  61. package/node/ListItem/ListItem.js +94 -50
  62. package/node/ListItemAvatar/ListItemAvatar.js +12 -8
  63. package/node/ListItemButton/ListItemButton.js +35 -15
  64. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  65. package/node/ListItemText/ListItemText.js +20 -11
  66. package/node/ListSubheader/ListSubheader.js +44 -19
  67. package/node/PaginationItem/PaginationItem.js +65 -20
  68. package/node/Radio/Radio.js +52 -22
  69. package/node/Radio/RadioButtonIcon.js +21 -15
  70. package/node/Rating/Rating.js +71 -37
  71. package/node/SvgIcon/SvgIcon.js +79 -24
  72. package/node/Table/Table.js +11 -6
  73. package/node/TableCell/TableCell.js +96 -41
  74. package/node/TableSortLabel/TableSortLabel.js +19 -9
  75. package/node/Toolbar/Toolbar.js +33 -17
  76. package/node/Typography/Typography.js +3 -2
  77. package/node/index.js +1 -1
  78. package/node/styles/experimental_extendTheme.js +1 -0
  79. package/node/styles/getOverlayAlpha.js +4 -5
  80. package/package.json +6 -6
  81. package/styles/experimental_extendTheme.d.ts +2 -0
  82. package/styles/experimental_extendTheme.js +2 -1
  83. package/styles/getOverlayAlpha.d.ts +1 -2
  84. package/styles/getOverlayAlpha.js +3 -4
  85. package/umd/material-ui.development.js +1223 -583
  86. package/umd/material-ui.production.min.js +4 -4
@@ -6,16 +6,15 @@ 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"));
14
14
  var _chainPropTypes = _interopRequireDefault(require("@mui/utils/chainPropTypes"));
15
15
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
16
16
  var _colorManipulator = require("@mui/system/colorManipulator");
17
- var _styled = _interopRequireDefault(require("../styles/styled"));
18
- var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
17
+ var _zeroStyled = require("../zero-styled");
19
18
  var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
20
19
  var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
21
20
  var _iconButtonClasses = _interopRequireWildcard(require("./iconButtonClasses"));
@@ -23,6 +22,7 @@ var _jsxRuntime = require("react/jsx-runtime");
23
22
  const _excluded = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];
24
23
  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); }
25
24
  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; }
25
+ const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiIconButton');
26
26
  const useUtilityClasses = ownerState => {
27
27
  const {
28
28
  classes,
@@ -36,7 +36,7 @@ const useUtilityClasses = ownerState => {
36
36
  };
37
37
  return (0, _composeClasses.default)(slots, _iconButtonClasses.getIconButtonUtilityClass, classes);
38
38
  };
39
- const IconButtonRoot = (0, _styled.default)(_ButtonBase.default, {
39
+ const IconButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
40
40
  name: 'MuiIconButton',
41
41
  slot: 'Root',
42
42
  overridesResolver: (props, styles) => {
@@ -46,9 +46,8 @@ const IconButtonRoot = (0, _styled.default)(_ButtonBase.default, {
46
46
  return [styles.root, ownerState.color !== 'default' && styles[`color${(0, _capitalize.default)(ownerState.color)}`], ownerState.edge && styles[`edge${(0, _capitalize.default)(ownerState.edge)}`], styles[`size${(0, _capitalize.default)(ownerState.size)}`]];
47
47
  }
48
48
  })(({
49
- theme,
50
- ownerState
51
- }) => (0, _extends2.default)({
49
+ theme
50
+ }) => ({
52
51
  textAlign: 'center',
53
52
  flex: '0 0 auto',
54
53
  fontSize: theme.typography.pxToRem(24),
@@ -59,50 +58,107 @@ const IconButtonRoot = (0, _styled.default)(_ButtonBase.default, {
59
58
  color: (theme.vars || theme).palette.action.active,
60
59
  transition: theme.transitions.create('background-color', {
61
60
  duration: theme.transitions.duration.shortest
62
- })
63
- }, !ownerState.disableRipple && {
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
- // Reset on touch devices, it doesn't add specificity
67
- '@media (hover: none)': {
68
- backgroundColor: 'transparent'
61
+ }),
62
+ variants: [{
63
+ props: {
64
+ disableRipple: false
65
+ },
66
+ style: {
67
+ '&:hover': {
68
+ 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),
69
+ // Reset on touch devices, it doesn't add specificity
70
+ '@media (hover: none)': {
71
+ backgroundColor: 'transparent'
72
+ }
73
+ }
69
74
  }
70
- }
71
- }, ownerState.edge === 'start' && {
72
- marginLeft: ownerState.size === 'small' ? -3 : -12
73
- }, ownerState.edge === 'end' && {
74
- marginRight: ownerState.size === 'small' ? -3 : -12
75
+ }, {
76
+ props: {
77
+ edge: 'start'
78
+ },
79
+ style: {
80
+ marginLeft: -12
81
+ }
82
+ }, {
83
+ props: {
84
+ edge: 'start',
85
+ size: 'small'
86
+ },
87
+ style: {
88
+ marginLeft: -3
89
+ }
90
+ }, {
91
+ props: {
92
+ edge: 'end'
93
+ },
94
+ style: {
95
+ marginRight: -12
96
+ }
97
+ }, {
98
+ props: {
99
+ edge: 'end',
100
+ size: 'small'
101
+ },
102
+ style: {
103
+ marginRight: -3
104
+ }
105
+ }]
75
106
  }), ({
76
- theme,
77
- ownerState
107
+ theme
78
108
  }) => {
79
- var _palette;
80
- const palette = (_palette = (theme.vars || theme).palette) == null ? void 0 : _palette[ownerState.color];
81
- return (0, _extends2.default)({}, ownerState.color === 'inherit' && {
82
- color: 'inherit'
83
- }, ownerState.color !== 'inherit' && ownerState.color !== 'default' && (0, _extends2.default)({
84
- color: palette == null ? void 0 : palette.main
85
- }, !ownerState.disableRipple && {
86
- '&:hover': (0, _extends2.default)({}, palette && {
87
- backgroundColor: theme.vars ? `rgba(${palette.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)(palette.main, theme.palette.action.hoverOpacity)
109
+ return {
110
+ variants: [{
111
+ props: {
112
+ color: 'inherit'
113
+ },
114
+ style: {
115
+ color: 'inherit'
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
+ },
122
+ style: {
123
+ color: (theme.vars || theme).palette[color].main
124
+ }
125
+ })), ...Object.entries(theme.palette).filter(([, value]) => value.main) // check all the used fields in the style below
126
+ .map(([color]) => ({
127
+ props: {
128
+ color,
129
+ disableRipple: false
130
+ },
131
+ style: {
132
+ '&:hover': {
133
+ backgroundColor: theme.vars ? `rgba(${(theme.vars || theme).palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0, _colorManipulator.alpha)((theme.vars || theme).palette[color].main, theme.palette.action.hoverOpacity),
134
+ // Reset on touch devices, it doesn't add specificity
135
+ '@media (hover: none)': {
136
+ backgroundColor: 'transparent'
137
+ }
138
+ }
139
+ }
140
+ })), {
141
+ props: {
142
+ size: 'small'
143
+ },
144
+ style: {
145
+ padding: 5,
146
+ fontSize: theme.typography.pxToRem(18)
147
+ }
88
148
  }, {
89
- // Reset on touch devices, it doesn't add specificity
90
- '@media (hover: none)': {
91
- backgroundColor: 'transparent'
149
+ props: {
150
+ size: 'large'
151
+ },
152
+ style: {
153
+ padding: 12,
154
+ fontSize: theme.typography.pxToRem(28)
92
155
  }
93
- })
94
- }), ownerState.size === 'small' && {
95
- padding: 5,
96
- fontSize: theme.typography.pxToRem(18)
97
- }, ownerState.size === 'large' && {
98
- padding: 12,
99
- fontSize: theme.typography.pxToRem(28)
100
- }, {
156
+ }],
101
157
  [`&.${_iconButtonClasses.default.disabled}`]: {
102
158
  backgroundColor: 'transparent',
103
159
  color: (theme.vars || theme).palette.action.disabled
104
160
  }
105
- });
161
+ };
106
162
  });
107
163
 
108
164
  /**
@@ -110,7 +166,7 @@ const IconButtonRoot = (0, _styled.default)(_ButtonBase.default, {
110
166
  * regarding the available icon options.
111
167
  */
112
168
  const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, ref) {
113
- const props = (0, _useThemeProps.default)({
169
+ const props = useThemeProps({
114
170
  props: inProps,
115
171
  name: 'MuiIconButton'
116
172
  });
@@ -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 _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
12
12
  var _integerPropType = _interopRequireDefault(require("@mui/utils/integerPropType"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -40,19 +40,21 @@ const ImageListRoot = (0, _styled.default)('ul', {
40
40
  } = props;
41
41
  return [styles.root, styles[ownerState.variant]];
42
42
  }
43
- })(({
44
- ownerState
45
- }) => {
46
- return (0, _extends2.default)({
47
- display: 'grid',
48
- overflowY: 'auto',
49
- listStyle: 'none',
50
- padding: 0,
51
- // Add iOS momentum scrolling for iOS < 13.0
52
- WebkitOverflowScrolling: 'touch'
53
- }, ownerState.variant === 'masonry' && {
54
- display: 'block'
55
- });
43
+ })({
44
+ display: 'grid',
45
+ overflowY: 'auto',
46
+ listStyle: 'none',
47
+ padding: 0,
48
+ // Add iOS momentum scrolling for iOS < 13.0
49
+ WebkitOverflowScrolling: 'touch',
50
+ variants: [{
51
+ props: {
52
+ variant: 'masonry'
53
+ },
54
+ style: {
55
+ display: 'block'
56
+ }
57
+ }]
56
58
  });
57
59
  const ImageList = /*#__PURE__*/React.forwardRef(function ImageList(inProps, ref) {
58
60
  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 _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
12
12
  var _integerPropType = _interopRequireDefault(require("@mui/utils/integerPropType"));
13
13
  var _clsx = _interopRequireDefault(require("clsx"));
@@ -45,32 +45,47 @@ const ImageListItemRoot = (0, _styled.default)('li', {
45
45
  [`& .${_imageListItemClasses.default.img}`]: styles.img
46
46
  }, styles.root, styles[ownerState.variant]];
47
47
  }
48
- })(({
49
- ownerState
50
- }) => (0, _extends2.default)({
48
+ })({
51
49
  display: 'block',
52
- position: 'relative'
53
- }, ownerState.variant === 'standard' && {
54
- // For titlebar under list item
55
- display: 'flex',
56
- flexDirection: 'column'
57
- }, ownerState.variant === 'woven' && {
58
- height: '100%',
59
- alignSelf: 'center',
60
- '&:nth-of-type(even)': {
61
- height: '70%'
62
- }
63
- }, {
64
- [`& .${_imageListItemClasses.default.img}`]: (0, _extends2.default)({
50
+ position: 'relative',
51
+ [`& .${_imageListItemClasses.default.img}`]: {
65
52
  objectFit: 'cover',
66
53
  width: '100%',
67
54
  height: '100%',
68
55
  display: 'block'
69
- }, ownerState.variant === 'standard' && {
70
- height: 'auto',
71
- flexGrow: 1
72
- })
73
- }));
56
+ },
57
+ variants: [{
58
+ props: {
59
+ variant: 'standard'
60
+ },
61
+ style: {
62
+ // For titlebar under list item
63
+ display: 'flex',
64
+ flexDirection: 'column'
65
+ }
66
+ }, {
67
+ props: {
68
+ variant: 'woven'
69
+ },
70
+ style: {
71
+ height: '100%',
72
+ alignSelf: 'center',
73
+ '&:nth-of-type(even)': {
74
+ height: '70%'
75
+ }
76
+ }
77
+ }, {
78
+ props: {
79
+ variant: 'standard'
80
+ },
81
+ style: {
82
+ [`& .${_imageListItemClasses.default.img}`]: {
83
+ height: 'auto',
84
+ flexGrow: 1
85
+ }
86
+ }
87
+ }]
88
+ });
74
89
  const ImageListItem = /*#__PURE__*/React.forwardRef(function ImageListItem(inProps, ref) {
75
90
  const props = (0, _useThemeProps.default)({
76
91
  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 _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
12
12
  var _clsx = _interopRequireDefault(require("clsx"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -46,26 +46,41 @@ const ImageListItemBarRoot = (0, _styled.default)('div', {
46
46
  return [styles.root, styles[`position${(0, _capitalize.default)(ownerState.position)}`]];
47
47
  }
48
48
  })(({
49
- theme,
50
- ownerState
49
+ theme
51
50
  }) => {
52
- return (0, _extends2.default)({
51
+ return {
53
52
  position: 'absolute',
54
53
  left: 0,
55
54
  right: 0,
56
55
  background: 'rgba(0, 0, 0, 0.5)',
57
56
  display: 'flex',
58
57
  alignItems: 'center',
59
- fontFamily: theme.typography.fontFamily
60
- }, ownerState.position === 'bottom' && {
61
- bottom: 0
62
- }, ownerState.position === 'top' && {
63
- top: 0
64
- }, ownerState.position === 'below' && {
65
- position: 'relative',
66
- background: 'transparent',
67
- alignItems: 'normal'
68
- });
58
+ fontFamily: theme.typography.fontFamily,
59
+ variants: [{
60
+ props: {
61
+ position: 'bottom'
62
+ },
63
+ style: {
64
+ bottom: 0
65
+ }
66
+ }, {
67
+ props: {
68
+ position: 'top'
69
+ },
70
+ style: {
71
+ top: 0
72
+ }
73
+ }, {
74
+ props: {
75
+ position: 'below'
76
+ },
77
+ style: {
78
+ position: 'relative',
79
+ background: 'transparent',
80
+ alignItems: 'normal'
81
+ }
82
+ }]
83
+ };
69
84
  });
70
85
  const ImageListItemBarTitleWrap = (0, _styled.default)('div', {
71
86
  name: 'MuiImageListItemBar',
@@ -77,22 +92,37 @@ const ImageListItemBarTitleWrap = (0, _styled.default)('div', {
77
92
  return [styles.titleWrap, styles[`titleWrap${(0, _capitalize.default)(ownerState.position)}`], ownerState.actionIcon && styles[`titleWrapActionPos${(0, _capitalize.default)(ownerState.actionPosition)}`]];
78
93
  }
79
94
  })(({
80
- theme,
81
- ownerState
95
+ theme
82
96
  }) => {
83
- return (0, _extends2.default)({
97
+ return {
84
98
  flexGrow: 1,
85
99
  padding: '12px 16px',
86
100
  color: (theme.vars || theme).palette.common.white,
87
- overflow: 'hidden'
88
- }, ownerState.position === 'below' && {
89
- padding: '6px 0 12px',
90
- color: 'inherit'
91
- }, ownerState.actionIcon && ownerState.actionPosition === 'left' && {
92
- paddingLeft: 0
93
- }, ownerState.actionIcon && ownerState.actionPosition === 'right' && {
94
- paddingRight: 0
95
- });
101
+ overflow: 'hidden',
102
+ variants: [{
103
+ props: {
104
+ position: 'below'
105
+ },
106
+ style: {
107
+ padding: '6px 0 12px',
108
+ color: 'inherit'
109
+ }
110
+ }, {
111
+ props: ({
112
+ ownerState
113
+ }) => ownerState.actionIcon && ownerState.actionPosition === 'left',
114
+ style: {
115
+ paddingLeft: 0
116
+ }
117
+ }, {
118
+ props: ({
119
+ ownerState
120
+ }) => ownerState.actionIcon && ownerState.actionPosition === 'right',
121
+ style: {
122
+ paddingRight: 0
123
+ }
124
+ }]
125
+ };
96
126
  });
97
127
  const ImageListItemBarTitle = (0, _styled.default)('div', {
98
128
  name: 'MuiImageListItemBar',
@@ -133,12 +163,15 @@ const ImageListItemBarActionIcon = (0, _styled.default)('div', {
133
163
  } = props;
134
164
  return [styles.actionIcon, styles[`actionIconActionPos${(0, _capitalize.default)(ownerState.actionPosition)}`]];
135
165
  }
136
- })(({
137
- ownerState
138
- }) => {
139
- return (0, _extends2.default)({}, ownerState.actionPosition === 'left' && {
140
- order: -1
141
- });
166
+ })({
167
+ variants: [{
168
+ props: {
169
+ actionPosition: 'left'
170
+ },
171
+ style: {
172
+ order: -1
173
+ }
174
+ }]
142
175
  });
143
176
  const ImageListItemBar = /*#__PURE__*/React.forwardRef(function ImageListItemBar(inProps, ref) {
144
177
  const props = (0, _useThemeProps.default)({
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.overridesResolver = exports.default = exports.ListItemRoot = 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"));
@@ -62,9 +62,8 @@ const ListItemRoot = exports.ListItemRoot = (0, _styled.default)('div', {
62
62
  slot: 'Root',
63
63
  overridesResolver
64
64
  })(({
65
- theme,
66
- ownerState
67
- }) => (0, _extends2.default)({
65
+ theme
66
+ }) => ({
68
67
  display: 'flex',
69
68
  justifyContent: 'flex-start',
70
69
  alignItems: 'center',
@@ -72,25 +71,7 @@ const ListItemRoot = exports.ListItemRoot = (0, _styled.default)('div', {
72
71
  textDecoration: 'none',
73
72
  width: '100%',
74
73
  boxSizing: 'border-box',
75
- textAlign: 'left'
76
- }, !ownerState.disablePadding && (0, _extends2.default)({
77
- paddingTop: 8,
78
- paddingBottom: 8
79
- }, ownerState.dense && {
80
- paddingTop: 4,
81
- paddingBottom: 4
82
- }, !ownerState.disableGutters && {
83
- paddingLeft: 16,
84
- paddingRight: 16
85
- }, !!ownerState.secondaryAction && {
86
- // Add some space to avoid collision as `ListItemSecondaryAction`
87
- // is absolutely positioned.
88
- paddingRight: 48
89
- }), !!ownerState.secondaryAction && {
90
- [`& > .${_ListItemButton.listItemButtonClasses.root}`]: {
91
- paddingRight: 48
92
- }
93
- }, {
74
+ textAlign: 'left',
94
75
  [`&.${_listItemClasses.default.focusVisible}`]: {
95
76
  backgroundColor: (theme.vars || theme).palette.action.focus
96
77
  },
@@ -102,35 +83,98 @@ const ListItemRoot = exports.ListItemRoot = (0, _styled.default)('div', {
102
83
  },
103
84
  [`&.${_listItemClasses.default.disabled}`]: {
104
85
  opacity: (theme.vars || theme).palette.action.disabledOpacity
105
- }
106
- }, ownerState.alignItems === 'flex-start' && {
107
- alignItems: 'flex-start'
108
- }, ownerState.divider && {
109
- borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
110
- backgroundClip: 'padding-box'
111
- }, ownerState.button && {
112
- transition: theme.transitions.create('background-color', {
113
- duration: theme.transitions.duration.shortest
114
- }),
115
- '&:hover': {
116
- textDecoration: 'none',
117
- backgroundColor: (theme.vars || theme).palette.action.hover,
118
- // Reset on touch devices, it doesn't add specificity
119
- '@media (hover: none)': {
120
- backgroundColor: 'transparent'
121
- }
122
86
  },
123
- [`&.${_listItemClasses.default.selected}:hover`]: {
124
- backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
125
- // Reset on touch devices, it doesn't add specificity
126
- '@media (hover: none)': {
127
- backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity)
87
+ variants: [{
88
+ props: ({
89
+ ownerState
90
+ }) => !ownerState.disablePadding,
91
+ style: {
92
+ paddingTop: 8,
93
+ paddingBottom: 8
128
94
  }
129
- }
130
- }, ownerState.hasSecondaryAction && {
131
- // Add some space to avoid collision as `ListItemSecondaryAction`
132
- // is absolutely positioned.
133
- paddingRight: 48
95
+ }, {
96
+ props: ({
97
+ ownerState
98
+ }) => !ownerState.disablePadding && ownerState.dense,
99
+ style: {
100
+ paddingTop: 4,
101
+ paddingBottom: 4
102
+ }
103
+ }, {
104
+ props: ({
105
+ ownerState
106
+ }) => !ownerState.disablePadding && !ownerState.disableGutters,
107
+ style: {
108
+ paddingLeft: 16,
109
+ paddingRight: 16
110
+ }
111
+ }, {
112
+ props: ({
113
+ ownerState
114
+ }) => !ownerState.disablePadding && !!ownerState.secondaryAction,
115
+ style: {
116
+ // Add some space to avoid collision as `ListItemSecondaryAction`
117
+ // is absolutely positioned.
118
+ paddingRight: 48
119
+ }
120
+ }, {
121
+ props: ({
122
+ ownerState
123
+ }) => !!ownerState.secondaryAction,
124
+ style: {
125
+ [`& > .${_ListItemButton.listItemButtonClasses.root}`]: {
126
+ paddingRight: 48
127
+ }
128
+ }
129
+ }, {
130
+ props: {
131
+ alignItems: 'flex-start'
132
+ },
133
+ style: {
134
+ alignItems: 'flex-start'
135
+ }
136
+ }, {
137
+ props: ({
138
+ ownerState
139
+ }) => ownerState.divider,
140
+ style: {
141
+ borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,
142
+ backgroundClip: 'padding-box'
143
+ }
144
+ }, {
145
+ props: ({
146
+ ownerState
147
+ }) => ownerState.button,
148
+ style: {
149
+ transition: theme.transitions.create('background-color', {
150
+ duration: theme.transitions.duration.shortest
151
+ }),
152
+ '&:hover': {
153
+ textDecoration: 'none',
154
+ backgroundColor: (theme.vars || theme).palette.action.hover,
155
+ // Reset on touch devices, it doesn't add specificity
156
+ '@media (hover: none)': {
157
+ backgroundColor: 'transparent'
158
+ }
159
+ },
160
+ [`&.${_listItemClasses.default.selected}:hover`]: {
161
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
162
+ // Reset on touch devices, it doesn't add specificity
163
+ '@media (hover: none)': {
164
+ backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : (0, _colorManipulator.alpha)(theme.palette.primary.main, theme.palette.action.selectedOpacity)
165
+ }
166
+ }
167
+ }
168
+ }, {
169
+ props: ({
170
+ ownerState
171
+ }) => ownerState.hasSecondaryAction,
172
+ style: {
173
+ // Add some space to avoid collision as `ListItemSecondaryAction`
174
+ // is absolutely positioned.
175
+ paddingRight: 48
176
+ }
177
+ }]
134
178
  }));
135
179
  const ListItemContainer = (0, _styled.default)('li', {
136
180
  name: 'MuiListItem',
@@ -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,14 +39,18 @@ const ListItemAvatarRoot = (0, _styled.default)('div', {
39
39
  } = props;
40
40
  return [styles.root, ownerState.alignItems === 'flex-start' && styles.alignItemsFlexStart];
41
41
  }
42
- })(({
43
- ownerState
44
- }) => (0, _extends2.default)({
42
+ })({
45
43
  minWidth: 56,
46
- flexShrink: 0
47
- }, ownerState.alignItems === 'flex-start' && {
48
- marginTop: 8
49
- }));
44
+ flexShrink: 0,
45
+ variants: [{
46
+ props: {
47
+ alignItems: 'flex-start'
48
+ },
49
+ style: {
50
+ marginTop: 8
51
+ }
52
+ }]
53
+ });
50
54
 
51
55
  /**
52
56
  * A simple wrapper to apply `List` styles to an `Avatar`.