@jetbrains/ring-ui 7.0.20 → 7.0.22
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.figma.d.ts +1 -0
- package/components/avatar/avatar.figma.js +24 -0
- package/components/list/list.css +11 -17
- package/components/list/list__classes.d.ts +2 -0
- package/components/list/list__classes.js +14 -0
- package/components/list/list__custom.js +4 -9
- package/components/list/list__item.js +5 -11
- package/components/list/list__link.js +3 -8
- package/components/tooltip/tooltip.js +1 -1
- package/package.json +20 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import figma from '@figma/code-connect';
|
|
3
|
+
import Avatar, { Size } from './avatar';
|
|
4
|
+
figma.connect(Avatar, 'https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?m=auto&node-id=5990-522&t=v8bItK8qotmnbysK-1', {
|
|
5
|
+
props: {
|
|
6
|
+
round: figma.boolean('Round'),
|
|
7
|
+
size: figma.enum('Size', {
|
|
8
|
+
'20 px': Size.Size20,
|
|
9
|
+
'24 px': Size.Size24,
|
|
10
|
+
'28 px': Size.Size28,
|
|
11
|
+
'32 px': Size.Size32,
|
|
12
|
+
'40px': Size.Size40,
|
|
13
|
+
'56px': Size.Size56,
|
|
14
|
+
}),
|
|
15
|
+
username: figma.enum('Content', {
|
|
16
|
+
name: 'Samuel Morse',
|
|
17
|
+
}),
|
|
18
|
+
url: figma.enum('Content', {
|
|
19
|
+
'color/image': 'avatar.png',
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
example: props => _jsx(Avatar, { ...props }),
|
|
23
|
+
imports: ['import Avatar, {Size} from "@jetbrains/ring-ui/components/avatar/avatar"'],
|
|
24
|
+
});
|
package/components/list/list.css
CHANGED
|
@@ -78,18 +78,6 @@
|
|
|
78
78
|
line-height: calc(var(--ring-unit) * 2);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.error {
|
|
82
|
-
cursor: default;
|
|
83
|
-
|
|
84
|
-
/* Override ring-link */
|
|
85
|
-
&,
|
|
86
|
-
&:hover,
|
|
87
|
-
&:focus,
|
|
88
|
-
&:visited {
|
|
89
|
-
color: var(--ring-error-color);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
81
|
.add {
|
|
94
82
|
padding: var(--ring-unit) calc(2 * var(--ring-unit));
|
|
95
83
|
|
|
@@ -184,16 +172,19 @@
|
|
|
184
172
|
}
|
|
185
173
|
|
|
186
174
|
/* override link */
|
|
187
|
-
.actionLink.actionLink {
|
|
175
|
+
.actionLink.actionLink.actionLink {
|
|
188
176
|
transition: none;
|
|
177
|
+
text-decoration-line: none;
|
|
178
|
+
|
|
179
|
+
color: var(--ring-text-color);
|
|
189
180
|
}
|
|
190
181
|
|
|
191
|
-
.
|
|
182
|
+
.action:hover {
|
|
192
183
|
background-color: var(--ring-hover-background-color);
|
|
193
184
|
}
|
|
194
185
|
|
|
195
186
|
/* TODO rename .hover to .selected in 8.0 */
|
|
196
|
-
.
|
|
187
|
+
.action.hover {
|
|
197
188
|
background-color: var(--ring-selected-background-color);
|
|
198
189
|
}
|
|
199
190
|
|
|
@@ -310,7 +301,10 @@
|
|
|
310
301
|
}
|
|
311
302
|
|
|
312
303
|
.disabled {
|
|
313
|
-
pointer-events: none;
|
|
314
|
-
|
|
315
304
|
color: var(--ring-disabled-color);
|
|
316
305
|
}
|
|
306
|
+
|
|
307
|
+
.item:not(.action),
|
|
308
|
+
.disabled {
|
|
309
|
+
pointer-events: none;
|
|
310
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import globalStyles from '../global/global.css';
|
|
3
|
+
import { Type } from './consts';
|
|
4
|
+
import styles from './list.css';
|
|
5
|
+
export function getListClasses({ className, disabled, hover, compact, scrolling, rgItemType, }) {
|
|
6
|
+
return classNames(styles.item, globalStyles.resetButton, className, {
|
|
7
|
+
[styles.action]: !disabled,
|
|
8
|
+
[styles.actionLink]: !disabled && rgItemType === Type.LINK,
|
|
9
|
+
[styles.hover]: hover && !disabled,
|
|
10
|
+
[styles.compact]: compact,
|
|
11
|
+
[styles.scrolling]: scrolling,
|
|
12
|
+
[styles.disabled]: disabled,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
3
|
import dataTests from '../global/data-tests';
|
|
5
4
|
import getEventKey from '../global/get-event-key';
|
|
6
|
-
import
|
|
5
|
+
import { getListClasses } from './list__classes';
|
|
7
6
|
export default class ListCustom extends PureComponent {
|
|
8
7
|
handleKeyPress = (event) => {
|
|
9
8
|
const key = getEventKey(event);
|
|
@@ -12,15 +11,11 @@ export default class ListCustom extends PureComponent {
|
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
13
|
render() {
|
|
15
|
-
const {
|
|
16
|
-
const classes =
|
|
17
|
-
[styles.action]: !disabled,
|
|
18
|
-
[styles.hover]: hover && !disabled,
|
|
19
|
-
[styles.scrolling]: scrolling,
|
|
20
|
-
});
|
|
14
|
+
const { disabled, template, tabIndex, onClick, onMouseOver, onMouseUp, role, tagName } = this.props;
|
|
15
|
+
const classes = getListClasses(this.props);
|
|
21
16
|
const dataTest = dataTests('ring-list-item-custom', {
|
|
22
17
|
'ring-list-item-action': !disabled,
|
|
23
|
-
},
|
|
18
|
+
}, this.props['data-test']);
|
|
24
19
|
const content = typeof template === 'function' ? template(this.props) : template;
|
|
25
20
|
const TagName = tagName || 'span';
|
|
26
21
|
return (_jsx(TagName, { role: role || 'button', tabIndex: tabIndex, onClick: onClick, onKeyPress: this.handleKeyPress, onMouseOver: onMouseOver, onFocus: onMouseOver, onMouseUp: onMouseUp, className: classes, "data-test": dataTest, children: content }));
|
|
@@ -6,8 +6,8 @@ import Avatar, { Size as AvatarSize } from '../avatar/avatar';
|
|
|
6
6
|
import Checkbox from '../checkbox/checkbox';
|
|
7
7
|
import Icon from '../icon/icon';
|
|
8
8
|
import getUID from '../global/get-uid';
|
|
9
|
-
import globalStyles from '../global/global.css';
|
|
10
9
|
import styles from './list.css';
|
|
10
|
+
import { getListClasses } from './list__classes';
|
|
11
11
|
/**
|
|
12
12
|
* @constructor
|
|
13
13
|
* @extends {ReactComponent}
|
|
@@ -20,18 +20,12 @@ export default class ListItem extends PureComponent {
|
|
|
20
20
|
stopBubbling = (e) => e.stopPropagation();
|
|
21
21
|
_isString = (val) => typeof val === 'string' || val instanceof String;
|
|
22
22
|
render() {
|
|
23
|
-
const {
|
|
23
|
+
const { disabled, checkbox, avatar, subavatar, glyph, icon, rightGlyph, description, label, title, details, hover, level, tabIndex, onClick, onCheckboxChange, onMouseOver, onMouseDown, onMouseUp, rightNodes, leftNodes, showGeneratedAvatar, username, labelWrapper, } = this.props;
|
|
24
24
|
const checkable = checkbox !== undefined;
|
|
25
25
|
const shouldShowGeneratedAvatar = showGeneratedAvatar && username != null;
|
|
26
26
|
const hasLeftNodes = leftNodes || glyph || avatar || shouldShowGeneratedAvatar;
|
|
27
27
|
const showCheckbox = checkable && (checkbox || !hasLeftNodes || (hover && !disabled));
|
|
28
|
-
const classes =
|
|
29
|
-
[styles.action]: !disabled,
|
|
30
|
-
[styles.hover]: hover && !disabled,
|
|
31
|
-
[styles.compact]: compact,
|
|
32
|
-
[styles.scrolling]: scrolling,
|
|
33
|
-
[styles.disabled]: disabled,
|
|
34
|
-
});
|
|
28
|
+
const classes = getListClasses(this.props);
|
|
35
29
|
const detailsClasses = classNames({
|
|
36
30
|
[styles.details]: details,
|
|
37
31
|
[styles.padded]: icon !== undefined || checkbox !== undefined || glyph !== undefined,
|
|
@@ -50,10 +44,10 @@ export default class ListItem extends PureComponent {
|
|
|
50
44
|
computedTitle = this._isString(label) ? label : '';
|
|
51
45
|
}
|
|
52
46
|
const dataTest = dataTests({
|
|
53
|
-
'ring-list-item': (
|
|
47
|
+
'ring-list-item': (this.props['data-test'] || '').indexOf('ring-list-item') === -1,
|
|
54
48
|
'ring-list-item-action': !disabled,
|
|
55
49
|
'ring-list-item-selected': checkbox,
|
|
56
|
-
},
|
|
50
|
+
}, this.props['data-test']);
|
|
57
51
|
const labelElement = (_jsx("span", { className: styles.label, title: computedTitle, "data-test": "ring-list-item-label", children: label }));
|
|
58
52
|
return (_jsxs("div", { className: styles.itemContainer, "data-test": dataTest, children: [showCheckbox && (_jsx("div", { className: styles.checkboxContainer, children: _jsx(Checkbox, { "aria-labelledby": this.id, checked: checkbox, disabled: disabled, onChange: onCheckboxChange, onClick: this.stopBubbling }) })), _jsxs("button", { id: this.id, type: "button", tabIndex: tabIndex, onClick: onClick, onMouseOver: onMouseOver, onMouseDown: onMouseDown, onFocus: onMouseOver, onMouseUp: onMouseUp, className: classes, style: style, disabled: disabled, children: [_jsxs("div", { className: styles.top, onMouseOut: this.stopBubbling, onBlur: this.stopBubbling, children: [!showCheckbox && (_jsxs("div", { className: styles.left, children: [leftNodes, glyph && (_jsx(Icon, { className: styles.glyph, glyph: glyph, size: this.props.iconSize, suppressSizeWarning: this.props.suppressSizeWarning })), (avatar || shouldShowGeneratedAvatar) && (_jsx(Avatar, { className: styles.avatar, url: avatar, size: AvatarSize.Size20, subavatar: subavatar, username: username }))] })), labelWrapper ? labelWrapper(labelElement) : labelElement, description && (_jsx("span", { className: styles.description, "data-test": "ring-list-item-description", children: description })), _jsxs("div", { className: styles.right, children: [rightGlyph && (_jsx(Icon, { className: styles.rightGlyph, glyph: rightGlyph, suppressSizeWarning: this.props.suppressSizeWarning, size: this.props.iconSize })), icon && _jsx("div", { className: styles.icon, style: { backgroundImage: `url("${icon}")` } }), rightNodes] })] }), details && _jsx("div", { className: detailsClasses, children: details })] })] }));
|
|
59
53
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
3
|
import Link, { linkHOC } from '../link/link';
|
|
5
4
|
import dataTests from '../global/data-tests';
|
|
6
|
-
import
|
|
5
|
+
import { getListClasses } from './list__classes';
|
|
7
6
|
/**
|
|
8
7
|
* @constructor
|
|
9
8
|
* @extends {ReactComponent}
|
|
@@ -11,12 +10,8 @@ import styles from './list.css';
|
|
|
11
10
|
export default class ListLink extends PureComponent {
|
|
12
11
|
render() {
|
|
13
12
|
const { scrolling, 'data-test': dataTest, className, label, hover, description, rgItemType, url, onCheckboxChange, disabled, LinkComponent, compact, hoverClassName, children, ...restProps } = this.props;
|
|
14
|
-
const classes =
|
|
15
|
-
[styles.actionLink]: !disabled,
|
|
16
|
-
[styles.compact]: compact,
|
|
17
|
-
[styles.scrolling]: scrolling,
|
|
18
|
-
});
|
|
13
|
+
const classes = getListClasses(this.props);
|
|
19
14
|
const Comp = LinkComponent ? linkHOC(LinkComponent) : Link;
|
|
20
|
-
return (_jsx(Comp, { pseudo: !this.props.href, ...restProps,
|
|
15
|
+
return (_jsx(Comp, { pseudo: !this.props.href, ...restProps, className: classes, "data-test": dataTests('ring-list-link', dataTest), children: label ?? children }));
|
|
21
16
|
}
|
|
22
17
|
}
|
|
@@ -119,6 +119,6 @@ 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
|
-
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, _jsx(ThemeProvider, { theme: theme, passToPopups: true, WrapperComponent: props => _jsx("span", { ...props }), children: _jsx(Popup, { trapFocus: false, anchorElement: this.containerNode, hidden: !this.state.showPopup || this.state.showNestedPopup, onCloseAttempt: this.hidePopup, maxHeight: 400,
|
|
122
|
+
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, _jsx(ThemeProvider, { theme: theme, passToPopups: true, WrapperComponent: props => _jsx("span", { ...props }), children: _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 }, popupProps?.className), children: title }) })] }) }));
|
|
123
123
|
}
|
|
124
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.22",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "JetBrains"
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
"readmeFilename": "README.md",
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@babel/cli": "^7.26.4",
|
|
89
|
-
"@babel/eslint-parser": "^7.
|
|
89
|
+
"@babel/eslint-parser": "^7.26.5",
|
|
90
90
|
"@babel/plugin-syntax-import-assertions": "^7.26.0",
|
|
91
91
|
"@csstools/css-parser-algorithms": "^3.0.4",
|
|
92
92
|
"@csstools/stylelint-no-at-nest-rule": "^4.0.0",
|
|
93
|
-
"@eslint/compat": "^1.2.
|
|
93
|
+
"@eslint/compat": "^1.2.5",
|
|
94
94
|
"@eslint/eslintrc": "^3.2.0",
|
|
95
|
-
"@eslint/js": "^9.
|
|
95
|
+
"@eslint/js": "^9.18.0",
|
|
96
96
|
"@figma/code-connect": "^1.2.4",
|
|
97
97
|
"@jetbrains/eslint-config": "^6.0.4",
|
|
98
98
|
"@jetbrains/logos": "3.0.0-canary.734b213.0",
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
"@storybook/test-runner": "^0.21.0",
|
|
117
117
|
"@storybook/theming": "8.4.7",
|
|
118
118
|
"@testing-library/dom": "^10.4.0",
|
|
119
|
-
"@testing-library/react": "^16.
|
|
120
|
-
"@testing-library/user-event": "^14.
|
|
119
|
+
"@testing-library/react": "^16.2.0",
|
|
120
|
+
"@testing-library/user-event": "^14.6.0",
|
|
121
121
|
"@types/chai": "^5.0.1",
|
|
122
122
|
"@types/chai-as-promised": "^8.0.1",
|
|
123
123
|
"@types/chai-dom": "0.0.10",
|
|
@@ -131,30 +131,30 @@
|
|
|
131
131
|
"@types/sinon-chai": "^4.0.0",
|
|
132
132
|
"@types/webpack-env": "^1.18.5",
|
|
133
133
|
"@vitejs/plugin-react": "^4.3.4",
|
|
134
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
134
|
+
"@vitest/eslint-plugin": "^1.1.25",
|
|
135
135
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
136
136
|
"acorn": "^8.14.0",
|
|
137
137
|
"axe-playwright": "^2.0.3",
|
|
138
138
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
139
|
-
"caniuse-lite": "^1.0.
|
|
139
|
+
"caniuse-lite": "^1.0.30001695",
|
|
140
140
|
"chai": "^5.1.2",
|
|
141
141
|
"chai-as-promised": "^8.0.1",
|
|
142
142
|
"chai-dom": "^1.10.0",
|
|
143
143
|
"chai-enzyme": "1.0.0-beta.1",
|
|
144
144
|
"cheerio": "^1.0.0-rc.12",
|
|
145
|
-
"chromatic": "^11.
|
|
145
|
+
"chromatic": "^11.25.0",
|
|
146
146
|
"core-js": "^3.40.0",
|
|
147
147
|
"cpy-cli": "^5.0.0",
|
|
148
148
|
"dotenv-cli": "^8.0.0",
|
|
149
149
|
"enzyme": "^3.11.0",
|
|
150
|
-
"eslint": "^9.
|
|
151
|
-
"eslint-config-prettier": "^
|
|
150
|
+
"eslint": "^9.18.0",
|
|
151
|
+
"eslint-config-prettier": "^10.0.1",
|
|
152
152
|
"eslint-formatter-jslint-xml": "^8.40.0",
|
|
153
153
|
"eslint-import-resolver-webpack": "^0.13.10",
|
|
154
154
|
"eslint-plugin-import": "^2.31.0",
|
|
155
155
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
156
|
-
"eslint-plugin-prettier": "^5.2.
|
|
157
|
-
"eslint-plugin-react": "^7.37.
|
|
156
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
157
|
+
"eslint-plugin-react": "^7.37.4",
|
|
158
158
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
159
159
|
"eslint-plugin-storybook": "^0.11.2",
|
|
160
160
|
"events": "^3.3.0",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"jest": "~29.7.0",
|
|
168
168
|
"jest-environment-jsdom": "^29.7.0",
|
|
169
169
|
"jest-teamcity": "^1.12.0",
|
|
170
|
-
"lint-staged": "^15.
|
|
170
|
+
"lint-staged": "^15.4.1",
|
|
171
171
|
"markdown-it": "^14.1.0",
|
|
172
172
|
"merge-options": "^3.0.4",
|
|
173
173
|
"pinst": "^3.0.0",
|
|
@@ -178,19 +178,19 @@
|
|
|
178
178
|
"react-test-renderer": "^19.0.0",
|
|
179
179
|
"regenerator-runtime": "^0.14.1",
|
|
180
180
|
"rimraf": "^6.0.1",
|
|
181
|
-
"rollup": "^4.
|
|
181
|
+
"rollup": "^4.31.0",
|
|
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
186
|
"storybook": "8.4.7",
|
|
187
|
-
"stylelint": "^16.
|
|
187
|
+
"stylelint": "^16.13.2",
|
|
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.
|
|
193
|
-
"vitest": "^
|
|
192
|
+
"typescript-eslint": "^8.20.0",
|
|
193
|
+
"vitest": "^3.0.2",
|
|
194
194
|
"vitest-teamcity-reporter": "^0.3.1",
|
|
195
195
|
"wallaby-webpack": "^3.9.16",
|
|
196
196
|
"webpack": "^5.97.1",
|
|
@@ -240,11 +240,11 @@
|
|
|
240
240
|
"es6-error": "^4.1.1",
|
|
241
241
|
"fastdom": "^1.0.12",
|
|
242
242
|
"file-loader": "^6.2.0",
|
|
243
|
-
"focus-trap": "^7.6.
|
|
243
|
+
"focus-trap": "^7.6.4",
|
|
244
244
|
"highlight.js": "^10.7.2",
|
|
245
245
|
"just-debounce-it": "^3.2.0",
|
|
246
246
|
"memoize-one": "^6.0.0",
|
|
247
|
-
"postcss": "^8.
|
|
247
|
+
"postcss": "^8.5.1",
|
|
248
248
|
"postcss-calc": "^10.1.0",
|
|
249
249
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
250
250
|
"postcss-font-family-system-ui": "^5.0.0",
|