@transferwise/components 0.0.0-experimental-d11e9c5 → 0.0.0-experimental-76bb7cd

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 (124) hide show
  1. package/build/avatar/Avatar.js +0 -3
  2. package/build/avatar/Avatar.js.map +1 -1
  3. package/build/avatar/Avatar.mjs +0 -3
  4. package/build/avatar/Avatar.mjs.map +1 -1
  5. package/build/avatarWrapper/AvatarWrapper.js +4 -10
  6. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  7. package/build/avatarWrapper/AvatarWrapper.mjs +4 -10
  8. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  9. package/build/badge/Badge.js +1 -3
  10. package/build/badge/Badge.js.map +1 -1
  11. package/build/badge/Badge.mjs +1 -3
  12. package/build/badge/Badge.mjs.map +1 -1
  13. package/build/button/Button.js.map +1 -1
  14. package/build/button/Button.mjs.map +1 -1
  15. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  16. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  17. package/build/common/circle/Circle.js +1 -17
  18. package/build/common/circle/Circle.js.map +1 -1
  19. package/build/common/circle/Circle.mjs +1 -17
  20. package/build/common/circle/Circle.mjs.map +1 -1
  21. package/build/index.js +121 -128
  22. package/build/index.js.map +1 -1
  23. package/build/index.mjs +29 -33
  24. package/build/index.mjs.map +1 -1
  25. package/build/main.css +5 -109
  26. package/build/styles/badge/Badge.css +5 -6
  27. package/build/styles/common/circle/Circle.css +0 -32
  28. package/build/styles/main.css +5 -109
  29. package/build/types/avatar/Avatar.d.ts +0 -3
  30. package/build/types/avatar/Avatar.d.ts.map +1 -1
  31. package/build/types/avatarWrapper/AvatarWrapper.d.ts +0 -3
  32. package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
  33. package/build/types/badge/Badge.d.ts +1 -5
  34. package/build/types/badge/Badge.d.ts.map +1 -1
  35. package/build/types/badge/index.d.ts +0 -2
  36. package/build/types/badge/index.d.ts.map +1 -1
  37. package/build/types/button/Button.d.ts +1 -1
  38. package/build/types/button/Button.d.ts.map +1 -1
  39. package/build/types/button/legacyUtils/legacyUtils.d.ts +2 -2
  40. package/build/types/button/legacyUtils/legacyUtils.d.ts.map +1 -1
  41. package/build/types/common/circle/Circle.d.ts +0 -2
  42. package/build/types/common/circle/Circle.d.ts.map +1 -1
  43. package/build/types/index.d.ts +1 -3
  44. package/build/types/index.d.ts.map +1 -1
  45. package/build/types/test-utils/index.d.ts +158 -0
  46. package/build/types/test-utils/index.d.ts.map +1 -0
  47. package/build/types/test-utils/jest.setup.d.ts +2 -0
  48. package/build/types/test-utils/jest.setup.d.ts.map +1 -0
  49. package/package.json +4 -3
  50. package/src/avatar/Avatar.tsx +0 -3
  51. package/src/avatarWrapper/AvatarWrapper.tsx +0 -3
  52. package/src/badge/Badge.css +5 -6
  53. package/src/badge/Badge.less +3 -4
  54. package/src/badge/Badge.tsx +1 -8
  55. package/src/badge/index.ts +0 -3
  56. package/src/button/{Button.spec.js → Button.spec.tsx} +3 -2
  57. package/src/button/Button.tsx +1 -1
  58. package/src/button/legacyUtils/{legacyUtils.spec.js → legacyUtils.spec.tsx} +1 -1
  59. package/src/button/legacyUtils/legacyUtils.ts +2 -2
  60. package/src/common/circle/Circle.css +0 -32
  61. package/src/common/circle/Circle.less +0 -35
  62. package/src/common/circle/Circle.tsx +1 -22
  63. package/src/decision/Decision.story.tsx +46 -10
  64. package/src/flowNavigation/FlowNavigation.story.tsx +48 -10
  65. package/src/index.ts +0 -4
  66. package/src/listItem/ListItem.story.tsx +43 -5
  67. package/src/main.css +5 -109
  68. package/src/main.less +0 -2
  69. package/src/modal/{Modal.rtl.spec.js → Modal.rtl.spec.tsx} +8 -7
  70. package/src/navigationOption/NavigationOption.story.tsx +65 -14
  71. package/src/overlayHeader/OverlayHeader.story.tsx +10 -5
  72. package/src/radio/Radio.story.tsx +5 -5
  73. package/src/radioGroup/RadioGroup.story.tsx +3 -3
  74. package/src/selectOption/SelectOption.story.tsx +30 -31
  75. package/src/slidingPanel/SlidingPanel.spec.js +1 -1
  76. package/src/ssr.spec.tsx +264 -0
  77. package/src/test-utils/{index.js → index.tsx} +11 -6
  78. package/src/test-utils/{jest.setup.js → jest.setup.ts} +13 -8
  79. package/src/tile/Tile.story.tsx +6 -2
  80. package/build/avatarView/AvatarView.js +0 -163
  81. package/build/avatarView/AvatarView.js.map +0 -1
  82. package/build/avatarView/AvatarView.mjs +0 -161
  83. package/build/avatarView/AvatarView.mjs.map +0 -1
  84. package/build/avatarView/NotificationDot.js +0 -59
  85. package/build/avatarView/NotificationDot.js.map +0 -1
  86. package/build/avatarView/NotificationDot.mjs +0 -57
  87. package/build/avatarView/NotificationDot.mjs.map +0 -1
  88. package/build/badge/BadgeAssets.js +0 -85
  89. package/build/badge/BadgeAssets.js.map +0 -1
  90. package/build/badge/BadgeAssets.mjs +0 -83
  91. package/build/badge/BadgeAssets.mjs.map +0 -1
  92. package/build/styles/avatarGroup/AvatarGroup.css +0 -29
  93. package/build/styles/avatarView/AvatarView.css +0 -42
  94. package/build/styles/avatarView/NotificationDot.css +0 -20
  95. package/build/types/avatarGroup/AvatarGroup.d.ts +0 -18
  96. package/build/types/avatarGroup/AvatarGroup.d.ts.map +0 -1
  97. package/build/types/avatarGroup/index.d.ts +0 -3
  98. package/build/types/avatarGroup/index.d.ts.map +0 -1
  99. package/build/types/avatarView/AvatarView.d.ts +0 -19
  100. package/build/types/avatarView/AvatarView.d.ts.map +0 -1
  101. package/build/types/avatarView/NotificationDot.d.ts +0 -8
  102. package/build/types/avatarView/NotificationDot.d.ts.map +0 -1
  103. package/build/types/avatarView/index.d.ts +0 -3
  104. package/build/types/avatarView/index.d.ts.map +0 -1
  105. package/build/types/badge/BadgeAssets.d.ts +0 -15
  106. package/build/types/badge/BadgeAssets.d.ts.map +0 -1
  107. package/src/avatarGroup/AvatarGroup.css +0 -29
  108. package/src/avatarGroup/AvatarGroup.less +0 -42
  109. package/src/avatarGroup/AvatarGroup.story.tsx +0 -284
  110. package/src/avatarGroup/AvatarGroup.tsx +0 -117
  111. package/src/avatarGroup/index.ts +0 -2
  112. package/src/avatarView/AvatarView.css +0 -42
  113. package/src/avatarView/AvatarView.less +0 -33
  114. package/src/avatarView/AvatarView.story.tsx +0 -425
  115. package/src/avatarView/AvatarView.tsx +0 -141
  116. package/src/avatarView/NotificationDot.css +0 -20
  117. package/src/avatarView/NotificationDot.less +0 -24
  118. package/src/avatarView/NotificationDot.tsx +0 -35
  119. package/src/avatarView/index.ts +0 -2
  120. package/src/badge/BadgeAssets.tsx +0 -65
  121. package/src/ssr.spec.js +0 -256
  122. /package/src/button/__snapshots__/{Button.spec.js.snap → Button.spec.tsx.snap} +0 -0
  123. /package/src/dimmer/{Dimmer.rtl.spec.js → Dimmer.rtl.spec.tsx} +0 -0
  124. /package/src/info/{Info.spec.js → Info.spec.jsx} +0 -0
package/src/main.css CHANGED
@@ -469,77 +469,6 @@ div.critical-comms .critical-comms-body {
469
469
  .np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
470
470
  border-color: var(--color-interactive-primary-hover);
471
471
  }
472
- .np-notification-dot {
473
- --np-notification-dot-size: 14px;
474
- position: relative;
475
- display: inline-block;
476
- }
477
- .np-notification-dot-mask {
478
- -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);
479
- 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);
480
- -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);
481
- 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);
482
- }
483
- .np-notification-dot-badge {
484
- position: absolute;
485
- width: var(--np-notification-dot-size);
486
- height: var(--np-notification-dot-size);
487
- background-color: var(--color-sentiment-negative);
488
- border-radius: 9999px;
489
- border-radius: var(--radius-full);
490
- right: 0;
491
- }
492
- .np-avatar-view .np-avatar-view-content {
493
- color: var(--color-interactive-primary);
494
- }
495
- .np-avatar-view-interactive {
496
- cursor: pointer;
497
- }
498
- .np-avatar-view-interactive .np-circle {
499
- background-color: rgba(134,167,189,0.10196);
500
- background-color: var(--color-background-neutral);
501
- }
502
- .np-avatar-view-interactive:hover {
503
- background-color: var(--color-background-neutral-hover);
504
- }
505
- .np-avatar-view-interactive:active {
506
- background-color: var(--color-background-neutral-active);
507
- }
508
- .np-avatar-view-non-interactive .np-circle {
509
- background-color: transparent;
510
- }
511
- .np-avatar-view-non-interactive .np-avatar-view-content .wds-flag {
512
- box-shadow: none;
513
- }
514
- .np-avatar-group {
515
- display: inline-flex;
516
- position: relative;
517
- }
518
- .np-avatar-group-diagonal {
519
- width: var(--np-avatar-group-size);
520
- height: var(--np-avatar-group-size);
521
- }
522
- .np-avatar-group-diagonal-mask {
523
- -webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
524
- mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-group-size) / 1.5) right calc(100% - var(--np-avatar-group-size) / 1.5), transparent 0, transparent calc(var(--np-avatar-group-single-size) / 2 + 0.5px), black 0);
525
- }
526
- .np-avatar-group-diagonal-child {
527
- position: absolute;
528
- top: var(--np-avatar-group-diagonal-child-position);
529
- right: 0;
530
- }
531
- .np-avatar-group-horizontal {
532
- height: var(--np-avatar-group-size);
533
- }
534
- .np-avatar-group-horizontal-mask {
535
- -webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
536
- mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc((100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc((var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
537
- -webkit-mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
538
- mask-image: radial-gradient(circle at top calc(100% - var(--np-avatar-group-single-size) / 2) right calc(calc(100% - var(--np-avatar-group-single-size) / 1.5) * -1), transparent 0, transparent calc(calc(var(--np-avatar-group-single-size) / 2.5) + var(--np-avatar-group-horizontal-child-position)), black 0);
539
- }
540
- .np-avatar-group-horizontal-child {
541
- margin-left: calc(var(--np-avatar-group-horizontal-child-position) * -1);
542
- }
543
472
  .tw-badge {
544
473
  position: relative;
545
474
  display: inline-block;
@@ -547,7 +476,6 @@ div.critical-comms .critical-comms-body {
547
476
  --badge-mask: 2px;
548
477
  --badge-mask-offset: calc(var(--badge-size) / 2);
549
478
  --badge-border-color: rgba(255, 255, 255, 0.08);
550
- --badge-content-position: 0px;
551
479
  }
552
480
  .tw-badge.tw-badge-lg {
553
481
  --badge-size: 24px;
@@ -557,8 +485,8 @@ div.critical-comms .critical-comms-body {
557
485
  --badge-border-color: rgba(0, 0, 0, 0.08);
558
486
  }
559
487
  .tw-badge > .tw-badge__children {
560
- -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));
561
- 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));
488
+ -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));
489
+ 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));
562
490
  }
563
491
  [dir="rtl"] .tw-badge > .tw-badge__children {
564
492
  -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));
@@ -568,8 +496,8 @@ div.critical-comms .critical-comms-body {
568
496
  position: absolute;
569
497
  width: var(--badge-size);
570
498
  height: var(--badge-size);
571
- bottom: var(--badge-content-position);
572
- right: var(--badge-content-position);
499
+ bottom: 0;
500
+ right: 0;
573
501
  box-sizing: border-box;
574
502
  border-radius: 50%;
575
503
  text-align: center;
@@ -582,7 +510,7 @@ div.critical-comms .critical-comms-body {
582
510
  user-select: none;
583
511
  }
584
512
  [dir="rtl"] .tw-badge > .tw-badge__content {
585
- left: var(--badge-content-position);
513
+ left: 0;
586
514
  right: auto;
587
515
  right: initial;
588
516
  }
@@ -1283,43 +1211,11 @@ div.critical-comms .critical-comms-body {
1283
1211
  width: var(--circle-size);
1284
1212
  height: var(--circle-size);
1285
1213
  flex-shrink: 0;
1286
- --circle-border-color: var(--color-border-neutral);
1287
- --circle-border-width: 1px;
1288
- font-size: var(--circle-font-size);
1289
- font-weight: 600;
1290
- font-weight: var(--font-weight-semi-bold);
1291
- line-height: 1;
1292
- }
1293
- .np-circle .np-display {
1294
- font-size: var(--circle-font-size);
1295
1214
  }
1296
1215
  .np-circle .tw-icon > svg {
1297
1216
  height: var(--circle-icon-size);
1298
1217
  width: var(--circle-icon-size);
1299
1218
  }
1300
- .np-circle img,
1301
- .np-circle .wds-flag {
1302
- border-radius: 9999px;
1303
- border-radius: var(--radius-full);
1304
- width: 100%;
1305
- height: 100%;
1306
- -o-object-fit: cover;
1307
- object-fit: cover;
1308
- }
1309
- .np-circle-border {
1310
- position: relative;
1311
- }
1312
- .np-circle-border::after {
1313
- content: "";
1314
- position: absolute;
1315
- top: 0;
1316
- left: 0;
1317
- width: 100%;
1318
- height: 100%;
1319
- border-radius: 9999px;
1320
- border-radius: var(--radius-full);
1321
- box-shadow: inset 0 0 0 var(--circle-border-width) var(--circle-border-color);
1322
- }
1323
1219
  .np-bottom-sheet {
1324
1220
  border-radius: 10px 10px 0 0;
1325
1221
  }
package/src/main.less CHANGED
@@ -3,8 +3,6 @@
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";
8
6
  @import "./badge/Badge.less";
9
7
  @import "./button/Button.less";
10
8
  @import "./card/Card.less";
@@ -1,15 +1,16 @@
1
1
  import { Position } from '../common';
2
2
  import { render, fireEvent, screen, mockMatchMedia } from '../test-utils';
3
3
 
4
- import Modal from './Modal';
4
+ import Modal, { ModalProps } from './Modal';
5
5
 
6
6
  mockMatchMedia();
7
7
 
8
8
  describe('Modal', () => {
9
- const props = {
9
+ const props: ModalProps = {
10
10
  onClose: jest.fn(),
11
11
  body: 'Some body',
12
12
  position: Position.TOP,
13
+ open: true,
13
14
  };
14
15
 
15
16
  beforeEach(() => {
@@ -17,14 +18,14 @@ describe('Modal', () => {
17
18
  });
18
19
 
19
20
  it(`doesn't calls onClose when click is inside modal`, () => {
20
- render(<Modal {...props} open />);
21
+ render(<Modal {...props} />);
21
22
 
22
23
  fireEvent.click(getDialog());
23
24
  expect(props.onClose).not.toHaveBeenCalled();
24
25
  });
25
26
 
26
27
  it('calls onClose if click outside the content', () => {
27
- render(<Modal {...props} open />);
28
+ render(<Modal {...props} />);
28
29
  expect(props.onClose).not.toHaveBeenCalled();
29
30
 
30
31
  fireEvent.click(screen.getByRole('presentation'));
@@ -32,7 +33,7 @@ describe('Modal', () => {
32
33
  });
33
34
 
34
35
  it("doesn't call onClose if click outside the content and closing on dimmer is disabled", () => {
35
- render(<Modal {...props} open disableDimmerClickToClose />);
36
+ render(<Modal {...props} disableDimmerClickToClose />);
36
37
 
37
38
  fireEvent.click(screen.getByRole('presentation'));
38
39
 
@@ -40,7 +41,7 @@ describe('Modal', () => {
40
41
  });
41
42
 
42
43
  it('calls onClose when Escape is pressed on Modal', () => {
43
- render(<Modal {...props} open />);
44
+ render(<Modal {...props} />);
44
45
  expect(props.onClose).not.toHaveBeenCalled();
45
46
 
46
47
  fireEvent.keyDown(getDialog(), { key: 'Escape' });
@@ -48,7 +49,7 @@ describe('Modal', () => {
48
49
  });
49
50
 
50
51
  it('calls onClose when Escape is pressed on document', () => {
51
- render(<Modal {...props} open />);
52
+ render(<Modal {...props} />);
52
53
  expect(props.onClose).not.toHaveBeenCalled();
53
54
 
54
55
  fireEvent.keyDown(document, { key: 'Escape' });
@@ -4,13 +4,13 @@ import { text, boolean } from '@storybook/addon-knobs';
4
4
  import {
5
5
  FastFlag as FastFlagIcon,
6
6
  Bank as BankIcon,
7
+ PlusCircle,
8
+ Profile,
7
9
  UpwardGraph as UpwardGraphIcon,
8
- Plus as PlusIcon,
9
- FastFlag,
10
10
  } from '@transferwise/icons';
11
11
  import { Illustration, Assets, Flag } from '@wise/art';
12
12
 
13
- import { Nudge, Header, Title, Typography, AvatarView } from '..';
13
+ import { Badge, Nudge, Avatar, Header, Title, Typography } from '..';
14
14
 
15
15
  import NavigationOption from './NavigationOption';
16
16
 
@@ -82,13 +82,37 @@ export const Variants = () => (
82
82
  </div>
83
83
  <div className="m-b-2">
84
84
  <div className="title-4 m-b-1">With Icon Avatar</div>
85
- <Template showMediaCircle={false} media={<AvatarView badge={{ icon: <PlusIcon /> }} />} />
85
+ <Template
86
+ showMediaCircle={false}
87
+ media={
88
+ <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
89
+ <Avatar type="icon">
90
+ <Profile size="24" />
91
+ </Avatar>
92
+ </Badge>
93
+ }
94
+ />
86
95
  </div>
87
96
  <div className="m-b-2">
88
97
  <div className="title-4 m-b-1">With Contact Avatar</div>
89
98
  <Template
90
99
  showMediaCircle={false}
91
- media={<AvatarView name="Super Pepa" badge={{ icon: <FastFlag /> }} />}
100
+ media={
101
+ <Badge
102
+ badge={
103
+ <img
104
+ src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
105
+ alt=""
106
+ height="24px"
107
+ width="24px"
108
+ />
109
+ }
110
+ >
111
+ <Avatar type="initials" size="md">
112
+ <span aria-hidden>SP</span>
113
+ </Avatar>
114
+ </Badge>
115
+ }
92
116
  />
93
117
  </div>
94
118
  <div className="m-t-4 m-b-2">
@@ -100,7 +124,22 @@ export const Variants = () => (
100
124
  </p>
101
125
  <Template
102
126
  showMediaCircle
103
- media={<AvatarView name="Super Pepa" badge={{ icon: <FastFlag /> }} />}
127
+ media={
128
+ <Badge
129
+ badge={
130
+ <img
131
+ src="https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg"
132
+ alt=""
133
+ height="24px"
134
+ width="24px"
135
+ />
136
+ }
137
+ >
138
+ <Avatar type="initials" size="md">
139
+ <span aria-hidden>SP</span>
140
+ </Avatar>
141
+ </Badge>
142
+ }
104
143
  />
105
144
  </div>
106
145
  </>
@@ -183,9 +222,9 @@ export const BalanceContent = () => (
183
222
  content="British pound"
184
223
  showMediaCircle={false}
185
224
  media={
186
- <AvatarView>
225
+ <Avatar type="icon">
187
226
  <Flag code="GBP" />
188
- </AvatarView>
227
+ </Avatar>
189
228
  }
190
229
  />
191
230
  );
@@ -194,7 +233,13 @@ export const NewContactContent = () => (
194
233
  <NavigationOptionTemplate
195
234
  title="New Contact"
196
235
  showMediaCircle={false}
197
- media={<AvatarView badge={{ type: 'action' }} />}
236
+ media={
237
+ <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
238
+ <Avatar type="icon">
239
+ <Profile size="24" />
240
+ </Avatar>
241
+ </Badge>
242
+ }
198
243
  />
199
244
  );
200
245
 
@@ -203,7 +248,13 @@ export const ExistingContactContent = () => (
203
248
  title="Wise Customer"
204
249
  content="EUR account ending in 1111"
205
250
  showMediaCircle={false}
206
- media={<AvatarView name="Wise Steve" badge={{ flagCode: 'EUR' }} />}
251
+ media={
252
+ <Badge badge={<Flag code="EUR" />}>
253
+ <Avatar type="initials" size="md">
254
+ <span aria-hidden>WS</span>
255
+ </Avatar>
256
+ </Badge>
257
+ }
207
258
  />
208
259
  );
209
260
 
@@ -229,9 +280,9 @@ export const ManageAccountContent = () => (
229
280
  content="View and share your account details to get paid."
230
281
  showMediaCircle={false}
231
282
  media={
232
- <AvatarView>
283
+ <Avatar type="icon">
233
284
  <BankIcon size={24} />
234
- </AvatarView>
285
+ </Avatar>
235
286
  }
236
287
  />
237
288
  <NavigationOptionTemplate
@@ -239,9 +290,9 @@ export const ManageAccountContent = () => (
239
290
  content="Convert money between your balances at your desired exchange rate."
240
291
  showMediaCircle={false}
241
292
  media={
242
- <AvatarView>
293
+ <Avatar type="icon">
243
294
  <UpwardGraphIcon size={24} />
244
- </AvatarView>
295
+ </Avatar>
245
296
  }
246
297
  />
247
298
  </>
@@ -2,8 +2,9 @@ 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 AvatarView from '../avatarView';
6
- import { ProfileType } from '../common';
5
+ import Avatar, { AvatarType } from '../avatar';
6
+ import AvatarWrapper from '../avatarWrapper';
7
+ import { ProfileType, Size } from '../common';
7
8
  import Logo from '../logo';
8
9
 
9
10
  import OverlayHeader from './OverlayHeader';
@@ -28,7 +29,11 @@ export const Basic = () => {
28
29
  return (
29
30
  <OverlayHeader
30
31
  logo={<Logo />}
31
- avatar={<AvatarView>{avatarProfiles[showAvatar]}</AvatarView>}
32
+ avatar={
33
+ <Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
34
+ {avatarProfiles[showAvatar]}
35
+ </Avatar>
36
+ }
32
37
  onClose={action('Close clicked')}
33
38
  />
34
39
  );
@@ -41,13 +46,13 @@ export const WithAvatarWrapper = () => {
41
46
  );
42
47
  const profileType = select(
43
48
  'profileType',
44
- [ProfileType.PERSONAL, ProfileType.BUSINESS],
49
+ Object.keys(ProfileType) as `${ProfileType}`[],
45
50
  undefined,
46
51
  );
47
52
  return (
48
53
  <OverlayHeader
49
54
  logo={<Logo />}
50
- avatar={<AvatarView imgSrc={avatarURL} type={profileType?.toLowerCase()} />}
55
+ avatar={<AvatarWrapper url={avatarURL} profileType={profileType} />}
51
56
  onClose={action('Close clicked')}
52
57
  />
53
58
  );
@@ -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 AvatarView from '../avatarView';
5
+ import Avatar, { AvatarType } from '../avatar';
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
- <AvatarView>
35
+ <Avatar type={AvatarType.THUMBNAIL}>
36
36
  <Flag code="IMP" />
37
- </AvatarView>
37
+ </Avatar>
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
- <AvatarView>
53
+ <Avatar type={AvatarType.THUMBNAIL}>
54
54
  <Flag code="KES" />
55
- </AvatarView>
55
+ </Avatar>
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 AvatarView from '../avatarView';
3
+ import Avatar, { AvatarType } from '../avatar';
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
- <AvatarView>
55
+ <Avatar type={AvatarType.THUMBNAIL}>
56
56
  <Flag code="NZD" />
57
- </AvatarView>
57
+ </Avatar>
58
58
  ),
59
59
  }) satisfies RadioGroupRadio,
60
60
  ),
@@ -8,7 +8,8 @@ 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 AvatarView from '../avatarView';
11
+ import Badge from '../badge';
12
+ import Avatar from '../avatar';
12
13
  import { Sentiment } from '../common';
13
14
  import { useState } from 'react';
14
15
 
@@ -115,59 +116,57 @@ const paymentMethods: SelectOptiopsSection<CustomData>[] = [
115
116
  ];
116
117
 
117
118
  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
+ },
118
132
  {
119
133
  title: 'Jars',
120
134
  options: [
121
135
  {
122
136
  media: (
123
- <AvatarView
124
- badge={{ flagCode: 'usd' }}
125
- style={{ backgroundColor: 'var(--color-bright-pink)' }}
126
- name="Tim Cook"
127
- />
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>
128
142
  ),
129
143
  title: 'Hawaii Holiday',
130
144
  content: 'Wise USD jar',
131
145
  },
132
146
  {
133
147
  media: (
134
- <AvatarView
135
- badge={{ flagCode: 'aed' }}
136
- style={{ backgroundColor: 'var(--color-bright-yellow)' }}
137
- >
138
- <Briefcase />
139
- </AvatarView>
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>
140
153
  ),
141
154
  title: 'Emirates Business Trip',
142
155
  content: 'Wise AED jar',
143
156
  },
144
157
  {
145
158
  media: (
146
- <AvatarView
147
- badge={{ flagCode: 'jpy' }}
148
- style={{ backgroundColor: 'var(--color-bright-blue)' }}
149
- >
150
- <Plane />
151
- </AvatarView>
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>
152
164
  ),
153
165
  title: 'Trip to Mars',
154
166
  content: 'Wise Jpy jar',
155
167
  },
156
168
  ],
157
169
  },
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
- },
171
170
  ];
172
171
 
173
172
  export const Basic: Story = {
@@ -1,6 +1,6 @@
1
1
  import { shallow, mount } from 'enzyme';
2
2
 
3
- import SlidingPanel, { EXIT_ANIMATION } from './SlidingPanel';
3
+ import SlidingPanel from './SlidingPanel';
4
4
 
5
5
  describe('SlidingPanel', () => {
6
6
  let component;