@transferwise/components 46.159.0 → 46.159.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/i18n/cs.json +5 -0
- package/build/i18n/cs.json.js +5 -0
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +5 -0
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +5 -0
- package/build/i18n/de.json.js +5 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +5 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/es.json +5 -0
- package/build/i18n/es.json.js +5 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +5 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +5 -0
- package/build/i18n/fr.json.js +5 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +5 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +5 -0
- package/build/i18n/hu.json.js +5 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +5 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +5 -0
- package/build/i18n/id.json.js +5 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +5 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +5 -0
- package/build/i18n/it.json.js +5 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +5 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +5 -0
- package/build/i18n/ja.json.js +5 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +5 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +5 -0
- package/build/i18n/nl.json.js +5 -0
- package/build/i18n/nl.json.js.map +1 -1
- package/build/i18n/nl.json.mjs +5 -0
- package/build/i18n/nl.json.mjs.map +1 -1
- package/build/i18n/pl.json +5 -0
- package/build/i18n/pl.json.js +5 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +5 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +5 -0
- package/build/i18n/pt.json.js +5 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +5 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +5 -0
- package/build/i18n/ro.json.js +5 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +5 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +5 -0
- package/build/i18n/ru.json.js +5 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +5 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +5 -0
- package/build/i18n/th.json.js +5 -0
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +5 -0
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/uk.json +5 -0
- package/build/i18n/uk.json.js +5 -0
- package/build/i18n/uk.json.js.map +1 -1
- package/build/i18n/uk.json.mjs +5 -0
- package/build/i18n/uk.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +5 -0
- package/build/i18n/zh-HK.json.js +5 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +5 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/main.css +4 -4104
- package/build/styles/ListItem/ListItem.css +1 -0
- package/build/styles/PocketSurface/PocketSurface.css +2 -11
- package/build/styles/SentimentSurface/SentimentSurface.css +0 -23
- package/build/styles/css/neptune.css +0 -2821
- package/build/styles/main.css +4 -4104
- package/build/styles/styles/less/neptune.css +0 -2821
- package/build/types/ListItem/_stories/variants/helpers.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/Accordion/_stories/Accordion.test.story.tsx +71 -0
- package/src/AvatarLayout/_stories/AvatarLayout.test.story.tsx +64 -0
- package/src/AvatarView/_stories/AvatarView.test.story.tsx +151 -0
- package/src/Button/LegacyButton/_stories/LegacyButton.test.story.tsx +22 -0
- package/src/Button/_stories/Button.test.story.tsx +65 -0
- package/src/Calendar/_stories/Calendar.test.story.tsx +73 -24
- package/src/Carousel/_stories/Carousel.test.story.tsx +59 -0
- package/src/Checkbox/_stories/Checkbox.test.story.tsx +20 -0
- package/src/CheckboxButton/_stories/CheckboxButton.test.story.tsx +17 -37
- package/src/Chevron/_stories/Chevron.test.story.tsx +26 -0
- package/src/Chips/_stories/Chips.test.story.tsx +39 -34
- package/src/CircularButton/_stories/CircularButton.test.story.tsx +0 -68
- package/src/DateInput/_stories/DateInput.test.story.tsx +13 -0
- package/src/DateLookup/_stories/DateLookup.rtl.test.story.tsx +88 -0
- package/src/Decision/_stories/Decision.test.story.tsx +79 -0
- package/src/DefinitionList/_stories/DefinitionList.test.story.tsx +54 -1
- package/src/Drawer/_stories/Drawer.rtl.test.story.tsx +58 -0
- package/src/ExpressiveMoneyInput/_stories/ExpressiveMoneyInput.rtl.test.story.tsx +118 -0
- package/src/Field/_stories/Field.test.story.tsx +46 -0
- package/src/FlowNavigation/_stories/FlowNavigation.test.story.tsx +44 -0
- package/src/Header/_stories/Header.test.story.tsx +27 -0
- package/src/Info/_stories/Info.rtl.test.story.tsx +64 -0
- package/src/Inputs/SelectInput/_stories/SelectInput.rtl.test.story.tsx +135 -0
- package/src/Inputs/_stories/InputGroup.test.story.tsx +69 -0
- package/src/Inputs/_stories/SearchInput.test.story.tsx +32 -0
- package/src/Inputs/_stories/TextArea.test.story.tsx +27 -0
- package/src/InstructionsList/_stories/InstructionsList.test.story.tsx +30 -0
- package/src/Label/_stories/Label.test.story.tsx +36 -0
- package/src/Link/_stories/Link.test.story.tsx +26 -0
- package/src/ListItem/ListItem.css +1 -0
- package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx} +6 -10
- package/src/ListItem/_stories/variants/helpers.tsx +2 -6
- package/src/Logo/_stories/Logo.test.story.tsx +44 -0
- package/src/Modal/_stories/Modal.rtl.test.story.tsx +59 -0
- package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +88 -0
- package/src/Nudge/_stories/Nudge.test.story.tsx +37 -0
- package/src/PhoneNumberInput/_stories/PhoneNumberInput.test.story.tsx +44 -0
- package/src/PocketSurface/PocketSurface.css +2 -11
- package/src/PocketSurface/PocketSurface.less +1 -1
- package/src/Popover/_stories/Popover.rtl.test.story.tsx +96 -0
- package/src/Progress/_stories/Progress.test.story.tsx +27 -0
- package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +33 -0
- package/src/PromoCard/_stories/PromoCard.test.story.tsx +42 -0
- package/src/PromoCard/_stories/PromoCardGroup.test.story.tsx +51 -0
- package/src/Prompt/ActionPrompt/_stories/ActionPrompt.test.story.tsx +42 -1
- package/src/Prompt/CriticalBanner/_stories/CriticalBanner.test.story.tsx +34 -31
- package/src/Prompt/InfoPrompt/_stories/InfoPrompt.test.story.tsx +25 -0
- package/src/Prompt/InlinePrompt/_stories/InlinePrompt.test.story.tsx +27 -0
- package/src/Radio/_stories/Radio.test.story.tsx +61 -0
- package/src/RadioGroup/_stories/RadioGroup.test.story.tsx +56 -0
- package/src/Section/_stories/Section.test.story.tsx +29 -0
- package/src/SegmentedControl/_stories/SegmentedControl.test.story.tsx +45 -0
- package/src/SentimentSurface/SentimentSurface.css +0 -23
- package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +70 -0
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +45 -0
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +0 -31
- package/src/Stepper/_stories/Stepper.test.story.tsx +17 -0
- package/src/Switch/_stories/Switch.test.story.tsx +20 -26
- package/src/Table/_stories/Table.test.story.tsx +104 -0
- package/src/Tabs/_stories/Tabs.test.story.tsx +72 -0
- package/src/TextareaWithDisplayFormat/_stories/TextareaWithDisplayFormat.test.story.tsx +48 -0
- package/src/Tooltip/_stories/Tooltip.rtl.test.story.tsx +79 -0
- package/src/Typeahead/_stories/Typeahead.rtl.test.story.tsx +90 -0
- package/src/Upload/_stories/Upload.rtl.test.story.tsx +53 -0
- package/src/UploadInput/_stories/UploadInput.test.story.tsx +47 -0
- package/src/_deprecated/Alert/_stories/Alert.test.story.tsx +28 -1
- package/src/_deprecated/Card/_stories/Card.test.story.tsx +38 -0
- package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +18 -0
- package/src/_deprecated/InlineAlert/_stories/InlineAlert.test.story.tsx +26 -0
- package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.test.story.tsx +42 -0
- package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +71 -0
- package/src/common/BottomSheet/_stories/BottomSheet.test.story.tsx +23 -0
- package/src/i18n/cs.json +5 -0
- package/src/i18n/de.json +5 -0
- package/src/i18n/es.json +5 -0
- package/src/i18n/fr.json +5 -0
- package/src/i18n/hu.json +5 -0
- package/src/i18n/id.json +5 -0
- package/src/i18n/it.json +5 -0
- package/src/i18n/ja.json +5 -0
- package/src/i18n/nl.json +5 -0
- package/src/i18n/pl.json +5 -0
- package/src/i18n/pt.json +5 -0
- package/src/i18n/ro.json +5 -0
- package/src/i18n/ru.json +5 -0
- package/src/i18n/th.json +5 -0
- package/src/i18n/uk.json +5 -0
- package/src/i18n/zh-HK.json +5 -0
- package/src/main.css +4 -4104
- package/src/styles/less/neptune.css +0 -2821
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import Link from '..';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: Link,
|
|
7
|
+
title: 'Typography/Link/Tests',
|
|
8
|
+
tags: ['!autodocs', '!manifest'],
|
|
9
|
+
} satisfies Meta<typeof Link>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Link>;
|
|
12
|
+
|
|
13
|
+
export const RTLDiff: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<>
|
|
16
|
+
<Link href="#" target="_blank">
|
|
17
|
+
External link with navigate-away icon
|
|
18
|
+
</Link>
|
|
19
|
+
<br />
|
|
20
|
+
<Link href="#" target="_blank" type="link-large">
|
|
21
|
+
Large external link with navigate-away icon
|
|
22
|
+
</Link>
|
|
23
|
+
</>
|
|
24
|
+
),
|
|
25
|
+
...withRTLDiff(),
|
|
26
|
+
};
|
|
@@ -619,6 +619,7 @@
|
|
|
619
619
|
.wds-list-item-spotlight-inactive {
|
|
620
620
|
background-color: rgba(134, 167, 189, 0.025);
|
|
621
621
|
}
|
|
622
|
+
|
|
622
623
|
@supports (color: color-mix(in lch, red, blue)) {
|
|
623
624
|
.wds-list-item-spotlight-inactive {
|
|
624
625
|
background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
|
package/src/ListItem/_stories/{variants/ListItem.rtl.test.story.tsx → ListItem.rtl.test.story.tsx}
RENAMED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import { ListItem, type ListItemProps } from '../ListItem';
|
|
4
|
+
import { VariantStory } from './variants/helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/Tests/
|
|
8
|
+
title: 'Content/ListItem/Tests/RTL Diff',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
|
-
|
|
11
|
-
controls: { disable: true },
|
|
12
|
-
actions: { disable: true },
|
|
13
|
-
knobs: { disable: true },
|
|
14
|
-
},
|
|
10
|
+
...withRTLDiff({ width: 'stretch' }),
|
|
15
11
|
} satisfies Meta<ListItemProps>;
|
|
16
12
|
|
|
17
13
|
const Default = {
|
|
18
14
|
...VariantStory,
|
|
19
|
-
|
|
15
|
+
parameters: { variants: [] },
|
|
20
16
|
args: { variant: 'rtl' },
|
|
21
17
|
};
|
|
22
18
|
|
|
@@ -141,12 +141,8 @@ export const VariantStory: VariantStory = {
|
|
|
141
141
|
|
|
142
142
|
return (
|
|
143
143
|
<List>
|
|
144
|
-
{instances.map((instance) => (
|
|
145
|
-
<ListItem
|
|
146
|
-
key={`${variant}-${controlType}-${JSON.stringify(instance)}`}
|
|
147
|
-
control={control}
|
|
148
|
-
{...instance}
|
|
149
|
-
/>
|
|
144
|
+
{instances.map((instance, index) => (
|
|
145
|
+
<ListItem key={`${variant}-${controlType}-${index}`} control={control} {...instance} />
|
|
150
146
|
))}
|
|
151
147
|
</List>
|
|
152
148
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
4
|
import Logo, { LogoType } from '..';
|
|
4
5
|
import { LogoFormat } from '../Logo';
|
|
5
6
|
import type { LogoSize } from '../Logo';
|
|
@@ -93,3 +94,46 @@ export const Sizes = () => (
|
|
|
93
94
|
)}
|
|
94
95
|
</div>
|
|
95
96
|
);
|
|
97
|
+
|
|
98
|
+
const rtlSizes: LogoSize[] = [16, 20, 24, 36];
|
|
99
|
+
|
|
100
|
+
export const RTLDiff: Story = {
|
|
101
|
+
render: () => (
|
|
102
|
+
<>
|
|
103
|
+
<div
|
|
104
|
+
style={{
|
|
105
|
+
display: 'grid',
|
|
106
|
+
gridTemplateColumns: `repeat(${rtlSizes.length}, min-content)`,
|
|
107
|
+
gap: '1rem',
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{rtlSizes.map((size) => (
|
|
112
|
+
<Logo key={`compact-${size}`} size={size} display="compact" />
|
|
113
|
+
))}
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div
|
|
117
|
+
style={{
|
|
118
|
+
display: 'grid',
|
|
119
|
+
gridTemplateColumns: `repeat(${rtlSizes.length}, min-content)`,
|
|
120
|
+
gap: '1rem',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{rtlSizes.map((size) => (
|
|
125
|
+
<Logo key={`full-${size}`} size={size} display="full" />
|
|
126
|
+
))}
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
{Object.values(LogoType).map((type) => (
|
|
130
|
+
<Logo key={`primary-${type}`} type={type} format="primary-lockup" display="full" />
|
|
131
|
+
))}
|
|
132
|
+
|
|
133
|
+
{Object.values(LogoType).map((type) => (
|
|
134
|
+
<Logo key={`secondary-${type}`} type={type} format="secondary-lockup" display="full" />
|
|
135
|
+
))}
|
|
136
|
+
</>
|
|
137
|
+
),
|
|
138
|
+
...withRTLDiff(),
|
|
139
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import { Button, Modal } from '../..';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: Modal,
|
|
8
|
+
title: 'Dialogs/Modal/Tests/RTL Diff',
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
|
+
} satisfies Meta<typeof Modal>;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof Modal>;
|
|
13
|
+
|
|
14
|
+
const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
|
|
15
|
+
|
|
16
|
+
export const WithTitleAndFooter: Story = {
|
|
17
|
+
render: () => (
|
|
18
|
+
<Modal
|
|
19
|
+
open
|
|
20
|
+
title="Modal title"
|
|
21
|
+
body="Body content for the modal dialog."
|
|
22
|
+
footer={
|
|
23
|
+
<Button v2 block>
|
|
24
|
+
Confirm
|
|
25
|
+
</Button>
|
|
26
|
+
}
|
|
27
|
+
onClose={() => {}}
|
|
28
|
+
/>
|
|
29
|
+
),
|
|
30
|
+
...iframeDiff,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const WithoutFooter: Story = {
|
|
34
|
+
render: () => (
|
|
35
|
+
<Modal
|
|
36
|
+
open
|
|
37
|
+
title="Modal without footer"
|
|
38
|
+
body="Body content without a footer."
|
|
39
|
+
onClose={() => {}}
|
|
40
|
+
/>
|
|
41
|
+
),
|
|
42
|
+
...iframeDiff,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WithoutTitle: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<Modal
|
|
48
|
+
open
|
|
49
|
+
body="Body content without a title."
|
|
50
|
+
footer={
|
|
51
|
+
<Button v2 block>
|
|
52
|
+
Done
|
|
53
|
+
</Button>
|
|
54
|
+
}
|
|
55
|
+
onClose={() => {}}
|
|
56
|
+
/>
|
|
57
|
+
),
|
|
58
|
+
...iframeDiff,
|
|
59
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import Field from '../../Field/Field';
|
|
6
|
+
import MoneyInput from '..';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
component: MoneyInput,
|
|
10
|
+
title: 'Forms/MoneyInput/Tests/RTL Diff',
|
|
11
|
+
tags: ['!autodocs', '!manifest'],
|
|
12
|
+
} satisfies Meta<typeof MoneyInput>;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof MoneyInput>;
|
|
15
|
+
|
|
16
|
+
const eurCurrency = {
|
|
17
|
+
value: 'EUR',
|
|
18
|
+
label: 'EUR',
|
|
19
|
+
note: 'Euro',
|
|
20
|
+
currency: 'eur',
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
const gbpCurrency = {
|
|
24
|
+
value: 'GBP',
|
|
25
|
+
label: 'GBP',
|
|
26
|
+
note: 'British pound',
|
|
27
|
+
currency: 'gbp',
|
|
28
|
+
} as const;
|
|
29
|
+
|
|
30
|
+
const multipleCurrencies = [eurCurrency, gbpCurrency] as const;
|
|
31
|
+
|
|
32
|
+
const sharedProps = {
|
|
33
|
+
amount: 1000,
|
|
34
|
+
id: 'money-input',
|
|
35
|
+
onAmountChange: () => {},
|
|
36
|
+
onCurrencyChange: () => {},
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
39
|
+
export const TriggerVariants: Story = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<>
|
|
42
|
+
<Field label="Single currency — large (flag + code)">
|
|
43
|
+
<MoneyInput {...sharedProps} size="lg" currencies={[]} selectedCurrency={eurCurrency} />
|
|
44
|
+
</Field>
|
|
45
|
+
<Field label="Single currency — medium (flag + code)">
|
|
46
|
+
<MoneyInput {...sharedProps} size="md" currencies={[]} selectedCurrency={eurCurrency} />
|
|
47
|
+
</Field>
|
|
48
|
+
<Field label="Single currency — small (code only)">
|
|
49
|
+
<MoneyInput {...sharedProps} size="sm" currencies={[]} selectedCurrency={eurCurrency} />
|
|
50
|
+
</Field>
|
|
51
|
+
<Field label="Multiple currencies — large (select trigger with flag)">
|
|
52
|
+
<MoneyInput
|
|
53
|
+
{...sharedProps}
|
|
54
|
+
size="lg"
|
|
55
|
+
currencies={multipleCurrencies}
|
|
56
|
+
selectedCurrency={eurCurrency}
|
|
57
|
+
/>
|
|
58
|
+
</Field>
|
|
59
|
+
<Field label="Multiple currencies — small (select trigger without flag)">
|
|
60
|
+
<MoneyInput
|
|
61
|
+
{...sharedProps}
|
|
62
|
+
size="sm"
|
|
63
|
+
currencies={multipleCurrencies}
|
|
64
|
+
selectedCurrency={eurCurrency}
|
|
65
|
+
/>
|
|
66
|
+
</Field>
|
|
67
|
+
</>
|
|
68
|
+
),
|
|
69
|
+
...withRTLDiff(),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const OpenDropdown: Story = {
|
|
73
|
+
render: () => (
|
|
74
|
+
<MoneyInput
|
|
75
|
+
{...sharedProps}
|
|
76
|
+
size="lg"
|
|
77
|
+
currencies={multipleCurrencies}
|
|
78
|
+
selectedCurrency={eurCurrency}
|
|
79
|
+
/>
|
|
80
|
+
),
|
|
81
|
+
play: async ({ canvasElement }) => {
|
|
82
|
+
const canvas = within(canvasElement);
|
|
83
|
+
const trigger = canvas.queryByRole('combobox');
|
|
84
|
+
if (!trigger) return;
|
|
85
|
+
await userEvent.click(trigger);
|
|
86
|
+
},
|
|
87
|
+
...withRTLDiff({ renderAs: 'iframe', width: '80%' }),
|
|
88
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import Nudge from '../Nudge';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: Nudge,
|
|
7
|
+
title: 'Prompts/Nudge/Tests',
|
|
8
|
+
tags: ['!autodocs', '!manifest'],
|
|
9
|
+
} satisfies Meta<typeof Nudge>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Nudge>;
|
|
12
|
+
|
|
13
|
+
export const RTLDiff: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<>
|
|
16
|
+
<Nudge
|
|
17
|
+
mediaName="globe"
|
|
18
|
+
title="With media and dismiss"
|
|
19
|
+
link="Link"
|
|
20
|
+
href="#"
|
|
21
|
+
onDismiss={() => {}}
|
|
22
|
+
/>
|
|
23
|
+
<div style={{ marginTop: 16 }} />
|
|
24
|
+
<Nudge
|
|
25
|
+
mediaName="globe"
|
|
26
|
+
title="With media, action, and dismiss"
|
|
27
|
+
action={{ text: 'Learn more', href: '#' }}
|
|
28
|
+
onDismiss={() => {}}
|
|
29
|
+
/>
|
|
30
|
+
<div style={{ marginTop: 16 }} />
|
|
31
|
+
<Nudge title="Without media, with dismiss" link="Link" href="#" onDismiss={() => {}} />
|
|
32
|
+
<div style={{ marginTop: 16 }} />
|
|
33
|
+
<Nudge title="Without media, no dismiss" link="Link" href="#" />
|
|
34
|
+
</>
|
|
35
|
+
),
|
|
36
|
+
...withRTLDiff(),
|
|
37
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import Field from '../../Field/Field';
|
|
5
|
+
import PhoneNumberInput from '..';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: PhoneNumberInput,
|
|
9
|
+
title: 'Forms/PhoneNumberInput/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof PhoneNumberInput>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof PhoneNumberInput>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The country code selector sits on the inline-start side of the phone number input.
|
|
17
|
+
* In RTL the two elements should swap sides — the selector moves to the right and
|
|
18
|
+
* the text field moves to the left. This diff verifies the flex row reverses correctly.
|
|
19
|
+
*
|
|
20
|
+
* Size variants are included because the size prop changes the input-group class and
|
|
21
|
+
* may affect spacing between the two sub-inputs.
|
|
22
|
+
*/
|
|
23
|
+
export const RTLDiff: Story = {
|
|
24
|
+
render: () => (
|
|
25
|
+
<>
|
|
26
|
+
<Field label="Default (md)">
|
|
27
|
+
<PhoneNumberInput onChange={() => {}} />
|
|
28
|
+
</Field>
|
|
29
|
+
|
|
30
|
+
<Field label="Small (sm)">
|
|
31
|
+
<PhoneNumberInput size="sm" onChange={() => {}} />
|
|
32
|
+
</Field>
|
|
33
|
+
|
|
34
|
+
<Field label="Large (lg)">
|
|
35
|
+
<PhoneNumberInput size="lg" onChange={() => {}} />
|
|
36
|
+
</Field>
|
|
37
|
+
|
|
38
|
+
<Field label="With initial value">
|
|
39
|
+
<PhoneNumberInput initialValue="+447573135343" onChange={() => {}} />
|
|
40
|
+
</Field>
|
|
41
|
+
</>
|
|
42
|
+
),
|
|
43
|
+
...withRTLDiff(),
|
|
44
|
+
};
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
--color-background-screen: #a0e1e1;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
.wds-pocket-bright-orange {
|
|
26
25
|
--color-content-primary: #260a2f;
|
|
27
26
|
--color-content-secondary: #110415;
|
|
@@ -40,7 +39,6 @@
|
|
|
40
39
|
--color-background-screen: #ffc091;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
|
|
44
42
|
.wds-pocket-bright-pink {
|
|
45
43
|
--color-content-primary: #320707;
|
|
46
44
|
--color-content-secondary: #160303;
|
|
@@ -59,7 +57,6 @@
|
|
|
59
57
|
--color-background-screen: #ffd7ef;
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
|
|
63
60
|
.wds-pocket-bright-yellow {
|
|
64
61
|
--color-content-primary: #3a341c;
|
|
65
62
|
--color-content-secondary: #110f08;
|
|
@@ -78,7 +75,6 @@
|
|
|
78
75
|
--color-background-screen: #ffeb69;
|
|
79
76
|
}
|
|
80
77
|
|
|
81
|
-
|
|
82
78
|
.wds-pocket-dark-charcoal {
|
|
83
79
|
--color-content-primary: #a0e1e1;
|
|
84
80
|
--color-content-secondary: #ecf9f9;
|
|
@@ -97,7 +93,6 @@
|
|
|
97
93
|
--color-background-screen: #21231d;
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
|
|
101
96
|
.wds-pocket-dark-gold {
|
|
102
97
|
--color-content-primary: #ffeb69;
|
|
103
98
|
--color-content-secondary: #fffce5;
|
|
@@ -116,7 +111,6 @@
|
|
|
116
111
|
--color-background-screen: #3a341c;
|
|
117
112
|
}
|
|
118
113
|
|
|
119
|
-
|
|
120
114
|
.wds-pocket-dark-maroon {
|
|
121
115
|
--color-content-primary: #ffd7ef;
|
|
122
116
|
--color-content-secondary: #ffe5f5;
|
|
@@ -135,7 +129,6 @@
|
|
|
135
129
|
--color-background-screen: #320707;
|
|
136
130
|
}
|
|
137
131
|
|
|
138
|
-
|
|
139
132
|
.wds-pocket-dark-purple {
|
|
140
133
|
--color-content-primary: #ffc091;
|
|
141
134
|
--color-content-secondary: #fff0e5;
|
|
@@ -153,11 +146,9 @@
|
|
|
153
146
|
--color-interactive-control-active: #471358;
|
|
154
147
|
--color-background-screen: #260a2f;
|
|
155
148
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
149
|
.wds-pocket-surface {
|
|
159
150
|
background-color: #ffffff;
|
|
160
151
|
background-color: var(--color-background-screen);
|
|
161
|
-
color: #
|
|
162
|
-
color: var(--color-content-
|
|
152
|
+
color: #5d7079;
|
|
153
|
+
color: var(--color-content-secondary);
|
|
163
154
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
|
|
4
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
|
+
import Button from '../../Button';
|
|
6
|
+
import { Position } from '../../common';
|
|
7
|
+
import Popover from '..';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
component: Popover,
|
|
11
|
+
title: 'Dialogs/Popover/Tests/RTL Diff',
|
|
12
|
+
tags: ['!autodocs', '!manifest'],
|
|
13
|
+
} satisfies Meta<typeof Popover>;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Popover>;
|
|
16
|
+
|
|
17
|
+
const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
|
|
18
|
+
|
|
19
|
+
const containerStyle: React.CSSProperties = {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
minHeight: '24rem',
|
|
24
|
+
width: '100%',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const clickTrigger = async ({ canvasElement }: { canvasElement: HTMLElement }) => {
|
|
28
|
+
const canvas = within(canvasElement);
|
|
29
|
+
const trigger = canvas.queryByRole('button');
|
|
30
|
+
if (!trigger) return;
|
|
31
|
+
await userEvent.click(trigger);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const PlacementRight: Story = {
|
|
35
|
+
render: () => (
|
|
36
|
+
<div style={containerStyle}>
|
|
37
|
+
<Popover
|
|
38
|
+
preferredPlacement={Position.RIGHT}
|
|
39
|
+
title="Guaranteed rate"
|
|
40
|
+
content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
|
|
41
|
+
>
|
|
42
|
+
<Button v2>Placement right</Button>
|
|
43
|
+
</Popover>
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
play: clickTrigger,
|
|
47
|
+
...iframeDiff,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const PlacementLeft: Story = {
|
|
51
|
+
render: () => (
|
|
52
|
+
<div style={containerStyle}>
|
|
53
|
+
<Popover
|
|
54
|
+
preferredPlacement={Position.LEFT}
|
|
55
|
+
title="Guaranteed rate"
|
|
56
|
+
content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
|
|
57
|
+
>
|
|
58
|
+
<Button v2>Placement left</Button>
|
|
59
|
+
</Popover>
|
|
60
|
+
</div>
|
|
61
|
+
),
|
|
62
|
+
play: clickTrigger,
|
|
63
|
+
...iframeDiff,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const PlacementTop: Story = {
|
|
67
|
+
render: () => (
|
|
68
|
+
<div style={containerStyle}>
|
|
69
|
+
<Popover
|
|
70
|
+
preferredPlacement={Position.TOP}
|
|
71
|
+
title="Guaranteed rate"
|
|
72
|
+
content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
|
|
73
|
+
>
|
|
74
|
+
<Button v2>Placement top</Button>
|
|
75
|
+
</Popover>
|
|
76
|
+
</div>
|
|
77
|
+
),
|
|
78
|
+
play: clickTrigger,
|
|
79
|
+
...iframeDiff,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const PlacementBottom: Story = {
|
|
83
|
+
render: () => (
|
|
84
|
+
<div style={containerStyle}>
|
|
85
|
+
<Popover
|
|
86
|
+
preferredPlacement={Position.BOTTOM}
|
|
87
|
+
title="Guaranteed rate"
|
|
88
|
+
content="You'll get this rate as long as we receive your 10 EUR within the next 51 hours."
|
|
89
|
+
>
|
|
90
|
+
<Button v2>Placement bottom</Button>
|
|
91
|
+
</Popover>
|
|
92
|
+
</div>
|
|
93
|
+
),
|
|
94
|
+
play: clickTrigger,
|
|
95
|
+
...iframeDiff,
|
|
96
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import Progress from '..';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: Progress,
|
|
8
|
+
title: 'Other/Progress/Tests',
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
|
+
} satisfies Meta<typeof Progress>;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof Progress>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The native <progress> element fills in the inline direction,
|
|
16
|
+
* so partial progress flips from left-to-right to right-to-left in RTL.
|
|
17
|
+
*/
|
|
18
|
+
export const RTLDiff: Story = {
|
|
19
|
+
render: () => (
|
|
20
|
+
<>
|
|
21
|
+
<Progress id="progress-quarter" progress={{ value: 25, max: 100 }} />
|
|
22
|
+
<Progress id="progress-half" progress={{ value: 50, max: 100 }} />
|
|
23
|
+
<Progress id="progress-three-quarters" progress={{ value: 75, max: 100 }} />
|
|
24
|
+
</>
|
|
25
|
+
),
|
|
26
|
+
...withRTLDiff(),
|
|
27
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import ProgressBar from '..';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
component: ProgressBar,
|
|
8
|
+
title: 'Content/ProgressBar/Tests',
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
|
+
} satisfies Meta<typeof ProgressBar>;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof ProgressBar>;
|
|
13
|
+
|
|
14
|
+
export const RTLDiff: Story = {
|
|
15
|
+
render: () => (
|
|
16
|
+
<>
|
|
17
|
+
<ProgressBar
|
|
18
|
+
id="progress-bar-with-description"
|
|
19
|
+
title="Send 5,550 GBP"
|
|
20
|
+
description="You have 3 days to reach your goal."
|
|
21
|
+
progress={{ value: 50, max: 100 }}
|
|
22
|
+
textEnd="200 GBP to go"
|
|
23
|
+
/>
|
|
24
|
+
<ProgressBar
|
|
25
|
+
id="progress-bar-without-description"
|
|
26
|
+
title="Total limit"
|
|
27
|
+
progress={{ value: 800, max: 1000 }}
|
|
28
|
+
textEnd="200 GBP remaining"
|
|
29
|
+
/>
|
|
30
|
+
</>
|
|
31
|
+
),
|
|
32
|
+
...withRTLDiff(),
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import PromoCard from '..';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: PromoCard,
|
|
7
|
+
title: 'Layouts/PromoCard/Tests',
|
|
8
|
+
tags: ['!autodocs', '!manifest'],
|
|
9
|
+
} satisfies Meta<typeof PromoCard>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof PromoCard>;
|
|
12
|
+
|
|
13
|
+
export const RTLDiff: Story = {
|
|
14
|
+
render: () => (
|
|
15
|
+
<>
|
|
16
|
+
<PromoCard
|
|
17
|
+
title="Link with arrow"
|
|
18
|
+
description="Indicator arrow icon flips in RTL."
|
|
19
|
+
href="#"
|
|
20
|
+
indicatorLabel="Free"
|
|
21
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
22
|
+
/>
|
|
23
|
+
<PromoCard
|
|
24
|
+
title="Checkbox checked"
|
|
25
|
+
description="Check icon positioned at the end."
|
|
26
|
+
type="checkbox"
|
|
27
|
+
defaultChecked
|
|
28
|
+
indicatorLabel="Selected"
|
|
29
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
30
|
+
/>
|
|
31
|
+
<PromoCard
|
|
32
|
+
title="Download indicator"
|
|
33
|
+
description="Download icon in the indicator area."
|
|
34
|
+
href="#"
|
|
35
|
+
download="file.pdf"
|
|
36
|
+
indicatorLabel="Download"
|
|
37
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
38
|
+
/>
|
|
39
|
+
</>
|
|
40
|
+
),
|
|
41
|
+
...withRTLDiff(),
|
|
42
|
+
};
|