@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.
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +1 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +1 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/common/Option/Option.js.map +1 -1
- package/build/common/Option/Option.mjs.map +1 -1
- package/build/inputs/InputGroup.js +10 -1
- package/build/inputs/InputGroup.js.map +1 -1
- package/build/inputs/InputGroup.mjs +10 -1
- package/build/inputs/InputGroup.mjs.map +1 -1
- package/build/legacylistItem/LegacyListItem.js.map +1 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
- package/build/main.css +18 -2
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +6 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +6 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/styles/inputs/InputGroup.css +10 -2
- package/build/styles/main.css +18 -2
- package/build/styles/phoneNumberInput/PhoneNumberInput.css +5 -0
- package/build/summary/Summary.js +1 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js +1 -1
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs +1 -1
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +1 -1
- package/build/types/alert/Alert.d.ts +1 -1
- package/build/types/checkboxOption/CheckboxOption.d.ts +1 -1
- package/build/types/common/Option/Option.d.ts +3 -0
- package/build/types/common/Option/Option.d.ts.map +1 -1
- package/build/types/legacylistItem/LegacyListItem.d.ts +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +2 -2
- package/build/types/radioOption/RadioOption.d.ts +1 -1
- package/build/types/summary/Summary.d.ts +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +1 -1
- package/package.json +21 -21
- package/src/actionOption/ActionOption.story.tsx +2 -1
- package/src/actionOption/ActionOption.tsx +1 -1
- package/src/alert/Alert.story.tsx +1 -1
- package/src/alert/Alert.tsx +1 -1
- package/src/button/_stories/Button.accessibility.docs.mdx +10 -6
- package/src/button/_stories/Button.story.tsx +0 -2
- package/src/checkboxOption/CheckboxOption.story.tsx +2 -1
- package/src/checkboxOption/CheckboxOption.tsx +1 -1
- package/src/common/Option/Option.tsx +3 -0
- package/src/common/bottomSheet/BottomSheet.story.tsx +11 -9
- package/src/common/bottomSheet/BottomSheet.test.story.tsx +28 -15
- package/src/divider/Divider.accessibility.docs.mdx +1 -10
- package/src/divider/Divider.story.tsx +0 -1
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +1 -2
- package/src/header/Header.accessibility.docs.mdx +9 -5
- package/src/inputs/InputGroup.css +10 -2
- package/src/inputs/InputGroup.less +12 -2
- package/src/inputs/InputGroup.story.tsx +27 -0
- package/src/inputs/InputGroup.tsx +10 -0
- package/src/inputs/SelectInput/_stories/SelectInput.story.tsx +0 -1
- package/src/legacylistItem/LegacyListItem.story.tsx +2 -1
- package/src/legacylistItem/LegacyListItem.test.story.tsx +1 -1
- package/src/legacylistItem/LegacyListItem.tsx +1 -1
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -1
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -1
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -1
- package/src/listItem/Button/ListItemButton.story.tsx +0 -1
- package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -1
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -1
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -1
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +0 -1
- package/src/listItem/Radio/ListItemRadio.story.tsx +0 -1
- package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -1
- package/src/listItem/_stories/ListItem.story.tsx +2 -1
- package/src/main.css +18 -2
- package/src/navigationOption/NavigationOption.story.tsx +2 -1
- package/src/navigationOption/NavigationOption.tsx +1 -1
- package/src/phoneNumberInput/PhoneNumberInput.css +5 -0
- package/src/phoneNumberInput/PhoneNumberInput.less +7 -0
- package/src/phoneNumberInput/PhoneNumberInput.tsx +10 -1
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +2 -2
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +0 -1
- package/src/radioOption/RadioOption.story.tsx +2 -1
- package/src/radioOption/RadioOption.tsx +1 -1
- package/src/section/Section.story.tsx +12 -7
- package/src/sentimentSurface/SentimentSurface.story.tsx +1 -1
- package/src/snackbar/Snackbar.test.story.tsx +16 -104
- package/src/summary/Summary.story.tsx +1 -1
- package/src/summary/Summary.test.story.tsx +1 -1
- package/src/summary/Summary.tsx +1 -1
- package/src/switchOption/SwitchOption.story.tsx +2 -2
- 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 {
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
target="_blank"
|
|
226
|
-
rel="noreferrer"
|
|
227
|
-
>
|
|
228
|
-
Bug DS-3716
|
|
229
|
-
</a>
|
|
230
|
-
}
|
|
231
|
-
media={<Coins />}
|
|
232
|
-
/>
|
|
143
|
+
Snackbar isn't transparent (I'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'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,
|
package/src/summary/Summary.tsx
CHANGED
|
@@ -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)
|