@jetbrains/ring-ui-built 7.0.22 → 7.0.24
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/components/_helpers/avatar-info.js +33 -0
- package/components/_helpers/card.js +3 -1
- package/components/avatar/avatar-info.d.ts +8 -0
- package/components/avatar/avatar-info.js +4 -0
- package/components/avatar/avatar-size.d.ts +16 -0
- package/components/avatar/avatar-size.js +19 -0
- package/components/avatar/avatar.d.ts +4 -16
- package/components/avatar/avatar.figma.js +3 -1
- package/components/avatar/avatar.js +14 -26
- package/components/avatar/fallback-avatar.d.ts +1 -1
- package/components/avatar/fallback-avatar.js +208 -36
- package/components/avatar-stack/avatar-stack.js +3 -1
- package/components/dropdown-menu/dropdown-menu.js +2 -0
- package/components/header/header.js +2 -0
- package/components/header/profile.js +3 -1
- package/components/header/smart-profile.js +2 -0
- package/components/list/list.js +2 -0
- package/components/list/list__item.js +3 -1
- package/components/list/list__users-groups-source.js +2 -0
- package/components/pager/pager.js +2 -0
- package/components/popup-menu/popup-menu.js +2 -0
- package/components/query-assist/query-assist.js +2 -0
- package/components/query-assist/query-assist__suggestions.js +2 -0
- package/components/select/select.js +3 -1
- package/components/select/select__filter.js +2 -0
- package/components/select/select__popup.js +2 -0
- package/components/style.css +1 -1
- package/components/tabs/collapsible-more.js +2 -0
- package/components/tabs/collapsible-tabs.d.ts +3 -2
- package/components/tabs/collapsible-tabs.js +19 -5
- package/components/tabs/dumb-tabs.d.ts +1 -0
- package/components/tabs/dumb-tabs.js +2 -0
- package/components/tabs/smart-tabs.js +2 -0
- package/components/tabs/tabs.js +2 -0
- package/components/tags-input/tags-input.js +2 -0
- package/components/user-card/card.js +2 -0
- package/components/user-card/smart-user-card-tooltip.js +2 -0
- package/components/user-card/tooltip.js +2 -0
- package/components/user-card/user-card.js +2 -0
- package/package.json +1 -1
- package/components/avatar/avatar-example-datauri.d.ts +0 -1
- package/components/avatar/avatar-example-datauri.js +0 -4
@@ -0,0 +1,33 @@
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
2
|
+
import classNames from 'classnames';
|
3
|
+
import { Size } from '../avatar/avatar-size.js';
|
4
|
+
|
5
|
+
var styles = {"avatar":"avatar_rui_a03e","avatarShadow":"avatarShadow_rui_a03e","avatarInfo":"avatarInfo_rui_a03e","subavatar":"subavatar_rui_a03e","empty":"empty_rui_a03e"};
|
6
|
+
|
7
|
+
const fontSizes = {
|
8
|
+
[Size.Size16]: 9,
|
9
|
+
[Size.Size18]: 9,
|
10
|
+
[Size.Size20]: 9,
|
11
|
+
[Size.Size24]: 11,
|
12
|
+
[Size.Size28]: 12,
|
13
|
+
[Size.Size32]: 14,
|
14
|
+
[Size.Size40]: 16,
|
15
|
+
[Size.Size48]: 16,
|
16
|
+
[Size.Size56]: 22
|
17
|
+
};
|
18
|
+
function AvatarInfo(_ref) {
|
19
|
+
let {
|
20
|
+
size,
|
21
|
+
children
|
22
|
+
} = _ref;
|
23
|
+
const fontSize = fontSizes[size];
|
24
|
+
return jsx("span", {
|
25
|
+
style: {
|
26
|
+
fontSize
|
27
|
+
},
|
28
|
+
className: classNames(styles.avatarInfo),
|
29
|
+
children: children
|
30
|
+
});
|
31
|
+
}
|
32
|
+
|
33
|
+
export { AvatarInfo as A, styles as s };
|
@@ -4,13 +4,14 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { PureComponent } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import copyIcon from '@jetbrains/icons/copy';
|
7
|
-
import Avatar
|
7
|
+
import Avatar from '../avatar/avatar.js';
|
8
8
|
import Link from '../link/link.js';
|
9
9
|
import clipboard from '../clipboard/clipboard.js';
|
10
10
|
import Tag from '../tag/tag.js';
|
11
11
|
import Icon from '../icon/icon.js';
|
12
12
|
import { I18nContext } from '../i18n/i18n-context.js';
|
13
13
|
import Tooltip from '../tooltip/tooltip.js';
|
14
|
+
import { Size } from '../avatar/avatar-size.js';
|
14
15
|
import { Size as Size$1 } from '../icon/icon__constants.js';
|
15
16
|
|
16
17
|
var styles = {"userCardSpaced":"userCardSpaced_rui_6e59","userInformationContainer":"userInformationContainer_rui_6e59","userAvatar":"userAvatar_rui_6e59","userInformation":"userInformation_rui_6e59","userInformationGeneral":"userInformationGeneral_rui_6e59","userNameLine":"userNameLine_rui_6e59","userName":"userName_rui_6e59","userLogin":"userLogin_rui_6e59","userEmail":"userEmail_rui_6e59","userCopyIcon":"userCopyIcon_rui_6e59","userEmailWrapper":"userEmailWrapper_rui_6e59","unverifiedLabel":"unverifiedLabel_rui_6e59","userNameInfo":"userNameInfo_rui_6e59","banLabel":"banLabel_rui_6e59","userActiveStatus":"userActiveStatus_rui_6e59","online":"online_rui_6e59"};
|
@@ -55,6 +56,7 @@ class UserCard extends PureComponent {
|
|
55
56
|
children: [jsx(Avatar, {
|
56
57
|
size: Size.Size56,
|
57
58
|
url: user.avatarUrl,
|
59
|
+
username: user.name,
|
58
60
|
round: true
|
59
61
|
}), !!avatarInfo && avatarInfo]
|
60
62
|
}), jsxs("div", {
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { Size } from './avatar-size';
|
3
|
+
interface InfoAvatarProps {
|
4
|
+
size: Size;
|
5
|
+
children?: ReactNode;
|
6
|
+
}
|
7
|
+
export default function AvatarInfo({ size, children }: InfoAvatarProps): import("react/jsx-runtime").JSX.Element;
|
8
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* @name Avatar
|
3
|
+
*/
|
4
|
+
var Size;
|
5
|
+
(function (Size) {
|
6
|
+
Size[Size["Size16"] = 16] = "Size16";
|
7
|
+
/** @deprecated */
|
8
|
+
Size[Size["Size18"] = 18] = "Size18";
|
9
|
+
Size[Size["Size20"] = 20] = "Size20";
|
10
|
+
Size[Size["Size24"] = 24] = "Size24";
|
11
|
+
Size[Size["Size28"] = 28] = "Size28";
|
12
|
+
Size[Size["Size32"] = 32] = "Size32";
|
13
|
+
Size[Size["Size40"] = 40] = "Size40";
|
14
|
+
/** @deprecated */
|
15
|
+
Size[Size["Size48"] = 48] = "Size48";
|
16
|
+
Size[Size["Size56"] = 56] = "Size56";
|
17
|
+
})(Size || (Size = {}));
|
18
|
+
|
19
|
+
export { Size };
|
@@ -1,19 +1,6 @@
|
|
1
|
-
import { PureComponent, ImgHTMLAttributes } from 'react';
|
2
|
-
|
3
|
-
|
4
|
-
*/
|
5
|
-
export declare enum Size {
|
6
|
-
/** @deprecated */
|
7
|
-
Size18 = 18,
|
8
|
-
Size20 = 20,
|
9
|
-
Size24 = 24,
|
10
|
-
Size28 = 28,
|
11
|
-
Size32 = 32,
|
12
|
-
Size40 = 40,
|
13
|
-
/** @deprecated */
|
14
|
-
Size48 = 48,
|
15
|
-
Size56 = 56
|
16
|
-
}
|
1
|
+
import { PureComponent, ImgHTMLAttributes, ReactNode } from 'react';
|
2
|
+
import { Size } from './avatar-size';
|
3
|
+
export { Size };
|
17
4
|
export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
|
18
5
|
dpr: number;
|
19
6
|
size: Size | number;
|
@@ -22,6 +9,7 @@ export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
22
9
|
round?: boolean | null | undefined;
|
23
10
|
subavatar?: string | null | undefined;
|
24
11
|
username?: string | null | undefined;
|
12
|
+
info?: ReactNode;
|
25
13
|
skipParams?: boolean | null | undefined;
|
26
14
|
}
|
27
15
|
export default class Avatar extends PureComponent<AvatarProps> {
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
3
3
|
import figma from '@figma/code-connect';
|
4
|
-
import Avatar
|
4
|
+
import Avatar from './avatar.js';
|
5
|
+
import { Size } from './avatar-size.js';
|
5
6
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
6
7
|
import 'react';
|
7
8
|
import 'classnames';
|
@@ -11,6 +12,7 @@ import 'core-js/modules/es.regexp.exec.js';
|
|
11
12
|
import 'core-js/modules/es.string.replace.js';
|
12
13
|
import '../global/dom.js';
|
13
14
|
import '../global/memoize.js';
|
15
|
+
import '../_helpers/avatar-info.js';
|
14
16
|
import './fallback-avatar.js';
|
15
17
|
import '../global/get-uid.js';
|
16
18
|
|
@@ -1,36 +1,20 @@
|
|
1
1
|
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
|
-
import {
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
4
4
|
import { PureComponent } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import deprecate from 'util-deprecate';
|
7
7
|
import { isDataURI, parseQueryString, encodeURL } from '../global/url.js';
|
8
8
|
import { getPixelRatio } from '../global/dom.js';
|
9
9
|
import memoize from '../global/memoize.js';
|
10
|
+
import { s as styles, A as AvatarInfo } from '../_helpers/avatar-info.js';
|
10
11
|
import FallbackAvatar from './fallback-avatar.js';
|
12
|
+
import { Size } from './avatar-size.js';
|
11
13
|
import 'core-js/modules/es.regexp.exec.js';
|
12
14
|
import 'core-js/modules/es.string.replace.js';
|
13
15
|
import '../global/get-uid.js';
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
const _excluded = ["size", "url", "dpr", "style", "round", "subavatar", "subavatarSize", "username", "skipParams"];
|
18
|
-
/**
|
19
|
-
* @name Avatar
|
20
|
-
*/
|
21
|
-
var Size;
|
22
|
-
(function (Size) {
|
23
|
-
/** @deprecated */
|
24
|
-
Size[Size["Size18"] = 18] = "Size18";
|
25
|
-
Size[Size["Size20"] = 20] = "Size20";
|
26
|
-
Size[Size["Size24"] = 24] = "Size24";
|
27
|
-
Size[Size["Size28"] = 28] = "Size28";
|
28
|
-
Size[Size["Size32"] = 32] = "Size32";
|
29
|
-
Size[Size["Size40"] = 40] = "Size40";
|
30
|
-
/** @deprecated */
|
31
|
-
Size[Size["Size48"] = 48] = "Size48";
|
32
|
-
Size[Size["Size56"] = 56] = "Size56";
|
33
|
-
})(Size || (Size = {}));
|
17
|
+
const _excluded = ["size", "url", "dpr", "style", "round", "subavatar", "subavatarSize", "username", "info", "skipParams"];
|
34
18
|
const warnSize = memoize(size => deprecate(() => {}, "Avatar: Size".concat(size, " is deprecated and will be removed in 8.0. The supported sizes are: Size20, Size24, Size28, Size32, Size40.")));
|
35
19
|
class Avatar extends PureComponent {
|
36
20
|
constructor() {
|
@@ -60,6 +44,7 @@ class Avatar extends PureComponent {
|
|
60
44
|
subavatar,
|
61
45
|
subavatarSize,
|
62
46
|
username,
|
47
|
+
info,
|
63
48
|
skipParams
|
64
49
|
} = _this$props,
|
65
50
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
@@ -80,17 +65,20 @@ class Avatar extends PureComponent {
|
|
80
65
|
width: subavatarSizeString
|
81
66
|
}, style);
|
82
67
|
if (!url || this.state.errorUrl === url) {
|
83
|
-
return
|
68
|
+
return jsxs("span", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
84
69
|
"data-test": "avatar",
|
85
70
|
className: classNames(styles.avatar, this.props.className, {
|
86
|
-
[styles.empty]: username == null
|
71
|
+
[styles.empty]: username == null && info == null
|
87
72
|
}),
|
88
73
|
style: styleObj,
|
89
|
-
children: username != null && jsx(FallbackAvatar, {
|
74
|
+
children: [username != null && jsx(FallbackAvatar, {
|
90
75
|
size: size,
|
91
76
|
round: round,
|
92
77
|
username: username
|
93
|
-
})
|
78
|
+
}), info != null && jsx(AvatarInfo, {
|
79
|
+
size: size,
|
80
|
+
children: info
|
81
|
+
})]
|
94
82
|
}));
|
95
83
|
}
|
96
84
|
let src = url;
|
@@ -114,7 +102,7 @@ class Avatar extends PureComponent {
|
|
114
102
|
children: [jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
115
103
|
onError: this.handleError,
|
116
104
|
onLoad: this.handleSuccess,
|
117
|
-
className: classNames(styles.avatar, this.props.className),
|
105
|
+
className: classNames(styles.avatar, styles.avatarShadow, this.props.className),
|
118
106
|
style: styleObj,
|
119
107
|
src: src,
|
120
108
|
alt: "User avatar"
|
@@ -133,7 +121,7 @@ class Avatar extends PureComponent {
|
|
133
121
|
"data-test": "avatar",
|
134
122
|
onError: this.handleError,
|
135
123
|
onLoad: this.handleSuccess,
|
136
|
-
className: classNames(styles.avatar, this.props.className),
|
124
|
+
className: classNames(styles.avatar, styles.avatarShadow, this.props.className),
|
137
125
|
style: styleObj,
|
138
126
|
src: src,
|
139
127
|
alt: "User avatar"
|
@@ -3,11 +3,21 @@ import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
4
4
|
import { useMemo } from 'react';
|
5
5
|
import getUID from '../global/get-uid.js';
|
6
|
+
import { Size } from './avatar-size.js';
|
6
7
|
|
7
|
-
const colorPairs = [['#
|
8
|
-
const
|
9
|
-
|
10
|
-
radius:
|
8
|
+
const colorPairs = [['#A5E074', '#E8E093'], ['#6AD8A2', '#79E98F'], ['#7FBAF6', '#7BEBB2'], ['#6DDC8C', '#97FFFF'], ['#8EE5C0', '#A2B6FF'], ['#73B4F5', '#78F8DC'], ['#BA8EFF', '#78DFD6'], ['#63AFF5', '#60E2F5'], ['#A192F7', '#93B2F7'], ['#B989FF', '#60E2F5'], ['#CA7EF7', '#9BBAF8'], ['#A192F7', '#CF94F4'], ['#AB7EE1', '#D58AE3'], ['#BE82FF', '#FFA0FF'], ['#C57EF2', '#F2799E'], ['#BE82FF', '#F2CC83'], ['#E16C9D', '#EF8AE8'], ['#F29766', '#EF8AE8'], ['#F27AA9', '#EAF087'], ['#F27AA9', '#FBBB8C'], ['#FFAB66', '#FFEBA0']];
|
9
|
+
const SizesSquare = {
|
10
|
+
[Size.Size16]: {
|
11
|
+
radius: 4,
|
12
|
+
text: {
|
13
|
+
x: 7.5,
|
14
|
+
y: 11
|
15
|
+
},
|
16
|
+
fontSize: '8px',
|
17
|
+
textAnchor: 'middle'
|
18
|
+
},
|
19
|
+
[Size.Size18]: {
|
20
|
+
radius: 4,
|
11
21
|
text: {
|
12
22
|
x: 9,
|
13
23
|
y: 13
|
@@ -15,46 +25,205 @@ const Sizes = {
|
|
15
25
|
fontSize: '11px',
|
16
26
|
textAnchor: 'middle'
|
17
27
|
},
|
18
|
-
|
19
|
-
radius:
|
28
|
+
[Size.Size20]: {
|
29
|
+
radius: 4,
|
20
30
|
text: {
|
21
31
|
x: 2,
|
22
|
-
y:
|
32
|
+
y: 10
|
33
|
+
},
|
34
|
+
fontSize: '9px',
|
35
|
+
underscore: {
|
36
|
+
x: 3,
|
37
|
+
y: 16,
|
38
|
+
width: 7,
|
39
|
+
height: 1
|
40
|
+
}
|
41
|
+
},
|
42
|
+
[Size.Size24]: {
|
43
|
+
radius: 4,
|
44
|
+
text: {
|
45
|
+
x: 2,
|
46
|
+
y: 12
|
23
47
|
},
|
24
48
|
fontSize: '11px',
|
25
49
|
underscore: {
|
26
50
|
x: 3,
|
27
|
-
y:
|
51
|
+
y: 18.5,
|
52
|
+
width: 9,
|
53
|
+
height: 1.5
|
28
54
|
}
|
29
55
|
},
|
30
|
-
|
31
|
-
radius:
|
56
|
+
[Size.Size28]: {
|
57
|
+
radius: 4,
|
58
|
+
text: {
|
59
|
+
x: 2,
|
60
|
+
y: 14
|
61
|
+
},
|
62
|
+
fontSize: '13px',
|
63
|
+
underscore: {
|
64
|
+
x: 3,
|
65
|
+
y: 22,
|
66
|
+
width: 11,
|
67
|
+
height: 2
|
68
|
+
}
|
69
|
+
},
|
70
|
+
[Size.Size32]: {
|
71
|
+
radius: 4,
|
32
72
|
text: {
|
33
73
|
x: 3,
|
34
74
|
y: 17
|
35
75
|
},
|
36
|
-
fontSize: '
|
76
|
+
fontSize: '15px',
|
37
77
|
letterSpacing: 1,
|
38
78
|
underscore: {
|
39
79
|
x: 4,
|
40
|
-
y:
|
80
|
+
y: 26,
|
81
|
+
width: 12,
|
82
|
+
height: 2
|
41
83
|
}
|
42
84
|
},
|
43
|
-
|
44
|
-
radius:
|
85
|
+
[Size.Size40]: {
|
86
|
+
radius: 4,
|
45
87
|
text: {
|
88
|
+
x: 3,
|
89
|
+
y: 21
|
90
|
+
},
|
91
|
+
fontSize: '19px',
|
92
|
+
letterSpacing: 1,
|
93
|
+
underscore: {
|
46
94
|
x: 5,
|
47
|
-
y:
|
95
|
+
y: 32,
|
96
|
+
width: 15,
|
97
|
+
height: 2.5
|
98
|
+
}
|
99
|
+
},
|
100
|
+
[Size.Size48]: {
|
101
|
+
radius: 4,
|
102
|
+
text: {
|
103
|
+
x: 3,
|
104
|
+
y: 21
|
48
105
|
},
|
49
|
-
fontSize: '
|
106
|
+
fontSize: '19px',
|
50
107
|
letterSpacing: 1,
|
51
108
|
underscore: {
|
52
|
-
x:
|
109
|
+
x: 5,
|
110
|
+
y: 32,
|
111
|
+
width: 15,
|
112
|
+
height: 2.5
|
113
|
+
}
|
114
|
+
},
|
115
|
+
[Size.Size56]: {
|
116
|
+
radius: 4,
|
117
|
+
text: {
|
118
|
+
x: 4,
|
53
119
|
y: 28
|
120
|
+
},
|
121
|
+
fontSize: '26px',
|
122
|
+
letterSpacing: 1,
|
123
|
+
underscore: {
|
124
|
+
x: 7,
|
125
|
+
y: 45,
|
126
|
+
width: 21,
|
127
|
+
height: 3.5
|
54
128
|
}
|
55
129
|
}
|
56
130
|
};
|
57
|
-
const
|
131
|
+
const SizesRound = {
|
132
|
+
[Size.Size16]: {
|
133
|
+
radius: 4,
|
134
|
+
fontSize: '8px',
|
135
|
+
text: {
|
136
|
+
x: '50%',
|
137
|
+
y: '54%'
|
138
|
+
},
|
139
|
+
textAnchor: 'middle',
|
140
|
+
dominantBaseline: 'middle'
|
141
|
+
},
|
142
|
+
[Size.Size18]: {
|
143
|
+
radius: 4,
|
144
|
+
fontSize: '11px',
|
145
|
+
text: {
|
146
|
+
x: '50%',
|
147
|
+
y: '54%'
|
148
|
+
},
|
149
|
+
textAnchor: 'middle',
|
150
|
+
dominantBaseline: 'middle'
|
151
|
+
},
|
152
|
+
[Size.Size20]: {
|
153
|
+
radius: 4,
|
154
|
+
fontSize: '9px',
|
155
|
+
text: {
|
156
|
+
x: '50%',
|
157
|
+
y: '54%'
|
158
|
+
},
|
159
|
+
textAnchor: 'middle',
|
160
|
+
dominantBaseline: 'middle'
|
161
|
+
},
|
162
|
+
[Size.Size24]: {
|
163
|
+
radius: 4,
|
164
|
+
fontSize: '11px',
|
165
|
+
text: {
|
166
|
+
x: '50%',
|
167
|
+
y: '54%'
|
168
|
+
},
|
169
|
+
textAnchor: 'middle',
|
170
|
+
dominantBaseline: 'middle'
|
171
|
+
},
|
172
|
+
[Size.Size28]: {
|
173
|
+
radius: 4,
|
174
|
+
fontSize: '13px',
|
175
|
+
text: {
|
176
|
+
x: '50%',
|
177
|
+
y: '54%'
|
178
|
+
},
|
179
|
+
textAnchor: 'middle',
|
180
|
+
dominantBaseline: 'middle'
|
181
|
+
},
|
182
|
+
[Size.Size32]: {
|
183
|
+
radius: 4,
|
184
|
+
fontSize: '15px',
|
185
|
+
text: {
|
186
|
+
x: '50%',
|
187
|
+
y: '54%'
|
188
|
+
},
|
189
|
+
textAnchor: 'middle',
|
190
|
+
dominantBaseline: 'middle',
|
191
|
+
letterSpacing: 1
|
192
|
+
},
|
193
|
+
[Size.Size40]: {
|
194
|
+
radius: 4,
|
195
|
+
fontSize: '19px',
|
196
|
+
letterSpacing: 1,
|
197
|
+
text: {
|
198
|
+
x: '50%',
|
199
|
+
y: '54%'
|
200
|
+
},
|
201
|
+
textAnchor: 'middle',
|
202
|
+
dominantBaseline: 'middle'
|
203
|
+
},
|
204
|
+
[Size.Size48]: {
|
205
|
+
radius: 4,
|
206
|
+
fontSize: '19px',
|
207
|
+
letterSpacing: 1,
|
208
|
+
text: {
|
209
|
+
x: '50%',
|
210
|
+
y: '54%'
|
211
|
+
},
|
212
|
+
textAnchor: 'middle',
|
213
|
+
dominantBaseline: 'middle'
|
214
|
+
},
|
215
|
+
[Size.Size56]: {
|
216
|
+
radius: 4,
|
217
|
+
fontSize: '26px',
|
218
|
+
letterSpacing: 1,
|
219
|
+
text: {
|
220
|
+
x: '50%',
|
221
|
+
y: '54%'
|
222
|
+
},
|
223
|
+
textAnchor: 'middle',
|
224
|
+
dominantBaseline: 'middle'
|
225
|
+
}
|
226
|
+
};
|
58
227
|
function extractLetters(name) {
|
59
228
|
const names = name.split(/[\s._]+/).filter(Boolean).map(word => Array.from(word));
|
60
229
|
if (names.length >= 2) {
|
@@ -86,27 +255,26 @@ function FallbackAvatar(_ref) {
|
|
86
255
|
} = _ref;
|
87
256
|
const hash = Math.abs(hashCode(username.toLowerCase()));
|
88
257
|
const [fromColor, toColor] = colorPairs[hash % colorPairs.length];
|
89
|
-
const
|
90
|
-
const
|
91
|
-
const sizes = Sizes[sizeKey];
|
258
|
+
const sizes = round ? SizesRound[size] : SizesSquare[size];
|
259
|
+
const underscore = sizes.underscore;
|
92
260
|
const radius = round ? '50%' : sizes.radius;
|
93
261
|
const gradientId = useMemo(() => getUID('gradient-'), []);
|
94
262
|
return jsxs("svg", {
|
95
|
-
viewBox: "0 0 ".concat(
|
263
|
+
viewBox: "0 0 ".concat(size, " ").concat(size),
|
96
264
|
xmlns: "http://www.w3.org/2000/svg",
|
97
265
|
children: [jsx("defs", {
|
98
266
|
children: jsxs("linearGradient", {
|
99
267
|
id: gradientId,
|
100
|
-
x1: "
|
101
|
-
y1: "
|
268
|
+
x1: "1",
|
269
|
+
y1: "1",
|
102
270
|
x2: "0",
|
103
|
-
y2: "
|
271
|
+
y2: "0",
|
104
272
|
children: [jsx("stop", {
|
105
273
|
stopColor: fromColor,
|
106
274
|
offset: "0"
|
107
275
|
}), jsx("stop", {
|
108
276
|
stopColor: toColor,
|
109
|
-
offset: "
|
277
|
+
offset: "0.8"
|
110
278
|
})]
|
111
279
|
})
|
112
280
|
}), jsxs("g", {
|
@@ -114,26 +282,30 @@ function FallbackAvatar(_ref) {
|
|
114
282
|
fill: "url(#".concat(gradientId, ")"),
|
115
283
|
x: "0",
|
116
284
|
y: "0",
|
117
|
-
width:
|
118
|
-
height:
|
285
|
+
width: size,
|
286
|
+
height: size,
|
119
287
|
rx: radius,
|
120
288
|
ry: radius
|
121
|
-
}),
|
289
|
+
}), jsx("text", {
|
122
290
|
x: sizes.text.x,
|
123
291
|
y: sizes.text.y,
|
124
|
-
fontFamily: "Arial, Helvetica, sans-serif",
|
292
|
+
fontFamily: "var(--ring-font-family, 'Arial, Helvetica, sans-serif')",
|
125
293
|
fontSize: sizes.fontSize,
|
294
|
+
fontWeight: "600",
|
126
295
|
letterSpacing: sizes.letterSpacing,
|
127
296
|
fill: "#FFFFFF",
|
297
|
+
dominantBaseline: sizes.dominantBaseline,
|
128
298
|
textAnchor: sizes.textAnchor,
|
129
299
|
cursor: "default",
|
130
|
-
children:
|
300
|
+
children: jsx("tspan", {
|
131
301
|
children: extractLetters(username)
|
132
|
-
})
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
302
|
+
})
|
303
|
+
}), underscore && jsx("rect", {
|
304
|
+
fill: "#FFFFFF",
|
305
|
+
x: underscore.x,
|
306
|
+
y: underscore.y,
|
307
|
+
width: underscore.width,
|
308
|
+
height: underscore.height
|
137
309
|
}), jsx("title", {
|
138
310
|
children: username
|
139
311
|
})]
|
@@ -4,7 +4,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, Children } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import DropdownMenu from '../dropdown-menu/dropdown-menu.js';
|
7
|
-
import
|
7
|
+
import '../avatar/avatar.js';
|
8
|
+
import { Size } from '../avatar/avatar-size.js';
|
8
9
|
import '../list/list.js';
|
9
10
|
import 'core-js/modules/es.symbol.description.js';
|
10
11
|
import 'core-js/modules/es.string.trim.js';
|
@@ -44,6 +45,7 @@ import 'core-js/modules/es.string.replace.js';
|
|
44
45
|
import '../global/composeRefs.js';
|
45
46
|
import '../control-help/control-help.js';
|
46
47
|
import '../global/url.js';
|
48
|
+
import '../_helpers/avatar-info.js';
|
47
49
|
import '../avatar/fallback-avatar.js';
|
48
50
|
import '../list/list__custom.js';
|
49
51
|
import '../global/get-event-key.js';
|
@@ -39,6 +39,8 @@ import '../list/list__item.js';
|
|
39
39
|
import '../avatar/avatar.js';
|
40
40
|
import '../global/url.js';
|
41
41
|
import 'core-js/modules/es.string.replace.js';
|
42
|
+
import '../_helpers/avatar-info.js';
|
43
|
+
import '../avatar/avatar-size.js';
|
42
44
|
import '../avatar/fallback-avatar.js';
|
43
45
|
import '../checkbox/checkbox.js';
|
44
46
|
import '@jetbrains/icons/checkmark-12px';
|
@@ -43,6 +43,8 @@ import '../global/controls-height.js';
|
|
43
43
|
import '../_helpers/button__classes.js';
|
44
44
|
import '../avatar/avatar.js';
|
45
45
|
import '../global/url.js';
|
46
|
+
import '../_helpers/avatar-info.js';
|
47
|
+
import '../avatar/avatar-size.js';
|
46
48
|
import '../avatar/fallback-avatar.js';
|
47
49
|
import '../dropdown-menu/dropdown-menu.js';
|
48
50
|
import '../list/list.js';
|
@@ -2,13 +2,14 @@ import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
3
3
|
import { PureComponent } from 'react';
|
4
4
|
import classNames from 'classnames';
|
5
|
-
import Avatar
|
5
|
+
import Avatar from '../avatar/avatar.js';
|
6
6
|
import { Button } from '../button/button.js';
|
7
7
|
import DropdownMenu from '../dropdown-menu/dropdown-menu.js';
|
8
8
|
import PopupMenu from '../popup-menu/popup-menu.js';
|
9
9
|
import { I18nContext } from '../i18n/i18n-context.js';
|
10
10
|
import { isTruthy } from '../global/typescript-utils.js';
|
11
11
|
import { s as styles } from '../_helpers/header.js';
|
12
|
+
import { Size } from '../avatar/avatar-size.js';
|
12
13
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
13
14
|
import 'util-deprecate';
|
14
15
|
import '../global/url.js';
|
@@ -16,6 +17,7 @@ import 'core-js/modules/es.regexp.exec.js';
|
|
16
17
|
import 'core-js/modules/es.string.replace.js';
|
17
18
|
import '../global/dom.js';
|
18
19
|
import '../global/memoize.js';
|
20
|
+
import '../_helpers/avatar-info.js';
|
19
21
|
import '../avatar/fallback-avatar.js';
|
20
22
|
import '../global/get-uid.js';
|
21
23
|
import '@jetbrains/icons/chevron-down';
|
@@ -54,6 +54,8 @@ import '../_helpers/link.js';
|
|
54
54
|
import '../group/group.js';
|
55
55
|
import 'react-dom/client';
|
56
56
|
import '../avatar/avatar.js';
|
57
|
+
import '../_helpers/avatar-info.js';
|
58
|
+
import '../avatar/avatar-size.js';
|
57
59
|
import '../avatar/fallback-avatar.js';
|
58
60
|
import '../dropdown-menu/dropdown-menu.js';
|
59
61
|
import '../list/list.js';
|
package/components/list/list.js
CHANGED
@@ -38,6 +38,8 @@ import './list__classes.js';
|
|
38
38
|
import '../avatar/avatar.js';
|
39
39
|
import '../global/url.js';
|
40
40
|
import 'core-js/modules/es.string.replace.js';
|
41
|
+
import '../_helpers/avatar-info.js';
|
42
|
+
import '../avatar/avatar-size.js';
|
41
43
|
import '../avatar/fallback-avatar.js';
|
42
44
|
import '../checkbox/checkbox.js';
|
43
45
|
import '@jetbrains/icons/checkmark-12px';
|