@transferwise/components 45.21.3 → 45.22.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 +90 -76
- package/build/index.esm.js.map +1 -1
- package/build/index.js +90 -76
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +1 -1
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/overlayHeader/OverlayHeader.css +1 -1
- package/build/types/common/flowHeader/FlowHeader.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts +1 -2
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
- package/build/types/flowNavigation/backButton/BackButton.d.ts +10 -11
- package/build/types/flowNavigation/backButton/BackButton.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +5 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/flowHeader/FlowHeader.tsx +4 -22
- package/src/common/flowHeader/__snapshots__/FlowHeader.spec.js.snap +6 -22
- package/src/flowNavigation/FlowNavigation.css +1 -1
- package/src/flowNavigation/FlowNavigation.less +0 -9
- package/src/flowNavigation/FlowNavigation.spec.js +3 -3
- package/src/flowNavigation/FlowNavigation.story.js +22 -189
- package/src/flowNavigation/FlowNavigation.tsx +22 -27
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +18 -26
- package/src/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/src/flowNavigation/animatedLabel/AnimatedLabel.less +0 -6
- package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +7 -21
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +8 -17
- package/src/flowNavigation/animatedLabel/__snapshots__/AnimatedLabel.spec.js.snap +4 -4
- package/src/flowNavigation/backButton/BackButton.js +14 -9
- package/src/flowNavigation/backButton/BackButton.spec.js +3 -2
- package/src/flowNavigation/backButton/__snapshots__/BackButton.spec.js.snap +28 -21
- package/src/inputs/SelectInput.css +1 -1
- package/src/inputs/SelectInput.less +7 -10
- package/src/inputs/SelectInput.spec.tsx +40 -0
- package/src/inputs/SelectInput.story.tsx +18 -0
- package/src/inputs/SelectInput.tsx +46 -12
- package/src/inputs/_BottomSheet.less +1 -1
- package/src/inputs/_Popover.less +1 -0
- package/src/main.css +1 -1
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/overlayHeader/OverlayHeader.js +6 -4
- package/src/overlayHeader/OverlayHeader.less +0 -8
- package/src/overlayHeader/OverlayHeader.spec.js +1 -1
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.js.snap +10 -14
- package/src/flowNavigation/animatedLabel/AnimatedLabel.story.js +0 -22
package/build/index.js
CHANGED
|
@@ -5430,19 +5430,8 @@ const FlowHeader = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
5430
5430
|
const isVertical = layout === exports.Layout.VERTICAL;
|
|
5431
5431
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
5432
5432
|
ref: reference,
|
|
5433
|
-
className: classNames__default.default('np-flow-header', 'd-flex', 'flex-wrap', 'align-items-center', className),
|
|
5434
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5435
|
-
className: classNames__default.default('np-flow-header__left', {
|
|
5436
|
-
'flex__item--8': isVertical
|
|
5437
|
-
}),
|
|
5438
|
-
children: leftContent
|
|
5439
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5440
|
-
className: classNames__default.default('align-items-center', 'd-flex', 'np-flow-header__right', 'justify-content-end', {
|
|
5441
|
-
'flex__item--4 ': isVertical,
|
|
5442
|
-
'order-2': !isVertical
|
|
5443
|
-
}),
|
|
5444
|
-
children: rightContent
|
|
5445
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5433
|
+
className: classNames__default.default('np-flow-header', 'd-flex', 'flex-wrap', 'align-items-center', 'justify-content-between', 'flex__item--12', className),
|
|
5434
|
+
children: [leftContent, rightContent, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5446
5435
|
className: classNames__default.default('align-items-center', 'd-flex', 'justify-content-center', {
|
|
5447
5436
|
'flex__item--12': isVertical,
|
|
5448
5437
|
'order-1 flex-grow-1': !isVertical
|
|
@@ -5745,19 +5734,16 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
5745
5734
|
const AnimatedLabel = ({
|
|
5746
5735
|
activeLabel,
|
|
5747
5736
|
className,
|
|
5748
|
-
labels
|
|
5749
|
-
'aria-label': ariaLabel
|
|
5737
|
+
labels
|
|
5750
5738
|
}) => {
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
className: classNames__default.default('np-animated-label', 'np-text-body-large-bold', className),
|
|
5739
|
+
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
5740
|
+
type: exports.Typography.BODY_LARGE_BOLD,
|
|
5741
|
+
className: classNames__default.default('np-animated-label', className),
|
|
5755
5742
|
children: labels.map((label, index) => {
|
|
5756
5743
|
const nextLabel = index - 1;
|
|
5757
5744
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5758
|
-
className: classNames__default.default('text-xs-
|
|
5759
|
-
'np-animated-label--in': index === activeLabel
|
|
5760
|
-
'np-animated-label--out': nextLabel === activeLabel && nextLabel !== numberLabels
|
|
5745
|
+
className: classNames__default.default('text-xs-center', {
|
|
5746
|
+
'np-animated-label--in text-ellipsis': index === activeLabel
|
|
5761
5747
|
}),
|
|
5762
5748
|
children: label
|
|
5763
5749
|
}, nextLabel);
|
|
@@ -5766,18 +5752,24 @@ const AnimatedLabel = ({
|
|
|
5766
5752
|
};
|
|
5767
5753
|
|
|
5768
5754
|
const BackButton = ({
|
|
5769
|
-
label,
|
|
5770
5755
|
className,
|
|
5771
|
-
onClick
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
children:
|
|
5777
|
-
|
|
5778
|
-
|
|
5756
|
+
onClick,
|
|
5757
|
+
'aria-label': ariaLabel
|
|
5758
|
+
}) => /*#__PURE__*/jsxRuntime.jsx(Avatar, {
|
|
5759
|
+
type: exports.AvatarType.ICON,
|
|
5760
|
+
size: 40,
|
|
5761
|
+
children: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
5762
|
+
type: "button",
|
|
5763
|
+
"aria-label": ariaLabel,
|
|
5764
|
+
className: classNames__default.default('np-back-button', 'btn-unstyled', className),
|
|
5765
|
+
onClick: onClick,
|
|
5766
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.ArrowLeft, {
|
|
5767
|
+
size: 24
|
|
5768
|
+
})
|
|
5769
|
+
})
|
|
5779
5770
|
});
|
|
5780
5771
|
BackButton.propTypes = {
|
|
5772
|
+
'aria-label': PropTypes__default.default.string.isRequired,
|
|
5781
5773
|
className: PropTypes__default.default.string,
|
|
5782
5774
|
label: PropTypes__default.default.element,
|
|
5783
5775
|
onClick: PropTypes__default.default.func
|
|
@@ -5807,21 +5799,9 @@ const FlowNavigation = ({
|
|
|
5807
5799
|
onClick: onClose
|
|
5808
5800
|
});
|
|
5809
5801
|
const isSmall = clientWidth != null && clientWidth < exports.Breakpoint.SMALL;
|
|
5802
|
+
const isLarge = clientWidth != null && clientWidth >= exports.Breakpoint.LARGE;
|
|
5810
5803
|
const newAvatar = done ? null : avatar;
|
|
5811
|
-
const
|
|
5812
|
-
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5813
|
-
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
5814
|
-
children: displayGoBack ? /*#__PURE__*/jsxRuntime.jsx(BackButton$1, {
|
|
5815
|
-
label: /*#__PURE__*/jsxRuntime.jsx(AnimatedLabel, {
|
|
5816
|
-
className: "m-x-1",
|
|
5817
|
-
labels: steps.map(step => step.label),
|
|
5818
|
-
activeLabel: activeStep - 1,
|
|
5819
|
-
"aria-label": intl.formatMessage(messages$5.back)
|
|
5820
|
-
}),
|
|
5821
|
-
onClick: onGoBack
|
|
5822
|
-
}) : logo
|
|
5823
|
-
});
|
|
5824
|
-
};
|
|
5804
|
+
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5825
5805
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5826
5806
|
ref: reference,
|
|
5827
5807
|
className: classNames__default.default('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {
|
|
@@ -5833,12 +5813,24 @@ const FlowNavigation = ({
|
|
|
5833
5813
|
'np-flow-navigation--xs-max': isSmall,
|
|
5834
5814
|
// Size switches on parent container which may or may not have the same size as the window.
|
|
5835
5815
|
'np-flow-navigation--sm': clientWidth != null && clientWidth >= exports.Breakpoint.SMALL,
|
|
5836
|
-
'np-flow-navigation--lg':
|
|
5816
|
+
'np-flow-navigation--lg': isLarge
|
|
5817
|
+
}),
|
|
5818
|
+
leftContent: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5819
|
+
children: [isSmall && displayGoBack ? /*#__PURE__*/jsxRuntime.jsx(BackButton$1, {
|
|
5820
|
+
"aria-label": intl.formatMessage(messages$5.back),
|
|
5821
|
+
onClick: onGoBack
|
|
5822
|
+
}) : logo, isSmall && /*#__PURE__*/jsxRuntime.jsx(AnimatedLabel, {
|
|
5823
|
+
className: "m-x-1",
|
|
5824
|
+
labels: steps.map(step => step.label),
|
|
5825
|
+
activeLabel: activeStep
|
|
5826
|
+
})]
|
|
5837
5827
|
}),
|
|
5838
|
-
|
|
5839
|
-
|
|
5828
|
+
rightContent: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
5829
|
+
className: classNames__default.default('d-flex', 'align-items-center', {
|
|
5830
|
+
'order-2': isLarge
|
|
5831
|
+
}),
|
|
5840
5832
|
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
5841
|
-
className: "
|
|
5833
|
+
className: "m-x-1"
|
|
5842
5834
|
}), closeButton]
|
|
5843
5835
|
}),
|
|
5844
5836
|
bottomContent: !done && /*#__PURE__*/jsxRuntime.jsx(Stepper, {
|
|
@@ -6783,6 +6775,7 @@ function SelectInput({
|
|
|
6783
6775
|
value: controlledValue,
|
|
6784
6776
|
compareValues,
|
|
6785
6777
|
renderValue = wrapInFragment,
|
|
6778
|
+
renderFooter,
|
|
6786
6779
|
renderTrigger = defaultRenderTrigger,
|
|
6787
6780
|
filterable,
|
|
6788
6781
|
filterPlaceholder,
|
|
@@ -6856,6 +6849,7 @@ function SelectInput({
|
|
|
6856
6849
|
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputOptions, {
|
|
6857
6850
|
items: items,
|
|
6858
6851
|
renderValue: renderValue,
|
|
6852
|
+
renderFooter: renderFooter,
|
|
6859
6853
|
filterable: filterable,
|
|
6860
6854
|
filterPlaceholder: filterPlaceholder,
|
|
6861
6855
|
searchInputRef: searchInputRef,
|
|
@@ -6898,29 +6892,32 @@ const SelectInputOptionsContainer = /*#__PURE__*/React.forwardRef(function Selec
|
|
|
6898
6892
|
React.useEffect(() => {
|
|
6899
6893
|
handleAriaActiveDescendantChange(ariaActiveDescendant);
|
|
6900
6894
|
}, [ariaActiveDescendant, handleAriaActiveDescendantChange]);
|
|
6901
|
-
return (
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6895
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6896
|
+
ref: ref,
|
|
6897
|
+
role: "none",
|
|
6898
|
+
onKeyDown: event => {
|
|
6899
|
+
// Prevent confirmation close without an active item
|
|
6900
|
+
if (event.key === 'Enter' && ariaActiveDescendant == null) {
|
|
6901
|
+
return;
|
|
6902
|
+
}
|
|
6903
|
+
// Prevent absorbing actions early
|
|
6904
|
+
if (event.key === 'Escape' || event.key === 'Tab') {
|
|
6905
|
+
onKeyDown?.({
|
|
6906
|
+
...event,
|
|
6907
|
+
preventDefault: () => {},
|
|
6908
|
+
stopPropagation: () => {}
|
|
6909
|
+
});
|
|
6910
|
+
return;
|
|
6911
|
+
}
|
|
6912
|
+
onKeyDown?.(event);
|
|
6913
|
+
},
|
|
6914
|
+
...restProps
|
|
6915
|
+
});
|
|
6920
6916
|
});
|
|
6921
6917
|
function SelectInputOptions({
|
|
6922
6918
|
items,
|
|
6923
6919
|
renderValue = wrapInFragment,
|
|
6920
|
+
renderFooter,
|
|
6924
6921
|
filterable = false,
|
|
6925
6922
|
filterPlaceholder,
|
|
6926
6923
|
searchInputRef,
|
|
@@ -6935,14 +6932,14 @@ function SelectInputOptions({
|
|
|
6935
6932
|
}
|
|
6936
6933
|
return undefined;
|
|
6937
6934
|
}, [filterable, query]);
|
|
6938
|
-
const
|
|
6935
|
+
const resultsEmpty = needle != null && filterSelectInputItems(items, needle).length === 0;
|
|
6939
6936
|
const listboxContainerRef = React.useRef(null);
|
|
6940
6937
|
React.useEffect(() => {
|
|
6941
6938
|
if (listboxContainerRef.current != null) {
|
|
6942
6939
|
listboxContainerRef.current.style.setProperty('--initial-height', `${listboxContainerRef.current.offsetHeight}px`);
|
|
6943
6940
|
}
|
|
6944
6941
|
}, []);
|
|
6945
|
-
const showStatus =
|
|
6942
|
+
const showStatus = resultsEmpty;
|
|
6946
6943
|
const statusId = reactId.useId();
|
|
6947
6944
|
const listboxId = reactId.useId();
|
|
6948
6945
|
return /*#__PURE__*/jsxRuntime.jsxs(react$1.Listbox.Options, {
|
|
@@ -6978,10 +6975,10 @@ function SelectInputOptions({
|
|
|
6978
6975
|
setQuery(event.currentTarget.value);
|
|
6979
6976
|
}
|
|
6980
6977
|
})
|
|
6981
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsxs("
|
|
6978
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsxs("section", {
|
|
6982
6979
|
ref: listboxContainerRef,
|
|
6983
6980
|
className: classNames__default.default('np-select-input-listbox-container', items.some(item => item.type === 'group') && 'np-select-input-listbox-container--has-group'),
|
|
6984
|
-
children: [
|
|
6981
|
+
children: [resultsEmpty ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6985
6982
|
id: statusId,
|
|
6986
6983
|
className: "np-select-input-options-status",
|
|
6987
6984
|
children: [/*#__PURE__*/jsxRuntime.jsx(icons.CrossCircle, {
|
|
@@ -7002,7 +6999,22 @@ function SelectInputOptions({
|
|
|
7002
6999
|
renderValue: renderValue,
|
|
7003
7000
|
needle: needle
|
|
7004
7001
|
}, index))
|
|
7005
|
-
})
|
|
7002
|
+
}), renderFooter != null ? /*#__PURE__*/jsxRuntime.jsx("footer", {
|
|
7003
|
+
className: "np-select-input-footer",
|
|
7004
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7005
|
+
role: "none",
|
|
7006
|
+
onKeyDown: event => {
|
|
7007
|
+
// Prevent interfering with Headless UI
|
|
7008
|
+
if (event.key !== 'Escape') {
|
|
7009
|
+
event.stopPropagation();
|
|
7010
|
+
}
|
|
7011
|
+
},
|
|
7012
|
+
children: renderFooter({
|
|
7013
|
+
resultsEmpty,
|
|
7014
|
+
normalizedQuery: needle
|
|
7015
|
+
})
|
|
7016
|
+
})
|
|
7017
|
+
}) : null]
|
|
7006
7018
|
})]
|
|
7007
7019
|
});
|
|
7008
7020
|
}
|
|
@@ -7059,7 +7071,7 @@ function SelectInputGroupItemView({
|
|
|
7059
7071
|
className: classNames__default.default(needle === null && 'np-select-input-group-item--without-needle'),
|
|
7060
7072
|
children: [needle == null ? /*#__PURE__*/jsxRuntime.jsx("header", {
|
|
7061
7073
|
id: headerId,
|
|
7062
|
-
role: "
|
|
7074
|
+
role: "none",
|
|
7063
7075
|
className: "np-select-input-group-item-header np-text-title-group",
|
|
7064
7076
|
children: item.label
|
|
7065
7077
|
}) : null, item.options.map((option, index) => /*#__PURE__*/jsxRuntime.jsx(SelectInputItemView
|
|
@@ -8837,6 +8849,7 @@ const OverlayHeader = ({
|
|
|
8837
8849
|
logo
|
|
8838
8850
|
}) => {
|
|
8839
8851
|
const closeButton = onClose && /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
8852
|
+
size: exports.Size.LARGE,
|
|
8840
8853
|
onClick: onClose
|
|
8841
8854
|
});
|
|
8842
8855
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -8844,9 +8857,10 @@ const OverlayHeader = ({
|
|
|
8844
8857
|
children: /*#__PURE__*/jsxRuntime.jsx(FlowHeader, {
|
|
8845
8858
|
className: "np-overlay-header__content p-a-3",
|
|
8846
8859
|
leftContent: logo,
|
|
8847
|
-
rightContent: /*#__PURE__*/jsxRuntime.jsxs(
|
|
8860
|
+
rightContent: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8861
|
+
className: classNames__default.default('d-flex', 'align-items-center', 'order-2'),
|
|
8848
8862
|
children: [avatar, avatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8849
|
-
className:
|
|
8863
|
+
className: classNames__default.default('m-x-1')
|
|
8850
8864
|
}), closeButton]
|
|
8851
8865
|
})
|
|
8852
8866
|
})
|