@wise/dynamic-flow-client-internal 4.26.0 → 4.27.0-experimental-f13a826
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/i18n/hu.json +1 -1
- package/build/i18n/nl.json +1 -1
- package/build/main.js +489 -477
- package/build/main.mjs +459 -447
- package/build/types/index.d.ts +1 -1
- package/package.json +17 -17
- package/build/types/dynamicFlow/renderers.d.ts +0 -7
package/build/main.mjs
CHANGED
|
@@ -319,185 +319,16 @@ var mapStatusToSentiment = (validation) => {
|
|
|
319
319
|
var FieldInput_default = FieldInput;
|
|
320
320
|
|
|
321
321
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
322
|
-
import { Checkbox } from "@transferwise/components";
|
|
323
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
324
|
-
var CheckboxInputRenderer = {
|
|
325
|
-
canRenderType: "input-checkbox",
|
|
326
|
-
render: (props) => {
|
|
327
|
-
const _a = props, {
|
|
328
|
-
id,
|
|
329
|
-
control,
|
|
330
|
-
title = "",
|
|
331
|
-
description,
|
|
332
|
-
help,
|
|
333
|
-
type,
|
|
334
|
-
validationState,
|
|
335
|
-
value
|
|
336
|
-
} = _a, rest = __objRest(_a, [
|
|
337
|
-
"id",
|
|
338
|
-
"control",
|
|
339
|
-
"title",
|
|
340
|
-
"description",
|
|
341
|
-
"help",
|
|
342
|
-
"type",
|
|
343
|
-
"validationState",
|
|
344
|
-
"value"
|
|
345
|
-
]);
|
|
346
|
-
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
347
|
-
return /* @__PURE__ */ jsx8(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx8(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
351
|
-
|
|
352
|
-
// ../renderers/src/ColumnsRenderer.tsx
|
|
353
|
-
import classNames2 from "classnames";
|
|
354
|
-
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
355
|
-
var ColumnsRenderer = {
|
|
356
|
-
canRenderType: "columns",
|
|
357
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs3(
|
|
358
|
-
"div",
|
|
359
|
-
{
|
|
360
|
-
className: classNames2("df-columns-renderer-container", getMargin(margin), {
|
|
361
|
-
"df-columns-renderer-bias-start": bias === "start",
|
|
362
|
-
"df-columns-renderer-bias-end": bias === "end"
|
|
363
|
-
}),
|
|
364
|
-
children: [
|
|
365
|
-
/* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
366
|
-
/* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
)
|
|
370
|
-
};
|
|
371
|
-
var ColumnsRenderer_default = ColumnsRenderer;
|
|
372
|
-
|
|
373
|
-
// ../renderers/src/components/VariableDateInput.tsx
|
|
374
|
-
import { DateInput, DateLookup } from "@transferwise/components";
|
|
375
|
-
|
|
376
|
-
// ../renderers/src/validators/type-validators.ts
|
|
377
|
-
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
378
|
-
|
|
379
|
-
// ../renderers/src/utils/value-utils.ts
|
|
380
|
-
var dateStringToDateOrNull = (dateString) => {
|
|
381
|
-
if (!dateString) {
|
|
382
|
-
return null;
|
|
383
|
-
}
|
|
384
|
-
const [year, month, date] = dateString.split("-").map((number) => Number.parseInt(number, 10));
|
|
385
|
-
if (!isNumber(year) || !isNumber(month) || !isNumber(date)) {
|
|
386
|
-
return null;
|
|
387
|
-
}
|
|
388
|
-
return new Date(year, month - 1, date);
|
|
389
|
-
};
|
|
390
|
-
var dateToDateString = (date) => {
|
|
391
|
-
const d = new Date(date);
|
|
392
|
-
const month = String(d.getMonth() + 1);
|
|
393
|
-
const day = String(d.getDate());
|
|
394
|
-
const year = d.getFullYear();
|
|
395
|
-
const formattedMonth = month.length < 2 ? `0${month}` : month;
|
|
396
|
-
const formattedDay = day.length < 2 ? `0${day}` : day;
|
|
397
|
-
return [year, formattedMonth, formattedDay].join("-");
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
// ../renderers/src/components/VariableDateInput.tsx
|
|
401
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
402
|
-
function VariableDateInput({
|
|
403
|
-
control,
|
|
404
|
-
inputProps
|
|
405
|
-
}) {
|
|
406
|
-
const {
|
|
407
|
-
autoComplete,
|
|
408
|
-
minimumDate,
|
|
409
|
-
maximumDate,
|
|
410
|
-
placeholder,
|
|
411
|
-
disabled,
|
|
412
|
-
onBlur,
|
|
413
|
-
onChange,
|
|
414
|
-
onFocus
|
|
415
|
-
} = inputProps;
|
|
416
|
-
if (control === "date-lookup") {
|
|
417
|
-
return /* @__PURE__ */ jsx10(
|
|
418
|
-
DateLookup,
|
|
419
|
-
{
|
|
420
|
-
value: dateStringToDateOrNull(inputProps.value),
|
|
421
|
-
min: dateStringToDateOrNull(minimumDate),
|
|
422
|
-
max: dateStringToDateOrNull(maximumDate),
|
|
423
|
-
placeholder,
|
|
424
|
-
disabled,
|
|
425
|
-
onChange: (date) => {
|
|
426
|
-
onChange(date !== null ? dateToDateString(date) : null);
|
|
427
|
-
},
|
|
428
|
-
onBlur,
|
|
429
|
-
onFocus
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
return /* @__PURE__ */ jsx10(
|
|
434
|
-
DateInput,
|
|
435
|
-
__spreadProps(__spreadValues({}, inputProps), {
|
|
436
|
-
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
437
|
-
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
438
|
-
})
|
|
439
|
-
);
|
|
440
|
-
}
|
|
441
|
-
var getAutocompleteString = (value, suffix) => {
|
|
442
|
-
if (value === "bday") {
|
|
443
|
-
return `${value}-${suffix}`;
|
|
444
|
-
}
|
|
445
|
-
return void 0;
|
|
446
|
-
};
|
|
447
|
-
var VariableDateInput_default = VariableDateInput;
|
|
448
|
-
|
|
449
|
-
// ../renderers/src/DateInputRenderer.tsx
|
|
450
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
451
|
-
var DateInputRenderer = {
|
|
452
|
-
canRenderType: "input-date",
|
|
453
|
-
render: (props) => {
|
|
454
|
-
const _a = props, {
|
|
455
|
-
id,
|
|
456
|
-
control,
|
|
457
|
-
description,
|
|
458
|
-
type,
|
|
459
|
-
help,
|
|
460
|
-
title,
|
|
461
|
-
validationState,
|
|
462
|
-
value: initialValue
|
|
463
|
-
} = _a, rest = __objRest(_a, [
|
|
464
|
-
"id",
|
|
465
|
-
"control",
|
|
466
|
-
"description",
|
|
467
|
-
"type",
|
|
468
|
-
"help",
|
|
469
|
-
"title",
|
|
470
|
-
"validationState",
|
|
471
|
-
"value"
|
|
472
|
-
]);
|
|
473
|
-
const value = initialValue != null ? initialValue : "";
|
|
474
|
-
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
475
|
-
return /* @__PURE__ */ jsx11(
|
|
476
|
-
FieldInput_default,
|
|
477
|
-
{
|
|
478
|
-
id,
|
|
479
|
-
label: title,
|
|
480
|
-
description,
|
|
481
|
-
validation: validationState,
|
|
482
|
-
help,
|
|
483
|
-
children: /* @__PURE__ */ jsx11(VariableDateInput_default, { control, inputProps })
|
|
484
|
-
}
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
var DateInputRenderer_default = DateInputRenderer;
|
|
489
|
-
|
|
490
|
-
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
491
|
-
import { NavigationOption, NavigationOptionsList } from "@transferwise/components";
|
|
322
|
+
import { Checkbox, ListItem } from "@transferwise/components";
|
|
492
323
|
|
|
493
324
|
// ../renderers/src/utils/UrnFlag.tsx
|
|
494
325
|
import { Flag } from "@wise/art";
|
|
495
|
-
import { jsx as
|
|
326
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
496
327
|
var countryUrnPrefix = "urn:wise:countries:";
|
|
497
328
|
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
498
329
|
var isUrnFlag = (uri) => uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix);
|
|
499
330
|
function UrnFlag({ size, urn }) {
|
|
500
|
-
return /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ jsx8(Flag, { code: getCode(urn), intrinsicSize: size });
|
|
501
332
|
}
|
|
502
333
|
var getCode = (urn) => {
|
|
503
334
|
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
@@ -505,19 +336,19 @@ var getCode = (urn) => {
|
|
|
505
336
|
|
|
506
337
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
507
338
|
import { Flag as Flag2 } from "@wise/art";
|
|
508
|
-
import { jsx as
|
|
339
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
509
340
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
510
341
|
function FlagIcon({ name }) {
|
|
511
342
|
if (!isFlagIcon(name)) {
|
|
512
343
|
return null;
|
|
513
344
|
}
|
|
514
345
|
const code = name.substring(5);
|
|
515
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ jsx9(Flag2, { code, intrinsicSize: 24 });
|
|
516
347
|
}
|
|
517
348
|
|
|
518
349
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
519
350
|
import * as icons from "@transferwise/icons";
|
|
520
|
-
import { jsx as
|
|
351
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
521
352
|
var isNamedIcon = (name) => {
|
|
522
353
|
const iconName = toCapitalisedCamelCase(name);
|
|
523
354
|
return Object.keys(icons).includes(iconName);
|
|
@@ -528,19 +359,19 @@ function NamedIcon({ name }) {
|
|
|
528
359
|
}
|
|
529
360
|
const iconName = toCapitalisedCamelCase(name);
|
|
530
361
|
const Icon = icons[iconName];
|
|
531
|
-
return /* @__PURE__ */
|
|
362
|
+
return /* @__PURE__ */ jsx10(Icon, { size: 24 });
|
|
532
363
|
}
|
|
533
364
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
534
365
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
535
366
|
|
|
536
367
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
537
|
-
import { jsx as
|
|
368
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
538
369
|
function DynamicIcon({ name }) {
|
|
539
370
|
if (isFlagIcon(name)) {
|
|
540
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ jsx11(FlagIcon, { name });
|
|
541
372
|
}
|
|
542
373
|
if (isNamedIcon(name)) {
|
|
543
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ jsx11(NamedIcon, { name });
|
|
544
375
|
}
|
|
545
376
|
return null;
|
|
546
377
|
}
|
|
@@ -572,12 +403,12 @@ var stringToURN = (uri) => {
|
|
|
572
403
|
};
|
|
573
404
|
|
|
574
405
|
// ../renderers/src/components/Media/resolveMediaFromUri.tsx
|
|
575
|
-
import { jsx as
|
|
406
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
576
407
|
var resolveMediaFromUri = (uri, size) => {
|
|
577
408
|
var _a, _b;
|
|
578
409
|
const { name, qComponents = [] } = stringToURN(uri);
|
|
579
410
|
if (isValidIconUrn(name)) {
|
|
580
|
-
const icon = /* @__PURE__ */
|
|
411
|
+
const icon = /* @__PURE__ */ jsx12(DynamicIcon_default, { name: name.replace("urn:wise:icons:", "") });
|
|
581
412
|
return {
|
|
582
413
|
icon,
|
|
583
414
|
backgroundColor: formatColor((_a = qComponents.find(([key]) => key === "background-color")) == null ? void 0 : _a[1])
|
|
@@ -585,7 +416,7 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
585
416
|
}
|
|
586
417
|
if (isUrnFlag(name)) {
|
|
587
418
|
return {
|
|
588
|
-
asset: /* @__PURE__ */
|
|
419
|
+
asset: /* @__PURE__ */ jsx12(UrnFlag, { urn: name, size })
|
|
589
420
|
};
|
|
590
421
|
}
|
|
591
422
|
if (name.startsWith("data:text/plain,")) {
|
|
@@ -596,7 +427,7 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
596
427
|
};
|
|
597
428
|
}
|
|
598
429
|
if (!uri.startsWith("urn:")) {
|
|
599
|
-
return { asset: /* @__PURE__ */
|
|
430
|
+
return { asset: /* @__PURE__ */ jsx12("img", { src: uri, alt: "", width: `${size}px` }) };
|
|
600
431
|
}
|
|
601
432
|
return { asset: void 0 };
|
|
602
433
|
};
|
|
@@ -612,7 +443,7 @@ var formatColor = (color) => {
|
|
|
612
443
|
|
|
613
444
|
// ../renderers/src/components/Media/AvatarMedia.tsx
|
|
614
445
|
import { AvatarLayout, AvatarView } from "@transferwise/components";
|
|
615
|
-
import { jsx as
|
|
446
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
616
447
|
var AvatarMedia = ({
|
|
617
448
|
accessibilityDescription,
|
|
618
449
|
content,
|
|
@@ -632,7 +463,7 @@ var AvatarMedia = ({
|
|
|
632
463
|
if (!asset && !icon) {
|
|
633
464
|
return null;
|
|
634
465
|
}
|
|
635
|
-
return /* @__PURE__ */
|
|
466
|
+
return /* @__PURE__ */ jsx13(
|
|
636
467
|
AvatarView,
|
|
637
468
|
{
|
|
638
469
|
"aria-label": accessibilityDescription,
|
|
@@ -649,7 +480,7 @@ var AvatarMedia = ({
|
|
|
649
480
|
var _b = _a, { badge } = _b, rest = __objRest(_b, ["badge"]);
|
|
650
481
|
return __spreadValues({}, rest);
|
|
651
482
|
});
|
|
652
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ jsx13(
|
|
653
484
|
AvatarLayout,
|
|
654
485
|
{
|
|
655
486
|
"aria-label": accessibilityDescription,
|
|
@@ -662,11 +493,11 @@ var AvatarMedia = ({
|
|
|
662
493
|
|
|
663
494
|
// ../renderers/src/utils/image-utils.tsx
|
|
664
495
|
import { AvatarView as AvatarView2 } from "@transferwise/components";
|
|
665
|
-
import { jsx as
|
|
496
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
666
497
|
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
667
498
|
if (iconNode && imageNode) {
|
|
668
499
|
if (imageNode && iconNode) {
|
|
669
|
-
return /* @__PURE__ */
|
|
500
|
+
return /* @__PURE__ */ jsx14(AvatarView2, { size, badge: { asset: iconNode, type: "reference" }, children: imageNode });
|
|
670
501
|
}
|
|
671
502
|
}
|
|
672
503
|
return null;
|
|
@@ -674,7 +505,7 @@ var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
|
674
505
|
var getIconNode = (icon) => {
|
|
675
506
|
if (icon) {
|
|
676
507
|
if ("name" in icon) {
|
|
677
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ jsx14(DynamicIcon_default, { name: icon.name });
|
|
678
509
|
}
|
|
679
510
|
if (icon.text) {
|
|
680
511
|
return icon.text;
|
|
@@ -686,10 +517,10 @@ var getImageNode = (image, size) => {
|
|
|
686
517
|
if (image) {
|
|
687
518
|
const { accessibilityDescription, uri } = image;
|
|
688
519
|
if (!uri.startsWith("urn:")) {
|
|
689
|
-
return /* @__PURE__ */
|
|
520
|
+
return /* @__PURE__ */ jsx14("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
690
521
|
}
|
|
691
522
|
if (isUrnFlag(uri)) {
|
|
692
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ jsx14(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
693
524
|
}
|
|
694
525
|
}
|
|
695
526
|
return null;
|
|
@@ -697,7 +528,7 @@ var getImageNode = (image, size) => {
|
|
|
697
528
|
|
|
698
529
|
// ../renderers/src/components/Media/LegacyMedia.tsx
|
|
699
530
|
import { AvatarView as AvatarView3 } from "@transferwise/components";
|
|
700
|
-
import { jsx as
|
|
531
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
701
532
|
var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
702
533
|
const imageNode = getImageNode(image, size);
|
|
703
534
|
const iconNode = getIconNode(icon);
|
|
@@ -706,11 +537,11 @@ var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
|
706
537
|
return badge;
|
|
707
538
|
}
|
|
708
539
|
if (imageNode) {
|
|
709
|
-
return preferAvatar ? /* @__PURE__ */
|
|
540
|
+
return preferAvatar ? /* @__PURE__ */ jsx15(AvatarView3, { children: imageNode }) : imageNode;
|
|
710
541
|
}
|
|
711
542
|
if (iconNode && icon) {
|
|
712
543
|
if ("text" in icon || size === 48) {
|
|
713
|
-
return /* @__PURE__ */
|
|
544
|
+
return /* @__PURE__ */ jsx15(AvatarView3, { size, children: iconNode });
|
|
714
545
|
}
|
|
715
546
|
return iconNode;
|
|
716
547
|
}
|
|
@@ -718,7 +549,7 @@ var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
|
718
549
|
};
|
|
719
550
|
|
|
720
551
|
// ../renderers/src/components/Media/Media.tsx
|
|
721
|
-
import { jsx as
|
|
552
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
722
553
|
function Media({
|
|
723
554
|
media,
|
|
724
555
|
preferAvatar,
|
|
@@ -726,13 +557,13 @@ function Media({
|
|
|
726
557
|
}) {
|
|
727
558
|
switch (media == null ? void 0 : media.type) {
|
|
728
559
|
case "avatar":
|
|
729
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ jsx16(AvatarMedia, __spreadProps(__spreadValues({}, media), { size }));
|
|
730
561
|
case "image": {
|
|
731
562
|
const { asset, icon } = resolveMediaFromUri(media.uri, size);
|
|
732
563
|
return icon != null ? icon : asset;
|
|
733
564
|
}
|
|
734
565
|
case "legacy": {
|
|
735
|
-
return /* @__PURE__ */
|
|
566
|
+
return /* @__PURE__ */ jsx16(LegacyMedia, __spreadProps(__spreadValues({}, media), { preferAvatar, size }));
|
|
736
567
|
}
|
|
737
568
|
default:
|
|
738
569
|
return null;
|
|
@@ -740,15 +571,205 @@ function Media({
|
|
|
740
571
|
}
|
|
741
572
|
|
|
742
573
|
// ../renderers/src/components/Media/OptionMedia.tsx
|
|
743
|
-
import { jsx as
|
|
574
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
744
575
|
var mediaSize = 48;
|
|
745
576
|
function OptionMedia(props) {
|
|
746
|
-
return /* @__PURE__ */
|
|
577
|
+
return /* @__PURE__ */ jsx17(Media, __spreadProps(__spreadValues({}, props), { size: mediaSize }));
|
|
747
578
|
}
|
|
748
579
|
|
|
749
580
|
// ../renderers/src/components/Media/getInlineMedia.tsx
|
|
581
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
582
|
+
var getInlineMedia = (media) => media ? /* @__PURE__ */ jsx18(Media, { media, preferAvatar: false, size: 24 }) : null;
|
|
583
|
+
|
|
584
|
+
// ../renderers/src/NewListItem/getMedia.tsx
|
|
585
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
586
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ jsx19(OptionMedia, { media, preferAvatar }) : void 0;
|
|
587
|
+
|
|
588
|
+
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
589
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
590
|
+
var CheckboxInputRenderer = {
|
|
591
|
+
canRenderType: "input-checkbox",
|
|
592
|
+
render: (props) => props.control === "switch-item" ? /* @__PURE__ */ jsx20(SwitchComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx20(CheckboxComponent, __spreadValues({}, props))
|
|
593
|
+
};
|
|
594
|
+
var CheckboxComponent = (props) => {
|
|
595
|
+
const _a = props, {
|
|
596
|
+
id,
|
|
597
|
+
control,
|
|
598
|
+
title = "",
|
|
599
|
+
description,
|
|
600
|
+
help,
|
|
601
|
+
type,
|
|
602
|
+
validationState,
|
|
603
|
+
value
|
|
604
|
+
} = _a, rest = __objRest(_a, [
|
|
605
|
+
"id",
|
|
606
|
+
"control",
|
|
607
|
+
"title",
|
|
608
|
+
"description",
|
|
609
|
+
"help",
|
|
610
|
+
"type",
|
|
611
|
+
"validationState",
|
|
612
|
+
"value"
|
|
613
|
+
]);
|
|
614
|
+
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
615
|
+
return /* @__PURE__ */ jsx20(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx20(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
616
|
+
};
|
|
617
|
+
var SwitchComponent = (props) => {
|
|
618
|
+
const { title, description, disabled, media, validationState, value, onChange } = props;
|
|
619
|
+
return /* @__PURE__ */ jsx20(
|
|
620
|
+
ListItem,
|
|
621
|
+
{
|
|
622
|
+
title,
|
|
623
|
+
subtitle: description,
|
|
624
|
+
media: getMedia(media, false),
|
|
625
|
+
disabled,
|
|
626
|
+
prompt: validationState && validationState.status === "invalid" ? /* @__PURE__ */ jsx20(ListItem.Prompt, { sentiment: "negative", children: validationState.message }) : void 0,
|
|
627
|
+
control: /* @__PURE__ */ jsx20(ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
};
|
|
631
|
+
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
632
|
+
|
|
633
|
+
// ../renderers/src/ColumnsRenderer.tsx
|
|
634
|
+
import classNames2 from "classnames";
|
|
635
|
+
import { jsx as jsx21, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
636
|
+
var ColumnsRenderer = {
|
|
637
|
+
canRenderType: "columns",
|
|
638
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs3(
|
|
639
|
+
"div",
|
|
640
|
+
{
|
|
641
|
+
className: classNames2("df-columns-renderer-container", getMargin(margin), {
|
|
642
|
+
"df-columns-renderer-bias-start": bias === "start",
|
|
643
|
+
"df-columns-renderer-bias-end": bias === "end"
|
|
644
|
+
}),
|
|
645
|
+
children: [
|
|
646
|
+
/* @__PURE__ */ jsx21("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
647
|
+
/* @__PURE__ */ jsx21("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
648
|
+
]
|
|
649
|
+
}
|
|
650
|
+
)
|
|
651
|
+
};
|
|
652
|
+
var ColumnsRenderer_default = ColumnsRenderer;
|
|
653
|
+
|
|
654
|
+
// ../renderers/src/components/VariableDateInput.tsx
|
|
655
|
+
import { DateInput, DateLookup } from "@transferwise/components";
|
|
656
|
+
|
|
657
|
+
// ../renderers/src/validators/type-validators.ts
|
|
658
|
+
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
659
|
+
|
|
660
|
+
// ../renderers/src/utils/value-utils.ts
|
|
661
|
+
var dateStringToDateOrNull = (dateString) => {
|
|
662
|
+
if (!dateString) {
|
|
663
|
+
return null;
|
|
664
|
+
}
|
|
665
|
+
const [year, month, date] = dateString.split("-").map((number) => Number.parseInt(number, 10));
|
|
666
|
+
if (!isNumber(year) || !isNumber(month) || !isNumber(date)) {
|
|
667
|
+
return null;
|
|
668
|
+
}
|
|
669
|
+
return new Date(year, month - 1, date);
|
|
670
|
+
};
|
|
671
|
+
var dateToDateString = (date) => {
|
|
672
|
+
const d = new Date(date);
|
|
673
|
+
const month = String(d.getMonth() + 1);
|
|
674
|
+
const day = String(d.getDate());
|
|
675
|
+
const year = d.getFullYear();
|
|
676
|
+
const formattedMonth = month.length < 2 ? `0${month}` : month;
|
|
677
|
+
const formattedDay = day.length < 2 ? `0${day}` : day;
|
|
678
|
+
return [year, formattedMonth, formattedDay].join("-");
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
// ../renderers/src/components/VariableDateInput.tsx
|
|
750
682
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
751
|
-
|
|
683
|
+
function VariableDateInput({
|
|
684
|
+
control,
|
|
685
|
+
inputProps
|
|
686
|
+
}) {
|
|
687
|
+
const {
|
|
688
|
+
autoComplete,
|
|
689
|
+
minimumDate,
|
|
690
|
+
maximumDate,
|
|
691
|
+
placeholder,
|
|
692
|
+
disabled,
|
|
693
|
+
onBlur,
|
|
694
|
+
onChange,
|
|
695
|
+
onFocus
|
|
696
|
+
} = inputProps;
|
|
697
|
+
if (control === "date-lookup") {
|
|
698
|
+
return /* @__PURE__ */ jsx22(
|
|
699
|
+
DateLookup,
|
|
700
|
+
{
|
|
701
|
+
value: dateStringToDateOrNull(inputProps.value),
|
|
702
|
+
min: dateStringToDateOrNull(minimumDate),
|
|
703
|
+
max: dateStringToDateOrNull(maximumDate),
|
|
704
|
+
placeholder,
|
|
705
|
+
disabled,
|
|
706
|
+
onChange: (date) => {
|
|
707
|
+
onChange(date !== null ? dateToDateString(date) : null);
|
|
708
|
+
},
|
|
709
|
+
onBlur,
|
|
710
|
+
onFocus
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
return /* @__PURE__ */ jsx22(
|
|
715
|
+
DateInput,
|
|
716
|
+
__spreadProps(__spreadValues({}, inputProps), {
|
|
717
|
+
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
718
|
+
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
719
|
+
})
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
var getAutocompleteString = (value, suffix) => {
|
|
723
|
+
if (value === "bday") {
|
|
724
|
+
return `${value}-${suffix}`;
|
|
725
|
+
}
|
|
726
|
+
return void 0;
|
|
727
|
+
};
|
|
728
|
+
var VariableDateInput_default = VariableDateInput;
|
|
729
|
+
|
|
730
|
+
// ../renderers/src/DateInputRenderer.tsx
|
|
731
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
732
|
+
var DateInputRenderer = {
|
|
733
|
+
canRenderType: "input-date",
|
|
734
|
+
render: (props) => {
|
|
735
|
+
const _a = props, {
|
|
736
|
+
id,
|
|
737
|
+
control,
|
|
738
|
+
description,
|
|
739
|
+
type,
|
|
740
|
+
help,
|
|
741
|
+
title,
|
|
742
|
+
validationState,
|
|
743
|
+
value: initialValue
|
|
744
|
+
} = _a, rest = __objRest(_a, [
|
|
745
|
+
"id",
|
|
746
|
+
"control",
|
|
747
|
+
"description",
|
|
748
|
+
"type",
|
|
749
|
+
"help",
|
|
750
|
+
"title",
|
|
751
|
+
"validationState",
|
|
752
|
+
"value"
|
|
753
|
+
]);
|
|
754
|
+
const value = initialValue != null ? initialValue : "";
|
|
755
|
+
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
756
|
+
return /* @__PURE__ */ jsx23(
|
|
757
|
+
FieldInput_default,
|
|
758
|
+
{
|
|
759
|
+
id,
|
|
760
|
+
label: title,
|
|
761
|
+
description,
|
|
762
|
+
validation: validationState,
|
|
763
|
+
help,
|
|
764
|
+
children: /* @__PURE__ */ jsx23(VariableDateInput_default, { control, inputProps })
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
var DateInputRenderer_default = DateInputRenderer;
|
|
770
|
+
|
|
771
|
+
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
772
|
+
import { NavigationOption, NavigationOptionsList } from "@transferwise/components";
|
|
752
773
|
|
|
753
774
|
// ../renderers/src/DecisionRenderer/DecisionList.tsx
|
|
754
775
|
import { Header as Header2, SearchInput } from "@transferwise/components";
|
|
@@ -798,7 +819,7 @@ var decision_messages_default = defineMessages3({
|
|
|
798
819
|
});
|
|
799
820
|
|
|
800
821
|
// ../renderers/src/DecisionRenderer/GroupedList.tsx
|
|
801
|
-
import { Fragment, jsx as
|
|
822
|
+
import { Fragment, jsx as jsx24, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
802
823
|
var OPTION_GROUPS = {
|
|
803
824
|
popular: "popular",
|
|
804
825
|
recent: "recent",
|
|
@@ -815,19 +836,19 @@ var GroupedList = (_a) => {
|
|
|
815
836
|
);
|
|
816
837
|
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
817
838
|
popularOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
|
|
818
|
-
/* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.popular) }),
|
|
819
840
|
renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
|
|
820
841
|
] }) : null,
|
|
821
842
|
recentOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
|
|
822
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.recent) }),
|
|
823
844
|
renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
|
|
824
845
|
] }) : null,
|
|
825
846
|
currencyWithAccountDetailsOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
|
|
826
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.currenciesWithAccountDetails) }),
|
|
827
848
|
renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: currencyWithAccountDetailsOptions }))
|
|
828
849
|
] }) : null,
|
|
829
850
|
/* @__PURE__ */ jsxs4(Section, { children: [
|
|
830
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ jsx24(Header, { as: "h2", title: formatMessage(decision_messages_default.all) }),
|
|
831
852
|
renderDecisionList3(rest)
|
|
832
853
|
] })
|
|
833
854
|
] });
|
|
@@ -880,16 +901,16 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
880
901
|
}
|
|
881
902
|
|
|
882
903
|
// ../renderers/src/DecisionRenderer/DecisionList.tsx
|
|
883
|
-
import { Fragment as Fragment2, jsx as
|
|
904
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
884
905
|
var DecisionWrapper = (props) => {
|
|
885
906
|
return /* @__PURE__ */ jsxs5("div", { className: getMargin(props.margin), children: [
|
|
886
|
-
props.title && /* @__PURE__ */
|
|
887
|
-
props.control === "filtered" ? /* @__PURE__ */
|
|
907
|
+
props.title && /* @__PURE__ */ jsx25(Header2, { as: "h2", title: props.title }),
|
|
908
|
+
props.control === "filtered" ? /* @__PURE__ */ jsx25(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx25(UnfilteredDecisionList, __spreadValues({}, props))
|
|
888
909
|
] });
|
|
889
910
|
};
|
|
890
911
|
var UnfilteredDecisionList = (_a) => {
|
|
891
912
|
var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
892
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
913
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx25(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList3 })) : renderDecisionList3(rest);
|
|
893
914
|
};
|
|
894
915
|
var FilteredDecisionList = (props) => {
|
|
895
916
|
const { formatMessage } = useIntl4();
|
|
@@ -898,7 +919,7 @@ var FilteredDecisionList = (props) => {
|
|
|
898
919
|
const filteredOptions = filterAndSortDecisionOptions(options, query);
|
|
899
920
|
const isGrouped = isGroupedDecision(options);
|
|
900
921
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
901
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ jsx25(
|
|
902
923
|
SearchInput,
|
|
903
924
|
{
|
|
904
925
|
placeholder: formatMessage(decision_messages_default.filterPlaceholder),
|
|
@@ -909,35 +930,35 @@ var FilteredDecisionList = (props) => {
|
|
|
909
930
|
}
|
|
910
931
|
}
|
|
911
932
|
),
|
|
912
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
913
|
-
query.length > 0 && /* @__PURE__ */
|
|
933
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx25(GroupedList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
934
|
+
query.length > 0 && /* @__PURE__ */ jsx25(Header2, { as: "h2", title: formatMessage(decision_messages_default.results), className: "m-t-4" }),
|
|
914
935
|
filteredOptions.length > 0 ? renderDecisionList3({
|
|
915
936
|
control,
|
|
916
937
|
className: query.length === 0 ? "m-t-3" : "",
|
|
917
938
|
options: filteredOptions
|
|
918
|
-
}) : /* @__PURE__ */
|
|
939
|
+
}) : /* @__PURE__ */ jsx25("p", { children: formatMessage(decision_messages_default.noResults) })
|
|
919
940
|
] })
|
|
920
941
|
] });
|
|
921
942
|
};
|
|
922
943
|
|
|
923
944
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
924
|
-
import { jsx as
|
|
945
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
925
946
|
var DecisionRenderer = {
|
|
926
947
|
canRenderType: "decision",
|
|
927
948
|
render: (props) => {
|
|
928
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ jsx26(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }));
|
|
929
950
|
}
|
|
930
951
|
};
|
|
931
952
|
var renderDecisionList = ({ options, className, control }) => {
|
|
932
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ jsx26("div", { className, children: /* @__PURE__ */ jsx26(NavigationOptionsList, { children: options.map((option) => {
|
|
933
954
|
const { description, disabled, media, title: itemTitle, tag, onClick } = option;
|
|
934
|
-
return /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ jsx26(
|
|
935
956
|
NavigationOption,
|
|
936
957
|
{
|
|
937
958
|
title: itemTitle,
|
|
938
959
|
content: description,
|
|
939
960
|
disabled,
|
|
940
|
-
media: media ? /* @__PURE__ */
|
|
961
|
+
media: media ? /* @__PURE__ */ jsx26(
|
|
941
962
|
OptionMedia,
|
|
942
963
|
{
|
|
943
964
|
media,
|
|
@@ -956,7 +977,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
956
977
|
|
|
957
978
|
// ../renderers/src/DividerRenderer.tsx
|
|
958
979
|
import { Divider } from "@transferwise/components";
|
|
959
|
-
import { jsx as
|
|
980
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
960
981
|
var mapControlToLevel = (control) => {
|
|
961
982
|
switch (control) {
|
|
962
983
|
case "section":
|
|
@@ -969,7 +990,7 @@ var mapControlToLevel = (control) => {
|
|
|
969
990
|
};
|
|
970
991
|
var DividerRenderer = {
|
|
971
992
|
canRenderType: "divider",
|
|
972
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
993
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx27(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
973
994
|
};
|
|
974
995
|
var DividerRenderer_default = DividerRenderer;
|
|
975
996
|
|
|
@@ -1004,7 +1025,7 @@ var external_confirmation_messages_default = defineMessages4({
|
|
|
1004
1025
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1005
1026
|
import { useIntl as useIntl5 } from "react-intl";
|
|
1006
1027
|
import { useEffect as useEffect3 } from "react";
|
|
1007
|
-
import { Fragment as Fragment3, jsx as
|
|
1028
|
+
import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1008
1029
|
var ExternalConfirmationRenderer = {
|
|
1009
1030
|
canRenderType: "external-confirmation",
|
|
1010
1031
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1027,15 +1048,15 @@ function ExternalConfirmationRendererComponent({
|
|
|
1027
1048
|
}
|
|
1028
1049
|
}
|
|
1029
1050
|
}, []);
|
|
1030
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ jsx28(
|
|
1031
1052
|
Modal,
|
|
1032
1053
|
{
|
|
1033
1054
|
open: status === "failure",
|
|
1034
1055
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1035
1056
|
body: /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ jsx28(Markdown2, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1058
|
+
/* @__PURE__ */ jsx28("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs6("div", { className: "df-box-renderer-width-lg", children: [
|
|
1059
|
+
/* @__PURE__ */ jsx28(
|
|
1039
1060
|
Button3,
|
|
1040
1061
|
{
|
|
1041
1062
|
v2: true,
|
|
@@ -1050,7 +1071,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1050
1071
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1051
1072
|
}
|
|
1052
1073
|
),
|
|
1053
|
-
/* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ jsx28(Button3, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1054
1075
|
] }) })
|
|
1055
1076
|
] }),
|
|
1056
1077
|
onClose: onCancel
|
|
@@ -1067,27 +1088,27 @@ function getOrigin(url) {
|
|
|
1067
1088
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1068
1089
|
|
|
1069
1090
|
// ../renderers/src/FormRenderer.tsx
|
|
1070
|
-
import { jsx as
|
|
1091
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1071
1092
|
var FormRenderer = {
|
|
1072
1093
|
canRenderType: "form",
|
|
1073
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1094
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx29("div", { className: getMargin(margin), children })
|
|
1074
1095
|
};
|
|
1075
1096
|
var FormRenderer_default = FormRenderer;
|
|
1076
1097
|
|
|
1077
1098
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1078
1099
|
import { Header as Header3 } from "@transferwise/components";
|
|
1079
|
-
import { jsx as
|
|
1100
|
+
import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1080
1101
|
var FormSectionRenderer = {
|
|
1081
1102
|
canRenderType: "form-section",
|
|
1082
1103
|
render: ({ title, description, children }) => /* @__PURE__ */ jsxs7("fieldset", { children: [
|
|
1083
|
-
title && /* @__PURE__ */
|
|
1104
|
+
title && /* @__PURE__ */ jsx30(
|
|
1084
1105
|
Header3,
|
|
1085
1106
|
{
|
|
1086
1107
|
as: "h2",
|
|
1087
1108
|
title
|
|
1088
1109
|
}
|
|
1089
1110
|
),
|
|
1090
|
-
description && /* @__PURE__ */
|
|
1111
|
+
description && /* @__PURE__ */ jsx30("p", { children: description }),
|
|
1091
1112
|
children
|
|
1092
1113
|
] })
|
|
1093
1114
|
};
|
|
@@ -1095,18 +1116,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1095
1116
|
|
|
1096
1117
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1097
1118
|
import { Display, Title } from "@transferwise/components";
|
|
1098
|
-
import { jsx as
|
|
1119
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1099
1120
|
var HeadingRenderer = {
|
|
1100
1121
|
canRenderType: "heading",
|
|
1101
|
-
render: (props) => /* @__PURE__ */
|
|
1122
|
+
render: (props) => /* @__PURE__ */ jsx31(Heading, __spreadValues({}, props))
|
|
1102
1123
|
};
|
|
1103
1124
|
function Heading(props) {
|
|
1104
1125
|
const { text, size, align, margin, control } = props;
|
|
1105
1126
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1106
|
-
return control === "display" ? /* @__PURE__ */
|
|
1127
|
+
return control === "display" ? /* @__PURE__ */ jsx31(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx31(StandardHeading, { size, text, className });
|
|
1107
1128
|
}
|
|
1108
1129
|
function DisplayHeading({ size, text, className }) {
|
|
1109
|
-
return /* @__PURE__ */
|
|
1130
|
+
return /* @__PURE__ */ jsx31(Display, { type: getDisplayType(size), className, children: text });
|
|
1110
1131
|
}
|
|
1111
1132
|
var getDisplayType = (size) => {
|
|
1112
1133
|
switch (size) {
|
|
@@ -1122,7 +1143,7 @@ var getDisplayType = (size) => {
|
|
|
1122
1143
|
}
|
|
1123
1144
|
};
|
|
1124
1145
|
function StandardHeading({ size, text, className }) {
|
|
1125
|
-
return /* @__PURE__ */
|
|
1146
|
+
return /* @__PURE__ */ jsx31(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1126
1147
|
}
|
|
1127
1148
|
var getTitleTypeBySize = (size) => {
|
|
1128
1149
|
var _a;
|
|
@@ -1149,7 +1170,7 @@ function isRelativePath(url = "") {
|
|
|
1149
1170
|
}
|
|
1150
1171
|
|
|
1151
1172
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1152
|
-
import { jsx as
|
|
1173
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1153
1174
|
function UrlImage({
|
|
1154
1175
|
accessibilityDescription,
|
|
1155
1176
|
align,
|
|
@@ -1164,7 +1185,7 @@ function UrlImage({
|
|
|
1164
1185
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1165
1186
|
}
|
|
1166
1187
|
}, [uri, httpClient]);
|
|
1167
|
-
return /* @__PURE__ */
|
|
1188
|
+
return /* @__PURE__ */ jsx32("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ jsx32(
|
|
1168
1189
|
Image,
|
|
1169
1190
|
{
|
|
1170
1191
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1208,7 +1229,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1208
1229
|
};
|
|
1209
1230
|
|
|
1210
1231
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1211
|
-
import { jsx as
|
|
1232
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1212
1233
|
var maxFlagSize = 600;
|
|
1213
1234
|
function UrnFlagImage({
|
|
1214
1235
|
accessibilityDescription,
|
|
@@ -1217,7 +1238,7 @@ function UrnFlagImage({
|
|
|
1217
1238
|
size,
|
|
1218
1239
|
uri
|
|
1219
1240
|
}) {
|
|
1220
|
-
return /* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ jsx33("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx33(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1221
1242
|
}
|
|
1222
1243
|
|
|
1223
1244
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -1237,7 +1258,7 @@ var isAnimated = (uri) => {
|
|
|
1237
1258
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1238
1259
|
import { Illustration3D } from "@wise/art";
|
|
1239
1260
|
import { Component } from "react";
|
|
1240
|
-
import { jsx as
|
|
1261
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1241
1262
|
var Illustration3DErrorBoundary = class extends Component {
|
|
1242
1263
|
constructor(props) {
|
|
1243
1264
|
super(props);
|
|
@@ -1261,12 +1282,12 @@ var SafeIllustration3D = ({
|
|
|
1261
1282
|
size,
|
|
1262
1283
|
onError
|
|
1263
1284
|
}) => {
|
|
1264
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ jsx34(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx34(Illustration3D, { name, size }) });
|
|
1265
1286
|
};
|
|
1266
1287
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1267
1288
|
|
|
1268
1289
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1269
|
-
import { jsx as
|
|
1290
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1270
1291
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1271
1292
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1272
1293
|
function UrnIllustration({
|
|
@@ -1281,7 +1302,7 @@ function UrnIllustration({
|
|
|
1281
1302
|
const illustrationName = getIllustrationName(uri);
|
|
1282
1303
|
const illustration3DName = getIllustration3DName(uri);
|
|
1283
1304
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1284
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ jsx35("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx35(
|
|
1285
1306
|
SafeIllustration3D_default,
|
|
1286
1307
|
{
|
|
1287
1308
|
name: illustration3DName,
|
|
@@ -1290,7 +1311,7 @@ function UrnIllustration({
|
|
|
1290
1311
|
}
|
|
1291
1312
|
) });
|
|
1292
1313
|
}
|
|
1293
|
-
return /* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ jsx35("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx35(
|
|
1294
1315
|
Illustration,
|
|
1295
1316
|
{
|
|
1296
1317
|
className: "df-illustration",
|
|
@@ -1310,24 +1331,24 @@ var getIllustration3DName = (uri) => {
|
|
|
1310
1331
|
};
|
|
1311
1332
|
|
|
1312
1333
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1313
|
-
import { jsx as
|
|
1334
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1314
1335
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1315
1336
|
function UrnImage(props) {
|
|
1316
1337
|
const { uri } = props;
|
|
1317
1338
|
if (isUrnIllustration(uri)) {
|
|
1318
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ jsx36(UrnIllustration, __spreadValues({}, props));
|
|
1319
1340
|
}
|
|
1320
1341
|
if (isUrnFlag(uri)) {
|
|
1321
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ jsx36(UrnFlagImage, __spreadValues({}, props));
|
|
1322
1343
|
}
|
|
1323
1344
|
return null;
|
|
1324
1345
|
}
|
|
1325
1346
|
|
|
1326
1347
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1327
|
-
import { jsx as
|
|
1348
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1328
1349
|
var ImageRenderer = {
|
|
1329
1350
|
canRenderType: "image",
|
|
1330
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
1351
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx37(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx37(UrlImage, __spreadValues({}, props))
|
|
1331
1352
|
};
|
|
1332
1353
|
|
|
1333
1354
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -1335,7 +1356,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
1335
1356
|
|
|
1336
1357
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1337
1358
|
import { Header as Header4, InstructionsList } from "@transferwise/components";
|
|
1338
|
-
import { jsx as
|
|
1359
|
+
import { jsx as jsx38, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1339
1360
|
var doContext = ["positive", "neutral"];
|
|
1340
1361
|
var dontContext = ["warning", "negative"];
|
|
1341
1362
|
var InstructionsRenderer = {
|
|
@@ -1344,8 +1365,8 @@ var InstructionsRenderer = {
|
|
|
1344
1365
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1345
1366
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1346
1367
|
return /* @__PURE__ */ jsxs8("div", { className: getMargin(margin), children: [
|
|
1347
|
-
title ? /* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1368
|
+
title ? /* @__PURE__ */ jsx38(Header4, { title }) : null,
|
|
1369
|
+
/* @__PURE__ */ jsx38(InstructionsList, { dos, donts })
|
|
1349
1370
|
] });
|
|
1350
1371
|
}
|
|
1351
1372
|
};
|
|
@@ -1377,7 +1398,7 @@ function pick(obj, ...keys) {
|
|
|
1377
1398
|
}
|
|
1378
1399
|
|
|
1379
1400
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1380
|
-
import { jsx as
|
|
1401
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1381
1402
|
var IntegerInputRenderer = {
|
|
1382
1403
|
canRenderType: "input-integer",
|
|
1383
1404
|
render: (props) => {
|
|
@@ -1392,7 +1413,7 @@ var IntegerInputRenderer = {
|
|
|
1392
1413
|
"maximum",
|
|
1393
1414
|
"minimum"
|
|
1394
1415
|
);
|
|
1395
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ jsx39(
|
|
1396
1417
|
FieldInput_default,
|
|
1397
1418
|
{
|
|
1398
1419
|
id,
|
|
@@ -1400,7 +1421,7 @@ var IntegerInputRenderer = {
|
|
|
1400
1421
|
description,
|
|
1401
1422
|
validation: validationState,
|
|
1402
1423
|
help,
|
|
1403
|
-
children: /* @__PURE__ */
|
|
1424
|
+
children: /* @__PURE__ */ jsx39(InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx39(
|
|
1404
1425
|
Input,
|
|
1405
1426
|
__spreadValues({
|
|
1406
1427
|
id,
|
|
@@ -1425,12 +1446,12 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1425
1446
|
// ../renderers/src/ListRenderer.tsx
|
|
1426
1447
|
import { Body, Header as Header5 } from "@transferwise/components";
|
|
1427
1448
|
import classNames3 from "classnames";
|
|
1428
|
-
import { jsx as
|
|
1449
|
+
import { jsx as jsx40, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1429
1450
|
var ListRenderer = {
|
|
1430
1451
|
canRenderType: "list",
|
|
1431
1452
|
render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs9("div", { className: getMargin(margin), children: [
|
|
1432
|
-
(title || callToAction) && /* @__PURE__ */
|
|
1433
|
-
items.map((props) => /* @__PURE__ */
|
|
1453
|
+
(title || callToAction) && /* @__PURE__ */ jsx40(Header5, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
|
|
1454
|
+
items.map((props) => /* @__PURE__ */ jsx40(DesignSystemListItem, __spreadProps(__spreadValues({}, props), { control }), props.title))
|
|
1434
1455
|
] })
|
|
1435
1456
|
};
|
|
1436
1457
|
var DesignSystemListItem = ({
|
|
@@ -1442,7 +1463,7 @@ var DesignSystemListItem = ({
|
|
|
1442
1463
|
media,
|
|
1443
1464
|
control,
|
|
1444
1465
|
tag
|
|
1445
|
-
}) => /* @__PURE__ */
|
|
1466
|
+
}) => /* @__PURE__ */ jsx40(
|
|
1446
1467
|
"label",
|
|
1447
1468
|
{
|
|
1448
1469
|
className: classNames3("np-option p-a-2", {
|
|
@@ -1450,7 +1471,7 @@ var DesignSystemListItem = ({
|
|
|
1450
1471
|
"np-option__container-aligned": true
|
|
1451
1472
|
}),
|
|
1452
1473
|
children: /* @__PURE__ */ jsxs9("div", { className: "media", children: [
|
|
1453
|
-
icon || image || media ? /* @__PURE__ */
|
|
1474
|
+
icon || image || media ? /* @__PURE__ */ jsx40("div", { className: "media-left", children: /* @__PURE__ */ jsx40(
|
|
1454
1475
|
ListItemMedia,
|
|
1455
1476
|
{
|
|
1456
1477
|
icon,
|
|
@@ -1460,12 +1481,12 @@ var DesignSystemListItem = ({
|
|
|
1460
1481
|
) }) : null,
|
|
1461
1482
|
/* @__PURE__ */ jsxs9("div", { className: "media-body", children: [
|
|
1462
1483
|
/* @__PURE__ */ jsxs9("div", { className: "d-flex justify-content-between", children: [
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1484
|
+
/* @__PURE__ */ jsx40("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
|
|
1485
|
+
/* @__PURE__ */ jsx40("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: supportingValues == null ? void 0 : supportingValues.value })
|
|
1465
1486
|
] }),
|
|
1466
1487
|
/* @__PURE__ */ jsxs9("div", { className: "d-flex justify-content-between", children: [
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ jsx40(Body, { className: "d-block np-option__body", children: description }),
|
|
1489
|
+
/* @__PURE__ */ jsx40(Body, { className: "d-block np-option__body", children: supportingValues == null ? void 0 : supportingValues.subvalue })
|
|
1469
1490
|
] })
|
|
1470
1491
|
] })
|
|
1471
1492
|
] })
|
|
@@ -1478,9 +1499,9 @@ var ListItemMedia = ({
|
|
|
1478
1499
|
preferAvatar
|
|
1479
1500
|
}) => {
|
|
1480
1501
|
if (icon) {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ jsx40("div", { className: "circle circle-sm text-primary circle-inverse", children: /* @__PURE__ */ jsx40(OptionMedia, { media, preferAvatar }) });
|
|
1482
1503
|
}
|
|
1483
|
-
return /* @__PURE__ */
|
|
1504
|
+
return /* @__PURE__ */ jsx40("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx40(OptionMedia, { media, preferAvatar }) });
|
|
1484
1505
|
};
|
|
1485
1506
|
var getListAction = (callToAction) => {
|
|
1486
1507
|
if (callToAction) {
|
|
@@ -1496,10 +1517,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
1496
1517
|
|
|
1497
1518
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1498
1519
|
import { Loader } from "@transferwise/components";
|
|
1499
|
-
import { jsx as
|
|
1520
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1500
1521
|
var LoadingIndicatorRenderer = {
|
|
1501
1522
|
canRenderType: "loading-indicator",
|
|
1502
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
1523
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx41(
|
|
1503
1524
|
Loader,
|
|
1504
1525
|
{
|
|
1505
1526
|
size,
|
|
@@ -1512,28 +1533,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1512
1533
|
|
|
1513
1534
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1514
1535
|
import { Markdown as Markdown3 } from "@transferwise/components";
|
|
1515
|
-
import { jsx as
|
|
1536
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1516
1537
|
var MarkdownRenderer = {
|
|
1517
1538
|
canRenderType: "markdown",
|
|
1518
|
-
render: ({ content, align, margin }) => /* @__PURE__ */
|
|
1539
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx42("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx42(Markdown3, { className: "np-text-body-large", config: { link: { target: "_blank" } }, children: content }) })
|
|
1519
1540
|
};
|
|
1520
1541
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1521
1542
|
|
|
1522
1543
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
1523
1544
|
import { Button as Button4, Modal as Modal2 } from "@transferwise/components";
|
|
1524
1545
|
import { useState as useState6 } from "react";
|
|
1525
|
-
import { jsx as
|
|
1546
|
+
import { jsx as jsx43, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1526
1547
|
var ModalLayoutRenderer = {
|
|
1527
1548
|
canRenderType: "modal-layout",
|
|
1528
|
-
render: (props) => /* @__PURE__ */
|
|
1549
|
+
render: (props) => /* @__PURE__ */ jsx43(DFModal, __spreadValues({}, props))
|
|
1529
1550
|
};
|
|
1530
1551
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
1531
1552
|
function DFModal({ content, margin, trigger }) {
|
|
1532
1553
|
const [visible, setVisible] = useState6(false);
|
|
1533
1554
|
const { children, title } = content;
|
|
1534
1555
|
return /* @__PURE__ */ jsxs10("div", { className: getMargin(margin), children: [
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ jsx43(Button4, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1557
|
+
/* @__PURE__ */ jsx43(
|
|
1537
1558
|
Modal2,
|
|
1538
1559
|
{
|
|
1539
1560
|
scroll: "content",
|
|
@@ -1549,11 +1570,11 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1549
1570
|
|
|
1550
1571
|
// ../renderers/src/ModalRenderer.tsx
|
|
1551
1572
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
1552
|
-
import { jsx as
|
|
1573
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1553
1574
|
var ModalRenderer = {
|
|
1554
1575
|
canRenderType: "modal",
|
|
1555
1576
|
render: ({ title, children, open, onClose }) => {
|
|
1556
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx44(Modal3, { open, title, body: children, onClose });
|
|
1557
1578
|
}
|
|
1558
1579
|
};
|
|
1559
1580
|
|
|
@@ -1573,10 +1594,10 @@ var multi_select_messages_default = defineMessages5({
|
|
|
1573
1594
|
});
|
|
1574
1595
|
|
|
1575
1596
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1576
|
-
import { jsx as
|
|
1597
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
1577
1598
|
var MultiSelectInputRenderer = {
|
|
1578
1599
|
canRenderType: "input-multi-select",
|
|
1579
|
-
render: (props) => /* @__PURE__ */
|
|
1600
|
+
render: (props) => /* @__PURE__ */ jsx45(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1580
1601
|
};
|
|
1581
1602
|
function MultiSelectInputRendererComponent(props) {
|
|
1582
1603
|
const { formatMessage } = useIntl6();
|
|
@@ -1618,12 +1639,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1618
1639
|
const contentProps = {
|
|
1619
1640
|
title: option.title,
|
|
1620
1641
|
description: option.description,
|
|
1621
|
-
icon: /* @__PURE__ */
|
|
1642
|
+
icon: /* @__PURE__ */ jsx45(OptionMedia, { media: option.media, preferAvatar: false })
|
|
1622
1643
|
};
|
|
1623
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ jsx45(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1624
1645
|
};
|
|
1625
1646
|
const extraProps = { autoComplete };
|
|
1626
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ jsx45(
|
|
1627
1648
|
FieldInput_default,
|
|
1628
1649
|
{
|
|
1629
1650
|
id,
|
|
@@ -1631,7 +1652,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1631
1652
|
help,
|
|
1632
1653
|
description,
|
|
1633
1654
|
validation: validationState,
|
|
1634
|
-
children: /* @__PURE__ */
|
|
1655
|
+
children: /* @__PURE__ */ jsx45(
|
|
1635
1656
|
SelectInput,
|
|
1636
1657
|
__spreadValues({
|
|
1637
1658
|
id,
|
|
@@ -1676,7 +1697,7 @@ import { UploadInput } from "@transferwise/components";
|
|
|
1676
1697
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1677
1698
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
1678
1699
|
import classNames4 from "classnames";
|
|
1679
|
-
import { jsx as
|
|
1700
|
+
import { jsx as jsx46, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1680
1701
|
function UploadFieldInput({
|
|
1681
1702
|
id,
|
|
1682
1703
|
children,
|
|
@@ -1685,7 +1706,7 @@ function UploadFieldInput({
|
|
|
1685
1706
|
help,
|
|
1686
1707
|
validation
|
|
1687
1708
|
}) {
|
|
1688
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1709
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx46(LabelContentWithHelp, { text: label, help }) : label;
|
|
1689
1710
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1690
1711
|
return /* @__PURE__ */ jsxs11(
|
|
1691
1712
|
"div",
|
|
@@ -1694,9 +1715,9 @@ function UploadFieldInput({
|
|
|
1694
1715
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1695
1716
|
}),
|
|
1696
1717
|
children: [
|
|
1697
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsx46("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1698
1719
|
children,
|
|
1699
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
1720
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx46(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
1700
1721
|
]
|
|
1701
1722
|
}
|
|
1702
1723
|
);
|
|
@@ -1731,7 +1752,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
1731
1752
|
};
|
|
1732
1753
|
|
|
1733
1754
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1734
|
-
import { jsx as
|
|
1755
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1735
1756
|
var MultiUploadInputRenderer = {
|
|
1736
1757
|
canRenderType: "input-upload-multi",
|
|
1737
1758
|
render: (props) => {
|
|
@@ -1756,7 +1777,7 @@ var MultiUploadInputRenderer = {
|
|
|
1756
1777
|
};
|
|
1757
1778
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1758
1779
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1759
|
-
return /* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ jsx47(
|
|
1760
1781
|
UploadFieldInput_default,
|
|
1761
1782
|
{
|
|
1762
1783
|
id,
|
|
@@ -1764,7 +1785,7 @@ var MultiUploadInputRenderer = {
|
|
|
1764
1785
|
description,
|
|
1765
1786
|
validation: validationState,
|
|
1766
1787
|
help,
|
|
1767
|
-
children: /* @__PURE__ */
|
|
1788
|
+
children: /* @__PURE__ */ jsx47(
|
|
1768
1789
|
UploadInput,
|
|
1769
1790
|
{
|
|
1770
1791
|
id,
|
|
@@ -1788,7 +1809,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1788
1809
|
|
|
1789
1810
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1790
1811
|
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1791
|
-
import { jsx as
|
|
1812
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1792
1813
|
var NumberInputRenderer = {
|
|
1793
1814
|
canRenderType: "input-number",
|
|
1794
1815
|
render: (props) => {
|
|
@@ -1802,7 +1823,7 @@ var NumberInputRenderer = {
|
|
|
1802
1823
|
"maximum",
|
|
1803
1824
|
"minimum"
|
|
1804
1825
|
);
|
|
1805
|
-
return /* @__PURE__ */
|
|
1826
|
+
return /* @__PURE__ */ jsx48(
|
|
1806
1827
|
FieldInput_default,
|
|
1807
1828
|
{
|
|
1808
1829
|
id,
|
|
@@ -1810,7 +1831,7 @@ var NumberInputRenderer = {
|
|
|
1810
1831
|
description,
|
|
1811
1832
|
validation: validationState,
|
|
1812
1833
|
help,
|
|
1813
|
-
children: /* @__PURE__ */
|
|
1834
|
+
children: /* @__PURE__ */ jsx48(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx48(
|
|
1814
1835
|
Input2,
|
|
1815
1836
|
__spreadValues({
|
|
1816
1837
|
id,
|
|
@@ -1862,17 +1883,17 @@ var paragraph_messages_default = defineMessages6({
|
|
|
1862
1883
|
});
|
|
1863
1884
|
|
|
1864
1885
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1865
|
-
import { jsx as
|
|
1886
|
+
import { jsx as jsx49, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1866
1887
|
var ParagraphRenderer = {
|
|
1867
1888
|
canRenderType: "paragraph",
|
|
1868
|
-
render: (props) => /* @__PURE__ */
|
|
1889
|
+
render: (props) => /* @__PURE__ */ jsx49(Paragraph, __spreadValues({}, props))
|
|
1869
1890
|
};
|
|
1870
1891
|
function Paragraph({ align, control, margin, text }) {
|
|
1871
1892
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1872
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
1893
|
+
return control === "copyable" ? /* @__PURE__ */ jsx49(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx49(StandardParagraph, { className, text });
|
|
1873
1894
|
}
|
|
1874
1895
|
function StandardParagraph({ text, className }) {
|
|
1875
|
-
return /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ jsx49("p", { className: `np-text-body-large ${className}`, children: text });
|
|
1876
1897
|
}
|
|
1877
1898
|
function CopyableParagraph({
|
|
1878
1899
|
text,
|
|
@@ -1887,7 +1908,7 @@ function CopyableParagraph({
|
|
|
1887
1908
|
};
|
|
1888
1909
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
1889
1910
|
return /* @__PURE__ */ jsxs12("div", { className, children: [
|
|
1890
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsx49(
|
|
1891
1912
|
Input3,
|
|
1892
1913
|
{
|
|
1893
1914
|
type: "text",
|
|
@@ -1896,7 +1917,7 @@ function CopyableParagraph({
|
|
|
1896
1917
|
className: classNames5("text-ellipsis", inputAlignmentClasses)
|
|
1897
1918
|
}
|
|
1898
1919
|
),
|
|
1899
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ jsx49(Button5, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1900
1921
|
] });
|
|
1901
1922
|
}
|
|
1902
1923
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
@@ -1934,10 +1955,10 @@ var repeatable_messages_default = defineMessages7({
|
|
|
1934
1955
|
});
|
|
1935
1956
|
|
|
1936
1957
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1937
|
-
import { Fragment as Fragment4, jsx as
|
|
1958
|
+
import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1938
1959
|
var RepeatableRenderer = {
|
|
1939
1960
|
canRenderType: "repeatable",
|
|
1940
|
-
render: (props) => /* @__PURE__ */
|
|
1961
|
+
render: (props) => /* @__PURE__ */ jsx50(Repeatable, __spreadValues({}, props))
|
|
1941
1962
|
};
|
|
1942
1963
|
function Repeatable(props) {
|
|
1943
1964
|
const {
|
|
@@ -1977,8 +1998,8 @@ function Repeatable(props) {
|
|
|
1977
1998
|
setOpenModalType(null);
|
|
1978
1999
|
};
|
|
1979
2000
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1980
|
-
title && /* @__PURE__ */
|
|
1981
|
-
description && /* @__PURE__ */
|
|
2001
|
+
title && /* @__PURE__ */ jsx50(Header6, { title }),
|
|
2002
|
+
description && /* @__PURE__ */ jsx50("p", { children: description }),
|
|
1982
2003
|
/* @__PURE__ */ jsxs13(
|
|
1983
2004
|
"div",
|
|
1984
2005
|
{
|
|
@@ -1986,30 +2007,30 @@ function Repeatable(props) {
|
|
|
1986
2007
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
1987
2008
|
}),
|
|
1988
2009
|
children: [
|
|
1989
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
2010
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx50(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2011
|
+
/* @__PURE__ */ jsx50(
|
|
1991
2012
|
NavigationOption2,
|
|
1992
2013
|
{
|
|
1993
|
-
media: /* @__PURE__ */
|
|
2014
|
+
media: /* @__PURE__ */ jsx50(Plus, {}),
|
|
1994
2015
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
1995
2016
|
showMediaAtAllSizes: true,
|
|
1996
2017
|
onClick: () => onAddItem()
|
|
1997
2018
|
}
|
|
1998
2019
|
),
|
|
1999
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2020
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx50(InlineAlert3, { type: "negative", children: validationState.message })
|
|
2000
2021
|
]
|
|
2001
2022
|
}
|
|
2002
2023
|
),
|
|
2003
|
-
/* @__PURE__ */
|
|
2024
|
+
/* @__PURE__ */ jsx50(
|
|
2004
2025
|
Modal4,
|
|
2005
2026
|
{
|
|
2006
2027
|
open: openModalType !== null,
|
|
2007
2028
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2008
2029
|
body: /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2009
|
-
/* @__PURE__ */
|
|
2030
|
+
/* @__PURE__ */ jsx50("div", { className: "m-b-2", children: editableItem }),
|
|
2010
2031
|
/* @__PURE__ */ jsxs13("div", { children: [
|
|
2011
|
-
/* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsx50(Button6, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2033
|
+
/* @__PURE__ */ jsx50(
|
|
2013
2034
|
Button6,
|
|
2014
2035
|
{
|
|
2015
2036
|
v2: true,
|
|
@@ -2031,10 +2052,10 @@ function ItemSummaryOption({
|
|
|
2031
2052
|
item,
|
|
2032
2053
|
onClick
|
|
2033
2054
|
}) {
|
|
2034
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ jsx50(
|
|
2035
2056
|
NavigationOption2,
|
|
2036
2057
|
{
|
|
2037
|
-
media: /* @__PURE__ */
|
|
2058
|
+
media: /* @__PURE__ */ jsx50(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2038
2059
|
title: item.title,
|
|
2039
2060
|
content: item.description,
|
|
2040
2061
|
showMediaAtAllSizes: true,
|
|
@@ -2049,8 +2070,8 @@ import { DefinitionList } from "@transferwise/components";
|
|
|
2049
2070
|
|
|
2050
2071
|
// ../renderers/src/components/Header.tsx
|
|
2051
2072
|
import { Header as DSHeader } from "@transferwise/components";
|
|
2052
|
-
import { jsx as
|
|
2053
|
-
var Header7 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */
|
|
2073
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2074
|
+
var Header7 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx51(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
2054
2075
|
var getHeaderAction = (callToAction) => {
|
|
2055
2076
|
if (!callToAction) {
|
|
2056
2077
|
return void 0;
|
|
@@ -2072,14 +2093,14 @@ var getHeaderAction = (callToAction) => {
|
|
|
2072
2093
|
};
|
|
2073
2094
|
|
|
2074
2095
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2075
|
-
import { Fragment as Fragment5, jsx as
|
|
2096
|
+
import { Fragment as Fragment5, jsx as jsx52, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2076
2097
|
var ReviewRenderer = {
|
|
2077
2098
|
canRenderType: "review",
|
|
2078
2099
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2079
2100
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2080
2101
|
return /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsx52(Header7, { title, callToAction }),
|
|
2103
|
+
/* @__PURE__ */ jsx52("div", { className: margin, children: /* @__PURE__ */ jsx52(
|
|
2083
2104
|
DefinitionList,
|
|
2084
2105
|
{
|
|
2085
2106
|
layout: orientation,
|
|
@@ -2120,7 +2141,7 @@ var getFieldLabel = (label, help, onClick) => {
|
|
|
2120
2141
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2121
2142
|
label,
|
|
2122
2143
|
" ",
|
|
2123
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx52(Help_default, { help, onClick })
|
|
2124
2145
|
] });
|
|
2125
2146
|
}
|
|
2126
2147
|
return label;
|
|
@@ -2166,18 +2187,18 @@ var generic_error_messages_default = defineMessages9({
|
|
|
2166
2187
|
|
|
2167
2188
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2168
2189
|
import { Link } from "@transferwise/components";
|
|
2169
|
-
import { jsx as
|
|
2190
|
+
import { jsx as jsx53, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2170
2191
|
function ErrorResult({ state }) {
|
|
2171
2192
|
const intl = useIntl9();
|
|
2172
2193
|
return /* @__PURE__ */ jsxs15("p", { className: "m-t-2", children: [
|
|
2173
2194
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2174
2195
|
"\xA0",
|
|
2175
|
-
/* @__PURE__ */
|
|
2196
|
+
/* @__PURE__ */ jsx53(Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
2176
2197
|
] });
|
|
2177
2198
|
}
|
|
2178
2199
|
|
|
2179
2200
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2180
|
-
import { Fragment as Fragment6, jsx as
|
|
2201
|
+
import { Fragment as Fragment6, jsx as jsx54, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2181
2202
|
function BlockSearchRendererComponent({
|
|
2182
2203
|
id,
|
|
2183
2204
|
isLoading,
|
|
@@ -2191,7 +2212,7 @@ function BlockSearchRendererComponent({
|
|
|
2191
2212
|
const [hasSearched, setHasSearched] = useState9(false);
|
|
2192
2213
|
const { formatMessage } = useIntl10();
|
|
2193
2214
|
return /* @__PURE__ */ jsxs16("div", { className: getMargin(margin), children: [
|
|
2194
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsx54(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx54(
|
|
2195
2216
|
Input4,
|
|
2196
2217
|
{
|
|
2197
2218
|
id,
|
|
@@ -2208,7 +2229,7 @@ function BlockSearchRendererComponent({
|
|
|
2208
2229
|
}
|
|
2209
2230
|
}
|
|
2210
2231
|
) }),
|
|
2211
|
-
isLoading ? /* @__PURE__ */
|
|
2232
|
+
isLoading ? /* @__PURE__ */ jsx54(Fragment6, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx54(SearchResultContent, { state, trackEvent })
|
|
2212
2233
|
] });
|
|
2213
2234
|
}
|
|
2214
2235
|
function SearchResultContent({
|
|
@@ -2217,31 +2238,31 @@ function SearchResultContent({
|
|
|
2217
2238
|
}) {
|
|
2218
2239
|
switch (state.type) {
|
|
2219
2240
|
case "error":
|
|
2220
|
-
return /* @__PURE__ */
|
|
2241
|
+
return /* @__PURE__ */ jsx54(ErrorResult, { state });
|
|
2221
2242
|
case "results":
|
|
2222
|
-
return /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ jsx54(SearchResults, { state, trackEvent });
|
|
2223
2244
|
case "noResults":
|
|
2224
|
-
return /* @__PURE__ */
|
|
2245
|
+
return /* @__PURE__ */ jsx54(EmptySearchResult, { state });
|
|
2225
2246
|
case "pending":
|
|
2226
2247
|
default:
|
|
2227
2248
|
return null;
|
|
2228
2249
|
}
|
|
2229
2250
|
}
|
|
2230
2251
|
function EmptySearchResult({ state }) {
|
|
2231
|
-
return /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ jsx54(Markdown4, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2232
2253
|
}
|
|
2233
2254
|
function SearchResults({
|
|
2234
2255
|
state,
|
|
2235
2256
|
trackEvent
|
|
2236
2257
|
}) {
|
|
2237
|
-
return /* @__PURE__ */
|
|
2258
|
+
return /* @__PURE__ */ jsx54(NavigationOptionsList2, { children: state.results.map((result) => {
|
|
2238
2259
|
const { media } = result;
|
|
2239
|
-
return /* @__PURE__ */
|
|
2260
|
+
return /* @__PURE__ */ jsx54(
|
|
2240
2261
|
NavigationOption3,
|
|
2241
2262
|
{
|
|
2242
2263
|
title: result.title,
|
|
2243
2264
|
content: result.description,
|
|
2244
|
-
media: media ? /* @__PURE__ */
|
|
2265
|
+
media: media ? /* @__PURE__ */ jsx54(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
2245
2266
|
showMediaCircle: false,
|
|
2246
2267
|
showMediaAtAllSizes: true,
|
|
2247
2268
|
onClick: () => {
|
|
@@ -2262,7 +2283,7 @@ import { Markdown as Markdown5, Typeahead } from "@transferwise/components";
|
|
|
2262
2283
|
import { Search } from "@transferwise/icons";
|
|
2263
2284
|
import { useState as useState10 } from "react";
|
|
2264
2285
|
import { useIntl as useIntl11 } from "react-intl";
|
|
2265
|
-
import { jsx as
|
|
2286
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2266
2287
|
function InlineSearchRenderer({
|
|
2267
2288
|
id,
|
|
2268
2289
|
isLoading,
|
|
@@ -2274,7 +2295,7 @@ function InlineSearchRenderer({
|
|
|
2274
2295
|
}) {
|
|
2275
2296
|
const [hasSearched, setHasSearched] = useState10(false);
|
|
2276
2297
|
const intl = useIntl11();
|
|
2277
|
-
return /* @__PURE__ */
|
|
2298
|
+
return /* @__PURE__ */ jsx55("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx55(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx55(
|
|
2278
2299
|
Typeahead,
|
|
2279
2300
|
{
|
|
2280
2301
|
id: "typeahead-input-id",
|
|
@@ -2282,10 +2303,10 @@ function InlineSearchRenderer({
|
|
|
2282
2303
|
name: "typeahead-input-name",
|
|
2283
2304
|
size: "md",
|
|
2284
2305
|
maxHeight: 100,
|
|
2285
|
-
footer: /* @__PURE__ */
|
|
2306
|
+
footer: /* @__PURE__ */ jsx55(TypeaheadFooter, { state, isLoading }),
|
|
2286
2307
|
multiple: false,
|
|
2287
2308
|
clearable: false,
|
|
2288
|
-
addon: /* @__PURE__ */
|
|
2309
|
+
addon: /* @__PURE__ */ jsx55(Search, { size: 24 }),
|
|
2289
2310
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2290
2311
|
minQueryLength: 1,
|
|
2291
2312
|
onChange: (values) => {
|
|
@@ -2322,23 +2343,23 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2322
2343
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2323
2344
|
const { formatMessage } = useIntl11();
|
|
2324
2345
|
if (state.type === "noResults") {
|
|
2325
|
-
return /* @__PURE__ */
|
|
2346
|
+
return /* @__PURE__ */ jsx55(Markdown5, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2326
2347
|
}
|
|
2327
2348
|
if (state.type === "error") {
|
|
2328
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsx55("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx55(ErrorResult, { state }) });
|
|
2329
2350
|
}
|
|
2330
2351
|
if (state.type === "pending" || isLoading) {
|
|
2331
|
-
return /* @__PURE__ */
|
|
2352
|
+
return /* @__PURE__ */ jsx55("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2332
2353
|
}
|
|
2333
2354
|
return null;
|
|
2334
2355
|
}
|
|
2335
2356
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2336
2357
|
|
|
2337
2358
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2338
|
-
import { jsx as
|
|
2359
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2339
2360
|
var SearchRenderer = {
|
|
2340
2361
|
canRenderType: "search",
|
|
2341
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
2362
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx56(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx56(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2342
2363
|
};
|
|
2343
2364
|
var SearchRenderer_default = SearchRenderer;
|
|
2344
2365
|
|
|
@@ -2367,12 +2388,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
2367
2388
|
};
|
|
2368
2389
|
|
|
2369
2390
|
// ../renderers/src/SectionRenderer.tsx
|
|
2370
|
-
import { jsx as
|
|
2391
|
+
import { jsx as jsx57, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2371
2392
|
var SectionRenderer = {
|
|
2372
2393
|
canRenderType: "section",
|
|
2373
2394
|
render: ({ children, callToAction, margin, title }) => {
|
|
2374
2395
|
return /* @__PURE__ */ jsxs17("section", { className: getMargin(margin), children: [
|
|
2375
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2396
|
+
(title || callToAction) && /* @__PURE__ */ jsx57(Header8, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
2376
2397
|
children
|
|
2377
2398
|
] });
|
|
2378
2399
|
}
|
|
@@ -2381,7 +2402,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
2381
2402
|
|
|
2382
2403
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2383
2404
|
import { RadioGroup } from "@transferwise/components";
|
|
2384
|
-
import { Fragment as Fragment7, jsx as
|
|
2405
|
+
import { Fragment as Fragment7, jsx as jsx58, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2385
2406
|
function RadioInputRendererComponent(props) {
|
|
2386
2407
|
const {
|
|
2387
2408
|
id,
|
|
@@ -2396,7 +2417,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2396
2417
|
onSelect
|
|
2397
2418
|
} = props;
|
|
2398
2419
|
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
2399
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ jsx58(
|
|
2400
2421
|
FieldInput_default,
|
|
2401
2422
|
{
|
|
2402
2423
|
id,
|
|
@@ -2404,7 +2425,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2404
2425
|
help,
|
|
2405
2426
|
description,
|
|
2406
2427
|
validation: validationState,
|
|
2407
|
-
children: /* @__PURE__ */
|
|
2428
|
+
children: /* @__PURE__ */ jsx58("span", { children: /* @__PURE__ */ jsx58(
|
|
2408
2429
|
RadioGroup,
|
|
2409
2430
|
{
|
|
2410
2431
|
name: id,
|
|
@@ -2413,7 +2434,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2413
2434
|
value: index,
|
|
2414
2435
|
secondary: option.description,
|
|
2415
2436
|
disabled: option.disabled || disabled,
|
|
2416
|
-
avatar: /* @__PURE__ */
|
|
2437
|
+
avatar: /* @__PURE__ */ jsx58(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2417
2438
|
})),
|
|
2418
2439
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2419
2440
|
onChange: onSelect
|
|
@@ -2429,7 +2450,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2429
2450
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2430
2451
|
import { Tabs } from "@transferwise/components";
|
|
2431
2452
|
import { useEffect as useEffect5 } from "react";
|
|
2432
|
-
import { Fragment as Fragment8, jsx as
|
|
2453
|
+
import { Fragment as Fragment8, jsx as jsx59, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2433
2454
|
function TabInputRendererComponent(props) {
|
|
2434
2455
|
const {
|
|
2435
2456
|
id,
|
|
@@ -2449,7 +2470,7 @@ function TabInputRendererComponent(props) {
|
|
|
2449
2470
|
}
|
|
2450
2471
|
}, [selectedIndex, onSelect, options.length]);
|
|
2451
2472
|
return /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
2452
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsx59(
|
|
2453
2474
|
FieldInput_default,
|
|
2454
2475
|
{
|
|
2455
2476
|
id,
|
|
@@ -2457,7 +2478,7 @@ function TabInputRendererComponent(props) {
|
|
|
2457
2478
|
help,
|
|
2458
2479
|
description,
|
|
2459
2480
|
validation: validationState,
|
|
2460
|
-
children: /* @__PURE__ */
|
|
2481
|
+
children: /* @__PURE__ */ jsx59(
|
|
2461
2482
|
Tabs,
|
|
2462
2483
|
{
|
|
2463
2484
|
name: id,
|
|
@@ -2466,7 +2487,7 @@ function TabInputRendererComponent(props) {
|
|
|
2466
2487
|
title: option.title,
|
|
2467
2488
|
// if we pass null, we get some props-types console errors
|
|
2468
2489
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2469
|
-
content: /* @__PURE__ */
|
|
2490
|
+
content: /* @__PURE__ */ jsx59(Fragment8, {}),
|
|
2470
2491
|
disabled: option.disabled || disabled
|
|
2471
2492
|
})),
|
|
2472
2493
|
onTabSelect: onSelect
|
|
@@ -2481,7 +2502,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2481
2502
|
|
|
2482
2503
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2483
2504
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
2484
|
-
import { Fragment as Fragment9, jsx as
|
|
2505
|
+
import { Fragment as Fragment9, jsx as jsx60, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2485
2506
|
function SelectInputRendererComponent(props) {
|
|
2486
2507
|
const {
|
|
2487
2508
|
id,
|
|
@@ -2521,13 +2542,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2521
2542
|
} : {
|
|
2522
2543
|
title: option.title,
|
|
2523
2544
|
description: option.description,
|
|
2524
|
-
icon: /* @__PURE__ */
|
|
2545
|
+
icon: /* @__PURE__ */ jsx60(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2525
2546
|
};
|
|
2526
|
-
return /* @__PURE__ */
|
|
2547
|
+
return /* @__PURE__ */ jsx60(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
2527
2548
|
};
|
|
2528
2549
|
const extraProps = { autoComplete };
|
|
2529
2550
|
return /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
2530
|
-
/* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ jsx60(
|
|
2531
2552
|
FieldInput_default,
|
|
2532
2553
|
{
|
|
2533
2554
|
id,
|
|
@@ -2535,7 +2556,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2535
2556
|
help,
|
|
2536
2557
|
description,
|
|
2537
2558
|
validation: validationState,
|
|
2538
|
-
children: /* @__PURE__ */
|
|
2559
|
+
children: /* @__PURE__ */ jsx60(
|
|
2539
2560
|
SelectInput2,
|
|
2540
2561
|
__spreadValues({
|
|
2541
2562
|
name: id,
|
|
@@ -2558,7 +2579,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2558
2579
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2559
2580
|
import { useEffect as useEffect6 } from "react";
|
|
2560
2581
|
import { SegmentedControl } from "@transferwise/components";
|
|
2561
|
-
import { Fragment as Fragment10, jsx as
|
|
2582
|
+
import { Fragment as Fragment10, jsx as jsx61, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2562
2583
|
function SegmentedInputRendererComponent(props) {
|
|
2563
2584
|
const {
|
|
2564
2585
|
id,
|
|
@@ -2577,7 +2598,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2577
2598
|
}
|
|
2578
2599
|
}, [selectedIndex, onSelect, options.length]);
|
|
2579
2600
|
return /* @__PURE__ */ jsxs21(Fragment10, { children: [
|
|
2580
|
-
/* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ jsx61(
|
|
2581
2602
|
FieldInput_default,
|
|
2582
2603
|
{
|
|
2583
2604
|
id,
|
|
@@ -2585,7 +2606,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2585
2606
|
help,
|
|
2586
2607
|
description,
|
|
2587
2608
|
validation: validationState,
|
|
2588
|
-
children: /* @__PURE__ */
|
|
2609
|
+
children: /* @__PURE__ */ jsx61(
|
|
2589
2610
|
SegmentedControl,
|
|
2590
2611
|
{
|
|
2591
2612
|
name: `${id}-segmented-control`,
|
|
@@ -2602,26 +2623,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2602
2623
|
)
|
|
2603
2624
|
}
|
|
2604
2625
|
),
|
|
2605
|
-
/* @__PURE__ */
|
|
2626
|
+
/* @__PURE__ */ jsx61("div", { id: `${id}-children`, children })
|
|
2606
2627
|
] });
|
|
2607
2628
|
}
|
|
2608
2629
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2609
2630
|
|
|
2610
2631
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2611
|
-
import { jsx as
|
|
2632
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
2612
2633
|
var SelectInputRenderer = {
|
|
2613
2634
|
canRenderType: "input-select",
|
|
2614
2635
|
render: (props) => {
|
|
2615
2636
|
switch (props.control) {
|
|
2616
2637
|
case "radio":
|
|
2617
|
-
return /* @__PURE__ */
|
|
2638
|
+
return /* @__PURE__ */ jsx62(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2618
2639
|
case "tab":
|
|
2619
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2640
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx62(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx62(TabInputRendererComponent, __spreadValues({}, props));
|
|
2620
2641
|
case "segmented":
|
|
2621
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2642
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx62(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx62(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2622
2643
|
case "select":
|
|
2623
2644
|
default:
|
|
2624
|
-
return /* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ jsx62(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2625
2646
|
}
|
|
2626
2647
|
}
|
|
2627
2648
|
};
|
|
@@ -2629,17 +2650,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2629
2650
|
|
|
2630
2651
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2631
2652
|
import { Header as Header9, Summary } from "@transferwise/components";
|
|
2632
|
-
import { jsx as
|
|
2653
|
+
import { jsx as jsx63, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2633
2654
|
var StatusListRenderer = {
|
|
2634
2655
|
canRenderType: "status-list",
|
|
2635
2656
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs22("div", { className: getMargin(margin), children: [
|
|
2636
|
-
title ? /* @__PURE__ */
|
|
2637
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
2657
|
+
title ? /* @__PURE__ */ jsx63(Header9, { title, className: "m-b-2" }) : null,
|
|
2658
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx63(
|
|
2638
2659
|
Summary,
|
|
2639
2660
|
{
|
|
2640
2661
|
title: itemTitle,
|
|
2641
2662
|
description,
|
|
2642
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
2663
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx63(DynamicIcon_default, { name: icon.name }) : null,
|
|
2643
2664
|
status: mapStatus(status),
|
|
2644
2665
|
action: getSummaryAction(callToAction)
|
|
2645
2666
|
},
|
|
@@ -2693,22 +2714,22 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
2693
2714
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
2694
2715
|
import { IconButton } from "@transferwise/components";
|
|
2695
2716
|
import { ArrowLeft } from "@transferwise/icons";
|
|
2696
|
-
import { jsx as
|
|
2717
|
+
import { jsx as jsx64, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2697
2718
|
function BackButton({ title, onClick }) {
|
|
2698
2719
|
return /* @__PURE__ */ jsxs23(IconButton, { priority: "tertiary", onClick, children: [
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx64("span", { className: "sr-only", children: title }),
|
|
2721
|
+
/* @__PURE__ */ jsx64(ArrowLeft, {})
|
|
2701
2722
|
] });
|
|
2702
2723
|
}
|
|
2703
2724
|
|
|
2704
2725
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
2705
2726
|
import { Button as Button7, IconButton as IconButton2 } from "@transferwise/components";
|
|
2706
|
-
import { jsx as
|
|
2727
|
+
import { jsx as jsx65, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2707
2728
|
var Toolbar = ({ items }) => {
|
|
2708
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
2729
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx65("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx65(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
2709
2730
|
};
|
|
2710
2731
|
function ToolbarButton(props) {
|
|
2711
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
2732
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx65(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx65(TextToolbarButton, __spreadValues({}, props));
|
|
2712
2733
|
}
|
|
2713
2734
|
function MediaToolbarButton(props) {
|
|
2714
2735
|
var _a;
|
|
@@ -2725,7 +2746,7 @@ function MediaToolbarButton(props) {
|
|
|
2725
2746
|
type,
|
|
2726
2747
|
onClick,
|
|
2727
2748
|
children: [
|
|
2728
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
2749
|
+
accessibilityDescription ? /* @__PURE__ */ jsx65("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
2729
2750
|
media ? (_a = getAddonStart(media)) == null ? void 0 : _a.value : null
|
|
2730
2751
|
]
|
|
2731
2752
|
}
|
|
@@ -2736,7 +2757,7 @@ function TextToolbarButton(props) {
|
|
|
2736
2757
|
const addonStart = media ? getAddonStart(media) : void 0;
|
|
2737
2758
|
const priority = getPriority2(control);
|
|
2738
2759
|
const sentiment = getSentiment(context);
|
|
2739
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ jsx65(
|
|
2740
2761
|
Button7,
|
|
2741
2762
|
{
|
|
2742
2763
|
v2: true,
|
|
@@ -2781,16 +2802,16 @@ var getIconButtonPriority = (control) => {
|
|
|
2781
2802
|
};
|
|
2782
2803
|
|
|
2783
2804
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
2784
|
-
import { jsx as
|
|
2805
|
+
import { jsx as jsx66, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2785
2806
|
function TopBar({ back, toolbar }) {
|
|
2786
2807
|
return back || toolbar ? /* @__PURE__ */ jsxs25("div", { className: "d-flex m-b-2", children: [
|
|
2787
|
-
back ? /* @__PURE__ */
|
|
2788
|
-
toolbar ? /* @__PURE__ */
|
|
2808
|
+
back ? /* @__PURE__ */ jsx66(BackButton, __spreadValues({}, back)) : null,
|
|
2809
|
+
toolbar ? /* @__PURE__ */ jsx66(Toolbar, __spreadValues({}, toolbar)) : null
|
|
2789
2810
|
] }) : null;
|
|
2790
2811
|
}
|
|
2791
2812
|
|
|
2792
2813
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
2793
|
-
import { jsx as
|
|
2814
|
+
import { jsx as jsx67, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2794
2815
|
var SplashCelebrationStepRenderer = {
|
|
2795
2816
|
canRenderType: "step",
|
|
2796
2817
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -2800,13 +2821,13 @@ function SplashCelebrationStepRendererComponent(props) {
|
|
|
2800
2821
|
const { back, toolbar, children, trackEvent } = props;
|
|
2801
2822
|
useCustomTheme("forest-green", trackEvent);
|
|
2802
2823
|
return /* @__PURE__ */ jsxs26("div", { className: "splash-screen m-t-5", children: [
|
|
2803
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ jsx67(TopBar, { back, toolbar }),
|
|
2804
2825
|
children
|
|
2805
2826
|
] });
|
|
2806
2827
|
}
|
|
2807
2828
|
|
|
2808
2829
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
2809
|
-
import { jsx as
|
|
2830
|
+
import { jsx as jsx68, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2810
2831
|
var SplashStepRenderer = {
|
|
2811
2832
|
canRenderType: "step",
|
|
2812
2833
|
canRender: ({ control }) => control === "splash",
|
|
@@ -2815,14 +2836,14 @@ var SplashStepRenderer = {
|
|
|
2815
2836
|
function SplashStepRendererComponent(props) {
|
|
2816
2837
|
const { back, toolbar, children } = props;
|
|
2817
2838
|
return /* @__PURE__ */ jsxs27("div", { className: "splash-screen m-t-5", children: [
|
|
2818
|
-
/* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ jsx68(TopBar, { back, toolbar }),
|
|
2819
2840
|
children
|
|
2820
2841
|
] });
|
|
2821
2842
|
}
|
|
2822
2843
|
|
|
2823
2844
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2824
2845
|
import { Alert as Alert2, Title as Title2 } from "@transferwise/components";
|
|
2825
|
-
import { Fragment as Fragment11, jsx as
|
|
2846
|
+
import { Fragment as Fragment11, jsx as jsx69, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2826
2847
|
var StepRenderer = {
|
|
2827
2848
|
canRenderType: "step",
|
|
2828
2849
|
render: StepRendererComponent
|
|
@@ -2830,12 +2851,12 @@ var StepRenderer = {
|
|
|
2830
2851
|
function StepRendererComponent(props) {
|
|
2831
2852
|
const { back, description, error, title, children, toolbar } = props;
|
|
2832
2853
|
return /* @__PURE__ */ jsxs28(Fragment11, { children: [
|
|
2833
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx69(TopBar, { back, toolbar }),
|
|
2834
2855
|
title || description ? /* @__PURE__ */ jsxs28("div", { className: "m-b-4", children: [
|
|
2835
|
-
title ? /* @__PURE__ */
|
|
2836
|
-
description ? /* @__PURE__ */
|
|
2856
|
+
title ? /* @__PURE__ */ jsx69(Title2, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2857
|
+
description ? /* @__PURE__ */ jsx69("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2837
2858
|
] }) : void 0,
|
|
2838
|
-
error ? /* @__PURE__ */
|
|
2859
|
+
error ? /* @__PURE__ */ jsx69(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2839
2860
|
children
|
|
2840
2861
|
] });
|
|
2841
2862
|
}
|
|
@@ -2843,26 +2864,26 @@ function StepRendererComponent(props) {
|
|
|
2843
2864
|
// ../renderers/src/TabsRenderer.tsx
|
|
2844
2865
|
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
2845
2866
|
import { useState as useState11 } from "react";
|
|
2846
|
-
import { jsx as
|
|
2867
|
+
import { jsx as jsx70, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2847
2868
|
var TabsRenderer = {
|
|
2848
2869
|
canRenderType: "tabs",
|
|
2849
2870
|
render: (props) => {
|
|
2850
2871
|
switch (props.control) {
|
|
2851
2872
|
case "segmented":
|
|
2852
2873
|
if (props.tabs.length > 3) {
|
|
2853
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ jsx70(TabsRendererComponent, __spreadValues({}, props));
|
|
2854
2875
|
}
|
|
2855
|
-
return /* @__PURE__ */
|
|
2876
|
+
return /* @__PURE__ */ jsx70(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
2856
2877
|
case "chips":
|
|
2857
|
-
return /* @__PURE__ */
|
|
2878
|
+
return /* @__PURE__ */ jsx70(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
2858
2879
|
default:
|
|
2859
|
-
return /* @__PURE__ */
|
|
2880
|
+
return /* @__PURE__ */ jsx70(TabsRendererComponent, __spreadValues({}, props));
|
|
2860
2881
|
}
|
|
2861
2882
|
}
|
|
2862
2883
|
};
|
|
2863
2884
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
2864
2885
|
const [selectedIndex, setSelectedIndex] = useState11(0);
|
|
2865
|
-
return /* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ jsx70("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx70(
|
|
2866
2887
|
Tabs2,
|
|
2867
2888
|
{
|
|
2868
2889
|
name: uid,
|
|
@@ -2884,7 +2905,7 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2884
2905
|
var _a;
|
|
2885
2906
|
const [selectedIndex, setSelectedIndex] = useState11(0);
|
|
2886
2907
|
return /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
|
|
2887
|
-
/* @__PURE__ */
|
|
2908
|
+
/* @__PURE__ */ jsx70(
|
|
2888
2909
|
SegmentedControl2,
|
|
2889
2910
|
{
|
|
2890
2911
|
name: uid,
|
|
@@ -2899,14 +2920,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2899
2920
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
2900
2921
|
}
|
|
2901
2922
|
),
|
|
2902
|
-
/* @__PURE__ */
|
|
2923
|
+
/* @__PURE__ */ jsx70("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
2903
2924
|
] });
|
|
2904
2925
|
}
|
|
2905
2926
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
2906
2927
|
var _a;
|
|
2907
2928
|
const [selectedIndex, setSelectedIndex] = useState11(0);
|
|
2908
2929
|
return /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
|
|
2909
|
-
/* @__PURE__ */
|
|
2930
|
+
/* @__PURE__ */ jsx70("div", { className: "chips-container", children: /* @__PURE__ */ jsx70(
|
|
2910
2931
|
Chips,
|
|
2911
2932
|
{
|
|
2912
2933
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -2914,7 +2935,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
|
2914
2935
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
2915
2936
|
}
|
|
2916
2937
|
) }),
|
|
2917
|
-
/* @__PURE__ */
|
|
2938
|
+
/* @__PURE__ */ jsx70("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
2918
2939
|
] });
|
|
2919
2940
|
}
|
|
2920
2941
|
|
|
@@ -2929,7 +2950,7 @@ import {
|
|
|
2929
2950
|
TextArea,
|
|
2930
2951
|
TextareaWithDisplayFormat
|
|
2931
2952
|
} from "@transferwise/components";
|
|
2932
|
-
import { jsx as
|
|
2953
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
2933
2954
|
var commonKeys = [
|
|
2934
2955
|
"autoComplete",
|
|
2935
2956
|
"autoCapitalize",
|
|
@@ -2948,12 +2969,12 @@ function VariableTextInput(inputProps) {
|
|
|
2948
2969
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
2949
2970
|
switch (control) {
|
|
2950
2971
|
case "email":
|
|
2951
|
-
return /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ jsx71(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
2952
2973
|
case "password":
|
|
2953
|
-
return /* @__PURE__ */
|
|
2974
|
+
return /* @__PURE__ */ jsx71(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
2954
2975
|
case "numeric": {
|
|
2955
2976
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
2956
|
-
return /* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ jsx71(
|
|
2957
2978
|
TextInput,
|
|
2958
2979
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
2959
2980
|
onChange: (newValue) => {
|
|
@@ -2964,9 +2985,9 @@ function VariableTextInput(inputProps) {
|
|
|
2964
2985
|
);
|
|
2965
2986
|
}
|
|
2966
2987
|
case "phone-number":
|
|
2967
|
-
return /* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ jsx71(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
2968
2989
|
default: {
|
|
2969
|
-
return /* @__PURE__ */
|
|
2990
|
+
return /* @__PURE__ */ jsx71(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
2970
2991
|
}
|
|
2971
2992
|
}
|
|
2972
2993
|
}
|
|
@@ -2974,11 +2995,11 @@ function TextInput(props) {
|
|
|
2974
2995
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
2975
2996
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
2976
2997
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
2977
|
-
return displayFormat ? /* @__PURE__ */
|
|
2998
|
+
return displayFormat ? /* @__PURE__ */ jsx71(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx71(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
2978
2999
|
}
|
|
2979
3000
|
|
|
2980
3001
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2981
|
-
import { jsx as
|
|
3002
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
2982
3003
|
var TextInputRenderer = {
|
|
2983
3004
|
canRenderType: "input-text",
|
|
2984
3005
|
render: (props) => {
|
|
@@ -3011,7 +3032,7 @@ var TextInputRenderer = {
|
|
|
3011
3032
|
}
|
|
3012
3033
|
}
|
|
3013
3034
|
});
|
|
3014
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ jsx72(
|
|
3015
3036
|
FieldInput_default,
|
|
3016
3037
|
{
|
|
3017
3038
|
id,
|
|
@@ -3019,7 +3040,7 @@ var TextInputRenderer = {
|
|
|
3019
3040
|
description,
|
|
3020
3041
|
validation: validationState,
|
|
3021
3042
|
help,
|
|
3022
|
-
children: /* @__PURE__ */
|
|
3043
|
+
children: /* @__PURE__ */ jsx72(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx72(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3023
3044
|
}
|
|
3024
3045
|
);
|
|
3025
3046
|
}
|
|
@@ -3033,7 +3054,7 @@ import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
|
3033
3054
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3034
3055
|
|
|
3035
3056
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3036
|
-
import { jsx as
|
|
3057
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3037
3058
|
var UploadInputRenderer = {
|
|
3038
3059
|
canRenderType: "input-upload",
|
|
3039
3060
|
render: (props) => {
|
|
@@ -3049,14 +3070,14 @@ var UploadInputRenderer = {
|
|
|
3049
3070
|
};
|
|
3050
3071
|
return (
|
|
3051
3072
|
// We don't pass help here as there is no sensible place to display it
|
|
3052
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx73(
|
|
3053
3074
|
UploadFieldInput_default,
|
|
3054
3075
|
{
|
|
3055
3076
|
id,
|
|
3056
3077
|
label: void 0,
|
|
3057
3078
|
description: void 0,
|
|
3058
3079
|
validation: validationState,
|
|
3059
|
-
children: /* @__PURE__ */
|
|
3080
|
+
children: /* @__PURE__ */ jsx73(
|
|
3060
3081
|
UploadInput2,
|
|
3061
3082
|
{
|
|
3062
3083
|
id,
|
|
@@ -3115,7 +3136,7 @@ var LargeUploadRenderer = {
|
|
|
3115
3136
|
};
|
|
3116
3137
|
const filetypes = acceptsToFileTypes(accepts);
|
|
3117
3138
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3118
|
-
return /* @__PURE__ */
|
|
3139
|
+
return /* @__PURE__ */ jsx73(
|
|
3119
3140
|
FieldInput_default,
|
|
3120
3141
|
{
|
|
3121
3142
|
id,
|
|
@@ -3123,7 +3144,7 @@ var LargeUploadRenderer = {
|
|
|
3123
3144
|
description,
|
|
3124
3145
|
validation: validationState,
|
|
3125
3146
|
help,
|
|
3126
|
-
children: /* @__PURE__ */
|
|
3147
|
+
children: /* @__PURE__ */ jsx73(
|
|
3127
3148
|
Upload,
|
|
3128
3149
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3129
3150
|
usAccept,
|
|
@@ -3139,19 +3160,15 @@ var LargeUploadRenderer = {
|
|
|
3139
3160
|
};
|
|
3140
3161
|
|
|
3141
3162
|
// ../renderers/src/NewListItem/NewDecisionRenderer.tsx
|
|
3142
|
-
import { ListItem as
|
|
3163
|
+
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
3143
3164
|
|
|
3144
3165
|
// ../renderers/src/NewListItem/getInlineAlert.tsx
|
|
3145
|
-
import { ListItem } from "@transferwise/components";
|
|
3146
|
-
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3147
|
-
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx73(ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
3148
|
-
|
|
3149
|
-
// ../renderers/src/NewListItem/getMedia.tsx
|
|
3166
|
+
import { ListItem as ListItem2 } from "@transferwise/components";
|
|
3150
3167
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3151
|
-
var
|
|
3168
|
+
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx74(ListItem2.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
3152
3169
|
|
|
3153
3170
|
// ../renderers/src/NewListItem/getAdditionalInfo.tsx
|
|
3154
|
-
import { ListItem as
|
|
3171
|
+
import { ListItem as ListItem3 } from "@transferwise/components";
|
|
3155
3172
|
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
3156
3173
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3157
3174
|
if (!additionalInfo) {
|
|
@@ -3160,7 +3177,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3160
3177
|
const { href, text, onClick } = additionalInfo;
|
|
3161
3178
|
if (href || onClick) {
|
|
3162
3179
|
return /* @__PURE__ */ jsx75(
|
|
3163
|
-
|
|
3180
|
+
ListItem3.AdditionalInfo,
|
|
3164
3181
|
{
|
|
3165
3182
|
action: {
|
|
3166
3183
|
label: text,
|
|
@@ -3171,7 +3188,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3171
3188
|
}
|
|
3172
3189
|
);
|
|
3173
3190
|
}
|
|
3174
|
-
return /* @__PURE__ */ jsx75(
|
|
3191
|
+
return /* @__PURE__ */ jsx75(ListItem3.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3175
3192
|
};
|
|
3176
3193
|
|
|
3177
3194
|
// ../renderers/src/NewListItem/NewDecisionRenderer.tsx
|
|
@@ -3195,7 +3212,7 @@ var renderDecisionList2 = ({ options, control }) => {
|
|
|
3195
3212
|
onClick
|
|
3196
3213
|
} = option;
|
|
3197
3214
|
return /* @__PURE__ */ jsx76(
|
|
3198
|
-
|
|
3215
|
+
ListItem4,
|
|
3199
3216
|
{
|
|
3200
3217
|
title: itemTitle,
|
|
3201
3218
|
subtitle: description,
|
|
@@ -3206,7 +3223,7 @@ var renderDecisionList2 = ({ options, control }) => {
|
|
|
3206
3223
|
media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
|
|
3207
3224
|
prompt: getInlineAlert(inlineAlert),
|
|
3208
3225
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
3209
|
-
control: href ? /* @__PURE__ */ jsx76(
|
|
3226
|
+
control: href ? /* @__PURE__ */ jsx76(ListItem4.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx76(ListItem4.Navigation, { onClick })
|
|
3210
3227
|
},
|
|
3211
3228
|
JSON.stringify(option)
|
|
3212
3229
|
);
|
|
@@ -3215,7 +3232,7 @@ var renderDecisionList2 = ({ options, control }) => {
|
|
|
3215
3232
|
var NewDecisionRenderer_default = DecisionRenderer2;
|
|
3216
3233
|
|
|
3217
3234
|
// ../renderers/src/NewListItem/NewListRenderer.tsx
|
|
3218
|
-
import { ListItem as
|
|
3235
|
+
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
3219
3236
|
import { jsx as jsx77, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3220
3237
|
var ListRenderer2 = {
|
|
3221
3238
|
canRenderType: "list",
|
|
@@ -3232,7 +3249,7 @@ var ListRenderer2 = {
|
|
|
3232
3249
|
inlineAlert
|
|
3233
3250
|
} = item;
|
|
3234
3251
|
return /* @__PURE__ */ jsx77(
|
|
3235
|
-
|
|
3252
|
+
ListItem5,
|
|
3236
3253
|
{
|
|
3237
3254
|
title: itemTitle,
|
|
3238
3255
|
subtitle: description,
|
|
@@ -3250,7 +3267,7 @@ var ListRenderer2 = {
|
|
|
3250
3267
|
var NewListRenderer_default = ListRenderer2;
|
|
3251
3268
|
|
|
3252
3269
|
// ../renderers/src/NewListItem/NewReviewRenderer.tsx
|
|
3253
|
-
import { ListItem as
|
|
3270
|
+
import { ListItem as ListItem6, Popover } from "@transferwise/components";
|
|
3254
3271
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
3255
3272
|
import { jsx as jsx78, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3256
3273
|
var IGNORED_CONTROLS = [
|
|
@@ -3277,7 +3294,7 @@ var ReviewRenderer2 = {
|
|
|
3277
3294
|
callToAction: itemCallToAction
|
|
3278
3295
|
} = field;
|
|
3279
3296
|
return /* @__PURE__ */ jsx78(
|
|
3280
|
-
|
|
3297
|
+
ListItem6,
|
|
3281
3298
|
{
|
|
3282
3299
|
title: value,
|
|
3283
3300
|
subtitle: label,
|
|
@@ -3298,10 +3315,10 @@ var getCTAControl = (callToAction) => {
|
|
|
3298
3315
|
}
|
|
3299
3316
|
const { accessibilityDescription, href, title, onClick } = callToAction;
|
|
3300
3317
|
if (href) {
|
|
3301
|
-
return /* @__PURE__ */ jsx78(
|
|
3318
|
+
return /* @__PURE__ */ jsx78(ListItem6.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
|
|
3302
3319
|
}
|
|
3303
3320
|
return /* @__PURE__ */ jsx78(
|
|
3304
|
-
|
|
3321
|
+
ListItem6.Button,
|
|
3305
3322
|
{
|
|
3306
3323
|
"aria-description": accessibilityDescription,
|
|
3307
3324
|
partiallyInteractive: true,
|
|
@@ -3314,12 +3331,12 @@ var getHelpControl = (help) => {
|
|
|
3314
3331
|
if (!help) {
|
|
3315
3332
|
return void 0;
|
|
3316
3333
|
}
|
|
3317
|
-
return /* @__PURE__ */ jsx78(Popover, { content: help, children: /* @__PURE__ */ jsx78(
|
|
3334
|
+
return /* @__PURE__ */ jsx78(Popover, { content: help, children: /* @__PURE__ */ jsx78(ListItem6.IconButton, { partiallyInteractive: true, children: /* @__PURE__ */ jsx78(QuestionMarkCircle, {}) }) });
|
|
3318
3335
|
};
|
|
3319
3336
|
var NewReviewRenderer_default = ReviewRenderer2;
|
|
3320
3337
|
|
|
3321
3338
|
// ../renderers/src/NewListItem/NewStatusListRenderer.tsx
|
|
3322
|
-
import { AvatarView as AvatarView4, Header as Header10, ListItem as
|
|
3339
|
+
import { AvatarView as AvatarView4, Header as Header10, ListItem as ListItem7 } from "@transferwise/components";
|
|
3323
3340
|
import { jsx as jsx79, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3324
3341
|
var NewStatusListRenderer = {
|
|
3325
3342
|
canRenderType: "status-list",
|
|
@@ -3328,13 +3345,13 @@ var NewStatusListRenderer = {
|
|
|
3328
3345
|
items.map((item) => {
|
|
3329
3346
|
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3330
3347
|
return /* @__PURE__ */ jsx79(
|
|
3331
|
-
|
|
3348
|
+
ListItem7,
|
|
3332
3349
|
{
|
|
3333
3350
|
title: itemTitle,
|
|
3334
3351
|
subtitle: description,
|
|
3335
3352
|
media: icon && "name" in icon ? /* @__PURE__ */ jsx79(AvatarView4, { badge: { status: mapStatus2(status) }, children: /* @__PURE__ */ jsx79(DynamicIcon_default, { name: icon.name }) }) : void 0,
|
|
3336
3353
|
additionalInfo: callToAction ? /* @__PURE__ */ jsx79(
|
|
3337
|
-
|
|
3354
|
+
ListItem7.AdditionalInfo,
|
|
3338
3355
|
{
|
|
3339
3356
|
action: {
|
|
3340
3357
|
href: callToAction.href,
|
|
@@ -3480,12 +3497,6 @@ var getWiseRenderers = () => [
|
|
|
3480
3497
|
StepRenderer
|
|
3481
3498
|
];
|
|
3482
3499
|
|
|
3483
|
-
// src/dynamicFlow/renderers.ts
|
|
3484
|
-
var Header11 = Header7;
|
|
3485
|
-
var getMargin2 = getMargin;
|
|
3486
|
-
var getListItemRenderers2 = getListItemRenderers;
|
|
3487
|
-
var getButtonV2Renderers2 = getButtonV2Renderers;
|
|
3488
|
-
|
|
3489
3500
|
// src/i18n/index.ts
|
|
3490
3501
|
import { translations as coreTranslations } from "@wise/dynamic-flow-client";
|
|
3491
3502
|
|
|
@@ -3736,7 +3747,7 @@ var hu_default = {
|
|
|
3736
3747
|
"df.wise.CopyFeedback.copy": "V\xE1g\xF3lapra m\xE1solva",
|
|
3737
3748
|
"df.wise.CopyFeedback.copyFailed": "Nem siker\xFClt a v\xE1g\xF3lapra m\xE1solni",
|
|
3738
3749
|
"df.wise.Decision.all": "\xD6sszes",
|
|
3739
|
-
"df.wise.Decision.currenciesWithAccountDetails": "
|
|
3750
|
+
"df.wise.Decision.currenciesWithAccountDetails": "P\xE9nznemek sz\xE1mlaadatokkal",
|
|
3740
3751
|
"df.wise.Decision.filterPlaceholder": "Kezdj el g\xE9pelni a keres\xE9shez",
|
|
3741
3752
|
"df.wise.Decision.noResults": "Nincs tal\xE1lat",
|
|
3742
3753
|
"df.wise.Decision.popular": "N\xE9pszer\u0171",
|
|
@@ -3918,7 +3929,7 @@ var nl_default = {
|
|
|
3918
3929
|
"df.wise.Decision.all": "Alles",
|
|
3919
3930
|
"df.wise.Decision.currenciesWithAccountDetails": "Valuta met rekeninggegevens",
|
|
3920
3931
|
"df.wise.Decision.filterPlaceholder": "Begin met typen om te zoeken",
|
|
3921
|
-
"df.wise.Decision.noResults": "
|
|
3932
|
+
"df.wise.Decision.noResults": "Geen resultaten",
|
|
3922
3933
|
"df.wise.Decision.popular": "Populair",
|
|
3923
3934
|
"df.wise.Decision.recent": "Recent",
|
|
3924
3935
|
"df.wise.Decision.results": "Zoekresultaten",
|
|
@@ -4507,12 +4518,13 @@ export {
|
|
|
4507
4518
|
DynamicFlowLegacy,
|
|
4508
4519
|
DynamicFlowRevamp,
|
|
4509
4520
|
DynamicForm,
|
|
4510
|
-
|
|
4521
|
+
Header7 as Header,
|
|
4511
4522
|
JsonSchemaForm,
|
|
4523
|
+
Media,
|
|
4512
4524
|
findRendererPropsByType,
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4525
|
+
getButtonV2Renderers,
|
|
4526
|
+
getListItemRenderers,
|
|
4527
|
+
getMargin,
|
|
4516
4528
|
isValidSchema,
|
|
4517
4529
|
makeHttpClient as makeCustomFetch,
|
|
4518
4530
|
i18n_default as translations
|