@transferwise/components 0.0.0-experimental-8d0974a → 0.0.0-experimental-53b8447

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.
Files changed (207) hide show
  1. package/build/avatar/Avatar.js +3 -0
  2. package/build/avatar/Avatar.js.map +1 -1
  3. package/build/avatar/Avatar.mjs +3 -0
  4. package/build/avatar/Avatar.mjs.map +1 -1
  5. package/build/avatarView/AvatarView.js +187 -0
  6. package/build/avatarView/AvatarView.js.map +1 -0
  7. package/build/avatarView/AvatarView.mjs +185 -0
  8. package/build/avatarView/AvatarView.mjs.map +1 -0
  9. package/build/avatarView/NotificationDot.js +56 -0
  10. package/build/avatarView/NotificationDot.js.map +1 -0
  11. package/build/avatarView/NotificationDot.mjs +54 -0
  12. package/build/avatarView/NotificationDot.mjs.map +1 -0
  13. package/build/avatarWrapper/AvatarWrapper.js +6 -1
  14. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  15. package/build/avatarWrapper/AvatarWrapper.mjs +6 -1
  16. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  17. package/build/badge/Badge.js +8 -1
  18. package/build/badge/Badge.js.map +1 -1
  19. package/build/badge/Badge.mjs +8 -1
  20. package/build/badge/Badge.mjs.map +1 -1
  21. package/build/badge/BadgeAssets.js +63 -0
  22. package/build/badge/BadgeAssets.js.map +1 -0
  23. package/build/badge/BadgeAssets.mjs +61 -0
  24. package/build/badge/BadgeAssets.mjs.map +1 -0
  25. package/build/common/circle/Circle.js +29 -3
  26. package/build/common/circle/Circle.js.map +1 -1
  27. package/build/common/circle/Circle.mjs +29 -3
  28. package/build/common/circle/Circle.mjs.map +1 -1
  29. package/build/dateLookup/DateLookup.js +6 -6
  30. package/build/dateLookup/DateLookup.js.map +1 -1
  31. package/build/dateLookup/DateLookup.mjs +6 -6
  32. package/build/dateLookup/DateLookup.mjs.map +1 -1
  33. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -4
  34. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  35. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +1 -4
  36. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
  37. package/build/i18n/de.json +5 -0
  38. package/build/i18n/de.json.js +5 -0
  39. package/build/i18n/de.json.js.map +1 -1
  40. package/build/i18n/de.json.mjs +5 -0
  41. package/build/i18n/de.json.mjs.map +1 -1
  42. package/build/i18n/es.json +5 -0
  43. package/build/i18n/es.json.js +5 -0
  44. package/build/i18n/es.json.js.map +1 -1
  45. package/build/i18n/es.json.mjs +5 -0
  46. package/build/i18n/es.json.mjs.map +1 -1
  47. package/build/i18n/fr.json +5 -0
  48. package/build/i18n/fr.json.js +5 -0
  49. package/build/i18n/fr.json.js.map +1 -1
  50. package/build/i18n/fr.json.mjs +5 -0
  51. package/build/i18n/fr.json.mjs.map +1 -1
  52. package/build/i18n/hu.json +5 -0
  53. package/build/i18n/hu.json.js +5 -0
  54. package/build/i18n/hu.json.js.map +1 -1
  55. package/build/i18n/hu.json.mjs +5 -0
  56. package/build/i18n/hu.json.mjs.map +1 -1
  57. package/build/i18n/id.json +5 -0
  58. package/build/i18n/id.json.js +5 -0
  59. package/build/i18n/id.json.js.map +1 -1
  60. package/build/i18n/id.json.mjs +5 -0
  61. package/build/i18n/id.json.mjs.map +1 -1
  62. package/build/i18n/it.json +5 -0
  63. package/build/i18n/it.json.js +5 -0
  64. package/build/i18n/it.json.js.map +1 -1
  65. package/build/i18n/it.json.mjs +5 -0
  66. package/build/i18n/it.json.mjs.map +1 -1
  67. package/build/i18n/ja.json +5 -0
  68. package/build/i18n/ja.json.js +5 -0
  69. package/build/i18n/ja.json.js.map +1 -1
  70. package/build/i18n/ja.json.mjs +5 -0
  71. package/build/i18n/ja.json.mjs.map +1 -1
  72. package/build/i18n/pl.json +5 -0
  73. package/build/i18n/pl.json.js +5 -0
  74. package/build/i18n/pl.json.js.map +1 -1
  75. package/build/i18n/pl.json.mjs +5 -0
  76. package/build/i18n/pl.json.mjs.map +1 -1
  77. package/build/i18n/pt.json +5 -0
  78. package/build/i18n/pt.json.js +5 -0
  79. package/build/i18n/pt.json.js.map +1 -1
  80. package/build/i18n/pt.json.mjs +5 -0
  81. package/build/i18n/pt.json.mjs.map +1 -1
  82. package/build/i18n/ro.json +5 -0
  83. package/build/i18n/ro.json.js +5 -0
  84. package/build/i18n/ro.json.js.map +1 -1
  85. package/build/i18n/ro.json.mjs +5 -0
  86. package/build/i18n/ro.json.mjs.map +1 -1
  87. package/build/i18n/ru.json +5 -0
  88. package/build/i18n/ru.json.js +5 -0
  89. package/build/i18n/ru.json.js.map +1 -1
  90. package/build/i18n/ru.json.mjs +5 -0
  91. package/build/i18n/ru.json.mjs.map +1 -1
  92. package/build/i18n/tr.json +5 -0
  93. package/build/i18n/tr.json.js +5 -0
  94. package/build/i18n/tr.json.js.map +1 -1
  95. package/build/i18n/tr.json.mjs +5 -0
  96. package/build/i18n/tr.json.mjs.map +1 -1
  97. package/build/index.js +15 -4
  98. package/build/index.js.map +1 -1
  99. package/build/index.mjs +10 -2
  100. package/build/index.mjs.map +1 -1
  101. package/build/main.css +98 -25
  102. package/build/statusIcon/StatusIcon.js +2 -2
  103. package/build/statusIcon/StatusIcon.js.map +1 -1
  104. package/build/statusIcon/StatusIcon.mjs +2 -2
  105. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  106. package/build/styles/avatarGroup/AvatarGroup.css +28 -0
  107. package/build/styles/avatarView/AvatarView.css +28 -0
  108. package/build/styles/avatarView/NotificationDot.css +20 -0
  109. package/build/styles/badge/Badge.css +6 -5
  110. package/build/styles/common/circle/Circle.css +36 -0
  111. package/build/styles/main.css +98 -25
  112. package/build/styles/statusIcon/StatusIcon.css +0 -20
  113. package/build/types/avatar/Avatar.d.ts +3 -0
  114. package/build/types/avatar/Avatar.d.ts.map +1 -1
  115. package/build/types/avatarGroup/AvatarGroup.d.ts +18 -0
  116. package/build/types/avatarGroup/AvatarGroup.d.ts.map +1 -0
  117. package/build/types/avatarGroup/index.d.ts +3 -0
  118. package/build/types/avatarGroup/index.d.ts.map +1 -0
  119. package/build/types/avatarView/AvatarView.d.ts +25 -0
  120. package/build/types/avatarView/AvatarView.d.ts.map +1 -0
  121. package/build/types/avatarView/NotificationDot.d.ts +8 -0
  122. package/build/types/avatarView/NotificationDot.d.ts.map +1 -0
  123. package/build/types/avatarView/index.d.ts +3 -0
  124. package/build/types/avatarView/index.d.ts.map +1 -0
  125. package/build/types/avatarWrapper/AvatarWrapper.d.ts +3 -0
  126. package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
  127. package/build/types/badge/Badge.d.ts +5 -1
  128. package/build/types/badge/Badge.d.ts.map +1 -1
  129. package/build/types/badge/BadgeAssets.d.ts +15 -0
  130. package/build/types/badge/BadgeAssets.d.ts.map +1 -0
  131. package/build/types/badge/index.d.ts +2 -0
  132. package/build/types/badge/index.d.ts.map +1 -1
  133. package/build/types/common/circle/Circle.d.ts +3 -1
  134. package/build/types/common/circle/Circle.d.ts.map +1 -1
  135. package/build/types/common/dateUtils/index.d.ts +0 -1
  136. package/build/types/common/dateUtils/index.d.ts.map +1 -1
  137. package/build/types/dateLookup/DateLookup.d.ts +1 -1
  138. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  139. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +1 -1
  140. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +1 -1
  141. package/build/types/index.d.ts +3 -1
  142. package/build/types/index.d.ts.map +1 -1
  143. package/build/types/statusIcon/StatusIcon.d.ts +6 -2
  144. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  145. package/package.json +3 -3
  146. package/src/avatar/Avatar.tsx +3 -0
  147. package/src/avatarGroup/AvatarGroup.css +28 -0
  148. package/src/avatarGroup/AvatarGroup.less +32 -0
  149. package/src/avatarGroup/AvatarGroup.story.tsx +195 -0
  150. package/src/avatarGroup/AvatarGroup.tsx +80 -0
  151. package/src/avatarGroup/index.ts +2 -0
  152. package/src/avatarView/AvatarView.css +28 -0
  153. package/src/avatarView/AvatarView.less +16 -0
  154. package/src/avatarView/AvatarView.story.tsx +573 -0
  155. package/src/avatarView/AvatarView.tsx +184 -0
  156. package/src/avatarView/NotificationDot.css +20 -0
  157. package/src/avatarView/NotificationDot.less +24 -0
  158. package/src/avatarView/NotificationDot.tsx +32 -0
  159. package/src/avatarView/index.ts +2 -0
  160. package/src/avatarWrapper/AvatarWrapper.story.tsx +6 -0
  161. package/src/avatarWrapper/AvatarWrapper.tsx +3 -0
  162. package/src/badge/Badge.css +6 -5
  163. package/src/badge/Badge.less +4 -3
  164. package/src/badge/Badge.tsx +8 -1
  165. package/src/badge/BadgeAssets.tsx +65 -0
  166. package/src/badge/index.ts +3 -0
  167. package/src/common/circle/Circle.css +36 -0
  168. package/src/common/circle/Circle.less +42 -1
  169. package/src/common/circle/Circle.tsx +41 -3
  170. package/src/common/dateUtils/index.ts +0 -1
  171. package/src/dateLookup/DateLookup.tests.story.tsx +5 -40
  172. package/src/dateLookup/DateLookup.tsx +11 -9
  173. package/src/dateLookup/dayCalendar/table/DayCalendarTable.tsx +2 -5
  174. package/src/decision/Decision.story.tsx +10 -46
  175. package/src/flowNavigation/FlowNavigation.story.js +10 -39
  176. package/src/i18n/de.json +5 -0
  177. package/src/i18n/es.json +5 -0
  178. package/src/i18n/fr.json +5 -0
  179. package/src/i18n/hu.json +5 -0
  180. package/src/i18n/id.json +5 -0
  181. package/src/i18n/it.json +5 -0
  182. package/src/i18n/ja.json +5 -0
  183. package/src/i18n/pl.json +5 -0
  184. package/src/i18n/pt.json +5 -0
  185. package/src/i18n/ro.json +5 -0
  186. package/src/i18n/ru.json +5 -0
  187. package/src/i18n/tr.json +5 -0
  188. package/src/index.ts +4 -0
  189. package/src/listItem/ListItem.story.tsx +6 -43
  190. package/src/main.css +98 -25
  191. package/src/main.less +2 -0
  192. package/src/navigationOption/NavigationOption.story.js +14 -65
  193. package/src/overlayHeader/OverlayHeader.story.tsx +5 -10
  194. package/src/radio/Radio.story.tsx +5 -5
  195. package/src/radioGroup/RadioGroup.story.tsx +3 -3
  196. package/src/selectOption/SelectOption.story.tsx +31 -30
  197. package/src/statusIcon/StatusIcon.css +0 -20
  198. package/src/statusIcon/StatusIcon.less +0 -17
  199. package/src/statusIcon/StatusIcon.tsx +14 -4
  200. package/src/tile/Tile.story.tsx +2 -6
  201. package/build/common/dateUtils/getDateView/getDateView.js +0 -10
  202. package/build/common/dateUtils/getDateView/getDateView.js.map +0 -1
  203. package/build/common/dateUtils/getDateView/getDateView.mjs +0 -8
  204. package/build/common/dateUtils/getDateView/getDateView.mjs.map +0 -1
  205. package/build/types/common/dateUtils/getDateView/getDateView.d.ts +0 -2
  206. package/build/types/common/dateUtils/getDateView/getDateView.d.ts.map +0 -1
  207. package/src/common/dateUtils/getDateView/getDateView.ts +0 -5
@@ -1,15 +1,14 @@
1
1
  /* eslint-disable react/jsx-child-element-spacing */
2
2
 
3
3
  import { action } from '@storybook/addon-actions';
4
- import { Documents } from '@transferwise/icons';
4
+ import { Documents, FastFlag } from '@transferwise/icons';
5
5
  import { ComponentProps } from 'react';
6
6
 
7
7
  import ActionButton from '../actionButton/ActionButton';
8
- import Avatar from '../avatar';
9
- import Badge from '../badge';
8
+ import AvatarView from '../avatarView';
10
9
  import Info from '../info';
11
10
  import Title from '../title/Title';
12
-
11
+ import Image from '../image';
13
12
  import ListItem, { List } from '.';
14
13
 
15
14
  export default {
@@ -42,13 +41,7 @@ export const Variants = () => {
42
41
  <List>
43
42
  <Template
44
43
  media={
45
- <Avatar>
46
- <img
47
- style={{ width: 32, height: 32 }}
48
- src="https://wise.com/public-resources/assets/balances/savings-emoji/google/✈️.png"
49
- alt=""
50
- />
51
- </Avatar>
44
+ <AvatarView imgSrc="https://wise.com/web-art/assets/illustrations/heart-small@2x.webp" />
52
45
  }
53
46
  />
54
47
  </List>
@@ -59,22 +52,7 @@ export const Variants = () => {
59
52
  <Template
60
53
  title="Sandra Pepper"
61
54
  value="Personal account"
62
- media={
63
- <Badge
64
- badge={
65
- <img
66
- src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
67
- alt=""
68
- height="24px"
69
- width="24px"
70
- />
71
- }
72
- >
73
- <Avatar type="initials" size="md">
74
- <span aria-hidden>SP</span>
75
- </Avatar>
76
- </Badge>
77
- }
55
+ media={<AvatarView name="Super Pepa" badge={{ icon: <FastFlag /> }} />}
78
56
  />
79
57
  </List>
80
58
  </div>
@@ -84,22 +62,7 @@ export const Variants = () => {
84
62
  <Template
85
63
  title="Account holder"
86
64
  value="Sandra Pepper"
87
- media={
88
- <Badge
89
- badge={
90
- <img
91
- src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
92
- alt=""
93
- height="24px"
94
- width="24px"
95
- />
96
- }
97
- >
98
- <Avatar type="initials" size="md">
99
- <span aria-hidden>SP</span>
100
- </Avatar>
101
- </Badge>
102
- }
65
+ media={<AvatarView name="Super Pepa" badge={{ icon: <FastFlag /> }} />}
103
66
  action={<ActionButton>Share details</ActionButton>}
104
67
  />
105
68
  </List>
package/src/main.css CHANGED
@@ -435,6 +435,62 @@ div.critical-comms .critical-comms-body {
435
435
  .np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
436
436
  border-color: var(--color-interactive-primary-hover);
437
437
  }
438
+ .np-notification-dot {
439
+ --np-notification-dot-size: 14px;
440
+ position: relative;
441
+ display: inline-block;
442
+ }
443
+ .np-notification-dot-mask {
444
+ -webkit-mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-notification-dot-size) / 2)) left calc(100% - (var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
445
+ mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-notification-dot-size) / 2)) left calc(100% - (var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
446
+ -webkit-mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-notification-dot-size) / 2)) left calc(100% - calc(var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
447
+ mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-notification-dot-size) / 2)) left calc(100% - calc(var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
448
+ }
449
+ .np-notification-dot-badge {
450
+ position: absolute;
451
+ width: var(--np-notification-dot-size);
452
+ height: var(--np-notification-dot-size);
453
+ background-color: var(--color-sentiment-negative);
454
+ border-radius: 9999px;
455
+ border-radius: var(--radius-full);
456
+ right: 0;
457
+ }
458
+ .np-avatar-view {
459
+ border-radius: 9999px;
460
+ border-radius: var(--radius-full);
461
+ color: var(--color-interactive-primary);
462
+ }
463
+ .np-avatar-view-non-interactive .np-avatar-view-content .wds-flag {
464
+ box-shadow: none;
465
+ }
466
+ .np-avatar-group {
467
+ display: inline-flex;
468
+ --np-avatar-group-size: 48px;
469
+ --np-avatar-size: 32px;
470
+ }
471
+ .np-avatar-group-diagonal {
472
+ width: var(--np-avatar-group-size);
473
+ height: var(--np-avatar-group-size);
474
+ }
475
+ .np-avatar-group-diagonal-mask {
476
+ -webkit-mask-image: radial-gradient(circle at top 55% left 100%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
477
+ mask-image: radial-gradient(circle at top 55% left 100%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
478
+ }
479
+ .np-avatar-group-diagonal-child {
480
+ margin-left: calc((var(--np-avatar-size) / 2) * -1);
481
+ margin-top: calc((var(--np-avatar-size) * var(--np-avatar-group-index)) / 2);
482
+ }
483
+ .np-avatar-group-horizontal {
484
+ width: calc((var(--np-avatar-size) * 2) - 2px);
485
+ height: var(--np-avatar-group-size);
486
+ }
487
+ .np-avatar-group-horizontal-mask {
488
+ -webkit-mask-image: radial-gradient(circle at right 50%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
489
+ mask-image: radial-gradient(circle at right 50%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
490
+ }
491
+ .np-avatar-group-horizontal-child {
492
+ margin-left: calc((var(--np-avatar-size) / 4) * -1);
493
+ }
438
494
  .tw-badge {
439
495
  position: relative;
440
496
  display: inline-block;
@@ -442,6 +498,7 @@ div.critical-comms .critical-comms-body {
442
498
  --badge-mask: 2px;
443
499
  --badge-mask-offset: calc(var(--badge-size) / 2);
444
500
  --badge-border-color: rgba(255, 255, 255, 0.08);
501
+ --badge-content-position: 0px;
445
502
  }
446
503
  .tw-badge.tw-badge-lg {
447
504
  --badge-size: 24px;
@@ -451,8 +508,8 @@ div.critical-comms .critical-comms-body {
451
508
  --badge-border-color: rgba(0, 0, 0, 0.08);
452
509
  }
453
510
  .tw-badge > .tw-badge__children {
454
- -webkit-mask-image: radial-gradient(circle at top 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));
455
- mask-image: radial-gradient(circle at top 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));
511
+ -webkit-mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) left calc(100% - var(--badge-mask-offset) - var(--badge-content-position)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
512
+ mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) left calc(100% - var(--badge-mask-offset) - var(--badge-content-position)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
456
513
  }
457
514
  [dir="rtl"] .tw-badge > .tw-badge__children {
458
515
  -webkit-mask-image: radial-gradient(circle at top 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));
@@ -460,8 +517,8 @@ div.critical-comms .critical-comms-body {
460
517
  }
461
518
  .tw-badge > .tw-badge__content {
462
519
  position: absolute;
463
- bottom: 0;
464
- right: 0;
520
+ bottom: var(--badge-content-position);
521
+ right: var(--badge-content-position);
465
522
  box-sizing: border-box;
466
523
  text-align: center;
467
524
  overflow: hidden;
@@ -470,7 +527,7 @@ div.critical-comms .critical-comms-body {
470
527
  user-select: none;
471
528
  }
472
529
  [dir="rtl"] .tw-badge > .tw-badge__content {
473
- left: 0;
530
+ left: var(--badge-content-position);
474
531
  right: auto;
475
532
  right: initial;
476
533
  }
@@ -1171,6 +1228,42 @@ div.critical-comms .critical-comms-body {
1171
1228
  width: var(--circle-size);
1172
1229
  height: var(--circle-size);
1173
1230
  flex-shrink: 0;
1231
+ --circle-border-color: var(--color-border-neutral);
1232
+ --circle-border-width: 1px;
1233
+ font-size: var(--circle-font-size);
1234
+ font-weight: 600;
1235
+ font-weight: var(--font-weight-semi-bold);
1236
+ line-height: 1;
1237
+ }
1238
+ .np-circle .np-display {
1239
+ font-size: var(--circle-font-size);
1240
+ }
1241
+ .np-circle .tw-icon > svg {
1242
+ height: var(--circle-icon-size);
1243
+ width: var(--circle-icon-size);
1244
+ }
1245
+ .np-circle img,
1246
+ .np-circle .wds-flag {
1247
+ border-radius: 9999px;
1248
+ border-radius: var(--radius-full);
1249
+ width: 100%;
1250
+ height: 100%;
1251
+ -o-object-fit: cover;
1252
+ object-fit: cover;
1253
+ }
1254
+ .np-circle-border {
1255
+ position: relative;
1256
+ }
1257
+ .np-circle-border::after {
1258
+ content: "";
1259
+ position: absolute;
1260
+ top: 0;
1261
+ left: 0;
1262
+ width: 100%;
1263
+ height: 100%;
1264
+ border-radius: 9999px;
1265
+ border-radius: var(--radius-full);
1266
+ box-shadow: inset 0 0 0 var(--circle-border-width) var(--circle-border-color);
1174
1267
  }
1175
1268
  .np-bottom-sheet {
1176
1269
  border-radius: 10px 10px 0 0;
@@ -4158,12 +4251,6 @@ html:not([dir="rtl"]) .np-navigation-option {
4158
4251
  transform: translateY(-24px);
4159
4252
  }
4160
4253
  }
4161
- .status-icon > svg {
4162
- height: 32px;
4163
- height: var(--size-32);
4164
- width: 32px;
4165
- width: var(--size-32);
4166
- }
4167
4254
  .status-circle .light {
4168
4255
  color: var(--color-contrast);
4169
4256
  }
@@ -4179,20 +4266,6 @@ html:not([dir="rtl"]) .np-navigation-option {
4179
4266
  .np-theme-personal .status-circle.pending .status-icon {
4180
4267
  color: var(--color-dark);
4181
4268
  }
4182
- .status-circle-sm .status-icon > svg {
4183
- height: 14px;
4184
- height: var(--size-14);
4185
- width: 14px;
4186
- width: var(--size-14);
4187
- }
4188
- @media (max-width: 320px) {
4189
- .status-circle-sm .status-icon > svg {
4190
- width: 24px;
4191
- width: var(--size-24);
4192
- height: 24px;
4193
- height: var(--size-24);
4194
- }
4195
- }
4196
4269
  .status-circle.negative,
4197
4270
  .status-circle.error {
4198
4271
  background-color: var(--color-sentiment-negative);
package/src/main.less CHANGED
@@ -3,6 +3,8 @@
3
3
  @import "./actionButton/ActionButton.less";
4
4
  @import "./alert/Alert.less";
5
5
  @import "./avatar/Avatar.less";
6
+ @import "./avatarView/AvatarView.less";
7
+ @import "./avatarGroup/AvatarGroup.less";
6
8
  @import "./badge/Badge.less";
7
9
  @import "./button/Button.less";
8
10
  @import "./card/Card.less";
@@ -3,13 +3,13 @@ import { text, boolean } from '@storybook/addon-knobs';
3
3
  import {
4
4
  FastFlag as FastFlagIcon,
5
5
  Bank as BankIcon,
6
- PlusCircle,
7
- Profile,
8
6
  UpwardGraph as UpwardGraphIcon,
7
+ Plus as PlusIcon,
8
+ FastFlag,
9
9
  } from '@transferwise/icons';
10
10
  import { Illustration, Assets, Flag } from '@wise/art';
11
11
 
12
- import { Badge, Nudge, Avatar, Header, Title, Typography } from '..';
12
+ import { Nudge, Header, Title, Typography, AvatarView } from '..';
13
13
 
14
14
  import NavigationOption from './NavigationOption';
15
15
 
@@ -67,37 +67,13 @@ export const Variants = () => (
67
67
  </div>
68
68
  <div className="m-b-2">
69
69
  <div className="title-4 m-b-1">With Icon Avatar</div>
70
- <Template
71
- showMediaCircle={false}
72
- media={
73
- <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
74
- <Avatar type="icon">
75
- <Profile size="24" />
76
- </Avatar>
77
- </Badge>
78
- }
79
- />
70
+ <Template showMediaCircle={false} media={<AvatarView badge={{ icon: <PlusIcon /> }} />} />
80
71
  </div>
81
72
  <div className="m-b-2">
82
73
  <div className="title-4 m-b-1">With Contact Avatar</div>
83
74
  <Template
84
75
  showMediaCircle={false}
85
- media={
86
- <Badge
87
- badge={
88
- <img
89
- src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
90
- alt=""
91
- height="24px"
92
- width="24px"
93
- />
94
- }
95
- >
96
- <Avatar type="initials" size="md">
97
- <span aria-hidden>SP</span>
98
- </Avatar>
99
- </Badge>
100
- }
76
+ media={<AvatarView name="Super Pepa" badge={{ icon: <FastFlag /> }} />}
101
77
  />
102
78
  </div>
103
79
  <div className="m-t-4 m-b-2">
@@ -109,22 +85,7 @@ export const Variants = () => (
109
85
  </p>
110
86
  <Template
111
87
  showMediaCircle
112
- media={
113
- <Badge
114
- badge={
115
- <img
116
- src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
117
- alt=""
118
- height="24px"
119
- width="24px"
120
- />
121
- }
122
- >
123
- <Avatar type="initials" size="md">
124
- <span aria-hidden>SP</span>
125
- </Avatar>
126
- </Badge>
127
- }
88
+ media={<AvatarView name="Super Pepa" badge={{ icon: <FastFlag /> }} />}
128
89
  />
129
90
  </div>
130
91
  </>
@@ -204,9 +165,9 @@ export const BalanceContent = () => (
204
165
  content="British pound"
205
166
  showMediaCircle={false}
206
167
  media={
207
- <Avatar type="icon">
168
+ <AvatarView>
208
169
  <Flag code="GBP" />
209
- </Avatar>
170
+ </AvatarView>
210
171
  }
211
172
  />
212
173
  );
@@ -215,13 +176,7 @@ export const NewContactContent = () => (
215
176
  <NavigationOptionTemplate
216
177
  title="New Contact"
217
178
  showMediaCircle={false}
218
- media={
219
- <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
220
- <Avatar type="icon">
221
- <Profile size="24" />
222
- </Avatar>
223
- </Badge>
224
- }
179
+ media={<AvatarView badge={{ type: 'action' }} />}
225
180
  />
226
181
  );
227
182
 
@@ -230,13 +185,7 @@ export const ExistingContactContent = () => (
230
185
  title="Wise Customer"
231
186
  content="EUR account ending in 1111"
232
187
  showMediaCircle={false}
233
- media={
234
- <Badge badge={<Flag code="EUR" />}>
235
- <Avatar type="initials" size="md">
236
- <span aria-hidden>WS</span>
237
- </Avatar>
238
- </Badge>
239
- }
188
+ media={<AvatarView name="Wise Steve" badge={{ flagCode: 'EUR' }} />}
240
189
  />
241
190
  );
242
191
 
@@ -262,9 +211,9 @@ export const ManageAccountContent = () => (
262
211
  content="View and share your account details to get paid."
263
212
  showMediaCircle={false}
264
213
  media={
265
- <Avatar type="icon">
214
+ <AvatarView>
266
215
  <BankIcon size={24} />
267
- </Avatar>
216
+ </AvatarView>
268
217
  }
269
218
  />
270
219
  <NavigationOptionTemplate
@@ -272,9 +221,9 @@ export const ManageAccountContent = () => (
272
221
  content="Convert money between your balances at your desired exchange rate."
273
222
  showMediaCircle={false}
274
223
  media={
275
- <Avatar type="icon">
224
+ <AvatarView>
276
225
  <UpwardGraphIcon size={24} />
277
- </Avatar>
226
+ </AvatarView>
278
227
  }
279
228
  />
280
229
  </>
@@ -2,9 +2,8 @@ import { action } from '@storybook/addon-actions';
2
2
  import { select, text } from '@storybook/addon-knobs';
3
3
  import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';
4
4
 
5
- import Avatar, { AvatarType } from '../avatar';
6
- import AvatarWrapper from '../avatarWrapper';
7
- import { ProfileType, Size } from '../common';
5
+ import AvatarView from '../avatarView';
6
+ import { ProfileType } from '../common';
8
7
  import Logo from '../logo';
9
8
 
10
9
  import OverlayHeader from './OverlayHeader';
@@ -29,11 +28,7 @@ export const Basic = () => {
29
28
  return (
30
29
  <OverlayHeader
31
30
  logo={<Logo />}
32
- avatar={
33
- <Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
34
- {avatarProfiles[showAvatar]}
35
- </Avatar>
36
- }
31
+ avatar={<AvatarView>{avatarProfiles[showAvatar]}</AvatarView>}
37
32
  onClose={action('Close clicked')}
38
33
  />
39
34
  );
@@ -46,13 +41,13 @@ export const WithAvatarWrapper = () => {
46
41
  );
47
42
  const profileType = select(
48
43
  'profileType',
49
- Object.keys(ProfileType) as `${ProfileType}`[],
44
+ [ProfileType.PERSONAL, ProfileType.BUSINESS],
50
45
  undefined,
51
46
  );
52
47
  return (
53
48
  <OverlayHeader
54
49
  logo={<Logo />}
55
- avatar={<AvatarWrapper url={avatarURL} profileType={profileType} />}
50
+ avatar={<AvatarView imgSrc={avatarURL} type={profileType?.toLowerCase()} />}
56
51
  onClose={action('Close clicked')}
57
52
  />
58
53
  );
@@ -2,7 +2,7 @@ import { boolean, text } from '@storybook/addon-knobs';
2
2
  import { Flag } from '@wise/art';
3
3
  import { useState } from 'react';
4
4
 
5
- import Avatar, { AvatarType } from '../avatar';
5
+ import AvatarView from '../avatarView';
6
6
  import Checkbox from '../checkbox';
7
7
 
8
8
  import Radio from './Radio';
@@ -32,9 +32,9 @@ export const Basic = () => {
32
32
  disabled={disabled}
33
33
  avatar={
34
34
  showAvatar ? (
35
- <Avatar type={AvatarType.THUMBNAIL}>
35
+ <AvatarView>
36
36
  <Flag code="IMP" />
37
- </Avatar>
37
+ </AvatarView>
38
38
  ) : null
39
39
  }
40
40
  onChange={() => setChecked(!checked)}
@@ -50,9 +50,9 @@ export const Basic = () => {
50
50
  secondary={secondary}
51
51
  avatar={
52
52
  showAvatar ? (
53
- <Avatar type={AvatarType.THUMBNAIL}>
53
+ <AvatarView>
54
54
  <Flag code="KES" />
55
- </Avatar>
55
+ </AvatarView>
56
56
  ) : null
57
57
  }
58
58
  onChange={() => setChecked(!checked)}
@@ -1,6 +1,6 @@
1
1
  import { Flag } from '@wise/art';
2
2
 
3
- import Avatar, { AvatarType } from '../avatar';
3
+ import AvatarView from '../avatarView';
4
4
 
5
5
  import RadioGroup, { RadioGroupProps, RadioGroupRadio } from './RadioGroup';
6
6
  import { Field } from '../field/Field';
@@ -52,9 +52,9 @@ export const WithAvatars = {
52
52
  ({
53
53
  ...radio,
54
54
  avatar: (
55
- <Avatar type={AvatarType.THUMBNAIL}>
55
+ <AvatarView>
56
56
  <Flag code="NZD" />
57
- </Avatar>
57
+ </AvatarView>
58
58
  ),
59
59
  }) satisfies RadioGroupRadio,
60
60
  ),
@@ -8,8 +8,7 @@ import SelectOption, {
8
8
  import { Bank, BankTransfer, Beach, Briefcase, Card, Plane } from '@transferwise/icons';
9
9
  import { Field } from '../field/Field';
10
10
  import { lorem10 } from '../test-utils';
11
- import Badge from '../badge';
12
- import Avatar from '../avatar';
11
+ import AvatarView from '../avatarView';
13
12
  import { Sentiment } from '../common';
14
13
  import { useState } from 'react';
15
14
 
@@ -116,57 +115,59 @@ const paymentMethods: SelectOptiopsSection<CustomData>[] = [
116
115
  ];
117
116
 
118
117
  const balances: SelectOptiopsSection[] = [
119
- {
120
- title: 'Balances',
121
- options: [
122
- {
123
- media: <Flag code="gbp" />,
124
- title: 'Wise GBP balance',
125
- },
126
- {
127
- media: <Flag code="eur" />,
128
- title: 'Wise EUR balance',
129
- },
130
- ],
131
- },
132
118
  {
133
119
  title: 'Jars',
134
120
  options: [
135
121
  {
136
122
  media: (
137
- <Badge badge={<Flag code="usd" />} size="md">
138
- <Avatar type="icon" size="md" backgroundColor="var(--color-bright-pink)">
139
- <Beach size="24" />
140
- </Avatar>
141
- </Badge>
123
+ <AvatarView
124
+ badge={{ flagCode: 'usd' }}
125
+ style={{ backgroundColor: 'var(--color-bright-pink)' }}
126
+ name="Tim Cook"
127
+ />
142
128
  ),
143
129
  title: 'Hawaii Holiday',
144
130
  content: 'Wise USD jar',
145
131
  },
146
132
  {
147
133
  media: (
148
- <Badge badge={<Flag code="aed" />} size="md">
149
- <Avatar type="icon" size="md" backgroundColor="var(--color-bright-yellow)">
150
- <Briefcase size="24" />
151
- </Avatar>
152
- </Badge>
134
+ <AvatarView
135
+ badge={{ flagCode: 'aed' }}
136
+ style={{ backgroundColor: 'var(--color-bright-yellow)' }}
137
+ >
138
+ <Briefcase />
139
+ </AvatarView>
153
140
  ),
154
141
  title: 'Emirates Business Trip',
155
142
  content: 'Wise AED jar',
156
143
  },
157
144
  {
158
145
  media: (
159
- <Badge badge={<Flag code="jpy" />} size="md">
160
- <Avatar type="icon" size="md" backgroundColor="var(--color-bright-blue)">
161
- <Plane size="24" />
162
- </Avatar>
163
- </Badge>
146
+ <AvatarView
147
+ badge={{ flagCode: 'jpy' }}
148
+ style={{ backgroundColor: 'var(--color-bright-blue)' }}
149
+ >
150
+ <Plane />
151
+ </AvatarView>
164
152
  ),
165
153
  title: 'Trip to Mars',
166
154
  content: 'Wise Jpy jar',
167
155
  },
168
156
  ],
169
157
  },
158
+ {
159
+ title: 'Balances',
160
+ options: [
161
+ {
162
+ media: <Flag code="gbp" />,
163
+ title: 'Wise GBP balance',
164
+ },
165
+ {
166
+ media: <Flag code="eur" />,
167
+ title: 'Wise EUR balance',
168
+ },
169
+ ],
170
+ },
170
171
  ];
171
172
 
172
173
  export const Basic: Story = {
@@ -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,20 +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
- @media (max-width: 320px) {
29
- .status-circle-sm .status-icon > svg {
30
- width: 24px;
31
- width: var(--size-24);
32
- height: 24px;
33
- height: var(--size-24);
34
- }
35
- }
36
16
  .status-circle.negative,
37
17
  .status-circle.error {
38
18
  background-color: var(--color-sentiment-negative);
@@ -1,8 +1,3 @@
1
- .status-icon > svg {
2
- height: var(--size-32);
3
- width: var(--size-32);
4
- }
5
-
6
1
  .status-circle {
7
2
  .light {
8
3
  color: var(--color-contrast);
@@ -22,18 +17,6 @@
22
17
  }
23
18
  }
24
19
  }
25
-
26
- &-sm {
27
- .status-icon > svg {
28
- height: var(--size-14);
29
- width: var(--size-14);
30
-
31
- @media (--screen-400-zoom) {
32
- width: var(--size-24);
33
- height: var(--size-24);
34
- }
35
- }
36
- }
37
20
  }
38
21
 
39
22
  .status-circle.negative,