@transferwise/components 46.35.1 → 46.36.0
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 +68 -65
- package/build/index.js.map +1 -1
- package/build/index.mjs +69 -66
- package/build/index.mjs.map +1 -1
- package/build/main.css +1 -0
- package/build/styles/main.css +1 -0
- package/build/styles/nudge/Nudge.css +1 -0
- package/build/types/common/action/Action.d.ts +15 -0
- package/build/types/common/action/Action.d.ts.map +1 -0
- package/build/types/nudge/Nudge.d.ts +4 -4
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts +2 -4
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/alert/Alert.tsx +2 -30
- package/src/common/action/Action.tsx +44 -0
- package/src/main.css +1 -0
- package/src/nudge/Nudge.css +1 -0
- package/src/nudge/Nudge.less +1 -0
- package/src/nudge/Nudge.story.tsx +34 -0
- package/src/nudge/Nudge.tsx +6 -4
- package/src/summary/Summary.tsx +3 -15
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;
|
|
@@ -7826,7 +7829,8 @@ const Nudge = ({
|
|
|
7826
7829
|
persistDismissal,
|
|
7827
7830
|
isPreviouslyDismissed,
|
|
7828
7831
|
id,
|
|
7829
|
-
className
|
|
7832
|
+
className,
|
|
7833
|
+
action
|
|
7830
7834
|
}) => {
|
|
7831
7835
|
const [isDismissed, setIsDismissed] = React.useState(false);
|
|
7832
7836
|
const [isMounted, setIsMounted] = React.useState(false);
|
|
@@ -7887,6 +7891,9 @@ const Nudge = ({
|
|
|
7887
7891
|
className: "wds-nudge-link",
|
|
7888
7892
|
onClick: onClick,
|
|
7889
7893
|
children: link
|
|
7894
|
+
}), action && /*#__PURE__*/jsxRuntime.jsx(Action, {
|
|
7895
|
+
action: action,
|
|
7896
|
+
className: "m-t-1"
|
|
7890
7897
|
})]
|
|
7891
7898
|
}), onDismiss || persistDismissal ? /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
7892
7899
|
className: "wds-nudge-control",
|
|
@@ -10860,13 +10867,9 @@ const Summary = ({
|
|
|
10860
10867
|
type: exports.Typography.BODY_DEFAULT,
|
|
10861
10868
|
className: "d-block np-summary__description",
|
|
10862
10869
|
children: description
|
|
10863
|
-
}), action && /*#__PURE__*/jsxRuntime.jsx(
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
className: "np-summary__action",
|
|
10867
|
-
"aria-label": action['aria-label'],
|
|
10868
|
-
onClick: action.onClick,
|
|
10869
|
-
children: action.text
|
|
10870
|
+
}), action && /*#__PURE__*/jsxRuntime.jsx(Action, {
|
|
10871
|
+
action: action,
|
|
10872
|
+
className: "np-summary__action"
|
|
10870
10873
|
})]
|
|
10871
10874
|
}), info && /*#__PURE__*/jsxRuntime.jsx(Info, {
|
|
10872
10875
|
"aria-label": info['aria-label'],
|