@transferwise/components 0.0.0-experimental-f7495f3 → 0.0.0-experimental-37d8e2c
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/build/avatar/Avatar.js +4 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +4 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatar/colors/colors.js +1 -1
- package/build/avatar/colors/colors.js.map +1 -1
- package/build/avatar/colors/colors.mjs +1 -1
- package/build/avatar/colors/colors.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +207 -0
- package/build/avatarView/AvatarView.js.map +1 -0
- package/build/avatarView/AvatarView.mjs +205 -0
- package/build/avatarView/AvatarView.mjs.map +1 -0
- package/build/avatarWrapper/AvatarWrapper.js +6 -9
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +5 -8
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +6 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +6 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +4 -7
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +4 -7
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/circle/Circle.js +24 -1
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +24 -1
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/common/initials.js +12 -0
- package/build/common/initials.js.map +1 -0
- package/build/common/initials.mjs +10 -0
- package/build/common/initials.mjs.map +1 -0
- package/build/common/notificationDot/NotificationDot.js +16 -0
- package/build/common/notificationDot/NotificationDot.js.map +1 -0
- package/build/common/notificationDot/NotificationDot.mjs +14 -0
- package/build/common/notificationDot/NotificationDot.mjs.map +1 -0
- package/build/display/Display.js +1 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +1 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +3 -0
- package/build/index.mjs.map +1 -1
- package/build/main.css +82 -41
- package/build/statusIcon/StatusIcon.js +4 -2
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +4 -2
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/avatarGroup/AvatarGroup.css +28 -0
- package/build/styles/avatarView/AvatarView.css +22 -0
- package/build/styles/badge/Badge.css +5 -5
- package/build/styles/circularButton/CircularButton.css +0 -24
- package/build/styles/common/circle/Circle.css +17 -0
- package/build/styles/common/notificationDot/NotificationDot.css +10 -0
- package/build/styles/main.css +82 -41
- package/build/styles/statusIcon/StatusIcon.css +0 -12
- package/build/types/avatar/Avatar.d.ts +3 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatar/colors/colors.d.ts +1 -1
- package/build/types/avatar/colors/colors.d.ts.map +1 -1
- package/build/types/avatarGroup/AvatarGroup.d.ts +19 -0
- package/build/types/avatarGroup/AvatarGroup.d.ts.map +1 -0
- package/build/types/avatarGroup/index.d.ts +3 -0
- package/build/types/avatarGroup/index.d.ts.map +1 -0
- package/build/types/avatarView/AvatarView.d.ts +25 -0
- package/build/types/avatarView/AvatarView.d.ts.map +1 -0
- package/build/types/avatarView/index.d.ts +3 -0
- package/build/types/avatarView/index.d.ts.map +1 -0
- package/build/types/avatarWrapper/AvatarWrapper.d.ts +3 -0
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts +2 -1
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +1 -1
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/build/types/common/index.d.ts +1 -0
- package/build/types/common/initials.d.ts +2 -0
- package/build/types/common/initials.d.ts.map +1 -0
- package/build/types/common/notificationDot/NotificationDot.d.ts +8 -0
- package/build/types/common/notificationDot/NotificationDot.d.ts.map +1 -0
- package/build/types/index.d.ts +4 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +6 -2
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/avatar/Avatar.tsx +4 -1
- package/src/avatar/colors/colors.ts +4 -4
- package/src/avatarGroup/AvatarGroup.css +28 -0
- package/src/avatarGroup/AvatarGroup.less +32 -0
- package/src/avatarGroup/AvatarGroup.story.tsx +249 -0
- package/src/avatarGroup/AvatarGroup.tsx +78 -0
- package/src/avatarGroup/index.ts +2 -0
- package/src/avatarView/AvatarView.css +22 -0
- package/src/avatarView/AvatarView.less +24 -0
- package/src/avatarView/AvatarView.story.tsx +425 -0
- package/src/avatarView/AvatarView.tsx +217 -0
- package/src/avatarView/index.ts +2 -0
- package/src/avatarWrapper/AvatarWrapper.tsx +12 -16
- package/src/badge/Badge.css +5 -5
- package/src/badge/Badge.less +3 -3
- package/src/badge/Badge.tsx +10 -1
- package/src/circularButton/CircularButton.css +0 -24
- package/src/circularButton/CircularButton.less +15 -15
- package/src/circularButton/CircularButton.tsx +4 -5
- package/src/common/circle/Circle.css +17 -0
- package/src/common/circle/Circle.less +22 -0
- package/src/common/circle/Circle.tsx +33 -2
- package/src/common/index.js +1 -0
- package/src/common/initials.ts +13 -0
- package/src/common/notificationDot/NotificationDot.css +10 -0
- package/src/common/notificationDot/NotificationDot.less +7 -0
- package/src/common/notificationDot/NotificationDot.tsx +10 -0
- package/src/display/Display.tsx +1 -1
- package/src/index.ts +4 -0
- package/src/main.css +82 -41
- package/src/main.less +3 -0
- package/src/statusIcon/StatusIcon.css +0 -12
- package/src/statusIcon/StatusIcon.less +6 -6
- package/src/statusIcon/StatusIcon.story.tsx +32 -28
- package/src/statusIcon/StatusIcon.tsx +18 -4
- package/src/test-utils/avatar-img.webp +0 -0
package/src/main.css
CHANGED
|
@@ -421,6 +421,56 @@ div.critical-comms .critical-comms-body {
|
|
|
421
421
|
.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
|
|
422
422
|
border-color: var(--color-interactive-primary-hover);
|
|
423
423
|
}
|
|
424
|
+
.np-avatar-view {
|
|
425
|
+
border-radius: 9999px;
|
|
426
|
+
border-radius: var(--radius-full);
|
|
427
|
+
color: var(--color-interactive-primary);
|
|
428
|
+
height: -moz-fit-content;
|
|
429
|
+
height: fit-content;
|
|
430
|
+
width: -moz-fit-content;
|
|
431
|
+
width: fit-content;
|
|
432
|
+
}
|
|
433
|
+
.np-avatar-view .np-circle {
|
|
434
|
+
background-color: transparent;
|
|
435
|
+
border: var(--avatar-view-non-interactive-border-width) solid rgba(0,0,0,0.10196);
|
|
436
|
+
border: var(--avatar-view-non-interactive-border-width) solid var(--color-border-neutral);
|
|
437
|
+
}
|
|
438
|
+
.np-avatar-view-selected .np-circle {
|
|
439
|
+
border: var(--avatar-view-selected-border-width) solid var(--color-interactive-primary) !important;
|
|
440
|
+
}
|
|
441
|
+
.np-avatar-view-interactive .np-circle {
|
|
442
|
+
background-color: rgba(134,167,189,0.10196);
|
|
443
|
+
background-color: var(--color-background-neutral);
|
|
444
|
+
border: none;
|
|
445
|
+
}
|
|
446
|
+
.np-avatar-group {
|
|
447
|
+
display: inline-flex;
|
|
448
|
+
--np-avatar-group-size: 48px;
|
|
449
|
+
--np-avatar-size: 32px;
|
|
450
|
+
}
|
|
451
|
+
.np-avatar-group-diagonal {
|
|
452
|
+
width: var(--np-avatar-group-size);
|
|
453
|
+
height: var(--np-avatar-group-size);
|
|
454
|
+
}
|
|
455
|
+
.np-avatar-group-diagonal-mask {
|
|
456
|
+
-webkit-mask-image: radial-gradient(circle at right 100%, transparent, transparent calc(var(--np-avatar-size) / 1.8), black 0);
|
|
457
|
+
mask-image: radial-gradient(circle at right 100%, transparent, transparent calc(var(--np-avatar-size) / 1.8), black 0);
|
|
458
|
+
}
|
|
459
|
+
.np-avatar-group-diagonal-child {
|
|
460
|
+
margin-left: calc((var(--np-avatar-size) / 2) * -1);
|
|
461
|
+
margin-top: calc((var(--np-avatar-size) * var(--np-avatar-group-index)) / 2);
|
|
462
|
+
}
|
|
463
|
+
.np-avatar-group-horizontal {
|
|
464
|
+
width: calc((var(--np-avatar-size) * 2) - 2px);
|
|
465
|
+
height: var(--np-avatar-group-size);
|
|
466
|
+
}
|
|
467
|
+
.np-avatar-group-horizontal-mask {
|
|
468
|
+
-webkit-mask-image: radial-gradient(circle at right 50%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
|
|
469
|
+
mask-image: radial-gradient(circle at right 50%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
|
|
470
|
+
}
|
|
471
|
+
.np-avatar-group-horizontal-child {
|
|
472
|
+
margin-left: calc((var(--np-avatar-size) / 4) * -1);
|
|
473
|
+
}
|
|
424
474
|
.tw-badge {
|
|
425
475
|
position: relative;
|
|
426
476
|
display: inline-block;
|
|
@@ -437,16 +487,16 @@ div.critical-comms .critical-comms-body {
|
|
|
437
487
|
--badge-border-color: rgba(0, 0, 0, 0.08);
|
|
438
488
|
}
|
|
439
489
|
.tw-badge > .tw-badge__children {
|
|
440
|
-
-webkit-mask-image: radial-gradient(circle at
|
|
441
|
-
mask-image: radial-gradient(circle at
|
|
490
|
+
-webkit-mask-image: radial-gradient(circle at var(--badge-mask-position) calc(100% - var(--badge-mask-offset)) left calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
491
|
+
mask-image: radial-gradient(circle at var(--badge-mask-position) calc(100% - var(--badge-mask-offset)) left calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
442
492
|
}
|
|
443
493
|
[dir="rtl"] .tw-badge > .tw-badge__children {
|
|
444
|
-
-webkit-mask-image: radial-gradient(circle at
|
|
445
|
-
mask-image: radial-gradient(circle at
|
|
494
|
+
-webkit-mask-image: radial-gradient(circle at var(--badge-mask-position) calc(100% - var(--badge-mask-offset)) right calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
495
|
+
mask-image: radial-gradient(circle at var(--badge-mask-position) calc(100% - var(--badge-mask-offset)) right calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
446
496
|
}
|
|
447
497
|
.tw-badge > .tw-badge__content {
|
|
448
498
|
position: absolute;
|
|
449
|
-
bottom:
|
|
499
|
+
bottom: var(--badge-bottom-position);
|
|
450
500
|
right: 0;
|
|
451
501
|
box-sizing: border-box;
|
|
452
502
|
text-align: center;
|
|
@@ -985,30 +1035,6 @@ div.critical-comms .critical-comms-body {
|
|
|
985
1035
|
cursor: pointer;
|
|
986
1036
|
position: relative;
|
|
987
1037
|
}
|
|
988
|
-
.np-circular-btn .tw-icon {
|
|
989
|
-
position: absolute;
|
|
990
|
-
top: 16px;
|
|
991
|
-
top: var(--size-16);
|
|
992
|
-
pointer-events: none;
|
|
993
|
-
color: white;
|
|
994
|
-
transition: color 0.15s ease-in-out;
|
|
995
|
-
width: 100%;
|
|
996
|
-
left: 0;
|
|
997
|
-
}
|
|
998
|
-
[dir="rtl"] .np-circular-btn .tw-icon {
|
|
999
|
-
right: 0;
|
|
1000
|
-
left: auto;
|
|
1001
|
-
left: initial;
|
|
1002
|
-
}
|
|
1003
|
-
@media (max-width: 320px) {
|
|
1004
|
-
.np-circular-btn .tw-icon {
|
|
1005
|
-
top: 8px;
|
|
1006
|
-
top: var(--size-8);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
.np-circular-btn .tw-icon > svg {
|
|
1010
|
-
margin: 0 auto;
|
|
1011
|
-
}
|
|
1012
1038
|
.np-theme-personal .np-circular-btn {
|
|
1013
1039
|
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1014
1040
|
}
|
|
@@ -1157,6 +1183,23 @@ div.critical-comms .critical-comms-body {
|
|
|
1157
1183
|
width: var(--circle-size);
|
|
1158
1184
|
height: var(--circle-size);
|
|
1159
1185
|
flex-shrink: 0;
|
|
1186
|
+
font-size: var(--circle-font-size);
|
|
1187
|
+
font-weight: 600;
|
|
1188
|
+
font-weight: var(--font-weight-semi-bold);
|
|
1189
|
+
line-height: 1;
|
|
1190
|
+
}
|
|
1191
|
+
.np-circle img {
|
|
1192
|
+
border-radius: 9999px;
|
|
1193
|
+
border-radius: var(--radius-full);
|
|
1194
|
+
width: 100%;
|
|
1195
|
+
height: 100%;
|
|
1196
|
+
}
|
|
1197
|
+
.np-circle .np-display {
|
|
1198
|
+
font-size: var(--circle-font-size);
|
|
1199
|
+
}
|
|
1200
|
+
.np-circle .tw-icon > svg {
|
|
1201
|
+
height: var(--circle-icon-size);
|
|
1202
|
+
width: var(--circle-icon-size);
|
|
1160
1203
|
}
|
|
1161
1204
|
.np-bottom-sheet {
|
|
1162
1205
|
border-radius: 10px 10px 0 0;
|
|
@@ -1439,6 +1482,16 @@ button.np-option {
|
|
|
1439
1482
|
border-radius: var(--radius-small);
|
|
1440
1483
|
}
|
|
1441
1484
|
}
|
|
1485
|
+
.np-notification-dot {
|
|
1486
|
+
--badge-notification-dot-size: 14px;
|
|
1487
|
+
width: 14px;
|
|
1488
|
+
width: var(--badge-notification-dot-size);
|
|
1489
|
+
height: 14px;
|
|
1490
|
+
height: var(--badge-notification-dot-size);
|
|
1491
|
+
background-color: var(--color-sentiment-negative);
|
|
1492
|
+
border-radius: 9999px;
|
|
1493
|
+
border-radius: var(--radius-full);
|
|
1494
|
+
}
|
|
1442
1495
|
.np-select-option {
|
|
1443
1496
|
border-radius: 10px;
|
|
1444
1497
|
border-radius: var(--radius-small);
|
|
@@ -4144,12 +4197,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4144
4197
|
transform: translateY(-24px);
|
|
4145
4198
|
}
|
|
4146
4199
|
}
|
|
4147
|
-
.status-icon > svg {
|
|
4148
|
-
height: 32px;
|
|
4149
|
-
height: var(--size-32);
|
|
4150
|
-
width: 32px;
|
|
4151
|
-
width: var(--size-32);
|
|
4152
|
-
}
|
|
4153
4200
|
.status-circle .light {
|
|
4154
4201
|
color: var(--color-contrast);
|
|
4155
4202
|
}
|
|
@@ -4165,12 +4212,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4165
4212
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
4166
4213
|
color: var(--color-dark);
|
|
4167
4214
|
}
|
|
4168
|
-
.status-circle-sm .status-icon > svg {
|
|
4169
|
-
height: 14px;
|
|
4170
|
-
height: var(--size-14);
|
|
4171
|
-
width: 14px;
|
|
4172
|
-
width: var(--size-14);
|
|
4173
|
-
}
|
|
4174
4215
|
@media (max-width: 320px) {
|
|
4175
4216
|
.status-circle-sm .status-icon > svg {
|
|
4176
4217
|
width: 24px;
|
package/src/main.less
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
@import "./accordion/Accordion.less";
|
|
3
3
|
@import "./actionButton/ActionButton.less";
|
|
4
4
|
@import "./avatar/Avatar.less";
|
|
5
|
+
@import "./avatarView/AvatarView.less";
|
|
6
|
+
@import "./avatarGroup/AvatarGroup.less";
|
|
5
7
|
@import "./badge/Badge.less";
|
|
6
8
|
@import "./button/Button.less";
|
|
7
9
|
@import "./card/Card.less";
|
|
@@ -14,6 +16,7 @@
|
|
|
14
16
|
@import "./common/card/Card.less";
|
|
15
17
|
@import "./common/closeButton/CloseButton.less";
|
|
16
18
|
@import "./common/Option/Option.less";
|
|
19
|
+
@import "./common/notificationDot/NotificationDot.less";
|
|
17
20
|
@import "./selectOption/SelectOption.less";
|
|
18
21
|
@import "./common/panel/Panel.less";
|
|
19
22
|
@import "./common/RadioButton/RadioButton.less";
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
.status-icon > svg {
|
|
2
|
-
height: 32px;
|
|
3
|
-
height: var(--size-32);
|
|
4
|
-
width: 32px;
|
|
5
|
-
width: var(--size-32);
|
|
6
|
-
}
|
|
7
1
|
.status-circle .light {
|
|
8
2
|
color: var(--color-contrast);
|
|
9
3
|
}
|
|
@@ -19,12 +13,6 @@
|
|
|
19
13
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
20
14
|
color: var(--color-dark);
|
|
21
15
|
}
|
|
22
|
-
.status-circle-sm .status-icon > svg {
|
|
23
|
-
height: 14px;
|
|
24
|
-
height: var(--size-14);
|
|
25
|
-
width: 14px;
|
|
26
|
-
width: var(--size-14);
|
|
27
|
-
}
|
|
28
16
|
@media (max-width: 320px) {
|
|
29
17
|
.status-circle-sm .status-icon > svg {
|
|
30
18
|
width: 24px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.status-icon > svg {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
// .status-icon > svg {
|
|
2
|
+
// height: var(--size-32);
|
|
3
|
+
// width: var(--size-32);
|
|
4
|
+
// }
|
|
5
5
|
|
|
6
6
|
.status-circle {
|
|
7
7
|
.light {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
&-sm {
|
|
27
27
|
.status-icon > svg {
|
|
28
|
-
height: var(--size-14);
|
|
29
|
-
width: var(--size-14);
|
|
28
|
+
// height: var(--size-14);
|
|
29
|
+
// width: var(--size-14);
|
|
30
30
|
|
|
31
31
|
@media (--screen-400-zoom) {
|
|
32
32
|
width: var(--size-24);
|
|
@@ -20,32 +20,36 @@ export const Basic: Story = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export const Variants: Story = {
|
|
23
|
-
render: () =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
render: () => {
|
|
24
|
+
const sizes = [16, 24, 32, 40, 48, 56, 72];
|
|
25
|
+
return (
|
|
26
|
+
<span style={{ display: 'flex', justifyContent: 'space-between', maxWidth: '400px' }}>
|
|
27
|
+
{[
|
|
28
|
+
Sentiment.POSITIVE,
|
|
29
|
+
Sentiment.NEGATIVE,
|
|
30
|
+
Sentiment.WARNING,
|
|
31
|
+
Sentiment.NEUTRAL,
|
|
32
|
+
Sentiment.PENDING,
|
|
33
|
+
].map((sentiment) => {
|
|
34
|
+
return (
|
|
35
|
+
<span
|
|
36
|
+
key={sentiment}
|
|
37
|
+
style={{
|
|
38
|
+
display: 'flex',
|
|
39
|
+
gap: '1em',
|
|
40
|
+
justifyContent: 'space-between',
|
|
41
|
+
flexDirection: 'column',
|
|
42
|
+
minHeight: '150px',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
{sizes.map((size) => {
|
|
47
|
+
return <StatusIcon key={size} size={size} sentiment={sentiment} />;
|
|
48
|
+
})}
|
|
49
|
+
</span>
|
|
50
|
+
);
|
|
51
|
+
})}
|
|
52
|
+
</span>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
51
55
|
};
|
|
@@ -5,9 +5,14 @@ import { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '.
|
|
|
5
5
|
import Circle, { CircleProps } from '../common/circle';
|
|
6
6
|
import { useMedia } from '../common/hooks/useMedia';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead
|
|
10
|
+
*/
|
|
11
|
+
type LegacySizes = SizeSmall | SizeMedium | SizeLarge;
|
|
12
|
+
|
|
8
13
|
export type StatusIconProps = {
|
|
9
|
-
sentiment
|
|
10
|
-
size
|
|
14
|
+
sentiment?: `${Sentiment}`;
|
|
15
|
+
size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
const iconTypeMap = {
|
|
@@ -31,13 +36,22 @@ const StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 'md' }: StatusIcon
|
|
|
31
36
|
const Icon = iconTypeMap[sentiment];
|
|
32
37
|
const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';
|
|
33
38
|
const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
34
|
-
const size =
|
|
39
|
+
const size =
|
|
40
|
+
sizeProp === Size.SMALL && isTinyViewport
|
|
41
|
+
? 32
|
|
42
|
+
: typeof sizeProp === 'string'
|
|
43
|
+
? mapLegacySize[sizeProp]
|
|
44
|
+
: sizeProp;
|
|
35
45
|
return (
|
|
36
46
|
<Circle
|
|
37
47
|
as="span"
|
|
38
48
|
size={size}
|
|
39
49
|
data-testid="status-icon"
|
|
40
|
-
className={clsx(
|
|
50
|
+
className={clsx(
|
|
51
|
+
'status-circle',
|
|
52
|
+
// `status-circle-${sizeProp}`,
|
|
53
|
+
sentiment,
|
|
54
|
+
)}
|
|
41
55
|
>
|
|
42
56
|
<Icon className={clsx('status-icon', iconColor)} />
|
|
43
57
|
</Circle>
|
|
Binary file
|