superdesk-ui-framework 3.0.18 → 3.0.20
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/app/styles/_avatar.scss +175 -25
- package/app/styles/design-tokens/_new-colors.scss +35 -2
- package/app-typescript/components/Icon.tsx +7 -1
- package/app-typescript/components/ShowPopup.tsx +173 -0
- package/app-typescript/components/Spacer.tsx +0 -8
- package/app-typescript/components/WithPopover.tsx +46 -0
- package/app-typescript/components/avatar/avatar-action-add.tsx +27 -0
- package/app-typescript/components/avatar/avatar-group.tsx +86 -0
- package/app-typescript/components/avatar/avatar-image.tsx +26 -0
- package/app-typescript/components/avatar/avatar-number.tsx +16 -0
- package/app-typescript/components/avatar/avatar-placeholder.tsx +35 -0
- package/app-typescript/components/avatar/avatar-text.tsx +19 -0
- package/app-typescript/components/avatar/avatar-wrapper.tsx +72 -0
- package/app-typescript/components/avatar/avatar.tsx +48 -0
- package/app-typescript/components/avatar/interfaces.ts +3 -0
- package/app-typescript/index.ts +8 -4
- package/dist/avatar_dummy.svg +4 -0
- package/dist/examples.bundle.js +3273 -2467
- package/dist/react/Avatar.tsx +628 -307
- package/dist/superdesk-ui.bundle.css +139 -27
- package/dist/superdesk-ui.bundle.js +2691 -1843
- package/dist/vendor.bundle.js +22 -22
- package/examples/pages/react/Avatar.tsx +628 -307
- package/images/avatar_dummy.svg +4 -0
- package/package.json +2 -1
- package/react/components/Icon.d.ts +1 -0
- package/react/components/Icon.js +1 -1
- package/react/components/ShowPopup.d.ts +10 -0
- package/react/components/ShowPopup.js +158 -0
- package/react/components/Spacer.d.ts +30 -0
- package/react/components/Spacer.js +86 -0
- package/react/components/WithPopover.d.ts +18 -0
- package/react/components/WithPopover.js +70 -0
- package/react/components/avatar/avatar-action-add.d.ts +9 -0
- package/react/components/avatar/avatar-action-add.js +59 -0
- package/react/components/avatar/avatar-group.d.ts +18 -0
- package/react/components/avatar/avatar-group.js +104 -0
- package/react/components/avatar/avatar-image.d.ts +9 -0
- package/react/components/avatar/avatar-image.js +62 -0
- package/react/components/avatar/avatar-number.d.ts +9 -0
- package/react/components/avatar/avatar-number.js +56 -0
- package/react/components/avatar/avatar-placeholder.d.ts +14 -0
- package/react/components/avatar/avatar-placeholder.js +57 -0
- package/react/components/avatar/avatar-text.d.ts +9 -0
- package/react/components/avatar/avatar-text.js +54 -0
- package/react/components/avatar/avatar-wrapper.d.ts +26 -0
- package/react/components/{Avatar.js → avatar/avatar-wrapper.js} +16 -57
- package/react/components/avatar/avatar.d.ts +17 -0
- package/react/components/avatar/avatar.js +59 -0
- package/react/components/avatar/interfaces.d.ts +3 -0
- package/react/components/avatar/interfaces.js +2 -0
- package/react/index.d.ts +8 -4
- package/react/index.js +20 -11
- package/app-typescript/components/Avatar.tsx +0 -122
- package/dist/avatar_64.png +0 -0
- package/react/components/Avatar.d.ts +0 -42
@@ -1,122 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import classNames from 'classnames';
|
3
|
-
|
4
|
-
interface IBase {
|
5
|
-
tooltipText?: string;
|
6
|
-
}
|
7
|
-
|
8
|
-
interface IImageAvatar extends IBase {
|
9
|
-
imageUrl?: string; // defaults to a placeholder image
|
10
|
-
}
|
11
|
-
|
12
|
-
interface ITextAvatar extends IBase {
|
13
|
-
text: string; // limited to 3 characters
|
14
|
-
}
|
15
|
-
|
16
|
-
export class AvatarContentText extends React.PureComponent<ITextAvatar> {
|
17
|
-
render() {
|
18
|
-
return (
|
19
|
-
<span
|
20
|
-
className="sd-avatar-content sd-avatar-content--text"
|
21
|
-
title={this.props.tooltipText}
|
22
|
-
>
|
23
|
-
<span>{this.props.text.slice(0, 3)}</span>
|
24
|
-
</span>
|
25
|
-
);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
export class AvatarContentImage extends React.PureComponent<IImageAvatar> {
|
30
|
-
render() {
|
31
|
-
if (this.props.imageUrl == null) {
|
32
|
-
return <span className="sd-avatar-content sd-avatar-content--empty" title={this.props.tooltipText} />;
|
33
|
-
} else {
|
34
|
-
return (
|
35
|
-
<span className="sd-avatar-content" title={this.props.tooltipText} >
|
36
|
-
<img src={this.props.imageUrl} />
|
37
|
-
</span>
|
38
|
-
);
|
39
|
-
}
|
40
|
-
}
|
41
|
-
}
|
42
|
-
interface IPropsAvatarGroup {
|
43
|
-
appearance?: 'stacked' | 'grid';
|
44
|
-
borderColor?: '000' | '050' | '100' | '150' | '200';
|
45
|
-
className?: string;
|
46
|
-
children: React.ReactNode;
|
47
|
-
}
|
48
|
-
export class AvatarGroup extends React.PureComponent<IPropsAvatarGroup> {
|
49
|
-
render() {
|
50
|
-
let classes = classNames('sd-avatar-group', {
|
51
|
-
[`sd-avatar-group--stacked`]: this.props.appearance === undefined,
|
52
|
-
[`sd-avatar-group--${this.props.appearance}`]: this.props.appearance,
|
53
|
-
[`sd-avatar-group__border--000`]: this.props.borderColor === undefined,
|
54
|
-
[`sd-avatar-group__border--${this.props.borderColor}`]: this.props.borderColor,
|
55
|
-
}, this.props.className);
|
56
|
-
return (
|
57
|
-
<div className={classes} role='group'>
|
58
|
-
{this.props.children}
|
59
|
-
</div>
|
60
|
-
);
|
61
|
-
}
|
62
|
-
}
|
63
|
-
|
64
|
-
interface IPropsAvatarWrapper {
|
65
|
-
size?: 'small' | 'medium' | 'large' | 'x-large' | 'xx-large'; // defaults to medium
|
66
|
-
statusIndicator?: {
|
67
|
-
status: 'online' | 'offline';
|
68
|
-
tooltipText?: string;
|
69
|
-
};
|
70
|
-
administratorIndicator?: {
|
71
|
-
enabled: boolean;
|
72
|
-
tooltipText?: string;
|
73
|
-
};
|
74
|
-
children: React.ReactNode;
|
75
|
-
'data-test-id'?: string;
|
76
|
-
}
|
77
|
-
|
78
|
-
export class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
|
79
|
-
render() {
|
80
|
-
return (
|
81
|
-
<span
|
82
|
-
className={classNames('sd-avatar', {
|
83
|
-
'sd-avatar--small': this.props.size === 'small',
|
84
|
-
'sd-avatar--medium': this.props.size === 'medium' || this.props.size == null,
|
85
|
-
'sd-avatar--large': this.props.size === 'large',
|
86
|
-
'sd-avatar--x-large': this.props.size === 'x-large',
|
87
|
-
'sd-avatar--xx-large': this.props.size === 'xx-large',
|
88
|
-
})}
|
89
|
-
data-test-id={this.props['data-test-id']}
|
90
|
-
>
|
91
|
-
{this.props.children}
|
92
|
-
|
93
|
-
{
|
94
|
-
this.props.statusIndicator != null
|
95
|
-
? (
|
96
|
-
<span
|
97
|
-
className={
|
98
|
-
this.props.statusIndicator.status === 'online'
|
99
|
-
? 'sd-avatar--indicator-status--online'
|
100
|
-
: 'sd-avatar--indicator-status--offline'
|
101
|
-
}
|
102
|
-
title={this.props.statusIndicator.tooltipText}
|
103
|
-
/>
|
104
|
-
)
|
105
|
-
: null
|
106
|
-
}
|
107
|
-
|
108
|
-
{
|
109
|
-
this.props.administratorIndicator?.enabled === true
|
110
|
-
? (
|
111
|
-
<i
|
112
|
-
className="icon-settings sd-avatar--indicator-admin"
|
113
|
-
title={this.props.administratorIndicator.tooltipText}
|
114
|
-
/>
|
115
|
-
)
|
116
|
-
: null
|
117
|
-
}
|
118
|
-
|
119
|
-
</span>
|
120
|
-
);
|
121
|
-
}
|
122
|
-
}
|
package/dist/avatar_64.png
DELETED
Binary file
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
interface IBase {
|
3
|
-
tooltipText?: string;
|
4
|
-
}
|
5
|
-
interface IImageAvatar extends IBase {
|
6
|
-
imageUrl?: string;
|
7
|
-
}
|
8
|
-
interface ITextAvatar extends IBase {
|
9
|
-
text: string;
|
10
|
-
}
|
11
|
-
export declare class AvatarContentText extends React.PureComponent<ITextAvatar> {
|
12
|
-
render(): JSX.Element;
|
13
|
-
}
|
14
|
-
export declare class AvatarContentImage extends React.PureComponent<IImageAvatar> {
|
15
|
-
render(): JSX.Element;
|
16
|
-
}
|
17
|
-
interface IPropsAvatarGroup {
|
18
|
-
appearance?: 'stacked' | 'grid';
|
19
|
-
borderColor?: '000' | '050' | '100' | '150' | '200';
|
20
|
-
className?: string;
|
21
|
-
children: React.ReactNode;
|
22
|
-
}
|
23
|
-
export declare class AvatarGroup extends React.PureComponent<IPropsAvatarGroup> {
|
24
|
-
render(): JSX.Element;
|
25
|
-
}
|
26
|
-
interface IPropsAvatarWrapper {
|
27
|
-
size?: 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
|
28
|
-
statusIndicator?: {
|
29
|
-
status: 'online' | 'offline';
|
30
|
-
tooltipText?: string;
|
31
|
-
};
|
32
|
-
administratorIndicator?: {
|
33
|
-
enabled: boolean;
|
34
|
-
tooltipText?: string;
|
35
|
-
};
|
36
|
-
children: React.ReactNode;
|
37
|
-
'data-test-id'?: string;
|
38
|
-
}
|
39
|
-
export declare class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
|
40
|
-
render(): JSX.Element;
|
41
|
-
}
|
42
|
-
export {};
|