@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
|
@@ -251,58 +251,6 @@ export const Search: Story = {
|
|
|
251
251
|
},
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
-
export const AutoFocusInModal: Story = {
|
|
255
|
-
parameters: {
|
|
256
|
-
docs: {
|
|
257
|
-
story: {
|
|
258
|
-
inline: false,
|
|
259
|
-
iframeHeight: 500,
|
|
260
|
-
},
|
|
261
|
-
},
|
|
262
|
-
},
|
|
263
|
-
render: function Render() {
|
|
264
|
-
const [open, setOpen] = useState<boolean>(true);
|
|
265
|
-
return (
|
|
266
|
-
<>
|
|
267
|
-
<Button v2 onClick={() => setOpen(true)}>
|
|
268
|
-
Open Modal
|
|
269
|
-
</Button>
|
|
270
|
-
<Modal
|
|
271
|
-
title="Global Search"
|
|
272
|
-
body={
|
|
273
|
-
<Typeahead
|
|
274
|
-
id="typeahead"
|
|
275
|
-
name="search-input"
|
|
276
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
277
|
-
autoFocus
|
|
278
|
-
size="md"
|
|
279
|
-
showSuggestions
|
|
280
|
-
showNewEntry={false}
|
|
281
|
-
addon={<SearchIcon size={24} />}
|
|
282
|
-
options={[
|
|
283
|
-
{ label: 'Option 1' },
|
|
284
|
-
{ label: 'Option 2' },
|
|
285
|
-
{ label: 'Option 3' },
|
|
286
|
-
{ label: 'Option 4' },
|
|
287
|
-
]}
|
|
288
|
-
inputAutoComplete="off"
|
|
289
|
-
onSearch={(search) => {
|
|
290
|
-
console.log(search);
|
|
291
|
-
}}
|
|
292
|
-
onChange={(option) => {}}
|
|
293
|
-
onBlur={() => {}}
|
|
294
|
-
/>
|
|
295
|
-
}
|
|
296
|
-
open={open}
|
|
297
|
-
onClose={() => {
|
|
298
|
-
setOpen(false);
|
|
299
|
-
}}
|
|
300
|
-
/>
|
|
301
|
-
</>
|
|
302
|
-
);
|
|
303
|
-
},
|
|
304
|
-
};
|
|
305
|
-
|
|
306
254
|
export const WithField: Story = {
|
|
307
255
|
args: {
|
|
308
256
|
autoFillOnBlur: undefined,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Search as SearchIcon } from '@transferwise/icons';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import Button from '../button';
|
|
6
|
+
import Modal from '../modal';
|
|
7
|
+
import Typeahead from './Typeahead';
|
|
8
|
+
|
|
9
|
+
// needed for SB to display correct name in the docs
|
|
10
|
+
(Typeahead as React.FC).displayName = 'Typeahead';
|
|
11
|
+
type Story = StoryObj<typeof Typeahead>;
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof Typeahead> = {
|
|
14
|
+
component: Typeahead,
|
|
15
|
+
title: 'Forms/Typeahead/Tests',
|
|
16
|
+
tags: ['!autodocs', '!manifest'],
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
export const AutoFocusInModal: Story = {
|
|
21
|
+
parameters: {
|
|
22
|
+
docs: {
|
|
23
|
+
story: {
|
|
24
|
+
inline: false,
|
|
25
|
+
iframeHeight: 500,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
chromatic: {
|
|
29
|
+
delay: 1000,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
render: function Render(args, { viewMode }) {
|
|
33
|
+
const [open, setOpen] = useState<boolean>(viewMode !== 'docs');
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<Button v2 onClick={() => setOpen(true)}>
|
|
37
|
+
Open Modal
|
|
38
|
+
</Button>
|
|
39
|
+
<Modal
|
|
40
|
+
title="Global Search"
|
|
41
|
+
body={
|
|
42
|
+
<Typeahead
|
|
43
|
+
id="typeahead"
|
|
44
|
+
name="search-input"
|
|
45
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
46
|
+
autoFocus
|
|
47
|
+
size="md"
|
|
48
|
+
showSuggestions
|
|
49
|
+
showNewEntry={false}
|
|
50
|
+
addon={<SearchIcon size={24} />}
|
|
51
|
+
options={[
|
|
52
|
+
{ label: 'Option 1' },
|
|
53
|
+
{ label: 'Option 2' },
|
|
54
|
+
{ label: 'Option 3' },
|
|
55
|
+
{ label: 'Option 4' },
|
|
56
|
+
]}
|
|
57
|
+
inputAutoComplete="off"
|
|
58
|
+
onSearch={(search) => {
|
|
59
|
+
console.log(search);
|
|
60
|
+
}}
|
|
61
|
+
onChange={(option) => {}}
|
|
62
|
+
onBlur={() => {}}
|
|
63
|
+
/>
|
|
64
|
+
}
|
|
65
|
+
open={open}
|
|
66
|
+
onClose={() => {
|
|
67
|
+
setOpen(false);
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
</>
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
};
|