@wise/dynamic-flow-client-internal 5.24.0-experimental-9265cac → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/ar.json +45 -0
- package/build/i18n/ko.json +45 -0
- package/build/main.css +9 -0
- package/build/main.js +1099 -950
- package/build/main.mjs +907 -755
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/dynamicFlow/DynamicFlowWithRef.d.ts +2 -2
- package/build/types/dynamicFlow/DynamicFlowWithRef.d.ts.map +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts +1 -1
- package/build/types/dynamicFlow/context-menu/useDFContextMenu.d.ts.map +1 -1
- package/build/types/dynamicFlow/renderers.d.ts +2 -1
- package/build/types/dynamicFlow/renderers.d.ts.map +1 -1
- package/package.json +5 -5
package/build/main.mjs
CHANGED
|
@@ -127,7 +127,7 @@ import { useDynamicFlow } from "@wise/dynamic-flow-client";
|
|
|
127
127
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
128
128
|
var appVersion = (
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
130
|
-
typeof process !== "undefined" ? "5.
|
|
130
|
+
typeof process !== "undefined" ? "5.25.0" : "0.0.0"
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -191,7 +191,7 @@ var useDFContextMenu = (controller) => {
|
|
|
191
191
|
if (!step) {
|
|
192
192
|
return null;
|
|
193
193
|
}
|
|
194
|
-
const model =
|
|
194
|
+
const model = controller.getValue();
|
|
195
195
|
return recursivelyRemoveNullish(__spreadProps(__spreadValues({}, step), { model }));
|
|
196
196
|
};
|
|
197
197
|
const getEncodedCurrentStep = () => {
|
|
@@ -316,183 +316,20 @@ import { useMemo as useMemo3 } from "react";
|
|
|
316
316
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
317
317
|
import { getDynamicSubflowRenderer } from "@wise/dynamic-flow-client";
|
|
318
318
|
|
|
319
|
-
// ../renderers/src/AlertRenderer.tsx
|
|
320
|
-
import {
|
|
321
|
-
|
|
322
|
-
// ../renderers/src/utils/layout-utils.ts
|
|
323
|
-
var getMargin = (size) => {
|
|
324
|
-
switch (size) {
|
|
325
|
-
case "xs":
|
|
326
|
-
return "m-b-0";
|
|
327
|
-
case "sm":
|
|
328
|
-
return "m-b-1";
|
|
329
|
-
case "md":
|
|
330
|
-
return "m-b-2";
|
|
331
|
-
case "lg":
|
|
332
|
-
return "m-b-3";
|
|
333
|
-
case "xl":
|
|
334
|
-
return "m-b-5";
|
|
335
|
-
default:
|
|
336
|
-
return "";
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
var getTextAlignment = (align) => {
|
|
340
|
-
switch (align) {
|
|
341
|
-
case "end":
|
|
342
|
-
return "text-xs-right";
|
|
343
|
-
case "center":
|
|
344
|
-
return "text-xs-center";
|
|
345
|
-
case "start":
|
|
346
|
-
default:
|
|
347
|
-
return "";
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
351
|
-
|
|
352
|
-
// ../renderers/src/AlertRenderer.tsx
|
|
353
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
354
|
-
var AlertRenderer = {
|
|
355
|
-
canRenderType: "alert",
|
|
356
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ jsx2(
|
|
357
|
-
Alert,
|
|
358
|
-
{
|
|
359
|
-
type: context,
|
|
360
|
-
className: getMargin(margin),
|
|
361
|
-
message: markdown,
|
|
362
|
-
action: mapCtaToAlertAction(callToAction)
|
|
363
|
-
}
|
|
364
|
-
)
|
|
365
|
-
};
|
|
366
|
-
var mapCtaToAlertAction = (callToAction) => {
|
|
367
|
-
if (callToAction) {
|
|
368
|
-
return __spreadValues({
|
|
369
|
-
text: callToAction.title,
|
|
370
|
-
"aria-label": callToAction.accessibilityDescription
|
|
371
|
-
}, callToAction.getAnchorProps());
|
|
372
|
-
}
|
|
373
|
-
return void 0;
|
|
374
|
-
};
|
|
375
|
-
var AlertRenderer_default = AlertRenderer;
|
|
376
|
-
|
|
377
|
-
// ../renderers/src/BoxRenderer.tsx
|
|
378
|
-
var import_classnames = __toESM(require_classnames());
|
|
379
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
380
|
-
var BoxRenderer = {
|
|
381
|
-
canRenderType: "box",
|
|
382
|
-
render: ({ children, control, margin, width }) => {
|
|
383
|
-
const hasFixedWidth = width !== "xl";
|
|
384
|
-
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
385
|
-
const contents = /* @__PURE__ */ jsx3(
|
|
386
|
-
"div",
|
|
387
|
-
{
|
|
388
|
-
className: (0, import_classnames.default)("df-box-renderer", {
|
|
389
|
-
"df-box-renderer-border": hasBorder,
|
|
390
|
-
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
391
|
-
[getMargin(margin)]: !hasFixedWidth
|
|
392
|
-
}),
|
|
393
|
-
children
|
|
394
|
-
}
|
|
395
|
-
);
|
|
396
|
-
return hasFixedWidth ? /* @__PURE__ */ jsx3("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
var BoxRenderer_default = BoxRenderer;
|
|
319
|
+
// ../renderers/src/AlertRenderer/AlertRenderer.tsx
|
|
320
|
+
import { useState as useState2 } from "react";
|
|
400
321
|
|
|
401
|
-
// ../renderers/src/
|
|
402
|
-
import {
|
|
403
|
-
import { useIntl } from "react-intl";
|
|
404
|
-
|
|
405
|
-
// ../renderers/src/messages/loading-button.messages.ts
|
|
406
|
-
import { defineMessages } from "react-intl";
|
|
407
|
-
var loading_button_messages_default = defineMessages({
|
|
408
|
-
buttonLoadingMessage: {
|
|
409
|
-
id: "df.wise.ButtonLayout.buttonLoadingMessage",
|
|
410
|
-
defaultMessage: "This might take a few seconds",
|
|
411
|
-
description: "Message displayed below a button when it is in a loading state."
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
416
|
-
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
417
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
418
|
-
var AddressValidationButtonRenderer = {
|
|
419
|
-
canRenderType: "button",
|
|
420
|
-
canRender: ({ control }) => control === "address-validation",
|
|
421
|
-
render: AddressValidationButtonComponent
|
|
422
|
-
};
|
|
423
|
-
function AddressValidationButtonComponent(props) {
|
|
424
|
-
const { disabled, margin, title, stepLoadingState, onClick } = props;
|
|
425
|
-
const { formatMessage } = useIntl();
|
|
426
|
-
const [spinny, setSpinny] = useState2(false);
|
|
427
|
-
useEffect2(() => {
|
|
428
|
-
if (stepLoadingState === "idle") {
|
|
429
|
-
setSpinny(false);
|
|
430
|
-
}
|
|
431
|
-
}, [stepLoadingState]);
|
|
432
|
-
const onBlur = () => {
|
|
433
|
-
if (stepLoadingState === "idle") {
|
|
434
|
-
setSpinny(false);
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
return /* @__PURE__ */ jsxs2("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
438
|
-
/* @__PURE__ */ jsx4(
|
|
439
|
-
Button,
|
|
440
|
-
{
|
|
441
|
-
v2: true,
|
|
442
|
-
block: true,
|
|
443
|
-
disabled,
|
|
444
|
-
priority: "primary",
|
|
445
|
-
size: "lg",
|
|
446
|
-
loading: spinny,
|
|
447
|
-
onClick: () => {
|
|
448
|
-
setSpinny(true);
|
|
449
|
-
onClick();
|
|
450
|
-
},
|
|
451
|
-
onBlur,
|
|
452
|
-
children: title
|
|
453
|
-
}
|
|
454
|
-
),
|
|
455
|
-
spinny && /* @__PURE__ */ jsx4(InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
456
|
-
] });
|
|
457
|
-
}
|
|
458
|
-
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
459
|
-
|
|
460
|
-
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
461
|
-
import { Button as Button2 } from "@transferwise/components";
|
|
462
|
-
|
|
463
|
-
// ../renderers/src/utils/isButtonPriority.ts
|
|
464
|
-
var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
|
|
465
|
-
var isButtonPriority = (control) => validPriorities.includes(control);
|
|
466
|
-
|
|
467
|
-
// ../renderers/src/ButtonRenderer/mapLegacyButtonSize.tsx
|
|
468
|
-
var mapLegacyButtonSize = (size) => {
|
|
469
|
-
if (!size) {
|
|
470
|
-
return void 0;
|
|
471
|
-
}
|
|
472
|
-
switch (size) {
|
|
473
|
-
case "xs":
|
|
474
|
-
case "sm":
|
|
475
|
-
return "sm";
|
|
476
|
-
case "lg":
|
|
477
|
-
case "xl":
|
|
478
|
-
return "lg";
|
|
479
|
-
case "md":
|
|
480
|
-
default:
|
|
481
|
-
return "md";
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
486
|
-
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
322
|
+
// ../renderers/src/AlertRenderer/ActionPromptComponent.tsx
|
|
323
|
+
import { ActionPrompt } from "@transferwise/components";
|
|
487
324
|
|
|
488
325
|
// ../renderers/src/utils/UrnFlag.tsx
|
|
489
326
|
import { Flag } from "@wise/art";
|
|
490
|
-
import { jsx as
|
|
327
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
491
328
|
var countryUrnPrefix = "urn:wise:countries:";
|
|
492
329
|
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
493
330
|
var isUrnFlag = (uri) => (uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix)) && uri.endsWith(":image");
|
|
494
331
|
function UrnFlag({ size, urn }) {
|
|
495
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ jsx2(Flag, { code: getCode(urn), intrinsicSize: size, className: "df-reserve-space" });
|
|
496
333
|
}
|
|
497
334
|
var getCode = (urn) => {
|
|
498
335
|
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
@@ -500,19 +337,19 @@ var getCode = (urn) => {
|
|
|
500
337
|
|
|
501
338
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
502
339
|
import { Flag as Flag2 } from "@wise/art";
|
|
503
|
-
import { jsx as
|
|
340
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
504
341
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
505
342
|
function FlagIcon({ name }) {
|
|
506
343
|
if (!isFlagIcon(name)) {
|
|
507
344
|
return null;
|
|
508
345
|
}
|
|
509
346
|
const code = name.substring(5);
|
|
510
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ jsx3(Flag2, { code, intrinsicSize: 24 });
|
|
511
348
|
}
|
|
512
349
|
|
|
513
350
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
514
351
|
import * as icons from "@transferwise/icons";
|
|
515
|
-
import { jsx as
|
|
352
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
516
353
|
var isNamedIcon = (name) => {
|
|
517
354
|
const iconName = toCapitalisedCamelCase(name);
|
|
518
355
|
return Object.keys(icons).includes(iconName);
|
|
@@ -523,19 +360,19 @@ function NamedIcon({ name }) {
|
|
|
523
360
|
}
|
|
524
361
|
const iconName = toCapitalisedCamelCase(name);
|
|
525
362
|
const Icon = icons[iconName];
|
|
526
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ jsx4(Icon, { size: 24 });
|
|
527
364
|
}
|
|
528
365
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
529
366
|
var capitaliseFirstChar = (value) => value.length === 0 ? "" : `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
530
367
|
|
|
531
368
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
532
|
-
import { jsx as
|
|
369
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
533
370
|
function DynamicIcon({ name }) {
|
|
534
371
|
if (isFlagIcon(name)) {
|
|
535
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ jsx5(FlagIcon, { name });
|
|
536
373
|
}
|
|
537
374
|
if (isNamedIcon(name)) {
|
|
538
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ jsx5(NamedIcon, { name });
|
|
539
376
|
}
|
|
540
377
|
return null;
|
|
541
378
|
}
|
|
@@ -567,11 +404,11 @@ var stringToURN = (uri) => {
|
|
|
567
404
|
};
|
|
568
405
|
|
|
569
406
|
// ../renderers/src/components/Media/resolveMediaFromUri.tsx
|
|
570
|
-
import { jsx as
|
|
571
|
-
var resolveMediaFromUri = (uri, size) => {
|
|
407
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
408
|
+
var resolveMediaFromUri = (uri, size, accessibilityDescription) => {
|
|
572
409
|
const { name, qComponents } = stringToURN(uri);
|
|
573
410
|
if (isValidIconUrn(name)) {
|
|
574
|
-
const icon = /* @__PURE__ */
|
|
411
|
+
const icon = /* @__PURE__ */ jsx6(DynamicIcon_default, { name: name.replace("urn:wise:icons:", "") });
|
|
575
412
|
return {
|
|
576
413
|
icon,
|
|
577
414
|
color: formatColor(qComponents["foreground-color"]),
|
|
@@ -580,7 +417,14 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
580
417
|
}
|
|
581
418
|
if (isUrnFlag(name)) {
|
|
582
419
|
return {
|
|
583
|
-
asset: /* @__PURE__ */
|
|
420
|
+
asset: /* @__PURE__ */ jsx6(
|
|
421
|
+
UrnFlag,
|
|
422
|
+
{
|
|
423
|
+
urn: name,
|
|
424
|
+
size,
|
|
425
|
+
accessibilityDescription
|
|
426
|
+
}
|
|
427
|
+
)
|
|
584
428
|
};
|
|
585
429
|
}
|
|
586
430
|
if (name.startsWith("data:text/plain,")) {
|
|
@@ -592,7 +436,9 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
592
436
|
};
|
|
593
437
|
}
|
|
594
438
|
if (!uri.startsWith("urn:")) {
|
|
595
|
-
return {
|
|
439
|
+
return {
|
|
440
|
+
asset: /* @__PURE__ */ jsx6("img", { src: uri, alt: accessibilityDescription != null ? accessibilityDescription : "", width: `${size}px` })
|
|
441
|
+
};
|
|
596
442
|
}
|
|
597
443
|
return { asset: void 0 };
|
|
598
444
|
};
|
|
@@ -608,7 +454,7 @@ var formatColor = (color) => {
|
|
|
608
454
|
|
|
609
455
|
// ../renderers/src/components/Media/AvatarMedia.tsx
|
|
610
456
|
import { AvatarLayout, AvatarView } from "@transferwise/components";
|
|
611
|
-
import { jsx as
|
|
457
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
612
458
|
var AvatarMedia = ({
|
|
613
459
|
accessibilityDescription,
|
|
614
460
|
content,
|
|
@@ -631,7 +477,7 @@ var AvatarMedia = ({
|
|
|
631
477
|
if (!asset && !icon) {
|
|
632
478
|
return null;
|
|
633
479
|
}
|
|
634
|
-
return /* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ jsx7(
|
|
635
481
|
AvatarView,
|
|
636
482
|
{
|
|
637
483
|
"aria-label": accessibilityDescription,
|
|
@@ -646,7 +492,7 @@ var AvatarMedia = ({
|
|
|
646
492
|
asset: icon != null ? icon : asset,
|
|
647
493
|
style: { backgroundColor, color }
|
|
648
494
|
}));
|
|
649
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ jsx7(
|
|
650
496
|
AvatarLayout,
|
|
651
497
|
{
|
|
652
498
|
"aria-label": accessibilityDescription,
|
|
@@ -665,7 +511,7 @@ var getBadge = ({
|
|
|
665
511
|
}) => {
|
|
666
512
|
if (backgroundColor || color) {
|
|
667
513
|
return {
|
|
668
|
-
asset: /* @__PURE__ */
|
|
514
|
+
asset: /* @__PURE__ */ jsx7(
|
|
669
515
|
"div",
|
|
670
516
|
{
|
|
671
517
|
className: "d-flex align-items-center justify-content-center",
|
|
@@ -688,11 +534,11 @@ var getBadge = ({
|
|
|
688
534
|
|
|
689
535
|
// ../renderers/src/utils/image-utils.tsx
|
|
690
536
|
import { AvatarView as AvatarView2 } from "@transferwise/components";
|
|
691
|
-
import { jsx as
|
|
537
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
692
538
|
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
693
539
|
if (iconNode && imageNode) {
|
|
694
540
|
if (imageNode && iconNode) {
|
|
695
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ jsx8(AvatarView2, { size, badge: { asset: iconNode, type: "reference" }, children: imageNode });
|
|
696
542
|
}
|
|
697
543
|
}
|
|
698
544
|
return null;
|
|
@@ -700,7 +546,7 @@ var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
|
700
546
|
var getIconNode = (icon) => {
|
|
701
547
|
if (icon) {
|
|
702
548
|
if ("name" in icon) {
|
|
703
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ jsx8(DynamicIcon_default, { name: icon.name });
|
|
704
550
|
}
|
|
705
551
|
if (icon.text) {
|
|
706
552
|
return icon.text;
|
|
@@ -712,10 +558,10 @@ var getImageNode = (image, size) => {
|
|
|
712
558
|
if (image) {
|
|
713
559
|
const { accessibilityDescription, uri } = image;
|
|
714
560
|
if (!uri.startsWith("urn:")) {
|
|
715
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ jsx8("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
716
562
|
}
|
|
717
563
|
if (isUrnFlag(uri)) {
|
|
718
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ jsx8(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
719
565
|
}
|
|
720
566
|
}
|
|
721
567
|
return null;
|
|
@@ -723,57 +569,338 @@ var getImageNode = (image, size) => {
|
|
|
723
569
|
|
|
724
570
|
// ../renderers/src/components/Media/LegacyMedia.tsx
|
|
725
571
|
import { AvatarView as AvatarView3 } from "@transferwise/components";
|
|
726
|
-
import { Fragment, jsx as
|
|
572
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
727
573
|
var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
728
574
|
const imageNode = getImageNode(image, size);
|
|
729
575
|
const iconNode = getIconNode(icon);
|
|
730
576
|
const badge = getBadgedMedia(iconNode, imageNode, size);
|
|
731
577
|
if (badge) {
|
|
732
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx9(Fragment, { children: badge });
|
|
733
579
|
}
|
|
734
580
|
if (imageNode) {
|
|
735
|
-
return preferAvatar ? /* @__PURE__ */
|
|
581
|
+
return preferAvatar ? /* @__PURE__ */ jsx9(AvatarView3, { children: imageNode }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
736
582
|
imageNode,
|
|
737
583
|
" "
|
|
738
584
|
] });
|
|
739
585
|
}
|
|
740
586
|
if (iconNode && icon) {
|
|
741
587
|
if ("text" in icon || size === 48) {
|
|
742
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ jsx9(AvatarView3, { size, children: iconNode });
|
|
743
589
|
}
|
|
744
|
-
return /* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ jsx9(Fragment, { children: iconNode });
|
|
745
591
|
}
|
|
746
592
|
return null;
|
|
747
593
|
};
|
|
748
594
|
|
|
749
595
|
// ../renderers/src/components/Media/Media.tsx
|
|
750
|
-
import { jsx as
|
|
751
|
-
var Media = ({
|
|
596
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
597
|
+
var Media = ({
|
|
598
|
+
media,
|
|
599
|
+
preferAvatar = false,
|
|
600
|
+
size
|
|
601
|
+
}) => {
|
|
752
602
|
switch (media == null ? void 0 : media.type) {
|
|
753
603
|
case "avatar":
|
|
754
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ jsx10(AvatarMedia, __spreadProps(__spreadValues({}, media), { size }));
|
|
755
605
|
case "image": {
|
|
756
|
-
const { asset, icon } = resolveMediaFromUri(
|
|
606
|
+
const { asset, icon } = resolveMediaFromUri(
|
|
607
|
+
media.uri,
|
|
608
|
+
size,
|
|
609
|
+
media.accessibilityDescription
|
|
610
|
+
);
|
|
757
611
|
return icon != null ? icon : asset;
|
|
758
612
|
}
|
|
759
613
|
case "legacy": {
|
|
760
|
-
return /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ jsx10(LegacyMedia, __spreadProps(__spreadValues({}, media), { preferAvatar, size }));
|
|
761
615
|
}
|
|
762
616
|
default:
|
|
763
617
|
return null;
|
|
764
618
|
}
|
|
765
619
|
};
|
|
620
|
+
var isMediaIcon = (media) => (media == null ? void 0 : media.type) === "image" && isValidIconUrn(media.uri);
|
|
766
621
|
|
|
767
622
|
// ../renderers/src/components/Media/OptionMedia.tsx
|
|
768
|
-
import { jsx as
|
|
623
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
769
624
|
var mediaSize = 48;
|
|
770
625
|
function OptionMedia(props) {
|
|
771
|
-
return /* @__PURE__ */
|
|
626
|
+
return /* @__PURE__ */ jsx11(Media, __spreadProps(__spreadValues({}, props), { size: mediaSize }));
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// ../renderers/src/components/Media/getInlineMedia.tsx
|
|
630
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
631
|
+
var getInlineMedia = (media) => media ? /* @__PURE__ */ jsx12(Media, { media, preferAvatar: false, size: 24 }) : null;
|
|
632
|
+
|
|
633
|
+
// ../renderers/src/components/Media/getPromptMedia.tsx
|
|
634
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
635
|
+
var getPromptMedia = (media) => {
|
|
636
|
+
if (!media || media.type === "legacy") {
|
|
637
|
+
return void 0;
|
|
638
|
+
}
|
|
639
|
+
if (media.type === "image" && !media.uri.startsWith("urn:")) {
|
|
640
|
+
return {
|
|
641
|
+
imgSrc: media.uri,
|
|
642
|
+
"aria-label": media.accessibilityDescription
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
const _a = media, { accessibilityDescription: ariaLabel } = _a, sansAriaLabel = __objRest(_a, ["accessibilityDescription"]);
|
|
646
|
+
return {
|
|
647
|
+
avatar: {
|
|
648
|
+
asset: /* @__PURE__ */ jsx13(Media, { media: sansAriaLabel, size: 48 })
|
|
649
|
+
},
|
|
650
|
+
"aria-label": ariaLabel
|
|
651
|
+
};
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
// ../renderers/src/utils/layout-utils.ts
|
|
655
|
+
var getMargin = (size) => {
|
|
656
|
+
switch (size) {
|
|
657
|
+
case "xs":
|
|
658
|
+
return "m-b-0";
|
|
659
|
+
case "sm":
|
|
660
|
+
return "m-b-1";
|
|
661
|
+
case "md":
|
|
662
|
+
return "m-b-2";
|
|
663
|
+
case "lg":
|
|
664
|
+
return "m-b-3";
|
|
665
|
+
case "xl":
|
|
666
|
+
return "m-b-5";
|
|
667
|
+
default:
|
|
668
|
+
return "";
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
var getTextAlignment = (align) => {
|
|
672
|
+
switch (align) {
|
|
673
|
+
case "end":
|
|
674
|
+
return "text-xs-right";
|
|
675
|
+
case "center":
|
|
676
|
+
return "text-xs-center";
|
|
677
|
+
case "start":
|
|
678
|
+
default:
|
|
679
|
+
return "";
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
683
|
+
|
|
684
|
+
// ../renderers/src/AlertRenderer/mappers.tsx
|
|
685
|
+
import {
|
|
686
|
+
Markdown,
|
|
687
|
+
MarkdownNodeType
|
|
688
|
+
} from "@transferwise/components";
|
|
689
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
690
|
+
var mapCallToAction = (callToAction) => __spreadValues({
|
|
691
|
+
label: callToAction.title,
|
|
692
|
+
"aria-label": callToAction.accessibilityDescription
|
|
693
|
+
}, callToAction.getAnchorProps());
|
|
694
|
+
var promptMarkdownAllowList = [
|
|
695
|
+
MarkdownNodeType.EMPH,
|
|
696
|
+
MarkdownNodeType.PARAGRAPH,
|
|
697
|
+
MarkdownNodeType.STRONG
|
|
698
|
+
];
|
|
699
|
+
var mapPromptDescription = (markdown) => /* @__PURE__ */ jsx14(
|
|
700
|
+
Markdown,
|
|
701
|
+
{
|
|
702
|
+
as: "span",
|
|
703
|
+
config: {
|
|
704
|
+
paragraph: { className: "df-alert-markdown" }
|
|
705
|
+
},
|
|
706
|
+
allowList: promptMarkdownAllowList,
|
|
707
|
+
children: markdown
|
|
708
|
+
}
|
|
709
|
+
);
|
|
710
|
+
var mapPromptSentiment = (context) => context === "positive" ? "success" : context;
|
|
711
|
+
|
|
712
|
+
// ../renderers/src/AlertRenderer/ActionPromptComponent.tsx
|
|
713
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
714
|
+
function ActionPromptComponent({
|
|
715
|
+
callToAction,
|
|
716
|
+
context,
|
|
717
|
+
margin,
|
|
718
|
+
markdown,
|
|
719
|
+
media,
|
|
720
|
+
onDismiss,
|
|
721
|
+
secondaryCallToAction,
|
|
722
|
+
title
|
|
723
|
+
}) {
|
|
724
|
+
return /* @__PURE__ */ jsx15(
|
|
725
|
+
ActionPrompt,
|
|
726
|
+
{
|
|
727
|
+
title: title != null ? title : "",
|
|
728
|
+
description: mapPromptDescription(markdown),
|
|
729
|
+
sentiment: mapPromptSentiment(context),
|
|
730
|
+
className: getMargin(margin),
|
|
731
|
+
media: getPromptMedia(media),
|
|
732
|
+
action: mapCallToAction(callToAction),
|
|
733
|
+
actionSecondary: secondaryCallToAction ? mapCallToAction(secondaryCallToAction) : void 0,
|
|
734
|
+
onDismiss
|
|
735
|
+
}
|
|
736
|
+
);
|
|
772
737
|
}
|
|
773
738
|
|
|
774
|
-
// ../renderers/src/
|
|
775
|
-
import {
|
|
776
|
-
|
|
739
|
+
// ../renderers/src/AlertRenderer/InfoPromptComponent.tsx
|
|
740
|
+
import { InfoPrompt } from "@transferwise/components";
|
|
741
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
742
|
+
function InfoPromptComponent({
|
|
743
|
+
callToAction,
|
|
744
|
+
context,
|
|
745
|
+
margin,
|
|
746
|
+
markdown,
|
|
747
|
+
media,
|
|
748
|
+
onDismiss,
|
|
749
|
+
title
|
|
750
|
+
}) {
|
|
751
|
+
return /* @__PURE__ */ jsx16(
|
|
752
|
+
InfoPrompt,
|
|
753
|
+
{
|
|
754
|
+
title,
|
|
755
|
+
description: mapPromptDescription(markdown),
|
|
756
|
+
sentiment: mapPromptSentiment(context),
|
|
757
|
+
className: getMargin(margin),
|
|
758
|
+
media: isMediaIcon(media) ? { asset: getInlineMedia(media) } : void 0,
|
|
759
|
+
action: callToAction ? mapCallToAction(callToAction) : void 0,
|
|
760
|
+
onDismiss
|
|
761
|
+
}
|
|
762
|
+
);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// ../renderers/src/AlertRenderer/AlertRenderer.tsx
|
|
766
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
767
|
+
var AlertRenderer = {
|
|
768
|
+
canRenderType: "alert",
|
|
769
|
+
render: AlertRendererComponent
|
|
770
|
+
};
|
|
771
|
+
function AlertRendererComponent(props) {
|
|
772
|
+
const [isVisible, setIsVisible] = useState2(true);
|
|
773
|
+
const { onDismiss: dismiss } = props;
|
|
774
|
+
if (!isVisible) {
|
|
775
|
+
return null;
|
|
776
|
+
}
|
|
777
|
+
const onDismiss = dismiss ? () => {
|
|
778
|
+
setIsVisible(false);
|
|
779
|
+
dismiss();
|
|
780
|
+
} : void 0;
|
|
781
|
+
if (shouldRenderActionPrompt(props)) {
|
|
782
|
+
return /* @__PURE__ */ jsx17(ActionPromptComponent, __spreadProps(__spreadValues({}, props), { onDismiss }));
|
|
783
|
+
}
|
|
784
|
+
return /* @__PURE__ */ jsx17(InfoPromptComponent, __spreadProps(__spreadValues({}, props), { onDismiss }));
|
|
785
|
+
}
|
|
786
|
+
var shouldRenderActionPrompt = (props) => {
|
|
787
|
+
var _a, _b;
|
|
788
|
+
return Boolean(
|
|
789
|
+
props.callToAction && ((_b = props.secondaryCallToAction) != null ? _b : (_a = props.tags) == null ? void 0 : _a.includes("prefers-action-prompt"))
|
|
790
|
+
);
|
|
791
|
+
};
|
|
792
|
+
var AlertRenderer_default = AlertRenderer;
|
|
793
|
+
|
|
794
|
+
// ../renderers/src/BoxRenderer.tsx
|
|
795
|
+
var import_classnames = __toESM(require_classnames());
|
|
796
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
797
|
+
var BoxRenderer = {
|
|
798
|
+
canRenderType: "box",
|
|
799
|
+
render: ({ children, control, margin, width }) => {
|
|
800
|
+
const hasFixedWidth = width !== "xl";
|
|
801
|
+
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
802
|
+
const contents = /* @__PURE__ */ jsx18(
|
|
803
|
+
"div",
|
|
804
|
+
{
|
|
805
|
+
className: (0, import_classnames.default)("df-box-renderer", {
|
|
806
|
+
"df-box-renderer-border": hasBorder,
|
|
807
|
+
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
808
|
+
[getMargin(margin)]: !hasFixedWidth
|
|
809
|
+
}),
|
|
810
|
+
children
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
return hasFixedWidth ? /* @__PURE__ */ jsx18("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
var BoxRenderer_default = BoxRenderer;
|
|
817
|
+
|
|
818
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
819
|
+
import { Button, InlineAlert } from "@transferwise/components";
|
|
820
|
+
import { useIntl } from "react-intl";
|
|
821
|
+
|
|
822
|
+
// ../renderers/src/messages/loading-button.messages.ts
|
|
823
|
+
import { defineMessages } from "react-intl";
|
|
824
|
+
var loading_button_messages_default = defineMessages({
|
|
825
|
+
buttonLoadingMessage: {
|
|
826
|
+
id: "df.wise.ButtonLayout.buttonLoadingMessage",
|
|
827
|
+
defaultMessage: "This might take a few seconds",
|
|
828
|
+
description: "Message displayed below a button when it is in a loading state."
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
|
|
832
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
833
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
834
|
+
import { jsx as jsx19, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
835
|
+
var AddressValidationButtonRenderer = {
|
|
836
|
+
canRenderType: "button",
|
|
837
|
+
canRender: ({ control }) => control === "address-validation",
|
|
838
|
+
render: AddressValidationButtonComponent
|
|
839
|
+
};
|
|
840
|
+
function AddressValidationButtonComponent(props) {
|
|
841
|
+
const { disabled, margin, title, stepLoadingState, onClick } = props;
|
|
842
|
+
const { formatMessage } = useIntl();
|
|
843
|
+
const [spinny, setSpinny] = useState3(false);
|
|
844
|
+
useEffect2(() => {
|
|
845
|
+
if (stepLoadingState === "idle") {
|
|
846
|
+
setSpinny(false);
|
|
847
|
+
}
|
|
848
|
+
}, [stepLoadingState]);
|
|
849
|
+
const onBlur = () => {
|
|
850
|
+
if (stepLoadingState === "idle") {
|
|
851
|
+
setSpinny(false);
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
return /* @__PURE__ */ jsxs3("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
855
|
+
/* @__PURE__ */ jsx19(
|
|
856
|
+
Button,
|
|
857
|
+
{
|
|
858
|
+
v2: true,
|
|
859
|
+
block: true,
|
|
860
|
+
disabled,
|
|
861
|
+
priority: "primary",
|
|
862
|
+
size: "lg",
|
|
863
|
+
loading: spinny,
|
|
864
|
+
onClick: () => {
|
|
865
|
+
setSpinny(true);
|
|
866
|
+
onClick();
|
|
867
|
+
},
|
|
868
|
+
onBlur,
|
|
869
|
+
children: title
|
|
870
|
+
}
|
|
871
|
+
),
|
|
872
|
+
spinny && /* @__PURE__ */ jsx19(InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
873
|
+
] });
|
|
874
|
+
}
|
|
875
|
+
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
876
|
+
|
|
877
|
+
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
878
|
+
import { Button as Button2 } from "@transferwise/components";
|
|
879
|
+
|
|
880
|
+
// ../renderers/src/utils/isButtonPriority.ts
|
|
881
|
+
var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
|
|
882
|
+
var isButtonPriority = (control) => validPriorities.includes(control);
|
|
883
|
+
|
|
884
|
+
// ../renderers/src/ButtonRenderer/mapLegacyButtonSize.tsx
|
|
885
|
+
var mapLegacyButtonSize = (size) => {
|
|
886
|
+
if (!size) {
|
|
887
|
+
return void 0;
|
|
888
|
+
}
|
|
889
|
+
switch (size) {
|
|
890
|
+
case "xs":
|
|
891
|
+
case "sm":
|
|
892
|
+
return "sm";
|
|
893
|
+
case "lg":
|
|
894
|
+
case "xl":
|
|
895
|
+
return "lg";
|
|
896
|
+
case "md":
|
|
897
|
+
default:
|
|
898
|
+
return "md";
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
903
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
777
904
|
|
|
778
905
|
// ../renderers/src/components/Media/getAddonStartMedia.ts
|
|
779
906
|
var getAddonStartMedia = (media) => {
|
|
@@ -794,7 +921,7 @@ var getAddonStartMedia = (media) => {
|
|
|
794
921
|
|
|
795
922
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
796
923
|
var import_classnames2 = __toESM(require_classnames());
|
|
797
|
-
import { jsx as
|
|
924
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
798
925
|
var ButtonRenderer = {
|
|
799
926
|
canRenderType: "button",
|
|
800
927
|
render: ButtonComponent
|
|
@@ -812,7 +939,7 @@ function ButtonComponent(props) {
|
|
|
812
939
|
stepLoadingState,
|
|
813
940
|
onClick
|
|
814
941
|
} = props;
|
|
815
|
-
const [spinny, setSpinny] =
|
|
942
|
+
const [spinny, setSpinny] = useState4(false);
|
|
816
943
|
useEffect3(() => {
|
|
817
944
|
if (stepLoadingState === "idle") {
|
|
818
945
|
setSpinny(false);
|
|
@@ -843,7 +970,7 @@ function ButtonComponent(props) {
|
|
|
843
970
|
onClick();
|
|
844
971
|
}
|
|
845
972
|
};
|
|
846
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsx20(Button2, __spreadProps(__spreadValues({}, buttonProps), { children: title }));
|
|
847
974
|
}
|
|
848
975
|
var getSentiment = (context) => context === "negative" ? "negative" : "default";
|
|
849
976
|
var getPriority = (control, tags) => {
|
|
@@ -883,7 +1010,7 @@ var scrollToIfNotVisible = (ref) => {
|
|
|
883
1010
|
};
|
|
884
1011
|
|
|
885
1012
|
// ../renderers/src/components/Help.tsx
|
|
886
|
-
import { Info, Markdown } from "@transferwise/components";
|
|
1013
|
+
import { Info, Markdown as Markdown2 } from "@transferwise/components";
|
|
887
1014
|
import { useIntl as useIntl2 } from "react-intl";
|
|
888
1015
|
|
|
889
1016
|
// ../renderers/src/messages/help.messages.ts
|
|
@@ -897,13 +1024,13 @@ var help_messages_default = defineMessages2({
|
|
|
897
1024
|
});
|
|
898
1025
|
|
|
899
1026
|
// ../renderers/src/components/Help.tsx
|
|
900
|
-
import { jsx as
|
|
1027
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
901
1028
|
function Help({ help, onClick }) {
|
|
902
1029
|
const intl = useIntl2();
|
|
903
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ jsx21(
|
|
904
1031
|
Info,
|
|
905
1032
|
{
|
|
906
|
-
content: /* @__PURE__ */
|
|
1033
|
+
content: /* @__PURE__ */ jsx21(Markdown2, { config: { link: { target: "_blank" } }, children: help }),
|
|
907
1034
|
presentation: "POPOVER",
|
|
908
1035
|
size: "sm",
|
|
909
1036
|
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
@@ -914,16 +1041,16 @@ function Help({ help, onClick }) {
|
|
|
914
1041
|
var Help_default = Help;
|
|
915
1042
|
|
|
916
1043
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
917
|
-
import { jsx as
|
|
1044
|
+
import { jsx as jsx22, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
918
1045
|
function LabelContentWithHelp({ text, help }) {
|
|
919
1046
|
return /* @__PURE__ */ jsxs4("div", { children: [
|
|
920
1047
|
text,
|
|
921
|
-
/* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ jsx22(Help_default, { help })
|
|
922
1049
|
] });
|
|
923
1050
|
}
|
|
924
1051
|
|
|
925
1052
|
// ../renderers/src/components/FieldInput.tsx
|
|
926
|
-
import { jsx as
|
|
1053
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
927
1054
|
function FieldInput({
|
|
928
1055
|
id,
|
|
929
1056
|
children,
|
|
@@ -936,9 +1063,9 @@ function FieldInput({
|
|
|
936
1063
|
features
|
|
937
1064
|
}) {
|
|
938
1065
|
var _a;
|
|
939
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1066
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx23(LabelContentWithHelp, { text: label, help }) : label;
|
|
940
1067
|
const { ref } = useScrollToError(validation, features);
|
|
941
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ jsx23("div", { ref, children: /* @__PURE__ */ jsx23(
|
|
942
1069
|
Field,
|
|
943
1070
|
{
|
|
944
1071
|
id,
|
|
@@ -966,22 +1093,22 @@ var FieldInput_default = FieldInput;
|
|
|
966
1093
|
|
|
967
1094
|
// ../renderers/src/utils/listItem/getAdditionalText.tsx
|
|
968
1095
|
import { ListItem } from "@transferwise/components";
|
|
969
|
-
import { jsx as
|
|
1096
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
970
1097
|
var getAdditionalText = (additionalText) => {
|
|
971
1098
|
if (!additionalText) {
|
|
972
1099
|
return void 0;
|
|
973
1100
|
}
|
|
974
|
-
return /* @__PURE__ */
|
|
1101
|
+
return /* @__PURE__ */ jsx24(ListItem.AdditionalInfo, { children: additionalText });
|
|
975
1102
|
};
|
|
976
1103
|
|
|
977
1104
|
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
978
1105
|
import { ListItem as ListItem2 } from "@transferwise/components";
|
|
979
|
-
import { jsx as
|
|
980
|
-
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */
|
|
1106
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1107
|
+
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx25(ListItem2.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
981
1108
|
|
|
982
1109
|
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
983
|
-
import { jsx as
|
|
984
|
-
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */
|
|
1110
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1111
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ jsx26(OptionMedia, { media, preferAvatar }) : void 0;
|
|
985
1112
|
|
|
986
1113
|
// ../renderers/src/utils/listItem/getSupportingValues.ts
|
|
987
1114
|
var getSupportingValues = (supportingValues) => {
|
|
@@ -989,18 +1116,18 @@ var getSupportingValues = (supportingValues) => {
|
|
|
989
1116
|
};
|
|
990
1117
|
|
|
991
1118
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
992
|
-
import { jsx as
|
|
1119
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
993
1120
|
var CheckboxInputRenderer = {
|
|
994
1121
|
canRenderType: "input-checkbox",
|
|
995
1122
|
render: (props) => {
|
|
996
1123
|
switch (props.control) {
|
|
997
1124
|
case "switch-item":
|
|
998
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ jsx27(SwitchItemComponent, __spreadValues({}, props));
|
|
999
1126
|
case "checkbox-item":
|
|
1000
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */ jsx27(CheckboxItemComponent, __spreadValues({}, props));
|
|
1001
1128
|
case "checkbox":
|
|
1002
1129
|
default:
|
|
1003
|
-
return /* @__PURE__ */
|
|
1130
|
+
return /* @__PURE__ */ jsx27(CheckboxComponent, __spreadValues({}, props));
|
|
1004
1131
|
}
|
|
1005
1132
|
}
|
|
1006
1133
|
};
|
|
@@ -1025,7 +1152,7 @@ var CheckboxComponent = (props) => {
|
|
|
1025
1152
|
"value"
|
|
1026
1153
|
]);
|
|
1027
1154
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
1028
|
-
return /* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ jsx27(
|
|
1029
1156
|
FieldInput_default,
|
|
1030
1157
|
{
|
|
1031
1158
|
id,
|
|
@@ -1036,7 +1163,7 @@ var CheckboxComponent = (props) => {
|
|
|
1036
1163
|
inlineAlert: rest.inlineAlert,
|
|
1037
1164
|
loadingState: rest.fieldLoadingState,
|
|
1038
1165
|
features: rest.features,
|
|
1039
|
-
children: /* @__PURE__ */
|
|
1166
|
+
children: /* @__PURE__ */ jsx27(Checkbox, __spreadValues({ id }, checkboxProps))
|
|
1040
1167
|
}
|
|
1041
1168
|
);
|
|
1042
1169
|
};
|
|
@@ -1055,7 +1182,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1055
1182
|
onChange
|
|
1056
1183
|
} = props;
|
|
1057
1184
|
const { ref } = useScrollToError(validationState, features);
|
|
1058
|
-
return /* @__PURE__ */
|
|
1185
|
+
return /* @__PURE__ */ jsx27("div", { ref, children: /* @__PURE__ */ jsx27(
|
|
1059
1186
|
ListItem3,
|
|
1060
1187
|
__spreadValues({
|
|
1061
1188
|
title,
|
|
@@ -1064,7 +1191,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1064
1191
|
media: getMedia(media, false),
|
|
1065
1192
|
disabled,
|
|
1066
1193
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1067
|
-
control: /* @__PURE__ */
|
|
1194
|
+
control: /* @__PURE__ */ jsx27(ListItem3.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
1068
1195
|
}, getSupportingValues(supportingValues))
|
|
1069
1196
|
) });
|
|
1070
1197
|
};
|
|
@@ -1083,7 +1210,7 @@ var SwitchItemComponent = (props) => {
|
|
|
1083
1210
|
onChange
|
|
1084
1211
|
} = props;
|
|
1085
1212
|
const { ref } = useScrollToError(validationState, features);
|
|
1086
|
-
return /* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ jsx27("div", { ref, children: /* @__PURE__ */ jsx27(
|
|
1087
1214
|
ListItem3,
|
|
1088
1215
|
__spreadValues({
|
|
1089
1216
|
title,
|
|
@@ -1092,13 +1219,13 @@ var SwitchItemComponent = (props) => {
|
|
|
1092
1219
|
media: getMedia(media, false),
|
|
1093
1220
|
disabled,
|
|
1094
1221
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1095
|
-
control: /* @__PURE__ */
|
|
1222
|
+
control: /* @__PURE__ */ jsx27(ListItem3.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
1096
1223
|
}, getSupportingValues(supportingValues))
|
|
1097
1224
|
) });
|
|
1098
1225
|
};
|
|
1099
1226
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
1100
1227
|
if ((validationState == null ? void 0 : validationState.status) === "invalid") {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ jsx27(ListItem3.Prompt, { sentiment: "negative", children: validationState.message });
|
|
1102
1229
|
}
|
|
1103
1230
|
return getInlineAlert(inlineAlert);
|
|
1104
1231
|
};
|
|
@@ -2072,11 +2199,11 @@ function useWindowVirtualizer(options) {
|
|
|
2072
2199
|
|
|
2073
2200
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2074
2201
|
import { ProcessIndicator, Button as Button4 } from "@transferwise/components";
|
|
2075
|
-
import { useRef as useRef3, useEffect as useEffect7,
|
|
2202
|
+
import { useRef as useRef3, useEffect as useEffect7, useLayoutEffect as useLayoutEffect2 } from "react";
|
|
2076
2203
|
|
|
2077
2204
|
// ../renderers/src/step/StepFooter.tsx
|
|
2078
2205
|
import { Button as Button3 } from "@transferwise/components";
|
|
2079
|
-
import { useEffect as useEffect6, useRef as useRef2, useState as
|
|
2206
|
+
import { useEffect as useEffect6, useRef as useRef2, useState as useState6 } from "react";
|
|
2080
2207
|
import { useIntl as useIntl3 } from "react-intl";
|
|
2081
2208
|
|
|
2082
2209
|
// ../renderers/src/messages/step.messages.ts
|
|
@@ -2090,23 +2217,23 @@ var step_messages_default = defineMessages3({
|
|
|
2090
2217
|
});
|
|
2091
2218
|
|
|
2092
2219
|
// ../renderers/src/step/StepFooter.tsx
|
|
2093
|
-
import { Fragment as Fragment2, jsx as
|
|
2220
|
+
import { Fragment as Fragment2, jsx as jsx28, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2094
2221
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
2095
2222
|
var StepFooter = ({ footer, tags }) => {
|
|
2096
2223
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
2097
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ jsx28(FooterWithScrollButton, { footer });
|
|
2098
2225
|
}
|
|
2099
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ jsx28(DefaultFooter, { footer });
|
|
2100
2227
|
};
|
|
2101
2228
|
var DefaultFooter = ({ footer }) => {
|
|
2102
2229
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2103
|
-
return hasFooter ? /* @__PURE__ */
|
|
2230
|
+
return hasFooter ? /* @__PURE__ */ jsx28("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
2104
2231
|
};
|
|
2105
2232
|
var FooterWithScrollButton = ({ footer }) => {
|
|
2106
2233
|
const { formatMessage } = useIntl3();
|
|
2107
2234
|
const endOfLayoutRef = useRef2(null);
|
|
2108
2235
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
2109
|
-
const scrollButton = /* @__PURE__ */
|
|
2236
|
+
const scrollButton = /* @__PURE__ */ jsx28(
|
|
2110
2237
|
Button3,
|
|
2111
2238
|
{
|
|
2112
2239
|
className: "m-b-1",
|
|
@@ -2122,10 +2249,10 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
2122
2249
|
);
|
|
2123
2250
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
2124
2251
|
if (isElementVisible && !hasStepFooterContent) {
|
|
2125
|
-
return /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ jsx28("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
2126
2253
|
}
|
|
2127
2254
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
2128
|
-
/* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ jsx28("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
2129
2256
|
/* @__PURE__ */ jsxs5("div", { className: "df-step-fixed__footer", children: [
|
|
2130
2257
|
!isElementVisible && scrollButton,
|
|
2131
2258
|
footer
|
|
@@ -2133,7 +2260,7 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
2133
2260
|
] });
|
|
2134
2261
|
};
|
|
2135
2262
|
var useIsElementVisible = (elementRef) => {
|
|
2136
|
-
const [isVisible, setIsVisible] =
|
|
2263
|
+
const [isVisible, setIsVisible] = useState6(false);
|
|
2137
2264
|
useEffect6(() => {
|
|
2138
2265
|
const element = elementRef.current;
|
|
2139
2266
|
if (!element) return;
|
|
@@ -2147,41 +2274,35 @@ var useIsElementVisible = (elementRef) => {
|
|
|
2147
2274
|
};
|
|
2148
2275
|
|
|
2149
2276
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2150
|
-
import { jsx as
|
|
2277
|
+
import { jsx as jsx29, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2151
2278
|
var ContentComponent = (props) => {
|
|
2152
2279
|
const { state, status, SectionHeader, Item } = props;
|
|
2153
2280
|
const endOfContentRef = useRef3(null);
|
|
2154
2281
|
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
2155
2282
|
useEffect7(() => {
|
|
2156
2283
|
var _a;
|
|
2157
|
-
console.log("bottom visible", status);
|
|
2158
2284
|
if (isBottomVisible && status.type === "idle" && status.loadMore) {
|
|
2159
2285
|
(_a = status.loadMore) == null ? void 0 : _a.call(status);
|
|
2160
2286
|
}
|
|
2161
|
-
}, [isBottomVisible]);
|
|
2287
|
+
}, [isBottomVisible, status]);
|
|
2162
2288
|
const stateCount = state.sections.reduce(
|
|
2163
2289
|
(total, section) => section.items.length + total + (section.title ? 1 : 0),
|
|
2164
2290
|
0
|
|
2165
2291
|
);
|
|
2166
|
-
const items =
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
type: "item"
|
|
2181
|
-
}))
|
|
2182
|
-
];
|
|
2183
|
-
}, []);
|
|
2184
|
-
}, [stateCount]);
|
|
2292
|
+
const items = state.sections.flatMap((section) => [
|
|
2293
|
+
...section.title ? [
|
|
2294
|
+
{
|
|
2295
|
+
type: "header",
|
|
2296
|
+
title: section.title,
|
|
2297
|
+
items: section.items,
|
|
2298
|
+
id: section.id
|
|
2299
|
+
}
|
|
2300
|
+
] : [],
|
|
2301
|
+
...section.items.map((item) => ({
|
|
2302
|
+
item,
|
|
2303
|
+
type: "item"
|
|
2304
|
+
}))
|
|
2305
|
+
]);
|
|
2185
2306
|
const listRef = useRef3(null);
|
|
2186
2307
|
const listOffsetRef = useRef3(0);
|
|
2187
2308
|
useLayoutEffect2(() => {
|
|
@@ -2191,14 +2312,13 @@ var ContentComponent = (props) => {
|
|
|
2191
2312
|
const virtualizer = useWindowVirtualizer({
|
|
2192
2313
|
count: stateCount,
|
|
2193
2314
|
estimateSize: () => 120,
|
|
2194
|
-
// todo, we could be clever here. Is it worth it?
|
|
2195
2315
|
overscan: 10,
|
|
2316
|
+
// eslint-disable-next-line react-hooks/refs
|
|
2196
2317
|
scrollMargin: listOffsetRef.current
|
|
2197
2318
|
});
|
|
2198
|
-
const showState = status.type === "idle" || status.reason === "pagination";
|
|
2199
2319
|
return /* @__PURE__ */ jsxs6("div", { ref: listRef, children: [
|
|
2200
|
-
|
|
2201
|
-
|
|
2320
|
+
state.beforeSections,
|
|
2321
|
+
/* @__PURE__ */ jsx29(
|
|
2202
2322
|
"div",
|
|
2203
2323
|
{
|
|
2204
2324
|
style: {
|
|
@@ -2211,7 +2331,7 @@ var ContentComponent = (props) => {
|
|
|
2211
2331
|
if (!i) {
|
|
2212
2332
|
return null;
|
|
2213
2333
|
}
|
|
2214
|
-
return /* @__PURE__ */
|
|
2334
|
+
return /* @__PURE__ */ jsx29(
|
|
2215
2335
|
"div",
|
|
2216
2336
|
{
|
|
2217
2337
|
ref: virtualizer.measureElement,
|
|
@@ -2223,7 +2343,7 @@ var ContentComponent = (props) => {
|
|
|
2223
2343
|
width: "100%",
|
|
2224
2344
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
2225
2345
|
},
|
|
2226
|
-
children: i.type === "header" ? /* @__PURE__ */
|
|
2346
|
+
children: i.type === "header" ? /* @__PURE__ */ jsx29(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ jsx29(Item, __spreadValues({}, i.item))
|
|
2227
2347
|
},
|
|
2228
2348
|
item.key
|
|
2229
2349
|
);
|
|
@@ -2231,65 +2351,29 @@ var ContentComponent = (props) => {
|
|
|
2231
2351
|
}
|
|
2232
2352
|
),
|
|
2233
2353
|
/* @__PURE__ */ jsxs6("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: [
|
|
2234
|
-
status.type === "idle" && status.loadMore || status.type === "loading" ? /* @__PURE__ */
|
|
2235
|
-
status.type === "error" && status.reason === "pagination" ? /* @__PURE__ */
|
|
2354
|
+
status.type === "idle" && status.loadMore || status.type === "loading" && status.reason === "pagination" ? /* @__PURE__ */ jsx29(ProcessIndicator, { size: "xs" }) : null,
|
|
2355
|
+
status.type === "error" && status.reason === "pagination" ? /* @__PURE__ */ jsx29("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ jsx29(Button4, { v2: true, size: "sm", priority: "secondary-neutral", onClick: status.retry, children: "Load more" }) }) : null
|
|
2236
2356
|
] }),
|
|
2237
|
-
|
|
2357
|
+
state.afterSections
|
|
2238
2358
|
] });
|
|
2239
2359
|
};
|
|
2240
2360
|
|
|
2241
|
-
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2242
|
-
import { InputGroup, Input } from "@transferwise/components";
|
|
2243
|
-
import { Search } from "@transferwise/icons";
|
|
2244
|
-
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2245
|
-
var SearchComponent = ({ state, features }) => {
|
|
2246
|
-
const { search } = state;
|
|
2247
|
-
if (!search) {
|
|
2248
|
-
return;
|
|
2249
|
-
}
|
|
2250
|
-
return /* @__PURE__ */ jsx26(
|
|
2251
|
-
FieldInput_default,
|
|
2252
|
-
{
|
|
2253
|
-
id: "search",
|
|
2254
|
-
description: "",
|
|
2255
|
-
validation: void 0,
|
|
2256
|
-
help: "",
|
|
2257
|
-
label: search.title,
|
|
2258
|
-
features,
|
|
2259
|
-
children: /* @__PURE__ */ jsx26(InputGroup, { addonStart: { content: /* @__PURE__ */ jsx26(Search, { size: 24 }) }, children: /* @__PURE__ */ jsx26(
|
|
2260
|
-
Input,
|
|
2261
|
-
{
|
|
2262
|
-
id: "search",
|
|
2263
|
-
name: "search",
|
|
2264
|
-
shape: "pill",
|
|
2265
|
-
placeholder: search.hint,
|
|
2266
|
-
type: "text",
|
|
2267
|
-
value: search.query,
|
|
2268
|
-
onChange: ({ currentTarget: { value } }) => {
|
|
2269
|
-
search.onChange(value);
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
) })
|
|
2273
|
-
}
|
|
2274
|
-
);
|
|
2275
|
-
};
|
|
2276
|
-
|
|
2277
2361
|
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
2278
2362
|
import { Chips } from "@transferwise/components";
|
|
2279
|
-
import { jsx as
|
|
2363
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2280
2364
|
var FiltersComponent = ({ state }) => {
|
|
2281
2365
|
const { filters } = state;
|
|
2282
|
-
return filters.map((filter) => {
|
|
2366
|
+
return /* @__PURE__ */ jsx30("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
2283
2367
|
var _a;
|
|
2284
|
-
return /* @__PURE__ */
|
|
2285
|
-
});
|
|
2368
|
+
return /* @__PURE__ */ jsx30(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
2369
|
+
}) });
|
|
2286
2370
|
};
|
|
2287
2371
|
var FilterComponent = (filter) => {
|
|
2288
2372
|
const { multiSelect, options } = filter;
|
|
2289
2373
|
if (!options) {
|
|
2290
2374
|
return null;
|
|
2291
2375
|
}
|
|
2292
|
-
return /* @__PURE__ */
|
|
2376
|
+
return /* @__PURE__ */ jsx30(
|
|
2293
2377
|
Chips,
|
|
2294
2378
|
{
|
|
2295
2379
|
className: "m-b-1",
|
|
@@ -2319,7 +2403,7 @@ import { ListItem as ListItem6 } from "@transferwise/components";
|
|
|
2319
2403
|
|
|
2320
2404
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
2321
2405
|
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
2322
|
-
import { jsx as
|
|
2406
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2323
2407
|
var getAdditionalInfo = (additionalInfo) => {
|
|
2324
2408
|
var _a, _b;
|
|
2325
2409
|
if (!additionalInfo) {
|
|
@@ -2327,7 +2411,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
2327
2411
|
}
|
|
2328
2412
|
const { href, text, onClick } = additionalInfo;
|
|
2329
2413
|
if (href || onClick) {
|
|
2330
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ jsx31(
|
|
2331
2415
|
ListItem4.AdditionalInfo,
|
|
2332
2416
|
{
|
|
2333
2417
|
action: __spreadValues({
|
|
@@ -2336,19 +2420,19 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
2336
2420
|
}
|
|
2337
2421
|
);
|
|
2338
2422
|
}
|
|
2339
|
-
return /* @__PURE__ */
|
|
2423
|
+
return /* @__PURE__ */ jsx31(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
2340
2424
|
};
|
|
2341
2425
|
|
|
2342
2426
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
2343
2427
|
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
2344
|
-
import { jsx as
|
|
2428
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2345
2429
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2346
2430
|
if (!callToAction) {
|
|
2347
2431
|
return void 0;
|
|
2348
2432
|
}
|
|
2349
2433
|
const { accessibilityDescription, title, context } = callToAction;
|
|
2350
2434
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2351
|
-
return /* @__PURE__ */
|
|
2435
|
+
return /* @__PURE__ */ jsx32(
|
|
2352
2436
|
ListItem5.Button,
|
|
2353
2437
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2354
2438
|
partiallyInteractive: !fullyInteractive,
|
|
@@ -2373,7 +2457,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
2373
2457
|
};
|
|
2374
2458
|
|
|
2375
2459
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2376
|
-
import { jsx as
|
|
2460
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2377
2461
|
var ItemComponent = (props) => {
|
|
2378
2462
|
var _a, _b;
|
|
2379
2463
|
const {
|
|
@@ -2394,7 +2478,7 @@ var ItemComponent = (props) => {
|
|
|
2394
2478
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
2395
2479
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2396
2480
|
};
|
|
2397
|
-
return /* @__PURE__ */
|
|
2481
|
+
return /* @__PURE__ */ jsx33(
|
|
2398
2482
|
ListItem6,
|
|
2399
2483
|
{
|
|
2400
2484
|
title,
|
|
@@ -2411,25 +2495,68 @@ var ItemComponent = (props) => {
|
|
|
2411
2495
|
};
|
|
2412
2496
|
var getNavigationControl = (onClick, href) => {
|
|
2413
2497
|
if (href) {
|
|
2414
|
-
return /* @__PURE__ */
|
|
2498
|
+
return /* @__PURE__ */ jsx33(ListItem6.Navigation, { href });
|
|
2415
2499
|
}
|
|
2416
2500
|
if (onClick) {
|
|
2417
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ jsx33(ListItem6.Navigation, { onClick });
|
|
2418
2502
|
}
|
|
2419
2503
|
return null;
|
|
2420
2504
|
};
|
|
2421
2505
|
|
|
2506
|
+
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2507
|
+
import { InputGroup, Input, ProcessIndicator as ProcessIndicator2 } from "@transferwise/components";
|
|
2508
|
+
import { Search } from "@transferwise/icons";
|
|
2509
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2510
|
+
var SearchComponent = ({ state, status, features }) => {
|
|
2511
|
+
const { search } = state;
|
|
2512
|
+
if (!search) {
|
|
2513
|
+
return;
|
|
2514
|
+
}
|
|
2515
|
+
return /* @__PURE__ */ jsx34(
|
|
2516
|
+
FieldInput_default,
|
|
2517
|
+
{
|
|
2518
|
+
id: "search",
|
|
2519
|
+
description: "",
|
|
2520
|
+
validation: void 0,
|
|
2521
|
+
help: "",
|
|
2522
|
+
label: search.title,
|
|
2523
|
+
features,
|
|
2524
|
+
children: /* @__PURE__ */ jsx34(
|
|
2525
|
+
InputGroup,
|
|
2526
|
+
{
|
|
2527
|
+
addonStart: { content: /* @__PURE__ */ jsx34(Search, { size: 24 }) },
|
|
2528
|
+
addonEnd: status.type === "loading" ? { content: /* @__PURE__ */ jsx34(ProcessIndicator2, { size: "xs" }) } : void 0,
|
|
2529
|
+
children: /* @__PURE__ */ jsx34(
|
|
2530
|
+
Input,
|
|
2531
|
+
{
|
|
2532
|
+
id: "search",
|
|
2533
|
+
name: "search",
|
|
2534
|
+
shape: "pill",
|
|
2535
|
+
placeholder: search.hint,
|
|
2536
|
+
type: "text",
|
|
2537
|
+
value: search.query,
|
|
2538
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
2539
|
+
search.onChange(value);
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
)
|
|
2543
|
+
}
|
|
2544
|
+
)
|
|
2545
|
+
}
|
|
2546
|
+
);
|
|
2547
|
+
};
|
|
2548
|
+
|
|
2422
2549
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
2423
|
-
import { jsx as
|
|
2550
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2424
2551
|
var SectionHeaderComponent = ({
|
|
2425
2552
|
title,
|
|
2426
2553
|
callToAction
|
|
2427
|
-
}) => /* @__PURE__ */
|
|
2554
|
+
}) => /* @__PURE__ */ jsx35(Header, { title, callToAction });
|
|
2428
2555
|
|
|
2429
2556
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
2430
|
-
import { jsx as
|
|
2557
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2431
2558
|
var createCollectionRenderer = (canRender, components) => {
|
|
2432
|
-
const
|
|
2559
|
+
const componentsWithDefaults = __spreadValues({
|
|
2433
2560
|
Search: SearchComponent,
|
|
2434
2561
|
Filters: FiltersComponent,
|
|
2435
2562
|
Filter: FilterComponent,
|
|
@@ -2441,44 +2568,37 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
2441
2568
|
canRenderType: "collection",
|
|
2442
2569
|
canRender,
|
|
2443
2570
|
render: (props) => {
|
|
2444
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx36(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
2445
2572
|
}
|
|
2446
2573
|
};
|
|
2447
2574
|
};
|
|
2448
2575
|
|
|
2449
2576
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
2450
|
-
import { Fragment as Fragment3, jsx as
|
|
2577
|
+
import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2451
2578
|
var CollectionRendererComponent = (props) => {
|
|
2452
2579
|
const { status, Search: Search4, Filters, Results } = props;
|
|
2453
2580
|
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
status.type === "idle" || status.type === "loading" ? /* @__PURE__ */
|
|
2581
|
+
/* @__PURE__ */ jsx37(Search4, __spreadValues({}, props)),
|
|
2582
|
+
/* @__PURE__ */ jsx37(Filters, __spreadValues({}, props)),
|
|
2583
|
+
status.type === "idle" || status.type === "loading" ? /* @__PURE__ */ jsx37(Results, __spreadValues({}, props)) : void 0,
|
|
2457
2584
|
status.type === "error" && status.reason === "search" && /* @__PURE__ */ jsxs7(InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
2458
2585
|
"Something went wrong,\xA0",
|
|
2459
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ jsx37(DSLink, { onClick: status.retry, children: "click here to retry" })
|
|
2460
2587
|
] })
|
|
2461
2588
|
] });
|
|
2462
2589
|
};
|
|
2463
|
-
var CollectionRenderer = createCollectionRenderer(() => true
|
|
2464
|
-
Search: (props) => /* @__PURE__ */ jsx33(SearchComponent, __spreadValues({}, props)),
|
|
2465
|
-
Filters: (props) => /* @__PURE__ */ jsx33(FiltersComponent, __spreadValues({}, props)),
|
|
2466
|
-
Filter: (props) => /* @__PURE__ */ jsx33(FilterComponent, __spreadValues({}, props)),
|
|
2467
|
-
Item: (props) => /* @__PURE__ */ jsx33(ItemComponent, __spreadValues({}, props)),
|
|
2468
|
-
SectionHeader: (props) => /* @__PURE__ */ jsx33(SectionHeaderComponent, __spreadValues({}, props)),
|
|
2469
|
-
Results: (props) => /* @__PURE__ */ jsx33(ContentComponent, __spreadValues({}, props))
|
|
2470
|
-
});
|
|
2590
|
+
var CollectionRenderer = createCollectionRenderer(() => true);
|
|
2471
2591
|
var CollectionRenderer_default = CollectionRenderer;
|
|
2472
2592
|
|
|
2473
2593
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2474
2594
|
var import_classnames3 = __toESM(require_classnames());
|
|
2475
2595
|
|
|
2476
2596
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
2477
|
-
import { useEffect as useEffect8, useState as
|
|
2597
|
+
import { useEffect as useEffect8, useState as useState7 } from "react";
|
|
2478
2598
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
2479
2599
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
2480
2600
|
var useIsCollapsed = () => {
|
|
2481
|
-
const [collapsed, setCollapsed] =
|
|
2601
|
+
const [collapsed, setCollapsed] = useState7(
|
|
2482
2602
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
2483
2603
|
);
|
|
2484
2604
|
useEffect8(() => {
|
|
@@ -2494,7 +2614,7 @@ var useIsCollapsed = () => {
|
|
|
2494
2614
|
};
|
|
2495
2615
|
|
|
2496
2616
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2497
|
-
import { jsx as
|
|
2617
|
+
import { jsx as jsx38, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2498
2618
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
2499
2619
|
var ColumnsRenderer = {
|
|
2500
2620
|
canRenderType: "columns",
|
|
@@ -2510,8 +2630,8 @@ function ColumnsRendererComponent({
|
|
|
2510
2630
|
var _a;
|
|
2511
2631
|
const isCollapsed = useIsCollapsed();
|
|
2512
2632
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
2513
|
-
const startColumn = /* @__PURE__ */
|
|
2514
|
-
const endColumn = /* @__PURE__ */
|
|
2633
|
+
const startColumn = /* @__PURE__ */ jsx38("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
2634
|
+
const endColumn = /* @__PURE__ */ jsx38("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
2515
2635
|
return /* @__PURE__ */ jsxs8(
|
|
2516
2636
|
"div",
|
|
2517
2637
|
{
|
|
@@ -2556,7 +2676,7 @@ var dateToDateString = (date) => {
|
|
|
2556
2676
|
};
|
|
2557
2677
|
|
|
2558
2678
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
2559
|
-
import { jsx as
|
|
2679
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2560
2680
|
function VariableDateInput({
|
|
2561
2681
|
control,
|
|
2562
2682
|
inputProps
|
|
@@ -2572,7 +2692,7 @@ function VariableDateInput({
|
|
|
2572
2692
|
onFocus
|
|
2573
2693
|
} = inputProps;
|
|
2574
2694
|
if (control === "date-lookup") {
|
|
2575
|
-
return /* @__PURE__ */
|
|
2695
|
+
return /* @__PURE__ */ jsx39(
|
|
2576
2696
|
DateLookup,
|
|
2577
2697
|
{
|
|
2578
2698
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -2588,7 +2708,7 @@ function VariableDateInput({
|
|
|
2588
2708
|
}
|
|
2589
2709
|
);
|
|
2590
2710
|
}
|
|
2591
|
-
return /* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ jsx39(
|
|
2592
2712
|
DateInput,
|
|
2593
2713
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2594
2714
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -2605,7 +2725,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
2605
2725
|
var VariableDateInput_default = VariableDateInput;
|
|
2606
2726
|
|
|
2607
2727
|
// ../renderers/src/DateInputRenderer.tsx
|
|
2608
|
-
import { jsx as
|
|
2728
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
2609
2729
|
var DateInputRenderer = {
|
|
2610
2730
|
canRenderType: "input-date",
|
|
2611
2731
|
render: (props) => {
|
|
@@ -2630,7 +2750,7 @@ var DateInputRenderer = {
|
|
|
2630
2750
|
]);
|
|
2631
2751
|
const value = initialValue != null ? initialValue : "";
|
|
2632
2752
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2633
|
-
return /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ jsx40(
|
|
2634
2754
|
FieldInput_default,
|
|
2635
2755
|
{
|
|
2636
2756
|
id,
|
|
@@ -2641,7 +2761,7 @@ var DateInputRenderer = {
|
|
|
2641
2761
|
loadingState: props.fieldLoadingState,
|
|
2642
2762
|
help,
|
|
2643
2763
|
features: props.features,
|
|
2644
|
-
children: /* @__PURE__ */
|
|
2764
|
+
children: /* @__PURE__ */ jsx40(VariableDateInput_default, { control, inputProps })
|
|
2645
2765
|
}
|
|
2646
2766
|
);
|
|
2647
2767
|
}
|
|
@@ -2653,7 +2773,7 @@ import { ListItem as ListItem7 } from "@transferwise/components";
|
|
|
2653
2773
|
|
|
2654
2774
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2655
2775
|
import { Header as Header3, SearchInput } from "@transferwise/components";
|
|
2656
|
-
import { useState as
|
|
2776
|
+
import { useState as useState8 } from "react";
|
|
2657
2777
|
import { useIntl as useIntl5 } from "react-intl";
|
|
2658
2778
|
|
|
2659
2779
|
// ../renderers/src/messages/filter.messages.ts
|
|
@@ -2676,10 +2796,10 @@ var filter_messages_default = defineMessages4({
|
|
|
2676
2796
|
}
|
|
2677
2797
|
});
|
|
2678
2798
|
|
|
2679
|
-
// ../renderers/src/
|
|
2680
|
-
function
|
|
2799
|
+
// ../renderers/src/utils/filter-and-sort-items.ts
|
|
2800
|
+
function filterAndSortItems(options, query) {
|
|
2681
2801
|
const upperQuery = normalizeAndRemoveAccents(query);
|
|
2682
|
-
const filteredItems =
|
|
2802
|
+
const filteredItems = options.filter((option) => {
|
|
2683
2803
|
var _a, _b, _c, _d;
|
|
2684
2804
|
const searchableWords = [
|
|
2685
2805
|
option.title,
|
|
@@ -2763,7 +2883,7 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
2763
2883
|
};
|
|
2764
2884
|
|
|
2765
2885
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2766
|
-
import { Fragment as Fragment4, jsx as
|
|
2886
|
+
import { Fragment as Fragment4, jsx as jsx41, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2767
2887
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2768
2888
|
var isGroupedDecision = (options) => {
|
|
2769
2889
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
@@ -2773,8 +2893,8 @@ var GroupedDecisionList = (_a) => {
|
|
|
2773
2893
|
const { formatMessage } = useIntl4();
|
|
2774
2894
|
const { options } = rest;
|
|
2775
2895
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
2776
|
-
return /* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2896
|
+
return /* @__PURE__ */ jsx41(Fragment4, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs9(Section, { children: [
|
|
2897
|
+
/* @__PURE__ */ jsx41(
|
|
2778
2898
|
Header2,
|
|
2779
2899
|
{
|
|
2780
2900
|
as: "h2",
|
|
@@ -2786,25 +2906,26 @@ var GroupedDecisionList = (_a) => {
|
|
|
2786
2906
|
};
|
|
2787
2907
|
|
|
2788
2908
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2789
|
-
import { Fragment as Fragment5, jsx as
|
|
2909
|
+
import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2790
2910
|
var DecisionWrapper = (props) => {
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2911
|
+
const { title, control, margin } = props;
|
|
2912
|
+
return /* @__PURE__ */ jsxs10("div", { className: getMargin(margin), children: [
|
|
2913
|
+
title && /* @__PURE__ */ jsx42(Header3, { as: "h2", title }),
|
|
2914
|
+
control === "filtered" ? /* @__PURE__ */ jsx42(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx42(UnfilteredDecisionList, __spreadValues({}, props))
|
|
2794
2915
|
] });
|
|
2795
2916
|
};
|
|
2796
2917
|
var UnfilteredDecisionList = (_a) => {
|
|
2797
2918
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
2798
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
2919
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx42(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
2799
2920
|
};
|
|
2800
2921
|
var FilteredDecisionList = (props) => {
|
|
2801
2922
|
const { formatMessage } = useIntl5();
|
|
2802
|
-
const [query, setQuery] =
|
|
2923
|
+
const [query, setQuery] = useState8("");
|
|
2803
2924
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
2804
|
-
const filteredOptions = (query == null ? void 0 : query.length) > 0 ?
|
|
2925
|
+
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
2805
2926
|
const isGrouped = isGroupedDecision(options);
|
|
2806
2927
|
return /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
2807
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsx42(
|
|
2808
2929
|
SearchInput,
|
|
2809
2930
|
{
|
|
2810
2931
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -2816,25 +2937,25 @@ var FilteredDecisionList = (props) => {
|
|
|
2816
2937
|
}
|
|
2817
2938
|
}
|
|
2818
2939
|
),
|
|
2819
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
2820
|
-
query.length > 0 && /* @__PURE__ */
|
|
2940
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx42(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
2941
|
+
query.length > 0 && /* @__PURE__ */ jsx42(Header3, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
2821
2942
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
2822
2943
|
control,
|
|
2823
2944
|
className: query.length === 0 ? "m-t-3" : "",
|
|
2824
2945
|
options: filteredOptions
|
|
2825
|
-
}) : /* @__PURE__ */
|
|
2946
|
+
}) : /* @__PURE__ */ jsx42("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
2826
2947
|
] })
|
|
2827
2948
|
] });
|
|
2828
2949
|
};
|
|
2829
2950
|
|
|
2830
2951
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2831
|
-
import { Fragment as Fragment6, jsx as
|
|
2952
|
+
import { Fragment as Fragment6, jsx as jsx43 } from "react/jsx-runtime";
|
|
2832
2953
|
var DecisionRenderer = {
|
|
2833
2954
|
canRenderType: "decision",
|
|
2834
|
-
render: (props) => /* @__PURE__ */
|
|
2955
|
+
render: (props) => /* @__PURE__ */ jsx43(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
2835
2956
|
};
|
|
2836
2957
|
var renderDecisionList = ({ options, control }) => {
|
|
2837
|
-
return /* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ jsx43(Fragment6, { children: options.map((_a) => {
|
|
2838
2959
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
2839
2960
|
const {
|
|
2840
2961
|
description,
|
|
@@ -2847,7 +2968,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2847
2968
|
supportingValues,
|
|
2848
2969
|
tags
|
|
2849
2970
|
} = rest;
|
|
2850
|
-
return /* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ jsx43(
|
|
2851
2972
|
ListItem7,
|
|
2852
2973
|
{
|
|
2853
2974
|
title: itemTitle,
|
|
@@ -2859,7 +2980,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2859
2980
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
2860
2981
|
prompt: getInlineAlert(inlineAlert),
|
|
2861
2982
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
2862
|
-
control: /* @__PURE__ */
|
|
2983
|
+
control: /* @__PURE__ */ jsx43(ListItem7.Navigation, __spreadValues({}, getAnchorProps()))
|
|
2863
2984
|
},
|
|
2864
2985
|
JSON.stringify(rest)
|
|
2865
2986
|
);
|
|
@@ -2869,7 +2990,7 @@ var DecisionRenderer_default = DecisionRenderer;
|
|
|
2869
2990
|
|
|
2870
2991
|
// ../renderers/src/DividerRenderer.tsx
|
|
2871
2992
|
import { Divider } from "@transferwise/components";
|
|
2872
|
-
import { jsx as
|
|
2993
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2873
2994
|
var mapControlToLevel = (control) => {
|
|
2874
2995
|
switch (control) {
|
|
2875
2996
|
case "section":
|
|
@@ -2882,12 +3003,12 @@ var mapControlToLevel = (control) => {
|
|
|
2882
3003
|
};
|
|
2883
3004
|
var DividerRenderer = {
|
|
2884
3005
|
canRenderType: "divider",
|
|
2885
|
-
render: ({ margin, control }) => /* @__PURE__ */
|
|
3006
|
+
render: ({ margin, control }) => /* @__PURE__ */ jsx44(Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
2886
3007
|
};
|
|
2887
3008
|
var DividerRenderer_default = DividerRenderer;
|
|
2888
3009
|
|
|
2889
3010
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2890
|
-
import { Button as Button5, Markdown as
|
|
3011
|
+
import { Button as Button5, Markdown as Markdown3, Modal } from "@transferwise/components";
|
|
2891
3012
|
|
|
2892
3013
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
2893
3014
|
import { defineMessages as defineMessages6 } from "react-intl";
|
|
@@ -2917,7 +3038,7 @@ var external_confirmation_messages_default = defineMessages6({
|
|
|
2917
3038
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2918
3039
|
import { useIntl as useIntl6 } from "react-intl";
|
|
2919
3040
|
import { useEffect as useEffect9 } from "react";
|
|
2920
|
-
import { Fragment as Fragment7, jsx as
|
|
3041
|
+
import { Fragment as Fragment7, jsx as jsx45, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2921
3042
|
var ExternalConfirmationRenderer = {
|
|
2922
3043
|
canRenderType: "external-confirmation",
|
|
2923
3044
|
render: ExternalConfirmationRendererComponent
|
|
@@ -2932,15 +3053,15 @@ function ExternalConfirmationRendererComponent({
|
|
|
2932
3053
|
useEffect9(() => {
|
|
2933
3054
|
open();
|
|
2934
3055
|
}, []);
|
|
2935
|
-
return /* @__PURE__ */
|
|
3056
|
+
return /* @__PURE__ */ jsx45(
|
|
2936
3057
|
Modal,
|
|
2937
3058
|
{
|
|
2938
3059
|
open: visible,
|
|
2939
3060
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
2940
3061
|
body: /* @__PURE__ */ jsxs11(Fragment7, { children: [
|
|
2941
|
-
/* @__PURE__ */
|
|
2942
|
-
/* @__PURE__ */
|
|
2943
|
-
/* @__PURE__ */
|
|
3062
|
+
/* @__PURE__ */ jsx45(Markdown3, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
3063
|
+
/* @__PURE__ */ jsx45("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs11("div", { className: "df-box-renderer-width-lg", children: [
|
|
3064
|
+
/* @__PURE__ */ jsx45(
|
|
2944
3065
|
Button5,
|
|
2945
3066
|
{
|
|
2946
3067
|
v2: true,
|
|
@@ -2954,7 +3075,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
2954
3075
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2955
3076
|
}
|
|
2956
3077
|
),
|
|
2957
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ jsx45(Button5, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2958
3079
|
] }) })
|
|
2959
3080
|
] }),
|
|
2960
3081
|
onClose: onCancel
|
|
@@ -2971,27 +3092,27 @@ function getOrigin(url) {
|
|
|
2971
3092
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
2972
3093
|
|
|
2973
3094
|
// ../renderers/src/FormRenderer.tsx
|
|
2974
|
-
import { jsx as
|
|
3095
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2975
3096
|
var FormRenderer = {
|
|
2976
3097
|
canRenderType: "form",
|
|
2977
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
3098
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx46("div", { className: getMargin(margin), children })
|
|
2978
3099
|
};
|
|
2979
3100
|
var FormRenderer_default = FormRenderer;
|
|
2980
3101
|
|
|
2981
3102
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
2982
3103
|
import { Header as Header4 } from "@transferwise/components";
|
|
2983
|
-
import { jsx as
|
|
3104
|
+
import { jsx as jsx47, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2984
3105
|
var FormSectionRenderer = {
|
|
2985
3106
|
canRenderType: "form-section",
|
|
2986
3107
|
render: ({ title, description, children }) => /* @__PURE__ */ jsxs12("fieldset", { children: [
|
|
2987
|
-
title && /* @__PURE__ */
|
|
3108
|
+
title && /* @__PURE__ */ jsx47(
|
|
2988
3109
|
Header4,
|
|
2989
3110
|
{
|
|
2990
3111
|
as: "h2",
|
|
2991
3112
|
title
|
|
2992
3113
|
}
|
|
2993
3114
|
),
|
|
2994
|
-
description && /* @__PURE__ */
|
|
3115
|
+
description && /* @__PURE__ */ jsx47("p", { children: description }),
|
|
2995
3116
|
children
|
|
2996
3117
|
] })
|
|
2997
3118
|
};
|
|
@@ -2999,18 +3120,18 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
2999
3120
|
|
|
3000
3121
|
// ../renderers/src/HeadingRenderer.tsx
|
|
3001
3122
|
import { Display, Title } from "@transferwise/components";
|
|
3002
|
-
import { jsx as
|
|
3123
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3003
3124
|
var HeadingRenderer = {
|
|
3004
3125
|
canRenderType: "heading",
|
|
3005
|
-
render: (props) => /* @__PURE__ */
|
|
3126
|
+
render: (props) => /* @__PURE__ */ jsx48(Heading, __spreadValues({}, props))
|
|
3006
3127
|
};
|
|
3007
3128
|
function Heading(props) {
|
|
3008
3129
|
const { text, size, align, margin, control } = props;
|
|
3009
3130
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
3010
|
-
return control === "display" ? /* @__PURE__ */
|
|
3131
|
+
return control === "display" ? /* @__PURE__ */ jsx48(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx48(StandardHeading, { size, text, className });
|
|
3011
3132
|
}
|
|
3012
3133
|
function DisplayHeading({ size, text, className }) {
|
|
3013
|
-
return /* @__PURE__ */
|
|
3134
|
+
return /* @__PURE__ */ jsx48(Display, { type: getDisplayType(size), className, children: text });
|
|
3014
3135
|
}
|
|
3015
3136
|
var getDisplayType = (size) => {
|
|
3016
3137
|
switch (size) {
|
|
@@ -3026,7 +3147,7 @@ var getDisplayType = (size) => {
|
|
|
3026
3147
|
}
|
|
3027
3148
|
};
|
|
3028
3149
|
function StandardHeading({ size, text, className }) {
|
|
3029
|
-
return /* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ jsx48(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
3030
3151
|
}
|
|
3031
3152
|
var getTitleTypeBySize = (size) => {
|
|
3032
3153
|
var _a;
|
|
@@ -3043,7 +3164,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
3043
3164
|
|
|
3044
3165
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3045
3166
|
import { Image } from "@transferwise/components";
|
|
3046
|
-
import { useEffect as useEffect10, useState as
|
|
3167
|
+
import { useEffect as useEffect10, useState as useState9 } from "react";
|
|
3047
3168
|
|
|
3048
3169
|
// ../renderers/src/utils/api-utils.ts
|
|
3049
3170
|
function isRelativePath(url = "") {
|
|
@@ -3053,7 +3174,7 @@ function isRelativePath(url = "") {
|
|
|
3053
3174
|
}
|
|
3054
3175
|
|
|
3055
3176
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3056
|
-
import { jsx as
|
|
3177
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3057
3178
|
function UrlImage({
|
|
3058
3179
|
accessibilityDescription,
|
|
3059
3180
|
align,
|
|
@@ -3062,13 +3183,13 @@ function UrlImage({
|
|
|
3062
3183
|
uri,
|
|
3063
3184
|
httpClient
|
|
3064
3185
|
}) {
|
|
3065
|
-
const [imageSource, setImageSource] =
|
|
3186
|
+
const [imageSource, setImageSource] = useState9("");
|
|
3066
3187
|
useEffect10(() => {
|
|
3067
3188
|
if (!uri.startsWith("urn:")) {
|
|
3068
3189
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
3069
3190
|
}
|
|
3070
3191
|
}, [uri, httpClient]);
|
|
3071
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx49("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx49(
|
|
3072
3193
|
Image,
|
|
3073
3194
|
{
|
|
3074
3195
|
className: "df-reserve-space",
|
|
@@ -3112,7 +3233,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
3112
3233
|
};
|
|
3113
3234
|
|
|
3114
3235
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
3115
|
-
import { jsx as
|
|
3236
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
3116
3237
|
var maxFlagSize = 600;
|
|
3117
3238
|
function UrnFlagImage({
|
|
3118
3239
|
accessibilityDescription,
|
|
@@ -3121,7 +3242,7 @@ function UrnFlagImage({
|
|
|
3121
3242
|
size,
|
|
3122
3243
|
uri
|
|
3123
3244
|
}) {
|
|
3124
|
-
return /* @__PURE__ */
|
|
3245
|
+
return /* @__PURE__ */ jsx50("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx50(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
3125
3246
|
}
|
|
3126
3247
|
|
|
3127
3248
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
@@ -3129,7 +3250,7 @@ import {
|
|
|
3129
3250
|
Illustration,
|
|
3130
3251
|
isIllustrationSupport3D
|
|
3131
3252
|
} from "@wise/art";
|
|
3132
|
-
import { useState as
|
|
3253
|
+
import { useState as useState10 } from "react";
|
|
3133
3254
|
|
|
3134
3255
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
3135
3256
|
var isAnimated = (uri) => {
|
|
@@ -3140,7 +3261,7 @@ var isAnimated = (uri) => {
|
|
|
3140
3261
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
3141
3262
|
import { Illustration3D } from "@wise/art";
|
|
3142
3263
|
import { Component } from "react";
|
|
3143
|
-
import { jsx as
|
|
3264
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
3144
3265
|
var Illustration3DErrorBoundary = class extends Component {
|
|
3145
3266
|
constructor(props) {
|
|
3146
3267
|
super(props);
|
|
@@ -3152,7 +3273,7 @@ var Illustration3DErrorBoundary = class extends Component {
|
|
|
3152
3273
|
componentDidCatch() {
|
|
3153
3274
|
this.props.onError();
|
|
3154
3275
|
}
|
|
3155
|
-
|
|
3276
|
+
render() {
|
|
3156
3277
|
if (this.state.hasError) {
|
|
3157
3278
|
return null;
|
|
3158
3279
|
}
|
|
@@ -3164,12 +3285,12 @@ var SafeIllustration3D = ({
|
|
|
3164
3285
|
size,
|
|
3165
3286
|
onError
|
|
3166
3287
|
}) => {
|
|
3167
|
-
return /* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ jsx51(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ jsx51(Illustration3D, { name, size }) });
|
|
3168
3289
|
};
|
|
3169
3290
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
3170
3291
|
|
|
3171
3292
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
3172
|
-
import { jsx as
|
|
3293
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3173
3294
|
var urnPrefix = "urn:wise:illustrations:";
|
|
3174
3295
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
3175
3296
|
function UrnIllustration({
|
|
@@ -3179,12 +3300,12 @@ function UrnIllustration({
|
|
|
3179
3300
|
size,
|
|
3180
3301
|
uri
|
|
3181
3302
|
}) {
|
|
3182
|
-
const [has3DFailed, setHas3DFailed] =
|
|
3303
|
+
const [has3DFailed, setHas3DFailed] = useState10(false);
|
|
3183
3304
|
const illustrationSize = getIllustrationSize(size);
|
|
3184
3305
|
const illustrationName = getIllustrationName(uri);
|
|
3185
3306
|
const illustration3DName = getIllustration3DName(uri);
|
|
3186
3307
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
3187
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ jsx52("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx52(
|
|
3188
3309
|
SafeIllustration3D_default,
|
|
3189
3310
|
{
|
|
3190
3311
|
name: illustration3DName,
|
|
@@ -3193,7 +3314,7 @@ function UrnIllustration({
|
|
|
3193
3314
|
}
|
|
3194
3315
|
) });
|
|
3195
3316
|
}
|
|
3196
|
-
return /* @__PURE__ */
|
|
3317
|
+
return /* @__PURE__ */ jsx52("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx52(
|
|
3197
3318
|
Illustration,
|
|
3198
3319
|
{
|
|
3199
3320
|
className: "df-illustration",
|
|
@@ -3213,24 +3334,24 @@ var getIllustration3DName = (uri) => {
|
|
|
3213
3334
|
};
|
|
3214
3335
|
|
|
3215
3336
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
3216
|
-
import { jsx as
|
|
3337
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3217
3338
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
3218
3339
|
function UrnImage(props) {
|
|
3219
3340
|
const { uri } = props;
|
|
3220
3341
|
if (isUrnIllustration(uri)) {
|
|
3221
|
-
return /* @__PURE__ */
|
|
3342
|
+
return /* @__PURE__ */ jsx53(UrnIllustration, __spreadValues({}, props));
|
|
3222
3343
|
}
|
|
3223
3344
|
if (isUrnFlag(uri)) {
|
|
3224
|
-
return /* @__PURE__ */
|
|
3345
|
+
return /* @__PURE__ */ jsx53(UrnFlagImage, __spreadValues({}, props));
|
|
3225
3346
|
}
|
|
3226
3347
|
return null;
|
|
3227
3348
|
}
|
|
3228
3349
|
|
|
3229
3350
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
3230
|
-
import { jsx as
|
|
3351
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3231
3352
|
var ImageRenderer = {
|
|
3232
3353
|
canRenderType: "image",
|
|
3233
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
3354
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx54(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx54(UrlImage, __spreadValues({}, props))
|
|
3234
3355
|
};
|
|
3235
3356
|
|
|
3236
3357
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
@@ -3238,7 +3359,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
3238
3359
|
|
|
3239
3360
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
3240
3361
|
import { Header as Header5, InstructionsList } from "@transferwise/components";
|
|
3241
|
-
import { jsx as
|
|
3362
|
+
import { jsx as jsx55, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3242
3363
|
var doContext = ["positive", "neutral"];
|
|
3243
3364
|
var dontContext = ["warning", "negative"];
|
|
3244
3365
|
var InstructionsRenderer = {
|
|
@@ -3247,8 +3368,8 @@ var InstructionsRenderer = {
|
|
|
3247
3368
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
3248
3369
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
3249
3370
|
return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
|
|
3250
|
-
title ? /* @__PURE__ */
|
|
3251
|
-
/* @__PURE__ */
|
|
3371
|
+
title ? /* @__PURE__ */ jsx55(Header5, { title }) : null,
|
|
3372
|
+
/* @__PURE__ */ jsx55(InstructionsList, { dos, donts })
|
|
3252
3373
|
] });
|
|
3253
3374
|
}
|
|
3254
3375
|
};
|
|
@@ -3280,7 +3401,7 @@ function pick(obj, ...keys) {
|
|
|
3280
3401
|
}
|
|
3281
3402
|
|
|
3282
3403
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3283
|
-
import { jsx as
|
|
3404
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
3284
3405
|
var IntegerInputRenderer = {
|
|
3285
3406
|
canRenderType: "input-integer",
|
|
3286
3407
|
render: (props) => {
|
|
@@ -3295,7 +3416,7 @@ var IntegerInputRenderer = {
|
|
|
3295
3416
|
"maximum",
|
|
3296
3417
|
"minimum"
|
|
3297
3418
|
);
|
|
3298
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ jsx56(
|
|
3299
3420
|
FieldInput_default,
|
|
3300
3421
|
{
|
|
3301
3422
|
id,
|
|
@@ -3306,7 +3427,7 @@ var IntegerInputRenderer = {
|
|
|
3306
3427
|
loadingState: props.fieldLoadingState,
|
|
3307
3428
|
help,
|
|
3308
3429
|
features: props.features,
|
|
3309
|
-
children: /* @__PURE__ */
|
|
3430
|
+
children: /* @__PURE__ */ jsx56(InputGroup2, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx56(
|
|
3310
3431
|
Input2,
|
|
3311
3432
|
__spreadValues({
|
|
3312
3433
|
id,
|
|
@@ -3333,8 +3454,8 @@ import { ListItem as ListItem8 } from "@transferwise/components";
|
|
|
3333
3454
|
|
|
3334
3455
|
// ../renderers/src/components/Header.tsx
|
|
3335
3456
|
import { Header as DSHeader } from "@transferwise/components";
|
|
3336
|
-
import { jsx as
|
|
3337
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */
|
|
3457
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
3458
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx57(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
3338
3459
|
var getHeaderAction = (callToAction) => {
|
|
3339
3460
|
if (!callToAction) {
|
|
3340
3461
|
return void 0;
|
|
@@ -3346,11 +3467,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
3346
3467
|
};
|
|
3347
3468
|
|
|
3348
3469
|
// ../renderers/src/ListRenderer.tsx
|
|
3349
|
-
import { jsx as
|
|
3470
|
+
import { jsx as jsx58, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3350
3471
|
var ListRenderer = {
|
|
3351
3472
|
canRenderType: "list",
|
|
3352
3473
|
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
|
|
3353
|
-
/* @__PURE__ */
|
|
3474
|
+
/* @__PURE__ */ jsx58(Header, { title, callToAction }),
|
|
3354
3475
|
items.map((item) => {
|
|
3355
3476
|
var _a, _b;
|
|
3356
3477
|
const {
|
|
@@ -3367,7 +3488,7 @@ var ListRenderer = {
|
|
|
3367
3488
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3368
3489
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3369
3490
|
};
|
|
3370
|
-
return /* @__PURE__ */
|
|
3491
|
+
return /* @__PURE__ */ jsx58(
|
|
3371
3492
|
ListItem8,
|
|
3372
3493
|
{
|
|
3373
3494
|
title: itemTitle,
|
|
@@ -3388,10 +3509,10 @@ var ListRenderer_default = ListRenderer;
|
|
|
3388
3509
|
|
|
3389
3510
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
3390
3511
|
import { Loader } from "@transferwise/components";
|
|
3391
|
-
import { jsx as
|
|
3512
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3392
3513
|
var LoadingIndicatorRenderer = {
|
|
3393
3514
|
canRenderType: "loading-indicator",
|
|
3394
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
3515
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx59(
|
|
3395
3516
|
Loader,
|
|
3396
3517
|
{
|
|
3397
3518
|
size,
|
|
@@ -3403,13 +3524,13 @@ var LoadingIndicatorRenderer = {
|
|
|
3403
3524
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
3404
3525
|
|
|
3405
3526
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
3406
|
-
import { Markdown as
|
|
3527
|
+
import { Markdown as Markdown4 } from "@transferwise/components";
|
|
3407
3528
|
var import_classnames4 = __toESM(require_classnames());
|
|
3408
|
-
import { jsx as
|
|
3529
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3409
3530
|
var MarkdownRenderer = {
|
|
3410
3531
|
canRenderType: "markdown",
|
|
3411
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */
|
|
3412
|
-
|
|
3532
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ jsx60("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx60(
|
|
3533
|
+
Markdown4,
|
|
3413
3534
|
{
|
|
3414
3535
|
className: (0, import_classnames4.default)(
|
|
3415
3536
|
"df-markdown",
|
|
@@ -3423,16 +3544,16 @@ var MarkdownRenderer = {
|
|
|
3423
3544
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
3424
3545
|
|
|
3425
3546
|
// ../renderers/src/MediaRenderer.tsx
|
|
3426
|
-
import { jsx as
|
|
3547
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3427
3548
|
var MediaRenderer = {
|
|
3428
3549
|
canRenderType: "media",
|
|
3429
3550
|
render: (_a) => {
|
|
3430
3551
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
3431
3552
|
switch (media.type) {
|
|
3432
3553
|
case "avatar":
|
|
3433
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ jsx61(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3434
3555
|
case "image":
|
|
3435
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ jsx61(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3436
3557
|
case "legacy":
|
|
3437
3558
|
return null;
|
|
3438
3559
|
}
|
|
@@ -3444,7 +3565,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
3444
3565
|
margin,
|
|
3445
3566
|
size
|
|
3446
3567
|
}) => {
|
|
3447
|
-
return /* @__PURE__ */
|
|
3568
|
+
return /* @__PURE__ */ jsx61("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ jsx61(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
3448
3569
|
};
|
|
3449
3570
|
var ImageMediaRendererComponent = (_a) => {
|
|
3450
3571
|
var _b = _a, {
|
|
@@ -3452,7 +3573,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
3452
3573
|
} = _b, rest = __objRest(_b, [
|
|
3453
3574
|
"media"
|
|
3454
3575
|
]);
|
|
3455
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
3576
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx61(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ jsx61(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
3456
3577
|
};
|
|
3457
3578
|
var mapAvatarMediaSize = (size) => {
|
|
3458
3579
|
switch (size) {
|
|
@@ -3471,19 +3592,19 @@ var mapAvatarMediaSize = (size) => {
|
|
|
3471
3592
|
|
|
3472
3593
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
3473
3594
|
import { Button as Button6, Modal as Modal2 } from "@transferwise/components";
|
|
3474
|
-
import { useState as
|
|
3475
|
-
import { jsx as
|
|
3595
|
+
import { useState as useState11 } from "react";
|
|
3596
|
+
import { jsx as jsx62, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3476
3597
|
var ModalLayoutRenderer = {
|
|
3477
3598
|
canRenderType: "modal-layout",
|
|
3478
|
-
render: (props) => /* @__PURE__ */
|
|
3599
|
+
render: (props) => /* @__PURE__ */ jsx62(DFModal, __spreadValues({}, props))
|
|
3479
3600
|
};
|
|
3480
3601
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
3481
3602
|
function DFModal({ content, margin, trigger }) {
|
|
3482
|
-
const [visible, setVisible] =
|
|
3603
|
+
const [visible, setVisible] = useState11(false);
|
|
3483
3604
|
const { children, title } = content;
|
|
3484
3605
|
return /* @__PURE__ */ jsxs15("div", { className: getMargin(margin), children: [
|
|
3485
|
-
/* @__PURE__ */
|
|
3486
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ jsx62(Button6, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
3607
|
+
/* @__PURE__ */ jsx62(
|
|
3487
3608
|
Modal2,
|
|
3488
3609
|
{
|
|
3489
3610
|
scroll: "content",
|
|
@@ -3499,11 +3620,11 @@ function DFModal({ content, margin, trigger }) {
|
|
|
3499
3620
|
|
|
3500
3621
|
// ../renderers/src/ModalRenderer.tsx
|
|
3501
3622
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
3502
|
-
import { jsx as
|
|
3623
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3503
3624
|
var ModalRenderer = {
|
|
3504
3625
|
canRenderType: "modal",
|
|
3505
3626
|
render: ({ title, children, open, onClose }) => {
|
|
3506
|
-
return /* @__PURE__ */
|
|
3627
|
+
return /* @__PURE__ */ jsx63(Modal3, { open, title, body: children, onClose });
|
|
3507
3628
|
}
|
|
3508
3629
|
};
|
|
3509
3630
|
|
|
@@ -3511,7 +3632,7 @@ var ModalRenderer = {
|
|
|
3511
3632
|
import { MoneyInput } from "@transferwise/components";
|
|
3512
3633
|
import { useEffect as useEffect11 } from "react";
|
|
3513
3634
|
import { useIntl as useIntl7 } from "react-intl";
|
|
3514
|
-
import { jsx as
|
|
3635
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
3515
3636
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3516
3637
|
var MoneyInputRenderer = {
|
|
3517
3638
|
canRenderType: "money-input",
|
|
@@ -3538,7 +3659,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
3538
3659
|
}
|
|
3539
3660
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
3540
3661
|
const { formatMessage } = useIntl7();
|
|
3541
|
-
return /* @__PURE__ */
|
|
3662
|
+
return /* @__PURE__ */ jsx64(
|
|
3542
3663
|
FieldInput_default,
|
|
3543
3664
|
{
|
|
3544
3665
|
id: uid,
|
|
@@ -3547,7 +3668,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
3547
3668
|
validation: validationState,
|
|
3548
3669
|
help,
|
|
3549
3670
|
features: props.features,
|
|
3550
|
-
children: /* @__PURE__ */
|
|
3671
|
+
children: /* @__PURE__ */ jsx64(
|
|
3551
3672
|
MoneyInput,
|
|
3552
3673
|
{
|
|
3553
3674
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -3609,8 +3730,17 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
3609
3730
|
}
|
|
3610
3731
|
|
|
3611
3732
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
3612
|
-
import { ListItem as ListItem9 } from "@transferwise/components";
|
|
3613
|
-
import {
|
|
3733
|
+
import { ListItem as ListItem9, SearchInput as SearchInput2 } from "@transferwise/components";
|
|
3734
|
+
import { useState as useState12 } from "react";
|
|
3735
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
3736
|
+
|
|
3737
|
+
// ../renderers/src/utils/items-with-index.ts
|
|
3738
|
+
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
3739
|
+
index
|
|
3740
|
+
}));
|
|
3741
|
+
|
|
3742
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
3743
|
+
import { Fragment as Fragment8, jsx as jsx65, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3614
3744
|
function InlineComponent(props) {
|
|
3615
3745
|
const {
|
|
3616
3746
|
id,
|
|
@@ -3620,65 +3750,87 @@ function InlineComponent(props) {
|
|
|
3620
3750
|
help,
|
|
3621
3751
|
options,
|
|
3622
3752
|
selectedIndices,
|
|
3753
|
+
tags,
|
|
3623
3754
|
title,
|
|
3624
3755
|
validationState,
|
|
3625
3756
|
onSelect
|
|
3626
3757
|
} = props;
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3758
|
+
const optionsWithIndex = zipWithIndex(options);
|
|
3759
|
+
const [query, setQuery] = useState12("");
|
|
3760
|
+
const { formatMessage } = useIntl8();
|
|
3761
|
+
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
3762
|
+
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
3763
|
+
return /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
3764
|
+
filtered && /* @__PURE__ */ jsx65(
|
|
3765
|
+
SearchInput2,
|
|
3766
|
+
{
|
|
3767
|
+
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
3768
|
+
disabled,
|
|
3769
|
+
value: query,
|
|
3770
|
+
className: "m-b-2",
|
|
3771
|
+
onChange: (e) => {
|
|
3772
|
+
var _a;
|
|
3773
|
+
return setQuery((_a = e.target.value) != null ? _a : "");
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
),
|
|
3777
|
+
/* @__PURE__ */ jsx65(
|
|
3778
|
+
FieldInput_default,
|
|
3779
|
+
{
|
|
3780
|
+
id,
|
|
3781
|
+
label: title,
|
|
3782
|
+
help,
|
|
3783
|
+
description,
|
|
3784
|
+
validation: validationState,
|
|
3785
|
+
features,
|
|
3786
|
+
children: filteredOptions.map((option) => {
|
|
3787
|
+
var _a;
|
|
3788
|
+
const {
|
|
3652
3789
|
title: itemTitle,
|
|
3653
|
-
subtitle,
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3790
|
+
description: subtitle,
|
|
3791
|
+
disabled: optionDisabled,
|
|
3792
|
+
media,
|
|
3793
|
+
index,
|
|
3794
|
+
additionalText,
|
|
3795
|
+
inlineAlert,
|
|
3796
|
+
supportingValues,
|
|
3797
|
+
childrenProps
|
|
3798
|
+
} = option;
|
|
3799
|
+
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
3800
|
+
return /* @__PURE__ */ jsx65(
|
|
3801
|
+
ListItem9,
|
|
3802
|
+
{
|
|
3803
|
+
title: itemTitle,
|
|
3804
|
+
subtitle,
|
|
3805
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
3806
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
3807
|
+
media: getMedia(media, false),
|
|
3808
|
+
prompt: getInlineAlert(inlineAlert),
|
|
3809
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx65(ListItem9.AdditionalInfo, { children: additionalText }) : void 0,
|
|
3810
|
+
disabled: disabled || optionDisabled,
|
|
3811
|
+
control: /* @__PURE__ */ jsx65(
|
|
3812
|
+
ListItem9.Checkbox,
|
|
3813
|
+
{
|
|
3814
|
+
checked: selectedIndices.includes(index),
|
|
3815
|
+
onChange: (e) => {
|
|
3816
|
+
const newSelectedIndices = e.target.checked ? [...selectedIndices, index] : selectedIndices.filter((i) => i !== index);
|
|
3817
|
+
onSelect(newSelectedIndices);
|
|
3818
|
+
}
|
|
3667
3819
|
}
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
)
|
|
3673
|
-
}
|
|
3674
|
-
|
|
3675
|
-
);
|
|
3820
|
+
)
|
|
3821
|
+
},
|
|
3822
|
+
key
|
|
3823
|
+
);
|
|
3824
|
+
})
|
|
3825
|
+
}
|
|
3826
|
+
)
|
|
3827
|
+
] });
|
|
3676
3828
|
}
|
|
3677
3829
|
|
|
3678
3830
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3679
3831
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
3680
|
-
import { useState as
|
|
3681
|
-
import { useIntl as
|
|
3832
|
+
import { useState as useState13 } from "react";
|
|
3833
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
3682
3834
|
|
|
3683
3835
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
3684
3836
|
import { defineMessages as defineMessages7 } from "react-intl";
|
|
@@ -3691,10 +3843,10 @@ var multi_select_messages_default = defineMessages7({
|
|
|
3691
3843
|
});
|
|
3692
3844
|
|
|
3693
3845
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3694
|
-
import { jsx as
|
|
3846
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
3695
3847
|
function DefaultComponent(props) {
|
|
3696
|
-
const { formatMessage } =
|
|
3697
|
-
const [stagedIndices, setStagedIndices] =
|
|
3848
|
+
const { formatMessage } = useIntl9();
|
|
3849
|
+
const [stagedIndices, setStagedIndices] = useState13();
|
|
3698
3850
|
const {
|
|
3699
3851
|
id,
|
|
3700
3852
|
autoComplete,
|
|
@@ -3733,12 +3885,12 @@ function DefaultComponent(props) {
|
|
|
3733
3885
|
const contentProps = {
|
|
3734
3886
|
title: option.title,
|
|
3735
3887
|
description: option.description,
|
|
3736
|
-
icon: /* @__PURE__ */
|
|
3888
|
+
icon: /* @__PURE__ */ jsx66(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3737
3889
|
};
|
|
3738
|
-
return /* @__PURE__ */
|
|
3890
|
+
return /* @__PURE__ */ jsx66(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3739
3891
|
};
|
|
3740
3892
|
const extraProps = { autoComplete };
|
|
3741
|
-
return /* @__PURE__ */
|
|
3893
|
+
return /* @__PURE__ */ jsx66(
|
|
3742
3894
|
FieldInput_default,
|
|
3743
3895
|
{
|
|
3744
3896
|
id,
|
|
@@ -3747,7 +3899,7 @@ function DefaultComponent(props) {
|
|
|
3747
3899
|
description,
|
|
3748
3900
|
validation: validationState,
|
|
3749
3901
|
features,
|
|
3750
|
-
children: /* @__PURE__ */
|
|
3902
|
+
children: /* @__PURE__ */ jsx66(
|
|
3751
3903
|
SelectInput,
|
|
3752
3904
|
__spreadValues({
|
|
3753
3905
|
id,
|
|
@@ -3787,7 +3939,7 @@ function DefaultComponent(props) {
|
|
|
3787
3939
|
|
|
3788
3940
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
3789
3941
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
3790
|
-
import { jsx as
|
|
3942
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
3791
3943
|
function InlineCheckboxComponent(props) {
|
|
3792
3944
|
const {
|
|
3793
3945
|
id,
|
|
@@ -3801,7 +3953,7 @@ function InlineCheckboxComponent(props) {
|
|
|
3801
3953
|
validationState,
|
|
3802
3954
|
onSelect
|
|
3803
3955
|
} = props;
|
|
3804
|
-
return /* @__PURE__ */
|
|
3956
|
+
return /* @__PURE__ */ jsx67(
|
|
3805
3957
|
FieldInput_default,
|
|
3806
3958
|
{
|
|
3807
3959
|
id,
|
|
@@ -3830,24 +3982,24 @@ function InlineCheckboxComponent(props) {
|
|
|
3830
3982
|
onSelect(newSelectedIndices);
|
|
3831
3983
|
}
|
|
3832
3984
|
};
|
|
3833
|
-
return /* @__PURE__ */
|
|
3985
|
+
return /* @__PURE__ */ jsx67(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
3834
3986
|
})
|
|
3835
3987
|
}
|
|
3836
3988
|
);
|
|
3837
3989
|
}
|
|
3838
3990
|
|
|
3839
3991
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
3840
|
-
import { jsx as
|
|
3992
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
3841
3993
|
var MultiSelectInputRenderer = {
|
|
3842
3994
|
canRenderType: "input-multi-select",
|
|
3843
3995
|
render: (props) => {
|
|
3844
3996
|
switch (props.control) {
|
|
3845
3997
|
case "inline":
|
|
3846
|
-
return /* @__PURE__ */
|
|
3998
|
+
return /* @__PURE__ */ jsx68(InlineComponent, __spreadValues({}, props));
|
|
3847
3999
|
case "inline-checkbox-group":
|
|
3848
|
-
return /* @__PURE__ */
|
|
4000
|
+
return /* @__PURE__ */ jsx68(InlineCheckboxComponent, __spreadValues({}, props));
|
|
3849
4001
|
default:
|
|
3850
|
-
return /* @__PURE__ */
|
|
4002
|
+
return /* @__PURE__ */ jsx68(DefaultComponent, __spreadValues({}, props));
|
|
3851
4003
|
}
|
|
3852
4004
|
}
|
|
3853
4005
|
};
|
|
@@ -3858,7 +4010,7 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
3858
4010
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
3859
4011
|
var import_classnames5 = __toESM(require_classnames());
|
|
3860
4012
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
3861
|
-
import { jsx as
|
|
4013
|
+
import { jsx as jsx69, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3862
4014
|
function UploadFieldInput({
|
|
3863
4015
|
id,
|
|
3864
4016
|
children,
|
|
@@ -3868,10 +4020,10 @@ function UploadFieldInput({
|
|
|
3868
4020
|
validation,
|
|
3869
4021
|
features
|
|
3870
4022
|
}) {
|
|
3871
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
4023
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx69(LabelContentWithHelp, { text: label, help }) : label;
|
|
3872
4024
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3873
4025
|
const { ref } = useScrollToError(validation, features);
|
|
3874
|
-
return /* @__PURE__ */
|
|
4026
|
+
return /* @__PURE__ */ jsxs17(
|
|
3875
4027
|
"div",
|
|
3876
4028
|
{
|
|
3877
4029
|
ref,
|
|
@@ -3879,9 +4031,9 @@ function UploadFieldInput({
|
|
|
3879
4031
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
3880
4032
|
}),
|
|
3881
4033
|
children: [
|
|
3882
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsx69("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
3883
4035
|
children,
|
|
3884
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
4036
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx69(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
3885
4037
|
]
|
|
3886
4038
|
}
|
|
3887
4039
|
);
|
|
@@ -3916,7 +4068,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
3916
4068
|
};
|
|
3917
4069
|
|
|
3918
4070
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
3919
|
-
import { jsx as
|
|
4071
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
3920
4072
|
var MultiUploadInputRenderer = {
|
|
3921
4073
|
canRenderType: "input-upload-multi",
|
|
3922
4074
|
render: (props) => {
|
|
@@ -3942,7 +4094,7 @@ var MultiUploadInputRenderer = {
|
|
|
3942
4094
|
};
|
|
3943
4095
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
3944
4096
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3945
|
-
return /* @__PURE__ */
|
|
4097
|
+
return /* @__PURE__ */ jsx70(
|
|
3946
4098
|
UploadFieldInput_default,
|
|
3947
4099
|
{
|
|
3948
4100
|
id,
|
|
@@ -3951,7 +4103,7 @@ var MultiUploadInputRenderer = {
|
|
|
3951
4103
|
validation: validationState,
|
|
3952
4104
|
help,
|
|
3953
4105
|
features,
|
|
3954
|
-
children: /* @__PURE__ */
|
|
4106
|
+
children: /* @__PURE__ */ jsx70(
|
|
3955
4107
|
UploadInput,
|
|
3956
4108
|
{
|
|
3957
4109
|
id,
|
|
@@ -3980,7 +4132,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
3980
4132
|
|
|
3981
4133
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
3982
4134
|
import { Input as Input3, InputGroup as InputGroup3 } from "@transferwise/components";
|
|
3983
|
-
import { jsx as
|
|
4135
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3984
4136
|
var NumberInputRenderer = {
|
|
3985
4137
|
canRenderType: "input-number",
|
|
3986
4138
|
render: (props) => {
|
|
@@ -3994,7 +4146,7 @@ var NumberInputRenderer = {
|
|
|
3994
4146
|
"maximum",
|
|
3995
4147
|
"minimum"
|
|
3996
4148
|
);
|
|
3997
|
-
return /* @__PURE__ */
|
|
4149
|
+
return /* @__PURE__ */ jsx71(
|
|
3998
4150
|
FieldInput_default,
|
|
3999
4151
|
{
|
|
4000
4152
|
id,
|
|
@@ -4005,7 +4157,7 @@ var NumberInputRenderer = {
|
|
|
4005
4157
|
loadingState: props.fieldLoadingState,
|
|
4006
4158
|
help,
|
|
4007
4159
|
features: props.features,
|
|
4008
|
-
children: /* @__PURE__ */
|
|
4160
|
+
children: /* @__PURE__ */ jsx71(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx71(
|
|
4009
4161
|
Input3,
|
|
4010
4162
|
__spreadValues({
|
|
4011
4163
|
id,
|
|
@@ -4026,7 +4178,7 @@ var NumberInputRenderer = {
|
|
|
4026
4178
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
4027
4179
|
|
|
4028
4180
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4029
|
-
import { useIntl as
|
|
4181
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
4030
4182
|
|
|
4031
4183
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
4032
4184
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -4057,14 +4209,14 @@ var paragraph_messages_default = defineMessages8({
|
|
|
4057
4209
|
});
|
|
4058
4210
|
|
|
4059
4211
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4060
|
-
import { jsx as
|
|
4212
|
+
import { jsx as jsx72, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4061
4213
|
var ParagraphRenderer = {
|
|
4062
4214
|
canRenderType: "paragraph",
|
|
4063
|
-
render: (props) => /* @__PURE__ */
|
|
4215
|
+
render: (props) => /* @__PURE__ */ jsx72(Paragraph, __spreadValues({}, props))
|
|
4064
4216
|
};
|
|
4065
4217
|
function Paragraph({ align, control, margin, size, text }) {
|
|
4066
4218
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
4067
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
4219
|
+
return control === "copyable" ? /* @__PURE__ */ jsx72(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx72(
|
|
4068
4220
|
"p",
|
|
4069
4221
|
{
|
|
4070
4222
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -4077,15 +4229,15 @@ function CopyableParagraph({
|
|
|
4077
4229
|
align,
|
|
4078
4230
|
className
|
|
4079
4231
|
}) {
|
|
4080
|
-
const { formatMessage } =
|
|
4232
|
+
const { formatMessage } = useIntl10();
|
|
4081
4233
|
const createSnackbar = useSnackBarIfAvailable();
|
|
4082
4234
|
const copy = () => {
|
|
4083
4235
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
4084
4236
|
});
|
|
4085
4237
|
};
|
|
4086
4238
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
4087
|
-
return /* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4239
|
+
return /* @__PURE__ */ jsxs18("div", { className, children: [
|
|
4240
|
+
/* @__PURE__ */ jsx72(
|
|
4089
4241
|
Input4,
|
|
4090
4242
|
{
|
|
4091
4243
|
type: "text",
|
|
@@ -4094,23 +4246,23 @@ function CopyableParagraph({
|
|
|
4094
4246
|
className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
|
|
4095
4247
|
}
|
|
4096
4248
|
),
|
|
4097
|
-
/* @__PURE__ */
|
|
4249
|
+
/* @__PURE__ */ jsx72(Button7, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
4098
4250
|
] });
|
|
4099
4251
|
}
|
|
4100
4252
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
4101
4253
|
|
|
4102
4254
|
// ../renderers/src/ProgressRenderer.tsx
|
|
4103
4255
|
import { ProgressBar } from "@transferwise/components";
|
|
4104
|
-
import { jsx as
|
|
4256
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
4105
4257
|
var ProgressRenderer = {
|
|
4106
4258
|
canRenderType: "progress",
|
|
4107
4259
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
4108
|
-
return /* @__PURE__ */
|
|
4260
|
+
return /* @__PURE__ */ jsx73(
|
|
4109
4261
|
ProgressBar,
|
|
4110
4262
|
{
|
|
4111
4263
|
id: uid,
|
|
4112
4264
|
className: getMargin(margin),
|
|
4113
|
-
title: title && help ? /* @__PURE__ */
|
|
4265
|
+
title: title && help ? /* @__PURE__ */ jsx73(LabelContentWithHelp, { text: title, help }) : title,
|
|
4114
4266
|
description,
|
|
4115
4267
|
progress: {
|
|
4116
4268
|
max: 1,
|
|
@@ -4126,8 +4278,8 @@ var ProgressRenderer = {
|
|
|
4126
4278
|
var import_classnames7 = __toESM(require_classnames());
|
|
4127
4279
|
import { Button as Button8, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
4128
4280
|
import { Plus } from "@transferwise/icons";
|
|
4129
|
-
import { useState as
|
|
4130
|
-
import { useIntl as
|
|
4281
|
+
import { useState as useState14 } from "react";
|
|
4282
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
4131
4283
|
|
|
4132
4284
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
4133
4285
|
import { defineMessages as defineMessages9 } from "react-intl";
|
|
@@ -4155,10 +4307,10 @@ var repeatable_messages_default = defineMessages9({
|
|
|
4155
4307
|
});
|
|
4156
4308
|
|
|
4157
4309
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4158
|
-
import { Fragment as
|
|
4310
|
+
import { Fragment as Fragment9, jsx as jsx74, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4159
4311
|
var RepeatableRenderer = {
|
|
4160
4312
|
canRenderType: "repeatable",
|
|
4161
|
-
render: (props) => /* @__PURE__ */
|
|
4313
|
+
render: (props) => /* @__PURE__ */ jsx74(Repeatable, __spreadValues({}, props))
|
|
4162
4314
|
};
|
|
4163
4315
|
function Repeatable(props) {
|
|
4164
4316
|
const {
|
|
@@ -4175,8 +4327,8 @@ function Repeatable(props) {
|
|
|
4175
4327
|
onSave,
|
|
4176
4328
|
onRemove
|
|
4177
4329
|
} = props;
|
|
4178
|
-
const { formatMessage } =
|
|
4179
|
-
const [openModalType, setOpenModalType] =
|
|
4330
|
+
const { formatMessage } = useIntl11();
|
|
4331
|
+
const [openModalType, setOpenModalType] = useState14(null);
|
|
4180
4332
|
const { ref } = useScrollToError(validationState, features);
|
|
4181
4333
|
const onAddItem = () => {
|
|
4182
4334
|
onAdd();
|
|
@@ -4199,42 +4351,42 @@ function Repeatable(props) {
|
|
|
4199
4351
|
const onCancelEdit = () => {
|
|
4200
4352
|
setOpenModalType(null);
|
|
4201
4353
|
};
|
|
4202
|
-
return /* @__PURE__ */
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
title && /* @__PURE__ */
|
|
4205
|
-
description && /* @__PURE__ */
|
|
4206
|
-
/* @__PURE__ */
|
|
4354
|
+
return /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4355
|
+
/* @__PURE__ */ jsxs19("div", { ref, children: [
|
|
4356
|
+
title && /* @__PURE__ */ jsx74(Header6, { title }),
|
|
4357
|
+
description && /* @__PURE__ */ jsx74("p", { children: description }),
|
|
4358
|
+
/* @__PURE__ */ jsxs19(
|
|
4207
4359
|
"div",
|
|
4208
4360
|
{
|
|
4209
4361
|
className: (0, import_classnames7.default)("form-group", {
|
|
4210
4362
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
4211
4363
|
}),
|
|
4212
4364
|
children: [
|
|
4213
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
4214
|
-
/* @__PURE__ */
|
|
4365
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx74(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
4366
|
+
/* @__PURE__ */ jsx74(
|
|
4215
4367
|
NavigationOption,
|
|
4216
4368
|
{
|
|
4217
|
-
media: /* @__PURE__ */
|
|
4369
|
+
media: /* @__PURE__ */ jsx74(Plus, {}),
|
|
4218
4370
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4219
4371
|
showMediaAtAllSizes: true,
|
|
4220
4372
|
onClick: () => onAddItem()
|
|
4221
4373
|
}
|
|
4222
4374
|
),
|
|
4223
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
4375
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx74(InlineAlert3, { type: "negative", children: validationState.message })
|
|
4224
4376
|
]
|
|
4225
4377
|
}
|
|
4226
4378
|
)
|
|
4227
4379
|
] }),
|
|
4228
|
-
/* @__PURE__ */
|
|
4380
|
+
/* @__PURE__ */ jsx74(
|
|
4229
4381
|
Modal4,
|
|
4230
4382
|
{
|
|
4231
4383
|
open: openModalType !== null,
|
|
4232
4384
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4233
|
-
body: /* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
/* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4237
|
-
/* @__PURE__ */
|
|
4385
|
+
body: /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
4386
|
+
/* @__PURE__ */ jsx74("div", { className: "m-b-2", children: editableItem }),
|
|
4387
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
4388
|
+
/* @__PURE__ */ jsx74(Button8, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
4389
|
+
/* @__PURE__ */ jsx74(
|
|
4238
4390
|
Button8,
|
|
4239
4391
|
{
|
|
4240
4392
|
v2: true,
|
|
@@ -4256,10 +4408,10 @@ function ItemSummaryOption({
|
|
|
4256
4408
|
item,
|
|
4257
4409
|
onClick
|
|
4258
4410
|
}) {
|
|
4259
|
-
return /* @__PURE__ */
|
|
4411
|
+
return /* @__PURE__ */ jsx74(
|
|
4260
4412
|
NavigationOption,
|
|
4261
4413
|
{
|
|
4262
|
-
media: /* @__PURE__ */
|
|
4414
|
+
media: /* @__PURE__ */ jsx74(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
4263
4415
|
title: item.title,
|
|
4264
4416
|
content: item.description,
|
|
4265
4417
|
showMediaAtAllSizes: true,
|
|
@@ -4272,14 +4424,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
|
|
|
4272
4424
|
|
|
4273
4425
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
4274
4426
|
import { DefinitionList } from "@transferwise/components";
|
|
4275
|
-
import { Fragment as
|
|
4427
|
+
import { Fragment as Fragment10, jsx as jsx75, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4276
4428
|
var ReviewRenderer = {
|
|
4277
4429
|
canRenderType: "review",
|
|
4278
4430
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
4279
4431
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
4280
|
-
return /* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
4433
|
+
/* @__PURE__ */ jsx75(Header, { title, callToAction }),
|
|
4434
|
+
/* @__PURE__ */ jsx75("div", { className: margin, children: /* @__PURE__ */ jsx75(
|
|
4283
4435
|
DefinitionList,
|
|
4284
4436
|
{
|
|
4285
4437
|
layout: orientation,
|
|
@@ -4317,20 +4469,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
4317
4469
|
};
|
|
4318
4470
|
var getFieldLabel = (label, help, onClick) => {
|
|
4319
4471
|
if (help) {
|
|
4320
|
-
return /* @__PURE__ */
|
|
4472
|
+
return /* @__PURE__ */ jsxs20(Fragment10, { children: [
|
|
4321
4473
|
label,
|
|
4322
4474
|
" ",
|
|
4323
|
-
/* @__PURE__ */
|
|
4475
|
+
/* @__PURE__ */ jsx75(Help_default, { help, onClick })
|
|
4324
4476
|
] });
|
|
4325
4477
|
}
|
|
4326
4478
|
return label;
|
|
4327
4479
|
};
|
|
4328
4480
|
|
|
4329
4481
|
// ../renderers/src/ReviewRenderer.tsx
|
|
4330
|
-
import { ListItem as ListItem10, Markdown as
|
|
4482
|
+
import { ListItem as ListItem10, Markdown as Markdown5, Popover } from "@transferwise/components";
|
|
4331
4483
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
4332
|
-
import { useIntl as
|
|
4333
|
-
import { jsx as
|
|
4484
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
4485
|
+
import { jsx as jsx76, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4334
4486
|
var IGNORED_CONTROLS = [
|
|
4335
4487
|
"horizontal",
|
|
4336
4488
|
"horizontal-end-aligned",
|
|
@@ -4340,7 +4492,7 @@ var IGNORED_CONTROLS = [
|
|
|
4340
4492
|
var ReviewRenderer2 = {
|
|
4341
4493
|
canRenderType: "review",
|
|
4342
4494
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
4343
|
-
render: (props) => /* @__PURE__ */
|
|
4495
|
+
render: (props) => /* @__PURE__ */ jsx76(Review, __spreadValues({}, props))
|
|
4344
4496
|
};
|
|
4345
4497
|
var Review = ({
|
|
4346
4498
|
callToAction,
|
|
@@ -4351,9 +4503,9 @@ var Review = ({
|
|
|
4351
4503
|
title,
|
|
4352
4504
|
trackEvent
|
|
4353
4505
|
}) => {
|
|
4354
|
-
const intl =
|
|
4355
|
-
return /* @__PURE__ */
|
|
4356
|
-
/* @__PURE__ */
|
|
4506
|
+
const intl = useIntl12();
|
|
4507
|
+
return /* @__PURE__ */ jsxs21("div", { className: getMargin(margin), children: [
|
|
4508
|
+
/* @__PURE__ */ jsx76(Header, { title, callToAction }),
|
|
4357
4509
|
fields.map((field) => {
|
|
4358
4510
|
var _a, _b, _c;
|
|
4359
4511
|
const {
|
|
@@ -4371,7 +4523,7 @@ var Review = ({
|
|
|
4371
4523
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4372
4524
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4373
4525
|
};
|
|
4374
|
-
return /* @__PURE__ */
|
|
4526
|
+
return /* @__PURE__ */ jsx76(
|
|
4375
4527
|
ListItem10,
|
|
4376
4528
|
{
|
|
4377
4529
|
title: value,
|
|
@@ -4392,14 +4544,14 @@ var Review = ({
|
|
|
4392
4544
|
] });
|
|
4393
4545
|
};
|
|
4394
4546
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
4395
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ jsx76(Popover, { content: /* @__PURE__ */ jsx76(Markdown5, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx76(ListItem10.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx76(QuestionMarkCircle, {}) }) });
|
|
4396
4548
|
};
|
|
4397
4549
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
4398
4550
|
|
|
4399
4551
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4400
|
-
import { Input as Input5, InputGroup as InputGroup4, List, ListItem as ListItem11, Markdown as
|
|
4401
|
-
import { useState as
|
|
4402
|
-
import { useIntl as
|
|
4552
|
+
import { Input as Input5, InputGroup as InputGroup4, List, ListItem as ListItem11, Markdown as Markdown6 } from "@transferwise/components";
|
|
4553
|
+
import { useState as useState15 } from "react";
|
|
4554
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
4403
4555
|
|
|
4404
4556
|
// ../renderers/src/messages/search.messages.ts
|
|
4405
4557
|
import { defineMessages as defineMessages10 } from "react-intl";
|
|
@@ -4412,7 +4564,7 @@ var search_messages_default = defineMessages10({
|
|
|
4412
4564
|
});
|
|
4413
4565
|
|
|
4414
4566
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4415
|
-
import { useIntl as
|
|
4567
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
4416
4568
|
|
|
4417
4569
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
4418
4570
|
import { defineMessages as defineMessages11 } from "react-intl";
|
|
@@ -4436,19 +4588,19 @@ var generic_error_messages_default = defineMessages11({
|
|
|
4436
4588
|
|
|
4437
4589
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4438
4590
|
import { Link as DSLink2 } from "@transferwise/components";
|
|
4439
|
-
import { jsx as
|
|
4591
|
+
import { jsx as jsx77, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4440
4592
|
function ErrorResult({ state }) {
|
|
4441
|
-
const intl =
|
|
4442
|
-
return /* @__PURE__ */
|
|
4593
|
+
const intl = useIntl13();
|
|
4594
|
+
return /* @__PURE__ */ jsxs22("p", { className: "m-t-2", children: [
|
|
4443
4595
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
4444
4596
|
"\xA0",
|
|
4445
|
-
/* @__PURE__ */
|
|
4597
|
+
/* @__PURE__ */ jsx77(DSLink2, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
4446
4598
|
] });
|
|
4447
4599
|
}
|
|
4448
4600
|
|
|
4449
4601
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4450
4602
|
import { Search as Search2 } from "@transferwise/icons";
|
|
4451
|
-
import { Fragment as
|
|
4603
|
+
import { Fragment as Fragment11, jsx as jsx78, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4452
4604
|
function BlockSearchRendererComponent({
|
|
4453
4605
|
id,
|
|
4454
4606
|
hint,
|
|
@@ -4461,10 +4613,10 @@ function BlockSearchRendererComponent({
|
|
|
4461
4613
|
trackEvent,
|
|
4462
4614
|
onChange
|
|
4463
4615
|
}) {
|
|
4464
|
-
const [hasSearched, setHasSearched] =
|
|
4465
|
-
const { formatMessage } =
|
|
4466
|
-
return /* @__PURE__ */
|
|
4467
|
-
/* @__PURE__ */
|
|
4616
|
+
const [hasSearched, setHasSearched] = useState15(false);
|
|
4617
|
+
const { formatMessage } = useIntl14();
|
|
4618
|
+
return /* @__PURE__ */ jsxs23("div", { className: getMargin(margin), children: [
|
|
4619
|
+
/* @__PURE__ */ jsx78(
|
|
4468
4620
|
FieldInput_default,
|
|
4469
4621
|
{
|
|
4470
4622
|
id,
|
|
@@ -4473,7 +4625,7 @@ function BlockSearchRendererComponent({
|
|
|
4473
4625
|
help: "",
|
|
4474
4626
|
label: title,
|
|
4475
4627
|
features,
|
|
4476
|
-
children: /* @__PURE__ */
|
|
4628
|
+
children: /* @__PURE__ */ jsx78(InputGroup4, { addonStart: { content: /* @__PURE__ */ jsx78(Search2, { size: 24 }) }, children: /* @__PURE__ */ jsx78(
|
|
4477
4629
|
Input5,
|
|
4478
4630
|
{
|
|
4479
4631
|
id,
|
|
@@ -4493,7 +4645,7 @@ function BlockSearchRendererComponent({
|
|
|
4493
4645
|
) })
|
|
4494
4646
|
}
|
|
4495
4647
|
),
|
|
4496
|
-
isLoading ? /* @__PURE__ */
|
|
4648
|
+
isLoading ? /* @__PURE__ */ jsx78("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx78(SearchResultContent, { state, trackEvent })
|
|
4497
4649
|
] });
|
|
4498
4650
|
}
|
|
4499
4651
|
function SearchResultContent({
|
|
@@ -4502,38 +4654,38 @@ function SearchResultContent({
|
|
|
4502
4654
|
}) {
|
|
4503
4655
|
switch (state.type) {
|
|
4504
4656
|
case "error":
|
|
4505
|
-
return /* @__PURE__ */
|
|
4657
|
+
return /* @__PURE__ */ jsx78(ErrorResult, { state });
|
|
4506
4658
|
case "results":
|
|
4507
|
-
return /* @__PURE__ */
|
|
4659
|
+
return /* @__PURE__ */ jsx78(SearchResults, { state, trackEvent });
|
|
4508
4660
|
case "layout":
|
|
4509
|
-
return /* @__PURE__ */
|
|
4661
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
4510
4662
|
" ",
|
|
4511
4663
|
state.layout,
|
|
4512
4664
|
" "
|
|
4513
4665
|
] });
|
|
4514
4666
|
case "noResults":
|
|
4515
|
-
return /* @__PURE__ */
|
|
4667
|
+
return /* @__PURE__ */ jsx78(EmptySearchResult, { state });
|
|
4516
4668
|
case "pending":
|
|
4517
4669
|
default:
|
|
4518
4670
|
return null;
|
|
4519
4671
|
}
|
|
4520
4672
|
}
|
|
4521
4673
|
function EmptySearchResult({ state }) {
|
|
4522
|
-
return /* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ jsx78(Markdown6, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4523
4675
|
}
|
|
4524
4676
|
function SearchResults({
|
|
4525
4677
|
state,
|
|
4526
4678
|
trackEvent
|
|
4527
4679
|
}) {
|
|
4528
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ jsx78(List, { children: state.results.map((result) => {
|
|
4529
4681
|
const { media } = result;
|
|
4530
|
-
return /* @__PURE__ */
|
|
4682
|
+
return /* @__PURE__ */ jsx78(
|
|
4531
4683
|
ListItem11,
|
|
4532
4684
|
{
|
|
4533
4685
|
title: result.title,
|
|
4534
4686
|
subtitle: result.description,
|
|
4535
|
-
media: media ? /* @__PURE__ */
|
|
4536
|
-
control: /* @__PURE__ */
|
|
4687
|
+
media: media ? /* @__PURE__ */ jsx78(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
4688
|
+
control: /* @__PURE__ */ jsx78(
|
|
4537
4689
|
ListItem11.Navigation,
|
|
4538
4690
|
{
|
|
4539
4691
|
onClick: () => {
|
|
@@ -4552,11 +4704,11 @@ function SearchResults({
|
|
|
4552
4704
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
4553
4705
|
|
|
4554
4706
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
4555
|
-
import { Markdown as
|
|
4707
|
+
import { Markdown as Markdown7, Typeahead } from "@transferwise/components";
|
|
4556
4708
|
import { Search as Search3 } from "@transferwise/icons";
|
|
4557
|
-
import { useState as
|
|
4558
|
-
import { useIntl as
|
|
4559
|
-
import { jsx as
|
|
4709
|
+
import { useState as useState16 } from "react";
|
|
4710
|
+
import { useIntl as useIntl15 } from "react-intl";
|
|
4711
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
4560
4712
|
function InlineSearchRenderer({
|
|
4561
4713
|
id,
|
|
4562
4714
|
hint,
|
|
@@ -4568,9 +4720,9 @@ function InlineSearchRenderer({
|
|
|
4568
4720
|
onChange,
|
|
4569
4721
|
trackEvent
|
|
4570
4722
|
}) {
|
|
4571
|
-
const [hasSearched, setHasSearched] =
|
|
4572
|
-
const intl =
|
|
4573
|
-
return /* @__PURE__ */
|
|
4723
|
+
const [hasSearched, setHasSearched] = useState16(false);
|
|
4724
|
+
const intl = useIntl15();
|
|
4725
|
+
return /* @__PURE__ */ jsx79("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx79(
|
|
4574
4726
|
FieldInput_default,
|
|
4575
4727
|
{
|
|
4576
4728
|
id,
|
|
@@ -4579,7 +4731,7 @@ function InlineSearchRenderer({
|
|
|
4579
4731
|
help: "",
|
|
4580
4732
|
label: title,
|
|
4581
4733
|
features,
|
|
4582
|
-
children: /* @__PURE__ */
|
|
4734
|
+
children: /* @__PURE__ */ jsx79(
|
|
4583
4735
|
Typeahead,
|
|
4584
4736
|
{
|
|
4585
4737
|
id: "typeahead-input-id",
|
|
@@ -4588,10 +4740,10 @@ function InlineSearchRenderer({
|
|
|
4588
4740
|
size: "md",
|
|
4589
4741
|
placeholder: hint,
|
|
4590
4742
|
maxHeight: 100,
|
|
4591
|
-
footer: /* @__PURE__ */
|
|
4743
|
+
footer: /* @__PURE__ */ jsx79(TypeaheadFooter, { state, isLoading }),
|
|
4592
4744
|
multiple: false,
|
|
4593
4745
|
clearable: false,
|
|
4594
|
-
addon: /* @__PURE__ */
|
|
4746
|
+
addon: /* @__PURE__ */ jsx79(Search3, { size: 24 }),
|
|
4595
4747
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
4596
4748
|
minQueryLength: 1,
|
|
4597
4749
|
onChange: (values) => {
|
|
@@ -4628,28 +4780,28 @@ function mapResultToTypeaheadOption(result) {
|
|
|
4628
4780
|
};
|
|
4629
4781
|
}
|
|
4630
4782
|
function TypeaheadFooter({ state, isLoading }) {
|
|
4631
|
-
const { formatMessage } =
|
|
4783
|
+
const { formatMessage } = useIntl15();
|
|
4632
4784
|
if (state.type === "layout") {
|
|
4633
|
-
return /* @__PURE__ */
|
|
4785
|
+
return /* @__PURE__ */ jsx79("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
4634
4786
|
}
|
|
4635
4787
|
if (state.type === "noResults") {
|
|
4636
|
-
return /* @__PURE__ */
|
|
4788
|
+
return /* @__PURE__ */ jsx79(Markdown7, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4637
4789
|
}
|
|
4638
4790
|
if (state.type === "error") {
|
|
4639
|
-
return /* @__PURE__ */
|
|
4791
|
+
return /* @__PURE__ */ jsx79("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx79(ErrorResult, { state }) });
|
|
4640
4792
|
}
|
|
4641
4793
|
if (state.type === "pending" || isLoading) {
|
|
4642
|
-
return /* @__PURE__ */
|
|
4794
|
+
return /* @__PURE__ */ jsx79("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
4643
4795
|
}
|
|
4644
4796
|
return null;
|
|
4645
4797
|
}
|
|
4646
4798
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
4647
4799
|
|
|
4648
4800
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
4649
|
-
import { jsx as
|
|
4801
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
4650
4802
|
var SearchRenderer = {
|
|
4651
4803
|
canRenderType: "search",
|
|
4652
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
4804
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx80(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx80(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
4653
4805
|
};
|
|
4654
4806
|
var SearchRenderer_default = SearchRenderer;
|
|
4655
4807
|
|
|
@@ -4678,12 +4830,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
4678
4830
|
};
|
|
4679
4831
|
|
|
4680
4832
|
// ../renderers/src/SectionRenderer.tsx
|
|
4681
|
-
import { jsx as
|
|
4833
|
+
import { jsx as jsx81, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4682
4834
|
var SectionRenderer = {
|
|
4683
4835
|
canRenderType: "section",
|
|
4684
4836
|
render: ({ children, callToAction, margin, title }) => {
|
|
4685
|
-
return /* @__PURE__ */
|
|
4686
|
-
(title || callToAction) && /* @__PURE__ */
|
|
4837
|
+
return /* @__PURE__ */ jsxs24("section", { className: getMargin(margin), children: [
|
|
4838
|
+
(title || callToAction) && /* @__PURE__ */ jsx81(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
4687
4839
|
children
|
|
4688
4840
|
] });
|
|
4689
4841
|
}
|
|
@@ -4692,7 +4844,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
4692
4844
|
|
|
4693
4845
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
4694
4846
|
import { RadioGroup } from "@transferwise/components";
|
|
4695
|
-
import { Fragment as
|
|
4847
|
+
import { Fragment as Fragment12, jsx as jsx82, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4696
4848
|
function RadioInputRendererComponent(props) {
|
|
4697
4849
|
const {
|
|
4698
4850
|
id,
|
|
@@ -4707,8 +4859,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4707
4859
|
validationState,
|
|
4708
4860
|
onSelect
|
|
4709
4861
|
} = props;
|
|
4710
|
-
return /* @__PURE__ */
|
|
4711
|
-
/* @__PURE__ */
|
|
4862
|
+
return /* @__PURE__ */ jsxs25(Fragment12, { children: [
|
|
4863
|
+
/* @__PURE__ */ jsx82(
|
|
4712
4864
|
FieldInput_default,
|
|
4713
4865
|
{
|
|
4714
4866
|
id,
|
|
@@ -4717,7 +4869,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4717
4869
|
description,
|
|
4718
4870
|
validation: validationState,
|
|
4719
4871
|
features,
|
|
4720
|
-
children: /* @__PURE__ */
|
|
4872
|
+
children: /* @__PURE__ */ jsx82("span", { children: /* @__PURE__ */ jsx82(
|
|
4721
4873
|
RadioGroup,
|
|
4722
4874
|
{
|
|
4723
4875
|
name: id,
|
|
@@ -4726,7 +4878,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4726
4878
|
value: index,
|
|
4727
4879
|
secondary: option.description,
|
|
4728
4880
|
disabled: option.disabled || disabled,
|
|
4729
|
-
avatar: /* @__PURE__ */
|
|
4881
|
+
avatar: /* @__PURE__ */ jsx82(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4730
4882
|
})),
|
|
4731
4883
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
4732
4884
|
onChange: onSelect
|
|
@@ -4742,7 +4894,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4742
4894
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
4743
4895
|
import { Tabs } from "@transferwise/components";
|
|
4744
4896
|
import { useEffect as useEffect12 } from "react";
|
|
4745
|
-
import { Fragment as
|
|
4897
|
+
import { Fragment as Fragment13, jsx as jsx83, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4746
4898
|
function TabInputRendererComponent(props) {
|
|
4747
4899
|
const {
|
|
4748
4900
|
id,
|
|
@@ -4762,8 +4914,8 @@ function TabInputRendererComponent(props) {
|
|
|
4762
4914
|
onSelect(0);
|
|
4763
4915
|
}
|
|
4764
4916
|
}, [selectedIndex, onSelect, options.length]);
|
|
4765
|
-
return /* @__PURE__ */
|
|
4766
|
-
/* @__PURE__ */
|
|
4917
|
+
return /* @__PURE__ */ jsxs26(Fragment13, { children: [
|
|
4918
|
+
/* @__PURE__ */ jsx83(
|
|
4767
4919
|
FieldInput_default,
|
|
4768
4920
|
{
|
|
4769
4921
|
id,
|
|
@@ -4772,7 +4924,7 @@ function TabInputRendererComponent(props) {
|
|
|
4772
4924
|
description,
|
|
4773
4925
|
validation: validationState,
|
|
4774
4926
|
features,
|
|
4775
|
-
children: /* @__PURE__ */
|
|
4927
|
+
children: /* @__PURE__ */ jsx83(
|
|
4776
4928
|
Tabs,
|
|
4777
4929
|
{
|
|
4778
4930
|
name: id,
|
|
@@ -4781,7 +4933,7 @@ function TabInputRendererComponent(props) {
|
|
|
4781
4933
|
title: option.title,
|
|
4782
4934
|
// if we pass null, we get some props-types console errors
|
|
4783
4935
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
4784
|
-
content: /* @__PURE__ */
|
|
4936
|
+
content: /* @__PURE__ */ jsx83(Fragment13, {}),
|
|
4785
4937
|
disabled: option.disabled || disabled
|
|
4786
4938
|
})),
|
|
4787
4939
|
onTabSelect: onSelect
|
|
@@ -4796,7 +4948,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
4796
4948
|
|
|
4797
4949
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
4798
4950
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
4799
|
-
import { Fragment as
|
|
4951
|
+
import { Fragment as Fragment14, jsx as jsx84, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4800
4952
|
function SelectInputRendererComponent(props) {
|
|
4801
4953
|
const {
|
|
4802
4954
|
id,
|
|
@@ -4837,13 +4989,13 @@ function SelectInputRendererComponent(props) {
|
|
|
4837
4989
|
} : {
|
|
4838
4990
|
title: option.title,
|
|
4839
4991
|
description: option.description,
|
|
4840
|
-
icon: /* @__PURE__ */
|
|
4992
|
+
icon: /* @__PURE__ */ jsx84(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4841
4993
|
};
|
|
4842
|
-
return /* @__PURE__ */
|
|
4994
|
+
return /* @__PURE__ */ jsx84(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
4843
4995
|
};
|
|
4844
4996
|
const extraProps = { autoComplete };
|
|
4845
|
-
return /* @__PURE__ */
|
|
4846
|
-
/* @__PURE__ */
|
|
4997
|
+
return /* @__PURE__ */ jsxs27(Fragment14, { children: [
|
|
4998
|
+
/* @__PURE__ */ jsx84(
|
|
4847
4999
|
FieldInput_default,
|
|
4848
5000
|
{
|
|
4849
5001
|
id,
|
|
@@ -4852,7 +5004,7 @@ function SelectInputRendererComponent(props) {
|
|
|
4852
5004
|
description,
|
|
4853
5005
|
validation: validationState,
|
|
4854
5006
|
features,
|
|
4855
|
-
children: /* @__PURE__ */
|
|
5007
|
+
children: /* @__PURE__ */ jsx84(
|
|
4856
5008
|
SelectInput2,
|
|
4857
5009
|
__spreadValues({
|
|
4858
5010
|
name: id,
|
|
@@ -4875,7 +5027,7 @@ function SelectInputRendererComponent(props) {
|
|
|
4875
5027
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
4876
5028
|
import { useEffect as useEffect13 } from "react";
|
|
4877
5029
|
import { SegmentedControl } from "@transferwise/components";
|
|
4878
|
-
import { Fragment as
|
|
5030
|
+
import { Fragment as Fragment15, jsx as jsx85, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4879
5031
|
function SegmentedInputRendererComponent(props) {
|
|
4880
5032
|
const {
|
|
4881
5033
|
id,
|
|
@@ -4894,8 +5046,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4894
5046
|
onSelect(0);
|
|
4895
5047
|
}
|
|
4896
5048
|
}, [selectedIndex, onSelect, options.length]);
|
|
4897
|
-
return /* @__PURE__ */
|
|
4898
|
-
/* @__PURE__ */
|
|
5049
|
+
return /* @__PURE__ */ jsxs28(Fragment15, { children: [
|
|
5050
|
+
/* @__PURE__ */ jsx85(
|
|
4899
5051
|
FieldInput_default,
|
|
4900
5052
|
{
|
|
4901
5053
|
id,
|
|
@@ -4904,7 +5056,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4904
5056
|
description,
|
|
4905
5057
|
validation: validationState,
|
|
4906
5058
|
features,
|
|
4907
|
-
children: /* @__PURE__ */
|
|
5059
|
+
children: /* @__PURE__ */ jsx85(
|
|
4908
5060
|
SegmentedControl,
|
|
4909
5061
|
{
|
|
4910
5062
|
name: `${id}-segmented-control`,
|
|
@@ -4921,14 +5073,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4921
5073
|
)
|
|
4922
5074
|
}
|
|
4923
5075
|
),
|
|
4924
|
-
/* @__PURE__ */
|
|
5076
|
+
/* @__PURE__ */ jsx85("div", { id: `${id}-children`, children })
|
|
4925
5077
|
] });
|
|
4926
5078
|
}
|
|
4927
5079
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
4928
5080
|
|
|
4929
5081
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
4930
5082
|
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem12 } from "@transferwise/components";
|
|
4931
|
-
import { jsx as
|
|
5083
|
+
import { jsx as jsx86, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4932
5084
|
function RadioItemRendererComponent(props) {
|
|
4933
5085
|
const {
|
|
4934
5086
|
id,
|
|
@@ -4944,22 +5096,22 @@ function RadioItemRendererComponent(props) {
|
|
|
4944
5096
|
onSelect
|
|
4945
5097
|
} = props;
|
|
4946
5098
|
const { ref } = useScrollToError(validationState, features);
|
|
4947
|
-
return /* @__PURE__ */
|
|
4948
|
-
rootTitle && /* @__PURE__ */
|
|
5099
|
+
return /* @__PURE__ */ jsxs29("div", { ref, children: [
|
|
5100
|
+
rootTitle && /* @__PURE__ */ jsx86(
|
|
4949
5101
|
Header8,
|
|
4950
5102
|
{
|
|
4951
5103
|
as: "h2",
|
|
4952
|
-
title: help ? /* @__PURE__ */
|
|
5104
|
+
title: help ? /* @__PURE__ */ jsx86(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
4953
5105
|
}
|
|
4954
5106
|
),
|
|
4955
|
-
rootDescription && /* @__PURE__ */
|
|
4956
|
-
/* @__PURE__ */
|
|
4957
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
5107
|
+
rootDescription && /* @__PURE__ */ jsx86("p", { children: rootDescription }),
|
|
5108
|
+
/* @__PURE__ */ jsx86(List2, { children: options.map(
|
|
5109
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx86(
|
|
4958
5110
|
ListItem12,
|
|
4959
5111
|
__spreadValues({
|
|
4960
5112
|
title,
|
|
4961
5113
|
subtitle: description,
|
|
4962
|
-
control: /* @__PURE__ */
|
|
5114
|
+
control: /* @__PURE__ */ jsx86(
|
|
4963
5115
|
ListItem12.Radio,
|
|
4964
5116
|
{
|
|
4965
5117
|
name: title,
|
|
@@ -4975,28 +5127,28 @@ function RadioItemRendererComponent(props) {
|
|
|
4975
5127
|
title
|
|
4976
5128
|
)
|
|
4977
5129
|
) }, `${id}-${selectedIndex}`),
|
|
4978
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
5130
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx86(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
4979
5131
|
children
|
|
4980
5132
|
] });
|
|
4981
5133
|
}
|
|
4982
5134
|
|
|
4983
5135
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
4984
|
-
import { jsx as
|
|
5136
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
4985
5137
|
var SelectInputRenderer = {
|
|
4986
5138
|
canRenderType: "input-select",
|
|
4987
5139
|
render: (props) => {
|
|
4988
5140
|
switch (props.control) {
|
|
4989
5141
|
case "radio":
|
|
4990
|
-
return /* @__PURE__ */
|
|
5142
|
+
return /* @__PURE__ */ jsx87(RadioInputRendererComponent, __spreadValues({}, props));
|
|
4991
5143
|
case "radio-item":
|
|
4992
|
-
return /* @__PURE__ */
|
|
5144
|
+
return /* @__PURE__ */ jsx87(RadioItemRendererComponent, __spreadValues({}, props));
|
|
4993
5145
|
case "tab":
|
|
4994
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
5146
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx87(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx87(TabInputRendererComponent, __spreadValues({}, props));
|
|
4995
5147
|
case "segmented":
|
|
4996
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
5148
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx87(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx87(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
4997
5149
|
case "select":
|
|
4998
5150
|
default:
|
|
4999
|
-
return /* @__PURE__ */
|
|
5151
|
+
return /* @__PURE__ */ jsx87(SelectInputRendererComponent, __spreadValues({}, props));
|
|
5000
5152
|
}
|
|
5001
5153
|
}
|
|
5002
5154
|
};
|
|
@@ -5004,20 +5156,20 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
5004
5156
|
|
|
5005
5157
|
// ../renderers/src/StatusListRenderer.tsx
|
|
5006
5158
|
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem13 } from "@transferwise/components";
|
|
5007
|
-
import { jsx as
|
|
5159
|
+
import { jsx as jsx88, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5008
5160
|
var StatusListRenderer = {
|
|
5009
5161
|
canRenderType: "status-list",
|
|
5010
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
5011
|
-
title ? /* @__PURE__ */
|
|
5162
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs30("div", { className: getMargin(margin), children: [
|
|
5163
|
+
title ? /* @__PURE__ */ jsx88(Header9, { title }) : null,
|
|
5012
5164
|
items.map((item) => {
|
|
5013
5165
|
const { callToAction, description, title: itemTitle } = item;
|
|
5014
|
-
return /* @__PURE__ */
|
|
5166
|
+
return /* @__PURE__ */ jsx88(
|
|
5015
5167
|
ListItem13,
|
|
5016
5168
|
{
|
|
5017
5169
|
title: itemTitle,
|
|
5018
5170
|
subtitle: description,
|
|
5019
|
-
media: /* @__PURE__ */
|
|
5020
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
5171
|
+
media: /* @__PURE__ */ jsx88(StatusListItemMedia, __spreadValues({}, item)),
|
|
5172
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx88(
|
|
5021
5173
|
ListItem13.AdditionalInfo,
|
|
5022
5174
|
{
|
|
5023
5175
|
action: __spreadValues({
|
|
@@ -5036,10 +5188,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
5036
5188
|
return void 0;
|
|
5037
5189
|
}
|
|
5038
5190
|
if ("name" in icon) {
|
|
5039
|
-
return /* @__PURE__ */
|
|
5191
|
+
return /* @__PURE__ */ jsx88(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx88(DynamicIcon_default, { name: icon.name }) });
|
|
5040
5192
|
}
|
|
5041
5193
|
if ("text" in icon) {
|
|
5042
|
-
return /* @__PURE__ */
|
|
5194
|
+
return /* @__PURE__ */ jsx88(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
5043
5195
|
}
|
|
5044
5196
|
return void 0;
|
|
5045
5197
|
};
|
|
@@ -5075,12 +5227,12 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
5075
5227
|
|
|
5076
5228
|
// ../renderers/src/step/StepHeader.tsx
|
|
5077
5229
|
import { Title as Title2 } from "@transferwise/components";
|
|
5078
|
-
import { Fragment as
|
|
5230
|
+
import { Fragment as Fragment16, jsx as jsx89, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5079
5231
|
var StepHeader = ({ title, description, tags }) => {
|
|
5080
5232
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
5081
|
-
return /* @__PURE__ */
|
|
5082
|
-
title ? /* @__PURE__ */
|
|
5083
|
-
description ? /* @__PURE__ */
|
|
5233
|
+
return /* @__PURE__ */ jsxs31(Fragment16, { children: [
|
|
5234
|
+
title ? /* @__PURE__ */ jsx89(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
5235
|
+
description ? /* @__PURE__ */ jsx89("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
5084
5236
|
] });
|
|
5085
5237
|
};
|
|
5086
5238
|
var getHeaderStyle = (tags) => {
|
|
@@ -5093,7 +5245,7 @@ var getHeaderStyle = (tags) => {
|
|
|
5093
5245
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5094
5246
|
import { IconButton } from "@transferwise/components";
|
|
5095
5247
|
import { ArrowLeft } from "@transferwise/icons";
|
|
5096
|
-
import { useIntl as
|
|
5248
|
+
import { useIntl as useIntl16 } from "react-intl";
|
|
5097
5249
|
|
|
5098
5250
|
// ../renderers/src/messages/back.messages.ts
|
|
5099
5251
|
import { defineMessages as defineMessages12 } from "react-intl";
|
|
@@ -5106,30 +5258,30 @@ var back_messages_default = defineMessages12({
|
|
|
5106
5258
|
});
|
|
5107
5259
|
|
|
5108
5260
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5109
|
-
import { jsx as
|
|
5261
|
+
import { jsx as jsx90, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5110
5262
|
function BackButton({ title, onClick }) {
|
|
5111
|
-
const { formatMessage } =
|
|
5112
|
-
return /* @__PURE__ */
|
|
5113
|
-
/* @__PURE__ */
|
|
5114
|
-
/* @__PURE__ */
|
|
5263
|
+
const { formatMessage } = useIntl16();
|
|
5264
|
+
return /* @__PURE__ */ jsxs32(IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
5265
|
+
/* @__PURE__ */ jsx90("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
5266
|
+
/* @__PURE__ */ jsx90(ArrowLeft, {})
|
|
5115
5267
|
] });
|
|
5116
5268
|
}
|
|
5117
5269
|
|
|
5118
5270
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
5119
5271
|
import { Button as Button9, IconButton as IconButton2 } from "@transferwise/components";
|
|
5120
|
-
import { jsx as
|
|
5272
|
+
import { jsx as jsx91, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5121
5273
|
var Toolbar = ({ items }) => {
|
|
5122
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
5274
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx91("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx91(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
5123
5275
|
};
|
|
5124
5276
|
function ToolbarButton(props) {
|
|
5125
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
5277
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx91(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx91(TextToolbarButton, __spreadValues({}, props));
|
|
5126
5278
|
}
|
|
5127
5279
|
function MediaToolbarButton(props) {
|
|
5128
5280
|
var _a;
|
|
5129
5281
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
5130
5282
|
const priority = getIconButtonPriority(control);
|
|
5131
5283
|
const type = getSentiment2(context);
|
|
5132
|
-
return /* @__PURE__ */
|
|
5284
|
+
return /* @__PURE__ */ jsxs33(
|
|
5133
5285
|
IconButton2,
|
|
5134
5286
|
{
|
|
5135
5287
|
className: "df-toolbar-button",
|
|
@@ -5139,7 +5291,7 @@ function MediaToolbarButton(props) {
|
|
|
5139
5291
|
type,
|
|
5140
5292
|
onClick,
|
|
5141
5293
|
children: [
|
|
5142
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
5294
|
+
accessibilityDescription ? /* @__PURE__ */ jsx91("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
5143
5295
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
5144
5296
|
]
|
|
5145
5297
|
}
|
|
@@ -5150,7 +5302,7 @@ function TextToolbarButton(props) {
|
|
|
5150
5302
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
5151
5303
|
const priority = getPriority2(control);
|
|
5152
5304
|
const sentiment = getSentiment2(context);
|
|
5153
|
-
return /* @__PURE__ */
|
|
5305
|
+
return /* @__PURE__ */ jsx91(
|
|
5154
5306
|
Button9,
|
|
5155
5307
|
{
|
|
5156
5308
|
v2: true,
|
|
@@ -5180,18 +5332,18 @@ var getIconButtonPriority = (control) => {
|
|
|
5180
5332
|
};
|
|
5181
5333
|
|
|
5182
5334
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
5183
|
-
import { jsx as
|
|
5335
|
+
import { jsx as jsx92, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5184
5336
|
function TopBar({ back, toolbar, tags }) {
|
|
5185
5337
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
5186
5338
|
const backCTA = isBackAllowed ? back : void 0;
|
|
5187
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
5188
|
-
backCTA ? /* @__PURE__ */
|
|
5189
|
-
toolbar ? /* @__PURE__ */
|
|
5339
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs34("div", { className: "d-flex m-b-2", children: [
|
|
5340
|
+
backCTA ? /* @__PURE__ */ jsx92(BackButton, __spreadValues({}, backCTA)) : null,
|
|
5341
|
+
toolbar ? /* @__PURE__ */ jsx92(Toolbar, __spreadValues({}, toolbar)) : null
|
|
5190
5342
|
] }) : null;
|
|
5191
5343
|
}
|
|
5192
5344
|
|
|
5193
5345
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
5194
|
-
import { jsx as
|
|
5346
|
+
import { jsx as jsx93, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5195
5347
|
var SplashCelebrationStepRenderer = {
|
|
5196
5348
|
canRenderType: "step",
|
|
5197
5349
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -5200,16 +5352,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
5200
5352
|
function SplashCelebrationStepRendererComponent(props) {
|
|
5201
5353
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
5202
5354
|
useCustomTheme("forest-green", trackEvent);
|
|
5203
|
-
return /* @__PURE__ */
|
|
5204
|
-
/* @__PURE__ */
|
|
5205
|
-
title || description ? /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ jsxs35("div", { className: "splash-screen m-t-5", children: [
|
|
5356
|
+
/* @__PURE__ */ jsx93(TopBar, { back, toolbar, tags }),
|
|
5357
|
+
title || description ? /* @__PURE__ */ jsx93("div", { className: "m-b-4", children: /* @__PURE__ */ jsx93(StepHeader, { title, description, tags }) }) : void 0,
|
|
5206
5358
|
children,
|
|
5207
|
-
/* @__PURE__ */
|
|
5359
|
+
/* @__PURE__ */ jsx93(StepFooter, { footer, tags })
|
|
5208
5360
|
] });
|
|
5209
5361
|
}
|
|
5210
5362
|
|
|
5211
5363
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
5212
|
-
import { jsx as
|
|
5364
|
+
import { jsx as jsx94, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5213
5365
|
var SplashStepRenderer = {
|
|
5214
5366
|
canRenderType: "step",
|
|
5215
5367
|
canRender: ({ control }) => control === "splash",
|
|
@@ -5217,55 +5369,55 @@ var SplashStepRenderer = {
|
|
|
5217
5369
|
};
|
|
5218
5370
|
function SplashStepRendererComponent(props) {
|
|
5219
5371
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
5220
|
-
return /* @__PURE__ */
|
|
5221
|
-
/* @__PURE__ */
|
|
5222
|
-
title || description ? /* @__PURE__ */
|
|
5372
|
+
return /* @__PURE__ */ jsxs36("div", { className: "splash-screen m-t-5", children: [
|
|
5373
|
+
/* @__PURE__ */ jsx94(TopBar, { back, toolbar, tags }),
|
|
5374
|
+
title || description ? /* @__PURE__ */ jsx94("div", { className: "m-b-4", children: /* @__PURE__ */ jsx94(StepHeader, { title, description, tags }) }) : void 0,
|
|
5223
5375
|
children,
|
|
5224
|
-
/* @__PURE__ */
|
|
5376
|
+
/* @__PURE__ */ jsx94(StepFooter, { footer, tags })
|
|
5225
5377
|
] });
|
|
5226
5378
|
}
|
|
5227
5379
|
|
|
5228
5380
|
// ../renderers/src/step/StepRenderer.tsx
|
|
5229
|
-
import { Alert
|
|
5230
|
-
import { jsx as
|
|
5381
|
+
import { Alert } from "@transferwise/components";
|
|
5382
|
+
import { jsx as jsx95, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5231
5383
|
var StepRenderer = {
|
|
5232
5384
|
canRenderType: "step",
|
|
5233
5385
|
render: StepRendererComponent
|
|
5234
5386
|
};
|
|
5235
5387
|
function StepRendererComponent(props) {
|
|
5236
5388
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
5237
|
-
return /* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5239
|
-
title || description ? /* @__PURE__ */
|
|
5240
|
-
error ? /* @__PURE__ */
|
|
5389
|
+
return /* @__PURE__ */ jsxs37("div", { children: [
|
|
5390
|
+
/* @__PURE__ */ jsx95(TopBar, { back, toolbar, tags }),
|
|
5391
|
+
title || description ? /* @__PURE__ */ jsx95("div", { className: "m-b-4", children: /* @__PURE__ */ jsx95(StepHeader, { title, description, tags }) }) : void 0,
|
|
5392
|
+
error ? /* @__PURE__ */ jsx95(Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
5241
5393
|
children,
|
|
5242
|
-
/* @__PURE__ */
|
|
5394
|
+
/* @__PURE__ */ jsx95(StepFooter, { footer, tags })
|
|
5243
5395
|
] });
|
|
5244
5396
|
}
|
|
5245
5397
|
|
|
5246
5398
|
// ../renderers/src/TabsRenderer.tsx
|
|
5247
5399
|
import { Chips as Chips2, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
5248
|
-
import { useState as
|
|
5249
|
-
import { jsx as
|
|
5400
|
+
import { useState as useState17 } from "react";
|
|
5401
|
+
import { jsx as jsx96, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5250
5402
|
var TabsRenderer = {
|
|
5251
5403
|
canRenderType: "tabs",
|
|
5252
5404
|
render: (props) => {
|
|
5253
5405
|
switch (props.control) {
|
|
5254
5406
|
case "segmented":
|
|
5255
5407
|
if (props.tabs.length > 3) {
|
|
5256
|
-
return /* @__PURE__ */
|
|
5408
|
+
return /* @__PURE__ */ jsx96(TabsRendererComponent, __spreadValues({}, props));
|
|
5257
5409
|
}
|
|
5258
|
-
return /* @__PURE__ */
|
|
5410
|
+
return /* @__PURE__ */ jsx96(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
5259
5411
|
case "chips":
|
|
5260
|
-
return /* @__PURE__ */
|
|
5412
|
+
return /* @__PURE__ */ jsx96(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
5261
5413
|
default:
|
|
5262
|
-
return /* @__PURE__ */
|
|
5414
|
+
return /* @__PURE__ */ jsx96(TabsRendererComponent, __spreadValues({}, props));
|
|
5263
5415
|
}
|
|
5264
5416
|
}
|
|
5265
5417
|
};
|
|
5266
5418
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
5267
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5268
|
-
return /* @__PURE__ */
|
|
5419
|
+
const [selectedIndex, setSelectedIndex] = useState17(0);
|
|
5420
|
+
return /* @__PURE__ */ jsx96("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx96(
|
|
5269
5421
|
Tabs2,
|
|
5270
5422
|
{
|
|
5271
5423
|
name: uid,
|
|
@@ -5273,7 +5425,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5273
5425
|
tabs: tabs.map((option) => ({
|
|
5274
5426
|
title: option.title,
|
|
5275
5427
|
disabled: false,
|
|
5276
|
-
content: /* @__PURE__ */
|
|
5428
|
+
content: /* @__PURE__ */ jsxs38("div", { className: "m-t-2", children: [
|
|
5277
5429
|
" ",
|
|
5278
5430
|
option.children,
|
|
5279
5431
|
" "
|
|
@@ -5285,9 +5437,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5285
5437
|
}
|
|
5286
5438
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
5287
5439
|
var _a;
|
|
5288
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5289
|
-
return /* @__PURE__ */
|
|
5290
|
-
/* @__PURE__ */
|
|
5440
|
+
const [selectedIndex, setSelectedIndex] = useState17(0);
|
|
5441
|
+
return /* @__PURE__ */ jsxs38("div", { className: getMargin(margin), children: [
|
|
5442
|
+
/* @__PURE__ */ jsx96(
|
|
5291
5443
|
SegmentedControl2,
|
|
5292
5444
|
{
|
|
5293
5445
|
name: uid,
|
|
@@ -5302,14 +5454,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5302
5454
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
5303
5455
|
}
|
|
5304
5456
|
),
|
|
5305
|
-
/* @__PURE__ */
|
|
5457
|
+
/* @__PURE__ */ jsx96("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5306
5458
|
] });
|
|
5307
5459
|
}
|
|
5308
5460
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
5309
5461
|
var _a;
|
|
5310
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5311
|
-
return /* @__PURE__ */
|
|
5312
|
-
/* @__PURE__ */
|
|
5462
|
+
const [selectedIndex, setSelectedIndex] = useState17(0);
|
|
5463
|
+
return /* @__PURE__ */ jsxs38("div", { className: getMargin(margin), children: [
|
|
5464
|
+
/* @__PURE__ */ jsx96("div", { className: "chips-container", children: /* @__PURE__ */ jsx96(
|
|
5313
5465
|
Chips2,
|
|
5314
5466
|
{
|
|
5315
5467
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -5317,7 +5469,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
|
5317
5469
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
5318
5470
|
}
|
|
5319
5471
|
) }),
|
|
5320
|
-
/* @__PURE__ */
|
|
5472
|
+
/* @__PURE__ */ jsx96("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5321
5473
|
] });
|
|
5322
5474
|
}
|
|
5323
5475
|
|
|
@@ -5332,7 +5484,7 @@ import {
|
|
|
5332
5484
|
TextArea,
|
|
5333
5485
|
TextareaWithDisplayFormat
|
|
5334
5486
|
} from "@transferwise/components";
|
|
5335
|
-
import { jsx as
|
|
5487
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
5336
5488
|
var commonKeys = [
|
|
5337
5489
|
"autoComplete",
|
|
5338
5490
|
"autoCapitalize",
|
|
@@ -5351,12 +5503,12 @@ function VariableTextInput(inputProps) {
|
|
|
5351
5503
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
5352
5504
|
switch (control) {
|
|
5353
5505
|
case "email":
|
|
5354
|
-
return /* @__PURE__ */
|
|
5506
|
+
return /* @__PURE__ */ jsx97(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
5355
5507
|
case "password":
|
|
5356
|
-
return /* @__PURE__ */
|
|
5508
|
+
return /* @__PURE__ */ jsx97(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
5357
5509
|
case "numeric": {
|
|
5358
5510
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
5359
|
-
return /* @__PURE__ */
|
|
5511
|
+
return /* @__PURE__ */ jsx97(
|
|
5360
5512
|
TextInput,
|
|
5361
5513
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
5362
5514
|
onChange: (newValue) => {
|
|
@@ -5367,9 +5519,9 @@ function VariableTextInput(inputProps) {
|
|
|
5367
5519
|
);
|
|
5368
5520
|
}
|
|
5369
5521
|
case "phone-number":
|
|
5370
|
-
return /* @__PURE__ */
|
|
5522
|
+
return /* @__PURE__ */ jsx97(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
5371
5523
|
default: {
|
|
5372
|
-
return /* @__PURE__ */
|
|
5524
|
+
return /* @__PURE__ */ jsx97(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
5373
5525
|
}
|
|
5374
5526
|
}
|
|
5375
5527
|
}
|
|
@@ -5377,11 +5529,11 @@ function TextInput(props) {
|
|
|
5377
5529
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
5378
5530
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
5379
5531
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input6;
|
|
5380
|
-
return displayFormat ? /* @__PURE__ */
|
|
5532
|
+
return displayFormat ? /* @__PURE__ */ jsx97(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx97(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
5381
5533
|
}
|
|
5382
5534
|
|
|
5383
5535
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5384
|
-
import { jsx as
|
|
5536
|
+
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
5385
5537
|
var TextInputRenderer = {
|
|
5386
5538
|
canRenderType: "input-text",
|
|
5387
5539
|
render: (props) => {
|
|
@@ -5414,7 +5566,7 @@ var TextInputRenderer = {
|
|
|
5414
5566
|
}
|
|
5415
5567
|
}
|
|
5416
5568
|
});
|
|
5417
|
-
return /* @__PURE__ */
|
|
5569
|
+
return /* @__PURE__ */ jsx98(
|
|
5418
5570
|
FieldInput_default,
|
|
5419
5571
|
{
|
|
5420
5572
|
id,
|
|
@@ -5425,7 +5577,7 @@ var TextInputRenderer = {
|
|
|
5425
5577
|
loadingState: props.fieldLoadingState,
|
|
5426
5578
|
help,
|
|
5427
5579
|
features: props.features,
|
|
5428
|
-
children: /* @__PURE__ */
|
|
5580
|
+
children: /* @__PURE__ */ jsx98(InputGroup5, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx98(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
5429
5581
|
}
|
|
5430
5582
|
);
|
|
5431
5583
|
}
|
|
@@ -5439,7 +5591,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
5439
5591
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
5440
5592
|
|
|
5441
5593
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
5442
|
-
import { jsx as
|
|
5594
|
+
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
5443
5595
|
var UploadInputRenderer = {
|
|
5444
5596
|
canRenderType: "input-upload",
|
|
5445
5597
|
render: (props) => {
|
|
@@ -5466,7 +5618,7 @@ var UploadInputRenderer = {
|
|
|
5466
5618
|
};
|
|
5467
5619
|
return (
|
|
5468
5620
|
// We don't pass help here as there is no sensible place to display it
|
|
5469
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ jsx99(
|
|
5470
5622
|
UploadFieldInput_default,
|
|
5471
5623
|
{
|
|
5472
5624
|
id,
|
|
@@ -5474,7 +5626,7 @@ var UploadInputRenderer = {
|
|
|
5474
5626
|
description: void 0,
|
|
5475
5627
|
validation: validationState,
|
|
5476
5628
|
features,
|
|
5477
|
-
children: /* @__PURE__ */
|
|
5629
|
+
children: /* @__PURE__ */ jsx99(
|
|
5478
5630
|
UploadInput2,
|
|
5479
5631
|
{
|
|
5480
5632
|
id,
|
|
@@ -5542,7 +5694,7 @@ var LargeUploadRenderer = {
|
|
|
5542
5694
|
};
|
|
5543
5695
|
const filetypes = acceptsToFileTypes(accepts);
|
|
5544
5696
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
5545
|
-
return /* @__PURE__ */
|
|
5697
|
+
return /* @__PURE__ */ jsx99(
|
|
5546
5698
|
FieldInput_default,
|
|
5547
5699
|
{
|
|
5548
5700
|
id,
|
|
@@ -5551,7 +5703,7 @@ var LargeUploadRenderer = {
|
|
|
5551
5703
|
validation: validationState,
|
|
5552
5704
|
help,
|
|
5553
5705
|
features,
|
|
5554
|
-
children: /* @__PURE__ */
|
|
5706
|
+
children: /* @__PURE__ */ jsx99(
|
|
5555
5707
|
Upload,
|
|
5556
5708
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
5557
5709
|
usAccept,
|
|
@@ -5568,16 +5720,16 @@ var LargeUploadRenderer = {
|
|
|
5568
5720
|
|
|
5569
5721
|
// ../renderers/src/UpsellRenderer.tsx
|
|
5570
5722
|
import { Nudge } from "@transferwise/components";
|
|
5571
|
-
import { useState as
|
|
5572
|
-
import { jsx as
|
|
5723
|
+
import { useState as useState18 } from "react";
|
|
5724
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
5573
5725
|
var UpsellRenderer = {
|
|
5574
5726
|
canRenderType: "upsell",
|
|
5575
5727
|
render: UpsellRendererComponent
|
|
5576
5728
|
};
|
|
5577
5729
|
function UpsellRendererComponent(props) {
|
|
5578
5730
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
5579
|
-
const [isVisible, setIsVisible] =
|
|
5580
|
-
return isVisible ? /* @__PURE__ */
|
|
5731
|
+
const [isVisible, setIsVisible] = useState18(true);
|
|
5732
|
+
return isVisible ? /* @__PURE__ */ jsx100(
|
|
5581
5733
|
Nudge,
|
|
5582
5734
|
{
|
|
5583
5735
|
className: getMargin(margin),
|
|
@@ -5626,7 +5778,7 @@ var supportedMediaNames = [
|
|
|
5626
5778
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
5627
5779
|
import { CircularButton } from "@transferwise/components";
|
|
5628
5780
|
var import_classnames8 = __toESM(require_classnames());
|
|
5629
|
-
import { jsx as
|
|
5781
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
5630
5782
|
var CircularButtonRenderer = {
|
|
5631
5783
|
canRenderType: "button",
|
|
5632
5784
|
canRender: ({ control }) => control === "circular",
|
|
@@ -5636,7 +5788,7 @@ function CircularButtonComponent(props) {
|
|
|
5636
5788
|
var _a;
|
|
5637
5789
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
5638
5790
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
5639
|
-
return /* @__PURE__ */
|
|
5791
|
+
return /* @__PURE__ */ jsx101("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ jsx101(
|
|
5640
5792
|
CircularButton,
|
|
5641
5793
|
{
|
|
5642
5794
|
disabled,
|
|
@@ -5701,11 +5853,11 @@ var getWiseRenderers = () => [
|
|
|
5701
5853
|
|
|
5702
5854
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
5703
5855
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
5704
|
-
import { jsx as
|
|
5856
|
+
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
5705
5857
|
var InitialLoadingStateRenderer = {
|
|
5706
5858
|
canRenderType: "loading-state",
|
|
5707
5859
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
5708
|
-
render: () => /* @__PURE__ */
|
|
5860
|
+
render: () => /* @__PURE__ */ jsx102(
|
|
5709
5861
|
Loader2,
|
|
5710
5862
|
{
|
|
5711
5863
|
size: "md",
|
|
@@ -5718,24 +5870,24 @@ var InitialLoadingStateRenderer = {
|
|
|
5718
5870
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
5719
5871
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
5720
5872
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
5721
|
-
import { jsx as
|
|
5873
|
+
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
5722
5874
|
function DynamicFlowModal(props) {
|
|
5723
5875
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
5724
5876
|
const dfProps = useWiseToCoreProps(rest);
|
|
5725
5877
|
const df = useDynamicFlowModal(dfProps);
|
|
5726
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ jsx103(
|
|
5727
5879
|
Modal5,
|
|
5728
5880
|
__spreadProps(__spreadValues({
|
|
5729
5881
|
className: `dynamic-flow-modal ${className}`,
|
|
5730
5882
|
disableDimmerClickToClose: true
|
|
5731
5883
|
}, df.modal), {
|
|
5732
|
-
body: /* @__PURE__ */
|
|
5884
|
+
body: /* @__PURE__ */ jsx103("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
5733
5885
|
})
|
|
5734
5886
|
);
|
|
5735
5887
|
}
|
|
5736
5888
|
|
|
5737
5889
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
5738
|
-
import { jsx as
|
|
5890
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
5739
5891
|
var wiseRenderers = getWiseRenderers();
|
|
5740
5892
|
var getMergedRenderers = (props) => {
|
|
5741
5893
|
var _d, _e;
|
|
@@ -5749,7 +5901,7 @@ var getMergedRenderers = (props) => {
|
|
|
5749
5901
|
method: initialRequest.method,
|
|
5750
5902
|
data: initialRequest.body
|
|
5751
5903
|
};
|
|
5752
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
5904
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx104(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx104(
|
|
5753
5905
|
DynamicFlowModal,
|
|
5754
5906
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
5755
5907
|
features: subflowFeatures,
|
|
@@ -5829,7 +5981,7 @@ var customEventsToAnalytics = {
|
|
|
5829
5981
|
|
|
5830
5982
|
// src/dynamicFlow/useOnCopy.tsx
|
|
5831
5983
|
import { useCallback as useCallback2 } from "react";
|
|
5832
|
-
import { useIntl as
|
|
5984
|
+
import { useIntl as useIntl17 } from "react-intl";
|
|
5833
5985
|
|
|
5834
5986
|
// src/dynamicFlow/messages.ts
|
|
5835
5987
|
import { defineMessages as defineMessages13 } from "react-intl";
|
|
@@ -5848,7 +6000,7 @@ var messages_default = defineMessages13({
|
|
|
5848
6000
|
|
|
5849
6001
|
// src/dynamicFlow/useOnCopy.tsx
|
|
5850
6002
|
var useOnCopy = () => {
|
|
5851
|
-
const { formatMessage } =
|
|
6003
|
+
const { formatMessage } = useIntl17();
|
|
5852
6004
|
const createSnackBar = useSnackBarIfAvailable();
|
|
5853
6005
|
return useCallback2(
|
|
5854
6006
|
(copiedContent) => {
|
|
@@ -5864,9 +6016,9 @@ var useOnCopy = () => {
|
|
|
5864
6016
|
|
|
5865
6017
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
5866
6018
|
import { useCallback as useCallback3 } from "react";
|
|
5867
|
-
import { useIntl as
|
|
6019
|
+
import { useIntl as useIntl18 } from "react-intl";
|
|
5868
6020
|
var useWiseHttpClient = (httpClient) => {
|
|
5869
|
-
const { locale } =
|
|
6021
|
+
const { locale } = useIntl18();
|
|
5870
6022
|
return useCallback3(
|
|
5871
6023
|
async (input, init = {}) => {
|
|
5872
6024
|
const headers = new Headers(init.headers);
|
|
@@ -5943,13 +6095,13 @@ var openLinkInNewTab = (url) => {
|
|
|
5943
6095
|
};
|
|
5944
6096
|
|
|
5945
6097
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
5946
|
-
import { jsxs as
|
|
6098
|
+
import { jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5947
6099
|
function DynamicFlow(props) {
|
|
5948
6100
|
const { className = "" } = props;
|
|
5949
6101
|
const dfProps = useWiseToCoreProps(props);
|
|
5950
6102
|
const df = useDynamicFlow(dfProps);
|
|
5951
6103
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
5952
|
-
return /* @__PURE__ */
|
|
6104
|
+
return /* @__PURE__ */ jsxs39("div", { className, onContextMenu, children: [
|
|
5953
6105
|
df.view,
|
|
5954
6106
|
contextMenu
|
|
5955
6107
|
] });
|
|
@@ -5961,7 +6113,7 @@ import {
|
|
|
5961
6113
|
useImperativeHandle
|
|
5962
6114
|
} from "react";
|
|
5963
6115
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
5964
|
-
import { jsx as
|
|
6116
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
5965
6117
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
5966
6118
|
const { className = "" } = props;
|
|
5967
6119
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -5969,15 +6121,15 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
5969
6121
|
useImperativeHandle(
|
|
5970
6122
|
ref,
|
|
5971
6123
|
() => ({
|
|
5972
|
-
getValue:
|
|
6124
|
+
getValue: () => {
|
|
5973
6125
|
var _a;
|
|
5974
|
-
return (_a =
|
|
6126
|
+
return (_a = df.controller.getValue()) != null ? _a : null;
|
|
5975
6127
|
},
|
|
5976
6128
|
validate: () => df.controller.validate()
|
|
5977
6129
|
}),
|
|
5978
6130
|
[df]
|
|
5979
6131
|
);
|
|
5980
|
-
return /* @__PURE__ */
|
|
6132
|
+
return /* @__PURE__ */ jsx105("div", { className, children: df.view });
|
|
5981
6133
|
});
|
|
5982
6134
|
|
|
5983
6135
|
// src/index.ts
|