@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/Checkbox/Checkbox.js +51 -20
  3. package/FormHelperText/FormHelperText.js +18 -8
  4. package/IconButton/IconButton.js +97 -40
  5. package/ImageList/ImageList.js +16 -14
  6. package/ImageListItem/ImageListItem.js +37 -22
  7. package/ImageListItemBar/ImageListItemBar.js +65 -32
  8. package/ListItem/ListItem.js +94 -50
  9. package/ListItemAvatar/ListItemAvatar.js +12 -8
  10. package/ListItemButton/ListItemButton.js +35 -15
  11. package/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  12. package/ListItemText/ListItemText.js +20 -11
  13. package/ListSubheader/ListSubheader.js +44 -19
  14. package/Radio/Radio.js +50 -20
  15. package/Radio/RadioButtonIcon.js +18 -12
  16. package/Rating/Rating.js +71 -37
  17. package/Table/Table.js +11 -6
  18. package/TableCell/TableCell.js +96 -41
  19. package/TableSortLabel/TableSortLabel.js +19 -9
  20. package/Toolbar/Toolbar.js +33 -17
  21. package/Typography/Typography.js +3 -2
  22. package/index.js +1 -1
  23. package/modern/Checkbox/Checkbox.js +51 -20
  24. package/modern/FormHelperText/FormHelperText.js +18 -8
  25. package/modern/IconButton/IconButton.js +97 -40
  26. package/modern/ImageList/ImageList.js +16 -14
  27. package/modern/ImageListItem/ImageListItem.js +37 -22
  28. package/modern/ImageListItemBar/ImageListItemBar.js +65 -32
  29. package/modern/ListItem/ListItem.js +94 -50
  30. package/modern/ListItemAvatar/ListItemAvatar.js +12 -8
  31. package/modern/ListItemButton/ListItemButton.js +35 -15
  32. package/modern/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  33. package/modern/ListItemText/ListItemText.js +20 -11
  34. package/modern/ListSubheader/ListSubheader.js +44 -19
  35. package/modern/Radio/Radio.js +50 -20
  36. package/modern/Radio/RadioButtonIcon.js +18 -12
  37. package/modern/Rating/Rating.js +71 -37
  38. package/modern/Table/Table.js +11 -6
  39. package/modern/TableCell/TableCell.js +96 -41
  40. package/modern/TableSortLabel/TableSortLabel.js +19 -9
  41. package/modern/Toolbar/Toolbar.js +33 -17
  42. package/modern/Typography/Typography.js +3 -2
  43. package/modern/index.js +1 -1
  44. package/modern/styles/experimental_extendTheme.js +2 -1
  45. package/modern/styles/getOverlayAlpha.js +3 -4
  46. package/node/Checkbox/Checkbox.js +54 -23
  47. package/node/FormHelperText/FormHelperText.js +18 -8
  48. package/node/IconButton/IconButton.js +99 -43
  49. package/node/ImageList/ImageList.js +16 -14
  50. package/node/ImageListItem/ImageListItem.js +37 -22
  51. package/node/ImageListItemBar/ImageListItemBar.js +65 -32
  52. package/node/ListItem/ListItem.js +94 -50
  53. package/node/ListItemAvatar/ListItemAvatar.js +12 -8
  54. package/node/ListItemButton/ListItemButton.js +35 -15
  55. package/node/ListItemSecondaryAction/ListItemSecondaryAction.js +12 -8
  56. package/node/ListItemText/ListItemText.js +20 -11
  57. package/node/ListSubheader/ListSubheader.js +44 -19
  58. package/node/Radio/Radio.js +52 -22
  59. package/node/Radio/RadioButtonIcon.js +21 -15
  60. package/node/Rating/Rating.js +71 -37
  61. package/node/Table/Table.js +11 -6
  62. package/node/TableCell/TableCell.js +96 -41
  63. package/node/TableSortLabel/TableSortLabel.js +19 -9
  64. package/node/Toolbar/Toolbar.js +33 -17
  65. package/node/Typography/Typography.js +3 -2
  66. package/node/index.js +1 -1
  67. package/node/styles/experimental_extendTheme.js +1 -0
  68. package/node/styles/getOverlayAlpha.js +4 -5
  69. package/package.json +4 -4
  70. package/styles/experimental_extendTheme.d.ts +2 -0
  71. package/styles/experimental_extendTheme.js +2 -1
  72. package/styles/getOverlayAlpha.d.ts +1 -2
  73. package/styles/getOverlayAlpha.js +3 -4
  74. package/umd/material-ui.development.js +1028 -533
  75. package/umd/material-ui.production.min.js +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.4
4
+
5
+ <!-- generated comparing v6.0.0-alpha.3..next -->
6
+
7
+ _Apr 24, 2024_
8
+
9
+ A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🔥 Converted 3 more Material UI components to use Pigment CSS.
12
+ - ℹ️ Pigment CSS now lives in [its own repository](https://github.com/mui/pigment-css)! From now on, all future development will happen there.
13
+
14
+ ### `@mui/material@6.0.0-alpha.4`
15
+
16
+ - [Checkbox] Convert to support CSS extraction (#41957) @lhilgert9
17
+ - [IconButton] Convert to support CSS extraction (#41850) @gijsbotje
18
+ - [Radio] Convert to support CSS extraction (#41840) @lhilgert9
19
+ - [Typography] Fix ownerState prop placement (#41903) @sai6855
20
+ - Generate typography tokens (#41703) @siriwatknp
21
+ - Move typography CSS variables to `font` (#42003) @siriwatknp
22
+ - Fix getOverlayAlpha type (#41995) @oliviertassinari
23
+ - Support CSS Extraction using codemod (#41935) @siriwatknp
24
+
25
+ ### `@mui/icons-material@6.0.0-alpha.4`
26
+
27
+ - &#8203;<!-- 08 -->[icons] Update the icons package (#41937) @danilo-leal
28
+
29
+ ### Docs
30
+
31
+ - [material-ui] Remove react-swipeable-views from demos as it's no longer maintained (#41912) @soler1212
32
+ - [material-ui] Add dark theme thumbnails for templates (#41947) @zanivan
33
+ - [material-ui] Remove links and interdependencies from free templates (#41941) @zanivan
34
+ - [material-ui] Add missing backticks to HTML tag in the installation page (#41972) @Miguelrom
35
+ - Fix 301 Toolpad links @oliviertassinari
36
+ - Fix 301 image redirections @oliviertassinari
37
+
38
+ ### Core
39
+
40
+ - pnpm docs:zipRules && vale sync @oliviertassinari
41
+ - Remove @pigment-css/\* packages (#41965) @mnajdova
42
+ - [code-infra] Move the HighlightedCode component to @mui/docs (#41859) @Janpot
43
+ - [code-infra] Move the HighlightedCode component to @mui/docs (#41859) @Janpot
44
+ - [code-infra] Make Babel config path configurable in API docs builder (#41999) @michaldudak
45
+ - [docs-infra] Fix flex-shrink pro-plan (#41990) @oliviertassinari
46
+ - [docs-infra] Allow more value uses of MUI (#41706) @oliviertassinari
47
+ - [docs-infra] Move CPU to shared config (#41901) @oliviertassinari
48
+ - [docs-infra] Improve Twitter OG:image (#41860) @oliviertassinari
49
+ - [docs-infra] Adapt docs infra to Base UI docs needs (#41963) @michaldudak
50
+ - [docs-infra] Add demo container design refinements (#41948) @danilo-leal
51
+ - [docs-infra] Use the `getLayout` on the material demo pages (#41936) @alexfauquette
52
+ - [test] Update browser versions in karma config (#42008) @ZeeshanTamboli
53
+ - [website] Remove customer support agent role from website (#41969) @rluzists1
54
+ - [website] Fix grid usage and add stray improvements (#41930) @danilo-leal
55
+
56
+ All contributors of this release in alphabetical order: @alexfauquette, @danilo-leal, @gijsbotje, @Janpot, @lhilgert9, @michaldudak, @Miguelrom, @mnajdova, @oliviertassinari, @rluzists1, @sai6855, @siriwatknp, @soler1212, @zanivan, @ZeeshanTamboli
57
+
3
58
  ## v6.0.0-alpha.3
4
59
 
5
60
  <!-- generated comparing v6.0.0-alpha.2..next -->
@@ -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 useThemeProps from '../styles/useThemeProps';
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
- ownerState
47
- }) => _extends({
48
- color: (theme.vars || theme).palette.text.secondary
49
- }, !ownerState.disableRipple && {
50
- '&:hover': {
51
- 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),
52
- // Reset on touch devices, it doesn't add specificity
53
- '@media (hover: none)': {
54
- backgroundColor: 'transparent'
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
- }, ownerState.color !== 'default' && {
58
- [`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]: {
59
- color: (theme.vars || theme).palette[ownerState.color].main
60
- },
61
- [`&.${checkboxClasses.disabled}`]: {
62
- color: (theme.vars || theme).palette.action.disabled
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, {});
@@ -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
- }, ownerState.size === 'small' && {
61
- marginTop: 4
62
- }, ownerState.contained && {
63
- marginLeft: 14,
64
- marginRight: 14
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 '../styles/styled';
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
- ownerState
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
- }, !ownerState.disableRipple && {
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
- // Reset on touch devices, it doesn't add specificity
59
- '@media (hover: none)': {
60
- backgroundColor: 'transparent'
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
- }, ownerState.edge === 'start' && {
64
- marginLeft: ownerState.size === 'small' ? -3 : -12
65
- }, ownerState.edge === 'end' && {
66
- marginRight: ownerState.size === 'small' ? -3 : -12
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
- const palette = (theme.vars || theme).palette?.[ownerState.color];
72
- return _extends({}, ownerState.color === 'inherit' && {
73
- color: 'inherit'
74
- }, ownerState.color !== 'inherit' && ownerState.color !== 'default' && _extends({
75
- color: palette?.main
76
- }, !ownerState.disableRipple && {
77
- '&:hover': _extends({}, palette && {
78
- backgroundColor: theme.vars ? `rgba(${palette.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(palette.main, theme.palette.action.hoverOpacity)
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
- // Reset on touch devices, it doesn't add specificity
81
- '@media (hover: none)': {
82
- backgroundColor: 'transparent'
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
  /**
@@ -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", "cols", "component", "rowHeight", "gap", "style", "variant"];
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
7
  import integerPropType from '@mui/utils/integerPropType';
@@ -32,19 +32,21 @@ const ImageListRoot = styled('ul', {
32
32
  } = props;
33
33
  return [styles.root, styles[ownerState.variant]];
34
34
  }
35
- })(({
36
- ownerState
37
- }) => {
38
- return _extends({
39
- display: 'grid',
40
- overflowY: 'auto',
41
- listStyle: 'none',
42
- padding: 0,
43
- // Add iOS momentum scrolling for iOS < 13.0
44
- WebkitOverflowScrolling: 'touch'
45
- }, ownerState.variant === 'masonry' && {
46
- display: 'block'
47
- });
35
+ })({
36
+ display: 'grid',
37
+ overflowY: 'auto',
38
+ listStyle: 'none',
39
+ padding: 0,
40
+ // Add iOS momentum scrolling for iOS < 13.0
41
+ WebkitOverflowScrolling: 'touch',
42
+ variants: [{
43
+ props: {
44
+ variant: 'masonry'
45
+ },
46
+ style: {
47
+ display: 'block'
48
+ }
49
+ }]
48
50
  });
49
51
  const ImageList = /*#__PURE__*/React.forwardRef(function ImageList(inProps, ref) {
50
52
  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 = ["children", "className", "cols", "component", "rows", "style"];
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
7
  import integerPropType from '@mui/utils/integerPropType';
@@ -37,32 +37,47 @@ const ImageListItemRoot = styled('li', {
37
37
  [`& .${imageListItemClasses.img}`]: styles.img
38
38
  }, styles.root, styles[ownerState.variant]];
39
39
  }
40
- })(({
41
- ownerState
42
- }) => _extends({
40
+ })({
43
41
  display: 'block',
44
- position: 'relative'
45
- }, ownerState.variant === 'standard' && {
46
- // For titlebar under list item
47
- display: 'flex',
48
- flexDirection: 'column'
49
- }, ownerState.variant === 'woven' && {
50
- height: '100%',
51
- alignSelf: 'center',
52
- '&:nth-of-type(even)': {
53
- height: '70%'
54
- }
55
- }, {
56
- [`& .${imageListItemClasses.img}`]: _extends({
42
+ position: 'relative',
43
+ [`& .${imageListItemClasses.img}`]: {
57
44
  objectFit: 'cover',
58
45
  width: '100%',
59
46
  height: '100%',
60
47
  display: 'block'
61
- }, ownerState.variant === 'standard' && {
62
- height: 'auto',
63
- flexGrow: 1
64
- })
65
- }));
48
+ },
49
+ variants: [{
50
+ props: {
51
+ variant: 'standard'
52
+ },
53
+ style: {
54
+ // For titlebar under list item
55
+ display: 'flex',
56
+ flexDirection: 'column'
57
+ }
58
+ }, {
59
+ props: {
60
+ variant: 'woven'
61
+ },
62
+ style: {
63
+ height: '100%',
64
+ alignSelf: 'center',
65
+ '&:nth-of-type(even)': {
66
+ height: '70%'
67
+ }
68
+ }
69
+ }, {
70
+ props: {
71
+ variant: 'standard'
72
+ },
73
+ style: {
74
+ [`& .${imageListItemClasses.img}`]: {
75
+ height: 'auto',
76
+ flexGrow: 1
77
+ }
78
+ }
79
+ }]
80
+ });
66
81
  const ImageListItem = /*#__PURE__*/React.forwardRef(function ImageListItem(inProps, ref) {
67
82
  const props = useThemeProps({
68
83
  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 = ["actionIcon", "actionPosition", "className", "subtitle", "title", "position"];
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
7
  import clsx from 'clsx';
@@ -38,26 +38,41 @@ const ImageListItemBarRoot = styled('div', {
38
38
  return [styles.root, styles[`position${capitalize(ownerState.position)}`]];
39
39
  }
40
40
  })(({
41
- theme,
42
- ownerState
41
+ theme
43
42
  }) => {
44
- return _extends({
43
+ return {
45
44
  position: 'absolute',
46
45
  left: 0,
47
46
  right: 0,
48
47
  background: 'rgba(0, 0, 0, 0.5)',
49
48
  display: 'flex',
50
49
  alignItems: 'center',
51
- fontFamily: theme.typography.fontFamily
52
- }, ownerState.position === 'bottom' && {
53
- bottom: 0
54
- }, ownerState.position === 'top' && {
55
- top: 0
56
- }, ownerState.position === 'below' && {
57
- position: 'relative',
58
- background: 'transparent',
59
- alignItems: 'normal'
60
- });
50
+ fontFamily: theme.typography.fontFamily,
51
+ variants: [{
52
+ props: {
53
+ position: 'bottom'
54
+ },
55
+ style: {
56
+ bottom: 0
57
+ }
58
+ }, {
59
+ props: {
60
+ position: 'top'
61
+ },
62
+ style: {
63
+ top: 0
64
+ }
65
+ }, {
66
+ props: {
67
+ position: 'below'
68
+ },
69
+ style: {
70
+ position: 'relative',
71
+ background: 'transparent',
72
+ alignItems: 'normal'
73
+ }
74
+ }]
75
+ };
61
76
  });
62
77
  const ImageListItemBarTitleWrap = styled('div', {
63
78
  name: 'MuiImageListItemBar',
@@ -69,22 +84,37 @@ const ImageListItemBarTitleWrap = styled('div', {
69
84
  return [styles.titleWrap, styles[`titleWrap${capitalize(ownerState.position)}`], ownerState.actionIcon && styles[`titleWrapActionPos${capitalize(ownerState.actionPosition)}`]];
70
85
  }
71
86
  })(({
72
- theme,
73
- ownerState
87
+ theme
74
88
  }) => {
75
- return _extends({
89
+ return {
76
90
  flexGrow: 1,
77
91
  padding: '12px 16px',
78
92
  color: (theme.vars || theme).palette.common.white,
79
- overflow: 'hidden'
80
- }, ownerState.position === 'below' && {
81
- padding: '6px 0 12px',
82
- color: 'inherit'
83
- }, ownerState.actionIcon && ownerState.actionPosition === 'left' && {
84
- paddingLeft: 0
85
- }, ownerState.actionIcon && ownerState.actionPosition === 'right' && {
86
- paddingRight: 0
87
- });
93
+ overflow: 'hidden',
94
+ variants: [{
95
+ props: {
96
+ position: 'below'
97
+ },
98
+ style: {
99
+ padding: '6px 0 12px',
100
+ color: 'inherit'
101
+ }
102
+ }, {
103
+ props: ({
104
+ ownerState
105
+ }) => ownerState.actionIcon && ownerState.actionPosition === 'left',
106
+ style: {
107
+ paddingLeft: 0
108
+ }
109
+ }, {
110
+ props: ({
111
+ ownerState
112
+ }) => ownerState.actionIcon && ownerState.actionPosition === 'right',
113
+ style: {
114
+ paddingRight: 0
115
+ }
116
+ }]
117
+ };
88
118
  });
89
119
  const ImageListItemBarTitle = styled('div', {
90
120
  name: 'MuiImageListItemBar',
@@ -125,12 +155,15 @@ const ImageListItemBarActionIcon = styled('div', {
125
155
  } = props;
126
156
  return [styles.actionIcon, styles[`actionIconActionPos${capitalize(ownerState.actionPosition)}`]];
127
157
  }
128
- })(({
129
- ownerState
130
- }) => {
131
- return _extends({}, ownerState.actionPosition === 'left' && {
132
- order: -1
133
- });
158
+ })({
159
+ variants: [{
160
+ props: {
161
+ actionPosition: 'left'
162
+ },
163
+ style: {
164
+ order: -1
165
+ }
166
+ }]
134
167
  });
135
168
  const ImageListItemBar = /*#__PURE__*/React.forwardRef(function ImageListItemBar(inProps, ref) {
136
169
  const props = useThemeProps({