@transferwise/components 46.159.0 → 46.159.2
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-addons.css +1841 -0
- package/build/styles/css/neptune-core.css +2092 -0
- package/build/styles/css/neptune.css +0 -2821
- package/build/styles/main.css +4 -4104
- package/build/styles/styles/less/neptune-addons.css +1841 -0
- package/build/styles/styles/less/neptune-core.css +2092 -0
- 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/AnimatedLabel/AnimatedLabel.less +0 -1
- 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/alerts.less +1 -2
- package/src/styles/less/neptune-addons.css +1841 -0
- package/src/styles/less/neptune-addons.less +4 -0
- package/src/styles/less/neptune-core.css +2092 -0
- package/src/styles/less/neptune-core.less +4 -0
- package/src/styles/less/neptune.bundle.less +11 -11
- package/src/styles/less/neptune.css +0 -2821
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import PromoCard from '../PromoCard';
|
|
5
|
+
import PromoCardGroup from '../CardGroup/PromoCardGroup';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: PromoCardGroup,
|
|
9
|
+
title: 'Layouts/PromoCardGroup/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof PromoCardGroup>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof PromoCardGroup>;
|
|
14
|
+
|
|
15
|
+
export const RTLDiff: Story = {
|
|
16
|
+
render: () => (
|
|
17
|
+
<PromoCardGroup>
|
|
18
|
+
<PromoCard
|
|
19
|
+
title="Digital"
|
|
20
|
+
description="A card that lives online and works anywhere."
|
|
21
|
+
type="radio"
|
|
22
|
+
value="digital"
|
|
23
|
+
id="digital"
|
|
24
|
+
indicatorLabel="Free"
|
|
25
|
+
imageAlt=""
|
|
26
|
+
imageSource="https://wise.com/web-art/assets/illustrations/digital-card-2-medium@2x.webp"
|
|
27
|
+
/>
|
|
28
|
+
<PromoCard
|
|
29
|
+
title="Standard"
|
|
30
|
+
description="Spend and withdraw money around the world."
|
|
31
|
+
type="radio"
|
|
32
|
+
value="standard"
|
|
33
|
+
id="standard"
|
|
34
|
+
indicatorLabel="7 GBP"
|
|
35
|
+
imageAlt=""
|
|
36
|
+
imageSource="https://wise.com/web-art/assets/illustrations/personal-card-medium@2x.webp"
|
|
37
|
+
/>
|
|
38
|
+
<PromoCard
|
|
39
|
+
title="Eco"
|
|
40
|
+
description="A debit card made to biodegrade."
|
|
41
|
+
type="radio"
|
|
42
|
+
value="eco"
|
|
43
|
+
id="eco"
|
|
44
|
+
indicatorLabel="9 GBP"
|
|
45
|
+
imageAlt=""
|
|
46
|
+
imageSource="https://wise.com/web-art/assets/illustrations/eco-card-medium@2x.webp"
|
|
47
|
+
/>
|
|
48
|
+
</PromoCardGroup>
|
|
49
|
+
),
|
|
50
|
+
...withRTLDiff(),
|
|
51
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { Freeze, People, Suitcase } from '@transferwise/icons';
|
|
2
|
+
import { Bank, Freeze, People, Suitcase } from '@transferwise/icons';
|
|
3
3
|
import { action } from 'storybook/actions';
|
|
4
4
|
import { fn } from 'storybook/test';
|
|
5
5
|
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
10
|
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
10
11
|
import { lorem10 } from '../../../test-utils';
|
|
11
12
|
|
|
@@ -272,3 +273,43 @@ export const Responsiveness: Story = {
|
|
|
272
273
|
},
|
|
273
274
|
},
|
|
274
275
|
};
|
|
276
|
+
|
|
277
|
+
export const RTLDiff: Story = {
|
|
278
|
+
render: () => (
|
|
279
|
+
<>
|
|
280
|
+
<ActionPrompt
|
|
281
|
+
title="Default status icon"
|
|
282
|
+
description="No media provided, uses default sentiment icon."
|
|
283
|
+
action={{ label: 'Continue' }}
|
|
284
|
+
/>
|
|
285
|
+
<ActionPrompt
|
|
286
|
+
title="Custom image"
|
|
287
|
+
description="Media with a custom image source."
|
|
288
|
+
media={{ imgSrc: '../../wise-card.svg' }}
|
|
289
|
+
action={{ label: 'View card' }}
|
|
290
|
+
/>
|
|
291
|
+
<ActionPrompt
|
|
292
|
+
title="Avatar with icon"
|
|
293
|
+
description="Media with an avatar containing a custom icon."
|
|
294
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
295
|
+
action={{ label: 'Connect bank' }}
|
|
296
|
+
/>
|
|
297
|
+
<ActionPrompt
|
|
298
|
+
title="Primary and secondary actions"
|
|
299
|
+
description="Both action buttons present."
|
|
300
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
301
|
+
action={{ label: 'Confirm' }}
|
|
302
|
+
actionSecondary={{ label: 'Cancel' }}
|
|
303
|
+
/>
|
|
304
|
+
<ActionPrompt
|
|
305
|
+
title="Dismissible with two actions"
|
|
306
|
+
description="Close button and both action buttons."
|
|
307
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
308
|
+
action={{ label: 'Confirm' }}
|
|
309
|
+
actionSecondary={{ label: 'Cancel' }}
|
|
310
|
+
onDismiss={() => {}}
|
|
311
|
+
/>
|
|
312
|
+
</>
|
|
313
|
+
),
|
|
314
|
+
...withRTLDiff(),
|
|
315
|
+
};
|
|
@@ -3,6 +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
7
|
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
7
8
|
import { CriticalBanner } from '../CriticalBanner';
|
|
8
9
|
|
|
@@ -325,37 +326,6 @@ export const LiveRegionAnnouncements: Story = {
|
|
|
325
326
|
},
|
|
326
327
|
};
|
|
327
328
|
|
|
328
|
-
/** Right-to-left layout regression test. */
|
|
329
|
-
export const RTL: Story = {
|
|
330
|
-
render: function Render() {
|
|
331
|
-
const [expanded, setExpanded] = useState(true);
|
|
332
|
-
const [collapsed, setCollapsed] = useState(false);
|
|
333
|
-
|
|
334
|
-
return (
|
|
335
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
336
|
-
<CriticalBanner
|
|
337
|
-
sentiment="negative"
|
|
338
|
-
title="Your account requires verification"
|
|
339
|
-
description="Please verify your identity to continue using all features."
|
|
340
|
-
action={{ label: 'Verify now', onClick: fn() }}
|
|
341
|
-
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
342
|
-
expanded={expanded}
|
|
343
|
-
onToggle={() => setExpanded(!expanded)}
|
|
344
|
-
/>
|
|
345
|
-
<CriticalBanner
|
|
346
|
-
sentiment="warning"
|
|
347
|
-
title="Collapsed state"
|
|
348
|
-
description="This banner is collapsed."
|
|
349
|
-
action={{ label: 'Take action', onClick: fn() }}
|
|
350
|
-
expanded={collapsed}
|
|
351
|
-
onToggle={() => setCollapsed(!collapsed)}
|
|
352
|
-
/>
|
|
353
|
-
</div>
|
|
354
|
-
);
|
|
355
|
-
},
|
|
356
|
-
...withVariantConfig(['rtl']),
|
|
357
|
-
};
|
|
358
|
-
|
|
359
329
|
/** 400% zoom regression test with all variants. */
|
|
360
330
|
export const Zoom400: Story = {
|
|
361
331
|
render: () => <AllVariants gap="2rem" />,
|
|
@@ -489,3 +459,36 @@ export const UncontrolledStateInteraction: Story = {
|
|
|
489
459
|
},
|
|
490
460
|
},
|
|
491
461
|
};
|
|
462
|
+
|
|
463
|
+
export const RTLDiff: Story = {
|
|
464
|
+
render: () => (
|
|
465
|
+
<>
|
|
466
|
+
<CriticalBanner title="Title only" description="Description without actions or media." />
|
|
467
|
+
<CriticalBanner
|
|
468
|
+
title="With primary action"
|
|
469
|
+
description="Banner with a single action button."
|
|
470
|
+
action={{ label: 'Verify now' }}
|
|
471
|
+
/>
|
|
472
|
+
<CriticalBanner
|
|
473
|
+
title="With both actions"
|
|
474
|
+
description="Banner with primary and secondary actions."
|
|
475
|
+
action={{ label: 'Verify now' }}
|
|
476
|
+
actionSecondary={{ label: 'Learn more' }}
|
|
477
|
+
/>
|
|
478
|
+
<CriticalBanner
|
|
479
|
+
title="With media image"
|
|
480
|
+
description="Banner with a custom image."
|
|
481
|
+
media={{ imgSrc: '../../wise-card.svg', 'aria-label': 'Wise card' }}
|
|
482
|
+
action={{ label: 'Take action' }}
|
|
483
|
+
/>
|
|
484
|
+
<CriticalBanner
|
|
485
|
+
title="With avatar media"
|
|
486
|
+
description="Banner with an avatar icon."
|
|
487
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
488
|
+
action={{ label: 'Connect bank' }}
|
|
489
|
+
actionSecondary={{ label: 'Learn more' }}
|
|
490
|
+
/>
|
|
491
|
+
</>
|
|
492
|
+
),
|
|
493
|
+
...withRTLDiff(),
|
|
494
|
+
};
|
|
@@ -5,6 +5,7 @@ import { action } from 'storybook/actions';
|
|
|
5
5
|
import { Star } from '@transferwise/icons';
|
|
6
6
|
import { InfoPrompt, type InfoPromptProps } from '../InfoPrompt';
|
|
7
7
|
import { allModes } from '../../../../.storybook/modes';
|
|
8
|
+
import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
8
9
|
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
9
10
|
|
|
10
11
|
const withComponentGrid =
|
|
@@ -553,3 +554,27 @@ export const LiveRegionDismiss: Story = {
|
|
|
553
554
|
);
|
|
554
555
|
},
|
|
555
556
|
};
|
|
557
|
+
|
|
558
|
+
export const RTLDiff: Story = {
|
|
559
|
+
render: () => (
|
|
560
|
+
<>
|
|
561
|
+
<InfoPrompt description="Basic description only." />
|
|
562
|
+
<InfoPrompt title="With Title" description="Description with a title above it." />
|
|
563
|
+
<InfoPrompt description="Dismissible prompt." onDismiss={() => {}} />
|
|
564
|
+
<InfoPrompt
|
|
565
|
+
title="With Action"
|
|
566
|
+
description="Description with an action link below."
|
|
567
|
+
action={{ label: 'Learn more', href: '#' }}
|
|
568
|
+
/>
|
|
569
|
+
<InfoPrompt description="Custom media icon." media={{ asset: <Star title="Starred" /> }} />
|
|
570
|
+
<InfoPrompt
|
|
571
|
+
title="All Options"
|
|
572
|
+
description="Title, action, dismiss, and custom media combined."
|
|
573
|
+
media={{ asset: <Star title="Starred" /> }}
|
|
574
|
+
action={{ label: 'View details', href: '#' }}
|
|
575
|
+
onDismiss={() => {}}
|
|
576
|
+
/>
|
|
577
|
+
</>
|
|
578
|
+
),
|
|
579
|
+
...withRTLDiff(),
|
|
580
|
+
};
|
|
@@ -2,6 +2,7 @@ import { StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import { Suitcase } from '@transferwise/icons';
|
|
3
3
|
import { InlinePrompt } from '../InlinePrompt';
|
|
4
4
|
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
5
|
+
import { withRTLDiff } from '../../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'Prompts/InlinePrompt/Tests',
|
|
@@ -19,3 +20,29 @@ export const TinyScreen: Story = {
|
|
|
19
20
|
),
|
|
20
21
|
...withVariantConfig(['400%']),
|
|
21
22
|
};
|
|
23
|
+
|
|
24
|
+
export const RTLDiff: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<>
|
|
27
|
+
{/* default icon at inline-start, auto width */}
|
|
28
|
+
<InlinePrompt sentiment="positive">Short content with default icon.</InlinePrompt>
|
|
29
|
+
|
|
30
|
+
{/* custom media icon, auto width */}
|
|
31
|
+
<InlinePrompt sentiment="positive" media={<Suitcase />}>
|
|
32
|
+
Custom icon with auto width.
|
|
33
|
+
</InlinePrompt>
|
|
34
|
+
|
|
35
|
+
{/* full width — icon position flips */}
|
|
36
|
+
<InlinePrompt sentiment="positive" media={<Suitcase />} width="full">
|
|
37
|
+
Custom icon with full width.
|
|
38
|
+
</InlinePrompt>
|
|
39
|
+
|
|
40
|
+
{/* multi-line content — verifies wrapping alignment */}
|
|
41
|
+
<InlinePrompt sentiment="warning" width="full">
|
|
42
|
+
This prompt has longer content that may wrap to multiple lines to verify that the icon
|
|
43
|
+
alignment remains correct in RTL layout.
|
|
44
|
+
</InlinePrompt>
|
|
45
|
+
</>
|
|
46
|
+
),
|
|
47
|
+
...withRTLDiff(),
|
|
48
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Flag } from '@wise/art';
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import AvatarView from '../../AvatarView';
|
|
5
|
+
import Radio from '../Radio';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: Radio,
|
|
9
|
+
title: 'Forms/Radio/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof Radio>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Radio>;
|
|
14
|
+
|
|
15
|
+
export const RTLDiff: Story = {
|
|
16
|
+
render: () => (
|
|
17
|
+
<>
|
|
18
|
+
<Radio
|
|
19
|
+
label="Standard option"
|
|
20
|
+
name="radio-rtl"
|
|
21
|
+
id="radio-rtl-basic"
|
|
22
|
+
value="basic"
|
|
23
|
+
onChange={() => {}}
|
|
24
|
+
/>
|
|
25
|
+
<Radio
|
|
26
|
+
label="Option with secondary text"
|
|
27
|
+
secondary="Secondary description"
|
|
28
|
+
name="radio-rtl"
|
|
29
|
+
id="radio-rtl-secondary"
|
|
30
|
+
value="secondary"
|
|
31
|
+
onChange={() => {}}
|
|
32
|
+
/>
|
|
33
|
+
<Radio
|
|
34
|
+
label="Option with avatar"
|
|
35
|
+
name="radio-rtl"
|
|
36
|
+
id="radio-rtl-avatar"
|
|
37
|
+
value="avatar"
|
|
38
|
+
avatar={
|
|
39
|
+
<AvatarView size={40}>
|
|
40
|
+
<Flag code="IM" />
|
|
41
|
+
</AvatarView>
|
|
42
|
+
}
|
|
43
|
+
onChange={() => {}}
|
|
44
|
+
/>
|
|
45
|
+
<Radio
|
|
46
|
+
label="Option with secondary text and avatar"
|
|
47
|
+
secondary="Secondary description"
|
|
48
|
+
name="radio-rtl"
|
|
49
|
+
id="radio-rtl-secondary-avatar"
|
|
50
|
+
value="secondary-avatar"
|
|
51
|
+
avatar={
|
|
52
|
+
<AvatarView size={40}>
|
|
53
|
+
<Flag code="IM" />
|
|
54
|
+
</AvatarView>
|
|
55
|
+
}
|
|
56
|
+
onChange={() => {}}
|
|
57
|
+
/>
|
|
58
|
+
</>
|
|
59
|
+
),
|
|
60
|
+
...withRTLDiff(),
|
|
61
|
+
};
|
|
@@ -2,6 +2,9 @@ import RadioGroup, { RadioGroupProps } from '../RadioGroup';
|
|
|
2
2
|
import Field from '../../Field/Field';
|
|
3
3
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
4
4
|
import { fn } from 'storybook/test';
|
|
5
|
+
import { Flag } from '@wise/art';
|
|
6
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
7
|
+
import AvatarView from '../../AvatarView';
|
|
5
8
|
|
|
6
9
|
const meta = {
|
|
7
10
|
component: RadioGroup,
|
|
@@ -60,3 +63,56 @@ export const FieldsWithoutPrompt = {
|
|
|
60
63
|
);
|
|
61
64
|
},
|
|
62
65
|
} satisfies Story;
|
|
66
|
+
|
|
67
|
+
export const RTLDiff: Story<string> = {
|
|
68
|
+
render: () => (
|
|
69
|
+
<>
|
|
70
|
+
<RadioGroup
|
|
71
|
+
name="radio-group-rtl-basic"
|
|
72
|
+
selectedValue="option-1"
|
|
73
|
+
radios={[
|
|
74
|
+
{ value: 'option-1', label: 'Option one' },
|
|
75
|
+
{ value: 'option-2', label: 'Option two' },
|
|
76
|
+
{ value: 'option-3', label: 'Option three' },
|
|
77
|
+
]}
|
|
78
|
+
onChange={() => {}}
|
|
79
|
+
/>
|
|
80
|
+
<RadioGroup
|
|
81
|
+
name="radio-group-rtl-secondary"
|
|
82
|
+
selectedValue="option-a"
|
|
83
|
+
radios={[
|
|
84
|
+
{ value: 'option-a', label: 'Option A', secondary: 'Secondary text for A' },
|
|
85
|
+
{ value: 'option-b', label: 'Option B', secondary: 'Secondary text for B' },
|
|
86
|
+
]}
|
|
87
|
+
onChange={() => {}}
|
|
88
|
+
/>
|
|
89
|
+
<RadioGroup
|
|
90
|
+
name="radio-group-rtl-avatar"
|
|
91
|
+
selectedValue="option-x"
|
|
92
|
+
radios={[
|
|
93
|
+
{
|
|
94
|
+
value: 'option-x',
|
|
95
|
+
label: 'Option X',
|
|
96
|
+
avatar: (
|
|
97
|
+
<AvatarView size={40}>
|
|
98
|
+
<Flag code="IM" />
|
|
99
|
+
</AvatarView>
|
|
100
|
+
),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: 'option-y',
|
|
104
|
+
label: 'Option Y',
|
|
105
|
+
secondary: 'With secondary and avatar',
|
|
106
|
+
avatar: (
|
|
107
|
+
<AvatarView size={40}>
|
|
108
|
+
<Flag code="IM" />
|
|
109
|
+
</AvatarView>
|
|
110
|
+
),
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
onChange={() => {}}
|
|
114
|
+
/>
|
|
115
|
+
</>
|
|
116
|
+
),
|
|
117
|
+
...withRTLDiff(),
|
|
118
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
|
+
import Header from '../../Header';
|
|
5
|
+
import Section from '..';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
component: Section,
|
|
9
|
+
title: 'Content/Section/Tests',
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
} satisfies Meta<typeof Section>;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Section>;
|
|
14
|
+
|
|
15
|
+
export const RTLDiff: Story = {
|
|
16
|
+
render: () => (
|
|
17
|
+
<>
|
|
18
|
+
<Section>
|
|
19
|
+
<Header title="Default section" />
|
|
20
|
+
Section content without horizontal padding.
|
|
21
|
+
</Section>
|
|
22
|
+
<Section withHorizontalPadding>
|
|
23
|
+
<Header title="With horizontal padding" />
|
|
24
|
+
Section content with horizontal padding applied.
|
|
25
|
+
</Section>
|
|
26
|
+
</>
|
|
27
|
+
),
|
|
28
|
+
...withRTLDiff(),
|
|
29
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
|
+
import SegmentedControl from '../SegmentedControl';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: SegmentedControl,
|
|
7
|
+
title: 'Forms/SegmentedControl/Tests',
|
|
8
|
+
tags: ['!autodocs', '!manifest'],
|
|
9
|
+
} satisfies Meta<typeof SegmentedControl>;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof SegmentedControl>;
|
|
12
|
+
|
|
13
|
+
const inputSegments = [
|
|
14
|
+
{ id: 'seg-one', label: 'One', value: 'one' },
|
|
15
|
+
{ id: 'seg-two', label: 'Two', value: 'two' },
|
|
16
|
+
{ id: 'seg-three', label: 'Three', value: 'three' },
|
|
17
|
+
] as const;
|
|
18
|
+
|
|
19
|
+
const viewSegments = [
|
|
20
|
+
{ id: 'seg-alpha', label: 'Alpha', value: 'alpha', controls: 'panel-alpha' },
|
|
21
|
+
{ id: 'seg-beta', label: 'Beta', value: 'beta', controls: 'panel-beta' },
|
|
22
|
+
{ id: 'seg-gamma', label: 'Gamma', value: 'gamma', controls: 'panel-gamma' },
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
export const RTLDiff: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<>
|
|
28
|
+
<SegmentedControl
|
|
29
|
+
name="rtl-input"
|
|
30
|
+
mode="input"
|
|
31
|
+
segments={inputSegments}
|
|
32
|
+
value="one"
|
|
33
|
+
onChange={() => {}}
|
|
34
|
+
/>
|
|
35
|
+
<SegmentedControl
|
|
36
|
+
name="rtl-view"
|
|
37
|
+
mode="view"
|
|
38
|
+
segments={viewSegments}
|
|
39
|
+
value="alpha"
|
|
40
|
+
onChange={() => {}}
|
|
41
|
+
/>
|
|
42
|
+
</>
|
|
43
|
+
),
|
|
44
|
+
...withRTLDiff(),
|
|
45
|
+
};
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
--color-sentiment-border-overlay: rgba(203,39,47,0.30196);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
29
28
|
.wds-sentiment-negative-light-elevated {
|
|
30
29
|
--color-sentiment-content-primary: #FFFFFF;
|
|
31
30
|
--color-sentiment-content-primary-hover: #F5CCCC;
|
|
@@ -48,7 +47,6 @@
|
|
|
48
47
|
--color-sentiment-border-overlay: rgba(255,255,255,0.30196);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
|
|
52
50
|
.wds-sentiment-neutral-light-base {
|
|
53
51
|
--color-sentiment-content-primary: #454745;
|
|
54
52
|
--color-sentiment-content-primary-hover: #353635;
|
|
@@ -71,7 +69,6 @@
|
|
|
71
69
|
--color-sentiment-border-overlay: rgba(69,71,69,0.30196);
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
|
|
75
72
|
.wds-sentiment-neutral-light-elevated {
|
|
76
73
|
--color-sentiment-content-primary: #F1F1ED;
|
|
77
74
|
--color-sentiment-content-primary-hover: #E7E7E1;
|
|
@@ -94,7 +91,6 @@
|
|
|
94
91
|
--color-sentiment-border-overlay: rgba(241,241,237,0.30196);
|
|
95
92
|
}
|
|
96
93
|
|
|
97
|
-
|
|
98
94
|
.wds-sentiment-proposition-light-base {
|
|
99
95
|
--color-sentiment-content-primary: #0E0F0C;
|
|
100
96
|
--color-sentiment-content-primary-hover: #0A2826;
|
|
@@ -117,7 +113,6 @@
|
|
|
117
113
|
--color-sentiment-border-overlay: rgba(14,15,12,0.30196);
|
|
118
114
|
}
|
|
119
115
|
|
|
120
|
-
|
|
121
116
|
.wds-sentiment-proposition-light-elevated {
|
|
122
117
|
--color-sentiment-content-primary: #FFFFFF;
|
|
123
118
|
--color-sentiment-content-primary-hover: #EAF9F9;
|
|
@@ -140,7 +135,6 @@
|
|
|
140
135
|
--color-sentiment-border-overlay: rgba(255,255,255,0.30196);
|
|
141
136
|
}
|
|
142
137
|
|
|
143
|
-
|
|
144
138
|
.wds-sentiment-success-light-base {
|
|
145
139
|
--color-sentiment-content-primary: #054D28;
|
|
146
140
|
--color-sentiment-content-primary-hover: #043A1E;
|
|
@@ -163,7 +157,6 @@
|
|
|
163
157
|
--color-sentiment-border-overlay: rgba(5,77,40,0.30196);
|
|
164
158
|
}
|
|
165
159
|
|
|
166
|
-
|
|
167
160
|
.wds-sentiment-success-light-elevated {
|
|
168
161
|
--color-sentiment-content-primary: #CEF1B8;
|
|
169
162
|
--color-sentiment-content-primary-hover: #E0FFCC;
|
|
@@ -186,7 +179,6 @@
|
|
|
186
179
|
--color-sentiment-border-overlay: rgba(206,241,184,0.30196);
|
|
187
180
|
}
|
|
188
181
|
|
|
189
|
-
|
|
190
182
|
.wds-sentiment-warning-light-base {
|
|
191
183
|
--color-sentiment-content-primary: #4A3B1C;
|
|
192
184
|
--color-sentiment-content-primary-hover: #302612;
|
|
@@ -209,7 +201,6 @@
|
|
|
209
201
|
--color-sentiment-border-overlay: rgba(74,59,28,0.30196);
|
|
210
202
|
}
|
|
211
203
|
|
|
212
|
-
|
|
213
204
|
.wds-sentiment-warning-light-elevated {
|
|
214
205
|
--color-sentiment-content-primary: #4A3B1C;
|
|
215
206
|
--color-sentiment-content-primary-hover: #302612;
|
|
@@ -232,7 +223,6 @@
|
|
|
232
223
|
--color-sentiment-border-overlay: rgba(74,59,28,0.30196);
|
|
233
224
|
}
|
|
234
225
|
|
|
235
|
-
|
|
236
226
|
.wds-sentiment-negative-dark-base {
|
|
237
227
|
--color-sentiment-content-primary: #FFA8AD;
|
|
238
228
|
--color-sentiment-content-primary-hover: #FFBDC0;
|
|
@@ -255,7 +245,6 @@
|
|
|
255
245
|
--color-sentiment-border-overlay: rgba(255,168,173,0.30196);
|
|
256
246
|
}
|
|
257
247
|
|
|
258
|
-
|
|
259
248
|
.wds-sentiment-negative-dark-elevated {
|
|
260
249
|
--color-sentiment-content-primary: #410B0D;
|
|
261
250
|
--color-sentiment-content-primary-hover: #641115;
|
|
@@ -278,7 +267,6 @@
|
|
|
278
267
|
--color-sentiment-border-overlay: rgba(65,11,13,0.30196);
|
|
279
268
|
}
|
|
280
269
|
|
|
281
|
-
|
|
282
270
|
.wds-sentiment-neutral-dark-base {
|
|
283
271
|
--color-sentiment-content-primary: #F1F1ED;
|
|
284
272
|
--color-sentiment-content-primary-hover: #E7E7E1;
|
|
@@ -301,7 +289,6 @@
|
|
|
301
289
|
--color-sentiment-border-overlay: rgba(241,241,237,0.30196);
|
|
302
290
|
}
|
|
303
291
|
|
|
304
|
-
|
|
305
292
|
.wds-sentiment-neutral-dark-elevated {
|
|
306
293
|
--color-sentiment-content-primary: #2A2C29;
|
|
307
294
|
--color-sentiment-content-primary-hover: #414441;
|
|
@@ -324,7 +311,6 @@
|
|
|
324
311
|
--color-sentiment-border-overlay: rgba(42,44,41,0.30196);
|
|
325
312
|
}
|
|
326
313
|
|
|
327
|
-
|
|
328
314
|
.wds-sentiment-proposition-dark-base {
|
|
329
315
|
--color-sentiment-content-primary: #FFFFFF;
|
|
330
316
|
--color-sentiment-content-primary-hover: #EAF9F9;
|
|
@@ -347,7 +333,6 @@
|
|
|
347
333
|
--color-sentiment-border-overlay: rgba(255,255,255,0.30196);
|
|
348
334
|
}
|
|
349
335
|
|
|
350
|
-
|
|
351
336
|
.wds-sentiment-proposition-dark-elevated {
|
|
352
337
|
--color-sentiment-content-primary: #0E0F0C;
|
|
353
338
|
--color-sentiment-content-primary-hover: #0A2826;
|
|
@@ -370,7 +355,6 @@
|
|
|
370
355
|
--color-sentiment-border-overlay: rgba(14,15,12,0.30196);
|
|
371
356
|
}
|
|
372
357
|
|
|
373
|
-
|
|
374
358
|
.wds-sentiment-success-dark-base {
|
|
375
359
|
--color-sentiment-content-primary: #CEF1B8;
|
|
376
360
|
--color-sentiment-content-primary-hover: #E0FFCC;
|
|
@@ -393,7 +377,6 @@
|
|
|
393
377
|
--color-sentiment-border-overlay: rgba(206,241,184,0.30196);
|
|
394
378
|
}
|
|
395
379
|
|
|
396
|
-
|
|
397
380
|
.wds-sentiment-success-dark-elevated {
|
|
398
381
|
--color-sentiment-content-primary: #252C20;
|
|
399
382
|
--color-sentiment-content-primary-hover: #323B2B;
|
|
@@ -416,7 +399,6 @@
|
|
|
416
399
|
--color-sentiment-border-overlay: rgba(37,44,32,0.30196);
|
|
417
400
|
}
|
|
418
401
|
|
|
419
|
-
|
|
420
402
|
.wds-sentiment-warning-dark-base {
|
|
421
403
|
--color-sentiment-content-primary: #FADC65;
|
|
422
404
|
--color-sentiment-content-primary-hover: #F9D648;
|
|
@@ -439,7 +421,6 @@
|
|
|
439
421
|
--color-sentiment-border-overlay: rgba(250,220,101,0.30196);
|
|
440
422
|
}
|
|
441
423
|
|
|
442
|
-
|
|
443
424
|
.wds-sentiment-warning-dark-elevated {
|
|
444
425
|
--color-sentiment-content-primary: #3A3523;
|
|
445
426
|
--color-sentiment-content-primary-hover: #504930;
|
|
@@ -461,13 +442,9 @@
|
|
|
461
442
|
--color-sentiment-background-surface-active: #F8CD20;
|
|
462
443
|
--color-sentiment-border-overlay: rgba(58,53,35,0.30196);
|
|
463
444
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
445
|
.wds-sentiment-surface {
|
|
467
446
|
--ring-outline-color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
468
447
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
448
|
.wds-sentiment-surface--hasBaseStyles {
|
|
472
449
|
background-color: var(--color-sentiment-background-surface);
|
|
473
450
|
color: var(--color-sentiment-content-primary);
|