@transferwise/components 0.0.0-experimental-6d7ebae → 0.0.0-experimental-a087360
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 +47 -59
- package/build/index.esm.js.map +1 -1
- package/build/index.js +47 -59
- 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 +1 -2
- 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 +0 -4
- package/src/inputs/SelectInput.spec.tsx +0 -40
- package/src/inputs/SelectInput.story.tsx +0 -18
- package/src/inputs/SelectInput.tsx +3 -14
- 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.esm.js
CHANGED
|
@@ -5396,19 +5396,8 @@ const FlowHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
5396
5396
|
const isVertical = layout === Layout$1.VERTICAL;
|
|
5397
5397
|
return /*#__PURE__*/jsxs("div", {
|
|
5398
5398
|
ref: reference,
|
|
5399
|
-
className: classNames('np-flow-header', 'd-flex', 'flex-wrap', 'align-items-center', className),
|
|
5400
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
5401
|
-
className: classNames('np-flow-header__left', {
|
|
5402
|
-
'flex__item--8': isVertical
|
|
5403
|
-
}),
|
|
5404
|
-
children: leftContent
|
|
5405
|
-
}), /*#__PURE__*/jsx("div", {
|
|
5406
|
-
className: classNames('align-items-center', 'd-flex', 'np-flow-header__right', 'justify-content-end', {
|
|
5407
|
-
'flex__item--4 ': isVertical,
|
|
5408
|
-
'order-2': !isVertical
|
|
5409
|
-
}),
|
|
5410
|
-
children: rightContent
|
|
5411
|
-
}), /*#__PURE__*/jsx("div", {
|
|
5399
|
+
className: classNames('np-flow-header', 'd-flex', 'flex-wrap', 'align-items-center', 'justify-content-between', 'flex__item--12', className),
|
|
5400
|
+
children: [leftContent, rightContent, /*#__PURE__*/jsx("div", {
|
|
5412
5401
|
className: classNames('align-items-center', 'd-flex', 'justify-content-center', {
|
|
5413
5402
|
'flex__item--12': isVertical,
|
|
5414
5403
|
'order-1 flex-grow-1': !isVertical
|
|
@@ -5711,19 +5700,16 @@ var messages$5 = defineMessages({
|
|
|
5711
5700
|
const AnimatedLabel = ({
|
|
5712
5701
|
activeLabel,
|
|
5713
5702
|
className,
|
|
5714
|
-
labels
|
|
5715
|
-
'aria-label': ariaLabel
|
|
5703
|
+
labels
|
|
5716
5704
|
}) => {
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
className: classNames('np-animated-label', 'np-text-body-large-bold', className),
|
|
5705
|
+
return /*#__PURE__*/jsx(Body, {
|
|
5706
|
+
type: Typography.BODY_LARGE_BOLD,
|
|
5707
|
+
className: classNames('np-animated-label', className),
|
|
5721
5708
|
children: labels.map((label, index) => {
|
|
5722
5709
|
const nextLabel = index - 1;
|
|
5723
5710
|
return /*#__PURE__*/jsx("div", {
|
|
5724
|
-
className: classNames('text-xs-
|
|
5725
|
-
'np-animated-label--in': index === activeLabel
|
|
5726
|
-
'np-animated-label--out': nextLabel === activeLabel && nextLabel !== numberLabels
|
|
5711
|
+
className: classNames('text-xs-center', {
|
|
5712
|
+
'np-animated-label--in text-ellipsis': index === activeLabel
|
|
5727
5713
|
}),
|
|
5728
5714
|
children: label
|
|
5729
5715
|
}, nextLabel);
|
|
@@ -5732,18 +5718,24 @@ const AnimatedLabel = ({
|
|
|
5732
5718
|
};
|
|
5733
5719
|
|
|
5734
5720
|
const BackButton = ({
|
|
5735
|
-
label,
|
|
5736
5721
|
className,
|
|
5737
|
-
onClick
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
children:
|
|
5743
|
-
|
|
5744
|
-
|
|
5722
|
+
onClick,
|
|
5723
|
+
'aria-label': ariaLabel
|
|
5724
|
+
}) => /*#__PURE__*/jsx(Avatar, {
|
|
5725
|
+
type: AvatarType.ICON,
|
|
5726
|
+
size: 40,
|
|
5727
|
+
children: /*#__PURE__*/jsx("button", {
|
|
5728
|
+
type: "button",
|
|
5729
|
+
"aria-label": ariaLabel,
|
|
5730
|
+
className: classNames('np-back-button', 'btn-unstyled', className),
|
|
5731
|
+
onClick: onClick,
|
|
5732
|
+
children: /*#__PURE__*/jsx(ArrowLeft, {
|
|
5733
|
+
size: 24
|
|
5734
|
+
})
|
|
5735
|
+
})
|
|
5745
5736
|
});
|
|
5746
5737
|
BackButton.propTypes = {
|
|
5738
|
+
'aria-label': PropTypes.string.isRequired,
|
|
5747
5739
|
className: PropTypes.string,
|
|
5748
5740
|
label: PropTypes.element,
|
|
5749
5741
|
onClick: PropTypes.func
|
|
@@ -5773,21 +5765,9 @@ const FlowNavigation = ({
|
|
|
5773
5765
|
onClick: onClose
|
|
5774
5766
|
});
|
|
5775
5767
|
const isSmall = clientWidth != null && clientWidth < Breakpoint.SMALL;
|
|
5768
|
+
const isLarge = clientWidth != null && clientWidth >= Breakpoint.LARGE;
|
|
5776
5769
|
const newAvatar = done ? null : avatar;
|
|
5777
|
-
const
|
|
5778
|
-
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5779
|
-
return /*#__PURE__*/jsx(Fragment, {
|
|
5780
|
-
children: displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
|
|
5781
|
-
label: /*#__PURE__*/jsx(AnimatedLabel, {
|
|
5782
|
-
className: "m-x-1",
|
|
5783
|
-
labels: steps.map(step => step.label),
|
|
5784
|
-
activeLabel: activeStep - 1,
|
|
5785
|
-
"aria-label": intl.formatMessage(messages$5.back)
|
|
5786
|
-
}),
|
|
5787
|
-
onClick: onGoBack
|
|
5788
|
-
}) : logo
|
|
5789
|
-
});
|
|
5790
|
-
};
|
|
5770
|
+
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5791
5771
|
return /*#__PURE__*/jsx("div", {
|
|
5792
5772
|
ref: reference,
|
|
5793
5773
|
className: classNames('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {
|
|
@@ -5799,12 +5779,24 @@ const FlowNavigation = ({
|
|
|
5799
5779
|
'np-flow-navigation--xs-max': isSmall,
|
|
5800
5780
|
// Size switches on parent container which may or may not have the same size as the window.
|
|
5801
5781
|
'np-flow-navigation--sm': clientWidth != null && clientWidth >= Breakpoint.SMALL,
|
|
5802
|
-
'np-flow-navigation--lg':
|
|
5782
|
+
'np-flow-navigation--lg': isLarge
|
|
5803
5783
|
}),
|
|
5804
|
-
leftContent:
|
|
5805
|
-
|
|
5784
|
+
leftContent: /*#__PURE__*/jsxs(Fragment, {
|
|
5785
|
+
children: [isSmall && displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
|
|
5786
|
+
"aria-label": intl.formatMessage(messages$5.back),
|
|
5787
|
+
onClick: onGoBack
|
|
5788
|
+
}) : logo, isSmall && /*#__PURE__*/jsx(AnimatedLabel, {
|
|
5789
|
+
className: "m-x-1",
|
|
5790
|
+
labels: steps.map(step => step.label),
|
|
5791
|
+
activeLabel: activeStep
|
|
5792
|
+
})]
|
|
5793
|
+
}),
|
|
5794
|
+
rightContent: /*#__PURE__*/jsxs("div", {
|
|
5795
|
+
className: classNames('d-flex', 'align-items-center', {
|
|
5796
|
+
'order-2': isLarge
|
|
5797
|
+
}),
|
|
5806
5798
|
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsx("span", {
|
|
5807
|
-
className: "
|
|
5799
|
+
className: "m-x-1"
|
|
5808
5800
|
}), closeButton]
|
|
5809
5801
|
}),
|
|
5810
5802
|
bottomContent: !done && /*#__PURE__*/jsx(Stepper, {
|
|
@@ -6749,7 +6741,6 @@ function SelectInput({
|
|
|
6749
6741
|
value: controlledValue,
|
|
6750
6742
|
compareValues,
|
|
6751
6743
|
renderValue = wrapInFragment,
|
|
6752
|
-
renderFooter,
|
|
6753
6744
|
renderTrigger = defaultRenderTrigger,
|
|
6754
6745
|
filterable,
|
|
6755
6746
|
filterPlaceholder,
|
|
@@ -6823,7 +6814,6 @@ function SelectInput({
|
|
|
6823
6814
|
children: /*#__PURE__*/jsx(SelectInputOptions, {
|
|
6824
6815
|
items: items,
|
|
6825
6816
|
renderValue: renderValue,
|
|
6826
|
-
renderFooter: renderFooter,
|
|
6827
6817
|
filterable: filterable,
|
|
6828
6818
|
filterPlaceholder: filterPlaceholder,
|
|
6829
6819
|
searchInputRef: searchInputRef,
|
|
@@ -6889,7 +6879,6 @@ const SelectInputOptionsContainer = /*#__PURE__*/forwardRef(function SelectInput
|
|
|
6889
6879
|
function SelectInputOptions({
|
|
6890
6880
|
items,
|
|
6891
6881
|
renderValue = wrapInFragment,
|
|
6892
|
-
renderFooter,
|
|
6893
6882
|
filterable = false,
|
|
6894
6883
|
filterPlaceholder,
|
|
6895
6884
|
searchInputRef,
|
|
@@ -6947,7 +6936,7 @@ function SelectInputOptions({
|
|
|
6947
6936
|
setQuery(event.currentTarget.value);
|
|
6948
6937
|
}
|
|
6949
6938
|
})
|
|
6950
|
-
}) : null, /*#__PURE__*/jsxs("
|
|
6939
|
+
}) : null, /*#__PURE__*/jsxs("div", {
|
|
6951
6940
|
ref: listboxContainerRef,
|
|
6952
6941
|
className: classNames('np-select-input-listbox-container', items.some(item => item.type === 'group') && 'np-select-input-listbox-container--has-group'),
|
|
6953
6942
|
children: [empty ? /*#__PURE__*/jsxs("div", {
|
|
@@ -6971,10 +6960,7 @@ function SelectInputOptions({
|
|
|
6971
6960
|
renderValue: renderValue,
|
|
6972
6961
|
needle: needle
|
|
6973
6962
|
}, index))
|
|
6974
|
-
})
|
|
6975
|
-
className: "np-select-input-footer",
|
|
6976
|
-
children: renderFooter(needle)
|
|
6977
|
-
}) : null]
|
|
6963
|
+
})]
|
|
6978
6964
|
})]
|
|
6979
6965
|
});
|
|
6980
6966
|
}
|
|
@@ -8809,6 +8795,7 @@ const OverlayHeader = ({
|
|
|
8809
8795
|
logo
|
|
8810
8796
|
}) => {
|
|
8811
8797
|
const closeButton = onClose && /*#__PURE__*/jsx(CloseButton, {
|
|
8798
|
+
size: Size.LARGE,
|
|
8812
8799
|
onClick: onClose
|
|
8813
8800
|
});
|
|
8814
8801
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -8816,9 +8803,10 @@ const OverlayHeader = ({
|
|
|
8816
8803
|
children: /*#__PURE__*/jsx(FlowHeader, {
|
|
8817
8804
|
className: "np-overlay-header__content p-a-3",
|
|
8818
8805
|
leftContent: logo,
|
|
8819
|
-
rightContent: /*#__PURE__*/jsxs(
|
|
8806
|
+
rightContent: /*#__PURE__*/jsxs("div", {
|
|
8807
|
+
className: classNames('d-flex', 'align-items-center', 'order-2'),
|
|
8820
8808
|
children: [avatar, avatar && closeButton && /*#__PURE__*/jsx("span", {
|
|
8821
|
-
className:
|
|
8809
|
+
className: classNames('m-x-1')
|
|
8822
8810
|
}), closeButton]
|
|
8823
8811
|
})
|
|
8824
8812
|
})
|