@wise/dynamic-flow-client-internal 4.16.0-exp-modal-renderer-c6d2baa → 4.16.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/main.js +1020 -983
- package/build/main.mjs +896 -859
- package/build/types/dynamicFlow/DynamicFlow.d.ts +1 -1
- package/package.json +5 -5
package/build/main.js
CHANGED
|
@@ -725,16 +725,119 @@ var mapCtaToAlertAction = (callToAction) => {
|
|
|
725
725
|
}
|
|
726
726
|
return void 0;
|
|
727
727
|
};
|
|
728
|
+
var AlertRenderer_default = AlertRenderer;
|
|
729
|
+
|
|
730
|
+
// ../renderers/src/components/FieldInput.tsx
|
|
731
|
+
var import_components3 = require("@transferwise/components");
|
|
732
|
+
|
|
733
|
+
// ../renderers/src/components/Help.tsx
|
|
734
|
+
var import_components2 = require("@transferwise/components");
|
|
735
|
+
var import_react_intl2 = require("react-intl");
|
|
736
|
+
|
|
737
|
+
// ../renderers/src/messages/help.messages.ts
|
|
738
|
+
var import_react_intl = require("react-intl");
|
|
739
|
+
var help_messages_default = (0, import_react_intl.defineMessages)({
|
|
740
|
+
helpAria: {
|
|
741
|
+
id: "df.wise.Help.ariaLabel",
|
|
742
|
+
defaultMessage: "Click here for more info.",
|
|
743
|
+
description: "Aria label for help."
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
// ../renderers/src/components/Help.tsx
|
|
748
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
749
|
+
function Help({ help, onClick }) {
|
|
750
|
+
const intl = (0, import_react_intl2.useIntl)();
|
|
751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
752
|
+
import_components2.Info,
|
|
753
|
+
{
|
|
754
|
+
className: "m-l-1",
|
|
755
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
756
|
+
presentation: "POPOVER",
|
|
757
|
+
size: "sm",
|
|
758
|
+
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
759
|
+
onClick
|
|
760
|
+
}
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
var Help_default = Help;
|
|
764
|
+
|
|
765
|
+
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
766
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
767
|
+
function LabelContentWithHelp({ text, help }) {
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
769
|
+
text,
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Help_default, { help })
|
|
771
|
+
] });
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// ../renderers/src/components/FieldInput.tsx
|
|
775
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
776
|
+
function FieldInput({ id, children, label, validation, description, help }) {
|
|
777
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
779
|
+
import_components3.Field,
|
|
780
|
+
{
|
|
781
|
+
id,
|
|
782
|
+
label: labelContent,
|
|
783
|
+
description,
|
|
784
|
+
message: validation == null ? void 0 : validation.message,
|
|
785
|
+
sentiment: mapStatusToSentiment(validation),
|
|
786
|
+
children
|
|
787
|
+
}
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
var mapStatusToSentiment = (validation) => {
|
|
791
|
+
if (validation) {
|
|
792
|
+
if (validation.status === "valid") {
|
|
793
|
+
return "positive";
|
|
794
|
+
}
|
|
795
|
+
return "negative";
|
|
796
|
+
}
|
|
797
|
+
return void 0;
|
|
798
|
+
};
|
|
799
|
+
var FieldInput_default = FieldInput;
|
|
800
|
+
|
|
801
|
+
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
802
|
+
var import_components4 = require("@transferwise/components");
|
|
803
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
804
|
+
var CheckboxInputRenderer = {
|
|
805
|
+
canRenderType: "input-checkbox",
|
|
806
|
+
render: (props) => {
|
|
807
|
+
const _a = props, {
|
|
808
|
+
id,
|
|
809
|
+
control,
|
|
810
|
+
title = "",
|
|
811
|
+
description,
|
|
812
|
+
help,
|
|
813
|
+
type,
|
|
814
|
+
validationState,
|
|
815
|
+
value
|
|
816
|
+
} = _a, rest = __objRest(_a, [
|
|
817
|
+
"id",
|
|
818
|
+
"control",
|
|
819
|
+
"title",
|
|
820
|
+
"description",
|
|
821
|
+
"help",
|
|
822
|
+
"type",
|
|
823
|
+
"validationState",
|
|
824
|
+
"value"
|
|
825
|
+
]);
|
|
826
|
+
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components4.Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
828
|
+
}
|
|
829
|
+
};
|
|
830
|
+
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
728
831
|
|
|
729
832
|
// ../renderers/src/BoxRenderer.tsx
|
|
730
833
|
var import_classnames = __toESM(require("classnames"));
|
|
731
|
-
var
|
|
834
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
732
835
|
var BoxRenderer = {
|
|
733
836
|
canRenderType: "box",
|
|
734
837
|
render: ({ children, control, margin, width }) => {
|
|
735
838
|
const hasFixedWidth = width !== "xl";
|
|
736
839
|
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
737
|
-
const contents = /* @__PURE__ */ (0,
|
|
840
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
738
841
|
"div",
|
|
739
842
|
{
|
|
740
843
|
className: (0, import_classnames.default)({
|
|
@@ -745,14 +848,15 @@ var BoxRenderer = {
|
|
|
745
848
|
children
|
|
746
849
|
}
|
|
747
850
|
);
|
|
748
|
-
return hasFixedWidth ? /* @__PURE__ */ (0,
|
|
851
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
749
852
|
}
|
|
750
853
|
};
|
|
854
|
+
var BoxRenderer_default = BoxRenderer;
|
|
751
855
|
|
|
752
856
|
// ../renderers/src/ButtonRenderer.tsx
|
|
753
|
-
var
|
|
857
|
+
var import_components5 = require("@transferwise/components");
|
|
754
858
|
var import_react = require("react");
|
|
755
|
-
var
|
|
859
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
756
860
|
var ButtonRenderer = {
|
|
757
861
|
canRenderType: "button",
|
|
758
862
|
render: ButtonComponent
|
|
@@ -763,8 +867,8 @@ function ButtonComponent(props) {
|
|
|
763
867
|
const isLoading = isActive && stepLoadingState !== "idle";
|
|
764
868
|
const priority = mapControl(control);
|
|
765
869
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
766
|
-
return /* @__PURE__ */ (0,
|
|
767
|
-
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
871
|
+
import_components5.Button,
|
|
768
872
|
{
|
|
769
873
|
block: true,
|
|
770
874
|
className: getMargin(margin),
|
|
@@ -818,109 +922,7 @@ var mapSize = (size) => {
|
|
|
818
922
|
return "md";
|
|
819
923
|
}
|
|
820
924
|
};
|
|
821
|
-
|
|
822
|
-
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
823
|
-
var import_components5 = require("@transferwise/components");
|
|
824
|
-
|
|
825
|
-
// ../renderers/src/components/FieldInput.tsx
|
|
826
|
-
var import_components4 = require("@transferwise/components");
|
|
827
|
-
|
|
828
|
-
// ../renderers/src/components/Help.tsx
|
|
829
|
-
var import_components3 = require("@transferwise/components");
|
|
830
|
-
var import_react_intl2 = require("react-intl");
|
|
831
|
-
|
|
832
|
-
// ../renderers/src/messages/help.messages.ts
|
|
833
|
-
var import_react_intl = require("react-intl");
|
|
834
|
-
var help_messages_default = (0, import_react_intl.defineMessages)({
|
|
835
|
-
helpAria: {
|
|
836
|
-
id: "df.wise.Help.ariaLabel",
|
|
837
|
-
defaultMessage: "Click here for more info.",
|
|
838
|
-
description: "Aria label for help."
|
|
839
|
-
}
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
// ../renderers/src/components/Help.tsx
|
|
843
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
844
|
-
function Help({ help, onClick }) {
|
|
845
|
-
const intl = (0, import_react_intl2.useIntl)();
|
|
846
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
847
|
-
import_components3.Info,
|
|
848
|
-
{
|
|
849
|
-
className: "m-l-1",
|
|
850
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_components3.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
851
|
-
presentation: "POPOVER",
|
|
852
|
-
size: "sm",
|
|
853
|
-
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
854
|
-
onClick
|
|
855
|
-
}
|
|
856
|
-
);
|
|
857
|
-
}
|
|
858
|
-
var Help_default = Help;
|
|
859
|
-
|
|
860
|
-
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
861
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
862
|
-
function LabelContentWithHelp({ text, help }) {
|
|
863
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
864
|
-
text,
|
|
865
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Help_default, { help })
|
|
866
|
-
] });
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
// ../renderers/src/components/FieldInput.tsx
|
|
870
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
871
|
-
function FieldInput({ id, children, label, validation, description, help }) {
|
|
872
|
-
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
873
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
874
|
-
import_components4.Field,
|
|
875
|
-
{
|
|
876
|
-
id,
|
|
877
|
-
label: labelContent,
|
|
878
|
-
description,
|
|
879
|
-
message: validation == null ? void 0 : validation.message,
|
|
880
|
-
sentiment: mapStatusToSentiment(validation),
|
|
881
|
-
children
|
|
882
|
-
}
|
|
883
|
-
);
|
|
884
|
-
}
|
|
885
|
-
var mapStatusToSentiment = (validation) => {
|
|
886
|
-
if (validation) {
|
|
887
|
-
if (validation.status === "valid") {
|
|
888
|
-
return "positive";
|
|
889
|
-
}
|
|
890
|
-
return "negative";
|
|
891
|
-
}
|
|
892
|
-
return void 0;
|
|
893
|
-
};
|
|
894
|
-
var FieldInput_default = FieldInput;
|
|
895
|
-
|
|
896
|
-
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
897
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
898
|
-
var CheckboxInputRenderer = {
|
|
899
|
-
canRenderType: "input-checkbox",
|
|
900
|
-
render: (props) => {
|
|
901
|
-
const _a = props, {
|
|
902
|
-
id,
|
|
903
|
-
control,
|
|
904
|
-
title = "",
|
|
905
|
-
description,
|
|
906
|
-
help,
|
|
907
|
-
type,
|
|
908
|
-
validationState,
|
|
909
|
-
value
|
|
910
|
-
} = _a, rest = __objRest(_a, [
|
|
911
|
-
"id",
|
|
912
|
-
"control",
|
|
913
|
-
"title",
|
|
914
|
-
"description",
|
|
915
|
-
"help",
|
|
916
|
-
"type",
|
|
917
|
-
"validationState",
|
|
918
|
-
"value"
|
|
919
|
-
]);
|
|
920
|
-
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
921
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components5.Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
922
|
-
}
|
|
923
|
-
};
|
|
925
|
+
var ButtonRenderer_default = ButtonRenderer;
|
|
924
926
|
|
|
925
927
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
926
928
|
var import_classnames2 = __toESM(require("classnames"));
|
|
@@ -941,6 +943,7 @@ var ColumnsRenderer = {
|
|
|
941
943
|
}
|
|
942
944
|
)
|
|
943
945
|
};
|
|
946
|
+
var ColumnsRenderer_default = ColumnsRenderer;
|
|
944
947
|
|
|
945
948
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
946
949
|
var import_components6 = require("@transferwise/components");
|
|
@@ -1057,6 +1060,7 @@ var DateInputRenderer = {
|
|
|
1057
1060
|
);
|
|
1058
1061
|
}
|
|
1059
1062
|
};
|
|
1063
|
+
var DateInputRenderer_default = DateInputRenderer;
|
|
1060
1064
|
|
|
1061
1065
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1062
1066
|
var import_components9 = require("@transferwise/components");
|
|
@@ -1210,6 +1214,7 @@ var DecisionRenderer = {
|
|
|
1210
1214
|
}) })
|
|
1211
1215
|
] })
|
|
1212
1216
|
};
|
|
1217
|
+
var DecisionRenderer_default = DecisionRenderer;
|
|
1213
1218
|
|
|
1214
1219
|
// ../renderers/src/DividerRenderer.tsx
|
|
1215
1220
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
@@ -1217,137 +1222,49 @@ var DividerRenderer = {
|
|
|
1217
1222
|
canRenderType: "divider",
|
|
1218
1223
|
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1219
1224
|
};
|
|
1225
|
+
var DividerRenderer_default = DividerRenderer;
|
|
1220
1226
|
|
|
1221
|
-
// ../renderers/src/
|
|
1222
|
-
var import_components10 = require("@transferwise/components");
|
|
1223
|
-
|
|
1224
|
-
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1225
|
-
var import_react_intl3 = require("react-intl");
|
|
1226
|
-
var external_confirmation_messages_default = (0, import_react_intl3.defineMessages)({
|
|
1227
|
-
title: {
|
|
1228
|
-
id: "df.wise.ExternalConfirmation.title",
|
|
1229
|
-
defaultMessage: "Please confirm",
|
|
1230
|
-
description: "Heading for the confirmation screen."
|
|
1231
|
-
},
|
|
1232
|
-
description: {
|
|
1233
|
-
id: "df.wise.ExternalConfirmation.description",
|
|
1234
|
-
defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
|
|
1235
|
-
description: "Description for the confirmation screen."
|
|
1236
|
-
},
|
|
1237
|
-
open: {
|
|
1238
|
-
id: "df.wise.ExternalConfirmation.open",
|
|
1239
|
-
defaultMessage: "Open in new tab",
|
|
1240
|
-
description: "Button text confirming opening a new browser tab."
|
|
1241
|
-
},
|
|
1242
|
-
cancel: {
|
|
1243
|
-
id: "df.wise.ExternalConfirmation.cancel",
|
|
1244
|
-
defaultMessage: "Cancel",
|
|
1245
|
-
description: "Button text rejecting opening a new browser tab."
|
|
1246
|
-
}
|
|
1247
|
-
});
|
|
1248
|
-
|
|
1249
|
-
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1250
|
-
var import_react_intl4 = require("react-intl");
|
|
1251
|
-
var import_react2 = require("react");
|
|
1227
|
+
// ../renderers/src/FormRenderer.tsx
|
|
1252
1228
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1253
|
-
var
|
|
1254
|
-
canRenderType: "
|
|
1255
|
-
render:
|
|
1229
|
+
var FormRenderer = {
|
|
1230
|
+
canRenderType: "form",
|
|
1231
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getMargin(margin), children })
|
|
1256
1232
|
};
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
} else {
|
|
1271
|
-
onFailure();
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
}, []);
|
|
1275
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1276
|
-
import_components10.Modal,
|
|
1277
|
-
{
|
|
1278
|
-
open: status === "failure",
|
|
1279
|
-
title: formatMessage(external_confirmation_messages_default.title),
|
|
1280
|
-
body: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1281
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components10.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1282
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
1283
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1284
|
-
import_components10.Button,
|
|
1285
|
-
{
|
|
1286
|
-
block: true,
|
|
1287
|
-
className: "m-b-2",
|
|
1288
|
-
priority: "primary",
|
|
1289
|
-
size: "md",
|
|
1290
|
-
onClick: () => {
|
|
1291
|
-
window.open(url);
|
|
1292
|
-
onCancel();
|
|
1293
|
-
},
|
|
1294
|
-
children: formatMessage(external_confirmation_messages_default.open)
|
|
1295
|
-
}
|
|
1296
|
-
),
|
|
1297
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components10.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1298
|
-
] }) })
|
|
1299
|
-
] }),
|
|
1300
|
-
onClose: onCancel
|
|
1301
|
-
}
|
|
1302
|
-
);
|
|
1303
|
-
}
|
|
1304
|
-
function getOrigin(url) {
|
|
1305
|
-
try {
|
|
1306
|
-
return new URL(url).origin;
|
|
1307
|
-
} catch (e) {
|
|
1308
|
-
return url;
|
|
1309
|
-
}
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
// ../renderers/src/FormRenderer.tsx
|
|
1313
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1314
|
-
var FormRenderer = {
|
|
1315
|
-
canRenderType: "form",
|
|
1316
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getMargin(margin), children })
|
|
1317
|
-
};
|
|
1318
|
-
|
|
1319
|
-
// ../renderers/src/FormSectionRenderer.tsx
|
|
1320
|
-
var import_components11 = require("@transferwise/components");
|
|
1321
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1322
|
-
var FormSectionRenderer = {
|
|
1323
|
-
canRenderType: "form-section",
|
|
1324
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { children: [
|
|
1325
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1326
|
-
import_components11.Header,
|
|
1327
|
-
{
|
|
1328
|
-
as: "h2",
|
|
1329
|
-
title
|
|
1233
|
+
var FormRenderer_default = FormRenderer;
|
|
1234
|
+
|
|
1235
|
+
// ../renderers/src/FormSectionRenderer.tsx
|
|
1236
|
+
var import_components10 = require("@transferwise/components");
|
|
1237
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1238
|
+
var FormSectionRenderer = {
|
|
1239
|
+
canRenderType: "form-section",
|
|
1240
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("fieldset", { children: [
|
|
1241
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1242
|
+
import_components10.Header,
|
|
1243
|
+
{
|
|
1244
|
+
as: "h2",
|
|
1245
|
+
title
|
|
1330
1246
|
}
|
|
1331
1247
|
),
|
|
1332
|
-
description && /* @__PURE__ */ (0,
|
|
1248
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: description }),
|
|
1333
1249
|
children
|
|
1334
1250
|
] })
|
|
1335
1251
|
};
|
|
1252
|
+
var FormSectionRenderer_default = FormSectionRenderer;
|
|
1336
1253
|
|
|
1337
1254
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1338
|
-
var
|
|
1339
|
-
var
|
|
1255
|
+
var import_components11 = require("@transferwise/components");
|
|
1256
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1340
1257
|
var HeadingRenderer = {
|
|
1341
1258
|
canRenderType: "heading",
|
|
1342
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1259
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, __spreadValues({}, props))
|
|
1343
1260
|
};
|
|
1344
1261
|
function Heading(props) {
|
|
1345
1262
|
const { text, size, align, margin, control } = props;
|
|
1346
1263
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1347
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1264
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StandardHeading, { size, text, className });
|
|
1348
1265
|
}
|
|
1349
1266
|
function DisplayHeading({ size, text, className }) {
|
|
1350
|
-
return /* @__PURE__ */ (0,
|
|
1267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components11.Display, { type: getDisplayType(size), className, children: text });
|
|
1351
1268
|
}
|
|
1352
1269
|
var getDisplayType = (size) => {
|
|
1353
1270
|
switch (size) {
|
|
@@ -1363,7 +1280,7 @@ var getDisplayType = (size) => {
|
|
|
1363
1280
|
}
|
|
1364
1281
|
};
|
|
1365
1282
|
function StandardHeading({ size, text, className }) {
|
|
1366
|
-
return /* @__PURE__ */ (0,
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components11.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1367
1284
|
}
|
|
1368
1285
|
var getTitleTypeBySize = (size) => {
|
|
1369
1286
|
var _a;
|
|
@@ -1376,10 +1293,11 @@ var getTitleTypeBySize = (size) => {
|
|
|
1376
1293
|
};
|
|
1377
1294
|
return (_a = titleTypes[size]) != null ? _a : "title-subsection";
|
|
1378
1295
|
};
|
|
1296
|
+
var HeadingRenderer_default = HeadingRenderer;
|
|
1379
1297
|
|
|
1380
1298
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1299
|
+
var import_components12 = require("@transferwise/components");
|
|
1300
|
+
var import_react2 = require("react");
|
|
1383
1301
|
|
|
1384
1302
|
// ../renderers/src/utils/api-utils.ts
|
|
1385
1303
|
function isRelativePath(url = "") {
|
|
@@ -1389,7 +1307,7 @@ function isRelativePath(url = "") {
|
|
|
1389
1307
|
}
|
|
1390
1308
|
|
|
1391
1309
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1392
|
-
var
|
|
1310
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1393
1311
|
function UrlImage({
|
|
1394
1312
|
accessibilityDescription,
|
|
1395
1313
|
align,
|
|
@@ -1398,14 +1316,14 @@ function UrlImage({
|
|
|
1398
1316
|
uri,
|
|
1399
1317
|
httpClient
|
|
1400
1318
|
}) {
|
|
1401
|
-
const [imageSource, setImageSource] = (0,
|
|
1402
|
-
(0,
|
|
1319
|
+
const [imageSource, setImageSource] = (0, import_react2.useState)("");
|
|
1320
|
+
(0, import_react2.useEffect)(() => {
|
|
1403
1321
|
if (!uri.startsWith("urn:")) {
|
|
1404
1322
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1405
1323
|
}
|
|
1406
1324
|
}, [uri, httpClient]);
|
|
1407
|
-
return /* @__PURE__ */ (0,
|
|
1408
|
-
|
|
1325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1326
|
+
import_components12.Image,
|
|
1409
1327
|
{
|
|
1410
1328
|
className: `img-responsive ${getMargin(margin)}`,
|
|
1411
1329
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -1448,7 +1366,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1448
1366
|
};
|
|
1449
1367
|
|
|
1450
1368
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1451
|
-
var
|
|
1369
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1452
1370
|
var maxFlagSize = 600;
|
|
1453
1371
|
function UrnFlagImage({
|
|
1454
1372
|
accessibilityDescription,
|
|
@@ -1457,7 +1375,7 @@ function UrnFlagImage({
|
|
|
1457
1375
|
size,
|
|
1458
1376
|
uri
|
|
1459
1377
|
}) {
|
|
1460
|
-
return /* @__PURE__ */ (0,
|
|
1378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1461
1379
|
}
|
|
1462
1380
|
|
|
1463
1381
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -1477,7 +1395,7 @@ var isAnimated = (uri) => {
|
|
|
1477
1395
|
};
|
|
1478
1396
|
|
|
1479
1397
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1480
|
-
var
|
|
1398
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1481
1399
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1482
1400
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1483
1401
|
function UrnIllustration({
|
|
@@ -1491,9 +1409,9 @@ function UrnIllustration({
|
|
|
1491
1409
|
const illustrationName = getIllustrationName(uri);
|
|
1492
1410
|
const illustration3DName = getIllustration3DName(uri);
|
|
1493
1411
|
if (illustration3DName && isAnimated(uri)) {
|
|
1494
|
-
return /* @__PURE__ */ (0,
|
|
1412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_art3.Illustration3D, { name: illustration3DName, size: illustrationSize }) });
|
|
1495
1413
|
}
|
|
1496
|
-
return /* @__PURE__ */ (0,
|
|
1414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1497
1415
|
import_art3.Illustration,
|
|
1498
1416
|
{
|
|
1499
1417
|
className: "df-illustration",
|
|
@@ -1513,29 +1431,32 @@ var getIllustration3DName = (uri) => {
|
|
|
1513
1431
|
};
|
|
1514
1432
|
|
|
1515
1433
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1516
|
-
var
|
|
1434
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1517
1435
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1518
1436
|
function UrnImage(props) {
|
|
1519
1437
|
const { uri } = props;
|
|
1520
1438
|
if (isUrnIllustration(uri)) {
|
|
1521
|
-
return /* @__PURE__ */ (0,
|
|
1439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
1522
1440
|
}
|
|
1523
1441
|
if (isUrnFlag(uri)) {
|
|
1524
|
-
return /* @__PURE__ */ (0,
|
|
1442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
1525
1443
|
}
|
|
1526
1444
|
return null;
|
|
1527
1445
|
}
|
|
1528
1446
|
|
|
1529
1447
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1530
|
-
var
|
|
1448
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1531
1449
|
var ImageRenderer = {
|
|
1532
1450
|
canRenderType: "image",
|
|
1533
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
1451
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(UrlImage, __spreadValues({}, props))
|
|
1534
1452
|
};
|
|
1535
1453
|
|
|
1454
|
+
// ../renderers/src/ImageRenderer/index.tsx
|
|
1455
|
+
var ImageRenderer_default = ImageRenderer;
|
|
1456
|
+
|
|
1536
1457
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1537
|
-
var
|
|
1538
|
-
var
|
|
1458
|
+
var import_components13 = require("@transferwise/components");
|
|
1459
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1539
1460
|
var doContext = ["positive", "neutral"];
|
|
1540
1461
|
var dontContext = ["warning", "negative"];
|
|
1541
1462
|
var InstructionsRenderer = {
|
|
@@ -1543,15 +1464,16 @@ var InstructionsRenderer = {
|
|
|
1543
1464
|
render: ({ items, margin, title }) => {
|
|
1544
1465
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1545
1466
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1546
|
-
return /* @__PURE__ */ (0,
|
|
1547
|
-
title ? /* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getMargin(margin), children: [
|
|
1468
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.Header, { title }) : null,
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.InstructionsList, { dos, donts })
|
|
1549
1470
|
] });
|
|
1550
1471
|
}
|
|
1551
1472
|
};
|
|
1473
|
+
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1552
1474
|
|
|
1553
1475
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1554
|
-
var
|
|
1476
|
+
var import_components15 = require("@transferwise/components");
|
|
1555
1477
|
|
|
1556
1478
|
// ../renderers/src/utils/input-utils.ts
|
|
1557
1479
|
var onWheel = (event) => {
|
|
@@ -1561,8 +1483,8 @@ var onWheel = (event) => {
|
|
|
1561
1483
|
};
|
|
1562
1484
|
|
|
1563
1485
|
// ../renderers/src/utils/getInlineAvatar.tsx
|
|
1564
|
-
var
|
|
1565
|
-
var
|
|
1486
|
+
var import_components14 = require("@transferwise/components");
|
|
1487
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1566
1488
|
var mediaSize2 = 24;
|
|
1567
1489
|
function getInlineAvatar({ icon, image }) {
|
|
1568
1490
|
const imageNode = getImageNode(image, mediaSize2);
|
|
@@ -1578,7 +1500,7 @@ function getInlineAvatar({ icon, image }) {
|
|
|
1578
1500
|
return iconNode;
|
|
1579
1501
|
}
|
|
1580
1502
|
if (iconNode) {
|
|
1581
|
-
return /* @__PURE__ */ (0,
|
|
1503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.AvatarView, { size: mediaSize2, children: iconNode });
|
|
1582
1504
|
}
|
|
1583
1505
|
return null;
|
|
1584
1506
|
}
|
|
@@ -1601,7 +1523,7 @@ function pick(obj, ...keys) {
|
|
|
1601
1523
|
}
|
|
1602
1524
|
|
|
1603
1525
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1604
|
-
var
|
|
1526
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1605
1527
|
var IntegerInputRenderer = {
|
|
1606
1528
|
canRenderType: "input-integer",
|
|
1607
1529
|
render: (props) => {
|
|
@@ -1616,7 +1538,7 @@ var IntegerInputRenderer = {
|
|
|
1616
1538
|
"maximum",
|
|
1617
1539
|
"minimum"
|
|
1618
1540
|
);
|
|
1619
|
-
return /* @__PURE__ */ (0,
|
|
1541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1620
1542
|
FieldInput_default,
|
|
1621
1543
|
{
|
|
1622
1544
|
id,
|
|
@@ -1624,8 +1546,8 @@ var IntegerInputRenderer = {
|
|
|
1624
1546
|
description,
|
|
1625
1547
|
validation: validationState,
|
|
1626
1548
|
help,
|
|
1627
|
-
children: /* @__PURE__ */ (0,
|
|
1628
|
-
|
|
1549
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components15.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1550
|
+
import_components15.Input,
|
|
1629
1551
|
__spreadValues({
|
|
1630
1552
|
id,
|
|
1631
1553
|
name: id,
|
|
@@ -1644,86 +1566,15 @@ var IntegerInputRenderer = {
|
|
|
1644
1566
|
);
|
|
1645
1567
|
}
|
|
1646
1568
|
};
|
|
1647
|
-
|
|
1648
|
-
// ../renderers/src/ListRenderer.tsx
|
|
1649
|
-
var import_components17 = require("@transferwise/components");
|
|
1650
|
-
var import_classnames3 = __toESM(require("classnames"));
|
|
1651
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1652
|
-
var ListRenderer = {
|
|
1653
|
-
canRenderType: "list",
|
|
1654
|
-
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: getMargin(margin), children: [
|
|
1655
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Header, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
1656
|
-
items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
|
|
1657
|
-
] })
|
|
1658
|
-
};
|
|
1659
|
-
var DesignSystemListItem = ({
|
|
1660
|
-
title,
|
|
1661
|
-
description,
|
|
1662
|
-
supportingValues,
|
|
1663
|
-
icon,
|
|
1664
|
-
image,
|
|
1665
|
-
control,
|
|
1666
|
-
tag
|
|
1667
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1668
|
-
"label",
|
|
1669
|
-
{
|
|
1670
|
-
className: (0, import_classnames3.default)("np-option p-a-2", {
|
|
1671
|
-
"np-option__sm-media": true,
|
|
1672
|
-
"np-option__container-aligned": true
|
|
1673
|
-
}),
|
|
1674
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "media", children: [
|
|
1675
|
-
icon || image ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1676
|
-
ListItemMedia,
|
|
1677
|
-
{
|
|
1678
|
-
image,
|
|
1679
|
-
icon,
|
|
1680
|
-
preferAvatar: control === "with-avatar" || tag === "with-avatar"
|
|
1681
|
-
}
|
|
1682
|
-
) }) : null,
|
|
1683
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "media-body", children: [
|
|
1684
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
1685
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
1686
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: supportingValues == null ? void 0 : supportingValues.value })
|
|
1687
|
-
] }),
|
|
1688
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
1689
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Body, { className: "d-block np-option__body", children: description }),
|
|
1690
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Body, { className: "d-block np-option__body", children: supportingValues == null ? void 0 : supportingValues.subvalue })
|
|
1691
|
-
] })
|
|
1692
|
-
] })
|
|
1693
|
-
] })
|
|
1694
|
-
},
|
|
1695
|
-
title
|
|
1696
|
-
);
|
|
1697
|
-
var ListItemMedia = ({
|
|
1698
|
-
icon,
|
|
1699
|
-
image,
|
|
1700
|
-
preferAvatar
|
|
1701
|
-
}) => {
|
|
1702
|
-
if (icon) {
|
|
1703
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(OptionMedia, { icon, image, preferAvatar }) });
|
|
1704
|
-
}
|
|
1705
|
-
if (image) {
|
|
1706
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(OptionMedia, { icon, image, preferAvatar }) });
|
|
1707
|
-
}
|
|
1708
|
-
};
|
|
1709
|
-
var getListAction = (callToAction) => {
|
|
1710
|
-
if (callToAction) {
|
|
1711
|
-
return __spreadValues({
|
|
1712
|
-
"aria-label": callToAction.accessibilityDescription,
|
|
1713
|
-
text: callToAction.title,
|
|
1714
|
-
onClick: callToAction.onClick
|
|
1715
|
-
}, callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
|
|
1716
|
-
}
|
|
1717
|
-
return void 0;
|
|
1718
|
-
};
|
|
1569
|
+
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1719
1570
|
|
|
1720
1571
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1572
|
+
var import_components16 = require("@transferwise/components");
|
|
1573
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1723
1574
|
var LoadingIndicatorRenderer = {
|
|
1724
1575
|
canRenderType: "loading-indicator",
|
|
1725
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
1726
|
-
|
|
1576
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1577
|
+
import_components16.Loader,
|
|
1727
1578
|
{
|
|
1728
1579
|
size,
|
|
1729
1580
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
@@ -1731,30 +1582,33 @@ var LoadingIndicatorRenderer = {
|
|
|
1731
1582
|
}
|
|
1732
1583
|
)
|
|
1733
1584
|
};
|
|
1585
|
+
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
1734
1586
|
|
|
1735
1587
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1736
|
-
var
|
|
1737
|
-
var
|
|
1588
|
+
var import_components17 = require("@transferwise/components");
|
|
1589
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1738
1590
|
var MarkdownRenderer = {
|
|
1739
1591
|
canRenderType: "markdown",
|
|
1740
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
1592
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Markdown, { className: "np-text-body-large", config: { link: { target: "_blank" } }, children: content }) })
|
|
1741
1593
|
};
|
|
1594
|
+
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1742
1595
|
|
|
1743
|
-
// ../renderers/src/
|
|
1744
|
-
var
|
|
1745
|
-
var
|
|
1746
|
-
var
|
|
1747
|
-
var
|
|
1748
|
-
canRenderType: "modal
|
|
1749
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1596
|
+
// ../renderers/src/ModalRenderer.tsx
|
|
1597
|
+
var import_components18 = require("@transferwise/components");
|
|
1598
|
+
var import_react3 = require("react");
|
|
1599
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1600
|
+
var ModalRenderer = {
|
|
1601
|
+
canRenderType: "modal",
|
|
1602
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DFModal, __spreadValues({}, props))
|
|
1750
1603
|
};
|
|
1604
|
+
var ModalRenderer_default = ModalRenderer;
|
|
1751
1605
|
function DFModal({ content, margin, trigger }) {
|
|
1752
|
-
const [visible, setVisible] = (0,
|
|
1606
|
+
const [visible, setVisible] = (0, import_react3.useState)(false);
|
|
1753
1607
|
const { children, title } = content;
|
|
1754
|
-
return /* @__PURE__ */ (0,
|
|
1755
|
-
/* @__PURE__ */ (0,
|
|
1756
|
-
/* @__PURE__ */ (0,
|
|
1757
|
-
|
|
1608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getMargin(margin), children: [
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components18.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1611
|
+
import_components18.Modal,
|
|
1758
1612
|
{
|
|
1759
1613
|
scroll: "content",
|
|
1760
1614
|
open: visible,
|
|
@@ -1767,24 +1621,14 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1767
1621
|
] });
|
|
1768
1622
|
}
|
|
1769
1623
|
|
|
1770
|
-
// ../renderers/src/ModalRenderer.tsx
|
|
1771
|
-
var import_components21 = require("@transferwise/components");
|
|
1772
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1773
|
-
var ModalContentRenderer = {
|
|
1774
|
-
canRenderType: "modal",
|
|
1775
|
-
render: ({ title, children, open, onClose }) => {
|
|
1776
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components21.Modal, { open, title, body: children, onClose });
|
|
1777
|
-
}
|
|
1778
|
-
};
|
|
1779
|
-
|
|
1780
1624
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1781
|
-
var
|
|
1782
|
-
var
|
|
1783
|
-
var
|
|
1625
|
+
var import_components19 = require("@transferwise/components");
|
|
1626
|
+
var import_react4 = require("react");
|
|
1627
|
+
var import_react_intl4 = require("react-intl");
|
|
1784
1628
|
|
|
1785
1629
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
1786
|
-
var
|
|
1787
|
-
var multi_select_messages_default = (0,
|
|
1630
|
+
var import_react_intl3 = require("react-intl");
|
|
1631
|
+
var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
|
|
1788
1632
|
summary: {
|
|
1789
1633
|
id: "df.wise.MultiSelect.summary",
|
|
1790
1634
|
defaultMessage: "{first} and {count} more",
|
|
@@ -1793,14 +1637,14 @@ var multi_select_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
1793
1637
|
});
|
|
1794
1638
|
|
|
1795
1639
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1796
|
-
var
|
|
1640
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1797
1641
|
var MultiSelectInputRenderer = {
|
|
1798
1642
|
canRenderType: "input-multi-select",
|
|
1799
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1643
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1800
1644
|
};
|
|
1801
1645
|
function MultiSelectInputRendererComponent(props) {
|
|
1802
|
-
const { formatMessage } = (0,
|
|
1803
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
1646
|
+
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
1647
|
+
const [stagedIndices, setStagedIndices] = (0, import_react4.useState)();
|
|
1804
1648
|
const {
|
|
1805
1649
|
id,
|
|
1806
1650
|
autoComplete,
|
|
@@ -1838,12 +1682,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1838
1682
|
const contentProps = {
|
|
1839
1683
|
title: option.title,
|
|
1840
1684
|
description: option.description,
|
|
1841
|
-
icon: /* @__PURE__ */ (0,
|
|
1685
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
1842
1686
|
};
|
|
1843
|
-
return /* @__PURE__ */ (0,
|
|
1687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1844
1688
|
};
|
|
1845
1689
|
const extraProps = { autoComplete };
|
|
1846
|
-
return /* @__PURE__ */ (0,
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1847
1691
|
FieldInput_default,
|
|
1848
1692
|
{
|
|
1849
1693
|
id,
|
|
@@ -1851,8 +1695,8 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1851
1695
|
help,
|
|
1852
1696
|
description,
|
|
1853
1697
|
validation: validationState,
|
|
1854
|
-
children: /* @__PURE__ */ (0,
|
|
1855
|
-
|
|
1698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1699
|
+
import_components19.SelectInput,
|
|
1856
1700
|
__spreadValues({
|
|
1857
1701
|
id,
|
|
1858
1702
|
items: options.map((option, index) => {
|
|
@@ -1888,14 +1732,15 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1888
1732
|
}
|
|
1889
1733
|
);
|
|
1890
1734
|
}
|
|
1735
|
+
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
1891
1736
|
|
|
1892
1737
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1893
|
-
var
|
|
1738
|
+
var import_components21 = require("@transferwise/components");
|
|
1894
1739
|
|
|
1895
1740
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1896
|
-
var
|
|
1897
|
-
var
|
|
1898
|
-
var
|
|
1741
|
+
var import_components20 = require("@transferwise/components");
|
|
1742
|
+
var import_classnames3 = __toESM(require("classnames"));
|
|
1743
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1899
1744
|
function UploadFieldInput({
|
|
1900
1745
|
id,
|
|
1901
1746
|
children,
|
|
@@ -1904,18 +1749,18 @@ function UploadFieldInput({
|
|
|
1904
1749
|
help,
|
|
1905
1750
|
validation
|
|
1906
1751
|
}) {
|
|
1907
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1752
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1908
1753
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1909
|
-
return /* @__PURE__ */ (0,
|
|
1754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1910
1755
|
"div",
|
|
1911
1756
|
{
|
|
1912
|
-
className: (0,
|
|
1757
|
+
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1913
1758
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1914
1759
|
}),
|
|
1915
1760
|
children: [
|
|
1916
|
-
/* @__PURE__ */ (0,
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1917
1762
|
children,
|
|
1918
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
1763
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1919
1764
|
]
|
|
1920
1765
|
}
|
|
1921
1766
|
);
|
|
@@ -1944,7 +1789,7 @@ var getFileType = (base64Url) => {
|
|
|
1944
1789
|
};
|
|
1945
1790
|
|
|
1946
1791
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1947
|
-
var
|
|
1792
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1948
1793
|
var MultiUploadInputRenderer = {
|
|
1949
1794
|
canRenderType: "input-upload-multi",
|
|
1950
1795
|
render: (props) => {
|
|
@@ -1969,7 +1814,7 @@ var MultiUploadInputRenderer = {
|
|
|
1969
1814
|
};
|
|
1970
1815
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1971
1816
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1972
|
-
return /* @__PURE__ */ (0,
|
|
1817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1973
1818
|
UploadFieldInput_default,
|
|
1974
1819
|
{
|
|
1975
1820
|
id,
|
|
@@ -1977,8 +1822,8 @@ var MultiUploadInputRenderer = {
|
|
|
1977
1822
|
description,
|
|
1978
1823
|
validation: validationState,
|
|
1979
1824
|
help,
|
|
1980
|
-
children: /* @__PURE__ */ (0,
|
|
1981
|
-
|
|
1825
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1826
|
+
import_components21.UploadInput,
|
|
1982
1827
|
{
|
|
1983
1828
|
id,
|
|
1984
1829
|
"aria-describedby": descriptionId,
|
|
@@ -1997,10 +1842,11 @@ var MultiUploadInputRenderer = {
|
|
|
1997
1842
|
);
|
|
1998
1843
|
}
|
|
1999
1844
|
};
|
|
1845
|
+
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
2000
1846
|
|
|
2001
1847
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2002
|
-
var
|
|
2003
|
-
var
|
|
1848
|
+
var import_components22 = require("@transferwise/components");
|
|
1849
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2004
1850
|
var NumberInputRenderer = {
|
|
2005
1851
|
canRenderType: "input-number",
|
|
2006
1852
|
render: (props) => {
|
|
@@ -2014,7 +1860,7 @@ var NumberInputRenderer = {
|
|
|
2014
1860
|
"maximum",
|
|
2015
1861
|
"minimum"
|
|
2016
1862
|
);
|
|
2017
|
-
return /* @__PURE__ */ (0,
|
|
1863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2018
1864
|
FieldInput_default,
|
|
2019
1865
|
{
|
|
2020
1866
|
id,
|
|
@@ -2022,8 +1868,8 @@ var NumberInputRenderer = {
|
|
|
2022
1868
|
description,
|
|
2023
1869
|
validation: validationState,
|
|
2024
1870
|
help,
|
|
2025
|
-
children: /* @__PURE__ */ (0,
|
|
2026
|
-
|
|
1871
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1872
|
+
import_components22.Input,
|
|
2027
1873
|
__spreadValues({
|
|
2028
1874
|
id,
|
|
2029
1875
|
name: id,
|
|
@@ -2040,26 +1886,27 @@ var NumberInputRenderer = {
|
|
|
2040
1886
|
);
|
|
2041
1887
|
}
|
|
2042
1888
|
};
|
|
1889
|
+
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2043
1890
|
|
|
2044
1891
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2045
|
-
var
|
|
1892
|
+
var import_react_intl6 = require("react-intl");
|
|
2046
1893
|
|
|
2047
1894
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2048
|
-
var
|
|
2049
|
-
var
|
|
1895
|
+
var import_components23 = require("@transferwise/components");
|
|
1896
|
+
var import_react5 = require("react");
|
|
2050
1897
|
function useSnackBarIfAvailable() {
|
|
2051
|
-
const context = (0,
|
|
1898
|
+
const context = (0, import_react5.useContext)(import_components23.SnackbarContext);
|
|
2052
1899
|
return context ? context.createSnackbar : () => {
|
|
2053
1900
|
};
|
|
2054
1901
|
}
|
|
2055
1902
|
|
|
2056
1903
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2057
|
-
var
|
|
2058
|
-
var
|
|
1904
|
+
var import_components24 = require("@transferwise/components");
|
|
1905
|
+
var import_classnames4 = __toESM(require("classnames"));
|
|
2059
1906
|
|
|
2060
1907
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2061
|
-
var
|
|
2062
|
-
var paragraph_messages_default = (0,
|
|
1908
|
+
var import_react_intl5 = require("react-intl");
|
|
1909
|
+
var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
|
|
2063
1910
|
copy: {
|
|
2064
1911
|
id: "df.wise.DynamicParagraph.copy",
|
|
2065
1912
|
defaultMessage: "Copy",
|
|
@@ -2073,54 +1920,55 @@ var paragraph_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
2073
1920
|
});
|
|
2074
1921
|
|
|
2075
1922
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2076
|
-
var
|
|
1923
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2077
1924
|
var ParagraphRenderer = {
|
|
2078
1925
|
canRenderType: "paragraph",
|
|
2079
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1926
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Paragraph, __spreadValues({}, props))
|
|
2080
1927
|
};
|
|
2081
1928
|
function Paragraph({ align, control, margin, text }) {
|
|
2082
1929
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2083
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
1930
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(StandardParagraph, { className, text });
|
|
2084
1931
|
}
|
|
2085
1932
|
function StandardParagraph({ text, className }) {
|
|
2086
|
-
return /* @__PURE__ */ (0,
|
|
1933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2087
1934
|
}
|
|
2088
1935
|
function CopyableParagraph({
|
|
2089
1936
|
text,
|
|
2090
1937
|
align,
|
|
2091
1938
|
className
|
|
2092
1939
|
}) {
|
|
2093
|
-
const { formatMessage } = (0,
|
|
1940
|
+
const { formatMessage } = (0, import_react_intl6.useIntl)();
|
|
2094
1941
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2095
1942
|
const copy = () => {
|
|
2096
1943
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2097
1944
|
});
|
|
2098
1945
|
};
|
|
2099
1946
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2100
|
-
return /* @__PURE__ */ (0,
|
|
2101
|
-
/* @__PURE__ */ (0,
|
|
2102
|
-
|
|
1947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className, children: [
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1949
|
+
import_components24.Input,
|
|
2103
1950
|
{
|
|
2104
1951
|
type: "text",
|
|
2105
1952
|
value: text,
|
|
2106
1953
|
readOnly: true,
|
|
2107
|
-
className: (0,
|
|
1954
|
+
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
2108
1955
|
}
|
|
2109
1956
|
),
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2111
1958
|
] });
|
|
2112
1959
|
}
|
|
1960
|
+
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2113
1961
|
|
|
2114
1962
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2115
|
-
var
|
|
1963
|
+
var import_components25 = require("@transferwise/components");
|
|
2116
1964
|
var import_icons = require("@transferwise/icons");
|
|
2117
|
-
var
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
1965
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
1966
|
+
var import_react6 = require("react");
|
|
1967
|
+
var import_react_intl8 = require("react-intl");
|
|
2120
1968
|
|
|
2121
1969
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2122
|
-
var
|
|
2123
|
-
var repeatable_messages_default = (0,
|
|
1970
|
+
var import_react_intl7 = require("react-intl");
|
|
1971
|
+
var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
|
|
2124
1972
|
addItemTitle: {
|
|
2125
1973
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2126
1974
|
defaultMessage: "Add Item",
|
|
@@ -2144,10 +1992,10 @@ var repeatable_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
2144
1992
|
});
|
|
2145
1993
|
|
|
2146
1994
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2147
|
-
var
|
|
1995
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2148
1996
|
var RepeatableRenderer = {
|
|
2149
1997
|
canRenderType: "repeatable",
|
|
2150
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1998
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Repeatable, __spreadValues({}, props))
|
|
2151
1999
|
};
|
|
2152
2000
|
function Repeatable(props) {
|
|
2153
2001
|
const {
|
|
@@ -2163,8 +2011,8 @@ function Repeatable(props) {
|
|
|
2163
2011
|
onSave,
|
|
2164
2012
|
onRemove
|
|
2165
2013
|
} = props;
|
|
2166
|
-
const { formatMessage } = (0,
|
|
2167
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2014
|
+
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
2015
|
+
const [openModalType, setOpenModalType] = (0, import_react6.useState)(null);
|
|
2168
2016
|
const onAddItem = () => {
|
|
2169
2017
|
onAdd();
|
|
2170
2018
|
setOpenModalType("add");
|
|
@@ -2186,40 +2034,40 @@ function Repeatable(props) {
|
|
|
2186
2034
|
const onCancelEdit = () => {
|
|
2187
2035
|
setOpenModalType(null);
|
|
2188
2036
|
};
|
|
2189
|
-
return /* @__PURE__ */ (0,
|
|
2190
|
-
title && /* @__PURE__ */ (0,
|
|
2191
|
-
description && /* @__PURE__ */ (0,
|
|
2192
|
-
/* @__PURE__ */ (0,
|
|
2037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
2038
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.Header, { title }),
|
|
2039
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: description }),
|
|
2040
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2193
2041
|
"div",
|
|
2194
2042
|
{
|
|
2195
|
-
className: (0,
|
|
2043
|
+
className: (0, import_classnames5.default)("form-group", {
|
|
2196
2044
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2197
2045
|
}),
|
|
2198
2046
|
children: [
|
|
2199
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2200
|
-
/* @__PURE__ */ (0,
|
|
2201
|
-
|
|
2047
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2049
|
+
import_components25.NavigationOption,
|
|
2202
2050
|
{
|
|
2203
|
-
media: /* @__PURE__ */ (0,
|
|
2051
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons.Plus, {}),
|
|
2204
2052
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2205
2053
|
showMediaAtAllSizes: true,
|
|
2206
2054
|
onClick: () => onAddItem()
|
|
2207
2055
|
}
|
|
2208
2056
|
),
|
|
2209
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2057
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
2210
2058
|
]
|
|
2211
2059
|
}
|
|
2212
2060
|
),
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2214
|
-
|
|
2061
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2062
|
+
import_components25.Modal,
|
|
2215
2063
|
{
|
|
2216
2064
|
open: openModalType !== null,
|
|
2217
2065
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2218
|
-
body: /* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
/* @__PURE__ */ (0,
|
|
2222
|
-
/* @__PURE__ */ (0,
|
|
2066
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
2067
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2068
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
2069
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2070
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2223
2071
|
] })
|
|
2224
2072
|
] }),
|
|
2225
2073
|
onClose: () => onCancelEdit()
|
|
@@ -2231,10 +2079,10 @@ function ItemSummaryOption({
|
|
|
2231
2079
|
item,
|
|
2232
2080
|
onClick
|
|
2233
2081
|
}) {
|
|
2234
|
-
return /* @__PURE__ */ (0,
|
|
2235
|
-
|
|
2082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2083
|
+
import_components25.NavigationOption,
|
|
2236
2084
|
{
|
|
2237
|
-
media: /* @__PURE__ */ (0,
|
|
2085
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionMedia, __spreadProps(__spreadValues({}, item), { preferAvatar: false })),
|
|
2238
2086
|
title: item.title,
|
|
2239
2087
|
content: item.description,
|
|
2240
2088
|
showMediaAtAllSizes: true,
|
|
@@ -2242,111 +2090,29 @@ function ItemSummaryOption({
|
|
|
2242
2090
|
}
|
|
2243
2091
|
);
|
|
2244
2092
|
}
|
|
2093
|
+
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2245
2094
|
|
|
2246
|
-
// ../renderers/src/
|
|
2247
|
-
var
|
|
2095
|
+
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2096
|
+
var import_components27 = require("@transferwise/components");
|
|
2097
|
+
var import_react7 = require("react");
|
|
2098
|
+
var import_react_intl12 = require("react-intl");
|
|
2248
2099
|
|
|
2249
|
-
// ../renderers/src/
|
|
2250
|
-
var
|
|
2251
|
-
|
|
2252
|
-
|
|
2100
|
+
// ../renderers/src/messages/search.messages.ts
|
|
2101
|
+
var import_react_intl9 = require("react-intl");
|
|
2102
|
+
var search_messages_default = (0, import_react_intl9.defineMessages)({
|
|
2103
|
+
loading: {
|
|
2104
|
+
id: "df.wise.SearchLayout.loading",
|
|
2105
|
+
defaultMessage: "Loading...",
|
|
2106
|
+
description: "A message shown to the user while their search is being processed, before results appear."
|
|
2253
2107
|
}
|
|
2254
|
-
|
|
2255
|
-
return href ? {
|
|
2256
|
-
"aria-label": accessibilityDescription,
|
|
2257
|
-
text: title,
|
|
2258
|
-
href,
|
|
2259
|
-
target: "_blank"
|
|
2260
|
-
} : {
|
|
2261
|
-
"aria-label": accessibilityDescription,
|
|
2262
|
-
text: title,
|
|
2263
|
-
onClick: (event) => {
|
|
2264
|
-
event.preventDefault();
|
|
2265
|
-
onClick();
|
|
2266
|
-
}
|
|
2267
|
-
};
|
|
2268
|
-
};
|
|
2269
|
-
|
|
2270
|
-
// ../renderers/src/ReviewRenderer.tsx
|
|
2271
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2272
|
-
var ReviewRenderer = {
|
|
2273
|
-
canRenderType: "review",
|
|
2274
|
-
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2275
|
-
const orientation = mapControlToDefinitionListLayout(control);
|
|
2276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
2277
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components29.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2278
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2279
|
-
import_components29.DefinitionList,
|
|
2280
|
-
{
|
|
2281
|
-
layout: orientation,
|
|
2282
|
-
definitions: fields.map(
|
|
2283
|
-
({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
|
|
2284
|
-
key: String(index),
|
|
2285
|
-
title: label,
|
|
2286
|
-
value: getFieldValue(
|
|
2287
|
-
value,
|
|
2288
|
-
help,
|
|
2289
|
-
orientation,
|
|
2290
|
-
() => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
|
|
2291
|
-
)
|
|
2292
|
-
})
|
|
2293
|
-
)
|
|
2294
|
-
}
|
|
2295
|
-
) })
|
|
2296
|
-
] });
|
|
2297
|
-
}
|
|
2298
|
-
};
|
|
2299
|
-
var mapControlToDefinitionListLayout = (control) => {
|
|
2300
|
-
switch (control) {
|
|
2301
|
-
case "horizontal":
|
|
2302
|
-
case "horizontal-end-aligned":
|
|
2303
|
-
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
2304
|
-
case "horizontal-start-aligned":
|
|
2305
|
-
return "HORIZONTAL_LEFT_ALIGNED";
|
|
2306
|
-
case "vertical-two-column":
|
|
2307
|
-
return "VERTICAL_TWO_COLUMN";
|
|
2308
|
-
case "vertical":
|
|
2309
|
-
case "vertical-one-column":
|
|
2310
|
-
default:
|
|
2311
|
-
return "VERTICAL_ONE_COLUMN";
|
|
2312
|
-
}
|
|
2313
|
-
};
|
|
2314
|
-
var getFieldValue = (value, help, orientation, onClick) => {
|
|
2315
|
-
if (help) {
|
|
2316
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2317
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Help_default, { help, onClick }),
|
|
2318
|
-
" ",
|
|
2319
|
-
value
|
|
2320
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2321
|
-
value,
|
|
2322
|
-
" ",
|
|
2323
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Help_default, { help, onClick })
|
|
2324
|
-
] });
|
|
2325
|
-
}
|
|
2326
|
-
return value;
|
|
2327
|
-
};
|
|
2328
|
-
|
|
2329
|
-
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2330
|
-
var import_components31 = require("@transferwise/components");
|
|
2331
|
-
var import_react8 = require("react");
|
|
2332
|
-
var import_react_intl14 = require("react-intl");
|
|
2333
|
-
|
|
2334
|
-
// ../renderers/src/messages/search.messages.ts
|
|
2335
|
-
var import_react_intl11 = require("react-intl");
|
|
2336
|
-
var search_messages_default = (0, import_react_intl11.defineMessages)({
|
|
2337
|
-
loading: {
|
|
2338
|
-
id: "df.wise.SearchLayout.loading",
|
|
2339
|
-
defaultMessage: "Loading...",
|
|
2340
|
-
description: "A message shown to the user while their search is being processed, before results appear."
|
|
2341
|
-
}
|
|
2342
|
-
});
|
|
2108
|
+
});
|
|
2343
2109
|
|
|
2344
2110
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2345
|
-
var
|
|
2111
|
+
var import_react_intl11 = require("react-intl");
|
|
2346
2112
|
|
|
2347
2113
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
2348
|
-
var
|
|
2349
|
-
var generic_error_messages_default = (0,
|
|
2114
|
+
var import_react_intl10 = require("react-intl");
|
|
2115
|
+
var generic_error_messages_default = (0, import_react_intl10.defineMessages)({
|
|
2350
2116
|
genericErrorRetryHint: {
|
|
2351
2117
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
2352
2118
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -2365,20 +2131,20 @@ var generic_error_messages_default = (0, import_react_intl12.defineMessages)({
|
|
|
2365
2131
|
});
|
|
2366
2132
|
|
|
2367
2133
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2368
|
-
var
|
|
2369
|
-
var
|
|
2134
|
+
var import_components26 = require("@transferwise/components");
|
|
2135
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2370
2136
|
function ErrorResult({ state }) {
|
|
2371
|
-
const intl = (0,
|
|
2137
|
+
const intl = (0, import_react_intl11.useIntl)();
|
|
2372
2138
|
const buttonVisualProps = {
|
|
2373
2139
|
priority: "tertiary",
|
|
2374
2140
|
size: "sm",
|
|
2375
2141
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2376
2142
|
};
|
|
2377
|
-
return /* @__PURE__ */ (0,
|
|
2143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "m-t-2", children: [
|
|
2378
2144
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2379
2145
|
"\xA0",
|
|
2380
|
-
/* @__PURE__ */ (0,
|
|
2381
|
-
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2147
|
+
import_components26.Button,
|
|
2382
2148
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2383
2149
|
onClick: () => {
|
|
2384
2150
|
state.onRetry();
|
|
@@ -2390,7 +2156,7 @@ function ErrorResult({ state }) {
|
|
|
2390
2156
|
}
|
|
2391
2157
|
|
|
2392
2158
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2393
|
-
var
|
|
2159
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2394
2160
|
function BlockSearchRendererComponent({
|
|
2395
2161
|
id,
|
|
2396
2162
|
isLoading,
|
|
@@ -2401,11 +2167,11 @@ function BlockSearchRendererComponent({
|
|
|
2401
2167
|
trackEvent,
|
|
2402
2168
|
onChange
|
|
2403
2169
|
}) {
|
|
2404
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2405
|
-
const { formatMessage } = (0,
|
|
2406
|
-
return /* @__PURE__ */ (0,
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2408
|
-
|
|
2170
|
+
const [hasSearched, setHasSearched] = (0, import_react7.useState)(false);
|
|
2171
|
+
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getMargin(margin), children: [
|
|
2173
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2174
|
+
import_components27.Input,
|
|
2409
2175
|
{
|
|
2410
2176
|
id,
|
|
2411
2177
|
name: id,
|
|
@@ -2421,7 +2187,7 @@ function BlockSearchRendererComponent({
|
|
|
2421
2187
|
}
|
|
2422
2188
|
}
|
|
2423
2189
|
) }),
|
|
2424
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2190
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SearchResultContent, { state, trackEvent })
|
|
2425
2191
|
] });
|
|
2426
2192
|
}
|
|
2427
2193
|
function SearchResultContent({
|
|
@@ -2430,27 +2196,27 @@ function SearchResultContent({
|
|
|
2430
2196
|
}) {
|
|
2431
2197
|
switch (state.type) {
|
|
2432
2198
|
case "error":
|
|
2433
|
-
return /* @__PURE__ */ (0,
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ErrorResult, { state });
|
|
2434
2200
|
case "results":
|
|
2435
|
-
return /* @__PURE__ */ (0,
|
|
2201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SearchResults, { state, trackEvent });
|
|
2436
2202
|
case "noResults":
|
|
2437
|
-
return /* @__PURE__ */ (0,
|
|
2203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(EmptySearchResult, { state });
|
|
2438
2204
|
case "pending":
|
|
2439
2205
|
default:
|
|
2440
2206
|
return null;
|
|
2441
2207
|
}
|
|
2442
2208
|
}
|
|
2443
2209
|
function EmptySearchResult({ state }) {
|
|
2444
|
-
return /* @__PURE__ */ (0,
|
|
2210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2445
2211
|
}
|
|
2446
2212
|
function SearchResults({
|
|
2447
2213
|
state,
|
|
2448
2214
|
trackEvent
|
|
2449
2215
|
}) {
|
|
2450
|
-
return /* @__PURE__ */ (0,
|
|
2216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
2451
2217
|
const { icon, image } = result;
|
|
2452
|
-
return /* @__PURE__ */ (0,
|
|
2453
|
-
|
|
2218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2219
|
+
import_components27.NavigationOption,
|
|
2454
2220
|
{
|
|
2455
2221
|
title: result.title,
|
|
2456
2222
|
content: result.description,
|
|
@@ -2471,11 +2237,11 @@ function SearchResults({
|
|
|
2471
2237
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
2472
2238
|
|
|
2473
2239
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2474
|
-
var
|
|
2240
|
+
var import_components28 = require("@transferwise/components");
|
|
2475
2241
|
var import_icons2 = require("@transferwise/icons");
|
|
2476
|
-
var
|
|
2477
|
-
var
|
|
2478
|
-
var
|
|
2242
|
+
var import_react8 = require("react");
|
|
2243
|
+
var import_react_intl13 = require("react-intl");
|
|
2244
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2479
2245
|
function InlineSearchRenderer({
|
|
2480
2246
|
id,
|
|
2481
2247
|
isLoading,
|
|
@@ -2485,20 +2251,20 @@ function InlineSearchRenderer({
|
|
|
2485
2251
|
title,
|
|
2486
2252
|
trackEvent
|
|
2487
2253
|
}) {
|
|
2488
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2489
|
-
const intl = (0,
|
|
2490
|
-
return /* @__PURE__ */ (0,
|
|
2491
|
-
|
|
2254
|
+
const [hasSearched, setHasSearched] = (0, import_react8.useState)(false);
|
|
2255
|
+
const intl = (0, import_react_intl13.useIntl)();
|
|
2256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2257
|
+
import_components28.Typeahead,
|
|
2492
2258
|
{
|
|
2493
2259
|
id: "typeahead-input-id",
|
|
2494
2260
|
intl,
|
|
2495
2261
|
name: "typeahead-input-name",
|
|
2496
2262
|
size: "md",
|
|
2497
2263
|
maxHeight: 100,
|
|
2498
|
-
footer: /* @__PURE__ */ (0,
|
|
2264
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2499
2265
|
multiple: false,
|
|
2500
2266
|
clearable: false,
|
|
2501
|
-
addon: /* @__PURE__ */ (0,
|
|
2267
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons2.Search, { size: 24 }),
|
|
2502
2268
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2503
2269
|
minQueryLength: 1,
|
|
2504
2270
|
onChange: (values) => {
|
|
@@ -2533,43 +2299,31 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2533
2299
|
};
|
|
2534
2300
|
}
|
|
2535
2301
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2536
|
-
const { formatMessage } = (0,
|
|
2302
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2537
2303
|
if (state.type === "noResults") {
|
|
2538
|
-
return /* @__PURE__ */ (0,
|
|
2304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2539
2305
|
}
|
|
2540
2306
|
if (state.type === "error") {
|
|
2541
|
-
return /* @__PURE__ */ (0,
|
|
2307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ErrorResult, { state }) });
|
|
2542
2308
|
}
|
|
2543
2309
|
if (state.type === "pending" || isLoading) {
|
|
2544
|
-
return /* @__PURE__ */ (0,
|
|
2310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2545
2311
|
}
|
|
2546
2312
|
return null;
|
|
2547
2313
|
}
|
|
2548
2314
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2549
2315
|
|
|
2550
2316
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2551
|
-
var
|
|
2317
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2552
2318
|
var SearchRenderer = {
|
|
2553
2319
|
canRenderType: "search",
|
|
2554
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2555
|
-
};
|
|
2556
|
-
|
|
2557
|
-
// ../renderers/src/SectionRenderer.tsx
|
|
2558
|
-
var import_components33 = require("@transferwise/components");
|
|
2559
|
-
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2560
|
-
var SectionRenderer = {
|
|
2561
|
-
canRenderType: "section",
|
|
2562
|
-
render: ({ children, callToAction, margin, title }) => {
|
|
2563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("section", { className: getMargin(margin), children: [
|
|
2564
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2565
|
-
children
|
|
2566
|
-
] });
|
|
2567
|
-
}
|
|
2320
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2568
2321
|
};
|
|
2322
|
+
var SearchRenderer_default = SearchRenderer;
|
|
2569
2323
|
|
|
2570
2324
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2571
|
-
var
|
|
2572
|
-
var
|
|
2325
|
+
var import_components29 = require("@transferwise/components");
|
|
2326
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2573
2327
|
function RadioInputRendererComponent(props) {
|
|
2574
2328
|
const {
|
|
2575
2329
|
id,
|
|
@@ -2583,8 +2337,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2583
2337
|
validationState,
|
|
2584
2338
|
onSelect
|
|
2585
2339
|
} = props;
|
|
2586
|
-
return /* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2588
2342
|
FieldInput_default,
|
|
2589
2343
|
{
|
|
2590
2344
|
id,
|
|
@@ -2592,8 +2346,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2592
2346
|
help,
|
|
2593
2347
|
description,
|
|
2594
2348
|
validation: validationState,
|
|
2595
|
-
children: /* @__PURE__ */ (0,
|
|
2596
|
-
|
|
2349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2350
|
+
import_components29.RadioGroup,
|
|
2597
2351
|
{
|
|
2598
2352
|
name: id,
|
|
2599
2353
|
radios: options.map((option, index) => ({
|
|
@@ -2601,7 +2355,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2601
2355
|
value: index,
|
|
2602
2356
|
secondary: option.description,
|
|
2603
2357
|
disabled: option.disabled || disabled,
|
|
2604
|
-
avatar: /* @__PURE__ */ (0,
|
|
2358
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
2605
2359
|
})),
|
|
2606
2360
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2607
2361
|
onChange: onSelect
|
|
@@ -2614,15 +2368,16 @@ function RadioInputRendererComponent(props) {
|
|
|
2614
2368
|
] });
|
|
2615
2369
|
}
|
|
2616
2370
|
|
|
2617
|
-
// ../renderers/src/SelectInputRenderer/
|
|
2618
|
-
var
|
|
2619
|
-
var
|
|
2620
|
-
var
|
|
2621
|
-
function
|
|
2371
|
+
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2372
|
+
var import_components30 = require("@transferwise/components");
|
|
2373
|
+
var import_react9 = require("react");
|
|
2374
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2375
|
+
function TabInputRendererComponent(props) {
|
|
2622
2376
|
const {
|
|
2623
2377
|
id,
|
|
2624
2378
|
children,
|
|
2625
2379
|
description,
|
|
2380
|
+
disabled,
|
|
2626
2381
|
help,
|
|
2627
2382
|
title,
|
|
2628
2383
|
options,
|
|
@@ -2630,13 +2385,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2630
2385
|
validationState,
|
|
2631
2386
|
onSelect
|
|
2632
2387
|
} = props;
|
|
2633
|
-
(0,
|
|
2388
|
+
(0, import_react9.useEffect)(() => {
|
|
2634
2389
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
2635
2390
|
onSelect(0);
|
|
2636
2391
|
}
|
|
2637
2392
|
}, [selectedIndex, onSelect, options.length]);
|
|
2638
|
-
return /* @__PURE__ */ (0,
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2640
2395
|
FieldInput_default,
|
|
2641
2396
|
{
|
|
2642
2397
|
id,
|
|
@@ -2644,31 +2399,31 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2644
2399
|
help,
|
|
2645
2400
|
description,
|
|
2646
2401
|
validation: validationState,
|
|
2647
|
-
children: /* @__PURE__ */ (0,
|
|
2648
|
-
|
|
2402
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2403
|
+
import_components30.Tabs,
|
|
2649
2404
|
{
|
|
2650
|
-
name:
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2405
|
+
name: id,
|
|
2406
|
+
selected: selectedIndex != null ? selectedIndex : 0,
|
|
2407
|
+
tabs: options.map((option) => ({
|
|
2408
|
+
title: option.title,
|
|
2409
|
+
// if we pass null, we get some props-types console errors
|
|
2410
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2411
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, {}),
|
|
2412
|
+
disabled: option.disabled || disabled
|
|
2658
2413
|
})),
|
|
2659
|
-
|
|
2414
|
+
onTabSelect: onSelect
|
|
2660
2415
|
}
|
|
2661
2416
|
)
|
|
2662
2417
|
}
|
|
2663
2418
|
),
|
|
2664
|
-
|
|
2419
|
+
children
|
|
2665
2420
|
] });
|
|
2666
2421
|
}
|
|
2667
2422
|
var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
|
|
2668
2423
|
|
|
2669
2424
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2670
|
-
var
|
|
2671
|
-
var
|
|
2425
|
+
var import_components31 = require("@transferwise/components");
|
|
2426
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2672
2427
|
function SelectInputRendererComponent(props) {
|
|
2673
2428
|
const {
|
|
2674
2429
|
id,
|
|
@@ -2708,13 +2463,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2708
2463
|
} : {
|
|
2709
2464
|
title: option.title,
|
|
2710
2465
|
description: option.description,
|
|
2711
|
-
icon: /* @__PURE__ */ (0,
|
|
2466
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
2712
2467
|
};
|
|
2713
|
-
return /* @__PURE__ */ (0,
|
|
2468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2714
2469
|
};
|
|
2715
2470
|
const extraProps = { autoComplete };
|
|
2716
|
-
return /* @__PURE__ */ (0,
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
2471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2718
2473
|
FieldInput_default,
|
|
2719
2474
|
{
|
|
2720
2475
|
id,
|
|
@@ -2722,8 +2477,8 @@ function SelectInputRendererComponent(props) {
|
|
|
2722
2477
|
help,
|
|
2723
2478
|
description,
|
|
2724
2479
|
validation: validationState,
|
|
2725
|
-
children: /* @__PURE__ */ (0,
|
|
2726
|
-
|
|
2480
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2481
|
+
import_components31.SelectInput,
|
|
2727
2482
|
__spreadValues({
|
|
2728
2483
|
name: id,
|
|
2729
2484
|
placeholder,
|
|
@@ -2742,16 +2497,15 @@ function SelectInputRendererComponent(props) {
|
|
|
2742
2497
|
] });
|
|
2743
2498
|
}
|
|
2744
2499
|
|
|
2745
|
-
// ../renderers/src/SelectInputRenderer/
|
|
2746
|
-
var
|
|
2747
|
-
var
|
|
2748
|
-
var
|
|
2749
|
-
function
|
|
2500
|
+
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2501
|
+
var import_react10 = require("react");
|
|
2502
|
+
var import_components32 = require("@transferwise/components");
|
|
2503
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2504
|
+
function SegmentedInputRendererComponent(props) {
|
|
2750
2505
|
const {
|
|
2751
2506
|
id,
|
|
2752
2507
|
children,
|
|
2753
2508
|
description,
|
|
2754
|
-
disabled,
|
|
2755
2509
|
help,
|
|
2756
2510
|
title,
|
|
2757
2511
|
options,
|
|
@@ -2759,13 +2513,13 @@ function TabInputRendererComponent(props) {
|
|
|
2759
2513
|
validationState,
|
|
2760
2514
|
onSelect
|
|
2761
2515
|
} = props;
|
|
2762
|
-
(0,
|
|
2516
|
+
(0, import_react10.useEffect)(() => {
|
|
2763
2517
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2764
2518
|
onSelect(0);
|
|
2765
2519
|
}
|
|
2766
2520
|
}, [selectedIndex, onSelect, options.length]);
|
|
2767
|
-
return /* @__PURE__ */ (0,
|
|
2768
|
-
/* @__PURE__ */ (0,
|
|
2521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2769
2523
|
FieldInput_default,
|
|
2770
2524
|
{
|
|
2771
2525
|
id,
|
|
@@ -2773,60 +2527,61 @@ function TabInputRendererComponent(props) {
|
|
|
2773
2527
|
help,
|
|
2774
2528
|
description,
|
|
2775
2529
|
validation: validationState,
|
|
2776
|
-
children: /* @__PURE__ */ (0,
|
|
2777
|
-
|
|
2530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2531
|
+
import_components32.SegmentedControl,
|
|
2778
2532
|
{
|
|
2779
|
-
name: id
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2533
|
+
name: `${id}-segmented-control`,
|
|
2534
|
+
value: String(selectedIndex),
|
|
2535
|
+
mode: "view",
|
|
2536
|
+
segments: options.map((option, index) => ({
|
|
2537
|
+
id: String(index),
|
|
2538
|
+
value: String(index),
|
|
2539
|
+
label: option.title,
|
|
2540
|
+
controls: `${id}-children`
|
|
2787
2541
|
})),
|
|
2788
|
-
|
|
2542
|
+
onChange: (value) => onSelect(Number(value))
|
|
2789
2543
|
}
|
|
2790
2544
|
)
|
|
2791
2545
|
}
|
|
2792
2546
|
),
|
|
2793
|
-
children
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { id: `${id}-children`, children })
|
|
2794
2548
|
] });
|
|
2795
2549
|
}
|
|
2796
2550
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2797
2551
|
|
|
2798
2552
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2799
|
-
var
|
|
2553
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2800
2554
|
var SelectInputRenderer = {
|
|
2801
2555
|
canRenderType: "input-select",
|
|
2802
2556
|
render: (props) => {
|
|
2803
2557
|
switch (props.control) {
|
|
2804
2558
|
case "radio":
|
|
2805
|
-
return /* @__PURE__ */ (0,
|
|
2559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2806
2560
|
case "tab":
|
|
2807
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2561
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2808
2562
|
case "segmented":
|
|
2809
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2563
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2810
2564
|
case "select":
|
|
2811
2565
|
default:
|
|
2812
|
-
return /* @__PURE__ */ (0,
|
|
2566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2813
2567
|
}
|
|
2814
2568
|
}
|
|
2815
2569
|
};
|
|
2570
|
+
var SelectInputRenderer_default = SelectInputRenderer;
|
|
2816
2571
|
|
|
2817
2572
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2818
|
-
var
|
|
2819
|
-
var
|
|
2573
|
+
var import_components33 = require("@transferwise/components");
|
|
2574
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2820
2575
|
var StatusListRenderer = {
|
|
2821
2576
|
canRenderType: "status-list",
|
|
2822
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
2823
|
-
title ? /* @__PURE__ */ (0,
|
|
2824
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
2825
|
-
|
|
2577
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: getMargin(margin), children: [
|
|
2578
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components33.Header, { title, className: "m-b-2" }) : null,
|
|
2579
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2580
|
+
import_components33.Summary,
|
|
2826
2581
|
{
|
|
2827
2582
|
title: itemTitle,
|
|
2828
2583
|
description,
|
|
2829
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
2584
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
2830
2585
|
status: mapStatus(status),
|
|
2831
2586
|
action: getSummaryAction(callToAction)
|
|
2832
2587
|
},
|
|
@@ -2834,6 +2589,7 @@ var StatusListRenderer = {
|
|
|
2834
2589
|
))
|
|
2835
2590
|
] })
|
|
2836
2591
|
};
|
|
2592
|
+
var StatusListRenderer_default = StatusListRenderer;
|
|
2837
2593
|
var getSummaryAction = (callToAction) => {
|
|
2838
2594
|
if (!callToAction) {
|
|
2839
2595
|
return void 0;
|
|
@@ -2860,64 +2616,423 @@ var mapStatus = (status) => {
|
|
|
2860
2616
|
return status;
|
|
2861
2617
|
};
|
|
2862
2618
|
|
|
2863
|
-
// ../renderers/src/
|
|
2864
|
-
var
|
|
2865
|
-
var import_react12 = require("react");
|
|
2866
|
-
var ThemeRequiredEventName = "Theme Required";
|
|
2867
|
-
var useCustomTheme = (theme, trackEvent) => {
|
|
2868
|
-
const previousThemeHookValue = (0, import_components_theming.useTheme)();
|
|
2869
|
-
const previousTheme = (0, import_react12.useMemo)(() => previousThemeHookValue.theme, []);
|
|
2870
|
-
(0, import_react12.useEffect)(() => {
|
|
2871
|
-
trackEvent(ThemeRequiredEventName, { theme });
|
|
2872
|
-
return theme !== previousTheme ? () => {
|
|
2873
|
-
trackEvent(ThemeRequiredEventName, { theme: previousTheme });
|
|
2874
|
-
} : () => {
|
|
2875
|
-
};
|
|
2876
|
-
}, []);
|
|
2877
|
-
};
|
|
2619
|
+
// ../renderers/src/TextInputRenderer.tsx
|
|
2620
|
+
var import_components35 = require("@transferwise/components");
|
|
2878
2621
|
|
|
2879
|
-
// ../renderers/src/
|
|
2880
|
-
var
|
|
2881
|
-
var
|
|
2882
|
-
var
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2622
|
+
// ../renderers/src/components/VariableTextInput.tsx
|
|
2623
|
+
var import_components34 = require("@transferwise/components");
|
|
2624
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2625
|
+
var commonKeys = [
|
|
2626
|
+
"autoComplete",
|
|
2627
|
+
"autoCapitalize",
|
|
2628
|
+
"placeholder",
|
|
2629
|
+
"control",
|
|
2630
|
+
"disabled",
|
|
2631
|
+
"displayFormat",
|
|
2632
|
+
"id",
|
|
2633
|
+
"onBlur",
|
|
2634
|
+
"onFocus",
|
|
2635
|
+
"placeholder",
|
|
2636
|
+
"value"
|
|
2637
|
+
];
|
|
2638
|
+
function VariableTextInput(inputProps) {
|
|
2639
|
+
const { id, value, control, onChange } = inputProps;
|
|
2640
|
+
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
2641
|
+
switch (control) {
|
|
2642
|
+
case "email":
|
|
2643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
2644
|
+
case "password":
|
|
2645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
2646
|
+
case "numeric": {
|
|
2647
|
+
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
2648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2649
|
+
TextInput,
|
|
2650
|
+
__spreadProps(__spreadValues({}, numericProps), {
|
|
2651
|
+
onChange: (newValue) => {
|
|
2652
|
+
const numericValueOrNull = !Number.isNaN(Number.parseFloat(newValue)) ? newValue : null;
|
|
2653
|
+
onChange(numericValueOrNull);
|
|
2654
|
+
}
|
|
2655
|
+
})
|
|
2656
|
+
);
|
|
2896
2657
|
}
|
|
2897
|
-
|
|
2658
|
+
case "phone-number":
|
|
2659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components34.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
2660
|
+
default: {
|
|
2661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2898
2664
|
}
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
canRenderType: "step",
|
|
2905
|
-
canRender: ({ control }) => control === "splash-celebration",
|
|
2906
|
-
render: SplashCelebrationStepRendererComponent
|
|
2907
|
-
};
|
|
2908
|
-
function SplashCelebrationStepRendererComponent(props) {
|
|
2909
|
-
const { back, children, trackEvent } = props;
|
|
2910
|
-
useCustomTheme("forest-green", trackEvent);
|
|
2911
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
2912
|
-
back ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
2913
|
-
children
|
|
2914
|
-
] });
|
|
2665
|
+
function TextInput(props) {
|
|
2666
|
+
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
2667
|
+
const InputWithPattern = control === "textarea" ? import_components34.TextareaWithDisplayFormat : import_components34.InputWithDisplayFormat;
|
|
2668
|
+
const InputWithoutPattern = control === "textarea" ? import_components34.TextArea : import_components34.Input;
|
|
2669
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
2915
2670
|
}
|
|
2916
2671
|
|
|
2917
|
-
// ../renderers/src/
|
|
2918
|
-
var
|
|
2919
|
-
var
|
|
2920
|
-
canRenderType: "
|
|
2672
|
+
// ../renderers/src/TextInputRenderer.tsx
|
|
2673
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2674
|
+
var TextInputRenderer = {
|
|
2675
|
+
canRenderType: "input-text",
|
|
2676
|
+
render: (props) => {
|
|
2677
|
+
const _a = props, {
|
|
2678
|
+
id,
|
|
2679
|
+
title,
|
|
2680
|
+
description,
|
|
2681
|
+
help,
|
|
2682
|
+
icon,
|
|
2683
|
+
image,
|
|
2684
|
+
validationState,
|
|
2685
|
+
value: initialValue,
|
|
2686
|
+
onChange
|
|
2687
|
+
} = _a, rest = __objRest(_a, [
|
|
2688
|
+
"id",
|
|
2689
|
+
"title",
|
|
2690
|
+
"description",
|
|
2691
|
+
"help",
|
|
2692
|
+
"icon",
|
|
2693
|
+
"image",
|
|
2694
|
+
"validationState",
|
|
2695
|
+
"value",
|
|
2696
|
+
"onChange"
|
|
2697
|
+
]);
|
|
2698
|
+
const value = initialValue != null ? initialValue : "";
|
|
2699
|
+
const inputProps = __spreadProps(__spreadValues({}, rest), {
|
|
2700
|
+
value,
|
|
2701
|
+
id,
|
|
2702
|
+
onChange: (newValue) => {
|
|
2703
|
+
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
2704
|
+
onChange(newValue);
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
});
|
|
2708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2709
|
+
FieldInput_default,
|
|
2710
|
+
{
|
|
2711
|
+
id,
|
|
2712
|
+
label: title,
|
|
2713
|
+
description,
|
|
2714
|
+
validation: validationState,
|
|
2715
|
+
help,
|
|
2716
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
2717
|
+
}
|
|
2718
|
+
);
|
|
2719
|
+
}
|
|
2720
|
+
};
|
|
2721
|
+
var TextInputRenderer_default = TextInputRenderer;
|
|
2722
|
+
|
|
2723
|
+
// ../renderers/src/UploadInputRenderer.tsx
|
|
2724
|
+
var import_components36 = require("@transferwise/components");
|
|
2725
|
+
|
|
2726
|
+
// ../renderers/src/utils/getRandomId.ts
|
|
2727
|
+
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
2728
|
+
|
|
2729
|
+
// ../renderers/src/UploadInputRenderer.tsx
|
|
2730
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2731
|
+
var UploadInputRenderer = {
|
|
2732
|
+
canRenderType: "input-upload",
|
|
2733
|
+
render: (props) => {
|
|
2734
|
+
const { id, accepts, title, description, disabled, maxSize, validationState, onUpload } = props;
|
|
2735
|
+
const onUploadFile = async (formData) => {
|
|
2736
|
+
const file = formData.get("file");
|
|
2737
|
+
return onUpload(file).then(() => ({
|
|
2738
|
+
id: getRandomId()
|
|
2739
|
+
}));
|
|
2740
|
+
};
|
|
2741
|
+
const onDeleteFile = async () => {
|
|
2742
|
+
await onUpload(null);
|
|
2743
|
+
};
|
|
2744
|
+
return (
|
|
2745
|
+
// We don't pass help here as there is no sensible place to display it
|
|
2746
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2747
|
+
UploadFieldInput_default,
|
|
2748
|
+
{
|
|
2749
|
+
id,
|
|
2750
|
+
label: void 0,
|
|
2751
|
+
description: void 0,
|
|
2752
|
+
validation: validationState,
|
|
2753
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2754
|
+
import_components36.UploadInput,
|
|
2755
|
+
{
|
|
2756
|
+
id,
|
|
2757
|
+
description,
|
|
2758
|
+
disabled,
|
|
2759
|
+
fileTypes: getAcceptsString(accepts),
|
|
2760
|
+
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
2761
|
+
uploadButtonTitle: title,
|
|
2762
|
+
onDeleteFile,
|
|
2763
|
+
onUploadFile
|
|
2764
|
+
}
|
|
2765
|
+
)
|
|
2766
|
+
}
|
|
2767
|
+
)
|
|
2768
|
+
);
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
var LargeUploadRenderer = {
|
|
2772
|
+
canRenderType: "input-upload",
|
|
2773
|
+
canRender: (props) => props.control === "upload-large",
|
|
2774
|
+
render: (props) => {
|
|
2775
|
+
const _a = props, {
|
|
2776
|
+
id,
|
|
2777
|
+
accepts,
|
|
2778
|
+
control,
|
|
2779
|
+
title,
|
|
2780
|
+
description,
|
|
2781
|
+
disabled,
|
|
2782
|
+
help,
|
|
2783
|
+
type,
|
|
2784
|
+
validationState,
|
|
2785
|
+
onUpload
|
|
2786
|
+
} = _a, rest = __objRest(_a, [
|
|
2787
|
+
"id",
|
|
2788
|
+
"accepts",
|
|
2789
|
+
"control",
|
|
2790
|
+
"title",
|
|
2791
|
+
"description",
|
|
2792
|
+
"disabled",
|
|
2793
|
+
"help",
|
|
2794
|
+
"type",
|
|
2795
|
+
"validationState",
|
|
2796
|
+
"onUpload"
|
|
2797
|
+
]);
|
|
2798
|
+
const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
|
|
2799
|
+
const onUploadFile = async (file, fileName) => {
|
|
2800
|
+
try {
|
|
2801
|
+
const convertedFile = file ? await toFile(file, fileName) : null;
|
|
2802
|
+
await onUpload(convertedFile);
|
|
2803
|
+
} catch (e) {
|
|
2804
|
+
await onUpload(null);
|
|
2805
|
+
throw e;
|
|
2806
|
+
}
|
|
2807
|
+
};
|
|
2808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2809
|
+
FieldInput_default,
|
|
2810
|
+
{
|
|
2811
|
+
id,
|
|
2812
|
+
label: title,
|
|
2813
|
+
description,
|
|
2814
|
+
validation: validationState,
|
|
2815
|
+
help,
|
|
2816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2817
|
+
import_components36.Upload,
|
|
2818
|
+
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2819
|
+
usAccept: getAcceptsString(accepts),
|
|
2820
|
+
usDisabled: disabled,
|
|
2821
|
+
onSuccess: onUploadFile,
|
|
2822
|
+
onFailure: async () => onUpload(null),
|
|
2823
|
+
onCancel: async () => onUpload(null)
|
|
2824
|
+
})
|
|
2825
|
+
)
|
|
2826
|
+
}
|
|
2827
|
+
);
|
|
2828
|
+
}
|
|
2829
|
+
};
|
|
2830
|
+
|
|
2831
|
+
// ../renderers/src/ReviewRenderer.tsx
|
|
2832
|
+
var import_components37 = require("@transferwise/components");
|
|
2833
|
+
|
|
2834
|
+
// ../renderers/src/utils/getHeaderAction.tsx
|
|
2835
|
+
var getHeaderAction = (callToAction) => {
|
|
2836
|
+
if (!callToAction) {
|
|
2837
|
+
return void 0;
|
|
2838
|
+
}
|
|
2839
|
+
const { accessibilityDescription, href, title, onClick } = callToAction;
|
|
2840
|
+
return href ? {
|
|
2841
|
+
"aria-label": accessibilityDescription,
|
|
2842
|
+
text: title,
|
|
2843
|
+
href,
|
|
2844
|
+
target: "_blank"
|
|
2845
|
+
} : {
|
|
2846
|
+
"aria-label": accessibilityDescription,
|
|
2847
|
+
text: title,
|
|
2848
|
+
onClick: (event) => {
|
|
2849
|
+
event.preventDefault();
|
|
2850
|
+
onClick();
|
|
2851
|
+
}
|
|
2852
|
+
};
|
|
2853
|
+
};
|
|
2854
|
+
|
|
2855
|
+
// ../renderers/src/ReviewRenderer.tsx
|
|
2856
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2857
|
+
var ReviewRenderer = {
|
|
2858
|
+
canRenderType: "review",
|
|
2859
|
+
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2860
|
+
const orientation = mapControlToDefinitionListLayout(control);
|
|
2861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: getMargin(margin), children: [
|
|
2862
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components37.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2864
|
+
import_components37.DefinitionList,
|
|
2865
|
+
{
|
|
2866
|
+
layout: orientation,
|
|
2867
|
+
definitions: fields.map(
|
|
2868
|
+
({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
|
|
2869
|
+
key: String(index),
|
|
2870
|
+
title: label,
|
|
2871
|
+
value: getFieldValue(
|
|
2872
|
+
value,
|
|
2873
|
+
help,
|
|
2874
|
+
orientation,
|
|
2875
|
+
() => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
|
|
2876
|
+
)
|
|
2877
|
+
})
|
|
2878
|
+
)
|
|
2879
|
+
}
|
|
2880
|
+
) })
|
|
2881
|
+
] });
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
var ReviewRenderer_default = ReviewRenderer;
|
|
2885
|
+
var mapControlToDefinitionListLayout = (control) => {
|
|
2886
|
+
switch (control) {
|
|
2887
|
+
case "horizontal":
|
|
2888
|
+
case "horizontal-end-aligned":
|
|
2889
|
+
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
2890
|
+
case "horizontal-start-aligned":
|
|
2891
|
+
return "HORIZONTAL_LEFT_ALIGNED";
|
|
2892
|
+
case "vertical-two-column":
|
|
2893
|
+
return "VERTICAL_TWO_COLUMN";
|
|
2894
|
+
case "vertical":
|
|
2895
|
+
case "vertical-one-column":
|
|
2896
|
+
default:
|
|
2897
|
+
return "VERTICAL_ONE_COLUMN";
|
|
2898
|
+
}
|
|
2899
|
+
};
|
|
2900
|
+
var getFieldValue = (value, help, orientation, onClick) => {
|
|
2901
|
+
if (help) {
|
|
2902
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Help_default, { help, onClick }),
|
|
2904
|
+
" ",
|
|
2905
|
+
value
|
|
2906
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
2907
|
+
value,
|
|
2908
|
+
" ",
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Help_default, { help, onClick })
|
|
2910
|
+
] });
|
|
2911
|
+
}
|
|
2912
|
+
return value;
|
|
2913
|
+
};
|
|
2914
|
+
|
|
2915
|
+
// ../renderers/src/step/StepRenderer.tsx
|
|
2916
|
+
var import_components39 = require("@transferwise/components");
|
|
2917
|
+
|
|
2918
|
+
// ../renderers/src/step/BackButton.tsx
|
|
2919
|
+
var import_components38 = require("@transferwise/components");
|
|
2920
|
+
var import_icons3 = require("@transferwise/icons");
|
|
2921
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2922
|
+
function BackButton({ title, onClick }) {
|
|
2923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
2924
|
+
"button",
|
|
2925
|
+
{
|
|
2926
|
+
type: "button",
|
|
2927
|
+
className: "df-back-btn",
|
|
2928
|
+
title,
|
|
2929
|
+
"aria-label": title,
|
|
2930
|
+
onClick,
|
|
2931
|
+
children: [
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: title }),
|
|
2933
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components38.AvatarView, { interactive: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
2934
|
+
]
|
|
2935
|
+
}
|
|
2936
|
+
) });
|
|
2937
|
+
}
|
|
2938
|
+
var BackButton_default = BackButton;
|
|
2939
|
+
|
|
2940
|
+
// ../renderers/src/step/StepRenderer.tsx
|
|
2941
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2942
|
+
var StepRenderer = {
|
|
2943
|
+
canRenderType: "step",
|
|
2944
|
+
render: StepRendererComponent
|
|
2945
|
+
};
|
|
2946
|
+
function StepRendererComponent(props) {
|
|
2947
|
+
const { back, description, error, title, children } = props;
|
|
2948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
2949
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
2950
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "m-b-4", children: [
|
|
2951
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components39.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2952
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2953
|
+
] }) : void 0,
|
|
2954
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components39.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2955
|
+
children
|
|
2956
|
+
] });
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
// ../renderers/src/ListRenderer.tsx
|
|
2960
|
+
var import_components40 = require("@transferwise/components");
|
|
2961
|
+
var import_classnames6 = __toESM(require("classnames"));
|
|
2962
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2963
|
+
var ListRenderer = {
|
|
2964
|
+
canRenderType: "list",
|
|
2965
|
+
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: getMargin(margin), children: [
|
|
2966
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components40.Header, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
2967
|
+
items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
|
|
2968
|
+
] })
|
|
2969
|
+
};
|
|
2970
|
+
var DesignSystemListItem = ({
|
|
2971
|
+
title,
|
|
2972
|
+
description,
|
|
2973
|
+
supportingValues,
|
|
2974
|
+
icon,
|
|
2975
|
+
image,
|
|
2976
|
+
control,
|
|
2977
|
+
tag
|
|
2978
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2979
|
+
"label",
|
|
2980
|
+
{
|
|
2981
|
+
className: (0, import_classnames6.default)("np-option p-a-2", {
|
|
2982
|
+
"np-option__sm-media": true,
|
|
2983
|
+
"np-option__container-aligned": true
|
|
2984
|
+
}),
|
|
2985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "media", children: [
|
|
2986
|
+
icon || image ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2987
|
+
ListItemMedia,
|
|
2988
|
+
{
|
|
2989
|
+
image,
|
|
2990
|
+
icon,
|
|
2991
|
+
preferAvatar: control === "with-avatar" || tag === "with-avatar"
|
|
2992
|
+
}
|
|
2993
|
+
) }) : null,
|
|
2994
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "media-body", children: [
|
|
2995
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: supportingValues == null ? void 0 : supportingValues.value })
|
|
2998
|
+
] }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components40.Body, { className: "d-block np-option__body", children: description }),
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components40.Body, { className: "d-block np-option__body", children: supportingValues == null ? void 0 : supportingValues.subvalue })
|
|
3002
|
+
] })
|
|
3003
|
+
] })
|
|
3004
|
+
] })
|
|
3005
|
+
},
|
|
3006
|
+
title
|
|
3007
|
+
);
|
|
3008
|
+
var ListItemMedia = ({
|
|
3009
|
+
icon,
|
|
3010
|
+
image,
|
|
3011
|
+
preferAvatar
|
|
3012
|
+
}) => {
|
|
3013
|
+
if (icon) {
|
|
3014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(OptionMedia, { icon, image, preferAvatar }) });
|
|
3015
|
+
}
|
|
3016
|
+
if (image) {
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(OptionMedia, { icon, image, preferAvatar }) });
|
|
3018
|
+
}
|
|
3019
|
+
};
|
|
3020
|
+
var getListAction = (callToAction) => {
|
|
3021
|
+
if (callToAction) {
|
|
3022
|
+
return __spreadValues({
|
|
3023
|
+
"aria-label": callToAction.accessibilityDescription,
|
|
3024
|
+
text: callToAction.title,
|
|
3025
|
+
onClick: callToAction.onClick
|
|
3026
|
+
}, callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
|
|
3027
|
+
}
|
|
3028
|
+
return void 0;
|
|
3029
|
+
};
|
|
3030
|
+
var ListRenderer_default = ListRenderer;
|
|
3031
|
+
|
|
3032
|
+
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3033
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3034
|
+
var SplashStepRenderer = {
|
|
3035
|
+
canRenderType: "step",
|
|
2921
3036
|
canRender: ({ control }) => control === "splash",
|
|
2922
3037
|
render: SplashStepRendererComponent
|
|
2923
3038
|
};
|
|
@@ -2929,57 +3044,175 @@ function SplashStepRendererComponent(props) {
|
|
|
2929
3044
|
] });
|
|
2930
3045
|
}
|
|
2931
3046
|
|
|
2932
|
-
// ../renderers/src/
|
|
2933
|
-
var
|
|
2934
|
-
var
|
|
2935
|
-
var
|
|
2936
|
-
|
|
2937
|
-
|
|
3047
|
+
// ../renderers/src/utils/useCustomTheme.ts
|
|
3048
|
+
var import_components_theming = require("@wise/components-theming");
|
|
3049
|
+
var import_react11 = require("react");
|
|
3050
|
+
var ThemeRequiredEventName = "Theme Required";
|
|
3051
|
+
var useCustomTheme = (theme, trackEvent) => {
|
|
3052
|
+
const previousThemeHookValue = (0, import_components_theming.useTheme)();
|
|
3053
|
+
const previousTheme = (0, import_react11.useMemo)(() => previousThemeHookValue.theme, []);
|
|
3054
|
+
(0, import_react11.useEffect)(() => {
|
|
3055
|
+
trackEvent(ThemeRequiredEventName, { theme });
|
|
3056
|
+
return theme !== previousTheme ? () => {
|
|
3057
|
+
trackEvent(ThemeRequiredEventName, { theme: previousTheme });
|
|
3058
|
+
} : () => {
|
|
3059
|
+
};
|
|
3060
|
+
}, []);
|
|
3061
|
+
};
|
|
3062
|
+
|
|
3063
|
+
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3064
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3065
|
+
var SplashCelebrationStepRenderer = {
|
|
3066
|
+
canRenderType: "step",
|
|
3067
|
+
canRender: ({ control }) => control === "splash-celebration",
|
|
3068
|
+
render: SplashCelebrationStepRendererComponent
|
|
3069
|
+
};
|
|
3070
|
+
function SplashCelebrationStepRendererComponent(props) {
|
|
3071
|
+
const { back, children, trackEvent } = props;
|
|
3072
|
+
useCustomTheme("forest-green", trackEvent);
|
|
3073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3074
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3075
|
+
children
|
|
3076
|
+
] });
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
3080
|
+
var import_components41 = require("@transferwise/components");
|
|
3081
|
+
|
|
3082
|
+
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
3083
|
+
var import_react_intl14 = require("react-intl");
|
|
3084
|
+
var external_confirmation_messages_default = (0, import_react_intl14.defineMessages)({
|
|
3085
|
+
title: {
|
|
3086
|
+
id: "df.wise.ExternalConfirmation.title",
|
|
3087
|
+
defaultMessage: "Please confirm",
|
|
3088
|
+
description: "Heading for the confirmation screen."
|
|
3089
|
+
},
|
|
3090
|
+
description: {
|
|
3091
|
+
id: "df.wise.ExternalConfirmation.description",
|
|
3092
|
+
defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
|
|
3093
|
+
description: "Description for the confirmation screen."
|
|
3094
|
+
},
|
|
3095
|
+
open: {
|
|
3096
|
+
id: "df.wise.ExternalConfirmation.open",
|
|
3097
|
+
defaultMessage: "Open in new tab",
|
|
3098
|
+
description: "Button text confirming opening a new browser tab."
|
|
3099
|
+
},
|
|
3100
|
+
cancel: {
|
|
3101
|
+
id: "df.wise.ExternalConfirmation.cancel",
|
|
3102
|
+
defaultMessage: "Cancel",
|
|
3103
|
+
description: "Button text rejecting opening a new browser tab."
|
|
3104
|
+
}
|
|
3105
|
+
});
|
|
3106
|
+
|
|
3107
|
+
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
3108
|
+
var import_react_intl15 = require("react-intl");
|
|
3109
|
+
var import_react12 = require("react");
|
|
3110
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3111
|
+
var ExternalConfirmationRenderer = {
|
|
3112
|
+
canRenderType: "external-confirmation",
|
|
3113
|
+
render: ExternalConfirmationRendererComponent
|
|
3114
|
+
};
|
|
3115
|
+
function ExternalConfirmationRendererComponent({
|
|
3116
|
+
url,
|
|
3117
|
+
status,
|
|
3118
|
+
onSuccess,
|
|
3119
|
+
onFailure,
|
|
3120
|
+
onCancel
|
|
3121
|
+
}) {
|
|
3122
|
+
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
3123
|
+
(0, import_react12.useEffect)(() => {
|
|
3124
|
+
if (url) {
|
|
3125
|
+
const w = window.open(url, "_blank");
|
|
3126
|
+
if (w) {
|
|
3127
|
+
onSuccess();
|
|
3128
|
+
} else {
|
|
3129
|
+
onFailure();
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
}, []);
|
|
3133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3134
|
+
import_components41.Modal,
|
|
3135
|
+
{
|
|
3136
|
+
open: status === "failure",
|
|
3137
|
+
title: formatMessage(external_confirmation_messages_default.title),
|
|
3138
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components41.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3142
|
+
import_components41.Button,
|
|
3143
|
+
{
|
|
3144
|
+
block: true,
|
|
3145
|
+
className: "m-b-2",
|
|
3146
|
+
priority: "primary",
|
|
3147
|
+
size: "md",
|
|
3148
|
+
onClick: () => {
|
|
3149
|
+
window.open(url);
|
|
3150
|
+
onCancel();
|
|
3151
|
+
},
|
|
3152
|
+
children: formatMessage(external_confirmation_messages_default.open)
|
|
3153
|
+
}
|
|
3154
|
+
),
|
|
3155
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components41.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
3156
|
+
] }) })
|
|
3157
|
+
] }),
|
|
3158
|
+
onClose: onCancel
|
|
3159
|
+
}
|
|
3160
|
+
);
|
|
3161
|
+
}
|
|
3162
|
+
function getOrigin(url) {
|
|
3163
|
+
try {
|
|
3164
|
+
return new URL(url).origin;
|
|
3165
|
+
} catch (e) {
|
|
3166
|
+
return url;
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
3170
|
+
|
|
3171
|
+
// ../renderers/src/SectionRenderer.tsx
|
|
3172
|
+
var import_components42 = require("@transferwise/components");
|
|
3173
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3174
|
+
var SectionRenderer = {
|
|
3175
|
+
canRenderType: "section",
|
|
3176
|
+
render: ({ children, callToAction, margin, title }) => {
|
|
3177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("section", { className: getMargin(margin), children: [
|
|
3178
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components42.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
3179
|
+
children
|
|
3180
|
+
] });
|
|
3181
|
+
}
|
|
2938
3182
|
};
|
|
2939
|
-
|
|
2940
|
-
const { back, description, error, title, children } = props;
|
|
2941
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
2942
|
-
back ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
2943
|
-
title || description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "m-b-4", children: [
|
|
2944
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2945
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2946
|
-
] }) : void 0,
|
|
2947
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2948
|
-
children
|
|
2949
|
-
] });
|
|
2950
|
-
}
|
|
3183
|
+
var SectionRenderer_default = SectionRenderer;
|
|
2951
3184
|
|
|
2952
3185
|
// ../renderers/src/TabsRenderer.tsx
|
|
2953
|
-
var
|
|
3186
|
+
var import_components43 = require("@transferwise/components");
|
|
2954
3187
|
var import_react13 = require("react");
|
|
2955
|
-
var
|
|
3188
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2956
3189
|
var TabsRenderer = {
|
|
2957
3190
|
canRenderType: "tabs",
|
|
2958
3191
|
render: (props) => {
|
|
2959
3192
|
switch (props.control) {
|
|
2960
3193
|
case "segmented":
|
|
2961
3194
|
if (props.tabs.length > 3) {
|
|
2962
|
-
return /* @__PURE__ */ (0,
|
|
3195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
2963
3196
|
}
|
|
2964
|
-
return /* @__PURE__ */ (0,
|
|
3197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
2965
3198
|
case "chips":
|
|
2966
|
-
return /* @__PURE__ */ (0,
|
|
3199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
2967
3200
|
default:
|
|
2968
|
-
return /* @__PURE__ */ (0,
|
|
3201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
2969
3202
|
}
|
|
2970
3203
|
}
|
|
2971
3204
|
};
|
|
2972
3205
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
2973
3206
|
const [selectedIndex, setSelectedIndex] = (0, import_react13.useState)(0);
|
|
2974
|
-
return /* @__PURE__ */ (0,
|
|
2975
|
-
|
|
3207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3208
|
+
import_components43.Tabs,
|
|
2976
3209
|
{
|
|
2977
3210
|
name: uid,
|
|
2978
3211
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
2979
3212
|
tabs: tabs.map((option) => ({
|
|
2980
3213
|
title: option.title,
|
|
2981
3214
|
disabled: false,
|
|
2982
|
-
content: /* @__PURE__ */ (0,
|
|
3215
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "m-t-2", children: [
|
|
2983
3216
|
" ",
|
|
2984
3217
|
option.children,
|
|
2985
3218
|
" "
|
|
@@ -2992,9 +3225,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2992
3225
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
2993
3226
|
var _a;
|
|
2994
3227
|
const [selectedIndex, setSelectedIndex] = (0, import_react13.useState)(0);
|
|
2995
|
-
return /* @__PURE__ */ (0,
|
|
2996
|
-
/* @__PURE__ */ (0,
|
|
2997
|
-
|
|
3228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: getMargin(margin), children: [
|
|
3229
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3230
|
+
import_components43.SegmentedControl,
|
|
2998
3231
|
{
|
|
2999
3232
|
name: uid,
|
|
3000
3233
|
value: String(selectedIndex),
|
|
@@ -3008,281 +3241,79 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3008
3241
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3009
3242
|
}
|
|
3010
3243
|
),
|
|
3011
|
-
/* @__PURE__ */ (0,
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3012
3245
|
] });
|
|
3013
3246
|
}
|
|
3014
3247
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3015
3248
|
var _a;
|
|
3016
3249
|
const [selectedIndex, setSelectedIndex] = (0, import_react13.useState)(0);
|
|
3017
|
-
return /* @__PURE__ */ (0,
|
|
3018
|
-
/* @__PURE__ */ (0,
|
|
3019
|
-
|
|
3250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: getMargin(margin), children: [
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3252
|
+
import_components43.Chips,
|
|
3020
3253
|
{
|
|
3021
3254
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3022
3255
|
selected: selectedIndex,
|
|
3023
3256
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3024
3257
|
}
|
|
3025
3258
|
) }),
|
|
3026
|
-
/* @__PURE__ */ (0,
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3027
3260
|
] });
|
|
3028
3261
|
}
|
|
3029
3262
|
|
|
3030
|
-
// ../renderers/src/TextInputRenderer.tsx
|
|
3031
|
-
var import_components43 = require("@transferwise/components");
|
|
3032
|
-
|
|
3033
|
-
// ../renderers/src/components/VariableTextInput.tsx
|
|
3034
|
-
var import_components42 = require("@transferwise/components");
|
|
3035
|
-
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3036
|
-
var commonKeys = [
|
|
3037
|
-
"autoComplete",
|
|
3038
|
-
"autoCapitalize",
|
|
3039
|
-
"placeholder",
|
|
3040
|
-
"control",
|
|
3041
|
-
"disabled",
|
|
3042
|
-
"displayFormat",
|
|
3043
|
-
"id",
|
|
3044
|
-
"onBlur",
|
|
3045
|
-
"onFocus",
|
|
3046
|
-
"placeholder",
|
|
3047
|
-
"value"
|
|
3048
|
-
];
|
|
3049
|
-
function VariableTextInput(inputProps) {
|
|
3050
|
-
const { id, value, control, onChange } = inputProps;
|
|
3051
|
-
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3052
|
-
switch (control) {
|
|
3053
|
-
case "email":
|
|
3054
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3055
|
-
case "password":
|
|
3056
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3057
|
-
case "numeric": {
|
|
3058
|
-
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3059
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3060
|
-
TextInput,
|
|
3061
|
-
__spreadProps(__spreadValues({}, numericProps), {
|
|
3062
|
-
onChange: (newValue) => {
|
|
3063
|
-
const numericValueOrNull = !Number.isNaN(Number.parseFloat(newValue)) ? newValue : null;
|
|
3064
|
-
onChange(numericValueOrNull);
|
|
3065
|
-
}
|
|
3066
|
-
})
|
|
3067
|
-
);
|
|
3068
|
-
}
|
|
3069
|
-
case "phone-number":
|
|
3070
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components42.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3071
|
-
default: {
|
|
3072
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3073
|
-
}
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
function TextInput(props) {
|
|
3077
|
-
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3078
|
-
const InputWithPattern = control === "textarea" ? import_components42.TextareaWithDisplayFormat : import_components42.InputWithDisplayFormat;
|
|
3079
|
-
const InputWithoutPattern = control === "textarea" ? import_components42.TextArea : import_components42.Input;
|
|
3080
|
-
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3081
|
-
}
|
|
3082
|
-
|
|
3083
|
-
// ../renderers/src/TextInputRenderer.tsx
|
|
3084
|
-
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3085
|
-
var TextInputRenderer = {
|
|
3086
|
-
canRenderType: "input-text",
|
|
3087
|
-
render: (props) => {
|
|
3088
|
-
const _a = props, {
|
|
3089
|
-
id,
|
|
3090
|
-
title,
|
|
3091
|
-
description,
|
|
3092
|
-
help,
|
|
3093
|
-
icon,
|
|
3094
|
-
image,
|
|
3095
|
-
validationState,
|
|
3096
|
-
value: initialValue,
|
|
3097
|
-
onChange
|
|
3098
|
-
} = _a, rest = __objRest(_a, [
|
|
3099
|
-
"id",
|
|
3100
|
-
"title",
|
|
3101
|
-
"description",
|
|
3102
|
-
"help",
|
|
3103
|
-
"icon",
|
|
3104
|
-
"image",
|
|
3105
|
-
"validationState",
|
|
3106
|
-
"value",
|
|
3107
|
-
"onChange"
|
|
3108
|
-
]);
|
|
3109
|
-
const value = initialValue != null ? initialValue : "";
|
|
3110
|
-
const inputProps = __spreadProps(__spreadValues({}, rest), {
|
|
3111
|
-
value,
|
|
3112
|
-
id,
|
|
3113
|
-
onChange: (newValue) => {
|
|
3114
|
-
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
3115
|
-
onChange(newValue);
|
|
3116
|
-
}
|
|
3117
|
-
}
|
|
3118
|
-
});
|
|
3119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3120
|
-
FieldInput_default,
|
|
3121
|
-
{
|
|
3122
|
-
id,
|
|
3123
|
-
label: title,
|
|
3124
|
-
description,
|
|
3125
|
-
validation: validationState,
|
|
3126
|
-
help,
|
|
3127
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components43.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3128
|
-
}
|
|
3129
|
-
);
|
|
3130
|
-
}
|
|
3131
|
-
};
|
|
3132
|
-
|
|
3133
|
-
// ../renderers/src/UploadInputRenderer.tsx
|
|
3134
|
-
var import_components44 = require("@transferwise/components");
|
|
3135
|
-
|
|
3136
|
-
// ../renderers/src/utils/getRandomId.ts
|
|
3137
|
-
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3138
|
-
|
|
3139
|
-
// ../renderers/src/UploadInputRenderer.tsx
|
|
3140
|
-
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3141
|
-
var UploadInputRenderer = {
|
|
3142
|
-
canRenderType: "input-upload",
|
|
3143
|
-
render: (props) => {
|
|
3144
|
-
const { id, accepts, title, description, disabled, maxSize, validationState, onUpload } = props;
|
|
3145
|
-
const onUploadFile = async (formData) => {
|
|
3146
|
-
const file = formData.get("file");
|
|
3147
|
-
return onUpload(file).then(() => ({
|
|
3148
|
-
id: getRandomId()
|
|
3149
|
-
}));
|
|
3150
|
-
};
|
|
3151
|
-
const onDeleteFile = async () => {
|
|
3152
|
-
await onUpload(null);
|
|
3153
|
-
};
|
|
3154
|
-
return (
|
|
3155
|
-
// We don't pass help here as there is no sensible place to display it
|
|
3156
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3157
|
-
UploadFieldInput_default,
|
|
3158
|
-
{
|
|
3159
|
-
id,
|
|
3160
|
-
label: void 0,
|
|
3161
|
-
description: void 0,
|
|
3162
|
-
validation: validationState,
|
|
3163
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3164
|
-
import_components44.UploadInput,
|
|
3165
|
-
{
|
|
3166
|
-
id,
|
|
3167
|
-
description,
|
|
3168
|
-
disabled,
|
|
3169
|
-
fileTypes: getAcceptsString(accepts),
|
|
3170
|
-
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
3171
|
-
uploadButtonTitle: title,
|
|
3172
|
-
onDeleteFile,
|
|
3173
|
-
onUploadFile
|
|
3174
|
-
}
|
|
3175
|
-
)
|
|
3176
|
-
}
|
|
3177
|
-
)
|
|
3178
|
-
);
|
|
3179
|
-
}
|
|
3180
|
-
};
|
|
3181
|
-
var LargeUploadRenderer = {
|
|
3182
|
-
canRenderType: "input-upload",
|
|
3183
|
-
canRender: (props) => props.control === "upload-large",
|
|
3184
|
-
render: (props) => {
|
|
3185
|
-
const _a = props, {
|
|
3186
|
-
id,
|
|
3187
|
-
accepts,
|
|
3188
|
-
control,
|
|
3189
|
-
title,
|
|
3190
|
-
description,
|
|
3191
|
-
disabled,
|
|
3192
|
-
help,
|
|
3193
|
-
type,
|
|
3194
|
-
validationState,
|
|
3195
|
-
onUpload
|
|
3196
|
-
} = _a, rest = __objRest(_a, [
|
|
3197
|
-
"id",
|
|
3198
|
-
"accepts",
|
|
3199
|
-
"control",
|
|
3200
|
-
"title",
|
|
3201
|
-
"description",
|
|
3202
|
-
"disabled",
|
|
3203
|
-
"help",
|
|
3204
|
-
"type",
|
|
3205
|
-
"validationState",
|
|
3206
|
-
"onUpload"
|
|
3207
|
-
]);
|
|
3208
|
-
const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
|
|
3209
|
-
const onUploadFile = async (file, fileName) => {
|
|
3210
|
-
try {
|
|
3211
|
-
const convertedFile = file ? await toFile(file, fileName) : null;
|
|
3212
|
-
await onUpload(convertedFile);
|
|
3213
|
-
} catch (e) {
|
|
3214
|
-
await onUpload(null);
|
|
3215
|
-
throw e;
|
|
3216
|
-
}
|
|
3217
|
-
};
|
|
3218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3219
|
-
FieldInput_default,
|
|
3220
|
-
{
|
|
3221
|
-
id,
|
|
3222
|
-
label: title,
|
|
3223
|
-
description,
|
|
3224
|
-
validation: validationState,
|
|
3225
|
-
help,
|
|
3226
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3227
|
-
import_components44.Upload,
|
|
3228
|
-
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3229
|
-
usAccept: getAcceptsString(accepts),
|
|
3230
|
-
usDisabled: disabled,
|
|
3231
|
-
onSuccess: onUploadFile,
|
|
3232
|
-
onFailure: async () => onUpload(null),
|
|
3233
|
-
onCancel: async () => onUpload(null)
|
|
3234
|
-
})
|
|
3235
|
-
)
|
|
3236
|
-
}
|
|
3237
|
-
);
|
|
3238
|
-
}
|
|
3239
|
-
};
|
|
3240
|
-
|
|
3241
3263
|
// ../renderers/src/getWiseRenderers.ts
|
|
3242
3264
|
var getWiseRenderers = () => [
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3265
|
+
AlertRenderer_default,
|
|
3266
|
+
CheckboxInputRenderer_default,
|
|
3267
|
+
BoxRenderer_default,
|
|
3268
|
+
ButtonRenderer_default,
|
|
3269
|
+
ColumnsRenderer_default,
|
|
3270
|
+
DateInputRenderer_default,
|
|
3271
|
+
DecisionRenderer_default,
|
|
3272
|
+
DividerRenderer_default,
|
|
3273
|
+
ExternalConfirmationRenderer_default,
|
|
3274
|
+
FormRenderer_default,
|
|
3275
|
+
FormSectionRenderer_default,
|
|
3276
|
+
HeadingRenderer_default,
|
|
3277
|
+
ImageRenderer_default,
|
|
3278
|
+
InstructionsRenderer_default,
|
|
3279
|
+
IntegerInputRenderer_default,
|
|
3258
3280
|
LargeUploadRenderer,
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
StatusListRenderer,
|
|
3281
|
+
ListRenderer_default,
|
|
3282
|
+
LoadingIndicatorRenderer_default,
|
|
3283
|
+
MarkdownRenderer_default,
|
|
3284
|
+
ModalRenderer_default,
|
|
3285
|
+
MultiSelectInputRenderer_default,
|
|
3286
|
+
MultiUploadInputRenderer_default,
|
|
3287
|
+
NumberInputRenderer_default,
|
|
3288
|
+
ParagraphRenderer_default,
|
|
3289
|
+
RepeatableRenderer_default,
|
|
3290
|
+
ReviewRenderer_default,
|
|
3291
|
+
SearchRenderer_default,
|
|
3292
|
+
SelectInputRenderer_default,
|
|
3293
|
+
SectionRenderer_default,
|
|
3294
|
+
StatusListRenderer_default,
|
|
3274
3295
|
TabsRenderer,
|
|
3275
|
-
|
|
3296
|
+
TextInputRenderer_default,
|
|
3276
3297
|
UploadInputRenderer,
|
|
3277
3298
|
SplashStepRenderer,
|
|
3278
3299
|
SplashCelebrationStepRenderer,
|
|
3279
3300
|
StepRenderer
|
|
3280
3301
|
];
|
|
3281
3302
|
|
|
3303
|
+
// ../renderers/src/ModalContentRenderer.tsx
|
|
3304
|
+
var import_components44 = require("@transferwise/components");
|
|
3305
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3306
|
+
var ModalContentRenderer = {
|
|
3307
|
+
canRenderType: "modal-content",
|
|
3308
|
+
render: ({ title, children, open, onClose }) => {
|
|
3309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components44.Modal, { open, title, body: children, onClose });
|
|
3310
|
+
}
|
|
3311
|
+
};
|
|
3312
|
+
|
|
3282
3313
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3283
3314
|
var appVersion = (
|
|
3284
3315
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3285
|
-
typeof process !== "undefined" ? "4.
|
|
3316
|
+
typeof process !== "undefined" ? "4.16.0" : "0.0.0"
|
|
3286
3317
|
);
|
|
3287
3318
|
|
|
3288
3319
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -3341,7 +3372,10 @@ function DynamicFlowRevamp(props) {
|
|
|
3341
3372
|
onThemeChange
|
|
3342
3373
|
} = props;
|
|
3343
3374
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3344
|
-
const mergedRenderers = (0, import_react14.useMemo)(
|
|
3375
|
+
const mergedRenderers = (0, import_react14.useMemo)(
|
|
3376
|
+
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3377
|
+
[renderers]
|
|
3378
|
+
);
|
|
3345
3379
|
const logEvent = (0, import_react14.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3346
3380
|
const trackEvent = (0, import_react14.useMemo)(
|
|
3347
3381
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
@@ -3368,7 +3402,10 @@ var DynamicForm = (0, import_react14.forwardRef)(function DynamicForm2(props, re
|
|
|
3368
3402
|
onThemeChange
|
|
3369
3403
|
} = props;
|
|
3370
3404
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3371
|
-
const mergedRenderers = (0, import_react14.useMemo)(
|
|
3405
|
+
const mergedRenderers = (0, import_react14.useMemo)(
|
|
3406
|
+
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3407
|
+
[renderers]
|
|
3408
|
+
);
|
|
3372
3409
|
const logEvent = (0, import_react14.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3373
3410
|
const trackEvent = (0, import_react14.useMemo)(
|
|
3374
3411
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|