@transferwise/components 45.14.2 → 45.15.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/i18n/en.json +8 -0
- package/build/index.esm.js +1001 -367
- package/build/index.esm.js.map +1 -1
- package/build/index.js +1003 -366
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/common/closeButton/CloseButton.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/inputs/Input.css +1 -1
- package/build/styles/inputs/InputGroup.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -0
- package/build/styles/inputs/TextArea.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/promoCard/PromoCard.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts +14 -5
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/common/Option/Option.d.ts.map +1 -1
- package/build/types/common/focusBoundary/FocusBoundary.d.ts +2 -2
- package/build/types/common/focusBoundary/FocusBoundary.d.ts.map +1 -1
- package/build/types/common/hooks/useMedia.d.ts +2 -0
- package/build/types/common/hooks/useMedia.d.ts.map +1 -0
- package/build/types/common/hooks/useScreenSize.d.ts +3 -0
- package/build/types/common/hooks/useScreenSize.d.ts.map +1 -0
- package/build/types/common/preventScroll/PreventScroll.d.ts +2 -0
- package/build/types/common/preventScroll/PreventScroll.d.ts.map +1 -0
- package/build/types/dateInput/DateInput.d.ts +2 -0
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.messages.d.ts +65 -0
- package/build/types/dateLookup/DateLookup.messages.d.ts.map +1 -0
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts +3 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/dateLookup/dateTrigger/DateTrigger.messages.d.ts +7 -7
- package/build/types/dateLookup/dateTrigger/DateTrigger.messages.d.ts.map +1 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts +4 -26
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
- package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts +4 -29
- package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts +1 -0
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts +10 -0
- package/build/types/inputs/SearchInput.d.ts.map +1 -0
- package/build/types/inputs/SelectInput.d.ts +41 -0
- package/build/types/inputs/SelectInput.d.ts.map +1 -0
- package/build/types/inputs/_BottomSheet.d.ts +17 -0
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -0
- package/build/types/inputs/_ButtonInput.d.ts +6 -0
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -0
- package/build/types/inputs/_Popover.d.ts +18 -0
- package/build/types/inputs/_Popover.d.ts.map +1 -0
- package/build/types/inputs/_common.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/snackbar/Snackbar.d.ts.map +1 -1
- package/build/types/stepper/Stepper.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tile/Tile.d.ts.map +1 -1
- package/build/types/upload/steps/completeStep/completeStep.d.ts.map +1 -1
- package/build/types/upload/steps/processingStep/processingStep.d.ts.map +1 -1
- package/build/types/utilities/wrapInFragment.d.ts +3 -0
- package/build/types/utilities/wrapInFragment.d.ts.map +1 -0
- package/package.json +27 -20
- package/src/accordion/AccordionItem/__snapshots__/AccordionItem.spec.js.snap +6 -6
- package/src/avatarWrapper/AvatarWrapper.tsx +20 -8
- package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +1 -1
- package/src/card/Card.spec.js +2 -2
- package/src/common/Option/Option.tsx +1 -7
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +8 -1
- package/src/common/closeButton/CloseButton.css +1 -1
- package/src/common/focusBoundary/FocusBoundary.tsx +9 -32
- package/src/common/hooks/useMedia.spec.ts +39 -0
- package/src/common/hooks/useMedia.ts +15 -0
- package/src/common/hooks/useScreenSize.ts +7 -0
- package/src/common/preventScroll/PreventScroll.tsx +6 -0
- package/src/dateInput/DateInput.js +6 -0
- package/src/dateInput/DateInput.story.tsx +2 -0
- package/src/dateLookup/DateLookup.css +1 -1
- package/src/dateLookup/DateLookup.keyboardEvents.spec.js +3 -3
- package/src/dateLookup/DateLookup.less +4 -0
- package/src/dateLookup/DateLookup.messages.js +44 -0
- package/src/dateLookup/DateLookup.testingLibrary.spec.js +39 -0
- package/src/dateLookup/dateHeader/DateHeader.js +48 -26
- package/src/dateLookup/dateHeader/DateHeader.spec.js +37 -0
- package/src/dateLookup/dayCalendar/DayCalendar.js +3 -1
- package/src/dateLookup/dayCalendar/DayCalendar.spec.js +7 -1
- package/src/dateLookup/dayCalendar/table/DayCalendarTable.js +7 -3
- package/src/dateLookup/dayCalendar/table/DayCalendarTable.spec.js +1 -0
- package/src/dateLookup/monthCalendar/MonthCalendar.js +3 -1
- package/src/dateLookup/monthCalendar/MonthCalendar.spec.js +7 -1
- package/src/dateLookup/monthCalendar/table/MonthCalendarTable.spec.js +4 -5
- package/src/dateLookup/tableLink/TableLink.js +24 -3
- package/src/dateLookup/tableLink/TableLink.spec.js +60 -4
- package/src/dateLookup/yearCalendar/YearCalendar.js +16 -3
- package/src/dateLookup/yearCalendar/YearCalendar.spec.js +14 -1
- package/src/dateLookup/yearCalendar/table/YearCalendarTable.spec.js +4 -5
- package/src/decision/Decision.story.js +11 -11
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +12 -12
- package/src/i18n/en.json +9 -0
- package/src/index.ts +8 -0
- package/src/inputs/Input.css +1 -1
- package/src/inputs/Input.less +14 -0
- package/src/inputs/Input.tsx +6 -2
- package/src/inputs/InputGroup.css +1 -1
- package/src/inputs/InputGroup.less +5 -0
- package/src/inputs/SearchInput.story.tsx +40 -0
- package/src/inputs/SearchInput.tsx +35 -0
- package/src/inputs/SelectInput.css +1 -0
- package/src/inputs/SelectInput.less +183 -0
- package/src/inputs/SelectInput.spec.tsx +120 -0
- package/src/inputs/SelectInput.story.tsx +264 -0
- package/src/inputs/SelectInput.tsx +565 -0
- package/src/inputs/TextArea.css +1 -1
- package/src/inputs/TextArea.less +5 -0
- package/src/inputs/_BottomSheet.less +107 -0
- package/src/inputs/_BottomSheet.tsx +128 -0
- package/src/inputs/_ButtonInput.less +7 -0
- package/src/inputs/_ButtonInput.tsx +27 -0
- package/src/inputs/_Popover.less +38 -0
- package/src/inputs/_Popover.tsx +118 -0
- package/src/inputs/_common.less +0 -4
- package/src/inputs/_common.ts +0 -1
- package/src/logo/Logo.js +3 -21
- package/src/logo/__snapshots__/Logo.spec.js.snap +78 -30
- package/src/main.css +1 -1
- package/src/main.less +4 -0
- package/src/phoneNumberInput/PhoneNumberInput.js +1 -0
- package/src/promoCard/PromoCard.css +1 -1
- package/src/select/searchBox/__snapshots__/SearchBox.spec.js.snap +1 -1
- package/src/snackbar/Snackbar.js +6 -1
- package/src/snackbar/Snackbar.spec.js +1 -3
- package/src/ssr.spec.js +7 -0
- package/src/stepper/Stepper.css +1 -1
- package/src/stepper/Stepper.less +1 -9
- package/src/stepper/Stepper.spec.js +4 -4
- package/src/stepper/Stepper.tsx +2 -5
- package/src/tabs/Tabs.js +2 -1
- package/src/tile/Tile.js +5 -11
- package/src/tile/__snapshots__/Tile.spec.js.snap +7 -9
- package/src/upload/Upload.js +1 -1
- package/src/upload/steps/completeStep/completeStep.js +4 -1
- package/src/upload/steps/processingStep/processingStep.js +1 -0
- package/src/uploadInput/uploadItem/UploadItem.tsx +1 -1
- package/src/utilities/wrapInFragment.tsx +3 -0
- package/build/types/common/focusBoundary/utils/getFocusableElements.d.ts +0 -2
- package/build/types/common/focusBoundary/utils/getFocusableElements.d.ts.map +0 -1
- package/build/types/common/focusBoundary/utils/index.d.ts +0 -3
- package/build/types/common/focusBoundary/utils/index.d.ts.map +0 -1
- package/build/types/common/focusBoundary/utils/resetFocus.d.ts +0 -2
- package/build/types/common/focusBoundary/utils/resetFocus.d.ts.map +0 -1
- package/src/common/focusBoundary/FocusBoundary.spec.tsx +0 -66
- package/src/common/focusBoundary/__snapshots__/FocusBoundary.spec.tsx.snap +0 -16
- package/src/common/focusBoundary/utils/getFocusableElements.js +0 -25
- package/src/common/focusBoundary/utils/getFocusableElements.spec.js +0 -51
- package/src/common/focusBoundary/utils/index.js +0 -2
- package/src/common/focusBoundary/utils/resetFocus.js +0 -23
- package/src/common/focusBoundary/utils/resetFocus.spec.js +0 -103
- package/src/snackbar/__snapshots__/Snackbar.spec.js.snap +0 -5
- /package/src/dateLookup/dateTrigger/{DateTrigger.messages.js → DateTrigger.messages.ts} +0 -0
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { cleanup, render, screen, userEvent } from '../../../test-utils';
|
|
2
|
-
import { fakeKeyDownEvent } from '../../fakeEvents';
|
|
3
|
-
|
|
4
|
-
import { resetFocus } from './resetFocus';
|
|
5
|
-
|
|
6
|
-
describe('resetFocus', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
render(
|
|
9
|
-
<>
|
|
10
|
-
<a href="test">first</a>
|
|
11
|
-
<a href="test">middle</a>
|
|
12
|
-
<a href="test">last</a>
|
|
13
|
-
</>,
|
|
14
|
-
);
|
|
15
|
-
});
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
cleanup();
|
|
18
|
-
});
|
|
19
|
-
it('set focus to first element when last element is focused and event is tab', () => {
|
|
20
|
-
focusOnLast();
|
|
21
|
-
|
|
22
|
-
resetFocus({
|
|
23
|
-
focusableEls: { first: first(), last: last() },
|
|
24
|
-
event: fakeKeyDownEvent({ shiftKey: false }),
|
|
25
|
-
});
|
|
26
|
-
expect(first()).toHaveFocus();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('set focus to last element when first element is focused and event is shift + tab', () => {
|
|
30
|
-
focusOnFirst();
|
|
31
|
-
|
|
32
|
-
resetFocus({
|
|
33
|
-
focusableEls: { first: first(), last: last() },
|
|
34
|
-
event: fakeKeyDownEvent({ shiftKey: true }),
|
|
35
|
-
});
|
|
36
|
-
expect(last()).toHaveFocus();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it(`doesn't change focus when first element is focused and event is tab`, () => {
|
|
40
|
-
focusOnFirst();
|
|
41
|
-
|
|
42
|
-
resetFocus({
|
|
43
|
-
focusableEls: { first: first(), last: last() },
|
|
44
|
-
event: fakeKeyDownEvent(),
|
|
45
|
-
});
|
|
46
|
-
expect(first()).toHaveFocus();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it(`doesn't change focus when last element is focused and event is shift+tab`, () => {
|
|
50
|
-
focusOnLast();
|
|
51
|
-
|
|
52
|
-
resetFocus({
|
|
53
|
-
focusableEls: { first: first(), last: last() },
|
|
54
|
-
event: fakeKeyDownEvent({ shiftKey: true }),
|
|
55
|
-
});
|
|
56
|
-
expect(last()).toHaveFocus();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it(`doesn't change focus when middle element is focused and event is shift+tab or tab`, () => {
|
|
60
|
-
focusOnMiddle();
|
|
61
|
-
|
|
62
|
-
resetFocus({
|
|
63
|
-
focusableEls: { first: first(), last: last() },
|
|
64
|
-
event: fakeKeyDownEvent({ shiftKey: true }),
|
|
65
|
-
});
|
|
66
|
-
expect(middle()).toHaveFocus();
|
|
67
|
-
|
|
68
|
-
resetFocus({
|
|
69
|
-
focusableEls: { first: first(), last: last() },
|
|
70
|
-
event: fakeKeyDownEvent(),
|
|
71
|
-
});
|
|
72
|
-
expect(middle()).toHaveFocus();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it(`doesn't change focus when first is the only element provided`, () => {
|
|
76
|
-
focusOnFirst();
|
|
77
|
-
resetFocus({
|
|
78
|
-
focusableEls: { first: first(), last: undefined },
|
|
79
|
-
event: fakeKeyDownEvent({ shiftKey: true }),
|
|
80
|
-
});
|
|
81
|
-
expect(first()).toHaveFocus();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it(`doesn't change focus when last is the only element provided`, () => {
|
|
85
|
-
focusOnLast();
|
|
86
|
-
resetFocus({
|
|
87
|
-
focusableEls: { first: undefined, last: last() },
|
|
88
|
-
event: fakeKeyDownEvent(),
|
|
89
|
-
});
|
|
90
|
-
expect(last()).toHaveFocus();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const first = () => screen.getByText('first');
|
|
94
|
-
const last = () => screen.getByText('last');
|
|
95
|
-
const middle = () => screen.getByText('middle');
|
|
96
|
-
|
|
97
|
-
const focusOnFirst = () => userEvent.tab();
|
|
98
|
-
const focusOnLast = () => userEvent.tab({ shift: true });
|
|
99
|
-
const focusOnMiddle = () => {
|
|
100
|
-
userEvent.tab();
|
|
101
|
-
userEvent.tab();
|
|
102
|
-
};
|
|
103
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Snackbar accepts element as text 1`] = `"<div class=\\"snackbar\\"><span class=\\"np-text-body-default snackbar__text snackbar__text--light snackbar__text-container-enter snackbar__text-container-enter-active\\"><span>test</span></span></div>"`;
|
|
4
|
-
|
|
5
|
-
exports[`Snackbar adjusts the theme if passed 1`] = `"<div class=\\"snackbar\\"><span class=\\"np-text-body-default snackbar__text snackbar__text--dark snackbar__text-container-enter snackbar__text-container-enter-active\\"><span>test</span></span></div>"`;
|
|
File without changes
|