@wise/dynamic-flow-client-internal 4.18.0 → 4.19.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/i18n/en.json +1 -0
- package/build/main.css +1 -1
- package/build/main.js +466 -403
- package/build/main.mjs +405 -342
- package/package.json +4 -4
package/build/main.mjs
CHANGED
|
@@ -628,15 +628,16 @@ var i18n_default = translations;
|
|
|
628
628
|
|
|
629
629
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
630
630
|
import { forwardRef, useCallback, useMemo as useMemo2 } from "react";
|
|
631
|
-
import { useIntl as
|
|
631
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
632
632
|
import {
|
|
633
633
|
DynamicFlow as DynamicFlowCoreLegacy,
|
|
634
634
|
DynamicFlowCoreRevamp,
|
|
635
635
|
DynamicFormCore
|
|
636
636
|
} from "@wise/dynamic-flow-client";
|
|
637
637
|
|
|
638
|
-
// ../renderers/src/
|
|
639
|
-
import {
|
|
638
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
639
|
+
import { Button, InlineAlert } from "@transferwise/components";
|
|
640
|
+
import { useIntl } from "react-intl";
|
|
640
641
|
|
|
641
642
|
// ../renderers/src/utils/layout-utils.ts
|
|
642
643
|
var getMargin = (size) => {
|
|
@@ -668,11 +669,79 @@ var getTextAlignment = (align) => {
|
|
|
668
669
|
};
|
|
669
670
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
670
671
|
|
|
672
|
+
// ../renderers/src/messages/loading-button.messages.ts
|
|
673
|
+
import { defineMessages } from "react-intl";
|
|
674
|
+
var loading_button_messages_default = defineMessages({
|
|
675
|
+
buttonLoadingMessage: {
|
|
676
|
+
id: "df.wise.ButtonLayout.buttonLoadingMessage",
|
|
677
|
+
defaultMessage: "This might take a few seconds",
|
|
678
|
+
description: "Message displayed below a button when it is in a loading state."
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// ../renderers/src/ButtonRenderer/useLoading.ts
|
|
683
|
+
import { useEffect, useState } from "react";
|
|
684
|
+
var useLoading = (stepLoadingState, onClick) => {
|
|
685
|
+
const [isActive, setIsActive] = useState(false);
|
|
686
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
687
|
+
useEffect(() => {
|
|
688
|
+
if (isActive && stepLoadingState !== "idle") {
|
|
689
|
+
setIsLoading(true);
|
|
690
|
+
}
|
|
691
|
+
if (isLoading && stepLoadingState === "idle") {
|
|
692
|
+
setIsLoading(false);
|
|
693
|
+
setIsActive(false);
|
|
694
|
+
}
|
|
695
|
+
}, [stepLoadingState, isActive, isLoading]);
|
|
696
|
+
return {
|
|
697
|
+
isLoading,
|
|
698
|
+
onClick: () => {
|
|
699
|
+
setIsActive(true);
|
|
700
|
+
onClick();
|
|
701
|
+
},
|
|
702
|
+
onBlur: () => {
|
|
703
|
+
setIsActive(false);
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
709
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
710
|
+
var AddressValidationButtonRenderer = {
|
|
711
|
+
canRenderType: "button",
|
|
712
|
+
canRender: ({ control }) => control === "address-validation",
|
|
713
|
+
render: AddressValidationButtonComponent
|
|
714
|
+
};
|
|
715
|
+
function AddressValidationButtonComponent(props) {
|
|
716
|
+
const { disabled, margin, title, stepLoadingState } = props;
|
|
717
|
+
const { formatMessage } = useIntl();
|
|
718
|
+
const { isLoading, onBlur, onClick } = useLoading(stepLoadingState, props.onClick);
|
|
719
|
+
return /* @__PURE__ */ jsxs("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
720
|
+
/* @__PURE__ */ jsx(
|
|
721
|
+
Button,
|
|
722
|
+
{
|
|
723
|
+
v2: true,
|
|
724
|
+
block: true,
|
|
725
|
+
disabled: isLoading || disabled,
|
|
726
|
+
priority: "primary",
|
|
727
|
+
size: "md",
|
|
728
|
+
loading: isLoading,
|
|
729
|
+
onBlur,
|
|
730
|
+
onClick,
|
|
731
|
+
children: title
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
isLoading && /* @__PURE__ */ jsx(InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
735
|
+
] });
|
|
736
|
+
}
|
|
737
|
+
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
738
|
+
|
|
671
739
|
// ../renderers/src/AlertRenderer.tsx
|
|
672
|
-
import {
|
|
740
|
+
import { Alert } from "@transferwise/components";
|
|
741
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
673
742
|
var AlertRenderer = {
|
|
674
743
|
canRenderType: "alert",
|
|
675
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */
|
|
744
|
+
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ jsx2(
|
|
676
745
|
Alert,
|
|
677
746
|
{
|
|
678
747
|
type: context,
|
|
@@ -695,13 +764,13 @@ var AlertRenderer_default = AlertRenderer;
|
|
|
695
764
|
|
|
696
765
|
// ../renderers/src/BoxRenderer.tsx
|
|
697
766
|
import classNames from "classnames";
|
|
698
|
-
import { jsx as
|
|
767
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
699
768
|
var BoxRenderer = {
|
|
700
769
|
canRenderType: "box",
|
|
701
770
|
render: ({ children, control, margin, width }) => {
|
|
702
771
|
const hasFixedWidth = width !== "xl";
|
|
703
772
|
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
704
|
-
const contents = /* @__PURE__ */
|
|
773
|
+
const contents = /* @__PURE__ */ jsx3(
|
|
705
774
|
"div",
|
|
706
775
|
{
|
|
707
776
|
className: classNames({
|
|
@@ -712,27 +781,25 @@ var BoxRenderer = {
|
|
|
712
781
|
children
|
|
713
782
|
}
|
|
714
783
|
);
|
|
715
|
-
return hasFixedWidth ? /* @__PURE__ */
|
|
784
|
+
return hasFixedWidth ? /* @__PURE__ */ jsx3("div", { className: classNames("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
716
785
|
}
|
|
717
786
|
};
|
|
718
787
|
var BoxRenderer_default = BoxRenderer;
|
|
719
788
|
|
|
720
|
-
// ../renderers/src/ButtonRenderer.tsx
|
|
721
|
-
import { Button } from "@transferwise/components";
|
|
722
|
-
import {
|
|
723
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
789
|
+
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
790
|
+
import { Button as Button2 } from "@transferwise/components";
|
|
791
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
724
792
|
var ButtonRenderer = {
|
|
725
793
|
canRenderType: "button",
|
|
726
794
|
render: ButtonComponent
|
|
727
795
|
};
|
|
728
796
|
function ButtonComponent(props) {
|
|
729
|
-
const { control, context, disabled, margin, title, size, stepLoadingState
|
|
730
|
-
const
|
|
731
|
-
const isLoading = isActive && stepLoadingState !== "idle";
|
|
797
|
+
const { control, context, disabled, margin, title, size, stepLoadingState } = props;
|
|
798
|
+
const { isLoading, onBlur, onClick } = useLoading(stepLoadingState, props.onClick);
|
|
732
799
|
const priority = mapControl(control);
|
|
733
800
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
734
|
-
return /* @__PURE__ */
|
|
735
|
-
|
|
801
|
+
return /* @__PURE__ */ jsx4(
|
|
802
|
+
Button2,
|
|
736
803
|
{
|
|
737
804
|
block: true,
|
|
738
805
|
className: getMargin(margin),
|
|
@@ -741,13 +808,8 @@ function ButtonComponent(props) {
|
|
|
741
808
|
size: mapSize(size),
|
|
742
809
|
loading: isLoading,
|
|
743
810
|
type,
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
onClick();
|
|
747
|
-
},
|
|
748
|
-
onBlur: () => {
|
|
749
|
-
setActive(false);
|
|
750
|
-
},
|
|
811
|
+
onBlur,
|
|
812
|
+
onClick,
|
|
751
813
|
children: title
|
|
752
814
|
}
|
|
753
815
|
);
|
|
@@ -793,11 +855,11 @@ import { Field } from "@transferwise/components";
|
|
|
793
855
|
|
|
794
856
|
// ../renderers/src/components/Help.tsx
|
|
795
857
|
import { Info, Markdown } from "@transferwise/components";
|
|
796
|
-
import { useIntl } from "react-intl";
|
|
858
|
+
import { useIntl as useIntl2 } from "react-intl";
|
|
797
859
|
|
|
798
860
|
// ../renderers/src/messages/help.messages.ts
|
|
799
|
-
import { defineMessages } from "react-intl";
|
|
800
|
-
var help_messages_default =
|
|
861
|
+
import { defineMessages as defineMessages2 } from "react-intl";
|
|
862
|
+
var help_messages_default = defineMessages2({
|
|
801
863
|
helpAria: {
|
|
802
864
|
id: "df.wise.Help.ariaLabel",
|
|
803
865
|
defaultMessage: "Click here for more info.",
|
|
@@ -806,14 +868,14 @@ var help_messages_default = defineMessages({
|
|
|
806
868
|
});
|
|
807
869
|
|
|
808
870
|
// ../renderers/src/components/Help.tsx
|
|
809
|
-
import { jsx as
|
|
871
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
810
872
|
function Help({ help, onClick }) {
|
|
811
|
-
const intl =
|
|
812
|
-
return /* @__PURE__ */
|
|
873
|
+
const intl = useIntl2();
|
|
874
|
+
return /* @__PURE__ */ jsx5(
|
|
813
875
|
Info,
|
|
814
876
|
{
|
|
815
877
|
className: "m-l-1",
|
|
816
|
-
content: /* @__PURE__ */
|
|
878
|
+
content: /* @__PURE__ */ jsx5(Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
817
879
|
presentation: "POPOVER",
|
|
818
880
|
size: "sm",
|
|
819
881
|
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
@@ -824,19 +886,19 @@ function Help({ help, onClick }) {
|
|
|
824
886
|
var Help_default = Help;
|
|
825
887
|
|
|
826
888
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
827
|
-
import { jsx as
|
|
889
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
828
890
|
function LabelContentWithHelp({ text, help }) {
|
|
829
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsxs2("div", { children: [
|
|
830
892
|
text,
|
|
831
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ jsx6(Help_default, { help })
|
|
832
894
|
] });
|
|
833
895
|
}
|
|
834
896
|
|
|
835
897
|
// ../renderers/src/components/FieldInput.tsx
|
|
836
|
-
import { jsx as
|
|
898
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
837
899
|
function FieldInput({ id, children, label, validation, description, help }) {
|
|
838
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
839
|
-
return /* @__PURE__ */
|
|
900
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx7(LabelContentWithHelp, { text: label, help }) : label;
|
|
901
|
+
return /* @__PURE__ */ jsx7(
|
|
840
902
|
Field,
|
|
841
903
|
{
|
|
842
904
|
id,
|
|
@@ -861,7 +923,7 @@ var FieldInput_default = FieldInput;
|
|
|
861
923
|
|
|
862
924
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
863
925
|
import { Checkbox } from "@transferwise/components";
|
|
864
|
-
import { jsx as
|
|
926
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
865
927
|
var CheckboxInputRenderer = {
|
|
866
928
|
canRenderType: "input-checkbox",
|
|
867
929
|
render: (props) => {
|
|
@@ -885,17 +947,17 @@ var CheckboxInputRenderer = {
|
|
|
885
947
|
"value"
|
|
886
948
|
]);
|
|
887
949
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
888
|
-
return /* @__PURE__ */
|
|
950
|
+
return /* @__PURE__ */ jsx8(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx8(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
889
951
|
}
|
|
890
952
|
};
|
|
891
953
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
892
954
|
|
|
893
955
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
894
956
|
import classNames2 from "classnames";
|
|
895
|
-
import { jsx as
|
|
957
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
896
958
|
var ColumnsRenderer = {
|
|
897
959
|
canRenderType: "columns",
|
|
898
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */
|
|
960
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs3(
|
|
899
961
|
"div",
|
|
900
962
|
{
|
|
901
963
|
className: classNames2("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -903,8 +965,8 @@ var ColumnsRenderer = {
|
|
|
903
965
|
"df-columns-renderer-bias-end": bias === "end"
|
|
904
966
|
}),
|
|
905
967
|
children: [
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
969
|
+
/* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
908
970
|
]
|
|
909
971
|
}
|
|
910
972
|
)
|
|
@@ -939,7 +1001,7 @@ var dateToDateString = (date) => {
|
|
|
939
1001
|
};
|
|
940
1002
|
|
|
941
1003
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
942
|
-
import { jsx as
|
|
1004
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
943
1005
|
function VariableDateInput({
|
|
944
1006
|
control,
|
|
945
1007
|
inputProps
|
|
@@ -955,7 +1017,7 @@ function VariableDateInput({
|
|
|
955
1017
|
onFocus
|
|
956
1018
|
} = inputProps;
|
|
957
1019
|
if (control === "date-lookup") {
|
|
958
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ jsx10(
|
|
959
1021
|
DateLookup,
|
|
960
1022
|
{
|
|
961
1023
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -971,7 +1033,7 @@ function VariableDateInput({
|
|
|
971
1033
|
}
|
|
972
1034
|
);
|
|
973
1035
|
}
|
|
974
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ jsx10(
|
|
975
1037
|
DateInput,
|
|
976
1038
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
977
1039
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -988,7 +1050,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
988
1050
|
var VariableDateInput_default = VariableDateInput;
|
|
989
1051
|
|
|
990
1052
|
// ../renderers/src/DateInputRenderer.tsx
|
|
991
|
-
import { jsx as
|
|
1053
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
992
1054
|
var DateInputRenderer = {
|
|
993
1055
|
canRenderType: "input-date",
|
|
994
1056
|
render: (props) => {
|
|
@@ -1013,7 +1075,7 @@ var DateInputRenderer = {
|
|
|
1013
1075
|
]);
|
|
1014
1076
|
const value = initialValue != null ? initialValue : "";
|
|
1015
1077
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1016
|
-
return /* @__PURE__ */
|
|
1078
|
+
return /* @__PURE__ */ jsx11(
|
|
1017
1079
|
FieldInput_default,
|
|
1018
1080
|
{
|
|
1019
1081
|
id,
|
|
@@ -1021,7 +1083,7 @@ var DateInputRenderer = {
|
|
|
1021
1083
|
description,
|
|
1022
1084
|
validation: validationState,
|
|
1023
1085
|
help,
|
|
1024
|
-
children: /* @__PURE__ */
|
|
1086
|
+
children: /* @__PURE__ */ jsx11(VariableDateInput_default, { control, inputProps })
|
|
1025
1087
|
}
|
|
1026
1088
|
);
|
|
1027
1089
|
}
|
|
@@ -1039,19 +1101,19 @@ import { AvatarView } from "@transferwise/components";
|
|
|
1039
1101
|
|
|
1040
1102
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1041
1103
|
import { Flag } from "@wise/art";
|
|
1042
|
-
import { jsx as
|
|
1104
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1043
1105
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1044
1106
|
function FlagIcon({ name }) {
|
|
1045
1107
|
if (!isFlagIcon(name)) {
|
|
1046
1108
|
return null;
|
|
1047
1109
|
}
|
|
1048
1110
|
const code = name.substring(5);
|
|
1049
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ jsx12(Flag, { code, intrinsicSize: 24 });
|
|
1050
1112
|
}
|
|
1051
1113
|
|
|
1052
1114
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
1053
1115
|
import * as icons from "@transferwise/icons";
|
|
1054
|
-
import { jsx as
|
|
1116
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1055
1117
|
var isNamedIcon = (name) => {
|
|
1056
1118
|
const iconName = toCapitalisedCamelCase(name);
|
|
1057
1119
|
return Object.keys(icons).includes(iconName);
|
|
@@ -1062,19 +1124,19 @@ function NamedIcon({ name }) {
|
|
|
1062
1124
|
}
|
|
1063
1125
|
const iconName = toCapitalisedCamelCase(name);
|
|
1064
1126
|
const Icon = icons[iconName];
|
|
1065
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */ jsx13(Icon, { size: 24 });
|
|
1066
1128
|
}
|
|
1067
1129
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
1068
1130
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
1069
1131
|
|
|
1070
1132
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
1071
|
-
import { jsx as
|
|
1133
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1072
1134
|
function DynamicIcon({ name }) {
|
|
1073
1135
|
if (isFlagIcon(name)) {
|
|
1074
|
-
return /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ jsx14(FlagIcon, { name });
|
|
1075
1137
|
}
|
|
1076
1138
|
if (isNamedIcon(name)) {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ jsx14(NamedIcon, { name });
|
|
1078
1140
|
}
|
|
1079
1141
|
return null;
|
|
1080
1142
|
}
|
|
@@ -1082,23 +1144,23 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
1082
1144
|
|
|
1083
1145
|
// ../renderers/src/utils/UrnFlag.tsx
|
|
1084
1146
|
import { Flag as Flag2 } from "@wise/art";
|
|
1085
|
-
import { jsx as
|
|
1147
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1086
1148
|
var countryUrnPrefix = "urn:wise:countries:";
|
|
1087
1149
|
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
1088
1150
|
var isUrnFlag = (uri) => uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix);
|
|
1089
1151
|
function UrnFlag({ size, urn }) {
|
|
1090
|
-
return /* @__PURE__ */
|
|
1152
|
+
return /* @__PURE__ */ jsx15(Flag2, { code: getCode(urn), intrinsicSize: size });
|
|
1091
1153
|
}
|
|
1092
1154
|
var getCode = (urn) => {
|
|
1093
1155
|
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
1094
1156
|
};
|
|
1095
1157
|
|
|
1096
1158
|
// ../renderers/src/utils/image-utils.tsx
|
|
1097
|
-
import { jsx as
|
|
1159
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1098
1160
|
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
1099
1161
|
if (iconNode && imageNode) {
|
|
1100
1162
|
if (imageNode && iconNode) {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ jsx16(AvatarView, { size, badge: { asset: iconNode }, children: imageNode });
|
|
1102
1164
|
}
|
|
1103
1165
|
}
|
|
1104
1166
|
return null;
|
|
@@ -1106,7 +1168,7 @@ var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
|
1106
1168
|
var getIconNode = (icon) => {
|
|
1107
1169
|
if (icon) {
|
|
1108
1170
|
if ("name" in icon) {
|
|
1109
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ jsx16(DynamicIcon_default, { name: icon.name });
|
|
1110
1172
|
}
|
|
1111
1173
|
if (icon.text) {
|
|
1112
1174
|
return icon.text;
|
|
@@ -1118,17 +1180,17 @@ var getImageNode = (image, size) => {
|
|
|
1118
1180
|
if (image) {
|
|
1119
1181
|
const { accessibilityDescription, uri } = image;
|
|
1120
1182
|
if (!uri.startsWith("urn:")) {
|
|
1121
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ jsx16("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
1122
1184
|
}
|
|
1123
1185
|
if (isUrnFlag(uri)) {
|
|
1124
|
-
return /* @__PURE__ */
|
|
1186
|
+
return /* @__PURE__ */ jsx16(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
1125
1187
|
}
|
|
1126
1188
|
}
|
|
1127
1189
|
return null;
|
|
1128
1190
|
};
|
|
1129
1191
|
|
|
1130
1192
|
// ../renderers/src/components/OptionMedia.tsx
|
|
1131
|
-
import { jsx as
|
|
1193
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1132
1194
|
var mediaSize = 48;
|
|
1133
1195
|
function OptionMedia({
|
|
1134
1196
|
icon,
|
|
@@ -1142,28 +1204,28 @@ function OptionMedia({
|
|
|
1142
1204
|
return badge;
|
|
1143
1205
|
}
|
|
1144
1206
|
if (imageNode) {
|
|
1145
|
-
return preferAvatar ? /* @__PURE__ */
|
|
1207
|
+
return preferAvatar ? /* @__PURE__ */ jsx17(AvatarView2, { children: imageNode }) : imageNode;
|
|
1146
1208
|
}
|
|
1147
1209
|
if (iconNode) {
|
|
1148
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx17(AvatarView2, { children: iconNode });
|
|
1149
1211
|
}
|
|
1150
1212
|
}
|
|
1151
1213
|
|
|
1152
1214
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1153
|
-
import { jsx as
|
|
1215
|
+
import { jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1154
1216
|
var DecisionRenderer = {
|
|
1155
1217
|
canRenderType: "decision",
|
|
1156
|
-
render: ({ control, margin, options, title }) => /* @__PURE__ */
|
|
1157
|
-
title && /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1218
|
+
render: ({ control, margin, options, title }) => /* @__PURE__ */ jsxs4("div", { className: getMargin(margin), children: [
|
|
1219
|
+
title && /* @__PURE__ */ jsx18(Header, { as: "h2", title }),
|
|
1220
|
+
/* @__PURE__ */ jsx18(NavigationOptionsList, { children: options.map((option) => {
|
|
1159
1221
|
const { description, disabled, icon, image, title: itemTitle, tag, onClick } = option;
|
|
1160
|
-
return /* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsx18(
|
|
1161
1223
|
NavigationOption,
|
|
1162
1224
|
{
|
|
1163
1225
|
title: itemTitle,
|
|
1164
1226
|
content: description,
|
|
1165
1227
|
disabled,
|
|
1166
|
-
media: icon || image ? /* @__PURE__ */
|
|
1228
|
+
media: icon || image ? /* @__PURE__ */ jsx18(
|
|
1167
1229
|
OptionMedia,
|
|
1168
1230
|
{
|
|
1169
1231
|
icon,
|
|
@@ -1183,19 +1245,19 @@ var DecisionRenderer = {
|
|
|
1183
1245
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1184
1246
|
|
|
1185
1247
|
// ../renderers/src/DividerRenderer.tsx
|
|
1186
|
-
import { jsx as
|
|
1248
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1187
1249
|
var DividerRenderer = {
|
|
1188
1250
|
canRenderType: "divider",
|
|
1189
|
-
render: ({ margin }) => /* @__PURE__ */
|
|
1251
|
+
render: ({ margin }) => /* @__PURE__ */ jsx19("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1190
1252
|
};
|
|
1191
1253
|
var DividerRenderer_default = DividerRenderer;
|
|
1192
1254
|
|
|
1193
1255
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1194
|
-
import { Button as
|
|
1256
|
+
import { Button as Button3, Markdown as Markdown2, Modal } from "@transferwise/components";
|
|
1195
1257
|
|
|
1196
1258
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1197
|
-
import { defineMessages as
|
|
1198
|
-
var external_confirmation_messages_default =
|
|
1259
|
+
import { defineMessages as defineMessages3 } from "react-intl";
|
|
1260
|
+
var external_confirmation_messages_default = defineMessages3({
|
|
1199
1261
|
title: {
|
|
1200
1262
|
id: "df.wise.ExternalConfirmation.title",
|
|
1201
1263
|
defaultMessage: "Please confirm",
|
|
@@ -1219,9 +1281,9 @@ var external_confirmation_messages_default = defineMessages2({
|
|
|
1219
1281
|
});
|
|
1220
1282
|
|
|
1221
1283
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1222
|
-
import { useIntl as
|
|
1223
|
-
import { useEffect } from "react";
|
|
1224
|
-
import { Fragment, jsx as
|
|
1284
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
1285
|
+
import { useEffect as useEffect2 } from "react";
|
|
1286
|
+
import { Fragment, jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1225
1287
|
var ExternalConfirmationRenderer = {
|
|
1226
1288
|
canRenderType: "external-confirmation",
|
|
1227
1289
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1233,8 +1295,8 @@ function ExternalConfirmationRendererComponent({
|
|
|
1233
1295
|
onFailure,
|
|
1234
1296
|
onCancel
|
|
1235
1297
|
}) {
|
|
1236
|
-
const { formatMessage } =
|
|
1237
|
-
|
|
1298
|
+
const { formatMessage } = useIntl3();
|
|
1299
|
+
useEffect2(() => {
|
|
1238
1300
|
if (url) {
|
|
1239
1301
|
const w = window.open(url, "_blank");
|
|
1240
1302
|
if (w) {
|
|
@@ -1244,16 +1306,16 @@ function ExternalConfirmationRendererComponent({
|
|
|
1244
1306
|
}
|
|
1245
1307
|
}
|
|
1246
1308
|
}, []);
|
|
1247
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ jsx20(
|
|
1248
1310
|
Modal,
|
|
1249
1311
|
{
|
|
1250
1312
|
open: status === "failure",
|
|
1251
1313
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1252
|
-
body: /* @__PURE__ */
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1256
|
-
|
|
1314
|
+
body: /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1315
|
+
/* @__PURE__ */ jsx20(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1316
|
+
/* @__PURE__ */ jsx20("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs5("div", { className: "df-box-renderer-width-lg", children: [
|
|
1317
|
+
/* @__PURE__ */ jsx20(
|
|
1318
|
+
Button3,
|
|
1257
1319
|
{
|
|
1258
1320
|
block: true,
|
|
1259
1321
|
className: "m-b-2",
|
|
@@ -1266,7 +1328,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1266
1328
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1267
1329
|
}
|
|
1268
1330
|
),
|
|
1269
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsx20(Button3, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1270
1332
|
] }) })
|
|
1271
1333
|
] }),
|
|
1272
1334
|
onClose: onCancel
|
|
@@ -1283,27 +1345,27 @@ function getOrigin(url) {
|
|
|
1283
1345
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1284
1346
|
|
|
1285
1347
|
// ../renderers/src/FormRenderer.tsx
|
|
1286
|
-
import { jsx as
|
|
1348
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1287
1349
|
var FormRenderer = {
|
|
1288
1350
|
canRenderType: "form",
|
|
1289
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1351
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx21("div", { className: getMargin(margin), children })
|
|
1290
1352
|
};
|
|
1291
1353
|
var FormRenderer_default = FormRenderer;
|
|
1292
1354
|
|
|
1293
1355
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1294
1356
|
import { Header as Header2 } from "@transferwise/components";
|
|
1295
|
-
import { jsx as
|
|
1357
|
+
import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1296
1358
|
var FormSectionRenderer = {
|
|
1297
1359
|
canRenderType: "form-section",
|
|
1298
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
1299
|
-
title && /* @__PURE__ */
|
|
1360
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs6("fieldset", { children: [
|
|
1361
|
+
title && /* @__PURE__ */ jsx22(
|
|
1300
1362
|
Header2,
|
|
1301
1363
|
{
|
|
1302
1364
|
as: "h2",
|
|
1303
1365
|
title
|
|
1304
1366
|
}
|
|
1305
1367
|
),
|
|
1306
|
-
description && /* @__PURE__ */
|
|
1368
|
+
description && /* @__PURE__ */ jsx22("p", { children: description }),
|
|
1307
1369
|
children
|
|
1308
1370
|
] })
|
|
1309
1371
|
};
|
|
@@ -1311,18 +1373,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1311
1373
|
|
|
1312
1374
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1313
1375
|
import { Display, Title } from "@transferwise/components";
|
|
1314
|
-
import { jsx as
|
|
1376
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1315
1377
|
var HeadingRenderer = {
|
|
1316
1378
|
canRenderType: "heading",
|
|
1317
|
-
render: (props) => /* @__PURE__ */
|
|
1379
|
+
render: (props) => /* @__PURE__ */ jsx23(Heading, __spreadValues({}, props))
|
|
1318
1380
|
};
|
|
1319
1381
|
function Heading(props) {
|
|
1320
1382
|
const { text, size, align, margin, control } = props;
|
|
1321
1383
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1322
|
-
return control === "display" ? /* @__PURE__ */
|
|
1384
|
+
return control === "display" ? /* @__PURE__ */ jsx23(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx23(StandardHeading, { size, text, className });
|
|
1323
1385
|
}
|
|
1324
1386
|
function DisplayHeading({ size, text, className }) {
|
|
1325
|
-
return /* @__PURE__ */
|
|
1387
|
+
return /* @__PURE__ */ jsx23(Display, { type: getDisplayType(size), className, children: text });
|
|
1326
1388
|
}
|
|
1327
1389
|
var getDisplayType = (size) => {
|
|
1328
1390
|
switch (size) {
|
|
@@ -1338,7 +1400,7 @@ var getDisplayType = (size) => {
|
|
|
1338
1400
|
}
|
|
1339
1401
|
};
|
|
1340
1402
|
function StandardHeading({ size, text, className }) {
|
|
1341
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsx23(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1342
1404
|
}
|
|
1343
1405
|
var getTitleTypeBySize = (size) => {
|
|
1344
1406
|
var _a;
|
|
@@ -1355,7 +1417,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1355
1417
|
|
|
1356
1418
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1357
1419
|
import { Image } from "@transferwise/components";
|
|
1358
|
-
import { useEffect as
|
|
1420
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
1359
1421
|
|
|
1360
1422
|
// ../renderers/src/utils/api-utils.ts
|
|
1361
1423
|
function isRelativePath(url = "") {
|
|
@@ -1365,7 +1427,7 @@ function isRelativePath(url = "") {
|
|
|
1365
1427
|
}
|
|
1366
1428
|
|
|
1367
1429
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1368
|
-
import { jsx as
|
|
1430
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1369
1431
|
function UrlImage({
|
|
1370
1432
|
accessibilityDescription,
|
|
1371
1433
|
align,
|
|
@@ -1375,12 +1437,12 @@ function UrlImage({
|
|
|
1375
1437
|
httpClient
|
|
1376
1438
|
}) {
|
|
1377
1439
|
const [imageSource, setImageSource] = useState2("");
|
|
1378
|
-
|
|
1440
|
+
useEffect3(() => {
|
|
1379
1441
|
if (!uri.startsWith("urn:")) {
|
|
1380
1442
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1381
1443
|
}
|
|
1382
1444
|
}, [uri, httpClient]);
|
|
1383
|
-
return /* @__PURE__ */
|
|
1445
|
+
return /* @__PURE__ */ jsx24("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ jsx24(
|
|
1384
1446
|
Image,
|
|
1385
1447
|
{
|
|
1386
1448
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1424,7 +1486,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1424
1486
|
};
|
|
1425
1487
|
|
|
1426
1488
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1427
|
-
import { jsx as
|
|
1489
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1428
1490
|
var maxFlagSize = 600;
|
|
1429
1491
|
function UrnFlagImage({
|
|
1430
1492
|
accessibilityDescription,
|
|
@@ -1433,7 +1495,7 @@ function UrnFlagImage({
|
|
|
1433
1495
|
size,
|
|
1434
1496
|
uri
|
|
1435
1497
|
}) {
|
|
1436
|
-
return /* @__PURE__ */
|
|
1498
|
+
return /* @__PURE__ */ jsx25("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx25(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1437
1499
|
}
|
|
1438
1500
|
|
|
1439
1501
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -1457,7 +1519,7 @@ var isAnimated = (uri) => {
|
|
|
1457
1519
|
};
|
|
1458
1520
|
|
|
1459
1521
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1460
|
-
import { jsx as
|
|
1522
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1461
1523
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1462
1524
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1463
1525
|
function UrnIllustration({
|
|
@@ -1471,9 +1533,9 @@ function UrnIllustration({
|
|
|
1471
1533
|
const illustrationName = getIllustrationName(uri);
|
|
1472
1534
|
const illustration3DName = getIllustration3DName(uri);
|
|
1473
1535
|
if (illustration3DName && isAnimated(uri)) {
|
|
1474
|
-
return /* @__PURE__ */
|
|
1536
|
+
return /* @__PURE__ */ jsx26("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx26(Illustration3D, { name: illustration3DName, size: illustrationSize }) });
|
|
1475
1537
|
}
|
|
1476
|
-
return /* @__PURE__ */
|
|
1538
|
+
return /* @__PURE__ */ jsx26("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx26(
|
|
1477
1539
|
Illustration,
|
|
1478
1540
|
{
|
|
1479
1541
|
className: "df-illustration",
|
|
@@ -1493,24 +1555,24 @@ var getIllustration3DName = (uri) => {
|
|
|
1493
1555
|
};
|
|
1494
1556
|
|
|
1495
1557
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1496
|
-
import { jsx as
|
|
1558
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1497
1559
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1498
1560
|
function UrnImage(props) {
|
|
1499
1561
|
const { uri } = props;
|
|
1500
1562
|
if (isUrnIllustration(uri)) {
|
|
1501
|
-
return /* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ jsx27(UrnIllustration, __spreadValues({}, props));
|
|
1502
1564
|
}
|
|
1503
1565
|
if (isUrnFlag(uri)) {
|
|
1504
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsx27(UrnFlagImage, __spreadValues({}, props));
|
|
1505
1567
|
}
|
|
1506
1568
|
return null;
|
|
1507
1569
|
}
|
|
1508
1570
|
|
|
1509
1571
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1510
|
-
import { jsx as
|
|
1572
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1511
1573
|
var ImageRenderer = {
|
|
1512
1574
|
canRenderType: "image",
|
|
1513
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
1575
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx28(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx28(UrlImage, __spreadValues({}, props))
|
|
1514
1576
|
};
|
|
1515
1577
|
|
|
1516
1578
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -1518,7 +1580,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
1518
1580
|
|
|
1519
1581
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1520
1582
|
import { Header as Header3, InstructionsList } from "@transferwise/components";
|
|
1521
|
-
import { jsx as
|
|
1583
|
+
import { jsx as jsx29, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1522
1584
|
var doContext = ["positive", "neutral"];
|
|
1523
1585
|
var dontContext = ["warning", "negative"];
|
|
1524
1586
|
var InstructionsRenderer = {
|
|
@@ -1526,9 +1588,9 @@ var InstructionsRenderer = {
|
|
|
1526
1588
|
render: ({ items, margin, title }) => {
|
|
1527
1589
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1528
1590
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1529
|
-
return /* @__PURE__ */
|
|
1530
|
-
title ? /* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
|
|
1592
|
+
title ? /* @__PURE__ */ jsx29(Header3, { title }) : null,
|
|
1593
|
+
/* @__PURE__ */ jsx29(InstructionsList, { dos, donts })
|
|
1532
1594
|
] });
|
|
1533
1595
|
}
|
|
1534
1596
|
};
|
|
@@ -1546,7 +1608,7 @@ var onWheel = (event) => {
|
|
|
1546
1608
|
|
|
1547
1609
|
// ../renderers/src/utils/getInlineAvatar.tsx
|
|
1548
1610
|
import { AvatarView as AvatarView3 } from "@transferwise/components";
|
|
1549
|
-
import { jsx as
|
|
1611
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1550
1612
|
var mediaSize2 = 24;
|
|
1551
1613
|
function getInlineAvatar({ icon, image }) {
|
|
1552
1614
|
const imageNode = getImageNode(image, mediaSize2);
|
|
@@ -1562,7 +1624,7 @@ function getInlineAvatar({ icon, image }) {
|
|
|
1562
1624
|
return iconNode;
|
|
1563
1625
|
}
|
|
1564
1626
|
if (iconNode) {
|
|
1565
|
-
return /* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ jsx30(AvatarView3, { size: mediaSize2, children: iconNode });
|
|
1566
1628
|
}
|
|
1567
1629
|
return null;
|
|
1568
1630
|
}
|
|
@@ -1585,7 +1647,7 @@ function pick(obj, ...keys) {
|
|
|
1585
1647
|
}
|
|
1586
1648
|
|
|
1587
1649
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1588
|
-
import { jsx as
|
|
1650
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1589
1651
|
var IntegerInputRenderer = {
|
|
1590
1652
|
canRenderType: "input-integer",
|
|
1591
1653
|
render: (props) => {
|
|
@@ -1600,7 +1662,7 @@ var IntegerInputRenderer = {
|
|
|
1600
1662
|
"maximum",
|
|
1601
1663
|
"minimum"
|
|
1602
1664
|
);
|
|
1603
|
-
return /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx31(
|
|
1604
1666
|
FieldInput_default,
|
|
1605
1667
|
{
|
|
1606
1668
|
id,
|
|
@@ -1608,7 +1670,7 @@ var IntegerInputRenderer = {
|
|
|
1608
1670
|
description,
|
|
1609
1671
|
validation: validationState,
|
|
1610
1672
|
help,
|
|
1611
|
-
children: /* @__PURE__ */
|
|
1673
|
+
children: /* @__PURE__ */ jsx31(InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx31(
|
|
1612
1674
|
Input,
|
|
1613
1675
|
__spreadValues({
|
|
1614
1676
|
id,
|
|
@@ -1633,12 +1695,12 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1633
1695
|
// ../renderers/src/ListRenderer.tsx
|
|
1634
1696
|
import { Body, Header as Header4 } from "@transferwise/components";
|
|
1635
1697
|
import classNames3 from "classnames";
|
|
1636
|
-
import { jsx as
|
|
1698
|
+
import { jsx as jsx32, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1637
1699
|
var ListRenderer = {
|
|
1638
1700
|
canRenderType: "list",
|
|
1639
|
-
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */
|
|
1640
|
-
(title || callToAction) && /* @__PURE__ */
|
|
1641
|
-
items.map((props) => /* @__PURE__ */
|
|
1701
|
+
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs8("div", { className: getMargin(margin), children: [
|
|
1702
|
+
(title || callToAction) && /* @__PURE__ */ jsx32(Header4, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
1703
|
+
items.map((props) => /* @__PURE__ */ jsx32(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
|
|
1642
1704
|
] })
|
|
1643
1705
|
};
|
|
1644
1706
|
var DesignSystemListItem = ({
|
|
@@ -1649,15 +1711,15 @@ var DesignSystemListItem = ({
|
|
|
1649
1711
|
image,
|
|
1650
1712
|
control,
|
|
1651
1713
|
tag
|
|
1652
|
-
}) => /* @__PURE__ */
|
|
1714
|
+
}) => /* @__PURE__ */ jsx32(
|
|
1653
1715
|
"label",
|
|
1654
1716
|
{
|
|
1655
1717
|
className: classNames3("np-option p-a-2", {
|
|
1656
1718
|
"np-option__sm-media": true,
|
|
1657
1719
|
"np-option__container-aligned": true
|
|
1658
1720
|
}),
|
|
1659
|
-
children: /* @__PURE__ */
|
|
1660
|
-
icon || image ? /* @__PURE__ */
|
|
1721
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "media", children: [
|
|
1722
|
+
icon || image ? /* @__PURE__ */ jsx32("div", { className: "media-left", children: /* @__PURE__ */ jsx32(
|
|
1661
1723
|
ListItemMedia,
|
|
1662
1724
|
{
|
|
1663
1725
|
image,
|
|
@@ -1665,14 +1727,14 @@ var DesignSystemListItem = ({
|
|
|
1665
1727
|
preferAvatar: control === "with-avatar" || tag === "with-avatar"
|
|
1666
1728
|
}
|
|
1667
1729
|
) }) : null,
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
/* @__PURE__ */
|
|
1730
|
+
/* @__PURE__ */ jsxs8("div", { className: "media-body", children: [
|
|
1731
|
+
/* @__PURE__ */ jsxs8("div", { className: "d-flex justify-content-between", children: [
|
|
1732
|
+
/* @__PURE__ */ jsx32("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
1733
|
+
/* @__PURE__ */ jsx32("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: supportingValues == null ? void 0 : supportingValues.value })
|
|
1672
1734
|
] }),
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsxs8("div", { className: "d-flex justify-content-between", children: [
|
|
1736
|
+
/* @__PURE__ */ jsx32(Body, { className: "d-block np-option__body", children: description }),
|
|
1737
|
+
/* @__PURE__ */ jsx32(Body, { className: "d-block np-option__body", children: supportingValues == null ? void 0 : supportingValues.subvalue })
|
|
1676
1738
|
] })
|
|
1677
1739
|
] })
|
|
1678
1740
|
] })
|
|
@@ -1685,10 +1747,10 @@ var ListItemMedia = ({
|
|
|
1685
1747
|
preferAvatar
|
|
1686
1748
|
}) => {
|
|
1687
1749
|
if (icon) {
|
|
1688
|
-
return /* @__PURE__ */
|
|
1750
|
+
return /* @__PURE__ */ jsx32("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ jsx32(OptionMedia, { icon, image, preferAvatar }) });
|
|
1689
1751
|
}
|
|
1690
1752
|
if (image) {
|
|
1691
|
-
return /* @__PURE__ */
|
|
1753
|
+
return /* @__PURE__ */ jsx32("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx32(OptionMedia, { icon, image, preferAvatar }) });
|
|
1692
1754
|
}
|
|
1693
1755
|
};
|
|
1694
1756
|
var getListAction = (callToAction) => {
|
|
@@ -1705,10 +1767,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
1705
1767
|
|
|
1706
1768
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1707
1769
|
import { Loader } from "@transferwise/components";
|
|
1708
|
-
import { jsx as
|
|
1770
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1709
1771
|
var LoadingIndicatorRenderer = {
|
|
1710
1772
|
canRenderType: "loading-indicator",
|
|
1711
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
1773
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx33(
|
|
1712
1774
|
Loader,
|
|
1713
1775
|
{
|
|
1714
1776
|
size,
|
|
@@ -1721,28 +1783,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1721
1783
|
|
|
1722
1784
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1723
1785
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
1724
|
-
import { jsx as
|
|
1786
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1725
1787
|
var MarkdownRenderer = {
|
|
1726
1788
|
canRenderType: "markdown",
|
|
1727
|
-
render: ({ content, align, margin }) => /* @__PURE__ */
|
|
1789
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx34("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx34(Markdown3, { className: "np-text-body-large", config: { link: { target: "_blank" } }, children: content }) })
|
|
1728
1790
|
};
|
|
1729
1791
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1730
1792
|
|
|
1731
1793
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
1732
|
-
import { Button as
|
|
1794
|
+
import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
|
|
1733
1795
|
import { useState as useState3 } from "react";
|
|
1734
|
-
import { jsx as
|
|
1796
|
+
import { jsx as jsx35, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1735
1797
|
var ModalLayoutRenderer = {
|
|
1736
1798
|
canRenderType: "modal-layout",
|
|
1737
|
-
render: (props) => /* @__PURE__ */
|
|
1799
|
+
render: (props) => /* @__PURE__ */ jsx35(DFModal, __spreadValues({}, props))
|
|
1738
1800
|
};
|
|
1739
1801
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
1740
1802
|
function DFModal({ content, margin, trigger }) {
|
|
1741
1803
|
const [visible, setVisible] = useState3(false);
|
|
1742
1804
|
const { children, title } = content;
|
|
1743
|
-
return /* @__PURE__ */
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ jsxs9("div", { className: getMargin(margin), children: [
|
|
1806
|
+
/* @__PURE__ */ jsx35(Button4, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1807
|
+
/* @__PURE__ */ jsx35(
|
|
1746
1808
|
Modal2,
|
|
1747
1809
|
{
|
|
1748
1810
|
scroll: "content",
|
|
@@ -1758,22 +1820,22 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1758
1820
|
|
|
1759
1821
|
// ../renderers/src/ModalRenderer.tsx
|
|
1760
1822
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
1761
|
-
import { jsx as
|
|
1823
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1762
1824
|
var ModalRenderer = {
|
|
1763
1825
|
canRenderType: "modal",
|
|
1764
1826
|
render: ({ title, children, open, onClose }) => {
|
|
1765
|
-
return /* @__PURE__ */
|
|
1827
|
+
return /* @__PURE__ */ jsx36(Modal3, { open, title, body: children, onClose });
|
|
1766
1828
|
}
|
|
1767
1829
|
};
|
|
1768
1830
|
|
|
1769
1831
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1770
1832
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
1771
1833
|
import { useState as useState4 } from "react";
|
|
1772
|
-
import { useIntl as
|
|
1834
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
1773
1835
|
|
|
1774
1836
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
1775
|
-
import { defineMessages as
|
|
1776
|
-
var multi_select_messages_default =
|
|
1837
|
+
import { defineMessages as defineMessages4 } from "react-intl";
|
|
1838
|
+
var multi_select_messages_default = defineMessages4({
|
|
1777
1839
|
summary: {
|
|
1778
1840
|
id: "df.wise.MultiSelect.summary",
|
|
1779
1841
|
defaultMessage: "{first} and {count} more",
|
|
@@ -1782,13 +1844,13 @@ var multi_select_messages_default = defineMessages3({
|
|
|
1782
1844
|
});
|
|
1783
1845
|
|
|
1784
1846
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1785
|
-
import { jsx as
|
|
1847
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1786
1848
|
var MultiSelectInputRenderer = {
|
|
1787
1849
|
canRenderType: "input-multi-select",
|
|
1788
|
-
render: (props) => /* @__PURE__ */
|
|
1850
|
+
render: (props) => /* @__PURE__ */ jsx37(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1789
1851
|
};
|
|
1790
1852
|
function MultiSelectInputRendererComponent(props) {
|
|
1791
|
-
const { formatMessage } =
|
|
1853
|
+
const { formatMessage } = useIntl4();
|
|
1792
1854
|
const [stagedIndices, setStagedIndices] = useState4();
|
|
1793
1855
|
const {
|
|
1794
1856
|
id,
|
|
@@ -1827,12 +1889,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1827
1889
|
const contentProps = {
|
|
1828
1890
|
title: option.title,
|
|
1829
1891
|
description: option.description,
|
|
1830
|
-
icon: /* @__PURE__ */
|
|
1892
|
+
icon: /* @__PURE__ */ jsx37(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
1831
1893
|
};
|
|
1832
|
-
return /* @__PURE__ */
|
|
1894
|
+
return /* @__PURE__ */ jsx37(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1833
1895
|
};
|
|
1834
1896
|
const extraProps = { autoComplete };
|
|
1835
|
-
return /* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ jsx37(
|
|
1836
1898
|
FieldInput_default,
|
|
1837
1899
|
{
|
|
1838
1900
|
id,
|
|
@@ -1840,7 +1902,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1840
1902
|
help,
|
|
1841
1903
|
description,
|
|
1842
1904
|
validation: validationState,
|
|
1843
|
-
children: /* @__PURE__ */
|
|
1905
|
+
children: /* @__PURE__ */ jsx37(
|
|
1844
1906
|
SelectInput,
|
|
1845
1907
|
__spreadValues({
|
|
1846
1908
|
id,
|
|
@@ -1883,9 +1945,9 @@ var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
|
1883
1945
|
import { UploadInput } from "@transferwise/components";
|
|
1884
1946
|
|
|
1885
1947
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1886
|
-
import { InlineAlert } from "@transferwise/components";
|
|
1948
|
+
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
1887
1949
|
import classNames4 from "classnames";
|
|
1888
|
-
import { jsx as
|
|
1950
|
+
import { jsx as jsx38, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1889
1951
|
function UploadFieldInput({
|
|
1890
1952
|
id,
|
|
1891
1953
|
children,
|
|
@@ -1894,18 +1956,18 @@ function UploadFieldInput({
|
|
|
1894
1956
|
help,
|
|
1895
1957
|
validation
|
|
1896
1958
|
}) {
|
|
1897
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1959
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx38(LabelContentWithHelp, { text: label, help }) : label;
|
|
1898
1960
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1899
|
-
return /* @__PURE__ */
|
|
1961
|
+
return /* @__PURE__ */ jsxs10(
|
|
1900
1962
|
"div",
|
|
1901
1963
|
{
|
|
1902
1964
|
className: classNames4("form-group d-block", {
|
|
1903
1965
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1904
1966
|
}),
|
|
1905
1967
|
children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx38("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1907
1969
|
children,
|
|
1908
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
1970
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx38(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
1909
1971
|
]
|
|
1910
1972
|
}
|
|
1911
1973
|
);
|
|
@@ -1934,7 +1996,7 @@ var getFileType = (base64Url) => {
|
|
|
1934
1996
|
};
|
|
1935
1997
|
|
|
1936
1998
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1937
|
-
import { jsx as
|
|
1999
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1938
2000
|
var MultiUploadInputRenderer = {
|
|
1939
2001
|
canRenderType: "input-upload-multi",
|
|
1940
2002
|
render: (props) => {
|
|
@@ -1959,7 +2021,7 @@ var MultiUploadInputRenderer = {
|
|
|
1959
2021
|
};
|
|
1960
2022
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1961
2023
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1962
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ jsx39(
|
|
1963
2025
|
UploadFieldInput_default,
|
|
1964
2026
|
{
|
|
1965
2027
|
id,
|
|
@@ -1967,7 +2029,7 @@ var MultiUploadInputRenderer = {
|
|
|
1967
2029
|
description,
|
|
1968
2030
|
validation: validationState,
|
|
1969
2031
|
help,
|
|
1970
|
-
children: /* @__PURE__ */
|
|
2032
|
+
children: /* @__PURE__ */ jsx39(
|
|
1971
2033
|
UploadInput,
|
|
1972
2034
|
{
|
|
1973
2035
|
id,
|
|
@@ -1991,7 +2053,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1991
2053
|
|
|
1992
2054
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1993
2055
|
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1994
|
-
import { jsx as
|
|
2056
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1995
2057
|
var NumberInputRenderer = {
|
|
1996
2058
|
canRenderType: "input-number",
|
|
1997
2059
|
render: (props) => {
|
|
@@ -2005,7 +2067,7 @@ var NumberInputRenderer = {
|
|
|
2005
2067
|
"maximum",
|
|
2006
2068
|
"minimum"
|
|
2007
2069
|
);
|
|
2008
|
-
return /* @__PURE__ */
|
|
2070
|
+
return /* @__PURE__ */ jsx40(
|
|
2009
2071
|
FieldInput_default,
|
|
2010
2072
|
{
|
|
2011
2073
|
id,
|
|
@@ -2013,7 +2075,7 @@ var NumberInputRenderer = {
|
|
|
2013
2075
|
description,
|
|
2014
2076
|
validation: validationState,
|
|
2015
2077
|
help,
|
|
2016
|
-
children: /* @__PURE__ */
|
|
2078
|
+
children: /* @__PURE__ */ jsx40(InputGroup2, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx40(
|
|
2017
2079
|
Input2,
|
|
2018
2080
|
__spreadValues({
|
|
2019
2081
|
id,
|
|
@@ -2034,7 +2096,7 @@ var NumberInputRenderer = {
|
|
|
2034
2096
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2035
2097
|
|
|
2036
2098
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2037
|
-
import { useIntl as
|
|
2099
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
2038
2100
|
|
|
2039
2101
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2040
2102
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -2046,12 +2108,12 @@ function useSnackBarIfAvailable() {
|
|
|
2046
2108
|
}
|
|
2047
2109
|
|
|
2048
2110
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2049
|
-
import { Button as
|
|
2111
|
+
import { Button as Button5, Input as Input3 } from "@transferwise/components";
|
|
2050
2112
|
import classNames5 from "classnames";
|
|
2051
2113
|
|
|
2052
2114
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2053
|
-
import { defineMessages as
|
|
2054
|
-
var paragraph_messages_default =
|
|
2115
|
+
import { defineMessages as defineMessages5 } from "react-intl";
|
|
2116
|
+
var paragraph_messages_default = defineMessages5({
|
|
2055
2117
|
copy: {
|
|
2056
2118
|
id: "df.wise.DynamicParagraph.copy",
|
|
2057
2119
|
defaultMessage: "Copy",
|
|
@@ -2065,32 +2127,32 @@ var paragraph_messages_default = defineMessages4({
|
|
|
2065
2127
|
});
|
|
2066
2128
|
|
|
2067
2129
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2068
|
-
import { jsx as
|
|
2130
|
+
import { jsx as jsx41, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2069
2131
|
var ParagraphRenderer = {
|
|
2070
2132
|
canRenderType: "paragraph",
|
|
2071
|
-
render: (props) => /* @__PURE__ */
|
|
2133
|
+
render: (props) => /* @__PURE__ */ jsx41(Paragraph, __spreadValues({}, props))
|
|
2072
2134
|
};
|
|
2073
2135
|
function Paragraph({ align, control, margin, text }) {
|
|
2074
2136
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2075
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2137
|
+
return control === "copyable" ? /* @__PURE__ */ jsx41(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx41(StandardParagraph, { className, text });
|
|
2076
2138
|
}
|
|
2077
2139
|
function StandardParagraph({ text, className }) {
|
|
2078
|
-
return /* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ jsx41("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2079
2141
|
}
|
|
2080
2142
|
function CopyableParagraph({
|
|
2081
2143
|
text,
|
|
2082
2144
|
align,
|
|
2083
2145
|
className
|
|
2084
2146
|
}) {
|
|
2085
|
-
const { formatMessage } =
|
|
2147
|
+
const { formatMessage } = useIntl5();
|
|
2086
2148
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2087
2149
|
const copy = () => {
|
|
2088
2150
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2089
2151
|
});
|
|
2090
2152
|
};
|
|
2091
2153
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2092
|
-
return /* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ jsxs11("div", { className, children: [
|
|
2155
|
+
/* @__PURE__ */ jsx41(
|
|
2094
2156
|
Input3,
|
|
2095
2157
|
{
|
|
2096
2158
|
type: "text",
|
|
@@ -2099,21 +2161,21 @@ function CopyableParagraph({
|
|
|
2099
2161
|
className: classNames5("text-ellipsis", inputAlignmentClasses)
|
|
2100
2162
|
}
|
|
2101
2163
|
),
|
|
2102
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ jsx41(Button5, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2103
2165
|
] });
|
|
2104
2166
|
}
|
|
2105
2167
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2106
2168
|
|
|
2107
2169
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2108
|
-
import { Button as
|
|
2170
|
+
import { Button as Button6, Header as Header5, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption as NavigationOption2 } from "@transferwise/components";
|
|
2109
2171
|
import { Plus } from "@transferwise/icons";
|
|
2110
2172
|
import classNames6 from "classnames";
|
|
2111
2173
|
import { useState as useState5 } from "react";
|
|
2112
|
-
import { useIntl as
|
|
2174
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
2113
2175
|
|
|
2114
2176
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2115
|
-
import { defineMessages as
|
|
2116
|
-
var repeatable_messages_default =
|
|
2177
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
2178
|
+
var repeatable_messages_default = defineMessages6({
|
|
2117
2179
|
addItemTitle: {
|
|
2118
2180
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2119
2181
|
defaultMessage: "Add Item",
|
|
@@ -2137,10 +2199,10 @@ var repeatable_messages_default = defineMessages5({
|
|
|
2137
2199
|
});
|
|
2138
2200
|
|
|
2139
2201
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2140
|
-
import { Fragment as Fragment2, jsx as
|
|
2202
|
+
import { Fragment as Fragment2, jsx as jsx42, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2141
2203
|
var RepeatableRenderer = {
|
|
2142
2204
|
canRenderType: "repeatable",
|
|
2143
|
-
render: (props) => /* @__PURE__ */
|
|
2205
|
+
render: (props) => /* @__PURE__ */ jsx42(Repeatable, __spreadValues({}, props))
|
|
2144
2206
|
};
|
|
2145
2207
|
function Repeatable(props) {
|
|
2146
2208
|
const {
|
|
@@ -2156,7 +2218,7 @@ function Repeatable(props) {
|
|
|
2156
2218
|
onSave,
|
|
2157
2219
|
onRemove
|
|
2158
2220
|
} = props;
|
|
2159
|
-
const { formatMessage } =
|
|
2221
|
+
const { formatMessage } = useIntl6();
|
|
2160
2222
|
const [openModalType, setOpenModalType] = useState5(null);
|
|
2161
2223
|
const onAddItem = () => {
|
|
2162
2224
|
onAdd();
|
|
@@ -2179,40 +2241,40 @@ function Repeatable(props) {
|
|
|
2179
2241
|
const onCancelEdit = () => {
|
|
2180
2242
|
setOpenModalType(null);
|
|
2181
2243
|
};
|
|
2182
|
-
return /* @__PURE__ */
|
|
2183
|
-
title && /* @__PURE__ */
|
|
2184
|
-
description && /* @__PURE__ */
|
|
2185
|
-
/* @__PURE__ */
|
|
2244
|
+
return /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
2245
|
+
title && /* @__PURE__ */ jsx42(Header5, { title }),
|
|
2246
|
+
description && /* @__PURE__ */ jsx42("p", { children: description }),
|
|
2247
|
+
/* @__PURE__ */ jsxs12(
|
|
2186
2248
|
"div",
|
|
2187
2249
|
{
|
|
2188
2250
|
className: classNames6("form-group", {
|
|
2189
2251
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2190
2252
|
}),
|
|
2191
2253
|
children: [
|
|
2192
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2193
|
-
/* @__PURE__ */
|
|
2254
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx42(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2255
|
+
/* @__PURE__ */ jsx42(
|
|
2194
2256
|
NavigationOption2,
|
|
2195
2257
|
{
|
|
2196
|
-
media: /* @__PURE__ */
|
|
2258
|
+
media: /* @__PURE__ */ jsx42(Plus, {}),
|
|
2197
2259
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2198
2260
|
showMediaAtAllSizes: true,
|
|
2199
2261
|
onClick: () => onAddItem()
|
|
2200
2262
|
}
|
|
2201
2263
|
),
|
|
2202
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2264
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx42(InlineAlert3, { type: "negative", children: validationState.message })
|
|
2203
2265
|
]
|
|
2204
2266
|
}
|
|
2205
2267
|
),
|
|
2206
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsx42(
|
|
2207
2269
|
Modal4,
|
|
2208
2270
|
{
|
|
2209
2271
|
open: openModalType !== null,
|
|
2210
2272
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2211
|
-
body: /* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2273
|
+
body: /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
2274
|
+
/* @__PURE__ */ jsx42("div", { className: "m-b-2", children: editableItem }),
|
|
2275
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
2276
|
+
/* @__PURE__ */ jsx42(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2277
|
+
/* @__PURE__ */ jsx42(Button6, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2216
2278
|
] })
|
|
2217
2279
|
] }),
|
|
2218
2280
|
onClose: () => onCancelEdit()
|
|
@@ -2224,10 +2286,10 @@ function ItemSummaryOption({
|
|
|
2224
2286
|
item,
|
|
2225
2287
|
onClick
|
|
2226
2288
|
}) {
|
|
2227
|
-
return /* @__PURE__ */
|
|
2289
|
+
return /* @__PURE__ */ jsx42(
|
|
2228
2290
|
NavigationOption2,
|
|
2229
2291
|
{
|
|
2230
|
-
media: /* @__PURE__ */
|
|
2292
|
+
media: /* @__PURE__ */ jsx42(OptionMedia, __spreadProps(__spreadValues({}, item), { preferAvatar: false })),
|
|
2231
2293
|
title: item.title,
|
|
2232
2294
|
content: item.description,
|
|
2233
2295
|
showMediaAtAllSizes: true,
|
|
@@ -2262,14 +2324,14 @@ var getHeaderAction = (callToAction) => {
|
|
|
2262
2324
|
};
|
|
2263
2325
|
|
|
2264
2326
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2265
|
-
import { Fragment as Fragment3, jsx as
|
|
2327
|
+
import { Fragment as Fragment3, jsx as jsx43, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2266
2328
|
var ReviewRenderer = {
|
|
2267
2329
|
canRenderType: "review",
|
|
2268
2330
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2269
2331
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2270
|
-
return /* @__PURE__ */
|
|
2271
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2272
|
-
/* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
|
|
2333
|
+
(title || callToAction) && /* @__PURE__ */ jsx43(Header6, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2334
|
+
/* @__PURE__ */ jsx43("div", { className: margin, children: /* @__PURE__ */ jsx43(
|
|
2273
2335
|
DefinitionList,
|
|
2274
2336
|
{
|
|
2275
2337
|
layout: orientation,
|
|
@@ -2308,14 +2370,14 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2308
2370
|
};
|
|
2309
2371
|
var getFieldValue = (value, help, orientation, onClick) => {
|
|
2310
2372
|
if (help) {
|
|
2311
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
2373
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
2374
|
+
/* @__PURE__ */ jsx43(Help_default, { help, onClick }),
|
|
2313
2375
|
" ",
|
|
2314
2376
|
value
|
|
2315
|
-
] }) : /* @__PURE__ */
|
|
2377
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
|
|
2316
2378
|
value,
|
|
2317
2379
|
" ",
|
|
2318
|
-
/* @__PURE__ */
|
|
2380
|
+
/* @__PURE__ */ jsx43(Help_default, { help, onClick })
|
|
2319
2381
|
] });
|
|
2320
2382
|
}
|
|
2321
2383
|
return value;
|
|
@@ -2324,11 +2386,11 @@ var getFieldValue = (value, help, orientation, onClick) => {
|
|
|
2324
2386
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2325
2387
|
import { Input as Input4, Markdown as Markdown4, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
|
|
2326
2388
|
import { useState as useState6 } from "react";
|
|
2327
|
-
import { useIntl as
|
|
2389
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
2328
2390
|
|
|
2329
2391
|
// ../renderers/src/messages/search.messages.ts
|
|
2330
|
-
import { defineMessages as
|
|
2331
|
-
var search_messages_default =
|
|
2392
|
+
import { defineMessages as defineMessages7 } from "react-intl";
|
|
2393
|
+
var search_messages_default = defineMessages7({
|
|
2332
2394
|
loading: {
|
|
2333
2395
|
id: "df.wise.SearchLayout.loading",
|
|
2334
2396
|
defaultMessage: "Loading...",
|
|
@@ -2337,11 +2399,11 @@ var search_messages_default = defineMessages6({
|
|
|
2337
2399
|
});
|
|
2338
2400
|
|
|
2339
2401
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2340
|
-
import { useIntl as
|
|
2402
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
2341
2403
|
|
|
2342
2404
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
2343
|
-
import { defineMessages as
|
|
2344
|
-
var generic_error_messages_default =
|
|
2405
|
+
import { defineMessages as defineMessages8 } from "react-intl";
|
|
2406
|
+
var generic_error_messages_default = defineMessages8({
|
|
2345
2407
|
genericErrorRetryHint: {
|
|
2346
2408
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
2347
2409
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -2360,20 +2422,20 @@ var generic_error_messages_default = defineMessages7({
|
|
|
2360
2422
|
});
|
|
2361
2423
|
|
|
2362
2424
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2363
|
-
import { Button as
|
|
2364
|
-
import { jsx as
|
|
2425
|
+
import { Button as Button7 } from "@transferwise/components";
|
|
2426
|
+
import { jsx as jsx44, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2365
2427
|
function ErrorResult({ state }) {
|
|
2366
|
-
const intl =
|
|
2428
|
+
const intl = useIntl7();
|
|
2367
2429
|
const buttonVisualProps = {
|
|
2368
2430
|
priority: "tertiary",
|
|
2369
2431
|
size: "sm",
|
|
2370
2432
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2371
2433
|
};
|
|
2372
|
-
return /* @__PURE__ */
|
|
2434
|
+
return /* @__PURE__ */ jsxs14("p", { className: "m-t-2", children: [
|
|
2373
2435
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2374
2436
|
"\xA0",
|
|
2375
|
-
/* @__PURE__ */
|
|
2376
|
-
|
|
2437
|
+
/* @__PURE__ */ jsx44(
|
|
2438
|
+
Button7,
|
|
2377
2439
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2378
2440
|
onClick: () => {
|
|
2379
2441
|
state.onRetry();
|
|
@@ -2385,7 +2447,7 @@ function ErrorResult({ state }) {
|
|
|
2385
2447
|
}
|
|
2386
2448
|
|
|
2387
2449
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2388
|
-
import { Fragment as Fragment4, jsx as
|
|
2450
|
+
import { Fragment as Fragment4, jsx as jsx45, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2389
2451
|
function BlockSearchRendererComponent({
|
|
2390
2452
|
id,
|
|
2391
2453
|
isLoading,
|
|
@@ -2397,9 +2459,9 @@ function BlockSearchRendererComponent({
|
|
|
2397
2459
|
onChange
|
|
2398
2460
|
}) {
|
|
2399
2461
|
const [hasSearched, setHasSearched] = useState6(false);
|
|
2400
|
-
const { formatMessage } =
|
|
2401
|
-
return /* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2462
|
+
const { formatMessage } = useIntl8();
|
|
2463
|
+
return /* @__PURE__ */ jsxs15("div", { className: getMargin(margin), children: [
|
|
2464
|
+
/* @__PURE__ */ jsx45(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx45(
|
|
2403
2465
|
Input4,
|
|
2404
2466
|
{
|
|
2405
2467
|
id,
|
|
@@ -2416,7 +2478,7 @@ function BlockSearchRendererComponent({
|
|
|
2416
2478
|
}
|
|
2417
2479
|
}
|
|
2418
2480
|
) }),
|
|
2419
|
-
isLoading ? /* @__PURE__ */
|
|
2481
|
+
isLoading ? /* @__PURE__ */ jsx45(Fragment4, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx45(SearchResultContent, { state, trackEvent })
|
|
2420
2482
|
] });
|
|
2421
2483
|
}
|
|
2422
2484
|
function SearchResultContent({
|
|
@@ -2425,26 +2487,26 @@ function SearchResultContent({
|
|
|
2425
2487
|
}) {
|
|
2426
2488
|
switch (state.type) {
|
|
2427
2489
|
case "error":
|
|
2428
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ jsx45(ErrorResult, { state });
|
|
2429
2491
|
case "results":
|
|
2430
|
-
return /* @__PURE__ */
|
|
2492
|
+
return /* @__PURE__ */ jsx45(SearchResults, { state, trackEvent });
|
|
2431
2493
|
case "noResults":
|
|
2432
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ jsx45(EmptySearchResult, { state });
|
|
2433
2495
|
case "pending":
|
|
2434
2496
|
default:
|
|
2435
2497
|
return null;
|
|
2436
2498
|
}
|
|
2437
2499
|
}
|
|
2438
2500
|
function EmptySearchResult({ state }) {
|
|
2439
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ jsx45(Markdown4, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2440
2502
|
}
|
|
2441
2503
|
function SearchResults({
|
|
2442
2504
|
state,
|
|
2443
2505
|
trackEvent
|
|
2444
2506
|
}) {
|
|
2445
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ jsx45(NavigationOptionsList2, { children: state.results.map((result) => {
|
|
2446
2508
|
const { icon, image } = result;
|
|
2447
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ jsx45(
|
|
2448
2510
|
NavigationOption3,
|
|
2449
2511
|
{
|
|
2450
2512
|
title: result.title,
|
|
@@ -2469,8 +2531,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2469
2531
|
import { Markdown as Markdown5, Typeahead } from "@transferwise/components";
|
|
2470
2532
|
import { Search } from "@transferwise/icons";
|
|
2471
2533
|
import { useState as useState7 } from "react";
|
|
2472
|
-
import { useIntl as
|
|
2473
|
-
import { jsx as
|
|
2534
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
2535
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2474
2536
|
function InlineSearchRenderer({
|
|
2475
2537
|
id,
|
|
2476
2538
|
isLoading,
|
|
@@ -2481,8 +2543,8 @@ function InlineSearchRenderer({
|
|
|
2481
2543
|
trackEvent
|
|
2482
2544
|
}) {
|
|
2483
2545
|
const [hasSearched, setHasSearched] = useState7(false);
|
|
2484
|
-
const intl =
|
|
2485
|
-
return /* @__PURE__ */
|
|
2546
|
+
const intl = useIntl9();
|
|
2547
|
+
return /* @__PURE__ */ jsx46("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx46(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx46(
|
|
2486
2548
|
Typeahead,
|
|
2487
2549
|
{
|
|
2488
2550
|
id: "typeahead-input-id",
|
|
@@ -2490,10 +2552,10 @@ function InlineSearchRenderer({
|
|
|
2490
2552
|
name: "typeahead-input-name",
|
|
2491
2553
|
size: "md",
|
|
2492
2554
|
maxHeight: 100,
|
|
2493
|
-
footer: /* @__PURE__ */
|
|
2555
|
+
footer: /* @__PURE__ */ jsx46(TypeaheadFooter, { state, isLoading }),
|
|
2494
2556
|
multiple: false,
|
|
2495
2557
|
clearable: false,
|
|
2496
|
-
addon: /* @__PURE__ */
|
|
2558
|
+
addon: /* @__PURE__ */ jsx46(Search, { size: 24 }),
|
|
2497
2559
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2498
2560
|
minQueryLength: 1,
|
|
2499
2561
|
onChange: (values) => {
|
|
@@ -2528,36 +2590,36 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2528
2590
|
};
|
|
2529
2591
|
}
|
|
2530
2592
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2531
|
-
const { formatMessage } =
|
|
2593
|
+
const { formatMessage } = useIntl9();
|
|
2532
2594
|
if (state.type === "noResults") {
|
|
2533
|
-
return /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ jsx46(Markdown5, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2534
2596
|
}
|
|
2535
2597
|
if (state.type === "error") {
|
|
2536
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ jsx46("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx46(ErrorResult, { state }) });
|
|
2537
2599
|
}
|
|
2538
2600
|
if (state.type === "pending" || isLoading) {
|
|
2539
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ jsx46("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2540
2602
|
}
|
|
2541
2603
|
return null;
|
|
2542
2604
|
}
|
|
2543
2605
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2544
2606
|
|
|
2545
2607
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2546
|
-
import { jsx as
|
|
2608
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2547
2609
|
var SearchRenderer = {
|
|
2548
2610
|
canRenderType: "search",
|
|
2549
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
2611
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx47(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx47(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2550
2612
|
};
|
|
2551
2613
|
var SearchRenderer_default = SearchRenderer;
|
|
2552
2614
|
|
|
2553
2615
|
// ../renderers/src/SectionRenderer.tsx
|
|
2554
2616
|
import { Header as Header7 } from "@transferwise/components";
|
|
2555
|
-
import { jsx as
|
|
2617
|
+
import { jsx as jsx48, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2556
2618
|
var SectionRenderer = {
|
|
2557
2619
|
canRenderType: "section",
|
|
2558
2620
|
render: ({ children, callToAction, margin, title }) => {
|
|
2559
|
-
return /* @__PURE__ */
|
|
2560
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2621
|
+
return /* @__PURE__ */ jsxs16("section", { className: getMargin(margin), children: [
|
|
2622
|
+
(title || callToAction) && /* @__PURE__ */ jsx48(Header7, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2561
2623
|
children
|
|
2562
2624
|
] });
|
|
2563
2625
|
}
|
|
@@ -2566,7 +2628,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
2566
2628
|
|
|
2567
2629
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2568
2630
|
import { RadioGroup } from "@transferwise/components";
|
|
2569
|
-
import { Fragment as Fragment5, jsx as
|
|
2631
|
+
import { Fragment as Fragment5, jsx as jsx49, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2570
2632
|
function RadioInputRendererComponent(props) {
|
|
2571
2633
|
const {
|
|
2572
2634
|
id,
|
|
@@ -2580,8 +2642,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2580
2642
|
validationState,
|
|
2581
2643
|
onSelect
|
|
2582
2644
|
} = props;
|
|
2583
|
-
return /* @__PURE__ */
|
|
2584
|
-
/* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
2646
|
+
/* @__PURE__ */ jsx49(
|
|
2585
2647
|
FieldInput_default,
|
|
2586
2648
|
{
|
|
2587
2649
|
id,
|
|
@@ -2589,7 +2651,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2589
2651
|
help,
|
|
2590
2652
|
description,
|
|
2591
2653
|
validation: validationState,
|
|
2592
|
-
children: /* @__PURE__ */
|
|
2654
|
+
children: /* @__PURE__ */ jsx49("span", { children: /* @__PURE__ */ jsx49(
|
|
2593
2655
|
RadioGroup,
|
|
2594
2656
|
{
|
|
2595
2657
|
name: id,
|
|
@@ -2598,7 +2660,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2598
2660
|
value: index,
|
|
2599
2661
|
secondary: option.description,
|
|
2600
2662
|
disabled: option.disabled || disabled,
|
|
2601
|
-
avatar: /* @__PURE__ */
|
|
2663
|
+
avatar: /* @__PURE__ */ jsx49(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
2602
2664
|
})),
|
|
2603
2665
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2604
2666
|
onChange: onSelect
|
|
@@ -2613,8 +2675,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2613
2675
|
|
|
2614
2676
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2615
2677
|
import { Tabs } from "@transferwise/components";
|
|
2616
|
-
import { useEffect as
|
|
2617
|
-
import { Fragment as Fragment6, jsx as
|
|
2678
|
+
import { useEffect as useEffect4 } from "react";
|
|
2679
|
+
import { Fragment as Fragment6, jsx as jsx50, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2618
2680
|
function TabInputRendererComponent(props) {
|
|
2619
2681
|
const {
|
|
2620
2682
|
id,
|
|
@@ -2628,13 +2690,13 @@ function TabInputRendererComponent(props) {
|
|
|
2628
2690
|
validationState,
|
|
2629
2691
|
onSelect
|
|
2630
2692
|
} = props;
|
|
2631
|
-
|
|
2693
|
+
useEffect4(() => {
|
|
2632
2694
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
2633
2695
|
onSelect(0);
|
|
2634
2696
|
}
|
|
2635
2697
|
}, [selectedIndex, onSelect, options.length]);
|
|
2636
|
-
return /* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2698
|
+
return /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2699
|
+
/* @__PURE__ */ jsx50(
|
|
2638
2700
|
FieldInput_default,
|
|
2639
2701
|
{
|
|
2640
2702
|
id,
|
|
@@ -2642,7 +2704,7 @@ function TabInputRendererComponent(props) {
|
|
|
2642
2704
|
help,
|
|
2643
2705
|
description,
|
|
2644
2706
|
validation: validationState,
|
|
2645
|
-
children: /* @__PURE__ */
|
|
2707
|
+
children: /* @__PURE__ */ jsx50(
|
|
2646
2708
|
Tabs,
|
|
2647
2709
|
{
|
|
2648
2710
|
name: id,
|
|
@@ -2651,7 +2713,7 @@ function TabInputRendererComponent(props) {
|
|
|
2651
2713
|
title: option.title,
|
|
2652
2714
|
// if we pass null, we get some props-types console errors
|
|
2653
2715
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2654
|
-
content: /* @__PURE__ */
|
|
2716
|
+
content: /* @__PURE__ */ jsx50(Fragment6, {}),
|
|
2655
2717
|
disabled: option.disabled || disabled
|
|
2656
2718
|
})),
|
|
2657
2719
|
onTabSelect: onSelect
|
|
@@ -2666,7 +2728,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2666
2728
|
|
|
2667
2729
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2668
2730
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
2669
|
-
import { Fragment as Fragment7, jsx as
|
|
2731
|
+
import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2670
2732
|
function SelectInputRendererComponent(props) {
|
|
2671
2733
|
const {
|
|
2672
2734
|
id,
|
|
@@ -2706,13 +2768,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2706
2768
|
} : {
|
|
2707
2769
|
title: option.title,
|
|
2708
2770
|
description: option.description,
|
|
2709
|
-
icon: /* @__PURE__ */
|
|
2771
|
+
icon: /* @__PURE__ */ jsx51(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
2710
2772
|
};
|
|
2711
|
-
return /* @__PURE__ */
|
|
2773
|
+
return /* @__PURE__ */ jsx51(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
2712
2774
|
};
|
|
2713
2775
|
const extraProps = { autoComplete };
|
|
2714
|
-
return /* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
2777
|
+
/* @__PURE__ */ jsx51(
|
|
2716
2778
|
FieldInput_default,
|
|
2717
2779
|
{
|
|
2718
2780
|
id,
|
|
@@ -2720,7 +2782,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2720
2782
|
help,
|
|
2721
2783
|
description,
|
|
2722
2784
|
validation: validationState,
|
|
2723
|
-
children: /* @__PURE__ */
|
|
2785
|
+
children: /* @__PURE__ */ jsx51(
|
|
2724
2786
|
SelectInput2,
|
|
2725
2787
|
__spreadValues({
|
|
2726
2788
|
name: id,
|
|
@@ -2741,9 +2803,9 @@ function SelectInputRendererComponent(props) {
|
|
|
2741
2803
|
}
|
|
2742
2804
|
|
|
2743
2805
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2744
|
-
import { useEffect as
|
|
2806
|
+
import { useEffect as useEffect5 } from "react";
|
|
2745
2807
|
import { SegmentedControl } from "@transferwise/components";
|
|
2746
|
-
import { Fragment as Fragment8, jsx as
|
|
2808
|
+
import { Fragment as Fragment8, jsx as jsx52, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2747
2809
|
function SegmentedInputRendererComponent(props) {
|
|
2748
2810
|
const {
|
|
2749
2811
|
id,
|
|
@@ -2756,13 +2818,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2756
2818
|
validationState,
|
|
2757
2819
|
onSelect
|
|
2758
2820
|
} = props;
|
|
2759
|
-
|
|
2821
|
+
useEffect5(() => {
|
|
2760
2822
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2761
2823
|
onSelect(0);
|
|
2762
2824
|
}
|
|
2763
2825
|
}, [selectedIndex, onSelect, options.length]);
|
|
2764
|
-
return /* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
2827
|
+
/* @__PURE__ */ jsx52(
|
|
2766
2828
|
FieldInput_default,
|
|
2767
2829
|
{
|
|
2768
2830
|
id,
|
|
@@ -2770,7 +2832,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2770
2832
|
help,
|
|
2771
2833
|
description,
|
|
2772
2834
|
validation: validationState,
|
|
2773
|
-
children: /* @__PURE__ */
|
|
2835
|
+
children: /* @__PURE__ */ jsx52(
|
|
2774
2836
|
SegmentedControl,
|
|
2775
2837
|
{
|
|
2776
2838
|
name: `${id}-segmented-control`,
|
|
@@ -2787,26 +2849,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2787
2849
|
)
|
|
2788
2850
|
}
|
|
2789
2851
|
),
|
|
2790
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx52("div", { id: `${id}-children`, children })
|
|
2791
2853
|
] });
|
|
2792
2854
|
}
|
|
2793
2855
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2794
2856
|
|
|
2795
2857
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2796
|
-
import { jsx as
|
|
2858
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2797
2859
|
var SelectInputRenderer = {
|
|
2798
2860
|
canRenderType: "input-select",
|
|
2799
2861
|
render: (props) => {
|
|
2800
2862
|
switch (props.control) {
|
|
2801
2863
|
case "radio":
|
|
2802
|
-
return /* @__PURE__ */
|
|
2864
|
+
return /* @__PURE__ */ jsx53(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2803
2865
|
case "tab":
|
|
2804
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2866
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx53(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx53(TabInputRendererComponent, __spreadValues({}, props));
|
|
2805
2867
|
case "segmented":
|
|
2806
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2868
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx53(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx53(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2807
2869
|
case "select":
|
|
2808
2870
|
default:
|
|
2809
|
-
return /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ jsx53(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2810
2872
|
}
|
|
2811
2873
|
}
|
|
2812
2874
|
};
|
|
@@ -2814,17 +2876,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2814
2876
|
|
|
2815
2877
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2816
2878
|
import { Header as Header8, Summary } from "@transferwise/components";
|
|
2817
|
-
import { jsx as
|
|
2879
|
+
import { jsx as jsx54, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2818
2880
|
var StatusListRenderer = {
|
|
2819
2881
|
canRenderType: "status-list",
|
|
2820
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
2821
|
-
title ? /* @__PURE__ */
|
|
2822
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
2882
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs21("div", { className: getMargin(margin), children: [
|
|
2883
|
+
title ? /* @__PURE__ */ jsx54(Header8, { title, className: "m-b-2" }) : null,
|
|
2884
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx54(
|
|
2823
2885
|
Summary,
|
|
2824
2886
|
{
|
|
2825
2887
|
title: itemTitle,
|
|
2826
2888
|
description,
|
|
2827
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
2889
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx54(DynamicIcon_default, { name: icon.name }) : null,
|
|
2828
2890
|
status: mapStatus(status),
|
|
2829
2891
|
action: getSummaryAction(callToAction)
|
|
2830
2892
|
},
|
|
@@ -2861,12 +2923,12 @@ var mapStatus = (status) => {
|
|
|
2861
2923
|
|
|
2862
2924
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
2863
2925
|
import { useTheme } from "@wise/components-theming";
|
|
2864
|
-
import { useEffect as
|
|
2926
|
+
import { useEffect as useEffect6, useMemo } from "react";
|
|
2865
2927
|
var ThemeRequiredEventName = "Theme Required";
|
|
2866
2928
|
var useCustomTheme = (theme, trackEvent) => {
|
|
2867
2929
|
const previousThemeHookValue = useTheme();
|
|
2868
2930
|
const previousTheme = useMemo(() => previousThemeHookValue.theme, []);
|
|
2869
|
-
|
|
2931
|
+
useEffect6(() => {
|
|
2870
2932
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
2871
2933
|
return theme !== previousTheme ? () => {
|
|
2872
2934
|
trackEvent(ThemeRequiredEventName, { theme: previousTheme });
|
|
@@ -2878,9 +2940,9 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
2878
2940
|
// ../renderers/src/step/BackButton.tsx
|
|
2879
2941
|
import { AvatarView as AvatarView4 } from "@transferwise/components";
|
|
2880
2942
|
import { ArrowLeft } from "@transferwise/icons";
|
|
2881
|
-
import { jsx as
|
|
2943
|
+
import { jsx as jsx55, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2882
2944
|
function BackButton({ title, onClick }) {
|
|
2883
|
-
return /* @__PURE__ */
|
|
2945
|
+
return /* @__PURE__ */ jsx55("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs22(
|
|
2884
2946
|
"button",
|
|
2885
2947
|
{
|
|
2886
2948
|
type: "button",
|
|
@@ -2889,8 +2951,8 @@ function BackButton({ title, onClick }) {
|
|
|
2889
2951
|
"aria-label": title,
|
|
2890
2952
|
onClick,
|
|
2891
2953
|
children: [
|
|
2892
|
-
/* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ jsx55("span", { className: "sr-only", children: title }),
|
|
2955
|
+
/* @__PURE__ */ jsx55(AvatarView4, { interactive: true, children: /* @__PURE__ */ jsx55(ArrowLeft, { size: "24" }) })
|
|
2894
2956
|
]
|
|
2895
2957
|
}
|
|
2896
2958
|
) });
|
|
@@ -2898,7 +2960,7 @@ function BackButton({ title, onClick }) {
|
|
|
2898
2960
|
var BackButton_default = BackButton;
|
|
2899
2961
|
|
|
2900
2962
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
2901
|
-
import { jsx as
|
|
2963
|
+
import { jsx as jsx56, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2902
2964
|
var SplashCelebrationStepRenderer = {
|
|
2903
2965
|
canRenderType: "step",
|
|
2904
2966
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -2907,14 +2969,14 @@ var SplashCelebrationStepRenderer = {
|
|
|
2907
2969
|
function SplashCelebrationStepRendererComponent(props) {
|
|
2908
2970
|
const { back, children, trackEvent } = props;
|
|
2909
2971
|
useCustomTheme("forest-green", trackEvent);
|
|
2910
|
-
return /* @__PURE__ */
|
|
2911
|
-
back ? /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ jsxs23("div", { className: "splash-screen m-t-5", children: [
|
|
2973
|
+
back ? /* @__PURE__ */ jsx56(BackButton_default, __spreadValues({}, back)) : null,
|
|
2912
2974
|
children
|
|
2913
2975
|
] });
|
|
2914
2976
|
}
|
|
2915
2977
|
|
|
2916
2978
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
2917
|
-
import { jsx as
|
|
2979
|
+
import { jsx as jsx57, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2918
2980
|
var SplashStepRenderer = {
|
|
2919
2981
|
canRenderType: "step",
|
|
2920
2982
|
canRender: ({ control }) => control === "splash",
|
|
@@ -2922,28 +2984,28 @@ var SplashStepRenderer = {
|
|
|
2922
2984
|
};
|
|
2923
2985
|
function SplashStepRendererComponent(props) {
|
|
2924
2986
|
const { back, children } = props;
|
|
2925
|
-
return /* @__PURE__ */
|
|
2926
|
-
back ? /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ jsxs24("div", { className: "splash-screen m-t-5", children: [
|
|
2988
|
+
back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
|
|
2927
2989
|
children
|
|
2928
2990
|
] });
|
|
2929
2991
|
}
|
|
2930
2992
|
|
|
2931
2993
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2932
2994
|
import { Alert as Alert2, Title as Title2 } from "@transferwise/components";
|
|
2933
|
-
import { Fragment as Fragment9, jsx as
|
|
2995
|
+
import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2934
2996
|
var StepRenderer = {
|
|
2935
2997
|
canRenderType: "step",
|
|
2936
2998
|
render: StepRendererComponent
|
|
2937
2999
|
};
|
|
2938
3000
|
function StepRendererComponent(props) {
|
|
2939
3001
|
const { back, description, error, title, children } = props;
|
|
2940
|
-
return /* @__PURE__ */
|
|
2941
|
-
back ? /* @__PURE__ */
|
|
2942
|
-
title || description ? /* @__PURE__ */
|
|
2943
|
-
title ? /* @__PURE__ */
|
|
2944
|
-
description ? /* @__PURE__ */
|
|
3002
|
+
return /* @__PURE__ */ jsxs25(Fragment9, { children: [
|
|
3003
|
+
back ? /* @__PURE__ */ jsx58(BackButton_default, __spreadValues({}, back)) : null,
|
|
3004
|
+
title || description ? /* @__PURE__ */ jsxs25("div", { className: "m-b-4", children: [
|
|
3005
|
+
title ? /* @__PURE__ */ jsx58(Title2, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
3006
|
+
description ? /* @__PURE__ */ jsx58("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2945
3007
|
] }) : void 0,
|
|
2946
|
-
error ? /* @__PURE__ */
|
|
3008
|
+
error ? /* @__PURE__ */ jsx58(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2947
3009
|
children
|
|
2948
3010
|
] });
|
|
2949
3011
|
}
|
|
@@ -2951,26 +3013,26 @@ function StepRendererComponent(props) {
|
|
|
2951
3013
|
// ../renderers/src/TabsRenderer.tsx
|
|
2952
3014
|
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
2953
3015
|
import { useState as useState8 } from "react";
|
|
2954
|
-
import { jsx as
|
|
3016
|
+
import { jsx as jsx59, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2955
3017
|
var TabsRenderer = {
|
|
2956
3018
|
canRenderType: "tabs",
|
|
2957
3019
|
render: (props) => {
|
|
2958
3020
|
switch (props.control) {
|
|
2959
3021
|
case "segmented":
|
|
2960
3022
|
if (props.tabs.length > 3) {
|
|
2961
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx59(TabsRendererComponent, __spreadValues({}, props));
|
|
2962
3024
|
}
|
|
2963
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx59(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
2964
3026
|
case "chips":
|
|
2965
|
-
return /* @__PURE__ */
|
|
3027
|
+
return /* @__PURE__ */ jsx59(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
2966
3028
|
default:
|
|
2967
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsx59(TabsRendererComponent, __spreadValues({}, props));
|
|
2968
3030
|
}
|
|
2969
3031
|
}
|
|
2970
3032
|
};
|
|
2971
3033
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
2972
3034
|
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
2973
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ jsx59("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx59(
|
|
2974
3036
|
Tabs2,
|
|
2975
3037
|
{
|
|
2976
3038
|
name: uid,
|
|
@@ -2978,7 +3040,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2978
3040
|
tabs: tabs.map((option) => ({
|
|
2979
3041
|
title: option.title,
|
|
2980
3042
|
disabled: false,
|
|
2981
|
-
content: /* @__PURE__ */
|
|
3043
|
+
content: /* @__PURE__ */ jsxs26("div", { className: "m-t-2", children: [
|
|
2982
3044
|
" ",
|
|
2983
3045
|
option.children,
|
|
2984
3046
|
" "
|
|
@@ -2991,8 +3053,8 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2991
3053
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
2992
3054
|
var _a;
|
|
2993
3055
|
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
2994
|
-
return /* @__PURE__ */
|
|
2995
|
-
/* @__PURE__ */
|
|
3056
|
+
return /* @__PURE__ */ jsxs26("div", { className: getMargin(margin), children: [
|
|
3057
|
+
/* @__PURE__ */ jsx59(
|
|
2996
3058
|
SegmentedControl2,
|
|
2997
3059
|
{
|
|
2998
3060
|
name: uid,
|
|
@@ -3007,14 +3069,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3007
3069
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3008
3070
|
}
|
|
3009
3071
|
),
|
|
3010
|
-
/* @__PURE__ */
|
|
3072
|
+
/* @__PURE__ */ jsx59("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3011
3073
|
] });
|
|
3012
3074
|
}
|
|
3013
3075
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3014
3076
|
var _a;
|
|
3015
3077
|
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
3016
|
-
return /* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3078
|
+
return /* @__PURE__ */ jsxs26("div", { className: getMargin(margin), children: [
|
|
3079
|
+
/* @__PURE__ */ jsx59("div", { className: "chips-container", children: /* @__PURE__ */ jsx59(
|
|
3018
3080
|
Chips,
|
|
3019
3081
|
{
|
|
3020
3082
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -3022,7 +3084,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
|
3022
3084
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3023
3085
|
}
|
|
3024
3086
|
) }),
|
|
3025
|
-
/* @__PURE__ */
|
|
3087
|
+
/* @__PURE__ */ jsx59("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3026
3088
|
] });
|
|
3027
3089
|
}
|
|
3028
3090
|
|
|
@@ -3037,7 +3099,7 @@ import {
|
|
|
3037
3099
|
TextArea,
|
|
3038
3100
|
TextareaWithDisplayFormat
|
|
3039
3101
|
} from "@transferwise/components";
|
|
3040
|
-
import { jsx as
|
|
3102
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3041
3103
|
var commonKeys = [
|
|
3042
3104
|
"autoComplete",
|
|
3043
3105
|
"autoCapitalize",
|
|
@@ -3056,12 +3118,12 @@ function VariableTextInput(inputProps) {
|
|
|
3056
3118
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3057
3119
|
switch (control) {
|
|
3058
3120
|
case "email":
|
|
3059
|
-
return /* @__PURE__ */
|
|
3121
|
+
return /* @__PURE__ */ jsx60(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3060
3122
|
case "password":
|
|
3061
|
-
return /* @__PURE__ */
|
|
3123
|
+
return /* @__PURE__ */ jsx60(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3062
3124
|
case "numeric": {
|
|
3063
3125
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3064
|
-
return /* @__PURE__ */
|
|
3126
|
+
return /* @__PURE__ */ jsx60(
|
|
3065
3127
|
TextInput,
|
|
3066
3128
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3067
3129
|
onChange: (newValue) => {
|
|
@@ -3072,9 +3134,9 @@ function VariableTextInput(inputProps) {
|
|
|
3072
3134
|
);
|
|
3073
3135
|
}
|
|
3074
3136
|
case "phone-number":
|
|
3075
|
-
return /* @__PURE__ */
|
|
3137
|
+
return /* @__PURE__ */ jsx60(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3076
3138
|
default: {
|
|
3077
|
-
return /* @__PURE__ */
|
|
3139
|
+
return /* @__PURE__ */ jsx60(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3078
3140
|
}
|
|
3079
3141
|
}
|
|
3080
3142
|
}
|
|
@@ -3082,11 +3144,11 @@ function TextInput(props) {
|
|
|
3082
3144
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3083
3145
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
3084
3146
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
3085
|
-
return displayFormat ? /* @__PURE__ */
|
|
3147
|
+
return displayFormat ? /* @__PURE__ */ jsx60(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx60(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3086
3148
|
}
|
|
3087
3149
|
|
|
3088
3150
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3089
|
-
import { jsx as
|
|
3151
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3090
3152
|
var TextInputRenderer = {
|
|
3091
3153
|
canRenderType: "input-text",
|
|
3092
3154
|
render: (props) => {
|
|
@@ -3121,7 +3183,7 @@ var TextInputRenderer = {
|
|
|
3121
3183
|
}
|
|
3122
3184
|
}
|
|
3123
3185
|
});
|
|
3124
|
-
return /* @__PURE__ */
|
|
3186
|
+
return /* @__PURE__ */ jsx61(
|
|
3125
3187
|
FieldInput_default,
|
|
3126
3188
|
{
|
|
3127
3189
|
id,
|
|
@@ -3129,7 +3191,7 @@ var TextInputRenderer = {
|
|
|
3129
3191
|
description,
|
|
3130
3192
|
validation: validationState,
|
|
3131
3193
|
help,
|
|
3132
|
-
children: /* @__PURE__ */
|
|
3194
|
+
children: /* @__PURE__ */ jsx61(InputGroup3, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx61(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3133
3195
|
}
|
|
3134
3196
|
);
|
|
3135
3197
|
}
|
|
@@ -3143,7 +3205,7 @@ import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
|
3143
3205
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3144
3206
|
|
|
3145
3207
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3146
|
-
import { jsx as
|
|
3208
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
3147
3209
|
var UploadInputRenderer = {
|
|
3148
3210
|
canRenderType: "input-upload",
|
|
3149
3211
|
render: (props) => {
|
|
@@ -3159,14 +3221,14 @@ var UploadInputRenderer = {
|
|
|
3159
3221
|
};
|
|
3160
3222
|
return (
|
|
3161
3223
|
// We don't pass help here as there is no sensible place to display it
|
|
3162
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsx62(
|
|
3163
3225
|
UploadFieldInput_default,
|
|
3164
3226
|
{
|
|
3165
3227
|
id,
|
|
3166
3228
|
label: void 0,
|
|
3167
3229
|
description: void 0,
|
|
3168
3230
|
validation: validationState,
|
|
3169
|
-
children: /* @__PURE__ */
|
|
3231
|
+
children: /* @__PURE__ */ jsx62(
|
|
3170
3232
|
UploadInput2,
|
|
3171
3233
|
{
|
|
3172
3234
|
id,
|
|
@@ -3223,7 +3285,7 @@ var LargeUploadRenderer = {
|
|
|
3223
3285
|
};
|
|
3224
3286
|
const filetypes = acceptsToFileTypes(accepts);
|
|
3225
3287
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3226
|
-
return /* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ jsx62(
|
|
3227
3289
|
FieldInput_default,
|
|
3228
3290
|
{
|
|
3229
3291
|
id,
|
|
@@ -3231,7 +3293,7 @@ var LargeUploadRenderer = {
|
|
|
3231
3293
|
description,
|
|
3232
3294
|
validation: validationState,
|
|
3233
3295
|
help,
|
|
3234
|
-
children: /* @__PURE__ */
|
|
3296
|
+
children: /* @__PURE__ */ jsx62(
|
|
3235
3297
|
Upload,
|
|
3236
3298
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3237
3299
|
usAccept,
|
|
@@ -3248,6 +3310,7 @@ var LargeUploadRenderer = {
|
|
|
3248
3310
|
|
|
3249
3311
|
// ../renderers/src/getWiseRenderers.ts
|
|
3250
3312
|
var getWiseRenderers = () => [
|
|
3313
|
+
AddressValidationButtonRenderer_default,
|
|
3251
3314
|
AlertRenderer_default,
|
|
3252
3315
|
CheckboxInputRenderer_default,
|
|
3253
3316
|
BoxRenderer_default,
|
|
@@ -3290,7 +3353,7 @@ var getWiseRenderers = () => [
|
|
|
3290
3353
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3291
3354
|
var appVersion = (
|
|
3292
3355
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3293
|
-
typeof process !== "undefined" ? "4.
|
|
3356
|
+
typeof process !== "undefined" ? "4.19.0" : "0.0.0"
|
|
3294
3357
|
);
|
|
3295
3358
|
|
|
3296
3359
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -3330,12 +3393,12 @@ var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties)
|
|
|
3330
3393
|
};
|
|
3331
3394
|
|
|
3332
3395
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3333
|
-
import { jsx as
|
|
3396
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3334
3397
|
var wiseRenderers = getWiseRenderers();
|
|
3335
3398
|
function DynamicFlowLegacy(props) {
|
|
3336
3399
|
const { customFetch = globalThis.fetch } = props;
|
|
3337
3400
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3338
|
-
return /* @__PURE__ */
|
|
3401
|
+
return /* @__PURE__ */ jsx63(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
|
|
3339
3402
|
}
|
|
3340
3403
|
function DynamicFlowRevamp(props) {
|
|
3341
3404
|
const {
|
|
@@ -3362,7 +3425,7 @@ function DynamicFlowRevamp(props) {
|
|
|
3362
3425
|
onLog: logEvent,
|
|
3363
3426
|
onLink
|
|
3364
3427
|
});
|
|
3365
|
-
return /* @__PURE__ */
|
|
3428
|
+
return /* @__PURE__ */ jsx63("div", { className, children: /* @__PURE__ */ jsx63(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
3366
3429
|
}
|
|
3367
3430
|
var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
3368
3431
|
const {
|
|
@@ -3389,10 +3452,10 @@ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
|
3389
3452
|
onLog: logEvent,
|
|
3390
3453
|
onLink
|
|
3391
3454
|
});
|
|
3392
|
-
return /* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ jsx63("div", { className, children: /* @__PURE__ */ jsx63(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
3393
3456
|
});
|
|
3394
3457
|
var useWiseHttpClient = (httpClient) => {
|
|
3395
|
-
const { locale } =
|
|
3458
|
+
const { locale } = useIntl10();
|
|
3396
3459
|
return useCallback(
|
|
3397
3460
|
async (input, init = {}) => {
|
|
3398
3461
|
const headers = new Headers(init.headers);
|