@transferwise/components 46.164.0 → 46.165.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.
- package/build/ListItem/ListItem.js +2 -0
- package/build/ListItem/ListItem.js.map +1 -1
- package/build/ListItem/ListItem.mjs +2 -0
- package/build/ListItem/ListItem.mjs.map +1 -1
- package/build/Snackbar/Snackbar.js +98 -101
- package/build/Snackbar/Snackbar.js.map +1 -1
- package/build/Snackbar/Snackbar.mjs +99 -102
- package/build/Snackbar/Snackbar.mjs.map +1 -1
- package/build/main.css +5 -0
- package/build/styles/ListItem/ListItem.css +5 -0
- package/build/styles/main.css +5 -0
- package/build/types/Body/Body.d.ts +2 -2
- package/build/types/Carousel/_stories/constants.d.ts +25 -0
- package/build/types/Carousel/_stories/constants.d.ts.map +1 -1
- package/build/types/IconButton/IconButton.d.ts +1 -1
- package/build/types/ListItem/ListItem.d.ts +6 -1
- package/build/types/ListItem/ListItem.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/MoneyInput/MoneyInput.d.ts +1 -1
- package/build/types/MoneyInput/MoneyInput.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/build/types/Title/Title.d.ts +2 -2
- package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
- package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +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/Button/_stories/Button.test.story.tsx +96 -62
- 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/DateLookup/_stories/DateLookup.rtl.test.story.tsx +2 -2
- 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 +18 -18
- 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/InputWithDisplayFormat/_stories/InputWithDisplayFormat.test.story.tsx +4 -4
- package/src/Inputs/InputGroup/_stories/InputGroup.test.story.tsx +9 -8
- package/src/Inputs/SearchInput/_stories/SearchInput.test.story.tsx +5 -3
- package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +108 -79
- package/src/Inputs/TextArea/_stories/TextArea.test.story.tsx +10 -10
- package/src/InstructionsList/_stories/InstructionsList.test.story.tsx +43 -16
- package/src/Label/_stories/Label.test.story.tsx +7 -7
- package/src/Link/_stories/Link.test.story.tsx +27 -13
- package/src/ListItem/ListItem.css +5 -0
- package/src/ListItem/ListItem.less +4 -0
- package/src/ListItem/ListItem.test.tsx +17 -0
- package/src/ListItem/ListItem.tsx +7 -0
- package/src/ListItem/_stories/ListItem.layout.test.story.tsx +23 -0
- package/src/ListItem/_stories/ListItem.rtl.test.story.tsx +126 -6
- package/src/ListItem/_stories/ListItem.story.tsx +8 -0
- 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 +21 -3
- package/src/Nudge/_stories/Nudge.test.story.tsx +70 -21
- package/src/PhoneNumberInput/_stories/PhoneNumberInput.rtl.test.story.tsx +1 -1
- package/src/Popover/_stories/Popover.rtl.test.story.tsx +92 -49
- package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +6 -6
- 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.test.tsx +16 -0
- package/src/Snackbar/Snackbar.tsx +91 -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/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.test.story.tsx +4 -4
- package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +68 -25
- package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +4 -4
- 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 +78 -42
- package/src/common/BottomSheet/_stories/BottomSheet.test.story.tsx +38 -20
- package/src/common/Panel/_stories/Panel.rtl.test.story.tsx +135 -51
- package/src/main.css +5 -0
|
@@ -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 { Button, Modal } from '../..';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -11,49 +11,68 @@ export default {
|
|
|
11
11
|
|
|
12
12
|
type Story = StoryObj<typeof Modal>;
|
|
13
13
|
|
|
14
|
-
const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
|
|
15
|
-
|
|
16
14
|
export const WithTitleAndFooter: Story = {
|
|
17
|
-
render: () =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
render: () => {
|
|
16
|
+
const i18n = useRtlDiffI18n();
|
|
17
|
+
return (
|
|
18
|
+
<Modal
|
|
19
|
+
open
|
|
20
|
+
title={i18n.title}
|
|
21
|
+
body={i18n.body}
|
|
22
|
+
footer={
|
|
23
|
+
<Button v2 block>
|
|
24
|
+
{i18n.confirm}
|
|
25
|
+
</Button>
|
|
26
|
+
}
|
|
27
|
+
onClose={() => {}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
...withRTLDiff({
|
|
32
|
+
renderAs: 'iframe',
|
|
33
|
+
i18n: {
|
|
34
|
+
title: { en: 'Modal title', ar: 'عنوان النافذة' },
|
|
35
|
+
body: { en: 'Body content for the modal dialog.', ar: 'محتوى النافذة الحوارية.' },
|
|
36
|
+
confirm: { en: 'Confirm', ar: 'تأكيد' },
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
31
39
|
};
|
|
32
40
|
|
|
33
41
|
export const WithoutFooter: Story = {
|
|
34
|
-
render: () =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
render: () => {
|
|
43
|
+
const i18n = useRtlDiffI18n();
|
|
44
|
+
return <Modal open title={i18n.title} body={i18n.body} onClose={() => {}} />;
|
|
45
|
+
},
|
|
46
|
+
...withRTLDiff({
|
|
47
|
+
renderAs: 'iframe',
|
|
48
|
+
i18n: {
|
|
49
|
+
title: { en: 'Modal without footer', ar: 'نافذة بدون تذييل' },
|
|
50
|
+
body: { en: 'Body content without a footer.', ar: 'محتوى بدون تذييل.' },
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
43
53
|
};
|
|
44
54
|
|
|
45
55
|
export const WithoutTitle: Story = {
|
|
46
|
-
render: () =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
render: () => {
|
|
57
|
+
const i18n = useRtlDiffI18n();
|
|
58
|
+
return (
|
|
59
|
+
<Modal
|
|
60
|
+
open
|
|
61
|
+
body={i18n.body}
|
|
62
|
+
footer={
|
|
63
|
+
<Button v2 block>
|
|
64
|
+
{i18n.done}
|
|
65
|
+
</Button>
|
|
66
|
+
}
|
|
67
|
+
onClose={() => {}}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
},
|
|
71
|
+
...withRTLDiff({
|
|
72
|
+
renderAs: 'iframe',
|
|
73
|
+
i18n: {
|
|
74
|
+
body: { en: 'Body content without a title.', ar: 'محتوى بدون عنوان.' },
|
|
75
|
+
done: { en: 'Done', ar: 'تم' },
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
59
78
|
};
|
|
@@ -29,6 +29,15 @@ const gbpCurrency = {
|
|
|
29
29
|
|
|
30
30
|
const multipleCurrencies = [eurCurrency, gbpCurrency] as const;
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* `note` holds the currency's full name and renders only in the open dropdown, so only
|
|
34
|
+
* OpenDropdown needs the localised variants.
|
|
35
|
+
*/
|
|
36
|
+
const getLocalisedCurrencies = (i18n: Record<string, string>) => [
|
|
37
|
+
{ ...eurCurrency, note: i18n.euro },
|
|
38
|
+
{ ...gbpCurrency, note: i18n.britishPound },
|
|
39
|
+
];
|
|
40
|
+
|
|
32
41
|
const sharedProps = {
|
|
33
42
|
amount: 1000,
|
|
34
43
|
id: 'money-input',
|
|
@@ -72,12 +81,13 @@ export const TriggerVariants: Story = {
|
|
|
72
81
|
export const OpenDropdown: Story = {
|
|
73
82
|
render: () => {
|
|
74
83
|
const i18n = useRtlDiffI18n();
|
|
84
|
+
const currencies = getLocalisedCurrencies(i18n);
|
|
75
85
|
return (
|
|
76
86
|
<MoneyInput
|
|
77
87
|
{...sharedProps}
|
|
78
88
|
size="lg"
|
|
79
|
-
currencies={
|
|
80
|
-
selectedCurrency={
|
|
89
|
+
currencies={currencies}
|
|
90
|
+
selectedCurrency={currencies[0]}
|
|
81
91
|
searchPlaceholder={i18n.searchPlaceholder}
|
|
82
92
|
/>
|
|
83
93
|
);
|
|
@@ -88,5 +98,13 @@ export const OpenDropdown: Story = {
|
|
|
88
98
|
if (!trigger) return;
|
|
89
99
|
await userEvent.click(trigger);
|
|
90
100
|
},
|
|
91
|
-
...withRTLDiff({
|
|
101
|
+
...withRTLDiff({
|
|
102
|
+
renderAs: 'iframe',
|
|
103
|
+
width: '40%',
|
|
104
|
+
i18n: {
|
|
105
|
+
searchPlaceholder: { en: 'Search currencies or countries', ar: 'ابحث عن العملات أو الدول' },
|
|
106
|
+
euro: { en: 'Euro', ar: 'اليورو' },
|
|
107
|
+
britishPound: { en: 'British pound', ar: 'الجنيه الإسترليني' },
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
92
110
|
};
|
|
@@ -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 Nudge from '../Nudge';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -28,27 +28,76 @@ const MEDIA_NAMES = [
|
|
|
28
28
|
] as const;
|
|
29
29
|
|
|
30
30
|
export const RTLDiff: Story = {
|
|
31
|
-
render: () =>
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
render: () => {
|
|
32
|
+
const i18n = useRtlDiffI18n();
|
|
33
|
+
const mediaTitles: Record<(typeof MEDIA_NAMES)[number], string> = {
|
|
34
|
+
globe: i18n.globe,
|
|
35
|
+
lock: i18n.lock,
|
|
36
|
+
wallet: i18n.wallet,
|
|
37
|
+
gear: i18n.gear,
|
|
38
|
+
'invite-letter': i18n.inviteLetter,
|
|
39
|
+
'personal-card': i18n.personalCard,
|
|
40
|
+
'business-card': i18n.businessCard,
|
|
41
|
+
heart: i18n.heart,
|
|
42
|
+
'multi-currency': i18n.multiCurrency,
|
|
43
|
+
'shopping-bag': i18n.shoppingBag,
|
|
44
|
+
flower: i18n.flower,
|
|
45
|
+
'gift-box': i18n.giftBox,
|
|
46
|
+
backpack: i18n.backpack,
|
|
47
|
+
documents: i18n.documents,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
{MEDIA_NAMES.map((mediaName) => (
|
|
53
|
+
<Nudge
|
|
54
|
+
key={mediaName}
|
|
55
|
+
mediaName={mediaName}
|
|
56
|
+
title={mediaTitles[mediaName]}
|
|
57
|
+
link={i18n.link}
|
|
58
|
+
href="#"
|
|
59
|
+
onDismiss={() => {}}
|
|
60
|
+
/>
|
|
61
|
+
))}
|
|
34
62
|
<Nudge
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
link="Link"
|
|
39
|
-
href="#"
|
|
63
|
+
mediaName="globe"
|
|
64
|
+
title={i18n.withAction}
|
|
65
|
+
action={{ text: i18n.learnMore, href: '#' }}
|
|
40
66
|
onDismiss={() => {}}
|
|
41
67
|
/>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
68
|
+
<Nudge title={i18n.withDismiss} link={i18n.link} href="#" onDismiss={() => {}} />
|
|
69
|
+
<Nudge title={i18n.withoutDismiss} link={i18n.link} href="#" />
|
|
70
|
+
</>
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
...withRTLDiff({
|
|
74
|
+
width: 'stretch',
|
|
75
|
+
i18n: {
|
|
76
|
+
globe: { en: 'globe', ar: 'الكرة الأرضية' },
|
|
77
|
+
lock: { en: 'lock', ar: 'قفل' },
|
|
78
|
+
wallet: { en: 'wallet', ar: 'محفظة' },
|
|
79
|
+
gear: { en: 'gear', ar: 'ترس' },
|
|
80
|
+
inviteLetter: { en: 'invite-letter', ar: 'رسالة دعوة' },
|
|
81
|
+
personalCard: { en: 'personal-card', ar: 'بطاقة شخصية' },
|
|
82
|
+
businessCard: { en: 'business-card', ar: 'بطاقة تجارية' },
|
|
83
|
+
heart: { en: 'heart', ar: 'قلب' },
|
|
84
|
+
multiCurrency: { en: 'multi-currency', ar: 'عملات متعددة' },
|
|
85
|
+
shoppingBag: { en: 'shopping-bag', ar: 'حقيبة تسوق' },
|
|
86
|
+
flower: { en: 'flower', ar: 'زهرة' },
|
|
87
|
+
giftBox: { en: 'gift-box', ar: 'علبة هدايا' },
|
|
88
|
+
backpack: { en: 'backpack', ar: 'حقيبة ظهر' },
|
|
89
|
+
documents: { en: 'documents', ar: 'مستندات' },
|
|
90
|
+
link: { en: 'Link', ar: 'رابط' },
|
|
91
|
+
withAction: { en: 'With action', ar: 'مع إجراء' },
|
|
92
|
+
learnMore: { en: 'Learn more', ar: 'اعرف المزيد' },
|
|
93
|
+
withDismiss: {
|
|
94
|
+
en: 'Without media, with dismiss',
|
|
95
|
+
ar: 'بدون وسائط، مع إمكانية الإغلاق',
|
|
96
|
+
},
|
|
97
|
+
withoutDismiss: {
|
|
98
|
+
en: 'Without media, no dismiss',
|
|
99
|
+
ar: 'بدون وسائط، بدون إمكانية الإغلاق',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
54
103
|
};
|
|
@@ -55,6 +55,6 @@ export const DropdownOpen: Story = {
|
|
|
55
55
|
...withRTLDiff({
|
|
56
56
|
renderAs: 'iframe',
|
|
57
57
|
hAlign: 'center',
|
|
58
|
-
i18n: { searchPlaceholder: {
|
|
58
|
+
i18n: { searchPlaceholder: { en: 'Country code', ar: 'رمز الدولة' } },
|
|
59
59
|
}),
|
|
60
60
|
};
|
|
@@ -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
|
};
|
|
@@ -34,14 +34,14 @@ export const RTLDiff: Story = {
|
|
|
34
34
|
},
|
|
35
35
|
...withRTLDiff({
|
|
36
36
|
i18n: {
|
|
37
|
-
title1: {
|
|
37
|
+
title1: { en: 'Send 5,550 GBP', ar: 'أرسل ٥٬٥٥٠ جنيه إسترليني' },
|
|
38
38
|
description: {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
en: 'You have 3 days to reach your goal.',
|
|
40
|
+
ar: 'لديك ٣ أيام للوصول إلى هدفك.',
|
|
41
41
|
},
|
|
42
|
-
textEnd1: {
|
|
43
|
-
title2: {
|
|
44
|
-
textEnd2: {
|
|
42
|
+
textEnd1: { en: '200 GBP to go', ar: '٢٠٠ جنيه إسترليني متبقي' },
|
|
43
|
+
title2: { en: 'Total limit', ar: 'الحد الإجمالي' },
|
|
44
|
+
textEnd2: { en: '200 GBP remaining', ar: '٢٠٠ جنيه إسترليني متبقي' },
|
|
45
45
|
},
|
|
46
46
|
}),
|
|
47
47
|
};
|
|
@@ -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
|
};
|