@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.mjs
CHANGED
|
@@ -639,8 +639,8 @@ import {
|
|
|
639
639
|
import { Alert } from "@transferwise/components";
|
|
640
640
|
|
|
641
641
|
// ../renderers/src/utils/layout-utils.ts
|
|
642
|
-
var getMargin = (
|
|
643
|
-
switch (
|
|
642
|
+
var getMargin = (size) => {
|
|
643
|
+
switch (size) {
|
|
644
644
|
case "xs":
|
|
645
645
|
return "m-b-0";
|
|
646
646
|
case "sm":
|
|
@@ -838,7 +838,7 @@ import { Button } from "@transferwise/components";
|
|
|
838
838
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
839
839
|
var ButtonRenderer = {
|
|
840
840
|
canRenderType: "button",
|
|
841
|
-
render: ({ control, context, disabled, margin, title, size
|
|
841
|
+
render: ({ control, context, disabled, margin, title, size, onClick }) => {
|
|
842
842
|
const priority = mapControl(control);
|
|
843
843
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
844
844
|
return /* @__PURE__ */ jsx7(
|
|
@@ -848,7 +848,7 @@ var ButtonRenderer = {
|
|
|
848
848
|
className: getMargin(margin),
|
|
849
849
|
disabled,
|
|
850
850
|
priority,
|
|
851
|
-
size: mapSize(
|
|
851
|
+
size: mapSize(size),
|
|
852
852
|
type,
|
|
853
853
|
onClick,
|
|
854
854
|
children: title
|
|
@@ -874,11 +874,11 @@ var mapControl = (control) => {
|
|
|
874
874
|
return "secondary";
|
|
875
875
|
}
|
|
876
876
|
};
|
|
877
|
-
var mapSize = (
|
|
878
|
-
if (!
|
|
877
|
+
var mapSize = (size) => {
|
|
878
|
+
if (!size) {
|
|
879
879
|
return void 0;
|
|
880
880
|
}
|
|
881
|
-
switch (
|
|
881
|
+
switch (size) {
|
|
882
882
|
case "xs":
|
|
883
883
|
case "sm":
|
|
884
884
|
return "sm";
|
|
@@ -918,9 +918,6 @@ import { DateInput, DateLookup } from "@transferwise/components";
|
|
|
918
918
|
|
|
919
919
|
// ../renderers/src/validators/type-validators.ts
|
|
920
920
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
921
|
-
var isNull = (value) => value === null;
|
|
922
|
-
var isUndefined = (value) => typeof value === "undefined";
|
|
923
|
-
var isNullish = (v) => isNull(v) || isUndefined(v);
|
|
924
921
|
|
|
925
922
|
// ../renderers/src/utils/value-utils.ts
|
|
926
923
|
var numericValueOrNull = (newValue) => /^\d+$/.test(newValue) && !Number.isNaN(Number.parseFloat(newValue)) ? newValue : null;
|
|
@@ -1037,6 +1034,12 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
1037
1034
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1038
1035
|
import { Header, NavigationOption, NavigationOptionsList } from "@transferwise/components";
|
|
1039
1036
|
|
|
1037
|
+
// ../renderers/src/components/OptionMedia.tsx
|
|
1038
|
+
import { AvatarView as AvatarView2 } from "@transferwise/components";
|
|
1039
|
+
|
|
1040
|
+
// ../renderers/src/utils/image-utils.tsx
|
|
1041
|
+
import { AvatarView } from "@transferwise/components";
|
|
1042
|
+
|
|
1040
1043
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1041
1044
|
import { Flag } from "@wise/art";
|
|
1042
1045
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -1080,27 +1083,33 @@ function DynamicIcon({ name }) {
|
|
|
1080
1083
|
}
|
|
1081
1084
|
var DynamicIcon_default = DynamicIcon;
|
|
1082
1085
|
|
|
1083
|
-
// ../renderers/src/
|
|
1084
|
-
import {
|
|
1086
|
+
// ../renderers/src/utils/UrnFlag.tsx
|
|
1087
|
+
import { Flag as Flag2 } from "@wise/art";
|
|
1085
1088
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1089
|
+
var countryUrnPrefix = "urn:wise:countries:";
|
|
1090
|
+
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
1091
|
+
var isUrnFlag = (uri) => uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix);
|
|
1092
|
+
function UrnFlag({ size, urn }) {
|
|
1093
|
+
return /* @__PURE__ */ jsx14(Flag2, { code: getCode(urn), intrinsicSize: size });
|
|
1094
|
+
}
|
|
1095
|
+
var getCode = (urn) => {
|
|
1096
|
+
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
// ../renderers/src/utils/image-utils.tsx
|
|
1100
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1101
|
+
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
1102
|
+
if (iconNode && imageNode) {
|
|
1103
|
+
if (imageNode && iconNode) {
|
|
1104
|
+
return /* @__PURE__ */ jsx15(AvatarView, { size, badge: { asset: iconNode }, children: imageNode });
|
|
1092
1105
|
}
|
|
1093
|
-
return imageNode;
|
|
1094
|
-
}
|
|
1095
|
-
if (iconNode) {
|
|
1096
|
-
return /* @__PURE__ */ jsx14(AvatarView, { children: iconNode });
|
|
1097
1106
|
}
|
|
1098
1107
|
return null;
|
|
1099
|
-
}
|
|
1108
|
+
};
|
|
1100
1109
|
var getIconNode = (icon) => {
|
|
1101
|
-
if (
|
|
1110
|
+
if (icon) {
|
|
1102
1111
|
if ("name" in icon) {
|
|
1103
|
-
return /* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ jsx15(DynamicIcon_default, { name: icon.name });
|
|
1104
1113
|
}
|
|
1105
1114
|
if (icon.text) {
|
|
1106
1115
|
return icon.text;
|
|
@@ -1108,32 +1117,54 @@ var getIconNode = (icon) => {
|
|
|
1108
1117
|
}
|
|
1109
1118
|
return null;
|
|
1110
1119
|
};
|
|
1111
|
-
var getImageNode = (image) => {
|
|
1120
|
+
var getImageNode = (image, size) => {
|
|
1112
1121
|
if (image) {
|
|
1113
1122
|
const { accessibilityDescription, uri } = image;
|
|
1114
1123
|
if (!uri.startsWith("urn:")) {
|
|
1115
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ jsx15("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
1125
|
+
}
|
|
1126
|
+
if (isUrnFlag(uri)) {
|
|
1127
|
+
return /* @__PURE__ */ jsx15(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
1116
1128
|
}
|
|
1117
1129
|
}
|
|
1118
1130
|
return null;
|
|
1119
1131
|
};
|
|
1120
1132
|
|
|
1133
|
+
// ../renderers/src/components/OptionMedia.tsx
|
|
1134
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1135
|
+
var mediaSize = 64;
|
|
1136
|
+
var badgeMediaSize = 48;
|
|
1137
|
+
function OptionMedia({ icon, image }) {
|
|
1138
|
+
const imageNode = getImageNode(image, mediaSize);
|
|
1139
|
+
const iconNode = getIconNode(icon);
|
|
1140
|
+
const badge = getBadgedMedia(iconNode, imageNode, badgeMediaSize);
|
|
1141
|
+
if (badge) {
|
|
1142
|
+
return badge;
|
|
1143
|
+
}
|
|
1144
|
+
if (imageNode) {
|
|
1145
|
+
return imageNode;
|
|
1146
|
+
}
|
|
1147
|
+
if (iconNode) {
|
|
1148
|
+
return /* @__PURE__ */ jsx16(AvatarView2, { children: iconNode });
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1121
1152
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1122
|
-
import { jsx as
|
|
1153
|
+
import { jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1123
1154
|
var DecisionRenderer = {
|
|
1124
1155
|
canRenderType: "decision",
|
|
1125
1156
|
render: ({ margin, options, title }) => /* @__PURE__ */ jsxs3("div", { className: getMargin(margin), children: [
|
|
1126
|
-
title && /* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1157
|
+
title && /* @__PURE__ */ jsx17(Header, { as: "h2", title }),
|
|
1158
|
+
/* @__PURE__ */ jsx17(NavigationOptionsList, { children: options.map((option) => {
|
|
1128
1159
|
const { description, disabled, icon, image, title: itemTitle, onClick } = option;
|
|
1129
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ jsx17(
|
|
1130
1161
|
NavigationOption,
|
|
1131
1162
|
{
|
|
1132
1163
|
title: itemTitle,
|
|
1133
1164
|
content: description,
|
|
1134
1165
|
disabled,
|
|
1135
|
-
media: /* @__PURE__ */
|
|
1136
|
-
showMediaCircle:
|
|
1166
|
+
media: /* @__PURE__ */ jsx17(OptionMedia, { icon, image }),
|
|
1167
|
+
showMediaCircle: false,
|
|
1137
1168
|
showMediaAtAllSizes: true,
|
|
1138
1169
|
onClick
|
|
1139
1170
|
},
|
|
@@ -1145,35 +1176,35 @@ var DecisionRenderer = {
|
|
|
1145
1176
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1146
1177
|
|
|
1147
1178
|
// ../renderers/src/DividerRenderer.tsx
|
|
1148
|
-
import { jsx as
|
|
1179
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1149
1180
|
var DividerRenderer = {
|
|
1150
1181
|
canRenderType: "divider",
|
|
1151
|
-
render: ({ margin }) => /* @__PURE__ */
|
|
1182
|
+
render: ({ margin }) => /* @__PURE__ */ jsx18("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1152
1183
|
};
|
|
1153
1184
|
var DividerRenderer_default = DividerRenderer;
|
|
1154
1185
|
|
|
1155
1186
|
// ../renderers/src/FormRenderer.tsx
|
|
1156
|
-
import { jsx as
|
|
1187
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1157
1188
|
var FormRenderer = {
|
|
1158
1189
|
canRenderType: "form",
|
|
1159
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1190
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx19("div", { className: getMargin(margin), children })
|
|
1160
1191
|
};
|
|
1161
1192
|
var FormRenderer_default = FormRenderer;
|
|
1162
1193
|
|
|
1163
1194
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1164
1195
|
import { Header as Header2 } from "@transferwise/components";
|
|
1165
|
-
import { jsx as
|
|
1196
|
+
import { jsx as jsx20, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1166
1197
|
var FormSectionRenderer = {
|
|
1167
1198
|
canRenderType: "section",
|
|
1168
1199
|
render: ({ title, description, children }) => /* @__PURE__ */ jsxs4("fieldset", { children: [
|
|
1169
|
-
title && /* @__PURE__ */
|
|
1200
|
+
title && /* @__PURE__ */ jsx20(
|
|
1170
1201
|
Header2,
|
|
1171
1202
|
{
|
|
1172
1203
|
as: "h2",
|
|
1173
1204
|
title
|
|
1174
1205
|
}
|
|
1175
1206
|
),
|
|
1176
|
-
description && /* @__PURE__ */
|
|
1207
|
+
description && /* @__PURE__ */ jsx20("p", { children: description }),
|
|
1177
1208
|
children
|
|
1178
1209
|
] })
|
|
1179
1210
|
};
|
|
@@ -1181,36 +1212,36 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1181
1212
|
|
|
1182
1213
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1183
1214
|
import { Display } from "@transferwise/components";
|
|
1184
|
-
import { jsx as
|
|
1215
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1185
1216
|
var HeadingRenderer = {
|
|
1186
1217
|
canRenderType: "heading",
|
|
1187
|
-
render: (props) => /* @__PURE__ */
|
|
1218
|
+
render: (props) => /* @__PURE__ */ jsx21(Heading, __spreadValues({}, props))
|
|
1188
1219
|
};
|
|
1189
1220
|
function Heading(props) {
|
|
1190
|
-
const { text, size
|
|
1221
|
+
const { text, size, align, margin, control } = props;
|
|
1191
1222
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1192
|
-
return control === "display" ? /* @__PURE__ */
|
|
1223
|
+
return control === "display" ? /* @__PURE__ */ jsx21(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx21(StandardHeading, { size, text, className });
|
|
1193
1224
|
}
|
|
1194
|
-
function DisplayHeading({ size
|
|
1195
|
-
return /* @__PURE__ */
|
|
1225
|
+
function DisplayHeading({ size, text, className }) {
|
|
1226
|
+
return /* @__PURE__ */ jsx21(Display, { type: getDisplayType(size), className, children: text });
|
|
1196
1227
|
}
|
|
1197
|
-
function StandardHeading({ size
|
|
1198
|
-
switch (
|
|
1228
|
+
function StandardHeading({ size, text, className }) {
|
|
1229
|
+
switch (size) {
|
|
1199
1230
|
case "xs":
|
|
1200
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ jsx21("h5", { className, children: text });
|
|
1201
1232
|
case "sm":
|
|
1202
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ jsx21("h4", { className, children: text });
|
|
1203
1234
|
case "lg":
|
|
1204
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ jsx21("h2", { className, children: text });
|
|
1205
1236
|
case "xl":
|
|
1206
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ jsx21("h1", { className, children: text });
|
|
1207
1238
|
case "md":
|
|
1208
1239
|
default:
|
|
1209
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ jsx21("h3", { className, children: text });
|
|
1210
1241
|
}
|
|
1211
1242
|
}
|
|
1212
|
-
var getDisplayType = (
|
|
1213
|
-
switch (
|
|
1243
|
+
var getDisplayType = (size) => {
|
|
1244
|
+
switch (size) {
|
|
1214
1245
|
case "xs":
|
|
1215
1246
|
case "sm":
|
|
1216
1247
|
return "display-small";
|
|
@@ -1236,12 +1267,12 @@ function isRelativePath(url = "") {
|
|
|
1236
1267
|
}
|
|
1237
1268
|
|
|
1238
1269
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1239
|
-
import { jsx as
|
|
1270
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1240
1271
|
function UrlImage({
|
|
1241
1272
|
accessibilityDescription,
|
|
1242
1273
|
align,
|
|
1243
1274
|
margin,
|
|
1244
|
-
size
|
|
1275
|
+
size,
|
|
1245
1276
|
uri,
|
|
1246
1277
|
httpClient
|
|
1247
1278
|
}) {
|
|
@@ -1251,7 +1282,7 @@ function UrlImage({
|
|
|
1251
1282
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1252
1283
|
}
|
|
1253
1284
|
}, [uri, httpClient]);
|
|
1254
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ jsx22("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ jsx22(
|
|
1255
1286
|
Image,
|
|
1256
1287
|
{
|
|
1257
1288
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1294,6 +1325,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1294
1325
|
}
|
|
1295
1326
|
};
|
|
1296
1327
|
|
|
1328
|
+
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1329
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1330
|
+
var maxFlagSize = 600;
|
|
1331
|
+
function UrnFlagImage({
|
|
1332
|
+
accessibilityDescription,
|
|
1333
|
+
align,
|
|
1334
|
+
margin,
|
|
1335
|
+
size,
|
|
1336
|
+
uri
|
|
1337
|
+
}) {
|
|
1338
|
+
return /* @__PURE__ */ jsx23("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx23(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1297
1341
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1298
1342
|
import {
|
|
1299
1343
|
Illustration,
|
|
@@ -1315,23 +1359,23 @@ var isAnimated = (uri) => {
|
|
|
1315
1359
|
};
|
|
1316
1360
|
|
|
1317
1361
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1318
|
-
import { jsx as
|
|
1362
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1319
1363
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1320
1364
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1321
1365
|
function UrnIllustration({
|
|
1322
1366
|
accessibilityDescription,
|
|
1323
1367
|
align,
|
|
1324
1368
|
margin,
|
|
1325
|
-
size
|
|
1369
|
+
size,
|
|
1326
1370
|
uri
|
|
1327
1371
|
}) {
|
|
1328
|
-
const illustrationSize = getIllustrationSize(
|
|
1372
|
+
const illustrationSize = getIllustrationSize(size);
|
|
1329
1373
|
const illustrationName = getIllustrationName(uri);
|
|
1330
1374
|
const illustration3DName = getIllustration3DName(uri);
|
|
1331
1375
|
if (illustration3DName && isAnimated(uri)) {
|
|
1332
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ jsx24("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx24(Illustration3D, { name: illustration3DName, size: illustrationSize }) });
|
|
1333
1377
|
}
|
|
1334
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ jsx24("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx24(
|
|
1335
1379
|
Illustration,
|
|
1336
1380
|
{
|
|
1337
1381
|
className: "df-illustration",
|
|
@@ -1341,7 +1385,7 @@ function UrnIllustration({
|
|
|
1341
1385
|
}
|
|
1342
1386
|
) });
|
|
1343
1387
|
}
|
|
1344
|
-
var getIllustrationSize = (
|
|
1388
|
+
var getIllustrationSize = (size) => ({ xs: "small", sm: "small", md: "medium", lg: "large", xl: "large" })[size] || "medium";
|
|
1345
1389
|
var getIllustrationName = (uri) => {
|
|
1346
1390
|
return uri.replace(urnPrefix, "").split("?")[0];
|
|
1347
1391
|
};
|
|
@@ -1351,21 +1395,24 @@ var getIllustration3DName = (uri) => {
|
|
|
1351
1395
|
};
|
|
1352
1396
|
|
|
1353
1397
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1354
|
-
import { jsx as
|
|
1398
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1355
1399
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1356
1400
|
function UrnImage(props) {
|
|
1357
1401
|
const { uri } = props;
|
|
1358
1402
|
if (isUrnIllustration(uri)) {
|
|
1359
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsx25(UrnIllustration, __spreadValues({}, props));
|
|
1404
|
+
}
|
|
1405
|
+
if (isUrnFlag(uri)) {
|
|
1406
|
+
return /* @__PURE__ */ jsx25(UrnFlagImage, __spreadValues({}, props));
|
|
1360
1407
|
}
|
|
1361
1408
|
return null;
|
|
1362
1409
|
}
|
|
1363
1410
|
|
|
1364
1411
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1365
|
-
import { jsx as
|
|
1412
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1366
1413
|
var ImageRenderer = {
|
|
1367
1414
|
canRenderType: "image",
|
|
1368
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
1415
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx26(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx26(UrlImage, __spreadValues({}, props))
|
|
1369
1416
|
};
|
|
1370
1417
|
|
|
1371
1418
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -1373,7 +1420,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
1373
1420
|
|
|
1374
1421
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1375
1422
|
import { Header as Header3, InstructionsList } from "@transferwise/components";
|
|
1376
|
-
import { jsx as
|
|
1423
|
+
import { jsx as jsx27, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1377
1424
|
var doContext = ["positive", "neutral"];
|
|
1378
1425
|
var dontContext = ["warning", "negative"];
|
|
1379
1426
|
var InstructionsRenderer = {
|
|
@@ -1382,8 +1429,8 @@ var InstructionsRenderer = {
|
|
|
1382
1429
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1383
1430
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1384
1431
|
return /* @__PURE__ */ jsxs5("div", { className: getMargin(margin), children: [
|
|
1385
|
-
title ? /* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1432
|
+
title ? /* @__PURE__ */ jsx27(Header3, { title }) : null,
|
|
1433
|
+
/* @__PURE__ */ jsx27(InstructionsList, { dos, donts })
|
|
1387
1434
|
] });
|
|
1388
1435
|
}
|
|
1389
1436
|
};
|
|
@@ -1399,25 +1446,25 @@ var onWheel = (event) => {
|
|
|
1399
1446
|
}
|
|
1400
1447
|
};
|
|
1401
1448
|
|
|
1402
|
-
// ../renderers/src/utils/
|
|
1403
|
-
import { AvatarView as
|
|
1404
|
-
import { jsx as
|
|
1405
|
-
var
|
|
1406
|
-
function
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1449
|
+
// ../renderers/src/utils/getInlineAvatar.tsx
|
|
1450
|
+
import { AvatarView as AvatarView3 } from "@transferwise/components";
|
|
1451
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1452
|
+
var mediaSize2 = 24;
|
|
1453
|
+
function getInlineAvatar({ icon, image }) {
|
|
1454
|
+
const imageNode = getImageNode(image, mediaSize2);
|
|
1455
|
+
const iconNode = getIconNode(icon);
|
|
1456
|
+
const badge = getBadgedMedia(iconNode, imageNode, mediaSize2);
|
|
1457
|
+
if (badge) {
|
|
1458
|
+
return badge;
|
|
1412
1459
|
}
|
|
1413
|
-
if (
|
|
1414
|
-
return
|
|
1460
|
+
if (imageNode) {
|
|
1461
|
+
return imageNode;
|
|
1415
1462
|
}
|
|
1416
|
-
if (isNamedIcon2(icon)) {
|
|
1417
|
-
return
|
|
1463
|
+
if (isNamedIcon2(icon) && !isFlagIcon2(icon)) {
|
|
1464
|
+
return iconNode;
|
|
1418
1465
|
}
|
|
1419
|
-
if (
|
|
1420
|
-
return /* @__PURE__ */
|
|
1466
|
+
if (iconNode) {
|
|
1467
|
+
return /* @__PURE__ */ jsx28(AvatarView3, { size: mediaSize2, children: iconNode });
|
|
1421
1468
|
}
|
|
1422
1469
|
return null;
|
|
1423
1470
|
}
|
|
@@ -1426,7 +1473,7 @@ var isFlagIcon2 = (icon) => isNamedIcon2(icon) && icon.name.startsWith("flag-");
|
|
|
1426
1473
|
|
|
1427
1474
|
// ../renderers/src/utils/getInputGroupAddonStart.tsx
|
|
1428
1475
|
var getInputGroupAddonStart = ({ icon, image }) => {
|
|
1429
|
-
const content =
|
|
1476
|
+
const content = getInlineAvatar({ icon, image });
|
|
1430
1477
|
return content ? { content } : void 0;
|
|
1431
1478
|
};
|
|
1432
1479
|
|
|
@@ -1440,7 +1487,7 @@ function pick(obj, ...keys) {
|
|
|
1440
1487
|
}
|
|
1441
1488
|
|
|
1442
1489
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1443
|
-
import { jsx as
|
|
1490
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1444
1491
|
var IntegerInputRenderer = {
|
|
1445
1492
|
canRenderType: "input-integer",
|
|
1446
1493
|
render: (props) => {
|
|
@@ -1455,7 +1502,7 @@ var IntegerInputRenderer = {
|
|
|
1455
1502
|
"maximum",
|
|
1456
1503
|
"minimum"
|
|
1457
1504
|
);
|
|
1458
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx29(
|
|
1459
1506
|
FieldInput_default,
|
|
1460
1507
|
{
|
|
1461
1508
|
id,
|
|
@@ -1463,7 +1510,7 @@ var IntegerInputRenderer = {
|
|
|
1463
1510
|
description,
|
|
1464
1511
|
validation: validationState,
|
|
1465
1512
|
help,
|
|
1466
|
-
children: /* @__PURE__ */
|
|
1513
|
+
children: /* @__PURE__ */ jsx29(InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx29(
|
|
1467
1514
|
Input,
|
|
1468
1515
|
__spreadValues({
|
|
1469
1516
|
id,
|
|
@@ -1487,13 +1534,13 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1487
1534
|
|
|
1488
1535
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1489
1536
|
import { Loader } from "@transferwise/components";
|
|
1490
|
-
import { jsx as
|
|
1537
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1491
1538
|
var LoadingIndicatorRenderer = {
|
|
1492
1539
|
canRenderType: "loading-indicator",
|
|
1493
|
-
render: ({ margin, size
|
|
1540
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx30(
|
|
1494
1541
|
Loader,
|
|
1495
1542
|
{
|
|
1496
|
-
size
|
|
1543
|
+
size,
|
|
1497
1544
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
1498
1545
|
"data-testid": "loading-indicator"
|
|
1499
1546
|
}
|
|
@@ -1503,28 +1550,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1503
1550
|
|
|
1504
1551
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1505
1552
|
import { Markdown as Markdown2 } from "@transferwise/components";
|
|
1506
|
-
import { jsx as
|
|
1553
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1507
1554
|
var MarkdownRenderer = {
|
|
1508
1555
|
canRenderType: "markdown",
|
|
1509
|
-
render: ({ content, align, margin }) => /* @__PURE__ */
|
|
1556
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx31("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx31(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1510
1557
|
};
|
|
1511
1558
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1512
1559
|
|
|
1513
1560
|
// ../renderers/src/ModalRenderer.tsx
|
|
1514
1561
|
import { Button as Button2, Modal } from "@transferwise/components";
|
|
1515
1562
|
import { useState as useState2 } from "react";
|
|
1516
|
-
import { jsx as
|
|
1563
|
+
import { jsx as jsx32, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1517
1564
|
var ModalRenderer = {
|
|
1518
1565
|
canRenderType: "modal",
|
|
1519
|
-
render: (props) => /* @__PURE__ */
|
|
1566
|
+
render: (props) => /* @__PURE__ */ jsx32(DFModal, __spreadValues({}, props))
|
|
1520
1567
|
};
|
|
1521
1568
|
var ModalRenderer_default = ModalRenderer;
|
|
1522
1569
|
function DFModal({ content, margin, trigger }) {
|
|
1523
1570
|
const [visible, setVisible] = useState2(false);
|
|
1524
1571
|
const { children, title } = content;
|
|
1525
1572
|
return /* @__PURE__ */ jsxs6("div", { className: getMargin(margin), children: [
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ jsx32(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1574
|
+
/* @__PURE__ */ jsx32(
|
|
1528
1575
|
Modal,
|
|
1529
1576
|
{
|
|
1530
1577
|
scroll: "content",
|
|
@@ -1540,24 +1587,7 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1540
1587
|
|
|
1541
1588
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1542
1589
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
1543
|
-
|
|
1544
|
-
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1545
|
-
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
1546
|
-
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1547
|
-
function OptionMedia({ icon, image }) {
|
|
1548
|
-
if (image && !image.uri.startsWith("urn:")) {
|
|
1549
|
-
return /* @__PURE__ */ jsx30("img", { src: image.uri, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1550
|
-
}
|
|
1551
|
-
if (icon && "name" in icon) {
|
|
1552
|
-
return /* @__PURE__ */ jsx30(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx30(DynamicIcon_default, { name: icon.name }) });
|
|
1553
|
-
}
|
|
1554
|
-
if (icon && "text" in icon) {
|
|
1555
|
-
return /* @__PURE__ */ jsx30(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
|
|
1556
|
-
}
|
|
1557
|
-
return null;
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1590
|
+
import { useState as useState3 } from "react";
|
|
1561
1591
|
import { useIntl as useIntl2 } from "react-intl";
|
|
1562
1592
|
|
|
1563
1593
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
@@ -1571,11 +1601,10 @@ var multi_select_messages_default = defineMessages2({
|
|
|
1571
1601
|
});
|
|
1572
1602
|
|
|
1573
1603
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1574
|
-
import {
|
|
1575
|
-
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1604
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1576
1605
|
var MultiSelectInputRenderer = {
|
|
1577
1606
|
canRenderType: "input-multi-select",
|
|
1578
|
-
render: (props) => /* @__PURE__ */
|
|
1607
|
+
render: (props) => /* @__PURE__ */ jsx33(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1579
1608
|
};
|
|
1580
1609
|
function MultiSelectInputRendererComponent(props) {
|
|
1581
1610
|
const { formatMessage } = useIntl2();
|
|
@@ -1617,12 +1646,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1617
1646
|
const contentProps = {
|
|
1618
1647
|
title: option.title,
|
|
1619
1648
|
description: option.description,
|
|
1620
|
-
icon: /* @__PURE__ */
|
|
1649
|
+
icon: /* @__PURE__ */ jsx33(OptionMedia, { icon: option.icon, image: option.image })
|
|
1621
1650
|
};
|
|
1622
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsx33(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1623
1652
|
};
|
|
1624
1653
|
const extraProps = { autoComplete };
|
|
1625
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx33(
|
|
1626
1655
|
FieldInput_default,
|
|
1627
1656
|
{
|
|
1628
1657
|
id,
|
|
@@ -1630,7 +1659,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1630
1659
|
help,
|
|
1631
1660
|
description,
|
|
1632
1661
|
validation: validationState,
|
|
1633
|
-
children: /* @__PURE__ */
|
|
1662
|
+
children: /* @__PURE__ */ jsx33(
|
|
1634
1663
|
SelectInput,
|
|
1635
1664
|
__spreadValues({
|
|
1636
1665
|
id,
|
|
@@ -1674,7 +1703,7 @@ import { UploadInput } from "@transferwise/components";
|
|
|
1674
1703
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1675
1704
|
import { InlineAlert } from "@transferwise/components";
|
|
1676
1705
|
import classNames3 from "classnames";
|
|
1677
|
-
import { jsx as
|
|
1706
|
+
import { jsx as jsx34, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1678
1707
|
function UploadFieldInput({
|
|
1679
1708
|
id,
|
|
1680
1709
|
children,
|
|
@@ -1683,7 +1712,7 @@ function UploadFieldInput({
|
|
|
1683
1712
|
help,
|
|
1684
1713
|
validation
|
|
1685
1714
|
}) {
|
|
1686
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1715
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx34(LabelContentWithHelp, { text: label, help }) : label;
|
|
1687
1716
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1688
1717
|
return /* @__PURE__ */ jsxs7(
|
|
1689
1718
|
"div",
|
|
@@ -1692,9 +1721,9 @@ function UploadFieldInput({
|
|
|
1692
1721
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1693
1722
|
}),
|
|
1694
1723
|
children: [
|
|
1695
|
-
/* @__PURE__ */
|
|
1724
|
+
/* @__PURE__ */ jsx34("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1696
1725
|
children,
|
|
1697
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
1726
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx34(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1698
1727
|
]
|
|
1699
1728
|
}
|
|
1700
1729
|
);
|
|
@@ -1723,7 +1752,7 @@ var getFileType = (base64Url) => {
|
|
|
1723
1752
|
};
|
|
1724
1753
|
|
|
1725
1754
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1726
|
-
import { jsx as
|
|
1755
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1727
1756
|
var MultiUploadInputRenderer = {
|
|
1728
1757
|
canRenderType: "input-upload-multi",
|
|
1729
1758
|
render: (props) => {
|
|
@@ -1748,7 +1777,7 @@ var MultiUploadInputRenderer = {
|
|
|
1748
1777
|
};
|
|
1749
1778
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1750
1779
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1751
|
-
return /* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ jsx35(
|
|
1752
1781
|
UploadFieldInput_default,
|
|
1753
1782
|
{
|
|
1754
1783
|
id,
|
|
@@ -1756,7 +1785,7 @@ var MultiUploadInputRenderer = {
|
|
|
1756
1785
|
description,
|
|
1757
1786
|
validation: validationState,
|
|
1758
1787
|
help,
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1788
|
+
children: /* @__PURE__ */ jsx35(
|
|
1760
1789
|
UploadInput,
|
|
1761
1790
|
{
|
|
1762
1791
|
id,
|
|
@@ -1780,7 +1809,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1780
1809
|
|
|
1781
1810
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1782
1811
|
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1783
|
-
import { jsx as
|
|
1812
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1784
1813
|
var NumberInputRenderer = {
|
|
1785
1814
|
canRenderType: "input-number",
|
|
1786
1815
|
render: (props) => {
|
|
@@ -1794,7 +1823,7 @@ var NumberInputRenderer = {
|
|
|
1794
1823
|
"maximum",
|
|
1795
1824
|
"minimum"
|
|
1796
1825
|
);
|
|
1797
|
-
return /* @__PURE__ */
|
|
1826
|
+
return /* @__PURE__ */ jsx36(
|
|
1798
1827
|
FieldInput_default,
|
|
1799
1828
|
{
|
|
1800
1829
|
id,
|
|
@@ -1802,7 +1831,7 @@ var NumberInputRenderer = {
|
|
|
1802
1831
|
description,
|
|
1803
1832
|
validation: validationState,
|
|
1804
1833
|
help,
|
|
1805
|
-
children: /* @__PURE__ */
|
|
1834
|
+
children: /* @__PURE__ */ jsx36(InputGroup2, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx36(
|
|
1806
1835
|
Input2,
|
|
1807
1836
|
__spreadValues({
|
|
1808
1837
|
id,
|
|
@@ -1854,17 +1883,17 @@ var paragraph_messages_default = defineMessages3({
|
|
|
1854
1883
|
});
|
|
1855
1884
|
|
|
1856
1885
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1857
|
-
import { jsx as
|
|
1886
|
+
import { jsx as jsx37, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1858
1887
|
var ParagraphRenderer = {
|
|
1859
1888
|
canRenderType: "paragraph",
|
|
1860
|
-
render: (props) => /* @__PURE__ */
|
|
1889
|
+
render: (props) => /* @__PURE__ */ jsx37(Paragraph, __spreadValues({}, props))
|
|
1861
1890
|
};
|
|
1862
1891
|
function Paragraph({ align, control, margin, text }) {
|
|
1863
1892
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1864
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
1893
|
+
return control === "copyable" ? /* @__PURE__ */ jsx37(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx37(StandardParagraph, { className, text });
|
|
1865
1894
|
}
|
|
1866
1895
|
function StandardParagraph({ text, className }) {
|
|
1867
|
-
return /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ jsx37("p", { className: `np-text-body-large ${className}`, children: text });
|
|
1868
1897
|
}
|
|
1869
1898
|
function CopyableParagraph({
|
|
1870
1899
|
text,
|
|
@@ -1879,7 +1908,7 @@ function CopyableParagraph({
|
|
|
1879
1908
|
};
|
|
1880
1909
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
1881
1910
|
return /* @__PURE__ */ jsxs8("div", { className, children: [
|
|
1882
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsx37(
|
|
1883
1912
|
Input3,
|
|
1884
1913
|
{
|
|
1885
1914
|
type: "text",
|
|
@@ -1888,15 +1917,16 @@ function CopyableParagraph({
|
|
|
1888
1917
|
className: classNames4("text-ellipsis", inputAlignmentClasses)
|
|
1889
1918
|
}
|
|
1890
1919
|
),
|
|
1891
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ jsx37(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1892
1921
|
] });
|
|
1893
1922
|
}
|
|
1894
1923
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
1895
1924
|
|
|
1896
1925
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1897
|
-
import { Button as Button4, Header as Header4,
|
|
1898
|
-
import { useState as useState4 } from "react";
|
|
1926
|
+
import { Button as Button4, Header as Header4, InlineAlert as InlineAlert2, Modal as Modal2, NavigationOption as NavigationOption2 } from "@transferwise/components";
|
|
1899
1927
|
import { Plus } from "@transferwise/icons";
|
|
1928
|
+
import classNames5 from "classnames";
|
|
1929
|
+
import { useState as useState4 } from "react";
|
|
1900
1930
|
import { useIntl as useIntl4 } from "react-intl";
|
|
1901
1931
|
|
|
1902
1932
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -1925,11 +1955,10 @@ var repeatable_messages_default = defineMessages4({
|
|
|
1925
1955
|
});
|
|
1926
1956
|
|
|
1927
1957
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1928
|
-
import
|
|
1929
|
-
import { Fragment, jsx as jsx36, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1958
|
+
import { Fragment, jsx as jsx38, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1930
1959
|
var RepeatableRenderer = {
|
|
1931
1960
|
canRenderType: "repeatable",
|
|
1932
|
-
render: (props) => /* @__PURE__ */
|
|
1961
|
+
render: (props) => /* @__PURE__ */ jsx38(Repeatable, __spreadValues({}, props))
|
|
1933
1962
|
};
|
|
1934
1963
|
function Repeatable(props) {
|
|
1935
1964
|
const {
|
|
@@ -1969,8 +1998,8 @@ function Repeatable(props) {
|
|
|
1969
1998
|
setOpenModalType(null);
|
|
1970
1999
|
};
|
|
1971
2000
|
return /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
1972
|
-
title && /* @__PURE__ */
|
|
1973
|
-
description && /* @__PURE__ */
|
|
2001
|
+
title && /* @__PURE__ */ jsx38(Header4, { title }),
|
|
2002
|
+
description && /* @__PURE__ */ jsx38("p", { children: description }),
|
|
1974
2003
|
/* @__PURE__ */ jsxs9(
|
|
1975
2004
|
"div",
|
|
1976
2005
|
{
|
|
@@ -1978,30 +2007,30 @@ function Repeatable(props) {
|
|
|
1978
2007
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
1979
2008
|
}),
|
|
1980
2009
|
children: [
|
|
1981
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
2010
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx38(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2011
|
+
/* @__PURE__ */ jsx38(
|
|
1983
2012
|
NavigationOption2,
|
|
1984
2013
|
{
|
|
1985
|
-
media: /* @__PURE__ */
|
|
2014
|
+
media: /* @__PURE__ */ jsx38(Plus, {}),
|
|
1986
2015
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
1987
2016
|
showMediaAtAllSizes: true,
|
|
1988
2017
|
onClick: () => onAddItem()
|
|
1989
2018
|
}
|
|
1990
2019
|
),
|
|
1991
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2020
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx38(InlineAlert2, { type: "negative", children: validationState.message })
|
|
1992
2021
|
]
|
|
1993
2022
|
}
|
|
1994
2023
|
),
|
|
1995
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ jsx38(
|
|
1996
2025
|
Modal2,
|
|
1997
2026
|
{
|
|
1998
2027
|
open: openModalType !== null,
|
|
1999
2028
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2000
2029
|
body: /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
2001
|
-
/* @__PURE__ */
|
|
2030
|
+
/* @__PURE__ */ jsx38("div", { className: "m-b-2", children: editableItem }),
|
|
2002
2031
|
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2003
|
-
/* @__PURE__ */
|
|
2004
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsx38(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2033
|
+
/* @__PURE__ */ jsx38(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2005
2034
|
] })
|
|
2006
2035
|
] }),
|
|
2007
2036
|
onClose: () => onCancelEdit()
|
|
@@ -2013,10 +2042,10 @@ function ItemSummaryOption({
|
|
|
2013
2042
|
item,
|
|
2014
2043
|
onClick
|
|
2015
2044
|
}) {
|
|
2016
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ jsx38(
|
|
2017
2046
|
NavigationOption2,
|
|
2018
2047
|
{
|
|
2019
|
-
media: /* @__PURE__ */
|
|
2048
|
+
media: /* @__PURE__ */ jsx38(OptionMedia, __spreadValues({}, item)),
|
|
2020
2049
|
title: item.title,
|
|
2021
2050
|
content: item.description,
|
|
2022
2051
|
showMediaAtAllSizes: true,
|
|
@@ -2066,7 +2095,7 @@ var generic_error_messages_default = defineMessages6({
|
|
|
2066
2095
|
|
|
2067
2096
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2068
2097
|
import { Button as Button5 } from "@transferwise/components";
|
|
2069
|
-
import { jsx as
|
|
2098
|
+
import { jsx as jsx39, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2070
2099
|
function ErrorResult({ state }) {
|
|
2071
2100
|
const intl = useIntl5();
|
|
2072
2101
|
const buttonVisualProps = {
|
|
@@ -2077,7 +2106,7 @@ function ErrorResult({ state }) {
|
|
|
2077
2106
|
return /* @__PURE__ */ jsxs10("p", { className: "m-t-2", children: [
|
|
2078
2107
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2079
2108
|
"\xA0",
|
|
2080
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsx39(
|
|
2081
2110
|
Button5,
|
|
2082
2111
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2083
2112
|
onClick: () => {
|
|
@@ -2090,7 +2119,7 @@ function ErrorResult({ state }) {
|
|
|
2090
2119
|
}
|
|
2091
2120
|
|
|
2092
2121
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2093
|
-
import { Fragment as Fragment2, jsx as
|
|
2122
|
+
import { Fragment as Fragment2, jsx as jsx40, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2094
2123
|
function BlockSearchRendererComponent({
|
|
2095
2124
|
id,
|
|
2096
2125
|
isLoading,
|
|
@@ -2104,7 +2133,7 @@ function BlockSearchRendererComponent({
|
|
|
2104
2133
|
const [hasSearched, setHasSearched] = useState5(false);
|
|
2105
2134
|
const { formatMessage } = useIntl6();
|
|
2106
2135
|
return /* @__PURE__ */ jsxs11("div", { className: getMargin(margin), children: [
|
|
2107
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ jsx40(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx40(
|
|
2108
2137
|
Input4,
|
|
2109
2138
|
{
|
|
2110
2139
|
id,
|
|
@@ -2121,7 +2150,7 @@ function BlockSearchRendererComponent({
|
|
|
2121
2150
|
}
|
|
2122
2151
|
}
|
|
2123
2152
|
) }),
|
|
2124
|
-
isLoading ? /* @__PURE__ */
|
|
2153
|
+
isLoading ? /* @__PURE__ */ jsx40(Fragment2, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx40(SearchResultContent, { state, trackEvent })
|
|
2125
2154
|
] });
|
|
2126
2155
|
}
|
|
2127
2156
|
function SearchResultContent({
|
|
@@ -2130,31 +2159,31 @@ function SearchResultContent({
|
|
|
2130
2159
|
}) {
|
|
2131
2160
|
switch (state.type) {
|
|
2132
2161
|
case "error":
|
|
2133
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ jsx40(ErrorResult, { state });
|
|
2134
2163
|
case "results":
|
|
2135
|
-
return /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ jsx40(SearchResults, { state, trackEvent });
|
|
2136
2165
|
case "noResults":
|
|
2137
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ jsx40(EmptySearchResult, { state });
|
|
2138
2167
|
case "pending":
|
|
2139
2168
|
default:
|
|
2140
2169
|
return null;
|
|
2141
2170
|
}
|
|
2142
2171
|
}
|
|
2143
2172
|
function EmptySearchResult({ state }) {
|
|
2144
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ jsx40(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2145
2174
|
}
|
|
2146
2175
|
function SearchResults({
|
|
2147
2176
|
state,
|
|
2148
2177
|
trackEvent
|
|
2149
2178
|
}) {
|
|
2150
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ jsx40(NavigationOptionsList2, { children: state.results.map((result) => {
|
|
2151
2180
|
const { icon, image } = result;
|
|
2152
|
-
return /* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ jsx40(
|
|
2153
2182
|
NavigationOption3,
|
|
2154
2183
|
{
|
|
2155
2184
|
title: result.title,
|
|
2156
2185
|
content: result.description,
|
|
2157
|
-
media:
|
|
2186
|
+
media: OptionMedia({ icon, image }),
|
|
2158
2187
|
showMediaCircle: false,
|
|
2159
2188
|
showMediaAtAllSizes: true,
|
|
2160
2189
|
onClick: () => {
|
|
@@ -2175,7 +2204,7 @@ import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
|
2175
2204
|
import { Search } from "@transferwise/icons";
|
|
2176
2205
|
import { useState as useState6 } from "react";
|
|
2177
2206
|
import { useIntl as useIntl7 } from "react-intl";
|
|
2178
|
-
import { jsx as
|
|
2207
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2179
2208
|
function InlineSearchRenderer({
|
|
2180
2209
|
id,
|
|
2181
2210
|
isLoading,
|
|
@@ -2187,7 +2216,7 @@ function InlineSearchRenderer({
|
|
|
2187
2216
|
}) {
|
|
2188
2217
|
const [hasSearched, setHasSearched] = useState6(false);
|
|
2189
2218
|
const intl = useIntl7();
|
|
2190
|
-
return /* @__PURE__ */
|
|
2219
|
+
return /* @__PURE__ */ jsx41("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx41(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx41(
|
|
2191
2220
|
Typeahead,
|
|
2192
2221
|
{
|
|
2193
2222
|
id: "typeahead-input-id",
|
|
@@ -2195,10 +2224,10 @@ function InlineSearchRenderer({
|
|
|
2195
2224
|
name: "typeahead-input-name",
|
|
2196
2225
|
size: "md",
|
|
2197
2226
|
maxHeight: 100,
|
|
2198
|
-
footer: /* @__PURE__ */
|
|
2227
|
+
footer: /* @__PURE__ */ jsx41(TypeaheadFooter, { state, isLoading }),
|
|
2199
2228
|
multiple: false,
|
|
2200
2229
|
clearable: false,
|
|
2201
|
-
addon: /* @__PURE__ */
|
|
2230
|
+
addon: /* @__PURE__ */ jsx41(Search, { size: 24 }),
|
|
2202
2231
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2203
2232
|
minQueryLength: 1,
|
|
2204
2233
|
onChange: (values) => {
|
|
@@ -2235,29 +2264,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2235
2264
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2236
2265
|
const { formatMessage } = useIntl7();
|
|
2237
2266
|
if (state.type === "noResults") {
|
|
2238
|
-
return /* @__PURE__ */
|
|
2267
|
+
return /* @__PURE__ */ jsx41(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2239
2268
|
}
|
|
2240
2269
|
if (state.type === "error") {
|
|
2241
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ jsx41("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx41(ErrorResult, { state }) });
|
|
2242
2271
|
}
|
|
2243
2272
|
if (state.type === "pending" || isLoading) {
|
|
2244
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ jsx41("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2245
2274
|
}
|
|
2246
2275
|
return null;
|
|
2247
2276
|
}
|
|
2248
2277
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2249
2278
|
|
|
2250
2279
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2251
|
-
import { jsx as
|
|
2280
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2252
2281
|
var SearchRenderer = {
|
|
2253
2282
|
canRenderType: "search",
|
|
2254
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
2283
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx42(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx42(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2255
2284
|
};
|
|
2256
2285
|
var SearchRenderer_default = SearchRenderer;
|
|
2257
2286
|
|
|
2258
2287
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2259
2288
|
import { RadioGroup } from "@transferwise/components";
|
|
2260
|
-
import { Fragment as Fragment3, jsx as
|
|
2289
|
+
import { Fragment as Fragment3, jsx as jsx43, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2261
2290
|
function RadioInputRendererComponent(props) {
|
|
2262
2291
|
const {
|
|
2263
2292
|
id,
|
|
@@ -2272,7 +2301,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2272
2301
|
onSelect
|
|
2273
2302
|
} = props;
|
|
2274
2303
|
return /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
2275
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ jsx43(
|
|
2276
2305
|
FieldInput_default,
|
|
2277
2306
|
{
|
|
2278
2307
|
id,
|
|
@@ -2280,7 +2309,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2280
2309
|
help,
|
|
2281
2310
|
description,
|
|
2282
2311
|
validation: validationState,
|
|
2283
|
-
children: /* @__PURE__ */
|
|
2312
|
+
children: /* @__PURE__ */ jsx43("span", { children: /* @__PURE__ */ jsx43(
|
|
2284
2313
|
RadioGroup,
|
|
2285
2314
|
{
|
|
2286
2315
|
name: id,
|
|
@@ -2289,7 +2318,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2289
2318
|
value: index,
|
|
2290
2319
|
secondary: option.description,
|
|
2291
2320
|
disabled: option.disabled || disabled,
|
|
2292
|
-
avatar: /* @__PURE__ */
|
|
2321
|
+
avatar: /* @__PURE__ */ jsx43(OptionMedia, { icon: option.icon, image: option.image })
|
|
2293
2322
|
})),
|
|
2294
2323
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2295
2324
|
onChange: onSelect
|
|
@@ -2305,7 +2334,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2305
2334
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2306
2335
|
import { Tabs } from "@transferwise/components";
|
|
2307
2336
|
import { useEffect as useEffect2 } from "react";
|
|
2308
|
-
import { Fragment as Fragment4, jsx as
|
|
2337
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2309
2338
|
function TabInputRendererComponent(props) {
|
|
2310
2339
|
const {
|
|
2311
2340
|
id,
|
|
@@ -2325,7 +2354,7 @@ function TabInputRendererComponent(props) {
|
|
|
2325
2354
|
}
|
|
2326
2355
|
}, [selectedIndex, onSelect, options.length]);
|
|
2327
2356
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2328
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx44(
|
|
2329
2358
|
FieldInput_default,
|
|
2330
2359
|
{
|
|
2331
2360
|
id,
|
|
@@ -2333,7 +2362,7 @@ function TabInputRendererComponent(props) {
|
|
|
2333
2362
|
help,
|
|
2334
2363
|
description,
|
|
2335
2364
|
validation: validationState,
|
|
2336
|
-
children: /* @__PURE__ */
|
|
2365
|
+
children: /* @__PURE__ */ jsx44(
|
|
2337
2366
|
Tabs,
|
|
2338
2367
|
{
|
|
2339
2368
|
name: id,
|
|
@@ -2342,7 +2371,7 @@ function TabInputRendererComponent(props) {
|
|
|
2342
2371
|
title: option.title,
|
|
2343
2372
|
// if we pass null, we get some props-types console errors
|
|
2344
2373
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2345
|
-
content: /* @__PURE__ */
|
|
2374
|
+
content: /* @__PURE__ */ jsx44(Fragment4, {}),
|
|
2346
2375
|
disabled: option.disabled || disabled
|
|
2347
2376
|
})),
|
|
2348
2377
|
onTabSelect: onSelect
|
|
@@ -2357,7 +2386,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2357
2386
|
|
|
2358
2387
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2359
2388
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
2360
|
-
import { Fragment as Fragment5, jsx as
|
|
2389
|
+
import { Fragment as Fragment5, jsx as jsx45, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2361
2390
|
function SelectInputRendererComponent(props) {
|
|
2362
2391
|
const {
|
|
2363
2392
|
id,
|
|
@@ -2393,17 +2422,17 @@ function SelectInputRendererComponent(props) {
|
|
|
2393
2422
|
const contentProps = withinTrigger ? {
|
|
2394
2423
|
title: option.title,
|
|
2395
2424
|
note: option.description,
|
|
2396
|
-
icon:
|
|
2425
|
+
icon: getInlineAvatar(option)
|
|
2397
2426
|
} : {
|
|
2398
2427
|
title: option.title,
|
|
2399
2428
|
description: option.description,
|
|
2400
|
-
icon: /* @__PURE__ */
|
|
2429
|
+
icon: /* @__PURE__ */ jsx45(OptionMedia, { icon: option.icon, image: option.image })
|
|
2401
2430
|
};
|
|
2402
|
-
return /* @__PURE__ */
|
|
2431
|
+
return /* @__PURE__ */ jsx45(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
2403
2432
|
};
|
|
2404
2433
|
const extraProps = { autoComplete };
|
|
2405
2434
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2406
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ jsx45(
|
|
2407
2436
|
FieldInput_default,
|
|
2408
2437
|
{
|
|
2409
2438
|
id,
|
|
@@ -2411,7 +2440,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2411
2440
|
help,
|
|
2412
2441
|
description,
|
|
2413
2442
|
validation: validationState,
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2443
|
+
children: /* @__PURE__ */ jsx45(
|
|
2415
2444
|
SelectInput2,
|
|
2416
2445
|
__spreadValues({
|
|
2417
2446
|
name: id,
|
|
@@ -2434,7 +2463,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2434
2463
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2435
2464
|
import { useEffect as useEffect3 } from "react";
|
|
2436
2465
|
import { SegmentedControl } from "@transferwise/components";
|
|
2437
|
-
import { Fragment as Fragment6, jsx as
|
|
2466
|
+
import { Fragment as Fragment6, jsx as jsx46, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2438
2467
|
function SegmentedInputRendererComponent(props) {
|
|
2439
2468
|
const {
|
|
2440
2469
|
id,
|
|
@@ -2453,7 +2482,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2453
2482
|
}
|
|
2454
2483
|
}, [selectedIndex, onSelect, options.length]);
|
|
2455
2484
|
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
2456
|
-
/* @__PURE__ */
|
|
2485
|
+
/* @__PURE__ */ jsx46(
|
|
2457
2486
|
FieldInput_default,
|
|
2458
2487
|
{
|
|
2459
2488
|
id,
|
|
@@ -2461,7 +2490,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2461
2490
|
help,
|
|
2462
2491
|
description,
|
|
2463
2492
|
validation: validationState,
|
|
2464
|
-
children: /* @__PURE__ */
|
|
2493
|
+
children: /* @__PURE__ */ jsx46(
|
|
2465
2494
|
SegmentedControl,
|
|
2466
2495
|
{
|
|
2467
2496
|
name: `${id}-segmented-control`,
|
|
@@ -2478,26 +2507,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2478
2507
|
)
|
|
2479
2508
|
}
|
|
2480
2509
|
),
|
|
2481
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsx46("div", { id: `${id}-children`, children })
|
|
2482
2511
|
] });
|
|
2483
2512
|
}
|
|
2484
2513
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2485
2514
|
|
|
2486
2515
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2487
|
-
import { jsx as
|
|
2516
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2488
2517
|
var SelectInputRenderer = {
|
|
2489
2518
|
canRenderType: "input-select",
|
|
2490
2519
|
render: (props) => {
|
|
2491
2520
|
switch (props.control) {
|
|
2492
2521
|
case "radio":
|
|
2493
|
-
return /* @__PURE__ */
|
|
2522
|
+
return /* @__PURE__ */ jsx47(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2494
2523
|
case "tab":
|
|
2495
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2524
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx47(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx47(TabInputRendererComponent, __spreadValues({}, props));
|
|
2496
2525
|
case "segmented":
|
|
2497
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2526
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx47(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx47(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2498
2527
|
case "select":
|
|
2499
2528
|
default:
|
|
2500
|
-
return /* @__PURE__ */
|
|
2529
|
+
return /* @__PURE__ */ jsx47(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2501
2530
|
}
|
|
2502
2531
|
}
|
|
2503
2532
|
};
|
|
@@ -2505,17 +2534,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2505
2534
|
|
|
2506
2535
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2507
2536
|
import { Header as Header5, Summary } from "@transferwise/components";
|
|
2508
|
-
import { jsx as
|
|
2537
|
+
import { jsx as jsx48, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2509
2538
|
var StatusListRenderer = {
|
|
2510
2539
|
canRenderType: "status-list",
|
|
2511
2540
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs16("div", { className: getMargin(margin), children: [
|
|
2512
|
-
title ? /* @__PURE__ */
|
|
2513
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
2541
|
+
title ? /* @__PURE__ */ jsx48(Header5, { title, className: "m-b-2" }) : null,
|
|
2542
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx48(
|
|
2514
2543
|
Summary,
|
|
2515
2544
|
{
|
|
2516
2545
|
title: itemTitle,
|
|
2517
2546
|
description,
|
|
2518
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
2547
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx48(DynamicIcon_default, { name: icon.name }) : null,
|
|
2519
2548
|
status: mapStatus(status),
|
|
2520
2549
|
action: getSummaryAction(callToAction)
|
|
2521
2550
|
},
|
|
@@ -2561,7 +2590,7 @@ import {
|
|
|
2561
2590
|
TextArea,
|
|
2562
2591
|
TextareaWithDisplayFormat
|
|
2563
2592
|
} from "@transferwise/components";
|
|
2564
|
-
import { jsx as
|
|
2593
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2565
2594
|
var commonKeys = [
|
|
2566
2595
|
"autoComplete",
|
|
2567
2596
|
"autoCapitalize",
|
|
@@ -2580,12 +2609,12 @@ function VariableTextInput(inputProps) {
|
|
|
2580
2609
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
2581
2610
|
switch (control) {
|
|
2582
2611
|
case "email":
|
|
2583
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsx49(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
2584
2613
|
case "password":
|
|
2585
|
-
return /* @__PURE__ */
|
|
2614
|
+
return /* @__PURE__ */ jsx49(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
2586
2615
|
case "numeric": {
|
|
2587
2616
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
2588
|
-
return /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ jsx49(
|
|
2589
2618
|
TextInput,
|
|
2590
2619
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
2591
2620
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
@@ -2593,9 +2622,9 @@ function VariableTextInput(inputProps) {
|
|
|
2593
2622
|
);
|
|
2594
2623
|
}
|
|
2595
2624
|
case "phone-number":
|
|
2596
|
-
return /* @__PURE__ */
|
|
2625
|
+
return /* @__PURE__ */ jsx49(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
2597
2626
|
default: {
|
|
2598
|
-
return /* @__PURE__ */
|
|
2627
|
+
return /* @__PURE__ */ jsx49(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
2599
2628
|
}
|
|
2600
2629
|
}
|
|
2601
2630
|
}
|
|
@@ -2603,11 +2632,11 @@ function TextInput(props) {
|
|
|
2603
2632
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
2604
2633
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
2605
2634
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
2606
|
-
return displayFormat ? /* @__PURE__ */
|
|
2635
|
+
return displayFormat ? /* @__PURE__ */ jsx49(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx49(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
2607
2636
|
}
|
|
2608
2637
|
|
|
2609
2638
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2610
|
-
import { jsx as
|
|
2639
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2611
2640
|
var TextInputRenderer = {
|
|
2612
2641
|
canRenderType: "input-text",
|
|
2613
2642
|
render: (props) => {
|
|
@@ -2642,7 +2671,7 @@ var TextInputRenderer = {
|
|
|
2642
2671
|
}
|
|
2643
2672
|
}
|
|
2644
2673
|
});
|
|
2645
|
-
return /* @__PURE__ */
|
|
2674
|
+
return /* @__PURE__ */ jsx50(
|
|
2646
2675
|
FieldInput_default,
|
|
2647
2676
|
{
|
|
2648
2677
|
id,
|
|
@@ -2650,7 +2679,7 @@ var TextInputRenderer = {
|
|
|
2650
2679
|
description,
|
|
2651
2680
|
validation: validationState,
|
|
2652
2681
|
help,
|
|
2653
|
-
children: /* @__PURE__ */
|
|
2682
|
+
children: /* @__PURE__ */ jsx50(InputGroup3, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx50(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
2654
2683
|
}
|
|
2655
2684
|
);
|
|
2656
2685
|
}
|
|
@@ -2664,7 +2693,7 @@ import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
|
2664
2693
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
2665
2694
|
|
|
2666
2695
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2667
|
-
import { jsx as
|
|
2696
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2668
2697
|
var UploadInputRenderer = {
|
|
2669
2698
|
canRenderType: "input-upload",
|
|
2670
2699
|
render: (props) => {
|
|
@@ -2680,14 +2709,14 @@ var UploadInputRenderer = {
|
|
|
2680
2709
|
};
|
|
2681
2710
|
return (
|
|
2682
2711
|
// We don't pass help here as there is no sensible place to display it
|
|
2683
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx51(
|
|
2684
2713
|
UploadFieldInput_default,
|
|
2685
2714
|
{
|
|
2686
2715
|
id,
|
|
2687
2716
|
label: void 0,
|
|
2688
2717
|
description: void 0,
|
|
2689
2718
|
validation: validationState,
|
|
2690
|
-
children: /* @__PURE__ */
|
|
2719
|
+
children: /* @__PURE__ */ jsx51(
|
|
2691
2720
|
UploadInput2,
|
|
2692
2721
|
{
|
|
2693
2722
|
id,
|
|
@@ -2744,7 +2773,7 @@ var LargeUploadRenderer = {
|
|
|
2744
2773
|
throw e;
|
|
2745
2774
|
}
|
|
2746
2775
|
};
|
|
2747
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsx51(
|
|
2748
2777
|
FieldInput_default,
|
|
2749
2778
|
{
|
|
2750
2779
|
id,
|
|
@@ -2752,7 +2781,7 @@ var LargeUploadRenderer = {
|
|
|
2752
2781
|
description,
|
|
2753
2782
|
validation: validationState,
|
|
2754
2783
|
help,
|
|
2755
|
-
children: /* @__PURE__ */
|
|
2784
|
+
children: /* @__PURE__ */ jsx51(
|
|
2756
2785
|
Upload,
|
|
2757
2786
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2758
2787
|
usAccept: getAcceptsString(accepts),
|
|
@@ -2769,14 +2798,14 @@ var LargeUploadRenderer = {
|
|
|
2769
2798
|
|
|
2770
2799
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2771
2800
|
import { DefinitionList, Header as Header6 } from "@transferwise/components";
|
|
2772
|
-
import { Fragment as Fragment7, jsx as
|
|
2801
|
+
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2773
2802
|
var ReviewRenderer = {
|
|
2774
2803
|
canRenderType: "review",
|
|
2775
2804
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
2776
2805
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2777
2806
|
return /* @__PURE__ */ jsxs17("div", { className: getMargin(margin), children: [
|
|
2778
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2807
|
+
(title || callToAction) && /* @__PURE__ */ jsx52(Header6, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
|
|
2808
|
+
/* @__PURE__ */ jsx52("div", { className: margin, children: /* @__PURE__ */ jsx52(
|
|
2780
2809
|
DefinitionList,
|
|
2781
2810
|
{
|
|
2782
2811
|
layout: orientation,
|
|
@@ -2809,13 +2838,13 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2809
2838
|
var getFieldValue = (value, help, orientation) => {
|
|
2810
2839
|
if (help) {
|
|
2811
2840
|
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
2812
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsx52(Help_default, { help }),
|
|
2813
2842
|
" ",
|
|
2814
2843
|
value
|
|
2815
2844
|
] }) : /* @__PURE__ */ jsxs17(Fragment7, { children: [
|
|
2816
2845
|
value,
|
|
2817
2846
|
" ",
|
|
2818
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ jsx52(Help_default, { help })
|
|
2819
2848
|
] });
|
|
2820
2849
|
}
|
|
2821
2850
|
return value;
|
|
@@ -2847,11 +2876,11 @@ var getReviewAction = (callToAction) => {
|
|
|
2847
2876
|
import { Alert as Alert2, Title } from "@transferwise/components";
|
|
2848
2877
|
|
|
2849
2878
|
// ../renderers/src/step/BackButton.tsx
|
|
2850
|
-
import { AvatarView as
|
|
2879
|
+
import { AvatarView as AvatarView4 } from "@transferwise/components";
|
|
2851
2880
|
import { ArrowLeft } from "@transferwise/icons";
|
|
2852
|
-
import { jsx as
|
|
2881
|
+
import { jsx as jsx53, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2853
2882
|
function BackButton({ title, onClick }) {
|
|
2854
|
-
return /* @__PURE__ */
|
|
2883
|
+
return /* @__PURE__ */ jsx53("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs18(
|
|
2855
2884
|
"button",
|
|
2856
2885
|
{
|
|
2857
2886
|
type: "button",
|
|
@@ -2860,8 +2889,8 @@ function BackButton({ title, onClick }) {
|
|
|
2860
2889
|
"aria-label": title,
|
|
2861
2890
|
onClick,
|
|
2862
2891
|
children: [
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
2892
|
+
/* @__PURE__ */ jsx53("span", { className: "sr-only", children: title }),
|
|
2893
|
+
/* @__PURE__ */ jsx53(AvatarView4, { interactive: true, children: /* @__PURE__ */ jsx53(ArrowLeft, { size: "24" }) })
|
|
2865
2894
|
]
|
|
2866
2895
|
}
|
|
2867
2896
|
) });
|
|
@@ -2898,17 +2927,17 @@ var external_confirmation_messages_default = defineMessages7({
|
|
|
2898
2927
|
|
|
2899
2928
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
2900
2929
|
import { Button as Button6, Markdown as Markdown5 } from "@transferwise/components";
|
|
2901
|
-
import { jsx as
|
|
2930
|
+
import { jsx as jsx54, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2902
2931
|
function ExternalConfirmationDialog({
|
|
2903
2932
|
external,
|
|
2904
2933
|
onClose
|
|
2905
2934
|
}) {
|
|
2906
2935
|
const { formatMessage } = useIntl8();
|
|
2907
|
-
return /* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
/* @__PURE__ */
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2936
|
+
return /* @__PURE__ */ jsx54("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
|
|
2937
|
+
/* @__PURE__ */ jsx54("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
2938
|
+
/* @__PURE__ */ jsx54(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
2939
|
+
/* @__PURE__ */ jsx54("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
|
|
2940
|
+
/* @__PURE__ */ jsx54(
|
|
2912
2941
|
Button6,
|
|
2913
2942
|
{
|
|
2914
2943
|
block: true,
|
|
@@ -2922,7 +2951,7 @@ function ExternalConfirmationDialog({
|
|
|
2922
2951
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2923
2952
|
}
|
|
2924
2953
|
),
|
|
2925
|
-
/* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ jsx54(Button6, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2926
2955
|
] }) })
|
|
2927
2956
|
] }) });
|
|
2928
2957
|
}
|
|
@@ -2951,7 +2980,7 @@ function useExternal(url) {
|
|
|
2951
2980
|
}
|
|
2952
2981
|
|
|
2953
2982
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2954
|
-
import { Fragment as Fragment8, jsx as
|
|
2983
|
+
import { Fragment as Fragment8, jsx as jsx55, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2955
2984
|
var StepRenderer = {
|
|
2956
2985
|
canRenderType: "step",
|
|
2957
2986
|
render: StepRendererComponent
|
|
@@ -2960,15 +2989,15 @@ function StepRendererComponent(props) {
|
|
|
2960
2989
|
const { back, description, error, external, title, children } = props;
|
|
2961
2990
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
2962
2991
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
2963
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsx55(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
2964
2993
|
}
|
|
2965
2994
|
return /* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
2966
|
-
back ? /* @__PURE__ */
|
|
2995
|
+
back ? /* @__PURE__ */ jsx55(BackButton_default, __spreadValues({}, back)) : null,
|
|
2967
2996
|
title || description ? /* @__PURE__ */ jsxs20("div", { className: "m-b-4", children: [
|
|
2968
|
-
title ? /* @__PURE__ */
|
|
2969
|
-
description ? /* @__PURE__ */
|
|
2997
|
+
title ? /* @__PURE__ */ jsx55(Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2998
|
+
description ? /* @__PURE__ */ jsx55("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2970
2999
|
] }) : void 0,
|
|
2971
|
-
error ? /* @__PURE__ */
|
|
3000
|
+
error ? /* @__PURE__ */ jsx55(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2972
3001
|
children
|
|
2973
3002
|
] });
|
|
2974
3003
|
}
|
|
@@ -2976,12 +3005,12 @@ function StepRendererComponent(props) {
|
|
|
2976
3005
|
// ../renderers/src/ListRenderer.tsx
|
|
2977
3006
|
import { Body, Header as Header7 } from "@transferwise/components";
|
|
2978
3007
|
import classNames6 from "classnames";
|
|
2979
|
-
import { jsx as
|
|
3008
|
+
import { jsx as jsx56, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2980
3009
|
var ListRenderer = {
|
|
2981
3010
|
canRenderType: "list",
|
|
2982
3011
|
render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ jsxs21("div", { className: getMargin(margin), children: [
|
|
2983
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2984
|
-
items.map((props) => /* @__PURE__ */
|
|
3012
|
+
(title || callToAction) && /* @__PURE__ */ jsx56(Header7, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
3013
|
+
items.map((props) => /* @__PURE__ */ jsx56(DesignSystemListItem, __spreadValues({}, props), props.title))
|
|
2985
3014
|
] })
|
|
2986
3015
|
};
|
|
2987
3016
|
var DesignSystemListItem = ({
|
|
@@ -2991,7 +3020,7 @@ var DesignSystemListItem = ({
|
|
|
2991
3020
|
subvalue,
|
|
2992
3021
|
icon,
|
|
2993
3022
|
image
|
|
2994
|
-
}) => /* @__PURE__ */
|
|
3023
|
+
}) => /* @__PURE__ */ jsx56(
|
|
2995
3024
|
"label",
|
|
2996
3025
|
{
|
|
2997
3026
|
className: classNames6("np-option p-a-2", {
|
|
@@ -2999,15 +3028,15 @@ var DesignSystemListItem = ({
|
|
|
2999
3028
|
"np-option__container-aligned": true
|
|
3000
3029
|
}),
|
|
3001
3030
|
children: /* @__PURE__ */ jsxs21("div", { className: "media", children: [
|
|
3002
|
-
icon || image ? /* @__PURE__ */
|
|
3031
|
+
icon || image ? /* @__PURE__ */ jsx56("div", { className: "media-left", children: /* @__PURE__ */ jsx56(ListItemMedia, { image, icon }) }) : null,
|
|
3003
3032
|
/* @__PURE__ */ jsxs21("div", { className: "media-body", children: [
|
|
3004
3033
|
/* @__PURE__ */ jsxs21("div", { className: "d-flex justify-content-between", children: [
|
|
3005
|
-
/* @__PURE__ */
|
|
3006
|
-
/* @__PURE__ */
|
|
3034
|
+
/* @__PURE__ */ jsx56("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
3035
|
+
/* @__PURE__ */ jsx56("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
|
|
3007
3036
|
] }),
|
|
3008
3037
|
/* @__PURE__ */ jsxs21("div", { className: "d-flex justify-content-between", children: [
|
|
3009
|
-
/* @__PURE__ */
|
|
3010
|
-
/* @__PURE__ */
|
|
3038
|
+
/* @__PURE__ */ jsx56(Body, { className: "d-block np-option__body", children: subtitle }),
|
|
3039
|
+
/* @__PURE__ */ jsx56(Body, { className: "d-block np-option__body", children: subvalue })
|
|
3011
3040
|
] })
|
|
3012
3041
|
] })
|
|
3013
3042
|
] })
|
|
@@ -3016,10 +3045,10 @@ var DesignSystemListItem = ({
|
|
|
3016
3045
|
);
|
|
3017
3046
|
var ListItemMedia = ({ icon, image }) => {
|
|
3018
3047
|
if (icon) {
|
|
3019
|
-
return /* @__PURE__ */
|
|
3048
|
+
return /* @__PURE__ */ jsx56("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ jsx56(OptionMedia, { icon, image }) });
|
|
3020
3049
|
}
|
|
3021
3050
|
if (image) {
|
|
3022
|
-
return /* @__PURE__ */
|
|
3051
|
+
return /* @__PURE__ */ jsx56("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx56(OptionMedia, { icon, image }) });
|
|
3023
3052
|
}
|
|
3024
3053
|
};
|
|
3025
3054
|
var getListAction = (callToAction) => {
|
|
@@ -3047,7 +3076,7 @@ var getListAction = (callToAction) => {
|
|
|
3047
3076
|
var ListRenderer_default = ListRenderer;
|
|
3048
3077
|
|
|
3049
3078
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3050
|
-
import { jsx as
|
|
3079
|
+
import { jsx as jsx57, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3051
3080
|
var SplashStepRenderer = {
|
|
3052
3081
|
canRenderType: "step",
|
|
3053
3082
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3057,10 +3086,10 @@ function SplashStepRendererComponent(props) {
|
|
|
3057
3086
|
const { back, children, external } = props;
|
|
3058
3087
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
3059
3088
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
3060
|
-
return /* @__PURE__ */
|
|
3089
|
+
return /* @__PURE__ */ jsx57(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
3061
3090
|
}
|
|
3062
3091
|
return /* @__PURE__ */ jsxs22("div", { className: "splash-screen m-t-5", children: [
|
|
3063
|
-
back ? /* @__PURE__ */
|
|
3092
|
+
back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
|
|
3064
3093
|
children
|
|
3065
3094
|
] });
|
|
3066
3095
|
}
|
|
@@ -3082,7 +3111,7 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3082
3111
|
};
|
|
3083
3112
|
|
|
3084
3113
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3085
|
-
import { jsx as
|
|
3114
|
+
import { jsx as jsx58, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3086
3115
|
var SplashCelebrationStepRenderer = {
|
|
3087
3116
|
canRenderType: "step",
|
|
3088
3117
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3093,10 +3122,10 @@ function SplashCelebrationStepRendererComponent(props) {
|
|
|
3093
3122
|
useCustomTheme("forest-green", trackEvent);
|
|
3094
3123
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
3095
3124
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
3096
|
-
return /* @__PURE__ */
|
|
3125
|
+
return /* @__PURE__ */ jsx58(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
3097
3126
|
}
|
|
3098
3127
|
return /* @__PURE__ */ jsxs23("div", { className: "splash-screen m-t-5", children: [
|
|
3099
|
-
back ? /* @__PURE__ */
|
|
3128
|
+
back ? /* @__PURE__ */ jsx58(BackButton_default, __spreadValues({}, back)) : null,
|
|
3100
3129
|
children
|
|
3101
3130
|
] });
|
|
3102
3131
|
}
|
|
@@ -3139,7 +3168,7 @@ var getWiseRenderers = () => [
|
|
|
3139
3168
|
];
|
|
3140
3169
|
|
|
3141
3170
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3142
|
-
var appVersion = "4.
|
|
3171
|
+
var appVersion = "4.8.0";
|
|
3143
3172
|
|
|
3144
3173
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
3145
3174
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -3165,7 +3194,7 @@ var logToRollbar = (level, message, extra) => {
|
|
|
3165
3194
|
|
|
3166
3195
|
// src/dynamicFlow/telemetry/getTrackEvent.ts
|
|
3167
3196
|
import { isThemeModern } from "@wise/components-theming";
|
|
3168
|
-
var getTrackEvent = (onEvent, onAnalytics, onThemeChange
|
|
3197
|
+
var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties) => {
|
|
3169
3198
|
onEvent == null ? void 0 : onEvent(name, properties);
|
|
3170
3199
|
if (name.includes(ThemeRequiredEventName)) {
|
|
3171
3200
|
const { theme } = properties != null ? properties : { theme: "personal" };
|
|
@@ -3175,23 +3204,15 @@ var getTrackEvent = (onEvent, onAnalytics, onThemeChange, onLog) => (name, prope
|
|
|
3175
3204
|
} else {
|
|
3176
3205
|
onAnalytics == null ? void 0 : onAnalytics(name, properties);
|
|
3177
3206
|
}
|
|
3178
|
-
if (name !== "DynamicFlow - Initiated") {
|
|
3179
|
-
if ((properties == null ? void 0 : properties.stepId) === void 0) {
|
|
3180
|
-
onLog == null ? void 0 : onLog("warning", "DynamicFlow warning. `stepId` is not defined in the event properties", {
|
|
3181
|
-
eventName: name,
|
|
3182
|
-
properties: Object.keys(properties != null ? properties : {})
|
|
3183
|
-
});
|
|
3184
|
-
}
|
|
3185
|
-
}
|
|
3186
3207
|
};
|
|
3187
3208
|
|
|
3188
3209
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3189
|
-
import { jsx as
|
|
3210
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3190
3211
|
var wiseRenderers = getWiseRenderers();
|
|
3191
3212
|
function DynamicFlowLegacy(props) {
|
|
3192
3213
|
const { customFetch = globalThis.fetch } = props;
|
|
3193
3214
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3194
|
-
return /* @__PURE__ */
|
|
3215
|
+
return /* @__PURE__ */ jsx59(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
|
|
3195
3216
|
}
|
|
3196
3217
|
function DynamicFlowRevamp(props) {
|
|
3197
3218
|
const {
|
|
@@ -3207,8 +3228,8 @@ function DynamicFlowRevamp(props) {
|
|
|
3207
3228
|
const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3208
3229
|
const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
|
|
3209
3230
|
const trackEvent = useMemo2(
|
|
3210
|
-
() => getTrackEvent(onEvent, onAnalytics, onThemeChange
|
|
3211
|
-
[onEvent, onAnalytics, onThemeChange
|
|
3231
|
+
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3232
|
+
[onEvent, onAnalytics, onThemeChange]
|
|
3212
3233
|
);
|
|
3213
3234
|
const coreProps = __spreadProps(__spreadValues({}, props), {
|
|
3214
3235
|
httpClient,
|
|
@@ -3217,7 +3238,7 @@ function DynamicFlowRevamp(props) {
|
|
|
3217
3238
|
onLog: logEvent,
|
|
3218
3239
|
onLink
|
|
3219
3240
|
});
|
|
3220
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ jsx59(DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
|
|
3221
3242
|
}
|
|
3222
3243
|
var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
3223
3244
|
const {
|
|
@@ -3233,8 +3254,8 @@ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
|
3233
3254
|
const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3234
3255
|
const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
|
|
3235
3256
|
const trackEvent = useMemo2(
|
|
3236
|
-
() => getTrackEvent(onEvent, onAnalytics, onThemeChange
|
|
3237
|
-
[onEvent, onAnalytics, onThemeChange
|
|
3257
|
+
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3258
|
+
[onEvent, onAnalytics, onThemeChange]
|
|
3238
3259
|
);
|
|
3239
3260
|
const coreProps = __spreadProps(__spreadValues({}, props), {
|
|
3240
3261
|
httpClient,
|
|
@@ -3243,7 +3264,7 @@ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
|
3243
3264
|
onLog: logEvent,
|
|
3244
3265
|
onLink
|
|
3245
3266
|
});
|
|
3246
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ jsx59(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref }));
|
|
3247
3268
|
});
|
|
3248
3269
|
var useWiseHttpClient = (httpClient) => {
|
|
3249
3270
|
const { locale } = useIntl9();
|