@jetbrains/ring-ui-built 7.0.21 → 7.0.23

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 (47) hide show
  1. package/components/_helpers/avatar-info.js +33 -0
  2. package/components/_helpers/card.js +3 -1
  3. package/components/avatar/avatar-info.d.ts +8 -0
  4. package/components/avatar/avatar-info.js +4 -0
  5. package/components/avatar/avatar-size.d.ts +16 -0
  6. package/components/avatar/avatar-size.js +19 -0
  7. package/components/avatar/avatar.d.ts +4 -16
  8. package/components/avatar/avatar.figma.d.ts +1 -0
  9. package/components/avatar/avatar.figma.js +39 -0
  10. package/components/avatar/avatar.js +14 -26
  11. package/components/avatar/fallback-avatar.d.ts +1 -1
  12. package/components/avatar/fallback-avatar.js +208 -36
  13. package/components/avatar-stack/avatar-stack.js +5 -2
  14. package/components/dropdown-menu/dropdown-menu.js +4 -1
  15. package/components/header/header.js +4 -1
  16. package/components/header/profile.js +5 -2
  17. package/components/header/smart-profile.js +4 -1
  18. package/components/list/list.js +3 -0
  19. package/components/list/list__classes.d.ts +2 -0
  20. package/components/list/list__classes.js +26 -0
  21. package/components/list/list__custom.js +17 -27
  22. package/components/list/list__item.js +35 -46
  23. package/components/list/list__link.js +5 -8
  24. package/components/list/list__users-groups-source.js +4 -1
  25. package/components/pager/pager.js +4 -1
  26. package/components/popup-menu/popup-menu.js +4 -1
  27. package/components/query-assist/query-assist.js +6 -3
  28. package/components/query-assist/query-assist__suggestions.js +4 -1
  29. package/components/select/select.js +5 -2
  30. package/components/select/select__filter.js +4 -1
  31. package/components/select/select__popup.js +4 -1
  32. package/components/style.css +1 -1
  33. package/components/tabs/collapsible-more.js +4 -1
  34. package/components/tabs/collapsible-tabs.d.ts +3 -2
  35. package/components/tabs/collapsible-tabs.js +10 -4
  36. package/components/tabs/dumb-tabs.d.ts +1 -0
  37. package/components/tabs/dumb-tabs.js +4 -1
  38. package/components/tabs/smart-tabs.js +4 -1
  39. package/components/tabs/tabs.js +4 -1
  40. package/components/tags-input/tags-input.js +4 -1
  41. package/components/user-card/card.js +2 -0
  42. package/components/user-card/smart-user-card-tooltip.js +2 -0
  43. package/components/user-card/tooltip.js +2 -0
  44. package/components/user-card/user-card.js +2 -0
  45. package/package.json +1 -1
  46. package/components/avatar/avatar-example-datauri.d.ts +0 -1
  47. 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, { Size } from '../avatar/avatar.js';
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,4 @@
1
+ import 'react/jsx-runtime';
2
+ import 'classnames';
3
+ export { A as default } from '../_helpers/avatar-info.js';
4
+ import './avatar-size.js';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @name Avatar
3
+ */
4
+ export declare enum Size {
5
+ Size16 = 16,
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
+ }
@@ -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
- * @name Avatar
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> {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import figma from '@figma/code-connect';
4
+ import Avatar from './avatar.js';
5
+ import { Size } from './avatar-size.js';
6
+ import 'core-js/modules/web.dom-collections.iterator.js';
7
+ import 'react';
8
+ import 'classnames';
9
+ import 'util-deprecate';
10
+ import '../global/url.js';
11
+ import 'core-js/modules/es.regexp.exec.js';
12
+ import 'core-js/modules/es.string.replace.js';
13
+ import '../global/dom.js';
14
+ import '../global/memoize.js';
15
+ import '../_helpers/avatar-info.js';
16
+ import './fallback-avatar.js';
17
+ import '../global/get-uid.js';
18
+
19
+ figma.connect(Avatar, 'https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?m=auto&node-id=5990-522&t=v8bItK8qotmnbysK-1', {
20
+ props: {
21
+ round: figma.boolean('Round'),
22
+ size: figma.enum('Size', {
23
+ '20 px': Size.Size20,
24
+ '24 px': Size.Size24,
25
+ '28 px': Size.Size28,
26
+ '32 px': Size.Size32,
27
+ '40px': Size.Size40,
28
+ '56px': Size.Size56
29
+ }),
30
+ username: figma.enum('Content', {
31
+ name: 'Samuel Morse'
32
+ }),
33
+ url: figma.enum('Content', {
34
+ 'color/image': 'avatar.png'
35
+ })
36
+ },
37
+ example: props => jsx(Avatar, _objectSpread2({}, props)),
38
+ imports: ['import Avatar, {Size} from "@jetbrains/ring-ui/components/avatar/avatar"']
39
+ });
@@ -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 { jsx, jsxs } from 'react/jsx-runtime';
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
- var styles = {"avatar":"avatar_rui_a03e","subavatar":"subavatar_rui_a03e","empty":"empty_rui_a03e"};
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 jsx("span", _objectSpread2(_objectSpread2({}, restProps), {}, {
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"
@@ -1,4 +1,4 @@
1
- import { Size } from './avatar';
1
+ import { Size } from './avatar-size';
2
2
  export interface FallbackAvatarProps {
3
3
  username: string;
4
4
  size: Size;
@@ -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 = [['#60A800', '#D5CA00'], ['#21D370', '#03E9E1'], ['#3BA1FF', '#36E97D'], ['#00C243', '#00FFFF'], ['#4BE098', '#627FFF'], ['#168BFA', '#26F7C7'], ['#9D4CFF', '#39D3C3'], ['#0A81F6', '#0ACFF6'], ['#765AF8', '#5A91F8'], ['#9E54FF', '#0ACFF6'], ['#B345F1', '#669DFF'], ['#765AF8', '#C059EE'], ['#9039D0', '#C239D0'], ['#9F2AFF', '#FD56FD'], ['#AB3AF2', '#E40568'], ['#9F2AFF', '#E9A80B'], ['#D50F6B', '#E73AE8'], ['#ED5502', '#E73AE8'], ['#ED358C', '#DBED18'], ['#ED358C', '#F9902E'], ['#FF7500', '#FFCA00']];
8
- const Sizes = {
9
- 18: {
10
- radius: 2,
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
- 24: {
19
- radius: 3,
28
+ [Size.Size20]: {
29
+ radius: 4,
20
30
  text: {
21
31
  x: 2,
22
- y: 13
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: 17
51
+ y: 18.5,
52
+ width: 9,
53
+ height: 1.5
28
54
  }
29
55
  },
30
- 32: {
31
- radius: 3,
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: '13px',
76
+ fontSize: '15px',
37
77
  letterSpacing: 1,
38
78
  underscore: {
39
79
  x: 4,
40
- y: 22
80
+ y: 26,
81
+ width: 12,
82
+ height: 2
41
83
  }
42
84
  },
43
- 40: {
44
- radius: 3,
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: 19
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: '15px',
106
+ fontSize: '19px',
50
107
  letterSpacing: 1,
51
108
  underscore: {
52
- x: 6,
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 sizeKeys = Object.keys(Sizes).map(Number);
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 possibleSizeKeys = sizeKeys.filter(key => key >= size);
90
- const sizeKey = possibleSizeKeys.length > 0 ? Math.min(...possibleSizeKeys) : Math.max(...sizeKeys);
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(sizeKey, " ").concat(sizeKey),
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: "0",
101
- y1: "0",
268
+ x1: "1",
269
+ y1: "1",
102
270
  x2: "0",
103
- y2: "1",
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: "1"
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: sizeKey,
118
- height: sizeKey,
285
+ width: size,
286
+ height: size,
119
287
  rx: radius,
120
288
  ry: radius
121
- }), jsxs("text", {
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: [jsx("tspan", {
300
+ children: jsx("tspan", {
131
301
  children: extractLetters(username)
132
- }), sizes.underscore && jsx("tspan", {
133
- x: sizes.underscore.x,
134
- y: sizes.underscore.y,
135
- children: '_'
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 { Size } from '../avatar/avatar.js';
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';
@@ -30,6 +31,8 @@ import '../list/list__link.js';
30
31
  import '../link/link.js';
31
32
  import '../link/clickableLink.js';
32
33
  import '../_helpers/link.js';
34
+ import '../list/list__classes.js';
35
+ import '../list/consts.js';
33
36
  import '../_helpers/list.js';
34
37
  import '../list/list__item.js';
35
38
  import '../checkbox/checkbox.js';
@@ -42,13 +45,13 @@ import 'core-js/modules/es.string.replace.js';
42
45
  import '../global/composeRefs.js';
43
46
  import '../control-help/control-help.js';
44
47
  import '../global/url.js';
48
+ import '../_helpers/avatar-info.js';
45
49
  import '../avatar/fallback-avatar.js';
46
50
  import '../list/list__custom.js';
47
51
  import '../global/get-event-key.js';
48
52
  import '../list/list__title.js';
49
53
  import '../list/list__separator.js';
50
54
  import '../list/list__hint.js';
51
- import '../list/consts.js';
52
55
  import '../dropdown/dropdown.js';
53
56
  import '../global/typescript-utils.js';
54
57
  import '../_helpers/anchor.js';
@@ -32,11 +32,15 @@ import '../list/list__link.js';
32
32
  import '../link/link.js';
33
33
  import '../link/clickableLink.js';
34
34
  import '../_helpers/link.js';
35
+ import '../list/list__classes.js';
36
+ import '../list/consts.js';
35
37
  import '../_helpers/list.js';
36
38
  import '../list/list__item.js';
37
39
  import '../avatar/avatar.js';
38
40
  import '../global/url.js';
39
41
  import 'core-js/modules/es.string.replace.js';
42
+ import '../_helpers/avatar-info.js';
43
+ import '../avatar/avatar-size.js';
40
44
  import '../avatar/fallback-avatar.js';
41
45
  import '../checkbox/checkbox.js';
42
46
  import '@jetbrains/icons/checkmark-12px';
@@ -51,7 +55,6 @@ import '../global/get-event-key.js';
51
55
  import '../list/list__title.js';
52
56
  import '../list/list__separator.js';
53
57
  import '../list/list__hint.js';
54
- import '../list/consts.js';
55
58
  import '../button/button.js';
56
59
  import '@jetbrains/icons/chevron-down';
57
60
  import '@jetbrains/icons/chevron-12px-down';