@transferwise/components 0.0.0-experimental-e94d625 → 0.0.0-experimental-8e1de95
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/Snackbar/Snackbar.js +97 -101
- package/build/Snackbar/Snackbar.js.map +1 -1
- package/build/Snackbar/Snackbar.mjs +98 -102
- package/build/Snackbar/Snackbar.mjs.map +1 -1
- package/build/types/Carousel/_stories/constants.d.ts +25 -0
- package/build/types/Carousel/_stories/constants.d.ts.map +1 -1
- package/build/types/ListItem/_stories/variants/helpers.d.ts +38 -1
- package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
- package/build/types/Snackbar/Snackbar.d.ts +1 -15
- package/build/types/Snackbar/Snackbar.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Accordion/_stories/Accordion.test.story.tsx +74 -48
- package/src/AvatarLayout/_stories/AvatarLayout.test.story.tsx +46 -30
- package/src/Button/LegacyButton/_stories/LegacyButton.test.story.tsx +29 -19
- package/src/Calendar/_stories/Calendar.test.story.tsx +34 -21
- package/src/Carousel/_stories/Carousel.test.story.tsx +18 -8
- package/src/Carousel/_stories/constants.tsx +29 -4
- package/src/Checkbox/_stories/Checkbox.test.story.tsx +22 -13
- package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +23 -14
- package/src/Chips/_stories/Chips.test.story.tsx +51 -36
- package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +62 -12
- package/src/Decision/_stories/Decision.test.story.tsx +74 -58
- package/src/DefinitionList/_stories/DefinitionList.test.story.tsx +58 -42
- package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +65 -38
- package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +107 -74
- package/src/Field/_stories/Field.test.story.tsx +1 -1
- package/src/FlowNavigation/_stories/FlowNavigation.rtl.test.story.tsx +81 -51
- package/src/Header/_stories/Header.test.story.tsx +30 -18
- package/src/Info/_stories/Info.rtl.test.story.tsx +124 -50
- package/src/Inputs/InputGroup/_stories/InputGroup.test.story.tsx +4 -2
- package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +106 -77
- package/src/InstructionsList/_stories/InstructionsList.test.story.tsx +43 -16
- package/src/Link/_stories/Link.test.story.tsx +27 -13
- package/src/ListItem/_stories/ListItem.rtl.test.story.tsx +126 -6
- package/src/ListItem/_stories/variants/helpers.tsx +174 -126
- package/src/Loader/_stories/Loader.test.story.tsx +17 -10
- package/src/Modal/_stories/Modal.rtl.test.story.tsx +58 -39
- package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +14 -2
- package/src/Nudge/_stories/Nudge.test.story.tsx +70 -21
- package/src/Popover/_stories/Popover.rtl.test.story.tsx +92 -49
- package/src/PromoCard/_stories/PromoCard.test.story.tsx +53 -29
- package/src/PromoCard/_stories/PromoCardGroup.test.story.tsx +60 -36
- package/src/Prompt/ActionPrompt/_stories/ActionPrompt.test.story.tsx +74 -38
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +68 -31
- package/src/Prompt/InfoPrompt/_stories/InfoPrompt.test.story.tsx +52 -22
- package/src/Prompt/InlinePrompt/_stories/InlinePrompt.test.story.tsx +36 -21
- package/src/Radio/_stories/Radio.test.story.tsx +60 -46
- package/src/RadioGroup/_stories/RadioGroup.test.story.tsx +70 -51
- package/src/Section/_stories/Section.test.story.tsx +30 -14
- package/src/SegmentedControl/_stories/SegmentedControl.test.story.tsx +38 -15
- package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +58 -34
- package/src/Snackbar/Snackbar.tsx +90 -88
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +24 -12
- package/src/Stepper/_stories/Stepper.test.story.tsx +27 -9
- package/src/Switch/_stories/Switch.test.story.tsx +20 -12
- package/src/Table/_stories/Table.test.story.tsx +107 -86
- package/src/Tabs/_stories/Tabs.test.story.tsx +92 -52
- package/src/Tag/_stories/Tag.test.story.tsx +27 -16
- package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +68 -25
- package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +3 -3
- package/src/Upload/_stories/Upload.rtl.test.story.tsx +49 -26
- package/src/UploadInput/_stories/UploadInput.test.story.tsx +63 -41
- package/src/_deprecated/Alert/_stories/Alert.test.story.tsx +45 -24
- package/src/_deprecated/Card/_stories/Card.test.story.tsx +47 -23
- package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +21 -15
- package/src/_deprecated/InlineAlert/_stories/InlineAlert.test.story.tsx +23 -12
- package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +76 -40
- package/src/common/BottomSheet/_stories/BottomSheet.test.story.tsx +38 -20
- package/src/common/Panel/_stories/Panel.rtl.test.story.tsx +135 -51
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { userEvent, within } from 'storybook/test';
|
|
3
3
|
|
|
4
|
-
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
5
|
import Button from '../../Button';
|
|
6
6
|
import { Position } from '../../common';
|
|
7
7
|
import Popover from '..';
|
|
@@ -22,65 +22,108 @@ const clickTrigger = async ({ canvasElement }: { canvasElement: HTMLElement }) =
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const PlacementRight: Story = {
|
|
25
|
-
render: () =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
title=
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
),
|
|
25
|
+
render: () => {
|
|
26
|
+
const i18n = useRtlDiffI18n();
|
|
27
|
+
return (
|
|
28
|
+
<Popover preferredPlacement={Position.RIGHT} title={i18n.title} content={i18n.content}>
|
|
29
|
+
<Button size="sm" v2>
|
|
30
|
+
{i18n.trigger}
|
|
31
|
+
</Button>
|
|
32
|
+
</Popover>
|
|
33
|
+
);
|
|
34
|
+
},
|
|
36
35
|
play: clickTrigger,
|
|
37
|
-
...withRTLDiff({
|
|
36
|
+
...withRTLDiff({
|
|
37
|
+
renderAs: 'iframe',
|
|
38
|
+
hAlign: 'left',
|
|
39
|
+
vAlign: 'center',
|
|
40
|
+
i18n: {
|
|
41
|
+
title: { en: 'Guaranteed rate', ar: 'سعر مضمون' },
|
|
42
|
+
content: {
|
|
43
|
+
en: "You'll get this rate as long as we receive your 10 EUR within the next 51 hours.",
|
|
44
|
+
ar: 'ستحصل على هذا السعر إذا استلمنا مبلغ 10 يورو خلال 51 ساعة القادمة.',
|
|
45
|
+
},
|
|
46
|
+
trigger: { en: 'right', ar: 'اليمين' },
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
38
49
|
};
|
|
39
50
|
|
|
40
51
|
export const PlacementLeft: Story = {
|
|
41
|
-
render: () =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
title=
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
),
|
|
52
|
+
render: () => {
|
|
53
|
+
const i18n = useRtlDiffI18n();
|
|
54
|
+
return (
|
|
55
|
+
<Popover preferredPlacement={Position.LEFT} title={i18n.title} content={i18n.content}>
|
|
56
|
+
<Button size="sm" v2>
|
|
57
|
+
{i18n.trigger}
|
|
58
|
+
</Button>
|
|
59
|
+
</Popover>
|
|
60
|
+
);
|
|
61
|
+
},
|
|
52
62
|
play: clickTrigger,
|
|
53
|
-
...withRTLDiff({
|
|
63
|
+
...withRTLDiff({
|
|
64
|
+
renderAs: 'iframe',
|
|
65
|
+
hAlign: 'right',
|
|
66
|
+
vAlign: 'center',
|
|
67
|
+
i18n: {
|
|
68
|
+
title: { en: 'Guaranteed rate', ar: 'سعر مضمون' },
|
|
69
|
+
content: {
|
|
70
|
+
en: "You'll get this rate as long as we receive your 10 EUR within the next 51 hours.",
|
|
71
|
+
ar: 'ستحصل على هذا السعر إذا استلمنا مبلغ 10 يورو خلال 51 ساعة القادمة.',
|
|
72
|
+
},
|
|
73
|
+
trigger: { en: 'left', ar: 'اليسار' },
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
54
76
|
};
|
|
55
77
|
|
|
56
78
|
export const PlacementTop: Story = {
|
|
57
|
-
render: () =>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
title=
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
),
|
|
79
|
+
render: () => {
|
|
80
|
+
const i18n = useRtlDiffI18n();
|
|
81
|
+
return (
|
|
82
|
+
<Popover preferredPlacement={Position.TOP} title={i18n.title} content={i18n.content}>
|
|
83
|
+
<Button size="sm" v2>
|
|
84
|
+
{i18n.trigger}
|
|
85
|
+
</Button>
|
|
86
|
+
</Popover>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
68
89
|
play: clickTrigger,
|
|
69
|
-
...withRTLDiff({
|
|
90
|
+
...withRTLDiff({
|
|
91
|
+
renderAs: 'iframe',
|
|
92
|
+
vAlign: 'bottom',
|
|
93
|
+
hAlign: 'center',
|
|
94
|
+
i18n: {
|
|
95
|
+
title: { en: 'Guaranteed rate', ar: 'سعر مضمون' },
|
|
96
|
+
content: {
|
|
97
|
+
en: "You'll get this rate as long as we receive your 10 EUR within the next 51 hours.",
|
|
98
|
+
ar: 'ستحصل على هذا السعر إذا استلمنا مبلغ 10 يورو خلال 51 ساعة القادمة.',
|
|
99
|
+
},
|
|
100
|
+
trigger: { en: 'top', ar: 'أعلى' },
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
70
103
|
};
|
|
71
104
|
|
|
72
105
|
export const PlacementBottom: Story = {
|
|
73
|
-
render: () =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
title=
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
),
|
|
106
|
+
render: () => {
|
|
107
|
+
const i18n = useRtlDiffI18n();
|
|
108
|
+
return (
|
|
109
|
+
<Popover preferredPlacement={Position.BOTTOM} title={i18n.title} content={i18n.content}>
|
|
110
|
+
<Button size="sm" v2>
|
|
111
|
+
{i18n.trigger}
|
|
112
|
+
</Button>
|
|
113
|
+
</Popover>
|
|
114
|
+
);
|
|
115
|
+
},
|
|
84
116
|
play: clickTrigger,
|
|
85
|
-
...withRTLDiff({
|
|
117
|
+
...withRTLDiff({
|
|
118
|
+
renderAs: 'iframe',
|
|
119
|
+
hAlign: 'center',
|
|
120
|
+
i18n: {
|
|
121
|
+
title: { en: 'Guaranteed rate', ar: 'سعر مضمون' },
|
|
122
|
+
content: {
|
|
123
|
+
en: "You'll get this rate as long as we receive your 10 EUR within the next 51 hours.",
|
|
124
|
+
ar: 'ستحصل على هذا السعر إذا استلمنا مبلغ 10 يورو خلال 51 ساعة القادمة.',
|
|
125
|
+
},
|
|
126
|
+
trigger: { en: 'bottom', ar: 'أسفل' },
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
86
129
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
2
|
+
import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
3
|
import PromoCard from '..';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -11,32 +11,56 @@ export default {
|
|
|
11
11
|
type Story = StoryObj<typeof PromoCard>;
|
|
12
12
|
|
|
13
13
|
export const RTLDiff: Story = {
|
|
14
|
-
render: () =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
14
|
+
render: () => {
|
|
15
|
+
const i18n = useRtlDiffI18n();
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<PromoCard
|
|
19
|
+
title={i18n.linkTitle}
|
|
20
|
+
description={i18n.linkDescription}
|
|
21
|
+
href="#"
|
|
22
|
+
indicatorLabel={i18n.linkIndicator}
|
|
23
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
24
|
+
/>
|
|
25
|
+
<PromoCard
|
|
26
|
+
title={i18n.checkboxTitle}
|
|
27
|
+
description={i18n.checkboxDescription}
|
|
28
|
+
type="checkbox"
|
|
29
|
+
defaultChecked
|
|
30
|
+
indicatorLabel={i18n.checkboxIndicator}
|
|
31
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
32
|
+
/>
|
|
33
|
+
<PromoCard
|
|
34
|
+
title={i18n.downloadTitle}
|
|
35
|
+
description={i18n.downloadDescription}
|
|
36
|
+
href="#"
|
|
37
|
+
download="file.pdf"
|
|
38
|
+
indicatorLabel={i18n.downloadIndicator}
|
|
39
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
40
|
+
/>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
...withRTLDiff({
|
|
45
|
+
i18n: {
|
|
46
|
+
linkTitle: { en: 'Link with arrow', ar: 'رابط مع سهم' },
|
|
47
|
+
linkDescription: {
|
|
48
|
+
en: 'Indicator arrow icon flips in RTL.',
|
|
49
|
+
ar: 'ينعكس سهم المؤشر في الاتجاه من اليمين إلى اليسار.',
|
|
50
|
+
},
|
|
51
|
+
linkIndicator: { en: 'Free', ar: 'مجانًا' },
|
|
52
|
+
checkboxTitle: { en: 'Checkbox checked', ar: 'مربع اختيار محدد' },
|
|
53
|
+
checkboxDescription: {
|
|
54
|
+
en: 'Check icon positioned at the end.',
|
|
55
|
+
ar: 'أيقونة الاختيار في نهاية البطاقة.',
|
|
56
|
+
},
|
|
57
|
+
checkboxIndicator: { en: 'Selected', ar: 'محدد' },
|
|
58
|
+
downloadTitle: { en: 'Download indicator', ar: 'مؤشر التنزيل' },
|
|
59
|
+
downloadDescription: {
|
|
60
|
+
en: 'Download icon in the indicator area.',
|
|
61
|
+
ar: 'أيقونة التنزيل في منطقة المؤشر.',
|
|
62
|
+
},
|
|
63
|
+
downloadIndicator: { en: 'Download', ar: 'تنزيل' },
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
42
66
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import { useRtlDiffI18n, withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
4
|
import PromoCard from '../PromoCard';
|
|
5
5
|
import PromoCardGroup from '../CardGroup/PromoCardGroup';
|
|
6
6
|
|
|
@@ -13,39 +13,63 @@ export default {
|
|
|
13
13
|
type Story = StoryObj<typeof PromoCardGroup>;
|
|
14
14
|
|
|
15
15
|
export const RTLDiff: Story = {
|
|
16
|
-
render: () =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
16
|
+
render: () => {
|
|
17
|
+
const i18n = useRtlDiffI18n();
|
|
18
|
+
return (
|
|
19
|
+
<PromoCardGroup>
|
|
20
|
+
<PromoCard
|
|
21
|
+
title={i18n.digitalTitle}
|
|
22
|
+
description={i18n.digitalDescription}
|
|
23
|
+
type="radio"
|
|
24
|
+
value="digital"
|
|
25
|
+
id="digital"
|
|
26
|
+
indicatorLabel={i18n.digitalIndicator}
|
|
27
|
+
imageAlt=""
|
|
28
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
29
|
+
/>
|
|
30
|
+
<PromoCard
|
|
31
|
+
title={i18n.standardTitle}
|
|
32
|
+
description={i18n.standardDescription}
|
|
33
|
+
type="radio"
|
|
34
|
+
value="standard"
|
|
35
|
+
id="standard"
|
|
36
|
+
indicatorLabel={i18n.standardIndicator}
|
|
37
|
+
imageAlt=""
|
|
38
|
+
imageSource="https://wise.com/web-art/assets/illustrations/personal-card-medium@2x.webp"
|
|
39
|
+
/>
|
|
40
|
+
<PromoCard
|
|
41
|
+
title={i18n.ecoTitle}
|
|
42
|
+
description={i18n.ecoDescription}
|
|
43
|
+
type="radio"
|
|
44
|
+
value="eco"
|
|
45
|
+
id="eco"
|
|
46
|
+
indicatorLabel={i18n.ecoIndicator}
|
|
47
|
+
imageAlt=""
|
|
48
|
+
imageSource="https://wise.com/web-art/assets/illustrations/eco-card-medium@2x.webp"
|
|
49
|
+
/>
|
|
50
|
+
</PromoCardGroup>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
...withRTLDiff({
|
|
54
|
+
i18n: {
|
|
55
|
+
digitalTitle: { en: 'Digital', ar: 'رقمية' },
|
|
56
|
+
digitalDescription: {
|
|
57
|
+
en: 'A card that lives online and works anywhere.',
|
|
58
|
+
ar: 'بطاقة تعمل عبر الإنترنت في أي مكان.',
|
|
59
|
+
},
|
|
60
|
+
digitalIndicator: { en: 'Free', ar: 'مجانًا' },
|
|
61
|
+
standardTitle: { en: 'Standard', ar: 'عادية' },
|
|
62
|
+
standardDescription: {
|
|
63
|
+
en: 'Spend and withdraw money around the world.',
|
|
64
|
+
ar: 'أنفق أموالك واسحبها في جميع أنحاء العالم.',
|
|
65
|
+
},
|
|
66
|
+
standardIndicator: { en: '7 GBP', ar: '7 جنيه إسترليني' },
|
|
67
|
+
ecoTitle: { en: 'Eco', ar: 'صديقة للبيئة' },
|
|
68
|
+
ecoDescription: {
|
|
69
|
+
en: 'A debit card made to biodegrade.',
|
|
70
|
+
ar: 'بطاقة خصم مصممة لتتحلل طبيعيًا.',
|
|
71
|
+
},
|
|
72
|
+
ecoIndicator: { en: '9 GBP', ar: '9 جنيه إسترليني' },
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
51
75
|
};
|
|
@@ -6,7 +6,7 @@ import { ActionPrompt } from '../ActionPrompt';
|
|
|
6
6
|
import { Body, Title } from '../../..';
|
|
7
7
|
import { StoryObj } from '@storybook/react-webpack5';
|
|
8
8
|
import { allModes } from '../../../../.storybook/modes';
|
|
9
|
-
import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
9
|
+
import { useRtlDiffI18n, withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
10
10
|
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
11
11
|
import { lorem10 } from '../../../test-utils';
|
|
12
12
|
|
|
@@ -275,41 +275,77 @@ export const Responsiveness: Story = {
|
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
export const RTLDiff: Story = {
|
|
278
|
-
render: () =>
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
278
|
+
render: () => {
|
|
279
|
+
const i18n = useRtlDiffI18n();
|
|
280
|
+
return (
|
|
281
|
+
<>
|
|
282
|
+
<ActionPrompt
|
|
283
|
+
title={i18n.defaultIconTitle}
|
|
284
|
+
description={i18n.defaultIconDescription}
|
|
285
|
+
action={{ label: i18n.continueAction }}
|
|
286
|
+
/>
|
|
287
|
+
<ActionPrompt
|
|
288
|
+
title={i18n.customImageTitle}
|
|
289
|
+
description={i18n.customImageDescription}
|
|
290
|
+
media={{ imgSrc: '../../wise-card.svg' }}
|
|
291
|
+
action={{ label: i18n.viewCardAction }}
|
|
292
|
+
/>
|
|
293
|
+
<ActionPrompt
|
|
294
|
+
title={i18n.avatarIconTitle}
|
|
295
|
+
description={i18n.avatarIconDescription}
|
|
296
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
297
|
+
action={{ label: i18n.connectBankAction }}
|
|
298
|
+
/>
|
|
299
|
+
<ActionPrompt
|
|
300
|
+
title={i18n.twoActionsTitle}
|
|
301
|
+
description={i18n.twoActionsDescription}
|
|
302
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
303
|
+
action={{ label: i18n.confirmAction }}
|
|
304
|
+
actionSecondary={{ label: i18n.cancelAction }}
|
|
305
|
+
/>
|
|
306
|
+
<ActionPrompt
|
|
307
|
+
title={i18n.dismissibleTitle}
|
|
308
|
+
description={i18n.dismissibleDescription}
|
|
309
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
310
|
+
action={{ label: i18n.confirmAction }}
|
|
311
|
+
actionSecondary={{ label: i18n.cancelAction }}
|
|
312
|
+
onDismiss={() => {}}
|
|
313
|
+
/>
|
|
314
|
+
</>
|
|
315
|
+
);
|
|
316
|
+
},
|
|
317
|
+
...withRTLDiff({
|
|
318
|
+
i18n: {
|
|
319
|
+
defaultIconTitle: { en: 'Default status icon', ar: 'أيقونة الحالة الافتراضية' },
|
|
320
|
+
defaultIconDescription: {
|
|
321
|
+
en: 'No media provided, uses default sentiment icon.',
|
|
322
|
+
ar: 'لا توجد وسائط، يتم استخدام أيقونة الحالة الافتراضية.',
|
|
323
|
+
},
|
|
324
|
+
continueAction: { en: 'Continue', ar: 'متابعة' },
|
|
325
|
+
customImageTitle: { en: 'Custom image', ar: 'صورة مخصصة' },
|
|
326
|
+
customImageDescription: {
|
|
327
|
+
en: 'Media with a custom image source.',
|
|
328
|
+
ar: 'وسائط مع مصدر صورة مخصص.',
|
|
329
|
+
},
|
|
330
|
+
viewCardAction: { en: 'View card', ar: 'عرض البطاقة' },
|
|
331
|
+
avatarIconTitle: { en: 'Avatar with icon', ar: 'صورة رمزية مع أيقونة' },
|
|
332
|
+
avatarIconDescription: {
|
|
333
|
+
en: 'Media with an avatar containing a custom icon.',
|
|
334
|
+
ar: 'وسائط مع صورة رمزية تحتوي على أيقونة مخصصة.',
|
|
335
|
+
},
|
|
336
|
+
connectBankAction: { en: 'Connect bank', ar: 'ربط البنك' },
|
|
337
|
+
twoActionsTitle: { en: 'Primary and secondary actions', ar: 'إجراءات أساسية وثانوية' },
|
|
338
|
+
twoActionsDescription: {
|
|
339
|
+
en: 'Both action buttons present.',
|
|
340
|
+
ar: 'زرّا الإجراء موجودان معًا.',
|
|
341
|
+
},
|
|
342
|
+
confirmAction: { en: 'Confirm', ar: 'تأكيد' },
|
|
343
|
+
cancelAction: { en: 'Cancel', ar: 'إلغاء' },
|
|
344
|
+
dismissibleTitle: { en: 'Dismissible with two actions', ar: 'قابل للإغلاق مع إجراءين' },
|
|
345
|
+
dismissibleDescription: {
|
|
346
|
+
en: 'Close button and both action buttons.',
|
|
347
|
+
ar: 'زر الإغلاق وزرّا الإجراء.',
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
}),
|
|
315
351
|
};
|
|
@@ -3,7 +3,7 @@ import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
3
3
|
import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
|
|
4
4
|
import { Bank } from '@transferwise/icons';
|
|
5
5
|
import Button from '../../../Button';
|
|
6
|
-
import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
6
|
+
import { useRtlDiffI18n, withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
7
7
|
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
8
8
|
import { CriticalBanner } from '../CriticalBanner';
|
|
9
9
|
|
|
@@ -482,34 +482,71 @@ export const UncontrolledStateInteraction: Story = {
|
|
|
482
482
|
};
|
|
483
483
|
|
|
484
484
|
export const RTLDiff: Story = {
|
|
485
|
-
render: () =>
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
title=
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
485
|
+
render: () => {
|
|
486
|
+
const i18n = useRtlDiffI18n();
|
|
487
|
+
return (
|
|
488
|
+
<>
|
|
489
|
+
<CriticalBanner title={i18n.titleOnly} description={i18n.titleOnlyDescription} />
|
|
490
|
+
<CriticalBanner
|
|
491
|
+
title={i18n.withPrimaryAction}
|
|
492
|
+
description={i18n.withPrimaryActionDescription}
|
|
493
|
+
action={{ label: i18n.verifyNow }}
|
|
494
|
+
/>
|
|
495
|
+
<CriticalBanner
|
|
496
|
+
title={i18n.withBothActions}
|
|
497
|
+
description={i18n.withBothActionsDescription}
|
|
498
|
+
action={{ label: i18n.verifyNow }}
|
|
499
|
+
actionSecondary={{ label: i18n.learnMore }}
|
|
500
|
+
/>
|
|
501
|
+
<CriticalBanner
|
|
502
|
+
title={i18n.withMediaImage}
|
|
503
|
+
description={i18n.withMediaImageDescription}
|
|
504
|
+
media={{ imgSrc: '../../wise-card.svg', 'aria-label': i18n.cardImage }}
|
|
505
|
+
action={{ label: i18n.takeAction }}
|
|
506
|
+
/>
|
|
507
|
+
<CriticalBanner
|
|
508
|
+
title={i18n.withAvatarMedia}
|
|
509
|
+
description={i18n.withAvatarMediaDescription}
|
|
510
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
511
|
+
action={{ label: i18n.connectBank }}
|
|
512
|
+
actionSecondary={{ label: i18n.learnMore }}
|
|
513
|
+
/>
|
|
514
|
+
</>
|
|
515
|
+
);
|
|
516
|
+
},
|
|
517
|
+
...withRTLDiff({
|
|
518
|
+
renderAs: 'iframe',
|
|
519
|
+
i18n: {
|
|
520
|
+
titleOnly: { en: 'Title only', ar: 'العنوان فقط' },
|
|
521
|
+
titleOnlyDescription: {
|
|
522
|
+
en: 'Description without actions or media.',
|
|
523
|
+
ar: 'وصف بدون إجراءات أو وسائط.',
|
|
524
|
+
},
|
|
525
|
+
withPrimaryAction: { en: 'With primary action', ar: 'مع إجراء رئيسي' },
|
|
526
|
+
withPrimaryActionDescription: {
|
|
527
|
+
en: 'Banner with a single action button.',
|
|
528
|
+
ar: 'لافتة تحتوي على زر إجراء واحد.',
|
|
529
|
+
},
|
|
530
|
+
withBothActions: { en: 'With both actions', ar: 'مع كلا الإجراءين' },
|
|
531
|
+
withBothActionsDescription: {
|
|
532
|
+
en: 'Banner with primary and secondary actions.',
|
|
533
|
+
ar: 'لافتة تحتوي على إجراء رئيسي وإجراء ثانوي.',
|
|
534
|
+
},
|
|
535
|
+
withMediaImage: { en: 'With media image', ar: 'مع صورة' },
|
|
536
|
+
withMediaImageDescription: {
|
|
537
|
+
en: 'Banner with a custom image.',
|
|
538
|
+
ar: 'لافتة تحتوي على صورة مخصصة.',
|
|
539
|
+
},
|
|
540
|
+
withAvatarMedia: { en: 'With avatar media', ar: 'مع صورة رمزية' },
|
|
541
|
+
withAvatarMediaDescription: {
|
|
542
|
+
en: 'Banner with an avatar icon.',
|
|
543
|
+
ar: 'لافتة تحتوي على أيقونة رمزية.',
|
|
544
|
+
},
|
|
545
|
+
verifyNow: { en: 'Verify now', ar: 'تحقّق الآن' },
|
|
546
|
+
learnMore: { en: 'Learn more', ar: 'اعرف المزيد' },
|
|
547
|
+
takeAction: { en: 'Take action', ar: 'اتخذ إجراءً' },
|
|
548
|
+
connectBank: { en: 'Connect bank', ar: 'ربط البنك' },
|
|
549
|
+
cardImage: { en: 'Wise card', ar: 'بطاقة Wise' },
|
|
550
|
+
},
|
|
551
|
+
}),
|
|
515
552
|
};
|