@mui/material 5.15.5 → 5.15.6

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/Avatar/Avatar.js CHANGED
@@ -35,9 +35,8 @@ const AvatarRoot = styled('div', {
35
35
  return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
36
36
  }
37
37
  })(({
38
- theme,
39
- ownerState
40
- }) => _extends({
38
+ theme
39
+ }) => ({
41
40
  position: 'relative',
42
41
  display: 'flex',
43
42
  alignItems: 'center',
@@ -50,18 +49,36 @@ const AvatarRoot = styled('div', {
50
49
  lineHeight: 1,
51
50
  borderRadius: '50%',
52
51
  overflow: 'hidden',
53
- userSelect: 'none'
54
- }, ownerState.variant === 'rounded' && {
55
- borderRadius: (theme.vars || theme).shape.borderRadius
56
- }, ownerState.variant === 'square' && {
57
- borderRadius: 0
58
- }, ownerState.colorDefault && _extends({
59
- color: (theme.vars || theme).palette.background.default
60
- }, theme.vars ? {
61
- backgroundColor: theme.vars.palette.Avatar.defaultBg
62
- } : {
63
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
64
- })));
52
+ userSelect: 'none',
53
+ variants: [{
54
+ props: {
55
+ variant: 'rounded'
56
+ },
57
+ style: {
58
+ borderRadius: (theme.vars || theme).shape.borderRadius
59
+ }
60
+ }, {
61
+ props: {
62
+ variant: 'square'
63
+ },
64
+ style: {
65
+ borderRadius: 0
66
+ }
67
+ }, {
68
+ props: {
69
+ colorDefault: true
70
+ },
71
+ style: _extends({
72
+ color: (theme.vars || theme).palette.background.default
73
+ }, theme.vars ? {
74
+ backgroundColor: theme.vars.palette.Avatar.defaultBg
75
+ } : _extends({
76
+ backgroundColor: theme.palette.grey[400]
77
+ }, theme.applyDarkStyles({
78
+ backgroundColor: theme.palette.grey[600]
79
+ })))
80
+ }]
81
+ }));
65
82
  const AvatarImg = styled('img', {
66
83
  name: 'MuiAvatar',
67
84
  slot: 'Img',