@wise/dynamic-flow-client-internal 5.14.0 → 5.15.0-experimental-76b77f2
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 +775 -658
- package/build/main.mjs +683 -566
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +18 -18
package/build/main.js
CHANGED
|
@@ -323,7 +323,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
323
323
|
};
|
|
324
324
|
|
|
325
325
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
326
|
-
var
|
|
326
|
+
var import_react25 = require("react");
|
|
327
327
|
|
|
328
328
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
329
329
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -1105,12 +1105,273 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1105
1105
|
};
|
|
1106
1106
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1107
1107
|
|
|
1108
|
+
// ../renderers/src/CollectionRenderer.tsx
|
|
1109
|
+
var import_components15 = require("@transferwise/components");
|
|
1110
|
+
|
|
1111
|
+
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1112
|
+
var import_components12 = require("@transferwise/components");
|
|
1113
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1114
|
+
var getAdditionalInfo = (additionalInfo) => {
|
|
1115
|
+
if (!additionalInfo) {
|
|
1116
|
+
return void 0;
|
|
1117
|
+
}
|
|
1118
|
+
const { href, text, onClick } = additionalInfo;
|
|
1119
|
+
if (href || onClick) {
|
|
1120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1121
|
+
import_components12.ListItem.AdditionalInfo,
|
|
1122
|
+
{
|
|
1123
|
+
action: {
|
|
1124
|
+
label: text,
|
|
1125
|
+
href,
|
|
1126
|
+
onClick,
|
|
1127
|
+
target: "_blank"
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1135
|
+
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1136
|
+
var import_components13 = require("@transferwise/components");
|
|
1137
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1138
|
+
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1139
|
+
if (!callToAction) {
|
|
1140
|
+
return void 0;
|
|
1141
|
+
}
|
|
1142
|
+
const { accessibilityDescription, href, title, context, onClick } = callToAction;
|
|
1143
|
+
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
1144
|
+
if (href) {
|
|
1145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1146
|
+
import_components13.ListItem.Button,
|
|
1147
|
+
{
|
|
1148
|
+
href,
|
|
1149
|
+
target: "_blank",
|
|
1150
|
+
rel: "noopener noreferrer",
|
|
1151
|
+
partiallyInteractive: !fullyInteractive,
|
|
1152
|
+
priority,
|
|
1153
|
+
"aria-description": accessibilityDescription,
|
|
1154
|
+
sentiment,
|
|
1155
|
+
children: title
|
|
1156
|
+
}
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1160
|
+
import_components13.ListItem.Button,
|
|
1161
|
+
{
|
|
1162
|
+
"aria-description": accessibilityDescription,
|
|
1163
|
+
partiallyInteractive: !fullyInteractive,
|
|
1164
|
+
priority,
|
|
1165
|
+
sentiment,
|
|
1166
|
+
onClick,
|
|
1167
|
+
children: title
|
|
1168
|
+
}
|
|
1169
|
+
);
|
|
1170
|
+
};
|
|
1171
|
+
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
1172
|
+
if (context === "negative") {
|
|
1173
|
+
return { priority: "secondary", sentiment: "negative" };
|
|
1174
|
+
}
|
|
1175
|
+
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1179
|
+
var shouldUseAvatar = (control, tags) => {
|
|
1180
|
+
var _a;
|
|
1181
|
+
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1184
|
+
// ../renderers/src/CollectionRenderer.tsx
|
|
1185
|
+
var import_react5 = require("react");
|
|
1186
|
+
|
|
1187
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
1188
|
+
var import_components14 = require("@transferwise/components");
|
|
1189
|
+
var import_react4 = require("react");
|
|
1190
|
+
var import_react_intl6 = require("react-intl");
|
|
1191
|
+
|
|
1192
|
+
// ../renderers/src/messages/step.messages.ts
|
|
1193
|
+
var import_react_intl5 = require("react-intl");
|
|
1194
|
+
var step_messages_default = (0, import_react_intl5.defineMessages)({
|
|
1195
|
+
scrollToBottom: {
|
|
1196
|
+
id: "df.wise.step.scrollToBottom",
|
|
1197
|
+
defaultMessage: "Scroll to bottom",
|
|
1198
|
+
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
1199
|
+
}
|
|
1200
|
+
});
|
|
1201
|
+
|
|
1202
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
1203
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1204
|
+
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
1205
|
+
var StepFooter = ({ footer, tags }) => {
|
|
1206
|
+
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
1207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FooterWithScrollButton, { footer });
|
|
1208
|
+
}
|
|
1209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DefaultFooter, { footer });
|
|
1210
|
+
};
|
|
1211
|
+
var DefaultFooter = ({ footer }) => {
|
|
1212
|
+
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
1213
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
1214
|
+
};
|
|
1215
|
+
var FooterWithScrollButton = ({ footer }) => {
|
|
1216
|
+
const { formatMessage } = (0, import_react_intl6.useIntl)();
|
|
1217
|
+
const endOfLayoutRef = (0, import_react4.useRef)(null);
|
|
1218
|
+
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
1219
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1220
|
+
import_components14.Button,
|
|
1221
|
+
{
|
|
1222
|
+
className: "m-b-1",
|
|
1223
|
+
v2: true,
|
|
1224
|
+
block: true,
|
|
1225
|
+
priority: "tertiary",
|
|
1226
|
+
onClick: () => {
|
|
1227
|
+
var _a;
|
|
1228
|
+
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
1229
|
+
},
|
|
1230
|
+
children: formatMessage(step_messages_default.scrollToBottom)
|
|
1231
|
+
}
|
|
1232
|
+
);
|
|
1233
|
+
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
1234
|
+
if (isElementVisible && !hasStepFooterContent) {
|
|
1235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
1236
|
+
}
|
|
1237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
1240
|
+
!isElementVisible && scrollButton,
|
|
1241
|
+
footer
|
|
1242
|
+
] })
|
|
1243
|
+
] });
|
|
1244
|
+
};
|
|
1245
|
+
var useIsElementVisible = (elementRef) => {
|
|
1246
|
+
const [isVisible, setIsVisible] = (0, import_react4.useState)(false);
|
|
1247
|
+
(0, import_react4.useEffect)(() => {
|
|
1248
|
+
const element = elementRef.current;
|
|
1249
|
+
if (!element) return;
|
|
1250
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
1251
|
+
setIsVisible(entry.isIntersecting);
|
|
1252
|
+
});
|
|
1253
|
+
observer.observe(element);
|
|
1254
|
+
return () => observer.disconnect();
|
|
1255
|
+
}, [elementRef]);
|
|
1256
|
+
return isVisible;
|
|
1257
|
+
};
|
|
1258
|
+
|
|
1259
|
+
// ../renderers/src/CollectionRenderer.tsx
|
|
1260
|
+
var import_icons = require("@transferwise/icons");
|
|
1261
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1262
|
+
var CollectionRendererComponent = ({
|
|
1263
|
+
control,
|
|
1264
|
+
state,
|
|
1265
|
+
filters,
|
|
1266
|
+
search,
|
|
1267
|
+
tags,
|
|
1268
|
+
loadMore
|
|
1269
|
+
}) => {
|
|
1270
|
+
const endOfContentRef = (0, import_react5.useRef)(null);
|
|
1271
|
+
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
1272
|
+
(0, import_react5.useEffect)(() => {
|
|
1273
|
+
if (isBottomVisible) {
|
|
1274
|
+
loadMore == null ? void 0 : loadMore();
|
|
1275
|
+
}
|
|
1276
|
+
}, [isBottomVisible]);
|
|
1277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
1278
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FieldInput_default, { id: "search", description: "", validation: void 0, help: "", label: search.title, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components15.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1279
|
+
import_components15.Input,
|
|
1280
|
+
{
|
|
1281
|
+
id: "search",
|
|
1282
|
+
name: "search",
|
|
1283
|
+
shape: "pill",
|
|
1284
|
+
placeholder: search.hint,
|
|
1285
|
+
type: "text",
|
|
1286
|
+
value: search.query,
|
|
1287
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
1288
|
+
search.onChange(value);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
) }) }),
|
|
1292
|
+
filters.map((filter) => {
|
|
1293
|
+
if (!filter.options) {
|
|
1294
|
+
return null;
|
|
1295
|
+
}
|
|
1296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1297
|
+
import_components15.Chips,
|
|
1298
|
+
{
|
|
1299
|
+
className: "m-b-1",
|
|
1300
|
+
selected: filter.options.some((option) => option.selected) ? filter.options.filter((option) => option.selected).map((option) => option.id) : "",
|
|
1301
|
+
chips: [
|
|
1302
|
+
{
|
|
1303
|
+
value: "",
|
|
1304
|
+
// this is a placeholder for now...
|
|
1305
|
+
label: "All"
|
|
1306
|
+
},
|
|
1307
|
+
...filter.options.map((option) => ({
|
|
1308
|
+
value: option.id,
|
|
1309
|
+
label: option.title
|
|
1310
|
+
}))
|
|
1311
|
+
],
|
|
1312
|
+
onChange: (value) => {
|
|
1313
|
+
var _a, _b, _c;
|
|
1314
|
+
if (value.selectedValue === "") {
|
|
1315
|
+
(_a = filter.options) == null ? void 0 : _a.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
(_c = (_b = filter.options) == null ? void 0 : _b.find((option) => value.selectedValue === option.id)) == null ? void 0 : _c.onSelect();
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
JSON.stringify(filter.options)
|
|
1322
|
+
);
|
|
1323
|
+
}),
|
|
1324
|
+
state.type === "collection-content" ? state.sections.map((section) => {
|
|
1325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Header, { title: section.title, callToAction: section.callToAction }),
|
|
1327
|
+
section.items.map((item) => {
|
|
1328
|
+
var _a, _b;
|
|
1329
|
+
const {
|
|
1330
|
+
title: itemTitle,
|
|
1331
|
+
description,
|
|
1332
|
+
supportingValues,
|
|
1333
|
+
media,
|
|
1334
|
+
additionalInfo,
|
|
1335
|
+
inlineAlert,
|
|
1336
|
+
callToAction: itemCallToAction,
|
|
1337
|
+
tags: itemTags
|
|
1338
|
+
} = item;
|
|
1339
|
+
const controlOptions = {
|
|
1340
|
+
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
1341
|
+
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
1342
|
+
};
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1344
|
+
import_components15.ListItem,
|
|
1345
|
+
{
|
|
1346
|
+
title: itemTitle,
|
|
1347
|
+
subtitle: description,
|
|
1348
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
1349
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
1350
|
+
media: getMedia(media, shouldUseAvatar(control, itemTags)),
|
|
1351
|
+
prompt: getInlineAlert(inlineAlert),
|
|
1352
|
+
additionalInfo: getAdditionalInfo(additionalInfo),
|
|
1353
|
+
control: getCTAControl(itemCallToAction, controlOptions)
|
|
1354
|
+
},
|
|
1355
|
+
itemTitle
|
|
1356
|
+
);
|
|
1357
|
+
})
|
|
1358
|
+
] }, section.id);
|
|
1359
|
+
}) : state.children,
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: endOfContentRef, "aria-hidden": true })
|
|
1361
|
+
] });
|
|
1362
|
+
};
|
|
1363
|
+
var CollectionRenderer = {
|
|
1364
|
+
canRenderType: "collection",
|
|
1365
|
+
render: CollectionRendererComponent
|
|
1366
|
+
};
|
|
1367
|
+
var CollectionRenderer_default = CollectionRenderer;
|
|
1368
|
+
|
|
1108
1369
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1109
1370
|
var import_classnames3 = __toESM(require_classnames());
|
|
1110
|
-
var
|
|
1371
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1111
1372
|
var ColumnsRenderer = {
|
|
1112
1373
|
canRenderType: "columns",
|
|
1113
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0,
|
|
1374
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1114
1375
|
"div",
|
|
1115
1376
|
{
|
|
1116
1377
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -1118,8 +1379,8 @@ var ColumnsRenderer = {
|
|
|
1118
1379
|
"df-columns-renderer-bias-end": bias === "end"
|
|
1119
1380
|
}),
|
|
1120
1381
|
children: [
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
1123
1384
|
]
|
|
1124
1385
|
}
|
|
1125
1386
|
)
|
|
@@ -1127,7 +1388,7 @@ var ColumnsRenderer = {
|
|
|
1127
1388
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
1128
1389
|
|
|
1129
1390
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1130
|
-
var
|
|
1391
|
+
var import_components16 = require("@transferwise/components");
|
|
1131
1392
|
|
|
1132
1393
|
// ../renderers/src/validators/type-validators.ts
|
|
1133
1394
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
@@ -1154,7 +1415,7 @@ var dateToDateString = (date) => {
|
|
|
1154
1415
|
};
|
|
1155
1416
|
|
|
1156
1417
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1157
|
-
var
|
|
1418
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1158
1419
|
function VariableDateInput({
|
|
1159
1420
|
control,
|
|
1160
1421
|
inputProps
|
|
@@ -1170,8 +1431,8 @@ function VariableDateInput({
|
|
|
1170
1431
|
onFocus
|
|
1171
1432
|
} = inputProps;
|
|
1172
1433
|
if (control === "date-lookup") {
|
|
1173
|
-
return /* @__PURE__ */ (0,
|
|
1174
|
-
|
|
1434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1435
|
+
import_components16.DateLookup,
|
|
1175
1436
|
{
|
|
1176
1437
|
value: dateStringToDateOrNull(inputProps.value),
|
|
1177
1438
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -1186,8 +1447,8 @@ function VariableDateInput({
|
|
|
1186
1447
|
}
|
|
1187
1448
|
);
|
|
1188
1449
|
}
|
|
1189
|
-
return /* @__PURE__ */ (0,
|
|
1190
|
-
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1451
|
+
import_components16.DateInput,
|
|
1191
1452
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1192
1453
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
1193
1454
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -1203,7 +1464,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1203
1464
|
var VariableDateInput_default = VariableDateInput;
|
|
1204
1465
|
|
|
1205
1466
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1206
|
-
var
|
|
1467
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1207
1468
|
var DateInputRenderer = {
|
|
1208
1469
|
canRenderType: "input-date",
|
|
1209
1470
|
render: (props) => {
|
|
@@ -1228,7 +1489,7 @@ var DateInputRenderer = {
|
|
|
1228
1489
|
]);
|
|
1229
1490
|
const value = initialValue != null ? initialValue : "";
|
|
1230
1491
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1231
|
-
return /* @__PURE__ */ (0,
|
|
1492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1232
1493
|
FieldInput_default,
|
|
1233
1494
|
{
|
|
1234
1495
|
id,
|
|
@@ -1236,7 +1497,7 @@ var DateInputRenderer = {
|
|
|
1236
1497
|
description,
|
|
1237
1498
|
validation: validationState,
|
|
1238
1499
|
help,
|
|
1239
|
-
children: /* @__PURE__ */ (0,
|
|
1500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(VariableDateInput_default, { control, inputProps })
|
|
1240
1501
|
}
|
|
1241
1502
|
);
|
|
1242
1503
|
}
|
|
@@ -1244,46 +1505,16 @@ var DateInputRenderer = {
|
|
|
1244
1505
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1245
1506
|
|
|
1246
1507
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1247
|
-
var
|
|
1248
|
-
|
|
1249
|
-
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1250
|
-
var import_components13 = require("@transferwise/components");
|
|
1251
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1252
|
-
var getAdditionalInfo = (additionalInfo) => {
|
|
1253
|
-
if (!additionalInfo) {
|
|
1254
|
-
return void 0;
|
|
1255
|
-
}
|
|
1256
|
-
const { href, text, onClick } = additionalInfo;
|
|
1257
|
-
if (href || onClick) {
|
|
1258
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1259
|
-
import_components13.ListItem.AdditionalInfo,
|
|
1260
|
-
{
|
|
1261
|
-
action: {
|
|
1262
|
-
label: text,
|
|
1263
|
-
href,
|
|
1264
|
-
onClick,
|
|
1265
|
-
target: "_blank"
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
);
|
|
1269
|
-
}
|
|
1270
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1271
|
-
};
|
|
1272
|
-
|
|
1273
|
-
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1274
|
-
var shouldUseAvatar = (control, tags) => {
|
|
1275
|
-
var _a;
|
|
1276
|
-
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1277
|
-
};
|
|
1508
|
+
var import_components19 = require("@transferwise/components");
|
|
1278
1509
|
|
|
1279
1510
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1282
|
-
var
|
|
1511
|
+
var import_components18 = require("@transferwise/components");
|
|
1512
|
+
var import_react6 = require("react");
|
|
1513
|
+
var import_react_intl10 = require("react-intl");
|
|
1283
1514
|
|
|
1284
1515
|
// ../renderers/src/messages/filter.messages.ts
|
|
1285
|
-
var
|
|
1286
|
-
var filter_messages_default = (0,
|
|
1516
|
+
var import_react_intl7 = require("react-intl");
|
|
1517
|
+
var filter_messages_default = (0, import_react_intl7.defineMessages)({
|
|
1287
1518
|
placeholder: {
|
|
1288
1519
|
id: "df.wise.filter.placeholder",
|
|
1289
1520
|
defaultMessage: "Start typing to search",
|
|
@@ -1349,12 +1580,12 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
1349
1580
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
1350
1581
|
|
|
1351
1582
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1352
|
-
var
|
|
1353
|
-
var
|
|
1583
|
+
var import_components17 = require("@transferwise/components");
|
|
1584
|
+
var import_react_intl9 = require("react-intl");
|
|
1354
1585
|
|
|
1355
1586
|
// ../renderers/src/messages/group.messages.ts
|
|
1356
|
-
var
|
|
1357
|
-
var group_messages_default = (0,
|
|
1587
|
+
var import_react_intl8 = require("react-intl");
|
|
1588
|
+
var group_messages_default = (0, import_react_intl8.defineMessages)({
|
|
1358
1589
|
all: {
|
|
1359
1590
|
id: "df.wise.group.all",
|
|
1360
1591
|
defaultMessage: "All",
|
|
@@ -1388,19 +1619,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
1388
1619
|
};
|
|
1389
1620
|
|
|
1390
1621
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1391
|
-
var
|
|
1622
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1392
1623
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1393
1624
|
var isGroupedDecision = (options) => {
|
|
1394
1625
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
1395
1626
|
};
|
|
1396
1627
|
var GroupedDecisionList = (_a) => {
|
|
1397
1628
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1398
|
-
const { formatMessage } = (0,
|
|
1629
|
+
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
1399
1630
|
const { options } = rest;
|
|
1400
1631
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
1401
|
-
return /* @__PURE__ */ (0,
|
|
1402
|
-
/* @__PURE__ */ (0,
|
|
1403
|
-
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_components17.Section, { children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1634
|
+
import_components17.Header,
|
|
1404
1635
|
{
|
|
1405
1636
|
as: "h2",
|
|
1406
1637
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -1411,26 +1642,26 @@ var GroupedDecisionList = (_a) => {
|
|
|
1411
1642
|
};
|
|
1412
1643
|
|
|
1413
1644
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1414
|
-
var
|
|
1645
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1415
1646
|
var DecisionWrapper = (props) => {
|
|
1416
|
-
return /* @__PURE__ */ (0,
|
|
1417
|
-
props.title && /* @__PURE__ */ (0,
|
|
1418
|
-
props.control === "filtered" ? /* @__PURE__ */ (0,
|
|
1647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getMargin(props.margin), children: [
|
|
1648
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components18.Header, { as: "h2", title: props.title }),
|
|
1649
|
+
props.control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
1419
1650
|
] });
|
|
1420
1651
|
};
|
|
1421
1652
|
var UnfilteredDecisionList = (_a) => {
|
|
1422
1653
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1423
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
1654
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
1424
1655
|
};
|
|
1425
1656
|
var FilteredDecisionList = (props) => {
|
|
1426
|
-
const { formatMessage } = (0,
|
|
1427
|
-
const [query, setQuery] = (0,
|
|
1657
|
+
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
1658
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
1428
1659
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
1429
1660
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
1430
1661
|
const isGrouped = isGroupedDecision(options);
|
|
1431
|
-
return /* @__PURE__ */ (0,
|
|
1432
|
-
/* @__PURE__ */ (0,
|
|
1433
|
-
|
|
1662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1664
|
+
import_components18.SearchInput,
|
|
1434
1665
|
{
|
|
1435
1666
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
1436
1667
|
value: query,
|
|
@@ -1441,25 +1672,25 @@ var FilteredDecisionList = (props) => {
|
|
|
1441
1672
|
}
|
|
1442
1673
|
}
|
|
1443
1674
|
),
|
|
1444
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
1445
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
1675
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1676
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components18.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
1446
1677
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
1447
1678
|
control,
|
|
1448
1679
|
className: query.length === 0 ? "m-t-3" : "",
|
|
1449
1680
|
options: filteredOptions
|
|
1450
|
-
}) : /* @__PURE__ */ (0,
|
|
1681
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
1451
1682
|
] })
|
|
1452
1683
|
] });
|
|
1453
1684
|
};
|
|
1454
1685
|
|
|
1455
1686
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1456
|
-
var
|
|
1687
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1457
1688
|
var DecisionRenderer = {
|
|
1458
1689
|
canRenderType: "decision",
|
|
1459
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1690
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
1460
1691
|
};
|
|
1461
1692
|
var renderDecisionList = ({ options, control }) => {
|
|
1462
|
-
return /* @__PURE__ */ (0,
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: options.map((_a) => {
|
|
1463
1694
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
1464
1695
|
const {
|
|
1465
1696
|
description,
|
|
@@ -1472,8 +1703,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1472
1703
|
supportingValues,
|
|
1473
1704
|
tags
|
|
1474
1705
|
} = rest;
|
|
1475
|
-
return /* @__PURE__ */ (0,
|
|
1476
|
-
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1707
|
+
import_components19.ListItem,
|
|
1477
1708
|
{
|
|
1478
1709
|
title: itemTitle,
|
|
1479
1710
|
subtitle: description,
|
|
@@ -1484,7 +1715,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1484
1715
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
1485
1716
|
prompt: getInlineAlert(inlineAlert),
|
|
1486
1717
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
1487
|
-
control: href ? /* @__PURE__ */ (0,
|
|
1718
|
+
control: href ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.ListItem.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.ListItem.Navigation, { onClick })
|
|
1488
1719
|
},
|
|
1489
1720
|
JSON.stringify(rest)
|
|
1490
1721
|
);
|
|
@@ -1493,8 +1724,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1493
1724
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1494
1725
|
|
|
1495
1726
|
// ../renderers/src/DividerRenderer.tsx
|
|
1496
|
-
var
|
|
1497
|
-
var
|
|
1727
|
+
var import_components20 = require("@transferwise/components");
|
|
1728
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1498
1729
|
var mapControlToLevel = (control) => {
|
|
1499
1730
|
switch (control) {
|
|
1500
1731
|
case "section":
|
|
@@ -1507,16 +1738,16 @@ var mapControlToLevel = (control) => {
|
|
|
1507
1738
|
};
|
|
1508
1739
|
var DividerRenderer = {
|
|
1509
1740
|
canRenderType: "divider",
|
|
1510
|
-
render: ({ margin, control }) => /* @__PURE__ */ (0,
|
|
1741
|
+
render: ({ margin, control }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components20.Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
1511
1742
|
};
|
|
1512
1743
|
var DividerRenderer_default = DividerRenderer;
|
|
1513
1744
|
|
|
1514
1745
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1515
|
-
var
|
|
1746
|
+
var import_components21 = require("@transferwise/components");
|
|
1516
1747
|
|
|
1517
1748
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1518
|
-
var
|
|
1519
|
-
var external_confirmation_messages_default = (0,
|
|
1749
|
+
var import_react_intl11 = require("react-intl");
|
|
1750
|
+
var external_confirmation_messages_default = (0, import_react_intl11.defineMessages)({
|
|
1520
1751
|
title: {
|
|
1521
1752
|
id: "df.wise.ExternalConfirmation.title",
|
|
1522
1753
|
defaultMessage: "Please confirm",
|
|
@@ -1540,9 +1771,9 @@ var external_confirmation_messages_default = (0, import_react_intl9.defineMessag
|
|
|
1540
1771
|
});
|
|
1541
1772
|
|
|
1542
1773
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1543
|
-
var
|
|
1544
|
-
var
|
|
1545
|
-
var
|
|
1774
|
+
var import_react_intl12 = require("react-intl");
|
|
1775
|
+
var import_react7 = require("react");
|
|
1776
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1546
1777
|
var ExternalConfirmationRenderer = {
|
|
1547
1778
|
canRenderType: "external-confirmation",
|
|
1548
1779
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1553,20 +1784,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
1553
1784
|
open,
|
|
1554
1785
|
onCancel
|
|
1555
1786
|
}) {
|
|
1556
|
-
const { formatMessage } = (0,
|
|
1557
|
-
(0,
|
|
1787
|
+
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
1788
|
+
(0, import_react7.useEffect)(() => {
|
|
1558
1789
|
open();
|
|
1559
1790
|
}, []);
|
|
1560
|
-
return /* @__PURE__ */ (0,
|
|
1561
|
-
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1792
|
+
import_components21.Modal,
|
|
1562
1793
|
{
|
|
1563
1794
|
open: visible,
|
|
1564
1795
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1565
|
-
body: /* @__PURE__ */ (0,
|
|
1566
|
-
/* @__PURE__ */ (0,
|
|
1567
|
-
/* @__PURE__ */ (0,
|
|
1568
|
-
/* @__PURE__ */ (0,
|
|
1569
|
-
|
|
1796
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components21.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1798
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1800
|
+
import_components21.Button,
|
|
1570
1801
|
{
|
|
1571
1802
|
v2: true,
|
|
1572
1803
|
block: true,
|
|
@@ -1579,7 +1810,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1579
1810
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1580
1811
|
}
|
|
1581
1812
|
),
|
|
1582
|
-
/* @__PURE__ */ (0,
|
|
1813
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components21.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1583
1814
|
] }) })
|
|
1584
1815
|
] }),
|
|
1585
1816
|
onClose: onCancel
|
|
@@ -1596,46 +1827,46 @@ function getOrigin(url) {
|
|
|
1596
1827
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1597
1828
|
|
|
1598
1829
|
// ../renderers/src/FormRenderer.tsx
|
|
1599
|
-
var
|
|
1830
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1600
1831
|
var FormRenderer = {
|
|
1601
1832
|
canRenderType: "form",
|
|
1602
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1833
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getMargin(margin), children })
|
|
1603
1834
|
};
|
|
1604
1835
|
var FormRenderer_default = FormRenderer;
|
|
1605
1836
|
|
|
1606
1837
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1607
|
-
var
|
|
1608
|
-
var
|
|
1838
|
+
var import_components22 = require("@transferwise/components");
|
|
1839
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1609
1840
|
var FormSectionRenderer = {
|
|
1610
1841
|
canRenderType: "form-section",
|
|
1611
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1612
|
-
title && /* @__PURE__ */ (0,
|
|
1613
|
-
|
|
1842
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("fieldset", { children: [
|
|
1843
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1844
|
+
import_components22.Header,
|
|
1614
1845
|
{
|
|
1615
1846
|
as: "h2",
|
|
1616
1847
|
title
|
|
1617
1848
|
}
|
|
1618
1849
|
),
|
|
1619
|
-
description && /* @__PURE__ */ (0,
|
|
1850
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: description }),
|
|
1620
1851
|
children
|
|
1621
1852
|
] })
|
|
1622
1853
|
};
|
|
1623
1854
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
1624
1855
|
|
|
1625
1856
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1626
|
-
var
|
|
1627
|
-
var
|
|
1857
|
+
var import_components23 = require("@transferwise/components");
|
|
1858
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1628
1859
|
var HeadingRenderer = {
|
|
1629
1860
|
canRenderType: "heading",
|
|
1630
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1861
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Heading, __spreadValues({}, props))
|
|
1631
1862
|
};
|
|
1632
1863
|
function Heading(props) {
|
|
1633
1864
|
const { text, size, align, margin, control } = props;
|
|
1634
1865
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1635
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1866
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StandardHeading, { size, text, className });
|
|
1636
1867
|
}
|
|
1637
1868
|
function DisplayHeading({ size, text, className }) {
|
|
1638
|
-
return /* @__PURE__ */ (0,
|
|
1869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Display, { type: getDisplayType(size), className, children: text });
|
|
1639
1870
|
}
|
|
1640
1871
|
var getDisplayType = (size) => {
|
|
1641
1872
|
switch (size) {
|
|
@@ -1651,7 +1882,7 @@ var getDisplayType = (size) => {
|
|
|
1651
1882
|
}
|
|
1652
1883
|
};
|
|
1653
1884
|
function StandardHeading({ size, text, className }) {
|
|
1654
|
-
return /* @__PURE__ */ (0,
|
|
1885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1655
1886
|
}
|
|
1656
1887
|
var getTitleTypeBySize = (size) => {
|
|
1657
1888
|
var _a;
|
|
@@ -1667,8 +1898,8 @@ var getTitleTypeBySize = (size) => {
|
|
|
1667
1898
|
var HeadingRenderer_default = HeadingRenderer;
|
|
1668
1899
|
|
|
1669
1900
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1670
|
-
var
|
|
1671
|
-
var
|
|
1901
|
+
var import_components24 = require("@transferwise/components");
|
|
1902
|
+
var import_react8 = require("react");
|
|
1672
1903
|
|
|
1673
1904
|
// ../renderers/src/utils/api-utils.ts
|
|
1674
1905
|
function isRelativePath(url = "") {
|
|
@@ -1678,7 +1909,7 @@ function isRelativePath(url = "") {
|
|
|
1678
1909
|
}
|
|
1679
1910
|
|
|
1680
1911
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1681
|
-
var
|
|
1912
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1682
1913
|
function UrlImage({
|
|
1683
1914
|
accessibilityDescription,
|
|
1684
1915
|
align,
|
|
@@ -1687,14 +1918,14 @@ function UrlImage({
|
|
|
1687
1918
|
uri,
|
|
1688
1919
|
httpClient
|
|
1689
1920
|
}) {
|
|
1690
|
-
const [imageSource, setImageSource] = (0,
|
|
1691
|
-
(0,
|
|
1921
|
+
const [imageSource, setImageSource] = (0, import_react8.useState)("");
|
|
1922
|
+
(0, import_react8.useEffect)(() => {
|
|
1692
1923
|
if (!uri.startsWith("urn:")) {
|
|
1693
1924
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1694
1925
|
}
|
|
1695
1926
|
}, [uri, httpClient]);
|
|
1696
|
-
return /* @__PURE__ */ (0,
|
|
1697
|
-
|
|
1927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1928
|
+
import_components24.Image,
|
|
1698
1929
|
{
|
|
1699
1930
|
className: "df-reserve-space",
|
|
1700
1931
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -1737,7 +1968,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1737
1968
|
};
|
|
1738
1969
|
|
|
1739
1970
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1740
|
-
var
|
|
1971
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1741
1972
|
var maxFlagSize = 600;
|
|
1742
1973
|
function UrnFlagImage({
|
|
1743
1974
|
accessibilityDescription,
|
|
@@ -1746,12 +1977,12 @@ function UrnFlagImage({
|
|
|
1746
1977
|
size,
|
|
1747
1978
|
uri
|
|
1748
1979
|
}) {
|
|
1749
|
-
return /* @__PURE__ */ (0,
|
|
1980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1750
1981
|
}
|
|
1751
1982
|
|
|
1752
1983
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1753
1984
|
var import_art4 = require("@wise/art");
|
|
1754
|
-
var
|
|
1985
|
+
var import_react10 = require("react");
|
|
1755
1986
|
|
|
1756
1987
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1757
1988
|
var isAnimated = (uri) => {
|
|
@@ -1761,9 +1992,9 @@ var isAnimated = (uri) => {
|
|
|
1761
1992
|
|
|
1762
1993
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1763
1994
|
var import_art3 = require("@wise/art");
|
|
1764
|
-
var
|
|
1765
|
-
var
|
|
1766
|
-
var Illustration3DErrorBoundary = class extends
|
|
1995
|
+
var import_react9 = require("react");
|
|
1996
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1997
|
+
var Illustration3DErrorBoundary = class extends import_react9.Component {
|
|
1767
1998
|
constructor(props) {
|
|
1768
1999
|
super(props);
|
|
1769
2000
|
this.state = { hasError: false };
|
|
@@ -1786,12 +2017,12 @@ var SafeIllustration3D = ({
|
|
|
1786
2017
|
size,
|
|
1787
2018
|
onError
|
|
1788
2019
|
}) => {
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
2020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_art3.Illustration3D, { name, size }) });
|
|
1790
2021
|
};
|
|
1791
2022
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1792
2023
|
|
|
1793
2024
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1794
|
-
var
|
|
2025
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1795
2026
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1796
2027
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1797
2028
|
function UrnIllustration({
|
|
@@ -1801,12 +2032,12 @@ function UrnIllustration({
|
|
|
1801
2032
|
size,
|
|
1802
2033
|
uri
|
|
1803
2034
|
}) {
|
|
1804
|
-
const [has3DFailed, setHas3DFailed] = (0,
|
|
2035
|
+
const [has3DFailed, setHas3DFailed] = (0, import_react10.useState)(false);
|
|
1805
2036
|
const illustrationSize = getIllustrationSize(size);
|
|
1806
2037
|
const illustrationName = getIllustrationName(uri);
|
|
1807
2038
|
const illustration3DName = getIllustration3DName(uri);
|
|
1808
2039
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
2040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1810
2041
|
SafeIllustration3D_default,
|
|
1811
2042
|
{
|
|
1812
2043
|
name: illustration3DName,
|
|
@@ -1815,7 +2046,7 @@ function UrnIllustration({
|
|
|
1815
2046
|
}
|
|
1816
2047
|
) });
|
|
1817
2048
|
}
|
|
1818
|
-
return /* @__PURE__ */ (0,
|
|
2049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1819
2050
|
import_art4.Illustration,
|
|
1820
2051
|
{
|
|
1821
2052
|
className: "df-illustration",
|
|
@@ -1835,32 +2066,32 @@ var getIllustration3DName = (uri) => {
|
|
|
1835
2066
|
};
|
|
1836
2067
|
|
|
1837
2068
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1838
|
-
var
|
|
2069
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1839
2070
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1840
2071
|
function UrnImage(props) {
|
|
1841
2072
|
const { uri } = props;
|
|
1842
2073
|
if (isUrnIllustration(uri)) {
|
|
1843
|
-
return /* @__PURE__ */ (0,
|
|
2074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
1844
2075
|
}
|
|
1845
2076
|
if (isUrnFlag(uri)) {
|
|
1846
|
-
return /* @__PURE__ */ (0,
|
|
2077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
1847
2078
|
}
|
|
1848
2079
|
return null;
|
|
1849
2080
|
}
|
|
1850
2081
|
|
|
1851
2082
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1852
|
-
var
|
|
2083
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1853
2084
|
var ImageRenderer = {
|
|
1854
2085
|
canRenderType: "image",
|
|
1855
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
2086
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UrlImage, __spreadValues({}, props))
|
|
1856
2087
|
};
|
|
1857
2088
|
|
|
1858
2089
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
1859
2090
|
var ImageRenderer_default = ImageRenderer;
|
|
1860
2091
|
|
|
1861
2092
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1862
|
-
var
|
|
1863
|
-
var
|
|
2093
|
+
var import_components25 = require("@transferwise/components");
|
|
2094
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1864
2095
|
var doContext = ["positive", "neutral"];
|
|
1865
2096
|
var dontContext = ["warning", "negative"];
|
|
1866
2097
|
var InstructionsRenderer = {
|
|
@@ -1868,16 +2099,16 @@ var InstructionsRenderer = {
|
|
|
1868
2099
|
render: ({ items, margin, title }) => {
|
|
1869
2100
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1870
2101
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1871
|
-
return /* @__PURE__ */ (0,
|
|
1872
|
-
title ? /* @__PURE__ */ (0,
|
|
1873
|
-
/* @__PURE__ */ (0,
|
|
2102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(margin), children: [
|
|
2103
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components25.Header, { title }) : null,
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components25.InstructionsList, { dos, donts })
|
|
1874
2105
|
] });
|
|
1875
2106
|
}
|
|
1876
2107
|
};
|
|
1877
2108
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1878
2109
|
|
|
1879
2110
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1880
|
-
var
|
|
2111
|
+
var import_components26 = require("@transferwise/components");
|
|
1881
2112
|
|
|
1882
2113
|
// ../renderers/src/utils/input-utils.ts
|
|
1883
2114
|
var onWheel = (event) => {
|
|
@@ -1902,7 +2133,7 @@ function pick(obj, ...keys) {
|
|
|
1902
2133
|
}
|
|
1903
2134
|
|
|
1904
2135
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1905
|
-
var
|
|
2136
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1906
2137
|
var IntegerInputRenderer = {
|
|
1907
2138
|
canRenderType: "input-integer",
|
|
1908
2139
|
render: (props) => {
|
|
@@ -1917,7 +2148,7 @@ var IntegerInputRenderer = {
|
|
|
1917
2148
|
"maximum",
|
|
1918
2149
|
"minimum"
|
|
1919
2150
|
);
|
|
1920
|
-
return /* @__PURE__ */ (0,
|
|
2151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1921
2152
|
FieldInput_default,
|
|
1922
2153
|
{
|
|
1923
2154
|
id,
|
|
@@ -1925,8 +2156,8 @@ var IntegerInputRenderer = {
|
|
|
1925
2156
|
description,
|
|
1926
2157
|
validation: validationState,
|
|
1927
2158
|
help,
|
|
1928
|
-
children: /* @__PURE__ */ (0,
|
|
1929
|
-
|
|
2159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components26.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2160
|
+
import_components26.Input,
|
|
1930
2161
|
__spreadValues({
|
|
1931
2162
|
id,
|
|
1932
2163
|
name: id,
|
|
@@ -1948,55 +2179,12 @@ var IntegerInputRenderer = {
|
|
|
1948
2179
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1949
2180
|
|
|
1950
2181
|
// ../renderers/src/ListRenderer.tsx
|
|
1951
|
-
var
|
|
1952
|
-
|
|
1953
|
-
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1954
|
-
var import_components24 = require("@transferwise/components");
|
|
1955
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1956
|
-
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1957
|
-
if (!callToAction) {
|
|
1958
|
-
return void 0;
|
|
1959
|
-
}
|
|
1960
|
-
const { accessibilityDescription, href, title, context, onClick } = callToAction;
|
|
1961
|
-
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
1962
|
-
if (href) {
|
|
1963
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1964
|
-
import_components24.ListItem.Button,
|
|
1965
|
-
{
|
|
1966
|
-
href,
|
|
1967
|
-
target: "_blank",
|
|
1968
|
-
rel: "noopener noreferrer",
|
|
1969
|
-
partiallyInteractive: !fullyInteractive,
|
|
1970
|
-
priority,
|
|
1971
|
-
"aria-description": accessibilityDescription,
|
|
1972
|
-
sentiment,
|
|
1973
|
-
children: title
|
|
1974
|
-
}
|
|
1975
|
-
);
|
|
1976
|
-
}
|
|
1977
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1978
|
-
import_components24.ListItem.Button,
|
|
1979
|
-
{
|
|
1980
|
-
"aria-description": accessibilityDescription,
|
|
1981
|
-
partiallyInteractive: !fullyInteractive,
|
|
1982
|
-
priority,
|
|
1983
|
-
sentiment,
|
|
1984
|
-
onClick,
|
|
1985
|
-
children: title
|
|
1986
|
-
}
|
|
1987
|
-
);
|
|
1988
|
-
};
|
|
1989
|
-
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
1990
|
-
if (context === "negative") {
|
|
1991
|
-
return { priority: "secondary", sentiment: "negative" };
|
|
1992
|
-
}
|
|
1993
|
-
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
1994
|
-
};
|
|
2182
|
+
var import_components28 = require("@transferwise/components");
|
|
1995
2183
|
|
|
1996
2184
|
// ../renderers/src/components/Header.tsx
|
|
1997
|
-
var
|
|
1998
|
-
var
|
|
1999
|
-
var
|
|
2185
|
+
var import_components27 = require("@transferwise/components");
|
|
2186
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2187
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components27.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
2000
2188
|
var getHeaderAction = (callToAction) => {
|
|
2001
2189
|
if (!callToAction) {
|
|
2002
2190
|
return void 0;
|
|
@@ -2018,11 +2206,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
2018
2206
|
};
|
|
2019
2207
|
|
|
2020
2208
|
// ../renderers/src/ListRenderer.tsx
|
|
2021
|
-
var
|
|
2209
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2022
2210
|
var ListRenderer = {
|
|
2023
2211
|
canRenderType: "list",
|
|
2024
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
2025
|
-
/* @__PURE__ */ (0,
|
|
2212
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: getMargin(margin), children: [
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Header, { title, callToAction }),
|
|
2026
2214
|
items.map((item) => {
|
|
2027
2215
|
var _a, _b;
|
|
2028
2216
|
const {
|
|
@@ -2039,8 +2227,8 @@ var ListRenderer = {
|
|
|
2039
2227
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2040
2228
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2041
2229
|
};
|
|
2042
|
-
return /* @__PURE__ */ (0,
|
|
2043
|
-
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2231
|
+
import_components28.ListItem,
|
|
2044
2232
|
{
|
|
2045
2233
|
title: itemTitle,
|
|
2046
2234
|
subtitle: description,
|
|
@@ -2059,12 +2247,12 @@ var ListRenderer = {
|
|
|
2059
2247
|
var ListRenderer_default = ListRenderer;
|
|
2060
2248
|
|
|
2061
2249
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
2062
|
-
var
|
|
2063
|
-
var
|
|
2250
|
+
var import_components29 = require("@transferwise/components");
|
|
2251
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2064
2252
|
var LoadingIndicatorRenderer = {
|
|
2065
2253
|
canRenderType: "loading-indicator",
|
|
2066
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
2067
|
-
|
|
2254
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2255
|
+
import_components29.Loader,
|
|
2068
2256
|
{
|
|
2069
2257
|
size,
|
|
2070
2258
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
@@ -2075,12 +2263,12 @@ var LoadingIndicatorRenderer = {
|
|
|
2075
2263
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
2076
2264
|
|
|
2077
2265
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
2078
|
-
var
|
|
2079
|
-
var
|
|
2266
|
+
var import_components30 = require("@transferwise/components");
|
|
2267
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2080
2268
|
var MarkdownRenderer = {
|
|
2081
2269
|
canRenderType: "markdown",
|
|
2082
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0,
|
|
2083
|
-
|
|
2270
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2271
|
+
import_components30.Markdown,
|
|
2084
2272
|
{
|
|
2085
2273
|
className: ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large",
|
|
2086
2274
|
config: { link: { target: "_blank" } },
|
|
@@ -2091,16 +2279,16 @@ var MarkdownRenderer = {
|
|
|
2091
2279
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
2092
2280
|
|
|
2093
2281
|
// ../renderers/src/MediaRenderer.tsx
|
|
2094
|
-
var
|
|
2282
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2095
2283
|
var MediaRenderer = {
|
|
2096
2284
|
canRenderType: "media",
|
|
2097
2285
|
render: (_a) => {
|
|
2098
2286
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
2099
2287
|
switch (media.type) {
|
|
2100
2288
|
case "avatar":
|
|
2101
|
-
return /* @__PURE__ */ (0,
|
|
2289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2102
2290
|
case "image":
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2104
2292
|
case "legacy":
|
|
2105
2293
|
return null;
|
|
2106
2294
|
}
|
|
@@ -2112,7 +2300,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
2112
2300
|
margin,
|
|
2113
2301
|
size
|
|
2114
2302
|
}) => {
|
|
2115
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
2116
2304
|
};
|
|
2117
2305
|
var ImageMediaRendererComponent = (_a) => {
|
|
2118
2306
|
var _b = _a, {
|
|
@@ -2120,7 +2308,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
2120
2308
|
} = _b, rest = __objRest(_b, [
|
|
2121
2309
|
"media"
|
|
2122
2310
|
]);
|
|
2123
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
2311
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
2124
2312
|
};
|
|
2125
2313
|
var mapAvatarMediaSize = (size) => {
|
|
2126
2314
|
switch (size) {
|
|
@@ -2138,21 +2326,21 @@ var mapAvatarMediaSize = (size) => {
|
|
|
2138
2326
|
};
|
|
2139
2327
|
|
|
2140
2328
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
2141
|
-
var
|
|
2142
|
-
var
|
|
2143
|
-
var
|
|
2329
|
+
var import_components31 = require("@transferwise/components");
|
|
2330
|
+
var import_react11 = require("react");
|
|
2331
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2144
2332
|
var ModalLayoutRenderer = {
|
|
2145
2333
|
canRenderType: "modal-layout",
|
|
2146
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2334
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DFModal, __spreadValues({}, props))
|
|
2147
2335
|
};
|
|
2148
2336
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
2149
2337
|
function DFModal({ content, margin, trigger }) {
|
|
2150
|
-
const [visible, setVisible] = (0,
|
|
2338
|
+
const [visible, setVisible] = (0, import_react11.useState)(false);
|
|
2151
2339
|
const { children, title } = content;
|
|
2152
|
-
return /* @__PURE__ */ (0,
|
|
2153
|
-
/* @__PURE__ */ (0,
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2155
|
-
|
|
2340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: getMargin(margin), children: [
|
|
2341
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components31.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
2342
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2343
|
+
import_components31.Modal,
|
|
2156
2344
|
{
|
|
2157
2345
|
scroll: "content",
|
|
2158
2346
|
open: visible,
|
|
@@ -2166,20 +2354,20 @@ function DFModal({ content, margin, trigger }) {
|
|
|
2166
2354
|
}
|
|
2167
2355
|
|
|
2168
2356
|
// ../renderers/src/ModalRenderer.tsx
|
|
2169
|
-
var
|
|
2170
|
-
var
|
|
2357
|
+
var import_components32 = require("@transferwise/components");
|
|
2358
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2171
2359
|
var ModalRenderer = {
|
|
2172
2360
|
canRenderType: "modal",
|
|
2173
2361
|
render: ({ title, children, open, onClose }) => {
|
|
2174
|
-
return /* @__PURE__ */ (0,
|
|
2362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components32.Modal, { open, title, body: children, onClose });
|
|
2175
2363
|
}
|
|
2176
2364
|
};
|
|
2177
2365
|
|
|
2178
2366
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
2179
|
-
var
|
|
2180
|
-
var
|
|
2181
|
-
var
|
|
2182
|
-
var
|
|
2367
|
+
var import_components33 = require("@transferwise/components");
|
|
2368
|
+
var import_react12 = require("react");
|
|
2369
|
+
var import_react_intl13 = require("react-intl");
|
|
2370
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2183
2371
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2184
2372
|
var MoneyInputRenderer = {
|
|
2185
2373
|
canRenderType: "money-input",
|
|
@@ -2200,13 +2388,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
2200
2388
|
onAmountChange,
|
|
2201
2389
|
onCurrencyChange
|
|
2202
2390
|
} = props;
|
|
2203
|
-
(0,
|
|
2391
|
+
(0, import_react12.useEffect)(() => {
|
|
2204
2392
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
2205
2393
|
onCurrencyChange(0);
|
|
2206
2394
|
}
|
|
2207
2395
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
2208
|
-
const { formatMessage } = (0,
|
|
2209
|
-
return /* @__PURE__ */ (0,
|
|
2396
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2210
2398
|
FieldInput_default,
|
|
2211
2399
|
{
|
|
2212
2400
|
id: uid,
|
|
@@ -2214,8 +2402,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
2214
2402
|
description,
|
|
2215
2403
|
validation: validationState,
|
|
2216
2404
|
help,
|
|
2217
|
-
children: /* @__PURE__ */ (0,
|
|
2218
|
-
|
|
2405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2406
|
+
import_components33.MoneyInput,
|
|
2219
2407
|
{
|
|
2220
2408
|
amount: parseFloatOrNull(amountValue),
|
|
2221
2409
|
searchPlaceholder: "",
|
|
@@ -2276,8 +2464,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
2276
2464
|
}
|
|
2277
2465
|
|
|
2278
2466
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2467
|
+
var import_components34 = require("@transferwise/components");
|
|
2468
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2281
2469
|
function InlineComponent(props) {
|
|
2282
2470
|
const {
|
|
2283
2471
|
id,
|
|
@@ -2290,7 +2478,7 @@ function InlineComponent(props) {
|
|
|
2290
2478
|
validationState,
|
|
2291
2479
|
onSelect
|
|
2292
2480
|
} = props;
|
|
2293
|
-
return /* @__PURE__ */ (0,
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2294
2482
|
FieldInput_default,
|
|
2295
2483
|
{
|
|
2296
2484
|
id,
|
|
@@ -2311,8 +2499,8 @@ function InlineComponent(props) {
|
|
|
2311
2499
|
childrenProps
|
|
2312
2500
|
} = option;
|
|
2313
2501
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2314
|
-
return /* @__PURE__ */ (0,
|
|
2315
|
-
|
|
2502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2503
|
+
import_components34.ListItem,
|
|
2316
2504
|
{
|
|
2317
2505
|
title: itemTitle,
|
|
2318
2506
|
subtitle,
|
|
@@ -2320,10 +2508,10 @@ function InlineComponent(props) {
|
|
|
2320
2508
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2321
2509
|
media: getMedia(media, false),
|
|
2322
2510
|
prompt: getInlineAlert(inlineAlert),
|
|
2323
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
2511
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components34.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2324
2512
|
disabled: disabled || optionDisabled,
|
|
2325
|
-
control: /* @__PURE__ */ (0,
|
|
2326
|
-
|
|
2513
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2514
|
+
import_components34.ListItem.Checkbox,
|
|
2327
2515
|
{
|
|
2328
2516
|
checked: selectedIndices.includes(index),
|
|
2329
2517
|
onChange: (e) => {
|
|
@@ -2341,13 +2529,13 @@ function InlineComponent(props) {
|
|
|
2341
2529
|
}
|
|
2342
2530
|
|
|
2343
2531
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2344
|
-
var
|
|
2345
|
-
var
|
|
2346
|
-
var
|
|
2532
|
+
var import_components35 = require("@transferwise/components");
|
|
2533
|
+
var import_react13 = require("react");
|
|
2534
|
+
var import_react_intl15 = require("react-intl");
|
|
2347
2535
|
|
|
2348
2536
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
2349
|
-
var
|
|
2350
|
-
var multi_select_messages_default = (0,
|
|
2537
|
+
var import_react_intl14 = require("react-intl");
|
|
2538
|
+
var multi_select_messages_default = (0, import_react_intl14.defineMessages)({
|
|
2351
2539
|
summary: {
|
|
2352
2540
|
id: "df.wise.MultiSelect.summary",
|
|
2353
2541
|
defaultMessage: "{first} and {count} more",
|
|
@@ -2356,10 +2544,10 @@ var multi_select_messages_default = (0, import_react_intl12.defineMessages)({
|
|
|
2356
2544
|
});
|
|
2357
2545
|
|
|
2358
2546
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2359
|
-
var
|
|
2547
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2360
2548
|
function DefaultComponent(props) {
|
|
2361
|
-
const { formatMessage } = (0,
|
|
2362
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
2549
|
+
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
2550
|
+
const [stagedIndices, setStagedIndices] = (0, import_react13.useState)();
|
|
2363
2551
|
const {
|
|
2364
2552
|
id,
|
|
2365
2553
|
autoComplete,
|
|
@@ -2397,12 +2585,12 @@ function DefaultComponent(props) {
|
|
|
2397
2585
|
const contentProps = {
|
|
2398
2586
|
title: option.title,
|
|
2399
2587
|
description: option.description,
|
|
2400
|
-
icon: /* @__PURE__ */ (0,
|
|
2588
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2401
2589
|
};
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components35.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2403
2591
|
};
|
|
2404
2592
|
const extraProps = { autoComplete };
|
|
2405
|
-
return /* @__PURE__ */ (0,
|
|
2593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2406
2594
|
FieldInput_default,
|
|
2407
2595
|
{
|
|
2408
2596
|
id,
|
|
@@ -2410,8 +2598,8 @@ function DefaultComponent(props) {
|
|
|
2410
2598
|
help,
|
|
2411
2599
|
description,
|
|
2412
2600
|
validation: validationState,
|
|
2413
|
-
children: /* @__PURE__ */ (0,
|
|
2414
|
-
|
|
2601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2602
|
+
import_components35.SelectInput,
|
|
2415
2603
|
__spreadValues({
|
|
2416
2604
|
id,
|
|
2417
2605
|
items: options.map((option, index) => {
|
|
@@ -2449,8 +2637,8 @@ function DefaultComponent(props) {
|
|
|
2449
2637
|
}
|
|
2450
2638
|
|
|
2451
2639
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
2452
|
-
var
|
|
2453
|
-
var
|
|
2640
|
+
var import_components36 = require("@transferwise/components");
|
|
2641
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2454
2642
|
function InlineCheckboxComponent(props) {
|
|
2455
2643
|
const {
|
|
2456
2644
|
id,
|
|
@@ -2463,7 +2651,7 @@ function InlineCheckboxComponent(props) {
|
|
|
2463
2651
|
validationState,
|
|
2464
2652
|
onSelect
|
|
2465
2653
|
} = props;
|
|
2466
|
-
return /* @__PURE__ */ (0,
|
|
2654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2467
2655
|
FieldInput_default,
|
|
2468
2656
|
{
|
|
2469
2657
|
id,
|
|
@@ -2491,35 +2679,35 @@ function InlineCheckboxComponent(props) {
|
|
|
2491
2679
|
onSelect(newSelectedIndices);
|
|
2492
2680
|
}
|
|
2493
2681
|
};
|
|
2494
|
-
return /* @__PURE__ */ (0,
|
|
2682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components36.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
2495
2683
|
})
|
|
2496
2684
|
}
|
|
2497
2685
|
);
|
|
2498
2686
|
}
|
|
2499
2687
|
|
|
2500
2688
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2501
|
-
var
|
|
2689
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2502
2690
|
var MultiSelectInputRenderer = {
|
|
2503
2691
|
canRenderType: "input-multi-select",
|
|
2504
2692
|
render: (props) => {
|
|
2505
2693
|
switch (props.control) {
|
|
2506
2694
|
case "inline":
|
|
2507
|
-
return /* @__PURE__ */ (0,
|
|
2695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InlineComponent, __spreadValues({}, props));
|
|
2508
2696
|
case "inline-checkbox-group":
|
|
2509
|
-
return /* @__PURE__ */ (0,
|
|
2697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
2510
2698
|
default:
|
|
2511
|
-
return /* @__PURE__ */ (0,
|
|
2699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
2512
2700
|
}
|
|
2513
2701
|
}
|
|
2514
2702
|
};
|
|
2515
2703
|
|
|
2516
2704
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2517
|
-
var
|
|
2705
|
+
var import_components38 = require("@transferwise/components");
|
|
2518
2706
|
|
|
2519
2707
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2520
|
-
var
|
|
2708
|
+
var import_components37 = require("@transferwise/components");
|
|
2521
2709
|
var import_classnames4 = __toESM(require_classnames());
|
|
2522
|
-
var
|
|
2710
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2523
2711
|
function UploadFieldInput({
|
|
2524
2712
|
id,
|
|
2525
2713
|
children,
|
|
@@ -2528,18 +2716,18 @@ function UploadFieldInput({
|
|
|
2528
2716
|
help,
|
|
2529
2717
|
validation
|
|
2530
2718
|
}) {
|
|
2531
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
2719
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
2532
2720
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2533
|
-
return /* @__PURE__ */ (0,
|
|
2721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2534
2722
|
"div",
|
|
2535
2723
|
{
|
|
2536
2724
|
className: (0, import_classnames4.default)("form-group d-block", {
|
|
2537
2725
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2538
2726
|
}),
|
|
2539
2727
|
children: [
|
|
2540
|
-
/* @__PURE__ */ (0,
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2541
2729
|
children,
|
|
2542
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2730
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components37.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
2543
2731
|
]
|
|
2544
2732
|
}
|
|
2545
2733
|
);
|
|
@@ -2574,7 +2762,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2574
2762
|
};
|
|
2575
2763
|
|
|
2576
2764
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2577
|
-
var
|
|
2765
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2578
2766
|
var MultiUploadInputRenderer = {
|
|
2579
2767
|
canRenderType: "input-upload-multi",
|
|
2580
2768
|
render: (props) => {
|
|
@@ -2599,7 +2787,7 @@ var MultiUploadInputRenderer = {
|
|
|
2599
2787
|
};
|
|
2600
2788
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2601
2789
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2602
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2603
2791
|
UploadFieldInput_default,
|
|
2604
2792
|
{
|
|
2605
2793
|
id,
|
|
@@ -2607,8 +2795,8 @@ var MultiUploadInputRenderer = {
|
|
|
2607
2795
|
description,
|
|
2608
2796
|
validation: validationState,
|
|
2609
2797
|
help,
|
|
2610
|
-
children: /* @__PURE__ */ (0,
|
|
2611
|
-
|
|
2798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2799
|
+
import_components38.UploadInput,
|
|
2612
2800
|
{
|
|
2613
2801
|
id,
|
|
2614
2802
|
"aria-describedby": descriptionId,
|
|
@@ -2617,7 +2805,7 @@ var MultiUploadInputRenderer = {
|
|
|
2617
2805
|
files: value.map(({ id: id2, file, validationState: validationState2 }) => ({
|
|
2618
2806
|
id: id2,
|
|
2619
2807
|
filename: file.name,
|
|
2620
|
-
status: (validationState2 == null ? void 0 : validationState2.status) === "invalid" ?
|
|
2808
|
+
status: (validationState2 == null ? void 0 : validationState2.status) === "invalid" ? import_components38.Status.FAILED : import_components38.Status.SUCCEEDED
|
|
2621
2809
|
})),
|
|
2622
2810
|
fileTypes: acceptsToFileTypes(accepts),
|
|
2623
2811
|
maxFiles: maxItems,
|
|
@@ -2635,8 +2823,8 @@ var MultiUploadInputRenderer = {
|
|
|
2635
2823
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
2636
2824
|
|
|
2637
2825
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2638
|
-
var
|
|
2639
|
-
var
|
|
2826
|
+
var import_components39 = require("@transferwise/components");
|
|
2827
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2640
2828
|
var NumberInputRenderer = {
|
|
2641
2829
|
canRenderType: "input-number",
|
|
2642
2830
|
render: (props) => {
|
|
@@ -2650,7 +2838,7 @@ var NumberInputRenderer = {
|
|
|
2650
2838
|
"maximum",
|
|
2651
2839
|
"minimum"
|
|
2652
2840
|
);
|
|
2653
|
-
return /* @__PURE__ */ (0,
|
|
2841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2654
2842
|
FieldInput_default,
|
|
2655
2843
|
{
|
|
2656
2844
|
id,
|
|
@@ -2658,8 +2846,8 @@ var NumberInputRenderer = {
|
|
|
2658
2846
|
description,
|
|
2659
2847
|
validation: validationState,
|
|
2660
2848
|
help,
|
|
2661
|
-
children: /* @__PURE__ */ (0,
|
|
2662
|
-
|
|
2849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components39.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2850
|
+
import_components39.Input,
|
|
2663
2851
|
__spreadValues({
|
|
2664
2852
|
id,
|
|
2665
2853
|
name: id,
|
|
@@ -2679,24 +2867,24 @@ var NumberInputRenderer = {
|
|
|
2679
2867
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2680
2868
|
|
|
2681
2869
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2682
|
-
var
|
|
2870
|
+
var import_react_intl17 = require("react-intl");
|
|
2683
2871
|
|
|
2684
2872
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2685
|
-
var
|
|
2686
|
-
var
|
|
2873
|
+
var import_components40 = require("@transferwise/components");
|
|
2874
|
+
var import_react14 = require("react");
|
|
2687
2875
|
function useSnackBarIfAvailable() {
|
|
2688
|
-
const context = (0,
|
|
2876
|
+
const context = (0, import_react14.useContext)(import_components40.SnackbarContext);
|
|
2689
2877
|
return context ? context.createSnackbar : () => {
|
|
2690
2878
|
};
|
|
2691
2879
|
}
|
|
2692
2880
|
|
|
2693
2881
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2694
|
-
var
|
|
2882
|
+
var import_components41 = require("@transferwise/components");
|
|
2695
2883
|
var import_classnames5 = __toESM(require_classnames());
|
|
2696
2884
|
|
|
2697
2885
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2698
|
-
var
|
|
2699
|
-
var paragraph_messages_default = (0,
|
|
2886
|
+
var import_react_intl16 = require("react-intl");
|
|
2887
|
+
var paragraph_messages_default = (0, import_react_intl16.defineMessages)({
|
|
2700
2888
|
copy: {
|
|
2701
2889
|
id: "df.wise.DynamicParagraph.copy",
|
|
2702
2890
|
defaultMessage: "Copy",
|
|
@@ -2710,14 +2898,14 @@ var paragraph_messages_default = (0, import_react_intl14.defineMessages)({
|
|
|
2710
2898
|
});
|
|
2711
2899
|
|
|
2712
2900
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2713
|
-
var
|
|
2901
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2714
2902
|
var ParagraphRenderer = {
|
|
2715
2903
|
canRenderType: "paragraph",
|
|
2716
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2904
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Paragraph, __spreadValues({}, props))
|
|
2717
2905
|
};
|
|
2718
2906
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2719
2907
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2720
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
2908
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2721
2909
|
"p",
|
|
2722
2910
|
{
|
|
2723
2911
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2730,16 +2918,16 @@ function CopyableParagraph({
|
|
|
2730
2918
|
align,
|
|
2731
2919
|
className
|
|
2732
2920
|
}) {
|
|
2733
|
-
const { formatMessage } = (0,
|
|
2921
|
+
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
2734
2922
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2735
2923
|
const copy = () => {
|
|
2736
2924
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2737
2925
|
});
|
|
2738
2926
|
};
|
|
2739
2927
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2740
|
-
return /* @__PURE__ */ (0,
|
|
2741
|
-
/* @__PURE__ */ (0,
|
|
2742
|
-
|
|
2928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className, children: [
|
|
2929
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2930
|
+
import_components41.Input,
|
|
2743
2931
|
{
|
|
2744
2932
|
type: "text",
|
|
2745
2933
|
value: text,
|
|
@@ -2747,23 +2935,23 @@ function CopyableParagraph({
|
|
|
2747
2935
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
2748
2936
|
}
|
|
2749
2937
|
),
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2751
2939
|
] });
|
|
2752
2940
|
}
|
|
2753
2941
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2754
2942
|
|
|
2755
2943
|
// ../renderers/src/ProgressRenderer.tsx
|
|
2756
|
-
var
|
|
2757
|
-
var
|
|
2944
|
+
var import_components42 = require("@transferwise/components");
|
|
2945
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2758
2946
|
var ProgressRenderer = {
|
|
2759
2947
|
canRenderType: "progress",
|
|
2760
2948
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2761
|
-
return /* @__PURE__ */ (0,
|
|
2762
|
-
|
|
2949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2950
|
+
import_components42.ProgressBar,
|
|
2763
2951
|
{
|
|
2764
2952
|
id: uid,
|
|
2765
2953
|
className: getMargin(margin),
|
|
2766
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
2954
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
2767
2955
|
description,
|
|
2768
2956
|
progress: {
|
|
2769
2957
|
max: 1,
|
|
@@ -2776,15 +2964,15 @@ var ProgressRenderer = {
|
|
|
2776
2964
|
};
|
|
2777
2965
|
|
|
2778
2966
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2779
|
-
var
|
|
2780
|
-
var
|
|
2967
|
+
var import_components43 = require("@transferwise/components");
|
|
2968
|
+
var import_icons2 = require("@transferwise/icons");
|
|
2781
2969
|
var import_classnames6 = __toESM(require_classnames());
|
|
2782
|
-
var
|
|
2783
|
-
var
|
|
2970
|
+
var import_react15 = require("react");
|
|
2971
|
+
var import_react_intl19 = require("react-intl");
|
|
2784
2972
|
|
|
2785
2973
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2786
|
-
var
|
|
2787
|
-
var repeatable_messages_default = (0,
|
|
2974
|
+
var import_react_intl18 = require("react-intl");
|
|
2975
|
+
var repeatable_messages_default = (0, import_react_intl18.defineMessages)({
|
|
2788
2976
|
addItemTitle: {
|
|
2789
2977
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2790
2978
|
defaultMessage: "Add Item",
|
|
@@ -2808,10 +2996,10 @@ var repeatable_messages_default = (0, import_react_intl16.defineMessages)({
|
|
|
2808
2996
|
});
|
|
2809
2997
|
|
|
2810
2998
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2811
|
-
var
|
|
2999
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2812
3000
|
var RepeatableRenderer = {
|
|
2813
3001
|
canRenderType: "repeatable",
|
|
2814
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
3002
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Repeatable, __spreadValues({}, props))
|
|
2815
3003
|
};
|
|
2816
3004
|
function Repeatable(props) {
|
|
2817
3005
|
const {
|
|
@@ -2827,8 +3015,8 @@ function Repeatable(props) {
|
|
|
2827
3015
|
onSave,
|
|
2828
3016
|
onRemove
|
|
2829
3017
|
} = props;
|
|
2830
|
-
const { formatMessage } = (0,
|
|
2831
|
-
const [openModalType, setOpenModalType] = (0,
|
|
3018
|
+
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
3019
|
+
const [openModalType, setOpenModalType] = (0, import_react15.useState)(null);
|
|
2832
3020
|
const onAddItem = () => {
|
|
2833
3021
|
onAdd();
|
|
2834
3022
|
setOpenModalType("add");
|
|
@@ -2850,41 +3038,41 @@ function Repeatable(props) {
|
|
|
2850
3038
|
const onCancelEdit = () => {
|
|
2851
3039
|
setOpenModalType(null);
|
|
2852
3040
|
};
|
|
2853
|
-
return /* @__PURE__ */ (0,
|
|
2854
|
-
title && /* @__PURE__ */ (0,
|
|
2855
|
-
description && /* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
3041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
3042
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components43.Header, { title }),
|
|
3043
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { children: description }),
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
2857
3045
|
"div",
|
|
2858
3046
|
{
|
|
2859
3047
|
className: (0, import_classnames6.default)("form-group", {
|
|
2860
3048
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2861
3049
|
}),
|
|
2862
3050
|
children: [
|
|
2863
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2864
|
-
/* @__PURE__ */ (0,
|
|
2865
|
-
|
|
3051
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3053
|
+
import_components43.NavigationOption,
|
|
2866
3054
|
{
|
|
2867
|
-
media: /* @__PURE__ */ (0,
|
|
3055
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_icons2.Plus, {}),
|
|
2868
3056
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2869
3057
|
showMediaAtAllSizes: true,
|
|
2870
3058
|
onClick: () => onAddItem()
|
|
2871
3059
|
}
|
|
2872
3060
|
),
|
|
2873
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
3061
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components43.InlineAlert, { type: "negative", children: validationState.message })
|
|
2874
3062
|
]
|
|
2875
3063
|
}
|
|
2876
3064
|
),
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3066
|
+
import_components43.Modal,
|
|
2879
3067
|
{
|
|
2880
3068
|
open: openModalType !== null,
|
|
2881
3069
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2882
|
-
body: /* @__PURE__ */ (0,
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
2884
|
-
/* @__PURE__ */ (0,
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
|
|
3070
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
3071
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { children: [
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components43.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3075
|
+
import_components43.Button,
|
|
2888
3076
|
{
|
|
2889
3077
|
v2: true,
|
|
2890
3078
|
priority: "secondary",
|
|
@@ -2905,10 +3093,10 @@ function ItemSummaryOption({
|
|
|
2905
3093
|
item,
|
|
2906
3094
|
onClick
|
|
2907
3095
|
}) {
|
|
2908
|
-
return /* @__PURE__ */ (0,
|
|
2909
|
-
|
|
3096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3097
|
+
import_components43.NavigationOption,
|
|
2910
3098
|
{
|
|
2911
|
-
media: /* @__PURE__ */ (0,
|
|
3099
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2912
3100
|
title: item.title,
|
|
2913
3101
|
content: item.description,
|
|
2914
3102
|
showMediaAtAllSizes: true,
|
|
@@ -2920,16 +3108,16 @@ function ItemSummaryOption({
|
|
|
2920
3108
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2921
3109
|
|
|
2922
3110
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2923
|
-
var
|
|
2924
|
-
var
|
|
3111
|
+
var import_components44 = require("@transferwise/components");
|
|
3112
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2925
3113
|
var ReviewRenderer = {
|
|
2926
3114
|
canRenderType: "review",
|
|
2927
3115
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2928
3116
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2929
|
-
return /* @__PURE__ */ (0,
|
|
2930
|
-
/* @__PURE__ */ (0,
|
|
2931
|
-
/* @__PURE__ */ (0,
|
|
2932
|
-
|
|
3117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: getMargin(margin), children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Header, { title, callToAction }),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3120
|
+
import_components44.DefinitionList,
|
|
2933
3121
|
{
|
|
2934
3122
|
layout: orientation,
|
|
2935
3123
|
definitions: fields.map(
|
|
@@ -2966,20 +3154,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2966
3154
|
};
|
|
2967
3155
|
var getFieldLabel = (label, help, onClick) => {
|
|
2968
3156
|
if (help) {
|
|
2969
|
-
return /* @__PURE__ */ (0,
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
2970
3158
|
label,
|
|
2971
3159
|
" ",
|
|
2972
|
-
/* @__PURE__ */ (0,
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Help_default, { help, onClick })
|
|
2973
3161
|
] });
|
|
2974
3162
|
}
|
|
2975
3163
|
return label;
|
|
2976
3164
|
};
|
|
2977
3165
|
|
|
2978
3166
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2979
|
-
var
|
|
2980
|
-
var
|
|
2981
|
-
var
|
|
2982
|
-
var
|
|
3167
|
+
var import_components45 = require("@transferwise/components");
|
|
3168
|
+
var import_icons3 = require("@transferwise/icons");
|
|
3169
|
+
var import_react_intl20 = require("react-intl");
|
|
3170
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2983
3171
|
var IGNORED_CONTROLS = [
|
|
2984
3172
|
"horizontal",
|
|
2985
3173
|
"horizontal-end-aligned",
|
|
@@ -2989,7 +3177,7 @@ var IGNORED_CONTROLS = [
|
|
|
2989
3177
|
var ReviewRenderer2 = {
|
|
2990
3178
|
canRenderType: "review",
|
|
2991
3179
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
2992
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
3180
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Review, __spreadValues({}, props))
|
|
2993
3181
|
};
|
|
2994
3182
|
var Review = ({
|
|
2995
3183
|
callToAction,
|
|
@@ -3000,9 +3188,9 @@ var Review = ({
|
|
|
3000
3188
|
title,
|
|
3001
3189
|
trackEvent
|
|
3002
3190
|
}) => {
|
|
3003
|
-
const intl = (0,
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3191
|
+
const intl = (0, import_react_intl20.useIntl)();
|
|
3192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: getMargin(margin), children: [
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Header, { title, callToAction }),
|
|
3006
3194
|
fields.map((field) => {
|
|
3007
3195
|
var _a, _b, _c;
|
|
3008
3196
|
const {
|
|
@@ -3020,8 +3208,8 @@ var Review = ({
|
|
|
3020
3208
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3021
3209
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3022
3210
|
};
|
|
3023
|
-
return /* @__PURE__ */ (0,
|
|
3024
|
-
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3212
|
+
import_components45.ListItem,
|
|
3025
3213
|
{
|
|
3026
3214
|
title: value,
|
|
3027
3215
|
subtitle: label,
|
|
@@ -3041,18 +3229,18 @@ var Review = ({
|
|
|
3041
3229
|
] });
|
|
3042
3230
|
};
|
|
3043
3231
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
3044
|
-
return /* @__PURE__ */ (0,
|
|
3232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_components45.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_components45.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_components45.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_icons3.QuestionMarkCircle, {}) }) });
|
|
3045
3233
|
};
|
|
3046
3234
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
3047
3235
|
|
|
3048
3236
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3049
|
-
var
|
|
3050
|
-
var
|
|
3051
|
-
var
|
|
3237
|
+
var import_components47 = require("@transferwise/components");
|
|
3238
|
+
var import_react16 = require("react");
|
|
3239
|
+
var import_react_intl24 = require("react-intl");
|
|
3052
3240
|
|
|
3053
3241
|
// ../renderers/src/messages/search.messages.ts
|
|
3054
|
-
var
|
|
3055
|
-
var search_messages_default = (0,
|
|
3242
|
+
var import_react_intl21 = require("react-intl");
|
|
3243
|
+
var search_messages_default = (0, import_react_intl21.defineMessages)({
|
|
3056
3244
|
loading: {
|
|
3057
3245
|
id: "df.wise.SearchLayout.loading",
|
|
3058
3246
|
defaultMessage: "Loading...",
|
|
@@ -3061,11 +3249,11 @@ var search_messages_default = (0, import_react_intl19.defineMessages)({
|
|
|
3061
3249
|
});
|
|
3062
3250
|
|
|
3063
3251
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3064
|
-
var
|
|
3252
|
+
var import_react_intl23 = require("react-intl");
|
|
3065
3253
|
|
|
3066
3254
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
3067
|
-
var
|
|
3068
|
-
var generic_error_messages_default = (0,
|
|
3255
|
+
var import_react_intl22 = require("react-intl");
|
|
3256
|
+
var generic_error_messages_default = (0, import_react_intl22.defineMessages)({
|
|
3069
3257
|
genericErrorRetryHint: {
|
|
3070
3258
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
3071
3259
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -3084,20 +3272,20 @@ var generic_error_messages_default = (0, import_react_intl20.defineMessages)({
|
|
|
3084
3272
|
});
|
|
3085
3273
|
|
|
3086
3274
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3087
|
-
var
|
|
3088
|
-
var
|
|
3275
|
+
var import_components46 = require("@transferwise/components");
|
|
3276
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3089
3277
|
function ErrorResult({ state }) {
|
|
3090
|
-
const intl = (0,
|
|
3091
|
-
return /* @__PURE__ */ (0,
|
|
3278
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
3279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("p", { className: "m-t-2", children: [
|
|
3092
3280
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
3093
3281
|
"\xA0",
|
|
3094
|
-
/* @__PURE__ */ (0,
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components46.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
3095
3283
|
] });
|
|
3096
3284
|
}
|
|
3097
3285
|
|
|
3098
3286
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3099
|
-
var
|
|
3100
|
-
var
|
|
3287
|
+
var import_icons4 = require("@transferwise/icons");
|
|
3288
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3101
3289
|
function BlockSearchRendererComponent({
|
|
3102
3290
|
id,
|
|
3103
3291
|
hint,
|
|
@@ -3109,11 +3297,11 @@ function BlockSearchRendererComponent({
|
|
|
3109
3297
|
trackEvent,
|
|
3110
3298
|
onChange
|
|
3111
3299
|
}) {
|
|
3112
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3113
|
-
const { formatMessage } = (0,
|
|
3114
|
-
return /* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
|
|
3300
|
+
const [hasSearched, setHasSearched] = (0, import_react16.useState)(false);
|
|
3301
|
+
const { formatMessage } = (0, import_react_intl24.useIntl)();
|
|
3302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: getMargin(margin), children: [
|
|
3303
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components47.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_icons4.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3304
|
+
import_components47.Input,
|
|
3117
3305
|
{
|
|
3118
3306
|
id,
|
|
3119
3307
|
name: id,
|
|
@@ -3129,7 +3317,7 @@ function BlockSearchRendererComponent({
|
|
|
3129
3317
|
}
|
|
3130
3318
|
}
|
|
3131
3319
|
) }) }),
|
|
3132
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
3320
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SearchResultContent, { state, trackEvent })
|
|
3133
3321
|
] });
|
|
3134
3322
|
}
|
|
3135
3323
|
function SearchResultContent({
|
|
@@ -3138,39 +3326,39 @@ function SearchResultContent({
|
|
|
3138
3326
|
}) {
|
|
3139
3327
|
switch (state.type) {
|
|
3140
3328
|
case "error":
|
|
3141
|
-
return /* @__PURE__ */ (0,
|
|
3329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorResult, { state });
|
|
3142
3330
|
case "results":
|
|
3143
|
-
return /* @__PURE__ */ (0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SearchResults, { state, trackEvent });
|
|
3144
3332
|
case "layout":
|
|
3145
|
-
return /* @__PURE__ */ (0,
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
3146
3334
|
" ",
|
|
3147
3335
|
state.layout,
|
|
3148
3336
|
" "
|
|
3149
3337
|
] });
|
|
3150
3338
|
case "noResults":
|
|
3151
|
-
return /* @__PURE__ */ (0,
|
|
3339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptySearchResult, { state });
|
|
3152
3340
|
case "pending":
|
|
3153
3341
|
default:
|
|
3154
3342
|
return null;
|
|
3155
3343
|
}
|
|
3156
3344
|
}
|
|
3157
3345
|
function EmptySearchResult({ state }) {
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components47.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3159
3347
|
}
|
|
3160
3348
|
function SearchResults({
|
|
3161
3349
|
state,
|
|
3162
3350
|
trackEvent
|
|
3163
3351
|
}) {
|
|
3164
|
-
return /* @__PURE__ */ (0,
|
|
3352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components47.List, { children: state.results.map((result) => {
|
|
3165
3353
|
const { media } = result;
|
|
3166
|
-
return /* @__PURE__ */ (0,
|
|
3167
|
-
|
|
3354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3355
|
+
import_components47.ListItem,
|
|
3168
3356
|
{
|
|
3169
3357
|
title: result.title,
|
|
3170
3358
|
subtitle: result.description,
|
|
3171
|
-
media: media ? /* @__PURE__ */ (0,
|
|
3172
|
-
control: /* @__PURE__ */ (0,
|
|
3173
|
-
|
|
3359
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
3360
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3361
|
+
import_components47.ListItem.Navigation,
|
|
3174
3362
|
{
|
|
3175
3363
|
onClick: () => {
|
|
3176
3364
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -3188,11 +3376,11 @@ function SearchResults({
|
|
|
3188
3376
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
3189
3377
|
|
|
3190
3378
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
3191
|
-
var
|
|
3192
|
-
var
|
|
3193
|
-
var
|
|
3194
|
-
var
|
|
3195
|
-
var
|
|
3379
|
+
var import_components48 = require("@transferwise/components");
|
|
3380
|
+
var import_icons5 = require("@transferwise/icons");
|
|
3381
|
+
var import_react17 = require("react");
|
|
3382
|
+
var import_react_intl25 = require("react-intl");
|
|
3383
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
3196
3384
|
function InlineSearchRenderer({
|
|
3197
3385
|
id,
|
|
3198
3386
|
hint,
|
|
@@ -3203,10 +3391,10 @@ function InlineSearchRenderer({
|
|
|
3203
3391
|
title,
|
|
3204
3392
|
trackEvent
|
|
3205
3393
|
}) {
|
|
3206
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3207
|
-
const intl = (0,
|
|
3208
|
-
return /* @__PURE__ */ (0,
|
|
3209
|
-
|
|
3394
|
+
const [hasSearched, setHasSearched] = (0, import_react17.useState)(false);
|
|
3395
|
+
const intl = (0, import_react_intl25.useIntl)();
|
|
3396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3397
|
+
import_components48.Typeahead,
|
|
3210
3398
|
{
|
|
3211
3399
|
id: "typeahead-input-id",
|
|
3212
3400
|
intl,
|
|
@@ -3214,10 +3402,10 @@ function InlineSearchRenderer({
|
|
|
3214
3402
|
size: "md",
|
|
3215
3403
|
placeholder: hint,
|
|
3216
3404
|
maxHeight: 100,
|
|
3217
|
-
footer: /* @__PURE__ */ (0,
|
|
3405
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
3218
3406
|
multiple: false,
|
|
3219
3407
|
clearable: false,
|
|
3220
|
-
addon: /* @__PURE__ */ (0,
|
|
3408
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_icons5.Search, { size: 24 }),
|
|
3221
3409
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
3222
3410
|
minQueryLength: 1,
|
|
3223
3411
|
onChange: (values) => {
|
|
@@ -3252,33 +3440,33 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3252
3440
|
};
|
|
3253
3441
|
}
|
|
3254
3442
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3255
|
-
const { formatMessage } = (0,
|
|
3443
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3256
3444
|
if (state.type === "layout") {
|
|
3257
|
-
return /* @__PURE__ */ (0,
|
|
3445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
3258
3446
|
}
|
|
3259
3447
|
if (state.type === "noResults") {
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components48.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3261
3449
|
}
|
|
3262
3450
|
if (state.type === "error") {
|
|
3263
|
-
return /* @__PURE__ */ (0,
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorResult, { state }) });
|
|
3264
3452
|
}
|
|
3265
3453
|
if (state.type === "pending" || isLoading) {
|
|
3266
|
-
return /* @__PURE__ */ (0,
|
|
3454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
3267
3455
|
}
|
|
3268
3456
|
return null;
|
|
3269
3457
|
}
|
|
3270
3458
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3271
3459
|
|
|
3272
3460
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3273
|
-
var
|
|
3461
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3274
3462
|
var SearchRenderer = {
|
|
3275
3463
|
canRenderType: "search",
|
|
3276
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
3464
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
3277
3465
|
};
|
|
3278
3466
|
var SearchRenderer_default = SearchRenderer;
|
|
3279
3467
|
|
|
3280
3468
|
// ../renderers/src/SectionRenderer.tsx
|
|
3281
|
-
var
|
|
3469
|
+
var import_components49 = require("@transferwise/components");
|
|
3282
3470
|
|
|
3283
3471
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
3284
3472
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -3302,12 +3490,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
3302
3490
|
};
|
|
3303
3491
|
|
|
3304
3492
|
// ../renderers/src/SectionRenderer.tsx
|
|
3305
|
-
var
|
|
3493
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3306
3494
|
var SectionRenderer = {
|
|
3307
3495
|
canRenderType: "section",
|
|
3308
3496
|
render: ({ children, callToAction, margin, title }) => {
|
|
3309
|
-
return /* @__PURE__ */ (0,
|
|
3310
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
3497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("section", { className: getMargin(margin), children: [
|
|
3498
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components49.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
3311
3499
|
children
|
|
3312
3500
|
] });
|
|
3313
3501
|
}
|
|
@@ -3315,8 +3503,8 @@ var SectionRenderer = {
|
|
|
3315
3503
|
var SectionRenderer_default = SectionRenderer;
|
|
3316
3504
|
|
|
3317
3505
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3318
|
-
var
|
|
3319
|
-
var
|
|
3506
|
+
var import_components50 = require("@transferwise/components");
|
|
3507
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3320
3508
|
function RadioInputRendererComponent(props) {
|
|
3321
3509
|
const {
|
|
3322
3510
|
id,
|
|
@@ -3330,8 +3518,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3330
3518
|
validationState,
|
|
3331
3519
|
onSelect
|
|
3332
3520
|
} = props;
|
|
3333
|
-
return /* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
|
|
3522
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3335
3523
|
FieldInput_default,
|
|
3336
3524
|
{
|
|
3337
3525
|
id,
|
|
@@ -3339,8 +3527,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3339
3527
|
help,
|
|
3340
3528
|
description,
|
|
3341
3529
|
validation: validationState,
|
|
3342
|
-
children: /* @__PURE__ */ (0,
|
|
3343
|
-
|
|
3530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3531
|
+
import_components50.RadioGroup,
|
|
3344
3532
|
{
|
|
3345
3533
|
name: id,
|
|
3346
3534
|
radios: options.map((option, index) => ({
|
|
@@ -3348,7 +3536,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3348
3536
|
value: index,
|
|
3349
3537
|
secondary: option.description,
|
|
3350
3538
|
disabled: option.disabled || disabled,
|
|
3351
|
-
avatar: /* @__PURE__ */ (0,
|
|
3539
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3352
3540
|
})),
|
|
3353
3541
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3354
3542
|
onChange: onSelect
|
|
@@ -3362,9 +3550,9 @@ function RadioInputRendererComponent(props) {
|
|
|
3362
3550
|
}
|
|
3363
3551
|
|
|
3364
3552
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3365
|
-
var
|
|
3366
|
-
var
|
|
3367
|
-
var
|
|
3553
|
+
var import_components51 = require("@transferwise/components");
|
|
3554
|
+
var import_react18 = require("react");
|
|
3555
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3368
3556
|
function TabInputRendererComponent(props) {
|
|
3369
3557
|
const {
|
|
3370
3558
|
id,
|
|
@@ -3378,13 +3566,13 @@ function TabInputRendererComponent(props) {
|
|
|
3378
3566
|
validationState,
|
|
3379
3567
|
onSelect
|
|
3380
3568
|
} = props;
|
|
3381
|
-
(0,
|
|
3569
|
+
(0, import_react18.useEffect)(() => {
|
|
3382
3570
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3383
3571
|
onSelect(0);
|
|
3384
3572
|
}
|
|
3385
3573
|
}, [selectedIndex, onSelect, options.length]);
|
|
3386
|
-
return /* @__PURE__ */ (0,
|
|
3387
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
3575
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3388
3576
|
FieldInput_default,
|
|
3389
3577
|
{
|
|
3390
3578
|
id,
|
|
@@ -3392,8 +3580,8 @@ function TabInputRendererComponent(props) {
|
|
|
3392
3580
|
help,
|
|
3393
3581
|
description,
|
|
3394
3582
|
validation: validationState,
|
|
3395
|
-
children: /* @__PURE__ */ (0,
|
|
3396
|
-
|
|
3583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3584
|
+
import_components51.Tabs,
|
|
3397
3585
|
{
|
|
3398
3586
|
name: id,
|
|
3399
3587
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -3401,7 +3589,7 @@ function TabInputRendererComponent(props) {
|
|
|
3401
3589
|
title: option.title,
|
|
3402
3590
|
// if we pass null, we get some props-types console errors
|
|
3403
3591
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3404
|
-
content: /* @__PURE__ */ (0,
|
|
3592
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_jsx_runtime73.Fragment, {}),
|
|
3405
3593
|
disabled: option.disabled || disabled
|
|
3406
3594
|
})),
|
|
3407
3595
|
onTabSelect: onSelect
|
|
@@ -3415,8 +3603,8 @@ function TabInputRendererComponent(props) {
|
|
|
3415
3603
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3416
3604
|
|
|
3417
3605
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3418
|
-
var
|
|
3419
|
-
var
|
|
3606
|
+
var import_components52 = require("@transferwise/components");
|
|
3607
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3420
3608
|
function SelectInputRendererComponent(props) {
|
|
3421
3609
|
const {
|
|
3422
3610
|
id,
|
|
@@ -3456,13 +3644,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3456
3644
|
} : {
|
|
3457
3645
|
title: option.title,
|
|
3458
3646
|
description: option.description,
|
|
3459
|
-
icon: /* @__PURE__ */ (0,
|
|
3647
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3460
3648
|
};
|
|
3461
|
-
return /* @__PURE__ */ (0,
|
|
3649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components52.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3462
3650
|
};
|
|
3463
3651
|
const extraProps = { autoComplete };
|
|
3464
|
-
return /* @__PURE__ */ (0,
|
|
3465
|
-
/* @__PURE__ */ (0,
|
|
3652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
3653
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3466
3654
|
FieldInput_default,
|
|
3467
3655
|
{
|
|
3468
3656
|
id,
|
|
@@ -3470,8 +3658,8 @@ function SelectInputRendererComponent(props) {
|
|
|
3470
3658
|
help,
|
|
3471
3659
|
description,
|
|
3472
3660
|
validation: validationState,
|
|
3473
|
-
children: /* @__PURE__ */ (0,
|
|
3474
|
-
|
|
3661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3662
|
+
import_components52.SelectInput,
|
|
3475
3663
|
__spreadValues({
|
|
3476
3664
|
name: id,
|
|
3477
3665
|
placeholder,
|
|
@@ -3491,9 +3679,9 @@ function SelectInputRendererComponent(props) {
|
|
|
3491
3679
|
}
|
|
3492
3680
|
|
|
3493
3681
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3494
|
-
var
|
|
3495
|
-
var
|
|
3496
|
-
var
|
|
3682
|
+
var import_react19 = require("react");
|
|
3683
|
+
var import_components53 = require("@transferwise/components");
|
|
3684
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3497
3685
|
function SegmentedInputRendererComponent(props) {
|
|
3498
3686
|
const {
|
|
3499
3687
|
id,
|
|
@@ -3506,13 +3694,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3506
3694
|
validationState,
|
|
3507
3695
|
onSelect
|
|
3508
3696
|
} = props;
|
|
3509
|
-
(0,
|
|
3697
|
+
(0, import_react19.useEffect)(() => {
|
|
3510
3698
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
3511
3699
|
onSelect(0);
|
|
3512
3700
|
}
|
|
3513
3701
|
}, [selectedIndex, onSelect, options.length]);
|
|
3514
|
-
return /* @__PURE__ */ (0,
|
|
3515
|
-
/* @__PURE__ */ (0,
|
|
3702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
3703
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3516
3704
|
FieldInput_default,
|
|
3517
3705
|
{
|
|
3518
3706
|
id,
|
|
@@ -3520,8 +3708,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3520
3708
|
help,
|
|
3521
3709
|
description,
|
|
3522
3710
|
validation: validationState,
|
|
3523
|
-
children: /* @__PURE__ */ (0,
|
|
3524
|
-
|
|
3711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3712
|
+
import_components53.SegmentedControl,
|
|
3525
3713
|
{
|
|
3526
3714
|
name: `${id}-segmented-control`,
|
|
3527
3715
|
value: String(selectedIndex),
|
|
@@ -3537,14 +3725,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3537
3725
|
)
|
|
3538
3726
|
}
|
|
3539
3727
|
),
|
|
3540
|
-
/* @__PURE__ */ (0,
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { id: `${id}-children`, children })
|
|
3541
3729
|
] });
|
|
3542
3730
|
}
|
|
3543
3731
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3544
3732
|
|
|
3545
3733
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
3546
|
-
var
|
|
3547
|
-
var
|
|
3734
|
+
var import_components54 = require("@transferwise/components");
|
|
3735
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3548
3736
|
function RadioItemRendererComponent(props) {
|
|
3549
3737
|
const {
|
|
3550
3738
|
id,
|
|
@@ -3558,23 +3746,23 @@ function RadioItemRendererComponent(props) {
|
|
|
3558
3746
|
validationState,
|
|
3559
3747
|
onSelect
|
|
3560
3748
|
} = props;
|
|
3561
|
-
return /* @__PURE__ */ (0,
|
|
3562
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
3563
|
-
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
3750
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3751
|
+
import_components54.Header,
|
|
3564
3752
|
{
|
|
3565
3753
|
as: "h2",
|
|
3566
|
-
title: help ? /* @__PURE__ */ (0,
|
|
3754
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
3567
3755
|
}
|
|
3568
3756
|
),
|
|
3569
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
3570
|
-
/* @__PURE__ */ (0,
|
|
3571
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
3572
|
-
|
|
3757
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("p", { children: rootDescription }),
|
|
3758
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components54.List, { children: options.map(
|
|
3759
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3760
|
+
import_components54.ListItem,
|
|
3573
3761
|
__spreadValues({
|
|
3574
3762
|
title,
|
|
3575
3763
|
subtitle: description,
|
|
3576
|
-
control: /* @__PURE__ */ (0,
|
|
3577
|
-
|
|
3764
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3765
|
+
import_components54.ListItem.Radio,
|
|
3578
3766
|
{
|
|
3579
3767
|
name: title,
|
|
3580
3768
|
checked: selectedIndex === index,
|
|
@@ -3589,50 +3777,50 @@ function RadioItemRendererComponent(props) {
|
|
|
3589
3777
|
title
|
|
3590
3778
|
)
|
|
3591
3779
|
) }, `${id}-${selectedIndex}`),
|
|
3592
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
3780
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components54.InlineAlert, { type: "negative", children: validationState.message }),
|
|
3593
3781
|
children
|
|
3594
3782
|
] });
|
|
3595
3783
|
}
|
|
3596
3784
|
|
|
3597
3785
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3598
|
-
var
|
|
3786
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3599
3787
|
var SelectInputRenderer = {
|
|
3600
3788
|
canRenderType: "input-select",
|
|
3601
3789
|
render: (props) => {
|
|
3602
3790
|
switch (props.control) {
|
|
3603
3791
|
case "radio":
|
|
3604
|
-
return /* @__PURE__ */ (0,
|
|
3792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3605
3793
|
case "radio-item":
|
|
3606
|
-
return /* @__PURE__ */ (0,
|
|
3794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
3607
3795
|
case "tab":
|
|
3608
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
3796
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
3609
3797
|
case "segmented":
|
|
3610
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
3798
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
3611
3799
|
case "select":
|
|
3612
3800
|
default:
|
|
3613
|
-
return /* @__PURE__ */ (0,
|
|
3801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3614
3802
|
}
|
|
3615
3803
|
}
|
|
3616
3804
|
};
|
|
3617
3805
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
3618
3806
|
|
|
3619
3807
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3620
|
-
var
|
|
3621
|
-
var
|
|
3808
|
+
var import_components55 = require("@transferwise/components");
|
|
3809
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3622
3810
|
var StatusListRenderer = {
|
|
3623
3811
|
canRenderType: "status-list",
|
|
3624
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
3625
|
-
title ? /* @__PURE__ */ (0,
|
|
3812
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: getMargin(margin), children: [
|
|
3813
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.Header, { title }) : null,
|
|
3626
3814
|
items.map((item) => {
|
|
3627
3815
|
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3628
|
-
return /* @__PURE__ */ (0,
|
|
3629
|
-
|
|
3816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3817
|
+
import_components55.ListItem,
|
|
3630
3818
|
{
|
|
3631
3819
|
title: itemTitle,
|
|
3632
3820
|
subtitle: description,
|
|
3633
|
-
media: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
3634
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
3635
|
-
|
|
3821
|
+
media: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DynamicIcon_default, { name: icon.name }) }) : void 0,
|
|
3822
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3823
|
+
import_components55.ListItem.AdditionalInfo,
|
|
3636
3824
|
{
|
|
3637
3825
|
action: {
|
|
3638
3826
|
href: callToAction.href,
|
|
@@ -3662,12 +3850,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
3662
3850
|
|
|
3663
3851
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3664
3852
|
var import_components_theming = require("@wise/components-theming");
|
|
3665
|
-
var
|
|
3853
|
+
var import_react20 = require("react");
|
|
3666
3854
|
var ThemeRequiredEventName = "Theme Required";
|
|
3667
3855
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3668
3856
|
const theming = (0, import_components_theming.useTheme)();
|
|
3669
|
-
const previousTheme = (0,
|
|
3670
|
-
(0,
|
|
3857
|
+
const previousTheme = (0, import_react20.useMemo)(() => theming.theme, []);
|
|
3858
|
+
(0, import_react20.useEffect)(() => {
|
|
3671
3859
|
theming.setTheme(theme);
|
|
3672
3860
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3673
3861
|
return theme !== previousTheme ? () => {
|
|
@@ -3678,86 +3866,14 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3678
3866
|
}, []);
|
|
3679
3867
|
};
|
|
3680
3868
|
|
|
3681
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3682
|
-
var import_components54 = require("@transferwise/components");
|
|
3683
|
-
var import_react19 = require("react");
|
|
3684
|
-
var import_react_intl25 = require("react-intl");
|
|
3685
|
-
|
|
3686
|
-
// ../renderers/src/messages/step.messages.ts
|
|
3687
|
-
var import_react_intl24 = require("react-intl");
|
|
3688
|
-
var step_messages_default = (0, import_react_intl24.defineMessages)({
|
|
3689
|
-
scrollToBottom: {
|
|
3690
|
-
id: "df.wise.step.scrollToBottom",
|
|
3691
|
-
defaultMessage: "Scroll to bottom",
|
|
3692
|
-
description: "Label for a button that appears when the content of a step is too long and the user needs to scroll to the bottom to see all the content."
|
|
3693
|
-
}
|
|
3694
|
-
});
|
|
3695
|
-
|
|
3696
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3697
|
-
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3698
|
-
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3699
|
-
var StepFooter = ({ footer, tags }) => {
|
|
3700
|
-
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3701
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FooterWithScrollButton, { footer });
|
|
3702
|
-
}
|
|
3703
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(DefaultFooter, { footer });
|
|
3704
|
-
};
|
|
3705
|
-
var DefaultFooter = ({ footer }) => {
|
|
3706
|
-
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3707
|
-
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3708
|
-
};
|
|
3709
|
-
var FooterWithScrollButton = ({ footer }) => {
|
|
3710
|
-
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3711
|
-
const endOfLayoutRef = (0, import_react19.useRef)(null);
|
|
3712
|
-
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3713
|
-
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
3714
|
-
import_components54.Button,
|
|
3715
|
-
{
|
|
3716
|
-
className: "m-b-1",
|
|
3717
|
-
v2: true,
|
|
3718
|
-
block: true,
|
|
3719
|
-
priority: "tertiary",
|
|
3720
|
-
onClick: () => {
|
|
3721
|
-
var _a;
|
|
3722
|
-
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3723
|
-
},
|
|
3724
|
-
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3725
|
-
}
|
|
3726
|
-
);
|
|
3727
|
-
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3728
|
-
if (isElementVisible && !hasStepFooterContent) {
|
|
3729
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3730
|
-
}
|
|
3731
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
3732
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3733
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3734
|
-
!isElementVisible && scrollButton,
|
|
3735
|
-
footer
|
|
3736
|
-
] })
|
|
3737
|
-
] });
|
|
3738
|
-
};
|
|
3739
|
-
var useIsElementVisible = (elementRef) => {
|
|
3740
|
-
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
3741
|
-
(0, import_react19.useEffect)(() => {
|
|
3742
|
-
const element = elementRef.current;
|
|
3743
|
-
if (!element) return;
|
|
3744
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
3745
|
-
setIsVisible(entry.isIntersecting);
|
|
3746
|
-
});
|
|
3747
|
-
observer.observe(element);
|
|
3748
|
-
return () => observer.disconnect();
|
|
3749
|
-
}, [elementRef]);
|
|
3750
|
-
return isVisible;
|
|
3751
|
-
};
|
|
3752
|
-
|
|
3753
3869
|
// ../renderers/src/step/StepHeader.tsx
|
|
3754
|
-
var
|
|
3755
|
-
var
|
|
3870
|
+
var import_components56 = require("@transferwise/components");
|
|
3871
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3756
3872
|
var StepHeader = ({ title, description, tags }) => {
|
|
3757
3873
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3758
|
-
return /* @__PURE__ */ (0,
|
|
3759
|
-
title ? /* @__PURE__ */ (0,
|
|
3760
|
-
description ? /* @__PURE__ */ (0,
|
|
3874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
3875
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components56.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3876
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3761
3877
|
] });
|
|
3762
3878
|
};
|
|
3763
3879
|
var getHeaderStyle = (tags) => {
|
|
@@ -3768,8 +3884,8 @@ var getHeaderStyle = (tags) => {
|
|
|
3768
3884
|
};
|
|
3769
3885
|
|
|
3770
3886
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3771
|
-
var
|
|
3772
|
-
var
|
|
3887
|
+
var import_components57 = require("@transferwise/components");
|
|
3888
|
+
var import_icons6 = require("@transferwise/icons");
|
|
3773
3889
|
var import_react_intl27 = require("react-intl");
|
|
3774
3890
|
|
|
3775
3891
|
// ../renderers/src/messages/back.messages.ts
|
|
@@ -3783,31 +3899,31 @@ var back_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
3783
3899
|
});
|
|
3784
3900
|
|
|
3785
3901
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3786
|
-
var
|
|
3902
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3787
3903
|
function BackButton({ title, onClick }) {
|
|
3788
3904
|
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
3789
|
-
return /* @__PURE__ */ (0,
|
|
3790
|
-
/* @__PURE__ */ (0,
|
|
3791
|
-
/* @__PURE__ */ (0,
|
|
3905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_components57.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3906
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3907
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_icons6.ArrowLeft, {})
|
|
3792
3908
|
] });
|
|
3793
3909
|
}
|
|
3794
3910
|
|
|
3795
3911
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3796
|
-
var
|
|
3797
|
-
var
|
|
3912
|
+
var import_components58 = require("@transferwise/components");
|
|
3913
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3798
3914
|
var Toolbar = ({ items }) => {
|
|
3799
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
3915
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
3800
3916
|
};
|
|
3801
3917
|
function ToolbarButton(props) {
|
|
3802
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
3918
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
3803
3919
|
}
|
|
3804
3920
|
function MediaToolbarButton(props) {
|
|
3805
3921
|
var _a;
|
|
3806
3922
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3807
3923
|
const priority = getIconButtonPriority(control);
|
|
3808
3924
|
const type = getSentiment2(context);
|
|
3809
|
-
return /* @__PURE__ */ (0,
|
|
3810
|
-
|
|
3925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
3926
|
+
import_components58.IconButton,
|
|
3811
3927
|
{
|
|
3812
3928
|
className: "df-toolbar-button",
|
|
3813
3929
|
disabled,
|
|
@@ -3816,7 +3932,7 @@ function MediaToolbarButton(props) {
|
|
|
3816
3932
|
type,
|
|
3817
3933
|
onClick,
|
|
3818
3934
|
children: [
|
|
3819
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
3935
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3820
3936
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3821
3937
|
]
|
|
3822
3938
|
}
|
|
@@ -3827,8 +3943,8 @@ function TextToolbarButton(props) {
|
|
|
3827
3943
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3828
3944
|
const priority = getPriority2(control);
|
|
3829
3945
|
const sentiment = getSentiment2(context);
|
|
3830
|
-
return /* @__PURE__ */ (0,
|
|
3831
|
-
|
|
3946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3947
|
+
import_components58.Button,
|
|
3832
3948
|
{
|
|
3833
3949
|
v2: true,
|
|
3834
3950
|
size: "sm",
|
|
@@ -3857,16 +3973,16 @@ var getIconButtonPriority = (control) => {
|
|
|
3857
3973
|
};
|
|
3858
3974
|
|
|
3859
3975
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3860
|
-
var
|
|
3976
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3861
3977
|
function TopBar({ back, toolbar }) {
|
|
3862
|
-
return back || toolbar ? /* @__PURE__ */ (0,
|
|
3863
|
-
back ? /* @__PURE__ */ (0,
|
|
3864
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
3978
|
+
return back || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
3979
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(BackButton, __spreadValues({}, back)) : null,
|
|
3980
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3865
3981
|
] }) : null;
|
|
3866
3982
|
}
|
|
3867
3983
|
|
|
3868
3984
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3869
|
-
var
|
|
3985
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3870
3986
|
var SplashCelebrationStepRenderer = {
|
|
3871
3987
|
canRenderType: "step",
|
|
3872
3988
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3875,16 +3991,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
3875
3991
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3876
3992
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
3877
3993
|
useCustomTheme("forest-green", trackEvent);
|
|
3878
|
-
return /* @__PURE__ */ (0,
|
|
3879
|
-
/* @__PURE__ */ (0,
|
|
3880
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3995
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TopBar, { back, toolbar }),
|
|
3996
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
3881
3997
|
children,
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3998
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(StepFooter, { footer, tags })
|
|
3883
3999
|
] });
|
|
3884
4000
|
}
|
|
3885
4001
|
|
|
3886
4002
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3887
|
-
var
|
|
4003
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
3888
4004
|
var SplashStepRenderer = {
|
|
3889
4005
|
canRenderType: "step",
|
|
3890
4006
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3892,63 +4008,63 @@ var SplashStepRenderer = {
|
|
|
3892
4008
|
};
|
|
3893
4009
|
function SplashStepRendererComponent(props) {
|
|
3894
4010
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
3896
|
-
/* @__PURE__ */ (0,
|
|
3897
|
-
title || description ? /* @__PURE__ */ (0,
|
|
4011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
4012
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TopBar, { back, toolbar }),
|
|
4013
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
3898
4014
|
children,
|
|
3899
|
-
/* @__PURE__ */ (0,
|
|
4015
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(StepFooter, { footer, tags })
|
|
3900
4016
|
] });
|
|
3901
4017
|
}
|
|
3902
4018
|
|
|
3903
4019
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3904
|
-
var
|
|
3905
|
-
var
|
|
4020
|
+
var import_components59 = require("@transferwise/components");
|
|
4021
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3906
4022
|
var StepRenderer = {
|
|
3907
4023
|
canRenderType: "step",
|
|
3908
4024
|
render: StepRendererComponent
|
|
3909
4025
|
};
|
|
3910
4026
|
function StepRendererComponent(props) {
|
|
3911
4027
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
3914
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3915
|
-
error ? /* @__PURE__ */ (0,
|
|
4028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { children: [
|
|
4029
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TopBar, { back, toolbar }),
|
|
4030
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
4031
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_components59.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
3916
4032
|
children,
|
|
3917
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(StepFooter, { footer, tags })
|
|
3918
4034
|
] });
|
|
3919
4035
|
}
|
|
3920
4036
|
|
|
3921
4037
|
// ../renderers/src/TabsRenderer.tsx
|
|
3922
|
-
var
|
|
3923
|
-
var
|
|
3924
|
-
var
|
|
4038
|
+
var import_components60 = require("@transferwise/components");
|
|
4039
|
+
var import_react21 = require("react");
|
|
4040
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
3925
4041
|
var TabsRenderer = {
|
|
3926
4042
|
canRenderType: "tabs",
|
|
3927
4043
|
render: (props) => {
|
|
3928
4044
|
switch (props.control) {
|
|
3929
4045
|
case "segmented":
|
|
3930
4046
|
if (props.tabs.length > 3) {
|
|
3931
|
-
return /* @__PURE__ */ (0,
|
|
4047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3932
4048
|
}
|
|
3933
|
-
return /* @__PURE__ */ (0,
|
|
4049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3934
4050
|
case "chips":
|
|
3935
|
-
return /* @__PURE__ */ (0,
|
|
4051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3936
4052
|
default:
|
|
3937
|
-
return /* @__PURE__ */ (0,
|
|
4053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3938
4054
|
}
|
|
3939
4055
|
}
|
|
3940
4056
|
};
|
|
3941
4057
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3942
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3943
|
-
return /* @__PURE__ */ (0,
|
|
3944
|
-
|
|
4058
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
|
|
4059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4060
|
+
import_components60.Tabs,
|
|
3945
4061
|
{
|
|
3946
4062
|
name: uid,
|
|
3947
4063
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
3948
4064
|
tabs: tabs.map((option) => ({
|
|
3949
4065
|
title: option.title,
|
|
3950
4066
|
disabled: false,
|
|
3951
|
-
content: /* @__PURE__ */ (0,
|
|
4067
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "m-t-2", children: [
|
|
3952
4068
|
" ",
|
|
3953
4069
|
option.children,
|
|
3954
4070
|
" "
|
|
@@ -3960,10 +4076,10 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3960
4076
|
}
|
|
3961
4077
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3962
4078
|
var _a;
|
|
3963
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3964
|
-
return /* @__PURE__ */ (0,
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
3966
|
-
|
|
4079
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
|
|
4080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getMargin(margin), children: [
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4082
|
+
import_components60.SegmentedControl,
|
|
3967
4083
|
{
|
|
3968
4084
|
name: uid,
|
|
3969
4085
|
value: String(selectedIndex),
|
|
@@ -3977,31 +4093,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3977
4093
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3978
4094
|
}
|
|
3979
4095
|
),
|
|
3980
|
-
/* @__PURE__ */ (0,
|
|
4096
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3981
4097
|
] });
|
|
3982
4098
|
}
|
|
3983
4099
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3984
4100
|
var _a;
|
|
3985
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3986
|
-
return /* @__PURE__ */ (0,
|
|
3987
|
-
/* @__PURE__ */ (0,
|
|
3988
|
-
|
|
4101
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
|
|
4102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getMargin(margin), children: [
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4104
|
+
import_components60.Chips,
|
|
3989
4105
|
{
|
|
3990
4106
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3991
4107
|
selected: selectedIndex,
|
|
3992
4108
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3993
4109
|
}
|
|
3994
4110
|
) }),
|
|
3995
|
-
/* @__PURE__ */ (0,
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3996
4112
|
] });
|
|
3997
4113
|
}
|
|
3998
4114
|
|
|
3999
4115
|
// ../renderers/src/TextInputRenderer.tsx
|
|
4000
|
-
var
|
|
4116
|
+
var import_components62 = require("@transferwise/components");
|
|
4001
4117
|
|
|
4002
4118
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
4003
|
-
var
|
|
4004
|
-
var
|
|
4119
|
+
var import_components61 = require("@transferwise/components");
|
|
4120
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
4005
4121
|
var commonKeys = [
|
|
4006
4122
|
"autoComplete",
|
|
4007
4123
|
"autoCapitalize",
|
|
@@ -4020,12 +4136,12 @@ function VariableTextInput(inputProps) {
|
|
|
4020
4136
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
4021
4137
|
switch (control) {
|
|
4022
4138
|
case "email":
|
|
4023
|
-
return /* @__PURE__ */ (0,
|
|
4139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
4024
4140
|
case "password":
|
|
4025
|
-
return /* @__PURE__ */ (0,
|
|
4141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
4026
4142
|
case "numeric": {
|
|
4027
4143
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
4028
|
-
return /* @__PURE__ */ (0,
|
|
4144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4029
4145
|
TextInput,
|
|
4030
4146
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
4031
4147
|
onChange: (newValue) => {
|
|
@@ -4036,21 +4152,21 @@ function VariableTextInput(inputProps) {
|
|
|
4036
4152
|
);
|
|
4037
4153
|
}
|
|
4038
4154
|
case "phone-number":
|
|
4039
|
-
return /* @__PURE__ */ (0,
|
|
4155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components61.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
4040
4156
|
default: {
|
|
4041
|
-
return /* @__PURE__ */ (0,
|
|
4157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
4042
4158
|
}
|
|
4043
4159
|
}
|
|
4044
4160
|
}
|
|
4045
4161
|
function TextInput(props) {
|
|
4046
4162
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
4047
|
-
const InputWithPattern = control === "textarea" ?
|
|
4048
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
4049
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
4163
|
+
const InputWithPattern = control === "textarea" ? import_components61.TextareaWithDisplayFormat : import_components61.InputWithDisplayFormat;
|
|
4164
|
+
const InputWithoutPattern = control === "textarea" ? import_components61.TextArea : import_components61.Input;
|
|
4165
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
4050
4166
|
}
|
|
4051
4167
|
|
|
4052
4168
|
// ../renderers/src/TextInputRenderer.tsx
|
|
4053
|
-
var
|
|
4169
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4054
4170
|
var TextInputRenderer = {
|
|
4055
4171
|
canRenderType: "input-text",
|
|
4056
4172
|
render: (props) => {
|
|
@@ -4083,7 +4199,7 @@ var TextInputRenderer = {
|
|
|
4083
4199
|
}
|
|
4084
4200
|
}
|
|
4085
4201
|
});
|
|
4086
|
-
return /* @__PURE__ */ (0,
|
|
4202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4087
4203
|
FieldInput_default,
|
|
4088
4204
|
{
|
|
4089
4205
|
id,
|
|
@@ -4091,7 +4207,7 @@ var TextInputRenderer = {
|
|
|
4091
4207
|
description,
|
|
4092
4208
|
validation: validationState,
|
|
4093
4209
|
help,
|
|
4094
|
-
children: /* @__PURE__ */ (0,
|
|
4210
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components62.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
4095
4211
|
}
|
|
4096
4212
|
);
|
|
4097
4213
|
}
|
|
@@ -4099,13 +4215,13 @@ var TextInputRenderer = {
|
|
|
4099
4215
|
var TextInputRenderer_default = TextInputRenderer;
|
|
4100
4216
|
|
|
4101
4217
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4102
|
-
var
|
|
4218
|
+
var import_components63 = require("@transferwise/components");
|
|
4103
4219
|
|
|
4104
4220
|
// ../renderers/src/utils/getRandomId.ts
|
|
4105
4221
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
4106
4222
|
|
|
4107
4223
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4108
|
-
var
|
|
4224
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4109
4225
|
var UploadInputRenderer = {
|
|
4110
4226
|
canRenderType: "input-upload",
|
|
4111
4227
|
render: (props) => {
|
|
@@ -4121,15 +4237,15 @@ var UploadInputRenderer = {
|
|
|
4121
4237
|
};
|
|
4122
4238
|
return (
|
|
4123
4239
|
// We don't pass help here as there is no sensible place to display it
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4125
4241
|
UploadFieldInput_default,
|
|
4126
4242
|
{
|
|
4127
4243
|
id,
|
|
4128
4244
|
label: void 0,
|
|
4129
4245
|
description: void 0,
|
|
4130
4246
|
validation: validationState,
|
|
4131
|
-
children: /* @__PURE__ */ (0,
|
|
4132
|
-
|
|
4247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4248
|
+
import_components63.UploadInput,
|
|
4133
4249
|
{
|
|
4134
4250
|
id,
|
|
4135
4251
|
description,
|
|
@@ -4139,7 +4255,7 @@ var UploadInputRenderer = {
|
|
|
4139
4255
|
{
|
|
4140
4256
|
id: "my-file",
|
|
4141
4257
|
filename: value.name,
|
|
4142
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
4258
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components63.Status.FAILED : import_components63.Status.SUCCEEDED
|
|
4143
4259
|
}
|
|
4144
4260
|
] : void 0,
|
|
4145
4261
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -4194,7 +4310,7 @@ var LargeUploadRenderer = {
|
|
|
4194
4310
|
};
|
|
4195
4311
|
const filetypes = acceptsToFileTypes(accepts);
|
|
4196
4312
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
4197
|
-
return /* @__PURE__ */ (0,
|
|
4313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4198
4314
|
FieldInput_default,
|
|
4199
4315
|
{
|
|
4200
4316
|
id,
|
|
@@ -4202,8 +4318,8 @@ var LargeUploadRenderer = {
|
|
|
4202
4318
|
description,
|
|
4203
4319
|
validation: validationState,
|
|
4204
4320
|
help,
|
|
4205
|
-
children: /* @__PURE__ */ (0,
|
|
4206
|
-
|
|
4321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4322
|
+
import_components63.Upload,
|
|
4207
4323
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4208
4324
|
usAccept,
|
|
4209
4325
|
usDisabled: disabled,
|
|
@@ -4218,18 +4334,18 @@ var LargeUploadRenderer = {
|
|
|
4218
4334
|
};
|
|
4219
4335
|
|
|
4220
4336
|
// ../renderers/src/UpsellRenderer.tsx
|
|
4221
|
-
var
|
|
4222
|
-
var
|
|
4223
|
-
var
|
|
4337
|
+
var import_components64 = require("@transferwise/components");
|
|
4338
|
+
var import_react22 = require("react");
|
|
4339
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4224
4340
|
var UpsellRenderer = {
|
|
4225
4341
|
canRenderType: "upsell",
|
|
4226
4342
|
render: UpsellRendererComponent
|
|
4227
4343
|
};
|
|
4228
4344
|
function UpsellRendererComponent(props) {
|
|
4229
4345
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
4230
|
-
const [isVisible, setIsVisible] = (0,
|
|
4231
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
4232
|
-
|
|
4346
|
+
const [isVisible, setIsVisible] = (0, import_react22.useState)(true);
|
|
4347
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4348
|
+
import_components64.Nudge,
|
|
4233
4349
|
{
|
|
4234
4350
|
className: getMargin(margin),
|
|
4235
4351
|
mediaName: getMediaName(media),
|
|
@@ -4278,9 +4394,9 @@ var supportedMediaNames = [
|
|
|
4278
4394
|
];
|
|
4279
4395
|
|
|
4280
4396
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
4281
|
-
var
|
|
4397
|
+
var import_components65 = require("@transferwise/components");
|
|
4282
4398
|
var import_classnames7 = __toESM(require_classnames());
|
|
4283
|
-
var
|
|
4399
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
4284
4400
|
var CircularButtonRenderer = {
|
|
4285
4401
|
canRenderType: "button",
|
|
4286
4402
|
canRender: ({ control }) => control === "circular",
|
|
@@ -4290,8 +4406,8 @@ function CircularButtonComponent(props) {
|
|
|
4290
4406
|
var _a;
|
|
4291
4407
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
4292
4408
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
4293
|
-
return /* @__PURE__ */ (0,
|
|
4294
|
-
|
|
4409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_classnames7.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
4410
|
+
import_components65.CircularButton,
|
|
4295
4411
|
{
|
|
4296
4412
|
disabled,
|
|
4297
4413
|
priority: priority != null ? priority : "secondary",
|
|
@@ -4310,6 +4426,7 @@ var getWiseRenderers = () => [
|
|
|
4310
4426
|
CheckboxInputRenderer_default,
|
|
4311
4427
|
CircularButtonRenderer,
|
|
4312
4428
|
BoxRenderer_default,
|
|
4429
|
+
CollectionRenderer_default,
|
|
4313
4430
|
ButtonRenderer,
|
|
4314
4431
|
ColumnsRenderer_default,
|
|
4315
4432
|
DateInputRenderer_default,
|
|
@@ -4353,13 +4470,13 @@ var getWiseRenderers = () => [
|
|
|
4353
4470
|
];
|
|
4354
4471
|
|
|
4355
4472
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
4356
|
-
var
|
|
4357
|
-
var
|
|
4473
|
+
var import_components66 = require("@transferwise/components");
|
|
4474
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4358
4475
|
var InitialLoadingStateRenderer = {
|
|
4359
4476
|
canRenderType: "loading-state",
|
|
4360
4477
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
4361
|
-
render: () => /* @__PURE__ */ (0,
|
|
4362
|
-
|
|
4478
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
4479
|
+
import_components66.Loader,
|
|
4363
4480
|
{
|
|
4364
4481
|
size: "md",
|
|
4365
4482
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
|
|
@@ -4369,7 +4486,7 @@ var InitialLoadingStateRenderer = {
|
|
|
4369
4486
|
};
|
|
4370
4487
|
|
|
4371
4488
|
// ../renderers/src/subflow/getSubflowRenderer.tsx
|
|
4372
|
-
var
|
|
4489
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
4373
4490
|
var getSubflowRenderer = ({
|
|
4374
4491
|
Component: Component2,
|
|
4375
4492
|
canRender
|
|
@@ -4378,7 +4495,7 @@ var getSubflowRenderer = ({
|
|
|
4378
4495
|
canRenderType: "subflow",
|
|
4379
4496
|
canRender,
|
|
4380
4497
|
render: (props) => {
|
|
4381
|
-
return /* @__PURE__ */ (0,
|
|
4498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
4382
4499
|
Component2,
|
|
4383
4500
|
{
|
|
4384
4501
|
presentation: props.presentation,
|
|
@@ -4396,7 +4513,7 @@ var getSubflowRenderer = ({
|
|
|
4396
4513
|
};
|
|
4397
4514
|
|
|
4398
4515
|
// src/dynamicFlow/useOnCopy.tsx
|
|
4399
|
-
var
|
|
4516
|
+
var import_react23 = require("react");
|
|
4400
4517
|
var import_react_intl29 = require("react-intl");
|
|
4401
4518
|
|
|
4402
4519
|
// src/dynamicFlow/messages.ts
|
|
@@ -4418,7 +4535,7 @@ var messages_default = (0, import_react_intl28.defineMessages)({
|
|
|
4418
4535
|
var useOnCopy = () => {
|
|
4419
4536
|
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
4420
4537
|
const createSnackBar = useSnackBarIfAvailable();
|
|
4421
|
-
return (0,
|
|
4538
|
+
return (0, import_react23.useCallback)(
|
|
4422
4539
|
(copiedContent) => {
|
|
4423
4540
|
if (copiedContent) {
|
|
4424
4541
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -4431,11 +4548,11 @@ var useOnCopy = () => {
|
|
|
4431
4548
|
};
|
|
4432
4549
|
|
|
4433
4550
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
4434
|
-
var
|
|
4551
|
+
var import_react24 = require("react");
|
|
4435
4552
|
var import_react_intl30 = require("react-intl");
|
|
4436
4553
|
var useWiseHttpClient = (httpClient) => {
|
|
4437
4554
|
const { locale } = (0, import_react_intl30.useIntl)();
|
|
4438
|
-
return (0,
|
|
4555
|
+
return (0, import_react24.useCallback)(
|
|
4439
4556
|
async (input, init = {}) => {
|
|
4440
4557
|
const headers = new Headers(init.headers);
|
|
4441
4558
|
headers.set("accept-language", locale);
|
|
@@ -4458,25 +4575,25 @@ var handleRejection = (error) => {
|
|
|
4458
4575
|
|
|
4459
4576
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
4460
4577
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
4461
|
-
var
|
|
4462
|
-
var
|
|
4578
|
+
var import_components67 = require("@transferwise/components");
|
|
4579
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
4463
4580
|
function DynamicFlowModal(props) {
|
|
4464
4581
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
4465
4582
|
const dfProps = useWiseToCoreProps(rest);
|
|
4466
4583
|
const df = (0, import_dynamic_flow_client2.useDynamicFlowModal)(dfProps);
|
|
4467
|
-
return /* @__PURE__ */ (0,
|
|
4468
|
-
|
|
4584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
4585
|
+
import_components67.Modal,
|
|
4469
4586
|
__spreadProps(__spreadValues({
|
|
4470
4587
|
className: `dynamic-flow-modal ${className}`,
|
|
4471
4588
|
disableDimmerClickToClose: true
|
|
4472
4589
|
}, df.modal), {
|
|
4473
|
-
body: /* @__PURE__ */ (0,
|
|
4590
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
4474
4591
|
})
|
|
4475
4592
|
);
|
|
4476
4593
|
}
|
|
4477
4594
|
|
|
4478
4595
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
4479
|
-
var
|
|
4596
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
4480
4597
|
var wiseRenderers = getWiseRenderers();
|
|
4481
4598
|
var getMergedRenderers = (props) => {
|
|
4482
4599
|
var _d, _e;
|
|
@@ -4490,7 +4607,7 @@ var getMergedRenderers = (props) => {
|
|
|
4490
4607
|
method: initialRequest.method,
|
|
4491
4608
|
data: initialRequest.body
|
|
4492
4609
|
};
|
|
4493
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
4610
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
4494
4611
|
DynamicFlowModal,
|
|
4495
4612
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
4496
4613
|
features: subflowFeatures,
|
|
@@ -4516,9 +4633,9 @@ var useWiseToCoreProps = (props) => {
|
|
|
4516
4633
|
onLog
|
|
4517
4634
|
} = props;
|
|
4518
4635
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4519
|
-
const mergedRenderers = (0,
|
|
4520
|
-
const logEvent = (0,
|
|
4521
|
-
const trackEvent = (0,
|
|
4636
|
+
const mergedRenderers = (0, import_react25.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
4637
|
+
const logEvent = (0, import_react25.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4638
|
+
const trackEvent = (0, import_react25.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
4522
4639
|
const onCopy = useOnCopy();
|
|
4523
4640
|
return __spreadProps(__spreadValues({}, props), {
|
|
4524
4641
|
httpClient,
|
|
@@ -4549,27 +4666,27 @@ var openLinkInNewTab = (url) => {
|
|
|
4549
4666
|
};
|
|
4550
4667
|
|
|
4551
4668
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4552
|
-
var
|
|
4669
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
4553
4670
|
function DynamicFlow(props) {
|
|
4554
4671
|
const { className = "" } = props;
|
|
4555
4672
|
const dfProps = useWiseToCoreProps(props);
|
|
4556
4673
|
const df = (0, import_dynamic_flow_client3.useDynamicFlow)(dfProps);
|
|
4557
4674
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
4558
|
-
return /* @__PURE__ */ (0,
|
|
4675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className, onContextMenu, children: [
|
|
4559
4676
|
df.view,
|
|
4560
4677
|
contextMenu
|
|
4561
4678
|
] });
|
|
4562
4679
|
}
|
|
4563
4680
|
|
|
4564
4681
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
4565
|
-
var
|
|
4682
|
+
var import_react26 = require("react");
|
|
4566
4683
|
var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
4567
|
-
var
|
|
4568
|
-
var DynamicFlowWithRef = (0,
|
|
4684
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
4685
|
+
var DynamicFlowWithRef = (0, import_react26.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
4569
4686
|
const { className = "" } = props;
|
|
4570
4687
|
const dfProps = useWiseToCoreProps(props);
|
|
4571
4688
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
4572
|
-
(0,
|
|
4689
|
+
(0, import_react26.useImperativeHandle)(
|
|
4573
4690
|
ref,
|
|
4574
4691
|
() => ({
|
|
4575
4692
|
getValue: async () => {
|
|
@@ -4580,14 +4697,14 @@ var DynamicFlowWithRef = (0, import_react25.forwardRef)(function DynamicFlowWith
|
|
|
4580
4697
|
}),
|
|
4581
4698
|
[df]
|
|
4582
4699
|
);
|
|
4583
|
-
return /* @__PURE__ */ (0,
|
|
4700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className, children: df.view });
|
|
4584
4701
|
});
|
|
4585
4702
|
|
|
4586
4703
|
// src/index.ts
|
|
4587
4704
|
var import_dynamic_flow_client7 = require("@wise/dynamic-flow-client");
|
|
4588
4705
|
|
|
4589
4706
|
// src/dynamicFlow/renderers.tsx
|
|
4590
|
-
var Header10 =
|
|
4707
|
+
var Header10 = Header;
|
|
4591
4708
|
var Media2 = Media;
|
|
4592
4709
|
var getMargin2 = getMargin;
|
|
4593
4710
|
|