@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.
Files changed (39) hide show
  1. package/build/index.esm.js +36 -31
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +36 -31
  4. package/build/index.js.map +1 -1
  5. package/build/main.css +1 -1
  6. package/build/styles/flowNavigation/FlowNavigation.css +1 -1
  7. package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
  8. package/build/styles/main.css +1 -1
  9. package/build/styles/overlayHeader/OverlayHeader.css +1 -1
  10. package/build/types/common/flowHeader/FlowHeader.d.ts.map +1 -1
  11. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  12. package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts +1 -2
  13. package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
  14. package/build/types/flowNavigation/backButton/BackButton.d.ts +10 -11
  15. package/build/types/flowNavigation/backButton/BackButton.d.ts.map +1 -1
  16. package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
  17. package/package.json +3 -3
  18. package/src/common/flowHeader/FlowHeader.tsx +9 -3
  19. package/src/common/flowHeader/__snapshots__/FlowHeader.spec.js.snap +2 -2
  20. package/src/flowNavigation/FlowNavigation.css +1 -1
  21. package/src/flowNavigation/FlowNavigation.less +0 -9
  22. package/src/flowNavigation/FlowNavigation.spec.js +3 -3
  23. package/src/flowNavigation/FlowNavigation.story.js +24 -183
  24. package/src/flowNavigation/FlowNavigation.tsx +9 -13
  25. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +14 -11
  26. package/src/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
  27. package/src/flowNavigation/animatedLabel/AnimatedLabel.less +0 -6
  28. package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +7 -21
  29. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +8 -17
  30. package/src/flowNavigation/animatedLabel/__snapshots__/AnimatedLabel.spec.js.snap +4 -4
  31. package/src/flowNavigation/backButton/BackButton.js +14 -9
  32. package/src/flowNavigation/backButton/BackButton.spec.js +3 -2
  33. package/src/flowNavigation/backButton/__snapshots__/BackButton.spec.js.snap +28 -21
  34. package/src/main.css +1 -1
  35. package/src/overlayHeader/OverlayHeader.css +1 -1
  36. package/src/overlayHeader/OverlayHeader.js +4 -2
  37. package/src/overlayHeader/OverlayHeader.less +0 -8
  38. package/src/overlayHeader/OverlayHeader.spec.js +1 -1
  39. package/src/overlayHeader/__snapshots__/OverlayHeader.spec.js.snap +3 -3
@@ -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
- const numberLabels = labels.length - 1;
5713
- return /*#__PURE__*/jsx("div", {
5714
- "aria-label": ariaLabel,
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-left', {
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
- }) => /*#__PURE__*/jsxs("button", {
5734
- type: "button",
5735
- className: classNames('np-back-button', 'align-items-center', 'btn-unstyled', className),
5736
- onClick: onClick,
5737
- children: [/*#__PURE__*/jsx(ArrowLeft, {
5738
- size: 24
5739
- }), label]
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__*/jsx(Fragment, {
5775
- children: displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
5776
- label: /*#__PURE__*/jsx(AnimatedLabel, {
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: "separator"
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: "separator"
8829
+ className: classNames('m-x-1')
8825
8830
  }), closeButton]
8826
8831
  })
8827
8832
  })