@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
package/build/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...",
|
package/build/index.esm.js
CHANGED
|
@@ -789,7 +789,7 @@ const ActionOption = ({
|
|
|
789
789
|
});
|
|
790
790
|
};
|
|
791
791
|
|
|
792
|
-
var messages$
|
|
792
|
+
var messages$b = defineMessages({
|
|
793
793
|
ariaLabel: {
|
|
794
794
|
id: "neptune.CloseButton.ariaLabel"
|
|
795
795
|
}
|
|
@@ -805,7 +805,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
|
|
|
805
805
|
testId
|
|
806
806
|
}, reference) {
|
|
807
807
|
const intl = useIntl();
|
|
808
|
-
ariaLabel ??= intl.formatMessage(messages$
|
|
808
|
+
ariaLabel ??= intl.formatMessage(messages$b.ariaLabel);
|
|
809
809
|
const Icon = filled ? CrossCircleFill : Cross;
|
|
810
810
|
return /*#__PURE__*/jsx("button", {
|
|
811
811
|
ref: reference,
|
|
@@ -825,7 +825,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
|
|
|
825
825
|
});
|
|
826
826
|
});
|
|
827
827
|
|
|
828
|
-
var messages$
|
|
828
|
+
var messages$a = defineMessages({
|
|
829
829
|
opensInNewTab: {
|
|
830
830
|
id: "neptune.Link.opensInNewTab"
|
|
831
831
|
}
|
|
@@ -854,7 +854,7 @@ const Link = ({
|
|
|
854
854
|
onClick: onClick,
|
|
855
855
|
...props,
|
|
856
856
|
children: [children, " ", isBlank && /*#__PURE__*/jsx(NavigateAway, {
|
|
857
|
-
title: formatMessage(messages$
|
|
857
|
+
title: formatMessage(messages$a.opensInNewTab)
|
|
858
858
|
})]
|
|
859
859
|
});
|
|
860
860
|
};
|
|
@@ -2216,7 +2216,7 @@ ProcessIndicator.defaultProps = {
|
|
|
2216
2216
|
};
|
|
2217
2217
|
var ProcessIndicator$1 = ProcessIndicator;
|
|
2218
2218
|
|
|
2219
|
-
var messages$
|
|
2219
|
+
var messages$9 = defineMessages({
|
|
2220
2220
|
loadingAriaLabel: {
|
|
2221
2221
|
id: "neptune.Button.loadingAriaLabel"
|
|
2222
2222
|
}
|
|
@@ -2335,7 +2335,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
2335
2335
|
className: classes,
|
|
2336
2336
|
...props,
|
|
2337
2337
|
"aria-live": loading ? 'polite' : 'off',
|
|
2338
|
-
"aria-label": loading ? intl.formatMessage(messages$
|
|
2338
|
+
"aria-label": loading ? intl.formatMessage(messages$9.loadingAriaLabel) : rest['aria-label'],
|
|
2339
2339
|
children: [children, loading && /*#__PURE__*/jsx(ProcessIndicator$1, {
|
|
2340
2340
|
size: processIndicatorSize(),
|
|
2341
2341
|
className: "btn-loader"
|
|
@@ -2628,7 +2628,7 @@ const Chip = ({
|
|
|
2628
2628
|
}, value);
|
|
2629
2629
|
};
|
|
2630
2630
|
|
|
2631
|
-
var messages$
|
|
2631
|
+
var messages$8 = defineMessages({
|
|
2632
2632
|
ariaLabel: {
|
|
2633
2633
|
id: "neptune.Chips.ariaLabel"
|
|
2634
2634
|
}
|
|
@@ -2660,7 +2660,7 @@ const Chips = ({
|
|
|
2660
2660
|
value: chip.value,
|
|
2661
2661
|
label: chip.label,
|
|
2662
2662
|
closeButton: {
|
|
2663
|
-
'aria-label': intl.formatMessage(messages$
|
|
2663
|
+
'aria-label': intl.formatMessage(messages$8.ariaLabel, {
|
|
2664
2664
|
choice: chip.label
|
|
2665
2665
|
})
|
|
2666
2666
|
},
|
|
@@ -2768,7 +2768,7 @@ const validDateObject = dateObject => dateObject instanceof Date && !isNaN(dateO
|
|
|
2768
2768
|
|
|
2769
2769
|
const isMonthAndYearFormat = dateString => validDateString(dateString) && dateString.split('-').length < 3;
|
|
2770
2770
|
|
|
2771
|
-
var messages$
|
|
2771
|
+
var messages$7 = defineMessages({
|
|
2772
2772
|
monthLabel: {
|
|
2773
2773
|
id: "neptune.DateInput.month.label"
|
|
2774
2774
|
},
|
|
@@ -2846,12 +2846,12 @@ const DateInput = ({
|
|
|
2846
2846
|
const [month, setMonth] = useState(() => getExplodedDate('month'));
|
|
2847
2847
|
const [year, setYear] = useState(() => getExplodedDate('year'));
|
|
2848
2848
|
const [lastBroadcastedValue, setLastBroadcastedValue] = useState(getDateObject);
|
|
2849
|
-
dayLabel = dayLabel || formatMessage(messages$
|
|
2850
|
-
monthLabel = monthLabel || formatMessage(messages$
|
|
2851
|
-
yearLabel = yearLabel || formatMessage(messages$
|
|
2849
|
+
dayLabel = dayLabel || formatMessage(messages$7.dayLabel);
|
|
2850
|
+
monthLabel = monthLabel || formatMessage(messages$7.monthLabel);
|
|
2851
|
+
yearLabel = yearLabel || formatMessage(messages$7.yearLabel);
|
|
2852
2852
|
placeholders = {
|
|
2853
2853
|
day: placeholders?.day || 'DD',
|
|
2854
|
-
month: placeholders?.month || formatMessage(messages$
|
|
2854
|
+
month: placeholders?.month || formatMessage(messages$7.monthLabel),
|
|
2855
2855
|
year: placeholders?.year || 'YYYY'
|
|
2856
2856
|
};
|
|
2857
2857
|
const getDateAsString = date => {
|
|
@@ -3282,7 +3282,7 @@ const ResponsivePanel = /*#__PURE__*/forwardRef(({
|
|
|
3282
3282
|
});
|
|
3283
3283
|
var ResponsivePanel$1 = ResponsivePanel;
|
|
3284
3284
|
|
|
3285
|
-
var messages$
|
|
3285
|
+
var messages$6 = defineMessages({
|
|
3286
3286
|
ariaLabel: {
|
|
3287
3287
|
id: "neptune.ClearButton.ariaLabel"
|
|
3288
3288
|
}
|
|
@@ -3345,7 +3345,7 @@ const DateTrigger = ({
|
|
|
3345
3345
|
className: "input-group-addon",
|
|
3346
3346
|
children: /*#__PURE__*/jsx(CloseButton, {
|
|
3347
3347
|
className: `clear-btn clear-btn--${size}`,
|
|
3348
|
-
"aria-label": formatMessage(messages$
|
|
3348
|
+
"aria-label": formatMessage(messages$6.ariaLabel),
|
|
3349
3349
|
size: Size.SMALL,
|
|
3350
3350
|
onClick: event => {
|
|
3351
3351
|
event.stopPropagation();
|
|
@@ -3375,7 +3375,7 @@ DateTrigger.defaultProps = {
|
|
|
3375
3375
|
};
|
|
3376
3376
|
var DateTrigger$1 = DateTrigger;
|
|
3377
3377
|
|
|
3378
|
-
var messages$
|
|
3378
|
+
var messages$5 = defineMessages({
|
|
3379
3379
|
next: {
|
|
3380
3380
|
id: "neptune.DateLookup.next"
|
|
3381
3381
|
},
|
|
@@ -3418,7 +3418,7 @@ const DateHeader = ({
|
|
|
3418
3418
|
children: /*#__PURE__*/jsx("button", {
|
|
3419
3419
|
type: "button",
|
|
3420
3420
|
className: `d-inline-flex ${buttonClasses}`,
|
|
3421
|
-
"aria-label": `${intl.formatMessage(messages$
|
|
3421
|
+
"aria-label": `${intl.formatMessage(messages$5.previous)} ${dateMode}`,
|
|
3422
3422
|
onClick: onPreviousClick,
|
|
3423
3423
|
children: /*#__PURE__*/jsx(Chevron$1, {
|
|
3424
3424
|
orientation: Position.LEFT,
|
|
@@ -3429,7 +3429,7 @@ const DateHeader = ({
|
|
|
3429
3429
|
}), label && /*#__PURE__*/jsx("button", {
|
|
3430
3430
|
type: "button",
|
|
3431
3431
|
className: `tw-date-lookup-header-current ${buttonClasses}`,
|
|
3432
|
-
"aria-label": intl.formatMessage(messages$
|
|
3432
|
+
"aria-label": intl.formatMessage(messages$5.goTo20YearView),
|
|
3433
3433
|
onClick: onLabelClick,
|
|
3434
3434
|
children: label
|
|
3435
3435
|
}), /*#__PURE__*/jsx("div", {
|
|
@@ -3437,7 +3437,7 @@ const DateHeader = ({
|
|
|
3437
3437
|
children: /*#__PURE__*/jsx("button", {
|
|
3438
3438
|
type: "button",
|
|
3439
3439
|
className: `d-inline-flex ${buttonClasses}`,
|
|
3440
|
-
"aria-label": `${useIntl().formatMessage(messages$
|
|
3440
|
+
"aria-label": `${useIntl().formatMessage(messages$5.next)} ${dateMode}`,
|
|
3441
3441
|
onClick: onNextClick,
|
|
3442
3442
|
children: /*#__PURE__*/jsx(Chevron$1, {
|
|
3443
3443
|
orientation: Position.RIGHT,
|
|
@@ -3481,7 +3481,7 @@ class TableLink extends PureComponent {
|
|
|
3481
3481
|
};
|
|
3482
3482
|
calculateAriaLabel = (longTitle, title, active, type, formatMessage) => {
|
|
3483
3483
|
if (active) {
|
|
3484
|
-
return `${longTitle || title}, ${formatMessage(messages$
|
|
3484
|
+
return `${longTitle || title}, ${formatMessage(messages$5.selected)} ${formatMessage(messages$5[type])}`;
|
|
3485
3485
|
}
|
|
3486
3486
|
return longTitle || title;
|
|
3487
3487
|
};
|
|
@@ -3704,7 +3704,7 @@ class DayCalendar extends PureComponent {
|
|
|
3704
3704
|
month: monthFormat,
|
|
3705
3705
|
year: 'numeric'
|
|
3706
3706
|
}),
|
|
3707
|
-
dateMode: formatMessage(messages$
|
|
3707
|
+
dateMode: formatMessage(messages$5.month),
|
|
3708
3708
|
onLabelClick: onLabelClick,
|
|
3709
3709
|
onPreviousClick: this.selectPreviousMonth,
|
|
3710
3710
|
onNextClick: this.selectNextMonth
|
|
@@ -3832,7 +3832,7 @@ class MonthCalendar extends PureComponent {
|
|
|
3832
3832
|
} = this.props;
|
|
3833
3833
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
3834
3834
|
children: [/*#__PURE__*/jsx(DateHeader$1, {
|
|
3835
|
-
dateMode: formatMessage(messages$
|
|
3835
|
+
dateMode: formatMessage(messages$5.year),
|
|
3836
3836
|
label: formatDate(new Date(viewYear, 0), locale, {
|
|
3837
3837
|
year: 'numeric'
|
|
3838
3838
|
}),
|
|
@@ -3957,7 +3957,7 @@ class YearCalendar extends PureComponent {
|
|
|
3957
3957
|
} = this.props;
|
|
3958
3958
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
3959
3959
|
children: [/*#__PURE__*/jsx(DateHeader$1, {
|
|
3960
|
-
dateMode: formatMessage(messages$
|
|
3960
|
+
dateMode: formatMessage(messages$5.twentyYears),
|
|
3961
3961
|
onPreviousClick: this.selectPreviousYears,
|
|
3962
3962
|
onNextClick: this.selectNextYears
|
|
3963
3963
|
}), /*#__PURE__*/jsx(YearCalendarTable$1, {
|
|
@@ -5655,13 +5655,21 @@ const Stepper = ({
|
|
|
5655
5655
|
});
|
|
5656
5656
|
};
|
|
5657
5657
|
|
|
5658
|
+
var messages$4 = defineMessages({
|
|
5659
|
+
back: {
|
|
5660
|
+
id: "neptune.FlowNavigation.back"
|
|
5661
|
+
}
|
|
5662
|
+
});
|
|
5663
|
+
|
|
5658
5664
|
const AnimatedLabel = ({
|
|
5659
5665
|
activeLabel,
|
|
5660
5666
|
className,
|
|
5661
|
-
labels
|
|
5667
|
+
labels,
|
|
5668
|
+
'aria-label': ariaLabel
|
|
5662
5669
|
}) => {
|
|
5663
5670
|
const numberLabels = labels.length - 1;
|
|
5664
5671
|
return /*#__PURE__*/jsx("div", {
|
|
5672
|
+
"aria-label": ariaLabel,
|
|
5665
5673
|
className: classNames('np-animated-label', 'np-text-body-large-bold', className),
|
|
5666
5674
|
children: labels.map((label, index) => {
|
|
5667
5675
|
const nextLabel = index - 1;
|
|
@@ -5675,15 +5683,6 @@ const AnimatedLabel = ({
|
|
|
5675
5683
|
})
|
|
5676
5684
|
});
|
|
5677
5685
|
};
|
|
5678
|
-
AnimatedLabel.propTypes = {
|
|
5679
|
-
activeLabel: PropTypes.number.isRequired,
|
|
5680
|
-
className: PropTypes.string,
|
|
5681
|
-
labels: PropTypes.arrayOf(PropTypes.node).isRequired
|
|
5682
|
-
};
|
|
5683
|
-
AnimatedLabel.defaultProps = {
|
|
5684
|
-
className: undefined
|
|
5685
|
-
};
|
|
5686
|
-
var AnimatedLabel$1 = AnimatedLabel;
|
|
5687
5686
|
|
|
5688
5687
|
const BackButton = ({
|
|
5689
5688
|
label,
|
|
@@ -5718,6 +5717,7 @@ const FlowNavigation = ({
|
|
|
5718
5717
|
steps
|
|
5719
5718
|
}) => {
|
|
5720
5719
|
const reference = useRef(null);
|
|
5720
|
+
const intl = useIntl();
|
|
5721
5721
|
const [clientWidth] = useClientWidth({
|
|
5722
5722
|
ref: reference
|
|
5723
5723
|
});
|
|
@@ -5731,10 +5731,11 @@ const FlowNavigation = ({
|
|
|
5731
5731
|
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5732
5732
|
return /*#__PURE__*/jsx(Fragment, {
|
|
5733
5733
|
children: displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
|
|
5734
|
-
label: /*#__PURE__*/jsx(AnimatedLabel
|
|
5734
|
+
label: /*#__PURE__*/jsx(AnimatedLabel, {
|
|
5735
5735
|
className: "m-x-1",
|
|
5736
5736
|
labels: steps.map(step => step.label),
|
|
5737
|
-
activeLabel: activeStep - 1
|
|
5737
|
+
activeLabel: activeStep - 1,
|
|
5738
|
+
"aria-label": intl.formatMessage(messages$4.back)
|
|
5738
5739
|
}),
|
|
5739
5740
|
onClick: onGoBack
|
|
5740
5741
|
}) : logo
|
|
@@ -6675,7 +6676,7 @@ function SelectInputClearButton({
|
|
|
6675
6676
|
const intl = useIntl();
|
|
6676
6677
|
return /*#__PURE__*/jsx("button", {
|
|
6677
6678
|
type: "button",
|
|
6678
|
-
"aria-label": intl.formatMessage(messages$
|
|
6679
|
+
"aria-label": intl.formatMessage(messages$6.ariaLabel),
|
|
6679
6680
|
className: classNames(className, 'np-select-input-addon np-select-input-addon--interactive'),
|
|
6680
6681
|
onClick: onClick,
|
|
6681
6682
|
children: /*#__PURE__*/jsx(Cross, {
|
|
@@ -6832,7 +6833,12 @@ function SelectInputOptions({
|
|
|
6832
6833
|
listboxRef
|
|
6833
6834
|
}) {
|
|
6834
6835
|
const [query, setQuery] = useState('');
|
|
6835
|
-
const needle = useMemo(() =>
|
|
6836
|
+
const needle = useMemo(() => {
|
|
6837
|
+
if (filterable) {
|
|
6838
|
+
return query ? searchableString(query) : null;
|
|
6839
|
+
}
|
|
6840
|
+
return undefined;
|
|
6841
|
+
}, [filterable, query]);
|
|
6836
6842
|
const listboxContainerRef = useRef(null);
|
|
6837
6843
|
useEffect(() => {
|
|
6838
6844
|
if (listboxContainerRef.current != null) {
|
|
@@ -6944,7 +6950,7 @@ function SelectInputGroupItemView({
|
|
|
6944
6950
|
jsxs("section", {
|
|
6945
6951
|
role: "group",
|
|
6946
6952
|
"aria-labelledby": headerId,
|
|
6947
|
-
className: classNames(needle
|
|
6953
|
+
className: classNames(needle === null && 'np-select-input-group-item--without-needle'),
|
|
6948
6954
|
children: [needle == null ? /*#__PURE__*/jsx("header", {
|
|
6949
6955
|
id: headerId,
|
|
6950
6956
|
role: "presentation",
|
|
@@ -10675,6 +10681,7 @@ var en = {
|
|
|
10675
10681
|
"neptune.DateLookup.selected": "selected",
|
|
10676
10682
|
"neptune.DateLookup.twentyYears": "20 years",
|
|
10677
10683
|
"neptune.DateLookup.year": "year",
|
|
10684
|
+
"neptune.FlowNavigation.back": "back to previous step",
|
|
10678
10685
|
"neptune.Link.opensInNewTab": "(opens in new tab)",
|
|
10679
10686
|
"neptune.MoneyInput.Select.placeholder": "Select an option...",
|
|
10680
10687
|
"neptune.Select.searchPlaceholder": "Search...",
|