@os-design/core 1.0.236 → 1.0.238

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@os-design/core",
3
- "version": "1.0.236",
3
+ "version": "1.0.238",
4
4
  "license": "UNLICENSED",
5
5
  "repository": "git@gitlab.com:os-team/libs/os-design.git",
6
6
  "main": "dist/cjs/index.js",
@@ -43,14 +43,14 @@
43
43
  "@os-team/password-score": "^1.0.5",
44
44
  "facepaint": "^1.2.1",
45
45
  "react-focus-lock": "^2.9.6",
46
- "react-window": "^1.8.9"
46
+ "react-window": "^1.8.10"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@emotion/react": ">=11",
50
50
  "@emotion/serialize": "*",
51
51
  "@emotion/styled": ">=11",
52
- "@types/facepaint": "^1.2.4",
53
- "@types/react-window": "^1.8.7"
52
+ "@types/facepaint": "^1.2.5",
53
+ "@types/react-window": "^1.8.8"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@emotion/react": ">=11",
@@ -59,5 +59,5 @@
59
59
  "react": ">=18",
60
60
  "react-dom": ">=18"
61
61
  },
62
- "gitHead": "472a5d2519bc0892befd10898920e0c5317eb54a"
62
+ "gitHead": "60a50e7c10af17bd9da35a631e74cc3df33d3e7b"
63
63
  }
@@ -74,8 +74,9 @@ const AvatarContainer = styled(
74
74
  ${sizeStyles};
75
75
  `;
76
76
 
77
- const UserIcon = styled(User)`
77
+ const IconContainer = styled.div`
78
78
  font-size: 0.6em;
79
+ line-height: 0.6;
79
80
  `;
80
81
 
81
82
  const Initials = styled.div`
@@ -118,6 +119,7 @@ const Avatar = forwardRef<HTMLDivElement, AvatarProps>(
118
119
  imageProps = {},
119
120
  online = false,
120
121
  size = '2em',
122
+ children,
121
123
  ...rest
122
124
  },
123
125
  ref
@@ -146,7 +148,11 @@ const Avatar = forwardRef<HTMLDivElement, AvatarProps>(
146
148
  if (initials) return <Initials>{initials}</Initials>;
147
149
 
148
150
  // Otherwise render the user icon
149
- return <UserIcon />;
151
+ return (
152
+ <IconContainer>
153
+ <User />
154
+ </IconContainer>
155
+ );
150
156
  }, [image, imageProps, firstName, lastName]);
151
157
 
152
158
  return (
@@ -158,7 +164,11 @@ const Avatar = forwardRef<HTMLDivElement, AvatarProps>(
158
164
  {...rest}
159
165
  ref={ref}
160
166
  >
161
- {renderChildren()}
167
+ {children ? (
168
+ <IconContainer>{children}</IconContainer>
169
+ ) : (
170
+ renderChildren()
171
+ )}
162
172
  </AvatarContainer>
163
173
  {online && <Online />}
164
174
  </Container>