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