@jetbrains/ring-ui-built 7.0.66 → 7.0.71
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/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +16 -24
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { createRoot } from 'react-dom/client';
|
|
4
3
|
import { ControlsHeightContext, getGlobalControlsHeight } from '../global/controls-height.js';
|
|
@@ -6,22 +5,19 @@ import AuthDialog from '../auth-dialog/auth-dialog.js';
|
|
|
6
5
|
import 'react';
|
|
7
6
|
import 'util-deprecate';
|
|
8
7
|
import '../global/configuration.js';
|
|
9
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
10
|
-
import 'core-js/modules/es.string.replace.js';
|
|
11
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
12
8
|
import 'classnames';
|
|
13
9
|
import '../_helpers/island.js';
|
|
14
|
-
import '../island/header.js';
|
|
15
|
-
import '../global/linear-function.js';
|
|
16
|
-
import '../island/adaptive-island-hoc.js';
|
|
17
10
|
import '../island/content.js';
|
|
18
11
|
import 'element-resize-detector';
|
|
19
12
|
import '../global/schedule-raf.js';
|
|
13
|
+
import '../island/adaptive-island-hoc.js';
|
|
14
|
+
import '../global/linear-function.js';
|
|
20
15
|
import '../dialog/dialog.js';
|
|
21
16
|
import 'react-dom';
|
|
22
17
|
import '@jetbrains/icons/close';
|
|
23
18
|
import '../island/island.js';
|
|
24
19
|
import '../global/data-tests.js';
|
|
20
|
+
import '../island/header.js';
|
|
25
21
|
import '../global/get-uid.js';
|
|
26
22
|
import '../shortcuts/shortcuts.js';
|
|
27
23
|
import '../shortcuts/core.js';
|
|
@@ -42,7 +38,6 @@ import '../_helpers/button.classes.js';
|
|
|
42
38
|
import '../popup/popup.target.js';
|
|
43
39
|
import '../popup/popup.js';
|
|
44
40
|
import '../popup/position.js';
|
|
45
|
-
import 'core-js/modules/es.array.sort.js';
|
|
46
41
|
import '../popup/popup.consts.js';
|
|
47
42
|
import '../popup/position-css.js';
|
|
48
43
|
import '../_helpers/dialog-body-scroll-preventer.js';
|
|
@@ -61,14 +56,16 @@ const reactRoot = createRoot(containerElement);
|
|
|
61
56
|
function renderAuthDialog(props) {
|
|
62
57
|
reactRoot.render(jsx(ControlsHeightContext.Provider, {
|
|
63
58
|
value: getGlobalControlsHeight(),
|
|
64
|
-
children: jsx(AuthDialog,
|
|
59
|
+
children: jsx(AuthDialog, {
|
|
60
|
+
...props
|
|
61
|
+
})
|
|
65
62
|
}));
|
|
66
63
|
}
|
|
67
|
-
function showAuthDialog() {
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
function showAuthDialog(props = {}) {
|
|
65
|
+
renderAuthDialog({
|
|
66
|
+
...props,
|
|
70
67
|
show: true
|
|
71
|
-
})
|
|
68
|
+
});
|
|
72
69
|
return () => {
|
|
73
70
|
renderAuthDialog({
|
|
74
71
|
show: false
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import figma from '@figma/code-connect';
|
|
3
2
|
|
|
4
|
-
var _templateObject;
|
|
5
3
|
const instance = figma.selectedInstance;
|
|
6
4
|
const round = instance.getBoolean('Round');
|
|
7
5
|
const size = parseInt(instance.getString('Size'), 10);
|
|
@@ -9,9 +7,9 @@ const content = instance.getString('Content');
|
|
|
9
7
|
const props = [];
|
|
10
8
|
const DEFAULT_SIZE = 20;
|
|
11
9
|
const isDefaultSize = size === DEFAULT_SIZE;
|
|
12
|
-
const imports = [
|
|
10
|
+
const imports = [`import Avatar${isDefaultSize ? '' : ', {Size}'} from '@jetbrains/ring-ui/components/avatar/avatar'`];
|
|
13
11
|
if (!isDefaultSize) {
|
|
14
|
-
props.push(
|
|
12
|
+
props.push(`size={Size.Size${size}}`);
|
|
15
13
|
}
|
|
16
14
|
switch (content) {
|
|
17
15
|
case 'color/image':
|
|
@@ -21,7 +19,7 @@ switch (content) {
|
|
|
21
19
|
props.push('username="Samuel Morse"');
|
|
22
20
|
break;
|
|
23
21
|
case 'label':
|
|
24
|
-
props.push(
|
|
22
|
+
props.push(`info="${instance.findText('Content').textContent}"`);
|
|
25
23
|
break;
|
|
26
24
|
case 'icon':
|
|
27
25
|
imports.push("import Icon from '@jetbrains/ring-ui/components/icon/icon'", "import warningIcon from '@jetbrains/icons/warning.svg'");
|
|
@@ -33,7 +31,9 @@ if (round) {
|
|
|
33
31
|
}
|
|
34
32
|
var avatar_figma = {
|
|
35
33
|
id: 'avatar',
|
|
36
|
-
example: figma.code
|
|
34
|
+
example: figma.code`${imports.join('\n')}
|
|
35
|
+
|
|
36
|
+
<Avatar ${props.map(prop => `${prop} `).join('')}/>`
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export { avatar_figma as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -10,63 +8,65 @@ import memoize from '../global/memoize.js';
|
|
|
10
8
|
import { s as styles, A as AvatarInfo } from '../_helpers/avatar-info.js';
|
|
11
9
|
import FallbackAvatar from './fallback-avatar.js';
|
|
12
10
|
import { Size } from './avatar-size.js';
|
|
13
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
14
|
-
import 'core-js/modules/es.string.replace.js';
|
|
15
11
|
import '../global/get-uid.js';
|
|
16
12
|
|
|
17
|
-
const
|
|
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.")));
|
|
13
|
+
const warnSize = memoize(size => deprecate(() => {}, `Avatar: Size${size} is deprecated and will be removed in 8.0. The supported sizes are: Size20, Size24, Size28, Size32, Size40.`));
|
|
19
14
|
class Avatar extends PureComponent {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
static defaultProps = {
|
|
16
|
+
dpr: getPixelRatio(),
|
|
17
|
+
size: Size.Size20,
|
|
18
|
+
subavatarSize: Size.Size20 / 2,
|
|
19
|
+
style: {}
|
|
20
|
+
};
|
|
21
|
+
state = {
|
|
22
|
+
errorUrl: ''
|
|
23
|
+
};
|
|
24
|
+
handleError = () => {
|
|
25
|
+
this.setState({
|
|
26
|
+
errorUrl: this.props.url
|
|
29
27
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
};
|
|
29
|
+
handleSuccess = () => {
|
|
30
|
+
this.setState({
|
|
31
|
+
errorUrl: ''
|
|
34
32
|
});
|
|
35
|
-
}
|
|
33
|
+
};
|
|
36
34
|
render() {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
35
|
+
const {
|
|
36
|
+
size,
|
|
37
|
+
url,
|
|
38
|
+
dpr,
|
|
39
|
+
style,
|
|
40
|
+
round,
|
|
41
|
+
subavatar,
|
|
42
|
+
subavatarSize,
|
|
43
|
+
username,
|
|
44
|
+
info,
|
|
45
|
+
skipParams,
|
|
46
|
+
...restProps
|
|
47
|
+
} = this.props;
|
|
51
48
|
if ([Size.Size18, Size.Size48].includes(size)) {
|
|
52
49
|
warnSize(size)();
|
|
53
50
|
}
|
|
54
|
-
const sizeString =
|
|
55
|
-
const subavatarSizeString =
|
|
56
|
-
const styleObj =
|
|
51
|
+
const sizeString = `${size}px`;
|
|
52
|
+
const subavatarSizeString = `${subavatarSize}px`;
|
|
53
|
+
const styleObj = {
|
|
57
54
|
height: sizeString,
|
|
58
|
-
width: sizeString
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
width: sizeString,
|
|
56
|
+
...style
|
|
57
|
+
};
|
|
58
|
+
const styleObjGroup = {
|
|
61
59
|
borderRadius: '2px',
|
|
62
60
|
height: subavatarSizeString,
|
|
63
|
-
width: subavatarSizeString
|
|
64
|
-
|
|
61
|
+
width: subavatarSizeString,
|
|
62
|
+
...style
|
|
63
|
+
};
|
|
65
64
|
const classes = classNames(styles.avatar, this.props.className, {
|
|
66
65
|
[styles.round]: round
|
|
67
66
|
});
|
|
68
67
|
if (!url || this.state.errorUrl === url) {
|
|
69
|
-
return jsxs("span",
|
|
68
|
+
return jsxs("span", {
|
|
69
|
+
...restProps,
|
|
70
70
|
"data-test": 'avatar',
|
|
71
71
|
className: classNames(classes, {
|
|
72
72
|
[styles.empty]: (username === null || username === undefined) && (info === null || info === undefined)
|
|
@@ -80,34 +80,38 @@ class Avatar extends PureComponent {
|
|
|
80
80
|
size: size,
|
|
81
81
|
children: info
|
|
82
82
|
})]
|
|
83
|
-
})
|
|
83
|
+
});
|
|
84
84
|
}
|
|
85
85
|
let src = url;
|
|
86
86
|
if (!skipParams && !isDataURI(url)) {
|
|
87
87
|
const [urlStart, query] = url.split('?');
|
|
88
|
-
const queryParams =
|
|
88
|
+
const queryParams = {
|
|
89
|
+
...parseQueryString(query),
|
|
89
90
|
dpr,
|
|
90
91
|
size
|
|
91
|
-
}
|
|
92
|
+
};
|
|
92
93
|
src = encodeURL(urlStart, queryParams);
|
|
93
94
|
}
|
|
94
95
|
let subavatarSrc = null;
|
|
95
96
|
if (subavatar && !isDataURI(subavatar)) {
|
|
96
97
|
const [urlStart, query] = subavatar.split('?');
|
|
97
|
-
const queryParams =
|
|
98
|
+
const queryParams = {
|
|
99
|
+
...parseQueryString(query),
|
|
98
100
|
dpr,
|
|
99
101
|
subavatarSizeString
|
|
100
|
-
}
|
|
102
|
+
};
|
|
101
103
|
subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
|
|
102
104
|
return jsxs("div", {
|
|
103
|
-
children: [jsx("img",
|
|
105
|
+
children: [jsx("img", {
|
|
106
|
+
...restProps,
|
|
104
107
|
onError: this.handleError,
|
|
105
108
|
onLoad: this.handleSuccess,
|
|
106
109
|
className: classNames(classes, styles.avatarShadow),
|
|
107
110
|
style: styleObj,
|
|
108
111
|
src: src,
|
|
109
112
|
alt: 'User avatar'
|
|
110
|
-
})
|
|
113
|
+
}), jsx("img", {
|
|
114
|
+
...restProps,
|
|
111
115
|
"data-test": 'avatar',
|
|
112
116
|
onError: this.handleError,
|
|
113
117
|
onLoad: this.handleSuccess,
|
|
@@ -115,10 +119,11 @@ class Avatar extends PureComponent {
|
|
|
115
119
|
style: styleObjGroup,
|
|
116
120
|
src: subavatarSrc,
|
|
117
121
|
alt: 'Subavatar'
|
|
118
|
-
})
|
|
122
|
+
})]
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
|
-
return jsx("img",
|
|
125
|
+
return jsx("img", {
|
|
126
|
+
...restProps,
|
|
122
127
|
"data-test": 'avatar',
|
|
123
128
|
onError: this.handleError,
|
|
124
129
|
onLoad: this.handleSuccess,
|
|
@@ -126,14 +131,8 @@ class Avatar extends PureComponent {
|
|
|
126
131
|
style: styleObj,
|
|
127
132
|
src: src,
|
|
128
133
|
alt: 'User avatar'
|
|
129
|
-
})
|
|
134
|
+
});
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
|
-
_defineProperty(Avatar, "defaultProps", {
|
|
133
|
-
dpr: getPixelRatio(),
|
|
134
|
-
size: Size.Size20,
|
|
135
|
-
subavatarSize: Size.Size20 / 2,
|
|
136
|
-
style: {}
|
|
137
|
-
});
|
|
138
137
|
|
|
139
138
|
export { Size, Avatar as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { useMemo } from 'react';
|
|
5
3
|
import getUID from '../global/get-uid.js';
|
|
@@ -233,7 +231,7 @@ function extractLetters(name) {
|
|
|
233
231
|
if (names[0].length >= 2) {
|
|
234
232
|
return names[0].slice(0, 2).join('').toUpperCase();
|
|
235
233
|
}
|
|
236
|
-
return
|
|
234
|
+
return `${names[0][0].toUpperCase()}X`;
|
|
237
235
|
}
|
|
238
236
|
return 'XX';
|
|
239
237
|
}
|
|
@@ -246,12 +244,11 @@ function hashCode(s) {
|
|
|
246
244
|
}
|
|
247
245
|
return h;
|
|
248
246
|
}
|
|
249
|
-
function FallbackAvatar(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
} = _ref;
|
|
247
|
+
function FallbackAvatar({
|
|
248
|
+
username,
|
|
249
|
+
size,
|
|
250
|
+
round
|
|
251
|
+
}) {
|
|
255
252
|
const hash = Math.abs(hashCode(username.toLowerCase()));
|
|
256
253
|
const [fromColor, toColor] = colorPairs[hash % colorPairs.length];
|
|
257
254
|
const sizes = round ? SizesRound[size] : SizesSquare[size];
|
|
@@ -259,7 +256,7 @@ function FallbackAvatar(_ref) {
|
|
|
259
256
|
const radius = round ? '50%' : sizes.radius;
|
|
260
257
|
const gradientId = useMemo(() => getUID('gradient-'), []);
|
|
261
258
|
return jsxs("svg", {
|
|
262
|
-
viewBox:
|
|
259
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
263
260
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
264
261
|
children: [jsx("defs", {
|
|
265
262
|
children: jsxs("linearGradient", {
|
|
@@ -278,7 +275,7 @@ function FallbackAvatar(_ref) {
|
|
|
278
275
|
})
|
|
279
276
|
}), jsxs("g", {
|
|
280
277
|
children: [jsx("rect", {
|
|
281
|
-
fill:
|
|
278
|
+
fill: `url(#${gradientId})`,
|
|
282
279
|
x: '0',
|
|
283
280
|
y: '0',
|
|
284
281
|
width: size,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
1
|
import figma from '@figma/code-connect';
|
|
5
2
|
|
|
6
|
-
var _sizeString$match
|
|
3
|
+
var _sizeString$match;
|
|
7
4
|
const instance = figma.selectedInstance;
|
|
8
5
|
const sizeString = instance.getString('Size');
|
|
9
6
|
const [sizeSubstring] = (_sizeString$match = sizeString.match(/\d+/)) !== null && _sizeString$match !== void 0 ? _sizeString$match : [];
|
|
@@ -14,7 +11,7 @@ const props = [];
|
|
|
14
11
|
const DEFAULT_SIZE = 20;
|
|
15
12
|
const isDefaultSize = size === DEFAULT_SIZE;
|
|
16
13
|
if (!isDefaultSize) {
|
|
17
|
-
props.push(
|
|
14
|
+
props.push(`size={Size.Size${size}}`);
|
|
18
15
|
}
|
|
19
16
|
const renderedChildren = children.map(child => {
|
|
20
17
|
const {
|
|
@@ -28,12 +25,14 @@ const renderedChildren = children.map(child => {
|
|
|
28
25
|
});
|
|
29
26
|
var avatarStack_figma = {
|
|
30
27
|
id: 'avatar-stack',
|
|
31
|
-
example: figma.code
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
example: figma.code`${imports.join('\n')}
|
|
29
|
+
${renderedChildren[0].imports}
|
|
30
|
+
|
|
31
|
+
<AvatarStack ${props.map(prop => `${prop} `).join('')}>
|
|
32
|
+
${renderedChildren.map(({
|
|
33
|
+
code
|
|
34
|
+
}) => code).join('\n ')}
|
|
35
|
+
</AvatarStack>`
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
export { avatarStack_figma as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { useState, Children } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -8,8 +6,6 @@ import Avatar from '../avatar/avatar.js';
|
|
|
8
6
|
import { f as fontSizes } from '../_helpers/avatar-info.js';
|
|
9
7
|
import { Size } from '../avatar/avatar-size.js';
|
|
10
8
|
import '../list/list.js';
|
|
11
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
12
|
-
import 'core-js/modules/es.string.trim.js';
|
|
13
9
|
import 'react-virtualized/dist/es/List';
|
|
14
10
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
15
11
|
import 'react-virtualized/dist/es/WindowScroller';
|
|
@@ -21,7 +17,6 @@ import '../global/get-uid.js';
|
|
|
21
17
|
import '../global/schedule-raf.js';
|
|
22
18
|
import '../global/memoize.js';
|
|
23
19
|
import '../global/dom.js';
|
|
24
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
25
20
|
import '../shortcuts/shortcuts.js';
|
|
26
21
|
import '../shortcuts/core.js';
|
|
27
22
|
import 'combokeys';
|
|
@@ -35,7 +30,6 @@ import '@jetbrains/icons/remove-12px';
|
|
|
35
30
|
import '../icon/icon.js';
|
|
36
31
|
import '../icon/icon.constants.js';
|
|
37
32
|
import '../_helpers/icon-svg.js';
|
|
38
|
-
import 'core-js/modules/es.string.replace.js';
|
|
39
33
|
import '../global/compose-refs.js';
|
|
40
34
|
import '../control-help/control-help.js';
|
|
41
35
|
import '../link/link.js';
|
|
@@ -65,39 +59,37 @@ import '../popup/popup.js';
|
|
|
65
59
|
import 'react-dom';
|
|
66
60
|
import '../tab-trap/tab-trap.js';
|
|
67
61
|
import '../popup/position.js';
|
|
68
|
-
import 'core-js/modules/es.array.sort.js';
|
|
69
62
|
import '../popup/popup.consts.js';
|
|
70
63
|
import '../popup/popup.target.js';
|
|
71
64
|
import '../popup/position-css.js';
|
|
72
65
|
|
|
73
66
|
var styles = {"avatarStack":"ring-avatar-stack-avatarStack","extraText":"ring-avatar-stack-extraText","item":"ring-avatar-stack-item","size20":"ring-avatar-stack-size20","size24":"ring-avatar-stack-size24","size28":"ring-avatar-stack-size28","size32":"ring-avatar-stack-size32","size40":"ring-avatar-stack-size40","size56":"ring-avatar-stack-size56","hovered":"ring-avatar-stack-hovered","extra":"ring-avatar-stack-extra ring-avatar-stack-item","extraButton":"ring-avatar-stack-extraButton ring-global-resetButton"};
|
|
74
67
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} = _ref,
|
|
84
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
68
|
+
function AvatarStack({
|
|
69
|
+
children,
|
|
70
|
+
className,
|
|
71
|
+
size = Size.Size20,
|
|
72
|
+
extraItems,
|
|
73
|
+
dropdownMenuProps,
|
|
74
|
+
...restProps
|
|
75
|
+
}) {
|
|
85
76
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
86
|
-
return jsxs("div",
|
|
87
|
-
className: classNames(styles.avatarStack, className, styles[
|
|
77
|
+
return jsxs("div", {
|
|
78
|
+
className: classNames(styles.avatarStack, className, styles[`size${size}`], {
|
|
88
79
|
[styles.hovered]: dropdownOpen
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
style:
|
|
92
|
-
height: size
|
|
93
|
-
|
|
80
|
+
}),
|
|
81
|
+
...restProps,
|
|
82
|
+
style: {
|
|
83
|
+
height: size,
|
|
84
|
+
...restProps.style
|
|
85
|
+
},
|
|
94
86
|
children: [Children.map(children, (child, index) => jsx("div", {
|
|
95
87
|
className: styles.item,
|
|
96
88
|
style: {
|
|
97
89
|
'--ring-avatar-stack-index': index
|
|
98
90
|
},
|
|
99
91
|
children: child
|
|
100
|
-
})), extraItems
|
|
92
|
+
})), extraItems?.length ? jsx(DropdownMenu, {
|
|
101
93
|
hoverMode: true,
|
|
102
94
|
hoverShowTimeOut: 10,
|
|
103
95
|
onShow: () => setDropdownOpen(true),
|
|
@@ -116,16 +108,18 @@ function AvatarStack(_ref) {
|
|
|
116
108
|
size: size,
|
|
117
109
|
info: jsx("span", {
|
|
118
110
|
className: styles.extraText,
|
|
119
|
-
children:
|
|
111
|
+
children: `+${extraItems.length}`
|
|
120
112
|
})
|
|
121
113
|
})
|
|
122
114
|
}),
|
|
123
115
|
data: extraItems,
|
|
124
|
-
menuProps:
|
|
125
|
-
offset: 4
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
116
|
+
menuProps: {
|
|
117
|
+
offset: 4,
|
|
118
|
+
...dropdownMenuProps?.menuProps
|
|
119
|
+
},
|
|
120
|
+
...dropdownMenuProps
|
|
121
|
+
}) : null]
|
|
122
|
+
});
|
|
129
123
|
}
|
|
130
124
|
|
|
131
125
|
export { AvatarStack as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import React__default from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
@@ -10,14 +9,10 @@ import closeIcon from '@jetbrains/icons/close';
|
|
|
10
9
|
import Icon from '../icon/icon.js';
|
|
11
10
|
import Link from '../link/link.js';
|
|
12
11
|
import Tooltip from '../tooltip/tooltip.js';
|
|
13
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
14
12
|
import 'util-deprecate';
|
|
15
13
|
import '../icon/icon.constants.js';
|
|
16
14
|
import '../_helpers/icon-svg.js';
|
|
17
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
18
|
-
import 'core-js/modules/es.string.replace.js';
|
|
19
15
|
import '../global/memoize.js';
|
|
20
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
21
16
|
import '../global/data-tests.js';
|
|
22
17
|
import '../link/clickable-link.js';
|
|
23
18
|
import '../_helpers/link.js';
|
|
@@ -34,7 +29,6 @@ import 'sniffr';
|
|
|
34
29
|
import '../tab-trap/tab-trap.js';
|
|
35
30
|
import '../global/configuration.js';
|
|
36
31
|
import '../popup/position.js';
|
|
37
|
-
import 'core-js/modules/es.array.sort.js';
|
|
38
32
|
import '../popup/popup.consts.js';
|
|
39
33
|
import '../popup/popup.target.js';
|
|
40
34
|
import '../popup/position-css.js';
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import figma from '@figma/code-connect';
|
|
3
2
|
|
|
4
|
-
var _templateObject;
|
|
5
3
|
const instance = figma.selectedInstance;
|
|
6
4
|
const imports = ["import Breadcrumbs from '@jetbrains/ring-ui/components/breadcrumbs/breadcrumbs'", "import Link from '@jetbrains/ring-ui/components/link/link'"];
|
|
7
5
|
const children = instance.findLayers(() => true).map(layer => layer.textContent).filter(text => text !== '/');
|
|
8
6
|
var breadcrumbs_figma = {
|
|
9
7
|
id: 'breadcrumbs',
|
|
10
|
-
example: figma.code
|
|
11
|
-
|
|
8
|
+
example: figma.code`${imports.join('\n')}
|
|
9
|
+
|
|
10
|
+
<Breadcrumbs>
|
|
11
|
+
${children.map((text, index) => {
|
|
12
|
+
const props = [`href="/page${index + 1}"`];
|
|
12
13
|
if (index === children.length - 1) {
|
|
13
14
|
props.push('active');
|
|
14
15
|
}
|
|
15
|
-
return
|
|
16
|
-
}).join('\n ')
|
|
16
|
+
return `<Link ${props.map(prop => `${prop} `).join('')}>${text}</Link>`;
|
|
17
|
+
}).join('\n ')}
|
|
18
|
+
</Breadcrumbs>`
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
export { breadcrumbs_figma as default };
|
|
@@ -4,11 +4,10 @@ import { Children, Fragment } from 'react';
|
|
|
4
4
|
|
|
5
5
|
var styles = {"separator":"ring-breadcrumbs-separator"};
|
|
6
6
|
|
|
7
|
-
function Breadcrumbs(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
7
|
+
function Breadcrumbs({
|
|
8
|
+
separatorClassName,
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
12
11
|
return Children.toArray(children).map((child, index) =>
|
|
13
12
|
// eslint-disable-next-line react/no-array-index-key
|
|
14
13
|
jsxs(Fragment, {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import figma from '@figma/code-connect';
|
|
3
2
|
|
|
4
|
-
var _templateObject;
|
|
5
3
|
const instance = figma.selectedInstance;
|
|
6
4
|
const size = instance.getString('Size');
|
|
7
5
|
const type = instance.getString('Type');
|
|
@@ -13,7 +11,7 @@ const DEFAULT_SIZE = 'M';
|
|
|
13
11
|
const isDefaultSize = size === DEFAULT_SIZE;
|
|
14
12
|
if (!isDefaultSize) {
|
|
15
13
|
imports.push("import {ControlsHeight} from '@jetbrains/ring-ui/components/global/controls-height'");
|
|
16
|
-
props.push(
|
|
14
|
+
props.push(`height={ControlsHeight.${size}}`);
|
|
17
15
|
}
|
|
18
16
|
switch (variant) {
|
|
19
17
|
case 'Red outlined':
|
|
@@ -46,16 +44,16 @@ switch (type) {
|
|
|
46
44
|
props.push('dropdown');
|
|
47
45
|
break;
|
|
48
46
|
case 'L-Icon-Label':
|
|
49
|
-
imports.push(
|
|
47
|
+
imports.push(`import downloadIcon from '@jetbrains/icons/download${use12pxIcon ? '-12px' : ''}'`);
|
|
50
48
|
props.push('icon={downloadIcon}');
|
|
51
49
|
break;
|
|
52
50
|
case 'Icon':
|
|
53
|
-
imports.push(
|
|
51
|
+
imports.push(`import addIcon from '@jetbrains/icons/add${use12pxIcon ? '-12px' : ''}'`);
|
|
54
52
|
props.push('icon={addIcon}');
|
|
55
53
|
break;
|
|
56
54
|
case 'Split':
|
|
57
55
|
imports.push("import ButtonGroup from '@jetbrains/ring-ui/components/button-group/button-group'");
|
|
58
|
-
imports.push(
|
|
56
|
+
imports.push(`import chevronDownIcon from '@jetbrains/icons/chevron-down${use12pxIcon ? '-12px' : ''}'`);
|
|
59
57
|
useButtonGroup = true;
|
|
60
58
|
break;
|
|
61
59
|
}
|
|
@@ -64,14 +62,21 @@ switch (state) {
|
|
|
64
62
|
props.push('disabled');
|
|
65
63
|
break;
|
|
66
64
|
}
|
|
67
|
-
const joinedProps = props.map(prop =>
|
|
65
|
+
const joinedProps = props.map(prop => `${prop} `).join('');
|
|
68
66
|
// prettier-ignore
|
|
69
|
-
const button = children ?
|
|
67
|
+
const button = children ? `<Button ${joinedProps}>
|
|
68
|
+
${children}
|
|
69
|
+
</Button>` : `<Button ${joinedProps}/>`;
|
|
70
70
|
var button_figma = {
|
|
71
71
|
id: 'button',
|
|
72
|
-
example: figma.code
|
|
72
|
+
example: figma.code`${imports.join('\n')}
|
|
73
|
+
|
|
74
|
+
${
|
|
73
75
|
// prettier-ignore
|
|
74
|
-
useButtonGroup ?
|
|
76
|
+
useButtonGroup ? `<ButtonGroup>
|
|
77
|
+
${button}
|
|
78
|
+
<Button ${joinedProps} icon={chevronDownIcon} />
|
|
79
|
+
</ButtonGroup>` : button}`
|
|
75
80
|
};
|
|
76
81
|
|
|
77
82
|
export { button_figma as default };
|