@transferwise/components 46.135.2 → 46.136.0

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 (66) hide show
  1. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  2. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  3. package/build/container/Container.js +24 -0
  4. package/build/container/Container.js.map +1 -0
  5. package/build/container/Container.mjs +20 -0
  6. package/build/container/Container.mjs.map +1 -0
  7. package/build/index.js +2 -0
  8. package/build/index.js.map +1 -1
  9. package/build/index.mjs +1 -0
  10. package/build/index.mjs.map +1 -1
  11. package/build/listItem/ListItem.js +2 -2
  12. package/build/listItem/ListItem.js.map +1 -1
  13. package/build/listItem/ListItem.mjs +2 -2
  14. package/build/listItem/ListItem.mjs.map +1 -1
  15. package/build/main.css +46 -0
  16. package/build/styles/container/Container.css +38 -0
  17. package/build/styles/main.css +46 -0
  18. package/build/types/body/Body.d.ts +2 -2
  19. package/build/types/container/Container.d.ts +16 -0
  20. package/build/types/container/Container.d.ts.map +1 -0
  21. package/build/types/container/index.d.ts +3 -0
  22. package/build/types/container/index.d.ts.map +1 -0
  23. package/build/types/iconButton/IconButton.d.ts +1 -1
  24. package/build/types/index.d.ts +2 -0
  25. package/build/types/index.d.ts.map +1 -1
  26. package/build/types/listItem/Button/ListItemButton.d.ts +1 -1
  27. package/build/types/listItem/ListItem.d.ts +1 -1
  28. package/build/types/select/searchBox/SearchBox.d.ts +1 -1
  29. package/build/types/title/Title.d.ts +2 -2
  30. package/build/types/uploadInput/uploadItem/UploadItemLink.d.ts +1 -1
  31. package/package.json +3 -3
  32. package/src/actionButton/ActionButton.story.tsx +4 -4
  33. package/src/actionButton/ActionButton.test.story.tsx +4 -4
  34. package/src/avatarWrapper/AvatarWrapper.tsx +3 -3
  35. package/src/common/circle/Circle.story.tsx +3 -3
  36. package/src/container/Container.css +38 -0
  37. package/src/container/Container.less +39 -0
  38. package/src/container/Container.story.tsx +130 -0
  39. package/src/container/Container.test.tsx +37 -0
  40. package/src/container/Container.tsx +37 -0
  41. package/src/container/index.ts +2 -0
  42. package/src/flowNavigation/FlowNavigation.story.tsx +16 -8
  43. package/src/iconButton/IconButton.story.tsx +5 -6
  44. package/src/iconButton/IconButton.test.story.tsx +8 -8
  45. package/src/icons/Icons.story.tsx +381 -0
  46. package/src/index.ts +2 -0
  47. package/src/listItem/ListItem.test.tsx +24 -0
  48. package/src/listItem/ListItem.tsx +2 -2
  49. package/src/listItem/_stories/ListItem.context.test.story.tsx +63 -0
  50. package/src/listItem/_stories/ListItem.scenarios.story.tsx +3 -3
  51. package/src/main.css +46 -0
  52. package/src/main.less +1 -0
  53. package/src/moneyInput/MoneyInput.story.tsx +2 -2
  54. package/src/navigationOption/NavigationOption.story.tsx +3 -3
  55. package/src/overlayHeader/OverlayHeader.story.tsx +2 -2
  56. package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +3 -3
  57. package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +3 -3
  58. package/src/prompt/InfoPrompt/InfoPrompt.accessibility.docs.mdx +1 -1
  59. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +3 -3
  60. package/src/prompt/InlinePrompt/InlinePrompt.accessibility.docs.mdx +1 -1
  61. package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +5 -5
  62. package/src/prompt/InlinePrompt/InlinePrompt.test.story.tsx +2 -2
  63. package/src/select/Select.story.tsx +3 -3
  64. package/src/select/option/Option.test.tsx +3 -3
  65. package/src/summary/Summary.story.tsx +5 -5
  66. package/src/summary/Summary.test.story.tsx +2 -2
package/src/main.css CHANGED
@@ -26290,6 +26290,52 @@ a[data-toggle="tooltip"] {
26290
26290
  --color-sentiment-background-surface-active: #B6ECEC;
26291
26291
  }
26292
26292
 
26293
+ .wds-container {
26294
+ --wds-container-padding-inline: 16px;
26295
+ --wds-container-width-fluid: 100%;
26296
+ --wds-container-width-standard: 1160px;
26297
+ --wds-container-width-narrow: 840px;
26298
+ --wds-container-width-compact: 600px;
26299
+ width: 100%;
26300
+ margin-inline: auto;
26301
+ padding-inline: 16px;
26302
+ padding-inline: var(--wds-container-padding-inline);
26303
+ }
26304
+
26305
+ @media (min-width: 576px) {
26306
+ .wds-container {
26307
+ --wds-container-padding-inline: var(--size-16);
26308
+ }
26309
+ }
26310
+
26311
+ @media (min-width: 768px) {
26312
+ .wds-container {
26313
+ --wds-container-padding-inline: var(--size-32);
26314
+ }
26315
+ }
26316
+
26317
+ @media (min-width: 992px) {
26318
+ .wds-container {
26319
+ --wds-container-padding-inline: var(--size-40);
26320
+ }
26321
+ }
26322
+
26323
+ .wds-container--standard {
26324
+ max-width: var(--wds-container-width-standard);
26325
+ }
26326
+
26327
+ .wds-container--narrow {
26328
+ max-width: var(--wds-container-width-narrow);
26329
+ }
26330
+
26331
+ .wds-container--compact {
26332
+ max-width: var(--wds-container-width-compact);
26333
+ }
26334
+
26335
+ .wds-container--fluid {
26336
+ max-width: var(--wds-container-width-fluid);
26337
+ }
26338
+
26293
26339
  .critical-comms {
26294
26340
  border-radius: 16px;
26295
26341
  border-radius: var(--radius-medium);
package/src/main.less CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  @import "./sentimentSurface/SentimentSurface.less";
4
4
 
5
+ @import "./container/Container.less";
5
6
  @import "./criticalBanner/CriticalCommsBanner.less";
6
7
  @import "./accordion/Accordion.less";
7
8
  @import "./actionButton/ActionButton.less";
@@ -1,6 +1,6 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { within, userEvent, expect } from 'storybook/test';
3
- import { Lock } from '@transferwise/icons';
3
+ import { Padlock } from '@transferwise/icons';
4
4
  import { useState } from 'react';
5
5
 
6
6
  import MoneyInput, { CurrencyOptionItem } from '.';
@@ -117,7 +117,7 @@ export const SingleCurrency: Story = {
117
117
 
118
118
  export const MultipleCurrencies: Story = {
119
119
  args: {
120
- addon: <Lock />,
120
+ addon: <Padlock />,
121
121
  currencies: [
122
122
  {
123
123
  header: 'Popular currencies',
@@ -4,7 +4,7 @@ import { Illustration, Assets, Flag } from '@wise/art';
4
4
  import {
5
5
  FastFlag as FastFlagIcon,
6
6
  Bank as BankIcon,
7
- Profile,
7
+ Person,
8
8
  UpwardGraph as UpwardGraphIcon,
9
9
  FastFlag,
10
10
  } from '@transferwise/icons';
@@ -106,7 +106,7 @@ export const Variants: StoryObj<StoryArgs> = {
106
106
  showMediaCircle={false}
107
107
  media={
108
108
  <AvatarView badge={{ type: 'reference' }}>
109
- <Profile />
109
+ <Person />
110
110
  </AvatarView>
111
111
  }
112
112
  content={hasTitleOnly ? null : args.content}
@@ -248,7 +248,7 @@ export const NewContactContent: StoryObj<StoryArgs> = {
248
248
  showMediaCircle={false}
249
249
  media={
250
250
  <AvatarView badge={{ type: 'reference' }}>
251
- <Profile size="24" />
251
+ <Person size="24" />
252
252
  </AvatarView>
253
253
  }
254
254
  onClick={fn()}
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { action } from 'storybook/actions';
3
- import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';
3
+ import { Person, Briefcase as BriefcaseIcon } from '@transferwise/icons';
4
4
  import AvatarView from '../avatarView';
5
5
  import { ProfileType } from '../common';
6
6
  import Logo from '../logo';
@@ -28,7 +28,7 @@ export default meta;
28
28
  const avatarProfiles = {
29
29
  '': null,
30
30
  Business: <BriefcaseIcon size="24" />,
31
- Profile: <ProfileIcon size="24" />,
31
+ Profile: <Person size="24" />,
32
32
  };
33
33
 
34
34
  export const Basic: StoryObj<StoryArgs> = {
@@ -1,7 +1,7 @@
1
1
  import { ReactElement, useState } from 'react';
2
2
  import { Meta, StoryObj } from '@storybook/react-webpack5';
3
3
  import { fn } from 'storybook/test';
4
- import { Bank, Star, Travel, Briefcase } from '@transferwise/icons';
4
+ import { Bank, Star, Suitcase, Briefcase } from '@transferwise/icons';
5
5
  import { lorem10, lorem20 } from '../../test-utils';
6
6
  import Button from '../../button';
7
7
  import Title from '../../title';
@@ -116,7 +116,7 @@ const MEDIA_OPTIONS: Record<string, ActionPromptProps['media']> = {
116
116
  },
117
117
  'Avatar: Icon (Bank)': { avatar: { asset: <Bank /> } },
118
118
  'Avatar: Icon (Star)': { avatar: { asset: <Star /> } },
119
- 'Avatar: Icon (Travel)': { avatar: { asset: <Travel /> } },
119
+ 'Avatar: Icon (Suitcase)': { avatar: { asset: <Suitcase /> } },
120
120
  'Avatar: Icon (Briefcase)': { avatar: { asset: <Briefcase /> } },
121
121
  'Avatar: Initials': { avatar: { profileName: 'John Doe' } },
122
122
  };
@@ -133,7 +133,7 @@ const previewArgTypes = {
133
133
  'Avatar: Personal (EU badge)',
134
134
  'Avatar: Icon (Bank)',
135
135
  'Avatar: Icon (Star)',
136
- 'Avatar: Icon (Travel)',
136
+ 'Avatar: Icon (Suitcase)',
137
137
  'Avatar: Icon (Briefcase)',
138
138
  'Avatar: Initials',
139
139
  ],
@@ -1,5 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { Freeze, People, Travel } from '@transferwise/icons';
2
+ import { Freeze, People, Suitcase } from '@transferwise/icons';
3
3
  import { action } from 'storybook/actions';
4
4
  import { fn } from 'storybook/test';
5
5
  import ActionPrompt from './ActionPrompt';
@@ -248,7 +248,7 @@ export const Responsiveness: Story = {
248
248
  sentiment="proposition"
249
249
  title="Stacked (320px)"
250
250
  description={lorem10}
251
- media={{ avatar: { asset: <Travel /> } }}
251
+ media={{ avatar: { asset: <Suitcase /> } }}
252
252
  action={{ label: 'Primary action', onClick: fn() }}
253
253
  actionSecondary={{ label: 'Secondary', onClick: fn() }}
254
254
  onDismiss={fn()}
@@ -257,7 +257,7 @@ export const Responsiveness: Story = {
257
257
  sentiment="proposition"
258
258
  title="Side-by-side (480px)"
259
259
  description={lorem10}
260
- media={{ avatar: { asset: <Travel /> } }}
260
+ media={{ avatar: { asset: <Suitcase /> } }}
261
261
  action={{ label: 'Primary action', onClick: fn() }}
262
262
  actionSecondary={{ label: 'Secondary', onClick: fn() }}
263
263
  onDismiss={fn()}
@@ -64,7 +64,7 @@ Custom media icons should include their own accessibility attributes. Use the `t
64
64
  <InfoPrompt
65
65
  sentiment="success"
66
66
  description="Your travel account is ready!"
67
- media={{ asset: <Travel title="Travel feature" /> }}
67
+ media={{ asset: <Suitcase title="Travel feature" /> }}
68
68
  />
69
69
 
70
70
  <InfoPrompt
@@ -2,7 +2,7 @@ import type { ReactElement } from 'react';
2
2
  import { useState } from 'react';
3
3
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
4
4
  import { action } from 'storybook/actions';
5
- import { Confetti, GiftBox, Star, Travel, Briefcase, Plane } from '@transferwise/icons';
5
+ import { Confetti, GiftBox, Star, Suitcase, Briefcase, Plane } from '@transferwise/icons';
6
6
  import { lorem10, lorem20 } from '../../test-utils';
7
7
  import Button from '../../button';
8
8
  import Title from '../../title';
@@ -90,7 +90,7 @@ const MEDIA_OPTIONS: Record<string, { asset: ReactElement } | undefined> = {
90
90
  star: { asset: <Star title="Starred" /> },
91
91
  confetti: { asset: <Confetti size={24} title="Celebration" /> },
92
92
  giftbox: { asset: <GiftBox title="Gift" /> },
93
- travel: { asset: <Travel title="Travel" /> },
93
+ travel: { asset: <Suitcase title="Travel" /> },
94
94
  briefcase: { asset: <Briefcase title="Business" /> },
95
95
  plane: { asset: <Plane title="Travel" /> },
96
96
  };
@@ -297,7 +297,7 @@ export const MediaTypes: StoryObj<InfoPromptProps> = {
297
297
  <InfoPrompt
298
298
  sentiment="success"
299
299
  description="Your travel account is ready!"
300
- media={{ asset: <Travel title="Travel" /> }}
300
+ media={{ asset: <Suitcase title="Travel" /> }}
301
301
  />
302
302
  <InfoPrompt
303
303
  sentiment="warning"
@@ -30,7 +30,7 @@ By default, sentiment icons have these labels:
30
30
  dark
31
31
  code={`
32
32
  <InlinePrompt
33
- media={<Travel />}
33
+ media={<Suitcase />}
34
34
  sentiment="positive"
35
35
  mediaLabel="Travel feature enabled: "
36
36
  >
@@ -1,7 +1,7 @@
1
1
  import type { ReactElement } from 'react';
2
2
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
3
3
  import { action } from 'storybook/actions';
4
- import { Clock, Taxi, Travel } from '@transferwise/icons';
4
+ import { Clock, Taxi, Suitcase } from '@transferwise/icons';
5
5
  import { lorem5 } from '../../test-utils';
6
6
  import Link from '../../link';
7
7
  import { InlinePrompt, InlinePromptProps } from './InlinePrompt';
@@ -233,7 +233,7 @@ export const IconOverrides: StoryObj<PreviewStoryArgs> = {
233
233
  <InlinePrompt {...args} media={<Clock title="Processing: " />} sentiment="warning">
234
234
  The account verification is taking longer than usual.
235
235
  </InlinePrompt>
236
- <InlinePrompt {...args} media={<Travel title="Activated: " />} sentiment="positive">
236
+ <InlinePrompt {...args} media={<Suitcase title="Activated: " />} sentiment="positive">
237
237
  Your travel account is set up and ready to use.
238
238
  </InlinePrompt>
239
239
  <InlinePrompt {...args} media={<Taxi title="Taxi addon: " />} sentiment="proposition">
@@ -256,13 +256,13 @@ export const SizingStrategies: StoryObj<PreviewStoryArgs> = {
256
256
  render: (args: PreviewStoryArgs) => {
257
257
  return (
258
258
  <>
259
- <InlinePrompt {...args} media={<Travel />} sentiment="positive" width="full">
259
+ <InlinePrompt {...args} media={<Suitcase />} sentiment="positive" width="full">
260
260
  This prompt will take the full width of its container.
261
261
  </InlinePrompt>
262
- <InlinePrompt {...args} media={<Travel />} sentiment="positive">
262
+ <InlinePrompt {...args} media={<Suitcase />} sentiment="positive">
263
263
  This prompt will hug its content.
264
264
  </InlinePrompt>
265
- <InlinePrompt {...args} media={<Travel />} sentiment="positive">
265
+ <InlinePrompt {...args} media={<Suitcase />} sentiment="positive">
266
266
  This prompt is configured to hug its content, but since the content is long enough to span
267
267
  across multiple lines, it will expand to the full width of its container. And no, you
268
268
  should not put pages of text here in the first place, but we recognise that some
@@ -1,5 +1,5 @@
1
1
  import { StoryObj } from '@storybook/react-webpack5';
2
- import { Travel } from '@transferwise/icons';
2
+ import { Suitcase } from '@transferwise/icons';
3
3
  import { InlinePrompt } from './InlinePrompt';
4
4
  import { withVariantConfig } from '../../../.storybook/helpers';
5
5
 
@@ -13,7 +13,7 @@ type Story = StoryObj<typeof InlinePrompt>;
13
13
 
14
14
  export const TinyScreen: Story = {
15
15
  render: () => (
16
- <InlinePrompt sentiment="positive" media={<Travel />}>
16
+ <InlinePrompt sentiment="positive" media={<Suitcase />}>
17
17
  Your travel money account is now active and ready to use for international transactions.
18
18
  </InlinePrompt>
19
19
  ),
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
- import { Person as ProfileIcon, Globe as GlobeIcon } from '@transferwise/icons';
2
+ import { Person, Globe as GlobeIcon } from '@transferwise/icons';
3
3
  import { useState } from 'react';
4
4
  import Select, { SelectItem, SelectOptionItem } from './Select';
5
5
 
@@ -75,7 +75,7 @@ export const Basic: Story = {
75
75
  { value: 2, label: 'A disabled thing', disabled: true },
76
76
  { separator: true },
77
77
  { header: 'Icons' },
78
- { value: 3, label: 'Profile', icon: <ProfileIcon /> },
78
+ { value: 3, label: 'Profile', icon: <Person /> },
79
79
  {
80
80
  value: 4,
81
81
  label: 'USD',
@@ -312,7 +312,7 @@ export const AdvancedSearch: Story = {
312
312
  { value: 2, label: 'A disabled thing', disabled: true },
313
313
  { separator: true },
314
314
  { header: 'Icons' },
315
- { value: 3, label: 'Profile', icon: <ProfileIcon /> },
315
+ { value: 3, label: 'Profile', icon: <Person /> },
316
316
  { value: 4, label: 'Globe', icon: <GlobeIcon /> },
317
317
  { header: 'Currencies' },
318
318
  { value: 5, label: 'British pound', currency: 'gbp' },
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
- import { Person as ProfileIcon } from '@transferwise/icons';
3
+ import { Person } from '@transferwise/icons';
4
4
 
5
5
  import Option, { Props as OptionProps } from './Option';
6
6
 
@@ -31,7 +31,7 @@ describe('Option', () => {
31
31
  });
32
32
 
33
33
  it('should render the given icon', () => {
34
- renderOption({ icon: <ProfileIcon /> });
34
+ renderOption({ icon: <Person /> });
35
35
  const optionElement = screen.getByTestId('test-option');
36
36
  expect(optionElement.querySelector('svg')).toBeInTheDocument();
37
37
  });
@@ -43,7 +43,7 @@ describe('Option', () => {
43
43
  });
44
44
 
45
45
  it('should override the currency flag with the given icon', () => {
46
- renderOption({ currency: 'USD', icon: <ProfileIcon /> });
46
+ renderOption({ currency: 'USD', icon: <Person /> });
47
47
  const optionElement = screen.getByTestId('test-option');
48
48
  expect(optionElement.querySelector('svg')).toBeInTheDocument();
49
49
  expect(optionElement.querySelectorAll('svg')).toHaveLength(1);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { action } from 'storybook/actions';
3
- import { Home as HomeIcon } from '@transferwise/icons';
3
+ import { House } from '@transferwise/icons';
4
4
  import { Status } from '../common';
5
5
  import { InfoPresentation } from '../info';
6
6
  import Summary, { type Props as SummaryProps } from './Summary';
@@ -32,7 +32,7 @@ export const Basic = (args: SummaryProps) => {
32
32
  }}
33
33
  as="li"
34
34
  description={description}
35
- icon={<HomeIcon size={24} />}
35
+ icon={<House size={24} />}
36
36
  title="Verify your address"
37
37
  status={Status.NOT_DONE}
38
38
  />
@@ -51,7 +51,7 @@ export const Basic = (args: SummaryProps) => {
51
51
  'aria-label': 'Please click here to know more about your address update status',
52
52
  onClick: action('Summary Info clicked'),
53
53
  }}
54
- icon={<HomeIcon size={24} />}
54
+ icon={<House size={24} />}
55
55
  title="You verified your address"
56
56
  status={Status.DONE}
57
57
  />
@@ -72,7 +72,7 @@ export const Basic = (args: SummaryProps) => {
72
72
  'aria-label': 'Please click here to know more about your address update status',
73
73
  onClick: action('Summary Info clicked'),
74
74
  }}
75
- icon={<HomeIcon size={24} />}
75
+ icon={<House size={24} />}
76
76
  title="We’re verifying your address"
77
77
  status={Status.PENDING}
78
78
  />
@@ -85,7 +85,7 @@ export const Basic = (args: SummaryProps) => {
85
85
  }}
86
86
  as="li"
87
87
  description={description}
88
- icon={<HomeIcon size={24} />}
88
+ icon={<House size={24} />}
89
89
  title="We’re verifying your address"
90
90
  status={Status.PENDING}
91
91
  />
@@ -1,4 +1,4 @@
1
- import { Home as HomeIcon } from '@transferwise/icons';
1
+ import { House } from '@transferwise/icons';
2
2
  import { Status } from '../common';
3
3
  import Summary, { type SummaryProps } from '.';
4
4
 
@@ -16,7 +16,7 @@ export const LongText = () => {
16
16
  'aria-label': ' Click here to change address',
17
17
  },
18
18
  as: 'li',
19
- icon: <HomeIcon size={24} />,
19
+ icon: <House size={24} />,
20
20
  status: Status.NOT_DONE,
21
21
  info: {
22
22
  title: 'Title',