@transferwise/components 45.26.1 → 45.26.3
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 +1 -0
- package/build/index.esm.js +39 -27
- package/build/index.esm.js.map +1 -1
- package/build/index.js +39 -27
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/info/Info.d.ts +1 -1
- package/build/types/info/Info.d.ts.map +1 -1
- package/build/types/info/Info.messages.d.ts +8 -0
- package/build/types/info/Info.messages.d.ts.map +1 -0
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/flowNavigation/FlowNavigation.tsx +12 -2
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +12 -8
- package/src/i18n/en.json +1 -0
- package/src/info/Info.messages.ts +8 -0
- package/src/info/Info.spec.js +10 -4
- package/src/info/Info.tsx +5 -2
- package/src/main.css +1 -1
- package/src/popover/Popover.js +1 -1
- package/src/popover/__snapshots__/Popover.spec.js.snap +2 -2
- package/src/summary/Summary.tsx +0 -1
- package/src/typeahead/Typeahead.story.js +6 -0
- package/src/typeahead/typeaheadOption/TypeaheadOption.css +1 -1
- package/src/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/src/typeahead/typeaheadOption/TypeaheadOption.less +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.typeahead__option.tw-dropdown-item .dropdown-item:active strong{color:#fff}.typeahead__option.tw-dropdown-item--focused{
|
|
1
|
+
.typeahead__option.tw-dropdown-item .dropdown-item:active strong{color:#fff}.typeahead__option.tw-dropdown-item--focused{border-radius:10px;border-radius:var(--radius-small);box-shadow:inset 0 0 0 1px #c9cbce;box-shadow:inset 0 0 0 1px var(--color-interactive-secondary)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/flowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAgB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAMnD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wGAAwG;IACxG,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,QAAA,MAAM,cAAc,kEAQjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/flowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAgB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAMnD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wGAAwG;IACxG,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,QAAA,MAAM,cAAc,kEAQjB,mBAAmB,sBA+ErB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/info/Info.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Info.d.ts","sourceRoot":"","sources":["../../../src/info/Info.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAQ,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAOjE,MAAM,WAAW,KAAK;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,QAAQ,CAAC;CAC/B;AAED,QAAA,MAAM,IAAI,6GASP,KAAK,gCAiDP,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Info.messages.d.ts","sourceRoot":"","sources":["../../../src/info/Info.messages.ts"],"names":[],"mappings":";;;;;;AAEA,wBAKG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../src/summary/Summary.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7D,OAAO,EAEL,UAAU,EACV,aAAa,EACb,aAAa,EAId,MAAM,WAAW,CAAC;AACnB,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAa,EAAE,SAAS,EAAE,MAA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CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG;QACvE,IAAI,EAAE,SAAS,CAAC;KACjB,CAAC;IACF;;OAEG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE;QACL,OAAO,EAAE,SAAS,CAAC;QACnB,KAAK,CAAC,EAAE,SAAS,CAAC;KACnB,CAAC;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,OAAO,CAAC,CAAC;IACxF;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,GAAG,UAAU,GAAG,aAAa,CAAC;IACpD;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,QAAA,MAAM,OAAO,6GAYV,KAAK,gCAoFP,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "45.26.
|
|
3
|
+
"version": "45.26.3",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"rollup": "^3.28.1",
|
|
79
79
|
"storybook": "^7.4.5",
|
|
80
80
|
"@transferwise/less-config": "3.0.6",
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
81
|
+
"@wise/components-theming": "0.8.4",
|
|
82
|
+
"@transferwise/neptune-css": "14.7.1"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@transferwise/icons": "^3.7.0",
|
|
@@ -69,7 +69,7 @@ const FlowNavigation = ({
|
|
|
69
69
|
{isSmall && displayGoBack ? (
|
|
70
70
|
<BackButton aria-label={intl.formatMessage(messages.back)} onClick={onGoBack} />
|
|
71
71
|
) : (
|
|
72
|
-
logo
|
|
72
|
+
<div className="np-flow-header__left">{logo}</div>
|
|
73
73
|
)}
|
|
74
74
|
{isSmall && (
|
|
75
75
|
<AnimatedLabel
|
|
@@ -81,7 +81,17 @@ const FlowNavigation = ({
|
|
|
81
81
|
</>
|
|
82
82
|
}
|
|
83
83
|
rightContent={
|
|
84
|
-
<div
|
|
84
|
+
<div
|
|
85
|
+
className={classNames(
|
|
86
|
+
'np-flow-header__right',
|
|
87
|
+
'd-flex',
|
|
88
|
+
'align-items-center',
|
|
89
|
+
'justify-content-end',
|
|
90
|
+
{
|
|
91
|
+
'order-2': isLarge,
|
|
92
|
+
},
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
85
95
|
{newAvatar}
|
|
86
96
|
{newAvatar && closeButton && <span className="m-x-1" />}
|
|
87
97
|
{closeButton}
|
|
@@ -18,7 +18,7 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
|
|
|
18
18
|
AnimatedLabel
|
|
19
19
|
</div>
|
|
20
20
|
<div
|
|
21
|
-
class="d-flex align-items-center"
|
|
21
|
+
class="np-flow-header__right d-flex align-items-center justify-content-end"
|
|
22
22
|
>
|
|
23
23
|
<div
|
|
24
24
|
class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
|
|
@@ -120,14 +120,18 @@ exports[`FlowNavigation renders as expected 1`] = `
|
|
|
120
120
|
<div
|
|
121
121
|
class="np-flow-header d-flex flex-wrap align-items-center justify-content-between flex__item--12 np-flow-navigation__content p-x-3 np-flow-navigation--sm np-flow-navigation--lg"
|
|
122
122
|
>
|
|
123
|
-
<img
|
|
124
|
-
alt="logo"
|
|
125
|
-
height="24"
|
|
126
|
-
src="logo.svg"
|
|
127
|
-
width="138"
|
|
128
|
-
/>
|
|
129
123
|
<div
|
|
130
|
-
class="
|
|
124
|
+
class="np-flow-header__left"
|
|
125
|
+
>
|
|
126
|
+
<img
|
|
127
|
+
alt="logo"
|
|
128
|
+
height="24"
|
|
129
|
+
src="logo.svg"
|
|
130
|
+
width="138"
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
<div
|
|
134
|
+
class="np-flow-header__right d-flex align-items-center justify-content-end order-2"
|
|
131
135
|
>
|
|
132
136
|
<div
|
|
133
137
|
class="tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
|
package/src/i18n/en.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 years",
|
|
16
16
|
"neptune.DateLookup.year": "year",
|
|
17
17
|
"neptune.FlowNavigation.back": "back to previous step",
|
|
18
|
+
"neptune.Info.ariaLabel": "More information",
|
|
18
19
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
19
20
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
20
21
|
"neptune.Select.searchPlaceholder": "Search...",
|
package/src/info/Info.spec.js
CHANGED
|
@@ -3,11 +3,11 @@ import { act, render, fireEvent, waitFor, screen } from '../test-utils';
|
|
|
3
3
|
import Info, { InfoPresentation } from '.';
|
|
4
4
|
|
|
5
5
|
describe('Info', () => {
|
|
6
|
+
const defaultScreenReaderLabel = 'More information';
|
|
6
7
|
const props = {
|
|
7
8
|
content: 'content',
|
|
8
9
|
className: 'className',
|
|
9
10
|
title: 'title',
|
|
10
|
-
'aria-label': 'aria-label',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
it('calls onClick on click event', async () => {
|
|
@@ -57,9 +57,15 @@ describe('Info', () => {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
it('accepts custom label for screen readers', () => {
|
|
61
|
+
const customScreenReaderLabel = 'Custom message';
|
|
62
|
+
render(<Info {...props} aria-label={customScreenReaderLabel} />);
|
|
63
|
+
|
|
64
|
+
expect(screen.getByLabelText(customScreenReaderLabel)).toBeInTheDocument();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const getTriggerButton = () => screen.queryByLabelText(defaultScreenReaderLabel);
|
|
68
|
+
const getPopover = () => screen.queryByRole('dialog');
|
|
63
69
|
const getModal = () => screen.queryByRole('dialog');
|
|
64
70
|
|
|
65
71
|
const openPopover = async () => {
|
package/src/info/Info.tsx
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { QuestionMarkCircle as HelpCircleIcon } from '@transferwise/icons';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
4
5
|
|
|
5
6
|
import { Size, Position, SizeSmall, SizeLarge } from '../common';
|
|
6
7
|
import Modal from '../modal';
|
|
7
8
|
import Popover from '../popover';
|
|
8
9
|
|
|
10
|
+
import messages from './Info.messages';
|
|
9
11
|
import { InfoPresentation } from './infoPresentations';
|
|
10
12
|
|
|
11
13
|
export interface Props {
|
|
12
|
-
'aria-label'
|
|
14
|
+
'aria-label'?: string;
|
|
13
15
|
/**
|
|
14
16
|
* Extra classes applied to Info
|
|
15
17
|
*/
|
|
@@ -47,8 +49,9 @@ const Info = ({
|
|
|
47
49
|
'aria-label': ariaLabel,
|
|
48
50
|
preferredPlacement = Position.BOTTOM,
|
|
49
51
|
}: Props) => {
|
|
52
|
+
const intl = useIntl();
|
|
50
53
|
const [open, setOpen] = useState(false);
|
|
51
|
-
|
|
54
|
+
ariaLabel ??= intl.formatMessage(messages.ariaLabel);
|
|
52
55
|
const isModal = presentation === InfoPresentation.MODAL;
|
|
53
56
|
const isSmall = size === Size.SMALL;
|
|
54
57
|
|