@transferwise/components 0.0.0-experimental-ded76ff → 0.0.0-experimental-adfacd1
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 +36 -31
- package/build/index.esm.js.map +1 -1
- package/build/index.js +36 -31
- 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/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/overlayHeader/OverlayHeader.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common/flowHeader/FlowHeader.tsx +9 -3
- package/src/common/flowHeader/__snapshots__/FlowHeader.spec.js.snap +2 -2
- 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 +24 -183
- package/src/flowNavigation/FlowNavigation.tsx +9 -13
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +14 -11
- 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/main.css +1 -1
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/overlayHeader/OverlayHeader.js +4 -2
- package/src/overlayHeader/OverlayHeader.less +0 -8
- package/src/overlayHeader/OverlayHeader.spec.js +1 -1
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.js.snap +3 -3
package/build/index.esm.js
CHANGED
|
@@ -5398,7 +5398,7 @@ const FlowHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
5398
5398
|
ref: reference,
|
|
5399
5399
|
className: classNames('np-flow-header', 'd-flex', 'flex-wrap', 'align-items-center', className),
|
|
5400
5400
|
children: [/*#__PURE__*/jsx("div", {
|
|
5401
|
-
className: classNames('np-flow-header__left', {
|
|
5401
|
+
className: classNames('np-flow-header__left', 'd-flex', 'align-items-center', 'justify-content-between', {
|
|
5402
5402
|
'flex__item--8': isVertical
|
|
5403
5403
|
}),
|
|
5404
5404
|
children: leftContent
|
|
@@ -5706,19 +5706,16 @@ var messages$5 = defineMessages({
|
|
|
5706
5706
|
const AnimatedLabel = ({
|
|
5707
5707
|
activeLabel,
|
|
5708
5708
|
className,
|
|
5709
|
-
labels
|
|
5710
|
-
'aria-label': ariaLabel
|
|
5709
|
+
labels
|
|
5711
5710
|
}) => {
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
className: classNames('np-animated-label', 'np-text-body-large-bold', className),
|
|
5711
|
+
return /*#__PURE__*/jsx(Body, {
|
|
5712
|
+
type: Typography.BODY_LARGE_BOLD,
|
|
5713
|
+
className: classNames('np-animated-label', className),
|
|
5716
5714
|
children: labels.map((label, index) => {
|
|
5717
5715
|
const nextLabel = index - 1;
|
|
5718
5716
|
return /*#__PURE__*/jsx("div", {
|
|
5719
|
-
className: classNames('text-xs-
|
|
5720
|
-
'np-animated-label--in': index === activeLabel
|
|
5721
|
-
'np-animated-label--out': nextLabel === activeLabel && nextLabel !== numberLabels
|
|
5717
|
+
className: classNames('text-xs-center', {
|
|
5718
|
+
'np-animated-label--in text-ellipsis': index === activeLabel
|
|
5722
5719
|
}),
|
|
5723
5720
|
children: label
|
|
5724
5721
|
}, nextLabel);
|
|
@@ -5727,18 +5724,24 @@ const AnimatedLabel = ({
|
|
|
5727
5724
|
};
|
|
5728
5725
|
|
|
5729
5726
|
const BackButton = ({
|
|
5730
|
-
label,
|
|
5731
5727
|
className,
|
|
5732
|
-
onClick
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
children:
|
|
5738
|
-
|
|
5739
|
-
|
|
5728
|
+
onClick,
|
|
5729
|
+
'aria-label': ariaLabel
|
|
5730
|
+
}) => /*#__PURE__*/jsx(Avatar, {
|
|
5731
|
+
type: AvatarType.ICON,
|
|
5732
|
+
size: 40,
|
|
5733
|
+
children: /*#__PURE__*/jsx("button", {
|
|
5734
|
+
type: "button",
|
|
5735
|
+
"aria-label": ariaLabel,
|
|
5736
|
+
className: classNames('np-back-button', 'btn-unstyled', className),
|
|
5737
|
+
onClick: onClick,
|
|
5738
|
+
children: /*#__PURE__*/jsx(ArrowLeft, {
|
|
5739
|
+
size: 24
|
|
5740
|
+
})
|
|
5741
|
+
})
|
|
5740
5742
|
});
|
|
5741
5743
|
BackButton.propTypes = {
|
|
5744
|
+
'aria-label': PropTypes.string.isRequired,
|
|
5742
5745
|
className: PropTypes.string,
|
|
5743
5746
|
label: PropTypes.element,
|
|
5744
5747
|
onClick: PropTypes.func
|
|
@@ -5771,16 +5774,17 @@ const FlowNavigation = ({
|
|
|
5771
5774
|
const newAvatar = done ? null : avatar;
|
|
5772
5775
|
const getLeftContentSmall = () => {
|
|
5773
5776
|
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5774
|
-
return /*#__PURE__*/
|
|
5775
|
-
children: displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
|
|
5776
|
-
label:
|
|
5777
|
-
className: "m-x-1",
|
|
5778
|
-
labels: steps.map(step => step.label),
|
|
5779
|
-
activeLabel: activeStep - 1,
|
|
5780
|
-
"aria-label": intl.formatMessage(messages$5.back)
|
|
5781
|
-
}),
|
|
5777
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
5778
|
+
children: [displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
|
|
5779
|
+
"aria-label": intl.formatMessage(messages$5.back),
|
|
5782
5780
|
onClick: onGoBack
|
|
5783
|
-
}) : logo
|
|
5781
|
+
}) : logo, /*#__PURE__*/jsx(AnimatedLabel, {
|
|
5782
|
+
className: "m-x-1",
|
|
5783
|
+
labels: steps.map(step => step.label),
|
|
5784
|
+
activeLabel: activeStep
|
|
5785
|
+
}), /*#__PURE__*/jsx("span", {
|
|
5786
|
+
className: "m-x-1"
|
|
5787
|
+
})]
|
|
5784
5788
|
});
|
|
5785
5789
|
};
|
|
5786
5790
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -5789,7 +5793,7 @@ const FlowNavigation = ({
|
|
|
5789
5793
|
'np-flow-navigation--border-bottom': !done
|
|
5790
5794
|
}),
|
|
5791
5795
|
children: /*#__PURE__*/jsx(FlowHeader, {
|
|
5792
|
-
className: classNames('np-flow-navigation__content p-x-3', {
|
|
5796
|
+
className: classNames('np-flow-navigation__content', isSmall ? 'p-x-2' : 'p-x-3', {
|
|
5793
5797
|
'np-flow-navigation--hidden': !clientWidth,
|
|
5794
5798
|
'np-flow-navigation--xs-max': isSmall,
|
|
5795
5799
|
// Size switches on parent container which may or may not have the same size as the window.
|
|
@@ -5799,7 +5803,7 @@ const FlowNavigation = ({
|
|
|
5799
5803
|
leftContent: isSmall ? getLeftContentSmall() : logo,
|
|
5800
5804
|
rightContent: /*#__PURE__*/jsxs(Fragment, {
|
|
5801
5805
|
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsx("span", {
|
|
5802
|
-
className: "
|
|
5806
|
+
className: "m-x-1"
|
|
5803
5807
|
}), closeButton]
|
|
5804
5808
|
}),
|
|
5805
5809
|
bottomContent: !done && /*#__PURE__*/jsx(Stepper, {
|
|
@@ -8812,6 +8816,7 @@ const OverlayHeader = ({
|
|
|
8812
8816
|
logo
|
|
8813
8817
|
}) => {
|
|
8814
8818
|
const closeButton = onClose && /*#__PURE__*/jsx(CloseButton, {
|
|
8819
|
+
size: Size.LARGE,
|
|
8815
8820
|
onClick: onClose
|
|
8816
8821
|
});
|
|
8817
8822
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -8821,7 +8826,7 @@ const OverlayHeader = ({
|
|
|
8821
8826
|
leftContent: logo,
|
|
8822
8827
|
rightContent: /*#__PURE__*/jsxs(Fragment, {
|
|
8823
8828
|
children: [avatar, avatar && closeButton && /*#__PURE__*/jsx("span", {
|
|
8824
|
-
className:
|
|
8829
|
+
className: classNames('m-x-1')
|
|
8825
8830
|
}), closeButton]
|
|
8826
8831
|
})
|
|
8827
8832
|
})
|