@transferwise/components 46.9.0 → 46.10.0
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/index.esm.js +26 -55
- package/build/index.esm.js.map +1 -1
- package/build/index.js +26 -55
- package/build/index.js.map +1 -1
- package/build/types/common/index.d.ts +0 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +2 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/package.json +14 -17
- package/src/button/Button.story.tsx +3 -3
- package/src/common/fakeEvents.js +2 -2
- package/src/common/index.js +0 -1
- package/src/dateInput/DateInput.story.tsx +4 -3
- package/src/dateLookup/DateLookup.js +6 -7
- package/src/dateLookup/DateLookup.keyboardEvents.spec.js +24 -25
- package/src/dateLookup/DateLookup.story.js +4 -3
- package/src/dateLookup/dateTrigger/DateTrigger.spec.js +3 -3
- package/src/info/Info.story.tsx +3 -3
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +2 -7
- package/src/inputs/SelectInput.spec.tsx +7 -0
- package/src/inputs/SelectInput.story.tsx +7 -7
- package/src/inputs/SelectInput.tsx +4 -0
- package/src/logo/Logo.js +4 -4
- package/src/moneyInput/MoneyInput.story.tsx +3 -3
- package/src/moneyInput/MoneyInput.tsx +14 -24
- package/src/select/Select.js +8 -9
- package/src/snackbar/Snackbar.story.tsx +3 -3
- package/src/switch/Switch.spec.js +2 -3
- package/src/switch/Switch.tsx +1 -2
- package/src/switchOption/SwitchOption.spec.js +1 -4
- package/src/tabs/Tabs.js +1 -2
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +5 -4
- package/src/tile/Tile.js +2 -2
- package/src/tile/Tile.spec.js +5 -5
- package/src/tooltip/Tooltip.story.tsx +3 -3
- package/src/typeahead/Typeahead.js +5 -6
- package/src/typeahead/Typeahead.spec.js +3 -8
- package/src/typeahead/Typeahead.story.js +3 -4
- package/build/types/common/key.d.ts +0 -9
- package/build/types/common/key.d.ts.map +0 -1
- package/build/types/common/keyCodes.d.ts +0 -16
- package/build/types/common/keyCodes.d.ts.map +0 -1
- package/src/common/key.js +0 -8
- package/src/common/keyCodes.js +0 -19
|
@@ -22,6 +22,5 @@ export { Sentiment } from "./propsValues/sentiment";
|
|
|
22
22
|
export { Variant } from "./propsValues/variant";
|
|
23
23
|
export { MarkdownNodeType } from "./propsValues/markdownNodeType";
|
|
24
24
|
export { FileType } from "./fileType";
|
|
25
|
-
export { Key } from "./key";
|
|
26
25
|
export { addNoScrollClass, removeNoScrollClass } from "./DOMOperations";
|
|
27
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateLookup.d.ts","sourceRoot":"","sources":["../../../src/dateLookup/DateLookup.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DateLookup.d.ts","sourceRoot":"","sources":["../../../src/dateLookup/DateLookup.js"],"names":[],"mappings":";AAoBA;IAoBE;;;;;;aAqBC;IApCD,wBAaC;IAjBD,wCAAsB;IAEtB,yCAAuB;IAIrB;;;;;;;;;;MAUC;IA0BH,6CAMC;IAFC,uCAAyE;IAI3E,6BAGC;IAED,iBAOE;IAEF,oBAME;IAEF,kBAME;IAEF,oCA6CE;IAEF,wEAmBE;IAEF,+DAOE;IAEF,gCAIE;IAEF,yBAA+C;IAE/C,2BAAmD;IAEnD,0BAAiD;IAEjD,sDAME;IAEF;;;eAEE;IAEF,+CA8BE;IAEF,wBAGE;IAEF,sCA0BC;CACF"}
|
|
@@ -16,6 +16,7 @@ export interface SelectInputSeparatorItem {
|
|
|
16
16
|
}
|
|
17
17
|
export type SelectInputItem<T = string> = SelectInputOptionItem<T> | SelectInputGroupItem<T> | SelectInputSeparatorItem;
|
|
18
18
|
export interface SelectInputProps<T = string, M extends boolean = false> {
|
|
19
|
+
id?: string;
|
|
19
20
|
name?: string;
|
|
20
21
|
multiple?: M;
|
|
21
22
|
placeholder?: string;
|
|
@@ -48,7 +49,7 @@ export interface SelectInputProps<T = string, M extends boolean = false> {
|
|
|
48
49
|
onChange?: (value: M extends true ? T[] : T) => void;
|
|
49
50
|
onClear?: () => void;
|
|
50
51
|
}
|
|
51
|
-
export declare function SelectInput<T = string, M extends boolean = false>({ name, multiple, placeholder, items, defaultValue, value: controlledValue, compareValues, renderValue, renderFooter, renderTrigger, filterable, filterPlaceholder, disabled, size, className, onFilterChange, onChange, onClear, }: SelectInputProps<T, M>): import("react").JSX.Element;
|
|
52
|
+
export declare function SelectInput<T = string, M extends boolean = false>({ id, name, multiple, placeholder, items, defaultValue, value: controlledValue, compareValues, renderValue, renderFooter, renderTrigger, filterable, filterPlaceholder, disabled, size, className, onFilterChange, onChange, onClear, }: SelectInputProps<T, M>): import("react").JSX.Element;
|
|
52
53
|
type SelectInputTriggerButtonElementType = 'button' | React.ComponentType;
|
|
53
54
|
export type SelectInputTriggerButtonProps<T extends SelectInputTriggerButtonElementType = 'button'> = Merge<React.ComponentPropsWithoutRef<T>, {
|
|
54
55
|
as?: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAoCjC,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,E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,aAAa,EACb,WAAoB,EACpB,YAAY,EACZ,aAAoC,EACpC,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,IAAW,EACX,SAAS,EACT,cAAqB,EACrB,QAAQ,EACR,OAAO,GACR,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,+BA+HxB;AAED,KAAK,mCAAmC,GAAG,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC;AAE1E,MAAM,MAAM,6BAA6B,CACvC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,IACtD,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEzD,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,EAAE,EACjG,EAAkB,EAClB,GAAG,SAAS,EACb,EAAE,6BAA6B,CAAC,CAAC,CAAC,+BAalC;AAwTD,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE,6BAA6B,+BAiD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAc,qBAAqB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAc,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAG/D,OAAO,EAAQ,SAAS,EAAE,UAAU,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EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;;;;AAqYD,wBAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.js"],"names":[],"mappings":"AA6EA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;gCAkeC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwB,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/switch/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwB,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,KAAK,KAAK,GAAG,WAAW,GAAG;IACzB,0HAA0H;IAC1H,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,QAAA,MAAM,MAAM,UAAW,KAAK,KAAG,YAgE9B,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/Tabs.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/Tabs.js"],"names":[],"mappings":";AA4BA;IAIE,wBAcC;IAjBD,wCAAwC;IACxC,oBADW,UAAU,cAAc,CAAC,CACH;IAI/B;;;;;;;;;;;MAWC;IAGH,gBAAiB;IAEjB,uBAAmB;IAEnB,eAAa;IAEb,8BAEC;IAED,wBAEC;IAED,0BASC;IAED,iEAiCC;IAED,6BAIC;IAED,yBAME;IAEF,6CAGE;IAEF,uCAQE;IAEF,mCAIE;IAEF,2BAME;IAEF,yDAKE;IAEF,wBAeE;IAEF,8BAWE;IAMF,6DA4BE;IAEF,wDAAoF;IAEpF;;;;;yBAkBE;IAEF,gCAGE;IAEF,mDAEC;IAED,iDAIE;IAEF,kCAME;IAGF,sDAYE;IAEF,oCAME;IAEF,2CAEE;IAEF,gDAIE;IAEF,uCAYE;IAEF,sCAiDE;IAEF,qCAoCE;IAEF,sCAiKC;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;;;;;EAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../../src/typeahead/Typeahead.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Typeahead.d.ts","sourceRoot":"","sources":["../../../src/typeahead/Typeahead.js"],"names":[],"mappings":"AAyBA;IACE,wBAWC;IARC,2BAAqE;IAErE;;;;;MAKC;IAGH,uDAeC;IAED,6BAEC;IAED,0BAOE;IAEF,kDAGE;IAEF,qCAoBE;IAEF,oCAiBE;IAEF,sCAmCE;IAEF,qCAYC;IAED,gCAiBE;IAEF,sCAME;IAEF,mCASE;IAEF,gCAgBE;IAEF,qBAWE;IAEF,qBAWE;IAEF,6CAOE;IAEF,4BASE;IAEF,kCAME;IAEF,mEAcE;IAEF;;;;;;;;;sCA0CE;IAEF,sCAmGC;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqEe,0CAAU;;;;;;;;;;AAle1B,gCAAyB;AADzB,0CAAmC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.10.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,25 +28,22 @@
|
|
|
28
28
|
"@babel/preset-typescript": "^7.22.15",
|
|
29
29
|
"@formatjs/cli": "^4.8.3",
|
|
30
30
|
"@rollup/plugin-babel": "^6.0.3",
|
|
31
|
-
"@rollup/plugin-image": "^3.0.2",
|
|
32
31
|
"@rollup/plugin-json": "^6.0.0",
|
|
33
32
|
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
34
33
|
"@rollup/plugin-typescript": "^11.1.3",
|
|
35
|
-
"@
|
|
36
|
-
"@storybook/addon-
|
|
37
|
-
"@storybook/addon-
|
|
38
|
-
"@storybook/addon-
|
|
34
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
35
|
+
"@storybook/addon-a11y": "^7.6.17",
|
|
36
|
+
"@storybook/addon-actions": "^7.6.17",
|
|
37
|
+
"@storybook/addon-essentials": "^7.6.17",
|
|
38
|
+
"@storybook/addon-interactions": "^7.6.17",
|
|
39
39
|
"@storybook/addon-knobs": "^7.0.2",
|
|
40
|
-
"@storybook/addon-viewport": "^7.
|
|
41
|
-
"@storybook/
|
|
42
|
-
"@storybook/
|
|
43
|
-
"@storybook/
|
|
44
|
-
"@storybook/
|
|
45
|
-
"@storybook/
|
|
46
|
-
"@storybook/
|
|
47
|
-
"@storybook/testing-library": "^0.1.0",
|
|
48
|
-
"@storybook/theming": "^7.4.5",
|
|
49
|
-
"@storybook/types": "^7.4.5",
|
|
40
|
+
"@storybook/addon-viewport": "^7.6.17",
|
|
41
|
+
"@storybook/manager-api": "^7.6.17",
|
|
42
|
+
"@storybook/react": "^7.6.17",
|
|
43
|
+
"@storybook/react-webpack5": "^7.6.17",
|
|
44
|
+
"@storybook/test": "^7.6.17",
|
|
45
|
+
"@storybook/theming": "^7.6.17",
|
|
46
|
+
"@storybook/types": "^7.6.17",
|
|
50
47
|
"@testing-library/dom": "^7.21.4",
|
|
51
48
|
"@testing-library/jest-dom": "^5.14.1",
|
|
52
49
|
"@testing-library/react": "^12.0.0",
|
|
@@ -74,7 +71,7 @@
|
|
|
74
71
|
"lodash.times": "^4.3.2",
|
|
75
72
|
"react-intl": "^5.10.0",
|
|
76
73
|
"rollup": "^3.28.1",
|
|
77
|
-
"storybook": "^7.
|
|
74
|
+
"storybook": "^7.6.17",
|
|
78
75
|
"@transferwise/less-config": "3.1.0",
|
|
79
76
|
"@transferwise/neptune-css": "14.9.5",
|
|
80
77
|
"@wise/components-theming": "1.0.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { userEvent, within } from '@storybook/
|
|
2
|
+
import { userEvent, within } from '@storybook/test';
|
|
3
3
|
|
|
4
4
|
import { ControlType, Priority } from '../common';
|
|
5
5
|
import { storyConfig } from '../test-utils';
|
|
@@ -34,9 +34,9 @@ export const Focused = storyConfig<Story>(
|
|
|
34
34
|
delay: 1000,
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
|
-
play: ({ canvasElement }) => {
|
|
37
|
+
play: async ({ canvasElement }) => {
|
|
38
38
|
const canvas = within(canvasElement);
|
|
39
|
-
userEvent.click(canvas.getByRole('button'));
|
|
39
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
{
|
package/src/common/fakeEvents.js
CHANGED
|
@@ -4,9 +4,9 @@ export const fakeEvent = () => ({
|
|
|
4
4
|
preventDefault() {},
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
export const fakeKeyDownEventForKey = (
|
|
7
|
+
export const fakeKeyDownEventForKey = (key) => ({
|
|
8
8
|
...fakeEvent(),
|
|
9
|
-
|
|
9
|
+
key,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const fakeKeyDownEvent = (eventAttribute = {}) => ({
|
package/src/common/index.js
CHANGED
|
@@ -21,7 +21,6 @@ export { Variant } from './propsValues/variant';
|
|
|
21
21
|
export * from './propsValues/scroll';
|
|
22
22
|
export { MarkdownNodeType } from './propsValues/markdownNodeType';
|
|
23
23
|
export { FileType } from './fileType';
|
|
24
|
-
export { Key } from './key';
|
|
25
24
|
export * from './locale';
|
|
26
25
|
export * from './commonProps';
|
|
27
26
|
export * from './randomId';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { userEvent, within } from '@storybook/test';
|
|
2
3
|
|
|
3
4
|
import { DateInput, Info, InlineAlert, Title, Typography } from '..';
|
|
4
|
-
import { lorem10, storyConfig
|
|
5
|
+
import { lorem10, storyConfig } from '../test-utils';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
component: DateInput,
|
|
@@ -25,9 +26,9 @@ type Story = StoryObj<typeof DateInput>;
|
|
|
25
26
|
|
|
26
27
|
export const Basic: Story = {};
|
|
27
28
|
|
|
28
|
-
Basic.play = ({ canvasElement }) => {
|
|
29
|
+
Basic.play = async ({ canvasElement }) => {
|
|
29
30
|
const canvas = within(canvasElement);
|
|
30
|
-
userEvent.click(canvas.getByRole('button'));
|
|
31
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
export const WithLabel: Story = {
|
|
@@ -4,7 +4,6 @@ import { createRef, PureComponent } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { Size, MonthFormat, Position, Breakpoint } from '../common';
|
|
6
6
|
import { isWithinRange, moveToWithinRange } from '../common/dateUtils';
|
|
7
|
-
import KeyCodes from '../common/keyCodes';
|
|
8
7
|
import ResponsivePanel from '../common/responsivePanel';
|
|
9
8
|
|
|
10
9
|
import DateTrigger from './dateTrigger';
|
|
@@ -102,8 +101,8 @@ class DateLookup extends PureComponent {
|
|
|
102
101
|
|
|
103
102
|
handleKeyDown = (event) => {
|
|
104
103
|
const { open, originalDate } = this.state;
|
|
105
|
-
switch (event.
|
|
106
|
-
case
|
|
104
|
+
switch (event.key) {
|
|
105
|
+
case 'ArrowLeft':
|
|
107
106
|
if (open) {
|
|
108
107
|
this.adjustDate(-1, -1, -1);
|
|
109
108
|
} else {
|
|
@@ -111,7 +110,7 @@ class DateLookup extends PureComponent {
|
|
|
111
110
|
}
|
|
112
111
|
event.preventDefault();
|
|
113
112
|
break;
|
|
114
|
-
case
|
|
113
|
+
case 'ArrowUp':
|
|
115
114
|
if (open) {
|
|
116
115
|
this.adjustDate(-7, -4, -4);
|
|
117
116
|
} else {
|
|
@@ -119,7 +118,7 @@ class DateLookup extends PureComponent {
|
|
|
119
118
|
}
|
|
120
119
|
event.preventDefault();
|
|
121
120
|
break;
|
|
122
|
-
case
|
|
121
|
+
case 'ArrowRight':
|
|
123
122
|
if (open) {
|
|
124
123
|
this.adjustDate(1, 1, 1);
|
|
125
124
|
} else {
|
|
@@ -127,7 +126,7 @@ class DateLookup extends PureComponent {
|
|
|
127
126
|
}
|
|
128
127
|
event.preventDefault();
|
|
129
128
|
break;
|
|
130
|
-
case
|
|
129
|
+
case 'ArrowDown':
|
|
131
130
|
if (open) {
|
|
132
131
|
this.adjustDate(7, 4, 4);
|
|
133
132
|
} else {
|
|
@@ -135,7 +134,7 @@ class DateLookup extends PureComponent {
|
|
|
135
134
|
}
|
|
136
135
|
event.preventDefault();
|
|
137
136
|
break;
|
|
138
|
-
case
|
|
137
|
+
case 'Escape':
|
|
139
138
|
if (originalDate !== null) {
|
|
140
139
|
this.props.onChange(originalDate);
|
|
141
140
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { mount } from 'enzyme';
|
|
3
3
|
|
|
4
4
|
import { fakeKeyDownEventForKey } from '../common/fakeEvents';
|
|
5
|
-
import KEY_CODES from '../common/keyCodes';
|
|
6
5
|
import { mockMatchMedia } from '../test-utils';
|
|
7
6
|
|
|
8
7
|
import DateLookup from '.';
|
|
@@ -31,28 +30,28 @@ describe('DateLookup (keyboard events)', () => {
|
|
|
31
30
|
});
|
|
32
31
|
|
|
33
32
|
it('can be opened by LEFT arrow', () => {
|
|
34
|
-
pressKey(
|
|
33
|
+
pressKey('ArrowLeft');
|
|
35
34
|
expect(component.instance().state.open).toBe(true);
|
|
36
35
|
});
|
|
37
36
|
|
|
38
37
|
it('can be opened by UP arrow', () => {
|
|
39
|
-
pressKey(
|
|
38
|
+
pressKey('ArrowUp');
|
|
40
39
|
expect(component.instance().state.open).toBe(true);
|
|
41
40
|
});
|
|
42
41
|
|
|
43
42
|
it('can be opened by RIGHT arrow', () => {
|
|
44
|
-
pressKey(
|
|
43
|
+
pressKey('ArrowRight');
|
|
45
44
|
expect(component.instance().state.open).toBe(true);
|
|
46
45
|
});
|
|
47
46
|
|
|
48
47
|
it('can be opened by DOWN arrow', () => {
|
|
49
|
-
pressKey(
|
|
48
|
+
pressKey('ArrowDown');
|
|
50
49
|
expect(component.instance().state.open).toBe(true);
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
it('can be closed by pressing ESCAPE', () => {
|
|
54
53
|
component.setState({ open: true });
|
|
55
|
-
pressKey(
|
|
54
|
+
pressKey('Escape');
|
|
56
55
|
expect(component.instance().state.open).toBe(false);
|
|
57
56
|
});
|
|
58
57
|
|
|
@@ -62,33 +61,33 @@ describe('DateLookup (keyboard events)', () => {
|
|
|
62
61
|
});
|
|
63
62
|
|
|
64
63
|
it('moves 1 day back by pressing LEFT', () => {
|
|
65
|
-
pressKey(
|
|
64
|
+
pressKey('ArrowLeft');
|
|
66
65
|
onChangeCalledWith(new Date(2018, 11, 26));
|
|
67
66
|
});
|
|
68
67
|
|
|
69
68
|
it('moves 7 days back by pressing UP', () => {
|
|
70
|
-
pressKey(
|
|
69
|
+
pressKey('ArrowUp');
|
|
71
70
|
onChangeCalledWith(new Date(2018, 11, 20));
|
|
72
71
|
});
|
|
73
72
|
|
|
74
73
|
it('moves 1 day forward by pressing RIGHT', () => {
|
|
75
|
-
pressKey(
|
|
74
|
+
pressKey('ArrowRight');
|
|
76
75
|
onChangeCalledWith(new Date(2018, 11, 28));
|
|
77
76
|
});
|
|
78
77
|
|
|
79
78
|
it('moves 7 day forward by pressing DOWN', () => {
|
|
80
|
-
pressKey(
|
|
79
|
+
pressKey('ArrowDown');
|
|
81
80
|
onChangeCalledWith(new Date(2019, 0, 3));
|
|
82
81
|
});
|
|
83
82
|
|
|
84
83
|
it('resets to original date when escape key is pressed', () => {
|
|
85
|
-
pressKey(
|
|
86
|
-
pressKey(
|
|
84
|
+
pressKey('ArrowLeft');
|
|
85
|
+
pressKey('Escape');
|
|
87
86
|
onChangeCalledWith(date);
|
|
88
87
|
});
|
|
89
88
|
|
|
90
89
|
it('resets to original date when clicking outside modal', () => {
|
|
91
|
-
pressKey(
|
|
90
|
+
pressKey('ArrowLeft');
|
|
92
91
|
component.find('.dimmer').simulate('click');
|
|
93
92
|
onChangeCalledWith(date);
|
|
94
93
|
});
|
|
@@ -100,22 +99,22 @@ describe('DateLookup (keyboard events)', () => {
|
|
|
100
99
|
});
|
|
101
100
|
|
|
102
101
|
it('moves 1 month back by pressing LEFT', () => {
|
|
103
|
-
pressKey(
|
|
102
|
+
pressKey('ArrowLeft');
|
|
104
103
|
onChangeCalledWith(new Date(2018, 10, 27));
|
|
105
104
|
});
|
|
106
105
|
|
|
107
106
|
it('moves 4 months back by pressing UP', () => {
|
|
108
|
-
pressKey(
|
|
107
|
+
pressKey('ArrowUp');
|
|
109
108
|
onChangeCalledWith(new Date(2018, 7, 27));
|
|
110
109
|
});
|
|
111
110
|
|
|
112
111
|
it('moves 1 month forward by pressing RIGHT', () => {
|
|
113
|
-
pressKey(
|
|
112
|
+
pressKey('ArrowRight');
|
|
114
113
|
onChangeCalledWith(new Date(2019, 0, 27));
|
|
115
114
|
});
|
|
116
115
|
|
|
117
116
|
it('moves 4 months forward by pressing DOWN', () => {
|
|
118
|
-
pressKey(
|
|
117
|
+
pressKey('ArrowDown');
|
|
119
118
|
onChangeCalledWith(new Date(2019, 3, 27));
|
|
120
119
|
});
|
|
121
120
|
});
|
|
@@ -126,22 +125,22 @@ describe('DateLookup (keyboard events)', () => {
|
|
|
126
125
|
});
|
|
127
126
|
|
|
128
127
|
it('moves 1 year back by pressing LEFT', () => {
|
|
129
|
-
pressKey(
|
|
128
|
+
pressKey('ArrowLeft');
|
|
130
129
|
onChangeCalledWith(new Date(2017, 11, 27));
|
|
131
130
|
});
|
|
132
131
|
|
|
133
132
|
it('moves 4 years back by pressing UP', () => {
|
|
134
|
-
pressKey(
|
|
133
|
+
pressKey('ArrowUp');
|
|
135
134
|
onChangeCalledWith(new Date(2014, 11, 27));
|
|
136
135
|
});
|
|
137
136
|
|
|
138
137
|
it('moves 1 year forward by pressing RIGHT', () => {
|
|
139
|
-
pressKey(
|
|
138
|
+
pressKey('ArrowRight');
|
|
140
139
|
onChangeCalledWith(new Date(2019, 11, 27));
|
|
141
140
|
});
|
|
142
141
|
|
|
143
142
|
it('moves 4 year forward by pressing DOWN', () => {
|
|
144
|
-
pressKey(
|
|
143
|
+
pressKey('ArrowDown');
|
|
145
144
|
onChangeCalledWith(new Date(2022, 11, 27));
|
|
146
145
|
});
|
|
147
146
|
});
|
|
@@ -157,16 +156,16 @@ describe('DateLookup (keyboard events)', () => {
|
|
|
157
156
|
});
|
|
158
157
|
|
|
159
158
|
it('makes sure that date is >= min', () => {
|
|
160
|
-
pressKey(
|
|
159
|
+
pressKey('ArrowLeft');
|
|
161
160
|
onChangeCalledWith(new Date(2018, 11, 26));
|
|
162
|
-
pressKey(
|
|
161
|
+
pressKey('ArrowLeft');
|
|
163
162
|
onChangeCalledWith(new Date(2018, 11, 26));
|
|
164
163
|
});
|
|
165
164
|
|
|
166
165
|
it('makes sure that date is <= max', () => {
|
|
167
|
-
pressKey(
|
|
166
|
+
pressKey('ArrowRight');
|
|
168
167
|
onChangeCalledWith(new Date(2018, 11, 28));
|
|
169
|
-
pressKey(
|
|
168
|
+
pressKey('ArrowRight');
|
|
170
169
|
onChangeCalledWith(new Date(2018, 11, 28));
|
|
171
170
|
});
|
|
172
171
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { boolean, select, date, text } from '@storybook/addon-knobs';
|
|
2
|
+
import { userEvent, within } from '@storybook/test';
|
|
2
3
|
import { useState } from 'react';
|
|
3
4
|
|
|
4
5
|
import { Size } from '../common';
|
|
5
|
-
import {
|
|
6
|
+
import { storyConfig } from '../test-utils';
|
|
6
7
|
|
|
7
8
|
import DateLookup from './DateLookup';
|
|
8
9
|
|
|
@@ -48,8 +49,8 @@ export const Basic = () => {
|
|
|
48
49
|
Basic.play = async ({ canvasElement }) => {
|
|
49
50
|
// testing focus state on keyboard nav
|
|
50
51
|
const canvas = within(canvasElement);
|
|
51
|
-
userEvent.tab(canvas.getByRole('button'));
|
|
52
|
-
userEvent.keyboard('
|
|
52
|
+
await userEvent.tab(canvas.getByRole('button'));
|
|
53
|
+
await userEvent.keyboard(' ');
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export const Basic400Zoom = storyConfig(
|
|
@@ -111,21 +111,21 @@ describe('DateTrigger', () => {
|
|
|
111
111
|
it('calls onClear when user press Space', () => {
|
|
112
112
|
const onClear = jest.fn();
|
|
113
113
|
component.setProps({ onClear });
|
|
114
|
-
clearButton().simulate('keypress', fakeKeyDownEventForKey(
|
|
114
|
+
clearButton().simulate('keypress', fakeKeyDownEventForKey(' '));
|
|
115
115
|
expect(onClear).toHaveBeenCalledTimes(1);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
it('calls onClear when user press Enter', () => {
|
|
119
119
|
const onClear = jest.fn();
|
|
120
120
|
component.setProps({ onClear });
|
|
121
|
-
clearButton().simulate('keypress', fakeKeyDownEventForKey(
|
|
121
|
+
clearButton().simulate('keypress', fakeKeyDownEventForKey('Enter'));
|
|
122
122
|
expect(onClear).toHaveBeenCalledTimes(1);
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
it(`doesn't call onClear when user press a random key`, () => {
|
|
126
126
|
const onClear = jest.fn();
|
|
127
127
|
component.setProps({ onClear });
|
|
128
|
-
clearButton().simulate('keypress', fakeKeyDownEventForKey(
|
|
128
|
+
clearButton().simulate('keypress', fakeKeyDownEventForKey('r'));
|
|
129
129
|
expect(onClear).not.toHaveBeenCalled();
|
|
130
130
|
});
|
|
131
131
|
|
package/src/info/Info.story.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { userEvent, within } from '@storybook/
|
|
2
|
+
import { userEvent, within } from '@storybook/test';
|
|
3
3
|
|
|
4
4
|
import { lorem10, storyConfig } from '../test-utils';
|
|
5
5
|
|
|
@@ -35,9 +35,9 @@ export const OpenedPopover: Story = {
|
|
|
35
35
|
delay: 1000,
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
-
play: ({ canvasElement }) => {
|
|
38
|
+
play: async ({ canvasElement }) => {
|
|
39
39
|
const canvas = within(canvasElement);
|
|
40
|
-
userEvent.click(canvas.getByRole('button'));
|
|
40
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { text } from '@storybook/addon-knobs';
|
|
2
|
-
|
|
3
|
-
import { within, userEvent } from '../test-utils';
|
|
2
|
+
import { userEvent, within } from '@storybook/test';
|
|
4
3
|
|
|
5
4
|
import InputWithDisplayFormat from '.';
|
|
6
5
|
|
|
@@ -86,9 +85,5 @@ SecurityPinPlay.args = {
|
|
|
86
85
|
|
|
87
86
|
SecurityPinPlay.play = async ({ canvasElement }) => {
|
|
88
87
|
const canvas = within(canvasElement);
|
|
89
|
-
|
|
90
|
-
while (i < 6) {
|
|
91
|
-
await userEvent.type(canvas.getByPlaceholderText('*-*-*-*-*-*'), `${i + 1}`, { delay: 5000 });
|
|
92
|
-
i++;
|
|
93
|
-
}
|
|
88
|
+
await userEvent.type(canvas.getByPlaceholderText('*-*-*-*-*-*'), '123456');
|
|
94
89
|
};
|
|
@@ -208,4 +208,11 @@ describe('SelectInput', () => {
|
|
|
208
208
|
|
|
209
209
|
expect(trigger).toHaveTextContent('USD, EUR');
|
|
210
210
|
});
|
|
211
|
+
|
|
212
|
+
it('supports custom `id` attribute', () => {
|
|
213
|
+
render(<SelectInput id="custom" items={[]} />);
|
|
214
|
+
|
|
215
|
+
const trigger = screen.getAllByRole('button')[0];
|
|
216
|
+
expect(trigger).toHaveAttribute('id', 'custom');
|
|
217
|
+
});
|
|
211
218
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { userEvent, within } from '@storybook/test';
|
|
2
3
|
import { Calendar, ChevronDown } from '@transferwise/icons';
|
|
3
4
|
import { Flag } from '@wise/art';
|
|
4
5
|
import classNames from 'classnames';
|
|
@@ -7,7 +8,6 @@ import { useState } from 'react';
|
|
|
7
8
|
import { getMonthNames } from '../common/dateUtils';
|
|
8
9
|
import Drawer from '../drawer';
|
|
9
10
|
import Modal from '../modal';
|
|
10
|
-
import { within, userEvent } from '../test-utils';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
SelectInput,
|
|
@@ -131,9 +131,9 @@ export const Basic: StoryObj<{
|
|
|
131
131
|
action: 'cleared',
|
|
132
132
|
},
|
|
133
133
|
},
|
|
134
|
-
play: ({ canvasElement }) => {
|
|
134
|
+
play: async ({ canvasElement }) => {
|
|
135
135
|
const triggerButton = within(canvasElement).getByRole('button');
|
|
136
|
-
userEvent.click(triggerButton);
|
|
136
|
+
await userEvent.click(triggerButton);
|
|
137
137
|
},
|
|
138
138
|
};
|
|
139
139
|
|
|
@@ -184,9 +184,9 @@ export const Months: StoryObj<{
|
|
|
184
184
|
action: 'cleared',
|
|
185
185
|
},
|
|
186
186
|
},
|
|
187
|
-
play: ({ canvasElement }) => {
|
|
187
|
+
play: async ({ canvasElement }) => {
|
|
188
188
|
const triggerButton = within(canvasElement).getByText('January');
|
|
189
|
-
userEvent.click(triggerButton);
|
|
189
|
+
await userEvent.click(triggerButton);
|
|
190
190
|
},
|
|
191
191
|
};
|
|
192
192
|
|
|
@@ -402,9 +402,9 @@ export const CustomTrigger: StoryObj = {
|
|
|
402
402
|
</div>
|
|
403
403
|
);
|
|
404
404
|
},
|
|
405
|
-
play: ({ canvasElement }) => {
|
|
405
|
+
play: async ({ canvasElement }) => {
|
|
406
406
|
const triggerButton = within(canvasElement).getByRole('button');
|
|
407
|
-
userEvent.click(triggerButton);
|
|
407
|
+
await userEvent.click(triggerButton);
|
|
408
408
|
},
|
|
409
409
|
};
|
|
410
410
|
|
|
@@ -41,6 +41,7 @@ function inferSearchableStrings(value: unknown) {
|
|
|
41
41
|
|
|
42
42
|
const SelectInputTriggerButtonPropsContext = createContext<{
|
|
43
43
|
ref?: React.ForwardedRef<HTMLButtonElement>;
|
|
44
|
+
id?: string;
|
|
44
45
|
onClick?: (event: React.MouseEvent) => void;
|
|
45
46
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
46
47
|
[key: string]: unknown;
|
|
@@ -125,6 +126,7 @@ function filterSelectInputItems<T>(items: readonly SelectInputItem<T>[], needle:
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
export interface SelectInputProps<T = string, M extends boolean = false> {
|
|
129
|
+
id?: string;
|
|
128
130
|
name?: string;
|
|
129
131
|
multiple?: M;
|
|
130
132
|
placeholder?: string;
|
|
@@ -218,6 +220,7 @@ function SelectInputClearButton({ className, onClick }: SelectInputClearButtonPr
|
|
|
218
220
|
const noop = () => {};
|
|
219
221
|
|
|
220
222
|
export function SelectInput<T = string, M extends boolean = false>({
|
|
223
|
+
id,
|
|
221
224
|
name,
|
|
222
225
|
multiple,
|
|
223
226
|
placeholder,
|
|
@@ -288,6 +291,7 @@ export function SelectInput<T = string, M extends boolean = false>({
|
|
|
288
291
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
289
292
|
value={{
|
|
290
293
|
ref: mergeRefs([ref, triggerRef]),
|
|
294
|
+
id,
|
|
291
295
|
...mergeProps(
|
|
292
296
|
{
|
|
293
297
|
onClick: () => {
|
package/src/logo/Logo.js
CHANGED
|
@@ -2,10 +2,10 @@ import classNames from 'classnames';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import { LogoType } from './logoTypes';
|
|
5
|
-
import { LogoFlagInverse } from './svg/flag-inverse.svg';
|
|
6
|
-
import { LogoFlag } from './svg/flag.svg';
|
|
7
|
-
import { LogoWiseInverse } from './svg/logo-inverse.svg';
|
|
8
|
-
import { LogoWise } from './svg/logo.svg';
|
|
5
|
+
import { ReactComponent as LogoFlagInverse } from './svg/flag-inverse.svg';
|
|
6
|
+
import { ReactComponent as LogoFlag } from './svg/flag.svg';
|
|
7
|
+
import { ReactComponent as LogoWiseInverse } from './svg/logo-inverse.svg';
|
|
8
|
+
import { ReactComponent as LogoWise } from './svg/logo.svg';
|
|
9
9
|
|
|
10
10
|
const svgPaths = {
|
|
11
11
|
WISE: LogoWise,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { within, userEvent } from '@storybook/
|
|
2
|
+
import { within, userEvent } from '@storybook/test';
|
|
3
3
|
import { Lock } from '@transferwise/icons';
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
|
|
@@ -150,9 +150,9 @@ export const BalanceCurrencies: Story = {
|
|
|
150
150
|
|
|
151
151
|
export const OpenedInput: Story = {
|
|
152
152
|
...MultipleCurrencies,
|
|
153
|
-
play: ({ canvasElement }) => {
|
|
153
|
+
play: async ({ canvasElement }) => {
|
|
154
154
|
const canvas = within(canvasElement);
|
|
155
|
-
userEvent.click(canvas.getByRole('button'));
|
|
155
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
156
156
|
},
|
|
157
157
|
};
|
|
158
158
|
|