@transferwise/components 46.147.0 → 46.148.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/container/Container.js.map +1 -1
- package/build/container/Container.mjs.map +1 -1
- package/build/main.css +63 -6
- package/build/prompt/CriticalBanner/CriticalBanner.js +81 -68
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +82 -69
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/styles/main.css +63 -6
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +2 -1
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +50 -1
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +2 -1
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +2 -1
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +2 -2
- package/build/types/container/Container.d.ts +2 -2
- package/build/types/container/Container.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/accordion/Accordion.story.tsx +25 -0
- package/src/avatarLayout/AvatarLayout.story.tsx +10 -0
- package/src/avatarView/AvatarView.story.tsx +8 -0
- package/src/body/Body.story.tsx +12 -0
- package/src/button/_stories/Button.story.tsx +7 -1
- package/src/calendar/Calendar.story.tsx +19 -7
- package/src/carousel/Carousel.story.tsx +35 -0
- package/src/checkbox/Checkbox.story.tsx +20 -0
- package/src/checkboxButton/CheckboxButton.story.tsx +16 -0
- package/src/chevron/Chevron.story.tsx +6 -0
- package/src/chips/Chips.story.tsx +23 -0
- package/src/circularButton/CircularButton.story.tsx +13 -0
- package/src/common/baseCard/BaseCard.story.tsx +12 -0
- package/src/common/bottomSheet/BottomSheet.story.tsx +21 -0
- package/src/common/circle/Circle.story.tsx +11 -0
- package/src/container/Container.story.tsx +12 -0
- package/src/container/Container.tsx +2 -2
- package/src/dateInput/DateInput.story.tsx +20 -0
- package/src/dateLookup/DateLookup.story.tsx +23 -0
- package/src/decision/Decision.story.tsx +36 -0
- package/src/definitionList/DefinitionList.story.tsx +16 -0
- package/src/dimmer/Dimmer.story.tsx +24 -0
- package/src/display/Display.story.tsx +11 -0
- package/src/divider/Divider.story.tsx +6 -0
- package/src/drawer/Drawer.story.tsx +25 -0
- package/src/dropFade/DropFade.story.tsx +27 -0
- package/src/emphasis/Emphasis.story.tsx +10 -0
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +37 -0
- package/src/field/Field.story.tsx +16 -0
- package/src/flowNavigation/FlowNavigation.story.tsx +25 -0
- package/src/header/Header.story.tsx +17 -0
- package/src/iconButton/IconButton.story.tsx +14 -0
- package/src/image/Image.story.tsx +11 -0
- package/src/info/Info.story.tsx +10 -0
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +23 -0
- package/src/inputs/InputGroup.story.tsx +37 -0
- package/src/inputs/SearchInput.story.tsx +22 -0
- package/src/inputs/SelectInput/_stories/SelectInput.story.tsx +42 -0
- package/src/inputs/TextArea.story.tsx +22 -0
- package/src/instructionsList/InstructionsList.story.tsx +19 -0
- package/src/label/Label.story.tsx +17 -0
- package/src/link/Link.story.tsx +11 -0
- package/src/list/List.story.tsx +19 -0
- package/src/listItem/_stories/ListItem.story.tsx +20 -0
- package/src/loader/Loader.story.tsx +6 -0
- package/src/logo/Logo.story.tsx +6 -0
- package/src/main.css +63 -6
- package/src/markdown/Markdown.story.tsx +17 -0
- package/src/modal/Modal.story.tsx +23 -0
- package/src/money/Money.story.tsx +7 -0
- package/src/moneyInput/MoneyInput.story.tsx +34 -0
- package/src/nudge/Nudge.story.tsx +17 -0
- package/src/overlayHeader/OverlayHeader.story.tsx +10 -0
- package/src/phoneNumberInput/PhoneNumberInput.story.tsx +23 -0
- package/src/popover/Popover.story.tsx +12 -0
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +11 -0
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +11 -0
- package/src/processIndicator/ProcessIndicator.story.tsx +10 -0
- package/src/progress/Progress.story.tsx +6 -0
- package/src/progressBar/ProgressBar.story.tsx +12 -0
- package/src/promoCard/PromoCard.story.tsx +15 -0
- package/src/promoCard/PromoCardGroup.story.tsx +28 -0
- package/src/prompt/ActionPrompt/ActionPrompt.css +2 -1
- package/src/prompt/ActionPrompt/ActionPrompt.less +2 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +31 -0
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +9 -0
- package/src/prompt/CriticalBanner/CriticalBanner.css +50 -1
- package/src/prompt/CriticalBanner/CriticalBanner.less +74 -1
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +181 -170
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +25 -6
- package/src/prompt/CriticalBanner/CriticalBanner.test.tsx +37 -0
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +96 -84
- package/src/prompt/CriticalBanner/CriticalBanner.vars.less +1 -0
- package/src/prompt/InfoPrompt/InfoPrompt.css +2 -1
- package/src/prompt/InfoPrompt/InfoPrompt.less +2 -1
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +30 -0
- package/src/prompt/InlinePrompt/InlinePrompt.css +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.less +2 -1
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +14 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +2 -2
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +1 -1
- package/src/radio/Radio.story.tsx +34 -0
- package/src/radioGroup/RadioGroup.story.tsx +26 -0
- package/src/section/Section.story.tsx +15 -0
- package/src/segmentedControl/SegmentedControl.story.tsx +27 -0
- package/src/sentimentSurface/SentimentSurface.story.tsx +11 -0
- package/src/slidingPanel/SlidingPanel.story.tsx +19 -0
- package/src/snackbar/Snackbar.story.tsx +24 -0
- package/src/statusIcon/StatusIcon.story.tsx +6 -0
- package/src/stepper/Stepper.story.tsx +30 -0
- package/src/sticky/Sticky.story.tsx +22 -1
- package/src/switch/Switch.story.tsx +17 -0
- package/src/table/Table.story.tsx +32 -0
- package/src/tabs/Tabs.story.tsx +31 -0
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +23 -0
- package/src/tile/Tile.story.tsx +13 -0
- package/src/title/Title.story.tsx +12 -0
- package/src/tooltip/Tooltip.story.tsx +8 -0
- package/src/typeahead/Typeahead.story.tsx +33 -0
- package/src/upload/Upload.story.tsx +24 -0
- package/src/uploadInput/UploadInput.story.tsx +31 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import Header, { HeaderProps } from './Header';
|
|
3
|
+
import {
|
|
4
|
+
createSandboxStory,
|
|
5
|
+
globalScope,
|
|
6
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
3
7
|
|
|
4
8
|
const withContainer = (Story: any) => (
|
|
5
9
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
|
@@ -83,6 +87,19 @@ export const Playground: Story = {
|
|
|
83
87
|
},
|
|
84
88
|
};
|
|
85
89
|
|
|
90
|
+
export const Sandbox = createSandboxStory({
|
|
91
|
+
code: `<Header
|
|
92
|
+
title="Section header"
|
|
93
|
+
level="group"
|
|
94
|
+
action={{
|
|
95
|
+
'aria-label': 'View all',
|
|
96
|
+
text: 'View all',
|
|
97
|
+
href: '#',
|
|
98
|
+
}}
|
|
99
|
+
/>`,
|
|
100
|
+
scope: globalScope,
|
|
101
|
+
});
|
|
102
|
+
|
|
86
103
|
/**
|
|
87
104
|
* Demonstrates a `Header` with an associated action.
|
|
88
105
|
*/
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
Freeze,
|
|
14
14
|
} from '@transferwise/icons';
|
|
15
15
|
import { fn } from 'storybook/test';
|
|
16
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
16
17
|
import IconButton, { Props } from './IconButton';
|
|
17
18
|
import SentimentSurface from '../sentimentSurface';
|
|
18
19
|
|
|
@@ -61,6 +62,19 @@ export const Playground: Story = {
|
|
|
61
62
|
),
|
|
62
63
|
};
|
|
63
64
|
|
|
65
|
+
export const Sandbox = createSandboxStory({
|
|
66
|
+
code: `<IconButton
|
|
67
|
+
size={48}
|
|
68
|
+
priority="primary"
|
|
69
|
+
type="default"
|
|
70
|
+
aria-label="Add item"
|
|
71
|
+
onClick={() => console.log('clicked')}
|
|
72
|
+
>
|
|
73
|
+
<Plus />
|
|
74
|
+
</IconButton>`,
|
|
75
|
+
scope: globalScope,
|
|
76
|
+
});
|
|
77
|
+
|
|
64
78
|
/**
|
|
65
79
|
* Priorities set a visual hierarchy amongst the buttons displayed on the
|
|
66
80
|
* screen to help more important buttons to take precedence over others. <br />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { action } from 'storybook/actions';
|
|
2
|
+
import { createSandboxStory } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
2
3
|
import Image, { type ImageProps } from './Image';
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
@@ -16,6 +17,16 @@ const meta = {
|
|
|
16
17
|
};
|
|
17
18
|
export default meta;
|
|
18
19
|
|
|
20
|
+
export const Sandbox = createSandboxStory({
|
|
21
|
+
code: `<Image
|
|
22
|
+
alt="Wise illustration"
|
|
23
|
+
src="https://wise.com/web-art/assets/illustrations/bell-small@1x.webp"
|
|
24
|
+
loading="lazy"
|
|
25
|
+
stretch={false}
|
|
26
|
+
/>`,
|
|
27
|
+
scope: { Image },
|
|
28
|
+
});
|
|
29
|
+
|
|
19
30
|
export const Basic = {
|
|
20
31
|
render: (args: ImageProps) => (
|
|
21
32
|
<>
|
package/src/info/Info.story.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
2
3
|
import { lorem10 } from '../test-utils';
|
|
3
4
|
import Info from '.';
|
|
4
5
|
import { withVariantConfig } from '../../.storybook/helpers';
|
|
@@ -22,6 +23,15 @@ export default meta;
|
|
|
22
23
|
|
|
23
24
|
type Story = StoryObj<typeof meta>;
|
|
24
25
|
|
|
26
|
+
export const Sandbox = createSandboxStory({
|
|
27
|
+
code: `<Info
|
|
28
|
+
aria-label="Click here for more details"
|
|
29
|
+
title="Fast transfer hint"
|
|
30
|
+
content="Your address has been verified, no more actions are required."
|
|
31
|
+
/>`,
|
|
32
|
+
scope: { ...globalScope, Info },
|
|
33
|
+
});
|
|
34
|
+
|
|
25
35
|
export const Basic: Story = {
|
|
26
36
|
...withVariantConfig(['default', 'dark', 'rtl']),
|
|
27
37
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { userEvent, within, fn } from 'storybook/test';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
createSandboxStory,
|
|
5
|
+
globalScope,
|
|
6
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
3
7
|
import InputWithDisplayFormat, { InputWithDisplayFormatProps } from '.';
|
|
4
8
|
import { Field, FieldProps } from '../field/Field';
|
|
5
9
|
import { Meta, type StoryObj } from '@storybook/react-webpack5';
|
|
@@ -24,6 +28,25 @@ const meta: Meta<typeof InputWithDisplayFormat> = {
|
|
|
24
28
|
} satisfies Meta<typeof InputWithDisplayFormat>;
|
|
25
29
|
export default meta;
|
|
26
30
|
|
|
31
|
+
export const Sandbox = createSandboxStory({
|
|
32
|
+
code: `const App = () => {
|
|
33
|
+
const [value, setValue] = React.useState('');
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Field label="Sort Code" id="sort-code">
|
|
37
|
+
<InputWithDisplayFormat
|
|
38
|
+
id="sort-code"
|
|
39
|
+
placeholder="**-**-**"
|
|
40
|
+
displayPattern="**-**-**"
|
|
41
|
+
value={value}
|
|
42
|
+
onChange={(event) => setValue(event.target.value)}
|
|
43
|
+
/>
|
|
44
|
+
</Field>
|
|
45
|
+
);
|
|
46
|
+
};`,
|
|
47
|
+
scope: globalScope,
|
|
48
|
+
});
|
|
49
|
+
|
|
27
50
|
export const Basic: Story = {
|
|
28
51
|
args: {
|
|
29
52
|
label: 'Sort Code',
|
|
@@ -2,6 +2,10 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import { Search } from '@transferwise/icons';
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
|
|
5
|
+
import {
|
|
6
|
+
createSandboxStory,
|
|
7
|
+
globalScope,
|
|
8
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
5
9
|
import { Button } from '..';
|
|
6
10
|
import { Field } from '../field/Field';
|
|
7
11
|
|
|
@@ -18,6 +22,39 @@ export default {
|
|
|
18
22
|
|
|
19
23
|
type Story = StoryObj<typeof InputGroup>;
|
|
20
24
|
|
|
25
|
+
export const Sandbox = createSandboxStory({
|
|
26
|
+
code: `const App = () => {
|
|
27
|
+
const [value, setValue] = React.useState('');
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Field label="Search">
|
|
31
|
+
<InputGroup
|
|
32
|
+
addonStart={{
|
|
33
|
+
content: <Search size={24} />,
|
|
34
|
+
initialContentWidth: 24,
|
|
35
|
+
}}
|
|
36
|
+
addonEnd={{
|
|
37
|
+
content: (
|
|
38
|
+
<Button v2 size="sm" onClick={() => setValue('')}>
|
|
39
|
+
Clear
|
|
40
|
+
</Button>
|
|
41
|
+
),
|
|
42
|
+
interactive: true,
|
|
43
|
+
padding: 'sm',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<Input
|
|
47
|
+
placeholder="Search by name..."
|
|
48
|
+
value={value}
|
|
49
|
+
onChange={(event) => setValue(event.target.value)}
|
|
50
|
+
/>
|
|
51
|
+
</InputGroup>
|
|
52
|
+
</Field>
|
|
53
|
+
);
|
|
54
|
+
};`,
|
|
55
|
+
scope: globalScope,
|
|
56
|
+
});
|
|
57
|
+
|
|
21
58
|
export const WithPrefix: Story = {
|
|
22
59
|
render: (args) => <InputGroupWithPrefix {...args} />,
|
|
23
60
|
args: {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
import { Size } from '../common';
|
|
5
9
|
import { Field } from '../field/Field';
|
|
6
10
|
|
|
@@ -13,6 +17,24 @@ export default {
|
|
|
13
17
|
|
|
14
18
|
type Story = StoryObj<typeof SearchInput>;
|
|
15
19
|
|
|
20
|
+
export const Sandbox = createSandboxStory({
|
|
21
|
+
code: `const App = () => {
|
|
22
|
+
const [value, setValue] = React.useState('');
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Field label="Search">
|
|
26
|
+
<SearchInput
|
|
27
|
+
size="md"
|
|
28
|
+
shape="pill"
|
|
29
|
+
value={value}
|
|
30
|
+
onChange={(event) => setValue(event.currentTarget.value)}
|
|
31
|
+
/>
|
|
32
|
+
</Field>
|
|
33
|
+
);
|
|
34
|
+
};`,
|
|
35
|
+
scope: globalScope,
|
|
36
|
+
});
|
|
37
|
+
|
|
16
38
|
export const Basic: Story = {
|
|
17
39
|
render: (args) => <SearchInputBasic {...args} />,
|
|
18
40
|
args: {
|
|
@@ -5,6 +5,10 @@ import { Flag } from '@wise/art';
|
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
|
|
8
|
+
import {
|
|
9
|
+
createSandboxStory,
|
|
10
|
+
globalScope,
|
|
11
|
+
} from '../../../../.storybook/components/sandbox/SandboxEditor';
|
|
8
12
|
import Button from '../../../button';
|
|
9
13
|
import { getMonthNames } from '../../../common/dateUtils';
|
|
10
14
|
import Drawer from '../../../drawer';
|
|
@@ -307,6 +311,44 @@ export const Playground: StoryObj<PlaygroundArgs> = {
|
|
|
307
311
|
},
|
|
308
312
|
};
|
|
309
313
|
|
|
314
|
+
export const Sandbox = createSandboxStory({
|
|
315
|
+
code: `const App = () => {
|
|
316
|
+
const months = [
|
|
317
|
+
{ id: 1, name: 'January' },
|
|
318
|
+
{ id: 2, name: 'February' },
|
|
319
|
+
{ id: 3, name: 'March' },
|
|
320
|
+
{ id: 4, name: 'April' },
|
|
321
|
+
{ id: 5, name: 'May' },
|
|
322
|
+
{ id: 6, name: 'June' },
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
const [selected, setSelected] = React.useState(undefined);
|
|
326
|
+
|
|
327
|
+
return (
|
|
328
|
+
<Field label="Select a month">
|
|
329
|
+
<SelectInput
|
|
330
|
+
size="lg"
|
|
331
|
+
filterable
|
|
332
|
+
filterPlaceholder="Type a month name"
|
|
333
|
+
placeholder="Choose a month"
|
|
334
|
+
items={months.map((month) => ({
|
|
335
|
+
type: 'option',
|
|
336
|
+
value: month,
|
|
337
|
+
filterMatchers: [month.name],
|
|
338
|
+
}))}
|
|
339
|
+
renderValue={(month) => (
|
|
340
|
+
<SelectInputOptionContent title={month.name} />
|
|
341
|
+
)}
|
|
342
|
+
value={selected}
|
|
343
|
+
onChange={(month) => setSelected(month)}
|
|
344
|
+
onClear={() => setSelected(undefined)}
|
|
345
|
+
/>
|
|
346
|
+
</Field>
|
|
347
|
+
);
|
|
348
|
+
};`,
|
|
349
|
+
scope: globalScope,
|
|
350
|
+
});
|
|
351
|
+
|
|
310
352
|
/**
|
|
311
353
|
* The simplest usage: a flat list of options with no icons or grouping.
|
|
312
354
|
* `renderValue` controls what is shown in both the trigger and each dropdown row.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
import { Field } from '../field/Field';
|
|
5
9
|
import { Sentiment } from '../common';
|
|
6
10
|
import { TextArea } from './TextArea';
|
|
@@ -54,6 +58,24 @@ export const Playground: Story = {
|
|
|
54
58
|
},
|
|
55
59
|
};
|
|
56
60
|
|
|
61
|
+
export const Sandbox = createSandboxStory({
|
|
62
|
+
code: `const App = () => {
|
|
63
|
+
const [value, setValue] = React.useState('');
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Field label="Message" required={false}>
|
|
67
|
+
<TextArea
|
|
68
|
+
maxLength={200}
|
|
69
|
+
placeholder="Type something..."
|
|
70
|
+
value={value}
|
|
71
|
+
onChange={({ target }) => setValue(target.value)}
|
|
72
|
+
/>
|
|
73
|
+
</Field>
|
|
74
|
+
);
|
|
75
|
+
};`,
|
|
76
|
+
scope: globalScope,
|
|
77
|
+
});
|
|
78
|
+
|
|
57
79
|
export const Basic: Story = {
|
|
58
80
|
render: () => {
|
|
59
81
|
const [value, setValue] = useState('');
|
|
@@ -4,6 +4,10 @@ import { fn } from 'storybook/test';
|
|
|
4
4
|
import Link from '../link';
|
|
5
5
|
|
|
6
6
|
import InstructionsList, { InstructionsListProps } from './InstructionsList';
|
|
7
|
+
import {
|
|
8
|
+
createSandboxStory,
|
|
9
|
+
globalScope,
|
|
10
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
7
11
|
|
|
8
12
|
export default {
|
|
9
13
|
component: InstructionsList,
|
|
@@ -13,6 +17,21 @@ export default {
|
|
|
13
17
|
|
|
14
18
|
type Story = StoryObj<typeof InstructionsList>;
|
|
15
19
|
|
|
20
|
+
export const Sandbox = createSandboxStory({
|
|
21
|
+
code: `<InstructionsList
|
|
22
|
+
sort="dosFirst"
|
|
23
|
+
dos={[
|
|
24
|
+
'Do an initial money transfer',
|
|
25
|
+
'Invite at least 3 friends',
|
|
26
|
+
]}
|
|
27
|
+
donts={[
|
|
28
|
+
'Paying extra hidden fees for transfers',
|
|
29
|
+
'Use bad exchange rate',
|
|
30
|
+
]}
|
|
31
|
+
/>`,
|
|
32
|
+
scope: globalScope,
|
|
33
|
+
});
|
|
34
|
+
|
|
16
35
|
export const Basic: Story = {
|
|
17
36
|
args: {
|
|
18
37
|
sort: 'dosFirst',
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSandboxStory,
|
|
3
|
+
globalScope,
|
|
4
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
1
5
|
import Info from '../info';
|
|
2
6
|
import { Label } from './Label';
|
|
3
7
|
|
|
@@ -6,6 +10,19 @@ export default {
|
|
|
6
10
|
title: 'Forms/Label',
|
|
7
11
|
};
|
|
8
12
|
|
|
13
|
+
export const Sandbox = createSandboxStory({
|
|
14
|
+
code: `<>
|
|
15
|
+
<Label>
|
|
16
|
+
<Label.Optional>
|
|
17
|
+
Field with Info{' '}
|
|
18
|
+
<Info content="Helpful tooltip content" aria-label="More information" />
|
|
19
|
+
</Label.Optional>
|
|
20
|
+
</Label>
|
|
21
|
+
<Label.Description className="m-b-2">This is a field description</Label.Description>
|
|
22
|
+
</>`,
|
|
23
|
+
scope: { ...globalScope, Info },
|
|
24
|
+
});
|
|
25
|
+
|
|
9
26
|
export const Basic = () => {
|
|
10
27
|
return (
|
|
11
28
|
<>
|
package/src/link/Link.story.tsx
CHANGED
|
@@ -4,12 +4,23 @@ import Title from '../title/Title';
|
|
|
4
4
|
|
|
5
5
|
import SentimentSurface from '../sentimentSurface';
|
|
6
6
|
import Link from '.';
|
|
7
|
+
import {
|
|
8
|
+
createSandboxStory,
|
|
9
|
+
globalScope,
|
|
10
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
7
11
|
|
|
8
12
|
export default {
|
|
9
13
|
component: Link,
|
|
10
14
|
title: 'Typography/Link',
|
|
11
15
|
};
|
|
12
16
|
|
|
17
|
+
export const Sandbox = createSandboxStory({
|
|
18
|
+
code: `<Link type="link-default" href="#">
|
|
19
|
+
Learn more about international transfers
|
|
20
|
+
</Link>`,
|
|
21
|
+
scope: { ...globalScope, Link },
|
|
22
|
+
});
|
|
23
|
+
|
|
13
24
|
export const Basic = () => {
|
|
14
25
|
return (
|
|
15
26
|
<>
|
package/src/list/List.story.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
2
3
|
import ListItem from '../listItem';
|
|
3
4
|
import List from './List';
|
|
4
5
|
|
|
@@ -10,6 +11,24 @@ export default {
|
|
|
10
11
|
|
|
11
12
|
type Story = StoryObj<typeof List>;
|
|
12
13
|
|
|
14
|
+
export const Sandbox = createSandboxStory({
|
|
15
|
+
code: `<List>
|
|
16
|
+
<ListItem
|
|
17
|
+
title="First item"
|
|
18
|
+
subtitle="This is the first item."
|
|
19
|
+
media={<ListItem.AvatarView />}
|
|
20
|
+
control={<ListItem.Navigation onClick={() => console.log('navigate')} />}
|
|
21
|
+
/>
|
|
22
|
+
<ListItem
|
|
23
|
+
title="Second item"
|
|
24
|
+
subtitle="This is the second item."
|
|
25
|
+
media={<ListItem.AvatarView />}
|
|
26
|
+
control={<ListItem.Navigation onClick={() => console.log('navigate')} />}
|
|
27
|
+
/>
|
|
28
|
+
</List>`,
|
|
29
|
+
scope: { ...globalScope, List },
|
|
30
|
+
});
|
|
31
|
+
|
|
13
32
|
export const Basic: Story = {
|
|
14
33
|
render: (args) => (
|
|
15
34
|
<List {...args}>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
import { MultiCurrency, Plus } from '@transferwise/icons';
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
import { lorem5, lorem10 } from '../../test-utils';
|
|
5
9
|
import Emphasis from '../../emphasis';
|
|
6
10
|
import Link from '../../link';
|
|
@@ -270,6 +274,22 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
|
|
|
270
274
|
decorators: [withoutKey],
|
|
271
275
|
};
|
|
272
276
|
|
|
277
|
+
export const Sandbox = createSandboxStory({
|
|
278
|
+
code: `<List>
|
|
279
|
+
<ListItem
|
|
280
|
+
title="List item title"
|
|
281
|
+
subtitle="Subtitle goes here"
|
|
282
|
+
additionalInfo={<ListItem.AdditionalInfo>Which is augmented with additional info.</ListItem.AdditionalInfo>}
|
|
283
|
+
control={<ListItem.Button onClick={() => {}}>Click me</ListItem.Button>}
|
|
284
|
+
media={<ListItem.AvatarView><Briefcase /></ListItem.AvatarView>}
|
|
285
|
+
prompt={<ListItem.Prompt sentiment="positive">Finally, there is a prompt{' '}<Link href="https://wise.com" rel="noreferrer" target="_blank">referencing some details</Link>{' '}for your convenience.</ListItem.Prompt>}
|
|
286
|
+
valueSubtitle="100 USD"
|
|
287
|
+
valueTitle="100 GBP"
|
|
288
|
+
/>
|
|
289
|
+
</List>`,
|
|
290
|
+
scope: { ...globalScope, List, Link },
|
|
291
|
+
});
|
|
292
|
+
|
|
273
293
|
export const Responsiveness: StoryObj<PreviewStoryArgs> = {
|
|
274
294
|
parameters: {
|
|
275
295
|
docs: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { createSandboxStory } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
2
3
|
|
|
3
4
|
import Loader from './Loader';
|
|
4
5
|
|
|
@@ -24,4 +25,9 @@ export default {
|
|
|
24
25
|
|
|
25
26
|
type Story = StoryObj<typeof Loader>;
|
|
26
27
|
|
|
28
|
+
export const Sandbox = createSandboxStory({
|
|
29
|
+
code: `<Loader size="md" label="Sending your money" />`,
|
|
30
|
+
scope: { Loader },
|
|
31
|
+
});
|
|
32
|
+
|
|
27
33
|
export const Basic: Story = {};
|
package/src/logo/Logo.story.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
|
|
3
3
|
import Logo, { LogoType, LogoDisplay, LogoFormat } from './Logo';
|
|
4
4
|
import type { LogoSize } from './Logo';
|
|
5
|
+
import { createSandboxStory } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
5
6
|
import { withVariantConfig } from '../../.storybook/helpers';
|
|
6
7
|
import Body from '../body';
|
|
7
8
|
|
|
@@ -51,6 +52,11 @@ export const Playground: Story = {
|
|
|
51
52
|
render: (args) => <Logo {...args} />,
|
|
52
53
|
};
|
|
53
54
|
|
|
55
|
+
export const Sandbox = createSandboxStory({
|
|
56
|
+
code: `<Logo type="WISE" format="primary-lockup" size={24} />`,
|
|
57
|
+
scope: { Logo },
|
|
58
|
+
});
|
|
59
|
+
|
|
54
60
|
/**
|
|
55
61
|
* The three logo types: standard Wise, Wise Business, and Wise Platform.
|
|
56
62
|
*/
|
package/src/main.css
CHANGED
|
@@ -31706,8 +31706,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31706
31706
|
gap: 16px;
|
|
31707
31707
|
gap: var(--Prompt-gap, var(--size-16));
|
|
31708
31708
|
word-wrap: break-word;
|
|
31709
|
-
padding: 8px;
|
|
31710
|
-
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
31709
|
+
padding: 8px 8px;
|
|
31710
|
+
padding: var(--Prompt-padding-y, var(--padding-x-small)) var(--Prompt-padding-x, var(--padding-x-small));
|
|
31711
31711
|
text-align: left;
|
|
31712
31712
|
word-break: break-word;
|
|
31713
31713
|
width: 100%;
|
|
@@ -31759,7 +31759,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31759
31759
|
|
|
31760
31760
|
.wds-inline-prompt {
|
|
31761
31761
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
31762
|
-
--Prompt-padding
|
|
31762
|
+
--Prompt-padding-x: var(--padding-x-small);
|
|
31763
|
+
--Prompt-padding-y: calc(var(--padding-x-small) / 2);
|
|
31763
31764
|
display: inline-flex;
|
|
31764
31765
|
border-radius: 10px;
|
|
31765
31766
|
border-radius: var(--radius-small);
|
|
@@ -31829,7 +31830,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31829
31830
|
.wds-info-prompt {
|
|
31830
31831
|
--Prompt-border-radius: var(--radius-medium);
|
|
31831
31832
|
--Prompt-gap: var(--size-8);
|
|
31832
|
-
--Prompt-padding: var(--size-12);
|
|
31833
|
+
--Prompt-padding-x: var(--size-12);
|
|
31834
|
+
--Prompt-padding-y: var(--size-12);
|
|
31833
31835
|
}
|
|
31834
31836
|
|
|
31835
31837
|
.wds-info-prompt__content {
|
|
@@ -31895,7 +31897,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31895
31897
|
}
|
|
31896
31898
|
|
|
31897
31899
|
.wds-action-prompt {
|
|
31898
|
-
--Prompt-padding: var(--size-16);
|
|
31900
|
+
--Prompt-padding-x: var(--size-16);
|
|
31901
|
+
--Prompt-padding-y: var(--size-16);
|
|
31899
31902
|
--Prompt-actions-gap: var(--size-8);
|
|
31900
31903
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31901
31904
|
--Prompt-border-radius: var(--radius-large);
|
|
@@ -31930,11 +31933,13 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31930
31933
|
}
|
|
31931
31934
|
|
|
31932
31935
|
.wds-critical-banner {
|
|
31933
|
-
--Prompt-padding: var(--
|
|
31936
|
+
--Prompt-padding-x: var(--wds-container-padding-inline);
|
|
31937
|
+
--Prompt-padding-y: var(--size-16);
|
|
31934
31938
|
--Prompt-actions-gap: var(--size-8);
|
|
31935
31939
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31936
31940
|
--Prompt-border-radius: 0;
|
|
31937
31941
|
container-type: inline-size;
|
|
31942
|
+
position: relative;
|
|
31938
31943
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
31939
31944
|
--critical-banner-duration: 150ms;
|
|
31940
31945
|
/* Override PrimitivePrompt's --screen-sm-max actions behaviour:
|
|
@@ -32075,6 +32080,53 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32075
32080
|
}
|
|
32076
32081
|
}
|
|
32077
32082
|
|
|
32083
|
+
.wds-critical-banner-overhang-query {
|
|
32084
|
+
container-name: critical-banner-overhang;
|
|
32085
|
+
container-type: inline-size;
|
|
32086
|
+
inline-size: 100%;
|
|
32087
|
+
}
|
|
32088
|
+
|
|
32089
|
+
.wds-critical-banner__entry-mask {
|
|
32090
|
+
display: grid;
|
|
32091
|
+
grid-template-rows: 0fr;
|
|
32092
|
+
overflow: hidden;
|
|
32093
|
+
animation: wds-critical-banner-reveal-height 400ms cubic-bezier(0.3, 0, 0.1, 1) 500ms both;
|
|
32094
|
+
}
|
|
32095
|
+
|
|
32096
|
+
@container critical-banner-overhang (max-width: 600px) {
|
|
32097
|
+
.wds-critical-banner__entry-mask {
|
|
32098
|
+
--critical-banner-mobile-overhang-size: 32px;
|
|
32099
|
+
}
|
|
32100
|
+
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
32101
|
+
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
32102
|
+
}
|
|
32103
|
+
.wds-critical-banner__entry-mask .wds-critical-banner-overhang::after {
|
|
32104
|
+
content: "";
|
|
32105
|
+
position: absolute;
|
|
32106
|
+
right: 0;
|
|
32107
|
+
bottom: calc(-1 * var(--critical-banner-mobile-overhang-size));
|
|
32108
|
+
left: 0;
|
|
32109
|
+
height: var(--critical-banner-mobile-overhang-size);
|
|
32110
|
+
pointer-events: none;
|
|
32111
|
+
background: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat, radial-gradient(circle at 0% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 100% 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
32112
|
+
}
|
|
32113
|
+
}
|
|
32114
|
+
|
|
32115
|
+
.wds-critical-banner__entry-track {
|
|
32116
|
+
min-height: 0;
|
|
32117
|
+
}
|
|
32118
|
+
|
|
32119
|
+
@keyframes wds-critical-banner-reveal-height {
|
|
32120
|
+
from {
|
|
32121
|
+
grid-template-rows: 0fr;
|
|
32122
|
+
overflow: hidden;
|
|
32123
|
+
}
|
|
32124
|
+
to {
|
|
32125
|
+
grid-template-rows: 1fr;
|
|
32126
|
+
overflow: visible;
|
|
32127
|
+
}
|
|
32128
|
+
}
|
|
32129
|
+
|
|
32078
32130
|
@media (prefers-reduced-motion: reduce) {
|
|
32079
32131
|
.wds-critical-banner__description,
|
|
32080
32132
|
.wds-critical-banner__title,
|
|
@@ -32082,6 +32134,11 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32082
32134
|
.wds-critical-banner__toggle {
|
|
32083
32135
|
transition: none !important;
|
|
32084
32136
|
}
|
|
32137
|
+
.wds-critical-banner__entry-mask {
|
|
32138
|
+
animation: none;
|
|
32139
|
+
grid-template-rows: 1fr;
|
|
32140
|
+
overflow: visible;
|
|
32141
|
+
}
|
|
32085
32142
|
}
|
|
32086
32143
|
|
|
32087
32144
|
.wds-expander-toggle {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
import Markdown from './Markdown';
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
|
|
5
9
|
export default {
|
|
6
10
|
component: Markdown,
|
|
@@ -9,6 +13,18 @@ export default {
|
|
|
9
13
|
|
|
10
14
|
type Story = StoryObj<typeof Markdown>;
|
|
11
15
|
|
|
16
|
+
export const Sandbox = createSandboxStory({
|
|
17
|
+
code: `<Markdown>{\`# Heading
|
|
18
|
+
|
|
19
|
+
Some **bold** and *italic* text.
|
|
20
|
+
|
|
21
|
+
1. First item
|
|
22
|
+
2. Second item
|
|
23
|
+
- Nested item
|
|
24
|
+
\`}</Markdown>`,
|
|
25
|
+
scope: globalScope,
|
|
26
|
+
});
|
|
27
|
+
|
|
12
28
|
export const Basic: Story = {
|
|
13
29
|
args: {
|
|
14
30
|
children: `# Heading
|
|
@@ -18,3 +34,4 @@ export const Basic: Story = {
|
|
|
18
34
|
- sublist`,
|
|
19
35
|
},
|
|
20
36
|
};
|
|
37
|
+
|