@jetbrains/ring-ui 7.0.30 → 7.0.32
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/avatar/avatar-info.d.ts +1 -0
- package/components/avatar/avatar-info.js +1 -1
- package/components/avatar/avatar.css +1 -1
- package/components/avatar/avatar.figma.js +45 -24
- package/components/avatar-stack/avatar-stack.css +8 -25
- package/components/avatar-stack/avatar-stack.js +8 -2
- package/components/button/button.figma.js +95 -70
- package/components/old-browsers-message/old-browsers-message.css +1 -1
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +2 -2
- package/components/tooltip/tooltip.css +20 -3
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tooltip/tooltip.js +2 -1
- package/components/user-card/card.js +1 -1
- package/package.json +20 -20
- package/components/avatar/avatar.figma.d.ts +0 -1
- package/components/button/button.figma.d.ts +0 -1
- package/components/button-group/button-group.figma.d.ts +0 -1
- package/components/button-group/button-group.figma.js +0 -30
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import styles from './avatar.css';
|
|
4
4
|
import { Size } from './avatar-size';
|
|
5
|
-
const fontSizes = {
|
|
5
|
+
export const fontSizes = {
|
|
6
6
|
[Size.Size16]: 9,
|
|
7
7
|
[Size.Size18]: 9,
|
|
8
8
|
[Size.Size20]: 9,
|
|
@@ -1,24 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=5990-522
|
|
2
|
+
const figma = require('figma');
|
|
3
|
+
|
|
4
|
+
const instance = figma.selectedInstance;
|
|
5
|
+
|
|
6
|
+
const round = instance.getBoolean('Round');
|
|
7
|
+
const size = parseInt(instance.getString('Size'), 10);
|
|
8
|
+
const content = instance.getString('Content');
|
|
9
|
+
|
|
10
|
+
const props = [];
|
|
11
|
+
const DEFAULT_SIZE = 20;
|
|
12
|
+
const isDefaultSize = size === DEFAULT_SIZE;
|
|
13
|
+
const imports = [`import Avatar${isDefaultSize ? '' : ', {Size}'} from '@jetbrains/ring-ui/components/avatar/avatar'`];
|
|
14
|
+
if (!isDefaultSize) {
|
|
15
|
+
props.push(`size={Size.Size${size}}`);
|
|
16
|
+
}
|
|
17
|
+
switch (content) {
|
|
18
|
+
case 'color/image':
|
|
19
|
+
props.push('url="avatar.png"');
|
|
20
|
+
break;
|
|
21
|
+
case 'name':
|
|
22
|
+
props.push('username="Samuel Morse"');
|
|
23
|
+
break;
|
|
24
|
+
case 'label':
|
|
25
|
+
props.push('info="5"');
|
|
26
|
+
break;
|
|
27
|
+
case 'icon':
|
|
28
|
+
imports.push(
|
|
29
|
+
"import Icon from '@jetbrains/ring-ui/components/icon/icon'",
|
|
30
|
+
"import warningIcon from '@jetbrains/icons/warning.svg'",
|
|
31
|
+
);
|
|
32
|
+
props.push('info={<Icon glyph={warningIcon} />}');
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
}
|
|
36
|
+
if (round) {
|
|
37
|
+
props.push('round');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
id: 'avatar',
|
|
42
|
+
example: figma.code`${imports.join('\n')}
|
|
43
|
+
|
|
44
|
+
<Avatar ${props.map(prop => `${prop} `).join('')}/>`,
|
|
45
|
+
};
|
|
@@ -1,37 +1,31 @@
|
|
|
1
1
|
.size20 {
|
|
2
2
|
--ring-avatar-stack-offset: 12px;
|
|
3
3
|
--ring-avatar-stack-mask-image: url('avatar-stack.mask-20.svg');
|
|
4
|
-
--ring-avatar-stack-extra-font-size: 9px
|
|
5
4
|
}
|
|
6
5
|
|
|
7
6
|
.size24 {
|
|
8
7
|
--ring-avatar-stack-offset: 16px;
|
|
9
8
|
--ring-avatar-stack-mask-image: url('avatar-stack.mask-24.svg');
|
|
10
|
-
--ring-avatar-stack-extra-font-size: 11px;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
.size28 {
|
|
14
12
|
--ring-avatar-stack-offset: 18px;
|
|
15
13
|
--ring-avatar-stack-mask-image: url('avatar-stack.mask-28.svg');
|
|
16
|
-
--ring-avatar-stack-extra-font-size: var(--ring-font-size-smaller);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
.size32 {
|
|
20
17
|
--ring-avatar-stack-offset: 20px;
|
|
21
18
|
--ring-avatar-stack-mask-image: url('avatar-stack.mask-32.svg');
|
|
22
|
-
--ring-avatar-stack-extra-font-size: var(--ring-font-size);
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
.size40 {
|
|
26
22
|
--ring-avatar-stack-offset: 26px;
|
|
27
23
|
--ring-avatar-stack-mask-image: url('avatar-stack.mask-40.svg');
|
|
28
|
-
--ring-avatar-stack-extra-font-size: var(--ring-font-size-larger);
|
|
29
24
|
}
|
|
30
25
|
|
|
31
26
|
.size56 {
|
|
32
27
|
--ring-avatar-stack-offset: 42px;
|
|
33
28
|
--ring-avatar-stack-mask-image: url('avatar-stack.mask-56.svg');
|
|
34
|
-
--ring-avatar-stack-extra-font-size: 22px;
|
|
35
29
|
}
|
|
36
30
|
|
|
37
31
|
.avatarStack {
|
|
@@ -80,38 +74,27 @@
|
|
|
80
74
|
|
|
81
75
|
.extra {
|
|
82
76
|
composes: item;
|
|
83
|
-
|
|
84
|
-
color: var(--ring-secondary-color);
|
|
85
|
-
|
|
86
|
-
border-radius: var(--ring-border-radius);
|
|
87
|
-
|
|
88
|
-
background-color: var(--ring-disabled-background-color);
|
|
89
|
-
|
|
90
|
-
font-size: var(--ring-avatar-stack-extra-font-size);
|
|
91
77
|
}
|
|
92
78
|
|
|
93
|
-
.
|
|
79
|
+
.extraButton {
|
|
94
80
|
composes: resetButton from "../global/global.css";
|
|
95
81
|
|
|
96
|
-
display: block;
|
|
97
|
-
|
|
98
|
-
width: 100%;
|
|
99
|
-
height: 100%;
|
|
100
|
-
|
|
101
82
|
cursor: pointer;
|
|
102
|
-
transition: opacity var(--ring-fast-ease);
|
|
103
|
-
text-align: center;
|
|
104
|
-
|
|
105
|
-
opacity: 0;
|
|
106
83
|
|
|
107
84
|
border-radius: var(--ring-border-radius);
|
|
108
85
|
}
|
|
109
86
|
|
|
110
|
-
.
|
|
87
|
+
.extraButton:focus-visible {
|
|
111
88
|
outline: none;
|
|
112
89
|
box-shadow: 0 0 0 2px var(--ring-border-hover-color);
|
|
113
90
|
}
|
|
114
91
|
|
|
92
|
+
.extraText {
|
|
93
|
+
transition: opacity var(--ring-fast-ease);
|
|
94
|
+
|
|
95
|
+
opacity: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
115
98
|
.hovered .extraText,
|
|
116
99
|
.avatarStack:hover .extraText,
|
|
117
100
|
.avatarStack:focus-within .extraText {
|
|
@@ -2,11 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Children, useState } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import DropdownMenu from '../dropdown-menu/dropdown-menu';
|
|
5
|
-
import { Size } from '../avatar/avatar';
|
|
5
|
+
import Avatar, { Size } from '../avatar/avatar';
|
|
6
|
+
import { fontSizes } from '../avatar/avatar-info';
|
|
6
7
|
import styles from './avatar-stack.css';
|
|
7
8
|
export default function AvatarStack({ children, className, size = Size.Size20, extraItems, dropdownMenuProps, ...restProps }) {
|
|
8
9
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
9
10
|
return (_jsxs("div", { className: classNames(styles.avatarStack, className, styles[`size${size}`], {
|
|
10
11
|
[styles.hovered]: dropdownOpen,
|
|
11
|
-
}), ...restProps, children: [Children.map(children, (child, index) => (_jsx("div", { className: styles.item, style: { '--ring-avatar-stack-index': index }, children: child }))), extraItems?.length ? (_jsx(DropdownMenu, { hoverMode: true, hoverShowTimeOut: 10, onShow: () => setDropdownOpen(true), onHide: () => setDropdownOpen(false), className: styles.extra, style: {
|
|
12
|
+
}), ...restProps, children: [Children.map(children, (child, index) => (_jsx("div", { className: styles.item, style: { '--ring-avatar-stack-index': index }, children: child }))), extraItems?.length ? (_jsx(DropdownMenu, { hoverMode: true, hoverShowTimeOut: 10, onShow: () => setDropdownOpen(true), onHide: () => setDropdownOpen(false), className: styles.extra, style: {
|
|
13
|
+
width: size,
|
|
14
|
+
height: size,
|
|
15
|
+
'--ring-avatar-stack-index': Children.count(children),
|
|
16
|
+
fontSize: fontSizes[size],
|
|
17
|
+
}, anchor: _jsx("button", { type: "button", className: styles.extraButton, children: _jsx(Avatar, { size: size, info: _jsx("span", { className: styles.extraText, children: `+${extraItems.length}` }) }) }), data: extraItems, menuProps: { offset: 4, ...dropdownMenuProps?.menuProps }, ...dropdownMenuProps })) : null] }));
|
|
12
18
|
}
|
|
@@ -1,70 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
imports
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
const figma = require('figma');
|
|
2
|
+
|
|
3
|
+
const instance = figma.selectedInstance;
|
|
4
|
+
|
|
5
|
+
const size = instance.getString('Size');
|
|
6
|
+
const type = instance.getString('Type');
|
|
7
|
+
const state = instance.getString('State');
|
|
8
|
+
const variant = instance.getString('Variant');
|
|
9
|
+
|
|
10
|
+
const imports = ["import Button from '@jetbrains/ring-ui/components/button/button'"];
|
|
11
|
+
const props = [];
|
|
12
|
+
const DEFAULT_SIZE = 'M';
|
|
13
|
+
const isDefaultSize = size === DEFAULT_SIZE;
|
|
14
|
+
|
|
15
|
+
if (!isDefaultSize) {
|
|
16
|
+
imports.push("import {ControlsHeight} from '@jetbrains/ring-ui/components/global/controls-height'");
|
|
17
|
+
props.push(`height={ControlsHeight.${size}}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
switch (variant) {
|
|
21
|
+
case 'Red outlined':
|
|
22
|
+
props.push('danger');
|
|
23
|
+
break;
|
|
24
|
+
case 'Main':
|
|
25
|
+
props.push('primary');
|
|
26
|
+
break;
|
|
27
|
+
case 'Green':
|
|
28
|
+
props.push('success');
|
|
29
|
+
break;
|
|
30
|
+
case 'Red solid':
|
|
31
|
+
props.push('error');
|
|
32
|
+
break;
|
|
33
|
+
case 'Gray':
|
|
34
|
+
props.push('secondary');
|
|
35
|
+
break;
|
|
36
|
+
case 'Ghost':
|
|
37
|
+
props.push('ghost');
|
|
38
|
+
break;
|
|
39
|
+
case 'Text':
|
|
40
|
+
props.push('inline');
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let children = 'Button';
|
|
46
|
+
const use12pxIcon = size === 'S' && variant !== 'Text';
|
|
47
|
+
let useButtonGroup = false;
|
|
48
|
+
switch (type) {
|
|
49
|
+
case 'R-Icon-Label':
|
|
50
|
+
props.push('dropdown');
|
|
51
|
+
break;
|
|
52
|
+
case 'L-Icon-Label':
|
|
53
|
+
imports.push(`import downloadIcon from '@jetbrains/icons/download${use12pxIcon ? '-12px' : ''}'`);
|
|
54
|
+
props.push('icon={downloadIcon}');
|
|
55
|
+
break;
|
|
56
|
+
case 'Icon':
|
|
57
|
+
children = null;
|
|
58
|
+
imports.push(`import addIcon from '@jetbrains/icons/add${use12pxIcon ? '-12px' : ''}'`);
|
|
59
|
+
props.push('icon={addIcon}');
|
|
60
|
+
break;
|
|
61
|
+
case 'Split':
|
|
62
|
+
imports.push("import ButtonGroup from '@jetbrains/ring-ui/components/button-group/button-group'");
|
|
63
|
+
imports.push(`import chevronDownIcon from '@jetbrains/icons/chevron-down${use12pxIcon ? '-12px' : ''}'`);
|
|
64
|
+
useButtonGroup = true;
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
switch (state) {
|
|
70
|
+
case 'Disabled':
|
|
71
|
+
props.push('disabled');
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const joinedProps = props.map(prop => `${prop} `).join('');
|
|
77
|
+
// prettier-ignore
|
|
78
|
+
const button = children ?
|
|
79
|
+
`<Button ${joinedProps}>
|
|
80
|
+
${children}
|
|
81
|
+
</Button>` : `<Button ${joinedProps}/>`;
|
|
82
|
+
|
|
83
|
+
export default {
|
|
84
|
+
id: 'button',
|
|
85
|
+
example: figma.code`${imports.join('\n')}
|
|
86
|
+
|
|
87
|
+
${
|
|
88
|
+
// prettier-ignore
|
|
89
|
+
useButtonGroup ?
|
|
90
|
+
`<ButtonGroup>
|
|
91
|
+
${button}
|
|
92
|
+
<Button ${joinedProps} icon={chevronDownIcon} />
|
|
93
|
+
</ButtonGroup>` : button
|
|
94
|
+
}`,
|
|
95
|
+
};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
color: var(--ring-text-color);
|
|
11
11
|
|
|
12
|
-
font-family: -
|
|
12
|
+
font-family: system-ui, Ubuntu, "Helvetica Neue", Arial, sans-serif;
|
|
13
13
|
font-size: var(--ring-font-size-larger);
|
|
14
14
|
line-height: calc(2.5 * var(--ring-unit));
|
|
15
15
|
}
|
|
@@ -50,6 +50,7 @@ export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps
|
|
|
50
50
|
stickyHeaderOffset?: string | undefined;
|
|
51
51
|
renderEmpty?: (() => ReactNode) | null | undefined;
|
|
52
52
|
RowComponent: typeof Row;
|
|
53
|
+
customLoader?: ((loaderClassName?: string) => ReactNode) | null | undefined;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Interactive table with selection and keyboard navigation support.
|
|
@@ -109,7 +109,7 @@ export class Table extends PureComponent {
|
|
|
109
109
|
window.scrollTo(scrollX, scrollY);
|
|
110
110
|
};
|
|
111
111
|
render() {
|
|
112
|
-
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getMetaColumnClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty, RowComponent, } = this.props;
|
|
112
|
+
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getMetaColumnClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty, RowComponent, customLoader, } = this.props;
|
|
113
113
|
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
|
114
114
|
const columnsArray = typeof columns === 'function' ? columns(null) : columns;
|
|
115
115
|
const headerProps = {
|
|
@@ -152,7 +152,7 @@ export class Table extends PureComponent {
|
|
|
152
152
|
const row = (_createElement(RowComponent, { innerRef: ref, level: getItemLevel(value), item: value, showFocus: selection.isFocused(value), autofocus: selection.isFocused(value), focused: focused && selection.isFocused(value), selectable: selectable && isItemSelectable(value), selected: selectable && selection.isSelected(value), onFocus: this.onRowFocus, onSelect: this.onRowSelect, onDoubleClick: onItemDoubleClick, onClick: onItemClick, collapsible: isItemCollapsible(value), parentCollapsible: isParentCollapsible(value), collapsed: isItemCollapsed(value), onCollapse: onItemCollapse, onExpand: onItemExpand, showDisabledSelection: isDisabledSelectionVisible(value), checkboxTooltip: getCheckboxTooltip(value), className: classNames(getItemClassName(value), { [style.draggingRow]: isDragged }), metaColumnClassName: getMetaColumnClassName(value), draggable: draggable, alwaysShowDragHandle: alwaysShowDragHandle, dragHandleTitle: dragHandleTitle, columns: columns, "data-test": getItemDataTest(value), ...restProps, key: restProps.key ?? getItemKey(value) }));
|
|
153
153
|
return isDragged ? (_jsx("table", { style: { ...props.style }, className: style.draggingTable, children: _jsx("tbody", { children: row }) })) : (row);
|
|
154
154
|
};
|
|
155
|
-
return (_jsxs("div", { className: wrapperClasses, "data-test": "ring-table-wrapper", ref: this.props.innerRef, children: [focused && _jsx(Shortcuts, { map: this.props.shortcutsMap, scope: this.state.shortcutsScope }), _jsx("div", { role: "presentation", onMouseDown: this.onMouseDown, children: draggable ? (_jsx(List, { values: data, renderList: renderList, renderItem: renderItem, onChange: this.onSortEnd })) : (renderList({ children: data.map((value, index) => renderItem({ value, index })) })) }), loading && (_jsx("div", { className: style.loadingOverlay, children: _jsx(Loader, { className: loaderClassName }) }))] }));
|
|
155
|
+
return (_jsxs("div", { className: wrapperClasses, "data-test": "ring-table-wrapper", ref: this.props.innerRef, children: [focused && _jsx(Shortcuts, { map: this.props.shortcutsMap, scope: this.state.shortcutsScope }), _jsx("div", { role: "presentation", onMouseDown: this.onMouseDown, children: draggable ? (_jsx(List, { values: data, renderList: renderList, renderItem: renderItem, onChange: this.onSortEnd })) : (renderList({ children: data.map((value, index) => renderItem({ value, index })) })) }), loading && (_jsx("div", { className: style.loadingOverlay, children: customLoader ? customLoader(loaderClassName) : _jsx(Loader, { className: loaderClassName }) }))] }));
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
|
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
2
|
|
|
3
|
+
:root {
|
|
4
|
+
--ring-tooltip-background-color: var(--ring-content-background-color);
|
|
5
|
+
--ring-tooltip-text-color: var(--ring-text-color);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:global(.ring-ui-theme-dark) {
|
|
9
|
+
--ring-tooltip-background-color: var(--ring-tag-background-color);
|
|
10
|
+
--ring-tooltip-text-color: var(--ring-white-text-color);
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
.tooltip {
|
|
4
14
|
max-width: calc(var(--ring-unit) * 50);
|
|
5
|
-
padding: var(--ring-unit);
|
|
15
|
+
padding: 6px var(--ring-unit);
|
|
6
16
|
|
|
7
17
|
text-align: left;
|
|
8
18
|
|
|
19
|
+
color: var(--ring-tooltip-text-color);
|
|
20
|
+
border-color: var(--ring-line-color);
|
|
21
|
+
background-color: var(--ring-tooltip-background-color);
|
|
22
|
+
box-shadow: 0 2px 8px var(--ring-popup-shadow-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.inheritedTheme {
|
|
9
26
|
color: var(--ring-text-color);
|
|
27
|
+
background-color: var(--ring-content-background-color);
|
|
28
|
+
box-shadow: var(--ring-popup-shadow);
|
|
10
29
|
}
|
|
11
30
|
|
|
12
31
|
.long {
|
|
13
|
-
padding: var(--ring-unit) calc(var(--ring-unit) * 1.5);
|
|
14
|
-
|
|
15
32
|
font-size: var(--ring-font-size-smaller);
|
|
16
33
|
line-height: var(--ring-line-height-lowest);
|
|
17
34
|
}
|
|
@@ -13,7 +13,7 @@ export interface TooltipProps extends Omit<AllHTMLAttributes<HTMLSpanElement>, '
|
|
|
13
13
|
selfOverflowOnly?: boolean | null | undefined;
|
|
14
14
|
popupProps?: Partial<PopupAttrs> | null | undefined;
|
|
15
15
|
title?: ReactNode | null | undefined;
|
|
16
|
-
theme?: Theme;
|
|
16
|
+
theme?: Theme | 'inherit';
|
|
17
17
|
'data-test'?: string | null | undefined;
|
|
18
18
|
long?: boolean | null | undefined;
|
|
19
19
|
}
|
|
@@ -119,6 +119,7 @@ export default class Tooltip extends Component {
|
|
|
119
119
|
const { children, 'data-test': dataTest, title, delay, theme, selfOverflowOnly, popupProps, long, ...restProps } = this.props;
|
|
120
120
|
const ariaProps = typeof title === 'string' && !!title ? { 'aria-label': title, role: 'tooltip' } : {};
|
|
121
121
|
const { onNestedTooltipShow, onNestedTooltipHide } = this;
|
|
122
|
-
|
|
122
|
+
const popup = (_jsx(Popup, { trapFocus: false, anchorElement: this.containerNode, hidden: !this.state.showPopup || this.state.showNestedPopup, onCloseAttempt: this.hidePopup, maxHeight: 400, attached: false, onMouseOut: this.hideIfMovedOutsidePopup, top: 4, dontCloseOnAnchorClick: true, ref: this.popupRef, ...popupProps, className: classNames(styles.tooltip, { [styles.long]: long, [styles.inheritedTheme]: theme === 'inherit' }, popupProps?.className), children: title }));
|
|
123
|
+
return (_jsx(TooltipContext.Provider, { value: { onNestedTooltipShow, onNestedTooltipHide }, children: _jsxs("span", { ...ariaProps, ...restProps, ref: this.containerRef, "data-test": dataTests('ring-tooltip', dataTest), "data-test-title": typeof title === 'string' ? title : undefined, children: [children, theme === 'inherit' ? (popup) : (_jsx(ThemeProvider, { theme: theme, passToPopups: true, WrapperComponent: props => _jsx("span", { ...props }), children: popup }))] }) }));
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -23,7 +23,7 @@ export default class UserCard extends PureComponent {
|
|
|
23
23
|
const translations = this.props.translations;
|
|
24
24
|
const classes = classNames(className, {});
|
|
25
25
|
const userActiveStatusClasses = classNames(styles.userActiveStatus, user.online ? styles.online : '');
|
|
26
|
-
return (_jsx("div", { className: classes,
|
|
26
|
+
return (_jsx("div", { ...restProps, className: classes, children: _jsxs("div", { className: styles.userInformationContainer, children: [_jsxs("div", { className: styles.userAvatar, children: [_jsx(Avatar, { size: AvatarSize.Size56, url: user.avatarUrl, username: user.name, round: true }), !!avatarInfo && avatarInfo] }), _jsxs("div", { className: styles.userInformation, children: [_jsxs("div", { className: styles.userInformationGeneral, children: [_jsxs("div", { className: styles.userNameLine, children: [user.href && (_jsx(Link, { href: user.href, className: styles.userName, "data-test": "user-card-link", children: user.name })), !user.href && _jsx("span", { className: styles.userName, children: user.name }), typeof user.online === 'boolean' && (_jsx("span", { className: userActiveStatusClasses, title: user.online
|
|
27
27
|
? (translations?.online ?? translate('online'))
|
|
28
28
|
: (translations?.offline ?? translate('offline')) })), !!info && _jsx("span", { className: styles.userNameInfo, children: info }), user.banned && (_jsx(Tooltip, { title: user.banReason, children: _jsx(Tag, { className: styles.banLabel, children: translations?.banned ?? translate('banned') }) }))] }), _jsx("div", { className: styles.userLogin, children: user.login }), user.email && (_jsxs("span", { className: styles.userEmailWrapper, children: [_jsx(Link, { href: `mailto:${user.email}`, title: `mailto:${user.email}`, target: "_blank", className: styles.userEmail, children: user.email }), user.unverifiedEmail && (_jsx("span", { className: styles.unverifiedLabel, children: translations?.unverified ?? translate('unverified') })), _jsx(Icon, { title: translations?.copyToClipboard ?? translate('copyToClipboard'), className: styles.userCopyIcon, onClick: this.copyEmail, glyph: copyIcon, size: IconSize.Size14, suppressSizeWarning: true })] }))] }), children] })] }) }));
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.32",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "JetBrains"
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@eslint/compat": "^1.2.6",
|
|
94
94
|
"@eslint/eslintrc": "^3.2.0",
|
|
95
95
|
"@eslint/js": "^9.20.0",
|
|
96
|
-
"@figma/code-connect": "^1.
|
|
96
|
+
"@figma/code-connect": "^1.3.1",
|
|
97
97
|
"@jetbrains/eslint-config": "^6.0.4",
|
|
98
98
|
"@jetbrains/logos": "3.0.0-canary.734b213.0",
|
|
99
99
|
"@jetbrains/rollup-css-plugin": "./packages/rollup-css-plugin",
|
|
@@ -103,18 +103,18 @@
|
|
|
103
103
|
"@rollup/plugin-json": "^6.1.0",
|
|
104
104
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
105
105
|
"@rollup/plugin-replace": "^6.0.2",
|
|
106
|
-
"@storybook/addon-a11y": "8.5.
|
|
107
|
-
"@storybook/addon-docs": "8.5.
|
|
108
|
-
"@storybook/addon-essentials": "8.5.
|
|
109
|
-
"@storybook/addon-themes": "^8.5.
|
|
110
|
-
"@storybook/components": "8.5.
|
|
106
|
+
"@storybook/addon-a11y": "8.5.6",
|
|
107
|
+
"@storybook/addon-docs": "8.5.6",
|
|
108
|
+
"@storybook/addon-essentials": "8.5.6",
|
|
109
|
+
"@storybook/addon-themes": "^8.5.6",
|
|
110
|
+
"@storybook/components": "8.5.6",
|
|
111
111
|
"@storybook/csf": "^0.1.13",
|
|
112
|
-
"@storybook/manager-api": "8.5.
|
|
113
|
-
"@storybook/preview-api": "8.5.
|
|
114
|
-
"@storybook/react": "8.5.
|
|
115
|
-
"@storybook/react-webpack5": "8.5.
|
|
116
|
-
"@storybook/test-runner": "^0.21.
|
|
117
|
-
"@storybook/theming": "8.5.
|
|
112
|
+
"@storybook/manager-api": "8.5.6",
|
|
113
|
+
"@storybook/preview-api": "8.5.6",
|
|
114
|
+
"@storybook/react": "8.5.6",
|
|
115
|
+
"@storybook/react-webpack5": "8.5.6",
|
|
116
|
+
"@storybook/test-runner": "^0.21.1",
|
|
117
|
+
"@storybook/theming": "8.5.6",
|
|
118
118
|
"@testing-library/dom": "^10.4.0",
|
|
119
119
|
"@testing-library/react": "^16.2.0",
|
|
120
120
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -136,8 +136,8 @@
|
|
|
136
136
|
"acorn": "^8.14.0",
|
|
137
137
|
"axe-playwright": "^2.1.0",
|
|
138
138
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
139
|
-
"caniuse-lite": "^1.0.
|
|
140
|
-
"chai": "^5.
|
|
139
|
+
"caniuse-lite": "^1.0.30001700",
|
|
140
|
+
"chai": "^5.2.0",
|
|
141
141
|
"chai-as-promised": "^8.0.1",
|
|
142
142
|
"chai-dom": "^1.10.0",
|
|
143
143
|
"chai-enzyme": "1.0.0-beta.1",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"eslint-plugin-prettier": "^5.2.3",
|
|
157
157
|
"eslint-plugin-react": "^7.37.4",
|
|
158
158
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
159
|
-
"eslint-plugin-storybook": "^0.11.
|
|
159
|
+
"eslint-plugin-storybook": "^0.11.3",
|
|
160
160
|
"events": "^3.3.0",
|
|
161
161
|
"glob": "^11.0.1",
|
|
162
162
|
"globals": "^15.15.0",
|
|
@@ -178,18 +178,18 @@
|
|
|
178
178
|
"react-test-renderer": "^19.0.0",
|
|
179
179
|
"regenerator-runtime": "^0.14.1",
|
|
180
180
|
"rimraf": "^6.0.1",
|
|
181
|
-
"rollup": "^4.34.
|
|
181
|
+
"rollup": "^4.34.8",
|
|
182
182
|
"rollup-plugin-clear": "^2.0.7",
|
|
183
183
|
"sinon": "^19.0.2",
|
|
184
184
|
"sinon-chai": "^4.0.0",
|
|
185
185
|
"storage-mock": "^2.1.0",
|
|
186
|
-
"storybook": "8.5.
|
|
186
|
+
"storybook": "8.5.6",
|
|
187
187
|
"stylelint": "^16.14.1",
|
|
188
188
|
"svg-inline-loader": "^0.8.2",
|
|
189
189
|
"teamcity-service-messages": "^0.1.14",
|
|
190
190
|
"terser-webpack-plugin": "^5.3.11",
|
|
191
191
|
"typescript": "~5.7.3",
|
|
192
|
-
"typescript-eslint": "^8.24.
|
|
192
|
+
"typescript-eslint": "^8.24.1",
|
|
193
193
|
"vitest": "^3.0.5",
|
|
194
194
|
"vitest-teamcity-reporter": "^0.3.1",
|
|
195
195
|
"wallaby-webpack": "^3.9.16",
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
219
|
"dependencies": {
|
|
220
|
-
"@babel/core": "^7.26.
|
|
220
|
+
"@babel/core": "^7.26.9",
|
|
221
221
|
"@babel/preset-typescript": "^7.26.0",
|
|
222
222
|
"@jetbrains/babel-preset-jetbrains": "^2.4.0",
|
|
223
223
|
"@jetbrains/icons": "^5.6.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import figma from '@figma/code-connect';
|
|
3
|
-
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
4
|
-
import Button from '../button/button';
|
|
5
|
-
import { ControlsHeight } from '../global/controls-height';
|
|
6
|
-
import ButtonGroup from './button-group';
|
|
7
|
-
figma.connect(ButtonGroup, 'https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=9954%3A528', {
|
|
8
|
-
props: {
|
|
9
|
-
height: figma.enum('Size', {
|
|
10
|
-
S: ControlsHeight.S,
|
|
11
|
-
M: ControlsHeight.M,
|
|
12
|
-
L: ControlsHeight.L,
|
|
13
|
-
}),
|
|
14
|
-
disabled: figma.enum('State', { Disabled: true }),
|
|
15
|
-
primary: figma.enum('Variant', { Main: true }),
|
|
16
|
-
success: figma.enum('Variant', { Green: true }),
|
|
17
|
-
error: figma.enum('Variant', { 'Red solid': true }),
|
|
18
|
-
secondary: figma.enum('Variant', { Gray: true }),
|
|
19
|
-
danger: figma.enum('Variant', { 'Red outlined': true }),
|
|
20
|
-
ghost: figma.enum('Variant', { Ghost: true }),
|
|
21
|
-
inline: figma.enum('Variant', { Text: true }),
|
|
22
|
-
},
|
|
23
|
-
variant: { Type: 'Split' },
|
|
24
|
-
example: props => (_jsxs(ButtonGroup, { children: [_jsx(Button, { ...props, children: 'Button' }), _jsx(Button, { ...props, icon: chevronDownIcon })] })),
|
|
25
|
-
imports: [
|
|
26
|
-
'import Button from "@jetbrains/ring-ui/components/button/button"',
|
|
27
|
-
'import {ControlsHeight} from "@jetbrains/ring-ui/components/global/controls-height"',
|
|
28
|
-
'import chevronDownIcon from "@jetbrains/icons/chevron-down"',
|
|
29
|
-
],
|
|
30
|
-
});
|