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