@wise/dynamic-flow-client-internal 4.7.2 → 4.8.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 +344 -323
- package/build/main.mjs +300 -279
- package/build/types/dynamicFlow/telemetry/getTrackEvent.d.ts +1 -2
- package/package.json +16 -16
package/build/main.js
CHANGED
|
@@ -673,8 +673,8 @@ var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
|
673
673
|
var import_components = require("@transferwise/components");
|
|
674
674
|
|
|
675
675
|
// ../renderers/src/utils/layout-utils.ts
|
|
676
|
-
var getMargin = (
|
|
677
|
-
switch (
|
|
676
|
+
var getMargin = (size) => {
|
|
677
|
+
switch (size) {
|
|
678
678
|
case "xs":
|
|
679
679
|
return "m-b-0";
|
|
680
680
|
case "sm":
|
|
@@ -872,7 +872,7 @@ var import_components5 = require("@transferwise/components");
|
|
|
872
872
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
873
873
|
var ButtonRenderer = {
|
|
874
874
|
canRenderType: "button",
|
|
875
|
-
render: ({ control, context, disabled, margin, title, size
|
|
875
|
+
render: ({ control, context, disabled, margin, title, size, onClick }) => {
|
|
876
876
|
const priority = mapControl(control);
|
|
877
877
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
878
878
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -882,7 +882,7 @@ var ButtonRenderer = {
|
|
|
882
882
|
className: getMargin(margin),
|
|
883
883
|
disabled,
|
|
884
884
|
priority,
|
|
885
|
-
size: mapSize(
|
|
885
|
+
size: mapSize(size),
|
|
886
886
|
type,
|
|
887
887
|
onClick,
|
|
888
888
|
children: title
|
|
@@ -908,11 +908,11 @@ var mapControl = (control) => {
|
|
|
908
908
|
return "secondary";
|
|
909
909
|
}
|
|
910
910
|
};
|
|
911
|
-
var mapSize = (
|
|
912
|
-
if (!
|
|
911
|
+
var mapSize = (size) => {
|
|
912
|
+
if (!size) {
|
|
913
913
|
return void 0;
|
|
914
914
|
}
|
|
915
|
-
switch (
|
|
915
|
+
switch (size) {
|
|
916
916
|
case "xs":
|
|
917
917
|
case "sm":
|
|
918
918
|
return "sm";
|
|
@@ -952,9 +952,6 @@ var import_components6 = require("@transferwise/components");
|
|
|
952
952
|
|
|
953
953
|
// ../renderers/src/validators/type-validators.ts
|
|
954
954
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
955
|
-
var isNull = (value) => value === null;
|
|
956
|
-
var isUndefined = (value) => typeof value === "undefined";
|
|
957
|
-
var isNullish = (v) => isNull(v) || isUndefined(v);
|
|
958
955
|
|
|
959
956
|
// ../renderers/src/utils/value-utils.ts
|
|
960
957
|
var numericValueOrNull = (newValue) => /^\d+$/.test(newValue) && !Number.isNaN(Number.parseFloat(newValue)) ? newValue : null;
|
|
@@ -1069,8 +1066,14 @@ var DateInputRenderer = {
|
|
|
1069
1066
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1070
1067
|
|
|
1071
1068
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1069
|
+
var import_components9 = require("@transferwise/components");
|
|
1070
|
+
|
|
1071
|
+
// ../renderers/src/components/OptionMedia.tsx
|
|
1072
1072
|
var import_components8 = require("@transferwise/components");
|
|
1073
1073
|
|
|
1074
|
+
// ../renderers/src/utils/image-utils.tsx
|
|
1075
|
+
var import_components7 = require("@transferwise/components");
|
|
1076
|
+
|
|
1074
1077
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1075
1078
|
var import_art = require("@wise/art");
|
|
1076
1079
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -1114,27 +1117,33 @@ function DynamicIcon({ name }) {
|
|
|
1114
1117
|
}
|
|
1115
1118
|
var DynamicIcon_default = DynamicIcon;
|
|
1116
1119
|
|
|
1117
|
-
// ../renderers/src/
|
|
1118
|
-
var
|
|
1120
|
+
// ../renderers/src/utils/UrnFlag.tsx
|
|
1121
|
+
var import_art2 = require("@wise/art");
|
|
1119
1122
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1123
|
+
var countryUrnPrefix = "urn:wise:countries:";
|
|
1124
|
+
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
1125
|
+
var isUrnFlag = (uri) => uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix);
|
|
1126
|
+
function UrnFlag({ size, urn }) {
|
|
1127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_art2.Flag, { code: getCode(urn), intrinsicSize: size });
|
|
1128
|
+
}
|
|
1129
|
+
var getCode = (urn) => {
|
|
1130
|
+
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
// ../renderers/src/utils/image-utils.tsx
|
|
1134
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1135
|
+
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
1136
|
+
if (iconNode && imageNode) {
|
|
1137
|
+
if (imageNode && iconNode) {
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_components7.AvatarView, { size, badge: { asset: iconNode }, children: imageNode });
|
|
1126
1139
|
}
|
|
1127
|
-
return imageNode;
|
|
1128
|
-
}
|
|
1129
|
-
if (iconNode) {
|
|
1130
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_components7.AvatarView, { children: iconNode });
|
|
1131
1140
|
}
|
|
1132
1141
|
return null;
|
|
1133
|
-
}
|
|
1142
|
+
};
|
|
1134
1143
|
var getIconNode = (icon) => {
|
|
1135
|
-
if (
|
|
1144
|
+
if (icon) {
|
|
1136
1145
|
if ("name" in icon) {
|
|
1137
|
-
return /* @__PURE__ */ (0,
|
|
1146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DynamicIcon_default, { name: icon.name });
|
|
1138
1147
|
}
|
|
1139
1148
|
if (icon.text) {
|
|
1140
1149
|
return icon.text;
|
|
@@ -1142,32 +1151,54 @@ var getIconNode = (icon) => {
|
|
|
1142
1151
|
}
|
|
1143
1152
|
return null;
|
|
1144
1153
|
};
|
|
1145
|
-
var getImageNode = (image) => {
|
|
1154
|
+
var getImageNode = (image, size) => {
|
|
1146
1155
|
if (image) {
|
|
1147
1156
|
const { accessibilityDescription, uri } = image;
|
|
1148
1157
|
if (!uri.startsWith("urn:")) {
|
|
1149
|
-
return /* @__PURE__ */ (0,
|
|
1158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
1159
|
+
}
|
|
1160
|
+
if (isUrnFlag(uri)) {
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
1150
1162
|
}
|
|
1151
1163
|
}
|
|
1152
1164
|
return null;
|
|
1153
1165
|
};
|
|
1154
1166
|
|
|
1167
|
+
// ../renderers/src/components/OptionMedia.tsx
|
|
1168
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1169
|
+
var mediaSize = 64;
|
|
1170
|
+
var badgeMediaSize = 48;
|
|
1171
|
+
function OptionMedia({ icon, image }) {
|
|
1172
|
+
const imageNode = getImageNode(image, mediaSize);
|
|
1173
|
+
const iconNode = getIconNode(icon);
|
|
1174
|
+
const badge = getBadgedMedia(iconNode, imageNode, badgeMediaSize);
|
|
1175
|
+
if (badge) {
|
|
1176
|
+
return badge;
|
|
1177
|
+
}
|
|
1178
|
+
if (imageNode) {
|
|
1179
|
+
return imageNode;
|
|
1180
|
+
}
|
|
1181
|
+
if (iconNode) {
|
|
1182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components8.AvatarView, { children: iconNode });
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1155
1186
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1156
|
-
var
|
|
1187
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1157
1188
|
var DecisionRenderer = {
|
|
1158
1189
|
canRenderType: "decision",
|
|
1159
|
-
render: ({ margin, options, title }) => /* @__PURE__ */ (0,
|
|
1160
|
-
title && /* @__PURE__ */ (0,
|
|
1161
|
-
/* @__PURE__ */ (0,
|
|
1190
|
+
render: ({ margin, options, title }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: getMargin(margin), children: [
|
|
1191
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components9.Header, { as: "h2", title }),
|
|
1192
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components9.NavigationOptionsList, { children: options.map((option) => {
|
|
1162
1193
|
const { description, disabled, icon, image, title: itemTitle, onClick } = option;
|
|
1163
|
-
return /* @__PURE__ */ (0,
|
|
1164
|
-
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1195
|
+
import_components9.NavigationOption,
|
|
1165
1196
|
{
|
|
1166
1197
|
title: itemTitle,
|
|
1167
1198
|
content: description,
|
|
1168
1199
|
disabled,
|
|
1169
|
-
media: /* @__PURE__ */ (0,
|
|
1170
|
-
showMediaCircle:
|
|
1200
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OptionMedia, { icon, image }),
|
|
1201
|
+
showMediaCircle: false,
|
|
1171
1202
|
showMediaAtAllSizes: true,
|
|
1172
1203
|
onClick
|
|
1173
1204
|
},
|
|
@@ -1179,72 +1210,72 @@ var DecisionRenderer = {
|
|
|
1179
1210
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1180
1211
|
|
|
1181
1212
|
// ../renderers/src/DividerRenderer.tsx
|
|
1182
|
-
var
|
|
1213
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1183
1214
|
var DividerRenderer = {
|
|
1184
1215
|
canRenderType: "divider",
|
|
1185
|
-
render: ({ margin }) => /* @__PURE__ */ (0,
|
|
1216
|
+
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1186
1217
|
};
|
|
1187
1218
|
var DividerRenderer_default = DividerRenderer;
|
|
1188
1219
|
|
|
1189
1220
|
// ../renderers/src/FormRenderer.tsx
|
|
1190
|
-
var
|
|
1221
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1191
1222
|
var FormRenderer = {
|
|
1192
1223
|
canRenderType: "form",
|
|
1193
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1224
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: getMargin(margin), children })
|
|
1194
1225
|
};
|
|
1195
1226
|
var FormRenderer_default = FormRenderer;
|
|
1196
1227
|
|
|
1197
1228
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1198
|
-
var
|
|
1199
|
-
var
|
|
1229
|
+
var import_components10 = require("@transferwise/components");
|
|
1230
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1200
1231
|
var FormSectionRenderer = {
|
|
1201
1232
|
canRenderType: "section",
|
|
1202
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1203
|
-
title && /* @__PURE__ */ (0,
|
|
1204
|
-
|
|
1233
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("fieldset", { children: [
|
|
1234
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1235
|
+
import_components10.Header,
|
|
1205
1236
|
{
|
|
1206
1237
|
as: "h2",
|
|
1207
1238
|
title
|
|
1208
1239
|
}
|
|
1209
1240
|
),
|
|
1210
|
-
description && /* @__PURE__ */ (0,
|
|
1241
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: description }),
|
|
1211
1242
|
children
|
|
1212
1243
|
] })
|
|
1213
1244
|
};
|
|
1214
1245
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
1215
1246
|
|
|
1216
1247
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1217
|
-
var
|
|
1218
|
-
var
|
|
1248
|
+
var import_components11 = require("@transferwise/components");
|
|
1249
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1219
1250
|
var HeadingRenderer = {
|
|
1220
1251
|
canRenderType: "heading",
|
|
1221
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1252
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Heading, __spreadValues({}, props))
|
|
1222
1253
|
};
|
|
1223
1254
|
function Heading(props) {
|
|
1224
|
-
const { text, size
|
|
1255
|
+
const { text, size, align, margin, control } = props;
|
|
1225
1256
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1226
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1257
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StandardHeading, { size, text, className });
|
|
1227
1258
|
}
|
|
1228
|
-
function DisplayHeading({ size
|
|
1229
|
-
return /* @__PURE__ */ (0,
|
|
1259
|
+
function DisplayHeading({ size, text, className }) {
|
|
1260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components11.Display, { type: getDisplayType(size), className, children: text });
|
|
1230
1261
|
}
|
|
1231
|
-
function StandardHeading({ size
|
|
1232
|
-
switch (
|
|
1262
|
+
function StandardHeading({ size, text, className }) {
|
|
1263
|
+
switch (size) {
|
|
1233
1264
|
case "xs":
|
|
1234
|
-
return /* @__PURE__ */ (0,
|
|
1265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h5", { className, children: text });
|
|
1235
1266
|
case "sm":
|
|
1236
|
-
return /* @__PURE__ */ (0,
|
|
1267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { className, children: text });
|
|
1237
1268
|
case "lg":
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className, children: text });
|
|
1239
1270
|
case "xl":
|
|
1240
|
-
return /* @__PURE__ */ (0,
|
|
1271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { className, children: text });
|
|
1241
1272
|
case "md":
|
|
1242
1273
|
default:
|
|
1243
|
-
return /* @__PURE__ */ (0,
|
|
1274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { className, children: text });
|
|
1244
1275
|
}
|
|
1245
1276
|
}
|
|
1246
|
-
var getDisplayType = (
|
|
1247
|
-
switch (
|
|
1277
|
+
var getDisplayType = (size) => {
|
|
1278
|
+
switch (size) {
|
|
1248
1279
|
case "xs":
|
|
1249
1280
|
case "sm":
|
|
1250
1281
|
return "display-small";
|
|
@@ -1259,7 +1290,7 @@ var getDisplayType = (size2) => {
|
|
|
1259
1290
|
var HeadingRenderer_default = HeadingRenderer;
|
|
1260
1291
|
|
|
1261
1292
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1262
|
-
var
|
|
1293
|
+
var import_components12 = require("@transferwise/components");
|
|
1263
1294
|
var import_react = require("react");
|
|
1264
1295
|
|
|
1265
1296
|
// ../renderers/src/utils/api-utils.ts
|
|
@@ -1270,12 +1301,12 @@ function isRelativePath(url = "") {
|
|
|
1270
1301
|
}
|
|
1271
1302
|
|
|
1272
1303
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1273
|
-
var
|
|
1304
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1274
1305
|
function UrlImage({
|
|
1275
1306
|
accessibilityDescription,
|
|
1276
1307
|
align,
|
|
1277
1308
|
margin,
|
|
1278
|
-
size
|
|
1309
|
+
size,
|
|
1279
1310
|
uri,
|
|
1280
1311
|
httpClient
|
|
1281
1312
|
}) {
|
|
@@ -1285,8 +1316,8 @@ function UrlImage({
|
|
|
1285
1316
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1286
1317
|
}
|
|
1287
1318
|
}, [uri, httpClient]);
|
|
1288
|
-
return /* @__PURE__ */ (0,
|
|
1289
|
-
|
|
1319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1320
|
+
import_components12.Image,
|
|
1290
1321
|
{
|
|
1291
1322
|
className: `img-responsive ${getMargin(margin)}`,
|
|
1292
1323
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -1328,8 +1359,21 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1328
1359
|
}
|
|
1329
1360
|
};
|
|
1330
1361
|
|
|
1362
|
+
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1363
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1364
|
+
var maxFlagSize = 600;
|
|
1365
|
+
function UrnFlagImage({
|
|
1366
|
+
accessibilityDescription,
|
|
1367
|
+
align,
|
|
1368
|
+
margin,
|
|
1369
|
+
size,
|
|
1370
|
+
uri
|
|
1371
|
+
}) {
|
|
1372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1331
1375
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1332
|
-
var
|
|
1376
|
+
var import_art3 = require("@wise/art");
|
|
1333
1377
|
|
|
1334
1378
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1335
1379
|
var isAnimated = (uri) => {
|
|
@@ -1345,24 +1389,24 @@ var isAnimated = (uri) => {
|
|
|
1345
1389
|
};
|
|
1346
1390
|
|
|
1347
1391
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1348
|
-
var
|
|
1392
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1349
1393
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1350
1394
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1351
1395
|
function UrnIllustration({
|
|
1352
1396
|
accessibilityDescription,
|
|
1353
1397
|
align,
|
|
1354
1398
|
margin,
|
|
1355
|
-
size
|
|
1399
|
+
size,
|
|
1356
1400
|
uri
|
|
1357
1401
|
}) {
|
|
1358
|
-
const illustrationSize = getIllustrationSize(
|
|
1402
|
+
const illustrationSize = getIllustrationSize(size);
|
|
1359
1403
|
const illustrationName = getIllustrationName(uri);
|
|
1360
1404
|
const illustration3DName = getIllustration3DName(uri);
|
|
1361
1405
|
if (illustration3DName && isAnimated(uri)) {
|
|
1362
|
-
return /* @__PURE__ */ (0,
|
|
1406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_art3.Illustration3D, { name: illustration3DName, size: illustrationSize }) });
|
|
1363
1407
|
}
|
|
1364
|
-
return /* @__PURE__ */ (0,
|
|
1365
|
-
|
|
1408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1409
|
+
import_art3.Illustration,
|
|
1366
1410
|
{
|
|
1367
1411
|
className: "df-illustration",
|
|
1368
1412
|
name: illustrationName,
|
|
@@ -1371,39 +1415,42 @@ function UrnIllustration({
|
|
|
1371
1415
|
}
|
|
1372
1416
|
) });
|
|
1373
1417
|
}
|
|
1374
|
-
var getIllustrationSize = (
|
|
1418
|
+
var getIllustrationSize = (size) => ({ xs: "small", sm: "small", md: "medium", lg: "large", xl: "large" })[size] || "medium";
|
|
1375
1419
|
var getIllustrationName = (uri) => {
|
|
1376
1420
|
return uri.replace(urnPrefix, "").split("?")[0];
|
|
1377
1421
|
};
|
|
1378
1422
|
var getIllustration3DName = (uri) => {
|
|
1379
1423
|
const illustrationName = getIllustrationName(uri);
|
|
1380
|
-
return (0,
|
|
1424
|
+
return (0, import_art3.isIllustrationSupport3D)(illustrationName) ? illustrationName : null;
|
|
1381
1425
|
};
|
|
1382
1426
|
|
|
1383
1427
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1384
|
-
var
|
|
1428
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1385
1429
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1386
1430
|
function UrnImage(props) {
|
|
1387
1431
|
const { uri } = props;
|
|
1388
1432
|
if (isUrnIllustration(uri)) {
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
1434
|
+
}
|
|
1435
|
+
if (isUrnFlag(uri)) {
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
1390
1437
|
}
|
|
1391
1438
|
return null;
|
|
1392
1439
|
}
|
|
1393
1440
|
|
|
1394
1441
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1395
|
-
var
|
|
1442
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1396
1443
|
var ImageRenderer = {
|
|
1397
1444
|
canRenderType: "image",
|
|
1398
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
1445
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(UrlImage, __spreadValues({}, props))
|
|
1399
1446
|
};
|
|
1400
1447
|
|
|
1401
1448
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
1402
1449
|
var ImageRenderer_default = ImageRenderer;
|
|
1403
1450
|
|
|
1404
1451
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1405
|
-
var
|
|
1406
|
-
var
|
|
1452
|
+
var import_components13 = require("@transferwise/components");
|
|
1453
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1407
1454
|
var doContext = ["positive", "neutral"];
|
|
1408
1455
|
var dontContext = ["warning", "negative"];
|
|
1409
1456
|
var InstructionsRenderer = {
|
|
@@ -1411,16 +1458,16 @@ var InstructionsRenderer = {
|
|
|
1411
1458
|
render: ({ items, margin, title }) => {
|
|
1412
1459
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1413
1460
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1414
|
-
return /* @__PURE__ */ (0,
|
|
1415
|
-
title ? /* @__PURE__ */ (0,
|
|
1416
|
-
/* @__PURE__ */ (0,
|
|
1461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: getMargin(margin), children: [
|
|
1462
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.Header, { title }) : null,
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.InstructionsList, { dos, donts })
|
|
1417
1464
|
] });
|
|
1418
1465
|
}
|
|
1419
1466
|
};
|
|
1420
1467
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1421
1468
|
|
|
1422
1469
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1423
|
-
var
|
|
1470
|
+
var import_components15 = require("@transferwise/components");
|
|
1424
1471
|
|
|
1425
1472
|
// ../renderers/src/utils/input-utils.ts
|
|
1426
1473
|
var onWheel = (event) => {
|
|
@@ -1429,25 +1476,25 @@ var onWheel = (event) => {
|
|
|
1429
1476
|
}
|
|
1430
1477
|
};
|
|
1431
1478
|
|
|
1432
|
-
// ../renderers/src/utils/
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1435
|
-
var
|
|
1436
|
-
function
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1479
|
+
// ../renderers/src/utils/getInlineAvatar.tsx
|
|
1480
|
+
var import_components14 = require("@transferwise/components");
|
|
1481
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1482
|
+
var mediaSize2 = 24;
|
|
1483
|
+
function getInlineAvatar({ icon, image }) {
|
|
1484
|
+
const imageNode = getImageNode(image, mediaSize2);
|
|
1485
|
+
const iconNode = getIconNode(icon);
|
|
1486
|
+
const badge = getBadgedMedia(iconNode, imageNode, mediaSize2);
|
|
1487
|
+
if (badge) {
|
|
1488
|
+
return badge;
|
|
1442
1489
|
}
|
|
1443
|
-
if (
|
|
1444
|
-
return
|
|
1490
|
+
if (imageNode) {
|
|
1491
|
+
return imageNode;
|
|
1445
1492
|
}
|
|
1446
|
-
if (isNamedIcon2(icon)) {
|
|
1447
|
-
return
|
|
1493
|
+
if (isNamedIcon2(icon) && !isFlagIcon2(icon)) {
|
|
1494
|
+
return iconNode;
|
|
1448
1495
|
}
|
|
1449
|
-
if (
|
|
1450
|
-
return /* @__PURE__ */ (0,
|
|
1496
|
+
if (iconNode) {
|
|
1497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.AvatarView, { size: mediaSize2, children: iconNode });
|
|
1451
1498
|
}
|
|
1452
1499
|
return null;
|
|
1453
1500
|
}
|
|
@@ -1456,7 +1503,7 @@ var isFlagIcon2 = (icon) => isNamedIcon2(icon) && icon.name.startsWith("flag-");
|
|
|
1456
1503
|
|
|
1457
1504
|
// ../renderers/src/utils/getInputGroupAddonStart.tsx
|
|
1458
1505
|
var getInputGroupAddonStart = ({ icon, image }) => {
|
|
1459
|
-
const content =
|
|
1506
|
+
const content = getInlineAvatar({ icon, image });
|
|
1460
1507
|
return content ? { content } : void 0;
|
|
1461
1508
|
};
|
|
1462
1509
|
|
|
@@ -1470,7 +1517,7 @@ function pick(obj, ...keys) {
|
|
|
1470
1517
|
}
|
|
1471
1518
|
|
|
1472
1519
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1473
|
-
var
|
|
1520
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1474
1521
|
var IntegerInputRenderer = {
|
|
1475
1522
|
canRenderType: "input-integer",
|
|
1476
1523
|
render: (props) => {
|
|
@@ -1485,7 +1532,7 @@ var IntegerInputRenderer = {
|
|
|
1485
1532
|
"maximum",
|
|
1486
1533
|
"minimum"
|
|
1487
1534
|
);
|
|
1488
|
-
return /* @__PURE__ */ (0,
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1489
1536
|
FieldInput_default,
|
|
1490
1537
|
{
|
|
1491
1538
|
id,
|
|
@@ -1493,8 +1540,8 @@ var IntegerInputRenderer = {
|
|
|
1493
1540
|
description,
|
|
1494
1541
|
validation: validationState,
|
|
1495
1542
|
help,
|
|
1496
|
-
children: /* @__PURE__ */ (0,
|
|
1497
|
-
|
|
1543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components15.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1544
|
+
import_components15.Input,
|
|
1498
1545
|
__spreadValues({
|
|
1499
1546
|
id,
|
|
1500
1547
|
name: id,
|
|
@@ -1516,14 +1563,14 @@ var IntegerInputRenderer = {
|
|
|
1516
1563
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1517
1564
|
|
|
1518
1565
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1519
|
-
var
|
|
1520
|
-
var
|
|
1566
|
+
var import_components16 = require("@transferwise/components");
|
|
1567
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1521
1568
|
var LoadingIndicatorRenderer = {
|
|
1522
1569
|
canRenderType: "loading-indicator",
|
|
1523
|
-
render: ({ margin, size
|
|
1524
|
-
|
|
1570
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1571
|
+
import_components16.Loader,
|
|
1525
1572
|
{
|
|
1526
|
-
size
|
|
1573
|
+
size,
|
|
1527
1574
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
1528
1575
|
"data-testid": "loading-indicator"
|
|
1529
1576
|
}
|
|
@@ -1532,30 +1579,30 @@ var LoadingIndicatorRenderer = {
|
|
|
1532
1579
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
1533
1580
|
|
|
1534
1581
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1535
|
-
var
|
|
1536
|
-
var
|
|
1582
|
+
var import_components17 = require("@transferwise/components");
|
|
1583
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1537
1584
|
var MarkdownRenderer = {
|
|
1538
1585
|
canRenderType: "markdown",
|
|
1539
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
1586
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1540
1587
|
};
|
|
1541
1588
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1542
1589
|
|
|
1543
1590
|
// ../renderers/src/ModalRenderer.tsx
|
|
1544
|
-
var
|
|
1591
|
+
var import_components18 = require("@transferwise/components");
|
|
1545
1592
|
var import_react2 = require("react");
|
|
1546
|
-
var
|
|
1593
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1547
1594
|
var ModalRenderer = {
|
|
1548
1595
|
canRenderType: "modal",
|
|
1549
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1596
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DFModal, __spreadValues({}, props))
|
|
1550
1597
|
};
|
|
1551
1598
|
var ModalRenderer_default = ModalRenderer;
|
|
1552
1599
|
function DFModal({ content, margin, trigger }) {
|
|
1553
1600
|
const [visible, setVisible] = (0, import_react2.useState)(false);
|
|
1554
1601
|
const { children, title } = content;
|
|
1555
|
-
return /* @__PURE__ */ (0,
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1557
|
-
/* @__PURE__ */ (0,
|
|
1558
|
-
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getMargin(margin), children: [
|
|
1603
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components18.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1604
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1605
|
+
import_components18.Modal,
|
|
1559
1606
|
{
|
|
1560
1607
|
scroll: "content",
|
|
1561
1608
|
open: visible,
|
|
@@ -1570,24 +1617,7 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1570
1617
|
|
|
1571
1618
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1572
1619
|
var import_components19 = require("@transferwise/components");
|
|
1573
|
-
|
|
1574
|
-
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1575
|
-
var import_components18 = require("@transferwise/components");
|
|
1576
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1577
|
-
function OptionMedia({ icon, image }) {
|
|
1578
|
-
if (image && !image.uri.startsWith("urn:")) {
|
|
1579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: image.uri, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1580
|
-
}
|
|
1581
|
-
if (icon && "name" in icon) {
|
|
1582
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1583
|
-
}
|
|
1584
|
-
if (icon && "text" in icon) {
|
|
1585
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
|
|
1586
|
-
}
|
|
1587
|
-
return null;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1620
|
+
var import_react3 = require("react");
|
|
1591
1621
|
var import_react_intl4 = require("react-intl");
|
|
1592
1622
|
|
|
1593
1623
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
@@ -1601,11 +1631,10 @@ var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1601
1631
|
});
|
|
1602
1632
|
|
|
1603
1633
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1604
|
-
var
|
|
1605
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1634
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1606
1635
|
var MultiSelectInputRenderer = {
|
|
1607
1636
|
canRenderType: "input-multi-select",
|
|
1608
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1637
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1609
1638
|
};
|
|
1610
1639
|
function MultiSelectInputRendererComponent(props) {
|
|
1611
1640
|
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
@@ -1647,12 +1676,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1647
1676
|
const contentProps = {
|
|
1648
1677
|
title: option.title,
|
|
1649
1678
|
description: option.description,
|
|
1650
|
-
icon: /* @__PURE__ */ (0,
|
|
1679
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
1651
1680
|
};
|
|
1652
|
-
return /* @__PURE__ */ (0,
|
|
1681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1653
1682
|
};
|
|
1654
1683
|
const extraProps = { autoComplete };
|
|
1655
|
-
return /* @__PURE__ */ (0,
|
|
1684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1656
1685
|
FieldInput_default,
|
|
1657
1686
|
{
|
|
1658
1687
|
id,
|
|
@@ -1660,7 +1689,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1660
1689
|
help,
|
|
1661
1690
|
description,
|
|
1662
1691
|
validation: validationState,
|
|
1663
|
-
children: /* @__PURE__ */ (0,
|
|
1692
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1664
1693
|
import_components19.SelectInput,
|
|
1665
1694
|
__spreadValues({
|
|
1666
1695
|
id,
|
|
@@ -1704,7 +1733,7 @@ var import_components21 = require("@transferwise/components");
|
|
|
1704
1733
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1705
1734
|
var import_components20 = require("@transferwise/components");
|
|
1706
1735
|
var import_classnames3 = __toESM(require("classnames"));
|
|
1707
|
-
var
|
|
1736
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1708
1737
|
function UploadFieldInput({
|
|
1709
1738
|
id,
|
|
1710
1739
|
children,
|
|
@@ -1713,18 +1742,18 @@ function UploadFieldInput({
|
|
|
1713
1742
|
help,
|
|
1714
1743
|
validation
|
|
1715
1744
|
}) {
|
|
1716
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1745
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1717
1746
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1718
|
-
return /* @__PURE__ */ (0,
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1719
1748
|
"div",
|
|
1720
1749
|
{
|
|
1721
1750
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1722
1751
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1723
1752
|
}),
|
|
1724
1753
|
children: [
|
|
1725
|
-
/* @__PURE__ */ (0,
|
|
1754
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1726
1755
|
children,
|
|
1727
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
1756
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1728
1757
|
]
|
|
1729
1758
|
}
|
|
1730
1759
|
);
|
|
@@ -1753,7 +1782,7 @@ var getFileType = (base64Url) => {
|
|
|
1753
1782
|
};
|
|
1754
1783
|
|
|
1755
1784
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1756
|
-
var
|
|
1785
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1757
1786
|
var MultiUploadInputRenderer = {
|
|
1758
1787
|
canRenderType: "input-upload-multi",
|
|
1759
1788
|
render: (props) => {
|
|
@@ -1778,7 +1807,7 @@ var MultiUploadInputRenderer = {
|
|
|
1778
1807
|
};
|
|
1779
1808
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1780
1809
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1781
|
-
return /* @__PURE__ */ (0,
|
|
1810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1782
1811
|
UploadFieldInput_default,
|
|
1783
1812
|
{
|
|
1784
1813
|
id,
|
|
@@ -1786,7 +1815,7 @@ var MultiUploadInputRenderer = {
|
|
|
1786
1815
|
description,
|
|
1787
1816
|
validation: validationState,
|
|
1788
1817
|
help,
|
|
1789
|
-
children: /* @__PURE__ */ (0,
|
|
1818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1790
1819
|
import_components21.UploadInput,
|
|
1791
1820
|
{
|
|
1792
1821
|
id,
|
|
@@ -1810,7 +1839,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1810
1839
|
|
|
1811
1840
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1812
1841
|
var import_components22 = require("@transferwise/components");
|
|
1813
|
-
var
|
|
1842
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1814
1843
|
var NumberInputRenderer = {
|
|
1815
1844
|
canRenderType: "input-number",
|
|
1816
1845
|
render: (props) => {
|
|
@@ -1824,7 +1853,7 @@ var NumberInputRenderer = {
|
|
|
1824
1853
|
"maximum",
|
|
1825
1854
|
"minimum"
|
|
1826
1855
|
);
|
|
1827
|
-
return /* @__PURE__ */ (0,
|
|
1856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1828
1857
|
FieldInput_default,
|
|
1829
1858
|
{
|
|
1830
1859
|
id,
|
|
@@ -1832,7 +1861,7 @@ var NumberInputRenderer = {
|
|
|
1832
1861
|
description,
|
|
1833
1862
|
validation: validationState,
|
|
1834
1863
|
help,
|
|
1835
|
-
children: /* @__PURE__ */ (0,
|
|
1864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1836
1865
|
import_components22.Input,
|
|
1837
1866
|
__spreadValues({
|
|
1838
1867
|
id,
|
|
@@ -1884,17 +1913,17 @@ var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
1884
1913
|
});
|
|
1885
1914
|
|
|
1886
1915
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1887
|
-
var
|
|
1916
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1888
1917
|
var ParagraphRenderer = {
|
|
1889
1918
|
canRenderType: "paragraph",
|
|
1890
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1919
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Paragraph, __spreadValues({}, props))
|
|
1891
1920
|
};
|
|
1892
1921
|
function Paragraph({ align, control, margin, text }) {
|
|
1893
1922
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1894
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
1923
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(StandardParagraph, { className, text });
|
|
1895
1924
|
}
|
|
1896
1925
|
function StandardParagraph({ text, className }) {
|
|
1897
|
-
return /* @__PURE__ */ (0,
|
|
1926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
|
|
1898
1927
|
}
|
|
1899
1928
|
function CopyableParagraph({
|
|
1900
1929
|
text,
|
|
@@ -1908,8 +1937,8 @@ function CopyableParagraph({
|
|
|
1908
1937
|
});
|
|
1909
1938
|
};
|
|
1910
1939
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
1911
|
-
return /* @__PURE__ */ (0,
|
|
1912
|
-
/* @__PURE__ */ (0,
|
|
1940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className, children: [
|
|
1941
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1913
1942
|
import_components24.Input,
|
|
1914
1943
|
{
|
|
1915
1944
|
type: "text",
|
|
@@ -1918,15 +1947,16 @@ function CopyableParagraph({
|
|
|
1918
1947
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
1919
1948
|
}
|
|
1920
1949
|
),
|
|
1921
|
-
/* @__PURE__ */ (0,
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1922
1951
|
] });
|
|
1923
1952
|
}
|
|
1924
1953
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
1925
1954
|
|
|
1926
1955
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1927
1956
|
var import_components25 = require("@transferwise/components");
|
|
1928
|
-
var import_react5 = require("react");
|
|
1929
1957
|
var import_icons = require("@transferwise/icons");
|
|
1958
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
1959
|
+
var import_react5 = require("react");
|
|
1930
1960
|
var import_react_intl8 = require("react-intl");
|
|
1931
1961
|
|
|
1932
1962
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -1955,11 +1985,10 @@ var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
1955
1985
|
});
|
|
1956
1986
|
|
|
1957
1987
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1958
|
-
var
|
|
1959
|
-
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1988
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1960
1989
|
var RepeatableRenderer = {
|
|
1961
1990
|
canRenderType: "repeatable",
|
|
1962
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1991
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Repeatable, __spreadValues({}, props))
|
|
1963
1992
|
};
|
|
1964
1993
|
function Repeatable(props) {
|
|
1965
1994
|
const {
|
|
@@ -1998,40 +2027,40 @@ function Repeatable(props) {
|
|
|
1998
2027
|
const onCancelEdit = () => {
|
|
1999
2028
|
setOpenModalType(null);
|
|
2000
2029
|
};
|
|
2001
|
-
return /* @__PURE__ */ (0,
|
|
2002
|
-
title && /* @__PURE__ */ (0,
|
|
2003
|
-
description && /* @__PURE__ */ (0,
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
2031
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.Header, { title }),
|
|
2032
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: description }),
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2005
2034
|
"div",
|
|
2006
2035
|
{
|
|
2007
2036
|
className: (0, import_classnames5.default)("form-group", {
|
|
2008
2037
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2009
2038
|
}),
|
|
2010
2039
|
children: [
|
|
2011
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2012
|
-
/* @__PURE__ */ (0,
|
|
2040
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2013
2042
|
import_components25.NavigationOption,
|
|
2014
2043
|
{
|
|
2015
|
-
media: /* @__PURE__ */ (0,
|
|
2044
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons.Plus, {}),
|
|
2016
2045
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2017
2046
|
showMediaAtAllSizes: true,
|
|
2018
2047
|
onClick: () => onAddItem()
|
|
2019
2048
|
}
|
|
2020
2049
|
),
|
|
2021
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2050
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
2022
2051
|
]
|
|
2023
2052
|
}
|
|
2024
2053
|
),
|
|
2025
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2026
2055
|
import_components25.Modal,
|
|
2027
2056
|
{
|
|
2028
2057
|
open: openModalType !== null,
|
|
2029
2058
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2030
|
-
body: /* @__PURE__ */ (0,
|
|
2031
|
-
/* @__PURE__ */ (0,
|
|
2032
|
-
/* @__PURE__ */ (0,
|
|
2033
|
-
/* @__PURE__ */ (0,
|
|
2034
|
-
/* @__PURE__ */ (0,
|
|
2059
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
2060
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2061
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
2062
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2035
2064
|
] })
|
|
2036
2065
|
] }),
|
|
2037
2066
|
onClose: () => onCancelEdit()
|
|
@@ -2043,10 +2072,10 @@ function ItemSummaryOption({
|
|
|
2043
2072
|
item,
|
|
2044
2073
|
onClick
|
|
2045
2074
|
}) {
|
|
2046
|
-
return /* @__PURE__ */ (0,
|
|
2075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2047
2076
|
import_components25.NavigationOption,
|
|
2048
2077
|
{
|
|
2049
|
-
media: /* @__PURE__ */ (0,
|
|
2078
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OptionMedia, __spreadValues({}, item)),
|
|
2050
2079
|
title: item.title,
|
|
2051
2080
|
content: item.description,
|
|
2052
2081
|
showMediaAtAllSizes: true,
|
|
@@ -2096,7 +2125,7 @@ var generic_error_messages_default = (0, import_react_intl10.defineMessages)({
|
|
|
2096
2125
|
|
|
2097
2126
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2098
2127
|
var import_components26 = require("@transferwise/components");
|
|
2099
|
-
var
|
|
2128
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2100
2129
|
function ErrorResult({ state }) {
|
|
2101
2130
|
const intl = (0, import_react_intl11.useIntl)();
|
|
2102
2131
|
const buttonVisualProps = {
|
|
@@ -2104,10 +2133,10 @@ function ErrorResult({ state }) {
|
|
|
2104
2133
|
size: "sm",
|
|
2105
2134
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2106
2135
|
};
|
|
2107
|
-
return /* @__PURE__ */ (0,
|
|
2136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "m-t-2", children: [
|
|
2108
2137
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2109
2138
|
"\xA0",
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2111
2140
|
import_components26.Button,
|
|
2112
2141
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2113
2142
|
onClick: () => {
|
|
@@ -2120,7 +2149,7 @@ function ErrorResult({ state }) {
|
|
|
2120
2149
|
}
|
|
2121
2150
|
|
|
2122
2151
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2123
|
-
var
|
|
2152
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2124
2153
|
function BlockSearchRendererComponent({
|
|
2125
2154
|
id,
|
|
2126
2155
|
isLoading,
|
|
@@ -2133,8 +2162,8 @@ function BlockSearchRendererComponent({
|
|
|
2133
2162
|
}) {
|
|
2134
2163
|
const [hasSearched, setHasSearched] = (0, import_react6.useState)(false);
|
|
2135
2164
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2136
|
-
return /* @__PURE__ */ (0,
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getMargin(margin), children: [
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2138
2167
|
import_components27.Input,
|
|
2139
2168
|
{
|
|
2140
2169
|
id,
|
|
@@ -2151,7 +2180,7 @@ function BlockSearchRendererComponent({
|
|
|
2151
2180
|
}
|
|
2152
2181
|
}
|
|
2153
2182
|
) }),
|
|
2154
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2183
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SearchResultContent, { state, trackEvent })
|
|
2155
2184
|
] });
|
|
2156
2185
|
}
|
|
2157
2186
|
function SearchResultContent({
|
|
@@ -2160,31 +2189,31 @@ function SearchResultContent({
|
|
|
2160
2189
|
}) {
|
|
2161
2190
|
switch (state.type) {
|
|
2162
2191
|
case "error":
|
|
2163
|
-
return /* @__PURE__ */ (0,
|
|
2192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ErrorResult, { state });
|
|
2164
2193
|
case "results":
|
|
2165
|
-
return /* @__PURE__ */ (0,
|
|
2194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SearchResults, { state, trackEvent });
|
|
2166
2195
|
case "noResults":
|
|
2167
|
-
return /* @__PURE__ */ (0,
|
|
2196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(EmptySearchResult, { state });
|
|
2168
2197
|
case "pending":
|
|
2169
2198
|
default:
|
|
2170
2199
|
return null;
|
|
2171
2200
|
}
|
|
2172
2201
|
}
|
|
2173
2202
|
function EmptySearchResult({ state }) {
|
|
2174
|
-
return /* @__PURE__ */ (0,
|
|
2203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2175
2204
|
}
|
|
2176
2205
|
function SearchResults({
|
|
2177
2206
|
state,
|
|
2178
2207
|
trackEvent
|
|
2179
2208
|
}) {
|
|
2180
|
-
return /* @__PURE__ */ (0,
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
2181
2210
|
const { icon, image } = result;
|
|
2182
|
-
return /* @__PURE__ */ (0,
|
|
2211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2183
2212
|
import_components27.NavigationOption,
|
|
2184
2213
|
{
|
|
2185
2214
|
title: result.title,
|
|
2186
2215
|
content: result.description,
|
|
2187
|
-
media:
|
|
2216
|
+
media: OptionMedia({ icon, image }),
|
|
2188
2217
|
showMediaCircle: false,
|
|
2189
2218
|
showMediaAtAllSizes: true,
|
|
2190
2219
|
onClick: () => {
|
|
@@ -2205,7 +2234,7 @@ var import_components28 = require("@transferwise/components");
|
|
|
2205
2234
|
var import_icons2 = require("@transferwise/icons");
|
|
2206
2235
|
var import_react7 = require("react");
|
|
2207
2236
|
var import_react_intl13 = require("react-intl");
|
|
2208
|
-
var
|
|
2237
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2209
2238
|
function InlineSearchRenderer({
|
|
2210
2239
|
id,
|
|
2211
2240
|
isLoading,
|
|
@@ -2217,7 +2246,7 @@ function InlineSearchRenderer({
|
|
|
2217
2246
|
}) {
|
|
2218
2247
|
const [hasSearched, setHasSearched] = (0, import_react7.useState)(false);
|
|
2219
2248
|
const intl = (0, import_react_intl13.useIntl)();
|
|
2220
|
-
return /* @__PURE__ */ (0,
|
|
2249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2221
2250
|
import_components28.Typeahead,
|
|
2222
2251
|
{
|
|
2223
2252
|
id: "typeahead-input-id",
|
|
@@ -2225,10 +2254,10 @@ function InlineSearchRenderer({
|
|
|
2225
2254
|
name: "typeahead-input-name",
|
|
2226
2255
|
size: "md",
|
|
2227
2256
|
maxHeight: 100,
|
|
2228
|
-
footer: /* @__PURE__ */ (0,
|
|
2257
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2229
2258
|
multiple: false,
|
|
2230
2259
|
clearable: false,
|
|
2231
|
-
addon: /* @__PURE__ */ (0,
|
|
2260
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons2.Search, { size: 24 }),
|
|
2232
2261
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2233
2262
|
minQueryLength: 1,
|
|
2234
2263
|
onChange: (values) => {
|
|
@@ -2265,29 +2294,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2265
2294
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2266
2295
|
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2267
2296
|
if (state.type === "noResults") {
|
|
2268
|
-
return /* @__PURE__ */ (0,
|
|
2297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2269
2298
|
}
|
|
2270
2299
|
if (state.type === "error") {
|
|
2271
|
-
return /* @__PURE__ */ (0,
|
|
2300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ErrorResult, { state }) });
|
|
2272
2301
|
}
|
|
2273
2302
|
if (state.type === "pending" || isLoading) {
|
|
2274
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2275
2304
|
}
|
|
2276
2305
|
return null;
|
|
2277
2306
|
}
|
|
2278
2307
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2279
2308
|
|
|
2280
2309
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2281
|
-
var
|
|
2310
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2282
2311
|
var SearchRenderer = {
|
|
2283
2312
|
canRenderType: "search",
|
|
2284
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2313
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2285
2314
|
};
|
|
2286
2315
|
var SearchRenderer_default = SearchRenderer;
|
|
2287
2316
|
|
|
2288
2317
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2289
2318
|
var import_components29 = require("@transferwise/components");
|
|
2290
|
-
var
|
|
2319
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2291
2320
|
function RadioInputRendererComponent(props) {
|
|
2292
2321
|
const {
|
|
2293
2322
|
id,
|
|
@@ -2301,8 +2330,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2301
2330
|
validationState,
|
|
2302
2331
|
onSelect
|
|
2303
2332
|
} = props;
|
|
2304
|
-
return /* @__PURE__ */ (0,
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
2333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
2334
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2306
2335
|
FieldInput_default,
|
|
2307
2336
|
{
|
|
2308
2337
|
id,
|
|
@@ -2310,7 +2339,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2310
2339
|
help,
|
|
2311
2340
|
description,
|
|
2312
2341
|
validation: validationState,
|
|
2313
|
-
children: /* @__PURE__ */ (0,
|
|
2342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2314
2343
|
import_components29.RadioGroup,
|
|
2315
2344
|
{
|
|
2316
2345
|
name: id,
|
|
@@ -2319,7 +2348,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2319
2348
|
value: index,
|
|
2320
2349
|
secondary: option.description,
|
|
2321
2350
|
disabled: option.disabled || disabled,
|
|
2322
|
-
avatar: /* @__PURE__ */ (0,
|
|
2351
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2323
2352
|
})),
|
|
2324
2353
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2325
2354
|
onChange: onSelect
|
|
@@ -2335,7 +2364,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2335
2364
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2336
2365
|
var import_components30 = require("@transferwise/components");
|
|
2337
2366
|
var import_react8 = require("react");
|
|
2338
|
-
var
|
|
2367
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2339
2368
|
function TabInputRendererComponent(props) {
|
|
2340
2369
|
const {
|
|
2341
2370
|
id,
|
|
@@ -2354,8 +2383,8 @@ function TabInputRendererComponent(props) {
|
|
|
2354
2383
|
onSelect(0);
|
|
2355
2384
|
}
|
|
2356
2385
|
}, [selectedIndex, onSelect, options.length]);
|
|
2357
|
-
return /* @__PURE__ */ (0,
|
|
2358
|
-
/* @__PURE__ */ (0,
|
|
2386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
2387
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2359
2388
|
FieldInput_default,
|
|
2360
2389
|
{
|
|
2361
2390
|
id,
|
|
@@ -2363,7 +2392,7 @@ function TabInputRendererComponent(props) {
|
|
|
2363
2392
|
help,
|
|
2364
2393
|
description,
|
|
2365
2394
|
validation: validationState,
|
|
2366
|
-
children: /* @__PURE__ */ (0,
|
|
2395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2367
2396
|
import_components30.Tabs,
|
|
2368
2397
|
{
|
|
2369
2398
|
name: id,
|
|
@@ -2372,7 +2401,7 @@ function TabInputRendererComponent(props) {
|
|
|
2372
2401
|
title: option.title,
|
|
2373
2402
|
// if we pass null, we get some props-types console errors
|
|
2374
2403
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2375
|
-
content: /* @__PURE__ */ (0,
|
|
2404
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, {}),
|
|
2376
2405
|
disabled: option.disabled || disabled
|
|
2377
2406
|
})),
|
|
2378
2407
|
onTabSelect: onSelect
|
|
@@ -2387,7 +2416,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2387
2416
|
|
|
2388
2417
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2389
2418
|
var import_components31 = require("@transferwise/components");
|
|
2390
|
-
var
|
|
2419
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2391
2420
|
function SelectInputRendererComponent(props) {
|
|
2392
2421
|
const {
|
|
2393
2422
|
id,
|
|
@@ -2423,17 +2452,17 @@ function SelectInputRendererComponent(props) {
|
|
|
2423
2452
|
const contentProps = withinTrigger ? {
|
|
2424
2453
|
title: option.title,
|
|
2425
2454
|
note: option.description,
|
|
2426
|
-
icon:
|
|
2455
|
+
icon: getInlineAvatar(option)
|
|
2427
2456
|
} : {
|
|
2428
2457
|
title: option.title,
|
|
2429
2458
|
description: option.description,
|
|
2430
|
-
icon: /* @__PURE__ */ (0,
|
|
2459
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2431
2460
|
};
|
|
2432
|
-
return /* @__PURE__ */ (0,
|
|
2461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2433
2462
|
};
|
|
2434
2463
|
const extraProps = { autoComplete };
|
|
2435
|
-
return /* @__PURE__ */ (0,
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2437
2466
|
FieldInput_default,
|
|
2438
2467
|
{
|
|
2439
2468
|
id,
|
|
@@ -2441,7 +2470,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2441
2470
|
help,
|
|
2442
2471
|
description,
|
|
2443
2472
|
validation: validationState,
|
|
2444
|
-
children: /* @__PURE__ */ (0,
|
|
2473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2445
2474
|
import_components31.SelectInput,
|
|
2446
2475
|
__spreadValues({
|
|
2447
2476
|
name: id,
|
|
@@ -2464,7 +2493,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2464
2493
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2465
2494
|
var import_react9 = require("react");
|
|
2466
2495
|
var import_components32 = require("@transferwise/components");
|
|
2467
|
-
var
|
|
2496
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2468
2497
|
function SegmentedInputRendererComponent(props) {
|
|
2469
2498
|
const {
|
|
2470
2499
|
id,
|
|
@@ -2482,8 +2511,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2482
2511
|
onSelect(0);
|
|
2483
2512
|
}
|
|
2484
2513
|
}, [selectedIndex, onSelect, options.length]);
|
|
2485
|
-
return /* @__PURE__ */ (0,
|
|
2486
|
-
/* @__PURE__ */ (0,
|
|
2514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2487
2516
|
FieldInput_default,
|
|
2488
2517
|
{
|
|
2489
2518
|
id,
|
|
@@ -2491,7 +2520,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2491
2520
|
help,
|
|
2492
2521
|
description,
|
|
2493
2522
|
validation: validationState,
|
|
2494
|
-
children: /* @__PURE__ */ (0,
|
|
2523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2495
2524
|
import_components32.SegmentedControl,
|
|
2496
2525
|
{
|
|
2497
2526
|
name: `${id}-segmented-control`,
|
|
@@ -2508,26 +2537,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2508
2537
|
)
|
|
2509
2538
|
}
|
|
2510
2539
|
),
|
|
2511
|
-
/* @__PURE__ */ (0,
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { id: `${id}-children`, children })
|
|
2512
2541
|
] });
|
|
2513
2542
|
}
|
|
2514
2543
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2515
2544
|
|
|
2516
2545
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2517
|
-
var
|
|
2546
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2518
2547
|
var SelectInputRenderer = {
|
|
2519
2548
|
canRenderType: "input-select",
|
|
2520
2549
|
render: (props) => {
|
|
2521
2550
|
switch (props.control) {
|
|
2522
2551
|
case "radio":
|
|
2523
|
-
return /* @__PURE__ */ (0,
|
|
2552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2524
2553
|
case "tab":
|
|
2525
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2554
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2526
2555
|
case "segmented":
|
|
2527
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2556
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2528
2557
|
case "select":
|
|
2529
2558
|
default:
|
|
2530
|
-
return /* @__PURE__ */ (0,
|
|
2559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2531
2560
|
}
|
|
2532
2561
|
}
|
|
2533
2562
|
};
|
|
@@ -2535,17 +2564,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2535
2564
|
|
|
2536
2565
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2537
2566
|
var import_components33 = require("@transferwise/components");
|
|
2538
|
-
var
|
|
2567
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2539
2568
|
var StatusListRenderer = {
|
|
2540
2569
|
canRenderType: "status-list",
|
|
2541
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
2542
|
-
title ? /* @__PURE__ */ (0,
|
|
2543
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
2570
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: getMargin(margin), children: [
|
|
2571
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components33.Header, { title, className: "m-b-2" }) : null,
|
|
2572
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2544
2573
|
import_components33.Summary,
|
|
2545
2574
|
{
|
|
2546
2575
|
title: itemTitle,
|
|
2547
2576
|
description,
|
|
2548
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
2577
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
2549
2578
|
status: mapStatus(status),
|
|
2550
2579
|
action: getSummaryAction(callToAction)
|
|
2551
2580
|
},
|
|
@@ -2585,7 +2614,7 @@ var import_components35 = require("@transferwise/components");
|
|
|
2585
2614
|
|
|
2586
2615
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2587
2616
|
var import_components34 = require("@transferwise/components");
|
|
2588
|
-
var
|
|
2617
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2589
2618
|
var commonKeys = [
|
|
2590
2619
|
"autoComplete",
|
|
2591
2620
|
"autoCapitalize",
|
|
@@ -2604,12 +2633,12 @@ function VariableTextInput(inputProps) {
|
|
|
2604
2633
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
2605
2634
|
switch (control) {
|
|
2606
2635
|
case "email":
|
|
2607
|
-
return /* @__PURE__ */ (0,
|
|
2636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
2608
2637
|
case "password":
|
|
2609
|
-
return /* @__PURE__ */ (0,
|
|
2638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
2610
2639
|
case "numeric": {
|
|
2611
2640
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
2612
|
-
return /* @__PURE__ */ (0,
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2613
2642
|
TextInput,
|
|
2614
2643
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
2615
2644
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
@@ -2617,9 +2646,9 @@ function VariableTextInput(inputProps) {
|
|
|
2617
2646
|
);
|
|
2618
2647
|
}
|
|
2619
2648
|
case "phone-number":
|
|
2620
|
-
return /* @__PURE__ */ (0,
|
|
2649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components34.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
2621
2650
|
default: {
|
|
2622
|
-
return /* @__PURE__ */ (0,
|
|
2651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
2623
2652
|
}
|
|
2624
2653
|
}
|
|
2625
2654
|
}
|
|
@@ -2627,11 +2656,11 @@ function TextInput(props) {
|
|
|
2627
2656
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
2628
2657
|
const InputWithPattern = control === "textarea" ? import_components34.TextareaWithDisplayFormat : import_components34.InputWithDisplayFormat;
|
|
2629
2658
|
const InputWithoutPattern = control === "textarea" ? import_components34.TextArea : import_components34.Input;
|
|
2630
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
2659
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
2631
2660
|
}
|
|
2632
2661
|
|
|
2633
2662
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2634
|
-
var
|
|
2663
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2635
2664
|
var TextInputRenderer = {
|
|
2636
2665
|
canRenderType: "input-text",
|
|
2637
2666
|
render: (props) => {
|
|
@@ -2666,7 +2695,7 @@ var TextInputRenderer = {
|
|
|
2666
2695
|
}
|
|
2667
2696
|
}
|
|
2668
2697
|
});
|
|
2669
|
-
return /* @__PURE__ */ (0,
|
|
2698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2670
2699
|
FieldInput_default,
|
|
2671
2700
|
{
|
|
2672
2701
|
id,
|
|
@@ -2674,7 +2703,7 @@ var TextInputRenderer = {
|
|
|
2674
2703
|
description,
|
|
2675
2704
|
validation: validationState,
|
|
2676
2705
|
help,
|
|
2677
|
-
children: /* @__PURE__ */ (0,
|
|
2706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
2678
2707
|
}
|
|
2679
2708
|
);
|
|
2680
2709
|
}
|
|
@@ -2688,7 +2717,7 @@ var import_components36 = require("@transferwise/components");
|
|
|
2688
2717
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
2689
2718
|
|
|
2690
2719
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2691
|
-
var
|
|
2720
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2692
2721
|
var UploadInputRenderer = {
|
|
2693
2722
|
canRenderType: "input-upload",
|
|
2694
2723
|
render: (props) => {
|
|
@@ -2704,14 +2733,14 @@ var UploadInputRenderer = {
|
|
|
2704
2733
|
};
|
|
2705
2734
|
return (
|
|
2706
2735
|
// We don't pass help here as there is no sensible place to display it
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2708
2737
|
UploadFieldInput_default,
|
|
2709
2738
|
{
|
|
2710
2739
|
id,
|
|
2711
2740
|
label: void 0,
|
|
2712
2741
|
description: void 0,
|
|
2713
2742
|
validation: validationState,
|
|
2714
|
-
children: /* @__PURE__ */ (0,
|
|
2743
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2715
2744
|
import_components36.UploadInput,
|
|
2716
2745
|
{
|
|
2717
2746
|
id,
|
|
@@ -2768,7 +2797,7 @@ var LargeUploadRenderer = {
|
|
|
2768
2797
|
throw e;
|
|
2769
2798
|
}
|
|
2770
2799
|
};
|
|
2771
|
-
return /* @__PURE__ */ (0,
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2772
2801
|
FieldInput_default,
|
|
2773
2802
|
{
|
|
2774
2803
|
id,
|
|
@@ -2776,7 +2805,7 @@ var LargeUploadRenderer = {
|
|
|
2776
2805
|
description,
|
|
2777
2806
|
validation: validationState,
|
|
2778
2807
|
help,
|
|
2779
|
-
children: /* @__PURE__ */ (0,
|
|
2808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2780
2809
|
import_components36.Upload,
|
|
2781
2810
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2782
2811
|
usAccept: getAcceptsString(accepts),
|
|
@@ -2793,14 +2822,14 @@ var LargeUploadRenderer = {
|
|
|
2793
2822
|
|
|
2794
2823
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2795
2824
|
var import_components37 = require("@transferwise/components");
|
|
2796
|
-
var
|
|
2825
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2797
2826
|
var ReviewRenderer = {
|
|
2798
2827
|
canRenderType: "review",
|
|
2799
2828
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
2800
2829
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2801
|
-
return /* @__PURE__ */ (0,
|
|
2802
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
2830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: getMargin(margin), children: [
|
|
2831
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components37.Header, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
|
|
2832
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2804
2833
|
import_components37.DefinitionList,
|
|
2805
2834
|
{
|
|
2806
2835
|
layout: orientation,
|
|
@@ -2832,14 +2861,14 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2832
2861
|
};
|
|
2833
2862
|
var getFieldValue = (value, help, orientation) => {
|
|
2834
2863
|
if (help) {
|
|
2835
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
2836
|
-
/* @__PURE__ */ (0,
|
|
2864
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Help_default, { help }),
|
|
2837
2866
|
" ",
|
|
2838
2867
|
value
|
|
2839
|
-
] }) : /* @__PURE__ */ (0,
|
|
2868
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
2840
2869
|
value,
|
|
2841
2870
|
" ",
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Help_default, { help })
|
|
2843
2872
|
] });
|
|
2844
2873
|
}
|
|
2845
2874
|
return value;
|
|
@@ -2873,9 +2902,9 @@ var import_components40 = require("@transferwise/components");
|
|
|
2873
2902
|
// ../renderers/src/step/BackButton.tsx
|
|
2874
2903
|
var import_components38 = require("@transferwise/components");
|
|
2875
2904
|
var import_icons3 = require("@transferwise/icons");
|
|
2876
|
-
var
|
|
2905
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2877
2906
|
function BackButton({ title, onClick }) {
|
|
2878
|
-
return /* @__PURE__ */ (0,
|
|
2907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
2879
2908
|
"button",
|
|
2880
2909
|
{
|
|
2881
2910
|
type: "button",
|
|
@@ -2884,8 +2913,8 @@ function BackButton({ title, onClick }) {
|
|
|
2884
2913
|
"aria-label": title,
|
|
2885
2914
|
onClick,
|
|
2886
2915
|
children: [
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2888
|
-
/* @__PURE__ */ (0,
|
|
2916
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "sr-only", children: title }),
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components38.AvatarView, { interactive: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
2889
2918
|
]
|
|
2890
2919
|
}
|
|
2891
2920
|
) });
|
|
@@ -2922,17 +2951,17 @@ var external_confirmation_messages_default = (0, import_react_intl14.defineMessa
|
|
|
2922
2951
|
|
|
2923
2952
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
2924
2953
|
var import_components39 = require("@transferwise/components");
|
|
2925
|
-
var
|
|
2954
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2926
2955
|
function ExternalConfirmationDialog({
|
|
2927
2956
|
external,
|
|
2928
2957
|
onClose
|
|
2929
2958
|
}) {
|
|
2930
2959
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
2931
|
-
return /* @__PURE__ */ (0,
|
|
2932
|
-
/* @__PURE__ */ (0,
|
|
2933
|
-
/* @__PURE__ */ (0,
|
|
2934
|
-
/* @__PURE__ */ (0,
|
|
2935
|
-
/* @__PURE__ */ (0,
|
|
2960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.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) }) }),
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
2964
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2936
2965
|
import_components39.Button,
|
|
2937
2966
|
{
|
|
2938
2967
|
block: true,
|
|
@@ -2946,7 +2975,7 @@ function ExternalConfirmationDialog({
|
|
|
2946
2975
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2947
2976
|
}
|
|
2948
2977
|
),
|
|
2949
|
-
/* @__PURE__ */ (0,
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components39.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2950
2979
|
] }) })
|
|
2951
2980
|
] }) });
|
|
2952
2981
|
}
|
|
@@ -2975,7 +3004,7 @@ function useExternal(url) {
|
|
|
2975
3004
|
}
|
|
2976
3005
|
|
|
2977
3006
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2978
|
-
var
|
|
3007
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2979
3008
|
var StepRenderer = {
|
|
2980
3009
|
canRenderType: "step",
|
|
2981
3010
|
render: StepRendererComponent
|
|
@@ -2984,15 +3013,15 @@ function StepRendererComponent(props) {
|
|
|
2984
3013
|
const { back, description, error, external, title, children } = props;
|
|
2985
3014
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
2986
3015
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
2987
|
-
return /* @__PURE__ */ (0,
|
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
2988
3017
|
}
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
2990
|
-
back ? /* @__PURE__ */ (0,
|
|
2991
|
-
title || description ? /* @__PURE__ */ (0,
|
|
2992
|
-
title ? /* @__PURE__ */ (0,
|
|
2993
|
-
description ? /* @__PURE__ */ (0,
|
|
3018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
3019
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3020
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "m-b-4", children: [
|
|
3021
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
3022
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2994
3023
|
] }) : void 0,
|
|
2995
|
-
error ? /* @__PURE__ */ (0,
|
|
3024
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2996
3025
|
children
|
|
2997
3026
|
] });
|
|
2998
3027
|
}
|
|
@@ -3000,12 +3029,12 @@ function StepRendererComponent(props) {
|
|
|
3000
3029
|
// ../renderers/src/ListRenderer.tsx
|
|
3001
3030
|
var import_components41 = require("@transferwise/components");
|
|
3002
3031
|
var import_classnames6 = __toESM(require("classnames"));
|
|
3003
|
-
var
|
|
3032
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3004
3033
|
var ListRenderer = {
|
|
3005
3034
|
canRenderType: "list",
|
|
3006
|
-
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ (0,
|
|
3007
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
3008
|
-
items.map((props) => /* @__PURE__ */ (0,
|
|
3035
|
+
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: getMargin(margin), children: [
|
|
3036
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components41.Header, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
3037
|
+
items.map((props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(DesignSystemListItem, __spreadValues({}, props), props.title))
|
|
3009
3038
|
] })
|
|
3010
3039
|
};
|
|
3011
3040
|
var DesignSystemListItem = ({
|
|
@@ -3015,23 +3044,23 @@ var DesignSystemListItem = ({
|
|
|
3015
3044
|
subvalue,
|
|
3016
3045
|
icon,
|
|
3017
3046
|
image
|
|
3018
|
-
}) => /* @__PURE__ */ (0,
|
|
3047
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3019
3048
|
"label",
|
|
3020
3049
|
{
|
|
3021
3050
|
className: (0, import_classnames6.default)("np-option p-a-2", {
|
|
3022
3051
|
"np-option__sm-media": true,
|
|
3023
3052
|
"np-option__container-aligned": true
|
|
3024
3053
|
}),
|
|
3025
|
-
children: /* @__PURE__ */ (0,
|
|
3026
|
-
icon || image ? /* @__PURE__ */ (0,
|
|
3027
|
-
/* @__PURE__ */ (0,
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3054
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "media", children: [
|
|
3055
|
+
icon || image ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "media-left", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ListItemMedia, { image, icon }) }) : null,
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "media-body", children: [
|
|
3057
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
|
|
3031
3060
|
] }),
|
|
3032
|
-
/* @__PURE__ */ (0,
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "d-flex justify-content-between", children: [
|
|
3062
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components41.Body, { className: "d-block np-option__body", children: subtitle }),
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components41.Body, { className: "d-block np-option__body", children: subvalue })
|
|
3035
3064
|
] })
|
|
3036
3065
|
] })
|
|
3037
3066
|
] })
|
|
@@ -3040,10 +3069,10 @@ var DesignSystemListItem = ({
|
|
|
3040
3069
|
);
|
|
3041
3070
|
var ListItemMedia = ({ icon, image }) => {
|
|
3042
3071
|
if (icon) {
|
|
3043
|
-
return /* @__PURE__ */ (0,
|
|
3072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { icon, image }) });
|
|
3044
3073
|
}
|
|
3045
3074
|
if (image) {
|
|
3046
|
-
return /* @__PURE__ */ (0,
|
|
3075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { icon, image }) });
|
|
3047
3076
|
}
|
|
3048
3077
|
};
|
|
3049
3078
|
var getListAction = (callToAction) => {
|
|
@@ -3071,7 +3100,7 @@ var getListAction = (callToAction) => {
|
|
|
3071
3100
|
var ListRenderer_default = ListRenderer;
|
|
3072
3101
|
|
|
3073
3102
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3074
|
-
var
|
|
3103
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3075
3104
|
var SplashStepRenderer = {
|
|
3076
3105
|
canRenderType: "step",
|
|
3077
3106
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3081,10 +3110,10 @@ function SplashStepRendererComponent(props) {
|
|
|
3081
3110
|
const { back, children, external } = props;
|
|
3082
3111
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
3083
3112
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
3084
|
-
return /* @__PURE__ */ (0,
|
|
3113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
3085
3114
|
}
|
|
3086
|
-
return /* @__PURE__ */ (0,
|
|
3087
|
-
back ? /* @__PURE__ */ (0,
|
|
3115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3116
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3088
3117
|
children
|
|
3089
3118
|
] });
|
|
3090
3119
|
}
|
|
@@ -3106,7 +3135,7 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3106
3135
|
};
|
|
3107
3136
|
|
|
3108
3137
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3109
|
-
var
|
|
3138
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3110
3139
|
var SplashCelebrationStepRenderer = {
|
|
3111
3140
|
canRenderType: "step",
|
|
3112
3141
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3117,10 +3146,10 @@ function SplashCelebrationStepRendererComponent(props) {
|
|
|
3117
3146
|
useCustomTheme("forest-green", trackEvent);
|
|
3118
3147
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
3119
3148
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
3120
|
-
return /* @__PURE__ */ (0,
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
3121
3150
|
}
|
|
3122
|
-
return /* @__PURE__ */ (0,
|
|
3123
|
-
back ? /* @__PURE__ */ (0,
|
|
3151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3152
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3124
3153
|
children
|
|
3125
3154
|
] });
|
|
3126
3155
|
}
|
|
@@ -3163,7 +3192,7 @@ var getWiseRenderers = () => [
|
|
|
3163
3192
|
];
|
|
3164
3193
|
|
|
3165
3194
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3166
|
-
var appVersion = "4.
|
|
3195
|
+
var appVersion = "4.8.0";
|
|
3167
3196
|
|
|
3168
3197
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
3169
3198
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -3189,7 +3218,7 @@ var logToRollbar = (level, message, extra) => {
|
|
|
3189
3218
|
|
|
3190
3219
|
// src/dynamicFlow/telemetry/getTrackEvent.ts
|
|
3191
3220
|
var import_components_theming2 = require("@wise/components-theming");
|
|
3192
|
-
var getTrackEvent = (onEvent, onAnalytics, onThemeChange
|
|
3221
|
+
var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties) => {
|
|
3193
3222
|
onEvent == null ? void 0 : onEvent(name, properties);
|
|
3194
3223
|
if (name.includes(ThemeRequiredEventName)) {
|
|
3195
3224
|
const { theme } = properties != null ? properties : { theme: "personal" };
|
|
@@ -3199,23 +3228,15 @@ var getTrackEvent = (onEvent, onAnalytics, onThemeChange, onLog) => (name, prope
|
|
|
3199
3228
|
} else {
|
|
3200
3229
|
onAnalytics == null ? void 0 : onAnalytics(name, properties);
|
|
3201
3230
|
}
|
|
3202
|
-
if (name !== "DynamicFlow - Initiated") {
|
|
3203
|
-
if ((properties == null ? void 0 : properties.stepId) === void 0) {
|
|
3204
|
-
onLog == null ? void 0 : onLog("warning", "DynamicFlow warning. `stepId` is not defined in the event properties", {
|
|
3205
|
-
eventName: name,
|
|
3206
|
-
properties: Object.keys(properties != null ? properties : {})
|
|
3207
|
-
});
|
|
3208
|
-
}
|
|
3209
|
-
}
|
|
3210
3231
|
};
|
|
3211
3232
|
|
|
3212
3233
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3213
|
-
var
|
|
3234
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3214
3235
|
var wiseRenderers = getWiseRenderers();
|
|
3215
3236
|
function DynamicFlowLegacy(props) {
|
|
3216
3237
|
const { customFetch = globalThis.fetch } = props;
|
|
3217
3238
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3218
|
-
return /* @__PURE__ */ (0,
|
|
3239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
3219
3240
|
}
|
|
3220
3241
|
function DynamicFlowRevamp(props) {
|
|
3221
3242
|
const {
|
|
@@ -3231,8 +3252,8 @@ function DynamicFlowRevamp(props) {
|
|
|
3231
3252
|
const mergedRenderers = (0, import_react12.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3232
3253
|
const logEvent = (0, import_react12.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3233
3254
|
const trackEvent = (0, import_react12.useMemo)(
|
|
3234
|
-
() => getTrackEvent(onEvent, onAnalytics, onThemeChange
|
|
3235
|
-
[onEvent, onAnalytics, onThemeChange
|
|
3255
|
+
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3256
|
+
[onEvent, onAnalytics, onThemeChange]
|
|
3236
3257
|
);
|
|
3237
3258
|
const coreProps = __spreadProps(__spreadValues({}, props), {
|
|
3238
3259
|
httpClient,
|
|
@@ -3241,7 +3262,7 @@ function DynamicFlowRevamp(props) {
|
|
|
3241
3262
|
onLog: logEvent,
|
|
3242
3263
|
onLink
|
|
3243
3264
|
});
|
|
3244
|
-
return /* @__PURE__ */ (0,
|
|
3265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
|
|
3245
3266
|
}
|
|
3246
3267
|
var DynamicForm = (0, import_react12.forwardRef)(function DynamicForm2(props, ref) {
|
|
3247
3268
|
const {
|
|
@@ -3257,8 +3278,8 @@ var DynamicForm = (0, import_react12.forwardRef)(function DynamicForm2(props, re
|
|
|
3257
3278
|
const mergedRenderers = (0, import_react12.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3258
3279
|
const logEvent = (0, import_react12.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3259
3280
|
const trackEvent = (0, import_react12.useMemo)(
|
|
3260
|
-
() => getTrackEvent(onEvent, onAnalytics, onThemeChange
|
|
3261
|
-
[onEvent, onAnalytics, onThemeChange
|
|
3281
|
+
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3282
|
+
[onEvent, onAnalytics, onThemeChange]
|
|
3262
3283
|
);
|
|
3263
3284
|
const coreProps = __spreadProps(__spreadValues({}, props), {
|
|
3264
3285
|
httpClient,
|
|
@@ -3267,7 +3288,7 @@ var DynamicForm = (0, import_react12.forwardRef)(function DynamicForm2(props, re
|
|
|
3267
3288
|
onLog: logEvent,
|
|
3268
3289
|
onLink
|
|
3269
3290
|
});
|
|
3270
|
-
return /* @__PURE__ */ (0,
|
|
3291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref }));
|
|
3271
3292
|
});
|
|
3272
3293
|
var useWiseHttpClient = (httpClient) => {
|
|
3273
3294
|
const { locale } = (0, import_react_intl16.useIntl)();
|