@jetbrains/ring-ui 7.0.0-beta.15 → 7.0.0-beta.16
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/data-list/data-list.mock.js +5 -5
- package/components/tag/tag.d.ts +1 -1
- package/components/tag/tag.js +2 -3
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +2 -2
- package/components/user-card/card.js +5 -4
- package/components/user-card/user-card.css +4 -0
- package/package.json +15 -15
- package/components/badge/badge.css +0 -42
- package/components/badge/badge.d.ts +0 -14
- package/components/badge/badge.js +0 -26
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Link from '../link/link';
|
|
2
|
-
import
|
|
2
|
+
import Tag from '../tag/tag';
|
|
3
3
|
const items = [
|
|
4
4
|
{
|
|
5
5
|
id: 1,
|
|
@@ -58,7 +58,7 @@ const items = [
|
|
|
58
58
|
title: (<span>
|
|
59
59
|
<Link href="#">JetProfile</Link>
|
|
60
60
|
<span> </span>
|
|
61
|
-
<
|
|
61
|
+
<Tag>duplicate</Tag>
|
|
62
62
|
</span>),
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -160,7 +160,7 @@ const items = [
|
|
|
160
160
|
title: (<span>
|
|
161
161
|
<strong>Developer</strong>
|
|
162
162
|
<span> in 57 projects </span>
|
|
163
|
-
<
|
|
163
|
+
<Tag>team role</Tag>
|
|
164
164
|
</span>),
|
|
165
165
|
items: [
|
|
166
166
|
{
|
|
@@ -198,7 +198,7 @@ export const moreItems = [
|
|
|
198
198
|
title: (<span>
|
|
199
199
|
<Link href="#">More item 1</Link>
|
|
200
200
|
<span> </span>
|
|
201
|
-
<
|
|
201
|
+
<Tag>duplicate</Tag>
|
|
202
202
|
</span>),
|
|
203
203
|
},
|
|
204
204
|
{
|
|
@@ -208,7 +208,7 @@ export const moreItems = [
|
|
|
208
208
|
title: (<span>
|
|
209
209
|
<Link href="#">More item 2</Link>
|
|
210
210
|
<span> </span>
|
|
211
|
-
<
|
|
211
|
+
<Tag>duplicate</Tag>
|
|
212
212
|
</span>),
|
|
213
213
|
},
|
|
214
214
|
];
|
package/components/tag/tag.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface TagRenderProps extends HTMLAttributes<HTMLElement> {
|
|
|
7
7
|
'data-test': string;
|
|
8
8
|
}
|
|
9
9
|
export interface TagProps {
|
|
10
|
-
onRemove
|
|
10
|
+
onRemove?: ((event: React.MouseEvent<HTMLElement>) => void) | null;
|
|
11
11
|
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
12
12
|
readOnly: boolean;
|
|
13
13
|
disabled: boolean;
|
package/components/tag/tag.js
CHANGED
|
@@ -11,7 +11,6 @@ import styles from './tag.css';
|
|
|
11
11
|
*/
|
|
12
12
|
export default class Tag extends PureComponent {
|
|
13
13
|
static defaultProps = {
|
|
14
|
-
onRemove: () => { },
|
|
15
14
|
onClick: () => { },
|
|
16
15
|
readOnly: false,
|
|
17
16
|
disabled: false,
|
|
@@ -77,7 +76,7 @@ export default class Tag extends PureComponent {
|
|
|
77
76
|
return null;
|
|
78
77
|
}
|
|
79
78
|
renderRemoveIcon() {
|
|
80
|
-
if (!this.props.readOnly) {
|
|
79
|
+
if (!this.props.readOnly && this.props.onRemove) {
|
|
81
80
|
return (<Button title="Remove" icon={closeIcon} data-test="ring-tag-remove" className={styles.remove} iconClassName={styles.removeIcon} onClick={this.props.onRemove} style={{ '--ring-icon-secondary-color': this.props.textColor }} height={ControlsHeight.M}/>);
|
|
82
81
|
}
|
|
83
82
|
return null;
|
|
@@ -86,7 +85,7 @@ export default class Tag extends PureComponent {
|
|
|
86
85
|
const classes = classNames('ring-js-shortcuts', styles.tag, {
|
|
87
86
|
[styles.focused]: this.state.focused,
|
|
88
87
|
[styles.disabled]: this.props.disabled,
|
|
89
|
-
[styles.withRemove]: !this.props.readOnly,
|
|
88
|
+
[styles.withRemove]: !this.props.readOnly && this.props.onRemove,
|
|
90
89
|
}, this.props.className);
|
|
91
90
|
const { backgroundColor, textColor, render } = this.props;
|
|
92
91
|
return (<span className={styles.container}>
|
|
@@ -24,8 +24,8 @@ export default class TagsList<T extends TagType> extends Component<TagsListProps
|
|
|
24
24
|
customTagComponent: null;
|
|
25
25
|
canNotBeEmpty: boolean;
|
|
26
26
|
disabled: boolean;
|
|
27
|
-
handleClick: typeof noop;
|
|
28
|
-
handleRemove: typeof noop;
|
|
27
|
+
handleClick: () => typeof noop;
|
|
28
|
+
handleRemove: () => typeof noop;
|
|
29
29
|
};
|
|
30
30
|
renderTag(tag: T, focusTag: boolean): React.JSX.Element;
|
|
31
31
|
render(): React.JSX.Element;
|
|
@@ -11,8 +11,8 @@ export default class TagsList extends Component {
|
|
|
11
11
|
customTagComponent: null,
|
|
12
12
|
canNotBeEmpty: false,
|
|
13
13
|
disabled: false,
|
|
14
|
-
handleClick: noop,
|
|
15
|
-
handleRemove: noop,
|
|
14
|
+
handleClick: () => noop,
|
|
15
|
+
handleRemove: () => noop,
|
|
16
16
|
};
|
|
17
17
|
renderTag(tag, focusTag) {
|
|
18
18
|
const TagComponent = this.props.customTagComponent || Tag;
|
|
@@ -5,9 +5,10 @@ import copyIcon from '@jetbrains/icons/copy';
|
|
|
5
5
|
import Avatar, { Size as AvatarSize } from '../avatar/avatar';
|
|
6
6
|
import Link from '../link/link';
|
|
7
7
|
import clipboard from '../clipboard/clipboard';
|
|
8
|
-
import
|
|
8
|
+
import Tag from '../tag/tag';
|
|
9
9
|
import Icon, { Size as IconSize } from '../icon/icon';
|
|
10
10
|
import { I18nContext } from '../i18n/i18n-context';
|
|
11
|
+
import Tooltip from '../tooltip/tooltip';
|
|
11
12
|
import styles from './user-card.css';
|
|
12
13
|
export default class UserCard extends PureComponent {
|
|
13
14
|
static contextType = I18nContext;
|
|
@@ -39,9 +40,9 @@ export default class UserCard extends PureComponent {
|
|
|
39
40
|
? (translations?.online ?? translate('online'))
|
|
40
41
|
: (translations?.offline ?? translate('offline'))}/>)}
|
|
41
42
|
{!!info && <span className={styles.userNameInfo}>{info}</span>}
|
|
42
|
-
{user.banned && (<
|
|
43
|
-
{translations?.banned ?? translate('banned')}
|
|
44
|
-
</
|
|
43
|
+
{user.banned && (<Tooltip title={user.banReason}>
|
|
44
|
+
<Tag className={styles.banLabel}>{translations?.banned ?? translate('banned')}</Tag>
|
|
45
|
+
</Tooltip>)}
|
|
45
46
|
</div>
|
|
46
47
|
<div className={styles.userLogin}>{user.login}</div>
|
|
47
48
|
{user.email && (<span className={styles.userEmailWrapper}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.16",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": "JetBrains",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -94,18 +94,18 @@
|
|
|
94
94
|
"@rollup/plugin-json": "^6.1.0",
|
|
95
95
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
96
96
|
"@rollup/plugin-replace": "^6.0.1",
|
|
97
|
-
"@storybook/addon-a11y": "8.4.
|
|
98
|
-
"@storybook/addon-docs": "8.4.
|
|
99
|
-
"@storybook/addon-essentials": "8.4.
|
|
100
|
-
"@storybook/addon-themes": "^8.4.
|
|
101
|
-
"@storybook/components": "8.4.
|
|
97
|
+
"@storybook/addon-a11y": "8.4.2",
|
|
98
|
+
"@storybook/addon-docs": "8.4.2",
|
|
99
|
+
"@storybook/addon-essentials": "8.4.2",
|
|
100
|
+
"@storybook/addon-themes": "^8.4.2",
|
|
101
|
+
"@storybook/components": "8.4.2",
|
|
102
102
|
"@storybook/csf": "^0.1.11",
|
|
103
|
-
"@storybook/manager-api": "8.4.
|
|
104
|
-
"@storybook/preview-api": "8.4.
|
|
105
|
-
"@storybook/react": "8.4.
|
|
106
|
-
"@storybook/react-webpack5": "8.4.
|
|
103
|
+
"@storybook/manager-api": "8.4.2",
|
|
104
|
+
"@storybook/preview-api": "8.4.2",
|
|
105
|
+
"@storybook/react": "8.4.2",
|
|
106
|
+
"@storybook/react-webpack5": "8.4.2",
|
|
107
107
|
"@storybook/test-runner": "^0.19.1",
|
|
108
|
-
"@storybook/theming": "8.4.
|
|
108
|
+
"@storybook/theming": "8.4.2",
|
|
109
109
|
"@testing-library/dom": "^10.4.0",
|
|
110
110
|
"@testing-library/react": "^16.0.1",
|
|
111
111
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -145,10 +145,10 @@
|
|
|
145
145
|
"eslint-plugin-prettier": "^5.2.1",
|
|
146
146
|
"eslint-plugin-react": "^7.37.2",
|
|
147
147
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
148
|
-
"eslint-plugin-storybook": "^0.
|
|
148
|
+
"eslint-plugin-storybook": "^0.11.0",
|
|
149
149
|
"events": "^3.3.0",
|
|
150
150
|
"glob": "^11.0.0",
|
|
151
|
-
"globals": "^15.
|
|
151
|
+
"globals": "^15.12.0",
|
|
152
152
|
"html-webpack-plugin": "^5.6.3",
|
|
153
153
|
"http-server": "^14.1.1",
|
|
154
154
|
"husky": "^9.1.6",
|
|
@@ -172,13 +172,13 @@
|
|
|
172
172
|
"sinon": "^19.0.2",
|
|
173
173
|
"sinon-chai": "^4.0.0",
|
|
174
174
|
"storage-mock": "^2.1.0",
|
|
175
|
-
"storybook": "8.4.
|
|
175
|
+
"storybook": "8.4.2",
|
|
176
176
|
"stylelint": "^16.10.0",
|
|
177
177
|
"svg-inline-loader": "^0.8.2",
|
|
178
178
|
"teamcity-service-messages": "^0.1.14",
|
|
179
179
|
"terser-webpack-plugin": "^5.3.10",
|
|
180
180
|
"typescript": "~5.6.3",
|
|
181
|
-
"typescript-eslint": "^8.
|
|
181
|
+
"typescript-eslint": "^8.13.0",
|
|
182
182
|
"vitest": "^2.1.4",
|
|
183
183
|
"vitest-teamcity-reporter": "^0.3.1",
|
|
184
184
|
"wallaby-webpack": "^3.9.16",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
@import "../global/variables.css";
|
|
2
|
-
|
|
3
|
-
.badge {
|
|
4
|
-
display: inline-block;
|
|
5
|
-
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
height: 20px;
|
|
8
|
-
padding: 0 var(--ring-unit);
|
|
9
|
-
|
|
10
|
-
cursor: default;
|
|
11
|
-
|
|
12
|
-
vertical-align: baseline;
|
|
13
|
-
|
|
14
|
-
color: var(--ring-secondary-color);
|
|
15
|
-
border: 1px var(--ring-line-color) solid;
|
|
16
|
-
border-radius: var(--ring-border-radius);
|
|
17
|
-
background-color: var(--ring-content-background-color);
|
|
18
|
-
|
|
19
|
-
font-size: var(--ring-font-size-smaller);
|
|
20
|
-
font-weight: normal;
|
|
21
|
-
font-style: normal;
|
|
22
|
-
line-height: 17px;
|
|
23
|
-
|
|
24
|
-
&.gray {
|
|
25
|
-
color: var(--ring-text-color);
|
|
26
|
-
background-color: var(--ring-tag-background-color);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.valid {
|
|
30
|
-
color: var(--ring-success-color);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.invalid {
|
|
34
|
-
color: var(--ring-error-color);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.disabled {
|
|
38
|
-
/* Deprecated: duplicates invalid */
|
|
39
|
-
|
|
40
|
-
color: var(--ring-error-color);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PureComponent, HTMLAttributes } from 'react';
|
|
2
|
-
export interface BadgeProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
-
gray?: boolean | null | undefined;
|
|
4
|
-
valid?: boolean | null | undefined;
|
|
5
|
-
invalid?: boolean | null | undefined;
|
|
6
|
-
disabled?: boolean | null | undefined;
|
|
7
|
-
'data-test'?: string | null | undefined;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @name Badge
|
|
11
|
-
*/
|
|
12
|
-
export default class Badge extends PureComponent<BadgeProps> {
|
|
13
|
-
render(): import("react").JSX.Element;
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { PureComponent } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import dataTests from '../global/data-tests';
|
|
4
|
-
import style from './badge.css';
|
|
5
|
-
/**
|
|
6
|
-
* @name Badge
|
|
7
|
-
*/
|
|
8
|
-
// TODO remove in 7.0
|
|
9
|
-
export default class Badge extends PureComponent {
|
|
10
|
-
render() {
|
|
11
|
-
const {
|
|
12
|
-
// Modifiers
|
|
13
|
-
gray, valid, invalid, disabled,
|
|
14
|
-
// Props
|
|
15
|
-
className, children, 'data-test': dataTest, ...props } = this.props;
|
|
16
|
-
const classes = classNames(style.badge, className, {
|
|
17
|
-
[style.gray]: gray,
|
|
18
|
-
[style.valid]: valid,
|
|
19
|
-
[style.invalid]: invalid,
|
|
20
|
-
[style.disabled]: disabled,
|
|
21
|
-
});
|
|
22
|
-
return (<span {...props} data-test={dataTests('ring-badge', dataTest)} className={classes}>
|
|
23
|
-
{children}
|
|
24
|
-
</span>);
|
|
25
|
-
}
|
|
26
|
-
}
|