@transferwise/components 46.35.1 → 46.36.1

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.js CHANGED
@@ -730,40 +730,6 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
730
730
  });
731
731
  });
732
732
 
733
- var messages$c = reactIntl.defineMessages({
734
- opensInNewTab: {
735
- id: "neptune.Link.opensInNewTab"
736
- }
737
- });
738
-
739
- const Link = ({
740
- className,
741
- children,
742
- href,
743
- target,
744
- type,
745
- 'aria-label': ariaLabel,
746
- onClick,
747
- ...props
748
- }) => {
749
- const isBlank = target === '_blank';
750
- const {
751
- formatMessage
752
- } = reactIntl.useIntl();
753
- return /*#__PURE__*/jsxRuntime.jsxs("a", {
754
- href: href,
755
- target: target,
756
- className: classNames__default.default('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className),
757
- "aria-label": ariaLabel,
758
- rel: isBlank ? 'noreferrer' : undefined,
759
- onClick: onClick,
760
- ...props,
761
- children: [children, " ", isBlank && /*#__PURE__*/jsxRuntime.jsx(icons.NavigateAway, {
762
- title: formatMessage(messages$c.opensInNewTab)
763
- })]
764
- });
765
- };
766
-
767
733
  const iconTypeMap = {
768
734
  positive: icons.Check,
769
735
  neutral: icons.Info,
@@ -910,6 +876,64 @@ InlineMarkdown.defaultProps = {
910
876
  className: undefined
911
877
  };
912
878
 
879
+ var messages$c = reactIntl.defineMessages({
880
+ opensInNewTab: {
881
+ id: "neptune.Link.opensInNewTab"
882
+ }
883
+ });
884
+
885
+ const Link = ({
886
+ className,
887
+ children,
888
+ href,
889
+ target,
890
+ type,
891
+ 'aria-label': ariaLabel,
892
+ onClick,
893
+ ...props
894
+ }) => {
895
+ const isBlank = target === '_blank';
896
+ const {
897
+ formatMessage
898
+ } = reactIntl.useIntl();
899
+ return /*#__PURE__*/jsxRuntime.jsxs("a", {
900
+ href: href,
901
+ target: target,
902
+ className: classNames__default.default('np-link', type ? `np-text-${type}` : undefined, 'd-inline-flex', className),
903
+ "aria-label": ariaLabel,
904
+ rel: isBlank ? 'noreferrer' : undefined,
905
+ onClick: onClick,
906
+ ...props,
907
+ children: [children, " ", isBlank && /*#__PURE__*/jsxRuntime.jsx(icons.NavigateAway, {
908
+ title: formatMessage(messages$c.opensInNewTab)
909
+ })]
910
+ });
911
+ };
912
+
913
+ function Action({
914
+ action,
915
+ className
916
+ }) {
917
+ if ('href' in action) {
918
+ return /*#__PURE__*/jsxRuntime.jsx(Link, {
919
+ href: action.href,
920
+ className: className,
921
+ "aria-label": action['aria-label'],
922
+ target: action.target,
923
+ type: exports.Typography.LINK_LARGE,
924
+ onClick: action.onClick,
925
+ children: action.text
926
+ });
927
+ }
928
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
929
+ type: "button",
930
+ "aria-label": action['aria-label'],
931
+ className: classNames__default.default('btn-unstyled np-text-link-large', className),
932
+ onClick: action.onClick,
933
+ children: action.text
934
+ });
935
+ }
936
+
913
937
  exports.AlertArrowPosition = void 0;
914
938
  (function (AlertArrowPosition) {
915
939
  AlertArrowPosition["TOP_LEFT"] = "up-left";
@@ -1016,7 +1040,8 @@ function Alert({
1016
1040
  })
1017
1041
  })]
1018
1042
  }), action && /*#__PURE__*/jsxRuntime.jsx(Action, {
1019
- action: action
1043
+ action: action,
1044
+ className: "m-t-1"
1020
1045
  })]
1021
1046
  })]
1022
1047
  }), onDismiss && /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
@@ -1043,28 +1068,6 @@ function alertArrowClassNames(arrow) {
1043
1068
  return 'arrow';
1044
1069
  }
1045
1070
  }
1046
- function Action({
1047
- action
1048
- }) {
1049
- if ('href' in action) {
1050
- return /*#__PURE__*/jsxRuntime.jsx(Link, {
1051
- href: action.href,
1052
- className: "m-t-1",
1053
- "aria-label": action['aria-label'],
1054
- target: action.target,
1055
- type: exports.Typography.LINK_LARGE,
1056
- onClick: action.onClick,
1057
- children: action.text
1058
- });
1059
- }
1060
- return /*#__PURE__*/jsxRuntime.jsx("button", {
1061
- type: "button",
1062
- "aria-label": action['aria-label'],
1063
- className: "btn-unstyled np-text-link-large m-t-1",
1064
- onClick: action.onClick,
1065
- children: action.text
1066
- });
1067
- }
1068
1071
 
1069
1072
  // TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
1070
1073
  exports.AvatarType = void 0;
@@ -7459,13 +7462,10 @@ const parseNumber = ({
7459
7462
  locale,
7460
7463
  maxLengthOverride
7461
7464
  }) => {
7462
- if (!maxLengthOverride) {
7463
- return parseAmount(amount, currency, locale);
7464
- }
7465
7465
  if (maxLengthOverride && amount.length > maxLengthOverride) {
7466
7466
  return 0;
7467
7467
  }
7468
- return Number(amount);
7468
+ return parseAmount(amount, currency, locale);
7469
7469
  };
7470
7470
  const allowedInputKeys = new Set(['Backspace', 'Delete', ',', '.', 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'Enter', 'Escape', 'Tab']);
7471
7471
  class MoneyInput extends React.Component {
@@ -7826,7 +7826,8 @@ const Nudge = ({
7826
7826
  persistDismissal,
7827
7827
  isPreviouslyDismissed,
7828
7828
  id,
7829
- className
7829
+ className,
7830
+ action
7830
7831
  }) => {
7831
7832
  const [isDismissed, setIsDismissed] = React.useState(false);
7832
7833
  const [isMounted, setIsMounted] = React.useState(false);
@@ -7887,6 +7888,9 @@ const Nudge = ({
7887
7888
  className: "wds-nudge-link",
7888
7889
  onClick: onClick,
7889
7890
  children: link
7891
+ }), action && /*#__PURE__*/jsxRuntime.jsx(Action, {
7892
+ action: action,
7893
+ className: "m-t-1"
7890
7894
  })]
7891
7895
  }), onDismiss || persistDismissal ? /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
7892
7896
  className: "wds-nudge-control",
@@ -10860,13 +10864,9 @@ const Summary = ({
10860
10864
  type: exports.Typography.BODY_DEFAULT,
10861
10865
  className: "d-block np-summary__description",
10862
10866
  children: description
10863
- }), action && /*#__PURE__*/jsxRuntime.jsx(Link, {
10864
- href: action.href,
10865
- target: action.target,
10866
- className: "np-summary__action",
10867
- "aria-label": action['aria-label'],
10868
- onClick: action.onClick,
10869
- children: action.text
10867
+ }), action && /*#__PURE__*/jsxRuntime.jsx(Action, {
10868
+ action: action,
10869
+ className: "np-summary__action"
10870
10870
  })]
10871
10871
  }), info && /*#__PURE__*/jsxRuntime.jsx(Info, {
10872
10872
  "aria-label": info['aria-label'],