@transferwise/components 46.95.2 → 46.96.1

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 (75) hide show
  1. package/build/alert/Alert.js +18 -6
  2. package/build/alert/Alert.js.map +1 -1
  3. package/build/alert/Alert.mjs +18 -6
  4. package/build/alert/Alert.mjs.map +1 -1
  5. package/build/link/Link.js +32 -4
  6. package/build/link/Link.js.map +1 -1
  7. package/build/link/Link.mjs +32 -4
  8. package/build/link/Link.mjs.map +1 -1
  9. package/build/main.css +18 -17
  10. package/build/nudge/Nudge.js +8 -4
  11. package/build/nudge/Nudge.js.map +1 -1
  12. package/build/nudge/Nudge.mjs +8 -4
  13. package/build/nudge/Nudge.mjs.map +1 -1
  14. package/build/promoCard/PromoCardIndicator.js +6 -5
  15. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  16. package/build/promoCard/PromoCardIndicator.mjs +6 -5
  17. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  18. package/build/styles/inputs/Input.css +2 -0
  19. package/build/styles/inputs/TextArea.css +2 -0
  20. package/build/styles/link/Link.css +2 -1
  21. package/build/styles/main.css +18 -17
  22. package/build/styles/popover/Popover.css +2 -0
  23. package/build/styles/statusIcon/StatusIcon.css +12 -1
  24. package/build/styles/stepper/Stepper.css +0 -7
  25. package/build/styles/summary/Summary.css +0 -4
  26. package/build/summary/Summary.js +8 -4
  27. package/build/summary/Summary.js.map +1 -1
  28. package/build/summary/Summary.mjs +8 -4
  29. package/build/summary/Summary.mjs.map +1 -1
  30. package/build/types/alert/Alert.d.ts.map +1 -1
  31. package/build/types/link/Link.d.ts +2 -2
  32. package/build/types/link/Link.d.ts.map +1 -1
  33. package/build/types/nudge/Nudge.d.ts +2 -2
  34. package/build/types/nudge/Nudge.d.ts.map +1 -1
  35. package/build/types/summary/Summary.d.ts +2 -2
  36. package/build/types/summary/Summary.d.ts.map +1 -1
  37. package/package.json +3 -3
  38. package/src/alert/Alert.tsx +27 -10
  39. package/src/dateLookup/DateLookup.less +0 -1
  40. package/src/decision/Decision.spec.tsx +2 -2
  41. package/src/decision/Decision.story.tsx +10 -46
  42. package/src/flowNavigation/FlowNavigation.spec.js +3 -7
  43. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +8 -4
  44. package/src/inputs/Input.css +2 -0
  45. package/src/inputs/TextArea.css +2 -0
  46. package/src/link/Link.css +2 -1
  47. package/src/link/Link.less +1 -1
  48. package/src/link/Link.spec.tsx +32 -1
  49. package/src/link/Link.story.tsx +12 -0
  50. package/src/link/Link.tsx +17 -6
  51. package/src/main.css +18 -17
  52. package/src/navigationOption/NavigationOption.story.tsx +30 -53
  53. package/src/nudge/Nudge.tsx +15 -3
  54. package/src/overlayHeader/OverlayHeader.spec.tsx +5 -8
  55. package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +4 -2
  56. package/src/popover/Popover.css +2 -0
  57. package/src/promoCard/PromoCard.spec.tsx +3 -1
  58. package/src/promoCard/PromoCardIndicator.tsx +5 -5
  59. package/src/statusIcon/StatusIcon.css +12 -1
  60. package/src/statusIcon/StatusIcon.less +11 -1
  61. package/src/statusIcon/StatusIcon.story.tsx +37 -30
  62. package/src/stepper/Stepper.css +0 -7
  63. package/src/stepper/Stepper.less +0 -8
  64. package/src/summary/Summary.css +0 -4
  65. package/src/summary/Summary.less +0 -2
  66. package/src/summary/Summary.tsx +14 -3
  67. package/src/tile/Tile.story.tsx +2 -6
  68. package/src/title/Title.test.story.tsx +25 -0
  69. package/build/common/action/Action.js +0 -53
  70. package/build/common/action/Action.js.map +0 -1
  71. package/build/common/action/Action.mjs +0 -51
  72. package/build/common/action/Action.mjs.map +0 -1
  73. package/build/types/common/action/Action.d.ts +0 -18
  74. package/build/types/common/action/Action.d.ts.map +0 -1
  75. package/src/common/action/Action.tsx +0 -74
@@ -9,7 +9,8 @@ import Title from '../title/Title';
9
9
  import { logActionRequired } from '../utilities';
10
10
 
11
11
  import InlineMarkdown from './inlineMarkdown';
12
- import { Action } from '../common/action/Action';
12
+ import Button from '../button';
13
+ import Link from '../link';
13
14
 
14
15
  export type AlertAction = {
15
16
  'aria-label'?: string;
@@ -193,15 +194,31 @@ export default function Alert({
193
194
  {children || <InlineMarkdown>{message}</InlineMarkdown>}
194
195
  </Body>
195
196
  </div>
196
- {action && (
197
- <Action
198
- action={action}
199
- variant="action-button"
200
- className="alert__action"
201
- sentiment="default"
202
- priority="secondary-neutral"
203
- />
204
- )}
197
+ {action &&
198
+ ('href' in action ? (
199
+ <Link
200
+ href={action.href}
201
+ aria-label={action['aria-label']}
202
+ target={action.target}
203
+ type={Typography.LINK_LARGE}
204
+ className="alert__action"
205
+ onClick={action.onClick}
206
+ >
207
+ {action.text}
208
+ </Link>
209
+ ) : (
210
+ <Button
211
+ v2
212
+ size="sm"
213
+ sentiment="default"
214
+ aria-label={action['aria-label']}
215
+ priority="secondary-neutral"
216
+ className="alert__action"
217
+ onClick={action.onClick}
218
+ >
219
+ {action.text}
220
+ </Button>
221
+ ))}
205
222
  </div>
206
223
  </div>
207
224
  {onDismiss && (
@@ -11,7 +11,6 @@
11
11
 
12
12
  > tbody > tr > td.weekend button {
13
13
  color: var(--color-content-secondary);
14
- &:extend(.np-text-body-default);
15
14
  }
16
15
 
17
16
  > tbody > tr > td {
@@ -1,10 +1,10 @@
1
- import Avatar from '../avatar';
2
1
  import { Breakpoint, Size } from '../common';
3
2
  import { mockMatchMedia } from '../mocks';
4
3
  import { render, screen } from '../test-utils';
5
4
 
6
5
  import Decision, { DecisionPresentation, DecisionType } from '.';
7
6
  import { DecisionProps } from './Decision';
7
+ import AvatarView from '../avatarView';
8
8
 
9
9
  mockMatchMedia(jest);
10
10
 
@@ -13,7 +13,7 @@ describe('Decision', () => {
13
13
  options: [
14
14
  {
15
15
  media: {
16
- list: <Avatar type="initials">HM</Avatar>,
16
+ list: <AvatarView profileName="Henry Mike" />,
17
17
  block: <img src="img.jpg" alt="alt" />,
18
18
  },
19
19
  href: '#href',
@@ -2,10 +2,10 @@ import { action } from '@storybook/addon-actions';
2
2
  import { boolean, select } from '@storybook/addon-knobs';
3
3
  import { Illustration } from '@wise/art';
4
4
 
5
- import Avatar from '../avatar';
6
5
  import { Size } from '../common';
7
6
 
8
7
  import Decision, { DecisionPresentation, DecisionType } from '.';
8
+ import AvatarView from '../avatarView';
9
9
 
10
10
  export default {
11
11
  component: Decision,
@@ -33,11 +33,7 @@ export const Basic = () => {
33
33
  disabled,
34
34
  media: {
35
35
  block: <Illustration name="globe" alt="" disablePadding />,
36
- list: (
37
- <Avatar size="md" type="initials">
38
- HM
39
- </Avatar>
40
- ),
36
+ list: <AvatarView profileName="Henry Mike" />,
41
37
  },
42
38
  'aria-label': 'Click to see something',
43
39
  title: 'Hank Miller',
@@ -50,11 +46,7 @@ export const Basic = () => {
50
46
  href: '#href2',
51
47
  media: {
52
48
  block: <Illustration name="confetti" alt="" disablePadding />,
53
- list: (
54
- <Avatar size="md" type="initials">
55
- HM
56
- </Avatar>
57
- ),
49
+ list: <AvatarView profileName="Henry Mike" />,
58
50
  },
59
51
  'aria-label': 'Click here to send money to Hank Miller.',
60
52
  title: 'Hank Miller',
@@ -109,11 +101,7 @@ export const grid = () => {
109
101
  alt=""
110
102
  />
111
103
  ),
112
- list: (
113
- <Avatar size="md" type="initials">
114
- HM
115
- </Avatar>
116
- ),
104
+ list: <AvatarView profileName="Henry Mike" />,
117
105
  },
118
106
  'aria-label': 'Click to see something',
119
107
  title: 'Hank Miller',
@@ -131,11 +119,7 @@ export const grid = () => {
131
119
  alt=""
132
120
  />
133
121
  ),
134
- list: (
135
- <Avatar size="md" type="initials">
136
- HM
137
- </Avatar>
138
- ),
122
+ list: <AvatarView profileName="Henry Mike" />,
139
123
  },
140
124
  'aria-label': 'Click here to send money to Hank Miller.',
141
125
  title: 'Hank Miller',
@@ -152,11 +136,7 @@ export const grid = () => {
152
136
  alt=""
153
137
  />
154
138
  ),
155
- list: (
156
- <Avatar size="md" type="initials">
157
- HM
158
- </Avatar>
159
- ),
139
+ list: <AvatarView profileName="Henry Mike" />,
160
140
  },
161
141
  'aria-label': 'Click here to send money to Hank Miller.',
162
142
  disabled,
@@ -175,11 +155,7 @@ export const grid = () => {
175
155
  alt=""
176
156
  />
177
157
  ),
178
- list: (
179
- <Avatar size="md" type="initials">
180
- HM
181
- </Avatar>
182
- ),
158
+ list: <AvatarView profileName="Henry Mike" />,
183
159
  },
184
160
  'aria-label': 'Click here to send money to Hank Miller.',
185
161
  title: 'Hank Miller',
@@ -197,11 +173,7 @@ export const grid = () => {
197
173
  alt=""
198
174
  />
199
175
  ),
200
- list: (
201
- <Avatar size="md" type="initials">
202
- HM
203
- </Avatar>
204
- ),
176
+ list: <AvatarView profileName="Henry Mike" />,
205
177
  },
206
178
  'aria-label': 'Click here to send money to Hank Miller.',
207
179
  title: 'Hank Miller',
@@ -219,11 +191,7 @@ export const grid = () => {
219
191
  alt=""
220
192
  />
221
193
  ),
222
- list: (
223
- <Avatar size="md" type="initials">
224
- HM
225
- </Avatar>
226
- ),
194
+ list: <AvatarView profileName="Henry Mike" />,
227
195
  },
228
196
  'aria-label': 'Click here to send money to Hank Miller.',
229
197
  title: 'Hank Miller',
@@ -241,11 +209,7 @@ export const grid = () => {
241
209
  alt=""
242
210
  />
243
211
  ),
244
- list: (
245
- <Avatar size="md" type="initials">
246
- HM
247
- </Avatar>
248
- ),
212
+ list: <AvatarView profileName="Henry Mike" />,
249
213
  },
250
214
  'aria-label': 'Click here to send money to Hank Miller.',
251
215
  title: 'Hank Miller',
@@ -1,5 +1,5 @@
1
- import Avatar, { AvatarType } from '../avatar';
2
- import { Breakpoint, Size } from '../common';
1
+ import AvatarView from '../avatarView';
2
+ import { Breakpoint } from '../common';
3
3
  import { mockMatchMedia, render, screen } from '../test-utils';
4
4
 
5
5
  import FlowNavigation from './FlowNavigation';
@@ -22,11 +22,7 @@ describe('FlowNavigation', () => {
22
22
  });
23
23
 
24
24
  const props = {
25
- avatar: (
26
- <Avatar type={AvatarType.INITIALS} size={Size.MEDIUM}>
27
- TM
28
- </Avatar>
29
- ),
25
+ avatar: <AvatarView profileName="Tim Mike" />,
30
26
  logo: <img alt="logo" src="logo.svg" width="138" height="24" />,
31
27
  onClose: jest.fn(),
32
28
  steps: [
@@ -46,10 +46,12 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
46
46
  class="np-flow-header__right d-flex align-items-center justify-content-end order-2--lg"
47
47
  >
48
48
  <div
49
- class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
49
+ class="np-circle d-flex align-items-center justify-content-center np-avatar-view np-avatar-view-non-interactive"
50
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
50
51
  >
51
52
  <div
52
- class="tw-avatar__content"
53
+ class="np-circle np-circle-border d-flex align-items-center justify-content-center np-avatar-view-content"
54
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
53
55
  >
54
56
  TM
55
57
  </div>
@@ -162,10 +164,12 @@ exports[`FlowNavigation renders as expected 1`] = `
162
164
  class="np-flow-header__right d-flex align-items-center justify-content-end order-2--lg"
163
165
  >
164
166
  <div
165
- class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
167
+ class="np-circle d-flex align-items-center justify-content-center np-avatar-view np-avatar-view-non-interactive"
168
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
166
169
  >
167
170
  <div
168
- class="tw-avatar__content"
171
+ class="np-circle np-circle-border d-flex align-items-center justify-content-center np-avatar-view-content"
172
+ style="--circle-size: 48px; --circle-icon-size: 24px; --circle-font-size: 22px;"
169
173
  >
170
174
  TM
171
175
  </div>
@@ -71,6 +71,8 @@
71
71
  line-height: 1.2;
72
72
  line-height: var(--line-height-title);
73
73
  letter-spacing: 0;
74
+ -webkit-hyphens: auto;
75
+ hyphens: auto;
74
76
  margin-bottom: 0;
75
77
  margin-bottom: initial;
76
78
  font-size: 1.375rem;
@@ -71,6 +71,8 @@
71
71
  line-height: 1.2;
72
72
  line-height: var(--line-height-title);
73
73
  letter-spacing: 0;
74
+ -webkit-hyphens: auto;
75
+ hyphens: auto;
74
76
  margin-bottom: 0;
75
77
  margin-bottom: initial;
76
78
  font-size: 1.375rem;
package/src/link/Link.css CHANGED
@@ -1,4 +1,5 @@
1
- a {
1
+ a,
2
+ button.np-link {
2
3
  border-radius: 2px;
3
4
  }
4
5
  .np-link .tw-icon {
@@ -1,7 +1,7 @@
1
1
  @import (reference) "../../node_modules/@transferwise/neptune-css/src/less/mixins/_logical-properties.less";
2
2
  @import (reference) "../../node_modules/@transferwise/neptune-css/src/less/ring.less";
3
3
 
4
- a {
4
+ a, button.np-link {
5
5
  border-radius: 2px;
6
6
  }
7
7
 
@@ -1,4 +1,4 @@
1
- import { render, screen } from '../test-utils';
1
+ import { render, screen, userEvent } from '../test-utils';
2
2
 
3
3
  import Link from '.';
4
4
 
@@ -32,6 +32,37 @@ describe('Link', () => {
32
32
  expect(link).toHaveAttribute('rel', 'noreferrer');
33
33
  });
34
34
 
35
+ it('renders as link (`a` element) when href and onClick provided', async () => {
36
+ const href = 'wise.com';
37
+ const onClick = jest.fn();
38
+ render(
39
+ <Link href={href} onClick={onClick}>
40
+ link text
41
+ </Link>,
42
+ );
43
+ expect(onClick).toHaveBeenCalledTimes(0);
44
+
45
+ const link = screen.getByText('link text');
46
+
47
+ expect(link).toHaveAttribute('href', href);
48
+ await userEvent.click(link);
49
+ expect(link.tagName).toBe('A');
50
+ expect(onClick).toHaveBeenCalledTimes(1);
51
+ });
52
+
53
+ it('renders as button element when only onClick provided', async () => {
54
+ const onClick = jest.fn();
55
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events
56
+ render(<Link onClick={onClick}>link text</Link>);
57
+ expect(onClick).toHaveBeenCalledTimes(0);
58
+
59
+ const link = screen.getByText('link text');
60
+
61
+ await userEvent.click(link);
62
+ expect(link.tagName).toBe('BUTTON');
63
+ expect(onClick).toHaveBeenCalledTimes(1);
64
+ });
65
+
35
66
  it('renders with the provided aria-label', () => {
36
67
  render(
37
68
  <Link {...props} aria-label="make me accessible">
@@ -24,6 +24,18 @@ export const Basic = () => {
24
24
  <Link type={Typography.LINK_LARGE} target="_blank" className="m-t-3" href="#">
25
25
  Large link
26
26
  </Link>
27
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
28
+ <Link className="m-t-3" onClick={() => console.log('click link')}>
29
+ button as Link
30
+ </Link>
31
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
32
+ <Link
33
+ className="m-t-3"
34
+ type={Typography.LINK_LARGE}
35
+ onClick={() => console.log('click link')}
36
+ >
37
+ button as Link
38
+ </Link>
27
39
  <Title type={Typography.TITLE_SCREEN} className="m-t-3">
28
40
  Links via <code>{'<Link />'}</code> component in all types of body copy
29
41
  </Title>
package/src/link/Link.tsx CHANGED
@@ -1,14 +1,15 @@
1
1
  import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
3
  import { useIntl } from 'react-intl';
4
- import { PrimitiveAnchor } from '../primitives';
5
- import type { PrimitiveAnchorProps } from '../primitives';
4
+ import { PrimitiveAnchor, PrimitiveButton } from '../primitives';
5
+ import type { PrimitiveAnchorProps, PrimitiveButtonProps } from '../primitives';
6
6
 
7
- import { LinkLarge, LinkDefault } from '../common';
7
+ import { LinkLarge, LinkDefault, Typography } from '../common';
8
8
 
9
9
  import messages from './Link.messages';
10
10
 
11
- export type Props = PrimitiveAnchorProps & { type?: LinkLarge | LinkDefault };
11
+ export type Props = PrimitiveAnchorProps &
12
+ Pick<PrimitiveButtonProps, 'onClick'> & { type?: LinkLarge | LinkDefault };
12
13
 
13
14
  /**
14
15
  * Standard Link component with navigate away icon
@@ -20,12 +21,13 @@ const Link = ({
20
21
  children,
21
22
  href,
22
23
  target,
23
- type,
24
+ type = Typography.LINK_DEFAULT,
24
25
  'aria-label': ariaLabel,
25
26
  onClick,
26
27
  ...props
27
28
  }: Props) => {
28
29
  const { formatMessage } = useIntl();
30
+ const isButton = Boolean(onClick) && href === undefined;
29
31
  const isBlank = target === '_blank';
30
32
 
31
33
  const classNames = clsx(
@@ -37,7 +39,16 @@ const Link = ({
37
39
  className,
38
40
  );
39
41
 
40
- return (
42
+ return isButton ? (
43
+ <PrimitiveButton
44
+ type="button"
45
+ aria-label={ariaLabel}
46
+ className={clsx(classNames, 'btn-unstyled', className)}
47
+ onClick={onClick}
48
+ >
49
+ {children}
50
+ </PrimitiveButton>
51
+ ) : (
41
52
  <PrimitiveAnchor
42
53
  href={href}
43
54
  target={target}
package/src/main.css CHANGED
@@ -34,10 +34,6 @@
34
34
  margin-left: var(--padding-small);
35
35
  }
36
36
  }
37
- .tw-date-lookup-calendar > tbody > tr > td.weekend button {
38
- font-size: 0.875rem;
39
- font-size: var(--font-size-14);line-height: 155%;letter-spacing: -0.006em;font-weight: 400;font-weight: var(--font-weight-regular);
40
- }
41
37
  @media (min-width: 768px) {
42
38
  }
43
39
  @media (min-width: 768px) {
@@ -2589,6 +2585,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2589
2585
  line-height: 1.2;
2590
2586
  line-height: var(--line-height-title);
2591
2587
  letter-spacing: 0;
2588
+ -webkit-hyphens: auto;
2589
+ hyphens: auto;
2592
2590
  margin-bottom: 0;
2593
2591
  margin-bottom: initial;
2594
2592
  font-size: 1.375rem;
@@ -3106,7 +3104,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3106
3104
  .tw-instructions .instruction .dont {
3107
3105
  color: var(--color-sentiment-negative);
3108
3106
  }
3109
- a {
3107
+ a,
3108
+ button.np-link {
3110
3109
  border-radius: 2px;
3111
3110
  }
3112
3111
  .np-link .tw-icon {
@@ -4024,6 +4023,8 @@ html:not([dir="rtl"]) .np-navigation-option {
4024
4023
  line-height: 1.2;
4025
4024
  line-height: var(--line-height-title);
4026
4025
  letter-spacing: 0;
4026
+ -webkit-hyphens: auto;
4027
+ hyphens: auto;
4027
4028
  margin-bottom: 0;
4028
4029
  margin-bottom: initial;
4029
4030
  font-weight: 600;
@@ -4438,7 +4439,10 @@ html:not([dir="rtl"]) .np-navigation-option {
4438
4439
  }
4439
4440
  }
4440
4441
  .status-circle .light {
4441
- color: var(--color-contrast);
4442
+ color: var(--color-contrast-overlay);
4443
+ }
4444
+ .np-theme-personal--bright-green .status-circle .light {
4445
+ color: var(--color-white);
4442
4446
  }
4443
4447
  .status-circle .dark {
4444
4448
  color: #37517e;
@@ -4456,6 +4460,10 @@ html:not([dir="rtl"]) .np-navigation-option {
4456
4460
  .status-circle.error {
4457
4461
  background-color: var(--color-sentiment-negative);
4458
4462
  }
4463
+ .status-circle.negative .status-icon,
4464
+ .status-circle.error .status-icon {
4465
+ color: var(--color-sentiment-negative-secondary);
4466
+ }
4459
4467
  .status-circle.neutral {
4460
4468
  background-color: #5d7079;
4461
4469
  background-color: var(--color-content-secondary);
@@ -4464,6 +4472,10 @@ html:not([dir="rtl"]) .np-navigation-option {
4464
4472
  .status-circle.success {
4465
4473
  background-color: var(--color-sentiment-positive);
4466
4474
  }
4475
+ .status-circle.positive .status-icon,
4476
+ .status-circle.success .status-icon {
4477
+ color: var(--color-sentiment-positive-secondary);
4478
+ }
4467
4479
  .tw-stepper {
4468
4480
  padding-bottom: 24px;
4469
4481
  width: 100%;
@@ -4541,13 +4553,6 @@ html:not([dir="rtl"]) .np-navigation-option {
4541
4553
  transition: width 0.6s ease-in-out;
4542
4554
  will-change: width;
4543
4555
  }
4544
- .btn-unstyled {
4545
- background: none;
4546
- border: none;
4547
- margin: 0;
4548
- padding: 0;
4549
- display: block;
4550
- }
4551
4556
  .np-select .np-dropdown-toggle {
4552
4557
  background-color: #ffffff;
4553
4558
  background-color: var(--color-background-screen);
@@ -5093,10 +5098,6 @@ html:not([dir="rtl"]) .np-navigation-option {
5093
5098
  .np-summary__action {
5094
5099
  margin-top: 4px;
5095
5100
  margin-top: var(--size-4);
5096
- font-size: 0.875rem;
5097
- font-size: var(--font-size-14);
5098
- font-weight: 600;
5099
- font-weight: var(--font-weight-semi-bold);
5100
5101
  }
5101
5102
  .np-summary + .np-summary {
5102
5103
  margin-top: 24px;
@@ -7,10 +7,11 @@ import {
7
7
  PlusCircle,
8
8
  Profile,
9
9
  UpwardGraph as UpwardGraphIcon,
10
+ FastFlag,
10
11
  } from '@transferwise/icons';
11
12
  import { Illustration, Assets, Flag } from '@wise/art';
12
13
 
13
- import { Badge, Nudge, Avatar, Header, Title, Typography } from '..';
14
+ import { Nudge, Header, Title, Typography, AvatarView } from '..';
14
15
 
15
16
  import NavigationOption from './NavigationOption';
16
17
 
@@ -85,11 +86,9 @@ export const Variants = () => (
85
86
  <Template
86
87
  showMediaCircle={false}
87
88
  media={
88
- <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
89
- <Avatar type="icon">
90
- <Profile size="24" />
91
- </Avatar>
92
- </Badge>
89
+ <AvatarView badge={{ type: 'reference' }}>
90
+ <Profile />
91
+ </AvatarView>
93
92
  }
94
93
  />
95
94
  </div>
@@ -98,20 +97,13 @@ export const Variants = () => (
98
97
  <Template
99
98
  showMediaCircle={false}
100
99
  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>
100
+ <AvatarView
101
+ badge={{
102
+ icon: <FastFlag />,
103
+ type: 'action',
104
+ }}
105
+ profileName="Spencer Penn"
106
+ />
115
107
  }
116
108
  />
117
109
  </div>
@@ -125,20 +117,13 @@ export const Variants = () => (
125
117
  <Template
126
118
  showMediaCircle
127
119
  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>
120
+ <AvatarView
121
+ badge={{
122
+ icon: <FastFlag />,
123
+ type: 'action',
124
+ }}
125
+ profileName="Spencer Penn"
126
+ />
142
127
  }
143
128
  />
144
129
  </div>
@@ -222,9 +207,9 @@ export const BalanceContent = () => (
222
207
  content="British pound"
223
208
  showMediaCircle={false}
224
209
  media={
225
- <Avatar type="icon">
210
+ <AvatarView>
226
211
  <Flag code="GBP" />
227
- </Avatar>
212
+ </AvatarView>
228
213
  }
229
214
  />
230
215
  );
@@ -234,11 +219,9 @@ export const NewContactContent = () => (
234
219
  title="New Contact"
235
220
  showMediaCircle={false}
236
221
  media={
237
- <Badge badge={<PlusCircle className="tw-contacts__new-contact-badge" />}>
238
- <Avatar type="icon">
239
- <Profile size="24" />
240
- </Avatar>
241
- </Badge>
222
+ <AvatarView badge={{ type: 'reference' }}>
223
+ <Profile size="24" />
224
+ </AvatarView>
242
225
  }
243
226
  />
244
227
  );
@@ -248,13 +231,7 @@ export const ExistingContactContent = () => (
248
231
  title="Wise Customer"
249
232
  content="EUR account ending in 1111"
250
233
  showMediaCircle={false}
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
- }
234
+ media={<AvatarView profileName="Walter Smith" badge={{ flagCode: 'EUR' }} />}
258
235
  />
259
236
  );
260
237
 
@@ -280,9 +257,9 @@ export const ManageAccountContent = () => (
280
257
  content="View and share your account details to get paid."
281
258
  showMediaCircle={false}
282
259
  media={
283
- <Avatar type="icon">
284
- <BankIcon size={24} />
285
- </Avatar>
260
+ <AvatarView>
261
+ <BankIcon />
262
+ </AvatarView>
286
263
  }
287
264
  />
288
265
  <NavigationOptionTemplate
@@ -290,9 +267,9 @@ export const ManageAccountContent = () => (
290
267
  content="Convert money between your balances at your desired exchange rate."
291
268
  showMediaCircle={false}
292
269
  media={
293
- <Avatar type="icon">
270
+ <AvatarView>
294
271
  <UpwardGraphIcon size={24} />
295
- </Avatar>
272
+ </AvatarView>
296
273
  }
297
274
  />
298
275
  </>