@transferwise/components 46.132.0 → 46.133.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 (103) hide show
  1. package/build/actionOption/ActionOption.js.map +1 -1
  2. package/build/actionOption/ActionOption.mjs.map +1 -1
  3. package/build/alert/Alert.js +1 -1
  4. package/build/alert/Alert.js.map +1 -1
  5. package/build/alert/Alert.mjs +1 -1
  6. package/build/alert/Alert.mjs.map +1 -1
  7. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  8. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  9. package/build/common/Option/Option.js.map +1 -1
  10. package/build/common/Option/Option.mjs.map +1 -1
  11. package/build/inputs/InputGroup.js +10 -1
  12. package/build/inputs/InputGroup.js.map +1 -1
  13. package/build/inputs/InputGroup.mjs +10 -1
  14. package/build/inputs/InputGroup.mjs.map +1 -1
  15. package/build/legacylistItem/LegacyListItem.js.map +1 -1
  16. package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
  17. package/build/main.css +18 -2
  18. package/build/navigationOption/NavigationOption.js.map +1 -1
  19. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  20. package/build/phoneNumberInput/PhoneNumberInput.js +6 -1
  21. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  22. package/build/phoneNumberInput/PhoneNumberInput.mjs +6 -1
  23. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  24. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  25. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  26. package/build/radioOption/RadioOption.js.map +1 -1
  27. package/build/radioOption/RadioOption.mjs.map +1 -1
  28. package/build/styles/inputs/InputGroup.css +10 -2
  29. package/build/styles/main.css +18 -2
  30. package/build/styles/phoneNumberInput/PhoneNumberInput.css +5 -0
  31. package/build/summary/Summary.js +1 -1
  32. package/build/summary/Summary.js.map +1 -1
  33. package/build/summary/Summary.mjs +1 -1
  34. package/build/summary/Summary.mjs.map +1 -1
  35. package/build/switchOption/SwitchOption.js +1 -1
  36. package/build/switchOption/SwitchOption.js.map +1 -1
  37. package/build/switchOption/SwitchOption.mjs +1 -1
  38. package/build/switchOption/SwitchOption.mjs.map +1 -1
  39. package/build/types/actionOption/ActionOption.d.ts +1 -1
  40. package/build/types/alert/Alert.d.ts +1 -1
  41. package/build/types/checkboxOption/CheckboxOption.d.ts +1 -1
  42. package/build/types/common/Option/Option.d.ts +3 -0
  43. package/build/types/common/Option/Option.d.ts.map +1 -1
  44. package/build/types/legacylistItem/LegacyListItem.d.ts +1 -1
  45. package/build/types/navigationOption/NavigationOption.d.ts +1 -1
  46. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
  47. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +2 -2
  48. package/build/types/radioOption/RadioOption.d.ts +1 -1
  49. package/build/types/summary/Summary.d.ts +1 -1
  50. package/build/types/switchOption/SwitchOption.d.ts +1 -1
  51. package/package.json +21 -21
  52. package/src/actionOption/ActionOption.story.tsx +2 -1
  53. package/src/actionOption/ActionOption.tsx +1 -1
  54. package/src/alert/Alert.story.tsx +1 -1
  55. package/src/alert/Alert.tsx +1 -1
  56. package/src/button/_stories/Button.accessibility.docs.mdx +10 -6
  57. package/src/button/_stories/Button.story.tsx +0 -2
  58. package/src/checkboxOption/CheckboxOption.story.tsx +2 -1
  59. package/src/checkboxOption/CheckboxOption.tsx +1 -1
  60. package/src/common/Option/Option.tsx +3 -0
  61. package/src/common/bottomSheet/BottomSheet.story.tsx +11 -9
  62. package/src/common/bottomSheet/BottomSheet.test.story.tsx +28 -15
  63. package/src/divider/Divider.accessibility.docs.mdx +1 -10
  64. package/src/divider/Divider.story.tsx +0 -1
  65. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +1 -2
  66. package/src/header/Header.accessibility.docs.mdx +9 -5
  67. package/src/inputs/InputGroup.css +10 -2
  68. package/src/inputs/InputGroup.less +12 -2
  69. package/src/inputs/InputGroup.story.tsx +27 -0
  70. package/src/inputs/InputGroup.tsx +10 -0
  71. package/src/inputs/SelectInput/_stories/SelectInput.story.tsx +0 -1
  72. package/src/legacylistItem/LegacyListItem.story.tsx +2 -1
  73. package/src/legacylistItem/LegacyListItem.test.story.tsx +1 -1
  74. package/src/legacylistItem/LegacyListItem.tsx +1 -1
  75. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -1
  76. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -1
  77. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -1
  78. package/src/listItem/Button/ListItemButton.story.tsx +0 -1
  79. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -1
  80. package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -1
  81. package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -1
  82. package/src/listItem/Prompt/ListItemPrompt.story.tsx +0 -1
  83. package/src/listItem/Radio/ListItemRadio.story.tsx +0 -1
  84. package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -1
  85. package/src/listItem/_stories/ListItem.story.tsx +2 -1
  86. package/src/main.css +18 -2
  87. package/src/navigationOption/NavigationOption.story.tsx +2 -1
  88. package/src/navigationOption/NavigationOption.tsx +1 -1
  89. package/src/phoneNumberInput/PhoneNumberInput.css +5 -0
  90. package/src/phoneNumberInput/PhoneNumberInput.less +7 -0
  91. package/src/phoneNumberInput/PhoneNumberInput.tsx +10 -1
  92. package/src/prompt/InfoPrompt/InfoPrompt.tsx +2 -2
  93. package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +0 -1
  94. package/src/radioOption/RadioOption.story.tsx +2 -1
  95. package/src/radioOption/RadioOption.tsx +1 -1
  96. package/src/section/Section.story.tsx +12 -7
  97. package/src/sentimentSurface/SentimentSurface.story.tsx +1 -1
  98. package/src/snackbar/Snackbar.test.story.tsx +16 -104
  99. package/src/summary/Summary.story.tsx +1 -1
  100. package/src/summary/Summary.test.story.tsx +1 -1
  101. package/src/summary/Summary.tsx +1 -1
  102. package/src/switchOption/SwitchOption.story.tsx +2 -2
  103. package/src/switchOption/SwitchOption.tsx +1 -1
@@ -1,13 +1,12 @@
1
- import { userEvent, within } from 'storybook/test';
1
+ import { userEvent, within, expect } from 'storybook/test';
2
2
  import { action } from 'storybook/actions';
3
- import { Mobile as MobileIcon, Theme, Switch, Bulb, Info, Coins, Team } from '@transferwise/icons';
3
+ import { withVariantConfig } from '../../.storybook/helpers';
4
+ import { lorem20 } from '../test-utils';
5
+ import { wait } from '../test-utils/wait';
6
+ import Button from '../button';
4
7
  import { Snackbar, type SnackbarProps } from './Snackbar';
5
8
  import { SnackbarConsumer } from './SnackbarContext';
6
9
  import SnackbarProvider from './SnackbarProvider';
7
- import Button from '../button';
8
- import CheckboxOption from '../checkboxOption';
9
- import { wait } from '../test-utils/wait';
10
- import { withVariantConfig } from '../../.storybook/helpers';
11
10
 
12
11
  export default {
13
12
  title: 'Dialogs/Snackbar/Tests',
@@ -43,6 +42,7 @@ const Default = {
43
42
  {({ createSnackbar }) => (
44
43
  <>
45
44
  <Button
45
+ v2
46
46
  block
47
47
  onClick={() => {
48
48
  createSnackbar({
@@ -69,36 +69,6 @@ export const Basic = {
69
69
  ...Default,
70
70
  args: {
71
71
  ...Default.args,
72
- extraContext: (
73
- <div className="p-t-3">
74
- <CheckboxOption
75
- title="In light mode, snackbar has drop shadow"
76
- content={
77
- <a
78
- href="https://transferwise.atlassian.net/browse/DS-4477"
79
- target="_blank"
80
- rel="noreferrer"
81
- >
82
- Bug DS-4477
83
- </a>
84
- }
85
- media={<Bulb />}
86
- />
87
- <CheckboxOption
88
- title="Font size is 14 px, not 16px"
89
- content={
90
- <a
91
- href="https://transferwise.atlassian.net/browse/DS-3716"
92
- target="_blank"
93
- rel="noreferrer"
94
- >
95
- Bug DS-3716
96
- </a>
97
- }
98
- media={<Info size="16" />}
99
- />
100
- </div>
101
- ) as React.ReactNode,
102
72
  },
103
73
  };
104
74
 
@@ -106,14 +76,6 @@ export const Mobile = {
106
76
  ...Default,
107
77
  args: {
108
78
  ...Default.args,
109
- extraContext: (
110
- <div className="p-t-3">
111
- <CheckboxOption
112
- title="In mobile view, snackbar is full-width, not centered"
113
- media={<MobileIcon />}
114
- />
115
- </div>
116
- ) as React.ReactNode,
117
79
  },
118
80
  ...withVariantConfig(['mobile'], Default),
119
81
  };
@@ -136,15 +98,6 @@ export const DarkMode = {
136
98
  ...Default,
137
99
  args: {
138
100
  ...Default.args,
139
- extraContext: (
140
- <div className="p-t-3">
141
- <CheckboxOption title="In dark mode, snackbar has no drop shadow" media={<Theme />} />
142
- <CheckboxOption
143
- title="In dark mode, snackbar is inverted and has light background"
144
- media={<Theme />}
145
- />
146
- </div>
147
- ) as React.ReactNode,
148
101
  },
149
102
  play: switchToDarkMode,
150
103
  ...withVariantConfig(['dark'], Default),
@@ -167,36 +120,6 @@ export const RTL = {
167
120
  ...Default,
168
121
  args: {
169
122
  ...Default.args,
170
- extraContext: (
171
- <div className="p-t-3">
172
- <CheckboxOption
173
- title="In RTL, snackbar is not left aligned"
174
- content={
175
- <a
176
- href="https://transferwise.atlassian.net/browse/DS-4642"
177
- target="_blank"
178
- rel="noreferrer"
179
- >
180
- Bug DS-4642
181
- </a>
182
- }
183
- media={<Switch />}
184
- />
185
- <CheckboxOption
186
- title="In RTL, snackbar has proper padding on left and right of button"
187
- content={
188
- <a
189
- href="https://transferwise.atlassian.net/browse/DS-4643"
190
- target="_blank"
191
- rel="noreferrer"
192
- >
193
- Bug DS-4643
194
- </a>
195
- }
196
- media={<Switch />}
197
- />
198
- </div>
199
- ) as React.ReactNode,
200
123
  },
201
124
  play: switchToRTL,
202
125
  ...withVariantConfig(['rtl'], Default),
@@ -217,42 +140,31 @@ export const Zoom400 = {
217
140
  ...Default.args,
218
141
  extraContext: (
219
142
  <div className="p-t-3">
220
- <CheckboxOption
221
- content="Snackbar isn't transparent (I'm going to make this text very long so that it will fill up the entire page and go behind the snackbar. This way, when you look at it you will easily be able to tell if the snackbar is transparent and recognize the bug because we don't want it to be transparent. Transparent is bad. When we first did rebrand we had a lot of problems with transparencies. I don't know what happened to them. I don't see them a lot anymore but I also don't remember anybody fixing them.)"
222
- title={
223
- <a
224
- href="https://transferwise.atlassian.net/browse/DS-3716"
225
- target="_blank"
226
- rel="noreferrer"
227
- >
228
- Bug DS-3716
229
- </a>
230
- }
231
- media={<Coins />}
232
- />
143
+ Snackbar isn&#39;t transparent (I&#39;m going to make this text very long so that it will
144
+ fill up the entire page and go behind the snackbar. This way, when you look at it you will
145
+ easily be able to tell if the snackbar is transparent and recognize the bug because we
146
+ don&#39;t want it to be transparent. Transparent is bad. When we first did rebrand we had a
147
+ lot of problems with transparencies. {lorem20}
233
148
  </div>
234
149
  ),
235
150
  },
236
151
  ...withVariantConfig(['400%'], Default),
237
152
  };
238
153
 
154
+ /**
155
+ * Snackbar is only shown once even if trigger is clicked many times
156
+ */
239
157
  export const MultipleClicks = {
240
158
  ...Default,
241
159
  args: {
242
160
  ...Default.args,
243
- extraContext: (
244
- <div className="p-t-3">
245
- <CheckboxOption
246
- title="Snackbar is only shown once even if clicked many times"
247
- media={<Team />}
248
- />
249
- </div>
250
- ),
251
161
  },
252
162
  play: async ({ canvasElement }: { canvasElement: HTMLElement }) => {
253
163
  const canvas = within(canvasElement);
254
164
  for (let i = 0; i < 8; i += 1) {
255
165
  await userEvent.click(canvas.getByRole('button'));
256
166
  }
167
+
168
+ await expect(within(document.body).getAllByRole('alert')).toHaveLength(1);
257
169
  },
258
170
  };
@@ -6,7 +6,7 @@ import { InfoPresentation } from '../info';
6
6
  import Summary, { type Props as SummaryProps } from './Summary';
7
7
 
8
8
  /**
9
- * > ⚠️ This component is **deprecated** and superseded by the [new ListItem component](?path=/docs/content-listitem--docs).
9
+ * > ⚠️ This component is **deprecated** and superseded by the [new ListItem component](?path=/docs/content-listitem--docs) (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).
10
10
  */
11
11
  export default {
12
12
  component: Summary,
@@ -5,7 +5,7 @@ import Summary, { type SummaryProps } from '.';
5
5
  export default {
6
6
  component: Summary,
7
7
  title: 'Content/Summary/Tests',
8
- tags: ['deprecated', '!manifest'],
8
+ tags: ['!manifest', 'deprecated'],
9
9
  };
10
10
 
11
11
  export const LongText = () => {
@@ -94,7 +94,7 @@ export interface Props {
94
94
  }
95
95
 
96
96
  /**
97
- * @deprecated Use `<ListItem />` instead.
97
+ * @deprecated Use `<ListItem />` instead (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).
98
98
  * @deprecatedSince 46.104.0
99
99
  * @see [Source](../listItem/ListItem.tsx)
100
100
  * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)
@@ -7,7 +7,8 @@ import { Nudge, Title, Typography } from '..';
7
7
  import SwitchOption, { type SwitchOptionProps } from './SwitchOption';
8
8
 
9
9
  /**
10
- * > ⚠️ This component is **deprecated** and superseded by the [new ListItem component](?path=/docs/content-listitem--docs) with the [ListItem.Switch control](?path=/docs/content-listitem-listitem-switch--docs).
10
+ * > ⚠️ This component is **deprecated** and superseded by the [new ListItem component](?path=/docs/content-listitem--docs) with the [ListItem.Switch control](?path=/docs/content-listitem-listitem-switch--docs)
11
+ * (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).
11
12
  */
12
13
  const meta = {
13
14
  component: SwitchOption,
@@ -45,7 +46,6 @@ function Template(args: SwitchOptionProps) {
45
46
 
46
47
  export const Playground = {
47
48
  render: (args: SwitchOptionProps) => <Template {...args} />,
48
- tags: ['!autodocs'],
49
49
  };
50
50
 
51
51
  export const Multiple = {
@@ -27,7 +27,7 @@ const stopPropagation = (event?: MouseEvent<HTMLSpanElement>) => {
27
27
  };
28
28
 
29
29
  /**
30
- * @deprecated Use `<ListItem />` instead.
30
+ * @deprecated Use `<ListItem />` instead (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).
31
31
  * @deprecatedSince 46.104.0
32
32
  * @see [Source](../listItem/ListItem.tsx)
33
33
  * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)