@wise/dynamic-flow-client-internal 3.27.6 → 3.27.7
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 +304 -316
- package/build/main.min.js +1 -1
- package/build/main.mjs +251 -263
- package/build/types/dynamicFlow/DynamicFlow.d.ts +1 -1
- package/package.json +3 -3
package/build/main.js
CHANGED
|
@@ -144,13 +144,13 @@ var init_clsx = __esm({
|
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
// ../../node_modules/.pnpm/@wise+art@2.17.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.16_react-dom@18.3.1_reac_4hsljgguo7de2wpoipdhgf4kzi/node_modules/@wise/art/dist/index-213daaa3.esm.js
|
|
147
|
-
var
|
|
147
|
+
var import_react2, import_jsx_runtime11, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
148
148
|
var init_index_213daaa3_esm = __esm({
|
|
149
149
|
"../../node_modules/.pnpm/@wise+art@2.17.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.16_react-dom@18.3.1_reac_4hsljgguo7de2wpoipdhgf4kzi/node_modules/@wise/art/dist/index-213daaa3.esm.js"() {
|
|
150
150
|
"use strict";
|
|
151
151
|
init_clsx();
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
import_react2 = require("react");
|
|
153
|
+
import_jsx_runtime11 = require("react/jsx-runtime");
|
|
154
154
|
unknownFlagName = "wise";
|
|
155
155
|
Flag = ({
|
|
156
156
|
code,
|
|
@@ -158,13 +158,13 @@ var init_index_213daaa3_esm = __esm({
|
|
|
158
158
|
className = void 0,
|
|
159
159
|
loading = "lazy"
|
|
160
160
|
}) => {
|
|
161
|
-
const [fallback, setFallback] = (0,
|
|
162
|
-
(0,
|
|
161
|
+
const [fallback, setFallback] = (0, import_react2.useState)(null);
|
|
162
|
+
(0, import_react2.useEffect)(() => {
|
|
163
163
|
setFallback(null);
|
|
164
164
|
}, [code]);
|
|
165
165
|
const detailed = intrinsicSize >= 150;
|
|
166
166
|
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
167
|
-
return /* @__PURE__ */ (0,
|
|
167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", {
|
|
168
168
|
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
169
169
|
src: false ? `${name}.svg` : `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
170
170
|
loading,
|
|
@@ -880,20 +880,26 @@ var translations = languages.reduce(
|
|
|
880
880
|
var i18n_default = translations;
|
|
881
881
|
|
|
882
882
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
883
|
-
var
|
|
883
|
+
var import_react14 = require("react");
|
|
884
884
|
var import_react_intl16 = require("react-intl");
|
|
885
885
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
886
886
|
|
|
887
|
-
// ../renderers/src/contexts/
|
|
887
|
+
// ../renderers/src/contexts/RendererContext.tsx
|
|
888
888
|
var import_react = require("react");
|
|
889
|
-
var
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}
|
|
889
|
+
var RendererContext = (0, import_react.createContext)({ loadingState: "idle", httpClient: fetch, trackEvent: () => {
|
|
890
|
+
} });
|
|
891
|
+
var RendererContextProvider = RendererContext.Provider;
|
|
892
|
+
var useLoadingContext = () => {
|
|
893
|
+
const { loadingState } = (0, import_react.useContext)(RendererContext);
|
|
894
|
+
return { loadingState, isLoading: loadingState !== "idle" };
|
|
895
|
+
};
|
|
896
|
+
var useTrackEvent = () => {
|
|
897
|
+
const { trackEvent } = (0, import_react.useContext)(RendererContext);
|
|
898
|
+
return trackEvent;
|
|
899
|
+
};
|
|
894
900
|
var useRendererHttpClient = () => {
|
|
895
|
-
const
|
|
896
|
-
return
|
|
901
|
+
const { httpClient } = (0, import_react.useContext)(RendererContext);
|
|
902
|
+
return httpClient;
|
|
897
903
|
};
|
|
898
904
|
|
|
899
905
|
// ../renderers/src/AlertRenderer.tsx
|
|
@@ -930,10 +936,10 @@ var getTextAlignment = (align) => {
|
|
|
930
936
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
931
937
|
|
|
932
938
|
// ../renderers/src/AlertRenderer.tsx
|
|
933
|
-
var
|
|
939
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
934
940
|
var AlertRenderer = {
|
|
935
941
|
canRenderType: "alert",
|
|
936
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0,
|
|
942
|
+
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
937
943
|
import_components.Alert,
|
|
938
944
|
{
|
|
939
945
|
type: context,
|
|
@@ -987,14 +993,14 @@ var help_messages_default = (0, import_react_intl.defineMessages)({
|
|
|
987
993
|
});
|
|
988
994
|
|
|
989
995
|
// ../renderers/src/components/Help.tsx
|
|
990
|
-
var
|
|
996
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
991
997
|
function Help({ help }) {
|
|
992
998
|
const intl = (0, import_react_intl2.useIntl)();
|
|
993
|
-
return /* @__PURE__ */ (0,
|
|
999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
994
1000
|
import_components2.Info,
|
|
995
1001
|
{
|
|
996
1002
|
className: "m-l-1",
|
|
997
|
-
content: /* @__PURE__ */ (0,
|
|
1003
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
998
1004
|
presentation: "POPOVER",
|
|
999
1005
|
size: "sm",
|
|
1000
1006
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -1004,19 +1010,19 @@ function Help({ help }) {
|
|
|
1004
1010
|
var Help_default = Help;
|
|
1005
1011
|
|
|
1006
1012
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
1007
|
-
var
|
|
1013
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1008
1014
|
function LabelContentWithHelp({ text, help }) {
|
|
1009
|
-
return /* @__PURE__ */ (0,
|
|
1015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
1010
1016
|
text,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Help_default, { help })
|
|
1012
1018
|
] });
|
|
1013
1019
|
}
|
|
1014
1020
|
|
|
1015
1021
|
// ../renderers/src/components/FieldInput.tsx
|
|
1016
|
-
var
|
|
1022
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1017
1023
|
function FieldInput({ id, children, label, validation, description, help }) {
|
|
1018
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1019
|
-
return /* @__PURE__ */ (0,
|
|
1024
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1020
1026
|
import_components3.Field,
|
|
1021
1027
|
{
|
|
1022
1028
|
id,
|
|
@@ -1041,7 +1047,7 @@ var FieldInput_default = FieldInput;
|
|
|
1041
1047
|
|
|
1042
1048
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
1043
1049
|
var import_components4 = require("@transferwise/components");
|
|
1044
|
-
var
|
|
1050
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1045
1051
|
var BooleanInputRenderer = {
|
|
1046
1052
|
canRenderType: "input-boolean",
|
|
1047
1053
|
render: (props) => {
|
|
@@ -1065,20 +1071,20 @@ var BooleanInputRenderer = {
|
|
|
1065
1071
|
"value"
|
|
1066
1072
|
]);
|
|
1067
1073
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
1068
|
-
return /* @__PURE__ */ (0,
|
|
1074
|
+
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)) });
|
|
1069
1075
|
}
|
|
1070
1076
|
};
|
|
1071
1077
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
1072
1078
|
|
|
1073
1079
|
// ../renderers/src/BoxRenderer.tsx
|
|
1074
1080
|
var import_classnames = __toESM(require_classnames());
|
|
1075
|
-
var
|
|
1081
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1076
1082
|
var BoxRenderer = {
|
|
1077
1083
|
canRenderType: "box",
|
|
1078
1084
|
render: ({ border, children, control, margin, width }) => {
|
|
1079
1085
|
const hasFixedWidth = width !== "xl";
|
|
1080
1086
|
const hasBorder = control === "bordered" || control === "bordered-web" || border;
|
|
1081
|
-
const contents = /* @__PURE__ */ (0,
|
|
1087
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1082
1088
|
"div",
|
|
1083
1089
|
{
|
|
1084
1090
|
className: (0, import_classnames.default)({
|
|
@@ -1089,30 +1095,14 @@ var BoxRenderer = {
|
|
|
1089
1095
|
children
|
|
1090
1096
|
}
|
|
1091
1097
|
);
|
|
1092
|
-
return hasFixedWidth ? /* @__PURE__ */ (0,
|
|
1098
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
1093
1099
|
}
|
|
1094
1100
|
};
|
|
1095
1101
|
var BoxRenderer_default = BoxRenderer;
|
|
1096
1102
|
|
|
1097
1103
|
// ../renderers/src/ButtonRenderer.tsx
|
|
1098
1104
|
var import_components5 = require("@transferwise/components");
|
|
1099
|
-
|
|
1100
|
-
// ../renderers/src/step/StepRendererContext.tsx
|
|
1101
|
-
var import_react2 = require("react");
|
|
1102
|
-
var StepRendererContext = (0, import_react2.createContext)({ loadingState: "idle", trackEvent: () => {
|
|
1103
|
-
} });
|
|
1104
|
-
var StepRendererContextProvider = StepRendererContext.Provider;
|
|
1105
|
-
var useLoadingContext = () => {
|
|
1106
|
-
const { loadingState } = (0, import_react2.useContext)(StepRendererContext);
|
|
1107
|
-
return { loadingState, isLoading: loadingState !== "idle" };
|
|
1108
|
-
};
|
|
1109
|
-
var useTrackEvent = () => {
|
|
1110
|
-
const { trackEvent } = (0, import_react2.useContext)(StepRendererContext);
|
|
1111
|
-
return trackEvent;
|
|
1112
|
-
};
|
|
1113
|
-
|
|
1114
|
-
// ../renderers/src/ButtonRenderer.tsx
|
|
1115
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1105
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1116
1106
|
var ButtonRenderer = {
|
|
1117
1107
|
canRenderType: "button",
|
|
1118
1108
|
render: ButtonRendererComponent
|
|
@@ -1130,7 +1120,7 @@ function ButtonRendererComponent({
|
|
|
1130
1120
|
const priority = mapControl(control);
|
|
1131
1121
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
1132
1122
|
const { isLoading } = useLoadingContext();
|
|
1133
|
-
return /* @__PURE__ */ (0,
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1134
1124
|
import_components5.Button,
|
|
1135
1125
|
{
|
|
1136
1126
|
block: true,
|
|
@@ -1184,10 +1174,10 @@ var ButtonRenderer_default = ButtonRenderer;
|
|
|
1184
1174
|
|
|
1185
1175
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1186
1176
|
var import_classnames2 = __toESM(require_classnames());
|
|
1187
|
-
var
|
|
1177
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1188
1178
|
var ColumnsRenderer = {
|
|
1189
1179
|
canRenderType: "columns",
|
|
1190
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0,
|
|
1180
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1191
1181
|
"div",
|
|
1192
1182
|
{
|
|
1193
1183
|
className: (0, import_classnames2.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -1195,8 +1185,8 @@ var ColumnsRenderer = {
|
|
|
1195
1185
|
"df-columns-renderer-bias-end": bias === "end"
|
|
1196
1186
|
}),
|
|
1197
1187
|
children: [
|
|
1198
|
-
/* @__PURE__ */ (0,
|
|
1199
|
-
/* @__PURE__ */ (0,
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
1189
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
1200
1190
|
]
|
|
1201
1191
|
}
|
|
1202
1192
|
)
|
|
@@ -1235,7 +1225,7 @@ var dateToDateString = (date) => {
|
|
|
1235
1225
|
};
|
|
1236
1226
|
|
|
1237
1227
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1238
|
-
var
|
|
1228
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1239
1229
|
function VariableDateInput({
|
|
1240
1230
|
control,
|
|
1241
1231
|
inputProps
|
|
@@ -1251,7 +1241,7 @@ function VariableDateInput({
|
|
|
1251
1241
|
onFocus
|
|
1252
1242
|
} = inputProps;
|
|
1253
1243
|
if (control === "date-lookup") {
|
|
1254
|
-
return /* @__PURE__ */ (0,
|
|
1244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1255
1245
|
import_components6.DateLookup,
|
|
1256
1246
|
{
|
|
1257
1247
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -1267,7 +1257,7 @@ function VariableDateInput({
|
|
|
1267
1257
|
}
|
|
1268
1258
|
);
|
|
1269
1259
|
}
|
|
1270
|
-
return /* @__PURE__ */ (0,
|
|
1260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1271
1261
|
import_components6.DateInput,
|
|
1272
1262
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1273
1263
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -1284,7 +1274,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1284
1274
|
var VariableDateInput_default = VariableDateInput;
|
|
1285
1275
|
|
|
1286
1276
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1287
|
-
var
|
|
1277
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1288
1278
|
var DateInputRenderer = {
|
|
1289
1279
|
canRenderType: "input-date",
|
|
1290
1280
|
render: (props) => {
|
|
@@ -1309,7 +1299,7 @@ var DateInputRenderer = {
|
|
|
1309
1299
|
]);
|
|
1310
1300
|
const value = initialValue != null ? initialValue : "";
|
|
1311
1301
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1312
|
-
return /* @__PURE__ */ (0,
|
|
1302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1313
1303
|
FieldInput_default,
|
|
1314
1304
|
{
|
|
1315
1305
|
id,
|
|
@@ -1317,7 +1307,7 @@ var DateInputRenderer = {
|
|
|
1317
1307
|
description,
|
|
1318
1308
|
validation: validationState,
|
|
1319
1309
|
help,
|
|
1320
|
-
children: /* @__PURE__ */ (0,
|
|
1310
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(VariableDateInput_default, { control, inputProps })
|
|
1321
1311
|
}
|
|
1322
1312
|
);
|
|
1323
1313
|
}
|
|
@@ -1330,23 +1320,23 @@ var import_components8 = require("@transferwise/components");
|
|
|
1330
1320
|
// ../../node_modules/.pnpm/@wise+art@2.17.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.16_react-dom@18.3.1_reac_4hsljgguo7de2wpoipdhgf4kzi/node_modules/@wise/art/dist/index.esm.js
|
|
1331
1321
|
init_index_213daaa3_esm();
|
|
1332
1322
|
init_clsx();
|
|
1333
|
-
var
|
|
1334
|
-
var
|
|
1323
|
+
var import_react3 = require("react");
|
|
1324
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1335
1325
|
|
|
1336
1326
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1337
|
-
var
|
|
1327
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1338
1328
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1339
1329
|
function FlagIcon({ name }) {
|
|
1340
1330
|
if (!isFlagIcon(name)) {
|
|
1341
1331
|
return null;
|
|
1342
1332
|
}
|
|
1343
1333
|
const code = name.substring(5);
|
|
1344
|
-
return /* @__PURE__ */ (0,
|
|
1334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Flag, { code });
|
|
1345
1335
|
}
|
|
1346
1336
|
|
|
1347
1337
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
1348
1338
|
var icons = __toESM(require("@transferwise/icons"));
|
|
1349
|
-
var
|
|
1339
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1350
1340
|
var isNamedIcon = (name) => {
|
|
1351
1341
|
const iconName = toCapitalisedCamelCase(name);
|
|
1352
1342
|
return Object.keys(icons).includes(iconName);
|
|
@@ -1357,19 +1347,19 @@ function NamedIcon({ name }) {
|
|
|
1357
1347
|
}
|
|
1358
1348
|
const iconName = toCapitalisedCamelCase(name);
|
|
1359
1349
|
const Icon = icons[iconName];
|
|
1360
|
-
return /* @__PURE__ */ (0,
|
|
1350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { size: 24 });
|
|
1361
1351
|
}
|
|
1362
1352
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
1363
1353
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
1364
1354
|
|
|
1365
1355
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
1366
|
-
var
|
|
1356
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1367
1357
|
function DynamicIcon({ name }) {
|
|
1368
1358
|
if (isFlagIcon(name)) {
|
|
1369
|
-
return /* @__PURE__ */ (0,
|
|
1359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FlagIcon, { name });
|
|
1370
1360
|
}
|
|
1371
1361
|
if (isNamedIcon(name)) {
|
|
1372
|
-
return /* @__PURE__ */ (0,
|
|
1362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NamedIcon, { name });
|
|
1373
1363
|
}
|
|
1374
1364
|
return null;
|
|
1375
1365
|
}
|
|
@@ -1377,25 +1367,25 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
1377
1367
|
|
|
1378
1368
|
// ../renderers/src/components/icon/NavigationOptionMedia.tsx
|
|
1379
1369
|
var import_components7 = require("@transferwise/components");
|
|
1380
|
-
var
|
|
1370
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1381
1371
|
function NavigationOptionMedia({ icon, image }) {
|
|
1382
1372
|
if (!isNullish(icon)) {
|
|
1383
1373
|
if ("name" in icon) {
|
|
1384
|
-
return /* @__PURE__ */ (0,
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1385
1375
|
}
|
|
1386
1376
|
if (icon.text) {
|
|
1387
|
-
return /* @__PURE__ */ (0,
|
|
1377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.INITIALS, children: icon.text });
|
|
1388
1378
|
}
|
|
1389
1379
|
}
|
|
1390
1380
|
if (image == null ? void 0 : image.url) {
|
|
1391
1381
|
const { url, accessibilityDescription } = image;
|
|
1392
|
-
return /* @__PURE__ */ (0,
|
|
1382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: url, alt: accessibilityDescription });
|
|
1393
1383
|
}
|
|
1394
1384
|
return null;
|
|
1395
1385
|
}
|
|
1396
1386
|
|
|
1397
1387
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1398
|
-
var
|
|
1388
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1399
1389
|
var DecisionRenderer = {
|
|
1400
1390
|
canRenderType: "decision",
|
|
1401
1391
|
render: DecisionRendererComponent
|
|
@@ -1403,15 +1393,15 @@ var DecisionRenderer = {
|
|
|
1403
1393
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1404
1394
|
function DecisionRendererComponent({ margin, options, title }) {
|
|
1405
1395
|
const { isLoading } = useLoadingContext();
|
|
1406
|
-
return /* @__PURE__ */ (0,
|
|
1407
|
-
title && /* @__PURE__ */ (0,
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: getMargin(margin), children: [
|
|
1397
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components8.Header, { as: "h2", title }),
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components8.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: title2, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1409
1399
|
import_components8.NavigationOption,
|
|
1410
1400
|
{
|
|
1411
1401
|
title: title2,
|
|
1412
1402
|
content: description,
|
|
1413
1403
|
disabled: isLoading || disabled,
|
|
1414
|
-
media: /* @__PURE__ */ (0,
|
|
1404
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NavigationOptionMedia, { icon, image }),
|
|
1415
1405
|
showMediaCircle: false,
|
|
1416
1406
|
showMediaAtAllSizes: true,
|
|
1417
1407
|
onClick
|
|
@@ -1422,36 +1412,36 @@ function DecisionRendererComponent({ margin, options, title }) {
|
|
|
1422
1412
|
}
|
|
1423
1413
|
|
|
1424
1414
|
// ../renderers/src/DividerRenderer.tsx
|
|
1425
|
-
var
|
|
1415
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1426
1416
|
var DividerRenderer = {
|
|
1427
1417
|
canRenderType: "divider",
|
|
1428
|
-
render: ({ margin }) => /* @__PURE__ */ (0,
|
|
1418
|
+
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1429
1419
|
};
|
|
1430
1420
|
var DividerRenderer_default = DividerRenderer;
|
|
1431
1421
|
|
|
1432
1422
|
// ../renderers/src/FormRenderer.tsx
|
|
1433
|
-
var
|
|
1423
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1434
1424
|
var FormRenderer = {
|
|
1435
1425
|
canRenderType: "form",
|
|
1436
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1426
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getMargin(margin), children })
|
|
1437
1427
|
};
|
|
1438
1428
|
var FormRenderer_default = FormRenderer;
|
|
1439
1429
|
|
|
1440
1430
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1441
1431
|
var import_components9 = require("@transferwise/components");
|
|
1442
|
-
var
|
|
1432
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1443
1433
|
var FormSectionRenderer = {
|
|
1444
1434
|
canRenderType: "form-section",
|
|
1445
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1435
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("fieldset", { children: [
|
|
1446
1436
|
title && // TODO - once section headers support help, we could show help in here
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1448
1438
|
import_components9.Header,
|
|
1449
1439
|
{
|
|
1450
1440
|
as: "h2",
|
|
1451
1441
|
title
|
|
1452
1442
|
}
|
|
1453
1443
|
),
|
|
1454
|
-
description && /* @__PURE__ */ (0,
|
|
1444
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: description }),
|
|
1455
1445
|
children
|
|
1456
1446
|
] })
|
|
1457
1447
|
};
|
|
@@ -1459,32 +1449,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1459
1449
|
|
|
1460
1450
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1461
1451
|
var import_components10 = require("@transferwise/components");
|
|
1462
|
-
var
|
|
1452
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1463
1453
|
var HeadingRenderer = {
|
|
1464
1454
|
canRenderType: "heading",
|
|
1465
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1455
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, __spreadValues({}, props))
|
|
1466
1456
|
};
|
|
1467
1457
|
function Heading(props) {
|
|
1468
1458
|
const { text, size: size2, align, margin, control } = props;
|
|
1469
1459
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1470
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1460
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StandardHeading, { size: size2, text, className });
|
|
1471
1461
|
}
|
|
1472
1462
|
function DisplayHeading({ size: size2, text, className }) {
|
|
1473
|
-
return /* @__PURE__ */ (0,
|
|
1463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components10.Display, { type: getDisplayType(size2), className, children: text });
|
|
1474
1464
|
}
|
|
1475
1465
|
function StandardHeading({ size: size2, text, className }) {
|
|
1476
1466
|
switch (size2) {
|
|
1477
1467
|
case "xs":
|
|
1478
|
-
return /* @__PURE__ */ (0,
|
|
1468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h5", { className, children: text });
|
|
1479
1469
|
case "sm":
|
|
1480
|
-
return /* @__PURE__ */ (0,
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className, children: text });
|
|
1481
1471
|
case "lg":
|
|
1482
|
-
return /* @__PURE__ */ (0,
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className, children: text });
|
|
1483
1473
|
case "xl":
|
|
1484
|
-
return /* @__PURE__ */ (0,
|
|
1474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { className, children: text });
|
|
1485
1475
|
case "md":
|
|
1486
1476
|
default:
|
|
1487
|
-
return /* @__PURE__ */ (0,
|
|
1477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { className, children: text });
|
|
1488
1478
|
}
|
|
1489
1479
|
}
|
|
1490
1480
|
var getDisplayType = (size2) => {
|
|
@@ -1504,7 +1494,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1504
1494
|
|
|
1505
1495
|
// ../renderers/src/ImageRenderer.tsx
|
|
1506
1496
|
var import_components11 = require("@transferwise/components");
|
|
1507
|
-
var
|
|
1497
|
+
var import_react4 = require("react");
|
|
1508
1498
|
|
|
1509
1499
|
// ../renderers/src/utils/api-utils.ts
|
|
1510
1500
|
function isRelativePath(url = "") {
|
|
@@ -1514,10 +1504,10 @@ function isRelativePath(url = "") {
|
|
|
1514
1504
|
}
|
|
1515
1505
|
|
|
1516
1506
|
// ../renderers/src/ImageRenderer.tsx
|
|
1517
|
-
var
|
|
1507
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1518
1508
|
var ImageRenderer = {
|
|
1519
1509
|
canRenderType: "image",
|
|
1520
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1510
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ImageRendererComponent, __spreadValues({}, props))
|
|
1521
1511
|
};
|
|
1522
1512
|
var ImageRenderer_default = ImageRenderer;
|
|
1523
1513
|
function ImageRendererComponent({
|
|
@@ -1526,12 +1516,12 @@ function ImageRendererComponent({
|
|
|
1526
1516
|
size: size2,
|
|
1527
1517
|
url
|
|
1528
1518
|
}) {
|
|
1529
|
-
const [imageSource, setImageSource] = (0,
|
|
1519
|
+
const [imageSource, setImageSource] = (0, import_react4.useState)("");
|
|
1530
1520
|
const httpClient = useRendererHttpClient();
|
|
1531
|
-
(0,
|
|
1521
|
+
(0, import_react4.useEffect)(() => {
|
|
1532
1522
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
1533
1523
|
}, [url, httpClient]);
|
|
1534
|
-
return /* @__PURE__ */ (0,
|
|
1524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1535
1525
|
import_components11.Image,
|
|
1536
1526
|
{
|
|
1537
1527
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1576,7 +1566,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1576
1566
|
|
|
1577
1567
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1578
1568
|
var import_components12 = require("@transferwise/components");
|
|
1579
|
-
var
|
|
1569
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1580
1570
|
var doContext = ["positive", "neutral"];
|
|
1581
1571
|
var dontContext = ["warning", "negative"];
|
|
1582
1572
|
var InstructionsRenderer = {
|
|
@@ -1584,9 +1574,9 @@ var InstructionsRenderer = {
|
|
|
1584
1574
|
render: ({ items, margin, title }) => {
|
|
1585
1575
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1586
1576
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1587
|
-
return /* @__PURE__ */ (0,
|
|
1588
|
-
title ? /* @__PURE__ */ (0,
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: getMargin(margin), children: [
|
|
1578
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { title }) : null,
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.InstructionsList, { dos, donts })
|
|
1590
1580
|
] });
|
|
1591
1581
|
}
|
|
1592
1582
|
};
|
|
@@ -1604,11 +1594,11 @@ var onWheel = (event) => {
|
|
|
1604
1594
|
|
|
1605
1595
|
// ../renderers/src/utils/getIconAvatar.tsx
|
|
1606
1596
|
var import_components13 = require("@transferwise/components");
|
|
1607
|
-
var
|
|
1597
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1608
1598
|
var size = 24;
|
|
1609
1599
|
function getIconAvatar({ icon, image }) {
|
|
1610
1600
|
if (image == null ? void 0 : image.url) {
|
|
1611
|
-
return /* @__PURE__ */ (0,
|
|
1601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1612
1602
|
"img",
|
|
1613
1603
|
{
|
|
1614
1604
|
src: image.url,
|
|
@@ -1619,13 +1609,13 @@ function getIconAvatar({ icon, image }) {
|
|
|
1619
1609
|
);
|
|
1620
1610
|
}
|
|
1621
1611
|
if (isFlagIcon2(icon)) {
|
|
1622
|
-
return /* @__PURE__ */ (0,
|
|
1612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1623
1613
|
}
|
|
1624
1614
|
if (isNamedIcon2(icon)) {
|
|
1625
|
-
return /* @__PURE__ */ (0,
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DynamicIcon_default, { name: icon.name });
|
|
1626
1616
|
}
|
|
1627
1617
|
if (icon && "text" in icon) {
|
|
1628
|
-
return /* @__PURE__ */ (0,
|
|
1618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: icon.text });
|
|
1629
1619
|
}
|
|
1630
1620
|
return null;
|
|
1631
1621
|
}
|
|
@@ -1639,7 +1629,7 @@ var getInputGroupAddonStart = ({ icon, image }) => {
|
|
|
1639
1629
|
};
|
|
1640
1630
|
|
|
1641
1631
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1642
|
-
var
|
|
1632
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1643
1633
|
var IntegerInputRenderer = {
|
|
1644
1634
|
canRenderType: "input-integer",
|
|
1645
1635
|
render: (props) => {
|
|
@@ -1666,7 +1656,7 @@ var IntegerInputRenderer = {
|
|
|
1666
1656
|
"value",
|
|
1667
1657
|
"onChange"
|
|
1668
1658
|
]);
|
|
1669
|
-
return /* @__PURE__ */ (0,
|
|
1659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1670
1660
|
FieldInput_default,
|
|
1671
1661
|
{
|
|
1672
1662
|
id,
|
|
@@ -1674,7 +1664,7 @@ var IntegerInputRenderer = {
|
|
|
1674
1664
|
description,
|
|
1675
1665
|
validation: validationState,
|
|
1676
1666
|
help,
|
|
1677
|
-
children: /* @__PURE__ */ (0,
|
|
1667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components14.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1678
1668
|
import_components14.Input,
|
|
1679
1669
|
__spreadValues({
|
|
1680
1670
|
id,
|
|
@@ -1698,10 +1688,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1698
1688
|
|
|
1699
1689
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1700
1690
|
var import_components15 = require("@transferwise/components");
|
|
1701
|
-
var
|
|
1691
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1702
1692
|
var LoadingIndicatorRenderer = {
|
|
1703
1693
|
canRenderType: "loading-indicator",
|
|
1704
|
-
render: ({ margin, size: size2 }) => /* @__PURE__ */ (0,
|
|
1694
|
+
render: ({ margin, size: size2 }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1705
1695
|
import_components15.Loader,
|
|
1706
1696
|
{
|
|
1707
1697
|
size: size2,
|
|
@@ -1714,28 +1704,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1714
1704
|
|
|
1715
1705
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1716
1706
|
var import_components16 = require("@transferwise/components");
|
|
1717
|
-
var
|
|
1707
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1718
1708
|
var MarkdownRenderer = {
|
|
1719
1709
|
canRenderType: "markdown",
|
|
1720
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
1710
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1721
1711
|
};
|
|
1722
1712
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1723
1713
|
|
|
1724
1714
|
// ../renderers/src/ModalRenderer.tsx
|
|
1725
1715
|
var import_components17 = require("@transferwise/components");
|
|
1726
|
-
var
|
|
1727
|
-
var
|
|
1716
|
+
var import_react5 = require("react");
|
|
1717
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1728
1718
|
var ModalRenderer = {
|
|
1729
1719
|
canRenderType: "modal",
|
|
1730
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1720
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DFModal, __spreadValues({}, props))
|
|
1731
1721
|
};
|
|
1732
1722
|
var ModalRenderer_default = ModalRenderer;
|
|
1733
1723
|
function DFModal({ content, margin, trigger }) {
|
|
1734
|
-
const [visible, setVisible] = (0,
|
|
1724
|
+
const [visible, setVisible] = (0, import_react5.useState)(false);
|
|
1735
1725
|
const { components, title } = content;
|
|
1736
|
-
return /* @__PURE__ */ (0,
|
|
1737
|
-
/* @__PURE__ */ (0,
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: getMargin(margin), children: [
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1739
1729
|
import_components17.Modal,
|
|
1740
1730
|
{
|
|
1741
1731
|
scroll: "content",
|
|
@@ -1754,16 +1744,16 @@ var import_components19 = require("@transferwise/components");
|
|
|
1754
1744
|
|
|
1755
1745
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1756
1746
|
var import_components18 = require("@transferwise/components");
|
|
1757
|
-
var
|
|
1747
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1758
1748
|
function OptionMedia({ icon, image }) {
|
|
1759
1749
|
if (image == null ? void 0 : image.url) {
|
|
1760
|
-
return /* @__PURE__ */ (0,
|
|
1750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1761
1751
|
}
|
|
1762
1752
|
if (icon && "name" in icon) {
|
|
1763
|
-
return /* @__PURE__ */ (0,
|
|
1753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1764
1754
|
}
|
|
1765
1755
|
if (icon && "text" in icon) {
|
|
1766
|
-
return /* @__PURE__ */ (0,
|
|
1756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
|
|
1767
1757
|
}
|
|
1768
1758
|
return null;
|
|
1769
1759
|
}
|
|
@@ -1782,15 +1772,15 @@ var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1782
1772
|
});
|
|
1783
1773
|
|
|
1784
1774
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1785
|
-
var
|
|
1786
|
-
var
|
|
1775
|
+
var import_react6 = require("react");
|
|
1776
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1787
1777
|
var MultiSelectInputRenderer = {
|
|
1788
1778
|
canRenderType: "input-multi-select",
|
|
1789
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1779
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1790
1780
|
};
|
|
1791
1781
|
function MultiSelectInputRendererComponent(props) {
|
|
1792
1782
|
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
1793
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
1783
|
+
const [stagedIndices, setStagedIndices] = (0, import_react6.useState)();
|
|
1794
1784
|
const {
|
|
1795
1785
|
id,
|
|
1796
1786
|
autoComplete,
|
|
@@ -1828,12 +1818,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1828
1818
|
const contentProps = {
|
|
1829
1819
|
title: option.title,
|
|
1830
1820
|
description: option.description,
|
|
1831
|
-
icon: /* @__PURE__ */ (0,
|
|
1821
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
1832
1822
|
};
|
|
1833
|
-
return /* @__PURE__ */ (0,
|
|
1823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1834
1824
|
};
|
|
1835
1825
|
const extraProps = { autoComplete };
|
|
1836
|
-
return /* @__PURE__ */ (0,
|
|
1826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1837
1827
|
FieldInput_default,
|
|
1838
1828
|
{
|
|
1839
1829
|
id,
|
|
@@ -1841,7 +1831,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1841
1831
|
help,
|
|
1842
1832
|
description,
|
|
1843
1833
|
validation: validationState,
|
|
1844
|
-
children: /* @__PURE__ */ (0,
|
|
1834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1845
1835
|
import_components19.SelectInput,
|
|
1846
1836
|
__spreadValues({
|
|
1847
1837
|
id,
|
|
@@ -1885,7 +1875,7 @@ var import_components21 = require("@transferwise/components");
|
|
|
1885
1875
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1886
1876
|
var import_components20 = require("@transferwise/components");
|
|
1887
1877
|
var import_classnames3 = __toESM(require_classnames());
|
|
1888
|
-
var
|
|
1878
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1889
1879
|
function UploadFieldInput({
|
|
1890
1880
|
id,
|
|
1891
1881
|
children,
|
|
@@ -1894,18 +1884,18 @@ function UploadFieldInput({
|
|
|
1894
1884
|
help,
|
|
1895
1885
|
validation
|
|
1896
1886
|
}) {
|
|
1897
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1887
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1898
1888
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1899
|
-
return /* @__PURE__ */ (0,
|
|
1889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1900
1890
|
"div",
|
|
1901
1891
|
{
|
|
1902
1892
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1903
1893
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1904
1894
|
}),
|
|
1905
1895
|
children: [
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1896
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1907
1897
|
children,
|
|
1908
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
1898
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1909
1899
|
]
|
|
1910
1900
|
}
|
|
1911
1901
|
);
|
|
@@ -1937,7 +1927,7 @@ var getFileType = (base64Url) => {
|
|
|
1937
1927
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1938
1928
|
|
|
1939
1929
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1940
|
-
var
|
|
1930
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1941
1931
|
var MultiUploadInputRenderer = {
|
|
1942
1932
|
canRenderType: "input-upload-multi",
|
|
1943
1933
|
render: (props) => {
|
|
@@ -1964,7 +1954,7 @@ var MultiUploadInputRenderer = {
|
|
|
1964
1954
|
};
|
|
1965
1955
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1966
1956
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1967
|
-
return /* @__PURE__ */ (0,
|
|
1957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1968
1958
|
UploadFieldInput_default,
|
|
1969
1959
|
{
|
|
1970
1960
|
id,
|
|
@@ -1972,7 +1962,7 @@ var MultiUploadInputRenderer = {
|
|
|
1972
1962
|
description,
|
|
1973
1963
|
validation: validationState,
|
|
1974
1964
|
help,
|
|
1975
|
-
children: /* @__PURE__ */ (0,
|
|
1965
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1976
1966
|
import_components21.UploadInput,
|
|
1977
1967
|
{
|
|
1978
1968
|
id,
|
|
@@ -1996,7 +1986,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1996
1986
|
|
|
1997
1987
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1998
1988
|
var import_components22 = require("@transferwise/components");
|
|
1999
|
-
var
|
|
1989
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2000
1990
|
var NumberInputRenderer = {
|
|
2001
1991
|
canRenderType: "input-number",
|
|
2002
1992
|
render: (props) => {
|
|
@@ -2023,7 +2013,7 @@ var NumberInputRenderer = {
|
|
|
2023
2013
|
"value",
|
|
2024
2014
|
"onChange"
|
|
2025
2015
|
]);
|
|
2026
|
-
return /* @__PURE__ */ (0,
|
|
2016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2027
2017
|
FieldInput_default,
|
|
2028
2018
|
{
|
|
2029
2019
|
id,
|
|
@@ -2031,7 +2021,7 @@ var NumberInputRenderer = {
|
|
|
2031
2021
|
description,
|
|
2032
2022
|
validation: validationState,
|
|
2033
2023
|
help,
|
|
2034
|
-
children: /* @__PURE__ */ (0,
|
|
2024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2035
2025
|
import_components22.Input,
|
|
2036
2026
|
__spreadValues({
|
|
2037
2027
|
id,
|
|
@@ -2056,9 +2046,9 @@ var import_react_intl6 = require("react-intl");
|
|
|
2056
2046
|
|
|
2057
2047
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2058
2048
|
var import_components23 = require("@transferwise/components");
|
|
2059
|
-
var
|
|
2049
|
+
var import_react7 = require("react");
|
|
2060
2050
|
function useSnackBarIfAvailable() {
|
|
2061
|
-
const context = (0,
|
|
2051
|
+
const context = (0, import_react7.useContext)(import_components23.SnackbarContext);
|
|
2062
2052
|
return context ? context.createSnackbar : () => {
|
|
2063
2053
|
};
|
|
2064
2054
|
}
|
|
@@ -2083,17 +2073,17 @@ var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
2083
2073
|
});
|
|
2084
2074
|
|
|
2085
2075
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2086
|
-
var
|
|
2076
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2087
2077
|
var ParagraphRenderer = {
|
|
2088
2078
|
canRenderType: "paragraph",
|
|
2089
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2079
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Paragraph, __spreadValues({}, props))
|
|
2090
2080
|
};
|
|
2091
2081
|
function Paragraph({ align, control, margin, text }) {
|
|
2092
2082
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2093
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
2083
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StandardParagraph, { className, text });
|
|
2094
2084
|
}
|
|
2095
2085
|
function StandardParagraph({ text, className }) {
|
|
2096
|
-
return /* @__PURE__ */ (0,
|
|
2086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2097
2087
|
}
|
|
2098
2088
|
function CopyableParagraph({
|
|
2099
2089
|
text,
|
|
@@ -2107,8 +2097,8 @@ function CopyableParagraph({
|
|
|
2107
2097
|
});
|
|
2108
2098
|
};
|
|
2109
2099
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className, children: [
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2112
2102
|
import_components24.Input,
|
|
2113
2103
|
{
|
|
2114
2104
|
type: "text",
|
|
@@ -2117,14 +2107,14 @@ function CopyableParagraph({
|
|
|
2117
2107
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
2118
2108
|
}
|
|
2119
2109
|
),
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2121
2111
|
] });
|
|
2122
2112
|
}
|
|
2123
2113
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2124
2114
|
|
|
2125
2115
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2126
2116
|
var import_components25 = require("@transferwise/components");
|
|
2127
|
-
var
|
|
2117
|
+
var import_react8 = require("react");
|
|
2128
2118
|
var import_icons = require("@transferwise/icons");
|
|
2129
2119
|
var import_react_intl8 = require("react-intl");
|
|
2130
2120
|
|
|
@@ -2155,10 +2145,10 @@ var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
2155
2145
|
|
|
2156
2146
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2157
2147
|
var import_classnames5 = __toESM(require_classnames());
|
|
2158
|
-
var
|
|
2148
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2159
2149
|
var RepeatableRenderer = {
|
|
2160
2150
|
canRenderType: "repeatable",
|
|
2161
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2151
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Repeatable, __spreadValues({}, props))
|
|
2162
2152
|
};
|
|
2163
2153
|
function Repeatable(props) {
|
|
2164
2154
|
const {
|
|
@@ -2175,7 +2165,7 @@ function Repeatable(props) {
|
|
|
2175
2165
|
onRemove
|
|
2176
2166
|
} = props;
|
|
2177
2167
|
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
2178
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2168
|
+
const [openModalType, setOpenModalType] = (0, import_react8.useState)(null);
|
|
2179
2169
|
const onAddItem = () => {
|
|
2180
2170
|
onAdd();
|
|
2181
2171
|
setOpenModalType("add");
|
|
@@ -2197,40 +2187,40 @@ function Repeatable(props) {
|
|
|
2197
2187
|
const onCancelEdit = () => {
|
|
2198
2188
|
setOpenModalType(null);
|
|
2199
2189
|
};
|
|
2200
|
-
return /* @__PURE__ */ (0,
|
|
2201
|
-
title && /* @__PURE__ */ (0,
|
|
2202
|
-
description && /* @__PURE__ */ (0,
|
|
2203
|
-
/* @__PURE__ */ (0,
|
|
2190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
2191
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.Header, { title }),
|
|
2192
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: description }),
|
|
2193
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2204
2194
|
"div",
|
|
2205
2195
|
{
|
|
2206
2196
|
className: (0, import_classnames5.default)("form-group", {
|
|
2207
2197
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2208
2198
|
}),
|
|
2209
2199
|
children: [
|
|
2210
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2211
|
-
/* @__PURE__ */ (0,
|
|
2200
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2212
2202
|
import_components25.NavigationOption,
|
|
2213
2203
|
{
|
|
2214
|
-
media: /* @__PURE__ */ (0,
|
|
2204
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons.Plus, {}),
|
|
2215
2205
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2216
2206
|
showMediaAtAllSizes: true,
|
|
2217
2207
|
onClick: () => onAddItem()
|
|
2218
2208
|
}
|
|
2219
2209
|
),
|
|
2220
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2210
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
2221
2211
|
]
|
|
2222
2212
|
}
|
|
2223
2213
|
),
|
|
2224
|
-
/* @__PURE__ */ (0,
|
|
2214
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2225
2215
|
import_components25.Modal,
|
|
2226
2216
|
{
|
|
2227
2217
|
open: openModalType !== null,
|
|
2228
2218
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2229
|
-
body: /* @__PURE__ */ (0,
|
|
2230
|
-
/* @__PURE__ */ (0,
|
|
2231
|
-
/* @__PURE__ */ (0,
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2219
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
2220
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
2222
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2223
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2234
2224
|
] })
|
|
2235
2225
|
] }),
|
|
2236
2226
|
onClose: () => onCancelEdit()
|
|
@@ -2242,10 +2232,10 @@ function ItemSummaryOption({
|
|
|
2242
2232
|
item,
|
|
2243
2233
|
onClick
|
|
2244
2234
|
}) {
|
|
2245
|
-
return /* @__PURE__ */ (0,
|
|
2235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2246
2236
|
import_components25.NavigationOption,
|
|
2247
2237
|
{
|
|
2248
|
-
media: /* @__PURE__ */ (0,
|
|
2238
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
|
|
2249
2239
|
title: item.title,
|
|
2250
2240
|
content: item.description,
|
|
2251
2241
|
showMediaAtAllSizes: true,
|
|
@@ -2283,7 +2273,7 @@ var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
2283
2273
|
|
|
2284
2274
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2285
2275
|
var import_components26 = require("@transferwise/components");
|
|
2286
|
-
var
|
|
2276
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2287
2277
|
function ErrorResult({ state }) {
|
|
2288
2278
|
const intl = (0, import_react_intl10.useIntl)();
|
|
2289
2279
|
const buttonVisualProps = {
|
|
@@ -2291,10 +2281,10 @@ function ErrorResult({ state }) {
|
|
|
2291
2281
|
size: "sm",
|
|
2292
2282
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2293
2283
|
};
|
|
2294
|
-
return /* @__PURE__ */ (0,
|
|
2284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "m-t-2", children: [
|
|
2295
2285
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2296
2286
|
"\xA0",
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2298
2288
|
import_components26.Button,
|
|
2299
2289
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2300
2290
|
onClick: () => {
|
|
@@ -2307,7 +2297,7 @@ function ErrorResult({ state }) {
|
|
|
2307
2297
|
}
|
|
2308
2298
|
|
|
2309
2299
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2310
|
-
var
|
|
2300
|
+
var import_react9 = require("react");
|
|
2311
2301
|
|
|
2312
2302
|
// ../renderers/src/messages/search.messages.ts
|
|
2313
2303
|
var import_react_intl11 = require("react-intl");
|
|
@@ -2321,7 +2311,7 @@ var search_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
2321
2311
|
|
|
2322
2312
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2323
2313
|
var import_react_intl12 = require("react-intl");
|
|
2324
|
-
var
|
|
2314
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2325
2315
|
function BlockSearchRendererComponent({
|
|
2326
2316
|
id,
|
|
2327
2317
|
isLoading,
|
|
@@ -2331,11 +2321,11 @@ function BlockSearchRendererComponent({
|
|
|
2331
2321
|
state,
|
|
2332
2322
|
title
|
|
2333
2323
|
}) {
|
|
2334
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2324
|
+
const [hasSearched, setHasSearched] = (0, import_react9.useState)(false);
|
|
2335
2325
|
const trackEvent = useTrackEvent();
|
|
2336
2326
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2337
|
-
return /* @__PURE__ */ (0,
|
|
2338
|
-
/* @__PURE__ */ (0,
|
|
2327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getMargin(margin), children: [
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2339
2329
|
import_components27.Input,
|
|
2340
2330
|
{
|
|
2341
2331
|
id,
|
|
@@ -2352,7 +2342,7 @@ function BlockSearchRendererComponent({
|
|
|
2352
2342
|
}
|
|
2353
2343
|
}
|
|
2354
2344
|
) }),
|
|
2355
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2345
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SearchResultContent, { state, onChange })
|
|
2356
2346
|
] });
|
|
2357
2347
|
}
|
|
2358
2348
|
function SearchResultContent({
|
|
@@ -2361,26 +2351,26 @@ function SearchResultContent({
|
|
|
2361
2351
|
}) {
|
|
2362
2352
|
switch (state.type) {
|
|
2363
2353
|
case "error":
|
|
2364
|
-
return /* @__PURE__ */ (0,
|
|
2354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ErrorResult, { state });
|
|
2365
2355
|
case "results":
|
|
2366
|
-
return /* @__PURE__ */ (0,
|
|
2356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SearchResults, { state, onChange });
|
|
2367
2357
|
case "noResults":
|
|
2368
|
-
return /* @__PURE__ */ (0,
|
|
2358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptySearchResult, { state });
|
|
2369
2359
|
case "pending":
|
|
2370
2360
|
default:
|
|
2371
2361
|
return null;
|
|
2372
2362
|
}
|
|
2373
2363
|
}
|
|
2374
2364
|
function EmptySearchResult({ state }) {
|
|
2375
|
-
return /* @__PURE__ */ (0,
|
|
2365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2376
2366
|
}
|
|
2377
2367
|
function SearchResults({
|
|
2378
2368
|
state
|
|
2379
2369
|
}) {
|
|
2380
2370
|
const trackEvent = useTrackEvent();
|
|
2381
|
-
return /* @__PURE__ */ (0,
|
|
2371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
2382
2372
|
const { icon, image } = result;
|
|
2383
|
-
return /* @__PURE__ */ (0,
|
|
2373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2384
2374
|
import_components27.NavigationOption,
|
|
2385
2375
|
{
|
|
2386
2376
|
title: result.title,
|
|
@@ -2404,9 +2394,9 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2404
2394
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2405
2395
|
var import_components28 = require("@transferwise/components");
|
|
2406
2396
|
var import_icons2 = require("@transferwise/icons");
|
|
2407
|
-
var
|
|
2397
|
+
var import_react10 = require("react");
|
|
2408
2398
|
var import_react_intl13 = require("react-intl");
|
|
2409
|
-
var
|
|
2399
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2410
2400
|
function InlineSearchRenderer({
|
|
2411
2401
|
id,
|
|
2412
2402
|
isLoading,
|
|
@@ -2415,10 +2405,10 @@ function InlineSearchRenderer({
|
|
|
2415
2405
|
state,
|
|
2416
2406
|
title
|
|
2417
2407
|
}) {
|
|
2418
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2408
|
+
const [hasSearched, setHasSearched] = (0, import_react10.useState)(false);
|
|
2419
2409
|
const trackEvent = useTrackEvent();
|
|
2420
2410
|
const intl = (0, import_react_intl13.useIntl)();
|
|
2421
|
-
return /* @__PURE__ */ (0,
|
|
2411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2422
2412
|
import_components28.Typeahead,
|
|
2423
2413
|
{
|
|
2424
2414
|
id: "typeahead-input-id",
|
|
@@ -2426,10 +2416,10 @@ function InlineSearchRenderer({
|
|
|
2426
2416
|
name: "typeahead-input-name",
|
|
2427
2417
|
size: "md",
|
|
2428
2418
|
maxHeight: 100,
|
|
2429
|
-
footer: /* @__PURE__ */ (0,
|
|
2419
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2430
2420
|
multiple: false,
|
|
2431
2421
|
clearable: false,
|
|
2432
|
-
addon: /* @__PURE__ */ (0,
|
|
2422
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons2.Search, { size: 24 }),
|
|
2433
2423
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2434
2424
|
minQueryLength: 1,
|
|
2435
2425
|
onChange: (values) => {
|
|
@@ -2466,29 +2456,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2466
2456
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2467
2457
|
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2468
2458
|
if (state.type === "noResults") {
|
|
2469
|
-
return /* @__PURE__ */ (0,
|
|
2459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2470
2460
|
}
|
|
2471
2461
|
if (state.type === "error") {
|
|
2472
|
-
return /* @__PURE__ */ (0,
|
|
2462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state }) });
|
|
2473
2463
|
}
|
|
2474
2464
|
if (state.type === "pending" || isLoading) {
|
|
2475
|
-
return /* @__PURE__ */ (0,
|
|
2465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2476
2466
|
}
|
|
2477
2467
|
return null;
|
|
2478
2468
|
}
|
|
2479
2469
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2480
2470
|
|
|
2481
2471
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2482
|
-
var
|
|
2472
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2483
2473
|
var SearchRenderer = {
|
|
2484
2474
|
canRenderType: "search",
|
|
2485
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2475
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2486
2476
|
};
|
|
2487
2477
|
var SearchRenderer_default = SearchRenderer;
|
|
2488
2478
|
|
|
2489
2479
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2490
2480
|
var import_components29 = require("@transferwise/components");
|
|
2491
|
-
var
|
|
2481
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2492
2482
|
function RadioInputRendererComponent(props) {
|
|
2493
2483
|
const {
|
|
2494
2484
|
id,
|
|
@@ -2502,8 +2492,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2502
2492
|
validationState,
|
|
2503
2493
|
onSelect
|
|
2504
2494
|
} = props;
|
|
2505
|
-
return /* @__PURE__ */ (0,
|
|
2506
|
-
/* @__PURE__ */ (0,
|
|
2495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
2496
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2507
2497
|
FieldInput_default,
|
|
2508
2498
|
{
|
|
2509
2499
|
id,
|
|
@@ -2511,7 +2501,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2511
2501
|
help,
|
|
2512
2502
|
description,
|
|
2513
2503
|
validation: validationState,
|
|
2514
|
-
children: /* @__PURE__ */ (0,
|
|
2504
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2515
2505
|
import_components29.RadioGroup,
|
|
2516
2506
|
{
|
|
2517
2507
|
name: id,
|
|
@@ -2520,7 +2510,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2520
2510
|
value: index,
|
|
2521
2511
|
secondary: option.description,
|
|
2522
2512
|
disabled: option.disabled || disabled,
|
|
2523
|
-
avatar: /* @__PURE__ */ (0,
|
|
2513
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2524
2514
|
})),
|
|
2525
2515
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2526
2516
|
onChange: onSelect
|
|
@@ -2535,8 +2525,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2535
2525
|
|
|
2536
2526
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2537
2527
|
var import_components30 = require("@transferwise/components");
|
|
2538
|
-
var
|
|
2539
|
-
var
|
|
2528
|
+
var import_react11 = require("react");
|
|
2529
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2540
2530
|
function TabInputRendererComponent(props) {
|
|
2541
2531
|
const {
|
|
2542
2532
|
id,
|
|
@@ -2550,13 +2540,13 @@ function TabInputRendererComponent(props) {
|
|
|
2550
2540
|
validationState,
|
|
2551
2541
|
onSelect
|
|
2552
2542
|
} = props;
|
|
2553
|
-
(0,
|
|
2543
|
+
(0, import_react11.useEffect)(() => {
|
|
2554
2544
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
2555
2545
|
onSelect(0);
|
|
2556
2546
|
}
|
|
2557
2547
|
}, [selectedIndex, onSelect, options.length]);
|
|
2558
|
-
return /* @__PURE__ */ (0,
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2560
2550
|
FieldInput_default,
|
|
2561
2551
|
{
|
|
2562
2552
|
id,
|
|
@@ -2564,7 +2554,7 @@ function TabInputRendererComponent(props) {
|
|
|
2564
2554
|
help,
|
|
2565
2555
|
description,
|
|
2566
2556
|
validation: validationState,
|
|
2567
|
-
children: /* @__PURE__ */ (0,
|
|
2557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2568
2558
|
import_components30.Tabs,
|
|
2569
2559
|
{
|
|
2570
2560
|
name: id,
|
|
@@ -2573,7 +2563,7 @@ function TabInputRendererComponent(props) {
|
|
|
2573
2563
|
title: option.title,
|
|
2574
2564
|
// if we pass null, we get some props-types console errors
|
|
2575
2565
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2576
|
-
content: /* @__PURE__ */ (0,
|
|
2566
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, {}),
|
|
2577
2567
|
disabled: option.disabled || disabled
|
|
2578
2568
|
})),
|
|
2579
2569
|
onTabSelect: onSelect
|
|
@@ -2588,7 +2578,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2588
2578
|
|
|
2589
2579
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2590
2580
|
var import_components31 = require("@transferwise/components");
|
|
2591
|
-
var
|
|
2581
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2592
2582
|
function SelectInputRendererComponent(props) {
|
|
2593
2583
|
const {
|
|
2594
2584
|
id,
|
|
@@ -2628,13 +2618,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2628
2618
|
} : {
|
|
2629
2619
|
title: option.title,
|
|
2630
2620
|
description: option.description,
|
|
2631
|
-
icon: /* @__PURE__ */ (0,
|
|
2621
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2632
2622
|
};
|
|
2633
|
-
return /* @__PURE__ */ (0,
|
|
2623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2634
2624
|
};
|
|
2635
2625
|
const extraProps = { autoComplete };
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2637
|
-
/* @__PURE__ */ (0,
|
|
2626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2638
2628
|
FieldInput_default,
|
|
2639
2629
|
{
|
|
2640
2630
|
id,
|
|
@@ -2642,7 +2632,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2642
2632
|
help,
|
|
2643
2633
|
description,
|
|
2644
2634
|
validation: validationState,
|
|
2645
|
-
children: /* @__PURE__ */ (0,
|
|
2635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2646
2636
|
import_components31.SelectInput,
|
|
2647
2637
|
__spreadValues({
|
|
2648
2638
|
name: id,
|
|
@@ -2663,9 +2653,9 @@ function SelectInputRendererComponent(props) {
|
|
|
2663
2653
|
}
|
|
2664
2654
|
|
|
2665
2655
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2666
|
-
var
|
|
2656
|
+
var import_react12 = require("react");
|
|
2667
2657
|
var import_components32 = require("@transferwise/components");
|
|
2668
|
-
var
|
|
2658
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2669
2659
|
function SegmentedInputRendererComponent(props) {
|
|
2670
2660
|
const {
|
|
2671
2661
|
id,
|
|
@@ -2678,13 +2668,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2678
2668
|
validationState,
|
|
2679
2669
|
onSelect
|
|
2680
2670
|
} = props;
|
|
2681
|
-
(0,
|
|
2671
|
+
(0, import_react12.useEffect)(() => {
|
|
2682
2672
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2683
2673
|
onSelect(0);
|
|
2684
2674
|
}
|
|
2685
2675
|
}, [selectedIndex, onSelect, options.length]);
|
|
2686
|
-
return /* @__PURE__ */ (0,
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
2677
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2688
2678
|
FieldInput_default,
|
|
2689
2679
|
{
|
|
2690
2680
|
id,
|
|
@@ -2692,7 +2682,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2692
2682
|
help,
|
|
2693
2683
|
description,
|
|
2694
2684
|
validation: validationState,
|
|
2695
|
-
children: /* @__PURE__ */ (0,
|
|
2685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2696
2686
|
import_components32.SegmentedControl,
|
|
2697
2687
|
{
|
|
2698
2688
|
name: `${id}-segmented-control`,
|
|
@@ -2709,26 +2699,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2709
2699
|
)
|
|
2710
2700
|
}
|
|
2711
2701
|
),
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2702
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { id: `${id}-children`, children })
|
|
2713
2703
|
] });
|
|
2714
2704
|
}
|
|
2715
2705
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2716
2706
|
|
|
2717
2707
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2718
|
-
var
|
|
2708
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2719
2709
|
var SelectInputRenderer = {
|
|
2720
2710
|
canRenderType: "input-select",
|
|
2721
2711
|
render: (props) => {
|
|
2722
2712
|
switch (props.control) {
|
|
2723
2713
|
case "radio":
|
|
2724
|
-
return /* @__PURE__ */ (0,
|
|
2714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2725
2715
|
case "tab":
|
|
2726
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2716
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2727
2717
|
case "segmented":
|
|
2728
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2718
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2729
2719
|
case "select":
|
|
2730
2720
|
default:
|
|
2731
|
-
return /* @__PURE__ */ (0,
|
|
2721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2732
2722
|
}
|
|
2733
2723
|
}
|
|
2734
2724
|
};
|
|
@@ -2736,17 +2726,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2736
2726
|
|
|
2737
2727
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2738
2728
|
var import_components33 = require("@transferwise/components");
|
|
2739
|
-
var
|
|
2729
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2740
2730
|
var StatusListRenderer = {
|
|
2741
2731
|
canRenderType: "status-list",
|
|
2742
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
2743
|
-
title ? /* @__PURE__ */ (0,
|
|
2744
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
2732
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(margin), children: [
|
|
2733
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components33.Header, { title, className: "m-b-2" }) : null,
|
|
2734
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2745
2735
|
import_components33.Summary,
|
|
2746
2736
|
{
|
|
2747
2737
|
title: itemTitle,
|
|
2748
2738
|
description,
|
|
2749
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
2739
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
2750
2740
|
status: mapStatus(status),
|
|
2751
2741
|
action: getSummaryAction(callToAction)
|
|
2752
2742
|
},
|
|
@@ -2786,31 +2776,31 @@ var import_components35 = require("@transferwise/components");
|
|
|
2786
2776
|
|
|
2787
2777
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2788
2778
|
var import_components34 = require("@transferwise/components");
|
|
2789
|
-
var
|
|
2779
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2790
2780
|
function VariableTextInput({
|
|
2791
2781
|
control,
|
|
2792
2782
|
inputProps
|
|
2793
2783
|
}) {
|
|
2794
2784
|
switch (control) {
|
|
2795
2785
|
case "password":
|
|
2796
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
2797
2787
|
case "email":
|
|
2798
|
-
return /* @__PURE__ */ (0,
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
2799
2789
|
case "textarea":
|
|
2800
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextAreaInput, __spreadValues({}, inputProps));
|
|
2801
2791
|
case "numeric":
|
|
2802
|
-
return /* @__PURE__ */ (0,
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
2803
2793
|
case "phone-number":
|
|
2804
|
-
return /* @__PURE__ */ (0,
|
|
2794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
2805
2795
|
default:
|
|
2806
|
-
return /* @__PURE__ */ (0,
|
|
2796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
2807
2797
|
}
|
|
2808
2798
|
}
|
|
2809
2799
|
function TextInput(_a) {
|
|
2810
2800
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2811
2801
|
if (typeof displayFormat === "string") {
|
|
2812
2802
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
2813
|
-
return /* @__PURE__ */ (0,
|
|
2803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2814
2804
|
import_components34.InputWithDisplayFormat,
|
|
2815
2805
|
__spreadValues({
|
|
2816
2806
|
displayPattern: displayFormat,
|
|
@@ -2818,29 +2808,29 @@ function TextInput(_a) {
|
|
|
2818
2808
|
}, inputProps)
|
|
2819
2809
|
);
|
|
2820
2810
|
}
|
|
2821
|
-
return /* @__PURE__ */ (0,
|
|
2811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
2822
2812
|
}
|
|
2823
2813
|
function TextAreaInput(_a) {
|
|
2824
2814
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2825
2815
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
2826
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
2816
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2827
2817
|
import_components34.TextareaWithDisplayFormat,
|
|
2828
2818
|
__spreadValues({
|
|
2829
2819
|
displayPattern: displayFormat,
|
|
2830
2820
|
onChange: (newValue) => onChange(newValue)
|
|
2831
2821
|
}, textAreaProps)
|
|
2832
|
-
) : /* @__PURE__ */ (0,
|
|
2822
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
2833
2823
|
}
|
|
2834
2824
|
function NumericInput(_a) {
|
|
2835
2825
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2836
2826
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
2837
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
2827
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2838
2828
|
import_components34.InputWithDisplayFormat,
|
|
2839
2829
|
__spreadValues({
|
|
2840
2830
|
displayPattern: displayFormat,
|
|
2841
2831
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
2842
2832
|
}, numericProps)
|
|
2843
|
-
) : /* @__PURE__ */ (0,
|
|
2833
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2844
2834
|
import_components34.Input,
|
|
2845
2835
|
__spreadValues({
|
|
2846
2836
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -2849,12 +2839,12 @@ function NumericInput(_a) {
|
|
|
2849
2839
|
}
|
|
2850
2840
|
function PhoneNumberInput(_a) {
|
|
2851
2841
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
2852
|
-
return /* @__PURE__ */ (0,
|
|
2842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
2853
2843
|
}
|
|
2854
2844
|
var VariableTextInput_default = VariableTextInput;
|
|
2855
2845
|
|
|
2856
2846
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2857
|
-
var
|
|
2847
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2858
2848
|
var TextInputRenderer = {
|
|
2859
2849
|
canRenderType: "input-text",
|
|
2860
2850
|
render: (props) => {
|
|
@@ -2889,7 +2879,7 @@ var TextInputRenderer = {
|
|
|
2889
2879
|
]);
|
|
2890
2880
|
const value = initialValue != null ? initialValue : "";
|
|
2891
2881
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2892
|
-
return /* @__PURE__ */ (0,
|
|
2882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2893
2883
|
FieldInput_default,
|
|
2894
2884
|
{
|
|
2895
2885
|
id,
|
|
@@ -2897,7 +2887,7 @@ var TextInputRenderer = {
|
|
|
2897
2887
|
description,
|
|
2898
2888
|
validation: validationState,
|
|
2899
2889
|
help,
|
|
2900
|
-
children: /* @__PURE__ */ (0,
|
|
2890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(VariableTextInput_default, { control, inputProps }) })
|
|
2901
2891
|
}
|
|
2902
2892
|
);
|
|
2903
2893
|
}
|
|
@@ -2906,7 +2896,7 @@ var TextInputRenderer_default = TextInputRenderer;
|
|
|
2906
2896
|
|
|
2907
2897
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2908
2898
|
var import_components36 = require("@transferwise/components");
|
|
2909
|
-
var
|
|
2899
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2910
2900
|
var UploadInputRenderer = {
|
|
2911
2901
|
canRenderType: "input-upload",
|
|
2912
2902
|
render: (props) => {
|
|
@@ -2922,14 +2912,14 @@ var UploadInputRenderer = {
|
|
|
2922
2912
|
};
|
|
2923
2913
|
return (
|
|
2924
2914
|
// We don't pass help here as there is no sensible place to display it
|
|
2925
|
-
/* @__PURE__ */ (0,
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2926
2916
|
UploadFieldInput_default,
|
|
2927
2917
|
{
|
|
2928
2918
|
id,
|
|
2929
2919
|
label: void 0,
|
|
2930
2920
|
description: void 0,
|
|
2931
2921
|
validation: validationState,
|
|
2932
|
-
children: /* @__PURE__ */ (0,
|
|
2922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2933
2923
|
import_components36.UploadInput,
|
|
2934
2924
|
{
|
|
2935
2925
|
id,
|
|
@@ -2986,7 +2976,7 @@ var LargeUploadRenderer = {
|
|
|
2986
2976
|
throw e;
|
|
2987
2977
|
}
|
|
2988
2978
|
};
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
2979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2990
2980
|
FieldInput_default,
|
|
2991
2981
|
{
|
|
2992
2982
|
id,
|
|
@@ -2994,7 +2984,7 @@ var LargeUploadRenderer = {
|
|
|
2994
2984
|
description,
|
|
2995
2985
|
validation: validationState,
|
|
2996
2986
|
help,
|
|
2997
|
-
children: /* @__PURE__ */ (0,
|
|
2987
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2998
2988
|
import_components36.Upload,
|
|
2999
2989
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3000
2990
|
usAccept: getAcceptsString(accepts),
|
|
@@ -3011,14 +3001,14 @@ var LargeUploadRenderer = {
|
|
|
3011
3001
|
|
|
3012
3002
|
// ../renderers/src/ReviewRenderer.tsx
|
|
3013
3003
|
var import_components37 = require("@transferwise/components");
|
|
3014
|
-
var
|
|
3004
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3015
3005
|
var ReviewRenderer = {
|
|
3016
3006
|
canRenderType: "review",
|
|
3017
3007
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
3018
3008
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
3019
|
-
return /* @__PURE__ */ (0,
|
|
3020
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
3021
|
-
/* @__PURE__ */ (0,
|
|
3009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: getMargin(margin), children: [
|
|
3010
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components37.Header, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
|
|
3011
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3022
3012
|
import_components37.DefinitionList,
|
|
3023
3013
|
{
|
|
3024
3014
|
layout: orientation,
|
|
@@ -3050,14 +3040,14 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
3050
3040
|
};
|
|
3051
3041
|
var getFieldValue = (value, help, orientation) => {
|
|
3052
3042
|
if (help) {
|
|
3053
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3043
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Help_default, { help }),
|
|
3055
3045
|
" ",
|
|
3056
3046
|
value
|
|
3057
|
-
] }) : /* @__PURE__ */ (0,
|
|
3047
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
3058
3048
|
value,
|
|
3059
3049
|
" ",
|
|
3060
|
-
/* @__PURE__ */ (0,
|
|
3050
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Help_default, { help })
|
|
3061
3051
|
] });
|
|
3062
3052
|
}
|
|
3063
3053
|
return value;
|
|
@@ -3086,7 +3076,29 @@ var getReviewAction = (callToAction) => {
|
|
|
3086
3076
|
};
|
|
3087
3077
|
|
|
3088
3078
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3089
|
-
var
|
|
3079
|
+
var import_components40 = require("@transferwise/components");
|
|
3080
|
+
|
|
3081
|
+
// ../renderers/src/step/BackButton.tsx
|
|
3082
|
+
var import_components38 = require("@transferwise/components");
|
|
3083
|
+
var import_icons3 = require("@transferwise/icons");
|
|
3084
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3085
|
+
function BackButton({ title, onClick }) {
|
|
3086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3087
|
+
"button",
|
|
3088
|
+
{
|
|
3089
|
+
type: "button",
|
|
3090
|
+
className: "df-back-btn",
|
|
3091
|
+
title,
|
|
3092
|
+
"aria-label": title,
|
|
3093
|
+
onClick,
|
|
3094
|
+
children: [
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "sr-only", children: title }),
|
|
3096
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components38.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
3097
|
+
]
|
|
3098
|
+
}
|
|
3099
|
+
) });
|
|
3100
|
+
}
|
|
3101
|
+
var BackButton_default = BackButton;
|
|
3090
3102
|
|
|
3091
3103
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
3092
3104
|
var import_react_intl15 = require("react-intl");
|
|
@@ -3117,7 +3129,7 @@ var external_confirmation_messages_default = (0, import_react_intl14.defineMessa
|
|
|
3117
3129
|
});
|
|
3118
3130
|
|
|
3119
3131
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
3120
|
-
var
|
|
3132
|
+
var import_components39 = require("@transferwise/components");
|
|
3121
3133
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3122
3134
|
function ExternalConfirmationDialog({
|
|
3123
3135
|
external,
|
|
@@ -3126,10 +3138,10 @@ function ExternalConfirmationDialog({
|
|
|
3126
3138
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
3127
3139
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
3128
3140
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
3129
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3141
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components39.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
3130
3142
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
3131
3143
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3132
|
-
|
|
3144
|
+
import_components39.Button,
|
|
3133
3145
|
{
|
|
3134
3146
|
block: true,
|
|
3135
3147
|
className: "m-b-2",
|
|
@@ -3142,7 +3154,7 @@ function ExternalConfirmationDialog({
|
|
|
3142
3154
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
3143
3155
|
}
|
|
3144
3156
|
),
|
|
3145
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3157
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components39.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
3146
3158
|
] }) })
|
|
3147
3159
|
] }) });
|
|
3148
3160
|
}
|
|
@@ -3155,12 +3167,12 @@ function getOrigin(url) {
|
|
|
3155
3167
|
}
|
|
3156
3168
|
|
|
3157
3169
|
// ../renderers/src/step/useExternal.tsx
|
|
3158
|
-
var
|
|
3170
|
+
var import_react13 = require("react");
|
|
3159
3171
|
function useExternal(url) {
|
|
3160
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
3161
|
-
const [hasDismissed, setHasDismissed] = (0,
|
|
3172
|
+
const [externalWindow, setExternalWindow] = (0, import_react13.useState)(null);
|
|
3173
|
+
const [hasDismissed, setHasDismissed] = (0, import_react13.useState)(false);
|
|
3162
3174
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
3163
|
-
(0,
|
|
3175
|
+
(0, import_react13.useEffect)(() => {
|
|
3164
3176
|
if (url) {
|
|
3165
3177
|
setHasDismissed(false);
|
|
3166
3178
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -3170,49 +3182,25 @@ function useExternal(url) {
|
|
|
3170
3182
|
return { requiresUserConfirmation, dismissConfirmation };
|
|
3171
3183
|
}
|
|
3172
3184
|
|
|
3173
|
-
// ../renderers/src/step/BackButton.tsx
|
|
3174
|
-
var import_components39 = require("@transferwise/components");
|
|
3175
|
-
var import_icons3 = require("@transferwise/icons");
|
|
3176
|
-
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3177
|
-
function BackButton({ title, onClick }) {
|
|
3178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3179
|
-
"button",
|
|
3180
|
-
{
|
|
3181
|
-
type: "button",
|
|
3182
|
-
className: "df-back-btn",
|
|
3183
|
-
title,
|
|
3184
|
-
"aria-label": title,
|
|
3185
|
-
onClick,
|
|
3186
|
-
children: [
|
|
3187
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: title }),
|
|
3188
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components39.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
3189
|
-
]
|
|
3190
|
-
}
|
|
3191
|
-
) });
|
|
3192
|
-
}
|
|
3193
|
-
var BackButton_default = BackButton;
|
|
3194
|
-
|
|
3195
3185
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3196
|
-
var
|
|
3197
|
-
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3186
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3198
3187
|
var StepRenderer = {
|
|
3199
3188
|
canRenderType: "step",
|
|
3200
3189
|
render: StepRendererComponent
|
|
3201
3190
|
};
|
|
3202
3191
|
function StepRendererComponent(props) {
|
|
3203
|
-
const { back, description, error, external,
|
|
3204
|
-
const value = (0, import_react15.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
3192
|
+
const { back, description, error, external, title, children } = props;
|
|
3205
3193
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
3206
3194
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
3207
|
-
return /* @__PURE__ */ (0,
|
|
3195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
3208
3196
|
}
|
|
3209
|
-
return /* @__PURE__ */ (0,
|
|
3210
|
-
back ? /* @__PURE__ */ (0,
|
|
3211
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3212
|
-
title ? /* @__PURE__ */ (0,
|
|
3213
|
-
description ? /* @__PURE__ */ (0,
|
|
3197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
3198
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3199
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "m-b-4", children: [
|
|
3200
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
3201
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
3214
3202
|
] }) : void 0,
|
|
3215
|
-
error ? /* @__PURE__ */ (0,
|
|
3203
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
3216
3204
|
children
|
|
3217
3205
|
] });
|
|
3218
3206
|
}
|
|
@@ -3252,30 +3240,30 @@ var getWiseRenderers = () => [
|
|
|
3252
3240
|
];
|
|
3253
3241
|
|
|
3254
3242
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3255
|
-
var
|
|
3243
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3256
3244
|
var wiseRenderers = getWiseRenderers();
|
|
3257
3245
|
function DynamicFlowLegacy(props) {
|
|
3258
3246
|
const { customFetch = globalThis.fetch } = props;
|
|
3259
3247
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
3261
3249
|
}
|
|
3262
3250
|
function DynamicFlowRevamp(props) {
|
|
3263
3251
|
const { customFetch = globalThis.fetch, renderers, onLink = openLinkInNewTab } = props;
|
|
3264
3252
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3265
|
-
const mergedRenderers = (0,
|
|
3253
|
+
const mergedRenderers = (0, import_react14.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3266
3254
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers, onLink });
|
|
3267
|
-
return /* @__PURE__ */ (0,
|
|
3255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
|
|
3268
3256
|
}
|
|
3269
|
-
var DynamicFragment = (0,
|
|
3257
|
+
var DynamicFragment = (0, import_react14.forwardRef)(function DynamicFragment2(props, ref) {
|
|
3270
3258
|
const { customFetch = globalThis.fetch, renderers, onLink = openLinkInNewTab } = props;
|
|
3271
3259
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3272
|
-
const mergedRenderers = (0,
|
|
3260
|
+
const mergedRenderers = (0, import_react14.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3273
3261
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers, onLink });
|
|
3274
|
-
return /* @__PURE__ */ (0,
|
|
3262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_dynamic_flow_client2.DynamicFragmentCore, __spreadProps(__spreadValues({}, coreProps), { ref }));
|
|
3275
3263
|
});
|
|
3276
3264
|
var useWiseHttpClient = (httpClient) => {
|
|
3277
3265
|
const { locale } = (0, import_react_intl16.useIntl)();
|
|
3278
|
-
return (0,
|
|
3266
|
+
return (0, import_react14.useCallback)(
|
|
3279
3267
|
async (input, init = {}) => {
|
|
3280
3268
|
const headers = new Headers(init.headers);
|
|
3281
3269
|
headers.set("accept-language", locale);
|