@wise/dynamic-flow-client-internal 5.12.1 → 5.13.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.css +36 -0
- package/build/main.js +583 -448
- package/build/main.mjs +568 -433
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/dynamicFlow/DynamicFlow.d.ts.map +1 -1
- package/build/types/dynamicFlow/context-menu/useContextMenu.d.ts +14 -0
- package/build/types/dynamicFlow/context-menu/useContextMenu.d.ts.map +1 -0
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts +9 -0
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts.map +1 -0
- package/build/types/dynamicFlow/renderers.d.ts +1 -1
- package/package.json +15 -15
package/build/main.mjs
CHANGED
|
@@ -120,13 +120,144 @@ import { makeHttpClient } from "@wise/dynamic-flow-client";
|
|
|
120
120
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
121
121
|
import { useDynamicFlow } from "@wise/dynamic-flow-client";
|
|
122
122
|
|
|
123
|
+
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
124
|
+
import { useCallback, useEffect, useState } from "react";
|
|
125
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
126
|
+
function useContextMenu({ title, items }) {
|
|
127
|
+
const { menuPosition, openMenuAt, closeMenu } = useMenuPosition();
|
|
128
|
+
const onContextMenu = (event) => {
|
|
129
|
+
if (items.length > 0) {
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
openMenuAt({ x: event.clientX, y: event.clientY });
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const contextMenu = menuPosition ? /* @__PURE__ */ jsxs("div", { className: "df-context-menu", style: { top: menuPosition.y, left: menuPosition.x }, children: [
|
|
135
|
+
/* @__PURE__ */ jsx("div", { className: "menu-header", children: title }),
|
|
136
|
+
items.map(({ label, onClick }) => /* @__PURE__ */ jsx(
|
|
137
|
+
"button",
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
className: "menu-button",
|
|
141
|
+
onClick: () => {
|
|
142
|
+
closeMenu();
|
|
143
|
+
onClick();
|
|
144
|
+
},
|
|
145
|
+
children: label
|
|
146
|
+
},
|
|
147
|
+
label
|
|
148
|
+
))
|
|
149
|
+
] }) : null;
|
|
150
|
+
return {
|
|
151
|
+
onContextMenu,
|
|
152
|
+
contextMenu
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
var useMenuPosition = () => {
|
|
156
|
+
const [menuPosition, setMenuPosition] = useState(null);
|
|
157
|
+
const clearMenu = useCallback(() => setMenuPosition(null), []);
|
|
158
|
+
const openMenuAt = useCallback(
|
|
159
|
+
(position) => {
|
|
160
|
+
setMenuPosition(position);
|
|
161
|
+
window.addEventListener("click", clearMenu);
|
|
162
|
+
},
|
|
163
|
+
[clearMenu]
|
|
164
|
+
);
|
|
165
|
+
const closeMenu = useCallback(() => {
|
|
166
|
+
setMenuPosition(null);
|
|
167
|
+
window.removeEventListener("click", clearMenu);
|
|
168
|
+
}, [clearMenu]);
|
|
169
|
+
useEffect(() => clearMenu, [clearMenu]);
|
|
170
|
+
return { menuPosition, openMenuAt, closeMenu };
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// src/dynamicFlow/context-menu/useDFContextMenu.tsx
|
|
174
|
+
var useDFContextMenu = (controller) => {
|
|
175
|
+
const getCurrentStepWithModel = async () => {
|
|
176
|
+
const step = controller.getCurrentStep();
|
|
177
|
+
if (!step) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
const model = await controller.getSubmittableValue();
|
|
181
|
+
return __spreadProps(__spreadValues({}, step), { model });
|
|
182
|
+
};
|
|
183
|
+
const getEncodedCurrentStep = () => {
|
|
184
|
+
const step = controller.getCurrentStep();
|
|
185
|
+
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
186
|
+
};
|
|
187
|
+
const getEncodedCurrentStepWithModel = async () => {
|
|
188
|
+
const step = await getCurrentStepWithModel();
|
|
189
|
+
return step ? toBase64(JSON.stringify(step, null, 2)) : null;
|
|
190
|
+
};
|
|
191
|
+
return useContextMenu({
|
|
192
|
+
title: "DynamicFlow Menu",
|
|
193
|
+
items: isDevOrStaging() ? [
|
|
194
|
+
{
|
|
195
|
+
label: "Open in Sandbox",
|
|
196
|
+
onClick: () => {
|
|
197
|
+
openInSandbox(getEncodedCurrentStep());
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
label: "Open in Sandbox (with model)",
|
|
202
|
+
onClick: () => {
|
|
203
|
+
void getEncodedCurrentStepWithModel().then(openInSandbox);
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
label: "Copy step JSON",
|
|
208
|
+
onClick: () => {
|
|
209
|
+
copyToClipboard(controller.getCurrentStep());
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
label: "Copy step JSON (with model)",
|
|
214
|
+
onClick: () => {
|
|
215
|
+
void getCurrentStepWithModel().then(copyToClipboard);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
] : []
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
var toBase64 = (str) => {
|
|
222
|
+
const bytes = new TextEncoder().encode(str);
|
|
223
|
+
const binString = Array.from(bytes, (b) => String.fromCharCode(b)).join("");
|
|
224
|
+
return btoa(binString);
|
|
225
|
+
};
|
|
226
|
+
var openInSandbox = (base64Step) => {
|
|
227
|
+
if (base64Step) {
|
|
228
|
+
window.open(`https://df.wise.com/sandbox#${base64Step}`, "_blank");
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var copyToClipboard = (step) => {
|
|
232
|
+
if (step) {
|
|
233
|
+
void navigator.clipboard.writeText(JSON.stringify(step, null, 2));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
var isDevOrStaging = () => {
|
|
237
|
+
const validHostNames = ["localhost", "dev-wi.se"];
|
|
238
|
+
try {
|
|
239
|
+
if (typeof window === "undefined" || !window.location) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
const currentHostname = window.location.hostname;
|
|
243
|
+
if (!currentHostname) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
return validHostNames.some(
|
|
247
|
+
(hostname) => currentHostname === hostname || currentHostname.endsWith(`.${hostname}`)
|
|
248
|
+
);
|
|
249
|
+
} catch (e) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
123
254
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
124
255
|
import { useMemo as useMemo2 } from "react";
|
|
125
256
|
|
|
126
257
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
127
258
|
var appVersion = (
|
|
128
259
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
129
|
-
typeof process !== "undefined" ? "5.
|
|
260
|
+
typeof process !== "undefined" ? "5.13.0" : "0.0.0"
|
|
130
261
|
);
|
|
131
262
|
|
|
132
263
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -212,10 +343,10 @@ var getTextAlignment = (align) => {
|
|
|
212
343
|
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
213
344
|
|
|
214
345
|
// ../renderers/src/AlertRenderer.tsx
|
|
215
|
-
import { jsx } from "react/jsx-runtime";
|
|
346
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
216
347
|
var AlertRenderer = {
|
|
217
348
|
canRenderType: "alert",
|
|
218
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */
|
|
349
|
+
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ jsx2(
|
|
219
350
|
Alert,
|
|
220
351
|
{
|
|
221
352
|
type: context,
|
|
@@ -238,13 +369,13 @@ var AlertRenderer_default = AlertRenderer;
|
|
|
238
369
|
|
|
239
370
|
// ../renderers/src/BoxRenderer.tsx
|
|
240
371
|
var import_classnames = __toESM(require_classnames());
|
|
241
|
-
import { jsx as
|
|
372
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
242
373
|
var BoxRenderer = {
|
|
243
374
|
canRenderType: "box",
|
|
244
375
|
render: ({ children, control, margin, width }) => {
|
|
245
376
|
const hasFixedWidth = width !== "xl";
|
|
246
377
|
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
247
|
-
const contents = /* @__PURE__ */
|
|
378
|
+
const contents = /* @__PURE__ */ jsx3(
|
|
248
379
|
"div",
|
|
249
380
|
{
|
|
250
381
|
className: (0, import_classnames.default)({
|
|
@@ -255,7 +386,7 @@ var BoxRenderer = {
|
|
|
255
386
|
children
|
|
256
387
|
}
|
|
257
388
|
);
|
|
258
|
-
return hasFixedWidth ? /* @__PURE__ */
|
|
389
|
+
return hasFixedWidth ? /* @__PURE__ */ jsx3("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
259
390
|
}
|
|
260
391
|
};
|
|
261
392
|
var BoxRenderer_default = BoxRenderer;
|
|
@@ -275,8 +406,8 @@ var loading_button_messages_default = defineMessages({
|
|
|
275
406
|
});
|
|
276
407
|
|
|
277
408
|
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
278
|
-
import { useEffect, useState } from "react";
|
|
279
|
-
import { jsx as
|
|
409
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
410
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
280
411
|
var AddressValidationButtonRenderer = {
|
|
281
412
|
canRenderType: "button",
|
|
282
413
|
canRender: ({ control }) => control === "address-validation",
|
|
@@ -285,8 +416,8 @@ var AddressValidationButtonRenderer = {
|
|
|
285
416
|
function AddressValidationButtonComponent(props) {
|
|
286
417
|
const { disabled, margin, title, stepLoadingState, onClick } = props;
|
|
287
418
|
const { formatMessage } = useIntl();
|
|
288
|
-
const [spinny, setSpinny] =
|
|
289
|
-
|
|
419
|
+
const [spinny, setSpinny] = useState2(false);
|
|
420
|
+
useEffect2(() => {
|
|
290
421
|
if (stepLoadingState === "idle") {
|
|
291
422
|
setSpinny(false);
|
|
292
423
|
}
|
|
@@ -296,8 +427,8 @@ function AddressValidationButtonComponent(props) {
|
|
|
296
427
|
setSpinny(false);
|
|
297
428
|
}
|
|
298
429
|
};
|
|
299
|
-
return /* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ jsxs2("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
431
|
+
/* @__PURE__ */ jsx4(
|
|
301
432
|
Button,
|
|
302
433
|
{
|
|
303
434
|
v2: true,
|
|
@@ -314,7 +445,7 @@ function AddressValidationButtonComponent(props) {
|
|
|
314
445
|
children: title
|
|
315
446
|
}
|
|
316
447
|
),
|
|
317
|
-
spinny && /* @__PURE__ */
|
|
448
|
+
spinny && /* @__PURE__ */ jsx4(InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
318
449
|
] });
|
|
319
450
|
}
|
|
320
451
|
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
@@ -345,16 +476,16 @@ var mapLegacyButtonSize = (size) => {
|
|
|
345
476
|
};
|
|
346
477
|
|
|
347
478
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
348
|
-
import { useEffect as
|
|
479
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
349
480
|
|
|
350
481
|
// ../renderers/src/utils/UrnFlag.tsx
|
|
351
482
|
import { Flag } from "@wise/art";
|
|
352
|
-
import { jsx as
|
|
483
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
353
484
|
var countryUrnPrefix = "urn:wise:countries:";
|
|
354
485
|
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
355
486
|
var isUrnFlag = (uri) => (uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix)) && uri.endsWith(":image");
|
|
356
487
|
function UrnFlag({ size, urn }) {
|
|
357
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ jsx5(Flag, { code: getCode(urn), intrinsicSize: size });
|
|
358
489
|
}
|
|
359
490
|
var getCode = (urn) => {
|
|
360
491
|
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
@@ -362,19 +493,19 @@ var getCode = (urn) => {
|
|
|
362
493
|
|
|
363
494
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
364
495
|
import { Flag as Flag2 } from "@wise/art";
|
|
365
|
-
import { jsx as
|
|
496
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
366
497
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
367
498
|
function FlagIcon({ name }) {
|
|
368
499
|
if (!isFlagIcon(name)) {
|
|
369
500
|
return null;
|
|
370
501
|
}
|
|
371
502
|
const code = name.substring(5);
|
|
372
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ jsx6(Flag2, { code, intrinsicSize: 24 });
|
|
373
504
|
}
|
|
374
505
|
|
|
375
506
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
376
507
|
import * as icons from "@transferwise/icons";
|
|
377
|
-
import { jsx as
|
|
508
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
378
509
|
var isNamedIcon = (name) => {
|
|
379
510
|
const iconName = toCapitalisedCamelCase(name);
|
|
380
511
|
return Object.keys(icons).includes(iconName);
|
|
@@ -385,19 +516,19 @@ function NamedIcon({ name, size = 24 }) {
|
|
|
385
516
|
}
|
|
386
517
|
const iconName = toCapitalisedCamelCase(name);
|
|
387
518
|
const Icon = icons[iconName];
|
|
388
|
-
return /* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ jsx7(Icon, { size });
|
|
389
520
|
}
|
|
390
521
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
391
|
-
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
522
|
+
var capitaliseFirstChar = (value) => value.length === 0 ? "" : `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
392
523
|
|
|
393
524
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
394
|
-
import { jsx as
|
|
525
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
395
526
|
function DynamicIcon({ name, size }) {
|
|
396
527
|
if (isFlagIcon(name)) {
|
|
397
|
-
return /* @__PURE__ */
|
|
528
|
+
return /* @__PURE__ */ jsx8(FlagIcon, { name });
|
|
398
529
|
}
|
|
399
530
|
if (isNamedIcon(name)) {
|
|
400
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ jsx8(NamedIcon, { name, size });
|
|
401
532
|
}
|
|
402
533
|
return null;
|
|
403
534
|
}
|
|
@@ -429,11 +560,11 @@ var stringToURN = (uri) => {
|
|
|
429
560
|
};
|
|
430
561
|
|
|
431
562
|
// ../renderers/src/components/Media/resolveMediaFromUri.tsx
|
|
432
|
-
import { jsx as
|
|
563
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
433
564
|
var resolveMediaFromUri = (uri, size) => {
|
|
434
565
|
const { name, qComponents } = stringToURN(uri);
|
|
435
566
|
if (isValidIconUrn(name)) {
|
|
436
|
-
const icon = /* @__PURE__ */
|
|
567
|
+
const icon = /* @__PURE__ */ jsx9(DynamicIcon_default, { name: name.replace("urn:wise:icons:", ""), size: size === 48 ? 32 : size });
|
|
437
568
|
return {
|
|
438
569
|
icon,
|
|
439
570
|
color: formatColor(qComponents["foreground-color"]),
|
|
@@ -442,7 +573,7 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
442
573
|
}
|
|
443
574
|
if (isUrnFlag(name)) {
|
|
444
575
|
return {
|
|
445
|
-
asset: /* @__PURE__ */
|
|
576
|
+
asset: /* @__PURE__ */ jsx9(UrnFlag, { urn: name, size })
|
|
446
577
|
};
|
|
447
578
|
}
|
|
448
579
|
if (name.startsWith("data:text/plain,")) {
|
|
@@ -454,7 +585,7 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
454
585
|
};
|
|
455
586
|
}
|
|
456
587
|
if (!uri.startsWith("urn:")) {
|
|
457
|
-
return { asset: /* @__PURE__ */
|
|
588
|
+
return { asset: /* @__PURE__ */ jsx9("img", { src: uri, alt: "", width: `${size}px` }) };
|
|
458
589
|
}
|
|
459
590
|
return { asset: void 0 };
|
|
460
591
|
};
|
|
@@ -470,7 +601,7 @@ var formatColor = (color) => {
|
|
|
470
601
|
|
|
471
602
|
// ../renderers/src/components/Media/AvatarMedia.tsx
|
|
472
603
|
import { AvatarLayout, AvatarView } from "@transferwise/components";
|
|
473
|
-
import { jsx as
|
|
604
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
474
605
|
var AvatarMedia = ({
|
|
475
606
|
accessibilityDescription,
|
|
476
607
|
content,
|
|
@@ -493,7 +624,7 @@ var AvatarMedia = ({
|
|
|
493
624
|
if (!asset && !icon) {
|
|
494
625
|
return null;
|
|
495
626
|
}
|
|
496
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ jsx10(
|
|
497
628
|
AvatarView,
|
|
498
629
|
{
|
|
499
630
|
"aria-label": accessibilityDescription,
|
|
@@ -508,7 +639,7 @@ var AvatarMedia = ({
|
|
|
508
639
|
asset: icon != null ? icon : asset,
|
|
509
640
|
style: { backgroundColor, color }
|
|
510
641
|
}));
|
|
511
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ jsx10(
|
|
512
643
|
AvatarLayout,
|
|
513
644
|
{
|
|
514
645
|
"aria-label": accessibilityDescription,
|
|
@@ -527,7 +658,7 @@ var getBadge = ({
|
|
|
527
658
|
}) => {
|
|
528
659
|
if (backgroundColor || color) {
|
|
529
660
|
return {
|
|
530
|
-
asset: /* @__PURE__ */
|
|
661
|
+
asset: /* @__PURE__ */ jsx10(
|
|
531
662
|
"div",
|
|
532
663
|
{
|
|
533
664
|
className: "d-flex align-items-center justify-content-center",
|
|
@@ -550,11 +681,11 @@ var getBadge = ({
|
|
|
550
681
|
|
|
551
682
|
// ../renderers/src/utils/image-utils.tsx
|
|
552
683
|
import { AvatarView as AvatarView2 } from "@transferwise/components";
|
|
553
|
-
import { jsx as
|
|
684
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
554
685
|
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
555
686
|
if (iconNode && imageNode) {
|
|
556
687
|
if (imageNode && iconNode) {
|
|
557
|
-
return /* @__PURE__ */
|
|
688
|
+
return /* @__PURE__ */ jsx11(AvatarView2, { size, badge: { asset: iconNode, type: "reference" }, children: imageNode });
|
|
558
689
|
}
|
|
559
690
|
}
|
|
560
691
|
return null;
|
|
@@ -562,7 +693,7 @@ var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
|
562
693
|
var getIconNode = (icon) => {
|
|
563
694
|
if (icon) {
|
|
564
695
|
if ("name" in icon) {
|
|
565
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ jsx11(DynamicIcon_default, { name: icon.name });
|
|
566
697
|
}
|
|
567
698
|
if (icon.text) {
|
|
568
699
|
return icon.text;
|
|
@@ -574,10 +705,10 @@ var getImageNode = (image, size) => {
|
|
|
574
705
|
if (image) {
|
|
575
706
|
const { accessibilityDescription, uri } = image;
|
|
576
707
|
if (!uri.startsWith("urn:")) {
|
|
577
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsx11("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
578
709
|
}
|
|
579
710
|
if (isUrnFlag(uri)) {
|
|
580
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsx11(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
581
712
|
}
|
|
582
713
|
}
|
|
583
714
|
return null;
|
|
@@ -585,7 +716,7 @@ var getImageNode = (image, size) => {
|
|
|
585
716
|
|
|
586
717
|
// ../renderers/src/components/Media/LegacyMedia.tsx
|
|
587
718
|
import { AvatarView as AvatarView3 } from "@transferwise/components";
|
|
588
|
-
import { jsx as
|
|
719
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
589
720
|
var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
590
721
|
const imageNode = getImageNode(image, size);
|
|
591
722
|
const iconNode = getIconNode(icon);
|
|
@@ -594,11 +725,11 @@ var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
|
594
725
|
return badge;
|
|
595
726
|
}
|
|
596
727
|
if (imageNode) {
|
|
597
|
-
return preferAvatar ? /* @__PURE__ */
|
|
728
|
+
return preferAvatar ? /* @__PURE__ */ jsx12(AvatarView3, { children: imageNode }) : imageNode;
|
|
598
729
|
}
|
|
599
730
|
if (iconNode && icon) {
|
|
600
731
|
if ("text" in icon || size === 48) {
|
|
601
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ jsx12(AvatarView3, { size, children: iconNode });
|
|
602
733
|
}
|
|
603
734
|
return iconNode;
|
|
604
735
|
}
|
|
@@ -606,17 +737,17 @@ var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
|
606
737
|
};
|
|
607
738
|
|
|
608
739
|
// ../renderers/src/components/Media/Media.tsx
|
|
609
|
-
import { jsx as
|
|
740
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
610
741
|
var Media = ({ media, preferAvatar = false, size }) => {
|
|
611
742
|
switch (media == null ? void 0 : media.type) {
|
|
612
743
|
case "avatar":
|
|
613
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ jsx13(AvatarMedia, __spreadProps(__spreadValues({}, media), { size }));
|
|
614
745
|
case "image": {
|
|
615
746
|
const { asset, icon } = resolveMediaFromUri(media.uri, size);
|
|
616
747
|
return icon != null ? icon : asset;
|
|
617
748
|
}
|
|
618
749
|
case "legacy": {
|
|
619
|
-
return /* @__PURE__ */
|
|
750
|
+
return /* @__PURE__ */ jsx13(LegacyMedia, __spreadProps(__spreadValues({}, media), { preferAvatar, size }));
|
|
620
751
|
}
|
|
621
752
|
default:
|
|
622
753
|
return null;
|
|
@@ -624,15 +755,15 @@ var Media = ({ media, preferAvatar = false, size }) => {
|
|
|
624
755
|
};
|
|
625
756
|
|
|
626
757
|
// ../renderers/src/components/Media/OptionMedia.tsx
|
|
627
|
-
import { jsx as
|
|
758
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
628
759
|
var mediaSize = 48;
|
|
629
760
|
function OptionMedia(props) {
|
|
630
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ jsx14(Media, __spreadProps(__spreadValues({}, props), { size: mediaSize }));
|
|
631
762
|
}
|
|
632
763
|
|
|
633
764
|
// ../renderers/src/components/Media/getInlineMedia.tsx
|
|
634
|
-
import { jsx as
|
|
635
|
-
var getInlineMedia = (media) => media ? /* @__PURE__ */
|
|
765
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
766
|
+
var getInlineMedia = (media) => media ? /* @__PURE__ */ jsx15(Media, { media, preferAvatar: false, size: 24 }) : null;
|
|
636
767
|
|
|
637
768
|
// ../renderers/src/components/Media/getAddonStartMedia.ts
|
|
638
769
|
var getAddonStartMedia = (media) => {
|
|
@@ -653,7 +784,7 @@ var getAddonStartMedia = (media) => {
|
|
|
653
784
|
|
|
654
785
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
655
786
|
var import_classnames2 = __toESM(require_classnames());
|
|
656
|
-
import { jsx as
|
|
787
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
657
788
|
var ButtonRenderer = {
|
|
658
789
|
canRenderType: "button",
|
|
659
790
|
render: ButtonComponent
|
|
@@ -671,8 +802,8 @@ function ButtonComponent(props) {
|
|
|
671
802
|
stepLoadingState,
|
|
672
803
|
onClick
|
|
673
804
|
} = props;
|
|
674
|
-
const [spinny, setSpinny] =
|
|
675
|
-
|
|
805
|
+
const [spinny, setSpinny] = useState3(false);
|
|
806
|
+
useEffect3(() => {
|
|
676
807
|
if (stepLoadingState === "idle") {
|
|
677
808
|
setSpinny(false);
|
|
678
809
|
}
|
|
@@ -702,7 +833,7 @@ function ButtonComponent(props) {
|
|
|
702
833
|
onClick();
|
|
703
834
|
}
|
|
704
835
|
};
|
|
705
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ jsx16(Button2, __spreadProps(__spreadValues({}, buttonProps), { children: title }));
|
|
706
837
|
}
|
|
707
838
|
var getSentiment = (context) => context === "negative" ? "negative" : "default";
|
|
708
839
|
var getPriority = (control, tags) => {
|
|
@@ -731,13 +862,13 @@ var help_messages_default = defineMessages2({
|
|
|
731
862
|
});
|
|
732
863
|
|
|
733
864
|
// ../renderers/src/components/Help.tsx
|
|
734
|
-
import { jsx as
|
|
865
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
735
866
|
function Help({ help, onClick }) {
|
|
736
867
|
const intl = useIntl2();
|
|
737
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ jsx17(
|
|
738
869
|
Info,
|
|
739
870
|
{
|
|
740
|
-
content: /* @__PURE__ */
|
|
871
|
+
content: /* @__PURE__ */ jsx17(Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
741
872
|
presentation: "POPOVER",
|
|
742
873
|
size: "sm",
|
|
743
874
|
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
@@ -748,19 +879,19 @@ function Help({ help, onClick }) {
|
|
|
748
879
|
var Help_default = Help;
|
|
749
880
|
|
|
750
881
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
751
|
-
import { jsx as
|
|
882
|
+
import { jsx as jsx18, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
752
883
|
function LabelContentWithHelp({ text, help }) {
|
|
753
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ jsxs3("div", { children: [
|
|
754
885
|
text,
|
|
755
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ jsx18(Help_default, { help })
|
|
756
887
|
] });
|
|
757
888
|
}
|
|
758
889
|
|
|
759
890
|
// ../renderers/src/components/FieldInput.tsx
|
|
760
|
-
import { jsx as
|
|
891
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
761
892
|
function FieldInput({ id, children, label, validation, description, help }) {
|
|
762
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
763
|
-
return /* @__PURE__ */
|
|
893
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx19(LabelContentWithHelp, { text: label, help }) : label;
|
|
894
|
+
return /* @__PURE__ */ jsx19(
|
|
764
895
|
Field,
|
|
765
896
|
{
|
|
766
897
|
id,
|
|
@@ -787,17 +918,17 @@ var FieldInput_default = FieldInput;
|
|
|
787
918
|
import { Checkbox, ListItem as ListItem3 } from "@transferwise/components";
|
|
788
919
|
|
|
789
920
|
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
790
|
-
import { jsx as
|
|
791
|
-
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */
|
|
921
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
922
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ jsx20(OptionMedia, { media, preferAvatar }) : void 0;
|
|
792
923
|
|
|
793
924
|
// ../renderers/src/utils/listItem/getAdditionalText.tsx
|
|
794
925
|
import { ListItem } from "@transferwise/components";
|
|
795
|
-
import { jsx as
|
|
926
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
796
927
|
var getAdditionalText = (additionalText) => {
|
|
797
928
|
if (!additionalText) {
|
|
798
929
|
return void 0;
|
|
799
930
|
}
|
|
800
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ jsx21(ListItem.AdditionalInfo, { children: additionalText });
|
|
801
932
|
};
|
|
802
933
|
|
|
803
934
|
// ../renderers/src/utils/listItem/getSupportingValues.ts
|
|
@@ -807,22 +938,22 @@ var getSupportingValues = (supportingValues) => {
|
|
|
807
938
|
|
|
808
939
|
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
809
940
|
import { ListItem as ListItem2 } from "@transferwise/components";
|
|
810
|
-
import { jsx as
|
|
811
|
-
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */
|
|
941
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
942
|
+
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx22(ListItem2.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
812
943
|
|
|
813
944
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
814
|
-
import { jsx as
|
|
945
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
815
946
|
var CheckboxInputRenderer = {
|
|
816
947
|
canRenderType: "input-checkbox",
|
|
817
948
|
render: (props) => {
|
|
818
949
|
switch (props.control) {
|
|
819
950
|
case "switch-item":
|
|
820
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ jsx23(SwitchItemComponent, __spreadValues({}, props));
|
|
821
952
|
case "checkbox-item":
|
|
822
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ jsx23(CheckboxItemComponent, __spreadValues({}, props));
|
|
823
954
|
case "checkbox":
|
|
824
955
|
default:
|
|
825
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ jsx23(CheckboxComponent, __spreadValues({}, props));
|
|
826
957
|
}
|
|
827
958
|
}
|
|
828
959
|
};
|
|
@@ -847,7 +978,7 @@ var CheckboxComponent = (props) => {
|
|
|
847
978
|
"value"
|
|
848
979
|
]);
|
|
849
980
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
850
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ jsx23(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx23(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
851
982
|
};
|
|
852
983
|
var CheckboxItemComponent = (props) => {
|
|
853
984
|
const {
|
|
@@ -862,7 +993,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
862
993
|
value,
|
|
863
994
|
onChange
|
|
864
995
|
} = props;
|
|
865
|
-
return /* @__PURE__ */
|
|
996
|
+
return /* @__PURE__ */ jsx23(
|
|
866
997
|
ListItem3,
|
|
867
998
|
__spreadValues({
|
|
868
999
|
title,
|
|
@@ -871,7 +1002,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
871
1002
|
media: getMedia(media, false),
|
|
872
1003
|
disabled,
|
|
873
1004
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
874
|
-
control: /* @__PURE__ */
|
|
1005
|
+
control: /* @__PURE__ */ jsx23(ListItem3.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
875
1006
|
}, getSupportingValues(supportingValues))
|
|
876
1007
|
);
|
|
877
1008
|
};
|
|
@@ -888,7 +1019,7 @@ var SwitchItemComponent = (props) => {
|
|
|
888
1019
|
value,
|
|
889
1020
|
onChange
|
|
890
1021
|
} = props;
|
|
891
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ jsx23(
|
|
892
1023
|
ListItem3,
|
|
893
1024
|
__spreadValues({
|
|
894
1025
|
title,
|
|
@@ -897,13 +1028,13 @@ var SwitchItemComponent = (props) => {
|
|
|
897
1028
|
media: getMedia(media, false),
|
|
898
1029
|
disabled,
|
|
899
1030
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
900
|
-
control: /* @__PURE__ */
|
|
1031
|
+
control: /* @__PURE__ */ jsx23(ListItem3.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
901
1032
|
}, getSupportingValues(supportingValues))
|
|
902
1033
|
);
|
|
903
1034
|
};
|
|
904
1035
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
905
1036
|
if (validationState && validationState.status === "invalid") {
|
|
906
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ jsx23(ListItem3.Prompt, { sentiment: "negative", children: validationState.message });
|
|
907
1038
|
}
|
|
908
1039
|
return getInlineAlert(inlineAlert);
|
|
909
1040
|
};
|
|
@@ -911,10 +1042,10 @@ var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
|
911
1042
|
|
|
912
1043
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
913
1044
|
var import_classnames3 = __toESM(require_classnames());
|
|
914
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
915
1046
|
var ColumnsRenderer = {
|
|
916
1047
|
canRenderType: "columns",
|
|
917
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */
|
|
1048
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs4(
|
|
918
1049
|
"div",
|
|
919
1050
|
{
|
|
920
1051
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -922,8 +1053,8 @@ var ColumnsRenderer = {
|
|
|
922
1053
|
"df-columns-renderer-bias-end": bias === "end"
|
|
923
1054
|
}),
|
|
924
1055
|
children: [
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ jsx24("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
1057
|
+
/* @__PURE__ */ jsx24("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
927
1058
|
]
|
|
928
1059
|
}
|
|
929
1060
|
)
|
|
@@ -958,7 +1089,7 @@ var dateToDateString = (date) => {
|
|
|
958
1089
|
};
|
|
959
1090
|
|
|
960
1091
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
961
|
-
import { jsx as
|
|
1092
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
962
1093
|
function VariableDateInput({
|
|
963
1094
|
control,
|
|
964
1095
|
inputProps
|
|
@@ -974,7 +1105,7 @@ function VariableDateInput({
|
|
|
974
1105
|
onFocus
|
|
975
1106
|
} = inputProps;
|
|
976
1107
|
if (control === "date-lookup") {
|
|
977
|
-
return /* @__PURE__ */
|
|
1108
|
+
return /* @__PURE__ */ jsx25(
|
|
978
1109
|
DateLookup,
|
|
979
1110
|
{
|
|
980
1111
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -990,7 +1121,7 @@ function VariableDateInput({
|
|
|
990
1121
|
}
|
|
991
1122
|
);
|
|
992
1123
|
}
|
|
993
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ jsx25(
|
|
994
1125
|
DateInput,
|
|
995
1126
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
996
1127
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -1007,7 +1138,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1007
1138
|
var VariableDateInput_default = VariableDateInput;
|
|
1008
1139
|
|
|
1009
1140
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1010
|
-
import { jsx as
|
|
1141
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1011
1142
|
var DateInputRenderer = {
|
|
1012
1143
|
canRenderType: "input-date",
|
|
1013
1144
|
render: (props) => {
|
|
@@ -1032,7 +1163,7 @@ var DateInputRenderer = {
|
|
|
1032
1163
|
]);
|
|
1033
1164
|
const value = initialValue != null ? initialValue : "";
|
|
1034
1165
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1035
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ jsx26(
|
|
1036
1167
|
FieldInput_default,
|
|
1037
1168
|
{
|
|
1038
1169
|
id,
|
|
@@ -1040,7 +1171,7 @@ var DateInputRenderer = {
|
|
|
1040
1171
|
description,
|
|
1041
1172
|
validation: validationState,
|
|
1042
1173
|
help,
|
|
1043
|
-
children: /* @__PURE__ */
|
|
1174
|
+
children: /* @__PURE__ */ jsx26(VariableDateInput_default, { control, inputProps })
|
|
1044
1175
|
}
|
|
1045
1176
|
);
|
|
1046
1177
|
}
|
|
@@ -1052,14 +1183,14 @@ import { ListItem as ListItem5 } from "@transferwise/components";
|
|
|
1052
1183
|
|
|
1053
1184
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1054
1185
|
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
1055
|
-
import { jsx as
|
|
1186
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1056
1187
|
var getAdditionalInfo = (additionalInfo) => {
|
|
1057
1188
|
if (!additionalInfo) {
|
|
1058
1189
|
return void 0;
|
|
1059
1190
|
}
|
|
1060
1191
|
const { href, text, onClick } = additionalInfo;
|
|
1061
1192
|
if (href || onClick) {
|
|
1062
|
-
return /* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ jsx27(
|
|
1063
1194
|
ListItem4.AdditionalInfo,
|
|
1064
1195
|
{
|
|
1065
1196
|
action: {
|
|
@@ -1071,7 +1202,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
1071
1202
|
}
|
|
1072
1203
|
);
|
|
1073
1204
|
}
|
|
1074
|
-
return /* @__PURE__ */
|
|
1205
|
+
return /* @__PURE__ */ jsx27(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1075
1206
|
};
|
|
1076
1207
|
|
|
1077
1208
|
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
@@ -1082,7 +1213,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
1082
1213
|
|
|
1083
1214
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1084
1215
|
import { Header as Header2, SearchInput } from "@transferwise/components";
|
|
1085
|
-
import { useState as
|
|
1216
|
+
import { useState as useState4 } from "react";
|
|
1086
1217
|
import { useIntl as useIntl4 } from "react-intl";
|
|
1087
1218
|
|
|
1088
1219
|
// ../renderers/src/messages/filter.messages.ts
|
|
@@ -1192,7 +1323,7 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
1192
1323
|
};
|
|
1193
1324
|
|
|
1194
1325
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1195
|
-
import { Fragment, jsx as
|
|
1326
|
+
import { Fragment, jsx as jsx28, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1196
1327
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1197
1328
|
var isGroupedDecision = (options) => {
|
|
1198
1329
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
@@ -1202,8 +1333,8 @@ var GroupedDecisionList = (_a) => {
|
|
|
1202
1333
|
const { formatMessage } = useIntl3();
|
|
1203
1334
|
const { options } = rest;
|
|
1204
1335
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
1205
|
-
return /* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1336
|
+
return /* @__PURE__ */ jsx28(Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs5(Section, { children: [
|
|
1337
|
+
/* @__PURE__ */ jsx28(
|
|
1207
1338
|
Header,
|
|
1208
1339
|
{
|
|
1209
1340
|
as: "h2",
|
|
@@ -1215,25 +1346,25 @@ var GroupedDecisionList = (_a) => {
|
|
|
1215
1346
|
};
|
|
1216
1347
|
|
|
1217
1348
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1218
|
-
import { Fragment as Fragment2, jsx as
|
|
1349
|
+
import { Fragment as Fragment2, jsx as jsx29, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1219
1350
|
var DecisionWrapper = (props) => {
|
|
1220
|
-
return /* @__PURE__ */
|
|
1221
|
-
props.title && /* @__PURE__ */
|
|
1222
|
-
props.control === "filtered" ? /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ jsxs6("div", { className: getMargin(props.margin), children: [
|
|
1352
|
+
props.title && /* @__PURE__ */ jsx29(Header2, { as: "h2", title: props.title }),
|
|
1353
|
+
props.control === "filtered" ? /* @__PURE__ */ jsx29(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx29(UnfilteredDecisionList, __spreadValues({}, props))
|
|
1223
1354
|
] });
|
|
1224
1355
|
};
|
|
1225
1356
|
var UnfilteredDecisionList = (_a) => {
|
|
1226
1357
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1227
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
1358
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx29(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
1228
1359
|
};
|
|
1229
1360
|
var FilteredDecisionList = (props) => {
|
|
1230
1361
|
const { formatMessage } = useIntl4();
|
|
1231
|
-
const [query, setQuery] =
|
|
1362
|
+
const [query, setQuery] = useState4("");
|
|
1232
1363
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
1233
1364
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
1234
1365
|
const isGrouped = isGroupedDecision(options);
|
|
1235
|
-
return /* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1367
|
+
/* @__PURE__ */ jsx29(
|
|
1237
1368
|
SearchInput,
|
|
1238
1369
|
{
|
|
1239
1370
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -1245,25 +1376,25 @@ var FilteredDecisionList = (props) => {
|
|
|
1245
1376
|
}
|
|
1246
1377
|
}
|
|
1247
1378
|
),
|
|
1248
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
1249
|
-
query.length > 0 && /* @__PURE__ */
|
|
1379
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx29(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1380
|
+
query.length > 0 && /* @__PURE__ */ jsx29(Header2, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
1250
1381
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
1251
1382
|
control,
|
|
1252
1383
|
className: query.length === 0 ? "m-t-3" : "",
|
|
1253
1384
|
options: filteredOptions
|
|
1254
|
-
}) : /* @__PURE__ */
|
|
1385
|
+
}) : /* @__PURE__ */ jsx29("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
1255
1386
|
] })
|
|
1256
1387
|
] });
|
|
1257
1388
|
};
|
|
1258
1389
|
|
|
1259
1390
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1260
|
-
import { Fragment as Fragment3, jsx as
|
|
1391
|
+
import { Fragment as Fragment3, jsx as jsx30 } from "react/jsx-runtime";
|
|
1261
1392
|
var DecisionRenderer = {
|
|
1262
1393
|
canRenderType: "decision",
|
|
1263
|
-
render: (props) => /* @__PURE__ */
|
|
1394
|
+
render: (props) => /* @__PURE__ */ jsx30(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
1264
1395
|
};
|
|
1265
1396
|
var renderDecisionList = ({ options, control }) => {
|
|
1266
|
-
return /* @__PURE__ */
|
|
1397
|
+
return /* @__PURE__ */ jsx30(Fragment3, { children: options.map((_a) => {
|
|
1267
1398
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
1268
1399
|
const {
|
|
1269
1400
|
description,
|
|
@@ -1276,7 +1407,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1276
1407
|
supportingValues,
|
|
1277
1408
|
tags
|
|
1278
1409
|
} = rest;
|
|
1279
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ jsx30(
|
|
1280
1411
|
ListItem5,
|
|
1281
1412
|
{
|
|
1282
1413
|
title: itemTitle,
|
|
@@ -1288,7 +1419,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
1288
1419
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
1289
1420
|
prompt: getInlineAlert(inlineAlert),
|
|
1290
1421
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
1291
|
-
control: href ? /* @__PURE__ */
|
|
1422
|
+
control: href ? /* @__PURE__ */ jsx30(ListItem5.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx30(ListItem5.Navigation, { onClick })
|
|
1292
1423
|
},
|
|
1293
1424
|
JSON.stringify(rest)
|
|
1294
1425
|
);
|
|
@@ -1298,7 +1429,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
1298
1429
|
|
|
1299
1430
|
// ../renderers/src/DividerRenderer.tsx
|
|
1300
1431
|
import { Divider } from "@transferwise/components";
|
|
1301
|
-
import { jsx as
|
|
1432
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1302
1433
|
var mapControlToLevel = (control) => {
|
|
1303
1434
|
switch (control) {
|
|
1304
1435
|
case "section":
|
|
@@ -1311,7 +1442,7 @@ var mapControlToLevel = (control) => {
|
|
|
1311
1442
|
};
|
|
1312
1443
|
var DividerRenderer = {
|
|
1313
1444
|
canRenderType: "divider",
|
|
1314
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
1445
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx31(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
1315
1446
|
};
|
|
1316
1447
|
var DividerRenderer_default = DividerRenderer;
|
|
1317
1448
|
|
|
@@ -1345,8 +1476,8 @@ var external_confirmation_messages_default = defineMessages5({
|
|
|
1345
1476
|
|
|
1346
1477
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1347
1478
|
import { useIntl as useIntl5 } from "react-intl";
|
|
1348
|
-
import { useEffect as
|
|
1349
|
-
import { Fragment as Fragment4, jsx as
|
|
1479
|
+
import { useEffect as useEffect4 } from "react";
|
|
1480
|
+
import { Fragment as Fragment4, jsx as jsx32, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1350
1481
|
var ExternalConfirmationRenderer = {
|
|
1351
1482
|
canRenderType: "external-confirmation",
|
|
1352
1483
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1358,18 +1489,18 @@ function ExternalConfirmationRendererComponent({
|
|
|
1358
1489
|
onCancel
|
|
1359
1490
|
}) {
|
|
1360
1491
|
const { formatMessage } = useIntl5();
|
|
1361
|
-
|
|
1492
|
+
useEffect4(() => {
|
|
1362
1493
|
open();
|
|
1363
1494
|
}, []);
|
|
1364
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ jsx32(
|
|
1365
1496
|
Modal,
|
|
1366
1497
|
{
|
|
1367
1498
|
open: visible,
|
|
1368
1499
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1369
|
-
body: /* @__PURE__ */
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1500
|
+
body: /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
1501
|
+
/* @__PURE__ */ jsx32(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1502
|
+
/* @__PURE__ */ jsx32("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs7("div", { className: "df-box-renderer-width-lg", children: [
|
|
1503
|
+
/* @__PURE__ */ jsx32(
|
|
1373
1504
|
Button3,
|
|
1374
1505
|
{
|
|
1375
1506
|
v2: true,
|
|
@@ -1383,7 +1514,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1383
1514
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1384
1515
|
}
|
|
1385
1516
|
),
|
|
1386
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ jsx32(Button3, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1387
1518
|
] }) })
|
|
1388
1519
|
] }),
|
|
1389
1520
|
onClose: onCancel
|
|
@@ -1400,27 +1531,27 @@ function getOrigin(url) {
|
|
|
1400
1531
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1401
1532
|
|
|
1402
1533
|
// ../renderers/src/FormRenderer.tsx
|
|
1403
|
-
import { jsx as
|
|
1534
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1404
1535
|
var FormRenderer = {
|
|
1405
1536
|
canRenderType: "form",
|
|
1406
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1537
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx33("div", { className: getMargin(margin), children })
|
|
1407
1538
|
};
|
|
1408
1539
|
var FormRenderer_default = FormRenderer;
|
|
1409
1540
|
|
|
1410
1541
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1411
1542
|
import { Header as Header3 } from "@transferwise/components";
|
|
1412
|
-
import { jsx as
|
|
1543
|
+
import { jsx as jsx34, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1413
1544
|
var FormSectionRenderer = {
|
|
1414
1545
|
canRenderType: "form-section",
|
|
1415
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
1416
|
-
title && /* @__PURE__ */
|
|
1546
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs8("fieldset", { children: [
|
|
1547
|
+
title && /* @__PURE__ */ jsx34(
|
|
1417
1548
|
Header3,
|
|
1418
1549
|
{
|
|
1419
1550
|
as: "h2",
|
|
1420
1551
|
title
|
|
1421
1552
|
}
|
|
1422
1553
|
),
|
|
1423
|
-
description && /* @__PURE__ */
|
|
1554
|
+
description && /* @__PURE__ */ jsx34("p", { children: description }),
|
|
1424
1555
|
children
|
|
1425
1556
|
] })
|
|
1426
1557
|
};
|
|
@@ -1428,18 +1559,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1428
1559
|
|
|
1429
1560
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1430
1561
|
import { Display, Title } from "@transferwise/components";
|
|
1431
|
-
import { jsx as
|
|
1562
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1432
1563
|
var HeadingRenderer = {
|
|
1433
1564
|
canRenderType: "heading",
|
|
1434
|
-
render: (props) => /* @__PURE__ */
|
|
1565
|
+
render: (props) => /* @__PURE__ */ jsx35(Heading, __spreadValues({}, props))
|
|
1435
1566
|
};
|
|
1436
1567
|
function Heading(props) {
|
|
1437
1568
|
const { text, size, align, margin, control } = props;
|
|
1438
1569
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1439
|
-
return control === "display" ? /* @__PURE__ */
|
|
1570
|
+
return control === "display" ? /* @__PURE__ */ jsx35(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx35(StandardHeading, { size, text, className });
|
|
1440
1571
|
}
|
|
1441
1572
|
function DisplayHeading({ size, text, className }) {
|
|
1442
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsx35(Display, { type: getDisplayType(size), className, children: text });
|
|
1443
1574
|
}
|
|
1444
1575
|
var getDisplayType = (size) => {
|
|
1445
1576
|
switch (size) {
|
|
@@ -1455,7 +1586,7 @@ var getDisplayType = (size) => {
|
|
|
1455
1586
|
}
|
|
1456
1587
|
};
|
|
1457
1588
|
function StandardHeading({ size, text, className }) {
|
|
1458
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsx35(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1459
1590
|
}
|
|
1460
1591
|
var getTitleTypeBySize = (size) => {
|
|
1461
1592
|
var _a;
|
|
@@ -1472,7 +1603,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1472
1603
|
|
|
1473
1604
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1474
1605
|
import { Image } from "@transferwise/components";
|
|
1475
|
-
import { useEffect as
|
|
1606
|
+
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
1476
1607
|
|
|
1477
1608
|
// ../renderers/src/utils/api-utils.ts
|
|
1478
1609
|
function isRelativePath(url = "") {
|
|
@@ -1482,7 +1613,7 @@ function isRelativePath(url = "") {
|
|
|
1482
1613
|
}
|
|
1483
1614
|
|
|
1484
1615
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1485
|
-
import { jsx as
|
|
1616
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1486
1617
|
function UrlImage({
|
|
1487
1618
|
accessibilityDescription,
|
|
1488
1619
|
align,
|
|
@@ -1491,13 +1622,13 @@ function UrlImage({
|
|
|
1491
1622
|
uri,
|
|
1492
1623
|
httpClient
|
|
1493
1624
|
}) {
|
|
1494
|
-
const [imageSource, setImageSource] =
|
|
1495
|
-
|
|
1625
|
+
const [imageSource, setImageSource] = useState5("");
|
|
1626
|
+
useEffect5(() => {
|
|
1496
1627
|
if (!uri.startsWith("urn:")) {
|
|
1497
1628
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1498
1629
|
}
|
|
1499
1630
|
}, [uri, httpClient]);
|
|
1500
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ jsx36("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ jsx36(
|
|
1501
1632
|
Image,
|
|
1502
1633
|
{
|
|
1503
1634
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1541,7 +1672,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1541
1672
|
};
|
|
1542
1673
|
|
|
1543
1674
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1544
|
-
import { jsx as
|
|
1675
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1545
1676
|
var maxFlagSize = 600;
|
|
1546
1677
|
function UrnFlagImage({
|
|
1547
1678
|
accessibilityDescription,
|
|
@@ -1550,7 +1681,7 @@ function UrnFlagImage({
|
|
|
1550
1681
|
size,
|
|
1551
1682
|
uri
|
|
1552
1683
|
}) {
|
|
1553
|
-
return /* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ jsx37("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx37(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1554
1685
|
}
|
|
1555
1686
|
|
|
1556
1687
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -1558,7 +1689,7 @@ import {
|
|
|
1558
1689
|
Illustration,
|
|
1559
1690
|
isIllustrationSupport3D
|
|
1560
1691
|
} from "@wise/art";
|
|
1561
|
-
import { useState as
|
|
1692
|
+
import { useState as useState6 } from "react";
|
|
1562
1693
|
|
|
1563
1694
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1564
1695
|
var isAnimated = (uri) => {
|
|
@@ -1569,7 +1700,7 @@ var isAnimated = (uri) => {
|
|
|
1569
1700
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1570
1701
|
import { Illustration3D } from "@wise/art";
|
|
1571
1702
|
import { Component } from "react";
|
|
1572
|
-
import { jsx as
|
|
1703
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1573
1704
|
var Illustration3DErrorBoundary = class extends Component {
|
|
1574
1705
|
constructor(props) {
|
|
1575
1706
|
super(props);
|
|
@@ -1593,12 +1724,12 @@ var SafeIllustration3D = ({
|
|
|
1593
1724
|
size,
|
|
1594
1725
|
onError
|
|
1595
1726
|
}) => {
|
|
1596
|
-
return /* @__PURE__ */
|
|
1727
|
+
return /* @__PURE__ */ jsx38(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx38(Illustration3D, { name, size }) });
|
|
1597
1728
|
};
|
|
1598
1729
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1599
1730
|
|
|
1600
1731
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1601
|
-
import { jsx as
|
|
1732
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1602
1733
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1603
1734
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1604
1735
|
function UrnIllustration({
|
|
@@ -1608,12 +1739,12 @@ function UrnIllustration({
|
|
|
1608
1739
|
size,
|
|
1609
1740
|
uri
|
|
1610
1741
|
}) {
|
|
1611
|
-
const [has3DFailed, setHas3DFailed] =
|
|
1742
|
+
const [has3DFailed, setHas3DFailed] = useState6(false);
|
|
1612
1743
|
const illustrationSize = getIllustrationSize(size);
|
|
1613
1744
|
const illustrationName = getIllustrationName(uri);
|
|
1614
1745
|
const illustration3DName = getIllustration3DName(uri);
|
|
1615
1746
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ jsx39("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx39(
|
|
1617
1748
|
SafeIllustration3D_default,
|
|
1618
1749
|
{
|
|
1619
1750
|
name: illustration3DName,
|
|
@@ -1622,7 +1753,7 @@ function UrnIllustration({
|
|
|
1622
1753
|
}
|
|
1623
1754
|
) });
|
|
1624
1755
|
}
|
|
1625
|
-
return /* @__PURE__ */
|
|
1756
|
+
return /* @__PURE__ */ jsx39("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx39(
|
|
1626
1757
|
Illustration,
|
|
1627
1758
|
{
|
|
1628
1759
|
className: "df-illustration",
|
|
@@ -1642,24 +1773,24 @@ var getIllustration3DName = (uri) => {
|
|
|
1642
1773
|
};
|
|
1643
1774
|
|
|
1644
1775
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1645
|
-
import { jsx as
|
|
1776
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1646
1777
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1647
1778
|
function UrnImage(props) {
|
|
1648
1779
|
const { uri } = props;
|
|
1649
1780
|
if (isUrnIllustration(uri)) {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx40(UrnIllustration, __spreadValues({}, props));
|
|
1651
1782
|
}
|
|
1652
1783
|
if (isUrnFlag(uri)) {
|
|
1653
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx40(UrnFlagImage, __spreadValues({}, props));
|
|
1654
1785
|
}
|
|
1655
1786
|
return null;
|
|
1656
1787
|
}
|
|
1657
1788
|
|
|
1658
1789
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1659
|
-
import { jsx as
|
|
1790
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1660
1791
|
var ImageRenderer = {
|
|
1661
1792
|
canRenderType: "image",
|
|
1662
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
1793
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx41(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx41(UrlImage, __spreadValues({}, props))
|
|
1663
1794
|
};
|
|
1664
1795
|
|
|
1665
1796
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -1667,7 +1798,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
1667
1798
|
|
|
1668
1799
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1669
1800
|
import { Header as Header4, InstructionsList } from "@transferwise/components";
|
|
1670
|
-
import { jsx as
|
|
1801
|
+
import { jsx as jsx42, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1671
1802
|
var doContext = ["positive", "neutral"];
|
|
1672
1803
|
var dontContext = ["warning", "negative"];
|
|
1673
1804
|
var InstructionsRenderer = {
|
|
@@ -1675,9 +1806,9 @@ var InstructionsRenderer = {
|
|
|
1675
1806
|
render: ({ items, margin, title }) => {
|
|
1676
1807
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1677
1808
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1678
|
-
return /* @__PURE__ */
|
|
1679
|
-
title ? /* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1809
|
+
return /* @__PURE__ */ jsxs9("div", { className: getMargin(margin), children: [
|
|
1810
|
+
title ? /* @__PURE__ */ jsx42(Header4, { title }) : null,
|
|
1811
|
+
/* @__PURE__ */ jsx42(InstructionsList, { dos, donts })
|
|
1681
1812
|
] });
|
|
1682
1813
|
}
|
|
1683
1814
|
};
|
|
@@ -1709,7 +1840,7 @@ function pick(obj, ...keys) {
|
|
|
1709
1840
|
}
|
|
1710
1841
|
|
|
1711
1842
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1712
|
-
import { jsx as
|
|
1843
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
1713
1844
|
var IntegerInputRenderer = {
|
|
1714
1845
|
canRenderType: "input-integer",
|
|
1715
1846
|
render: (props) => {
|
|
@@ -1724,7 +1855,7 @@ var IntegerInputRenderer = {
|
|
|
1724
1855
|
"maximum",
|
|
1725
1856
|
"minimum"
|
|
1726
1857
|
);
|
|
1727
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ jsx43(
|
|
1728
1859
|
FieldInput_default,
|
|
1729
1860
|
{
|
|
1730
1861
|
id,
|
|
@@ -1732,7 +1863,7 @@ var IntegerInputRenderer = {
|
|
|
1732
1863
|
description,
|
|
1733
1864
|
validation: validationState,
|
|
1734
1865
|
help,
|
|
1735
|
-
children: /* @__PURE__ */
|
|
1866
|
+
children: /* @__PURE__ */ jsx43(InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx43(
|
|
1736
1867
|
Input,
|
|
1737
1868
|
__spreadValues({
|
|
1738
1869
|
id,
|
|
@@ -1759,7 +1890,7 @@ import { ListItem as ListItem7 } from "@transferwise/components";
|
|
|
1759
1890
|
|
|
1760
1891
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1761
1892
|
import { ListItem as ListItem6 } from "@transferwise/components";
|
|
1762
|
-
import { jsx as
|
|
1893
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1763
1894
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1764
1895
|
if (!callToAction) {
|
|
1765
1896
|
return void 0;
|
|
@@ -1767,7 +1898,7 @@ var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
|
1767
1898
|
const { accessibilityDescription, href, title, context, onClick } = callToAction;
|
|
1768
1899
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
1769
1900
|
if (href) {
|
|
1770
|
-
return /* @__PURE__ */
|
|
1901
|
+
return /* @__PURE__ */ jsx44(
|
|
1771
1902
|
ListItem6.Button,
|
|
1772
1903
|
{
|
|
1773
1904
|
href,
|
|
@@ -1781,7 +1912,7 @@ var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
|
1781
1912
|
}
|
|
1782
1913
|
);
|
|
1783
1914
|
}
|
|
1784
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ jsx44(
|
|
1785
1916
|
ListItem6.Button,
|
|
1786
1917
|
{
|
|
1787
1918
|
"aria-description": accessibilityDescription,
|
|
@@ -1802,8 +1933,8 @@ var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
|
1802
1933
|
|
|
1803
1934
|
// ../renderers/src/components/Header.tsx
|
|
1804
1935
|
import { Header as DSHeader } from "@transferwise/components";
|
|
1805
|
-
import { jsx as
|
|
1806
|
-
var Header5 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */
|
|
1936
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1937
|
+
var Header5 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx45(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
1807
1938
|
var getHeaderAction = (callToAction) => {
|
|
1808
1939
|
if (!callToAction) {
|
|
1809
1940
|
return void 0;
|
|
@@ -1825,11 +1956,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
1825
1956
|
};
|
|
1826
1957
|
|
|
1827
1958
|
// ../renderers/src/ListRenderer.tsx
|
|
1828
|
-
import { jsx as
|
|
1959
|
+
import { jsx as jsx46, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1829
1960
|
var ListRenderer = {
|
|
1830
1961
|
canRenderType: "list",
|
|
1831
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
1962
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs10("div", { className: getMargin(margin), children: [
|
|
1963
|
+
/* @__PURE__ */ jsx46(Header5, { title, callToAction }),
|
|
1833
1964
|
items.map((item) => {
|
|
1834
1965
|
var _a, _b;
|
|
1835
1966
|
const {
|
|
@@ -1846,7 +1977,7 @@ var ListRenderer = {
|
|
|
1846
1977
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
1847
1978
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
1848
1979
|
};
|
|
1849
|
-
return /* @__PURE__ */
|
|
1980
|
+
return /* @__PURE__ */ jsx46(
|
|
1850
1981
|
ListItem7,
|
|
1851
1982
|
{
|
|
1852
1983
|
title: itemTitle,
|
|
@@ -1867,10 +1998,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
1867
1998
|
|
|
1868
1999
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1869
2000
|
import { Loader } from "@transferwise/components";
|
|
1870
|
-
import { jsx as
|
|
2001
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1871
2002
|
var LoadingIndicatorRenderer = {
|
|
1872
2003
|
canRenderType: "loading-indicator",
|
|
1873
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
2004
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx47(
|
|
1874
2005
|
Loader,
|
|
1875
2006
|
{
|
|
1876
2007
|
size,
|
|
@@ -1883,10 +2014,10 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1883
2014
|
|
|
1884
2015
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1885
2016
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
1886
|
-
import { jsx as
|
|
2017
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1887
2018
|
var MarkdownRenderer = {
|
|
1888
2019
|
canRenderType: "markdown",
|
|
1889
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */
|
|
2020
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx48("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx48(
|
|
1890
2021
|
Markdown3,
|
|
1891
2022
|
{
|
|
1892
2023
|
className: ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large",
|
|
@@ -1898,16 +2029,16 @@ var MarkdownRenderer = {
|
|
|
1898
2029
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1899
2030
|
|
|
1900
2031
|
// ../renderers/src/MediaRenderer.tsx
|
|
1901
|
-
import { jsx as
|
|
2032
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
1902
2033
|
var MediaRenderer = {
|
|
1903
2034
|
canRenderType: "media",
|
|
1904
2035
|
render: (_a) => {
|
|
1905
2036
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
1906
2037
|
switch (media.type) {
|
|
1907
2038
|
case "avatar":
|
|
1908
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsx49(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
1909
2040
|
case "image":
|
|
1910
|
-
return /* @__PURE__ */
|
|
2041
|
+
return /* @__PURE__ */ jsx49(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
1911
2042
|
case "legacy":
|
|
1912
2043
|
return null;
|
|
1913
2044
|
}
|
|
@@ -1919,7 +2050,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
1919
2050
|
margin,
|
|
1920
2051
|
size
|
|
1921
2052
|
}) => {
|
|
1922
|
-
return /* @__PURE__ */
|
|
2053
|
+
return /* @__PURE__ */ jsx49("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx49(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
1923
2054
|
};
|
|
1924
2055
|
var ImageMediaRendererComponent = (_a) => {
|
|
1925
2056
|
var _b = _a, {
|
|
@@ -1927,7 +2058,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
1927
2058
|
} = _b, rest = __objRest(_b, [
|
|
1928
2059
|
"media"
|
|
1929
2060
|
]);
|
|
1930
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
2061
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx49(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ jsx49(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
1931
2062
|
};
|
|
1932
2063
|
var mapAvatarMediaSize = (size) => {
|
|
1933
2064
|
switch (size) {
|
|
@@ -1946,19 +2077,19 @@ var mapAvatarMediaSize = (size) => {
|
|
|
1946
2077
|
|
|
1947
2078
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
1948
2079
|
import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
|
|
1949
|
-
import { useState as
|
|
1950
|
-
import { jsx as
|
|
2080
|
+
import { useState as useState7 } from "react";
|
|
2081
|
+
import { jsx as jsx50, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1951
2082
|
var ModalLayoutRenderer = {
|
|
1952
2083
|
canRenderType: "modal-layout",
|
|
1953
|
-
render: (props) => /* @__PURE__ */
|
|
2084
|
+
render: (props) => /* @__PURE__ */ jsx50(DFModal, __spreadValues({}, props))
|
|
1954
2085
|
};
|
|
1955
2086
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
1956
2087
|
function DFModal({ content, margin, trigger }) {
|
|
1957
|
-
const [visible, setVisible] =
|
|
2088
|
+
const [visible, setVisible] = useState7(false);
|
|
1958
2089
|
const { children, title } = content;
|
|
1959
|
-
return /* @__PURE__ */
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
/* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ jsxs11("div", { className: getMargin(margin), children: [
|
|
2091
|
+
/* @__PURE__ */ jsx50(Button4, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
2092
|
+
/* @__PURE__ */ jsx50(
|
|
1962
2093
|
Modal2,
|
|
1963
2094
|
{
|
|
1964
2095
|
scroll: "content",
|
|
@@ -1974,19 +2105,19 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1974
2105
|
|
|
1975
2106
|
// ../renderers/src/ModalRenderer.tsx
|
|
1976
2107
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
1977
|
-
import { jsx as
|
|
2108
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
1978
2109
|
var ModalRenderer = {
|
|
1979
2110
|
canRenderType: "modal",
|
|
1980
2111
|
render: ({ title, children, open, onClose }) => {
|
|
1981
|
-
return /* @__PURE__ */
|
|
2112
|
+
return /* @__PURE__ */ jsx51(Modal3, { open, title, body: children, onClose });
|
|
1982
2113
|
}
|
|
1983
2114
|
};
|
|
1984
2115
|
|
|
1985
2116
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
1986
2117
|
import { MoneyInput } from "@transferwise/components";
|
|
1987
|
-
import { useEffect as
|
|
2118
|
+
import { useEffect as useEffect6 } from "react";
|
|
1988
2119
|
import { useIntl as useIntl6 } from "react-intl";
|
|
1989
|
-
import { jsx as
|
|
2120
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
1990
2121
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1991
2122
|
var MoneyInputRenderer = {
|
|
1992
2123
|
canRenderType: "money-input",
|
|
@@ -2007,13 +2138,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
2007
2138
|
onAmountChange,
|
|
2008
2139
|
onCurrencyChange
|
|
2009
2140
|
} = props;
|
|
2010
|
-
|
|
2141
|
+
useEffect6(() => {
|
|
2011
2142
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
2012
2143
|
onCurrencyChange(0);
|
|
2013
2144
|
}
|
|
2014
2145
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
2015
2146
|
const { formatMessage } = useIntl6();
|
|
2016
|
-
return /* @__PURE__ */
|
|
2147
|
+
return /* @__PURE__ */ jsx52(
|
|
2017
2148
|
FieldInput_default,
|
|
2018
2149
|
{
|
|
2019
2150
|
id: uid,
|
|
@@ -2021,7 +2152,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
2021
2152
|
description,
|
|
2022
2153
|
validation: validationState,
|
|
2023
2154
|
help,
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2155
|
+
children: /* @__PURE__ */ jsx52(
|
|
2025
2156
|
MoneyInput,
|
|
2026
2157
|
{
|
|
2027
2158
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -2084,7 +2215,7 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
2084
2215
|
|
|
2085
2216
|
// ../renderers/src/MultiSelectInputRenderer/InlineMultiSelectInputRendererComponent.tsx
|
|
2086
2217
|
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
2087
|
-
import { jsx as
|
|
2218
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2088
2219
|
function InlineMultiSelectInputRendererComponent(props) {
|
|
2089
2220
|
const {
|
|
2090
2221
|
id,
|
|
@@ -2097,7 +2228,7 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2097
2228
|
validationState,
|
|
2098
2229
|
onSelect
|
|
2099
2230
|
} = props;
|
|
2100
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsx53(
|
|
2101
2232
|
FieldInput_default,
|
|
2102
2233
|
{
|
|
2103
2234
|
id,
|
|
@@ -2118,7 +2249,7 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2118
2249
|
childrenProps
|
|
2119
2250
|
} = option;
|
|
2120
2251
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2121
|
-
return /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ jsx53(
|
|
2122
2253
|
ListItem8,
|
|
2123
2254
|
{
|
|
2124
2255
|
title: itemTitle,
|
|
@@ -2127,9 +2258,9 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2127
2258
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2128
2259
|
media: getMedia(media, false),
|
|
2129
2260
|
prompt: getInlineAlert(inlineAlert),
|
|
2130
|
-
additionalInfo: additionalText ? /* @__PURE__ */
|
|
2261
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx53(ListItem8.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2131
2262
|
disabled: disabled || optionDisabled,
|
|
2132
|
-
control: /* @__PURE__ */
|
|
2263
|
+
control: /* @__PURE__ */ jsx53(
|
|
2133
2264
|
ListItem8.Checkbox,
|
|
2134
2265
|
{
|
|
2135
2266
|
checked: selectedIndices.includes(index),
|
|
@@ -2149,7 +2280,7 @@ function InlineMultiSelectInputRendererComponent(props) {
|
|
|
2149
2280
|
|
|
2150
2281
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRendererComponent.tsx
|
|
2151
2282
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
2152
|
-
import { useState as
|
|
2283
|
+
import { useState as useState8 } from "react";
|
|
2153
2284
|
import { useIntl as useIntl7 } from "react-intl";
|
|
2154
2285
|
|
|
2155
2286
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
@@ -2163,10 +2294,10 @@ var multi_select_messages_default = defineMessages6({
|
|
|
2163
2294
|
});
|
|
2164
2295
|
|
|
2165
2296
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRendererComponent.tsx
|
|
2166
|
-
import { jsx as
|
|
2297
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2167
2298
|
function MultiSelectInputRendererComponent(props) {
|
|
2168
2299
|
const { formatMessage } = useIntl7();
|
|
2169
|
-
const [stagedIndices, setStagedIndices] =
|
|
2300
|
+
const [stagedIndices, setStagedIndices] = useState8();
|
|
2170
2301
|
const {
|
|
2171
2302
|
id,
|
|
2172
2303
|
autoComplete,
|
|
@@ -2204,12 +2335,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2204
2335
|
const contentProps = {
|
|
2205
2336
|
title: option.title,
|
|
2206
2337
|
description: option.description,
|
|
2207
|
-
icon: /* @__PURE__ */
|
|
2338
|
+
icon: /* @__PURE__ */ jsx54(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2208
2339
|
};
|
|
2209
|
-
return /* @__PURE__ */
|
|
2340
|
+
return /* @__PURE__ */ jsx54(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2210
2341
|
};
|
|
2211
2342
|
const extraProps = { autoComplete };
|
|
2212
|
-
return /* @__PURE__ */
|
|
2343
|
+
return /* @__PURE__ */ jsx54(
|
|
2213
2344
|
FieldInput_default,
|
|
2214
2345
|
{
|
|
2215
2346
|
id,
|
|
@@ -2217,7 +2348,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2217
2348
|
help,
|
|
2218
2349
|
description,
|
|
2219
2350
|
validation: validationState,
|
|
2220
|
-
children: /* @__PURE__ */
|
|
2351
|
+
children: /* @__PURE__ */ jsx54(
|
|
2221
2352
|
SelectInput,
|
|
2222
2353
|
__spreadValues({
|
|
2223
2354
|
id,
|
|
@@ -2256,11 +2387,11 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
2256
2387
|
}
|
|
2257
2388
|
|
|
2258
2389
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2259
|
-
import { jsx as
|
|
2390
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2260
2391
|
var MultiSelectInputRenderer = {
|
|
2261
2392
|
canRenderType: "input-multi-select",
|
|
2262
2393
|
render: (props) => {
|
|
2263
|
-
return props.control === "inline" ? /* @__PURE__ */
|
|
2394
|
+
return props.control === "inline" ? /* @__PURE__ */ jsx55(InlineMultiSelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx55(MultiSelectInputRendererComponent, __spreadValues({}, props));
|
|
2264
2395
|
}
|
|
2265
2396
|
};
|
|
2266
2397
|
|
|
@@ -2270,7 +2401,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
2270
2401
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2271
2402
|
var import_classnames4 = __toESM(require_classnames());
|
|
2272
2403
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
2273
|
-
import { jsx as
|
|
2404
|
+
import { jsx as jsx56, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2274
2405
|
function UploadFieldInput({
|
|
2275
2406
|
id,
|
|
2276
2407
|
children,
|
|
@@ -2279,18 +2410,18 @@ function UploadFieldInput({
|
|
|
2279
2410
|
help,
|
|
2280
2411
|
validation
|
|
2281
2412
|
}) {
|
|
2282
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
2413
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx56(LabelContentWithHelp, { text: label, help }) : label;
|
|
2283
2414
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2284
|
-
return /* @__PURE__ */
|
|
2415
|
+
return /* @__PURE__ */ jsxs12(
|
|
2285
2416
|
"div",
|
|
2286
2417
|
{
|
|
2287
2418
|
className: (0, import_classnames4.default)("form-group d-block", {
|
|
2288
2419
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
2289
2420
|
}),
|
|
2290
2421
|
children: [
|
|
2291
|
-
/* @__PURE__ */
|
|
2422
|
+
/* @__PURE__ */ jsx56("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
2292
2423
|
children,
|
|
2293
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
2424
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx56(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
2294
2425
|
]
|
|
2295
2426
|
}
|
|
2296
2427
|
);
|
|
@@ -2325,7 +2456,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
2325
2456
|
};
|
|
2326
2457
|
|
|
2327
2458
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2328
|
-
import { jsx as
|
|
2459
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2329
2460
|
var MultiUploadInputRenderer = {
|
|
2330
2461
|
canRenderType: "input-upload-multi",
|
|
2331
2462
|
render: (props) => {
|
|
@@ -2350,7 +2481,7 @@ var MultiUploadInputRenderer = {
|
|
|
2350
2481
|
};
|
|
2351
2482
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
2352
2483
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
2353
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ jsx57(
|
|
2354
2485
|
UploadFieldInput_default,
|
|
2355
2486
|
{
|
|
2356
2487
|
id,
|
|
@@ -2358,7 +2489,7 @@ var MultiUploadInputRenderer = {
|
|
|
2358
2489
|
description,
|
|
2359
2490
|
validation: validationState,
|
|
2360
2491
|
help,
|
|
2361
|
-
children: /* @__PURE__ */
|
|
2492
|
+
children: /* @__PURE__ */ jsx57(
|
|
2362
2493
|
UploadInput,
|
|
2363
2494
|
{
|
|
2364
2495
|
id,
|
|
@@ -2387,7 +2518,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
2387
2518
|
|
|
2388
2519
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
2389
2520
|
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
2390
|
-
import { jsx as
|
|
2521
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2391
2522
|
var NumberInputRenderer = {
|
|
2392
2523
|
canRenderType: "input-number",
|
|
2393
2524
|
render: (props) => {
|
|
@@ -2401,7 +2532,7 @@ var NumberInputRenderer = {
|
|
|
2401
2532
|
"maximum",
|
|
2402
2533
|
"minimum"
|
|
2403
2534
|
);
|
|
2404
|
-
return /* @__PURE__ */
|
|
2535
|
+
return /* @__PURE__ */ jsx58(
|
|
2405
2536
|
FieldInput_default,
|
|
2406
2537
|
{
|
|
2407
2538
|
id,
|
|
@@ -2409,7 +2540,7 @@ var NumberInputRenderer = {
|
|
|
2409
2540
|
description,
|
|
2410
2541
|
validation: validationState,
|
|
2411
2542
|
help,
|
|
2412
|
-
children: /* @__PURE__ */
|
|
2543
|
+
children: /* @__PURE__ */ jsx58(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx58(
|
|
2413
2544
|
Input2,
|
|
2414
2545
|
__spreadValues({
|
|
2415
2546
|
id,
|
|
@@ -2461,14 +2592,14 @@ var paragraph_messages_default = defineMessages7({
|
|
|
2461
2592
|
});
|
|
2462
2593
|
|
|
2463
2594
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2464
|
-
import { jsx as
|
|
2595
|
+
import { jsx as jsx59, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2465
2596
|
var ParagraphRenderer = {
|
|
2466
2597
|
canRenderType: "paragraph",
|
|
2467
|
-
render: (props) => /* @__PURE__ */
|
|
2598
|
+
render: (props) => /* @__PURE__ */ jsx59(Paragraph, __spreadValues({}, props))
|
|
2468
2599
|
};
|
|
2469
2600
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2470
2601
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2471
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2602
|
+
return control === "copyable" ? /* @__PURE__ */ jsx59(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx59(
|
|
2472
2603
|
"p",
|
|
2473
2604
|
{
|
|
2474
2605
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2488,8 +2619,8 @@ function CopyableParagraph({
|
|
|
2488
2619
|
});
|
|
2489
2620
|
};
|
|
2490
2621
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2491
|
-
return /* @__PURE__ */
|
|
2492
|
-
/* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ jsxs13("div", { className, children: [
|
|
2623
|
+
/* @__PURE__ */ jsx59(
|
|
2493
2624
|
Input3,
|
|
2494
2625
|
{
|
|
2495
2626
|
type: "text",
|
|
@@ -2498,23 +2629,23 @@ function CopyableParagraph({
|
|
|
2498
2629
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
2499
2630
|
}
|
|
2500
2631
|
),
|
|
2501
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsx59(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2502
2633
|
] });
|
|
2503
2634
|
}
|
|
2504
2635
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2505
2636
|
|
|
2506
2637
|
// ../renderers/src/ProgressRenderer.tsx
|
|
2507
2638
|
import { ProgressBar } from "@transferwise/components";
|
|
2508
|
-
import { jsx as
|
|
2639
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
2509
2640
|
var ProgressRenderer = {
|
|
2510
2641
|
canRenderType: "progress",
|
|
2511
2642
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2512
|
-
return /* @__PURE__ */
|
|
2643
|
+
return /* @__PURE__ */ jsx60(
|
|
2513
2644
|
ProgressBar,
|
|
2514
2645
|
{
|
|
2515
2646
|
id: uid,
|
|
2516
2647
|
className: getMargin(margin),
|
|
2517
|
-
title: title && help ? /* @__PURE__ */
|
|
2648
|
+
title: title && help ? /* @__PURE__ */ jsx60(LabelContentWithHelp, { text: title, help }) : title,
|
|
2518
2649
|
description,
|
|
2519
2650
|
progress: {
|
|
2520
2651
|
max: 1,
|
|
@@ -2530,7 +2661,7 @@ var ProgressRenderer = {
|
|
|
2530
2661
|
var import_classnames6 = __toESM(require_classnames());
|
|
2531
2662
|
import { Button as Button6, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
2532
2663
|
import { Plus } from "@transferwise/icons";
|
|
2533
|
-
import { useState as
|
|
2664
|
+
import { useState as useState9 } from "react";
|
|
2534
2665
|
import { useIntl as useIntl9 } from "react-intl";
|
|
2535
2666
|
|
|
2536
2667
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
@@ -2559,10 +2690,10 @@ var repeatable_messages_default = defineMessages8({
|
|
|
2559
2690
|
});
|
|
2560
2691
|
|
|
2561
2692
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2562
|
-
import { Fragment as Fragment5, jsx as
|
|
2693
|
+
import { Fragment as Fragment5, jsx as jsx61, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2563
2694
|
var RepeatableRenderer = {
|
|
2564
2695
|
canRenderType: "repeatable",
|
|
2565
|
-
render: (props) => /* @__PURE__ */
|
|
2696
|
+
render: (props) => /* @__PURE__ */ jsx61(Repeatable, __spreadValues({}, props))
|
|
2566
2697
|
};
|
|
2567
2698
|
function Repeatable(props) {
|
|
2568
2699
|
const {
|
|
@@ -2579,7 +2710,7 @@ function Repeatable(props) {
|
|
|
2579
2710
|
onRemove
|
|
2580
2711
|
} = props;
|
|
2581
2712
|
const { formatMessage } = useIntl9();
|
|
2582
|
-
const [openModalType, setOpenModalType] =
|
|
2713
|
+
const [openModalType, setOpenModalType] = useState9(null);
|
|
2583
2714
|
const onAddItem = () => {
|
|
2584
2715
|
onAdd();
|
|
2585
2716
|
setOpenModalType("add");
|
|
@@ -2601,40 +2732,40 @@ function Repeatable(props) {
|
|
|
2601
2732
|
const onCancelEdit = () => {
|
|
2602
2733
|
setOpenModalType(null);
|
|
2603
2734
|
};
|
|
2604
|
-
return /* @__PURE__ */
|
|
2605
|
-
title && /* @__PURE__ */
|
|
2606
|
-
description && /* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2736
|
+
title && /* @__PURE__ */ jsx61(Header6, { title }),
|
|
2737
|
+
description && /* @__PURE__ */ jsx61("p", { children: description }),
|
|
2738
|
+
/* @__PURE__ */ jsxs14(
|
|
2608
2739
|
"div",
|
|
2609
2740
|
{
|
|
2610
2741
|
className: (0, import_classnames6.default)("form-group", {
|
|
2611
2742
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2612
2743
|
}),
|
|
2613
2744
|
children: [
|
|
2614
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2745
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx61(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2746
|
+
/* @__PURE__ */ jsx61(
|
|
2616
2747
|
NavigationOption,
|
|
2617
2748
|
{
|
|
2618
|
-
media: /* @__PURE__ */
|
|
2749
|
+
media: /* @__PURE__ */ jsx61(Plus, {}),
|
|
2619
2750
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2620
2751
|
showMediaAtAllSizes: true,
|
|
2621
2752
|
onClick: () => onAddItem()
|
|
2622
2753
|
}
|
|
2623
2754
|
),
|
|
2624
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2755
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx61(InlineAlert3, { type: "negative", children: validationState.message })
|
|
2625
2756
|
]
|
|
2626
2757
|
}
|
|
2627
2758
|
),
|
|
2628
|
-
/* @__PURE__ */
|
|
2759
|
+
/* @__PURE__ */ jsx61(
|
|
2629
2760
|
Modal4,
|
|
2630
2761
|
{
|
|
2631
2762
|
open: openModalType !== null,
|
|
2632
2763
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2633
|
-
body: /* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2635
|
-
/* @__PURE__ */
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2764
|
+
body: /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2765
|
+
/* @__PURE__ */ jsx61("div", { className: "m-b-2", children: editableItem }),
|
|
2766
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
2767
|
+
/* @__PURE__ */ jsx61(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2768
|
+
/* @__PURE__ */ jsx61(
|
|
2638
2769
|
Button6,
|
|
2639
2770
|
{
|
|
2640
2771
|
v2: true,
|
|
@@ -2656,10 +2787,10 @@ function ItemSummaryOption({
|
|
|
2656
2787
|
item,
|
|
2657
2788
|
onClick
|
|
2658
2789
|
}) {
|
|
2659
|
-
return /* @__PURE__ */
|
|
2790
|
+
return /* @__PURE__ */ jsx61(
|
|
2660
2791
|
NavigationOption,
|
|
2661
2792
|
{
|
|
2662
|
-
media: /* @__PURE__ */
|
|
2793
|
+
media: /* @__PURE__ */ jsx61(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2663
2794
|
title: item.title,
|
|
2664
2795
|
content: item.description,
|
|
2665
2796
|
showMediaAtAllSizes: true,
|
|
@@ -2672,14 +2803,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
2672
2803
|
|
|
2673
2804
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2674
2805
|
import { DefinitionList } from "@transferwise/components";
|
|
2675
|
-
import { Fragment as Fragment6, jsx as
|
|
2806
|
+
import { Fragment as Fragment6, jsx as jsx62, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2676
2807
|
var ReviewRenderer = {
|
|
2677
2808
|
canRenderType: "review",
|
|
2678
2809
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2679
2810
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2680
|
-
return /* @__PURE__ */
|
|
2681
|
-
/* @__PURE__ */
|
|
2682
|
-
/* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ jsxs15("div", { className: getMargin(margin), children: [
|
|
2812
|
+
/* @__PURE__ */ jsx62(Header5, { title, callToAction }),
|
|
2813
|
+
/* @__PURE__ */ jsx62("div", { className: margin, children: /* @__PURE__ */ jsx62(
|
|
2683
2814
|
DefinitionList,
|
|
2684
2815
|
{
|
|
2685
2816
|
layout: orientation,
|
|
@@ -2717,10 +2848,10 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2717
2848
|
};
|
|
2718
2849
|
var getFieldLabel = (label, help, onClick) => {
|
|
2719
2850
|
if (help) {
|
|
2720
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
2721
2852
|
label,
|
|
2722
2853
|
" ",
|
|
2723
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx62(Help_default, { help, onClick })
|
|
2724
2855
|
] });
|
|
2725
2856
|
}
|
|
2726
2857
|
return label;
|
|
@@ -2730,7 +2861,7 @@ var getFieldLabel = (label, help, onClick) => {
|
|
|
2730
2861
|
import { ListItem as ListItem9, Markdown as Markdown4, Popover } from "@transferwise/components";
|
|
2731
2862
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
2732
2863
|
import { useIntl as useIntl10 } from "react-intl";
|
|
2733
|
-
import { jsx as
|
|
2864
|
+
import { jsx as jsx63, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2734
2865
|
var IGNORED_CONTROLS = [
|
|
2735
2866
|
"horizontal",
|
|
2736
2867
|
"horizontal-end-aligned",
|
|
@@ -2740,7 +2871,7 @@ var IGNORED_CONTROLS = [
|
|
|
2740
2871
|
var ReviewRenderer2 = {
|
|
2741
2872
|
canRenderType: "review",
|
|
2742
2873
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
2743
|
-
render: (props) => /* @__PURE__ */
|
|
2874
|
+
render: (props) => /* @__PURE__ */ jsx63(Review, __spreadValues({}, props))
|
|
2744
2875
|
};
|
|
2745
2876
|
var Review = ({
|
|
2746
2877
|
callToAction,
|
|
@@ -2752,8 +2883,8 @@ var Review = ({
|
|
|
2752
2883
|
trackEvent
|
|
2753
2884
|
}) => {
|
|
2754
2885
|
const intl = useIntl10();
|
|
2755
|
-
return /* @__PURE__ */
|
|
2756
|
-
/* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ jsxs16("div", { className: getMargin(margin), children: [
|
|
2887
|
+
/* @__PURE__ */ jsx63(Header5, { title, callToAction }),
|
|
2757
2888
|
fields.map((field) => {
|
|
2758
2889
|
var _a, _b, _c;
|
|
2759
2890
|
const {
|
|
@@ -2771,7 +2902,7 @@ var Review = ({
|
|
|
2771
2902
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2772
2903
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2773
2904
|
};
|
|
2774
|
-
return /* @__PURE__ */
|
|
2905
|
+
return /* @__PURE__ */ jsx63(
|
|
2775
2906
|
ListItem9,
|
|
2776
2907
|
{
|
|
2777
2908
|
title: value,
|
|
@@ -2792,13 +2923,13 @@ var Review = ({
|
|
|
2792
2923
|
] });
|
|
2793
2924
|
};
|
|
2794
2925
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
2795
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ jsx63(Popover, { content: /* @__PURE__ */ jsx63(Markdown4, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx63(ListItem9.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx63(QuestionMarkCircle, {}) }) });
|
|
2796
2927
|
};
|
|
2797
2928
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
2798
2929
|
|
|
2799
2930
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2800
2931
|
import { Input as Input4, InputGroup as InputGroup3, List, ListItem as ListItem10, Markdown as Markdown5 } from "@transferwise/components";
|
|
2801
|
-
import { useState as
|
|
2932
|
+
import { useState as useState10 } from "react";
|
|
2802
2933
|
import { useIntl as useIntl12 } from "react-intl";
|
|
2803
2934
|
|
|
2804
2935
|
// ../renderers/src/messages/search.messages.ts
|
|
@@ -2836,19 +2967,19 @@ var generic_error_messages_default = defineMessages10({
|
|
|
2836
2967
|
|
|
2837
2968
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2838
2969
|
import { Link } from "@transferwise/components";
|
|
2839
|
-
import { jsx as
|
|
2970
|
+
import { jsx as jsx64, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2840
2971
|
function ErrorResult({ state }) {
|
|
2841
2972
|
const intl = useIntl11();
|
|
2842
|
-
return /* @__PURE__ */
|
|
2973
|
+
return /* @__PURE__ */ jsxs17("p", { className: "m-t-2", children: [
|
|
2843
2974
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2844
2975
|
"\xA0",
|
|
2845
|
-
/* @__PURE__ */
|
|
2976
|
+
/* @__PURE__ */ jsx64(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
2846
2977
|
] });
|
|
2847
2978
|
}
|
|
2848
2979
|
|
|
2849
2980
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2850
2981
|
import { Search } from "@transferwise/icons";
|
|
2851
|
-
import { Fragment as Fragment7, jsx as
|
|
2982
|
+
import { Fragment as Fragment7, jsx as jsx65, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2852
2983
|
function BlockSearchRendererComponent({
|
|
2853
2984
|
id,
|
|
2854
2985
|
hint,
|
|
@@ -2860,10 +2991,10 @@ function BlockSearchRendererComponent({
|
|
|
2860
2991
|
trackEvent,
|
|
2861
2992
|
onChange
|
|
2862
2993
|
}) {
|
|
2863
|
-
const [hasSearched, setHasSearched] =
|
|
2994
|
+
const [hasSearched, setHasSearched] = useState10(false);
|
|
2864
2995
|
const { formatMessage } = useIntl12();
|
|
2865
|
-
return /* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2996
|
+
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
2997
|
+
/* @__PURE__ */ jsx65(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx65(InputGroup3, { addonStart: { content: /* @__PURE__ */ jsx65(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx65(
|
|
2867
2998
|
Input4,
|
|
2868
2999
|
{
|
|
2869
3000
|
id,
|
|
@@ -2880,7 +3011,7 @@ function BlockSearchRendererComponent({
|
|
|
2880
3011
|
}
|
|
2881
3012
|
}
|
|
2882
3013
|
) }) }),
|
|
2883
|
-
isLoading ? /* @__PURE__ */
|
|
3014
|
+
isLoading ? /* @__PURE__ */ jsx65("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx65(SearchResultContent, { state, trackEvent })
|
|
2884
3015
|
] });
|
|
2885
3016
|
}
|
|
2886
3017
|
function SearchResultContent({
|
|
@@ -2889,38 +3020,38 @@ function SearchResultContent({
|
|
|
2889
3020
|
}) {
|
|
2890
3021
|
switch (state.type) {
|
|
2891
3022
|
case "error":
|
|
2892
|
-
return /* @__PURE__ */
|
|
3023
|
+
return /* @__PURE__ */ jsx65(ErrorResult, { state });
|
|
2893
3024
|
case "results":
|
|
2894
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsx65(SearchResults, { state, trackEvent });
|
|
2895
3026
|
case "layout":
|
|
2896
|
-
return /* @__PURE__ */
|
|
3027
|
+
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
2897
3028
|
" ",
|
|
2898
3029
|
state.layout,
|
|
2899
3030
|
" "
|
|
2900
3031
|
] });
|
|
2901
3032
|
case "noResults":
|
|
2902
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ jsx65(EmptySearchResult, { state });
|
|
2903
3034
|
case "pending":
|
|
2904
3035
|
default:
|
|
2905
3036
|
return null;
|
|
2906
3037
|
}
|
|
2907
3038
|
}
|
|
2908
3039
|
function EmptySearchResult({ state }) {
|
|
2909
|
-
return /* @__PURE__ */
|
|
3040
|
+
return /* @__PURE__ */ jsx65(Markdown5, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2910
3041
|
}
|
|
2911
3042
|
function SearchResults({
|
|
2912
3043
|
state,
|
|
2913
3044
|
trackEvent
|
|
2914
3045
|
}) {
|
|
2915
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ jsx65(List, { children: state.results.map((result) => {
|
|
2916
3047
|
const { media } = result;
|
|
2917
|
-
return /* @__PURE__ */
|
|
3048
|
+
return /* @__PURE__ */ jsx65(
|
|
2918
3049
|
ListItem10,
|
|
2919
3050
|
{
|
|
2920
3051
|
title: result.title,
|
|
2921
3052
|
subtitle: result.description,
|
|
2922
|
-
media: media ? /* @__PURE__ */
|
|
2923
|
-
control: /* @__PURE__ */
|
|
3053
|
+
media: media ? /* @__PURE__ */ jsx65(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
3054
|
+
control: /* @__PURE__ */ jsx65(
|
|
2924
3055
|
ListItem10.Navigation,
|
|
2925
3056
|
{
|
|
2926
3057
|
onClick: () => {
|
|
@@ -2941,9 +3072,9 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2941
3072
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2942
3073
|
import { Markdown as Markdown6, Typeahead } from "@transferwise/components";
|
|
2943
3074
|
import { Search as Search2 } from "@transferwise/icons";
|
|
2944
|
-
import { useState as
|
|
3075
|
+
import { useState as useState11 } from "react";
|
|
2945
3076
|
import { useIntl as useIntl13 } from "react-intl";
|
|
2946
|
-
import { jsx as
|
|
3077
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2947
3078
|
function InlineSearchRenderer({
|
|
2948
3079
|
id,
|
|
2949
3080
|
hint,
|
|
@@ -2954,9 +3085,9 @@ function InlineSearchRenderer({
|
|
|
2954
3085
|
title,
|
|
2955
3086
|
trackEvent
|
|
2956
3087
|
}) {
|
|
2957
|
-
const [hasSearched, setHasSearched] =
|
|
3088
|
+
const [hasSearched, setHasSearched] = useState11(false);
|
|
2958
3089
|
const intl = useIntl13();
|
|
2959
|
-
return /* @__PURE__ */
|
|
3090
|
+
return /* @__PURE__ */ jsx66("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx66(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx66(
|
|
2960
3091
|
Typeahead,
|
|
2961
3092
|
{
|
|
2962
3093
|
id: "typeahead-input-id",
|
|
@@ -2965,10 +3096,10 @@ function InlineSearchRenderer({
|
|
|
2965
3096
|
size: "md",
|
|
2966
3097
|
placeholder: hint,
|
|
2967
3098
|
maxHeight: 100,
|
|
2968
|
-
footer: /* @__PURE__ */
|
|
3099
|
+
footer: /* @__PURE__ */ jsx66(TypeaheadFooter, { state, isLoading }),
|
|
2969
3100
|
multiple: false,
|
|
2970
3101
|
clearable: false,
|
|
2971
|
-
addon: /* @__PURE__ */
|
|
3102
|
+
addon: /* @__PURE__ */ jsx66(Search2, { size: 24 }),
|
|
2972
3103
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2973
3104
|
minQueryLength: 1,
|
|
2974
3105
|
onChange: (values) => {
|
|
@@ -3005,26 +3136,26 @@ function mapResultToTypeaheadOption(result) {
|
|
|
3005
3136
|
function TypeaheadFooter({ state, isLoading }) {
|
|
3006
3137
|
const { formatMessage } = useIntl13();
|
|
3007
3138
|
if (state.type === "layout") {
|
|
3008
|
-
return /* @__PURE__ */
|
|
3139
|
+
return /* @__PURE__ */ jsx66("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
3009
3140
|
}
|
|
3010
3141
|
if (state.type === "noResults") {
|
|
3011
|
-
return /* @__PURE__ */
|
|
3142
|
+
return /* @__PURE__ */ jsx66(Markdown6, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
3012
3143
|
}
|
|
3013
3144
|
if (state.type === "error") {
|
|
3014
|
-
return /* @__PURE__ */
|
|
3145
|
+
return /* @__PURE__ */ jsx66("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx66(ErrorResult, { state }) });
|
|
3015
3146
|
}
|
|
3016
3147
|
if (state.type === "pending" || isLoading) {
|
|
3017
|
-
return /* @__PURE__ */
|
|
3148
|
+
return /* @__PURE__ */ jsx66("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
3018
3149
|
}
|
|
3019
3150
|
return null;
|
|
3020
3151
|
}
|
|
3021
3152
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
3022
3153
|
|
|
3023
3154
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
3024
|
-
import { jsx as
|
|
3155
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
3025
3156
|
var SearchRenderer = {
|
|
3026
3157
|
canRenderType: "search",
|
|
3027
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
3158
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx67(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx67(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
3028
3159
|
};
|
|
3029
3160
|
var SearchRenderer_default = SearchRenderer;
|
|
3030
3161
|
|
|
@@ -3053,12 +3184,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
3053
3184
|
};
|
|
3054
3185
|
|
|
3055
3186
|
// ../renderers/src/SectionRenderer.tsx
|
|
3056
|
-
import { jsx as
|
|
3187
|
+
import { jsx as jsx68, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3057
3188
|
var SectionRenderer = {
|
|
3058
3189
|
canRenderType: "section",
|
|
3059
3190
|
render: ({ children, callToAction, margin, title }) => {
|
|
3060
|
-
return /* @__PURE__ */
|
|
3061
|
-
(title || callToAction) && /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ jsxs19("section", { className: getMargin(margin), children: [
|
|
3192
|
+
(title || callToAction) && /* @__PURE__ */ jsx68(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
3062
3193
|
children
|
|
3063
3194
|
] });
|
|
3064
3195
|
}
|
|
@@ -3067,7 +3198,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
3067
3198
|
|
|
3068
3199
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
3069
3200
|
import { RadioGroup } from "@transferwise/components";
|
|
3070
|
-
import { Fragment as Fragment8, jsx as
|
|
3201
|
+
import { Fragment as Fragment8, jsx as jsx69, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3071
3202
|
function RadioInputRendererComponent(props) {
|
|
3072
3203
|
const {
|
|
3073
3204
|
id,
|
|
@@ -3081,8 +3212,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3081
3212
|
validationState,
|
|
3082
3213
|
onSelect
|
|
3083
3214
|
} = props;
|
|
3084
|
-
return /* @__PURE__ */
|
|
3085
|
-
/* @__PURE__ */
|
|
3215
|
+
return /* @__PURE__ */ jsxs20(Fragment8, { children: [
|
|
3216
|
+
/* @__PURE__ */ jsx69(
|
|
3086
3217
|
FieldInput_default,
|
|
3087
3218
|
{
|
|
3088
3219
|
id,
|
|
@@ -3090,7 +3221,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3090
3221
|
help,
|
|
3091
3222
|
description,
|
|
3092
3223
|
validation: validationState,
|
|
3093
|
-
children: /* @__PURE__ */
|
|
3224
|
+
children: /* @__PURE__ */ jsx69("span", { children: /* @__PURE__ */ jsx69(
|
|
3094
3225
|
RadioGroup,
|
|
3095
3226
|
{
|
|
3096
3227
|
name: id,
|
|
@@ -3099,7 +3230,7 @@ function RadioInputRendererComponent(props) {
|
|
|
3099
3230
|
value: index,
|
|
3100
3231
|
secondary: option.description,
|
|
3101
3232
|
disabled: option.disabled || disabled,
|
|
3102
|
-
avatar: /* @__PURE__ */
|
|
3233
|
+
avatar: /* @__PURE__ */ jsx69(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3103
3234
|
})),
|
|
3104
3235
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
3105
3236
|
onChange: onSelect
|
|
@@ -3114,8 +3245,8 @@ function RadioInputRendererComponent(props) {
|
|
|
3114
3245
|
|
|
3115
3246
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
3116
3247
|
import { Tabs } from "@transferwise/components";
|
|
3117
|
-
import { useEffect as
|
|
3118
|
-
import { Fragment as Fragment9, jsx as
|
|
3248
|
+
import { useEffect as useEffect7 } from "react";
|
|
3249
|
+
import { Fragment as Fragment9, jsx as jsx70, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3119
3250
|
function TabInputRendererComponent(props) {
|
|
3120
3251
|
const {
|
|
3121
3252
|
id,
|
|
@@ -3129,13 +3260,13 @@ function TabInputRendererComponent(props) {
|
|
|
3129
3260
|
validationState,
|
|
3130
3261
|
onSelect
|
|
3131
3262
|
} = props;
|
|
3132
|
-
|
|
3263
|
+
useEffect7(() => {
|
|
3133
3264
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
3134
3265
|
onSelect(0);
|
|
3135
3266
|
}
|
|
3136
3267
|
}, [selectedIndex, onSelect, options.length]);
|
|
3137
|
-
return /* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3268
|
+
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
3269
|
+
/* @__PURE__ */ jsx70(
|
|
3139
3270
|
FieldInput_default,
|
|
3140
3271
|
{
|
|
3141
3272
|
id,
|
|
@@ -3143,7 +3274,7 @@ function TabInputRendererComponent(props) {
|
|
|
3143
3274
|
help,
|
|
3144
3275
|
description,
|
|
3145
3276
|
validation: validationState,
|
|
3146
|
-
children: /* @__PURE__ */
|
|
3277
|
+
children: /* @__PURE__ */ jsx70(
|
|
3147
3278
|
Tabs,
|
|
3148
3279
|
{
|
|
3149
3280
|
name: id,
|
|
@@ -3152,7 +3283,7 @@ function TabInputRendererComponent(props) {
|
|
|
3152
3283
|
title: option.title,
|
|
3153
3284
|
// if we pass null, we get some props-types console errors
|
|
3154
3285
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
3155
|
-
content: /* @__PURE__ */
|
|
3286
|
+
content: /* @__PURE__ */ jsx70(Fragment9, {}),
|
|
3156
3287
|
disabled: option.disabled || disabled
|
|
3157
3288
|
})),
|
|
3158
3289
|
onTabSelect: onSelect
|
|
@@ -3167,7 +3298,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
3167
3298
|
|
|
3168
3299
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
3169
3300
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
3170
|
-
import { Fragment as Fragment10, jsx as
|
|
3301
|
+
import { Fragment as Fragment10, jsx as jsx71, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3171
3302
|
function SelectInputRendererComponent(props) {
|
|
3172
3303
|
const {
|
|
3173
3304
|
id,
|
|
@@ -3207,13 +3338,13 @@ function SelectInputRendererComponent(props) {
|
|
|
3207
3338
|
} : {
|
|
3208
3339
|
title: option.title,
|
|
3209
3340
|
description: option.description,
|
|
3210
|
-
icon: /* @__PURE__ */
|
|
3341
|
+
icon: /* @__PURE__ */ jsx71(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3211
3342
|
};
|
|
3212
|
-
return /* @__PURE__ */
|
|
3343
|
+
return /* @__PURE__ */ jsx71(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
3213
3344
|
};
|
|
3214
3345
|
const extraProps = { autoComplete };
|
|
3215
|
-
return /* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3346
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
3347
|
+
/* @__PURE__ */ jsx71(
|
|
3217
3348
|
FieldInput_default,
|
|
3218
3349
|
{
|
|
3219
3350
|
id,
|
|
@@ -3221,7 +3352,7 @@ function SelectInputRendererComponent(props) {
|
|
|
3221
3352
|
help,
|
|
3222
3353
|
description,
|
|
3223
3354
|
validation: validationState,
|
|
3224
|
-
children: /* @__PURE__ */
|
|
3355
|
+
children: /* @__PURE__ */ jsx71(
|
|
3225
3356
|
SelectInput2,
|
|
3226
3357
|
__spreadValues({
|
|
3227
3358
|
name: id,
|
|
@@ -3242,9 +3373,9 @@ function SelectInputRendererComponent(props) {
|
|
|
3242
3373
|
}
|
|
3243
3374
|
|
|
3244
3375
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
3245
|
-
import { useEffect as
|
|
3376
|
+
import { useEffect as useEffect8 } from "react";
|
|
3246
3377
|
import { SegmentedControl } from "@transferwise/components";
|
|
3247
|
-
import { Fragment as Fragment11, jsx as
|
|
3378
|
+
import { Fragment as Fragment11, jsx as jsx72, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3248
3379
|
function SegmentedInputRendererComponent(props) {
|
|
3249
3380
|
const {
|
|
3250
3381
|
id,
|
|
@@ -3257,13 +3388,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3257
3388
|
validationState,
|
|
3258
3389
|
onSelect
|
|
3259
3390
|
} = props;
|
|
3260
|
-
|
|
3391
|
+
useEffect8(() => {
|
|
3261
3392
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
3262
3393
|
onSelect(0);
|
|
3263
3394
|
}
|
|
3264
3395
|
}, [selectedIndex, onSelect, options.length]);
|
|
3265
|
-
return /* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3396
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
3397
|
+
/* @__PURE__ */ jsx72(
|
|
3267
3398
|
FieldInput_default,
|
|
3268
3399
|
{
|
|
3269
3400
|
id,
|
|
@@ -3271,7 +3402,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3271
3402
|
help,
|
|
3272
3403
|
description,
|
|
3273
3404
|
validation: validationState,
|
|
3274
|
-
children: /* @__PURE__ */
|
|
3405
|
+
children: /* @__PURE__ */ jsx72(
|
|
3275
3406
|
SegmentedControl,
|
|
3276
3407
|
{
|
|
3277
3408
|
name: `${id}-segmented-control`,
|
|
@@ -3288,14 +3419,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
3288
3419
|
)
|
|
3289
3420
|
}
|
|
3290
3421
|
),
|
|
3291
|
-
/* @__PURE__ */
|
|
3422
|
+
/* @__PURE__ */ jsx72("div", { id: `${id}-children`, children })
|
|
3292
3423
|
] });
|
|
3293
3424
|
}
|
|
3294
3425
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
3295
3426
|
|
|
3296
3427
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
3297
3428
|
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem11 } from "@transferwise/components";
|
|
3298
|
-
import { Fragment as Fragment12, jsx as
|
|
3429
|
+
import { Fragment as Fragment12, jsx as jsx73, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3299
3430
|
function RadioItemRendererComponent(props) {
|
|
3300
3431
|
const {
|
|
3301
3432
|
id,
|
|
@@ -3309,22 +3440,22 @@ function RadioItemRendererComponent(props) {
|
|
|
3309
3440
|
validationState,
|
|
3310
3441
|
onSelect
|
|
3311
3442
|
} = props;
|
|
3312
|
-
return /* @__PURE__ */
|
|
3313
|
-
rootTitle && /* @__PURE__ */
|
|
3443
|
+
return /* @__PURE__ */ jsxs24(Fragment12, { children: [
|
|
3444
|
+
rootTitle && /* @__PURE__ */ jsx73(
|
|
3314
3445
|
Header8,
|
|
3315
3446
|
{
|
|
3316
3447
|
as: "h2",
|
|
3317
|
-
title: help ? /* @__PURE__ */
|
|
3448
|
+
title: help ? /* @__PURE__ */ jsx73(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
3318
3449
|
}
|
|
3319
3450
|
),
|
|
3320
|
-
rootDescription && /* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
3451
|
+
rootDescription && /* @__PURE__ */ jsx73("p", { children: rootDescription }),
|
|
3452
|
+
/* @__PURE__ */ jsx73(List2, { children: options.map(
|
|
3453
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx73(
|
|
3323
3454
|
ListItem11,
|
|
3324
3455
|
__spreadValues({
|
|
3325
3456
|
title,
|
|
3326
3457
|
subtitle: description,
|
|
3327
|
-
control: /* @__PURE__ */
|
|
3458
|
+
control: /* @__PURE__ */ jsx73(
|
|
3328
3459
|
ListItem11.Radio,
|
|
3329
3460
|
{
|
|
3330
3461
|
name: title,
|
|
@@ -3340,28 +3471,28 @@ function RadioItemRendererComponent(props) {
|
|
|
3340
3471
|
title
|
|
3341
3472
|
)
|
|
3342
3473
|
) }, `${id}-${selectedIndex}`),
|
|
3343
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
3474
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx73(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
3344
3475
|
children
|
|
3345
3476
|
] });
|
|
3346
3477
|
}
|
|
3347
3478
|
|
|
3348
3479
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
3349
|
-
import { jsx as
|
|
3480
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3350
3481
|
var SelectInputRenderer = {
|
|
3351
3482
|
canRenderType: "input-select",
|
|
3352
3483
|
render: (props) => {
|
|
3353
3484
|
switch (props.control) {
|
|
3354
3485
|
case "radio":
|
|
3355
|
-
return /* @__PURE__ */
|
|
3486
|
+
return /* @__PURE__ */ jsx74(RadioInputRendererComponent, __spreadValues({}, props));
|
|
3356
3487
|
case "radio-item":
|
|
3357
|
-
return /* @__PURE__ */
|
|
3488
|
+
return /* @__PURE__ */ jsx74(RadioItemRendererComponent, __spreadValues({}, props));
|
|
3358
3489
|
case "tab":
|
|
3359
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3490
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx74(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx74(TabInputRendererComponent, __spreadValues({}, props));
|
|
3360
3491
|
case "segmented":
|
|
3361
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
3492
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx74(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx74(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
3362
3493
|
case "select":
|
|
3363
3494
|
default:
|
|
3364
|
-
return /* @__PURE__ */
|
|
3495
|
+
return /* @__PURE__ */ jsx74(SelectInputRendererComponent, __spreadValues({}, props));
|
|
3365
3496
|
}
|
|
3366
3497
|
}
|
|
3367
3498
|
};
|
|
@@ -3369,20 +3500,20 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
3369
3500
|
|
|
3370
3501
|
// ../renderers/src/StatusListRenderer.tsx
|
|
3371
3502
|
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem12 } from "@transferwise/components";
|
|
3372
|
-
import { jsx as
|
|
3503
|
+
import { jsx as jsx75, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3373
3504
|
var StatusListRenderer = {
|
|
3374
3505
|
canRenderType: "status-list",
|
|
3375
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
3376
|
-
title ? /* @__PURE__ */
|
|
3506
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
3507
|
+
title ? /* @__PURE__ */ jsx75(Header9, { title }) : null,
|
|
3377
3508
|
items.map((item) => {
|
|
3378
3509
|
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3379
|
-
return /* @__PURE__ */
|
|
3510
|
+
return /* @__PURE__ */ jsx75(
|
|
3380
3511
|
ListItem12,
|
|
3381
3512
|
{
|
|
3382
3513
|
title: itemTitle,
|
|
3383
3514
|
subtitle: description,
|
|
3384
|
-
media: icon && "name" in icon ? /* @__PURE__ */
|
|
3385
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
3515
|
+
media: icon && "name" in icon ? /* @__PURE__ */ jsx75(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx75(DynamicIcon_default, { name: icon.name }) }) : void 0,
|
|
3516
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx75(
|
|
3386
3517
|
ListItem12.AdditionalInfo,
|
|
3387
3518
|
{
|
|
3388
3519
|
action: {
|
|
@@ -3413,12 +3544,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
3413
3544
|
|
|
3414
3545
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
3415
3546
|
import { useTheme } from "@wise/components-theming";
|
|
3416
|
-
import { useEffect as
|
|
3547
|
+
import { useEffect as useEffect9, useMemo } from "react";
|
|
3417
3548
|
var ThemeRequiredEventName = "Theme Required";
|
|
3418
3549
|
var useCustomTheme = (theme, trackEvent) => {
|
|
3419
3550
|
const theming = useTheme();
|
|
3420
3551
|
const previousTheme = useMemo(() => theming.theme, []);
|
|
3421
|
-
|
|
3552
|
+
useEffect9(() => {
|
|
3422
3553
|
theming.setTheme(theme);
|
|
3423
3554
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
3424
3555
|
return theme !== previousTheme ? () => {
|
|
@@ -3445,30 +3576,30 @@ var back_messages_default = defineMessages11({
|
|
|
3445
3576
|
});
|
|
3446
3577
|
|
|
3447
3578
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
3448
|
-
import { jsx as
|
|
3579
|
+
import { jsx as jsx76, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3449
3580
|
function BackButton({ title, onClick }) {
|
|
3450
3581
|
const { formatMessage } = useIntl14();
|
|
3451
|
-
return /* @__PURE__ */
|
|
3452
|
-
/* @__PURE__ */
|
|
3453
|
-
/* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsxs26(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3583
|
+
/* @__PURE__ */ jsx76("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3584
|
+
/* @__PURE__ */ jsx76(ArrowLeft, {})
|
|
3454
3585
|
] });
|
|
3455
3586
|
}
|
|
3456
3587
|
|
|
3457
3588
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
3458
3589
|
import { Button as Button7, IconButton as IconButton2 } from "@transferwise/components";
|
|
3459
|
-
import { jsx as
|
|
3590
|
+
import { jsx as jsx77, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3460
3591
|
var Toolbar = ({ items }) => {
|
|
3461
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
3592
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx77("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx77(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
3462
3593
|
};
|
|
3463
3594
|
function ToolbarButton(props) {
|
|
3464
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
3595
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx77(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx77(TextToolbarButton, __spreadValues({}, props));
|
|
3465
3596
|
}
|
|
3466
3597
|
function MediaToolbarButton(props) {
|
|
3467
3598
|
var _a;
|
|
3468
3599
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
3469
3600
|
const priority = getIconButtonPriority(control);
|
|
3470
3601
|
const type = getSentiment2(context);
|
|
3471
|
-
return /* @__PURE__ */
|
|
3602
|
+
return /* @__PURE__ */ jsxs27(
|
|
3472
3603
|
IconButton2,
|
|
3473
3604
|
{
|
|
3474
3605
|
className: "df-toolbar-button",
|
|
@@ -3478,7 +3609,7 @@ function MediaToolbarButton(props) {
|
|
|
3478
3609
|
type,
|
|
3479
3610
|
onClick,
|
|
3480
3611
|
children: [
|
|
3481
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
3612
|
+
accessibilityDescription ? /* @__PURE__ */ jsx77("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
3482
3613
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
3483
3614
|
]
|
|
3484
3615
|
}
|
|
@@ -3489,7 +3620,7 @@ function TextToolbarButton(props) {
|
|
|
3489
3620
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
3490
3621
|
const priority = getPriority2(control);
|
|
3491
3622
|
const sentiment = getSentiment2(context);
|
|
3492
|
-
return /* @__PURE__ */
|
|
3623
|
+
return /* @__PURE__ */ jsx77(
|
|
3493
3624
|
Button7,
|
|
3494
3625
|
{
|
|
3495
3626
|
v2: true,
|
|
@@ -3519,17 +3650,17 @@ var getIconButtonPriority = (control) => {
|
|
|
3519
3650
|
};
|
|
3520
3651
|
|
|
3521
3652
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
3522
|
-
import { jsx as
|
|
3653
|
+
import { jsx as jsx78, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3523
3654
|
function TopBar({ back, toolbar }) {
|
|
3524
|
-
return back || toolbar ? /* @__PURE__ */
|
|
3525
|
-
back ? /* @__PURE__ */
|
|
3526
|
-
toolbar ? /* @__PURE__ */
|
|
3655
|
+
return back || toolbar ? /* @__PURE__ */ jsxs28("div", { className: "d-flex m-b-2", children: [
|
|
3656
|
+
back ? /* @__PURE__ */ jsx78(BackButton, __spreadValues({}, back)) : null,
|
|
3657
|
+
toolbar ? /* @__PURE__ */ jsx78(Toolbar, __spreadValues({}, toolbar)) : null
|
|
3527
3658
|
] }) : null;
|
|
3528
3659
|
}
|
|
3529
3660
|
|
|
3530
3661
|
// ../renderers/src/step/StepFooter.tsx
|
|
3531
3662
|
import { Button as Button8 } from "@transferwise/components";
|
|
3532
|
-
import { useEffect as
|
|
3663
|
+
import { useEffect as useEffect10, useRef, useState as useState12 } from "react";
|
|
3533
3664
|
import { useIntl as useIntl15 } from "react-intl";
|
|
3534
3665
|
|
|
3535
3666
|
// ../renderers/src/messages/step.messages.ts
|
|
@@ -3543,23 +3674,23 @@ var step_messages_default = defineMessages12({
|
|
|
3543
3674
|
});
|
|
3544
3675
|
|
|
3545
3676
|
// ../renderers/src/step/StepFooter.tsx
|
|
3546
|
-
import { Fragment as Fragment13, jsx as
|
|
3677
|
+
import { Fragment as Fragment13, jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3547
3678
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3548
3679
|
var StepFooter = ({ footer, tags }) => {
|
|
3549
3680
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3550
|
-
return /* @__PURE__ */
|
|
3681
|
+
return /* @__PURE__ */ jsx79(FooterWithScrollButton, { footer });
|
|
3551
3682
|
}
|
|
3552
|
-
return /* @__PURE__ */
|
|
3683
|
+
return /* @__PURE__ */ jsx79(DefaultFooter, { footer });
|
|
3553
3684
|
};
|
|
3554
3685
|
var DefaultFooter = ({ footer }) => {
|
|
3555
3686
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3556
|
-
return hasFooter ? /* @__PURE__ */
|
|
3687
|
+
return hasFooter ? /* @__PURE__ */ jsx79("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3557
3688
|
};
|
|
3558
3689
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3559
3690
|
const { formatMessage } = useIntl15();
|
|
3560
3691
|
const endOfLayoutRef = useRef(null);
|
|
3561
3692
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3562
|
-
const scrollButton = /* @__PURE__ */
|
|
3693
|
+
const scrollButton = /* @__PURE__ */ jsx79(
|
|
3563
3694
|
Button8,
|
|
3564
3695
|
{
|
|
3565
3696
|
className: "m-b-1",
|
|
@@ -3575,19 +3706,19 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3575
3706
|
);
|
|
3576
3707
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3577
3708
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3578
|
-
return /* @__PURE__ */
|
|
3709
|
+
return /* @__PURE__ */ jsx79("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3579
3710
|
}
|
|
3580
|
-
return /* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3711
|
+
return /* @__PURE__ */ jsxs29(Fragment13, { children: [
|
|
3712
|
+
/* @__PURE__ */ jsx79("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3713
|
+
/* @__PURE__ */ jsxs29("div", { className: "df-step-fixed__footer", children: [
|
|
3583
3714
|
!isElementVisible && scrollButton,
|
|
3584
3715
|
footer
|
|
3585
3716
|
] })
|
|
3586
3717
|
] });
|
|
3587
3718
|
};
|
|
3588
3719
|
var useIsElementVisible = (elementRef) => {
|
|
3589
|
-
const [isVisible, setIsVisible] =
|
|
3590
|
-
|
|
3720
|
+
const [isVisible, setIsVisible] = useState12(false);
|
|
3721
|
+
useEffect10(() => {
|
|
3591
3722
|
const element = elementRef.current;
|
|
3592
3723
|
if (!element) return;
|
|
3593
3724
|
const observer = new IntersectionObserver(([entry]) => {
|
|
@@ -3600,7 +3731,7 @@ var useIsElementVisible = (elementRef) => {
|
|
|
3600
3731
|
};
|
|
3601
3732
|
|
|
3602
3733
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
3603
|
-
import { jsx as
|
|
3734
|
+
import { jsx as jsx80, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3604
3735
|
var SplashCelebrationStepRenderer = {
|
|
3605
3736
|
canRenderType: "step",
|
|
3606
3737
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -3609,15 +3740,15 @@ var SplashCelebrationStepRenderer = {
|
|
|
3609
3740
|
function SplashCelebrationStepRendererComponent(props) {
|
|
3610
3741
|
const { back, toolbar, children, footer, tags, trackEvent } = props;
|
|
3611
3742
|
useCustomTheme("forest-green", trackEvent);
|
|
3612
|
-
return /* @__PURE__ */
|
|
3613
|
-
/* @__PURE__ */
|
|
3743
|
+
return /* @__PURE__ */ jsxs30("div", { className: "splash-screen m-t-5", children: [
|
|
3744
|
+
/* @__PURE__ */ jsx80(TopBar, { back, toolbar }),
|
|
3614
3745
|
children,
|
|
3615
|
-
/* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ jsx80(StepFooter, { footer, tags })
|
|
3616
3747
|
] });
|
|
3617
3748
|
}
|
|
3618
3749
|
|
|
3619
3750
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
3620
|
-
import { jsx as
|
|
3751
|
+
import { jsx as jsx81, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3621
3752
|
var SplashStepRenderer = {
|
|
3622
3753
|
canRenderType: "step",
|
|
3623
3754
|
canRender: ({ control }) => control === "splash",
|
|
@@ -3625,10 +3756,10 @@ var SplashStepRenderer = {
|
|
|
3625
3756
|
};
|
|
3626
3757
|
function SplashStepRendererComponent(props) {
|
|
3627
3758
|
const { back, toolbar, children, footer, tags } = props;
|
|
3628
|
-
return /* @__PURE__ */
|
|
3629
|
-
/* @__PURE__ */
|
|
3759
|
+
return /* @__PURE__ */ jsxs31("div", { className: "splash-screen m-t-5", children: [
|
|
3760
|
+
/* @__PURE__ */ jsx81(TopBar, { back, toolbar }),
|
|
3630
3761
|
children,
|
|
3631
|
-
/* @__PURE__ */
|
|
3762
|
+
/* @__PURE__ */ jsx81(StepFooter, { footer, tags })
|
|
3632
3763
|
] });
|
|
3633
3764
|
}
|
|
3634
3765
|
|
|
@@ -3637,12 +3768,12 @@ import { Alert as Alert2 } from "@transferwise/components";
|
|
|
3637
3768
|
|
|
3638
3769
|
// ../renderers/src/step/StepHeader.tsx
|
|
3639
3770
|
import { Title as Title2 } from "@transferwise/components";
|
|
3640
|
-
import { Fragment as Fragment14, jsx as
|
|
3771
|
+
import { Fragment as Fragment14, jsx as jsx82, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3641
3772
|
var StepHeader = ({ title, description, tags }) => {
|
|
3642
3773
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
3643
|
-
return /* @__PURE__ */
|
|
3644
|
-
title ? /* @__PURE__ */
|
|
3645
|
-
description ? /* @__PURE__ */
|
|
3774
|
+
return /* @__PURE__ */ jsxs32(Fragment14, { children: [
|
|
3775
|
+
title ? /* @__PURE__ */ jsx82(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3776
|
+
description ? /* @__PURE__ */ jsx82("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
3646
3777
|
] });
|
|
3647
3778
|
};
|
|
3648
3779
|
var getHeaderStyle = (tags) => {
|
|
@@ -3653,45 +3784,45 @@ var getHeaderStyle = (tags) => {
|
|
|
3653
3784
|
};
|
|
3654
3785
|
|
|
3655
3786
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3656
|
-
import { jsx as
|
|
3787
|
+
import { jsx as jsx83, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3657
3788
|
var StepRenderer = {
|
|
3658
3789
|
canRenderType: "step",
|
|
3659
3790
|
render: StepRendererComponent
|
|
3660
3791
|
};
|
|
3661
3792
|
function StepRendererComponent(props) {
|
|
3662
3793
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
3663
|
-
return /* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3665
|
-
title || description ? /* @__PURE__ */
|
|
3666
|
-
error ? /* @__PURE__ */
|
|
3794
|
+
return /* @__PURE__ */ jsxs33("div", { children: [
|
|
3795
|
+
/* @__PURE__ */ jsx83(TopBar, { back, toolbar }),
|
|
3796
|
+
title || description ? /* @__PURE__ */ jsx83("div", { className: "m-b-4", children: /* @__PURE__ */ jsx83(StepHeader, { title, description, tags }) }) : void 0,
|
|
3797
|
+
error ? /* @__PURE__ */ jsx83(Alert2, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
3667
3798
|
children,
|
|
3668
|
-
/* @__PURE__ */
|
|
3799
|
+
/* @__PURE__ */ jsx83(StepFooter, { footer, tags })
|
|
3669
3800
|
] });
|
|
3670
3801
|
}
|
|
3671
3802
|
|
|
3672
3803
|
// ../renderers/src/TabsRenderer.tsx
|
|
3673
3804
|
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
3674
|
-
import { useState as
|
|
3675
|
-
import { jsx as
|
|
3805
|
+
import { useState as useState13 } from "react";
|
|
3806
|
+
import { jsx as jsx84, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3676
3807
|
var TabsRenderer = {
|
|
3677
3808
|
canRenderType: "tabs",
|
|
3678
3809
|
render: (props) => {
|
|
3679
3810
|
switch (props.control) {
|
|
3680
3811
|
case "segmented":
|
|
3681
3812
|
if (props.tabs.length > 3) {
|
|
3682
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ jsx84(TabsRendererComponent, __spreadValues({}, props));
|
|
3683
3814
|
}
|
|
3684
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ jsx84(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3685
3816
|
case "chips":
|
|
3686
|
-
return /* @__PURE__ */
|
|
3817
|
+
return /* @__PURE__ */ jsx84(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3687
3818
|
default:
|
|
3688
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsx84(TabsRendererComponent, __spreadValues({}, props));
|
|
3689
3820
|
}
|
|
3690
3821
|
}
|
|
3691
3822
|
};
|
|
3692
3823
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3693
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3694
|
-
return /* @__PURE__ */
|
|
3824
|
+
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
3825
|
+
return /* @__PURE__ */ jsx84("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx84(
|
|
3695
3826
|
Tabs2,
|
|
3696
3827
|
{
|
|
3697
3828
|
name: uid,
|
|
@@ -3699,7 +3830,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3699
3830
|
tabs: tabs.map((option) => ({
|
|
3700
3831
|
title: option.title,
|
|
3701
3832
|
disabled: false,
|
|
3702
|
-
content: /* @__PURE__ */
|
|
3833
|
+
content: /* @__PURE__ */ jsxs34("div", { className: "m-t-2", children: [
|
|
3703
3834
|
" ",
|
|
3704
3835
|
option.children,
|
|
3705
3836
|
" "
|
|
@@ -3711,9 +3842,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3711
3842
|
}
|
|
3712
3843
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3713
3844
|
var _a;
|
|
3714
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3715
|
-
return /* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3845
|
+
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
3846
|
+
return /* @__PURE__ */ jsxs34("div", { className: getMargin(margin), children: [
|
|
3847
|
+
/* @__PURE__ */ jsx84(
|
|
3717
3848
|
SegmentedControl2,
|
|
3718
3849
|
{
|
|
3719
3850
|
name: uid,
|
|
@@ -3728,14 +3859,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3728
3859
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3729
3860
|
}
|
|
3730
3861
|
),
|
|
3731
|
-
/* @__PURE__ */
|
|
3862
|
+
/* @__PURE__ */ jsx84("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3732
3863
|
] });
|
|
3733
3864
|
}
|
|
3734
3865
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3735
3866
|
var _a;
|
|
3736
|
-
const [selectedIndex, setSelectedIndex] =
|
|
3737
|
-
return /* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
3867
|
+
const [selectedIndex, setSelectedIndex] = useState13(0);
|
|
3868
|
+
return /* @__PURE__ */ jsxs34("div", { className: getMargin(margin), children: [
|
|
3869
|
+
/* @__PURE__ */ jsx84("div", { className: "chips-container", children: /* @__PURE__ */ jsx84(
|
|
3739
3870
|
Chips,
|
|
3740
3871
|
{
|
|
3741
3872
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -3743,7 +3874,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
|
3743
3874
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3744
3875
|
}
|
|
3745
3876
|
) }),
|
|
3746
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ jsx84("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3747
3878
|
] });
|
|
3748
3879
|
}
|
|
3749
3880
|
|
|
@@ -3758,7 +3889,7 @@ import {
|
|
|
3758
3889
|
TextArea,
|
|
3759
3890
|
TextareaWithDisplayFormat
|
|
3760
3891
|
} from "@transferwise/components";
|
|
3761
|
-
import { jsx as
|
|
3892
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
3762
3893
|
var commonKeys = [
|
|
3763
3894
|
"autoComplete",
|
|
3764
3895
|
"autoCapitalize",
|
|
@@ -3777,12 +3908,12 @@ function VariableTextInput(inputProps) {
|
|
|
3777
3908
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3778
3909
|
switch (control) {
|
|
3779
3910
|
case "email":
|
|
3780
|
-
return /* @__PURE__ */
|
|
3911
|
+
return /* @__PURE__ */ jsx85(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3781
3912
|
case "password":
|
|
3782
|
-
return /* @__PURE__ */
|
|
3913
|
+
return /* @__PURE__ */ jsx85(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3783
3914
|
case "numeric": {
|
|
3784
3915
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3785
|
-
return /* @__PURE__ */
|
|
3916
|
+
return /* @__PURE__ */ jsx85(
|
|
3786
3917
|
TextInput,
|
|
3787
3918
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3788
3919
|
onChange: (newValue) => {
|
|
@@ -3793,9 +3924,9 @@ function VariableTextInput(inputProps) {
|
|
|
3793
3924
|
);
|
|
3794
3925
|
}
|
|
3795
3926
|
case "phone-number":
|
|
3796
|
-
return /* @__PURE__ */
|
|
3927
|
+
return /* @__PURE__ */ jsx85(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3797
3928
|
default: {
|
|
3798
|
-
return /* @__PURE__ */
|
|
3929
|
+
return /* @__PURE__ */ jsx85(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3799
3930
|
}
|
|
3800
3931
|
}
|
|
3801
3932
|
}
|
|
@@ -3803,11 +3934,11 @@ function TextInput(props) {
|
|
|
3803
3934
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3804
3935
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
3805
3936
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
3806
|
-
return displayFormat ? /* @__PURE__ */
|
|
3937
|
+
return displayFormat ? /* @__PURE__ */ jsx85(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx85(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3807
3938
|
}
|
|
3808
3939
|
|
|
3809
3940
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3810
|
-
import { jsx as
|
|
3941
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
3811
3942
|
var TextInputRenderer = {
|
|
3812
3943
|
canRenderType: "input-text",
|
|
3813
3944
|
render: (props) => {
|
|
@@ -3840,7 +3971,7 @@ var TextInputRenderer = {
|
|
|
3840
3971
|
}
|
|
3841
3972
|
}
|
|
3842
3973
|
});
|
|
3843
|
-
return /* @__PURE__ */
|
|
3974
|
+
return /* @__PURE__ */ jsx86(
|
|
3844
3975
|
FieldInput_default,
|
|
3845
3976
|
{
|
|
3846
3977
|
id,
|
|
@@ -3848,7 +3979,7 @@ var TextInputRenderer = {
|
|
|
3848
3979
|
description,
|
|
3849
3980
|
validation: validationState,
|
|
3850
3981
|
help,
|
|
3851
|
-
children: /* @__PURE__ */
|
|
3982
|
+
children: /* @__PURE__ */ jsx86(InputGroup4, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx86(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3852
3983
|
}
|
|
3853
3984
|
);
|
|
3854
3985
|
}
|
|
@@ -3862,7 +3993,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
3862
3993
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3863
3994
|
|
|
3864
3995
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3865
|
-
import { jsx as
|
|
3996
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
3866
3997
|
var UploadInputRenderer = {
|
|
3867
3998
|
canRenderType: "input-upload",
|
|
3868
3999
|
render: (props) => {
|
|
@@ -3878,14 +4009,14 @@ var UploadInputRenderer = {
|
|
|
3878
4009
|
};
|
|
3879
4010
|
return (
|
|
3880
4011
|
// We don't pass help here as there is no sensible place to display it
|
|
3881
|
-
/* @__PURE__ */
|
|
4012
|
+
/* @__PURE__ */ jsx87(
|
|
3882
4013
|
UploadFieldInput_default,
|
|
3883
4014
|
{
|
|
3884
4015
|
id,
|
|
3885
4016
|
label: void 0,
|
|
3886
4017
|
description: void 0,
|
|
3887
4018
|
validation: validationState,
|
|
3888
|
-
children: /* @__PURE__ */
|
|
4019
|
+
children: /* @__PURE__ */ jsx87(
|
|
3889
4020
|
UploadInput2,
|
|
3890
4021
|
{
|
|
3891
4022
|
id,
|
|
@@ -3951,7 +4082,7 @@ var LargeUploadRenderer = {
|
|
|
3951
4082
|
};
|
|
3952
4083
|
const filetypes = acceptsToFileTypes(accepts);
|
|
3953
4084
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3954
|
-
return /* @__PURE__ */
|
|
4085
|
+
return /* @__PURE__ */ jsx87(
|
|
3955
4086
|
FieldInput_default,
|
|
3956
4087
|
{
|
|
3957
4088
|
id,
|
|
@@ -3959,7 +4090,7 @@ var LargeUploadRenderer = {
|
|
|
3959
4090
|
description,
|
|
3960
4091
|
validation: validationState,
|
|
3961
4092
|
help,
|
|
3962
|
-
children: /* @__PURE__ */
|
|
4093
|
+
children: /* @__PURE__ */ jsx87(
|
|
3963
4094
|
Upload,
|
|
3964
4095
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3965
4096
|
usAccept,
|
|
@@ -3976,16 +4107,16 @@ var LargeUploadRenderer = {
|
|
|
3976
4107
|
|
|
3977
4108
|
// ../renderers/src/UpsellRenderer.tsx
|
|
3978
4109
|
import { Nudge } from "@transferwise/components";
|
|
3979
|
-
import { useState as
|
|
3980
|
-
import { jsx as
|
|
4110
|
+
import { useState as useState14 } from "react";
|
|
4111
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
3981
4112
|
var UpsellRenderer = {
|
|
3982
4113
|
canRenderType: "upsell",
|
|
3983
4114
|
render: UpsellRendererComponent
|
|
3984
4115
|
};
|
|
3985
4116
|
function UpsellRendererComponent(props) {
|
|
3986
4117
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
3987
|
-
const [isVisible, setIsVisible] =
|
|
3988
|
-
return isVisible ? /* @__PURE__ */
|
|
4118
|
+
const [isVisible, setIsVisible] = useState14(true);
|
|
4119
|
+
return isVisible ? /* @__PURE__ */ jsx88(
|
|
3989
4120
|
Nudge,
|
|
3990
4121
|
{
|
|
3991
4122
|
className: getMargin(margin),
|
|
@@ -4037,7 +4168,7 @@ var supportedMediaNames = [
|
|
|
4037
4168
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
4038
4169
|
import { CircularButton } from "@transferwise/components";
|
|
4039
4170
|
var import_classnames7 = __toESM(require_classnames());
|
|
4040
|
-
import { jsx as
|
|
4171
|
+
import { jsx as jsx89 } from "react/jsx-runtime";
|
|
4041
4172
|
var CircularButtonRenderer = {
|
|
4042
4173
|
canRenderType: "button",
|
|
4043
4174
|
canRender: ({ control }) => control === "circular",
|
|
@@ -4047,7 +4178,7 @@ function CircularButtonComponent(props) {
|
|
|
4047
4178
|
var _a;
|
|
4048
4179
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
4049
4180
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
4050
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsx89("div", { className: (0, import_classnames7.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx89(
|
|
4051
4182
|
CircularButton,
|
|
4052
4183
|
{
|
|
4053
4184
|
disabled,
|
|
@@ -4111,11 +4242,11 @@ var getWiseRenderers = () => [
|
|
|
4111
4242
|
|
|
4112
4243
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
4113
4244
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
4114
|
-
import { jsx as
|
|
4245
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
4115
4246
|
var InitialLoadingStateRenderer = {
|
|
4116
4247
|
canRenderType: "loading-state",
|
|
4117
4248
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
4118
|
-
render: () => /* @__PURE__ */
|
|
4249
|
+
render: () => /* @__PURE__ */ jsx90(
|
|
4119
4250
|
Loader2,
|
|
4120
4251
|
{
|
|
4121
4252
|
size: "md",
|
|
@@ -4126,7 +4257,7 @@ var InitialLoadingStateRenderer = {
|
|
|
4126
4257
|
};
|
|
4127
4258
|
|
|
4128
4259
|
// ../renderers/src/subflow/getSubflowRenderer.tsx
|
|
4129
|
-
import { jsx as
|
|
4260
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
4130
4261
|
var getSubflowRenderer = ({
|
|
4131
4262
|
Component: Component2,
|
|
4132
4263
|
canRender
|
|
@@ -4135,7 +4266,7 @@ var getSubflowRenderer = ({
|
|
|
4135
4266
|
canRenderType: "subflow",
|
|
4136
4267
|
canRender,
|
|
4137
4268
|
render: (props) => {
|
|
4138
|
-
return /* @__PURE__ */
|
|
4269
|
+
return /* @__PURE__ */ jsx91(
|
|
4139
4270
|
Component2,
|
|
4140
4271
|
{
|
|
4141
4272
|
presentation: props.presentation,
|
|
@@ -4152,7 +4283,7 @@ var getSubflowRenderer = ({
|
|
|
4152
4283
|
};
|
|
4153
4284
|
|
|
4154
4285
|
// src/dynamicFlow/useOnCopy.tsx
|
|
4155
|
-
import { useCallback } from "react";
|
|
4286
|
+
import { useCallback as useCallback2 } from "react";
|
|
4156
4287
|
import { useIntl as useIntl16 } from "react-intl";
|
|
4157
4288
|
|
|
4158
4289
|
// src/dynamicFlow/messages.ts
|
|
@@ -4174,7 +4305,7 @@ var messages_default = defineMessages13({
|
|
|
4174
4305
|
var useOnCopy = () => {
|
|
4175
4306
|
const { formatMessage } = useIntl16();
|
|
4176
4307
|
const createSnackBar = useSnackBarIfAvailable();
|
|
4177
|
-
return
|
|
4308
|
+
return useCallback2(
|
|
4178
4309
|
(copiedContent) => {
|
|
4179
4310
|
if (copiedContent) {
|
|
4180
4311
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -4187,11 +4318,11 @@ var useOnCopy = () => {
|
|
|
4187
4318
|
};
|
|
4188
4319
|
|
|
4189
4320
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
4190
|
-
import { useCallback as
|
|
4321
|
+
import { useCallback as useCallback3 } from "react";
|
|
4191
4322
|
import { useIntl as useIntl17 } from "react-intl";
|
|
4192
4323
|
var useWiseHttpClient = (httpClient) => {
|
|
4193
4324
|
const { locale } = useIntl17();
|
|
4194
|
-
return
|
|
4325
|
+
return useCallback3(
|
|
4195
4326
|
async (input, init = {}) => {
|
|
4196
4327
|
const headers = new Headers(init.headers);
|
|
4197
4328
|
headers.set("accept-language", locale);
|
|
@@ -4215,24 +4346,24 @@ var handleRejection = (error) => {
|
|
|
4215
4346
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
4216
4347
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
4217
4348
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
4218
|
-
import { jsx as
|
|
4349
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
4219
4350
|
function DynamicFlowModal(props) {
|
|
4220
4351
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
4221
4352
|
const dfProps = useWiseToCoreProps(rest);
|
|
4222
4353
|
const df = useDynamicFlowModal(dfProps);
|
|
4223
|
-
return /* @__PURE__ */
|
|
4354
|
+
return /* @__PURE__ */ jsx92(
|
|
4224
4355
|
Modal5,
|
|
4225
4356
|
__spreadProps(__spreadValues({
|
|
4226
4357
|
className: `dynamic-flow-modal ${className}`,
|
|
4227
4358
|
disableDimmerClickToClose: true
|
|
4228
4359
|
}, df.modal), {
|
|
4229
|
-
body: /* @__PURE__ */
|
|
4360
|
+
body: /* @__PURE__ */ jsx92("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
4230
4361
|
})
|
|
4231
4362
|
);
|
|
4232
4363
|
}
|
|
4233
4364
|
|
|
4234
4365
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
4235
|
-
import { jsx as
|
|
4366
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
4236
4367
|
var wiseRenderers = getWiseRenderers();
|
|
4237
4368
|
var getMergedRenderers = (props) => {
|
|
4238
4369
|
var _d, _e;
|
|
@@ -4246,7 +4377,7 @@ var getMergedRenderers = (props) => {
|
|
|
4246
4377
|
method: initialRequest.method,
|
|
4247
4378
|
data: initialRequest.body
|
|
4248
4379
|
};
|
|
4249
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
4380
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx93(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx93(
|
|
4250
4381
|
DynamicFlowModal,
|
|
4251
4382
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
4252
4383
|
features: subflowFeatures,
|
|
@@ -4305,12 +4436,16 @@ var openLinkInNewTab = (url) => {
|
|
|
4305
4436
|
};
|
|
4306
4437
|
|
|
4307
4438
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4308
|
-
import {
|
|
4439
|
+
import { jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4309
4440
|
function DynamicFlow(props) {
|
|
4310
4441
|
const { className = "" } = props;
|
|
4311
4442
|
const dfProps = useWiseToCoreProps(props);
|
|
4312
4443
|
const df = useDynamicFlow(dfProps);
|
|
4313
|
-
|
|
4444
|
+
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
4445
|
+
return /* @__PURE__ */ jsxs35("div", { className, onContextMenu, children: [
|
|
4446
|
+
df.view,
|
|
4447
|
+
contextMenu
|
|
4448
|
+
] });
|
|
4314
4449
|
}
|
|
4315
4450
|
|
|
4316
4451
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|