@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/dist/cjs/Avatar/index.js +5 -4
- package/dist/cjs/Avatar/index.js.map +1 -1
- package/dist/cjs/Breadcrumb/index.js +2 -2
- package/dist/cjs/Breadcrumb/index.js.map +1 -1
- package/dist/cjs/List/index.js +2 -2
- package/dist/cjs/List/index.js.map +1 -1
- package/dist/cjs/MenuGroup/index.js +2 -2
- package/dist/cjs/MenuGroup/index.js.map +1 -1
- package/dist/cjs/PageHeaderInputSearch/utils/defaultLocale.js +2 -2
- package/dist/cjs/PageHeaderInputSearch/utils/defaultLocale.js.map +1 -1
- package/dist/cjs/Popover/utils/usePopoverPosition.js +2 -2
- package/dist/cjs/Popover/utils/usePopoverPosition.js.map +1 -1
- package/dist/cjs/Select/index.js +2 -2
- package/dist/cjs/Select/index.js.map +1 -1
- package/dist/esm/Avatar/index.js +5 -3
- package/dist/esm/Avatar/index.js.map +1 -1
- package/dist/types/Avatar/index.d.ts.map +1 -1
- package/dist/types/Button/index.d.ts +1 -1
- package/dist/types/ButtonLink/index.d.ts +1 -2
- package/dist/types/ButtonLink/index.d.ts.map +1 -1
- package/dist/types/Input/index.d.ts +2 -2
- package/dist/types/Link/index.d.ts +1 -1
- package/dist/types/Modal/index.d.ts +1 -1
- package/dist/types/PageHeader/index.d.ts +1 -1
- package/dist/types/Select/index.d.ts +8 -8
- package/dist/types/Tag/index.d.ts +3 -3
- package/dist/types/ThemeSwitcher/index.d.ts +1 -2
- package/dist/types/ThemeSwitcher/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/Avatar/index.tsx +13 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/core",
|
|
3
|
-
"version": "1.0.
|
|
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.
|
|
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.
|
|
53
|
-
"@types/react-window": "^1.8.
|
|
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": "
|
|
62
|
+
"gitHead": "60a50e7c10af17bd9da35a631e74cc3df33d3e7b"
|
|
63
63
|
}
|
package/src/Avatar/index.tsx
CHANGED
|
@@ -74,8 +74,9 @@ const AvatarContainer = styled(
|
|
|
74
74
|
${sizeStyles};
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
|
-
const
|
|
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
|
|
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
|
-
{
|
|
167
|
+
{children ? (
|
|
168
|
+
<IconContainer>{children}</IconContainer>
|
|
169
|
+
) : (
|
|
170
|
+
renderChildren()
|
|
171
|
+
)}
|
|
162
172
|
</AvatarContainer>
|
|
163
173
|
{online && <Online />}
|
|
164
174
|
</Container>
|