@wise/dynamic-flow-client-internal 5.14.0-experimental-9fc0bf0 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.mjs
CHANGED
|
@@ -123,7 +123,7 @@ import { useDynamicFlow } from "@wise/dynamic-flow-client";
|
|
|
123
123
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
124
124
|
var appVersion = (
|
|
125
125
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
126
|
-
typeof process !== "undefined" ? "5.14.0
|
|
126
|
+
typeof process !== "undefined" ? "5.14.0" : "0.0.0"
|
|
127
127
|
);
|
|
128
128
|
|
|
129
129
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -178,21 +178,25 @@ var useMenuPosition = () => {
|
|
|
178
178
|
|
|
179
179
|
// src/dynamicFlow/context-menu/useDFContextMenu.tsx
|
|
180
180
|
var useDFContextMenu = (controller) => {
|
|
181
|
+
const getCurrentStep = () => {
|
|
182
|
+
const step = controller.getCurrentStep();
|
|
183
|
+
return step ? recursivelyRemoveNullish(step) : null;
|
|
184
|
+
};
|
|
181
185
|
const getCurrentStepWithModel = async () => {
|
|
182
186
|
const step = controller.getCurrentStep();
|
|
183
187
|
if (!step) {
|
|
184
188
|
return null;
|
|
185
189
|
}
|
|
186
190
|
const model = await controller.getSubmittableValue();
|
|
187
|
-
return __spreadProps(__spreadValues({}, step), { model });
|
|
191
|
+
return recursivelyRemoveNullish(__spreadProps(__spreadValues({}, step), { model }));
|
|
188
192
|
};
|
|
189
193
|
const getEncodedCurrentStep = () => {
|
|
190
|
-
const step =
|
|
191
|
-
return step ? toBase64(JSON.stringify(
|
|
194
|
+
const step = getCurrentStep();
|
|
195
|
+
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
192
196
|
};
|
|
193
197
|
const getEncodedCurrentStepWithModel = async () => {
|
|
194
198
|
const step = await getCurrentStepWithModel();
|
|
195
|
-
return step ? toBase64(JSON.stringify(
|
|
199
|
+
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
196
200
|
};
|
|
197
201
|
return useContextMenu({
|
|
198
202
|
title: "DynamicFlow Menu (Dev/Staging only)",
|
|
@@ -200,7 +204,7 @@ var useDFContextMenu = (controller) => {
|
|
|
200
204
|
{
|
|
201
205
|
label: `DF client version: ${appVersion}`,
|
|
202
206
|
onClick: () => {
|
|
203
|
-
|
|
207
|
+
openVersionPage(appVersion);
|
|
204
208
|
}
|
|
205
209
|
},
|
|
206
210
|
{
|
|
@@ -218,7 +222,7 @@ var useDFContextMenu = (controller) => {
|
|
|
218
222
|
{
|
|
219
223
|
label: "Copy step JSON",
|
|
220
224
|
onClick: () => {
|
|
221
|
-
copyToClipboard(
|
|
225
|
+
copyToClipboard(getCurrentStep());
|
|
222
226
|
}
|
|
223
227
|
},
|
|
224
228
|
{
|
|
@@ -237,8 +241,27 @@ var toBase64 = (str) => {
|
|
|
237
241
|
};
|
|
238
242
|
var openInSandbox = (base64Step) => {
|
|
239
243
|
if (base64Step) {
|
|
240
|
-
window.open(`https://df.wise.com/sandbox#${base64Step}`, "_blank");
|
|
244
|
+
window.open(`https://df.wise.com/sandbox#${base64Step}`, "_blank", "noopener,noreferrer");
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
var openVersionPage = (version) => {
|
|
248
|
+
const changelogUrl = getGitHubChangelogUrl(version);
|
|
249
|
+
if (changelogUrl) {
|
|
250
|
+
window.open(changelogUrl, "_blank", "noopener,noreferrer");
|
|
251
|
+
} else {
|
|
252
|
+
window.open(getNpmPackageUrl(version), "_blank", "noopener,noreferrer");
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
var getGitHubChangelogUrl = (version) => {
|
|
256
|
+
const semverRegex = /^\d+\.\d+\.\d+$/;
|
|
257
|
+
if (semverRegex.test(version)) {
|
|
258
|
+
const hash = version.replace(/\./g, "");
|
|
259
|
+
return `https://github.com/transferwise/dynamic-flow/blob/main/web/wise/CHANGELOG.md#${hash}`;
|
|
241
260
|
}
|
|
261
|
+
return void 0;
|
|
262
|
+
};
|
|
263
|
+
var getNpmPackageUrl = (version) => {
|
|
264
|
+
return `https://www.npmjs.com/package/@wise/dynamic-flow-client-internal/v/${version}`;
|
|
242
265
|
};
|
|
243
266
|
var copyToClipboard = (value) => {
|
|
244
267
|
if (typeof value === "string") {
|
|
@@ -266,15 +289,17 @@ var isDevOrStaging = () => {
|
|
|
266
289
|
return false;
|
|
267
290
|
}
|
|
268
291
|
};
|
|
269
|
-
var
|
|
292
|
+
var recursivelyRemoveNullish = (element) => {
|
|
270
293
|
if (Array.isArray(element)) {
|
|
271
|
-
return element.map(
|
|
294
|
+
return element.map(recursivelyRemoveNullish);
|
|
272
295
|
}
|
|
273
296
|
if (element !== null && typeof element === "object") {
|
|
274
|
-
return Object.entries(element).reduce(
|
|
275
|
-
(
|
|
276
|
-
|
|
277
|
-
|
|
297
|
+
return Object.entries(element).reduce((acc, [key, value]) => {
|
|
298
|
+
if (value !== null && value !== void 0) {
|
|
299
|
+
acc[key] = recursivelyRemoveNullish(value);
|
|
300
|
+
}
|
|
301
|
+
return acc;
|
|
302
|
+
}, {});
|
|
278
303
|
}
|
|
279
304
|
return element;
|
|
280
305
|
};
|
|
@@ -2235,10 +2260,10 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
2235
2260
|
}
|
|
2236
2261
|
}
|
|
2237
2262
|
|
|
2238
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2263
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
2239
2264
|
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
2240
2265
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2241
|
-
function
|
|
2266
|
+
function InlineComponent(props) {
|
|
2242
2267
|
const {
|
|
2243
2268
|
id,
|
|
2244
2269
|
description,
|
|
@@ -2300,7 +2325,7 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2300
2325
|
);
|
|
2301
2326
|
}
|
|
2302
2327
|
|
|
2303
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2328
|
+
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2304
2329
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
2305
2330
|
import { useState as useState8 } from "react";
|
|
2306
2331
|
import { useIntl as useIntl7 } from "react-intl";
|
|
@@ -2315,9 +2340,9 @@ var multi_select_messages_default = defineMessages6({
|
|
|
2315
2340
|
}
|
|
2316
2341
|
});
|
|
2317
2342
|
|
|
2318
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2343
|
+
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
2319
2344
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2320
|
-
function
|
|
2345
|
+
function DefaultComponent(props) {
|
|
2321
2346
|
const { formatMessage } = useIntl7();
|
|
2322
2347
|
const [stagedIndices, setStagedIndices] = useState8();
|
|
2323
2348
|
const {
|
|
@@ -2408,12 +2433,68 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2408
2433
|
);
|
|
2409
2434
|
}
|
|
2410
2435
|
|
|
2411
|
-
// ../renderers/src/MultiSelectInputRenderer/
|
|
2436
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
2437
|
+
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
2412
2438
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2439
|
+
function InlineCheckboxComponent(props) {
|
|
2440
|
+
const {
|
|
2441
|
+
id,
|
|
2442
|
+
description,
|
|
2443
|
+
disabled,
|
|
2444
|
+
help,
|
|
2445
|
+
options,
|
|
2446
|
+
selectedIndices,
|
|
2447
|
+
title,
|
|
2448
|
+
validationState,
|
|
2449
|
+
onSelect
|
|
2450
|
+
} = props;
|
|
2451
|
+
return /* @__PURE__ */ jsx55(
|
|
2452
|
+
FieldInput_default,
|
|
2453
|
+
{
|
|
2454
|
+
id,
|
|
2455
|
+
label: title,
|
|
2456
|
+
help,
|
|
2457
|
+
description,
|
|
2458
|
+
validation: validationState,
|
|
2459
|
+
children: options.map((option, index) => {
|
|
2460
|
+
var _a;
|
|
2461
|
+
const {
|
|
2462
|
+
title: label,
|
|
2463
|
+
description: secondary,
|
|
2464
|
+
disabled: optionDisabled,
|
|
2465
|
+
childrenProps
|
|
2466
|
+
} = option;
|
|
2467
|
+
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2468
|
+
const checkboxProps = {
|
|
2469
|
+
id,
|
|
2470
|
+
label,
|
|
2471
|
+
secondary,
|
|
2472
|
+
checked: selectedIndices.includes(index),
|
|
2473
|
+
disabled: disabled || optionDisabled,
|
|
2474
|
+
onChange: () => {
|
|
2475
|
+
const newSelectedIndices = selectedIndices.includes(index) ? selectedIndices.filter((i) => i !== index) : [...selectedIndices, index];
|
|
2476
|
+
onSelect(newSelectedIndices);
|
|
2477
|
+
}
|
|
2478
|
+
};
|
|
2479
|
+
return /* @__PURE__ */ jsx55(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
2480
|
+
})
|
|
2481
|
+
}
|
|
2482
|
+
);
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2486
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2413
2487
|
var MultiSelectInputRenderer = {
|
|
2414
2488
|
canRenderType: "input-multi-select",
|
|
2415
2489
|
render: (props) => {
|
|
2416
|
-
|
|
2490
|
+
switch (props.control) {
|
|
2491
|
+
case "inline":
|
|
2492
|
+
return /* @__PURE__ */ jsx56(InlineComponent, __spreadValues({}, props));
|
|
2493
|
+
case "inline-checkbox-group":
|
|
2494
|
+
return /* @__PURE__ */ jsx56(InlineCheckboxComponent, __spreadValues({}, props));
|
|
2495
|
+
default:
|
|
2496
|
+
return /* @__PURE__ */ jsx56(DefaultComponent, __spreadValues({}, props));
|
|
2497
|
+
}
|
|
2417
2498
|
}
|
|
2418
2499
|
};
|
|
2419
2500
|
|
|
@@ -2423,7 +2504,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
2423
2504
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2424
2505
|
var import_classnames4 = __toESM(require_classnames());
|
|
2425
2506
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
2426
|
-
import { jsx as
|
|
2507
|
+
import { jsx as jsx57, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2427
2508
|
function UploadFieldInput({
|
|
2428
2509
|
id,
|
|
2429
2510
|
children,
|
|
@@ -2432,7 +2513,7 @@ function UploadFieldInput({
|
|
|
2432
2513
|
help,
|
|
2433
2514
|
validation
|
|
2434
2515
|
}) {
|
|
2435
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
2516
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx57(LabelContentWithHelp, { text: label, help }) : label;
|
|
2436
2517
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2437
2518
|
return /* @__PURE__ */ jsxs12(
|
|
2438
2519
|
"div",
|
|
@@ -2441,9 +2522,9 @@ function UploadFieldInput({
|
|
|
2441
2522
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2442
2523
|
}),
|
|
2443
2524
|
children: [
|
|
2444
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ jsx57("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2445
2526
|
children,
|
|
2446
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
2527
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx57(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
2447
2528
|
]
|
|
2448
2529
|
}
|
|
2449
2530
|
);
|
|
@@ -2478,7 +2559,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2478
2559
|
};
|
|
2479
2560
|
|
|
2480
2561
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2481
|
-
import { jsx as
|
|
2562
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2482
2563
|
var MultiUploadInputRenderer = {
|
|
2483
2564
|
canRenderType: "input-upload-multi",
|
|
2484
2565
|
render: (props) => {
|
|
@@ -2503,7 +2584,7 @@ var MultiUploadInputRenderer = {
|
|
|
2503
2584
|
};
|
|
2504
2585
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2505
2586
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2506
|
-
return /* @__PURE__ */
|
|
2587
|
+
return /* @__PURE__ */ jsx58(
|
|
2507
2588
|
UploadFieldInput_default,
|
|
2508
2589
|
{
|
|
2509
2590
|
id,
|
|
@@ -2511,7 +2592,7 @@ var MultiUploadInputRenderer = {
|
|
|
2511
2592
|
description,
|
|
2512
2593
|
validation: validationState,
|
|
2513
2594
|
help,
|
|
2514
|
-
children: /* @__PURE__ */
|
|
2595
|
+
children: /* @__PURE__ */ jsx58(
|
|
2515
2596
|
UploadInput,
|
|
2516
2597
|
{
|
|
2517
2598
|
id,
|
|
@@ -2540,7 +2621,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
2540
2621
|
|
|
2541
2622
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2542
2623
|
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
2543
|
-
import { jsx as
|
|
2624
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2544
2625
|
var NumberInputRenderer = {
|
|
2545
2626
|
canRenderType: "input-number",
|
|
2546
2627
|
render: (props) => {
|
|
@@ -2554,7 +2635,7 @@ var NumberInputRenderer = {
|
|
|
2554
2635
|
"maximum",
|
|
2555
2636
|
"minimum"
|
|
2556
2637
|
);
|
|
2557
|
-
return /* @__PURE__ */
|
|
2638
|
+
return /* @__PURE__ */ jsx59(
|
|
2558
2639
|
FieldInput_default,
|
|
2559
2640
|
{
|
|
2560
2641
|
id,
|
|
@@ -2562,7 +2643,7 @@ var NumberInputRenderer = {
|
|
|
2562
2643
|
description,
|
|
2563
2644
|
validation: validationState,
|
|
2564
2645
|
help,
|
|
2565
|
-
children: /* @__PURE__ */
|
|
2646
|
+
children: /* @__PURE__ */ jsx59(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx59(
|
|
2566
2647
|
Input2,
|
|
2567
2648
|
__spreadValues({
|
|
2568
2649
|
id,
|
|
@@ -2614,14 +2695,14 @@ var paragraph_messages_default = defineMessages7({
|
|
|
2614
2695
|
});
|
|
2615
2696
|
|
|
2616
2697
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2617
|
-
import { jsx as
|
|
2698
|
+
import { jsx as jsx60, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2618
2699
|
var ParagraphRenderer = {
|
|
2619
2700
|
canRenderType: "paragraph",
|
|
2620
|
-
render: (props) => /* @__PURE__ */
|
|
2701
|
+
render: (props) => /* @__PURE__ */ jsx60(Paragraph, __spreadValues({}, props))
|
|
2621
2702
|
};
|
|
2622
2703
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2623
2704
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2624
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2705
|
+
return control === "copyable" ? /* @__PURE__ */ jsx60(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx60(
|
|
2625
2706
|
"p",
|
|
2626
2707
|
{
|
|
2627
2708
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2642,7 +2723,7 @@ function CopyableParagraph({
|
|
|
2642
2723
|
};
|
|
2643
2724
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2644
2725
|
return /* @__PURE__ */ jsxs13("div", { className, children: [
|
|
2645
|
-
/* @__PURE__ */
|
|
2726
|
+
/* @__PURE__ */ jsx60(
|
|
2646
2727
|
Input3,
|
|
2647
2728
|
{
|
|
2648
2729
|
type: "text",
|
|
@@ -2651,23 +2732,23 @@ function CopyableParagraph({
|
|
|
2651
2732
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
2652
2733
|
}
|
|
2653
2734
|
),
|
|
2654
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ jsx60(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2655
2736
|
] });
|
|
2656
2737
|
}
|
|
2657
2738
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2658
2739
|
|
|
2659
2740
|
// ../renderers/src/ProgressRenderer.tsx
|
|
2660
2741
|
import { ProgressBar } from "@transferwise/components";
|
|
2661
|
-
import { jsx as
|
|
2742
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2662
2743
|
var ProgressRenderer = {
|
|
2663
2744
|
canRenderType: "progress",
|
|
2664
2745
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2665
|
-
return /* @__PURE__ */
|
|
2746
|
+
return /* @__PURE__ */ jsx61(
|
|
2666
2747
|
ProgressBar,
|
|
2667
2748
|
{
|
|
2668
2749
|
id: uid,
|
|
2669
2750
|
className: getMargin(margin),
|
|
2670
|
-
title: title && help ? /* @__PURE__ */
|
|
2751
|
+
title: title && help ? /* @__PURE__ */ jsx61(LabelContentWithHelp, { text: title, help }) : title,
|
|
2671
2752
|
description,
|
|
2672
2753
|
progress: {
|
|
2673
2754
|
max: 1,
|
|
@@ -2712,10 +2793,10 @@ var repeatable_messages_default = defineMessages8({
|
|
|
2712
2793
|
});
|
|
2713
2794
|
|
|
2714
2795
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2715
|
-
import { Fragment as Fragment5, jsx as
|
|
2796
|
+
import { Fragment as Fragment5, jsx as jsx62, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2716
2797
|
var RepeatableRenderer = {
|
|
2717
2798
|
canRenderType: "repeatable",
|
|
2718
|
-
render: (props) => /* @__PURE__ */
|
|
2799
|
+
render: (props) => /* @__PURE__ */ jsx62(Repeatable, __spreadValues({}, props))
|
|
2719
2800
|
};
|
|
2720
2801
|
function Repeatable(props) {
|
|
2721
2802
|
const {
|
|
@@ -2755,8 +2836,8 @@ function Repeatable(props) {
|
|
|
2755
2836
|
setOpenModalType(null);
|
|
2756
2837
|
};
|
|
2757
2838
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2758
|
-
title && /* @__PURE__ */
|
|
2759
|
-
description && /* @__PURE__ */
|
|
2839
|
+
title && /* @__PURE__ */ jsx62(Header6, { title }),
|
|
2840
|
+
description && /* @__PURE__ */ jsx62("p", { children: description }),
|
|
2760
2841
|
/* @__PURE__ */ jsxs14(
|
|
2761
2842
|
"div",
|
|
2762
2843
|
{
|
|
@@ -2764,30 +2845,30 @@ function Repeatable(props) {
|
|
|
2764
2845
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2765
2846
|
}),
|
|
2766
2847
|
children: [
|
|
2767
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2768
|
-
/* @__PURE__ */
|
|
2848
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx62(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2849
|
+
/* @__PURE__ */ jsx62(
|
|
2769
2850
|
NavigationOption,
|
|
2770
2851
|
{
|
|
2771
|
-
media: /* @__PURE__ */
|
|
2852
|
+
media: /* @__PURE__ */ jsx62(Plus, {}),
|
|
2772
2853
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2773
2854
|
showMediaAtAllSizes: true,
|
|
2774
2855
|
onClick: () => onAddItem()
|
|
2775
2856
|
}
|
|
2776
2857
|
),
|
|
2777
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2858
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx62(InlineAlert3, { type: "negative", children: validationState.message })
|
|
2778
2859
|
]
|
|
2779
2860
|
}
|
|
2780
2861
|
),
|
|
2781
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ jsx62(
|
|
2782
2863
|
Modal4,
|
|
2783
2864
|
{
|
|
2784
2865
|
open: openModalType !== null,
|
|
2785
2866
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2786
2867
|
body: /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2787
|
-
/* @__PURE__ */
|
|
2868
|
+
/* @__PURE__ */ jsx62("div", { className: "m-b-2", children: editableItem }),
|
|
2788
2869
|
/* @__PURE__ */ jsxs14("div", { children: [
|
|
2789
|
-
/* @__PURE__ */
|
|
2790
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ jsx62(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2871
|
+
/* @__PURE__ */ jsx62(
|
|
2791
2872
|
Button6,
|
|
2792
2873
|
{
|
|
2793
2874
|
v2: true,
|
|
@@ -2809,10 +2890,10 @@ function ItemSummaryOption({
|
|
|
2809
2890
|
item,
|
|
2810
2891
|
onClick
|
|
2811
2892
|
}) {
|
|
2812
|
-
return /* @__PURE__ */
|
|
2893
|
+
return /* @__PURE__ */ jsx62(
|
|
2813
2894
|
NavigationOption,
|
|
2814
2895
|
{
|
|
2815
|
-
media: /* @__PURE__ */
|
|
2896
|
+
media: /* @__PURE__ */ jsx62(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2816
2897
|
title: item.title,
|
|
2817
2898
|
content: item.description,
|
|
2818
2899
|
showMediaAtAllSizes: true,
|
|
@@ -2825,14 +2906,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
2825
2906
|
|
|
2826
2907
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2827
2908
|
import { DefinitionList } from "@transferwise/components";
|
|
2828
|
-
import { Fragment as Fragment6, jsx as
|
|
2909
|
+
import { Fragment as Fragment6, jsx as jsx63, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2829
2910
|
var ReviewRenderer = {
|
|
2830
2911
|
canRenderType: "review",
|
|
2831
2912
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2832
2913
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2833
2914
|
return /* @__PURE__ */ jsxs15("div", { className: getMargin(margin), children: [
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2915
|
+
/* @__PURE__ */ jsx63(Header5, { title, callToAction }),
|
|
2916
|
+
/* @__PURE__ */ jsx63("div", { className: margin, children: /* @__PURE__ */ jsx63(
|
|
2836
2917
|
DefinitionList,
|
|
2837
2918
|
{
|
|
2838
2919
|
layout: orientation,
|
|
@@ -2873,7 +2954,7 @@ var getFieldLabel = (label, help, onClick) => {
|
|
|
2873
2954
|
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
2874
2955
|
label,
|
|
2875
2956
|
" ",
|
|
2876
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ jsx63(Help_default, { help, onClick })
|
|
2877
2958
|
] });
|
|
2878
2959
|
}
|
|
2879
2960
|
return label;
|
|
@@ -2883,7 +2964,7 @@ var getFieldLabel = (label, help, onClick) => {
|
|
|
2883
2964
|
import { ListItem as ListItem9, Markdown as Markdown4, Popover } from "@transferwise/components";
|
|
2884
2965
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
2885
2966
|
import { useIntl as useIntl10 } from "react-intl";
|
|
2886
|
-
import { jsx as
|
|
2967
|
+
import { jsx as jsx64, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2887
2968
|
var IGNORED_CONTROLS = [
|
|
2888
2969
|
"horizontal",
|
|
2889
2970
|
"horizontal-end-aligned",
|
|
@@ -2893,7 +2974,7 @@ var IGNORED_CONTROLS = [
|
|
|
2893
2974
|
var ReviewRenderer2 = {
|
|
2894
2975
|
canRenderType: "review",
|
|
2895
2976
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
2896
|
-
render: (props) => /* @__PURE__ */
|
|
2977
|
+
render: (props) => /* @__PURE__ */ jsx64(Review, __spreadValues({}, props))
|
|
2897
2978
|
};
|
|
2898
2979
|
var Review = ({
|
|
2899
2980
|
callToAction,
|
|
@@ -2906,7 +2987,7 @@ var Review = ({
|
|
|
2906
2987
|
}) => {
|
|
2907
2988
|
const intl = useIntl10();
|
|
2908
2989
|
return /* @__PURE__ */ jsxs16("div", { className: getMargin(margin), children: [
|
|
2909
|
-
/* @__PURE__ */
|
|
2990
|
+
/* @__PURE__ */ jsx64(Header5, { title, callToAction }),
|
|
2910
2991
|
fields.map((field) => {
|
|
2911
2992
|
var _a, _b, _c;
|
|
2912
2993
|
const {
|
|
@@ -2924,7 +3005,7 @@ var Review = ({
|
|
|
2924
3005
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2925
3006
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2926
3007
|
};
|
|
2927
|
-
return /* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ jsx64(
|
|
2928
3009
|
ListItem9,
|
|
2929
3010
|
{
|
|
2930
3011
|
title: value,
|
|
@@ -2945,7 +3026,7 @@ var Review = ({
|
|
|
2945
3026
|
] });
|
|
2946
3027
|
};
|
|
2947
3028
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
2948
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsx64(Popover, { content: /* @__PURE__ */ jsx64(Markdown4, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx64(ListItem9.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx64(QuestionMarkCircle, {}) }) });
|
|
2949
3030
|
};
|
|
2950
3031
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
2951
3032
|
|
|
@@ -2989,19 +3070,19 @@ var generic_error_messages_default = defineMessages10({
|
|
|
2989
3070
|
|
|
2990
3071
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2991
3072
|
import { Link } from "@transferwise/components";
|
|
2992
|
-
import { jsx as
|
|
3073
|
+
import { jsx as jsx65, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2993
3074
|
function ErrorResult({ state }) {
|
|
2994
3075
|
const intl = useIntl11();
|
|
2995
3076
|
return /* @__PURE__ */ jsxs17("p", { className: "m-t-2", children: [
|
|
2996
3077
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2997
3078
|
"\xA0",
|
|
2998
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsx65(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
2999
3080
|
] });
|
|
3000
3081
|
}
|
|
3001
3082
|
|
|
3002
3083
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
3003
3084
|
import { Search } from "@transferwise/icons";
|
|
3004
|
-
import { Fragment as Fragment7, jsx as
|
|
3085
|
+
import { Fragment as Fragment7, jsx as jsx66, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3005
3086
|
function BlockSearchRendererComponent({
|
|
3006
3087
|
id,
|
|
3007
3088
|
hint,
|
|
@@ -3016,7 +3097,7 @@ function BlockSearchRendererComponent({
|
|
|
3016
3097
|
const [hasSearched, setHasSearched] = useState10(false);
|
|
3017
3098
|
const { formatMessage } = useIntl12();
|
|
3018
3099
|
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
3019
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ jsx66(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx66(InputGroup3, { addonStart: { content: /* @__PURE__ */ jsx66(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx66(
|
|
3020
3101
|
Input4,
|
|
3021
3102
|
{
|
|
3022
3103
|
id,
|
|
@@ -3033,7 +3114,7 @@ function BlockSearchRendererComponent({
|
|
|
3033
3114
|
}
|
|
3034
3115
|
}
|
|
3035
3116
|
) }) }),
|
|
3036
|
-
isLoading ? /* @__PURE__ */
|
|
3117
|
+
isLoading ? /* @__PURE__ */ jsx66("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx66(SearchResultContent, { state, trackEvent })
|
|
3037
3118
|
] });
|
|
3038
3119
|
}
|
|
3039
3120
|
function SearchResultContent({
|
|
@@ -3042,9 +3123,9 @@ function SearchResultContent({
|
|
|
3042
3123
|
}) {
|
|
3043
3124
|
switch (state.type) {
|
|
3044
3125
|
case "error":
|
|
3045
|
-
return /* @__PURE__ */
|
|
3126
|
+
return /* @__PURE__ */ jsx66(ErrorResult, { state });
|
|
3046
3127
|
case "results":
|
|
3047
|
-
return /* @__PURE__ */
|
|
3128
|
+
return /* @__PURE__ */ jsx66(SearchResults, { state, trackEvent });
|
|
3048
3129
|
case "layout":
|
|
3049
3130
|
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
3050
3131
|
" ",
|
|
@@ -3052,28 +3133,28 @@ function SearchResultContent({
|
|
|
3052
3133
|
" "
|
|
3053
3134
|
] });
|
|
3054
3135
|
case "noResults":
|
|
3055
|
-
return /* @__PURE__ */
|
|
3136
|
+
return /* @__PURE__ */ jsx66(EmptySearchResult, { state });
|
|
3056
3137
|
case "pending":
|
|
3057
3138
|
default:
|
|
3058
3139
|
return null;
|
|
3059
3140
|
}
|
|
3060
3141
|
}
|
|
3061
3142
|
function EmptySearchResult({ state }) {
|
|
3062
|
-
return /* @__PURE__ */
|
|
3143
|
+
return /* @__PURE__ */ jsx66(Markdown5, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3063
3144
|
}
|
|
3064
3145
|
function SearchResults({
|
|
3065
3146
|
state,
|
|
3066
3147
|
trackEvent
|
|
3067
3148
|
}) {
|
|
3068
|
-
return /* @__PURE__ */
|
|
3149
|
+
return /* @__PURE__ */ jsx66(List, { children: state.results.map((result) => {
|
|
3069
3150
|
const { media } = result;
|
|
3070
|
-
return /* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ jsx66(
|
|
3071
3152
|
ListItem10,
|
|
3072
3153
|
{
|
|
3073
3154
|
title: result.title,
|
|
3074
3155
|
subtitle: result.description,
|
|
3075
|
-
media: media ? /* @__PURE__ */
|
|
3076
|
-
control: /* @__PURE__ */
|
|
3156
|
+
media: media ? /* @__PURE__ */ jsx66(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
3157
|
+
control: /* @__PURE__ */ jsx66(
|
|
3077
3158
|
ListItem10.Navigation,
|
|
3078
3159
|
{
|
|
3079
3160
|
onClick: () => {
|
|
@@ -3096,7 +3177,7 @@ import { Markdown as Markdown6, Typeahead } from "@transferwise/components";
|
|
|
3096
3177
|
import { Search as Search2 } from "@transferwise/icons";
|
|
3097
3178
|
import { useState as useState11 } from "react";
|
|
3098
3179
|
import { useIntl as useIntl13 } from "react-intl";
|
|
3099
|
-
import { jsx as
|
|
3180
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
3100
3181
|
function InlineSearchRenderer({
|
|
3101
3182
|
id,
|
|
3102
3183
|
hint,
|
|
@@ -3109,7 +3190,7 @@ function InlineSearchRenderer({
|
|
|
3109
3190
|
}) {
|
|
3110
3191
|
const [hasSearched, setHasSearched] = useState11(false);
|
|
3111
3192
|
const intl = useIntl13();
|
|
3112
|
-
return /* @__PURE__ */
|
|
3193
|
+
return /* @__PURE__ */ jsx67("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx67(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx67(
|
|
3113
3194
|
Typeahead,
|
|
3114
3195
|
{
|
|
3115
3196
|
id: "typeahead-input-id",
|
|
@@ -3118,10 +3199,10 @@ function InlineSearchRenderer({
|
|
|
3118
3199
|
size: "md",
|
|
3119
3200
|
placeholder: hint,
|
|
3120
3201
|
maxHeight: 100,
|
|
3121
|
-
footer: /* @__PURE__ */
|
|
3202
|
+
footer: /* @__PURE__ */ jsx67(TypeaheadFooter, { state, isLoading }),
|
|
3122
3203
|
multiple: false,
|
|
3123
3204
|
clearable: false,
|
|
3124
|
-
addon: /* @__PURE__ */
|
|
3205
|
+
addon: /* @__PURE__ */ jsx67(Search2, { size: 24 }),
|
|
3125
3206
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
3126
3207
|
minQueryLength: 1,
|
|
3127
3208
|
onChange: (values) => {
|
|
@@ -3158,26 +3239,26 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3158
3239
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3159
3240
|
const { formatMessage } = useIntl13();
|
|
3160
3241
|
if (state.type === "layout") {
|
|
3161
|
-
return /* @__PURE__ */
|
|
3242
|
+
return /* @__PURE__ */ jsx67("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
3162
3243
|
}
|
|
3163
3244
|
if (state.type === "noResults") {
|
|
3164
|
-
return /* @__PURE__ */
|
|
3245
|
+
return /* @__PURE__ */ jsx67(Markdown6, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3165
3246
|
}
|
|
3166
3247
|
if (state.type === "error") {
|
|
3167
|
-
return /* @__PURE__ */
|
|
3248
|
+
return /* @__PURE__ */ jsx67("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx67(ErrorResult, { state }) });
|
|
3168
3249
|
}
|
|
3169
3250
|
if (state.type === "pending" || isLoading) {
|
|
3170
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ jsx67("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
3171
3252
|
}
|
|
3172
3253
|
return null;
|
|
3173
3254
|
}
|
|
3174
3255
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3175
3256
|
|
|
3176
3257
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3177
|
-
import { jsx as
|
|
3258
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
3178
3259
|
var SearchRenderer = {
|
|
3179
3260
|
canRenderType: "search",
|
|
3180
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
3261
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx68(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx68(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
3181
3262
|
};
|
|
3182
3263
|
var SearchRenderer_default = SearchRenderer;
|
|
3183
3264
|
|
|
@@ -3206,12 +3287,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
3206
3287
|
};
|
|
3207
3288
|
|
|
3208
3289
|
// ../renderers/src/SectionRenderer.tsx
|
|
3209
|
-
import { jsx as
|
|
3290
|
+
import { jsx as jsx69, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3210
3291
|
var SectionRenderer = {
|
|
3211
3292
|
canRenderType: "section",
|
|
3212
3293
|
render: ({ children, callToAction, margin, title }) => {
|
|
3213
3294
|
return /* @__PURE__ */ jsxs19("section", { className: getMargin(margin), children: [
|
|
3214
|
-
(title || callToAction) && /* @__PURE__ */
|
|
3295
|
+
(title || callToAction) && /* @__PURE__ */ jsx69(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
3215
3296
|
children
|
|
3216
3297
|
] });
|
|
3217
3298
|
}
|
|
@@ -3220,7 +3301,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
3220
3301
|
|
|
3221
3302
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3222
3303
|
import { RadioGroup } from "@transferwise/components";
|
|
3223
|
-
import { Fragment as Fragment8, jsx as
|
|
3304
|
+
import { Fragment as Fragment8, jsx as jsx70, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3224
3305
|
function RadioInputRendererComponent(props) {
|
|
3225
3306
|
const {
|
|
3226
3307
|
id,
|
|
@@ -3235,7 +3316,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3235
3316
|
onSelect
|
|
3236
3317
|
} = props;
|
|
3237
3318
|
return /* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
3238
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ jsx70(
|
|
3239
3320
|
FieldInput_default,
|
|
3240
3321
|
{
|
|
3241
3322
|
id,
|
|
@@ -3243,7 +3324,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3243
3324
|
help,
|
|
3244
3325
|
description,
|
|
3245
3326
|
validation: validationState,
|
|
3246
|
-
children: /* @__PURE__ */
|
|
3327
|
+
children: /* @__PURE__ */ jsx70("span", { children: /* @__PURE__ */ jsx70(
|
|
3247
3328
|
RadioGroup,
|
|
3248
3329
|
{
|
|
3249
3330
|
name: id,
|
|
@@ -3252,7 +3333,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3252
3333
|
value: index,
|
|
3253
3334
|
secondary: option.description,
|
|
3254
3335
|
disabled: option.disabled || disabled,
|
|
3255
|
-
avatar: /* @__PURE__ */
|
|
3336
|
+
avatar: /* @__PURE__ */ jsx70(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3256
3337
|
})),
|
|
3257
3338
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3258
3339
|
onChange: onSelect
|
|
@@ -3268,7 +3349,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3268
3349
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3269
3350
|
import { Tabs } from "@transferwise/components";
|
|
3270
3351
|
import { useEffect as useEffect7 } from "react";
|
|
3271
|
-
import { Fragment as Fragment9, jsx as
|
|
3352
|
+
import { Fragment as Fragment9, jsx as jsx71, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3272
3353
|
function TabInputRendererComponent(props) {
|
|
3273
3354
|
const {
|
|
3274
3355
|
id,
|
|
@@ -3288,7 +3369,7 @@ function TabInputRendererComponent(props) {
|
|
|
3288
3369
|
}
|
|
3289
3370
|
}, [selectedIndex, onSelect, options.length]);
|
|
3290
3371
|
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
3291
|
-
/* @__PURE__ */
|
|
3372
|
+
/* @__PURE__ */ jsx71(
|
|
3292
3373
|
FieldInput_default,
|
|
3293
3374
|
{
|
|
3294
3375
|
id,
|
|
@@ -3296,7 +3377,7 @@ function TabInputRendererComponent(props) {
|
|
|
3296
3377
|
help,
|
|
3297
3378
|
description,
|
|
3298
3379
|
validation: validationState,
|
|
3299
|
-
children: /* @__PURE__ */
|
|
3380
|
+
children: /* @__PURE__ */ jsx71(
|
|
3300
3381
|
Tabs,
|
|
3301
3382
|
{
|
|
3302
3383
|
name: id,
|
|
@@ -3305,7 +3386,7 @@ function TabInputRendererComponent(props) {
|
|
|
3305
3386
|
title: option.title,
|
|
3306
3387
|
// if we pass null, we get some props-types console errors
|
|
3307
3388
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3308
|
-
content: /* @__PURE__ */
|
|
3389
|
+
content: /* @__PURE__ */ jsx71(Fragment9, {}),
|
|
3309
3390
|
disabled: option.disabled || disabled
|
|
3310
3391
|
})),
|
|
3311
3392
|
onTabSelect: onSelect
|
|
@@ -3320,7 +3401,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
3320
3401
|
|
|
3321
3402
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3322
3403
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
3323
|
-
import { Fragment as Fragment10, jsx as
|
|
3404
|
+
import { Fragment as Fragment10, jsx as jsx72, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3324
3405
|
function SelectInputRendererComponent(props) {
|
|
3325
3406
|
const {
|
|
3326
3407
|
id,
|
|
@@ -3360,13 +3441,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3360
3441
|
} : {
|
|
3361
3442
|
title: option.title,
|
|
3362
3443
|
description: option.description,
|
|
3363
|
-
icon: /* @__PURE__ */
|
|
3444
|
+
icon: /* @__PURE__ */ jsx72(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3364
3445
|
};
|
|
3365
|
-
return /* @__PURE__ */
|
|
3446
|
+
return /* @__PURE__ */ jsx72(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
3366
3447
|
};
|
|
3367
3448
|
const extraProps = { autoComplete };
|
|
3368
3449
|
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
3369
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsx72(
|
|
3370
3451
|
FieldInput_default,
|
|
3371
3452
|
{
|
|
3372
3453
|
id,
|
|
@@ -3374,7 +3455,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3374
3455
|
help,
|
|
3375
3456
|
description,
|
|
3376
3457
|
validation: validationState,
|
|
3377
|
-
children: /* @__PURE__ */
|
|
3458
|
+
children: /* @__PURE__ */ jsx72(
|
|
3378
3459
|
SelectInput2,
|
|
3379
3460
|
__spreadValues({
|
|
3380
3461
|
name: id,
|
|
@@ -3397,7 +3478,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3397
3478
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3398
3479
|
import { useEffect as useEffect8 } from "react";
|
|
3399
3480
|
import { SegmentedControl } from "@transferwise/components";
|
|
3400
|
-
import { Fragment as Fragment11, jsx as
|
|
3481
|
+
import { Fragment as Fragment11, jsx as jsx73, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3401
3482
|
function SegmentedInputRendererComponent(props) {
|
|
3402
3483
|
const {
|
|
3403
3484
|
id,
|
|
@@ -3416,7 +3497,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3416
3497
|
}
|
|
3417
3498
|
}, [selectedIndex, onSelect, options.length]);
|
|
3418
3499
|
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3419
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx73(
|
|
3420
3501
|
FieldInput_default,
|
|
3421
3502
|
{
|
|
3422
3503
|
id,
|
|
@@ -3424,7 +3505,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3424
3505
|
help,
|
|
3425
3506
|
description,
|
|
3426
3507
|
validation: validationState,
|
|
3427
|
-
children: /* @__PURE__ */
|
|
3508
|
+
children: /* @__PURE__ */ jsx73(
|
|
3428
3509
|
SegmentedControl,
|
|
3429
3510
|
{
|
|
3430
3511
|
name: `${id}-segmented-control`,
|
|
@@ -3441,14 +3522,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3441
3522
|
)
|
|
3442
3523
|
}
|
|
3443
3524
|
),
|
|
3444
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ jsx73("div", { id: `${id}-children`, children })
|
|
3445
3526
|
] });
|
|
3446
3527
|
}
|
|
3447
3528
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3448
3529
|
|
|
3449
3530
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
3450
3531
|
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem11 } from "@transferwise/components";
|
|
3451
|
-
import { Fragment as Fragment12, jsx as
|
|
3532
|
+
import { Fragment as Fragment12, jsx as jsx74, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3452
3533
|
function RadioItemRendererComponent(props) {
|
|
3453
3534
|
const {
|
|
3454
3535
|
id,
|
|
@@ -3463,21 +3544,21 @@ function RadioItemRendererComponent(props) {
|
|
|
3463
3544
|
onSelect
|
|
3464
3545
|
} = props;
|
|
3465
3546
|
return /* @__PURE__ */ jsxs24(Fragment12, { children: [
|
|
3466
|
-
rootTitle && /* @__PURE__ */
|
|
3547
|
+
rootTitle && /* @__PURE__ */ jsx74(
|
|
3467
3548
|
Header8,
|
|
3468
3549
|
{
|
|
3469
3550
|
as: "h2",
|
|
3470
|
-
title: help ? /* @__PURE__ */
|
|
3551
|
+
title: help ? /* @__PURE__ */ jsx74(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
3471
3552
|
}
|
|
3472
3553
|
),
|
|
3473
|
-
rootDescription && /* @__PURE__ */
|
|
3474
|
-
/* @__PURE__ */
|
|
3475
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
3554
|
+
rootDescription && /* @__PURE__ */ jsx74("p", { children: rootDescription }),
|
|
3555
|
+
/* @__PURE__ */ jsx74(List2, { children: options.map(
|
|
3556
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx74(
|
|
3476
3557
|
ListItem11,
|
|
3477
3558
|
__spreadValues({
|
|
3478
3559
|
title,
|
|
3479
3560
|
subtitle: description,
|
|
3480
|
-
control: /* @__PURE__ */
|
|
3561
|
+
control: /* @__PURE__ */ jsx74(
|
|
3481
3562
|
ListItem11.Radio,
|
|
3482
3563
|
{
|
|
3483
3564
|
name: title,
|
|
@@ -3493,28 +3574,28 @@ function RadioItemRendererComponent(props) {
|
|
|
3493
3574
|
title
|
|
3494
3575
|
)
|
|
3495
3576
|
) }, `${id}-${selectedIndex}`),
|
|
3496
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
3577
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx74(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
3497
3578
|
children
|
|
3498
3579
|
] });
|
|
3499
3580
|
}
|
|
3500
3581
|
|
|
3501
3582
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3502
|
-
import { jsx as
|
|
3583
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3503
3584
|
var SelectInputRenderer = {
|
|
3504
3585
|
canRenderType: "input-select",
|
|
3505
3586
|
render: (props) => {
|
|
3506
3587
|
switch (props.control) {
|
|
3507
3588
|
case "radio":
|
|
3508
|
-
return /* @__PURE__ */
|
|
3589
|
+
return /* @__PURE__ */ jsx75(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3509
3590
|
case "radio-item":
|
|
3510
|
-
return /* @__PURE__ */
|
|
3591
|
+
return /* @__PURE__ */ jsx75(RadioItemRendererComponent, __spreadValues({}, props));
|
|
3511
3592
|
case "tab":
|
|
3512
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3593
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx75(TabInputRendererComponent, __spreadValues({}, props));
|
|
3513
3594
|
case "segmented":
|
|
3514
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3595
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx75(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
3515
3596
|
case "select":
|
|
3516
3597
|
default:
|
|
3517
|
-
return /* @__PURE__ */
|
|
3598
|
+
return /* @__PURE__ */ jsx75(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3518
3599
|
}
|
|
3519
3600
|
}
|
|
3520
3601
|
};
|
|
@@ -3522,20 +3603,20 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
3522
3603
|
|
|
3523
3604
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3524
3605
|
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem12 } from "@transferwise/components";
|
|
3525
|
-
import { jsx as
|
|
3606
|
+
import { jsx as jsx76, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3526
3607
|
var StatusListRenderer = {
|
|
3527
3608
|
canRenderType: "status-list",
|
|
3528
3609
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
3529
|
-
title ? /* @__PURE__ */
|
|
3610
|
+
title ? /* @__PURE__ */ jsx76(Header9, { title }) : null,
|
|
3530
3611
|
items.map((item) => {
|
|
3531
3612
|
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3532
|
-
return /* @__PURE__ */
|
|
3613
|
+
return /* @__PURE__ */ jsx76(
|
|
3533
3614
|
ListItem12,
|
|
3534
3615
|
{
|
|
3535
3616
|
title: itemTitle,
|
|
3536
3617
|
subtitle: description,
|
|
3537
|
-
media: icon && "name" in icon ? /* @__PURE__ */
|
|
3538
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
3618
|
+
media: icon && "name" in icon ? /* @__PURE__ */ jsx76(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx76(DynamicIcon_default, { name: icon.name }) }) : void 0,
|
|
3619
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx76(
|
|
3539
3620
|
ListItem12.AdditionalInfo,
|
|
3540
3621
|
{
|
|
3541
3622
|
action: {
|
|
@@ -3598,23 +3679,23 @@ var step_messages_default = defineMessages11({
|
|
|
3598
3679
|
});
|
|
3599
3680
|
|
|
3600
3681
|
// ../renderers/src/step/StepFooter.tsx
|
|
3601
|
-
import { Fragment as Fragment13, jsx as
|
|
3682
|
+
import { Fragment as Fragment13, jsx as jsx77, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3602
3683
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3603
3684
|
var StepFooter = ({ footer, tags }) => {
|
|
3604
3685
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3605
|
-
return /* @__PURE__ */
|
|
3686
|
+
return /* @__PURE__ */ jsx77(FooterWithScrollButton, { footer });
|
|
3606
3687
|
}
|
|
3607
|
-
return /* @__PURE__ */
|
|
3688
|
+
return /* @__PURE__ */ jsx77(DefaultFooter, { footer });
|
|
3608
3689
|
};
|
|
3609
3690
|
var DefaultFooter = ({ footer }) => {
|
|
3610
3691
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3611
|
-
return hasFooter ? /* @__PURE__ */
|
|
3692
|
+
return hasFooter ? /* @__PURE__ */ jsx77("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3612
3693
|
};
|
|
3613
3694
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3614
3695
|
const { formatMessage } = useIntl14();
|
|
3615
3696
|
const endOfLayoutRef = useRef(null);
|
|
3616
3697
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3617
|
-
const scrollButton = /* @__PURE__ */
|
|
3698
|
+
const scrollButton = /* @__PURE__ */ jsx77(
|
|
3618
3699
|
Button7,
|
|
3619
3700
|
{
|
|
3620
3701
|
className: "m-b-1",
|
|
@@ -3630,10 +3711,10 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3630
3711
|
);
|
|
3631
3712
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3632
3713
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3633
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3634
3715
|
}
|
|
3635
3716
|
return /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
3636
|
-
/* @__PURE__ */
|
|
3717
|
+
/* @__PURE__ */ jsx77("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3637
3718
|
/* @__PURE__ */ jsxs26("div", { className: "df-step-fixed__footer", children: [
|
|
3638
3719
|
!isElementVisible && scrollButton,
|
|
3639
3720
|
footer
|
|
@@ -3656,12 +3737,12 @@ var useIsElementVisible = (elementRef) => {
|
|
|
3656
3737
|
|
|
3657
3738
|
// ../renderers/src/step/StepHeader.tsx
|
|
3658
3739
|
import { Title as Title2 } from "@transferwise/components";
|
|
3659
|
-
import { Fragment as Fragment14, jsx as
|
|
3740
|
+
import { Fragment as Fragment14, jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3660
3741
|
var StepHeader = ({ title, description, tags }) => {
|
|
3661
3742
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3662
3743
|
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
3663
|
-
title ? /* @__PURE__ */
|
|
3664
|
-
description ? /* @__PURE__ */
|
|
3744
|
+
title ? /* @__PURE__ */ jsx78(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3745
|
+
description ? /* @__PURE__ */ jsx78("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3665
3746
|
] });
|
|
3666
3747
|
};
|
|
3667
3748
|
var getHeaderStyle = (tags) => {
|
|
@@ -3687,23 +3768,23 @@ var back_messages_default = defineMessages12({
|
|
|
3687
3768
|
});
|
|
3688
3769
|
|
|
3689
3770
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3690
|
-
import { jsx as
|
|
3771
|
+
import { jsx as jsx79, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3691
3772
|
function BackButton({ title, onClick }) {
|
|
3692
3773
|
const { formatMessage } = useIntl15();
|
|
3693
3774
|
return /* @__PURE__ */ jsxs28(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsx79("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3776
|
+
/* @__PURE__ */ jsx79(ArrowLeft, {})
|
|
3696
3777
|
] });
|
|
3697
3778
|
}
|
|
3698
3779
|
|
|
3699
3780
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3700
3781
|
import { Button as Button8, IconButton as IconButton2 } from "@transferwise/components";
|
|
3701
|
-
import { jsx as
|
|
3782
|
+
import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3702
3783
|
var Toolbar = ({ items }) => {
|
|
3703
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
3784
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx80("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx80(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
3704
3785
|
};
|
|
3705
3786
|
function ToolbarButton(props) {
|
|
3706
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
3787
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx80(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx80(TextToolbarButton, __spreadValues({}, props));
|
|
3707
3788
|
}
|
|
3708
3789
|
function MediaToolbarButton(props) {
|
|
3709
3790
|
var _a;
|
|
@@ -3720,7 +3801,7 @@ function MediaToolbarButton(props) {
|
|
|
3720
3801
|
type,
|
|
3721
3802
|
onClick,
|
|
3722
3803
|
children: [
|
|
3723
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
3804
|
+
accessibilityDescription ? /* @__PURE__ */ jsx80("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3724
3805
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3725
3806
|
]
|
|
3726
3807
|
}
|
|
@@ -3731,7 +3812,7 @@ function TextToolbarButton(props) {
|
|
|
3731
3812
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3732
3813
|
const priority = getPriority2(control);
|
|
3733
3814
|
const sentiment = getSentiment2(context);
|
|
3734
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx80(
|
|
3735
3816
|
Button8,
|
|
3736
3817
|
{
|
|
3737
3818
|
v2: true,
|
|
@@ -3761,16 +3842,16 @@ var getIconButtonPriority = (control) => {
|
|
|
3761
3842
|
};
|
|
3762
3843
|
|
|
3763
3844
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3764
|
-
import { jsx as
|
|
3845
|
+
import { jsx as jsx81, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3765
3846
|
function TopBar({ back, toolbar }) {
|
|
3766
3847
|
return back || toolbar ? /* @__PURE__ */ jsxs30("div", { className: "d-flex m-b-2", children: [
|
|
3767
|
-
back ? /* @__PURE__ */
|
|
3768
|
-
toolbar ? /* @__PURE__ */
|
|
3848
|
+
back ? /* @__PURE__ */ jsx81(BackButton, __spreadValues({}, back)) : null,
|
|
3849
|
+
toolbar ? /* @__PURE__ */ jsx81(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3769
3850
|
] }) : null;
|
|
3770
3851
|
}
|
|
3771
3852
|
|
|
3772
3853
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3773
|
-
import { jsx as
|
|
3854
|
+
import { jsx as jsx82, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3774
3855
|
var SplashCelebrationStepRenderer = {
|
|
3775
3856
|
canRenderType: "step",
|
|
3776
3857
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3780,15 +3861,15 @@ function SplashCelebrationStepRendererComponent(props) {
|
|
|
3780
3861
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
3781
3862
|
useCustomTheme("forest-green", trackEvent);
|
|
3782
3863
|
return /* @__PURE__ */ jsxs31("div", { className: "splash-screen m-t-5", children: [
|
|
3783
|
-
/* @__PURE__ */
|
|
3784
|
-
title || description ? /* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsx82(TopBar, { back, toolbar }),
|
|
3865
|
+
title || description ? /* @__PURE__ */ jsx82("div", { className: "m-b-4", children: /* @__PURE__ */ jsx82(StepHeader, { title, description, tags }) }) : void 0,
|
|
3785
3866
|
children,
|
|
3786
|
-
/* @__PURE__ */
|
|
3867
|
+
/* @__PURE__ */ jsx82(StepFooter, { footer, tags })
|
|
3787
3868
|
] });
|
|
3788
3869
|
}
|
|
3789
3870
|
|
|
3790
3871
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3791
|
-
import { jsx as
|
|
3872
|
+
import { jsx as jsx83, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3792
3873
|
var SplashStepRenderer = {
|
|
3793
3874
|
canRenderType: "step",
|
|
3794
3875
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3797,16 +3878,16 @@ var SplashStepRenderer = {
|
|
|
3797
3878
|
function SplashStepRendererComponent(props) {
|
|
3798
3879
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
3799
3880
|
return /* @__PURE__ */ jsxs32("div", { className: "splash-screen m-t-5", children: [
|
|
3800
|
-
/* @__PURE__ */
|
|
3801
|
-
title || description ? /* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ jsx83(TopBar, { back, toolbar }),
|
|
3882
|
+
title || description ? /* @__PURE__ */ jsx83("div", { className: "m-b-4", children: /* @__PURE__ */ jsx83(StepHeader, { title, description, tags }) }) : void 0,
|
|
3802
3883
|
children,
|
|
3803
|
-
/* @__PURE__ */
|
|
3884
|
+
/* @__PURE__ */ jsx83(StepFooter, { footer, tags })
|
|
3804
3885
|
] });
|
|
3805
3886
|
}
|
|
3806
3887
|
|
|
3807
3888
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3808
3889
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
3809
|
-
import { jsx as
|
|
3890
|
+
import { jsx as jsx84, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3810
3891
|
var StepRenderer = {
|
|
3811
3892
|
canRenderType: "step",
|
|
3812
3893
|
render: StepRendererComponent
|
|
@@ -3814,37 +3895,37 @@ var StepRenderer = {
|
|
|
3814
3895
|
function StepRendererComponent(props) {
|
|
3815
3896
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
3816
3897
|
return /* @__PURE__ */ jsxs33("div", { children: [
|
|
3817
|
-
/* @__PURE__ */
|
|
3818
|
-
title || description ? /* @__PURE__ */
|
|
3819
|
-
error ? /* @__PURE__ */
|
|
3898
|
+
/* @__PURE__ */ jsx84(TopBar, { back, toolbar }),
|
|
3899
|
+
title || description ? /* @__PURE__ */ jsx84("div", { className: "m-b-4", children: /* @__PURE__ */ jsx84(StepHeader, { title, description, tags }) }) : void 0,
|
|
3900
|
+
error ? /* @__PURE__ */ jsx84(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
3820
3901
|
children,
|
|
3821
|
-
/* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ jsx84(StepFooter, { footer, tags })
|
|
3822
3903
|
] });
|
|
3823
3904
|
}
|
|
3824
3905
|
|
|
3825
3906
|
// ../renderers/src/TabsRenderer.tsx
|
|
3826
3907
|
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
3827
3908
|
import { useState as useState13 } from "react";
|
|
3828
|
-
import { jsx as
|
|
3909
|
+
import { jsx as jsx85, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3829
3910
|
var TabsRenderer = {
|
|
3830
3911
|
canRenderType: "tabs",
|
|
3831
3912
|
render: (props) => {
|
|
3832
3913
|
switch (props.control) {
|
|
3833
3914
|
case "segmented":
|
|
3834
3915
|
if (props.tabs.length > 3) {
|
|
3835
|
-
return /* @__PURE__ */
|
|
3916
|
+
return /* @__PURE__ */ jsx85(TabsRendererComponent, __spreadValues({}, props));
|
|
3836
3917
|
}
|
|
3837
|
-
return /* @__PURE__ */
|
|
3918
|
+
return /* @__PURE__ */ jsx85(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3838
3919
|
case "chips":
|
|
3839
|
-
return /* @__PURE__ */
|
|
3920
|
+
return /* @__PURE__ */ jsx85(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3840
3921
|
default:
|
|
3841
|
-
return /* @__PURE__ */
|
|
3922
|
+
return /* @__PURE__ */ jsx85(TabsRendererComponent, __spreadValues({}, props));
|
|
3842
3923
|
}
|
|
3843
3924
|
}
|
|
3844
3925
|
};
|
|
3845
3926
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3846
3927
|
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
3847
|
-
return /* @__PURE__ */
|
|
3928
|
+
return /* @__PURE__ */ jsx85("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx85(
|
|
3848
3929
|
Tabs2,
|
|
3849
3930
|
{
|
|
3850
3931
|
name: uid,
|
|
@@ -3866,7 +3947,7 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3866
3947
|
var _a;
|
|
3867
3948
|
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
3868
3949
|
return /* @__PURE__ */ jsxs34("div", { className: getMargin(margin), children: [
|
|
3869
|
-
/* @__PURE__ */
|
|
3950
|
+
/* @__PURE__ */ jsx85(
|
|
3870
3951
|
SegmentedControl2,
|
|
3871
3952
|
{
|
|
3872
3953
|
name: uid,
|
|
@@ -3881,14 +3962,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3881
3962
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3882
3963
|
}
|
|
3883
3964
|
),
|
|
3884
|
-
/* @__PURE__ */
|
|
3965
|
+
/* @__PURE__ */ jsx85("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3885
3966
|
] });
|
|
3886
3967
|
}
|
|
3887
3968
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3888
3969
|
var _a;
|
|
3889
3970
|
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
3890
3971
|
return /* @__PURE__ */ jsxs34("div", { className: getMargin(margin), children: [
|
|
3891
|
-
/* @__PURE__ */
|
|
3972
|
+
/* @__PURE__ */ jsx85("div", { className: "chips-container", children: /* @__PURE__ */ jsx85(
|
|
3892
3973
|
Chips,
|
|
3893
3974
|
{
|
|
3894
3975
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -3896,7 +3977,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
|
3896
3977
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3897
3978
|
}
|
|
3898
3979
|
) }),
|
|
3899
|
-
/* @__PURE__ */
|
|
3980
|
+
/* @__PURE__ */ jsx85("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3900
3981
|
] });
|
|
3901
3982
|
}
|
|
3902
3983
|
|
|
@@ -3911,7 +3992,7 @@ import {
|
|
|
3911
3992
|
TextArea,
|
|
3912
3993
|
TextareaWithDisplayFormat
|
|
3913
3994
|
} from "@transferwise/components";
|
|
3914
|
-
import { jsx as
|
|
3995
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
3915
3996
|
var commonKeys = [
|
|
3916
3997
|
"autoComplete",
|
|
3917
3998
|
"autoCapitalize",
|
|
@@ -3930,12 +4011,12 @@ function VariableTextInput(inputProps) {
|
|
|
3930
4011
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3931
4012
|
switch (control) {
|
|
3932
4013
|
case "email":
|
|
3933
|
-
return /* @__PURE__ */
|
|
4014
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3934
4015
|
case "password":
|
|
3935
|
-
return /* @__PURE__ */
|
|
4016
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3936
4017
|
case "numeric": {
|
|
3937
4018
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3938
|
-
return /* @__PURE__ */
|
|
4019
|
+
return /* @__PURE__ */ jsx86(
|
|
3939
4020
|
TextInput,
|
|
3940
4021
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3941
4022
|
onChange: (newValue) => {
|
|
@@ -3946,9 +4027,9 @@ function VariableTextInput(inputProps) {
|
|
|
3946
4027
|
);
|
|
3947
4028
|
}
|
|
3948
4029
|
case "phone-number":
|
|
3949
|
-
return /* @__PURE__ */
|
|
4030
|
+
return /* @__PURE__ */ jsx86(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3950
4031
|
default: {
|
|
3951
|
-
return /* @__PURE__ */
|
|
4032
|
+
return /* @__PURE__ */ jsx86(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3952
4033
|
}
|
|
3953
4034
|
}
|
|
3954
4035
|
}
|
|
@@ -3956,11 +4037,11 @@ function TextInput(props) {
|
|
|
3956
4037
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3957
4038
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
3958
4039
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
3959
|
-
return displayFormat ? /* @__PURE__ */
|
|
4040
|
+
return displayFormat ? /* @__PURE__ */ jsx86(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx86(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3960
4041
|
}
|
|
3961
4042
|
|
|
3962
4043
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3963
|
-
import { jsx as
|
|
4044
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
3964
4045
|
var TextInputRenderer = {
|
|
3965
4046
|
canRenderType: "input-text",
|
|
3966
4047
|
render: (props) => {
|
|
@@ -3993,7 +4074,7 @@ var TextInputRenderer = {
|
|
|
3993
4074
|
}
|
|
3994
4075
|
}
|
|
3995
4076
|
});
|
|
3996
|
-
return /* @__PURE__ */
|
|
4077
|
+
return /* @__PURE__ */ jsx87(
|
|
3997
4078
|
FieldInput_default,
|
|
3998
4079
|
{
|
|
3999
4080
|
id,
|
|
@@ -4001,7 +4082,7 @@ var TextInputRenderer = {
|
|
|
4001
4082
|
description,
|
|
4002
4083
|
validation: validationState,
|
|
4003
4084
|
help,
|
|
4004
|
-
children: /* @__PURE__ */
|
|
4085
|
+
children: /* @__PURE__ */ jsx87(InputGroup4, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx87(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
4005
4086
|
}
|
|
4006
4087
|
);
|
|
4007
4088
|
}
|
|
@@ -4015,7 +4096,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
4015
4096
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
4016
4097
|
|
|
4017
4098
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
4018
|
-
import { jsx as
|
|
4099
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
4019
4100
|
var UploadInputRenderer = {
|
|
4020
4101
|
canRenderType: "input-upload",
|
|
4021
4102
|
render: (props) => {
|
|
@@ -4031,14 +4112,14 @@ var UploadInputRenderer = {
|
|
|
4031
4112
|
};
|
|
4032
4113
|
return (
|
|
4033
4114
|
// We don't pass help here as there is no sensible place to display it
|
|
4034
|
-
/* @__PURE__ */
|
|
4115
|
+
/* @__PURE__ */ jsx88(
|
|
4035
4116
|
UploadFieldInput_default,
|
|
4036
4117
|
{
|
|
4037
4118
|
id,
|
|
4038
4119
|
label: void 0,
|
|
4039
4120
|
description: void 0,
|
|
4040
4121
|
validation: validationState,
|
|
4041
|
-
children: /* @__PURE__ */
|
|
4122
|
+
children: /* @__PURE__ */ jsx88(
|
|
4042
4123
|
UploadInput2,
|
|
4043
4124
|
{
|
|
4044
4125
|
id,
|
|
@@ -4104,7 +4185,7 @@ var LargeUploadRenderer = {
|
|
|
4104
4185
|
};
|
|
4105
4186
|
const filetypes = acceptsToFileTypes(accepts);
|
|
4106
4187
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
4107
|
-
return /* @__PURE__ */
|
|
4188
|
+
return /* @__PURE__ */ jsx88(
|
|
4108
4189
|
FieldInput_default,
|
|
4109
4190
|
{
|
|
4110
4191
|
id,
|
|
@@ -4112,7 +4193,7 @@ var LargeUploadRenderer = {
|
|
|
4112
4193
|
description,
|
|
4113
4194
|
validation: validationState,
|
|
4114
4195
|
help,
|
|
4115
|
-
children: /* @__PURE__ */
|
|
4196
|
+
children: /* @__PURE__ */ jsx88(
|
|
4116
4197
|
Upload,
|
|
4117
4198
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
4118
4199
|
usAccept,
|
|
@@ -4130,7 +4211,7 @@ var LargeUploadRenderer = {
|
|
|
4130
4211
|
// ../renderers/src/UpsellRenderer.tsx
|
|
4131
4212
|
import { Nudge } from "@transferwise/components";
|
|
4132
4213
|
import { useState as useState14 } from "react";
|
|
4133
|
-
import { jsx as
|
|
4214
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
4134
4215
|
var UpsellRenderer = {
|
|
4135
4216
|
canRenderType: "upsell",
|
|
4136
4217
|
render: UpsellRendererComponent
|
|
@@ -4138,7 +4219,7 @@ var UpsellRenderer = {
|
|
|
4138
4219
|
function UpsellRendererComponent(props) {
|
|
4139
4220
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
4140
4221
|
const [isVisible, setIsVisible] = useState14(true);
|
|
4141
|
-
return isVisible ? /* @__PURE__ */
|
|
4222
|
+
return isVisible ? /* @__PURE__ */ jsx89(
|
|
4142
4223
|
Nudge,
|
|
4143
4224
|
{
|
|
4144
4225
|
className: getMargin(margin),
|
|
@@ -4190,7 +4271,7 @@ var supportedMediaNames = [
|
|
|
4190
4271
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
4191
4272
|
import { CircularButton } from "@transferwise/components";
|
|
4192
4273
|
var import_classnames7 = __toESM(require_classnames());
|
|
4193
|
-
import { jsx as
|
|
4274
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
4194
4275
|
var CircularButtonRenderer = {
|
|
4195
4276
|
canRenderType: "button",
|
|
4196
4277
|
canRender: ({ control }) => control === "circular",
|
|
@@ -4200,7 +4281,7 @@ function CircularButtonComponent(props) {
|
|
|
4200
4281
|
var _a;
|
|
4201
4282
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
4202
4283
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
4203
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsx90("div", { className: (0, import_classnames7.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx90(
|
|
4204
4285
|
CircularButton,
|
|
4205
4286
|
{
|
|
4206
4287
|
disabled,
|
|
@@ -4264,11 +4345,11 @@ var getWiseRenderers = () => [
|
|
|
4264
4345
|
|
|
4265
4346
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
4266
4347
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
4267
|
-
import { jsx as
|
|
4348
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
4268
4349
|
var InitialLoadingStateRenderer = {
|
|
4269
4350
|
canRenderType: "loading-state",
|
|
4270
4351
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
4271
|
-
render: () => /* @__PURE__ */
|
|
4352
|
+
render: () => /* @__PURE__ */ jsx91(
|
|
4272
4353
|
Loader2,
|
|
4273
4354
|
{
|
|
4274
4355
|
size: "md",
|
|
@@ -4279,7 +4360,7 @@ var InitialLoadingStateRenderer = {
|
|
|
4279
4360
|
};
|
|
4280
4361
|
|
|
4281
4362
|
// ../renderers/src/subflow/getSubflowRenderer.tsx
|
|
4282
|
-
import { jsx as
|
|
4363
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
4283
4364
|
var getSubflowRenderer = ({
|
|
4284
4365
|
Component: Component2,
|
|
4285
4366
|
canRender
|
|
@@ -4288,7 +4369,7 @@ var getSubflowRenderer = ({
|
|
|
4288
4369
|
canRenderType: "subflow",
|
|
4289
4370
|
canRender,
|
|
4290
4371
|
render: (props) => {
|
|
4291
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ jsx92(
|
|
4292
4373
|
Component2,
|
|
4293
4374
|
{
|
|
4294
4375
|
presentation: props.presentation,
|
|
@@ -4369,24 +4450,24 @@ var handleRejection = (error) => {
|
|
|
4369
4450
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
4370
4451
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
4371
4452
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
4372
|
-
import { jsx as
|
|
4453
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
4373
4454
|
function DynamicFlowModal(props) {
|
|
4374
4455
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
4375
4456
|
const dfProps = useWiseToCoreProps(rest);
|
|
4376
4457
|
const df = useDynamicFlowModal(dfProps);
|
|
4377
|
-
return /* @__PURE__ */
|
|
4458
|
+
return /* @__PURE__ */ jsx93(
|
|
4378
4459
|
Modal5,
|
|
4379
4460
|
__spreadProps(__spreadValues({
|
|
4380
4461
|
className: `dynamic-flow-modal ${className}`,
|
|
4381
4462
|
disableDimmerClickToClose: true
|
|
4382
4463
|
}, df.modal), {
|
|
4383
|
-
body: /* @__PURE__ */
|
|
4464
|
+
body: /* @__PURE__ */ jsx93("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
4384
4465
|
})
|
|
4385
4466
|
);
|
|
4386
4467
|
}
|
|
4387
4468
|
|
|
4388
4469
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
4389
|
-
import { jsx as
|
|
4470
|
+
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
4390
4471
|
var wiseRenderers = getWiseRenderers();
|
|
4391
4472
|
var getMergedRenderers = (props) => {
|
|
4392
4473
|
var _d, _e;
|
|
@@ -4400,7 +4481,7 @@ var getMergedRenderers = (props) => {
|
|
|
4400
4481
|
method: initialRequest.method,
|
|
4401
4482
|
data: initialRequest.body
|
|
4402
4483
|
};
|
|
4403
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
4484
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx94(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx94(
|
|
4404
4485
|
DynamicFlowModal,
|
|
4405
4486
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
4406
4487
|
features: subflowFeatures,
|
|
@@ -4477,7 +4558,7 @@ import {
|
|
|
4477
4558
|
useImperativeHandle
|
|
4478
4559
|
} from "react";
|
|
4479
4560
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
4480
|
-
import { jsx as
|
|
4561
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
4481
4562
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
4482
4563
|
const { className = "" } = props;
|
|
4483
4564
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -4493,7 +4574,7 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
4493
4574
|
}),
|
|
4494
4575
|
[df]
|
|
4495
4576
|
);
|
|
4496
|
-
return /* @__PURE__ */
|
|
4577
|
+
return /* @__PURE__ */ jsx95("div", { className, children: df.view });
|
|
4497
4578
|
});
|
|
4498
4579
|
|
|
4499
4580
|
// src/index.ts
|