superdesk-ui-framework 3.1.14 → 3.1.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/app/img/AvatarDefaultImage.svg +6 -0
- package/app/styles/_avatar.scss +28 -6
- package/app/styles/components/_sd-loader.scss +18 -5
- package/app/styles/design-tokens/_new-colors.scss +32 -17
- package/app-typescript/components/Button.tsx +1 -1
- package/app-typescript/components/DatePicker.tsx +6 -0
- package/app-typescript/components/Loader.tsx +23 -5
- package/app-typescript/components/avatar/avatar-group.tsx +2 -1
- package/app-typescript/components/avatar/avatar-image.tsx +1 -1
- package/app-typescript/components/avatar/avatar-placeholder.tsx +0 -1
- package/app-typescript/components/avatar/avatar-wrapper.tsx +14 -2
- package/app-typescript/components/avatar/avatar.tsx +8 -1
- package/dist/components/Avatar.tsx +97 -40
- package/dist/components/Buttons.tsx +5 -3
- package/dist/components/Index.tsx +157 -128
- package/dist/components/Loader.tsx +24 -0
- package/dist/examples.bundle.js +351 -243
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +30 -10
- package/dist/superdesk-ui.bundle.css +68 -26
- package/dist/superdesk-ui.bundle.js +95 -84
- package/examples/pages/components/Avatar.tsx +97 -40
- package/examples/pages/components/Buttons.tsx +5 -3
- package/examples/pages/components/Index.tsx +157 -128
- package/examples/pages/components/Loader.tsx +24 -0
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +30 -10
- package/package.json +1 -1
- package/react/components/Button.js +1 -1
- package/react/components/DatePicker.js +4 -0
- package/react/components/Loader.d.ts +11 -3
- package/react/components/Loader.js +6 -2
- package/react/components/avatar/avatar-group.js +2 -2
- package/react/components/avatar/avatar-image.js +1 -1
- package/react/components/avatar/avatar-placeholder.js +1 -1
- package/react/components/avatar/avatar-wrapper.d.ts +4 -1
- package/react/components/avatar/avatar-wrapper.js +4 -2
- package/react/components/avatar/avatar.d.ts +4 -0
- package/react/components/avatar/avatar.js +2 -2
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<g opacity="0.5">
|
3
|
+
<path d="M85.7778 40.6667C85.7778 54.9089 74.2422 66.4445 60 66.4445C45.7578 66.4445 34.2222 54.9089 34.2222 40.6667C34.2222 26.4245 45.7578 14.8889 60 14.8889C74.2422 14.8889 85.7778 26.4245 85.7778 40.6667Z" fill="white"/>
|
4
|
+
<path d="M59.9999 72.8889C45.5943 72.8889 19.1732 78.9418 10.9529 90.972C21.2315 107.215 39.3562 118 59.9999 118C80.6436 118 98.7684 107.215 109.047 90.972C100.827 78.9418 74.4056 72.8889 59.9999 72.8889Z" fill="white"/>
|
5
|
+
</g>
|
6
|
+
</svg>
|
package/app/styles/_avatar.scss
CHANGED
@@ -41,6 +41,7 @@
|
|
41
41
|
text-transform: uppercase;
|
42
42
|
letter-spacing: -0.03em;
|
43
43
|
overflow: hidden;
|
44
|
+
cursor: default;
|
44
45
|
|
45
46
|
> img {
|
46
47
|
width: 100%;
|
@@ -88,6 +89,9 @@
|
|
88
89
|
outline: 2px solid var(--sd-colour-interactive);
|
89
90
|
}
|
90
91
|
}
|
92
|
+
span {
|
93
|
+
cursor: default;
|
94
|
+
}
|
91
95
|
}
|
92
96
|
|
93
97
|
.sd-avatar-content--text {
|
@@ -95,18 +99,19 @@
|
|
95
99
|
}
|
96
100
|
|
97
101
|
.sd-avatar-content--dummy-img {
|
98
|
-
background-color: var(--sd-colour-avatar-bg);
|
102
|
+
background-color: var(--sd-colour-avatar-bg--empty);
|
99
103
|
background-image: url('~../../images/avatar_dummy.svg');
|
100
104
|
background-repeat: no-repeat;
|
101
105
|
background-size: cover;
|
102
|
-
border: 1px solid var(--sd-colour-avatar-border);
|
103
|
-
//box-shadow: inset 0 0 0 1px #005b7f;
|
104
106
|
}
|
105
107
|
|
106
108
|
&.sd-avatar--empty-light {
|
107
109
|
.sd-avatar-content--dummy-img {
|
108
110
|
background-color: var(--sd-colour-avatar-bg--light);
|
109
111
|
border: 1px dashed var(--sd-colour-avatar-border--light);
|
112
|
+
svg {
|
113
|
+
opacity: 0.25;
|
114
|
+
}
|
110
115
|
}
|
111
116
|
}
|
112
117
|
|
@@ -118,11 +123,27 @@
|
|
118
123
|
z-index: 1;
|
119
124
|
inset-block-end: -4px;
|
120
125
|
inset-inline-end: -4px;
|
126
|
+
opacity: 1;
|
127
|
+
color: var(--color-text-lighter);
|
121
128
|
[class^="icon-"], [class*=" icon-"] {
|
129
|
+
color: inherit;
|
122
130
|
text-shadow: -1px 1px 0 var(--sd-item__main-Bg), 1px 1px 0 var(--sd-item__main-Bg), 1px -1px 0 var(--sd-item__main-Bg), -1px -1px 0 var(--sd-item__main-Bg);
|
123
131
|
}
|
124
132
|
|
125
133
|
}
|
134
|
+
.sd-avatar__coverage-state {
|
135
|
+
--dot-size: 6px;
|
136
|
+
display: flex;
|
137
|
+
height: var(--dot-size);
|
138
|
+
width: var(--dot-size);
|
139
|
+
position: absolute;
|
140
|
+
background-color: var(--sd-colour-coverage-state--default);
|
141
|
+
z-index: 2;
|
142
|
+
border-radius: var(--b-radius--full);
|
143
|
+
inset-block-end: -3px;
|
144
|
+
inset-inline-end: 3px;
|
145
|
+
box-shadow: 0 0 0 1px var(--sd-item__main-Bg);
|
146
|
+
}
|
126
147
|
|
127
148
|
&.sd-avatar--x-small {
|
128
149
|
.sd-avatar__icon {
|
@@ -361,11 +382,12 @@
|
|
361
382
|
|
362
383
|
.avatar-popup {
|
363
384
|
background-color: var(--color-dropdown-menu-Bg);
|
364
|
-
border-radius:
|
365
|
-
padding:
|
385
|
+
border-radius: var(--b-radius--large);
|
386
|
+
padding: var(--space--2);
|
387
|
+
padding-inline-end: var(--space--3);
|
366
388
|
box-shadow: var(--sd-shadow__dropdown);
|
367
389
|
display: flex;
|
368
390
|
flex-direction: column;
|
369
|
-
gap:
|
391
|
+
gap: var(--gap-1-5);
|
370
392
|
overflow: auto;
|
371
393
|
}
|
@@ -1,6 +1,24 @@
|
|
1
1
|
// Animated loader
|
2
2
|
|
3
|
+
.sd-loader--inline {
|
4
|
+
display: inline-flex;
|
5
|
+
width: 100%;
|
6
|
+
min-width: 90px;
|
7
|
+
height: 100%;
|
8
|
+
min-height: 30px;
|
9
|
+
|
10
|
+
// inlining img/three-dots.svg as base64 encoded URL to have loader ready on application start
|
11
|
+
// otherwise, loader image would only start downloading when it already needs to be shown
|
12
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMTIwIDMwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IiM3YjdiN2IiPjxjaXJjbGUgY3g9IjE1IiBjeT0iMTUiIHI9IjE1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSIxNSIgdG89IjE1IiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxNTs5OzE1IiBjYWxjTW9kZT0ibGluZWFyIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsLW9wYWNpdHkiIGZyb209IjEiIHRvPSIxIiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxOy41OzEiIGNhbGNNb2RlPSJsaW5lYXIiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPjwvY2lyY2xlPjxjaXJjbGUgY3g9IjYwIiBjeT0iMTUiIHI9IjkiIGZpbGwtb3BhY2l0eT0iMC4zIj48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSI5IiB0bz0iOSIgYmVnaW49IjBzIiBkdXI9IjAuOHMiIHZhbHVlcz0iOTsxNTs5IiBjYWxjTW9kZT0ibGluZWFyIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsLW9wYWNpdHkiIGZyb209IjAuNSIgdG89IjAuNSIgYmVnaW49IjBzIiBkdXI9IjAuOHMiIHZhbHVlcz0iLjU7MTsuNSIgY2FsY01vZGU9ImxpbmVhciIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIC8+PC9jaXJjbGU+PGNpcmNsZSBjeD0iMTA1IiBjeT0iMTUiIHI9IjE1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSIxNSIgdG89IjE1IiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxNTs5OzE1IiBjYWxjTW9kZT0ibGluZWFyIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJmaWxsLW9wYWNpdHkiIGZyb209IjEiIHRvPSIxIiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxOy41OzEiIGNhbGNNb2RlPSJsaW5lYXIiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPjwvY2lyY2xlPjwvc3ZnPg==");
|
13
|
+
|
14
|
+
background-repeat: no-repeat;
|
15
|
+
background-position: center center;
|
16
|
+
background-size: 60px;
|
17
|
+
background-color: var(--sd-colour-overlay-actioning);
|
18
|
+
}
|
19
|
+
|
3
20
|
.sd-loader {
|
21
|
+
@extend .sd-loader--inline;
|
4
22
|
content: '';
|
5
23
|
display: block;
|
6
24
|
position: absolute;
|
@@ -9,9 +27,4 @@
|
|
9
27
|
inset-block-end: 0;
|
10
28
|
inset-inline-start: 0;
|
11
29
|
z-index: 99999;
|
12
|
-
background-image: url(../img/three-dots.svg);
|
13
|
-
background-repeat: no-repeat;
|
14
|
-
background-position: center center;
|
15
|
-
background-size: 60px;
|
16
|
-
background-color: var(--sd-colour-overlay-actioning);
|
17
30
|
}
|
@@ -351,22 +351,32 @@
|
|
351
351
|
--sd-colour__tag-label-Bg--inverse: var(--sd-colour-bg--08);
|
352
352
|
--sd-colour__tag-label-Txt--inverse: hsla(214, 13%, 98%, 1);
|
353
353
|
|
354
|
-
|
354
|
+
// Avatars
|
355
|
+
--sd-colour-avatar-bg: hsl(197, 100%, 30%);
|
355
356
|
--sd-colour-avatar-border: var(--sd-colour-avatar-bg);
|
356
|
-
|
357
357
|
--sd-colour-avatar-bg--light: hsla(214, 13%, 90%, 1);
|
358
|
-
--sd-colour-avatar-
|
359
|
-
--sd-colour-avatar-
|
360
|
-
--sd-colour-avatar-
|
358
|
+
--sd-colour-avatar-bg--empty: hsl(212, 20%, 48%);
|
359
|
+
--sd-colour-avatar-bg--empty-light: hsla(214, 13%, 90%, 1);
|
360
|
+
--sd-colour-avatar-border--light: var(--sd-colour-line--medium);
|
361
|
+
--sd-colour-avatar-border--light-hover: var(--sd-colour-line--strong);
|
362
|
+
--sd-colour-avatar-dummy: hsla(214, 13%, 65%, 0.50);
|
361
363
|
--sd-colour-avatar-add: hsla(214, 13%, 55%, 1);
|
362
364
|
--sd-colour-avatar-add--hover: hsla(214, 13%, 45%, 1);
|
363
|
-
|
364
|
-
--sd-colour-avatar-outline--offline: hsla(214, 13%, 85%, 1);
|
365
|
+
--sd-colour-avatar-outline--offline: var(--sd-colour-line--light);
|
365
366
|
--sd-colour-avatar-outline--online: var(--sd-colour-success);
|
366
|
-
|
367
|
+
// Avatar icon states
|
367
368
|
--sd-colour-state--default: var(--color-text-lighter);
|
368
|
-
--sd-colour-state--
|
369
|
+
--sd-colour-state--unassigned: var(--color-text-lighter);
|
370
|
+
--sd-colour-state--assigned: var(--color-text-lighter);
|
371
|
+
--sd-colour-state--canceled: var(--color-text-lighter);
|
372
|
+
--sd-colour-state--in-progress: var(--sd-colour-warning);
|
373
|
+
--sd-colour-state--in-workflow: var(--sd-colour-info);
|
374
|
+
--sd-colour-state--completed: var(--sd-colour-success);
|
369
375
|
--sd-colour-state--done: var(--sd-colour-success);
|
376
|
+
// Avatar dot states (coverage status indication)
|
377
|
+
--sd-colour-coverage-state--default: var(--color-text-lighter);
|
378
|
+
--sd-colour-coverage-state--on-merit: var(--sd-colour-warning);
|
379
|
+
--sd-colour-coverage-state--not-covering: var(--sd-colour-alert);
|
370
380
|
|
371
381
|
// New Collapsible Box
|
372
382
|
--collapse-box-button-color-bg-default: hsla(var(--sd-colour-cool-grey-l--85), 1);
|
@@ -522,19 +532,24 @@
|
|
522
532
|
--sd-colour__tag-label-Bg--inverse: hsla(214, 13%, 55%, 0.95);
|
523
533
|
--sd-colour__tag-label-Txt--inverse: hsla(214, 13%, 10%, 1);
|
524
534
|
|
535
|
+
// Avatars
|
525
536
|
--sd-colour-avatar-bg: hsl(197, 100%, 25%);
|
526
|
-
--sd-colour-avatar-border:
|
527
|
-
|
537
|
+
--sd-colour-avatar-border: var(--sd-colour-avatar-bg);
|
528
538
|
--sd-colour-avatar-bg--light: hsla(214, 13%, 20%, 1);
|
529
|
-
--sd-colour-avatar-
|
530
|
-
--sd-colour-avatar-
|
531
|
-
--sd-colour-avatar-
|
539
|
+
--sd-colour-avatar-bg--empty: hsl(212, 20%, 38%);
|
540
|
+
--sd-colour-avatar-bg--empty-light: hsla(214, 13%, 20%, 1);
|
541
|
+
--sd-colour-avatar-border--light: var(--sd-colour-line--light);
|
542
|
+
--sd-colour-avatar-border--light-hover: var(--sd-colour-line--medium);
|
543
|
+
--sd-colour-avatar-dummy: hsla(214, 13%, 95%, 0.2);
|
532
544
|
--sd-colour-avatar-add: hsla(214, 13%, 65%, 1);
|
533
545
|
--sd-colour-avatar-add--hover: hsla(214, 13%, 90%, 1);
|
534
|
-
|
546
|
+
--sd-colour-avatar-outline--offline: var(--sd-colour-line--medium);
|
547
|
+
--sd-colour-avatar-outline--online: var(--sd-colour-success);
|
548
|
+
// Avatar dot states (coverage status indication)
|
535
549
|
--sd-colour-state--default: var(--color-text-lighter);
|
536
|
-
--sd-colour-state--
|
537
|
-
--sd-colour-state--
|
550
|
+
--sd-colour-state--unassigned: var(--color-text-lighter);
|
551
|
+
--sd-colour-state--assigned: var(--color-text-lighter);
|
552
|
+
--sd-colour-state--canceled: var(--color-text-lighter);
|
538
553
|
|
539
554
|
// New Collapsible Box
|
540
555
|
--collapse-box-button-color-bg-default: hsla(var(--sd-colour-cool-grey-l--25), 1);
|
@@ -50,7 +50,7 @@ export class Button extends React.PureComponent<IPropsButton> {
|
|
50
50
|
title={this.props.tooltip}
|
51
51
|
>
|
52
52
|
{this.props.isLoading ? <Spinner size="mini" /> : null}
|
53
|
-
{this.props.icon && !this.props.isLoading ? <Icon name={this.props.icon} /> : null}
|
53
|
+
{this.props.icon && !this.props.isLoading ? <Icon ariaHidden name={this.props.icon} /> : null}
|
54
54
|
{this.props.iconOnly ? null : this.props.text}
|
55
55
|
</button>
|
56
56
|
);
|
@@ -165,6 +165,12 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
|
165
165
|
<Button
|
166
166
|
onClick={() => {
|
167
167
|
this.props.onChange(null);
|
168
|
+
if (
|
169
|
+
this.instance != null
|
170
|
+
&& typeof this.instance.hideOverlay === 'function'
|
171
|
+
) {
|
172
|
+
this.instance.hideOverlay();
|
173
|
+
}
|
168
174
|
}}
|
169
175
|
text='Clear'
|
170
176
|
data-test-id='clear-button'
|
@@ -1,18 +1,36 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
|
3
|
-
interface
|
4
|
-
overlay
|
3
|
+
interface IPropsOverlay {
|
4
|
+
overlay: true;
|
5
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
5
6
|
}
|
6
7
|
|
8
|
+
interface IPropsInline {
|
9
|
+
overlay?: false;
|
10
|
+
width?: React.CSSProperties['width'];
|
11
|
+
height?: React.CSSProperties['height'];
|
12
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
13
|
+
}
|
14
|
+
|
15
|
+
type IProps = IPropsOverlay | IPropsInline;
|
16
|
+
|
7
17
|
export class Loader extends React.Component<IProps> {
|
8
18
|
render() {
|
9
|
-
|
10
19
|
if (this.props.overlay) {
|
11
20
|
return (
|
12
|
-
<div className=
|
21
|
+
<div className="sd-loader" style={{backgroundColor: this.props.backgroundColor}} />
|
13
22
|
);
|
14
23
|
} else {
|
15
|
-
return
|
24
|
+
return (
|
25
|
+
<div
|
26
|
+
className="sd-loader--inline"
|
27
|
+
style={{
|
28
|
+
width: this.props.width,
|
29
|
+
height: this.props.height,
|
30
|
+
backgroundColor: this.props.backgroundColor,
|
31
|
+
}}
|
32
|
+
/>
|
33
|
+
);
|
16
34
|
}
|
17
35
|
}
|
18
36
|
}
|
@@ -100,6 +100,7 @@ export class AvatarGroup extends React.PureComponent<IPropsAvatarGroup> {
|
|
100
100
|
initials={item.initials}
|
101
101
|
displayName={item.displayName}
|
102
102
|
icon={item.icon}
|
103
|
+
statusDot={item.statusDot}
|
103
104
|
/>
|
104
105
|
)
|
105
106
|
: (
|
@@ -157,7 +158,7 @@ export class AvatarGroup extends React.PureComponent<IPropsAvatarGroup> {
|
|
157
158
|
{
|
158
159
|
itemsOverLimit > 0 && (
|
159
160
|
<PlusButtonWrapper onToggle={onToggle}>
|
160
|
-
<AvatarWrapper size={size}
|
161
|
+
<AvatarWrapper size={size}>
|
161
162
|
<AvatarContentNumber number={`${itemsOverLimit}`} />
|
162
163
|
</AvatarWrapper>
|
163
164
|
</PlusButtonWrapper>
|
@@ -24,7 +24,7 @@ export class AvatarContentImage extends React.PureComponent<IPropsImageAvatar> {
|
|
24
24
|
title={tooltipText}
|
25
25
|
>
|
26
26
|
<svg width="200" height="200" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
27
|
-
<circle cx="100" cy="100" r="100" fill="white" fillOpacity="0
|
27
|
+
<circle cx="100" cy="100" r="100" fill="white" fillOpacity="0"/>
|
28
28
|
{/* tslint:disable-next-line:max-line-length */}
|
29
29
|
<path fillRule="evenodd" clipRule="evenodd" d="M40 153V145.384C40 141.557 41.16 137.981 43.16 135C49.14 126.057 66.24 119.711 77.14 118C82.74 117.115 90.16 116.538 100 116.538C109.84 116.538 117.26 117.115 122.86 118C133.76 119.711 150.86 126.057 156.84 135C158.84 137.981 160 141.557 160 145.384V153C150 165 130 180 100 180C70 180 50 165 40 153ZM100 30C122.08 30 140 47.2307 140 68.4614C140 89.6922 122.08 106.923 100 106.923C77.92 106.923 60 89.6922 60 68.4614C60 47.2307 77.92 30 100 30Z" fill="var(--sd-colour-avatar-dummy)" fillOpacity="1"/>
|
30
30
|
</svg>
|
@@ -14,11 +14,14 @@ interface IPropsAvatarWrapper {
|
|
14
14
|
};
|
15
15
|
children: React.ReactNode;
|
16
16
|
'data-test-id'?: string;
|
17
|
-
|
17
|
+
noAvatarPlaceholderColor?: 'subtle' | 'strong'; // defaults to strong; only applies to placeholder image
|
18
18
|
icon?: {
|
19
19
|
name: string;
|
20
20
|
color?: string;
|
21
21
|
};
|
22
|
+
statusDot?: {
|
23
|
+
color?: string;
|
24
|
+
};
|
22
25
|
|
23
26
|
}
|
24
27
|
|
@@ -28,6 +31,7 @@ interface IPropsAvatarWrapper {
|
|
28
31
|
export class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
|
29
32
|
render() {
|
30
33
|
const {icon} = this.props;
|
34
|
+
const {statusDot} = this.props;
|
31
35
|
|
32
36
|
return (
|
33
37
|
<span
|
@@ -40,7 +44,7 @@ export class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
|
|
40
44
|
'sd-avatar--xx-large': this.props.size === 'xx-large',
|
41
45
|
'sd-avatar--indicator-status--online' : this.props.statusIndicator?.status === 'online',
|
42
46
|
'sd-avatar--indicator-status--offline' : this.props.statusIndicator?.status === 'offline',
|
43
|
-
'sd-avatar--empty-light': this.props.
|
47
|
+
'sd-avatar--empty-light': this.props.noAvatarPlaceholderColor === 'subtle',
|
44
48
|
})}
|
45
49
|
data-test-id={this.props['data-test-id']}
|
46
50
|
title={this.props.statusIndicator != null ? this.props.statusIndicator.tooltipText : ""}
|
@@ -66,6 +70,14 @@ export class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
|
|
66
70
|
)
|
67
71
|
}
|
68
72
|
|
73
|
+
{
|
74
|
+
statusDot != null && (
|
75
|
+
<span
|
76
|
+
style={{backgroundColor: statusDot.color}}
|
77
|
+
className="sd-avatar__coverage-state">
|
78
|
+
</span>
|
79
|
+
)
|
80
|
+
}
|
69
81
|
</span>
|
70
82
|
);
|
71
83
|
}
|
@@ -18,6 +18,10 @@ export interface IPropsAvatar {
|
|
18
18
|
name: string;
|
19
19
|
color?: string;
|
20
20
|
};
|
21
|
+
statusDot?: {
|
22
|
+
color?: string;
|
23
|
+
};
|
24
|
+
noAvatarPlaceholderColor?: 'subtle' | 'strong'; // defaults to strong; only applies to placeholder image
|
21
25
|
|
22
26
|
/**
|
23
27
|
* displayName is shown as tooltip by default
|
@@ -42,8 +46,10 @@ export class Avatar extends React.PureComponent<IPropsAvatar> {
|
|
42
46
|
statusIndicator,
|
43
47
|
administratorIndicator,
|
44
48
|
icon,
|
49
|
+
noAvatarPlaceholderColor,
|
45
50
|
displayName,
|
46
51
|
customContent,
|
52
|
+
statusDot,
|
47
53
|
} = this.props;
|
48
54
|
|
49
55
|
const tooltipCombined = [displayName, this.props.tooltip]
|
@@ -55,7 +61,8 @@ export class Avatar extends React.PureComponent<IPropsAvatar> {
|
|
55
61
|
statusIndicator={statusIndicator ? {status: statusIndicator, tooltipText: ''} : undefined}
|
56
62
|
administratorIndicator={administratorIndicator ? {enabled: true, tooltipText: ''} : undefined}
|
57
63
|
icon={icon}
|
58
|
-
|
64
|
+
statusDot={statusDot}
|
65
|
+
noAvatarPlaceholderColor={noAvatarPlaceholderColor}
|
59
66
|
>
|
60
67
|
{(() => {
|
61
68
|
if (customContent != null) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as Markup from '../../js/react';
|
3
3
|
|
4
|
-
import {Container, Avatar, AvatarGroup} from '../../../app-typescript';
|
4
|
+
import {Container, Avatar, AvatarGroup, AvatarPlaceholder} from '../../../app-typescript';
|
5
5
|
import {IAvatarInGroup, IAvatarPlaceholderInGroup} from '../../../app-typescript/components/avatar/avatar-group';
|
6
6
|
|
7
7
|
const avatars: Array<IAvatarInGroup> = [
|
@@ -73,7 +73,7 @@ export default class AvatarDoc extends React.PureComponent {
|
|
73
73
|
imageUrl={null}
|
74
74
|
initials="Jeffrey Lebowski"
|
75
75
|
size="large"
|
76
|
-
icon={{name: 'print', color: '
|
76
|
+
icon={{name: 'print', color: 'var(--sd-colour-state--in-workflow)'}}
|
77
77
|
statusIndicator="offline"
|
78
78
|
administratorIndicator
|
79
79
|
/>
|
@@ -83,7 +83,7 @@ export default class AvatarDoc extends React.PureComponent {
|
|
83
83
|
imageUrl={null}
|
84
84
|
initials='Jeffrey Lebowski'
|
85
85
|
size="large"
|
86
|
-
icon={{name: 'print', color: '
|
86
|
+
icon={{name: 'print', color: 'var(--sd-colour-state--done)'}}
|
87
87
|
administratorIndicator
|
88
88
|
/>
|
89
89
|
|
@@ -192,15 +192,29 @@ export default class AvatarDoc extends React.PureComponent {
|
|
192
192
|
imageUrl="/avatar.jpg"
|
193
193
|
initials="JL"
|
194
194
|
displayName="Jeffrey Lebowski"
|
195
|
-
icon={{name: 'text', color: 'var(--sd-colour-state--in-
|
195
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--in-workflow)'}}
|
196
196
|
/>
|
197
197
|
|
198
198
|
<Avatar
|
199
199
|
size="x-large"
|
200
|
-
imageUrl=
|
201
|
-
initials=
|
202
|
-
displayName="
|
203
|
-
|
200
|
+
imageUrl={null}
|
201
|
+
initials={null}
|
202
|
+
displayName="Unassigned"
|
203
|
+
noAvatarPlaceholderColor='subtle'
|
204
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--canceled)'}}
|
205
|
+
/>
|
206
|
+
|
207
|
+
<AvatarPlaceholder
|
208
|
+
kind='plus-button'
|
209
|
+
size='x-large'
|
210
|
+
/>
|
211
|
+
|
212
|
+
<Avatar
|
213
|
+
size="x-large"
|
214
|
+
imageUrl={null}
|
215
|
+
initials={null}
|
216
|
+
displayName="Unassigned"
|
217
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--canceled)'}}
|
204
218
|
/>
|
205
219
|
|
206
220
|
<Avatar
|
@@ -208,12 +222,29 @@ export default class AvatarDoc extends React.PureComponent {
|
|
208
222
|
imageUrl={null}
|
209
223
|
initials="JL"
|
210
224
|
displayName="Jeffrey Lebowski"
|
211
|
-
icon={{name: 'video-cancel', color: 'var(--sd-colour-state--
|
225
|
+
icon={{name: 'video-cancel', color: 'var(--sd-colour-state--canceled)'}}
|
212
226
|
/>
|
213
227
|
|
214
228
|
</Container>
|
215
|
-
|
216
|
-
|
229
|
+
<p className="docs-page__paragraph">// With icon and Coverage status indicator</p>
|
230
|
+
<Container gap='medium' className='sd-margin-b--3'>
|
231
|
+
<Avatar
|
232
|
+
displayName="Unassigned"
|
233
|
+
imageUrl={null}
|
234
|
+
initials={null}
|
235
|
+
size="small"
|
236
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--assigned)'}}
|
237
|
+
statusDot={{color: 'var(--sd-colour-coverage-state--on-merit)'}}
|
238
|
+
/>
|
239
|
+
<Avatar
|
240
|
+
displayName="Unassigned"
|
241
|
+
imageUrl={null}
|
242
|
+
initials={null}
|
243
|
+
size="small"
|
244
|
+
icon={{name: 'photo', color: 'var(--sd-colour-state--assigned)'}}
|
245
|
+
statusDot={{color: 'var(--sd-colour-coverage-state--not-covering)'}}
|
246
|
+
/>
|
247
|
+
</Container>
|
217
248
|
</Markup.ReactMarkupPreview>
|
218
249
|
|
219
250
|
<Markup.ReactMarkupCode>{`
|
@@ -234,7 +265,7 @@ export default class AvatarDoc extends React.PureComponent {
|
|
234
265
|
imageUrl={null}
|
235
266
|
initials="Jeffrey Lebowski"
|
236
267
|
size="large"
|
237
|
-
icon={{name: 'print', color: '
|
268
|
+
icon={{name: 'print', color: 'var(--sd-colour-state--in-workflow)}}
|
238
269
|
statusIndicator="offline"
|
239
270
|
administratorIndicator
|
240
271
|
/>
|
@@ -244,7 +275,7 @@ export default class AvatarDoc extends React.PureComponent {
|
|
244
275
|
imageUrl={null}
|
245
276
|
initials='Jeffrey Lebowski'
|
246
277
|
size="large"
|
247
|
-
icon={{name: 'print', color: '
|
278
|
+
icon={{name: 'print', color: 'var(--sd-colour-state--done)'}}
|
248
279
|
administratorIndicator
|
249
280
|
/>
|
250
281
|
|
@@ -366,15 +397,24 @@ export default class AvatarDoc extends React.PureComponent {
|
|
366
397
|
imageUrl="/avatar.jpg"
|
367
398
|
initials="JL"
|
368
399
|
displayName="Jeffrey Lebowski"
|
369
|
-
icon={{name: 'text', color: 'var(--sd-colour-state--in-
|
400
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--in-workflow)'}}
|
370
401
|
/>
|
371
402
|
|
372
403
|
<Avatar
|
373
404
|
size="x-large"
|
374
|
-
imageUrl=
|
375
|
-
initials=
|
376
|
-
displayName="
|
377
|
-
|
405
|
+
imageUrl={null}
|
406
|
+
initials={null}
|
407
|
+
displayName="Unassigned"
|
408
|
+
emptyLight
|
409
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--canceled)'}}
|
410
|
+
/>
|
411
|
+
|
412
|
+
<Avatar
|
413
|
+
size="x-large"
|
414
|
+
imageUrl={null}
|
415
|
+
initials={null}
|
416
|
+
displayName="Unassigned"
|
417
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--canceled)'}}
|
378
418
|
/>
|
379
419
|
|
380
420
|
<Avatar
|
@@ -382,10 +422,27 @@ export default class AvatarDoc extends React.PureComponent {
|
|
382
422
|
imageUrl={null}
|
383
423
|
initials="JL"
|
384
424
|
displayName="Jeffrey Lebowski"
|
385
|
-
icon={{name: 'video-cancel', color: 'var(--sd-colour-state--
|
425
|
+
icon={{name: 'video-cancel', color: 'var(--sd-colour-state--canceled)'}}
|
426
|
+
/>
|
427
|
+
|
428
|
+
// With icon and Coverage status indicator
|
429
|
+
<Avatar
|
430
|
+
displayName="Unassigned"
|
431
|
+
imageUrl={null}
|
432
|
+
initials={null}
|
433
|
+
size="small"
|
434
|
+
icon={{name: 'text', color: 'var(--sd-colour-state--assigned)'}}
|
435
|
+
statusDot={{color: 'var(--sd-colour-coverage-state--on-merit)'}}
|
436
|
+
/>
|
437
|
+
<Avatar
|
438
|
+
displayName="Unassigned"
|
439
|
+
imageUrl={null}
|
440
|
+
initials={null}
|
441
|
+
size="small"
|
442
|
+
icon={{name: 'photo', color: 'var(--sd-colour-state--assigned)'}}
|
443
|
+
statusDot={{color: 'var(--sd-colour-coverage-state--not-covering)'}}
|
386
444
|
/>
|
387
445
|
|
388
|
-
</AvatarWrapper>
|
389
446
|
`}
|
390
447
|
</Markup.ReactMarkupCode>
|
391
448
|
</Markup.ReactMarkup>
|
@@ -453,25 +510,25 @@ export default class AvatarDoc extends React.PureComponent {
|
|
453
510
|
imageUrl: null,
|
454
511
|
initials: "U3",
|
455
512
|
displayName: 'User3',
|
456
|
-
icon:{name: 'print', color: '
|
513
|
+
icon:{name: 'print', color: 'var(--sd-colour-state--in-workflow)'},
|
457
514
|
},
|
458
515
|
{
|
459
516
|
imageUrl: 'avatar-3.jpg',
|
460
517
|
initials: "U4",
|
461
518
|
displayName: 'User4',
|
462
|
-
icon:{name: 'print', color: '
|
519
|
+
icon:{name: 'print', color: 'var(--sd-colour-state--in-progress)'},
|
463
520
|
},
|
464
521
|
{
|
465
522
|
imageUrl: 'avatar-4.jpg',
|
466
523
|
initials: "U5",
|
467
524
|
displayName: 'User5',
|
468
|
-
icon:{name: 'print', color: '
|
525
|
+
icon:{name: 'print', color: 'var(--sd-colour-highlight)'},
|
469
526
|
},
|
470
527
|
{
|
471
528
|
imageUrl: null,
|
472
529
|
initials: "U6",
|
473
530
|
displayName: 'User6',
|
474
|
-
icon:{name: 'print', color: '
|
531
|
+
icon:{name: 'print', color: 'var(--sd-colour-state--in-progress)'},
|
475
532
|
},
|
476
533
|
];
|
477
534
|
|
@@ -571,39 +628,39 @@ export default class AvatarDoc extends React.PureComponent {
|
|
571
628
|
const avatars: Array<IAvatarInGroup> = [
|
572
629
|
{
|
573
630
|
imageUrl: 'avatar.jpg',
|
574
|
-
initials: "
|
575
|
-
displayName:
|
631
|
+
initials: "U1",
|
632
|
+
displayName: 'User1',
|
576
633
|
icon:{name: 'print', color: 'red'},
|
577
634
|
},
|
578
635
|
{
|
579
636
|
imageUrl: null,
|
580
|
-
initials: "
|
581
|
-
displayName:
|
637
|
+
initials: "U2",
|
638
|
+
displayName: 'User2',
|
582
639
|
icon:{name: 'print', color: 'green'},
|
583
640
|
},
|
584
641
|
{
|
585
642
|
imageUrl: null,
|
586
|
-
initials: "
|
587
|
-
displayName:
|
588
|
-
icon:{name: 'print', color: '
|
643
|
+
initials: "U3",
|
644
|
+
displayName: 'User3',
|
645
|
+
icon:{name: 'print', color: 'var(--sd-colour-state--in-workflow)'},
|
589
646
|
},
|
590
647
|
{
|
591
648
|
imageUrl: 'avatar-3.jpg',
|
592
|
-
initials: "
|
593
|
-
displayName:
|
594
|
-
icon:{name: 'print', color: '
|
649
|
+
initials: "U4",
|
650
|
+
displayName: 'User4',
|
651
|
+
icon:{name: 'print', color: 'var(--sd-colour-state--in-progress)'},
|
595
652
|
},
|
596
653
|
{
|
597
654
|
imageUrl: 'avatar-4.jpg',
|
598
|
-
initials: "
|
599
|
-
displayName:
|
600
|
-
icon:{name: 'print', color: '
|
655
|
+
initials: "U5",
|
656
|
+
displayName: 'User5',
|
657
|
+
icon:{name: 'print', color: 'var(--sd-colour-highlight)'},
|
601
658
|
},
|
602
659
|
{
|
603
660
|
imageUrl: null,
|
604
|
-
initials: "
|
605
|
-
displayName:
|
606
|
-
icon:{name: 'print', color: '
|
661
|
+
initials: "U6",
|
662
|
+
displayName: 'User6',
|
663
|
+
icon:{name: 'print', color: 'var(--sd-colour-state--in-progress)'},
|
607
664
|
},
|
608
665
|
];
|
609
666
|
|