@wise/dynamic-flow-client-internal 5.14.0-experimental-9fc0bf0 → 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 +869 -671
- package/build/main.mjs +778 -580
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts.map +1 -1
- package/package.json +19 -17
package/build/main.js
CHANGED
|
@@ -141,7 +141,7 @@ var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
|
|
|
141
141
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
142
142
|
var appVersion = (
|
|
143
143
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
144
|
-
typeof process !== "undefined" ? "5.14.0
|
|
144
|
+
typeof process !== "undefined" ? "5.14.0" : "0.0.0"
|
|
145
145
|
);
|
|
146
146
|
|
|
147
147
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -196,21 +196,25 @@ var useMenuPosition = () => {
|
|
|
196
196
|
|
|
197
197
|
// src/dynamicFlow/context-menu/useDFContextMenu.tsx
|
|
198
198
|
var useDFContextMenu = (controller) => {
|
|
199
|
+
const getCurrentStep = () => {
|
|
200
|
+
const step = controller.getCurrentStep();
|
|
201
|
+
return step ? recursivelyRemoveNullish(step) : null;
|
|
202
|
+
};
|
|
199
203
|
const getCurrentStepWithModel = async () => {
|
|
200
204
|
const step = controller.getCurrentStep();
|
|
201
205
|
if (!step) {
|
|
202
206
|
return null;
|
|
203
207
|
}
|
|
204
208
|
const model = await controller.getSubmittableValue();
|
|
205
|
-
return __spreadProps(__spreadValues({}, step), { model });
|
|
209
|
+
return recursivelyRemoveNullish(__spreadProps(__spreadValues({}, step), { model }));
|
|
206
210
|
};
|
|
207
211
|
const getEncodedCurrentStep = () => {
|
|
208
|
-
const step =
|
|
209
|
-
return step ? toBase64(JSON.stringify(
|
|
212
|
+
const step = getCurrentStep();
|
|
213
|
+
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
210
214
|
};
|
|
211
215
|
const getEncodedCurrentStepWithModel = async () => {
|
|
212
216
|
const step = await getCurrentStepWithModel();
|
|
213
|
-
return step ? toBase64(JSON.stringify(
|
|
217
|
+
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
214
218
|
};
|
|
215
219
|
return useContextMenu({
|
|
216
220
|
title: "DynamicFlow Menu (Dev/Staging only)",
|
|
@@ -218,7 +222,7 @@ var useDFContextMenu = (controller) => {
|
|
|
218
222
|
{
|
|
219
223
|
label: `DF client version: ${appVersion}`,
|
|
220
224
|
onClick: () => {
|
|
221
|
-
|
|
225
|
+
openVersionPage(appVersion);
|
|
222
226
|
}
|
|
223
227
|
},
|
|
224
228
|
{
|
|
@@ -236,7 +240,7 @@ var useDFContextMenu = (controller) => {
|
|
|
236
240
|
{
|
|
237
241
|
label: "Copy step JSON",
|
|
238
242
|
onClick: () => {
|
|
239
|
-
copyToClipboard(
|
|
243
|
+
copyToClipboard(getCurrentStep());
|
|
240
244
|
}
|
|
241
245
|
},
|
|
242
246
|
{
|
|
@@ -255,8 +259,27 @@ var toBase64 = (str) => {
|
|
|
255
259
|
};
|
|
256
260
|
var openInSandbox = (base64Step) => {
|
|
257
261
|
if (base64Step) {
|
|
258
|
-
window.open(`https://df.wise.com/sandbox#${base64Step}`, "_blank");
|
|
262
|
+
window.open(`https://df.wise.com/sandbox#${base64Step}`, "_blank", "noopener,noreferrer");
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
var openVersionPage = (version) => {
|
|
266
|
+
const changelogUrl = getGitHubChangelogUrl(version);
|
|
267
|
+
if (changelogUrl) {
|
|
268
|
+
window.open(changelogUrl, "_blank", "noopener,noreferrer");
|
|
269
|
+
} else {
|
|
270
|
+
window.open(getNpmPackageUrl(version), "_blank", "noopener,noreferrer");
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
var getGitHubChangelogUrl = (version) => {
|
|
274
|
+
const semverRegex = /^\d+\.\d+\.\d+$/;
|
|
275
|
+
if (semverRegex.test(version)) {
|
|
276
|
+
const hash = version.replace(/\./g, "");
|
|
277
|
+
return `https://github.com/transferwise/dynamic-flow/blob/main/web/wise/CHANGELOG.md#${hash}`;
|
|
259
278
|
}
|
|
279
|
+
return void 0;
|
|
280
|
+
};
|
|
281
|
+
var getNpmPackageUrl = (version) => {
|
|
282
|
+
return `https://www.npmjs.com/package/@wise/dynamic-flow-client-internal/v/${version}`;
|
|
260
283
|
};
|
|
261
284
|
var copyToClipboard = (value) => {
|
|
262
285
|
if (typeof value === "string") {
|
|
@@ -284,21 +307,23 @@ var isDevOrStaging = () => {
|
|
|
284
307
|
return false;
|
|
285
308
|
}
|
|
286
309
|
};
|
|
287
|
-
var
|
|
310
|
+
var recursivelyRemoveNullish = (element) => {
|
|
288
311
|
if (Array.isArray(element)) {
|
|
289
|
-
return element.map(
|
|
312
|
+
return element.map(recursivelyRemoveNullish);
|
|
290
313
|
}
|
|
291
314
|
if (element !== null && typeof element === "object") {
|
|
292
|
-
return Object.entries(element).reduce(
|
|
293
|
-
(
|
|
294
|
-
|
|
295
|
-
|
|
315
|
+
return Object.entries(element).reduce((acc, [key, value]) => {
|
|
316
|
+
if (value !== null && value !== void 0) {
|
|
317
|
+
acc[key] = recursivelyRemoveNullish(value);
|
|
318
|
+
}
|
|
319
|
+
return acc;
|
|
320
|
+
}, {});
|
|
296
321
|
}
|
|
297
322
|
return element;
|
|
298
323
|
};
|
|
299
324
|
|
|
300
325
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
301
|
-
var
|
|
326
|
+
var import_react25 = require("react");
|
|
302
327
|
|
|
303
328
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
304
329
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -1080,12 +1105,273 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1080
1105
|
};
|
|
1081
1106
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1082
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
|
+
|
|
1083
1369
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1084
1370
|
var import_classnames3 = __toESM(require_classnames());
|
|
1085
|
-
var
|
|
1371
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1086
1372
|
var ColumnsRenderer = {
|
|
1087
1373
|
canRenderType: "columns",
|
|
1088
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0,
|
|
1374
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1089
1375
|
"div",
|
|
1090
1376
|
{
|
|
1091
1377
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -1093,8 +1379,8 @@ var ColumnsRenderer = {
|
|
|
1093
1379
|
"df-columns-renderer-bias-end": bias === "end"
|
|
1094
1380
|
}),
|
|
1095
1381
|
children: [
|
|
1096
|
-
/* @__PURE__ */ (0,
|
|
1097
|
-
/* @__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 })
|
|
1098
1384
|
]
|
|
1099
1385
|
}
|
|
1100
1386
|
)
|
|
@@ -1102,7 +1388,7 @@ var ColumnsRenderer = {
|
|
|
1102
1388
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
1103
1389
|
|
|
1104
1390
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1105
|
-
var
|
|
1391
|
+
var import_components16 = require("@transferwise/components");
|
|
1106
1392
|
|
|
1107
1393
|
// ../renderers/src/validators/type-validators.ts
|
|
1108
1394
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
@@ -1129,7 +1415,7 @@ var dateToDateString = (date) => {
|
|
|
1129
1415
|
};
|
|
1130
1416
|
|
|
1131
1417
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1132
|
-
var
|
|
1418
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1133
1419
|
function VariableDateInput({
|
|
1134
1420
|
control,
|
|
1135
1421
|
inputProps
|
|
@@ -1145,8 +1431,8 @@ function VariableDateInput({
|
|
|
1145
1431
|
onFocus
|
|
1146
1432
|
} = inputProps;
|
|
1147
1433
|
if (control === "date-lookup") {
|
|
1148
|
-
return /* @__PURE__ */ (0,
|
|
1149
|
-
|
|
1434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1435
|
+
import_components16.DateLookup,
|
|
1150
1436
|
{
|
|
1151
1437
|
value: dateStringToDateOrNull(inputProps.value),
|
|
1152
1438
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -1161,8 +1447,8 @@ function VariableDateInput({
|
|
|
1161
1447
|
}
|
|
1162
1448
|
);
|
|
1163
1449
|
}
|
|
1164
|
-
return /* @__PURE__ */ (0,
|
|
1165
|
-
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1451
|
+
import_components16.DateInput,
|
|
1166
1452
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1167
1453
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
1168
1454
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -1178,7 +1464,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1178
1464
|
var VariableDateInput_default = VariableDateInput;
|
|
1179
1465
|
|
|
1180
1466
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1181
|
-
var
|
|
1467
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1182
1468
|
var DateInputRenderer = {
|
|
1183
1469
|
canRenderType: "input-date",
|
|
1184
1470
|
render: (props) => {
|
|
@@ -1203,7 +1489,7 @@ var DateInputRenderer = {
|
|
|
1203
1489
|
]);
|
|
1204
1490
|
const value = initialValue != null ? initialValue : "";
|
|
1205
1491
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1206
|
-
return /* @__PURE__ */ (0,
|
|
1492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1207
1493
|
FieldInput_default,
|
|
1208
1494
|
{
|
|
1209
1495
|
id,
|
|
@@ -1211,7 +1497,7 @@ var DateInputRenderer = {
|
|
|
1211
1497
|
description,
|
|
1212
1498
|
validation: validationState,
|
|
1213
1499
|
help,
|
|
1214
|
-
children: /* @__PURE__ */ (0,
|
|
1500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(VariableDateInput_default, { control, inputProps })
|
|
1215
1501
|
}
|
|
1216
1502
|
);
|
|
1217
1503
|
}
|
|
@@ -1219,46 +1505,16 @@ var DateInputRenderer = {
|
|
|
1219
1505
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1220
1506
|
|
|
1221
1507
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1222
|
-
var
|
|
1223
|
-
|
|
1224
|
-
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1225
|
-
var import_components13 = require("@transferwise/components");
|
|
1226
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1227
|
-
var getAdditionalInfo = (additionalInfo) => {
|
|
1228
|
-
if (!additionalInfo) {
|
|
1229
|
-
return void 0;
|
|
1230
|
-
}
|
|
1231
|
-
const { href, text, onClick } = additionalInfo;
|
|
1232
|
-
if (href || onClick) {
|
|
1233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1234
|
-
import_components13.ListItem.AdditionalInfo,
|
|
1235
|
-
{
|
|
1236
|
-
action: {
|
|
1237
|
-
label: text,
|
|
1238
|
-
href,
|
|
1239
|
-
onClick,
|
|
1240
|
-
target: "_blank"
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
);
|
|
1244
|
-
}
|
|
1245
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1246
|
-
};
|
|
1247
|
-
|
|
1248
|
-
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1249
|
-
var shouldUseAvatar = (control, tags) => {
|
|
1250
|
-
var _a;
|
|
1251
|
-
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1252
|
-
};
|
|
1508
|
+
var import_components19 = require("@transferwise/components");
|
|
1253
1509
|
|
|
1254
1510
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1255
|
-
var
|
|
1256
|
-
var
|
|
1257
|
-
var
|
|
1511
|
+
var import_components18 = require("@transferwise/components");
|
|
1512
|
+
var import_react6 = require("react");
|
|
1513
|
+
var import_react_intl10 = require("react-intl");
|
|
1258
1514
|
|
|
1259
1515
|
// ../renderers/src/messages/filter.messages.ts
|
|
1260
|
-
var
|
|
1261
|
-
var filter_messages_default = (0,
|
|
1516
|
+
var import_react_intl7 = require("react-intl");
|
|
1517
|
+
var filter_messages_default = (0, import_react_intl7.defineMessages)({
|
|
1262
1518
|
placeholder: {
|
|
1263
1519
|
id: "df.wise.filter.placeholder",
|
|
1264
1520
|
defaultMessage: "Start typing to search",
|
|
@@ -1324,12 +1580,12 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
1324
1580
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
1325
1581
|
|
|
1326
1582
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1327
|
-
var
|
|
1328
|
-
var
|
|
1583
|
+
var import_components17 = require("@transferwise/components");
|
|
1584
|
+
var import_react_intl9 = require("react-intl");
|
|
1329
1585
|
|
|
1330
1586
|
// ../renderers/src/messages/group.messages.ts
|
|
1331
|
-
var
|
|
1332
|
-
var group_messages_default = (0,
|
|
1587
|
+
var import_react_intl8 = require("react-intl");
|
|
1588
|
+
var group_messages_default = (0, import_react_intl8.defineMessages)({
|
|
1333
1589
|
all: {
|
|
1334
1590
|
id: "df.wise.group.all",
|
|
1335
1591
|
defaultMessage: "All",
|
|
@@ -1363,19 +1619,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
1363
1619
|
};
|
|
1364
1620
|
|
|
1365
1621
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1366
|
-
var
|
|
1622
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1367
1623
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1368
1624
|
var isGroupedDecision = (options) => {
|
|
1369
1625
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
1370
1626
|
};
|
|
1371
1627
|
var GroupedDecisionList = (_a) => {
|
|
1372
1628
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1373
|
-
const { formatMessage } = (0,
|
|
1629
|
+
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
1374
1630
|
const { options } = rest;
|
|
1375
1631
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1378
|
-
|
|
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,
|
|
1379
1635
|
{
|
|
1380
1636
|
as: "h2",
|
|
1381
1637
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -1386,26 +1642,26 @@ var GroupedDecisionList = (_a) => {
|
|
|
1386
1642
|
};
|
|
1387
1643
|
|
|
1388
1644
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1389
|
-
var
|
|
1645
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1390
1646
|
var DecisionWrapper = (props) => {
|
|
1391
|
-
return /* @__PURE__ */ (0,
|
|
1392
|
-
props.title && /* @__PURE__ */ (0,
|
|
1393
|
-
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))
|
|
1394
1650
|
] });
|
|
1395
1651
|
};
|
|
1396
1652
|
var UnfilteredDecisionList = (_a) => {
|
|
1397
1653
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1398
|
-
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);
|
|
1399
1655
|
};
|
|
1400
1656
|
var FilteredDecisionList = (props) => {
|
|
1401
|
-
const { formatMessage } = (0,
|
|
1402
|
-
const [query, setQuery] = (0,
|
|
1657
|
+
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
1658
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
1403
1659
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
1404
1660
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
1405
1661
|
const isGrouped = isGroupedDecision(options);
|
|
1406
|
-
return /* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1408
|
-
|
|
1662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1664
|
+
import_components18.SearchInput,
|
|
1409
1665
|
{
|
|
1410
1666
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
1411
1667
|
value: query,
|
|
@@ -1416,25 +1672,25 @@ var FilteredDecisionList = (props) => {
|
|
|
1416
1672
|
}
|
|
1417
1673
|
}
|
|
1418
1674
|
),
|
|
1419
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
1420
|
-
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" }),
|
|
1421
1677
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
1422
1678
|
control,
|
|
1423
1679
|
className: query.length === 0 ? "m-t-3" : "",
|
|
1424
1680
|
options: filteredOptions
|
|
1425
|
-
}) : /* @__PURE__ */ (0,
|
|
1681
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
1426
1682
|
] })
|
|
1427
1683
|
] });
|
|
1428
1684
|
};
|
|
1429
1685
|
|
|
1430
1686
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1431
|
-
var
|
|
1687
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1432
1688
|
var DecisionRenderer = {
|
|
1433
1689
|
canRenderType: "decision",
|
|
1434
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1690
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
1435
1691
|
};
|
|
1436
1692
|
var renderDecisionList = ({ options, control }) => {
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: options.map((_a) => {
|
|
1438
1694
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
1439
1695
|
const {
|
|
1440
1696
|
description,
|
|
@@ -1447,8 +1703,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1447
1703
|
supportingValues,
|
|
1448
1704
|
tags
|
|
1449
1705
|
} = rest;
|
|
1450
|
-
return /* @__PURE__ */ (0,
|
|
1451
|
-
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1707
|
+
import_components19.ListItem,
|
|
1452
1708
|
{
|
|
1453
1709
|
title: itemTitle,
|
|
1454
1710
|
subtitle: description,
|
|
@@ -1459,7 +1715,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1459
1715
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
1460
1716
|
prompt: getInlineAlert(inlineAlert),
|
|
1461
1717
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
1462
|
-
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 })
|
|
1463
1719
|
},
|
|
1464
1720
|
JSON.stringify(rest)
|
|
1465
1721
|
);
|
|
@@ -1468,8 +1724,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1468
1724
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1469
1725
|
|
|
1470
1726
|
// ../renderers/src/DividerRenderer.tsx
|
|
1471
|
-
var
|
|
1472
|
-
var
|
|
1727
|
+
var import_components20 = require("@transferwise/components");
|
|
1728
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1473
1729
|
var mapControlToLevel = (control) => {
|
|
1474
1730
|
switch (control) {
|
|
1475
1731
|
case "section":
|
|
@@ -1482,16 +1738,16 @@ var mapControlToLevel = (control) => {
|
|
|
1482
1738
|
};
|
|
1483
1739
|
var DividerRenderer = {
|
|
1484
1740
|
canRenderType: "divider",
|
|
1485
|
-
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) })
|
|
1486
1742
|
};
|
|
1487
1743
|
var DividerRenderer_default = DividerRenderer;
|
|
1488
1744
|
|
|
1489
1745
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1490
|
-
var
|
|
1746
|
+
var import_components21 = require("@transferwise/components");
|
|
1491
1747
|
|
|
1492
1748
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1493
|
-
var
|
|
1494
|
-
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)({
|
|
1495
1751
|
title: {
|
|
1496
1752
|
id: "df.wise.ExternalConfirmation.title",
|
|
1497
1753
|
defaultMessage: "Please confirm",
|
|
@@ -1515,9 +1771,9 @@ var external_confirmation_messages_default = (0, import_react_intl9.defineMessag
|
|
|
1515
1771
|
});
|
|
1516
1772
|
|
|
1517
1773
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1518
|
-
var
|
|
1519
|
-
var
|
|
1520
|
-
var
|
|
1774
|
+
var import_react_intl12 = require("react-intl");
|
|
1775
|
+
var import_react7 = require("react");
|
|
1776
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1521
1777
|
var ExternalConfirmationRenderer = {
|
|
1522
1778
|
canRenderType: "external-confirmation",
|
|
1523
1779
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1528,20 +1784,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
1528
1784
|
open,
|
|
1529
1785
|
onCancel
|
|
1530
1786
|
}) {
|
|
1531
|
-
const { formatMessage } = (0,
|
|
1532
|
-
(0,
|
|
1787
|
+
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
1788
|
+
(0, import_react7.useEffect)(() => {
|
|
1533
1789
|
open();
|
|
1534
1790
|
}, []);
|
|
1535
|
-
return /* @__PURE__ */ (0,
|
|
1536
|
-
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1792
|
+
import_components21.Modal,
|
|
1537
1793
|
{
|
|
1538
1794
|
open: visible,
|
|
1539
1795
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1540
|
-
body: /* @__PURE__ */ (0,
|
|
1541
|
-
/* @__PURE__ */ (0,
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1544
|
-
|
|
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,
|
|
1545
1801
|
{
|
|
1546
1802
|
v2: true,
|
|
1547
1803
|
block: true,
|
|
@@ -1554,7 +1810,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1554
1810
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1555
1811
|
}
|
|
1556
1812
|
),
|
|
1557
|
-
/* @__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) })
|
|
1558
1814
|
] }) })
|
|
1559
1815
|
] }),
|
|
1560
1816
|
onClose: onCancel
|
|
@@ -1571,46 +1827,46 @@ function getOrigin(url) {
|
|
|
1571
1827
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1572
1828
|
|
|
1573
1829
|
// ../renderers/src/FormRenderer.tsx
|
|
1574
|
-
var
|
|
1830
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1575
1831
|
var FormRenderer = {
|
|
1576
1832
|
canRenderType: "form",
|
|
1577
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1833
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: getMargin(margin), children })
|
|
1578
1834
|
};
|
|
1579
1835
|
var FormRenderer_default = FormRenderer;
|
|
1580
1836
|
|
|
1581
1837
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1582
|
-
var
|
|
1583
|
-
var
|
|
1838
|
+
var import_components22 = require("@transferwise/components");
|
|
1839
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1584
1840
|
var FormSectionRenderer = {
|
|
1585
1841
|
canRenderType: "form-section",
|
|
1586
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1587
|
-
title && /* @__PURE__ */ (0,
|
|
1588
|
-
|
|
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,
|
|
1589
1845
|
{
|
|
1590
1846
|
as: "h2",
|
|
1591
1847
|
title
|
|
1592
1848
|
}
|
|
1593
1849
|
),
|
|
1594
|
-
description && /* @__PURE__ */ (0,
|
|
1850
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: description }),
|
|
1595
1851
|
children
|
|
1596
1852
|
] })
|
|
1597
1853
|
};
|
|
1598
1854
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
1599
1855
|
|
|
1600
1856
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1601
|
-
var
|
|
1602
|
-
var
|
|
1857
|
+
var import_components23 = require("@transferwise/components");
|
|
1858
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1603
1859
|
var HeadingRenderer = {
|
|
1604
1860
|
canRenderType: "heading",
|
|
1605
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1861
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Heading, __spreadValues({}, props))
|
|
1606
1862
|
};
|
|
1607
1863
|
function Heading(props) {
|
|
1608
1864
|
const { text, size, align, margin, control } = props;
|
|
1609
1865
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1610
|
-
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 });
|
|
1611
1867
|
}
|
|
1612
1868
|
function DisplayHeading({ size, text, className }) {
|
|
1613
|
-
return /* @__PURE__ */ (0,
|
|
1869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Display, { type: getDisplayType(size), className, children: text });
|
|
1614
1870
|
}
|
|
1615
1871
|
var getDisplayType = (size) => {
|
|
1616
1872
|
switch (size) {
|
|
@@ -1626,7 +1882,7 @@ var getDisplayType = (size) => {
|
|
|
1626
1882
|
}
|
|
1627
1883
|
};
|
|
1628
1884
|
function StandardHeading({ size, text, className }) {
|
|
1629
|
-
return /* @__PURE__ */ (0,
|
|
1885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1630
1886
|
}
|
|
1631
1887
|
var getTitleTypeBySize = (size) => {
|
|
1632
1888
|
var _a;
|
|
@@ -1642,8 +1898,8 @@ var getTitleTypeBySize = (size) => {
|
|
|
1642
1898
|
var HeadingRenderer_default = HeadingRenderer;
|
|
1643
1899
|
|
|
1644
1900
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1645
|
-
var
|
|
1646
|
-
var
|
|
1901
|
+
var import_components24 = require("@transferwise/components");
|
|
1902
|
+
var import_react8 = require("react");
|
|
1647
1903
|
|
|
1648
1904
|
// ../renderers/src/utils/api-utils.ts
|
|
1649
1905
|
function isRelativePath(url = "") {
|
|
@@ -1653,7 +1909,7 @@ function isRelativePath(url = "") {
|
|
|
1653
1909
|
}
|
|
1654
1910
|
|
|
1655
1911
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1656
|
-
var
|
|
1912
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1657
1913
|
function UrlImage({
|
|
1658
1914
|
accessibilityDescription,
|
|
1659
1915
|
align,
|
|
@@ -1662,14 +1918,14 @@ function UrlImage({
|
|
|
1662
1918
|
uri,
|
|
1663
1919
|
httpClient
|
|
1664
1920
|
}) {
|
|
1665
|
-
const [imageSource, setImageSource] = (0,
|
|
1666
|
-
(0,
|
|
1921
|
+
const [imageSource, setImageSource] = (0, import_react8.useState)("");
|
|
1922
|
+
(0, import_react8.useEffect)(() => {
|
|
1667
1923
|
if (!uri.startsWith("urn:")) {
|
|
1668
1924
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1669
1925
|
}
|
|
1670
1926
|
}, [uri, httpClient]);
|
|
1671
|
-
return /* @__PURE__ */ (0,
|
|
1672
|
-
|
|
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,
|
|
1673
1929
|
{
|
|
1674
1930
|
className: "df-reserve-space",
|
|
1675
1931
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -1712,7 +1968,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1712
1968
|
};
|
|
1713
1969
|
|
|
1714
1970
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1715
|
-
var
|
|
1971
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1716
1972
|
var maxFlagSize = 600;
|
|
1717
1973
|
function UrnFlagImage({
|
|
1718
1974
|
accessibilityDescription,
|
|
@@ -1721,12 +1977,12 @@ function UrnFlagImage({
|
|
|
1721
1977
|
size,
|
|
1722
1978
|
uri
|
|
1723
1979
|
}) {
|
|
1724
|
-
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 }) });
|
|
1725
1981
|
}
|
|
1726
1982
|
|
|
1727
1983
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1728
1984
|
var import_art4 = require("@wise/art");
|
|
1729
|
-
var
|
|
1985
|
+
var import_react10 = require("react");
|
|
1730
1986
|
|
|
1731
1987
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1732
1988
|
var isAnimated = (uri) => {
|
|
@@ -1736,9 +1992,9 @@ var isAnimated = (uri) => {
|
|
|
1736
1992
|
|
|
1737
1993
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1738
1994
|
var import_art3 = require("@wise/art");
|
|
1739
|
-
var
|
|
1740
|
-
var
|
|
1741
|
-
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 {
|
|
1742
1998
|
constructor(props) {
|
|
1743
1999
|
super(props);
|
|
1744
2000
|
this.state = { hasError: false };
|
|
@@ -1761,12 +2017,12 @@ var SafeIllustration3D = ({
|
|
|
1761
2017
|
size,
|
|
1762
2018
|
onError
|
|
1763
2019
|
}) => {
|
|
1764
|
-
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 }) });
|
|
1765
2021
|
};
|
|
1766
2022
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1767
2023
|
|
|
1768
2024
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1769
|
-
var
|
|
2025
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1770
2026
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1771
2027
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1772
2028
|
function UrnIllustration({
|
|
@@ -1776,12 +2032,12 @@ function UrnIllustration({
|
|
|
1776
2032
|
size,
|
|
1777
2033
|
uri
|
|
1778
2034
|
}) {
|
|
1779
|
-
const [has3DFailed, setHas3DFailed] = (0,
|
|
2035
|
+
const [has3DFailed, setHas3DFailed] = (0, import_react10.useState)(false);
|
|
1780
2036
|
const illustrationSize = getIllustrationSize(size);
|
|
1781
2037
|
const illustrationName = getIllustrationName(uri);
|
|
1782
2038
|
const illustration3DName = getIllustration3DName(uri);
|
|
1783
2039
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1784
|
-
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)(
|
|
1785
2041
|
SafeIllustration3D_default,
|
|
1786
2042
|
{
|
|
1787
2043
|
name: illustration3DName,
|
|
@@ -1790,7 +2046,7 @@ function UrnIllustration({
|
|
|
1790
2046
|
}
|
|
1791
2047
|
) });
|
|
1792
2048
|
}
|
|
1793
|
-
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)(
|
|
1794
2050
|
import_art4.Illustration,
|
|
1795
2051
|
{
|
|
1796
2052
|
className: "df-illustration",
|
|
@@ -1810,32 +2066,32 @@ var getIllustration3DName = (uri) => {
|
|
|
1810
2066
|
};
|
|
1811
2067
|
|
|
1812
2068
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1813
|
-
var
|
|
2069
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1814
2070
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1815
2071
|
function UrnImage(props) {
|
|
1816
2072
|
const { uri } = props;
|
|
1817
2073
|
if (isUrnIllustration(uri)) {
|
|
1818
|
-
return /* @__PURE__ */ (0,
|
|
2074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
1819
2075
|
}
|
|
1820
2076
|
if (isUrnFlag(uri)) {
|
|
1821
|
-
return /* @__PURE__ */ (0,
|
|
2077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
1822
2078
|
}
|
|
1823
2079
|
return null;
|
|
1824
2080
|
}
|
|
1825
2081
|
|
|
1826
2082
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1827
|
-
var
|
|
2083
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1828
2084
|
var ImageRenderer = {
|
|
1829
2085
|
canRenderType: "image",
|
|
1830
|
-
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))
|
|
1831
2087
|
};
|
|
1832
2088
|
|
|
1833
2089
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
1834
2090
|
var ImageRenderer_default = ImageRenderer;
|
|
1835
2091
|
|
|
1836
2092
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1837
|
-
var
|
|
1838
|
-
var
|
|
2093
|
+
var import_components25 = require("@transferwise/components");
|
|
2094
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1839
2095
|
var doContext = ["positive", "neutral"];
|
|
1840
2096
|
var dontContext = ["warning", "negative"];
|
|
1841
2097
|
var InstructionsRenderer = {
|
|
@@ -1843,16 +2099,16 @@ var InstructionsRenderer = {
|
|
|
1843
2099
|
render: ({ items, margin, title }) => {
|
|
1844
2100
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1845
2101
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1846
|
-
return /* @__PURE__ */ (0,
|
|
1847
|
-
title ? /* @__PURE__ */ (0,
|
|
1848
|
-
/* @__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 })
|
|
1849
2105
|
] });
|
|
1850
2106
|
}
|
|
1851
2107
|
};
|
|
1852
2108
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1853
2109
|
|
|
1854
2110
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1855
|
-
var
|
|
2111
|
+
var import_components26 = require("@transferwise/components");
|
|
1856
2112
|
|
|
1857
2113
|
// ../renderers/src/utils/input-utils.ts
|
|
1858
2114
|
var onWheel = (event) => {
|
|
@@ -1877,7 +2133,7 @@ function pick(obj, ...keys) {
|
|
|
1877
2133
|
}
|
|
1878
2134
|
|
|
1879
2135
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1880
|
-
var
|
|
2136
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1881
2137
|
var IntegerInputRenderer = {
|
|
1882
2138
|
canRenderType: "input-integer",
|
|
1883
2139
|
render: (props) => {
|
|
@@ -1892,7 +2148,7 @@ var IntegerInputRenderer = {
|
|
|
1892
2148
|
"maximum",
|
|
1893
2149
|
"minimum"
|
|
1894
2150
|
);
|
|
1895
|
-
return /* @__PURE__ */ (0,
|
|
2151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1896
2152
|
FieldInput_default,
|
|
1897
2153
|
{
|
|
1898
2154
|
id,
|
|
@@ -1900,8 +2156,8 @@ var IntegerInputRenderer = {
|
|
|
1900
2156
|
description,
|
|
1901
2157
|
validation: validationState,
|
|
1902
2158
|
help,
|
|
1903
|
-
children: /* @__PURE__ */ (0,
|
|
1904
|
-
|
|
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,
|
|
1905
2161
|
__spreadValues({
|
|
1906
2162
|
id,
|
|
1907
2163
|
name: id,
|
|
@@ -1923,55 +2179,12 @@ var IntegerInputRenderer = {
|
|
|
1923
2179
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1924
2180
|
|
|
1925
2181
|
// ../renderers/src/ListRenderer.tsx
|
|
1926
|
-
var
|
|
1927
|
-
|
|
1928
|
-
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1929
|
-
var import_components24 = require("@transferwise/components");
|
|
1930
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1931
|
-
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1932
|
-
if (!callToAction) {
|
|
1933
|
-
return void 0;
|
|
1934
|
-
}
|
|
1935
|
-
const { accessibilityDescription, href, title, context, onClick } = callToAction;
|
|
1936
|
-
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
1937
|
-
if (href) {
|
|
1938
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1939
|
-
import_components24.ListItem.Button,
|
|
1940
|
-
{
|
|
1941
|
-
href,
|
|
1942
|
-
target: "_blank",
|
|
1943
|
-
rel: "noopener noreferrer",
|
|
1944
|
-
partiallyInteractive: !fullyInteractive,
|
|
1945
|
-
priority,
|
|
1946
|
-
"aria-description": accessibilityDescription,
|
|
1947
|
-
sentiment,
|
|
1948
|
-
children: title
|
|
1949
|
-
}
|
|
1950
|
-
);
|
|
1951
|
-
}
|
|
1952
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1953
|
-
import_components24.ListItem.Button,
|
|
1954
|
-
{
|
|
1955
|
-
"aria-description": accessibilityDescription,
|
|
1956
|
-
partiallyInteractive: !fullyInteractive,
|
|
1957
|
-
priority,
|
|
1958
|
-
sentiment,
|
|
1959
|
-
onClick,
|
|
1960
|
-
children: title
|
|
1961
|
-
}
|
|
1962
|
-
);
|
|
1963
|
-
};
|
|
1964
|
-
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
1965
|
-
if (context === "negative") {
|
|
1966
|
-
return { priority: "secondary", sentiment: "negative" };
|
|
1967
|
-
}
|
|
1968
|
-
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
1969
|
-
};
|
|
2182
|
+
var import_components28 = require("@transferwise/components");
|
|
1970
2183
|
|
|
1971
2184
|
// ../renderers/src/components/Header.tsx
|
|
1972
|
-
var
|
|
1973
|
-
var
|
|
1974
|
-
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) });
|
|
1975
2188
|
var getHeaderAction = (callToAction) => {
|
|
1976
2189
|
if (!callToAction) {
|
|
1977
2190
|
return void 0;
|
|
@@ -1993,11 +2206,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
1993
2206
|
};
|
|
1994
2207
|
|
|
1995
2208
|
// ../renderers/src/ListRenderer.tsx
|
|
1996
|
-
var
|
|
2209
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1997
2210
|
var ListRenderer = {
|
|
1998
2211
|
canRenderType: "list",
|
|
1999
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
2000
|
-
/* @__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 }),
|
|
2001
2214
|
items.map((item) => {
|
|
2002
2215
|
var _a, _b;
|
|
2003
2216
|
const {
|
|
@@ -2014,8 +2227,8 @@ var ListRenderer = {
|
|
|
2014
2227
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2015
2228
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2016
2229
|
};
|
|
2017
|
-
return /* @__PURE__ */ (0,
|
|
2018
|
-
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2231
|
+
import_components28.ListItem,
|
|
2019
2232
|
{
|
|
2020
2233
|
title: itemTitle,
|
|
2021
2234
|
subtitle: description,
|
|
@@ -2034,12 +2247,12 @@ var ListRenderer = {
|
|
|
2034
2247
|
var ListRenderer_default = ListRenderer;
|
|
2035
2248
|
|
|
2036
2249
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
2037
|
-
var
|
|
2038
|
-
var
|
|
2250
|
+
var import_components29 = require("@transferwise/components");
|
|
2251
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2039
2252
|
var LoadingIndicatorRenderer = {
|
|
2040
2253
|
canRenderType: "loading-indicator",
|
|
2041
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
2042
|
-
|
|
2254
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2255
|
+
import_components29.Loader,
|
|
2043
2256
|
{
|
|
2044
2257
|
size,
|
|
2045
2258
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
@@ -2050,12 +2263,12 @@ var LoadingIndicatorRenderer = {
|
|
|
2050
2263
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
2051
2264
|
|
|
2052
2265
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
2053
|
-
var
|
|
2054
|
-
var
|
|
2266
|
+
var import_components30 = require("@transferwise/components");
|
|
2267
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2055
2268
|
var MarkdownRenderer = {
|
|
2056
2269
|
canRenderType: "markdown",
|
|
2057
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0,
|
|
2058
|
-
|
|
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,
|
|
2059
2272
|
{
|
|
2060
2273
|
className: ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large",
|
|
2061
2274
|
config: { link: { target: "_blank" } },
|
|
@@ -2066,16 +2279,16 @@ var MarkdownRenderer = {
|
|
|
2066
2279
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
2067
2280
|
|
|
2068
2281
|
// ../renderers/src/MediaRenderer.tsx
|
|
2069
|
-
var
|
|
2282
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2070
2283
|
var MediaRenderer = {
|
|
2071
2284
|
canRenderType: "media",
|
|
2072
2285
|
render: (_a) => {
|
|
2073
2286
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
2074
2287
|
switch (media.type) {
|
|
2075
2288
|
case "avatar":
|
|
2076
|
-
return /* @__PURE__ */ (0,
|
|
2289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2077
2290
|
case "image":
|
|
2078
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
2079
2292
|
case "legacy":
|
|
2080
2293
|
return null;
|
|
2081
2294
|
}
|
|
@@ -2087,7 +2300,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
2087
2300
|
margin,
|
|
2088
2301
|
size
|
|
2089
2302
|
}) => {
|
|
2090
|
-
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) }) });
|
|
2091
2304
|
};
|
|
2092
2305
|
var ImageMediaRendererComponent = (_a) => {
|
|
2093
2306
|
var _b = _a, {
|
|
@@ -2095,7 +2308,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
2095
2308
|
} = _b, rest = __objRest(_b, [
|
|
2096
2309
|
"media"
|
|
2097
2310
|
]);
|
|
2098
|
-
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));
|
|
2099
2312
|
};
|
|
2100
2313
|
var mapAvatarMediaSize = (size) => {
|
|
2101
2314
|
switch (size) {
|
|
@@ -2113,21 +2326,21 @@ var mapAvatarMediaSize = (size) => {
|
|
|
2113
2326
|
};
|
|
2114
2327
|
|
|
2115
2328
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
2116
|
-
var
|
|
2117
|
-
var
|
|
2118
|
-
var
|
|
2329
|
+
var import_components31 = require("@transferwise/components");
|
|
2330
|
+
var import_react11 = require("react");
|
|
2331
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2119
2332
|
var ModalLayoutRenderer = {
|
|
2120
2333
|
canRenderType: "modal-layout",
|
|
2121
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2334
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DFModal, __spreadValues({}, props))
|
|
2122
2335
|
};
|
|
2123
2336
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
2124
2337
|
function DFModal({ content, margin, trigger }) {
|
|
2125
|
-
const [visible, setVisible] = (0,
|
|
2338
|
+
const [visible, setVisible] = (0, import_react11.useState)(false);
|
|
2126
2339
|
const { children, title } = content;
|
|
2127
|
-
return /* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2130
|
-
|
|
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,
|
|
2131
2344
|
{
|
|
2132
2345
|
scroll: "content",
|
|
2133
2346
|
open: visible,
|
|
@@ -2141,20 +2354,20 @@ function DFModal({ content, margin, trigger }) {
|
|
|
2141
2354
|
}
|
|
2142
2355
|
|
|
2143
2356
|
// ../renderers/src/ModalRenderer.tsx
|
|
2144
|
-
var
|
|
2145
|
-
var
|
|
2357
|
+
var import_components32 = require("@transferwise/components");
|
|
2358
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2146
2359
|
var ModalRenderer = {
|
|
2147
2360
|
canRenderType: "modal",
|
|
2148
2361
|
render: ({ title, children, open, onClose }) => {
|
|
2149
|
-
return /* @__PURE__ */ (0,
|
|
2362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components32.Modal, { open, title, body: children, onClose });
|
|
2150
2363
|
}
|
|
2151
2364
|
};
|
|
2152
2365
|
|
|
2153
2366
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
2154
|
-
var
|
|
2155
|
-
var
|
|
2156
|
-
var
|
|
2157
|
-
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");
|
|
2158
2371
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2159
2372
|
var MoneyInputRenderer = {
|
|
2160
2373
|
canRenderType: "money-input",
|
|
@@ -2175,13 +2388,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
2175
2388
|
onAmountChange,
|
|
2176
2389
|
onCurrencyChange
|
|
2177
2390
|
} = props;
|
|
2178
|
-
(0,
|
|
2391
|
+
(0, import_react12.useEffect)(() => {
|
|
2179
2392
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
2180
2393
|
onCurrencyChange(0);
|
|
2181
2394
|
}
|
|
2182
2395
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
2183
|
-
const { formatMessage } = (0,
|
|
2184
|
-
return /* @__PURE__ */ (0,
|
|
2396
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2185
2398
|
FieldInput_default,
|
|
2186
2399
|
{
|
|
2187
2400
|
id: uid,
|
|
@@ -2189,8 +2402,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
2189
2402
|
description,
|
|
2190
2403
|
validation: validationState,
|
|
2191
2404
|
help,
|
|
2192
|
-
children: /* @__PURE__ */ (0,
|
|
2193
|
-
|
|
2405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2406
|
+
import_components33.MoneyInput,
|
|
2194
2407
|
{
|
|
2195
2408
|
amount: parseFloatOrNull(amountValue),
|
|
2196
2409
|
searchPlaceholder: "",
|
|
@@ -2250,10 +2463,10 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
2250
2463
|
}
|
|
2251
2464
|
}
|
|
2252
2465
|
|
|
2253
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2254
|
-
var
|
|
2255
|
-
var
|
|
2256
|
-
function
|
|
2466
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
2467
|
+
var import_components34 = require("@transferwise/components");
|
|
2468
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2469
|
+
function InlineComponent(props) {
|
|
2257
2470
|
const {
|
|
2258
2471
|
id,
|
|
2259
2472
|
description,
|
|
@@ -2265,7 +2478,7 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2265
2478
|
validationState,
|
|
2266
2479
|
onSelect
|
|
2267
2480
|
} = props;
|
|
2268
|
-
return /* @__PURE__ */ (0,
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2269
2482
|
FieldInput_default,
|
|
2270
2483
|
{
|
|
2271
2484
|
id,
|
|
@@ -2286,8 +2499,8 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2286
2499
|
childrenProps
|
|
2287
2500
|
} = option;
|
|
2288
2501
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2290
|
-
|
|
2502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2503
|
+
import_components34.ListItem,
|
|
2291
2504
|
{
|
|
2292
2505
|
title: itemTitle,
|
|
2293
2506
|
subtitle,
|
|
@@ -2295,10 +2508,10 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2295
2508
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2296
2509
|
media: getMedia(media, false),
|
|
2297
2510
|
prompt: getInlineAlert(inlineAlert),
|
|
2298
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
2511
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components34.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2299
2512
|
disabled: disabled || optionDisabled,
|
|
2300
|
-
control: /* @__PURE__ */ (0,
|
|
2301
|
-
|
|
2513
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2514
|
+
import_components34.ListItem.Checkbox,
|
|
2302
2515
|
{
|
|
2303
2516
|
checked: selectedIndices.includes(index),
|
|
2304
2517
|
onChange: (e) => {
|
|
@@ -2315,14 +2528,14 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2315
2528
|
);
|
|
2316
2529
|
}
|
|
2317
2530
|
|
|
2318
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2319
|
-
var
|
|
2320
|
-
var
|
|
2321
|
-
var
|
|
2531
|
+
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2532
|
+
var import_components35 = require("@transferwise/components");
|
|
2533
|
+
var import_react13 = require("react");
|
|
2534
|
+
var import_react_intl15 = require("react-intl");
|
|
2322
2535
|
|
|
2323
2536
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
2324
|
-
var
|
|
2325
|
-
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)({
|
|
2326
2539
|
summary: {
|
|
2327
2540
|
id: "df.wise.MultiSelect.summary",
|
|
2328
2541
|
defaultMessage: "{first} and {count} more",
|
|
@@ -2330,11 +2543,11 @@ var multi_select_messages_default = (0, import_react_intl12.defineMessages)({
|
|
|
2330
2543
|
}
|
|
2331
2544
|
});
|
|
2332
2545
|
|
|
2333
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2334
|
-
var
|
|
2335
|
-
function
|
|
2336
|
-
const { formatMessage } = (0,
|
|
2337
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
2546
|
+
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2547
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2548
|
+
function DefaultComponent(props) {
|
|
2549
|
+
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
2550
|
+
const [stagedIndices, setStagedIndices] = (0, import_react13.useState)();
|
|
2338
2551
|
const {
|
|
2339
2552
|
id,
|
|
2340
2553
|
autoComplete,
|
|
@@ -2372,12 +2585,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2372
2585
|
const contentProps = {
|
|
2373
2586
|
title: option.title,
|
|
2374
2587
|
description: option.description,
|
|
2375
|
-
icon: /* @__PURE__ */ (0,
|
|
2588
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2376
2589
|
};
|
|
2377
|
-
return /* @__PURE__ */ (0,
|
|
2590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components35.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2378
2591
|
};
|
|
2379
2592
|
const extraProps = { autoComplete };
|
|
2380
|
-
return /* @__PURE__ */ (0,
|
|
2593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2381
2594
|
FieldInput_default,
|
|
2382
2595
|
{
|
|
2383
2596
|
id,
|
|
@@ -2385,8 +2598,8 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2385
2598
|
help,
|
|
2386
2599
|
description,
|
|
2387
2600
|
validation: validationState,
|
|
2388
|
-
children: /* @__PURE__ */ (0,
|
|
2389
|
-
|
|
2601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2602
|
+
import_components35.SelectInput,
|
|
2390
2603
|
__spreadValues({
|
|
2391
2604
|
id,
|
|
2392
2605
|
items: options.map((option, index) => {
|
|
@@ -2423,22 +2636,78 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2423
2636
|
);
|
|
2424
2637
|
}
|
|
2425
2638
|
|
|
2639
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
2640
|
+
var import_components36 = require("@transferwise/components");
|
|
2641
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2642
|
+
function InlineCheckboxComponent(props) {
|
|
2643
|
+
const {
|
|
2644
|
+
id,
|
|
2645
|
+
description,
|
|
2646
|
+
disabled,
|
|
2647
|
+
help,
|
|
2648
|
+
options,
|
|
2649
|
+
selectedIndices,
|
|
2650
|
+
title,
|
|
2651
|
+
validationState,
|
|
2652
|
+
onSelect
|
|
2653
|
+
} = props;
|
|
2654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2655
|
+
FieldInput_default,
|
|
2656
|
+
{
|
|
2657
|
+
id,
|
|
2658
|
+
label: title,
|
|
2659
|
+
help,
|
|
2660
|
+
description,
|
|
2661
|
+
validation: validationState,
|
|
2662
|
+
children: options.map((option, index) => {
|
|
2663
|
+
var _a;
|
|
2664
|
+
const {
|
|
2665
|
+
title: label,
|
|
2666
|
+
description: secondary,
|
|
2667
|
+
disabled: optionDisabled,
|
|
2668
|
+
childrenProps
|
|
2669
|
+
} = option;
|
|
2670
|
+
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2671
|
+
const checkboxProps = {
|
|
2672
|
+
id,
|
|
2673
|
+
label,
|
|
2674
|
+
secondary,
|
|
2675
|
+
checked: selectedIndices.includes(index),
|
|
2676
|
+
disabled: disabled || optionDisabled,
|
|
2677
|
+
onChange: () => {
|
|
2678
|
+
const newSelectedIndices = selectedIndices.includes(index) ? selectedIndices.filter((i) => i !== index) : [...selectedIndices, index];
|
|
2679
|
+
onSelect(newSelectedIndices);
|
|
2680
|
+
}
|
|
2681
|
+
};
|
|
2682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components36.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
2683
|
+
})
|
|
2684
|
+
}
|
|
2685
|
+
);
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2426
2688
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2427
|
-
var
|
|
2689
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2428
2690
|
var MultiSelectInputRenderer = {
|
|
2429
2691
|
canRenderType: "input-multi-select",
|
|
2430
2692
|
render: (props) => {
|
|
2431
|
-
|
|
2693
|
+
switch (props.control) {
|
|
2694
|
+
case "inline":
|
|
2695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InlineComponent, __spreadValues({}, props));
|
|
2696
|
+
case "inline-checkbox-group":
|
|
2697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
2698
|
+
default:
|
|
2699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
2700
|
+
}
|
|
2432
2701
|
}
|
|
2433
2702
|
};
|
|
2434
2703
|
|
|
2435
2704
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2436
|
-
var
|
|
2705
|
+
var import_components38 = require("@transferwise/components");
|
|
2437
2706
|
|
|
2438
2707
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2439
|
-
var
|
|
2708
|
+
var import_components37 = require("@transferwise/components");
|
|
2440
2709
|
var import_classnames4 = __toESM(require_classnames());
|
|
2441
|
-
var
|
|
2710
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2442
2711
|
function UploadFieldInput({
|
|
2443
2712
|
id,
|
|
2444
2713
|
children,
|
|
@@ -2447,18 +2716,18 @@ function UploadFieldInput({
|
|
|
2447
2716
|
help,
|
|
2448
2717
|
validation
|
|
2449
2718
|
}) {
|
|
2450
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
2719
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
2451
2720
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2452
|
-
return /* @__PURE__ */ (0,
|
|
2721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
2453
2722
|
"div",
|
|
2454
2723
|
{
|
|
2455
2724
|
className: (0, import_classnames4.default)("form-group d-block", {
|
|
2456
2725
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2457
2726
|
}),
|
|
2458
2727
|
children: [
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2460
2729
|
children,
|
|
2461
|
-
(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 })
|
|
2462
2731
|
]
|
|
2463
2732
|
}
|
|
2464
2733
|
);
|
|
@@ -2493,7 +2762,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2493
2762
|
};
|
|
2494
2763
|
|
|
2495
2764
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2496
|
-
var
|
|
2765
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2497
2766
|
var MultiUploadInputRenderer = {
|
|
2498
2767
|
canRenderType: "input-upload-multi",
|
|
2499
2768
|
render: (props) => {
|
|
@@ -2518,7 +2787,7 @@ var MultiUploadInputRenderer = {
|
|
|
2518
2787
|
};
|
|
2519
2788
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2520
2789
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2521
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2522
2791
|
UploadFieldInput_default,
|
|
2523
2792
|
{
|
|
2524
2793
|
id,
|
|
@@ -2526,8 +2795,8 @@ var MultiUploadInputRenderer = {
|
|
|
2526
2795
|
description,
|
|
2527
2796
|
validation: validationState,
|
|
2528
2797
|
help,
|
|
2529
|
-
children: /* @__PURE__ */ (0,
|
|
2530
|
-
|
|
2798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2799
|
+
import_components38.UploadInput,
|
|
2531
2800
|
{
|
|
2532
2801
|
id,
|
|
2533
2802
|
"aria-describedby": descriptionId,
|
|
@@ -2536,7 +2805,7 @@ var MultiUploadInputRenderer = {
|
|
|
2536
2805
|
files: value.map(({ id: id2, file, validationState: validationState2 }) => ({
|
|
2537
2806
|
id: id2,
|
|
2538
2807
|
filename: file.name,
|
|
2539
|
-
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
|
|
2540
2809
|
})),
|
|
2541
2810
|
fileTypes: acceptsToFileTypes(accepts),
|
|
2542
2811
|
maxFiles: maxItems,
|
|
@@ -2554,8 +2823,8 @@ var MultiUploadInputRenderer = {
|
|
|
2554
2823
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
2555
2824
|
|
|
2556
2825
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2557
|
-
var
|
|
2558
|
-
var
|
|
2826
|
+
var import_components39 = require("@transferwise/components");
|
|
2827
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2559
2828
|
var NumberInputRenderer = {
|
|
2560
2829
|
canRenderType: "input-number",
|
|
2561
2830
|
render: (props) => {
|
|
@@ -2569,7 +2838,7 @@ var NumberInputRenderer = {
|
|
|
2569
2838
|
"maximum",
|
|
2570
2839
|
"minimum"
|
|
2571
2840
|
);
|
|
2572
|
-
return /* @__PURE__ */ (0,
|
|
2841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2573
2842
|
FieldInput_default,
|
|
2574
2843
|
{
|
|
2575
2844
|
id,
|
|
@@ -2577,8 +2846,8 @@ var NumberInputRenderer = {
|
|
|
2577
2846
|
description,
|
|
2578
2847
|
validation: validationState,
|
|
2579
2848
|
help,
|
|
2580
|
-
children: /* @__PURE__ */ (0,
|
|
2581
|
-
|
|
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,
|
|
2582
2851
|
__spreadValues({
|
|
2583
2852
|
id,
|
|
2584
2853
|
name: id,
|
|
@@ -2598,24 +2867,24 @@ var NumberInputRenderer = {
|
|
|
2598
2867
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2599
2868
|
|
|
2600
2869
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2601
|
-
var
|
|
2870
|
+
var import_react_intl17 = require("react-intl");
|
|
2602
2871
|
|
|
2603
2872
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2604
|
-
var
|
|
2605
|
-
var
|
|
2873
|
+
var import_components40 = require("@transferwise/components");
|
|
2874
|
+
var import_react14 = require("react");
|
|
2606
2875
|
function useSnackBarIfAvailable() {
|
|
2607
|
-
const context = (0,
|
|
2876
|
+
const context = (0, import_react14.useContext)(import_components40.SnackbarContext);
|
|
2608
2877
|
return context ? context.createSnackbar : () => {
|
|
2609
2878
|
};
|
|
2610
2879
|
}
|
|
2611
2880
|
|
|
2612
2881
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2613
|
-
var
|
|
2882
|
+
var import_components41 = require("@transferwise/components");
|
|
2614
2883
|
var import_classnames5 = __toESM(require_classnames());
|
|
2615
2884
|
|
|
2616
2885
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2617
|
-
var
|
|
2618
|
-
var paragraph_messages_default = (0,
|
|
2886
|
+
var import_react_intl16 = require("react-intl");
|
|
2887
|
+
var paragraph_messages_default = (0, import_react_intl16.defineMessages)({
|
|
2619
2888
|
copy: {
|
|
2620
2889
|
id: "df.wise.DynamicParagraph.copy",
|
|
2621
2890
|
defaultMessage: "Copy",
|
|
@@ -2629,14 +2898,14 @@ var paragraph_messages_default = (0, import_react_intl14.defineMessages)({
|
|
|
2629
2898
|
});
|
|
2630
2899
|
|
|
2631
2900
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2632
|
-
var
|
|
2901
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2633
2902
|
var ParagraphRenderer = {
|
|
2634
2903
|
canRenderType: "paragraph",
|
|
2635
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2904
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Paragraph, __spreadValues({}, props))
|
|
2636
2905
|
};
|
|
2637
2906
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2638
2907
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2639
|
-
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)(
|
|
2640
2909
|
"p",
|
|
2641
2910
|
{
|
|
2642
2911
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2649,16 +2918,16 @@ function CopyableParagraph({
|
|
|
2649
2918
|
align,
|
|
2650
2919
|
className
|
|
2651
2920
|
}) {
|
|
2652
|
-
const { formatMessage } = (0,
|
|
2921
|
+
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
2653
2922
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2654
2923
|
const copy = () => {
|
|
2655
2924
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2656
2925
|
});
|
|
2657
2926
|
};
|
|
2658
2927
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2660
|
-
/* @__PURE__ */ (0,
|
|
2661
|
-
|
|
2928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className, children: [
|
|
2929
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2930
|
+
import_components41.Input,
|
|
2662
2931
|
{
|
|
2663
2932
|
type: "text",
|
|
2664
2933
|
value: text,
|
|
@@ -2666,23 +2935,23 @@ function CopyableParagraph({
|
|
|
2666
2935
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
2667
2936
|
}
|
|
2668
2937
|
),
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2670
2939
|
] });
|
|
2671
2940
|
}
|
|
2672
2941
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2673
2942
|
|
|
2674
2943
|
// ../renderers/src/ProgressRenderer.tsx
|
|
2675
|
-
var
|
|
2676
|
-
var
|
|
2944
|
+
var import_components42 = require("@transferwise/components");
|
|
2945
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2677
2946
|
var ProgressRenderer = {
|
|
2678
2947
|
canRenderType: "progress",
|
|
2679
2948
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2680
|
-
return /* @__PURE__ */ (0,
|
|
2681
|
-
|
|
2949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
2950
|
+
import_components42.ProgressBar,
|
|
2682
2951
|
{
|
|
2683
2952
|
id: uid,
|
|
2684
2953
|
className: getMargin(margin),
|
|
2685
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
2954
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
2686
2955
|
description,
|
|
2687
2956
|
progress: {
|
|
2688
2957
|
max: 1,
|
|
@@ -2695,15 +2964,15 @@ var ProgressRenderer = {
|
|
|
2695
2964
|
};
|
|
2696
2965
|
|
|
2697
2966
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2698
|
-
var
|
|
2699
|
-
var
|
|
2967
|
+
var import_components43 = require("@transferwise/components");
|
|
2968
|
+
var import_icons2 = require("@transferwise/icons");
|
|
2700
2969
|
var import_classnames6 = __toESM(require_classnames());
|
|
2701
|
-
var
|
|
2702
|
-
var
|
|
2970
|
+
var import_react15 = require("react");
|
|
2971
|
+
var import_react_intl19 = require("react-intl");
|
|
2703
2972
|
|
|
2704
2973
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2705
|
-
var
|
|
2706
|
-
var repeatable_messages_default = (0,
|
|
2974
|
+
var import_react_intl18 = require("react-intl");
|
|
2975
|
+
var repeatable_messages_default = (0, import_react_intl18.defineMessages)({
|
|
2707
2976
|
addItemTitle: {
|
|
2708
2977
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2709
2978
|
defaultMessage: "Add Item",
|
|
@@ -2727,10 +2996,10 @@ var repeatable_messages_default = (0, import_react_intl16.defineMessages)({
|
|
|
2727
2996
|
});
|
|
2728
2997
|
|
|
2729
2998
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2730
|
-
var
|
|
2999
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2731
3000
|
var RepeatableRenderer = {
|
|
2732
3001
|
canRenderType: "repeatable",
|
|
2733
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
3002
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Repeatable, __spreadValues({}, props))
|
|
2734
3003
|
};
|
|
2735
3004
|
function Repeatable(props) {
|
|
2736
3005
|
const {
|
|
@@ -2746,8 +3015,8 @@ function Repeatable(props) {
|
|
|
2746
3015
|
onSave,
|
|
2747
3016
|
onRemove
|
|
2748
3017
|
} = props;
|
|
2749
|
-
const { formatMessage } = (0,
|
|
2750
|
-
const [openModalType, setOpenModalType] = (0,
|
|
3018
|
+
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
3019
|
+
const [openModalType, setOpenModalType] = (0, import_react15.useState)(null);
|
|
2751
3020
|
const onAddItem = () => {
|
|
2752
3021
|
onAdd();
|
|
2753
3022
|
setOpenModalType("add");
|
|
@@ -2769,41 +3038,41 @@ function Repeatable(props) {
|
|
|
2769
3038
|
const onCancelEdit = () => {
|
|
2770
3039
|
setOpenModalType(null);
|
|
2771
3040
|
};
|
|
2772
|
-
return /* @__PURE__ */ (0,
|
|
2773
|
-
title && /* @__PURE__ */ (0,
|
|
2774
|
-
description && /* @__PURE__ */ (0,
|
|
2775
|
-
/* @__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)(
|
|
2776
3045
|
"div",
|
|
2777
3046
|
{
|
|
2778
3047
|
className: (0, import_classnames6.default)("form-group", {
|
|
2779
3048
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2780
3049
|
}),
|
|
2781
3050
|
children: [
|
|
2782
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2783
|
-
/* @__PURE__ */ (0,
|
|
2784
|
-
|
|
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,
|
|
2785
3054
|
{
|
|
2786
|
-
media: /* @__PURE__ */ (0,
|
|
3055
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_icons2.Plus, {}),
|
|
2787
3056
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2788
3057
|
showMediaAtAllSizes: true,
|
|
2789
3058
|
onClick: () => onAddItem()
|
|
2790
3059
|
}
|
|
2791
3060
|
),
|
|
2792
|
-
(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 })
|
|
2793
3062
|
]
|
|
2794
3063
|
}
|
|
2795
3064
|
),
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3066
|
+
import_components43.Modal,
|
|
2798
3067
|
{
|
|
2799
3068
|
open: openModalType !== null,
|
|
2800
3069
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2801
|
-
body: /* @__PURE__ */ (0,
|
|
2802
|
-
/* @__PURE__ */ (0,
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
2804
|
-
/* @__PURE__ */ (0,
|
|
2805
|
-
/* @__PURE__ */ (0,
|
|
2806
|
-
|
|
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,
|
|
2807
3076
|
{
|
|
2808
3077
|
v2: true,
|
|
2809
3078
|
priority: "secondary",
|
|
@@ -2824,10 +3093,10 @@ function ItemSummaryOption({
|
|
|
2824
3093
|
item,
|
|
2825
3094
|
onClick
|
|
2826
3095
|
}) {
|
|
2827
|
-
return /* @__PURE__ */ (0,
|
|
2828
|
-
|
|
3096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3097
|
+
import_components43.NavigationOption,
|
|
2829
3098
|
{
|
|
2830
|
-
media: /* @__PURE__ */ (0,
|
|
3099
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2831
3100
|
title: item.title,
|
|
2832
3101
|
content: item.description,
|
|
2833
3102
|
showMediaAtAllSizes: true,
|
|
@@ -2839,16 +3108,16 @@ function ItemSummaryOption({
|
|
|
2839
3108
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2840
3109
|
|
|
2841
3110
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2842
|
-
var
|
|
2843
|
-
var
|
|
3111
|
+
var import_components44 = require("@transferwise/components");
|
|
3112
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2844
3113
|
var ReviewRenderer = {
|
|
2845
3114
|
canRenderType: "review",
|
|
2846
3115
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2847
3116
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2848
|
-
return /* @__PURE__ */ (0,
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
|
|
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,
|
|
2852
3121
|
{
|
|
2853
3122
|
layout: orientation,
|
|
2854
3123
|
definitions: fields.map(
|
|
@@ -2885,20 +3154,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2885
3154
|
};
|
|
2886
3155
|
var getFieldLabel = (label, help, onClick) => {
|
|
2887
3156
|
if (help) {
|
|
2888
|
-
return /* @__PURE__ */ (0,
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
2889
3158
|
label,
|
|
2890
3159
|
" ",
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
3160
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Help_default, { help, onClick })
|
|
2892
3161
|
] });
|
|
2893
3162
|
}
|
|
2894
3163
|
return label;
|
|
2895
3164
|
};
|
|
2896
3165
|
|
|
2897
3166
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2898
|
-
var
|
|
2899
|
-
var
|
|
2900
|
-
var
|
|
2901
|
-
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");
|
|
2902
3171
|
var IGNORED_CONTROLS = [
|
|
2903
3172
|
"horizontal",
|
|
2904
3173
|
"horizontal-end-aligned",
|
|
@@ -2908,7 +3177,7 @@ var IGNORED_CONTROLS = [
|
|
|
2908
3177
|
var ReviewRenderer2 = {
|
|
2909
3178
|
canRenderType: "review",
|
|
2910
3179
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
2911
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
3180
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Review, __spreadValues({}, props))
|
|
2912
3181
|
};
|
|
2913
3182
|
var Review = ({
|
|
2914
3183
|
callToAction,
|
|
@@ -2919,9 +3188,9 @@ var Review = ({
|
|
|
2919
3188
|
title,
|
|
2920
3189
|
trackEvent
|
|
2921
3190
|
}) => {
|
|
2922
|
-
const intl = (0,
|
|
2923
|
-
return /* @__PURE__ */ (0,
|
|
2924
|
-
/* @__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 }),
|
|
2925
3194
|
fields.map((field) => {
|
|
2926
3195
|
var _a, _b, _c;
|
|
2927
3196
|
const {
|
|
@@ -2939,8 +3208,8 @@ var Review = ({
|
|
|
2939
3208
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2940
3209
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2941
3210
|
};
|
|
2942
|
-
return /* @__PURE__ */ (0,
|
|
2943
|
-
|
|
3211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3212
|
+
import_components45.ListItem,
|
|
2944
3213
|
{
|
|
2945
3214
|
title: value,
|
|
2946
3215
|
subtitle: label,
|
|
@@ -2960,18 +3229,18 @@ var Review = ({
|
|
|
2960
3229
|
] });
|
|
2961
3230
|
};
|
|
2962
3231
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
2963
|
-
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, {}) }) });
|
|
2964
3233
|
};
|
|
2965
3234
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
2966
3235
|
|
|
2967
3236
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2968
|
-
var
|
|
2969
|
-
var
|
|
2970
|
-
var
|
|
3237
|
+
var import_components47 = require("@transferwise/components");
|
|
3238
|
+
var import_react16 = require("react");
|
|
3239
|
+
var import_react_intl24 = require("react-intl");
|
|
2971
3240
|
|
|
2972
3241
|
// ../renderers/src/messages/search.messages.ts
|
|
2973
|
-
var
|
|
2974
|
-
var search_messages_default = (0,
|
|
3242
|
+
var import_react_intl21 = require("react-intl");
|
|
3243
|
+
var search_messages_default = (0, import_react_intl21.defineMessages)({
|
|
2975
3244
|
loading: {
|
|
2976
3245
|
id: "df.wise.SearchLayout.loading",
|
|
2977
3246
|
defaultMessage: "Loading...",
|
|
@@ -2980,11 +3249,11 @@ var search_messages_default = (0, import_react_intl19.defineMessages)({
|
|
|
2980
3249
|
});
|
|
2981
3250
|
|
|
2982
3251
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2983
|
-
var
|
|
3252
|
+
var import_react_intl23 = require("react-intl");
|
|
2984
3253
|
|
|
2985
3254
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
2986
|
-
var
|
|
2987
|
-
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)({
|
|
2988
3257
|
genericErrorRetryHint: {
|
|
2989
3258
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
2990
3259
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -3003,20 +3272,20 @@ var generic_error_messages_default = (0, import_react_intl20.defineMessages)({
|
|
|
3003
3272
|
});
|
|
3004
3273
|
|
|
3005
3274
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
3006
|
-
var
|
|
3007
|
-
var
|
|
3275
|
+
var import_components46 = require("@transferwise/components");
|
|
3276
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3008
3277
|
function ErrorResult({ state }) {
|
|
3009
|
-
const intl = (0,
|
|
3010
|
-
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: [
|
|
3011
3280
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
3012
3281
|
"\xA0",
|
|
3013
|
-
/* @__PURE__ */ (0,
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components46.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
3014
3283
|
] });
|
|
3015
3284
|
}
|
|
3016
3285
|
|
|
3017
3286
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3018
|
-
var
|
|
3019
|
-
var
|
|
3287
|
+
var import_icons4 = require("@transferwise/icons");
|
|
3288
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3020
3289
|
function BlockSearchRendererComponent({
|
|
3021
3290
|
id,
|
|
3022
3291
|
hint,
|
|
@@ -3028,11 +3297,11 @@ function BlockSearchRendererComponent({
|
|
|
3028
3297
|
trackEvent,
|
|
3029
3298
|
onChange
|
|
3030
3299
|
}) {
|
|
3031
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3032
|
-
const { formatMessage } = (0,
|
|
3033
|
-
return /* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3035
|
-
|
|
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,
|
|
3036
3305
|
{
|
|
3037
3306
|
id,
|
|
3038
3307
|
name: id,
|
|
@@ -3048,7 +3317,7 @@ function BlockSearchRendererComponent({
|
|
|
3048
3317
|
}
|
|
3049
3318
|
}
|
|
3050
3319
|
) }) }),
|
|
3051
|
-
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 })
|
|
3052
3321
|
] });
|
|
3053
3322
|
}
|
|
3054
3323
|
function SearchResultContent({
|
|
@@ -3057,39 +3326,39 @@ function SearchResultContent({
|
|
|
3057
3326
|
}) {
|
|
3058
3327
|
switch (state.type) {
|
|
3059
3328
|
case "error":
|
|
3060
|
-
return /* @__PURE__ */ (0,
|
|
3329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorResult, { state });
|
|
3061
3330
|
case "results":
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SearchResults, { state, trackEvent });
|
|
3063
3332
|
case "layout":
|
|
3064
|
-
return /* @__PURE__ */ (0,
|
|
3333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
3065
3334
|
" ",
|
|
3066
3335
|
state.layout,
|
|
3067
3336
|
" "
|
|
3068
3337
|
] });
|
|
3069
3338
|
case "noResults":
|
|
3070
|
-
return /* @__PURE__ */ (0,
|
|
3339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptySearchResult, { state });
|
|
3071
3340
|
case "pending":
|
|
3072
3341
|
default:
|
|
3073
3342
|
return null;
|
|
3074
3343
|
}
|
|
3075
3344
|
}
|
|
3076
3345
|
function EmptySearchResult({ state }) {
|
|
3077
|
-
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 });
|
|
3078
3347
|
}
|
|
3079
3348
|
function SearchResults({
|
|
3080
3349
|
state,
|
|
3081
3350
|
trackEvent
|
|
3082
3351
|
}) {
|
|
3083
|
-
return /* @__PURE__ */ (0,
|
|
3352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components47.List, { children: state.results.map((result) => {
|
|
3084
3353
|
const { media } = result;
|
|
3085
|
-
return /* @__PURE__ */ (0,
|
|
3086
|
-
|
|
3354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3355
|
+
import_components47.ListItem,
|
|
3087
3356
|
{
|
|
3088
3357
|
title: result.title,
|
|
3089
3358
|
subtitle: result.description,
|
|
3090
|
-
media: media ? /* @__PURE__ */ (0,
|
|
3091
|
-
control: /* @__PURE__ */ (0,
|
|
3092
|
-
|
|
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,
|
|
3093
3362
|
{
|
|
3094
3363
|
onClick: () => {
|
|
3095
3364
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -3107,11 +3376,11 @@ function SearchResults({
|
|
|
3107
3376
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
3108
3377
|
|
|
3109
3378
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
3110
|
-
var
|
|
3111
|
-
var
|
|
3112
|
-
var
|
|
3113
|
-
var
|
|
3114
|
-
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");
|
|
3115
3384
|
function InlineSearchRenderer({
|
|
3116
3385
|
id,
|
|
3117
3386
|
hint,
|
|
@@ -3122,10 +3391,10 @@ function InlineSearchRenderer({
|
|
|
3122
3391
|
title,
|
|
3123
3392
|
trackEvent
|
|
3124
3393
|
}) {
|
|
3125
|
-
const [hasSearched, setHasSearched] = (0,
|
|
3126
|
-
const intl = (0,
|
|
3127
|
-
return /* @__PURE__ */ (0,
|
|
3128
|
-
|
|
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,
|
|
3129
3398
|
{
|
|
3130
3399
|
id: "typeahead-input-id",
|
|
3131
3400
|
intl,
|
|
@@ -3133,10 +3402,10 @@ function InlineSearchRenderer({
|
|
|
3133
3402
|
size: "md",
|
|
3134
3403
|
placeholder: hint,
|
|
3135
3404
|
maxHeight: 100,
|
|
3136
|
-
footer: /* @__PURE__ */ (0,
|
|
3405
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
3137
3406
|
multiple: false,
|
|
3138
3407
|
clearable: false,
|
|
3139
|
-
addon: /* @__PURE__ */ (0,
|
|
3408
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_icons5.Search, { size: 24 }),
|
|
3140
3409
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
3141
3410
|
minQueryLength: 1,
|
|
3142
3411
|
onChange: (values) => {
|
|
@@ -3171,33 +3440,33 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3171
3440
|
};
|
|
3172
3441
|
}
|
|
3173
3442
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3174
|
-
const { formatMessage } = (0,
|
|
3443
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3175
3444
|
if (state.type === "layout") {
|
|
3176
|
-
return /* @__PURE__ */ (0,
|
|
3445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
3177
3446
|
}
|
|
3178
3447
|
if (state.type === "noResults") {
|
|
3179
|
-
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 });
|
|
3180
3449
|
}
|
|
3181
3450
|
if (state.type === "error") {
|
|
3182
|
-
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 }) });
|
|
3183
3452
|
}
|
|
3184
3453
|
if (state.type === "pending" || isLoading) {
|
|
3185
|
-
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) });
|
|
3186
3455
|
}
|
|
3187
3456
|
return null;
|
|
3188
3457
|
}
|
|
3189
3458
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3190
3459
|
|
|
3191
3460
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3192
|
-
var
|
|
3461
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3193
3462
|
var SearchRenderer = {
|
|
3194
3463
|
canRenderType: "search",
|
|
3195
|
-
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))
|
|
3196
3465
|
};
|
|
3197
3466
|
var SearchRenderer_default = SearchRenderer;
|
|
3198
3467
|
|
|
3199
3468
|
// ../renderers/src/SectionRenderer.tsx
|
|
3200
|
-
var
|
|
3469
|
+
var import_components49 = require("@transferwise/components");
|
|
3201
3470
|
|
|
3202
3471
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
3203
3472
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -3221,12 +3490,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
3221
3490
|
};
|
|
3222
3491
|
|
|
3223
3492
|
// ../renderers/src/SectionRenderer.tsx
|
|
3224
|
-
var
|
|
3493
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3225
3494
|
var SectionRenderer = {
|
|
3226
3495
|
canRenderType: "section",
|
|
3227
3496
|
render: ({ children, callToAction, margin, title }) => {
|
|
3228
|
-
return /* @__PURE__ */ (0,
|
|
3229
|
-
(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) }),
|
|
3230
3499
|
children
|
|
3231
3500
|
] });
|
|
3232
3501
|
}
|
|
@@ -3234,8 +3503,8 @@ var SectionRenderer = {
|
|
|
3234
3503
|
var SectionRenderer_default = SectionRenderer;
|
|
3235
3504
|
|
|
3236
3505
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3237
|
-
var
|
|
3238
|
-
var
|
|
3506
|
+
var import_components50 = require("@transferwise/components");
|
|
3507
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3239
3508
|
function RadioInputRendererComponent(props) {
|
|
3240
3509
|
const {
|
|
3241
3510
|
id,
|
|
@@ -3249,8 +3518,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3249
3518
|
validationState,
|
|
3250
3519
|
onSelect
|
|
3251
3520
|
} = props;
|
|
3252
|
-
return /* @__PURE__ */ (0,
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
|
|
3522
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3254
3523
|
FieldInput_default,
|
|
3255
3524
|
{
|
|
3256
3525
|
id,
|
|
@@ -3258,8 +3527,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3258
3527
|
help,
|
|
3259
3528
|
description,
|
|
3260
3529
|
validation: validationState,
|
|
3261
|
-
children: /* @__PURE__ */ (0,
|
|
3262
|
-
|
|
3530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3531
|
+
import_components50.RadioGroup,
|
|
3263
3532
|
{
|
|
3264
3533
|
name: id,
|
|
3265
3534
|
radios: options.map((option, index) => ({
|
|
@@ -3267,7 +3536,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3267
3536
|
value: index,
|
|
3268
3537
|
secondary: option.description,
|
|
3269
3538
|
disabled: option.disabled || disabled,
|
|
3270
|
-
avatar: /* @__PURE__ */ (0,
|
|
3539
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3271
3540
|
})),
|
|
3272
3541
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3273
3542
|
onChange: onSelect
|
|
@@ -3281,9 +3550,9 @@ function RadioInputRendererComponent(props) {
|
|
|
3281
3550
|
}
|
|
3282
3551
|
|
|
3283
3552
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3284
|
-
var
|
|
3285
|
-
var
|
|
3286
|
-
var
|
|
3553
|
+
var import_components51 = require("@transferwise/components");
|
|
3554
|
+
var import_react18 = require("react");
|
|
3555
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3287
3556
|
function TabInputRendererComponent(props) {
|
|
3288
3557
|
const {
|
|
3289
3558
|
id,
|
|
@@ -3297,13 +3566,13 @@ function TabInputRendererComponent(props) {
|
|
|
3297
3566
|
validationState,
|
|
3298
3567
|
onSelect
|
|
3299
3568
|
} = props;
|
|
3300
|
-
(0,
|
|
3569
|
+
(0, import_react18.useEffect)(() => {
|
|
3301
3570
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3302
3571
|
onSelect(0);
|
|
3303
3572
|
}
|
|
3304
3573
|
}, [selectedIndex, onSelect, options.length]);
|
|
3305
|
-
return /* @__PURE__ */ (0,
|
|
3306
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
3575
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3307
3576
|
FieldInput_default,
|
|
3308
3577
|
{
|
|
3309
3578
|
id,
|
|
@@ -3311,8 +3580,8 @@ function TabInputRendererComponent(props) {
|
|
|
3311
3580
|
help,
|
|
3312
3581
|
description,
|
|
3313
3582
|
validation: validationState,
|
|
3314
|
-
children: /* @__PURE__ */ (0,
|
|
3315
|
-
|
|
3583
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
3584
|
+
import_components51.Tabs,
|
|
3316
3585
|
{
|
|
3317
3586
|
name: id,
|
|
3318
3587
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -3320,7 +3589,7 @@ function TabInputRendererComponent(props) {
|
|
|
3320
3589
|
title: option.title,
|
|
3321
3590
|
// if we pass null, we get some props-types console errors
|
|
3322
3591
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3323
|
-
content: /* @__PURE__ */ (0,
|
|
3592
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_jsx_runtime73.Fragment, {}),
|
|
3324
3593
|
disabled: option.disabled || disabled
|
|
3325
3594
|
})),
|
|
3326
3595
|
onTabSelect: onSelect
|
|
@@ -3334,8 +3603,8 @@ function TabInputRendererComponent(props) {
|
|
|
3334
3603
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3335
3604
|
|
|
3336
3605
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3337
|
-
var
|
|
3338
|
-
var
|
|
3606
|
+
var import_components52 = require("@transferwise/components");
|
|
3607
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3339
3608
|
function SelectInputRendererComponent(props) {
|
|
3340
3609
|
const {
|
|
3341
3610
|
id,
|
|
@@ -3375,13 +3644,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3375
3644
|
} : {
|
|
3376
3645
|
title: option.title,
|
|
3377
3646
|
description: option.description,
|
|
3378
|
-
icon: /* @__PURE__ */ (0,
|
|
3647
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3379
3648
|
};
|
|
3380
|
-
return /* @__PURE__ */ (0,
|
|
3649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components52.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3381
3650
|
};
|
|
3382
3651
|
const extraProps = { autoComplete };
|
|
3383
|
-
return /* @__PURE__ */ (0,
|
|
3384
|
-
/* @__PURE__ */ (0,
|
|
3652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
3653
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3385
3654
|
FieldInput_default,
|
|
3386
3655
|
{
|
|
3387
3656
|
id,
|
|
@@ -3389,8 +3658,8 @@ function SelectInputRendererComponent(props) {
|
|
|
3389
3658
|
help,
|
|
3390
3659
|
description,
|
|
3391
3660
|
validation: validationState,
|
|
3392
|
-
children: /* @__PURE__ */ (0,
|
|
3393
|
-
|
|
3661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3662
|
+
import_components52.SelectInput,
|
|
3394
3663
|
__spreadValues({
|
|
3395
3664
|
name: id,
|
|
3396
3665
|
placeholder,
|
|
@@ -3410,9 +3679,9 @@ function SelectInputRendererComponent(props) {
|
|
|
3410
3679
|
}
|
|
3411
3680
|
|
|
3412
3681
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3413
|
-
var
|
|
3414
|
-
var
|
|
3415
|
-
var
|
|
3682
|
+
var import_react19 = require("react");
|
|
3683
|
+
var import_components53 = require("@transferwise/components");
|
|
3684
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3416
3685
|
function SegmentedInputRendererComponent(props) {
|
|
3417
3686
|
const {
|
|
3418
3687
|
id,
|
|
@@ -3425,13 +3694,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3425
3694
|
validationState,
|
|
3426
3695
|
onSelect
|
|
3427
3696
|
} = props;
|
|
3428
|
-
(0,
|
|
3697
|
+
(0, import_react19.useEffect)(() => {
|
|
3429
3698
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
3430
3699
|
onSelect(0);
|
|
3431
3700
|
}
|
|
3432
3701
|
}, [selectedIndex, onSelect, options.length]);
|
|
3433
|
-
return /* @__PURE__ */ (0,
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
3703
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3435
3704
|
FieldInput_default,
|
|
3436
3705
|
{
|
|
3437
3706
|
id,
|
|
@@ -3439,8 +3708,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3439
3708
|
help,
|
|
3440
3709
|
description,
|
|
3441
3710
|
validation: validationState,
|
|
3442
|
-
children: /* @__PURE__ */ (0,
|
|
3443
|
-
|
|
3711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3712
|
+
import_components53.SegmentedControl,
|
|
3444
3713
|
{
|
|
3445
3714
|
name: `${id}-segmented-control`,
|
|
3446
3715
|
value: String(selectedIndex),
|
|
@@ -3456,14 +3725,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3456
3725
|
)
|
|
3457
3726
|
}
|
|
3458
3727
|
),
|
|
3459
|
-
/* @__PURE__ */ (0,
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { id: `${id}-children`, children })
|
|
3460
3729
|
] });
|
|
3461
3730
|
}
|
|
3462
3731
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3463
3732
|
|
|
3464
3733
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
3465
|
-
var
|
|
3466
|
-
var
|
|
3734
|
+
var import_components54 = require("@transferwise/components");
|
|
3735
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3467
3736
|
function RadioItemRendererComponent(props) {
|
|
3468
3737
|
const {
|
|
3469
3738
|
id,
|
|
@@ -3477,23 +3746,23 @@ function RadioItemRendererComponent(props) {
|
|
|
3477
3746
|
validationState,
|
|
3478
3747
|
onSelect
|
|
3479
3748
|
} = props;
|
|
3480
|
-
return /* @__PURE__ */ (0,
|
|
3481
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
3482
|
-
|
|
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,
|
|
3483
3752
|
{
|
|
3484
3753
|
as: "h2",
|
|
3485
|
-
title: help ? /* @__PURE__ */ (0,
|
|
3754
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
3486
3755
|
}
|
|
3487
3756
|
),
|
|
3488
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3490
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
3491
|
-
|
|
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,
|
|
3492
3761
|
__spreadValues({
|
|
3493
3762
|
title,
|
|
3494
3763
|
subtitle: description,
|
|
3495
|
-
control: /* @__PURE__ */ (0,
|
|
3496
|
-
|
|
3764
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3765
|
+
import_components54.ListItem.Radio,
|
|
3497
3766
|
{
|
|
3498
3767
|
name: title,
|
|
3499
3768
|
checked: selectedIndex === index,
|
|
@@ -3508,50 +3777,50 @@ function RadioItemRendererComponent(props) {
|
|
|
3508
3777
|
title
|
|
3509
3778
|
)
|
|
3510
3779
|
) }, `${id}-${selectedIndex}`),
|
|
3511
|
-
(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 }),
|
|
3512
3781
|
children
|
|
3513
3782
|
] });
|
|
3514
3783
|
}
|
|
3515
3784
|
|
|
3516
3785
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3517
|
-
var
|
|
3786
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3518
3787
|
var SelectInputRenderer = {
|
|
3519
3788
|
canRenderType: "input-select",
|
|
3520
3789
|
render: (props) => {
|
|
3521
3790
|
switch (props.control) {
|
|
3522
3791
|
case "radio":
|
|
3523
|
-
return /* @__PURE__ */ (0,
|
|
3792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3524
3793
|
case "radio-item":
|
|
3525
|
-
return /* @__PURE__ */ (0,
|
|
3794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
3526
3795
|
case "tab":
|
|
3527
|
-
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));
|
|
3528
3797
|
case "segmented":
|
|
3529
|
-
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));
|
|
3530
3799
|
case "select":
|
|
3531
3800
|
default:
|
|
3532
|
-
return /* @__PURE__ */ (0,
|
|
3801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3533
3802
|
}
|
|
3534
3803
|
}
|
|
3535
3804
|
};
|
|
3536
3805
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
3537
3806
|
|
|
3538
3807
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3539
|
-
var
|
|
3540
|
-
var
|
|
3808
|
+
var import_components55 = require("@transferwise/components");
|
|
3809
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3541
3810
|
var StatusListRenderer = {
|
|
3542
3811
|
canRenderType: "status-list",
|
|
3543
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
3544
|
-
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,
|
|
3545
3814
|
items.map((item) => {
|
|
3546
3815
|
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3547
|
-
return /* @__PURE__ */ (0,
|
|
3548
|
-
|
|
3816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3817
|
+
import_components55.ListItem,
|
|
3549
3818
|
{
|
|
3550
3819
|
title: itemTitle,
|
|
3551
3820
|
subtitle: description,
|
|
3552
|
-
media: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
3553
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
3554
|
-
|
|
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,
|
|
3555
3824
|
{
|
|
3556
3825
|
action: {
|
|
3557
3826
|
href: callToAction.href,
|
|
@@ -3581,12 +3850,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
3581
3850
|
|
|
3582
3851
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3583
3852
|
var import_components_theming = require("@wise/components-theming");
|
|
3584
|
-
var
|
|
3853
|
+
var import_react20 = require("react");
|
|
3585
3854
|
var ThemeRequiredEventName = "Theme Required";
|
|
3586
3855
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3587
3856
|
const theming = (0, import_components_theming.useTheme)();
|
|
3588
|
-
const previousTheme = (0,
|
|
3589
|
-
(0,
|
|
3857
|
+
const previousTheme = (0, import_react20.useMemo)(() => theming.theme, []);
|
|
3858
|
+
(0, import_react20.useEffect)(() => {
|
|
3590
3859
|
theming.setTheme(theme);
|
|
3591
3860
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3592
3861
|
return theme !== previousTheme ? () => {
|
|
@@ -3597,86 +3866,14 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
3597
3866
|
}, []);
|
|
3598
3867
|
};
|
|
3599
3868
|
|
|
3600
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3601
|
-
var import_components53 = require("@transferwise/components");
|
|
3602
|
-
var import_react19 = require("react");
|
|
3603
|
-
var import_react_intl25 = require("react-intl");
|
|
3604
|
-
|
|
3605
|
-
// ../renderers/src/messages/step.messages.ts
|
|
3606
|
-
var import_react_intl24 = require("react-intl");
|
|
3607
|
-
var step_messages_default = (0, import_react_intl24.defineMessages)({
|
|
3608
|
-
scrollToBottom: {
|
|
3609
|
-
id: "df.wise.step.scrollToBottom",
|
|
3610
|
-
defaultMessage: "Scroll to bottom",
|
|
3611
|
-
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."
|
|
3612
|
-
}
|
|
3613
|
-
});
|
|
3614
|
-
|
|
3615
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3616
|
-
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3617
|
-
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3618
|
-
var StepFooter = ({ footer, tags }) => {
|
|
3619
|
-
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3620
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FooterWithScrollButton, { footer });
|
|
3621
|
-
}
|
|
3622
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DefaultFooter, { footer });
|
|
3623
|
-
};
|
|
3624
|
-
var DefaultFooter = ({ footer }) => {
|
|
3625
|
-
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3626
|
-
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3627
|
-
};
|
|
3628
|
-
var FooterWithScrollButton = ({ footer }) => {
|
|
3629
|
-
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3630
|
-
const endOfLayoutRef = (0, import_react19.useRef)(null);
|
|
3631
|
-
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3632
|
-
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3633
|
-
import_components53.Button,
|
|
3634
|
-
{
|
|
3635
|
-
className: "m-b-1",
|
|
3636
|
-
v2: true,
|
|
3637
|
-
block: true,
|
|
3638
|
-
priority: "tertiary",
|
|
3639
|
-
onClick: () => {
|
|
3640
|
-
var _a;
|
|
3641
|
-
(_a = endOfLayoutRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
3642
|
-
},
|
|
3643
|
-
children: formatMessage(step_messages_default.scrollToBottom)
|
|
3644
|
-
}
|
|
3645
|
-
);
|
|
3646
|
-
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3647
|
-
if (isElementVisible && !hasStepFooterContent) {
|
|
3648
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3649
|
-
}
|
|
3650
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
3651
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3652
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3653
|
-
!isElementVisible && scrollButton,
|
|
3654
|
-
footer
|
|
3655
|
-
] })
|
|
3656
|
-
] });
|
|
3657
|
-
};
|
|
3658
|
-
var useIsElementVisible = (elementRef) => {
|
|
3659
|
-
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
3660
|
-
(0, import_react19.useEffect)(() => {
|
|
3661
|
-
const element = elementRef.current;
|
|
3662
|
-
if (!element) return;
|
|
3663
|
-
const observer = new IntersectionObserver(([entry]) => {
|
|
3664
|
-
setIsVisible(entry.isIntersecting);
|
|
3665
|
-
});
|
|
3666
|
-
observer.observe(element);
|
|
3667
|
-
return () => observer.disconnect();
|
|
3668
|
-
}, [elementRef]);
|
|
3669
|
-
return isVisible;
|
|
3670
|
-
};
|
|
3671
|
-
|
|
3672
3869
|
// ../renderers/src/step/StepHeader.tsx
|
|
3673
|
-
var
|
|
3674
|
-
var
|
|
3870
|
+
var import_components56 = require("@transferwise/components");
|
|
3871
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3675
3872
|
var StepHeader = ({ title, description, tags }) => {
|
|
3676
3873
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3677
|
-
return /* @__PURE__ */ (0,
|
|
3678
|
-
title ? /* @__PURE__ */ (0,
|
|
3679
|
-
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
|
|
3680
3877
|
] });
|
|
3681
3878
|
};
|
|
3682
3879
|
var getHeaderStyle = (tags) => {
|
|
@@ -3687,8 +3884,8 @@ var getHeaderStyle = (tags) => {
|
|
|
3687
3884
|
};
|
|
3688
3885
|
|
|
3689
3886
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3690
|
-
var
|
|
3691
|
-
var
|
|
3887
|
+
var import_components57 = require("@transferwise/components");
|
|
3888
|
+
var import_icons6 = require("@transferwise/icons");
|
|
3692
3889
|
var import_react_intl27 = require("react-intl");
|
|
3693
3890
|
|
|
3694
3891
|
// ../renderers/src/messages/back.messages.ts
|
|
@@ -3702,31 +3899,31 @@ var back_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
3702
3899
|
});
|
|
3703
3900
|
|
|
3704
3901
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3705
|
-
var
|
|
3902
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3706
3903
|
function BackButton({ title, onClick }) {
|
|
3707
3904
|
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
3708
|
-
return /* @__PURE__ */ (0,
|
|
3709
|
-
/* @__PURE__ */ (0,
|
|
3710
|
-
/* @__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, {})
|
|
3711
3908
|
] });
|
|
3712
3909
|
}
|
|
3713
3910
|
|
|
3714
3911
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3715
|
-
var
|
|
3716
|
-
var
|
|
3912
|
+
var import_components58 = require("@transferwise/components");
|
|
3913
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3717
3914
|
var Toolbar = ({ items }) => {
|
|
3718
|
-
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;
|
|
3719
3916
|
};
|
|
3720
3917
|
function ToolbarButton(props) {
|
|
3721
|
-
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));
|
|
3722
3919
|
}
|
|
3723
3920
|
function MediaToolbarButton(props) {
|
|
3724
3921
|
var _a;
|
|
3725
3922
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3726
3923
|
const priority = getIconButtonPriority(control);
|
|
3727
3924
|
const type = getSentiment2(context);
|
|
3728
|
-
return /* @__PURE__ */ (0,
|
|
3729
|
-
|
|
3925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
3926
|
+
import_components58.IconButton,
|
|
3730
3927
|
{
|
|
3731
3928
|
className: "df-toolbar-button",
|
|
3732
3929
|
disabled,
|
|
@@ -3735,7 +3932,7 @@ function MediaToolbarButton(props) {
|
|
|
3735
3932
|
type,
|
|
3736
3933
|
onClick,
|
|
3737
3934
|
children: [
|
|
3738
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
3935
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3739
3936
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3740
3937
|
]
|
|
3741
3938
|
}
|
|
@@ -3746,8 +3943,8 @@ function TextToolbarButton(props) {
|
|
|
3746
3943
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3747
3944
|
const priority = getPriority2(control);
|
|
3748
3945
|
const sentiment = getSentiment2(context);
|
|
3749
|
-
return /* @__PURE__ */ (0,
|
|
3750
|
-
|
|
3946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3947
|
+
import_components58.Button,
|
|
3751
3948
|
{
|
|
3752
3949
|
v2: true,
|
|
3753
3950
|
size: "sm",
|
|
@@ -3776,16 +3973,16 @@ var getIconButtonPriority = (control) => {
|
|
|
3776
3973
|
};
|
|
3777
3974
|
|
|
3778
3975
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3779
|
-
var
|
|
3976
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3780
3977
|
function TopBar({ back, toolbar }) {
|
|
3781
|
-
return back || toolbar ? /* @__PURE__ */ (0,
|
|
3782
|
-
back ? /* @__PURE__ */ (0,
|
|
3783
|
-
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
|
|
3784
3981
|
] }) : null;
|
|
3785
3982
|
}
|
|
3786
3983
|
|
|
3787
3984
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3788
|
-
var
|
|
3985
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3789
3986
|
var SplashCelebrationStepRenderer = {
|
|
3790
3987
|
canRenderType: "step",
|
|
3791
3988
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3794,16 +3991,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
3794
3991
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3795
3992
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
3796
3993
|
useCustomTheme("forest-green", trackEvent);
|
|
3797
|
-
return /* @__PURE__ */ (0,
|
|
3798
|
-
/* @__PURE__ */ (0,
|
|
3799
|
-
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,
|
|
3800
3997
|
children,
|
|
3801
|
-
/* @__PURE__ */ (0,
|
|
3998
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(StepFooter, { footer, tags })
|
|
3802
3999
|
] });
|
|
3803
4000
|
}
|
|
3804
4001
|
|
|
3805
4002
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3806
|
-
var
|
|
4003
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
3807
4004
|
var SplashStepRenderer = {
|
|
3808
4005
|
canRenderType: "step",
|
|
3809
4006
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3811,63 +4008,63 @@ var SplashStepRenderer = {
|
|
|
3811
4008
|
};
|
|
3812
4009
|
function SplashStepRendererComponent(props) {
|
|
3813
4010
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
3814
|
-
return /* @__PURE__ */ (0,
|
|
3815
|
-
/* @__PURE__ */ (0,
|
|
3816
|
-
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,
|
|
3817
4014
|
children,
|
|
3818
|
-
/* @__PURE__ */ (0,
|
|
4015
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(StepFooter, { footer, tags })
|
|
3819
4016
|
] });
|
|
3820
4017
|
}
|
|
3821
4018
|
|
|
3822
4019
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3823
|
-
var
|
|
3824
|
-
var
|
|
4020
|
+
var import_components59 = require("@transferwise/components");
|
|
4021
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3825
4022
|
var StepRenderer = {
|
|
3826
4023
|
canRenderType: "step",
|
|
3827
4024
|
render: StepRendererComponent
|
|
3828
4025
|
};
|
|
3829
4026
|
function StepRendererComponent(props) {
|
|
3830
4027
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
3831
|
-
return /* @__PURE__ */ (0,
|
|
3832
|
-
/* @__PURE__ */ (0,
|
|
3833
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3834
|
-
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,
|
|
3835
4032
|
children,
|
|
3836
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(StepFooter, { footer, tags })
|
|
3837
4034
|
] });
|
|
3838
4035
|
}
|
|
3839
4036
|
|
|
3840
4037
|
// ../renderers/src/TabsRenderer.tsx
|
|
3841
|
-
var
|
|
3842
|
-
var
|
|
3843
|
-
var
|
|
4038
|
+
var import_components60 = require("@transferwise/components");
|
|
4039
|
+
var import_react21 = require("react");
|
|
4040
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
3844
4041
|
var TabsRenderer = {
|
|
3845
4042
|
canRenderType: "tabs",
|
|
3846
4043
|
render: (props) => {
|
|
3847
4044
|
switch (props.control) {
|
|
3848
4045
|
case "segmented":
|
|
3849
4046
|
if (props.tabs.length > 3) {
|
|
3850
|
-
return /* @__PURE__ */ (0,
|
|
4047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3851
4048
|
}
|
|
3852
|
-
return /* @__PURE__ */ (0,
|
|
4049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3853
4050
|
case "chips":
|
|
3854
|
-
return /* @__PURE__ */ (0,
|
|
4051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3855
4052
|
default:
|
|
3856
|
-
return /* @__PURE__ */ (0,
|
|
4053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3857
4054
|
}
|
|
3858
4055
|
}
|
|
3859
4056
|
};
|
|
3860
4057
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3861
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3862
|
-
return /* @__PURE__ */ (0,
|
|
3863
|
-
|
|
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,
|
|
3864
4061
|
{
|
|
3865
4062
|
name: uid,
|
|
3866
4063
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
3867
4064
|
tabs: tabs.map((option) => ({
|
|
3868
4065
|
title: option.title,
|
|
3869
4066
|
disabled: false,
|
|
3870
|
-
content: /* @__PURE__ */ (0,
|
|
4067
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "m-t-2", children: [
|
|
3871
4068
|
" ",
|
|
3872
4069
|
option.children,
|
|
3873
4070
|
" "
|
|
@@ -3879,10 +4076,10 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3879
4076
|
}
|
|
3880
4077
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3881
4078
|
var _a;
|
|
3882
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3883
|
-
return /* @__PURE__ */ (0,
|
|
3884
|
-
/* @__PURE__ */ (0,
|
|
3885
|
-
|
|
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,
|
|
3886
4083
|
{
|
|
3887
4084
|
name: uid,
|
|
3888
4085
|
value: String(selectedIndex),
|
|
@@ -3896,31 +4093,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3896
4093
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3897
4094
|
}
|
|
3898
4095
|
),
|
|
3899
|
-
/* @__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 })
|
|
3900
4097
|
] });
|
|
3901
4098
|
}
|
|
3902
4099
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3903
4100
|
var _a;
|
|
3904
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3905
|
-
return /* @__PURE__ */ (0,
|
|
3906
|
-
/* @__PURE__ */ (0,
|
|
3907
|
-
|
|
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,
|
|
3908
4105
|
{
|
|
3909
4106
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3910
4107
|
selected: selectedIndex,
|
|
3911
4108
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3912
4109
|
}
|
|
3913
4110
|
) }),
|
|
3914
|
-
/* @__PURE__ */ (0,
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3915
4112
|
] });
|
|
3916
4113
|
}
|
|
3917
4114
|
|
|
3918
4115
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3919
|
-
var
|
|
4116
|
+
var import_components62 = require("@transferwise/components");
|
|
3920
4117
|
|
|
3921
4118
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
3922
|
-
var
|
|
3923
|
-
var
|
|
4119
|
+
var import_components61 = require("@transferwise/components");
|
|
4120
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
3924
4121
|
var commonKeys = [
|
|
3925
4122
|
"autoComplete",
|
|
3926
4123
|
"autoCapitalize",
|
|
@@ -3939,12 +4136,12 @@ function VariableTextInput(inputProps) {
|
|
|
3939
4136
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3940
4137
|
switch (control) {
|
|
3941
4138
|
case "email":
|
|
3942
|
-
return /* @__PURE__ */ (0,
|
|
4139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3943
4140
|
case "password":
|
|
3944
|
-
return /* @__PURE__ */ (0,
|
|
4141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3945
4142
|
case "numeric": {
|
|
3946
4143
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3947
|
-
return /* @__PURE__ */ (0,
|
|
4144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
3948
4145
|
TextInput,
|
|
3949
4146
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3950
4147
|
onChange: (newValue) => {
|
|
@@ -3955,21 +4152,21 @@ function VariableTextInput(inputProps) {
|
|
|
3955
4152
|
);
|
|
3956
4153
|
}
|
|
3957
4154
|
case "phone-number":
|
|
3958
|
-
return /* @__PURE__ */ (0,
|
|
4155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components61.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3959
4156
|
default: {
|
|
3960
|
-
return /* @__PURE__ */ (0,
|
|
4157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3961
4158
|
}
|
|
3962
4159
|
}
|
|
3963
4160
|
}
|
|
3964
4161
|
function TextInput(props) {
|
|
3965
4162
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3966
|
-
const InputWithPattern = control === "textarea" ?
|
|
3967
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
3968
|
-
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) }));
|
|
3969
4166
|
}
|
|
3970
4167
|
|
|
3971
4168
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3972
|
-
var
|
|
4169
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
3973
4170
|
var TextInputRenderer = {
|
|
3974
4171
|
canRenderType: "input-text",
|
|
3975
4172
|
render: (props) => {
|
|
@@ -4002,7 +4199,7 @@ var TextInputRenderer = {
|
|
|
4002
4199
|
}
|
|
4003
4200
|
}
|
|
4004
4201
|
});
|
|
4005
|
-
return /* @__PURE__ */ (0,
|
|
4202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4006
4203
|
FieldInput_default,
|
|
4007
4204
|
{
|
|
4008
4205
|
id,
|
|
@@ -4010,7 +4207,7 @@ var TextInputRenderer = {
|
|
|
4010
4207
|
description,
|
|
4011
4208
|
validation: validationState,
|
|
4012
4209
|
help,
|
|
4013
|
-
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)) })
|
|
4014
4211
|
}
|
|
4015
4212
|
);
|
|
4016
4213
|
}
|
|
@@ -4018,13 +4215,13 @@ var TextInputRenderer = {
|
|
|
4018
4215
|
var TextInputRenderer_default = TextInputRenderer;
|
|
4019
4216
|
|
|
4020
4217
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4021
|
-
var
|
|
4218
|
+
var import_components63 = require("@transferwise/components");
|
|
4022
4219
|
|
|
4023
4220
|
// ../renderers/src/utils/getRandomId.ts
|
|
4024
4221
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
4025
4222
|
|
|
4026
4223
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4027
|
-
var
|
|
4224
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4028
4225
|
var UploadInputRenderer = {
|
|
4029
4226
|
canRenderType: "input-upload",
|
|
4030
4227
|
render: (props) => {
|
|
@@ -4040,15 +4237,15 @@ var UploadInputRenderer = {
|
|
|
4040
4237
|
};
|
|
4041
4238
|
return (
|
|
4042
4239
|
// We don't pass help here as there is no sensible place to display it
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4044
4241
|
UploadFieldInput_default,
|
|
4045
4242
|
{
|
|
4046
4243
|
id,
|
|
4047
4244
|
label: void 0,
|
|
4048
4245
|
description: void 0,
|
|
4049
4246
|
validation: validationState,
|
|
4050
|
-
children: /* @__PURE__ */ (0,
|
|
4051
|
-
|
|
4247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4248
|
+
import_components63.UploadInput,
|
|
4052
4249
|
{
|
|
4053
4250
|
id,
|
|
4054
4251
|
description,
|
|
@@ -4058,7 +4255,7 @@ var UploadInputRenderer = {
|
|
|
4058
4255
|
{
|
|
4059
4256
|
id: "my-file",
|
|
4060
4257
|
filename: value.name,
|
|
4061
|
-
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
|
|
4062
4259
|
}
|
|
4063
4260
|
] : void 0,
|
|
4064
4261
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -4113,7 +4310,7 @@ var LargeUploadRenderer = {
|
|
|
4113
4310
|
};
|
|
4114
4311
|
const filetypes = acceptsToFileTypes(accepts);
|
|
4115
4312
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
4116
|
-
return /* @__PURE__ */ (0,
|
|
4313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4117
4314
|
FieldInput_default,
|
|
4118
4315
|
{
|
|
4119
4316
|
id,
|
|
@@ -4121,8 +4318,8 @@ var LargeUploadRenderer = {
|
|
|
4121
4318
|
description,
|
|
4122
4319
|
validation: validationState,
|
|
4123
4320
|
help,
|
|
4124
|
-
children: /* @__PURE__ */ (0,
|
|
4125
|
-
|
|
4321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4322
|
+
import_components63.Upload,
|
|
4126
4323
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4127
4324
|
usAccept,
|
|
4128
4325
|
usDisabled: disabled,
|
|
@@ -4137,18 +4334,18 @@ var LargeUploadRenderer = {
|
|
|
4137
4334
|
};
|
|
4138
4335
|
|
|
4139
4336
|
// ../renderers/src/UpsellRenderer.tsx
|
|
4140
|
-
var
|
|
4141
|
-
var
|
|
4142
|
-
var
|
|
4337
|
+
var import_components64 = require("@transferwise/components");
|
|
4338
|
+
var import_react22 = require("react");
|
|
4339
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4143
4340
|
var UpsellRenderer = {
|
|
4144
4341
|
canRenderType: "upsell",
|
|
4145
4342
|
render: UpsellRendererComponent
|
|
4146
4343
|
};
|
|
4147
4344
|
function UpsellRendererComponent(props) {
|
|
4148
4345
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
4149
|
-
const [isVisible, setIsVisible] = (0,
|
|
4150
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
4151
|
-
|
|
4346
|
+
const [isVisible, setIsVisible] = (0, import_react22.useState)(true);
|
|
4347
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4348
|
+
import_components64.Nudge,
|
|
4152
4349
|
{
|
|
4153
4350
|
className: getMargin(margin),
|
|
4154
4351
|
mediaName: getMediaName(media),
|
|
@@ -4197,9 +4394,9 @@ var supportedMediaNames = [
|
|
|
4197
4394
|
];
|
|
4198
4395
|
|
|
4199
4396
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
4200
|
-
var
|
|
4397
|
+
var import_components65 = require("@transferwise/components");
|
|
4201
4398
|
var import_classnames7 = __toESM(require_classnames());
|
|
4202
|
-
var
|
|
4399
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
4203
4400
|
var CircularButtonRenderer = {
|
|
4204
4401
|
canRenderType: "button",
|
|
4205
4402
|
canRender: ({ control }) => control === "circular",
|
|
@@ -4209,8 +4406,8 @@ function CircularButtonComponent(props) {
|
|
|
4209
4406
|
var _a;
|
|
4210
4407
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
4211
4408
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
4212
|
-
return /* @__PURE__ */ (0,
|
|
4213
|
-
|
|
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,
|
|
4214
4411
|
{
|
|
4215
4412
|
disabled,
|
|
4216
4413
|
priority: priority != null ? priority : "secondary",
|
|
@@ -4229,6 +4426,7 @@ var getWiseRenderers = () => [
|
|
|
4229
4426
|
CheckboxInputRenderer_default,
|
|
4230
4427
|
CircularButtonRenderer,
|
|
4231
4428
|
BoxRenderer_default,
|
|
4429
|
+
CollectionRenderer_default,
|
|
4232
4430
|
ButtonRenderer,
|
|
4233
4431
|
ColumnsRenderer_default,
|
|
4234
4432
|
DateInputRenderer_default,
|
|
@@ -4272,13 +4470,13 @@ var getWiseRenderers = () => [
|
|
|
4272
4470
|
];
|
|
4273
4471
|
|
|
4274
4472
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
4275
|
-
var
|
|
4276
|
-
var
|
|
4473
|
+
var import_components66 = require("@transferwise/components");
|
|
4474
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4277
4475
|
var InitialLoadingStateRenderer = {
|
|
4278
4476
|
canRenderType: "loading-state",
|
|
4279
4477
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
4280
|
-
render: () => /* @__PURE__ */ (0,
|
|
4281
|
-
|
|
4478
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
4479
|
+
import_components66.Loader,
|
|
4282
4480
|
{
|
|
4283
4481
|
size: "md",
|
|
4284
4482
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
|
|
@@ -4288,7 +4486,7 @@ var InitialLoadingStateRenderer = {
|
|
|
4288
4486
|
};
|
|
4289
4487
|
|
|
4290
4488
|
// ../renderers/src/subflow/getSubflowRenderer.tsx
|
|
4291
|
-
var
|
|
4489
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
4292
4490
|
var getSubflowRenderer = ({
|
|
4293
4491
|
Component: Component2,
|
|
4294
4492
|
canRender
|
|
@@ -4297,7 +4495,7 @@ var getSubflowRenderer = ({
|
|
|
4297
4495
|
canRenderType: "subflow",
|
|
4298
4496
|
canRender,
|
|
4299
4497
|
render: (props) => {
|
|
4300
|
-
return /* @__PURE__ */ (0,
|
|
4498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
4301
4499
|
Component2,
|
|
4302
4500
|
{
|
|
4303
4501
|
presentation: props.presentation,
|
|
@@ -4315,7 +4513,7 @@ var getSubflowRenderer = ({
|
|
|
4315
4513
|
};
|
|
4316
4514
|
|
|
4317
4515
|
// src/dynamicFlow/useOnCopy.tsx
|
|
4318
|
-
var
|
|
4516
|
+
var import_react23 = require("react");
|
|
4319
4517
|
var import_react_intl29 = require("react-intl");
|
|
4320
4518
|
|
|
4321
4519
|
// src/dynamicFlow/messages.ts
|
|
@@ -4337,7 +4535,7 @@ var messages_default = (0, import_react_intl28.defineMessages)({
|
|
|
4337
4535
|
var useOnCopy = () => {
|
|
4338
4536
|
const { formatMessage } = (0, import_react_intl29.useIntl)();
|
|
4339
4537
|
const createSnackBar = useSnackBarIfAvailable();
|
|
4340
|
-
return (0,
|
|
4538
|
+
return (0, import_react23.useCallback)(
|
|
4341
4539
|
(copiedContent) => {
|
|
4342
4540
|
if (copiedContent) {
|
|
4343
4541
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -4350,11 +4548,11 @@ var useOnCopy = () => {
|
|
|
4350
4548
|
};
|
|
4351
4549
|
|
|
4352
4550
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
4353
|
-
var
|
|
4551
|
+
var import_react24 = require("react");
|
|
4354
4552
|
var import_react_intl30 = require("react-intl");
|
|
4355
4553
|
var useWiseHttpClient = (httpClient) => {
|
|
4356
4554
|
const { locale } = (0, import_react_intl30.useIntl)();
|
|
4357
|
-
return (0,
|
|
4555
|
+
return (0, import_react24.useCallback)(
|
|
4358
4556
|
async (input, init = {}) => {
|
|
4359
4557
|
const headers = new Headers(init.headers);
|
|
4360
4558
|
headers.set("accept-language", locale);
|
|
@@ -4377,25 +4575,25 @@ var handleRejection = (error) => {
|
|
|
4377
4575
|
|
|
4378
4576
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
4379
4577
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
4380
|
-
var
|
|
4381
|
-
var
|
|
4578
|
+
var import_components67 = require("@transferwise/components");
|
|
4579
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
4382
4580
|
function DynamicFlowModal(props) {
|
|
4383
4581
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
4384
4582
|
const dfProps = useWiseToCoreProps(rest);
|
|
4385
4583
|
const df = (0, import_dynamic_flow_client2.useDynamicFlowModal)(dfProps);
|
|
4386
|
-
return /* @__PURE__ */ (0,
|
|
4387
|
-
|
|
4584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
4585
|
+
import_components67.Modal,
|
|
4388
4586
|
__spreadProps(__spreadValues({
|
|
4389
4587
|
className: `dynamic-flow-modal ${className}`,
|
|
4390
4588
|
disableDimmerClickToClose: true
|
|
4391
4589
|
}, df.modal), {
|
|
4392
|
-
body: /* @__PURE__ */ (0,
|
|
4590
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
4393
4591
|
})
|
|
4394
4592
|
);
|
|
4395
4593
|
}
|
|
4396
4594
|
|
|
4397
4595
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
4398
|
-
var
|
|
4596
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
4399
4597
|
var wiseRenderers = getWiseRenderers();
|
|
4400
4598
|
var getMergedRenderers = (props) => {
|
|
4401
4599
|
var _d, _e;
|
|
@@ -4409,7 +4607,7 @@ var getMergedRenderers = (props) => {
|
|
|
4409
4607
|
method: initialRequest.method,
|
|
4410
4608
|
data: initialRequest.body
|
|
4411
4609
|
};
|
|
4412
|
-
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)(
|
|
4413
4611
|
DynamicFlowModal,
|
|
4414
4612
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
4415
4613
|
features: subflowFeatures,
|
|
@@ -4435,9 +4633,9 @@ var useWiseToCoreProps = (props) => {
|
|
|
4435
4633
|
onLog
|
|
4436
4634
|
} = props;
|
|
4437
4635
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4438
|
-
const mergedRenderers = (0,
|
|
4439
|
-
const logEvent = (0,
|
|
4440
|
-
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]);
|
|
4441
4639
|
const onCopy = useOnCopy();
|
|
4442
4640
|
return __spreadProps(__spreadValues({}, props), {
|
|
4443
4641
|
httpClient,
|
|
@@ -4468,27 +4666,27 @@ var openLinkInNewTab = (url) => {
|
|
|
4468
4666
|
};
|
|
4469
4667
|
|
|
4470
4668
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4471
|
-
var
|
|
4669
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
4472
4670
|
function DynamicFlow(props) {
|
|
4473
4671
|
const { className = "" } = props;
|
|
4474
4672
|
const dfProps = useWiseToCoreProps(props);
|
|
4475
4673
|
const df = (0, import_dynamic_flow_client3.useDynamicFlow)(dfProps);
|
|
4476
4674
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
4477
|
-
return /* @__PURE__ */ (0,
|
|
4675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className, onContextMenu, children: [
|
|
4478
4676
|
df.view,
|
|
4479
4677
|
contextMenu
|
|
4480
4678
|
] });
|
|
4481
4679
|
}
|
|
4482
4680
|
|
|
4483
4681
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
4484
|
-
var
|
|
4682
|
+
var import_react26 = require("react");
|
|
4485
4683
|
var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
4486
|
-
var
|
|
4487
|
-
var DynamicFlowWithRef = (0,
|
|
4684
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
4685
|
+
var DynamicFlowWithRef = (0, import_react26.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
4488
4686
|
const { className = "" } = props;
|
|
4489
4687
|
const dfProps = useWiseToCoreProps(props);
|
|
4490
4688
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
4491
|
-
(0,
|
|
4689
|
+
(0, import_react26.useImperativeHandle)(
|
|
4492
4690
|
ref,
|
|
4493
4691
|
() => ({
|
|
4494
4692
|
getValue: async () => {
|
|
@@ -4499,14 +4697,14 @@ var DynamicFlowWithRef = (0, import_react25.forwardRef)(function DynamicFlowWith
|
|
|
4499
4697
|
}),
|
|
4500
4698
|
[df]
|
|
4501
4699
|
);
|
|
4502
|
-
return /* @__PURE__ */ (0,
|
|
4700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className, children: df.view });
|
|
4503
4701
|
});
|
|
4504
4702
|
|
|
4505
4703
|
// src/index.ts
|
|
4506
4704
|
var import_dynamic_flow_client7 = require("@wise/dynamic-flow-client");
|
|
4507
4705
|
|
|
4508
4706
|
// src/dynamicFlow/renderers.tsx
|
|
4509
|
-
var Header10 =
|
|
4707
|
+
var Header10 = Header;
|
|
4510
4708
|
var Media2 = Media;
|
|
4511
4709
|
var getMargin2 = getMargin;
|
|
4512
4710
|
|