@jetbrains/ring-ui 5.0.77 → 5.0.78
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/query-assist/query-assist.css +2 -1
- package/components/select/select.css +2 -0
- package/components/user-card/card.d.ts +3 -1
- package/components/user-card/card.js +3 -1
- package/components/user-card/user-card.css +7 -0
- package/dist/_helpers/card.js +6 -2
- package/dist/style.css +1 -1
- package/dist/user-card/card.d.ts +3 -1
- package/package.json +7 -7
|
@@ -150,12 +150,13 @@
|
|
|
150
150
|
left: 1px;
|
|
151
151
|
|
|
152
152
|
display: block;
|
|
153
|
-
|
|
154
153
|
overflow: hidden;
|
|
155
154
|
|
|
156
155
|
width: calc(100% - unit * 4);
|
|
157
156
|
padding-left: var(--ring-input-padding-start);
|
|
158
157
|
|
|
158
|
+
white-space: nowrap;
|
|
159
|
+
|
|
159
160
|
text-overflow: ellipsis;
|
|
160
161
|
|
|
161
162
|
pointer-events: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, PureComponent } from 'react';
|
|
1
|
+
import { HTMLAttributes, PureComponent, ReactElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
export interface UserCardUser {
|
|
4
4
|
name: string;
|
|
@@ -18,11 +18,13 @@ export interface UserCardWording {
|
|
|
18
18
|
export interface UserCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
19
|
user: UserCardUser;
|
|
20
20
|
wording: UserCardWording;
|
|
21
|
+
info?: ReactElement | readonly ReactElement[] | string;
|
|
21
22
|
'data-test'?: string | null | undefined;
|
|
22
23
|
}
|
|
23
24
|
export default class UserCard extends PureComponent<UserCardProps> {
|
|
24
25
|
static propTypes: {
|
|
25
26
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
|
+
info: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
28
|
className: PropTypes.Requireable<string>;
|
|
27
29
|
user: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
28
30
|
name: PropTypes.Validator<string>;
|
|
@@ -8,6 +8,7 @@ import styles from './user-card.css';
|
|
|
8
8
|
export default class UserCard extends PureComponent {
|
|
9
9
|
static propTypes = {
|
|
10
10
|
children: PropTypes.node,
|
|
11
|
+
info: PropTypes.node,
|
|
11
12
|
className: PropTypes.string,
|
|
12
13
|
user: PropTypes.shape({
|
|
13
14
|
name: PropTypes.string.isRequired,
|
|
@@ -33,7 +34,7 @@ export default class UserCard extends PureComponent {
|
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
render() {
|
|
36
|
-
const { children, className, user, wording, ...restProps } = this.props;
|
|
37
|
+
const { children, info, className, user, wording, ...restProps } = this.props;
|
|
37
38
|
const classes = classNames(className, {});
|
|
38
39
|
const userActiveStatusClasses = classNames(styles.userActiveStatus, user.online ? styles.online : '');
|
|
39
40
|
return (<div className={classes} {...restProps}>
|
|
@@ -45,6 +46,7 @@ export default class UserCard extends PureComponent {
|
|
|
45
46
|
{user.name}
|
|
46
47
|
</Link>)}
|
|
47
48
|
{!user.href && <span className={styles.userName}>{user.name}</span>}
|
|
49
|
+
{!!info && <span className={styles.userNameInfo}>{info}</span>}
|
|
48
50
|
{user.banned &&
|
|
49
51
|
(<span className={classNames(badgeStyles.badge, badgeStyles.invalid)} title={user.banReason}>{wording.banned}</span>)}
|
|
50
52
|
</div>
|
package/dist/_helpers/card.js
CHANGED
|
@@ -6,12 +6,13 @@ import Avatar, { Size } from '../avatar/avatar.js';
|
|
|
6
6
|
import Link from '../link/link.js';
|
|
7
7
|
import { m as modules_6c9187df } from './badge.js';
|
|
8
8
|
|
|
9
|
-
var modules_a4196c17 = {"unit":"8px","light":"light_rui_6e59","userCardSpaced":"userCardSpaced_rui_6e59","userInformationContainer":"userInformationContainer_rui_6e59","userInformation":"userInformation_rui_6e59","userName":"userName_rui_6e59","userActiveStatus":"userActiveStatus_rui_6e59","online":"online_rui_6e59"};
|
|
9
|
+
var modules_a4196c17 = {"unit":"8px","light":"light_rui_6e59","userCardSpaced":"userCardSpaced_rui_6e59","userInformationContainer":"userInformationContainer_rui_6e59","userInformation":"userInformation_rui_6e59","userName":"userName_rui_6e59","userNameInfo":"userNameInfo_rui_6e59","userActiveStatus":"userActiveStatus_rui_6e59","online":"online_rui_6e59"};
|
|
10
10
|
|
|
11
11
|
class UserCard extends PureComponent {
|
|
12
12
|
render() {
|
|
13
13
|
const {
|
|
14
14
|
children,
|
|
15
|
+
info,
|
|
15
16
|
className,
|
|
16
17
|
user,
|
|
17
18
|
wording,
|
|
@@ -33,7 +34,9 @@ class UserCard extends PureComponent {
|
|
|
33
34
|
className: modules_a4196c17.userName
|
|
34
35
|
}, user.name), !user.href && /*#__PURE__*/React.createElement("span", {
|
|
35
36
|
className: modules_a4196c17.userName
|
|
36
|
-
}, user.name),
|
|
37
|
+
}, user.name), !!info && /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
className: modules_a4196c17.userNameInfo
|
|
39
|
+
}, info), user.banned && /*#__PURE__*/React.createElement("span", {
|
|
37
40
|
className: classNames(modules_6c9187df.badge, modules_6c9187df.invalid),
|
|
38
41
|
title: user.banReason
|
|
39
42
|
}, wording.banned)), /*#__PURE__*/React.createElement("div", null, typeof user.online === 'boolean' && /*#__PURE__*/React.createElement("span", {
|
|
@@ -44,6 +47,7 @@ class UserCard extends PureComponent {
|
|
|
44
47
|
}
|
|
45
48
|
_defineProperty(UserCard, "propTypes", {
|
|
46
49
|
children: PropTypes.node,
|
|
50
|
+
info: PropTypes.node,
|
|
47
51
|
className: PropTypes.string,
|
|
48
52
|
user: PropTypes.shape({
|
|
49
53
|
name: PropTypes.string.isRequired,
|