@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.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
|
|
5837
5817
|
}),
|
|
5838
|
-
leftContent:
|
|
5839
|
-
|
|
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
|
+
})]
|
|
5827
|
+
}),
|
|
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,7 +6775,6 @@ function SelectInput({
|
|
|
6783
6775
|
value: controlledValue,
|
|
6784
6776
|
compareValues,
|
|
6785
6777
|
renderValue = wrapInFragment,
|
|
6786
|
-
renderFooter,
|
|
6787
6778
|
renderTrigger = defaultRenderTrigger,
|
|
6788
6779
|
filterable,
|
|
6789
6780
|
filterPlaceholder,
|
|
@@ -6857,7 +6848,6 @@ function SelectInput({
|
|
|
6857
6848
|
children: /*#__PURE__*/jsxRuntime.jsx(SelectInputOptions, {
|
|
6858
6849
|
items: items,
|
|
6859
6850
|
renderValue: renderValue,
|
|
6860
|
-
renderFooter: renderFooter,
|
|
6861
6851
|
filterable: filterable,
|
|
6862
6852
|
filterPlaceholder: filterPlaceholder,
|
|
6863
6853
|
searchInputRef: searchInputRef,
|
|
@@ -6923,7 +6913,6 @@ const SelectInputOptionsContainer = /*#__PURE__*/React.forwardRef(function Selec
|
|
|
6923
6913
|
function SelectInputOptions({
|
|
6924
6914
|
items,
|
|
6925
6915
|
renderValue = wrapInFragment,
|
|
6926
|
-
renderFooter,
|
|
6927
6916
|
filterable = false,
|
|
6928
6917
|
filterPlaceholder,
|
|
6929
6918
|
searchInputRef,
|
|
@@ -6981,7 +6970,7 @@ function SelectInputOptions({
|
|
|
6981
6970
|
setQuery(event.currentTarget.value);
|
|
6982
6971
|
}
|
|
6983
6972
|
})
|
|
6984
|
-
}) : null, /*#__PURE__*/jsxRuntime.jsxs("
|
|
6973
|
+
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6985
6974
|
ref: listboxContainerRef,
|
|
6986
6975
|
className: classNames__default.default('np-select-input-listbox-container', items.some(item => item.type === 'group') && 'np-select-input-listbox-container--has-group'),
|
|
6987
6976
|
children: [empty ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -7005,10 +6994,7 @@ function SelectInputOptions({
|
|
|
7005
6994
|
renderValue: renderValue,
|
|
7006
6995
|
needle: needle
|
|
7007
6996
|
}, index))
|
|
7008
|
-
})
|
|
7009
|
-
className: "np-select-input-footer",
|
|
7010
|
-
children: renderFooter(needle)
|
|
7011
|
-
}) : null]
|
|
6997
|
+
})]
|
|
7012
6998
|
})]
|
|
7013
6999
|
});
|
|
7014
7000
|
}
|
|
@@ -8843,6 +8829,7 @@ const OverlayHeader = ({
|
|
|
8843
8829
|
logo
|
|
8844
8830
|
}) => {
|
|
8845
8831
|
const closeButton = onClose && /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
8832
|
+
size: exports.Size.LARGE,
|
|
8846
8833
|
onClick: onClose
|
|
8847
8834
|
});
|
|
8848
8835
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -8850,9 +8837,10 @@ const OverlayHeader = ({
|
|
|
8850
8837
|
children: /*#__PURE__*/jsxRuntime.jsx(FlowHeader, {
|
|
8851
8838
|
className: "np-overlay-header__content p-a-3",
|
|
8852
8839
|
leftContent: logo,
|
|
8853
|
-
rightContent: /*#__PURE__*/jsxRuntime.jsxs(
|
|
8840
|
+
rightContent: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8841
|
+
className: classNames__default.default('d-flex', 'align-items-center', 'order-2'),
|
|
8854
8842
|
children: [avatar, avatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8855
|
-
className:
|
|
8843
|
+
className: classNames__default.default('m-x-1')
|
|
8856
8844
|
}), closeButton]
|
|
8857
8845
|
})
|
|
8858
8846
|
})
|