@transferwise/components 0.0.0-experimental-adfacd1 → 0.0.0-experimental-b5cc5ec
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 -36
- package/build/index.esm.js.map +1 -1
- package/build/index.js +36 -36
- 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 +2 -1
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
- package/build/types/flowNavigation/backButton/BackButton.d.ts +11 -10
- package/build/types/flowNavigation/backButton/BackButton.d.ts.map +1 -1
- package/build/types/logo/Logo.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 +3 -9
- package/src/common/flowHeader/__snapshots__/FlowHeader.spec.js.snap +2 -2
- package/src/flowNavigation/FlowNavigation.css +1 -1
- package/src/flowNavigation/FlowNavigation.less +9 -0
- package/src/flowNavigation/FlowNavigation.spec.js +3 -3
- package/src/flowNavigation/FlowNavigation.story.js +183 -24
- package/src/flowNavigation/FlowNavigation.tsx +13 -9
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +11 -14
- package/src/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/src/flowNavigation/animatedLabel/AnimatedLabel.less +6 -0
- package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +21 -7
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +17 -8
- package/src/flowNavigation/animatedLabel/__snapshots__/AnimatedLabel.spec.js.snap +4 -4
- package/src/flowNavigation/backButton/BackButton.js +9 -14
- package/src/flowNavigation/backButton/BackButton.spec.js +2 -3
- package/src/flowNavigation/backButton/__snapshots__/BackButton.spec.js.snap +21 -28
- package/src/logo/Logo.js +5 -0
- package/src/main.css +1 -1
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/overlayHeader/OverlayHeader.js +2 -4
- package/src/overlayHeader/OverlayHeader.less +8 -0
- package/src/overlayHeader/OverlayHeader.spec.js +1 -1
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.js.snap +3 -3
package/build/index.js
CHANGED
|
@@ -5432,7 +5432,7 @@ const FlowHeader = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
5432
5432
|
ref: reference,
|
|
5433
5433
|
className: classNames__default.default('np-flow-header', 'd-flex', 'flex-wrap', 'align-items-center', className),
|
|
5434
5434
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5435
|
-
className: classNames__default.default('np-flow-header__left',
|
|
5435
|
+
className: classNames__default.default('np-flow-header__left', {
|
|
5436
5436
|
'flex__item--8': isVertical
|
|
5437
5437
|
}),
|
|
5438
5438
|
children: leftContent
|
|
@@ -5537,6 +5537,11 @@ const Logo = ({
|
|
|
5537
5537
|
});
|
|
5538
5538
|
const isSmall = clientWidth < exports.Breakpoint.SMALL;
|
|
5539
5539
|
const LogoSvg = isSmall ? svgPaths[`WISE_FLAG${inverse ? '_INVERSE' : ''}`] : svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
|
|
5540
|
+
|
|
5541
|
+
// If clientWidth is not defined, don't render anything
|
|
5542
|
+
if (clientWidth === null) {
|
|
5543
|
+
return null;
|
|
5544
|
+
}
|
|
5540
5545
|
return /*#__PURE__*/jsxRuntime.jsx(LogoSvg, {
|
|
5541
5546
|
className: classNames__default.default('np-logo-svg', className),
|
|
5542
5547
|
alt: type === exports.LogoType.WISE ? 'Wise' : 'Wise business'
|
|
@@ -5740,16 +5745,19 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
5740
5745
|
const AnimatedLabel = ({
|
|
5741
5746
|
activeLabel,
|
|
5742
5747
|
className,
|
|
5743
|
-
labels
|
|
5748
|
+
labels,
|
|
5749
|
+
'aria-label': ariaLabel
|
|
5744
5750
|
}) => {
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5751
|
+
const numberLabels = labels.length - 1;
|
|
5752
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5753
|
+
"aria-label": ariaLabel,
|
|
5754
|
+
className: classNames__default.default('np-animated-label', 'np-text-body-large-bold', className),
|
|
5748
5755
|
children: labels.map((label, index) => {
|
|
5749
5756
|
const nextLabel = index - 1;
|
|
5750
5757
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
5751
|
-
className: classNames__default.default('text-xs-
|
|
5752
|
-
'np-animated-label--in
|
|
5758
|
+
className: classNames__default.default('text-xs-left', {
|
|
5759
|
+
'np-animated-label--in': index === activeLabel,
|
|
5760
|
+
'np-animated-label--out': nextLabel === activeLabel && nextLabel !== numberLabels
|
|
5753
5761
|
}),
|
|
5754
5762
|
children: label
|
|
5755
5763
|
}, nextLabel);
|
|
@@ -5758,24 +5766,18 @@ const AnimatedLabel = ({
|
|
|
5758
5766
|
};
|
|
5759
5767
|
|
|
5760
5768
|
const BackButton = ({
|
|
5769
|
+
label,
|
|
5761
5770
|
className,
|
|
5762
|
-
onClick
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
className: classNames__default.default('np-back-button', 'btn-unstyled', className),
|
|
5771
|
-
onClick: onClick,
|
|
5772
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.ArrowLeft, {
|
|
5773
|
-
size: 24
|
|
5774
|
-
})
|
|
5775
|
-
})
|
|
5771
|
+
onClick
|
|
5772
|
+
}) => /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
5773
|
+
type: "button",
|
|
5774
|
+
className: classNames__default.default('np-back-button', 'align-items-center', 'btn-unstyled', className),
|
|
5775
|
+
onClick: onClick,
|
|
5776
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(icons.ArrowLeft, {
|
|
5777
|
+
size: 24
|
|
5778
|
+
}), label]
|
|
5776
5779
|
});
|
|
5777
5780
|
BackButton.propTypes = {
|
|
5778
|
-
'aria-label': PropTypes__default.default.string.isRequired,
|
|
5779
5781
|
className: PropTypes__default.default.string,
|
|
5780
5782
|
label: PropTypes__default.default.element,
|
|
5781
5783
|
onClick: PropTypes__default.default.func
|
|
@@ -5808,17 +5810,16 @@ const FlowNavigation = ({
|
|
|
5808
5810
|
const newAvatar = done ? null : avatar;
|
|
5809
5811
|
const getLeftContentSmall = () => {
|
|
5810
5812
|
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
5811
|
-
return /*#__PURE__*/jsxRuntime.
|
|
5812
|
-
children:
|
|
5813
|
-
|
|
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
|
+
}),
|
|
5814
5821
|
onClick: onGoBack
|
|
5815
|
-
}) : logo
|
|
5816
|
-
className: "m-x-1",
|
|
5817
|
-
labels: steps.map(step => step.label),
|
|
5818
|
-
activeLabel: activeStep
|
|
5819
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
5820
|
-
className: "m-x-1"
|
|
5821
|
-
})]
|
|
5822
|
+
}) : logo
|
|
5822
5823
|
});
|
|
5823
5824
|
};
|
|
5824
5825
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -5827,7 +5828,7 @@ const FlowNavigation = ({
|
|
|
5827
5828
|
'np-flow-navigation--border-bottom': !done
|
|
5828
5829
|
}),
|
|
5829
5830
|
children: /*#__PURE__*/jsxRuntime.jsx(FlowHeader, {
|
|
5830
|
-
className: classNames__default.default('np-flow-navigation__content
|
|
5831
|
+
className: classNames__default.default('np-flow-navigation__content p-x-3', {
|
|
5831
5832
|
'np-flow-navigation--hidden': !clientWidth,
|
|
5832
5833
|
'np-flow-navigation--xs-max': isSmall,
|
|
5833
5834
|
// Size switches on parent container which may or may not have the same size as the window.
|
|
@@ -5837,7 +5838,7 @@ const FlowNavigation = ({
|
|
|
5837
5838
|
leftContent: isSmall ? getLeftContentSmall() : logo,
|
|
5838
5839
|
rightContent: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5839
5840
|
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
5840
|
-
className: "
|
|
5841
|
+
className: "separator"
|
|
5841
5842
|
}), closeButton]
|
|
5842
5843
|
}),
|
|
5843
5844
|
bottomContent: !done && /*#__PURE__*/jsxRuntime.jsx(Stepper, {
|
|
@@ -8850,7 +8851,6 @@ const OverlayHeader = ({
|
|
|
8850
8851
|
logo
|
|
8851
8852
|
}) => {
|
|
8852
8853
|
const closeButton = onClose && /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
8853
|
-
size: exports.Size.LARGE,
|
|
8854
8854
|
onClick: onClose
|
|
8855
8855
|
});
|
|
8856
8856
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -8860,7 +8860,7 @@ const OverlayHeader = ({
|
|
|
8860
8860
|
leftContent: logo,
|
|
8861
8861
|
rightContent: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8862
8862
|
children: [avatar, avatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8863
|
-
className:
|
|
8863
|
+
className: "separator"
|
|
8864
8864
|
}), closeButton]
|
|
8865
8865
|
})
|
|
8866
8866
|
})
|