@transferwise/components 0.0.0-experimental-09066ec → 0.0.0-experimental-148ffef
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/common/liveRegion/LiveRegion.js +44 -7
- package/build/common/liveRegion/LiveRegion.js.map +1 -1
- package/build/common/liveRegion/LiveRegion.mjs +44 -7
- package/build/common/liveRegion/LiveRegion.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +1 -0
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +1 -0
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +1 -0
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +1 -0
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js +2 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +2 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/types/common/liveRegion/LiveRegion.d.ts +5 -2
- package/build/types/common/liveRegion/LiveRegion.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/{DisabledComponents.story.tsx → DisabledComponents.test.story.tsx} +1 -1
- package/src/actionButton/ActionButton.story.tsx +11 -7
- package/src/actionButton/ActionButton.test.story.tsx +49 -0
- package/src/avatarLayout/AvatarLayout.story.tsx +1 -105
- package/src/avatarLayout/AvatarLayout.test.story.tsx +117 -0
- package/src/avatarView/AvatarView.story.tsx +1 -104
- package/src/avatarView/AvatarView.test.story.tsx +114 -0
- package/src/button/LegacyButton.story.tsx +1 -26
- package/src/button/LegacyButton.test.story.tsx +37 -0
- package/src/button/_stories/Button.story.tsx +17 -41
- package/src/button/_stories/Button.test.story.tsx +30 -0
- package/src/checkbox/Checkbox.story.tsx +1 -6
- package/src/checkbox/Checkbox.test.story.tsx +33 -0
- package/src/circularButton/CircularButton.story.tsx +0 -6
- package/src/circularButton/CircularButton.test.story.tsx +62 -1
- package/src/common/bottomSheet/BottomSheet.story.tsx +0 -55
- package/src/common/bottomSheet/BottomSheet.test.story.tsx +118 -2
- package/src/common/liveRegion/LiveRegion.test.tsx +69 -2
- package/src/common/liveRegion/LiveRegion.tsx +75 -8
- package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +1 -1
- package/src/dateLookup/DateLookup.story.tsx +0 -18
- package/src/dateLookup/DateLookup.test.story.tsx +51 -1
- package/src/divider/Divider.story.tsx +0 -1
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.autofocus.docs.mdx +1 -1
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +0 -9
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.test.story.tsx +23 -0
- package/src/field/Field.story.tsx +1 -34
- package/src/field/Field.test.story.tsx +56 -0
- package/src/header/Header.test.story.tsx +1 -1
- package/src/info/Info.story.tsx +1 -34
- package/src/info/Info.test.story.tsx +53 -0
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +0 -12
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.test.story.tsx +33 -0
- package/src/legacylistItem/LegacyListItem.test.story.tsx +1 -1
- package/src/listItem/_stories/Breakpoints/ListItem.noMedia.test.story.tsx +1 -1
- package/src/listItem/_stories/Breakpoints/ListItem.sideMedia.test.story.tsx +1 -1
- package/src/listItem/_stories/Breakpoints/ListItem.stackedMedia.test.story.tsx +1 -1
- package/src/listItem/_stories/ListItem.focus.test.story.tsx +1 -1
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.medium.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.neutral.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.personal.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +1 -1
- package/src/listItem/_stories/variants/ListItem.small.test.story.tsx +1 -1
- package/src/logo/Logo.story.tsx +0 -6
- package/src/logo/Logo.test.story.tsx +20 -0
- package/src/modal/Modal.story.tsx +0 -26
- package/src/modal/Modal.test.story.tsx +125 -0
- package/src/moneyInput/MoneyInput.test.story.tsx +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +0 -43
- package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +45 -1
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +142 -5
- package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +11 -6
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +2 -1
- package/src/radioGroup/RadioGroup.test.story.tsx +1 -1
- package/src/stepper/Stepper.test.story.tsx +1 -1
- package/src/summary/Summary.test.story.tsx +1 -1
- package/src/tooltip/Tooltip.story.tsx +0 -21
- package/src/tooltip/Tooltip.test.story.tsx +42 -0
- package/src/typeahead/Typeahead.story.tsx +0 -52
- package/src/typeahead/Typeahead.test.story.tsx +73 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { StoryFn } from '@storybook/react-webpack5';
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { expect, userEvent, within } from 'storybook/test';
|
|
3
3
|
import { action } from 'storybook/actions';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
|
|
6
6
|
import DateLookup, { type DateLookupProps } from './DateLookup';
|
|
7
|
+
import { Size } from '../common';
|
|
8
|
+
import { withVariantConfig } from '../../.storybook/helpers';
|
|
7
9
|
|
|
8
10
|
export default {
|
|
9
11
|
component: DateLookup,
|
|
@@ -99,3 +101,51 @@ FocusOnFirstNonDisabledDate.play = async () => {
|
|
|
99
101
|
await userEvent.tab();
|
|
100
102
|
await userEvent.keyboard(' ');
|
|
101
103
|
};
|
|
104
|
+
|
|
105
|
+
const epoch = new Date('2011-01-01');
|
|
106
|
+
const theFuture = new Date(epoch);
|
|
107
|
+
theFuture.setUTCDate(epoch.getUTCDate() + 10);
|
|
108
|
+
const thePast = new Date(epoch);
|
|
109
|
+
thePast.setUTCDate(epoch.getUTCDate() - 10);
|
|
110
|
+
|
|
111
|
+
const Basic: StoryObj<typeof DateLookup> = {
|
|
112
|
+
render: (args: DateLookupProps) => {
|
|
113
|
+
const [value, setValue] = useState<Date | null>(epoch);
|
|
114
|
+
return (
|
|
115
|
+
<DateLookup
|
|
116
|
+
{...args}
|
|
117
|
+
min={args.min ? new Date(args.min) : thePast}
|
|
118
|
+
max={args.max ? new Date(args.max) : theFuture}
|
|
119
|
+
value={value}
|
|
120
|
+
onChange={(v) => setValue(v)}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
args: {
|
|
125
|
+
size: Size.MEDIUM,
|
|
126
|
+
disabled: false,
|
|
127
|
+
label: 'label',
|
|
128
|
+
monthFormat: 'long',
|
|
129
|
+
placeholder: 'placeholder',
|
|
130
|
+
id: 'date-lookup',
|
|
131
|
+
clearable: true,
|
|
132
|
+
min: thePast,
|
|
133
|
+
max: theFuture,
|
|
134
|
+
},
|
|
135
|
+
play: async () => {
|
|
136
|
+
await userEvent.tab();
|
|
137
|
+
await userEvent.keyboard(' ');
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Basic400Zoom: StoryObj<typeof DateLookup> = {
|
|
142
|
+
...Basic,
|
|
143
|
+
...withVariantConfig(['400%'], {
|
|
144
|
+
...Basic,
|
|
145
|
+
parameters: {
|
|
146
|
+
chromatic: {
|
|
147
|
+
delay: 2000,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
}),
|
|
151
|
+
};
|
|
@@ -221,12 +221,3 @@ export const WithCustomCurrencySelector = {
|
|
|
221
221
|
);
|
|
222
222
|
},
|
|
223
223
|
};
|
|
224
|
-
|
|
225
|
-
export const WithAutofocus = {
|
|
226
|
-
tags: ['!autodocs', '!dev'],
|
|
227
|
-
args: {
|
|
228
|
-
inlinePrompt: undefined,
|
|
229
|
-
autoFocus: true,
|
|
230
|
-
},
|
|
231
|
-
render: (args: ExpressiveMoneyInputProps) => <ExpressiveMoneyInput {...args} />,
|
|
232
|
-
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import ExpressiveMoneyInput, { Props as ExpressiveMoneyInputProps } from './ExpressiveMoneyInput';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ExpressiveMoneyInput> = {
|
|
5
|
+
component: ExpressiveMoneyInput,
|
|
6
|
+
tags: ['!autodocs', '!manifest'],
|
|
7
|
+
title: 'Forms/ExpressiveMoneyInput/Tests',
|
|
8
|
+
args: {
|
|
9
|
+
label: 'You send',
|
|
10
|
+
currency: 'GBP',
|
|
11
|
+
amount: 1234.56,
|
|
12
|
+
currencySelector: undefined,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<ExpressiveMoneyInputProps>;
|
|
18
|
+
|
|
19
|
+
export const WithAutofocus: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
autoFocus: true,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -102,7 +102,7 @@ export const Basic = (args: FieldProps) => {
|
|
|
102
102
|
);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
export const
|
|
105
|
+
export const Messages = (args: FieldProps) => {
|
|
106
106
|
const [value, setValue] = useState<string | undefined>('This is some text');
|
|
107
107
|
return (
|
|
108
108
|
<div>
|
|
@@ -145,39 +145,6 @@ export const WithStatusMessages = (args: FieldProps) => {
|
|
|
145
145
|
>
|
|
146
146
|
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
147
147
|
</Field>
|
|
148
|
-
|
|
149
|
-
{/* instance with deprecated `hint` prop */}
|
|
150
|
-
<Field
|
|
151
|
-
label="Text Input with deprecated `hint` prop"
|
|
152
|
-
hint="This is a helpful message"
|
|
153
|
-
sentiment={Sentiment.NEGATIVE}
|
|
154
|
-
message="Validation error, please take a look"
|
|
155
|
-
messageIconLabel={args.messageIconLabel}
|
|
156
|
-
messageLoading={args.messageLoading}
|
|
157
|
-
>
|
|
158
|
-
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
159
|
-
</Field>
|
|
160
|
-
|
|
161
|
-
{/* instance with deprecated `error` & `hint` props */}
|
|
162
|
-
<Field
|
|
163
|
-
label="Text Input with deprecated `error` & `hint` props"
|
|
164
|
-
hint="This is a helpful message"
|
|
165
|
-
error="Validation error, please take a look"
|
|
166
|
-
messageIconLabel={args.messageIconLabel}
|
|
167
|
-
messageLoading={args.messageLoading}
|
|
168
|
-
>
|
|
169
|
-
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
170
|
-
</Field>
|
|
171
|
-
|
|
172
|
-
{/* instance of info via `message` property, this is rare case (e.g MoneyInput) */}
|
|
173
|
-
<Field
|
|
174
|
-
label="Text Input with Info under the field"
|
|
175
|
-
message="This is a helpful message"
|
|
176
|
-
messageIconLabel={args.messageIconLabel}
|
|
177
|
-
messageLoading={args.messageLoading}
|
|
178
|
-
>
|
|
179
|
-
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
180
|
-
</Field>
|
|
181
148
|
</div>
|
|
182
149
|
);
|
|
183
150
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
import { Input } from '../inputs/Input';
|
|
4
|
+
import { Field, FieldProps } from './Field';
|
|
5
|
+
import { Sentiment } from '../common';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Field> = {
|
|
8
|
+
component: Field,
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
|
+
title: 'Forms/Field/Tests',
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof Field>;
|
|
15
|
+
|
|
16
|
+
export const DeprecatedProps: Story = {
|
|
17
|
+
render: (args: FieldProps) => {
|
|
18
|
+
const [value, setValue] = useState<string | undefined>('This is some text');
|
|
19
|
+
return (
|
|
20
|
+
<div>
|
|
21
|
+
{/* instance with deprecated `hint` prop */}
|
|
22
|
+
<Field
|
|
23
|
+
label="Text Input with deprecated `hint` prop"
|
|
24
|
+
hint="This is a helpful message"
|
|
25
|
+
sentiment={Sentiment.NEGATIVE}
|
|
26
|
+
message="Validation error, please take a look"
|
|
27
|
+
messageIconLabel={args.messageIconLabel}
|
|
28
|
+
messageLoading={args.messageLoading}
|
|
29
|
+
>
|
|
30
|
+
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
31
|
+
</Field>
|
|
32
|
+
|
|
33
|
+
{/* instance with deprecated `error` & `hint` props */}
|
|
34
|
+
<Field
|
|
35
|
+
label="Text Input with deprecated `error` & `hint` props"
|
|
36
|
+
hint="This is a helpful message"
|
|
37
|
+
error="Validation error, please take a look"
|
|
38
|
+
messageIconLabel={args.messageIconLabel}
|
|
39
|
+
messageLoading={args.messageLoading}
|
|
40
|
+
>
|
|
41
|
+
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
42
|
+
</Field>
|
|
43
|
+
|
|
44
|
+
{/* instance of info via `message` property, this is rare case (e.g MoneyInput) */}
|
|
45
|
+
<Field
|
|
46
|
+
label="Text Input with Info under the field"
|
|
47
|
+
message="This is a helpful message"
|
|
48
|
+
messageIconLabel={args.messageIconLabel}
|
|
49
|
+
messageLoading={args.messageLoading}
|
|
50
|
+
>
|
|
51
|
+
<Input value={value} onChange={({ target }) => setValue(target.value)} />
|
|
52
|
+
</Field>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -5,7 +5,7 @@ import { withVariantConfig } from '../../.storybook/helpers';
|
|
|
5
5
|
const meta: Meta<typeof Header> = {
|
|
6
6
|
component: Header,
|
|
7
7
|
tags: ['!autodocs', '!manifest'],
|
|
8
|
-
title: 'Typography/Header/
|
|
8
|
+
title: 'Typography/Header/Tests',
|
|
9
9
|
};
|
|
10
10
|
export default meta;
|
|
11
11
|
type Story = StoryObj<HeaderProps>;
|
package/src/info/Info.story.tsx
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { userEvent, within } from 'storybook/test';
|
|
3
|
-
|
|
4
2
|
import { lorem10 } from '../test-utils';
|
|
5
|
-
|
|
6
|
-
import Info, { InfoPresentation } from '.';
|
|
3
|
+
import Info from '.';
|
|
7
4
|
import { withVariantConfig } from '../../.storybook/helpers';
|
|
8
5
|
|
|
9
6
|
const meta = {
|
|
@@ -14,7 +11,6 @@ const meta = {
|
|
|
14
11
|
title: 'Fast transfer hint',
|
|
15
12
|
content: lorem10,
|
|
16
13
|
},
|
|
17
|
-
|
|
18
14
|
render: (args) => (
|
|
19
15
|
<p>
|
|
20
16
|
<span>Fast transfer</span> <Info {...args} />
|
|
@@ -29,32 +25,3 @@ type Story = StoryObj<typeof meta>;
|
|
|
29
25
|
export const Basic: Story = {
|
|
30
26
|
...withVariantConfig(['default', 'dark', 'rtl']),
|
|
31
27
|
};
|
|
32
|
-
|
|
33
|
-
export const OpenedPopover = {
|
|
34
|
-
parameters: {
|
|
35
|
-
chromatic: {
|
|
36
|
-
delay: 1000,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
play: async ({ canvasElement }) => {
|
|
40
|
-
const canvas = within(canvasElement);
|
|
41
|
-
await userEvent.click(canvas.getByRole('button'));
|
|
42
|
-
},
|
|
43
|
-
} satisfies Story;
|
|
44
|
-
|
|
45
|
-
export const OpenedPopoverMobile: Story = {
|
|
46
|
-
...OpenedPopover,
|
|
47
|
-
...withVariantConfig(['mobile'], OpenedPopover),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const OpenedModal = {
|
|
51
|
-
...OpenedPopover,
|
|
52
|
-
args: {
|
|
53
|
-
presentation: InfoPresentation.MODAL,
|
|
54
|
-
},
|
|
55
|
-
} satisfies Story;
|
|
56
|
-
|
|
57
|
-
export const OpenedModalMobile: Story = {
|
|
58
|
-
...OpenedModal,
|
|
59
|
-
...withVariantConfig(['mobile'], OpenedModal),
|
|
60
|
-
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { userEvent, within } from 'storybook/test';
|
|
3
|
+
import { lorem10 } from '../test-utils';
|
|
4
|
+
import Info, { InfoPresentation } from '.';
|
|
5
|
+
import { withVariantConfig } from '../../.storybook/helpers';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Info> = {
|
|
8
|
+
component: Info,
|
|
9
|
+
tags: ['!autodocs', '!manifest'],
|
|
10
|
+
title: 'Dialogs/Info/Tests',
|
|
11
|
+
args: {
|
|
12
|
+
'aria-label': 'Click here for more details',
|
|
13
|
+
title: 'Fast transfer hint',
|
|
14
|
+
content: lorem10,
|
|
15
|
+
},
|
|
16
|
+
render: (args) => (
|
|
17
|
+
<p>
|
|
18
|
+
<span>Fast transfer</span> <Info {...args} />
|
|
19
|
+
</p>
|
|
20
|
+
),
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
export const OpenedPopover: Story = {
|
|
27
|
+
parameters: {
|
|
28
|
+
chromatic: {
|
|
29
|
+
delay: 1000,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
play: async ({ canvasElement }) => {
|
|
33
|
+
const canvas = within(canvasElement);
|
|
34
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const OpenedPopoverMobile: Story = {
|
|
39
|
+
...OpenedPopover,
|
|
40
|
+
...withVariantConfig(['mobile'], OpenedPopover),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const OpenedModal: Story = {
|
|
44
|
+
...OpenedPopover,
|
|
45
|
+
args: {
|
|
46
|
+
presentation: InfoPresentation.MODAL,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const OpenedModalMobile: Story = {
|
|
51
|
+
...OpenedModal,
|
|
52
|
+
...withVariantConfig(['mobile'], OpenedModal),
|
|
53
|
+
};
|
|
@@ -65,15 +65,3 @@ export const SecurityPin: Story = {
|
|
|
65
65
|
displayPattern: '*-*-*-*-*-*',
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
export const SecurityPinPlay: Story = {
|
|
70
|
-
args: {
|
|
71
|
-
label: 'Security Pin Play',
|
|
72
|
-
placeholder: '*-*-*-*-*-*',
|
|
73
|
-
displayPattern: '*-*-*-*-*-*',
|
|
74
|
-
},
|
|
75
|
-
play: async ({ canvasElement }) => {
|
|
76
|
-
const canvas = within(canvasElement);
|
|
77
|
-
await userEvent.type(canvas.getByPlaceholderText('*-*-*-*-*-*'), '123456');
|
|
78
|
-
},
|
|
79
|
-
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { userEvent, within } from 'storybook/test';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
|
|
4
|
+
import InputWithDisplayFormat, { InputWithDisplayFormatProps } from '.';
|
|
5
|
+
import { Field, FieldProps } from '../field/Field';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof InputWithDisplayFormat> = {
|
|
8
|
+
title: 'Forms/InputWithDisplayFormat/Tests',
|
|
9
|
+
component: InputWithDisplayFormat,
|
|
10
|
+
tags: ['!autodocs', '!manifest'],
|
|
11
|
+
render: function Render({ label, ...args }: InputWithDisplayFormatProps & FieldProps) {
|
|
12
|
+
return (
|
|
13
|
+
<Field label={label} id={args.id}>
|
|
14
|
+
<InputWithDisplayFormat id={args.id} {...args} />
|
|
15
|
+
</Field>
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<InputWithDisplayFormatProps & { label: string }>;
|
|
22
|
+
|
|
23
|
+
export const SecurityPinPlay: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
label: 'Security Pin Play',
|
|
26
|
+
placeholder: '*-*-*-*-*-*',
|
|
27
|
+
displayPattern: '*-*-*-*-*-*',
|
|
28
|
+
},
|
|
29
|
+
play: async ({ canvasElement }) => {
|
|
30
|
+
const canvas = within(canvasElement);
|
|
31
|
+
await userEvent.type(canvas.getByPlaceholderText('*-*-*-*-*-*'), '123456');
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
component: ListItem,
|
|
14
|
-
title: 'Content/ListItem/
|
|
14
|
+
title: 'Content/ListItem/Tests/Breakpoints/StackedMedia',
|
|
15
15
|
tags: ['!autodocs', '!manifest'],
|
|
16
16
|
parameters: {
|
|
17
17
|
controls: { disable: true },
|
|
@@ -20,7 +20,7 @@ const waitForListItem = async (canvas: ReturnType<typeof within>, timeout = 3000
|
|
|
20
20
|
|
|
21
21
|
export default {
|
|
22
22
|
component: ListItem,
|
|
23
|
-
title: 'Content/ListItem/
|
|
23
|
+
title: 'Content/ListItem/Tests/focus',
|
|
24
24
|
tags: ['!autodocs', '!manifest'],
|
|
25
25
|
parameters: {
|
|
26
26
|
controls: { disable: true },
|
|
@@ -11,7 +11,7 @@ import { withSizedContainer } from './helpers';
|
|
|
11
11
|
import { LISTITEM_CQ } from '../constants';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
title: 'Content/ListItem/
|
|
14
|
+
title: 'Content/ListItem/Tests/layout',
|
|
15
15
|
tags: ['!autodocs', '!manifest'],
|
|
16
16
|
parameters: {
|
|
17
17
|
controls: { disable: true },
|
|
@@ -5,7 +5,7 @@ import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/
|
|
8
|
+
title: 'Content/ListItem/Tests/variants/theme: bright-green',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
@@ -5,7 +5,7 @@ import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/
|
|
8
|
+
title: 'Content/ListItem/Tests/variants/theme: dark',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
@@ -5,7 +5,7 @@ import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/
|
|
8
|
+
title: 'Content/ListItem/Tests/variants/theme: forest-green',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
@@ -5,7 +5,7 @@ import { withSizedContainer } from '../helpers';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/
|
|
8
|
+
title: 'Content/ListItem/Tests/variants/cq: medium',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
13
|
component: ListItem,
|
|
14
|
-
title: 'Content/ListItem/
|
|
14
|
+
title: 'Content/ListItem/Tests/variants/surface: neutral',
|
|
15
15
|
tags: ['!autodocs', '!manifest'],
|
|
16
16
|
parameters: {
|
|
17
17
|
controls: { disable: true },
|
|
@@ -10,7 +10,7 @@ import { VariantStory } from './helpers';
|
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
component: ListItem,
|
|
13
|
-
title: 'Content/ListItem/
|
|
13
|
+
title: 'Content/ListItem/Tests/variants/theme: personal',
|
|
14
14
|
tags: ['!autodocs', '!manifest'],
|
|
15
15
|
parameters: {
|
|
16
16
|
controls: { disable: true },
|
|
@@ -5,7 +5,7 @@ import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/
|
|
8
|
+
title: 'Content/ListItem/Tests/variants/rtl',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
|
@@ -5,7 +5,7 @@ import { withSizedContainer } from '../helpers';
|
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
8
|
-
title: 'Content/ListItem/
|
|
8
|
+
title: 'Content/ListItem/Tests/variants/cq: small',
|
|
9
9
|
tags: ['!autodocs', '!manifest'],
|
|
10
10
|
parameters: {
|
|
11
11
|
controls: { disable: true },
|
package/src/logo/Logo.story.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
import Logo, { LogoType } from '.';
|
|
4
|
-
import { withVariantConfig } from '../../.storybook/helpers';
|
|
5
4
|
|
|
6
5
|
export default {
|
|
7
6
|
component: Logo,
|
|
@@ -36,8 +35,3 @@ export const Basic: Story = {
|
|
|
36
35
|
inverse: false,
|
|
37
36
|
},
|
|
38
37
|
};
|
|
39
|
-
|
|
40
|
-
export const Mobile: Story = {
|
|
41
|
-
...Basic,
|
|
42
|
-
...withVariantConfig(['mobile']),
|
|
43
|
-
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import Logo from '.';
|
|
3
|
+
import { withVariantConfig } from '../../.storybook/helpers';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Logo> = {
|
|
6
|
+
component: Logo,
|
|
7
|
+
tags: ['!autodocs', '!manifest'],
|
|
8
|
+
title: 'Content/Logo/Tests',
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof Logo>;
|
|
13
|
+
|
|
14
|
+
export const Mobile: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
type: 'WISE',
|
|
17
|
+
inverse: false,
|
|
18
|
+
},
|
|
19
|
+
...withVariantConfig(['mobile']),
|
|
20
|
+
};
|
|
@@ -6,7 +6,6 @@ import { useState } from 'react';
|
|
|
6
6
|
import { Button, Modal, ModalProps } from '..';
|
|
7
7
|
import { CommonProps, Scroll } from '../common';
|
|
8
8
|
import { lorem10, lorem100, lorem1000 } from '../test-utils';
|
|
9
|
-
import { withVariantConfig } from '../../.storybook/helpers';
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
11
|
component: Modal,
|
|
@@ -76,11 +75,6 @@ export const Basic: Story = {
|
|
|
76
75
|
render: (args, context) => <StoryContent args={args} viewMode={context.viewMode} />,
|
|
77
76
|
};
|
|
78
77
|
|
|
79
|
-
export const BasicMobile: Story = {
|
|
80
|
-
...Basic,
|
|
81
|
-
...withVariantConfig(['mobile'], Basic),
|
|
82
|
-
};
|
|
83
|
-
|
|
84
78
|
export const ContentScroll: Story = {
|
|
85
79
|
args: {
|
|
86
80
|
title: lorem10,
|
|
@@ -90,11 +84,6 @@ export const ContentScroll: Story = {
|
|
|
90
84
|
render: (args, context) => <StoryContent args={args} viewMode={context.viewMode} />,
|
|
91
85
|
};
|
|
92
86
|
|
|
93
|
-
export const ContentScrollMobile: Story = {
|
|
94
|
-
...ContentScroll,
|
|
95
|
-
...withVariantConfig(['mobile'], ContentScroll),
|
|
96
|
-
};
|
|
97
|
-
|
|
98
87
|
export const ViewportScroll: Story = {
|
|
99
88
|
args: {
|
|
100
89
|
title: lorem10,
|
|
@@ -104,11 +93,6 @@ export const ViewportScroll: Story = {
|
|
|
104
93
|
render: (args, context) => <StoryContent args={args} viewMode={context.viewMode} />,
|
|
105
94
|
};
|
|
106
95
|
|
|
107
|
-
export const ViewportScrollMobile: Story = {
|
|
108
|
-
...ViewportScroll,
|
|
109
|
-
...withVariantConfig(['mobile'], ViewportScroll),
|
|
110
|
-
};
|
|
111
|
-
|
|
112
96
|
export const WithoutTitle: Story = {
|
|
113
97
|
args: {
|
|
114
98
|
body: lorem1000,
|
|
@@ -117,11 +101,6 @@ export const WithoutTitle: Story = {
|
|
|
117
101
|
render: (args, context) => <StoryContent args={args} viewMode={context.viewMode} />,
|
|
118
102
|
};
|
|
119
103
|
|
|
120
|
-
export const WithoutTitleMobile: Story = {
|
|
121
|
-
...WithoutTitle,
|
|
122
|
-
...withVariantConfig(['mobile'], WithoutTitle),
|
|
123
|
-
};
|
|
124
|
-
|
|
125
104
|
export const WithThemeProviderInContent: Story = {
|
|
126
105
|
args: {
|
|
127
106
|
title: lorem10,
|
|
@@ -138,8 +117,3 @@ export const WithThemeProviderInContent: Story = {
|
|
|
138
117
|
<StoryContent args={args} screenMode={screenMode} viewMode={viewMode} />
|
|
139
118
|
),
|
|
140
119
|
};
|
|
141
|
-
|
|
142
|
-
export const WithThemeProviderInContentMobile: Story = {
|
|
143
|
-
...WithThemeProviderInContent,
|
|
144
|
-
...withVariantConfig(['mobile'], WithThemeProviderInContent),
|
|
145
|
-
};
|