@transferwise/components 45.19.1 → 45.19.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 +45 -38
- package/build/index.esm.js.map +1 -1
- package/build/index.js +45 -38
- package/build/index.js.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.messages.d.ts +8 -0
- package/build/types/flowNavigation/FlowNavigation.messages.d.ts.map +1 -0
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts +8 -16
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
- package/build/types/flowNavigation/animatedLabel/index.d.ts +1 -1
- package/build/types/flowNavigation/animatedLabel/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/button/Button.spec.js +12 -0
- package/src/button/Button.tsx +1 -1
- package/src/flowNavigation/FlowNavigation.messages.ts +8 -0
- package/src/flowNavigation/FlowNavigation.tsx +4 -0
- package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +6 -0
- package/src/flowNavigation/animatedLabel/{AnimatedLabel.js → AnimatedLabel.tsx} +18 -12
- package/src/i18n/en.json +1 -0
- package/src/inputs/SelectInput.tsx +8 -3
- /package/src/flowNavigation/animatedLabel/{index.js → index.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/flowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
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,sBA0ErB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowNavigation.messages.d.ts","sourceRoot":"","sources":["../../../src/flowNavigation/FlowNavigation.messages.ts"],"names":[],"mappings":";;;;;;AAEA,wBAKG"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
activeLabel:
|
|
4
|
-
className
|
|
5
|
-
labels:
|
|
6
|
-
|
|
7
|
-
declare namespace AnimatedLabel {
|
|
8
|
-
namespace propTypes {
|
|
9
|
-
const activeLabel: any;
|
|
10
|
-
const className: any;
|
|
11
|
-
const labels: any;
|
|
12
|
-
}
|
|
13
|
-
namespace defaultProps {
|
|
14
|
-
const className_1: undefined;
|
|
15
|
-
export { className_1 as className };
|
|
16
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AnimatedLabelProps {
|
|
3
|
+
activeLabel: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
labels: React.ReactNode[];
|
|
6
|
+
'aria-label': string;
|
|
17
7
|
}
|
|
8
|
+
declare const AnimatedLabel: ({ activeLabel, className, labels, "aria-label": ariaLabel, }: AnimatedLabelProps) => React.JSX.Element;
|
|
9
|
+
export default AnimatedLabel;
|
|
18
10
|
//# sourceMappingURL=AnimatedLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedLabel.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/animatedLabel/AnimatedLabel.
|
|
1
|
+
{"version":3,"file":"AnimatedLabel.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/animatedLabel/AnimatedLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,iEAKhB,kBAAkB,sBAwBpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from './AnimatedLabel';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/animatedLabel/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/animatedLabel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":";AAgDA,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB,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S,CAAC;CACxB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE,6BAA6B,+BAiD/B"}
|
package/package.json
CHANGED
|
@@ -85,6 +85,12 @@ describe('Button', () => {
|
|
|
85
85
|
render(<Button {...props} className="catsarethebest" />);
|
|
86
86
|
expect(screen.getByRole('button')).toHaveClass('catsarethebest');
|
|
87
87
|
});
|
|
88
|
+
|
|
89
|
+
it('passes through aria-label if set', () => {
|
|
90
|
+
render(<Button {...props} aria-label="unique label" />);
|
|
91
|
+
const loadingButton = screen.getByLabelText('unique label');
|
|
92
|
+
expect(loadingButton).toBeInTheDocument();
|
|
93
|
+
});
|
|
88
94
|
});
|
|
89
95
|
|
|
90
96
|
describe('onClick', () => {
|
|
@@ -170,6 +176,12 @@ describe('Button', () => {
|
|
|
170
176
|
expect(screen.getByRole('button', { name: 'loading' })).toBeInTheDocument();
|
|
171
177
|
});
|
|
172
178
|
|
|
179
|
+
it('loading button has aria-label of loading', () => {
|
|
180
|
+
render(<Button {...props} loading />);
|
|
181
|
+
const loadingButton = screen.getByLabelText('loading');
|
|
182
|
+
expect(loadingButton).toBeInTheDocument();
|
|
183
|
+
});
|
|
184
|
+
|
|
173
185
|
it('renders as block if block is true', () => {
|
|
174
186
|
expect(render(<Button {...props} block />).container).toMatchSnapshot();
|
|
175
187
|
});
|
package/src/button/Button.tsx
CHANGED
|
@@ -126,7 +126,7 @@ const Button = forwardRef<ButtonReferenceType, Props>(
|
|
|
126
126
|
className={classes}
|
|
127
127
|
{...props}
|
|
128
128
|
aria-live={loading ? 'polite' : 'off'}
|
|
129
|
-
aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) :
|
|
129
|
+
aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label']}
|
|
130
130
|
>
|
|
131
131
|
{children}
|
|
132
132
|
{loading && <ProcessIndicator size={processIndicatorSize()} className="btn-loader" />}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { useRef } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
4
5
|
|
|
5
6
|
import { Breakpoint, Layout } from '../common';
|
|
6
7
|
import { CloseButton } from '../common/closeButton';
|
|
@@ -9,6 +10,7 @@ import { useClientWidth } from '../common/hooks';
|
|
|
9
10
|
import Logo from '../logo';
|
|
10
11
|
import Stepper, { Step } from '../stepper/Stepper';
|
|
11
12
|
|
|
13
|
+
import messages from './FlowNavigation.messages';
|
|
12
14
|
import AnimatedLabel from './animatedLabel';
|
|
13
15
|
import BackButton from './backButton';
|
|
14
16
|
|
|
@@ -35,6 +37,7 @@ const FlowNavigation = ({
|
|
|
35
37
|
steps,
|
|
36
38
|
}: FlowNavigationProps) => {
|
|
37
39
|
const reference = useRef<HTMLDivElement>(null);
|
|
40
|
+
const intl = useIntl();
|
|
38
41
|
|
|
39
42
|
const [clientWidth] = useClientWidth({ ref: reference });
|
|
40
43
|
const closeButton = onClose != null && <CloseButton size="lg" onClick={onClose} />;
|
|
@@ -53,6 +56,7 @@ const FlowNavigation = ({
|
|
|
53
56
|
className="m-x-1"
|
|
54
57
|
labels={steps.map((step) => step.label)}
|
|
55
58
|
activeLabel={activeStep - 1}
|
|
59
|
+
aria-label={intl.formatMessage(messages.back)}
|
|
56
60
|
/>
|
|
57
61
|
}
|
|
58
62
|
onClick={onGoBack}
|
|
@@ -14,6 +14,12 @@ describe('AnimatedLabel', () => {
|
|
|
14
14
|
expect(container).toMatchSnapshot();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
it('renders aria-label if provided', () => {
|
|
18
|
+
render(<AnimatedLabel {...props} aria-label="hello" />);
|
|
19
|
+
const checkbox = screen.getByLabelText('hello');
|
|
20
|
+
expect(checkbox).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
|
|
17
23
|
it('renders only one label with class in', () => {
|
|
18
24
|
const { container } = render(<AnimatedLabel {...props} />);
|
|
19
25
|
expect(screen.getByText(props.labels[0])).toHaveClass('np-animated-label--in');
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export interface AnimatedLabelProps {
|
|
5
|
+
activeLabel: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
labels: React.ReactNode[];
|
|
8
|
+
'aria-label': string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const AnimatedLabel = ({
|
|
12
|
+
activeLabel,
|
|
13
|
+
className,
|
|
14
|
+
labels,
|
|
15
|
+
'aria-label': ariaLabel,
|
|
16
|
+
}: AnimatedLabelProps) => {
|
|
5
17
|
const numberLabels = labels.length - 1;
|
|
6
18
|
|
|
7
19
|
return (
|
|
8
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
aria-label={ariaLabel}
|
|
22
|
+
className={classNames('np-animated-label', 'np-text-body-large-bold', className)}
|
|
23
|
+
>
|
|
9
24
|
{labels.map((label, index) => {
|
|
10
25
|
const nextLabel = index - 1;
|
|
11
26
|
return (
|
|
@@ -24,13 +39,4 @@ const AnimatedLabel = ({ activeLabel, className, labels }) => {
|
|
|
24
39
|
);
|
|
25
40
|
};
|
|
26
41
|
|
|
27
|
-
AnimatedLabel.propTypes = {
|
|
28
|
-
activeLabel: PropTypes.number.isRequired,
|
|
29
|
-
className: PropTypes.string,
|
|
30
|
-
labels: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
31
|
-
};
|
|
32
|
-
AnimatedLabel.defaultProps = {
|
|
33
|
-
className: undefined,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
42
|
export default AnimatedLabel;
|
package/src/i18n/en.json
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"neptune.DateLookup.selected": "selected",
|
|
15
15
|
"neptune.DateLookup.twentyYears": "20 years",
|
|
16
16
|
"neptune.DateLookup.year": "year",
|
|
17
|
+
"neptune.FlowNavigation.back": "back to previous step",
|
|
17
18
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
18
19
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
19
20
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
@@ -360,7 +360,12 @@ function SelectInputOptions<T = string>({
|
|
|
360
360
|
listboxRef,
|
|
361
361
|
}: SelectInputOptionsProps<T>) {
|
|
362
362
|
const [query, setQuery] = useState('');
|
|
363
|
-
const needle = useMemo(() =>
|
|
363
|
+
const needle = useMemo(() => {
|
|
364
|
+
if (filterable) {
|
|
365
|
+
return query ? searchableString(query) : null;
|
|
366
|
+
}
|
|
367
|
+
return undefined;
|
|
368
|
+
}, [filterable, query]);
|
|
364
369
|
|
|
365
370
|
const listboxContainerRef = useRef<HTMLDivElement>(null);
|
|
366
371
|
useEffect(() => {
|
|
@@ -449,7 +454,7 @@ interface SelectInputItemViewProps<
|
|
|
449
454
|
I extends SelectInputItem<T | undefined> = SelectInputItem<T | undefined>,
|
|
450
455
|
> extends Required<Pick<SelectInputProps<T>, 'renderValue'>> {
|
|
451
456
|
item: I;
|
|
452
|
-
needle: string | null;
|
|
457
|
+
needle: string | null | undefined;
|
|
453
458
|
}
|
|
454
459
|
|
|
455
460
|
function SelectInputItemView<T = string>({
|
|
@@ -503,7 +508,7 @@ function SelectInputGroupItemView<T = string>({
|
|
|
503
508
|
<section
|
|
504
509
|
role="group"
|
|
505
510
|
aria-labelledby={headerId}
|
|
506
|
-
className={classNames(needle
|
|
511
|
+
className={classNames(needle === null && 'np-select-input-group-item--without-needle')}
|
|
507
512
|
>
|
|
508
513
|
{needle == null ? (
|
|
509
514
|
<header
|
|
File without changes
|