@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.js
CHANGED
|
@@ -145,7 +145,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
|
145
145
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
146
146
|
var appVersion = (
|
|
147
147
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
148
|
-
typeof process !== "undefined" ? "5.
|
|
148
|
+
typeof process !== "undefined" ? "5.25.0" : "0.0.0"
|
|
149
149
|
);
|
|
150
150
|
|
|
151
151
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -209,7 +209,7 @@ var useDFContextMenu = (controller) => {
|
|
|
209
209
|
if (!step) {
|
|
210
210
|
return null;
|
|
211
211
|
}
|
|
212
|
-
const model =
|
|
212
|
+
const model = controller.getValue();
|
|
213
213
|
return recursivelyRemoveNullish(__spreadProps(__spreadValues({}, step), { model }));
|
|
214
214
|
};
|
|
215
215
|
const getEncodedCurrentStep = () => {
|
|
@@ -329,188 +329,25 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
332
|
-
var
|
|
332
|
+
var import_react29 = require("react");
|
|
333
333
|
|
|
334
334
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
335
335
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
336
336
|
|
|
337
|
-
// ../renderers/src/AlertRenderer.tsx
|
|
338
|
-
var import_components = require("@transferwise/components");
|
|
339
|
-
|
|
340
|
-
// ../renderers/src/utils/layout-utils.ts
|
|
341
|
-
var getMargin = (size) => {
|
|
342
|
-
switch (size) {
|
|
343
|
-
case "xs":
|
|
344
|
-
return "m-b-0";
|
|
345
|
-
case "sm":
|
|
346
|
-
return "m-b-1";
|
|
347
|
-
case "md":
|
|
348
|
-
return "m-b-2";
|
|
349
|
-
case "lg":
|
|
350
|
-
return "m-b-3";
|
|
351
|
-
case "xl":
|
|
352
|
-
return "m-b-5";
|
|
353
|
-
default:
|
|
354
|
-
return "";
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
var getTextAlignment = (align) => {
|
|
358
|
-
switch (align) {
|
|
359
|
-
case "end":
|
|
360
|
-
return "text-xs-right";
|
|
361
|
-
case "center":
|
|
362
|
-
return "text-xs-center";
|
|
363
|
-
case "start":
|
|
364
|
-
default:
|
|
365
|
-
return "";
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
369
|
-
|
|
370
|
-
// ../renderers/src/AlertRenderer.tsx
|
|
371
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
372
|
-
var AlertRenderer = {
|
|
373
|
-
canRenderType: "alert",
|
|
374
|
-
render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
375
|
-
import_components.Alert,
|
|
376
|
-
{
|
|
377
|
-
type: context,
|
|
378
|
-
className: getMargin(margin),
|
|
379
|
-
message: markdown,
|
|
380
|
-
action: mapCtaToAlertAction(callToAction)
|
|
381
|
-
}
|
|
382
|
-
)
|
|
383
|
-
};
|
|
384
|
-
var mapCtaToAlertAction = (callToAction) => {
|
|
385
|
-
if (callToAction) {
|
|
386
|
-
return __spreadValues({
|
|
387
|
-
text: callToAction.title,
|
|
388
|
-
"aria-label": callToAction.accessibilityDescription
|
|
389
|
-
}, callToAction.getAnchorProps());
|
|
390
|
-
}
|
|
391
|
-
return void 0;
|
|
392
|
-
};
|
|
393
|
-
var AlertRenderer_default = AlertRenderer;
|
|
394
|
-
|
|
395
|
-
// ../renderers/src/BoxRenderer.tsx
|
|
396
|
-
var import_classnames = __toESM(require_classnames());
|
|
397
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
398
|
-
var BoxRenderer = {
|
|
399
|
-
canRenderType: "box",
|
|
400
|
-
render: ({ children, control, margin, width }) => {
|
|
401
|
-
const hasFixedWidth = width !== "xl";
|
|
402
|
-
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
403
|
-
const contents = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
404
|
-
"div",
|
|
405
|
-
{
|
|
406
|
-
className: (0, import_classnames.default)("df-box-renderer", {
|
|
407
|
-
"df-box-renderer-border": hasBorder,
|
|
408
|
-
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
409
|
-
[getMargin(margin)]: !hasFixedWidth
|
|
410
|
-
}),
|
|
411
|
-
children
|
|
412
|
-
}
|
|
413
|
-
);
|
|
414
|
-
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
var BoxRenderer_default = BoxRenderer;
|
|
418
|
-
|
|
419
|
-
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
420
|
-
var import_components2 = require("@transferwise/components");
|
|
421
|
-
var import_react_intl2 = require("react-intl");
|
|
422
|
-
|
|
423
|
-
// ../renderers/src/messages/loading-button.messages.ts
|
|
424
|
-
var import_react_intl = require("react-intl");
|
|
425
|
-
var loading_button_messages_default = (0, import_react_intl.defineMessages)({
|
|
426
|
-
buttonLoadingMessage: {
|
|
427
|
-
id: "df.wise.ButtonLayout.buttonLoadingMessage",
|
|
428
|
-
defaultMessage: "This might take a few seconds",
|
|
429
|
-
description: "Message displayed below a button when it is in a loading state."
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
337
|
+
// ../renderers/src/AlertRenderer/AlertRenderer.tsx
|
|
434
338
|
var import_react2 = require("react");
|
|
435
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
436
|
-
var AddressValidationButtonRenderer = {
|
|
437
|
-
canRenderType: "button",
|
|
438
|
-
canRender: ({ control }) => control === "address-validation",
|
|
439
|
-
render: AddressValidationButtonComponent
|
|
440
|
-
};
|
|
441
|
-
function AddressValidationButtonComponent(props) {
|
|
442
|
-
const { disabled, margin, title, stepLoadingState, onClick } = props;
|
|
443
|
-
const { formatMessage } = (0, import_react_intl2.useIntl)();
|
|
444
|
-
const [spinny, setSpinny] = (0, import_react2.useState)(false);
|
|
445
|
-
(0, import_react2.useEffect)(() => {
|
|
446
|
-
if (stepLoadingState === "idle") {
|
|
447
|
-
setSpinny(false);
|
|
448
|
-
}
|
|
449
|
-
}, [stepLoadingState]);
|
|
450
|
-
const onBlur = () => {
|
|
451
|
-
if (stepLoadingState === "idle") {
|
|
452
|
-
setSpinny(false);
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
456
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
457
|
-
import_components2.Button,
|
|
458
|
-
{
|
|
459
|
-
v2: true,
|
|
460
|
-
block: true,
|
|
461
|
-
disabled,
|
|
462
|
-
priority: "primary",
|
|
463
|
-
size: "lg",
|
|
464
|
-
loading: spinny,
|
|
465
|
-
onClick: () => {
|
|
466
|
-
setSpinny(true);
|
|
467
|
-
onClick();
|
|
468
|
-
},
|
|
469
|
-
onBlur,
|
|
470
|
-
children: title
|
|
471
|
-
}
|
|
472
|
-
),
|
|
473
|
-
spinny && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_components2.InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
474
|
-
] });
|
|
475
|
-
}
|
|
476
|
-
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
477
339
|
|
|
478
|
-
// ../renderers/src/
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
// ../renderers/src/utils/isButtonPriority.ts
|
|
482
|
-
var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
|
|
483
|
-
var isButtonPriority = (control) => validPriorities.includes(control);
|
|
484
|
-
|
|
485
|
-
// ../renderers/src/ButtonRenderer/mapLegacyButtonSize.tsx
|
|
486
|
-
var mapLegacyButtonSize = (size) => {
|
|
487
|
-
if (!size) {
|
|
488
|
-
return void 0;
|
|
489
|
-
}
|
|
490
|
-
switch (size) {
|
|
491
|
-
case "xs":
|
|
492
|
-
case "sm":
|
|
493
|
-
return "sm";
|
|
494
|
-
case "lg":
|
|
495
|
-
case "xl":
|
|
496
|
-
return "lg";
|
|
497
|
-
case "md":
|
|
498
|
-
default:
|
|
499
|
-
return "md";
|
|
500
|
-
}
|
|
501
|
-
};
|
|
502
|
-
|
|
503
|
-
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
504
|
-
var import_react3 = require("react");
|
|
340
|
+
// ../renderers/src/AlertRenderer/ActionPromptComponent.tsx
|
|
341
|
+
var import_components5 = require("@transferwise/components");
|
|
505
342
|
|
|
506
343
|
// ../renderers/src/utils/UrnFlag.tsx
|
|
507
344
|
var import_art = require("@wise/art");
|
|
508
|
-
var
|
|
345
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
509
346
|
var countryUrnPrefix = "urn:wise:countries:";
|
|
510
347
|
var currencyUrnPrefix = "urn:wise:currencies:";
|
|
511
348
|
var isUrnFlag = (uri) => (uri.startsWith(countryUrnPrefix) || uri.startsWith(currencyUrnPrefix)) && uri.endsWith(":image");
|
|
512
349
|
function UrnFlag({ size, urn }) {
|
|
513
|
-
return /* @__PURE__ */ (0,
|
|
350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_art.Flag, { code: getCode(urn), intrinsicSize: size, className: "df-reserve-space" });
|
|
514
351
|
}
|
|
515
352
|
var getCode = (urn) => {
|
|
516
353
|
return urn.replace(countryUrnPrefix, "").replace(currencyUrnPrefix, "").replace(":image", "").split("?")[0];
|
|
@@ -518,19 +355,19 @@ var getCode = (urn) => {
|
|
|
518
355
|
|
|
519
356
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
520
357
|
var import_art2 = require("@wise/art");
|
|
521
|
-
var
|
|
358
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
522
359
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
523
360
|
function FlagIcon({ name }) {
|
|
524
361
|
if (!isFlagIcon(name)) {
|
|
525
362
|
return null;
|
|
526
363
|
}
|
|
527
364
|
const code = name.substring(5);
|
|
528
|
-
return /* @__PURE__ */ (0,
|
|
365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_art2.Flag, { code, intrinsicSize: 24 });
|
|
529
366
|
}
|
|
530
367
|
|
|
531
368
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
532
369
|
var icons = __toESM(require("@transferwise/icons"));
|
|
533
|
-
var
|
|
370
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
534
371
|
var isNamedIcon = (name) => {
|
|
535
372
|
const iconName = toCapitalisedCamelCase(name);
|
|
536
373
|
return Object.keys(icons).includes(iconName);
|
|
@@ -541,19 +378,19 @@ function NamedIcon({ name }) {
|
|
|
541
378
|
}
|
|
542
379
|
const iconName = toCapitalisedCamelCase(name);
|
|
543
380
|
const Icon = icons[iconName];
|
|
544
|
-
return /* @__PURE__ */ (0,
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: 24 });
|
|
545
382
|
}
|
|
546
383
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
547
384
|
var capitaliseFirstChar = (value) => value.length === 0 ? "" : `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
548
385
|
|
|
549
386
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
550
|
-
var
|
|
387
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
551
388
|
function DynamicIcon({ name }) {
|
|
552
389
|
if (isFlagIcon(name)) {
|
|
553
|
-
return /* @__PURE__ */ (0,
|
|
390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FlagIcon, { name });
|
|
554
391
|
}
|
|
555
392
|
if (isNamedIcon(name)) {
|
|
556
|
-
return /* @__PURE__ */ (0,
|
|
393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NamedIcon, { name });
|
|
557
394
|
}
|
|
558
395
|
return null;
|
|
559
396
|
}
|
|
@@ -585,11 +422,11 @@ var stringToURN = (uri) => {
|
|
|
585
422
|
};
|
|
586
423
|
|
|
587
424
|
// ../renderers/src/components/Media/resolveMediaFromUri.tsx
|
|
588
|
-
var
|
|
589
|
-
var resolveMediaFromUri = (uri, size) => {
|
|
425
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
426
|
+
var resolveMediaFromUri = (uri, size, accessibilityDescription) => {
|
|
590
427
|
const { name, qComponents } = stringToURN(uri);
|
|
591
428
|
if (isValidIconUrn(name)) {
|
|
592
|
-
const icon = /* @__PURE__ */ (0,
|
|
429
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DynamicIcon_default, { name: name.replace("urn:wise:icons:", "") });
|
|
593
430
|
return {
|
|
594
431
|
icon,
|
|
595
432
|
color: formatColor(qComponents["foreground-color"]),
|
|
@@ -598,7 +435,14 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
598
435
|
}
|
|
599
436
|
if (isUrnFlag(name)) {
|
|
600
437
|
return {
|
|
601
|
-
asset: /* @__PURE__ */ (0,
|
|
438
|
+
asset: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
439
|
+
UrnFlag,
|
|
440
|
+
{
|
|
441
|
+
urn: name,
|
|
442
|
+
size,
|
|
443
|
+
accessibilityDescription
|
|
444
|
+
}
|
|
445
|
+
)
|
|
602
446
|
};
|
|
603
447
|
}
|
|
604
448
|
if (name.startsWith("data:text/plain,")) {
|
|
@@ -610,7 +454,9 @@ var resolveMediaFromUri = (uri, size) => {
|
|
|
610
454
|
};
|
|
611
455
|
}
|
|
612
456
|
if (!uri.startsWith("urn:")) {
|
|
613
|
-
return {
|
|
457
|
+
return {
|
|
458
|
+
asset: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: uri, alt: accessibilityDescription != null ? accessibilityDescription : "", width: `${size}px` })
|
|
459
|
+
};
|
|
614
460
|
}
|
|
615
461
|
return { asset: void 0 };
|
|
616
462
|
};
|
|
@@ -625,8 +471,8 @@ var formatColor = (color) => {
|
|
|
625
471
|
};
|
|
626
472
|
|
|
627
473
|
// ../renderers/src/components/Media/AvatarMedia.tsx
|
|
628
|
-
var
|
|
629
|
-
var
|
|
474
|
+
var import_components = require("@transferwise/components");
|
|
475
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
630
476
|
var AvatarMedia = ({
|
|
631
477
|
accessibilityDescription,
|
|
632
478
|
content,
|
|
@@ -649,8 +495,8 @@ var AvatarMedia = ({
|
|
|
649
495
|
if (!asset && !icon) {
|
|
650
496
|
return null;
|
|
651
497
|
}
|
|
652
|
-
return /* @__PURE__ */ (0,
|
|
653
|
-
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
499
|
+
import_components.AvatarView,
|
|
654
500
|
{
|
|
655
501
|
"aria-label": accessibilityDescription,
|
|
656
502
|
size,
|
|
@@ -664,8 +510,8 @@ var AvatarMedia = ({
|
|
|
664
510
|
asset: icon != null ? icon : asset,
|
|
665
511
|
style: { backgroundColor, color }
|
|
666
512
|
}));
|
|
667
|
-
return /* @__PURE__ */ (0,
|
|
668
|
-
|
|
513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
514
|
+
import_components.AvatarLayout,
|
|
669
515
|
{
|
|
670
516
|
"aria-label": accessibilityDescription,
|
|
671
517
|
size,
|
|
@@ -683,7 +529,7 @@ var getBadge = ({
|
|
|
683
529
|
}) => {
|
|
684
530
|
if (backgroundColor || color) {
|
|
685
531
|
return {
|
|
686
|
-
asset: /* @__PURE__ */ (0,
|
|
532
|
+
asset: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
687
533
|
"div",
|
|
688
534
|
{
|
|
689
535
|
className: "d-flex align-items-center justify-content-center",
|
|
@@ -705,12 +551,12 @@ var getBadge = ({
|
|
|
705
551
|
};
|
|
706
552
|
|
|
707
553
|
// ../renderers/src/utils/image-utils.tsx
|
|
708
|
-
var
|
|
709
|
-
var
|
|
554
|
+
var import_components2 = require("@transferwise/components");
|
|
555
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
710
556
|
var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
711
557
|
if (iconNode && imageNode) {
|
|
712
558
|
if (imageNode && iconNode) {
|
|
713
|
-
return /* @__PURE__ */ (0,
|
|
559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components2.AvatarView, { size, badge: { asset: iconNode, type: "reference" }, children: imageNode });
|
|
714
560
|
}
|
|
715
561
|
}
|
|
716
562
|
return null;
|
|
@@ -718,7 +564,7 @@ var getBadgedMedia = (iconNode, imageNode, size) => {
|
|
|
718
564
|
var getIconNode = (icon) => {
|
|
719
565
|
if (icon) {
|
|
720
566
|
if ("name" in icon) {
|
|
721
|
-
return /* @__PURE__ */ (0,
|
|
567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DynamicIcon_default, { name: icon.name });
|
|
722
568
|
}
|
|
723
569
|
if (icon.text) {
|
|
724
570
|
return icon.text;
|
|
@@ -730,68 +576,346 @@ var getImageNode = (image, size) => {
|
|
|
730
576
|
if (image) {
|
|
731
577
|
const { accessibilityDescription, uri } = image;
|
|
732
578
|
if (!uri.startsWith("urn:")) {
|
|
733
|
-
return /* @__PURE__ */ (0,
|
|
579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: uri, alt: accessibilityDescription, width: `${size}px` });
|
|
734
580
|
}
|
|
735
581
|
if (isUrnFlag(uri)) {
|
|
736
|
-
return /* @__PURE__ */ (0,
|
|
582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(UrnFlag, { urn: uri, accessibilityDescription, size });
|
|
737
583
|
}
|
|
738
584
|
}
|
|
739
585
|
return null;
|
|
740
586
|
};
|
|
741
587
|
|
|
742
588
|
// ../renderers/src/components/Media/LegacyMedia.tsx
|
|
743
|
-
var
|
|
744
|
-
var
|
|
589
|
+
var import_components3 = require("@transferwise/components");
|
|
590
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
745
591
|
var LegacyMedia = ({ image, icon, preferAvatar, size }) => {
|
|
746
592
|
const imageNode = getImageNode(image, size);
|
|
747
593
|
const iconNode = getIconNode(icon);
|
|
748
594
|
const badge = getBadgedMedia(iconNode, imageNode, size);
|
|
749
595
|
if (badge) {
|
|
750
|
-
return /* @__PURE__ */ (0,
|
|
596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: badge });
|
|
751
597
|
}
|
|
752
598
|
if (imageNode) {
|
|
753
|
-
return preferAvatar ? /* @__PURE__ */ (0,
|
|
599
|
+
return preferAvatar ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.AvatarView, { children: imageNode }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
754
600
|
imageNode,
|
|
755
601
|
" "
|
|
756
602
|
] });
|
|
757
603
|
}
|
|
758
604
|
if (iconNode && icon) {
|
|
759
605
|
if ("text" in icon || size === 48) {
|
|
760
|
-
return /* @__PURE__ */ (0,
|
|
606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components3.AvatarView, { size, children: iconNode });
|
|
761
607
|
}
|
|
762
|
-
return /* @__PURE__ */ (0,
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children: iconNode });
|
|
763
609
|
}
|
|
764
610
|
return null;
|
|
765
611
|
};
|
|
766
612
|
|
|
767
613
|
// ../renderers/src/components/Media/Media.tsx
|
|
768
|
-
var
|
|
769
|
-
var Media = ({
|
|
614
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
615
|
+
var Media = ({
|
|
616
|
+
media,
|
|
617
|
+
preferAvatar = false,
|
|
618
|
+
size
|
|
619
|
+
}) => {
|
|
770
620
|
switch (media == null ? void 0 : media.type) {
|
|
771
621
|
case "avatar":
|
|
772
|
-
return /* @__PURE__ */ (0,
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AvatarMedia, __spreadProps(__spreadValues({}, media), { size }));
|
|
773
623
|
case "image": {
|
|
774
|
-
const { asset, icon } = resolveMediaFromUri(
|
|
624
|
+
const { asset, icon } = resolveMediaFromUri(
|
|
625
|
+
media.uri,
|
|
626
|
+
size,
|
|
627
|
+
media.accessibilityDescription
|
|
628
|
+
);
|
|
775
629
|
return icon != null ? icon : asset;
|
|
776
630
|
}
|
|
777
631
|
case "legacy": {
|
|
778
|
-
return /* @__PURE__ */ (0,
|
|
632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LegacyMedia, __spreadProps(__spreadValues({}, media), { preferAvatar, size }));
|
|
779
633
|
}
|
|
780
634
|
default:
|
|
781
635
|
return null;
|
|
782
636
|
}
|
|
783
637
|
};
|
|
638
|
+
var isMediaIcon = (media) => (media == null ? void 0 : media.type) === "image" && isValidIconUrn(media.uri);
|
|
784
639
|
|
|
785
640
|
// ../renderers/src/components/Media/OptionMedia.tsx
|
|
786
|
-
var
|
|
641
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
787
642
|
var mediaSize = 48;
|
|
788
643
|
function OptionMedia(props) {
|
|
789
|
-
return /* @__PURE__ */ (0,
|
|
644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Media, __spreadProps(__spreadValues({}, props), { size: mediaSize }));
|
|
790
645
|
}
|
|
791
646
|
|
|
792
647
|
// ../renderers/src/components/Media/getInlineMedia.tsx
|
|
648
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
649
|
+
var getInlineMedia = (media) => media ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Media, { media, preferAvatar: false, size: 24 }) : null;
|
|
650
|
+
|
|
651
|
+
// ../renderers/src/components/Media/getPromptMedia.tsx
|
|
652
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
653
|
+
var getPromptMedia = (media) => {
|
|
654
|
+
if (!media || media.type === "legacy") {
|
|
655
|
+
return void 0;
|
|
656
|
+
}
|
|
657
|
+
if (media.type === "image" && !media.uri.startsWith("urn:")) {
|
|
658
|
+
return {
|
|
659
|
+
imgSrc: media.uri,
|
|
660
|
+
"aria-label": media.accessibilityDescription
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
const _a = media, { accessibilityDescription: ariaLabel } = _a, sansAriaLabel = __objRest(_a, ["accessibilityDescription"]);
|
|
664
|
+
return {
|
|
665
|
+
avatar: {
|
|
666
|
+
asset: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Media, { media: sansAriaLabel, size: 48 })
|
|
667
|
+
},
|
|
668
|
+
"aria-label": ariaLabel
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
// ../renderers/src/utils/layout-utils.ts
|
|
673
|
+
var getMargin = (size) => {
|
|
674
|
+
switch (size) {
|
|
675
|
+
case "xs":
|
|
676
|
+
return "m-b-0";
|
|
677
|
+
case "sm":
|
|
678
|
+
return "m-b-1";
|
|
679
|
+
case "md":
|
|
680
|
+
return "m-b-2";
|
|
681
|
+
case "lg":
|
|
682
|
+
return "m-b-3";
|
|
683
|
+
case "xl":
|
|
684
|
+
return "m-b-5";
|
|
685
|
+
default:
|
|
686
|
+
return "";
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
var getTextAlignment = (align) => {
|
|
690
|
+
switch (align) {
|
|
691
|
+
case "end":
|
|
692
|
+
return "text-xs-right";
|
|
693
|
+
case "center":
|
|
694
|
+
return "text-xs-center";
|
|
695
|
+
case "start":
|
|
696
|
+
default:
|
|
697
|
+
return "";
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
|
|
701
|
+
|
|
702
|
+
// ../renderers/src/AlertRenderer/mappers.tsx
|
|
703
|
+
var import_components4 = require("@transferwise/components");
|
|
704
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
705
|
+
var mapCallToAction = (callToAction) => __spreadValues({
|
|
706
|
+
label: callToAction.title,
|
|
707
|
+
"aria-label": callToAction.accessibilityDescription
|
|
708
|
+
}, callToAction.getAnchorProps());
|
|
709
|
+
var promptMarkdownAllowList = [
|
|
710
|
+
import_components4.MarkdownNodeType.EMPH,
|
|
711
|
+
import_components4.MarkdownNodeType.PARAGRAPH,
|
|
712
|
+
import_components4.MarkdownNodeType.STRONG
|
|
713
|
+
];
|
|
714
|
+
var mapPromptDescription = (markdown) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
715
|
+
import_components4.Markdown,
|
|
716
|
+
{
|
|
717
|
+
as: "span",
|
|
718
|
+
config: {
|
|
719
|
+
paragraph: { className: "df-alert-markdown" }
|
|
720
|
+
},
|
|
721
|
+
allowList: promptMarkdownAllowList,
|
|
722
|
+
children: markdown
|
|
723
|
+
}
|
|
724
|
+
);
|
|
725
|
+
var mapPromptSentiment = (context) => context === "positive" ? "success" : context;
|
|
726
|
+
|
|
727
|
+
// ../renderers/src/AlertRenderer/ActionPromptComponent.tsx
|
|
793
728
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
794
|
-
|
|
729
|
+
function ActionPromptComponent({
|
|
730
|
+
callToAction,
|
|
731
|
+
context,
|
|
732
|
+
margin,
|
|
733
|
+
markdown,
|
|
734
|
+
media,
|
|
735
|
+
onDismiss,
|
|
736
|
+
secondaryCallToAction,
|
|
737
|
+
title
|
|
738
|
+
}) {
|
|
739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
740
|
+
import_components5.ActionPrompt,
|
|
741
|
+
{
|
|
742
|
+
title: title != null ? title : "",
|
|
743
|
+
description: mapPromptDescription(markdown),
|
|
744
|
+
sentiment: mapPromptSentiment(context),
|
|
745
|
+
className: getMargin(margin),
|
|
746
|
+
media: getPromptMedia(media),
|
|
747
|
+
action: mapCallToAction(callToAction),
|
|
748
|
+
actionSecondary: secondaryCallToAction ? mapCallToAction(secondaryCallToAction) : void 0,
|
|
749
|
+
onDismiss
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// ../renderers/src/AlertRenderer/InfoPromptComponent.tsx
|
|
755
|
+
var import_components6 = require("@transferwise/components");
|
|
756
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
757
|
+
function InfoPromptComponent({
|
|
758
|
+
callToAction,
|
|
759
|
+
context,
|
|
760
|
+
margin,
|
|
761
|
+
markdown,
|
|
762
|
+
media,
|
|
763
|
+
onDismiss,
|
|
764
|
+
title
|
|
765
|
+
}) {
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
767
|
+
import_components6.InfoPrompt,
|
|
768
|
+
{
|
|
769
|
+
title,
|
|
770
|
+
description: mapPromptDescription(markdown),
|
|
771
|
+
sentiment: mapPromptSentiment(context),
|
|
772
|
+
className: getMargin(margin),
|
|
773
|
+
media: isMediaIcon(media) ? { asset: getInlineMedia(media) } : void 0,
|
|
774
|
+
action: callToAction ? mapCallToAction(callToAction) : void 0,
|
|
775
|
+
onDismiss
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
// ../renderers/src/AlertRenderer/AlertRenderer.tsx
|
|
781
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
782
|
+
var AlertRenderer = {
|
|
783
|
+
canRenderType: "alert",
|
|
784
|
+
render: AlertRendererComponent
|
|
785
|
+
};
|
|
786
|
+
function AlertRendererComponent(props) {
|
|
787
|
+
const [isVisible, setIsVisible] = (0, import_react2.useState)(true);
|
|
788
|
+
const { onDismiss: dismiss } = props;
|
|
789
|
+
if (!isVisible) {
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
const onDismiss = dismiss ? () => {
|
|
793
|
+
setIsVisible(false);
|
|
794
|
+
dismiss();
|
|
795
|
+
} : void 0;
|
|
796
|
+
if (shouldRenderActionPrompt(props)) {
|
|
797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ActionPromptComponent, __spreadProps(__spreadValues({}, props), { onDismiss }));
|
|
798
|
+
}
|
|
799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(InfoPromptComponent, __spreadProps(__spreadValues({}, props), { onDismiss }));
|
|
800
|
+
}
|
|
801
|
+
var shouldRenderActionPrompt = (props) => {
|
|
802
|
+
var _a, _b;
|
|
803
|
+
return Boolean(
|
|
804
|
+
props.callToAction && ((_b = props.secondaryCallToAction) != null ? _b : (_a = props.tags) == null ? void 0 : _a.includes("prefers-action-prompt"))
|
|
805
|
+
);
|
|
806
|
+
};
|
|
807
|
+
var AlertRenderer_default = AlertRenderer;
|
|
808
|
+
|
|
809
|
+
// ../renderers/src/BoxRenderer.tsx
|
|
810
|
+
var import_classnames = __toESM(require_classnames());
|
|
811
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
812
|
+
var BoxRenderer = {
|
|
813
|
+
canRenderType: "box",
|
|
814
|
+
render: ({ children, control, margin, width }) => {
|
|
815
|
+
const hasFixedWidth = width !== "xl";
|
|
816
|
+
const hasBorder = control === "bordered" || control === "bordered-web";
|
|
817
|
+
const contents = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
818
|
+
"div",
|
|
819
|
+
{
|
|
820
|
+
className: (0, import_classnames.default)("df-box-renderer", {
|
|
821
|
+
"df-box-renderer-border": hasBorder,
|
|
822
|
+
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
823
|
+
[getMargin(margin)]: !hasFixedWidth
|
|
824
|
+
}),
|
|
825
|
+
children
|
|
826
|
+
}
|
|
827
|
+
);
|
|
828
|
+
return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
var BoxRenderer_default = BoxRenderer;
|
|
832
|
+
|
|
833
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
834
|
+
var import_components7 = require("@transferwise/components");
|
|
835
|
+
var import_react_intl2 = require("react-intl");
|
|
836
|
+
|
|
837
|
+
// ../renderers/src/messages/loading-button.messages.ts
|
|
838
|
+
var import_react_intl = require("react-intl");
|
|
839
|
+
var loading_button_messages_default = (0, import_react_intl.defineMessages)({
|
|
840
|
+
buttonLoadingMessage: {
|
|
841
|
+
id: "df.wise.ButtonLayout.buttonLoadingMessage",
|
|
842
|
+
defaultMessage: "This might take a few seconds",
|
|
843
|
+
description: "Message displayed below a button when it is in a loading state."
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
// ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
|
|
848
|
+
var import_react3 = require("react");
|
|
849
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
850
|
+
var AddressValidationButtonRenderer = {
|
|
851
|
+
canRenderType: "button",
|
|
852
|
+
canRender: ({ control }) => control === "address-validation",
|
|
853
|
+
render: AddressValidationButtonComponent
|
|
854
|
+
};
|
|
855
|
+
function AddressValidationButtonComponent(props) {
|
|
856
|
+
const { disabled, margin, title, stepLoadingState, onClick } = props;
|
|
857
|
+
const { formatMessage } = (0, import_react_intl2.useIntl)();
|
|
858
|
+
const [spinny, setSpinny] = (0, import_react3.useState)(false);
|
|
859
|
+
(0, import_react3.useEffect)(() => {
|
|
860
|
+
if (stepLoadingState === "idle") {
|
|
861
|
+
setSpinny(false);
|
|
862
|
+
}
|
|
863
|
+
}, [stepLoadingState]);
|
|
864
|
+
const onBlur = () => {
|
|
865
|
+
if (stepLoadingState === "idle") {
|
|
866
|
+
setSpinny(false);
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
|
|
870
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
871
|
+
import_components7.Button,
|
|
872
|
+
{
|
|
873
|
+
v2: true,
|
|
874
|
+
block: true,
|
|
875
|
+
disabled,
|
|
876
|
+
priority: "primary",
|
|
877
|
+
size: "lg",
|
|
878
|
+
loading: spinny,
|
|
879
|
+
onClick: () => {
|
|
880
|
+
setSpinny(true);
|
|
881
|
+
onClick();
|
|
882
|
+
},
|
|
883
|
+
onBlur,
|
|
884
|
+
children: title
|
|
885
|
+
}
|
|
886
|
+
),
|
|
887
|
+
spinny && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components7.InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
|
|
888
|
+
] });
|
|
889
|
+
}
|
|
890
|
+
var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
891
|
+
|
|
892
|
+
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
893
|
+
var import_components8 = require("@transferwise/components");
|
|
894
|
+
|
|
895
|
+
// ../renderers/src/utils/isButtonPriority.ts
|
|
896
|
+
var validPriorities = ["primary", "secondary", "secondary-neutral", "tertiary"];
|
|
897
|
+
var isButtonPriority = (control) => validPriorities.includes(control);
|
|
898
|
+
|
|
899
|
+
// ../renderers/src/ButtonRenderer/mapLegacyButtonSize.tsx
|
|
900
|
+
var mapLegacyButtonSize = (size) => {
|
|
901
|
+
if (!size) {
|
|
902
|
+
return void 0;
|
|
903
|
+
}
|
|
904
|
+
switch (size) {
|
|
905
|
+
case "xs":
|
|
906
|
+
case "sm":
|
|
907
|
+
return "sm";
|
|
908
|
+
case "lg":
|
|
909
|
+
case "xl":
|
|
910
|
+
return "lg";
|
|
911
|
+
case "md":
|
|
912
|
+
default:
|
|
913
|
+
return "md";
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
918
|
+
var import_react4 = require("react");
|
|
795
919
|
|
|
796
920
|
// ../renderers/src/components/Media/getAddonStartMedia.ts
|
|
797
921
|
var getAddonStartMedia = (media) => {
|
|
@@ -812,7 +936,7 @@ var getAddonStartMedia = (media) => {
|
|
|
812
936
|
|
|
813
937
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
814
938
|
var import_classnames2 = __toESM(require_classnames());
|
|
815
|
-
var
|
|
939
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
816
940
|
var ButtonRenderer = {
|
|
817
941
|
canRenderType: "button",
|
|
818
942
|
render: ButtonComponent
|
|
@@ -830,8 +954,8 @@ function ButtonComponent(props) {
|
|
|
830
954
|
stepLoadingState,
|
|
831
955
|
onClick
|
|
832
956
|
} = props;
|
|
833
|
-
const [spinny, setSpinny] = (0,
|
|
834
|
-
(0,
|
|
957
|
+
const [spinny, setSpinny] = (0, import_react4.useState)(false);
|
|
958
|
+
(0, import_react4.useEffect)(() => {
|
|
835
959
|
if (stepLoadingState === "idle") {
|
|
836
960
|
setSpinny(false);
|
|
837
961
|
}
|
|
@@ -861,7 +985,7 @@ function ButtonComponent(props) {
|
|
|
861
985
|
onClick();
|
|
862
986
|
}
|
|
863
987
|
};
|
|
864
|
-
return /* @__PURE__ */ (0,
|
|
988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components8.Button, __spreadProps(__spreadValues({}, buttonProps), { children: title }));
|
|
865
989
|
}
|
|
866
990
|
var getSentiment = (context) => context === "negative" ? "negative" : "default";
|
|
867
991
|
var getPriority = (control, tags) => {
|
|
@@ -873,17 +997,17 @@ var getPriority = (control, tags) => {
|
|
|
873
997
|
};
|
|
874
998
|
|
|
875
999
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
876
|
-
var
|
|
1000
|
+
var import_components13 = require("@transferwise/components");
|
|
877
1001
|
|
|
878
1002
|
// ../renderers/src/components/FieldInput.tsx
|
|
879
|
-
var
|
|
1003
|
+
var import_components10 = require("@transferwise/components");
|
|
880
1004
|
|
|
881
1005
|
// ../renderers/src/utils/useScrollToError.ts
|
|
882
|
-
var
|
|
1006
|
+
var import_react5 = require("react");
|
|
883
1007
|
var useScrollToError = (validationState, features) => {
|
|
884
|
-
const ref = (0,
|
|
1008
|
+
const ref = (0, import_react5.useRef)(null);
|
|
885
1009
|
const enabled = (features == null ? void 0 : features.scrollToError) !== false;
|
|
886
|
-
(0,
|
|
1010
|
+
(0, import_react5.useEffect)(() => {
|
|
887
1011
|
if ((validationState == null ? void 0 : validationState.status) === "invalid" && (validationState == null ? void 0 : validationState.message) && enabled) {
|
|
888
1012
|
scrollToIfNotVisible(ref.current);
|
|
889
1013
|
}
|
|
@@ -901,7 +1025,7 @@ var scrollToIfNotVisible = (ref) => {
|
|
|
901
1025
|
};
|
|
902
1026
|
|
|
903
1027
|
// ../renderers/src/components/Help.tsx
|
|
904
|
-
var
|
|
1028
|
+
var import_components9 = require("@transferwise/components");
|
|
905
1029
|
var import_react_intl4 = require("react-intl");
|
|
906
1030
|
|
|
907
1031
|
// ../renderers/src/messages/help.messages.ts
|
|
@@ -915,13 +1039,13 @@ var help_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
915
1039
|
});
|
|
916
1040
|
|
|
917
1041
|
// ../renderers/src/components/Help.tsx
|
|
918
|
-
var
|
|
1042
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
919
1043
|
function Help({ help, onClick }) {
|
|
920
1044
|
const intl = (0, import_react_intl4.useIntl)();
|
|
921
|
-
return /* @__PURE__ */ (0,
|
|
922
|
-
|
|
1045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1046
|
+
import_components9.Info,
|
|
923
1047
|
{
|
|
924
|
-
content: /* @__PURE__ */ (0,
|
|
1048
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
925
1049
|
presentation: "POPOVER",
|
|
926
1050
|
size: "sm",
|
|
927
1051
|
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
@@ -932,16 +1056,16 @@ function Help({ help, onClick }) {
|
|
|
932
1056
|
var Help_default = Help;
|
|
933
1057
|
|
|
934
1058
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
935
|
-
var
|
|
1059
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
936
1060
|
function LabelContentWithHelp({ text, help }) {
|
|
937
|
-
return /* @__PURE__ */ (0,
|
|
1061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
938
1062
|
text,
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
1063
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Help_default, { help })
|
|
940
1064
|
] });
|
|
941
1065
|
}
|
|
942
1066
|
|
|
943
1067
|
// ../renderers/src/components/FieldInput.tsx
|
|
944
|
-
var
|
|
1068
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
945
1069
|
function FieldInput({
|
|
946
1070
|
id,
|
|
947
1071
|
children,
|
|
@@ -954,10 +1078,10 @@ function FieldInput({
|
|
|
954
1078
|
features
|
|
955
1079
|
}) {
|
|
956
1080
|
var _a;
|
|
957
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1081
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
958
1082
|
const { ref } = useScrollToError(validation, features);
|
|
959
|
-
return /* @__PURE__ */ (0,
|
|
960
|
-
|
|
1083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1084
|
+
import_components10.Field,
|
|
961
1085
|
{
|
|
962
1086
|
id,
|
|
963
1087
|
label: labelContent,
|
|
@@ -983,23 +1107,23 @@ var mapStatusToSentiment = (validation, defaultContext) => {
|
|
|
983
1107
|
var FieldInput_default = FieldInput;
|
|
984
1108
|
|
|
985
1109
|
// ../renderers/src/utils/listItem/getAdditionalText.tsx
|
|
986
|
-
var
|
|
987
|
-
var
|
|
1110
|
+
var import_components11 = require("@transferwise/components");
|
|
1111
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
988
1112
|
var getAdditionalText = (additionalText) => {
|
|
989
1113
|
if (!additionalText) {
|
|
990
1114
|
return void 0;
|
|
991
1115
|
}
|
|
992
|
-
return /* @__PURE__ */ (0,
|
|
1116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components11.ListItem.AdditionalInfo, { children: additionalText });
|
|
993
1117
|
};
|
|
994
1118
|
|
|
995
1119
|
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
996
|
-
var
|
|
997
|
-
var
|
|
998
|
-
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0,
|
|
1120
|
+
var import_components12 = require("@transferwise/components");
|
|
1121
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1122
|
+
var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components12.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
|
|
999
1123
|
|
|
1000
1124
|
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
1001
|
-
var
|
|
1002
|
-
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0,
|
|
1125
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1126
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
|
|
1003
1127
|
|
|
1004
1128
|
// ../renderers/src/utils/listItem/getSupportingValues.ts
|
|
1005
1129
|
var getSupportingValues = (supportingValues) => {
|
|
@@ -1007,18 +1131,18 @@ var getSupportingValues = (supportingValues) => {
|
|
|
1007
1131
|
};
|
|
1008
1132
|
|
|
1009
1133
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1010
|
-
var
|
|
1134
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1011
1135
|
var CheckboxInputRenderer = {
|
|
1012
1136
|
canRenderType: "input-checkbox",
|
|
1013
1137
|
render: (props) => {
|
|
1014
1138
|
switch (props.control) {
|
|
1015
1139
|
case "switch-item":
|
|
1016
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SwitchItemComponent, __spreadValues({}, props));
|
|
1017
1141
|
case "checkbox-item":
|
|
1018
|
-
return /* @__PURE__ */ (0,
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxItemComponent, __spreadValues({}, props));
|
|
1019
1143
|
case "checkbox":
|
|
1020
1144
|
default:
|
|
1021
|
-
return /* @__PURE__ */ (0,
|
|
1145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxComponent, __spreadValues({}, props));
|
|
1022
1146
|
}
|
|
1023
1147
|
}
|
|
1024
1148
|
};
|
|
@@ -1043,7 +1167,7 @@ var CheckboxComponent = (props) => {
|
|
|
1043
1167
|
"value"
|
|
1044
1168
|
]);
|
|
1045
1169
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
1046
|
-
return /* @__PURE__ */ (0,
|
|
1170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1047
1171
|
FieldInput_default,
|
|
1048
1172
|
{
|
|
1049
1173
|
id,
|
|
@@ -1054,7 +1178,7 @@ var CheckboxComponent = (props) => {
|
|
|
1054
1178
|
inlineAlert: rest.inlineAlert,
|
|
1055
1179
|
loadingState: rest.fieldLoadingState,
|
|
1056
1180
|
features: rest.features,
|
|
1057
|
-
children: /* @__PURE__ */ (0,
|
|
1181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.Checkbox, __spreadValues({ id }, checkboxProps))
|
|
1058
1182
|
}
|
|
1059
1183
|
);
|
|
1060
1184
|
};
|
|
@@ -1073,8 +1197,8 @@ var CheckboxItemComponent = (props) => {
|
|
|
1073
1197
|
onChange
|
|
1074
1198
|
} = props;
|
|
1075
1199
|
const { ref } = useScrollToError(validationState, features);
|
|
1076
|
-
return /* @__PURE__ */ (0,
|
|
1077
|
-
|
|
1200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1201
|
+
import_components13.ListItem,
|
|
1078
1202
|
__spreadValues({
|
|
1079
1203
|
title,
|
|
1080
1204
|
subtitle: description,
|
|
@@ -1082,7 +1206,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1082
1206
|
media: getMedia(media, false),
|
|
1083
1207
|
disabled,
|
|
1084
1208
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1085
|
-
control: /* @__PURE__ */ (0,
|
|
1209
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.ListItem.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
1086
1210
|
}, getSupportingValues(supportingValues))
|
|
1087
1211
|
) });
|
|
1088
1212
|
};
|
|
@@ -1101,8 +1225,8 @@ var SwitchItemComponent = (props) => {
|
|
|
1101
1225
|
onChange
|
|
1102
1226
|
} = props;
|
|
1103
1227
|
const { ref } = useScrollToError(validationState, features);
|
|
1104
|
-
return /* @__PURE__ */ (0,
|
|
1105
|
-
|
|
1228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1229
|
+
import_components13.ListItem,
|
|
1106
1230
|
__spreadValues({
|
|
1107
1231
|
title,
|
|
1108
1232
|
subtitle: description,
|
|
@@ -1110,20 +1234,20 @@ var SwitchItemComponent = (props) => {
|
|
|
1110
1234
|
media: getMedia(media, false),
|
|
1111
1235
|
disabled,
|
|
1112
1236
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1113
|
-
control: /* @__PURE__ */ (0,
|
|
1237
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
1114
1238
|
}, getSupportingValues(supportingValues))
|
|
1115
1239
|
) });
|
|
1116
1240
|
};
|
|
1117
1241
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
1118
1242
|
if ((validationState == null ? void 0 : validationState.status) === "invalid") {
|
|
1119
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.ListItem.Prompt, { sentiment: "negative", children: validationState.message });
|
|
1120
1244
|
}
|
|
1121
1245
|
return getInlineAlert(inlineAlert);
|
|
1122
1246
|
};
|
|
1123
1247
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1124
1248
|
|
|
1125
1249
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
1126
|
-
var
|
|
1250
|
+
var import_components21 = require("@transferwise/components");
|
|
1127
1251
|
|
|
1128
1252
|
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.13.24_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
1129
1253
|
var React = __toESM(require("react"), 1);
|
|
@@ -2089,12 +2213,12 @@ function useWindowVirtualizer(options) {
|
|
|
2089
2213
|
}
|
|
2090
2214
|
|
|
2091
2215
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2092
|
-
var
|
|
2093
|
-
var
|
|
2216
|
+
var import_components15 = require("@transferwise/components");
|
|
2217
|
+
var import_react7 = require("react");
|
|
2094
2218
|
|
|
2095
2219
|
// ../renderers/src/step/StepFooter.tsx
|
|
2096
|
-
var
|
|
2097
|
-
var
|
|
2220
|
+
var import_components14 = require("@transferwise/components");
|
|
2221
|
+
var import_react6 = require("react");
|
|
2098
2222
|
var import_react_intl6 = require("react-intl");
|
|
2099
2223
|
|
|
2100
2224
|
// ../renderers/src/messages/step.messages.ts
|
|
@@ -2108,24 +2232,24 @@ var step_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
2108
2232
|
});
|
|
2109
2233
|
|
|
2110
2234
|
// ../renderers/src/step/StepFooter.tsx
|
|
2111
|
-
var
|
|
2235
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2112
2236
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
2113
2237
|
var StepFooter = ({ footer, tags }) => {
|
|
2114
2238
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
2115
|
-
return /* @__PURE__ */ (0,
|
|
2239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FooterWithScrollButton, { footer });
|
|
2116
2240
|
}
|
|
2117
|
-
return /* @__PURE__ */ (0,
|
|
2241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DefaultFooter, { footer });
|
|
2118
2242
|
};
|
|
2119
2243
|
var DefaultFooter = ({ footer }) => {
|
|
2120
2244
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2121
|
-
return hasFooter ? /* @__PURE__ */ (0,
|
|
2245
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
2122
2246
|
};
|
|
2123
2247
|
var FooterWithScrollButton = ({ footer }) => {
|
|
2124
2248
|
const { formatMessage } = (0, import_react_intl6.useIntl)();
|
|
2125
|
-
const endOfLayoutRef = (0,
|
|
2249
|
+
const endOfLayoutRef = (0, import_react6.useRef)(null);
|
|
2126
2250
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
2127
|
-
const scrollButton = /* @__PURE__ */ (0,
|
|
2128
|
-
|
|
2251
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2252
|
+
import_components14.Button,
|
|
2129
2253
|
{
|
|
2130
2254
|
className: "m-b-1",
|
|
2131
2255
|
v2: true,
|
|
@@ -2140,19 +2264,19 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
2140
2264
|
);
|
|
2141
2265
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
2142
2266
|
if (isElementVisible && !hasStepFooterContent) {
|
|
2143
|
-
return /* @__PURE__ */ (0,
|
|
2267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
2144
2268
|
}
|
|
2145
|
-
return /* @__PURE__ */ (0,
|
|
2146
|
-
/* @__PURE__ */ (0,
|
|
2147
|
-
/* @__PURE__ */ (0,
|
|
2269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2270
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
2271
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
2148
2272
|
!isElementVisible && scrollButton,
|
|
2149
2273
|
footer
|
|
2150
2274
|
] })
|
|
2151
2275
|
] });
|
|
2152
2276
|
};
|
|
2153
2277
|
var useIsElementVisible = (elementRef) => {
|
|
2154
|
-
const [isVisible, setIsVisible] = (0,
|
|
2155
|
-
(0,
|
|
2278
|
+
const [isVisible, setIsVisible] = (0, import_react6.useState)(false);
|
|
2279
|
+
(0, import_react6.useEffect)(() => {
|
|
2156
2280
|
const element = elementRef.current;
|
|
2157
2281
|
if (!element) return;
|
|
2158
2282
|
const observer = new IntersectionObserver(([entry]) => {
|
|
@@ -2165,58 +2289,51 @@ var useIsElementVisible = (elementRef) => {
|
|
|
2165
2289
|
};
|
|
2166
2290
|
|
|
2167
2291
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
2168
|
-
var
|
|
2292
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2169
2293
|
var ContentComponent = (props) => {
|
|
2170
2294
|
const { state, status, SectionHeader, Item } = props;
|
|
2171
|
-
const endOfContentRef = (0,
|
|
2295
|
+
const endOfContentRef = (0, import_react7.useRef)(null);
|
|
2172
2296
|
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
2173
|
-
(0,
|
|
2297
|
+
(0, import_react7.useEffect)(() => {
|
|
2174
2298
|
var _a;
|
|
2175
|
-
console.log("bottom visible", status);
|
|
2176
2299
|
if (isBottomVisible && status.type === "idle" && status.loadMore) {
|
|
2177
2300
|
(_a = status.loadMore) == null ? void 0 : _a.call(status);
|
|
2178
2301
|
}
|
|
2179
|
-
}, [isBottomVisible]);
|
|
2302
|
+
}, [isBottomVisible, status]);
|
|
2180
2303
|
const stateCount = state.sections.reduce(
|
|
2181
2304
|
(total, section) => section.items.length + total + (section.title ? 1 : 0),
|
|
2182
2305
|
0
|
|
2183
2306
|
);
|
|
2184
|
-
const items =
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
}, []);
|
|
2202
|
-
}, [stateCount]);
|
|
2203
|
-
const listRef = (0, import_react6.useRef)(null);
|
|
2204
|
-
const listOffsetRef = (0, import_react6.useRef)(0);
|
|
2205
|
-
(0, import_react6.useLayoutEffect)(() => {
|
|
2307
|
+
const items = state.sections.flatMap((section) => [
|
|
2308
|
+
...section.title ? [
|
|
2309
|
+
{
|
|
2310
|
+
type: "header",
|
|
2311
|
+
title: section.title,
|
|
2312
|
+
items: section.items,
|
|
2313
|
+
id: section.id
|
|
2314
|
+
}
|
|
2315
|
+
] : [],
|
|
2316
|
+
...section.items.map((item) => ({
|
|
2317
|
+
item,
|
|
2318
|
+
type: "item"
|
|
2319
|
+
}))
|
|
2320
|
+
]);
|
|
2321
|
+
const listRef = (0, import_react7.useRef)(null);
|
|
2322
|
+
const listOffsetRef = (0, import_react7.useRef)(0);
|
|
2323
|
+
(0, import_react7.useLayoutEffect)(() => {
|
|
2206
2324
|
var _a, _b;
|
|
2207
2325
|
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
2208
2326
|
});
|
|
2209
2327
|
const virtualizer = useWindowVirtualizer({
|
|
2210
2328
|
count: stateCount,
|
|
2211
2329
|
estimateSize: () => 120,
|
|
2212
|
-
// todo, we could be clever here. Is it worth it?
|
|
2213
2330
|
overscan: 10,
|
|
2331
|
+
// eslint-disable-next-line react-hooks/refs
|
|
2214
2332
|
scrollMargin: listOffsetRef.current
|
|
2215
2333
|
});
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
showState && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: listRef, children: [
|
|
2335
|
+
state.beforeSections,
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2220
2337
|
"div",
|
|
2221
2338
|
{
|
|
2222
2339
|
style: {
|
|
@@ -2229,7 +2346,7 @@ var ContentComponent = (props) => {
|
|
|
2229
2346
|
if (!i) {
|
|
2230
2347
|
return null;
|
|
2231
2348
|
}
|
|
2232
|
-
return /* @__PURE__ */ (0,
|
|
2349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2233
2350
|
"div",
|
|
2234
2351
|
{
|
|
2235
2352
|
ref: virtualizer.measureElement,
|
|
@@ -2241,74 +2358,38 @@ var ContentComponent = (props) => {
|
|
|
2241
2358
|
width: "100%",
|
|
2242
2359
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
2243
2360
|
},
|
|
2244
|
-
children: i.type === "header" ? /* @__PURE__ */ (0,
|
|
2361
|
+
children: i.type === "header" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Item, __spreadValues({}, i.item))
|
|
2245
2362
|
},
|
|
2246
2363
|
item.key
|
|
2247
2364
|
);
|
|
2248
2365
|
})
|
|
2249
2366
|
}
|
|
2250
2367
|
),
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
2252
|
-
status.type === "idle" && status.loadMore || status.type === "loading" ? /* @__PURE__ */ (0,
|
|
2253
|
-
status.type === "error" && status.reason === "pagination" ? /* @__PURE__ */ (0,
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: [
|
|
2369
|
+
status.type === "idle" && status.loadMore || status.type === "loading" && status.reason === "pagination" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components15.ProcessIndicator, { size: "xs" }) : null,
|
|
2370
|
+
status.type === "error" && status.reason === "pagination" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components15.Button, { v2: true, size: "sm", priority: "secondary-neutral", onClick: status.retry, children: "Load more" }) }) : null
|
|
2254
2371
|
] }),
|
|
2255
|
-
|
|
2372
|
+
state.afterSections
|
|
2256
2373
|
] });
|
|
2257
2374
|
};
|
|
2258
2375
|
|
|
2259
|
-
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2260
|
-
var import_components14 = require("@transferwise/components");
|
|
2261
|
-
var import_icons = require("@transferwise/icons");
|
|
2262
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2263
|
-
var SearchComponent = ({ state, features }) => {
|
|
2264
|
-
const { search } = state;
|
|
2265
|
-
if (!search) {
|
|
2266
|
-
return;
|
|
2267
|
-
}
|
|
2268
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2269
|
-
FieldInput_default,
|
|
2270
|
-
{
|
|
2271
|
-
id: "search",
|
|
2272
|
-
description: "",
|
|
2273
|
-
validation: void 0,
|
|
2274
|
-
help: "",
|
|
2275
|
-
label: search.title,
|
|
2276
|
-
features,
|
|
2277
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components14.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_icons.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2278
|
-
import_components14.Input,
|
|
2279
|
-
{
|
|
2280
|
-
id: "search",
|
|
2281
|
-
name: "search",
|
|
2282
|
-
shape: "pill",
|
|
2283
|
-
placeholder: search.hint,
|
|
2284
|
-
type: "text",
|
|
2285
|
-
value: search.query,
|
|
2286
|
-
onChange: ({ currentTarget: { value } }) => {
|
|
2287
|
-
search.onChange(value);
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
) })
|
|
2291
|
-
}
|
|
2292
|
-
);
|
|
2293
|
-
};
|
|
2294
|
-
|
|
2295
2376
|
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
2296
|
-
var
|
|
2297
|
-
var
|
|
2377
|
+
var import_components16 = require("@transferwise/components");
|
|
2378
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2298
2379
|
var FiltersComponent = ({ state }) => {
|
|
2299
2380
|
const { filters } = state;
|
|
2300
|
-
return filters.map((filter) => {
|
|
2381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
2301
2382
|
var _a;
|
|
2302
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
-
});
|
|
2383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
2384
|
+
}) });
|
|
2304
2385
|
};
|
|
2305
2386
|
var FilterComponent = (filter) => {
|
|
2306
2387
|
const { multiSelect, options } = filter;
|
|
2307
2388
|
if (!options) {
|
|
2308
2389
|
return null;
|
|
2309
2390
|
}
|
|
2310
|
-
return /* @__PURE__ */ (0,
|
|
2311
|
-
|
|
2391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2392
|
+
import_components16.Chips,
|
|
2312
2393
|
{
|
|
2313
2394
|
className: "m-b-1",
|
|
2314
2395
|
multiple: multiSelect,
|
|
@@ -2333,11 +2414,11 @@ var FilterComponent = (filter) => {
|
|
|
2333
2414
|
};
|
|
2334
2415
|
|
|
2335
2416
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2336
|
-
var
|
|
2417
|
+
var import_components19 = require("@transferwise/components");
|
|
2337
2418
|
|
|
2338
2419
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
2339
|
-
var
|
|
2340
|
-
var
|
|
2420
|
+
var import_components17 = require("@transferwise/components");
|
|
2421
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2341
2422
|
var getAdditionalInfo = (additionalInfo) => {
|
|
2342
2423
|
var _a, _b;
|
|
2343
2424
|
if (!additionalInfo) {
|
|
@@ -2345,8 +2426,8 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
2345
2426
|
}
|
|
2346
2427
|
const { href, text, onClick } = additionalInfo;
|
|
2347
2428
|
if (href || onClick) {
|
|
2348
|
-
return /* @__PURE__ */ (0,
|
|
2349
|
-
|
|
2429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2430
|
+
import_components17.ListItem.AdditionalInfo,
|
|
2350
2431
|
{
|
|
2351
2432
|
action: __spreadValues({
|
|
2352
2433
|
label: text
|
|
@@ -2354,20 +2435,20 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
2354
2435
|
}
|
|
2355
2436
|
);
|
|
2356
2437
|
}
|
|
2357
|
-
return /* @__PURE__ */ (0,
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components17.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
2358
2439
|
};
|
|
2359
2440
|
|
|
2360
2441
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
2361
|
-
var
|
|
2362
|
-
var
|
|
2442
|
+
var import_components18 = require("@transferwise/components");
|
|
2443
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2363
2444
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
2364
2445
|
if (!callToAction) {
|
|
2365
2446
|
return void 0;
|
|
2366
2447
|
}
|
|
2367
2448
|
const { accessibilityDescription, title, context } = callToAction;
|
|
2368
2449
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
2369
|
-
return /* @__PURE__ */ (0,
|
|
2370
|
-
|
|
2450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2451
|
+
import_components18.ListItem.Button,
|
|
2371
2452
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
2372
2453
|
partiallyInteractive: !fullyInteractive,
|
|
2373
2454
|
priority,
|
|
@@ -2391,7 +2472,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
2391
2472
|
};
|
|
2392
2473
|
|
|
2393
2474
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
2394
|
-
var
|
|
2475
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2395
2476
|
var ItemComponent = (props) => {
|
|
2396
2477
|
var _a, _b;
|
|
2397
2478
|
const {
|
|
@@ -2412,8 +2493,8 @@ var ItemComponent = (props) => {
|
|
|
2412
2493
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
2413
2494
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2414
2495
|
};
|
|
2415
|
-
return /* @__PURE__ */ (0,
|
|
2416
|
-
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2497
|
+
import_components19.ListItem,
|
|
2417
2498
|
{
|
|
2418
2499
|
title,
|
|
2419
2500
|
subtitle: description,
|
|
@@ -2429,25 +2510,68 @@ var ItemComponent = (props) => {
|
|
|
2429
2510
|
};
|
|
2430
2511
|
var getNavigationControl = (onClick, href) => {
|
|
2431
2512
|
if (href) {
|
|
2432
|
-
return /* @__PURE__ */ (0,
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.ListItem.Navigation, { href });
|
|
2433
2514
|
}
|
|
2434
2515
|
if (onClick) {
|
|
2435
|
-
return /* @__PURE__ */ (0,
|
|
2516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components19.ListItem.Navigation, { onClick });
|
|
2436
2517
|
}
|
|
2437
2518
|
return null;
|
|
2438
2519
|
};
|
|
2439
2520
|
|
|
2521
|
+
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
2522
|
+
var import_components20 = require("@transferwise/components");
|
|
2523
|
+
var import_icons = require("@transferwise/icons");
|
|
2524
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2525
|
+
var SearchComponent = ({ state, status, features }) => {
|
|
2526
|
+
const { search } = state;
|
|
2527
|
+
if (!search) {
|
|
2528
|
+
return;
|
|
2529
|
+
}
|
|
2530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2531
|
+
FieldInput_default,
|
|
2532
|
+
{
|
|
2533
|
+
id: "search",
|
|
2534
|
+
description: "",
|
|
2535
|
+
validation: void 0,
|
|
2536
|
+
help: "",
|
|
2537
|
+
label: search.title,
|
|
2538
|
+
features,
|
|
2539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2540
|
+
import_components20.InputGroup,
|
|
2541
|
+
{
|
|
2542
|
+
addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons.Search, { size: 24 }) },
|
|
2543
|
+
addonEnd: status.type === "loading" ? { content: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components20.ProcessIndicator, { size: "xs" }) } : void 0,
|
|
2544
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2545
|
+
import_components20.Input,
|
|
2546
|
+
{
|
|
2547
|
+
id: "search",
|
|
2548
|
+
name: "search",
|
|
2549
|
+
shape: "pill",
|
|
2550
|
+
placeholder: search.hint,
|
|
2551
|
+
type: "text",
|
|
2552
|
+
value: search.query,
|
|
2553
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
2554
|
+
search.onChange(value);
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
)
|
|
2558
|
+
}
|
|
2559
|
+
)
|
|
2560
|
+
}
|
|
2561
|
+
);
|
|
2562
|
+
};
|
|
2563
|
+
|
|
2440
2564
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
2441
|
-
var
|
|
2565
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2442
2566
|
var SectionHeaderComponent = ({
|
|
2443
2567
|
title,
|
|
2444
2568
|
callToAction
|
|
2445
|
-
}) => /* @__PURE__ */ (0,
|
|
2569
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Header, { title, callToAction });
|
|
2446
2570
|
|
|
2447
2571
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
2448
|
-
var
|
|
2572
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2449
2573
|
var createCollectionRenderer = (canRender, components) => {
|
|
2450
|
-
const
|
|
2574
|
+
const componentsWithDefaults = __spreadValues({
|
|
2451
2575
|
Search: SearchComponent,
|
|
2452
2576
|
Filters: FiltersComponent,
|
|
2453
2577
|
Filter: FilterComponent,
|
|
@@ -2459,47 +2583,40 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
2459
2583
|
canRenderType: "collection",
|
|
2460
2584
|
canRender,
|
|
2461
2585
|
render: (props) => {
|
|
2462
|
-
return /* @__PURE__ */ (0,
|
|
2586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
2463
2587
|
}
|
|
2464
2588
|
};
|
|
2465
2589
|
};
|
|
2466
2590
|
|
|
2467
2591
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
2468
|
-
var
|
|
2592
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2469
2593
|
var CollectionRendererComponent = (props) => {
|
|
2470
2594
|
const { status, Search: Search4, Filters, Results } = props;
|
|
2471
|
-
return /* @__PURE__ */ (0,
|
|
2472
|
-
/* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
status.type === "idle" || status.type === "loading" ? /* @__PURE__ */ (0,
|
|
2475
|
-
status.type === "error" && status.reason === "search" && /* @__PURE__ */ (0,
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Search4, __spreadValues({}, props)),
|
|
2597
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Filters, __spreadValues({}, props)),
|
|
2598
|
+
status.type === "idle" || status.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Results, __spreadValues({}, props)) : void 0,
|
|
2599
|
+
status.type === "error" && status.reason === "search" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_components21.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
2476
2600
|
"Something went wrong,\xA0",
|
|
2477
|
-
/* @__PURE__ */ (0,
|
|
2601
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components21.Link, { onClick: status.retry, children: "click here to retry" })
|
|
2478
2602
|
] })
|
|
2479
2603
|
] });
|
|
2480
2604
|
};
|
|
2481
|
-
var CollectionRenderer = createCollectionRenderer(() => true
|
|
2482
|
-
Search: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SearchComponent, __spreadValues({}, props)),
|
|
2483
|
-
Filters: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FiltersComponent, __spreadValues({}, props)),
|
|
2484
|
-
Filter: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FilterComponent, __spreadValues({}, props)),
|
|
2485
|
-
Item: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ItemComponent, __spreadValues({}, props)),
|
|
2486
|
-
SectionHeader: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SectionHeaderComponent, __spreadValues({}, props)),
|
|
2487
|
-
Results: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ContentComponent, __spreadValues({}, props))
|
|
2488
|
-
});
|
|
2605
|
+
var CollectionRenderer = createCollectionRenderer(() => true);
|
|
2489
2606
|
var CollectionRenderer_default = CollectionRenderer;
|
|
2490
2607
|
|
|
2491
2608
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2492
2609
|
var import_classnames3 = __toESM(require_classnames());
|
|
2493
2610
|
|
|
2494
2611
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
2495
|
-
var
|
|
2612
|
+
var import_react8 = require("react");
|
|
2496
2613
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
2497
2614
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
2498
2615
|
var useIsCollapsed = () => {
|
|
2499
|
-
const [collapsed, setCollapsed] = (0,
|
|
2616
|
+
const [collapsed, setCollapsed] = (0, import_react8.useState)(
|
|
2500
2617
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
2501
2618
|
);
|
|
2502
|
-
(0,
|
|
2619
|
+
(0, import_react8.useEffect)(() => {
|
|
2503
2620
|
if (supportsMatchMedia()) {
|
|
2504
2621
|
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
2505
2622
|
const update = () => setCollapsed(mql.matches);
|
|
@@ -2512,7 +2629,7 @@ var useIsCollapsed = () => {
|
|
|
2512
2629
|
};
|
|
2513
2630
|
|
|
2514
2631
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
2515
|
-
var
|
|
2632
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2516
2633
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
2517
2634
|
var ColumnsRenderer = {
|
|
2518
2635
|
canRenderType: "columns",
|
|
@@ -2528,9 +2645,9 @@ function ColumnsRendererComponent({
|
|
|
2528
2645
|
var _a;
|
|
2529
2646
|
const isCollapsed = useIsCollapsed();
|
|
2530
2647
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
2531
|
-
const startColumn = /* @__PURE__ */ (0,
|
|
2532
|
-
const endColumn = /* @__PURE__ */ (0,
|
|
2533
|
-
return /* @__PURE__ */ (0,
|
|
2648
|
+
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
2649
|
+
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
2650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2534
2651
|
"div",
|
|
2535
2652
|
{
|
|
2536
2653
|
className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
|
|
@@ -2547,7 +2664,7 @@ function ColumnsRendererComponent({
|
|
|
2547
2664
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
2548
2665
|
|
|
2549
2666
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
2550
|
-
var
|
|
2667
|
+
var import_components22 = require("@transferwise/components");
|
|
2551
2668
|
|
|
2552
2669
|
// ../renderers/src/validators/type-validators.ts
|
|
2553
2670
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
@@ -2574,7 +2691,7 @@ var dateToDateString = (date) => {
|
|
|
2574
2691
|
};
|
|
2575
2692
|
|
|
2576
2693
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
2577
|
-
var
|
|
2694
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2578
2695
|
function VariableDateInput({
|
|
2579
2696
|
control,
|
|
2580
2697
|
inputProps
|
|
@@ -2590,8 +2707,8 @@ function VariableDateInput({
|
|
|
2590
2707
|
onFocus
|
|
2591
2708
|
} = inputProps;
|
|
2592
2709
|
if (control === "date-lookup") {
|
|
2593
|
-
return /* @__PURE__ */ (0,
|
|
2594
|
-
|
|
2710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2711
|
+
import_components22.DateLookup,
|
|
2595
2712
|
{
|
|
2596
2713
|
value: dateStringToDateOrNull(inputProps.value),
|
|
2597
2714
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -2606,8 +2723,8 @@ function VariableDateInput({
|
|
|
2606
2723
|
}
|
|
2607
2724
|
);
|
|
2608
2725
|
}
|
|
2609
|
-
return /* @__PURE__ */ (0,
|
|
2610
|
-
|
|
2726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2727
|
+
import_components22.DateInput,
|
|
2611
2728
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
2612
2729
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
2613
2730
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -2623,7 +2740,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
2623
2740
|
var VariableDateInput_default = VariableDateInput;
|
|
2624
2741
|
|
|
2625
2742
|
// ../renderers/src/DateInputRenderer.tsx
|
|
2626
|
-
var
|
|
2743
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2627
2744
|
var DateInputRenderer = {
|
|
2628
2745
|
canRenderType: "input-date",
|
|
2629
2746
|
render: (props) => {
|
|
@@ -2648,7 +2765,7 @@ var DateInputRenderer = {
|
|
|
2648
2765
|
]);
|
|
2649
2766
|
const value = initialValue != null ? initialValue : "";
|
|
2650
2767
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2651
|
-
return /* @__PURE__ */ (0,
|
|
2768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2652
2769
|
FieldInput_default,
|
|
2653
2770
|
{
|
|
2654
2771
|
id,
|
|
@@ -2659,7 +2776,7 @@ var DateInputRenderer = {
|
|
|
2659
2776
|
loadingState: props.fieldLoadingState,
|
|
2660
2777
|
help,
|
|
2661
2778
|
features: props.features,
|
|
2662
|
-
children: /* @__PURE__ */ (0,
|
|
2779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(VariableDateInput_default, { control, inputProps })
|
|
2663
2780
|
}
|
|
2664
2781
|
);
|
|
2665
2782
|
}
|
|
@@ -2667,11 +2784,11 @@ var DateInputRenderer = {
|
|
|
2667
2784
|
var DateInputRenderer_default = DateInputRenderer;
|
|
2668
2785
|
|
|
2669
2786
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2670
|
-
var
|
|
2787
|
+
var import_components25 = require("@transferwise/components");
|
|
2671
2788
|
|
|
2672
2789
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2673
|
-
var
|
|
2674
|
-
var
|
|
2790
|
+
var import_components24 = require("@transferwise/components");
|
|
2791
|
+
var import_react9 = require("react");
|
|
2675
2792
|
var import_react_intl10 = require("react-intl");
|
|
2676
2793
|
|
|
2677
2794
|
// ../renderers/src/messages/filter.messages.ts
|
|
@@ -2694,10 +2811,10 @@ var filter_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
2694
2811
|
}
|
|
2695
2812
|
});
|
|
2696
2813
|
|
|
2697
|
-
// ../renderers/src/
|
|
2698
|
-
function
|
|
2814
|
+
// ../renderers/src/utils/filter-and-sort-items.ts
|
|
2815
|
+
function filterAndSortItems(options, query) {
|
|
2699
2816
|
const upperQuery = normalizeAndRemoveAccents(query);
|
|
2700
|
-
const filteredItems =
|
|
2817
|
+
const filteredItems = options.filter((option) => {
|
|
2701
2818
|
var _a, _b, _c, _d;
|
|
2702
2819
|
const searchableWords = [
|
|
2703
2820
|
option.title,
|
|
@@ -2742,7 +2859,7 @@ function filterAndSortDecisionOptions(selectOptions, query) {
|
|
|
2742
2859
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
2743
2860
|
|
|
2744
2861
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2745
|
-
var
|
|
2862
|
+
var import_components23 = require("@transferwise/components");
|
|
2746
2863
|
var import_react_intl9 = require("react-intl");
|
|
2747
2864
|
|
|
2748
2865
|
// ../renderers/src/messages/group.messages.ts
|
|
@@ -2781,7 +2898,7 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
2781
2898
|
};
|
|
2782
2899
|
|
|
2783
2900
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
2784
|
-
var
|
|
2901
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2785
2902
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
2786
2903
|
var isGroupedDecision = (options) => {
|
|
2787
2904
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
@@ -2791,9 +2908,9 @@ var GroupedDecisionList = (_a) => {
|
|
|
2791
2908
|
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
2792
2909
|
const { options } = rest;
|
|
2793
2910
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2796
|
-
|
|
2911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_components23.Section, { children: [
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2913
|
+
import_components23.Header,
|
|
2797
2914
|
{
|
|
2798
2915
|
as: "h2",
|
|
2799
2916
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -2804,26 +2921,27 @@ var GroupedDecisionList = (_a) => {
|
|
|
2804
2921
|
};
|
|
2805
2922
|
|
|
2806
2923
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
2807
|
-
var
|
|
2924
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2808
2925
|
var DecisionWrapper = (props) => {
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2926
|
+
const { title, control, margin } = props;
|
|
2927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
2928
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components24.Header, { as: "h2", title }),
|
|
2929
|
+
control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
2812
2930
|
] });
|
|
2813
2931
|
};
|
|
2814
2932
|
var UnfilteredDecisionList = (_a) => {
|
|
2815
2933
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
2816
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
2934
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
2817
2935
|
};
|
|
2818
2936
|
var FilteredDecisionList = (props) => {
|
|
2819
2937
|
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
2820
|
-
const [query, setQuery] = (0,
|
|
2938
|
+
const [query, setQuery] = (0, import_react9.useState)("");
|
|
2821
2939
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
2822
|
-
const filteredOptions = (query == null ? void 0 : query.length) > 0 ?
|
|
2940
|
+
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
2823
2941
|
const isGrouped = isGroupedDecision(options);
|
|
2824
|
-
return /* @__PURE__ */ (0,
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2826
|
-
|
|
2942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2944
|
+
import_components24.SearchInput,
|
|
2827
2945
|
{
|
|
2828
2946
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
2829
2947
|
value: query,
|
|
@@ -2834,25 +2952,25 @@ var FilteredDecisionList = (props) => {
|
|
|
2834
2952
|
}
|
|
2835
2953
|
}
|
|
2836
2954
|
),
|
|
2837
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
2838
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
2955
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2956
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components24.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
2839
2957
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
2840
2958
|
control,
|
|
2841
2959
|
className: query.length === 0 ? "m-t-3" : "",
|
|
2842
2960
|
options: filteredOptions
|
|
2843
|
-
}) : /* @__PURE__ */ (0,
|
|
2961
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
2844
2962
|
] })
|
|
2845
2963
|
] });
|
|
2846
2964
|
};
|
|
2847
2965
|
|
|
2848
2966
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
2849
|
-
var
|
|
2967
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2850
2968
|
var DecisionRenderer = {
|
|
2851
2969
|
canRenderType: "decision",
|
|
2852
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2970
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
2853
2971
|
};
|
|
2854
2972
|
var renderDecisionList = ({ options, control }) => {
|
|
2855
|
-
return /* @__PURE__ */ (0,
|
|
2973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: options.map((_a) => {
|
|
2856
2974
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
2857
2975
|
const {
|
|
2858
2976
|
description,
|
|
@@ -2865,8 +2983,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2865
2983
|
supportingValues,
|
|
2866
2984
|
tags
|
|
2867
2985
|
} = rest;
|
|
2868
|
-
return /* @__PURE__ */ (0,
|
|
2869
|
-
|
|
2986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2987
|
+
import_components25.ListItem,
|
|
2870
2988
|
{
|
|
2871
2989
|
title: itemTitle,
|
|
2872
2990
|
subtitle: description,
|
|
@@ -2877,7 +2995,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2877
2995
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
2878
2996
|
prompt: getInlineAlert(inlineAlert),
|
|
2879
2997
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
2880
|
-
control: /* @__PURE__ */ (0,
|
|
2998
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components25.ListItem.Navigation, __spreadValues({}, getAnchorProps()))
|
|
2881
2999
|
},
|
|
2882
3000
|
JSON.stringify(rest)
|
|
2883
3001
|
);
|
|
@@ -2886,8 +3004,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
2886
3004
|
var DecisionRenderer_default = DecisionRenderer;
|
|
2887
3005
|
|
|
2888
3006
|
// ../renderers/src/DividerRenderer.tsx
|
|
2889
|
-
var
|
|
2890
|
-
var
|
|
3007
|
+
var import_components26 = require("@transferwise/components");
|
|
3008
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2891
3009
|
var mapControlToLevel = (control) => {
|
|
2892
3010
|
switch (control) {
|
|
2893
3011
|
case "section":
|
|
@@ -2900,12 +3018,12 @@ var mapControlToLevel = (control) => {
|
|
|
2900
3018
|
};
|
|
2901
3019
|
var DividerRenderer = {
|
|
2902
3020
|
canRenderType: "divider",
|
|
2903
|
-
render: ({ margin, control }) => /* @__PURE__ */ (0,
|
|
3021
|
+
render: ({ margin, control }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components26.Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
2904
3022
|
};
|
|
2905
3023
|
var DividerRenderer_default = DividerRenderer;
|
|
2906
3024
|
|
|
2907
3025
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2908
|
-
var
|
|
3026
|
+
var import_components27 = require("@transferwise/components");
|
|
2909
3027
|
|
|
2910
3028
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
2911
3029
|
var import_react_intl11 = require("react-intl");
|
|
@@ -2934,8 +3052,8 @@ var external_confirmation_messages_default = (0, import_react_intl11.defineMessa
|
|
|
2934
3052
|
|
|
2935
3053
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
2936
3054
|
var import_react_intl12 = require("react-intl");
|
|
2937
|
-
var
|
|
2938
|
-
var
|
|
3055
|
+
var import_react10 = require("react");
|
|
3056
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2939
3057
|
var ExternalConfirmationRenderer = {
|
|
2940
3058
|
canRenderType: "external-confirmation",
|
|
2941
3059
|
render: ExternalConfirmationRendererComponent
|
|
@@ -2947,19 +3065,19 @@ function ExternalConfirmationRendererComponent({
|
|
|
2947
3065
|
onCancel
|
|
2948
3066
|
}) {
|
|
2949
3067
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2950
|
-
(0,
|
|
3068
|
+
(0, import_react10.useEffect)(() => {
|
|
2951
3069
|
open();
|
|
2952
3070
|
}, []);
|
|
2953
|
-
return /* @__PURE__ */ (0,
|
|
2954
|
-
|
|
3071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3072
|
+
import_components27.Modal,
|
|
2955
3073
|
{
|
|
2956
3074
|
open: visible,
|
|
2957
3075
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
2958
|
-
body: /* @__PURE__ */ (0,
|
|
2959
|
-
/* @__PURE__ */ (0,
|
|
2960
|
-
/* @__PURE__ */ (0,
|
|
2961
|
-
/* @__PURE__ */ (0,
|
|
2962
|
-
|
|
3076
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components27.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3080
|
+
import_components27.Button,
|
|
2963
3081
|
{
|
|
2964
3082
|
v2: true,
|
|
2965
3083
|
block: true,
|
|
@@ -2972,7 +3090,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
2972
3090
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2973
3091
|
}
|
|
2974
3092
|
),
|
|
2975
|
-
/* @__PURE__ */ (0,
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components27.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2976
3094
|
] }) })
|
|
2977
3095
|
] }),
|
|
2978
3096
|
onClose: onCancel
|
|
@@ -2989,46 +3107,46 @@ function getOrigin(url) {
|
|
|
2989
3107
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
2990
3108
|
|
|
2991
3109
|
// ../renderers/src/FormRenderer.tsx
|
|
2992
|
-
var
|
|
3110
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2993
3111
|
var FormRenderer = {
|
|
2994
3112
|
canRenderType: "form",
|
|
2995
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
3113
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: getMargin(margin), children })
|
|
2996
3114
|
};
|
|
2997
3115
|
var FormRenderer_default = FormRenderer;
|
|
2998
3116
|
|
|
2999
3117
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
3000
|
-
var
|
|
3001
|
-
var
|
|
3118
|
+
var import_components28 = require("@transferwise/components");
|
|
3119
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3002
3120
|
var FormSectionRenderer = {
|
|
3003
3121
|
canRenderType: "form-section",
|
|
3004
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
3005
|
-
title && /* @__PURE__ */ (0,
|
|
3006
|
-
|
|
3122
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("fieldset", { children: [
|
|
3123
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3124
|
+
import_components28.Header,
|
|
3007
3125
|
{
|
|
3008
3126
|
as: "h2",
|
|
3009
3127
|
title
|
|
3010
3128
|
}
|
|
3011
3129
|
),
|
|
3012
|
-
description && /* @__PURE__ */ (0,
|
|
3130
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: description }),
|
|
3013
3131
|
children
|
|
3014
3132
|
] })
|
|
3015
3133
|
};
|
|
3016
3134
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
3017
3135
|
|
|
3018
3136
|
// ../renderers/src/HeadingRenderer.tsx
|
|
3019
|
-
var
|
|
3020
|
-
var
|
|
3137
|
+
var import_components29 = require("@transferwise/components");
|
|
3138
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3021
3139
|
var HeadingRenderer = {
|
|
3022
3140
|
canRenderType: "heading",
|
|
3023
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
3141
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Heading, __spreadValues({}, props))
|
|
3024
3142
|
};
|
|
3025
3143
|
function Heading(props) {
|
|
3026
3144
|
const { text, size, align, margin, control } = props;
|
|
3027
3145
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
3028
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
3146
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(StandardHeading, { size, text, className });
|
|
3029
3147
|
}
|
|
3030
3148
|
function DisplayHeading({ size, text, className }) {
|
|
3031
|
-
return /* @__PURE__ */ (0,
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components29.Display, { type: getDisplayType(size), className, children: text });
|
|
3032
3150
|
}
|
|
3033
3151
|
var getDisplayType = (size) => {
|
|
3034
3152
|
switch (size) {
|
|
@@ -3044,7 +3162,7 @@ var getDisplayType = (size) => {
|
|
|
3044
3162
|
}
|
|
3045
3163
|
};
|
|
3046
3164
|
function StandardHeading({ size, text, className }) {
|
|
3047
|
-
return /* @__PURE__ */ (0,
|
|
3165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components29.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
3048
3166
|
}
|
|
3049
3167
|
var getTitleTypeBySize = (size) => {
|
|
3050
3168
|
var _a;
|
|
@@ -3060,8 +3178,8 @@ var getTitleTypeBySize = (size) => {
|
|
|
3060
3178
|
var HeadingRenderer_default = HeadingRenderer;
|
|
3061
3179
|
|
|
3062
3180
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3063
|
-
var
|
|
3064
|
-
var
|
|
3181
|
+
var import_components30 = require("@transferwise/components");
|
|
3182
|
+
var import_react11 = require("react");
|
|
3065
3183
|
|
|
3066
3184
|
// ../renderers/src/utils/api-utils.ts
|
|
3067
3185
|
function isRelativePath(url = "") {
|
|
@@ -3071,7 +3189,7 @@ function isRelativePath(url = "") {
|
|
|
3071
3189
|
}
|
|
3072
3190
|
|
|
3073
3191
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
3074
|
-
var
|
|
3192
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3075
3193
|
function UrlImage({
|
|
3076
3194
|
accessibilityDescription,
|
|
3077
3195
|
align,
|
|
@@ -3080,14 +3198,14 @@ function UrlImage({
|
|
|
3080
3198
|
uri,
|
|
3081
3199
|
httpClient
|
|
3082
3200
|
}) {
|
|
3083
|
-
const [imageSource, setImageSource] = (0,
|
|
3084
|
-
(0,
|
|
3201
|
+
const [imageSource, setImageSource] = (0, import_react11.useState)("");
|
|
3202
|
+
(0, import_react11.useEffect)(() => {
|
|
3085
3203
|
if (!uri.startsWith("urn:")) {
|
|
3086
3204
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
3087
3205
|
}
|
|
3088
3206
|
}, [uri, httpClient]);
|
|
3089
|
-
return /* @__PURE__ */ (0,
|
|
3090
|
-
|
|
3207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3208
|
+
import_components30.Image,
|
|
3091
3209
|
{
|
|
3092
3210
|
className: "df-reserve-space",
|
|
3093
3211
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -3130,7 +3248,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
3130
3248
|
};
|
|
3131
3249
|
|
|
3132
3250
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
3133
|
-
var
|
|
3251
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3134
3252
|
var maxFlagSize = 600;
|
|
3135
3253
|
function UrnFlagImage({
|
|
3136
3254
|
accessibilityDescription,
|
|
@@ -3139,12 +3257,12 @@ function UrnFlagImage({
|
|
|
3139
3257
|
size,
|
|
3140
3258
|
uri
|
|
3141
3259
|
}) {
|
|
3142
|
-
return /* @__PURE__ */ (0,
|
|
3260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
3143
3261
|
}
|
|
3144
3262
|
|
|
3145
3263
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
3146
3264
|
var import_art4 = require("@wise/art");
|
|
3147
|
-
var
|
|
3265
|
+
var import_react13 = require("react");
|
|
3148
3266
|
|
|
3149
3267
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
3150
3268
|
var isAnimated = (uri) => {
|
|
@@ -3154,9 +3272,9 @@ var isAnimated = (uri) => {
|
|
|
3154
3272
|
|
|
3155
3273
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
3156
3274
|
var import_art3 = require("@wise/art");
|
|
3157
|
-
var
|
|
3158
|
-
var
|
|
3159
|
-
var Illustration3DErrorBoundary = class extends
|
|
3275
|
+
var import_react12 = require("react");
|
|
3276
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3277
|
+
var Illustration3DErrorBoundary = class extends import_react12.Component {
|
|
3160
3278
|
constructor(props) {
|
|
3161
3279
|
super(props);
|
|
3162
3280
|
this.state = { hasError: false };
|
|
@@ -3167,7 +3285,7 @@ var Illustration3DErrorBoundary = class extends import_react11.Component {
|
|
|
3167
3285
|
componentDidCatch() {
|
|
3168
3286
|
this.props.onError();
|
|
3169
3287
|
}
|
|
3170
|
-
|
|
3288
|
+
render() {
|
|
3171
3289
|
if (this.state.hasError) {
|
|
3172
3290
|
return null;
|
|
3173
3291
|
}
|
|
@@ -3179,12 +3297,12 @@ var SafeIllustration3D = ({
|
|
|
3179
3297
|
size,
|
|
3180
3298
|
onError
|
|
3181
3299
|
}) => {
|
|
3182
|
-
return /* @__PURE__ */ (0,
|
|
3300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_art3.Illustration3D, { name, size }) });
|
|
3183
3301
|
};
|
|
3184
3302
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
3185
3303
|
|
|
3186
3304
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
3187
|
-
var
|
|
3305
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3188
3306
|
var urnPrefix = "urn:wise:illustrations:";
|
|
3189
3307
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
3190
3308
|
function UrnIllustration({
|
|
@@ -3194,12 +3312,12 @@ function UrnIllustration({
|
|
|
3194
3312
|
size,
|
|
3195
3313
|
uri
|
|
3196
3314
|
}) {
|
|
3197
|
-
const [has3DFailed, setHas3DFailed] = (0,
|
|
3315
|
+
const [has3DFailed, setHas3DFailed] = (0, import_react13.useState)(false);
|
|
3198
3316
|
const illustrationSize = getIllustrationSize(size);
|
|
3199
3317
|
const illustrationName = getIllustrationName(uri);
|
|
3200
3318
|
const illustration3DName = getIllustration3DName(uri);
|
|
3201
3319
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
3202
|
-
return /* @__PURE__ */ (0,
|
|
3320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3203
3321
|
SafeIllustration3D_default,
|
|
3204
3322
|
{
|
|
3205
3323
|
name: illustration3DName,
|
|
@@ -3208,7 +3326,7 @@ function UrnIllustration({
|
|
|
3208
3326
|
}
|
|
3209
3327
|
) });
|
|
3210
3328
|
}
|
|
3211
|
-
return /* @__PURE__ */ (0,
|
|
3329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3212
3330
|
import_art4.Illustration,
|
|
3213
3331
|
{
|
|
3214
3332
|
className: "df-illustration",
|
|
@@ -3228,32 +3346,32 @@ var getIllustration3DName = (uri) => {
|
|
|
3228
3346
|
};
|
|
3229
3347
|
|
|
3230
3348
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
3231
|
-
var
|
|
3349
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3232
3350
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
3233
3351
|
function UrnImage(props) {
|
|
3234
3352
|
const { uri } = props;
|
|
3235
3353
|
if (isUrnIllustration(uri)) {
|
|
3236
|
-
return /* @__PURE__ */ (0,
|
|
3354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
3237
3355
|
}
|
|
3238
3356
|
if (isUrnFlag(uri)) {
|
|
3239
|
-
return /* @__PURE__ */ (0,
|
|
3357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
3240
3358
|
}
|
|
3241
3359
|
return null;
|
|
3242
3360
|
}
|
|
3243
3361
|
|
|
3244
3362
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
3245
|
-
var
|
|
3363
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3246
3364
|
var ImageRenderer = {
|
|
3247
3365
|
canRenderType: "image",
|
|
3248
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
3366
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(UrlImage, __spreadValues({}, props))
|
|
3249
3367
|
};
|
|
3250
3368
|
|
|
3251
3369
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
3252
3370
|
var ImageRenderer_default = ImageRenderer;
|
|
3253
3371
|
|
|
3254
3372
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
3255
|
-
var
|
|
3256
|
-
var
|
|
3373
|
+
var import_components31 = require("@transferwise/components");
|
|
3374
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3257
3375
|
var doContext = ["positive", "neutral"];
|
|
3258
3376
|
var dontContext = ["warning", "negative"];
|
|
3259
3377
|
var InstructionsRenderer = {
|
|
@@ -3261,16 +3379,16 @@ var InstructionsRenderer = {
|
|
|
3261
3379
|
render: ({ items, margin, title }) => {
|
|
3262
3380
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
3263
3381
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
3264
|
-
return /* @__PURE__ */ (0,
|
|
3265
|
-
title ? /* @__PURE__ */ (0,
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: getMargin(margin), children: [
|
|
3383
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components31.Header, { title }) : null,
|
|
3384
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components31.InstructionsList, { dos, donts })
|
|
3267
3385
|
] });
|
|
3268
3386
|
}
|
|
3269
3387
|
};
|
|
3270
3388
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
3271
3389
|
|
|
3272
3390
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3273
|
-
var
|
|
3391
|
+
var import_components32 = require("@transferwise/components");
|
|
3274
3392
|
|
|
3275
3393
|
// ../renderers/src/utils/input-utils.ts
|
|
3276
3394
|
var onWheel = (event) => {
|
|
@@ -3295,7 +3413,7 @@ function pick(obj, ...keys) {
|
|
|
3295
3413
|
}
|
|
3296
3414
|
|
|
3297
3415
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
3298
|
-
var
|
|
3416
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3299
3417
|
var IntegerInputRenderer = {
|
|
3300
3418
|
canRenderType: "input-integer",
|
|
3301
3419
|
render: (props) => {
|
|
@@ -3310,7 +3428,7 @@ var IntegerInputRenderer = {
|
|
|
3310
3428
|
"maximum",
|
|
3311
3429
|
"minimum"
|
|
3312
3430
|
);
|
|
3313
|
-
return /* @__PURE__ */ (0,
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3314
3432
|
FieldInput_default,
|
|
3315
3433
|
{
|
|
3316
3434
|
id,
|
|
@@ -3321,8 +3439,8 @@ var IntegerInputRenderer = {
|
|
|
3321
3439
|
loadingState: props.fieldLoadingState,
|
|
3322
3440
|
help,
|
|
3323
3441
|
features: props.features,
|
|
3324
|
-
children: /* @__PURE__ */ (0,
|
|
3325
|
-
|
|
3442
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components32.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3443
|
+
import_components32.Input,
|
|
3326
3444
|
__spreadValues({
|
|
3327
3445
|
id,
|
|
3328
3446
|
name: id,
|
|
@@ -3344,12 +3462,12 @@ var IntegerInputRenderer = {
|
|
|
3344
3462
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
3345
3463
|
|
|
3346
3464
|
// ../renderers/src/ListRenderer.tsx
|
|
3347
|
-
var
|
|
3465
|
+
var import_components34 = require("@transferwise/components");
|
|
3348
3466
|
|
|
3349
3467
|
// ../renderers/src/components/Header.tsx
|
|
3350
|
-
var
|
|
3351
|
-
var
|
|
3352
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0,
|
|
3468
|
+
var import_components33 = require("@transferwise/components");
|
|
3469
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3470
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components33.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
3353
3471
|
var getHeaderAction = (callToAction) => {
|
|
3354
3472
|
if (!callToAction) {
|
|
3355
3473
|
return void 0;
|
|
@@ -3361,11 +3479,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
3361
3479
|
};
|
|
3362
3480
|
|
|
3363
3481
|
// ../renderers/src/ListRenderer.tsx
|
|
3364
|
-
var
|
|
3482
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3365
3483
|
var ListRenderer = {
|
|
3366
3484
|
canRenderType: "list",
|
|
3367
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3485
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: getMargin(margin), children: [
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Header, { title, callToAction }),
|
|
3369
3487
|
items.map((item) => {
|
|
3370
3488
|
var _a, _b;
|
|
3371
3489
|
const {
|
|
@@ -3382,8 +3500,8 @@ var ListRenderer = {
|
|
|
3382
3500
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3383
3501
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3384
3502
|
};
|
|
3385
|
-
return /* @__PURE__ */ (0,
|
|
3386
|
-
|
|
3503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3504
|
+
import_components34.ListItem,
|
|
3387
3505
|
{
|
|
3388
3506
|
title: itemTitle,
|
|
3389
3507
|
subtitle: description,
|
|
@@ -3402,12 +3520,12 @@ var ListRenderer = {
|
|
|
3402
3520
|
var ListRenderer_default = ListRenderer;
|
|
3403
3521
|
|
|
3404
3522
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
3405
|
-
var
|
|
3406
|
-
var
|
|
3523
|
+
var import_components35 = require("@transferwise/components");
|
|
3524
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3407
3525
|
var LoadingIndicatorRenderer = {
|
|
3408
3526
|
canRenderType: "loading-indicator",
|
|
3409
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
3410
|
-
|
|
3527
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3528
|
+
import_components35.Loader,
|
|
3411
3529
|
{
|
|
3412
3530
|
size,
|
|
3413
3531
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
@@ -3418,13 +3536,13 @@ var LoadingIndicatorRenderer = {
|
|
|
3418
3536
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
3419
3537
|
|
|
3420
3538
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
3421
|
-
var
|
|
3539
|
+
var import_components36 = require("@transferwise/components");
|
|
3422
3540
|
var import_classnames4 = __toESM(require_classnames());
|
|
3423
|
-
var
|
|
3541
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3424
3542
|
var MarkdownRenderer = {
|
|
3425
3543
|
canRenderType: "markdown",
|
|
3426
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0,
|
|
3427
|
-
|
|
3544
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3545
|
+
import_components36.Markdown,
|
|
3428
3546
|
{
|
|
3429
3547
|
className: (0, import_classnames4.default)(
|
|
3430
3548
|
"df-markdown",
|
|
@@ -3438,16 +3556,16 @@ var MarkdownRenderer = {
|
|
|
3438
3556
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
3439
3557
|
|
|
3440
3558
|
// ../renderers/src/MediaRenderer.tsx
|
|
3441
|
-
var
|
|
3559
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3442
3560
|
var MediaRenderer = {
|
|
3443
3561
|
canRenderType: "media",
|
|
3444
3562
|
render: (_a) => {
|
|
3445
3563
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
3446
3564
|
switch (media.type) {
|
|
3447
3565
|
case "avatar":
|
|
3448
|
-
return /* @__PURE__ */ (0,
|
|
3566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3449
3567
|
case "image":
|
|
3450
|
-
return /* @__PURE__ */ (0,
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
3451
3569
|
case "legacy":
|
|
3452
3570
|
return null;
|
|
3453
3571
|
}
|
|
@@ -3459,7 +3577,7 @@ var AvatarMediaRendererComponent = ({
|
|
|
3459
3577
|
margin,
|
|
3460
3578
|
size
|
|
3461
3579
|
}) => {
|
|
3462
|
-
return /* @__PURE__ */ (0,
|
|
3580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
3463
3581
|
};
|
|
3464
3582
|
var ImageMediaRendererComponent = (_a) => {
|
|
3465
3583
|
var _b = _a, {
|
|
@@ -3467,7 +3585,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
3467
3585
|
} = _b, rest = __objRest(_b, [
|
|
3468
3586
|
"media"
|
|
3469
3587
|
]);
|
|
3470
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
3588
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
3471
3589
|
};
|
|
3472
3590
|
var mapAvatarMediaSize = (size) => {
|
|
3473
3591
|
switch (size) {
|
|
@@ -3485,21 +3603,21 @@ var mapAvatarMediaSize = (size) => {
|
|
|
3485
3603
|
};
|
|
3486
3604
|
|
|
3487
3605
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
3488
|
-
var
|
|
3489
|
-
var
|
|
3490
|
-
var
|
|
3606
|
+
var import_components37 = require("@transferwise/components");
|
|
3607
|
+
var import_react14 = require("react");
|
|
3608
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3491
3609
|
var ModalLayoutRenderer = {
|
|
3492
3610
|
canRenderType: "modal-layout",
|
|
3493
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
3611
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DFModal, __spreadValues({}, props))
|
|
3494
3612
|
};
|
|
3495
3613
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
3496
3614
|
function DFModal({ content, margin, trigger }) {
|
|
3497
|
-
const [visible, setVisible] = (0,
|
|
3615
|
+
const [visible, setVisible] = (0, import_react14.useState)(false);
|
|
3498
3616
|
const { children, title } = content;
|
|
3499
|
-
return /* @__PURE__ */ (0,
|
|
3500
|
-
/* @__PURE__ */ (0,
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
|
|
3617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: getMargin(margin), children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components37.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3620
|
+
import_components37.Modal,
|
|
3503
3621
|
{
|
|
3504
3622
|
scroll: "content",
|
|
3505
3623
|
open: visible,
|
|
@@ -3513,20 +3631,20 @@ function DFModal({ content, margin, trigger }) {
|
|
|
3513
3631
|
}
|
|
3514
3632
|
|
|
3515
3633
|
// ../renderers/src/ModalRenderer.tsx
|
|
3516
|
-
var
|
|
3517
|
-
var
|
|
3634
|
+
var import_components38 = require("@transferwise/components");
|
|
3635
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3518
3636
|
var ModalRenderer = {
|
|
3519
3637
|
canRenderType: "modal",
|
|
3520
3638
|
render: ({ title, children, open, onClose }) => {
|
|
3521
|
-
return /* @__PURE__ */ (0,
|
|
3639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_components38.Modal, { open, title, body: children, onClose });
|
|
3522
3640
|
}
|
|
3523
3641
|
};
|
|
3524
3642
|
|
|
3525
3643
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
3526
|
-
var
|
|
3527
|
-
var
|
|
3644
|
+
var import_components39 = require("@transferwise/components");
|
|
3645
|
+
var import_react15 = require("react");
|
|
3528
3646
|
var import_react_intl13 = require("react-intl");
|
|
3529
|
-
var
|
|
3647
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3530
3648
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3531
3649
|
var MoneyInputRenderer = {
|
|
3532
3650
|
canRenderType: "money-input",
|
|
@@ -3547,13 +3665,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
3547
3665
|
onAmountChange,
|
|
3548
3666
|
onCurrencyChange
|
|
3549
3667
|
} = props;
|
|
3550
|
-
(0,
|
|
3668
|
+
(0, import_react15.useEffect)(() => {
|
|
3551
3669
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
3552
3670
|
onCurrencyChange(0);
|
|
3553
3671
|
}
|
|
3554
3672
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
3555
3673
|
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
3556
|
-
return /* @__PURE__ */ (0,
|
|
3674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3557
3675
|
FieldInput_default,
|
|
3558
3676
|
{
|
|
3559
3677
|
id: uid,
|
|
@@ -3562,8 +3680,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
3562
3680
|
validation: validationState,
|
|
3563
3681
|
help,
|
|
3564
3682
|
features: props.features,
|
|
3565
|
-
children: /* @__PURE__ */ (0,
|
|
3566
|
-
|
|
3683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3684
|
+
import_components39.MoneyInput,
|
|
3567
3685
|
{
|
|
3568
3686
|
amount: parseFloatOrNull(amountValue),
|
|
3569
3687
|
searchPlaceholder: "",
|
|
@@ -3624,80 +3742,111 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
3624
3742
|
}
|
|
3625
3743
|
|
|
3626
3744
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
3627
|
-
var
|
|
3628
|
-
var
|
|
3745
|
+
var import_components40 = require("@transferwise/components");
|
|
3746
|
+
var import_react16 = require("react");
|
|
3747
|
+
var import_react_intl14 = require("react-intl");
|
|
3748
|
+
|
|
3749
|
+
// ../renderers/src/utils/items-with-index.ts
|
|
3750
|
+
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
3751
|
+
index
|
|
3752
|
+
}));
|
|
3753
|
+
|
|
3754
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
3755
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3629
3756
|
function InlineComponent(props) {
|
|
3630
3757
|
const {
|
|
3631
3758
|
id,
|
|
3632
3759
|
description,
|
|
3633
3760
|
disabled,
|
|
3634
|
-
features,
|
|
3635
|
-
help,
|
|
3636
|
-
options,
|
|
3637
|
-
selectedIndices,
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3761
|
+
features,
|
|
3762
|
+
help,
|
|
3763
|
+
options,
|
|
3764
|
+
selectedIndices,
|
|
3765
|
+
tags,
|
|
3766
|
+
title,
|
|
3767
|
+
validationState,
|
|
3768
|
+
onSelect
|
|
3769
|
+
} = props;
|
|
3770
|
+
const optionsWithIndex = zipWithIndex(options);
|
|
3771
|
+
const [query, setQuery] = (0, import_react16.useState)("");
|
|
3772
|
+
const { formatMessage } = (0, import_react_intl14.useIntl)();
|
|
3773
|
+
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
3774
|
+
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
3775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
3776
|
+
filtered && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3777
|
+
import_components40.SearchInput,
|
|
3778
|
+
{
|
|
3779
|
+
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
3780
|
+
disabled,
|
|
3781
|
+
value: query,
|
|
3782
|
+
className: "m-b-2",
|
|
3783
|
+
onChange: (e) => {
|
|
3784
|
+
var _a;
|
|
3785
|
+
return setQuery((_a = e.target.value) != null ? _a : "");
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
),
|
|
3789
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3790
|
+
FieldInput_default,
|
|
3791
|
+
{
|
|
3792
|
+
id,
|
|
3793
|
+
label: title,
|
|
3794
|
+
help,
|
|
3795
|
+
description,
|
|
3796
|
+
validation: validationState,
|
|
3797
|
+
features,
|
|
3798
|
+
children: filteredOptions.map((option) => {
|
|
3799
|
+
var _a;
|
|
3800
|
+
const {
|
|
3667
3801
|
title: itemTitle,
|
|
3668
|
-
subtitle,
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3802
|
+
description: subtitle,
|
|
3803
|
+
disabled: optionDisabled,
|
|
3804
|
+
media,
|
|
3805
|
+
index,
|
|
3806
|
+
additionalText,
|
|
3807
|
+
inlineAlert,
|
|
3808
|
+
supportingValues,
|
|
3809
|
+
childrenProps
|
|
3810
|
+
} = option;
|
|
3811
|
+
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
3812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3813
|
+
import_components40.ListItem,
|
|
3814
|
+
{
|
|
3815
|
+
title: itemTitle,
|
|
3816
|
+
subtitle,
|
|
3817
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
3818
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
3819
|
+
media: getMedia(media, false),
|
|
3820
|
+
prompt: getInlineAlert(inlineAlert),
|
|
3821
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components40.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
3822
|
+
disabled: disabled || optionDisabled,
|
|
3823
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3824
|
+
import_components40.ListItem.Checkbox,
|
|
3825
|
+
{
|
|
3826
|
+
checked: selectedIndices.includes(index),
|
|
3827
|
+
onChange: (e) => {
|
|
3828
|
+
const newSelectedIndices = e.target.checked ? [...selectedIndices, index] : selectedIndices.filter((i) => i !== index);
|
|
3829
|
+
onSelect(newSelectedIndices);
|
|
3830
|
+
}
|
|
3682
3831
|
}
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
)
|
|
3688
|
-
}
|
|
3689
|
-
|
|
3690
|
-
);
|
|
3832
|
+
)
|
|
3833
|
+
},
|
|
3834
|
+
key
|
|
3835
|
+
);
|
|
3836
|
+
})
|
|
3837
|
+
}
|
|
3838
|
+
)
|
|
3839
|
+
] });
|
|
3691
3840
|
}
|
|
3692
3841
|
|
|
3693
3842
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3694
|
-
var
|
|
3695
|
-
var
|
|
3696
|
-
var
|
|
3843
|
+
var import_components41 = require("@transferwise/components");
|
|
3844
|
+
var import_react17 = require("react");
|
|
3845
|
+
var import_react_intl16 = require("react-intl");
|
|
3697
3846
|
|
|
3698
3847
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
3699
|
-
var
|
|
3700
|
-
var multi_select_messages_default = (0,
|
|
3848
|
+
var import_react_intl15 = require("react-intl");
|
|
3849
|
+
var multi_select_messages_default = (0, import_react_intl15.defineMessages)({
|
|
3701
3850
|
summary: {
|
|
3702
3851
|
id: "df.wise.MultiSelect.summary",
|
|
3703
3852
|
defaultMessage: "{first} and {count} more",
|
|
@@ -3706,10 +3855,10 @@ var multi_select_messages_default = (0, import_react_intl14.defineMessages)({
|
|
|
3706
3855
|
});
|
|
3707
3856
|
|
|
3708
3857
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
3709
|
-
var
|
|
3858
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3710
3859
|
function DefaultComponent(props) {
|
|
3711
|
-
const { formatMessage } = (0,
|
|
3712
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
3860
|
+
const { formatMessage } = (0, import_react_intl16.useIntl)();
|
|
3861
|
+
const [stagedIndices, setStagedIndices] = (0, import_react17.useState)();
|
|
3713
3862
|
const {
|
|
3714
3863
|
id,
|
|
3715
3864
|
autoComplete,
|
|
@@ -3748,12 +3897,12 @@ function DefaultComponent(props) {
|
|
|
3748
3897
|
const contentProps = {
|
|
3749
3898
|
title: option.title,
|
|
3750
3899
|
description: option.description,
|
|
3751
|
-
icon: /* @__PURE__ */ (0,
|
|
3900
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
3752
3901
|
};
|
|
3753
|
-
return /* @__PURE__ */ (0,
|
|
3902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_components41.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
3754
3903
|
};
|
|
3755
3904
|
const extraProps = { autoComplete };
|
|
3756
|
-
return /* @__PURE__ */ (0,
|
|
3905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3757
3906
|
FieldInput_default,
|
|
3758
3907
|
{
|
|
3759
3908
|
id,
|
|
@@ -3762,8 +3911,8 @@ function DefaultComponent(props) {
|
|
|
3762
3911
|
description,
|
|
3763
3912
|
validation: validationState,
|
|
3764
3913
|
features,
|
|
3765
|
-
children: /* @__PURE__ */ (0,
|
|
3766
|
-
|
|
3914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3915
|
+
import_components41.SelectInput,
|
|
3767
3916
|
__spreadValues({
|
|
3768
3917
|
id,
|
|
3769
3918
|
items: options.map((option, index) => {
|
|
@@ -3801,8 +3950,8 @@ function DefaultComponent(props) {
|
|
|
3801
3950
|
}
|
|
3802
3951
|
|
|
3803
3952
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
3804
|
-
var
|
|
3805
|
-
var
|
|
3953
|
+
var import_components42 = require("@transferwise/components");
|
|
3954
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3806
3955
|
function InlineCheckboxComponent(props) {
|
|
3807
3956
|
const {
|
|
3808
3957
|
id,
|
|
@@ -3816,7 +3965,7 @@ function InlineCheckboxComponent(props) {
|
|
|
3816
3965
|
validationState,
|
|
3817
3966
|
onSelect
|
|
3818
3967
|
} = props;
|
|
3819
|
-
return /* @__PURE__ */ (0,
|
|
3968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3820
3969
|
FieldInput_default,
|
|
3821
3970
|
{
|
|
3822
3971
|
id,
|
|
@@ -3845,35 +3994,35 @@ function InlineCheckboxComponent(props) {
|
|
|
3845
3994
|
onSelect(newSelectedIndices);
|
|
3846
3995
|
}
|
|
3847
3996
|
};
|
|
3848
|
-
return /* @__PURE__ */ (0,
|
|
3997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components42.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
3849
3998
|
})
|
|
3850
3999
|
}
|
|
3851
4000
|
);
|
|
3852
4001
|
}
|
|
3853
4002
|
|
|
3854
4003
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
3855
|
-
var
|
|
4004
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3856
4005
|
var MultiSelectInputRenderer = {
|
|
3857
4006
|
canRenderType: "input-multi-select",
|
|
3858
4007
|
render: (props) => {
|
|
3859
4008
|
switch (props.control) {
|
|
3860
4009
|
case "inline":
|
|
3861
|
-
return /* @__PURE__ */ (0,
|
|
4010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(InlineComponent, __spreadValues({}, props));
|
|
3862
4011
|
case "inline-checkbox-group":
|
|
3863
|
-
return /* @__PURE__ */ (0,
|
|
4012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
3864
4013
|
default:
|
|
3865
|
-
return /* @__PURE__ */ (0,
|
|
4014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
3866
4015
|
}
|
|
3867
4016
|
}
|
|
3868
4017
|
};
|
|
3869
4018
|
|
|
3870
4019
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
3871
|
-
var
|
|
4020
|
+
var import_components44 = require("@transferwise/components");
|
|
3872
4021
|
|
|
3873
4022
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
3874
|
-
var
|
|
4023
|
+
var import_components43 = require("@transferwise/components");
|
|
3875
4024
|
var import_classnames5 = __toESM(require_classnames());
|
|
3876
|
-
var
|
|
4025
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
3877
4026
|
function UploadFieldInput({
|
|
3878
4027
|
id,
|
|
3879
4028
|
children,
|
|
@@ -3883,10 +4032,10 @@ function UploadFieldInput({
|
|
|
3883
4032
|
validation,
|
|
3884
4033
|
features
|
|
3885
4034
|
}) {
|
|
3886
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
4035
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
3887
4036
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3888
4037
|
const { ref } = useScrollToError(validation, features);
|
|
3889
|
-
return /* @__PURE__ */ (0,
|
|
4038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
3890
4039
|
"div",
|
|
3891
4040
|
{
|
|
3892
4041
|
ref,
|
|
@@ -3894,9 +4043,9 @@ function UploadFieldInput({
|
|
|
3894
4043
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
3895
4044
|
}),
|
|
3896
4045
|
children: [
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
4046
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
3898
4047
|
children,
|
|
3899
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
4048
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components43.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
3900
4049
|
]
|
|
3901
4050
|
}
|
|
3902
4051
|
);
|
|
@@ -3931,7 +4080,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
3931
4080
|
};
|
|
3932
4081
|
|
|
3933
4082
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
3934
|
-
var
|
|
4083
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3935
4084
|
var MultiUploadInputRenderer = {
|
|
3936
4085
|
canRenderType: "input-upload-multi",
|
|
3937
4086
|
render: (props) => {
|
|
@@ -3957,7 +4106,7 @@ var MultiUploadInputRenderer = {
|
|
|
3957
4106
|
};
|
|
3958
4107
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
3959
4108
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
3960
|
-
return /* @__PURE__ */ (0,
|
|
4109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3961
4110
|
UploadFieldInput_default,
|
|
3962
4111
|
{
|
|
3963
4112
|
id,
|
|
@@ -3966,8 +4115,8 @@ var MultiUploadInputRenderer = {
|
|
|
3966
4115
|
validation: validationState,
|
|
3967
4116
|
help,
|
|
3968
4117
|
features,
|
|
3969
|
-
children: /* @__PURE__ */ (0,
|
|
3970
|
-
|
|
4118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4119
|
+
import_components44.UploadInput,
|
|
3971
4120
|
{
|
|
3972
4121
|
id,
|
|
3973
4122
|
"aria-describedby": descriptionId,
|
|
@@ -3976,7 +4125,7 @@ var MultiUploadInputRenderer = {
|
|
|
3976
4125
|
files: value.map(({ id: fileId, file, validationState: fileValidationState }) => ({
|
|
3977
4126
|
id: fileId,
|
|
3978
4127
|
filename: file.name,
|
|
3979
|
-
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ?
|
|
4128
|
+
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ? import_components44.Status.FAILED : import_components44.Status.SUCCEEDED
|
|
3980
4129
|
})),
|
|
3981
4130
|
fileTypes: acceptsToFileTypes(accepts),
|
|
3982
4131
|
maxFiles: maxItems,
|
|
@@ -3994,8 +4143,8 @@ var MultiUploadInputRenderer = {
|
|
|
3994
4143
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
3995
4144
|
|
|
3996
4145
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
3997
|
-
var
|
|
3998
|
-
var
|
|
4146
|
+
var import_components45 = require("@transferwise/components");
|
|
4147
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3999
4148
|
var NumberInputRenderer = {
|
|
4000
4149
|
canRenderType: "input-number",
|
|
4001
4150
|
render: (props) => {
|
|
@@ -4009,7 +4158,7 @@ var NumberInputRenderer = {
|
|
|
4009
4158
|
"maximum",
|
|
4010
4159
|
"minimum"
|
|
4011
4160
|
);
|
|
4012
|
-
return /* @__PURE__ */ (0,
|
|
4161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4013
4162
|
FieldInput_default,
|
|
4014
4163
|
{
|
|
4015
4164
|
id,
|
|
@@ -4020,8 +4169,8 @@ var NumberInputRenderer = {
|
|
|
4020
4169
|
loadingState: props.fieldLoadingState,
|
|
4021
4170
|
help,
|
|
4022
4171
|
features: props.features,
|
|
4023
|
-
children: /* @__PURE__ */ (0,
|
|
4024
|
-
|
|
4172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components45.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4173
|
+
import_components45.Input,
|
|
4025
4174
|
__spreadValues({
|
|
4026
4175
|
id,
|
|
4027
4176
|
name: id,
|
|
@@ -4041,24 +4190,24 @@ var NumberInputRenderer = {
|
|
|
4041
4190
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
4042
4191
|
|
|
4043
4192
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4044
|
-
var
|
|
4193
|
+
var import_react_intl18 = require("react-intl");
|
|
4045
4194
|
|
|
4046
4195
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
4047
|
-
var
|
|
4048
|
-
var
|
|
4196
|
+
var import_components46 = require("@transferwise/components");
|
|
4197
|
+
var import_react18 = require("react");
|
|
4049
4198
|
function useSnackBarIfAvailable() {
|
|
4050
|
-
const context = (0,
|
|
4199
|
+
const context = (0, import_react18.useContext)(import_components46.SnackbarContext);
|
|
4051
4200
|
return context ? context.createSnackbar : () => {
|
|
4052
4201
|
};
|
|
4053
4202
|
}
|
|
4054
4203
|
|
|
4055
4204
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4056
|
-
var
|
|
4205
|
+
var import_components47 = require("@transferwise/components");
|
|
4057
4206
|
var import_classnames6 = __toESM(require_classnames());
|
|
4058
4207
|
|
|
4059
4208
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
4060
|
-
var
|
|
4061
|
-
var paragraph_messages_default = (0,
|
|
4209
|
+
var import_react_intl17 = require("react-intl");
|
|
4210
|
+
var paragraph_messages_default = (0, import_react_intl17.defineMessages)({
|
|
4062
4211
|
copy: {
|
|
4063
4212
|
id: "df.wise.DynamicParagraph.copy",
|
|
4064
4213
|
defaultMessage: "Copy",
|
|
@@ -4072,14 +4221,14 @@ var paragraph_messages_default = (0, import_react_intl16.defineMessages)({
|
|
|
4072
4221
|
});
|
|
4073
4222
|
|
|
4074
4223
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
4075
|
-
var
|
|
4224
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4076
4225
|
var ParagraphRenderer = {
|
|
4077
4226
|
canRenderType: "paragraph",
|
|
4078
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4227
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Paragraph, __spreadValues({}, props))
|
|
4079
4228
|
};
|
|
4080
4229
|
function Paragraph({ align, control, margin, size, text }) {
|
|
4081
4230
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
4082
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
4231
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4083
4232
|
"p",
|
|
4084
4233
|
{
|
|
4085
4234
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -4092,16 +4241,16 @@ function CopyableParagraph({
|
|
|
4092
4241
|
align,
|
|
4093
4242
|
className
|
|
4094
4243
|
}) {
|
|
4095
|
-
const { formatMessage } = (0,
|
|
4244
|
+
const { formatMessage } = (0, import_react_intl18.useIntl)();
|
|
4096
4245
|
const createSnackbar = useSnackBarIfAvailable();
|
|
4097
4246
|
const copy = () => {
|
|
4098
4247
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
4099
4248
|
});
|
|
4100
4249
|
};
|
|
4101
4250
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
4102
|
-
return /* @__PURE__ */ (0,
|
|
4103
|
-
/* @__PURE__ */ (0,
|
|
4104
|
-
|
|
4251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className, children: [
|
|
4252
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4253
|
+
import_components47.Input,
|
|
4105
4254
|
{
|
|
4106
4255
|
type: "text",
|
|
4107
4256
|
value: text,
|
|
@@ -4109,23 +4258,23 @@ function CopyableParagraph({
|
|
|
4109
4258
|
className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
|
|
4110
4259
|
}
|
|
4111
4260
|
),
|
|
4112
|
-
/* @__PURE__ */ (0,
|
|
4261
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components47.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
4113
4262
|
] });
|
|
4114
4263
|
}
|
|
4115
4264
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
4116
4265
|
|
|
4117
4266
|
// ../renderers/src/ProgressRenderer.tsx
|
|
4118
|
-
var
|
|
4119
|
-
var
|
|
4267
|
+
var import_components48 = require("@transferwise/components");
|
|
4268
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
4120
4269
|
var ProgressRenderer = {
|
|
4121
4270
|
canRenderType: "progress",
|
|
4122
4271
|
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
4123
|
-
return /* @__PURE__ */ (0,
|
|
4124
|
-
|
|
4272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
4273
|
+
import_components48.ProgressBar,
|
|
4125
4274
|
{
|
|
4126
4275
|
id: uid,
|
|
4127
4276
|
className: getMargin(margin),
|
|
4128
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
4277
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
4129
4278
|
description,
|
|
4130
4279
|
progress: {
|
|
4131
4280
|
max: 1,
|
|
@@ -4138,15 +4287,15 @@ var ProgressRenderer = {
|
|
|
4138
4287
|
};
|
|
4139
4288
|
|
|
4140
4289
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4141
|
-
var
|
|
4290
|
+
var import_components49 = require("@transferwise/components");
|
|
4142
4291
|
var import_icons2 = require("@transferwise/icons");
|
|
4143
4292
|
var import_classnames7 = __toESM(require_classnames());
|
|
4144
|
-
var
|
|
4145
|
-
var
|
|
4293
|
+
var import_react19 = require("react");
|
|
4294
|
+
var import_react_intl20 = require("react-intl");
|
|
4146
4295
|
|
|
4147
4296
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
4148
|
-
var
|
|
4149
|
-
var repeatable_messages_default = (0,
|
|
4297
|
+
var import_react_intl19 = require("react-intl");
|
|
4298
|
+
var repeatable_messages_default = (0, import_react_intl19.defineMessages)({
|
|
4150
4299
|
addItemTitle: {
|
|
4151
4300
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
4152
4301
|
defaultMessage: "Add Item",
|
|
@@ -4170,10 +4319,10 @@ var repeatable_messages_default = (0, import_react_intl18.defineMessages)({
|
|
|
4170
4319
|
});
|
|
4171
4320
|
|
|
4172
4321
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
4173
|
-
var
|
|
4322
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
4174
4323
|
var RepeatableRenderer = {
|
|
4175
4324
|
canRenderType: "repeatable",
|
|
4176
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4325
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Repeatable, __spreadValues({}, props))
|
|
4177
4326
|
};
|
|
4178
4327
|
function Repeatable(props) {
|
|
4179
4328
|
const {
|
|
@@ -4190,8 +4339,8 @@ function Repeatable(props) {
|
|
|
4190
4339
|
onSave,
|
|
4191
4340
|
onRemove
|
|
4192
4341
|
} = props;
|
|
4193
|
-
const { formatMessage } = (0,
|
|
4194
|
-
const [openModalType, setOpenModalType] = (0,
|
|
4342
|
+
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
4343
|
+
const [openModalType, setOpenModalType] = (0, import_react19.useState)(null);
|
|
4195
4344
|
const { ref } = useScrollToError(validationState, features);
|
|
4196
4345
|
const onAddItem = () => {
|
|
4197
4346
|
onAdd();
|
|
@@ -4214,43 +4363,43 @@ function Repeatable(props) {
|
|
|
4214
4363
|
const onCancelEdit = () => {
|
|
4215
4364
|
setOpenModalType(null);
|
|
4216
4365
|
};
|
|
4217
|
-
return /* @__PURE__ */ (0,
|
|
4218
|
-
/* @__PURE__ */ (0,
|
|
4219
|
-
title && /* @__PURE__ */ (0,
|
|
4220
|
-
description && /* @__PURE__ */ (0,
|
|
4221
|
-
/* @__PURE__ */ (0,
|
|
4366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
4367
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { ref, children: [
|
|
4368
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components49.Header, { title }),
|
|
4369
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { children: description }),
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
4222
4371
|
"div",
|
|
4223
4372
|
{
|
|
4224
4373
|
className: (0, import_classnames7.default)("form-group", {
|
|
4225
4374
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
4226
4375
|
}),
|
|
4227
4376
|
children: [
|
|
4228
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
4229
|
-
/* @__PURE__ */ (0,
|
|
4230
|
-
|
|
4377
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
4378
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4379
|
+
import_components49.NavigationOption,
|
|
4231
4380
|
{
|
|
4232
|
-
media: /* @__PURE__ */ (0,
|
|
4381
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_icons2.Plus, {}),
|
|
4233
4382
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4234
4383
|
showMediaAtAllSizes: true,
|
|
4235
4384
|
onClick: () => onAddItem()
|
|
4236
4385
|
}
|
|
4237
4386
|
),
|
|
4238
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
4387
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components49.InlineAlert, { type: "negative", children: validationState.message })
|
|
4239
4388
|
]
|
|
4240
4389
|
}
|
|
4241
4390
|
)
|
|
4242
4391
|
] }),
|
|
4243
|
-
/* @__PURE__ */ (0,
|
|
4244
|
-
|
|
4392
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4393
|
+
import_components49.Modal,
|
|
4245
4394
|
{
|
|
4246
4395
|
open: openModalType !== null,
|
|
4247
4396
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
4248
|
-
body: /* @__PURE__ */ (0,
|
|
4249
|
-
/* @__PURE__ */ (0,
|
|
4250
|
-
/* @__PURE__ */ (0,
|
|
4251
|
-
/* @__PURE__ */ (0,
|
|
4252
|
-
/* @__PURE__ */ (0,
|
|
4253
|
-
|
|
4397
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
4399
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { children: [
|
|
4400
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components49.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4402
|
+
import_components49.Button,
|
|
4254
4403
|
{
|
|
4255
4404
|
v2: true,
|
|
4256
4405
|
priority: "secondary",
|
|
@@ -4271,10 +4420,10 @@ function ItemSummaryOption({
|
|
|
4271
4420
|
item,
|
|
4272
4421
|
onClick
|
|
4273
4422
|
}) {
|
|
4274
|
-
return /* @__PURE__ */ (0,
|
|
4275
|
-
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4424
|
+
import_components49.NavigationOption,
|
|
4276
4425
|
{
|
|
4277
|
-
media: /* @__PURE__ */ (0,
|
|
4426
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
4278
4427
|
title: item.title,
|
|
4279
4428
|
content: item.description,
|
|
4280
4429
|
showMediaAtAllSizes: true,
|
|
@@ -4286,16 +4435,16 @@ function ItemSummaryOption({
|
|
|
4286
4435
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
4287
4436
|
|
|
4288
4437
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
4289
|
-
var
|
|
4290
|
-
var
|
|
4438
|
+
var import_components50 = require("@transferwise/components");
|
|
4439
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
4291
4440
|
var ReviewRenderer = {
|
|
4292
4441
|
canRenderType: "review",
|
|
4293
4442
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
4294
4443
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
4295
|
-
return /* @__PURE__ */ (0,
|
|
4296
|
-
/* @__PURE__ */ (0,
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4298
|
-
|
|
4444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: getMargin(margin), children: [
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Header, { title, callToAction }),
|
|
4446
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
4447
|
+
import_components50.DefinitionList,
|
|
4299
4448
|
{
|
|
4300
4449
|
layout: orientation,
|
|
4301
4450
|
definitions: fields.map(
|
|
@@ -4332,20 +4481,20 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
4332
4481
|
};
|
|
4333
4482
|
var getFieldLabel = (label, help, onClick) => {
|
|
4334
4483
|
if (help) {
|
|
4335
|
-
return /* @__PURE__ */ (0,
|
|
4484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
4336
4485
|
label,
|
|
4337
4486
|
" ",
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Help_default, { help, onClick })
|
|
4339
4488
|
] });
|
|
4340
4489
|
}
|
|
4341
4490
|
return label;
|
|
4342
4491
|
};
|
|
4343
4492
|
|
|
4344
4493
|
// ../renderers/src/ReviewRenderer.tsx
|
|
4345
|
-
var
|
|
4494
|
+
var import_components51 = require("@transferwise/components");
|
|
4346
4495
|
var import_icons3 = require("@transferwise/icons");
|
|
4347
|
-
var
|
|
4348
|
-
var
|
|
4496
|
+
var import_react_intl21 = require("react-intl");
|
|
4497
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
4349
4498
|
var IGNORED_CONTROLS = [
|
|
4350
4499
|
"horizontal",
|
|
4351
4500
|
"horizontal-end-aligned",
|
|
@@ -4355,7 +4504,7 @@ var IGNORED_CONTROLS = [
|
|
|
4355
4504
|
var ReviewRenderer2 = {
|
|
4356
4505
|
canRenderType: "review",
|
|
4357
4506
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
4358
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4507
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Review, __spreadValues({}, props))
|
|
4359
4508
|
};
|
|
4360
4509
|
var Review = ({
|
|
4361
4510
|
callToAction,
|
|
@@ -4366,9 +4515,9 @@ var Review = ({
|
|
|
4366
4515
|
title,
|
|
4367
4516
|
trackEvent
|
|
4368
4517
|
}) => {
|
|
4369
|
-
const intl = (0,
|
|
4370
|
-
return /* @__PURE__ */ (0,
|
|
4371
|
-
/* @__PURE__ */ (0,
|
|
4518
|
+
const intl = (0, import_react_intl21.useIntl)();
|
|
4519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: getMargin(margin), children: [
|
|
4520
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Header, { title, callToAction }),
|
|
4372
4521
|
fields.map((field) => {
|
|
4373
4522
|
var _a, _b, _c;
|
|
4374
4523
|
const {
|
|
@@ -4386,8 +4535,8 @@ var Review = ({
|
|
|
4386
4535
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4387
4536
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4388
4537
|
};
|
|
4389
|
-
return /* @__PURE__ */ (0,
|
|
4390
|
-
|
|
4538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4539
|
+
import_components51.ListItem,
|
|
4391
4540
|
{
|
|
4392
4541
|
title: value,
|
|
4393
4542
|
subtitle: label,
|
|
@@ -4407,18 +4556,18 @@ var Review = ({
|
|
|
4407
4556
|
] });
|
|
4408
4557
|
};
|
|
4409
4558
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
4410
|
-
return /* @__PURE__ */ (0,
|
|
4559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components51.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components51.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components51.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_icons3.QuestionMarkCircle, {}) }) });
|
|
4411
4560
|
};
|
|
4412
4561
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
4413
4562
|
|
|
4414
4563
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4415
|
-
var
|
|
4416
|
-
var
|
|
4417
|
-
var
|
|
4564
|
+
var import_components53 = require("@transferwise/components");
|
|
4565
|
+
var import_react20 = require("react");
|
|
4566
|
+
var import_react_intl25 = require("react-intl");
|
|
4418
4567
|
|
|
4419
4568
|
// ../renderers/src/messages/search.messages.ts
|
|
4420
|
-
var
|
|
4421
|
-
var search_messages_default = (0,
|
|
4569
|
+
var import_react_intl22 = require("react-intl");
|
|
4570
|
+
var search_messages_default = (0, import_react_intl22.defineMessages)({
|
|
4422
4571
|
loading: {
|
|
4423
4572
|
id: "df.wise.SearchLayout.loading",
|
|
4424
4573
|
defaultMessage: "Loading...",
|
|
@@ -4427,11 +4576,11 @@ var search_messages_default = (0, import_react_intl21.defineMessages)({
|
|
|
4427
4576
|
});
|
|
4428
4577
|
|
|
4429
4578
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4430
|
-
var
|
|
4579
|
+
var import_react_intl24 = require("react-intl");
|
|
4431
4580
|
|
|
4432
4581
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
4433
|
-
var
|
|
4434
|
-
var generic_error_messages_default = (0,
|
|
4582
|
+
var import_react_intl23 = require("react-intl");
|
|
4583
|
+
var generic_error_messages_default = (0, import_react_intl23.defineMessages)({
|
|
4435
4584
|
genericErrorRetryHint: {
|
|
4436
4585
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
4437
4586
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -4450,20 +4599,20 @@ var generic_error_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
4450
4599
|
});
|
|
4451
4600
|
|
|
4452
4601
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
4453
|
-
var
|
|
4454
|
-
var
|
|
4602
|
+
var import_components52 = require("@transferwise/components");
|
|
4603
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4455
4604
|
function ErrorResult({ state }) {
|
|
4456
|
-
const intl = (0,
|
|
4457
|
-
return /* @__PURE__ */ (0,
|
|
4605
|
+
const intl = (0, import_react_intl24.useIntl)();
|
|
4606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("p", { className: "m-t-2", children: [
|
|
4458
4607
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
4459
4608
|
"\xA0",
|
|
4460
|
-
/* @__PURE__ */ (0,
|
|
4609
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components52.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
4461
4610
|
] });
|
|
4462
4611
|
}
|
|
4463
4612
|
|
|
4464
4613
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
4465
4614
|
var import_icons4 = require("@transferwise/icons");
|
|
4466
|
-
var
|
|
4615
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4467
4616
|
function BlockSearchRendererComponent({
|
|
4468
4617
|
id,
|
|
4469
4618
|
hint,
|
|
@@ -4476,10 +4625,10 @@ function BlockSearchRendererComponent({
|
|
|
4476
4625
|
trackEvent,
|
|
4477
4626
|
onChange
|
|
4478
4627
|
}) {
|
|
4479
|
-
const [hasSearched, setHasSearched] = (0,
|
|
4480
|
-
const { formatMessage } = (0,
|
|
4481
|
-
return /* @__PURE__ */ (0,
|
|
4482
|
-
/* @__PURE__ */ (0,
|
|
4628
|
+
const [hasSearched, setHasSearched] = (0, import_react20.useState)(false);
|
|
4629
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
4630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: getMargin(margin), children: [
|
|
4631
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4483
4632
|
FieldInput_default,
|
|
4484
4633
|
{
|
|
4485
4634
|
id,
|
|
@@ -4488,8 +4637,8 @@ function BlockSearchRendererComponent({
|
|
|
4488
4637
|
help: "",
|
|
4489
4638
|
label: title,
|
|
4490
4639
|
features,
|
|
4491
|
-
children: /* @__PURE__ */ (0,
|
|
4492
|
-
|
|
4640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components53.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_icons4.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4641
|
+
import_components53.Input,
|
|
4493
4642
|
{
|
|
4494
4643
|
id,
|
|
4495
4644
|
name: id,
|
|
@@ -4508,7 +4657,7 @@ function BlockSearchRendererComponent({
|
|
|
4508
4657
|
) })
|
|
4509
4658
|
}
|
|
4510
4659
|
),
|
|
4511
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
4660
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(SearchResultContent, { state, trackEvent })
|
|
4512
4661
|
] });
|
|
4513
4662
|
}
|
|
4514
4663
|
function SearchResultContent({
|
|
@@ -4517,39 +4666,39 @@ function SearchResultContent({
|
|
|
4517
4666
|
}) {
|
|
4518
4667
|
switch (state.type) {
|
|
4519
4668
|
case "error":
|
|
4520
|
-
return /* @__PURE__ */ (0,
|
|
4669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ErrorResult, { state });
|
|
4521
4670
|
case "results":
|
|
4522
|
-
return /* @__PURE__ */ (0,
|
|
4671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(SearchResults, { state, trackEvent });
|
|
4523
4672
|
case "layout":
|
|
4524
|
-
return /* @__PURE__ */ (0,
|
|
4673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
4525
4674
|
" ",
|
|
4526
4675
|
state.layout,
|
|
4527
4676
|
" "
|
|
4528
4677
|
] });
|
|
4529
4678
|
case "noResults":
|
|
4530
|
-
return /* @__PURE__ */ (0,
|
|
4679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(EmptySearchResult, { state });
|
|
4531
4680
|
case "pending":
|
|
4532
4681
|
default:
|
|
4533
4682
|
return null;
|
|
4534
4683
|
}
|
|
4535
4684
|
}
|
|
4536
4685
|
function EmptySearchResult({ state }) {
|
|
4537
|
-
return /* @__PURE__ */ (0,
|
|
4686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components53.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4538
4687
|
}
|
|
4539
4688
|
function SearchResults({
|
|
4540
4689
|
state,
|
|
4541
4690
|
trackEvent
|
|
4542
4691
|
}) {
|
|
4543
|
-
return /* @__PURE__ */ (0,
|
|
4692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components53.List, { children: state.results.map((result) => {
|
|
4544
4693
|
const { media } = result;
|
|
4545
|
-
return /* @__PURE__ */ (0,
|
|
4546
|
-
|
|
4694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4695
|
+
import_components53.ListItem,
|
|
4547
4696
|
{
|
|
4548
4697
|
title: result.title,
|
|
4549
4698
|
subtitle: result.description,
|
|
4550
|
-
media: media ? /* @__PURE__ */ (0,
|
|
4551
|
-
control: /* @__PURE__ */ (0,
|
|
4552
|
-
|
|
4699
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
4700
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4701
|
+
import_components53.ListItem.Navigation,
|
|
4553
4702
|
{
|
|
4554
4703
|
onClick: () => {
|
|
4555
4704
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -4567,11 +4716,11 @@ function SearchResults({
|
|
|
4567
4716
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
4568
4717
|
|
|
4569
4718
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
4570
|
-
var
|
|
4719
|
+
var import_components54 = require("@transferwise/components");
|
|
4571
4720
|
var import_icons5 = require("@transferwise/icons");
|
|
4572
|
-
var
|
|
4573
|
-
var
|
|
4574
|
-
var
|
|
4721
|
+
var import_react21 = require("react");
|
|
4722
|
+
var import_react_intl26 = require("react-intl");
|
|
4723
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
4575
4724
|
function InlineSearchRenderer({
|
|
4576
4725
|
id,
|
|
4577
4726
|
hint,
|
|
@@ -4583,9 +4732,9 @@ function InlineSearchRenderer({
|
|
|
4583
4732
|
onChange,
|
|
4584
4733
|
trackEvent
|
|
4585
4734
|
}) {
|
|
4586
|
-
const [hasSearched, setHasSearched] = (0,
|
|
4587
|
-
const intl = (0,
|
|
4588
|
-
return /* @__PURE__ */ (0,
|
|
4735
|
+
const [hasSearched, setHasSearched] = (0, import_react21.useState)(false);
|
|
4736
|
+
const intl = (0, import_react_intl26.useIntl)();
|
|
4737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4589
4738
|
FieldInput_default,
|
|
4590
4739
|
{
|
|
4591
4740
|
id,
|
|
@@ -4594,8 +4743,8 @@ function InlineSearchRenderer({
|
|
|
4594
4743
|
help: "",
|
|
4595
4744
|
label: title,
|
|
4596
4745
|
features,
|
|
4597
|
-
children: /* @__PURE__ */ (0,
|
|
4598
|
-
|
|
4746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
4747
|
+
import_components54.Typeahead,
|
|
4599
4748
|
{
|
|
4600
4749
|
id: "typeahead-input-id",
|
|
4601
4750
|
intl,
|
|
@@ -4603,10 +4752,10 @@ function InlineSearchRenderer({
|
|
|
4603
4752
|
size: "md",
|
|
4604
4753
|
placeholder: hint,
|
|
4605
4754
|
maxHeight: 100,
|
|
4606
|
-
footer: /* @__PURE__ */ (0,
|
|
4755
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
4607
4756
|
multiple: false,
|
|
4608
4757
|
clearable: false,
|
|
4609
|
-
addon: /* @__PURE__ */ (0,
|
|
4758
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_icons5.Search, { size: 24 }),
|
|
4610
4759
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
4611
4760
|
minQueryLength: 1,
|
|
4612
4761
|
onChange: (values) => {
|
|
@@ -4643,33 +4792,33 @@ function mapResultToTypeaheadOption(result) {
|
|
|
4643
4792
|
};
|
|
4644
4793
|
}
|
|
4645
4794
|
function TypeaheadFooter({ state, isLoading }) {
|
|
4646
|
-
const { formatMessage } = (0,
|
|
4795
|
+
const { formatMessage } = (0, import_react_intl26.useIntl)();
|
|
4647
4796
|
if (state.type === "layout") {
|
|
4648
|
-
return /* @__PURE__ */ (0,
|
|
4797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
4649
4798
|
}
|
|
4650
4799
|
if (state.type === "noResults") {
|
|
4651
|
-
return /* @__PURE__ */ (0,
|
|
4800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components54.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
4652
4801
|
}
|
|
4653
4802
|
if (state.type === "error") {
|
|
4654
|
-
return /* @__PURE__ */ (0,
|
|
4803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ErrorResult, { state }) });
|
|
4655
4804
|
}
|
|
4656
4805
|
if (state.type === "pending" || isLoading) {
|
|
4657
|
-
return /* @__PURE__ */ (0,
|
|
4806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
4658
4807
|
}
|
|
4659
4808
|
return null;
|
|
4660
4809
|
}
|
|
4661
4810
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
4662
4811
|
|
|
4663
4812
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
4664
|
-
var
|
|
4813
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
4665
4814
|
var SearchRenderer = {
|
|
4666
4815
|
canRenderType: "search",
|
|
4667
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
4816
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
4668
4817
|
};
|
|
4669
4818
|
var SearchRenderer_default = SearchRenderer;
|
|
4670
4819
|
|
|
4671
4820
|
// ../renderers/src/SectionRenderer.tsx
|
|
4672
|
-
var
|
|
4821
|
+
var import_components55 = require("@transferwise/components");
|
|
4673
4822
|
|
|
4674
4823
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
4675
4824
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -4693,12 +4842,12 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
4693
4842
|
};
|
|
4694
4843
|
|
|
4695
4844
|
// ../renderers/src/SectionRenderer.tsx
|
|
4696
|
-
var
|
|
4845
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
4697
4846
|
var SectionRenderer = {
|
|
4698
4847
|
canRenderType: "section",
|
|
4699
4848
|
render: ({ children, callToAction, margin, title }) => {
|
|
4700
|
-
return /* @__PURE__ */ (0,
|
|
4701
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
4849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("section", { className: getMargin(margin), children: [
|
|
4850
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components55.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
4702
4851
|
children
|
|
4703
4852
|
] });
|
|
4704
4853
|
}
|
|
@@ -4706,8 +4855,8 @@ var SectionRenderer = {
|
|
|
4706
4855
|
var SectionRenderer_default = SectionRenderer;
|
|
4707
4856
|
|
|
4708
4857
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
4709
|
-
var
|
|
4710
|
-
var
|
|
4858
|
+
var import_components56 = require("@transferwise/components");
|
|
4859
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
4711
4860
|
function RadioInputRendererComponent(props) {
|
|
4712
4861
|
const {
|
|
4713
4862
|
id,
|
|
@@ -4722,8 +4871,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4722
4871
|
validationState,
|
|
4723
4872
|
onSelect
|
|
4724
4873
|
} = props;
|
|
4725
|
-
return /* @__PURE__ */ (0,
|
|
4726
|
-
/* @__PURE__ */ (0,
|
|
4874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
|
|
4875
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4727
4876
|
FieldInput_default,
|
|
4728
4877
|
{
|
|
4729
4878
|
id,
|
|
@@ -4732,8 +4881,8 @@ function RadioInputRendererComponent(props) {
|
|
|
4732
4881
|
description,
|
|
4733
4882
|
validation: validationState,
|
|
4734
4883
|
features,
|
|
4735
|
-
children: /* @__PURE__ */ (0,
|
|
4736
|
-
|
|
4884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4885
|
+
import_components56.RadioGroup,
|
|
4737
4886
|
{
|
|
4738
4887
|
name: id,
|
|
4739
4888
|
radios: options.map((option, index) => ({
|
|
@@ -4741,7 +4890,7 @@ function RadioInputRendererComponent(props) {
|
|
|
4741
4890
|
value: index,
|
|
4742
4891
|
secondary: option.description,
|
|
4743
4892
|
disabled: option.disabled || disabled,
|
|
4744
|
-
avatar: /* @__PURE__ */ (0,
|
|
4893
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4745
4894
|
})),
|
|
4746
4895
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
4747
4896
|
onChange: onSelect
|
|
@@ -4755,9 +4904,9 @@ function RadioInputRendererComponent(props) {
|
|
|
4755
4904
|
}
|
|
4756
4905
|
|
|
4757
4906
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
4758
|
-
var
|
|
4759
|
-
var
|
|
4760
|
-
var
|
|
4907
|
+
var import_components57 = require("@transferwise/components");
|
|
4908
|
+
var import_react22 = require("react");
|
|
4909
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
4761
4910
|
function TabInputRendererComponent(props) {
|
|
4762
4911
|
const {
|
|
4763
4912
|
id,
|
|
@@ -4772,13 +4921,13 @@ function TabInputRendererComponent(props) {
|
|
|
4772
4921
|
validationState,
|
|
4773
4922
|
onSelect
|
|
4774
4923
|
} = props;
|
|
4775
|
-
(0,
|
|
4924
|
+
(0, import_react22.useEffect)(() => {
|
|
4776
4925
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
4777
4926
|
onSelect(0);
|
|
4778
4927
|
}
|
|
4779
4928
|
}, [selectedIndex, onSelect, options.length]);
|
|
4780
|
-
return /* @__PURE__ */ (0,
|
|
4781
|
-
/* @__PURE__ */ (0,
|
|
4929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
4930
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4782
4931
|
FieldInput_default,
|
|
4783
4932
|
{
|
|
4784
4933
|
id,
|
|
@@ -4787,8 +4936,8 @@ function TabInputRendererComponent(props) {
|
|
|
4787
4936
|
description,
|
|
4788
4937
|
validation: validationState,
|
|
4789
4938
|
features,
|
|
4790
|
-
children: /* @__PURE__ */ (0,
|
|
4791
|
-
|
|
4939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4940
|
+
import_components57.Tabs,
|
|
4792
4941
|
{
|
|
4793
4942
|
name: id,
|
|
4794
4943
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -4796,7 +4945,7 @@ function TabInputRendererComponent(props) {
|
|
|
4796
4945
|
title: option.title,
|
|
4797
4946
|
// if we pass null, we get some props-types console errors
|
|
4798
4947
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
4799
|
-
content: /* @__PURE__ */ (0,
|
|
4948
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_jsx_runtime83.Fragment, {}),
|
|
4800
4949
|
disabled: option.disabled || disabled
|
|
4801
4950
|
})),
|
|
4802
4951
|
onTabSelect: onSelect
|
|
@@ -4810,8 +4959,8 @@ function TabInputRendererComponent(props) {
|
|
|
4810
4959
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
4811
4960
|
|
|
4812
4961
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
4813
|
-
var
|
|
4814
|
-
var
|
|
4962
|
+
var import_components58 = require("@transferwise/components");
|
|
4963
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
4815
4964
|
function SelectInputRendererComponent(props) {
|
|
4816
4965
|
const {
|
|
4817
4966
|
id,
|
|
@@ -4852,13 +5001,13 @@ function SelectInputRendererComponent(props) {
|
|
|
4852
5001
|
} : {
|
|
4853
5002
|
title: option.title,
|
|
4854
5003
|
description: option.description,
|
|
4855
|
-
icon: /* @__PURE__ */ (0,
|
|
5004
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4856
5005
|
};
|
|
4857
|
-
return /* @__PURE__ */ (0,
|
|
5006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components58.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
4858
5007
|
};
|
|
4859
5008
|
const extraProps = { autoComplete };
|
|
4860
|
-
return /* @__PURE__ */ (0,
|
|
4861
|
-
/* @__PURE__ */ (0,
|
|
5009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4862
5011
|
FieldInput_default,
|
|
4863
5012
|
{
|
|
4864
5013
|
id,
|
|
@@ -4867,8 +5016,8 @@ function SelectInputRendererComponent(props) {
|
|
|
4867
5016
|
description,
|
|
4868
5017
|
validation: validationState,
|
|
4869
5018
|
features,
|
|
4870
|
-
children: /* @__PURE__ */ (0,
|
|
4871
|
-
|
|
5019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
5020
|
+
import_components58.SelectInput,
|
|
4872
5021
|
__spreadValues({
|
|
4873
5022
|
name: id,
|
|
4874
5023
|
placeholder,
|
|
@@ -4888,9 +5037,9 @@ function SelectInputRendererComponent(props) {
|
|
|
4888
5037
|
}
|
|
4889
5038
|
|
|
4890
5039
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
4891
|
-
var
|
|
4892
|
-
var
|
|
4893
|
-
var
|
|
5040
|
+
var import_react23 = require("react");
|
|
5041
|
+
var import_components59 = require("@transferwise/components");
|
|
5042
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
4894
5043
|
function SegmentedInputRendererComponent(props) {
|
|
4895
5044
|
const {
|
|
4896
5045
|
id,
|
|
@@ -4904,13 +5053,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4904
5053
|
validationState,
|
|
4905
5054
|
onSelect
|
|
4906
5055
|
} = props;
|
|
4907
|
-
(0,
|
|
5056
|
+
(0, import_react23.useEffect)(() => {
|
|
4908
5057
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
4909
5058
|
onSelect(0);
|
|
4910
5059
|
}
|
|
4911
5060
|
}, [selectedIndex, onSelect, options.length]);
|
|
4912
|
-
return /* @__PURE__ */ (0,
|
|
4913
|
-
/* @__PURE__ */ (0,
|
|
5061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
5062
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4914
5063
|
FieldInput_default,
|
|
4915
5064
|
{
|
|
4916
5065
|
id,
|
|
@@ -4919,8 +5068,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4919
5068
|
description,
|
|
4920
5069
|
validation: validationState,
|
|
4921
5070
|
features,
|
|
4922
|
-
children: /* @__PURE__ */ (0,
|
|
4923
|
-
|
|
5071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5072
|
+
import_components59.SegmentedControl,
|
|
4924
5073
|
{
|
|
4925
5074
|
name: `${id}-segmented-control`,
|
|
4926
5075
|
value: String(selectedIndex),
|
|
@@ -4936,14 +5085,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
4936
5085
|
)
|
|
4937
5086
|
}
|
|
4938
5087
|
),
|
|
4939
|
-
/* @__PURE__ */ (0,
|
|
5088
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { id: `${id}-children`, children })
|
|
4940
5089
|
] });
|
|
4941
5090
|
}
|
|
4942
5091
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
4943
5092
|
|
|
4944
5093
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
4945
|
-
var
|
|
4946
|
-
var
|
|
5094
|
+
var import_components60 = require("@transferwise/components");
|
|
5095
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
4947
5096
|
function RadioItemRendererComponent(props) {
|
|
4948
5097
|
const {
|
|
4949
5098
|
id,
|
|
@@ -4959,23 +5108,23 @@ function RadioItemRendererComponent(props) {
|
|
|
4959
5108
|
onSelect
|
|
4960
5109
|
} = props;
|
|
4961
5110
|
const { ref } = useScrollToError(validationState, features);
|
|
4962
|
-
return /* @__PURE__ */ (0,
|
|
4963
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
4964
|
-
|
|
5111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { ref, children: [
|
|
5112
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5113
|
+
import_components60.Header,
|
|
4965
5114
|
{
|
|
4966
5115
|
as: "h2",
|
|
4967
|
-
title: help ? /* @__PURE__ */ (0,
|
|
5116
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
4968
5117
|
}
|
|
4969
5118
|
),
|
|
4970
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
4971
|
-
/* @__PURE__ */ (0,
|
|
4972
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
4973
|
-
|
|
5119
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: rootDescription }),
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components60.List, { children: options.map(
|
|
5121
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5122
|
+
import_components60.ListItem,
|
|
4974
5123
|
__spreadValues({
|
|
4975
5124
|
title,
|
|
4976
5125
|
subtitle: description,
|
|
4977
|
-
control: /* @__PURE__ */ (0,
|
|
4978
|
-
|
|
5126
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5127
|
+
import_components60.ListItem.Radio,
|
|
4979
5128
|
{
|
|
4980
5129
|
name: title,
|
|
4981
5130
|
checked: selectedIndex === index,
|
|
@@ -4990,50 +5139,50 @@ function RadioItemRendererComponent(props) {
|
|
|
4990
5139
|
title
|
|
4991
5140
|
)
|
|
4992
5141
|
) }, `${id}-${selectedIndex}`),
|
|
4993
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5142
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components60.InlineAlert, { type: "negative", children: validationState.message }),
|
|
4994
5143
|
children
|
|
4995
5144
|
] });
|
|
4996
5145
|
}
|
|
4997
5146
|
|
|
4998
5147
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
4999
|
-
var
|
|
5148
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
5000
5149
|
var SelectInputRenderer = {
|
|
5001
5150
|
canRenderType: "input-select",
|
|
5002
5151
|
render: (props) => {
|
|
5003
5152
|
switch (props.control) {
|
|
5004
5153
|
case "radio":
|
|
5005
|
-
return /* @__PURE__ */ (0,
|
|
5154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
5006
5155
|
case "radio-item":
|
|
5007
|
-
return /* @__PURE__ */ (0,
|
|
5156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
5008
5157
|
case "tab":
|
|
5009
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
5158
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
5010
5159
|
case "segmented":
|
|
5011
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
5160
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
5012
5161
|
case "select":
|
|
5013
5162
|
default:
|
|
5014
|
-
return /* @__PURE__ */ (0,
|
|
5163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
5015
5164
|
}
|
|
5016
5165
|
}
|
|
5017
5166
|
};
|
|
5018
5167
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
5019
5168
|
|
|
5020
5169
|
// ../renderers/src/StatusListRenderer.tsx
|
|
5021
|
-
var
|
|
5022
|
-
var
|
|
5170
|
+
var import_components61 = require("@transferwise/components");
|
|
5171
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
5023
5172
|
var StatusListRenderer = {
|
|
5024
5173
|
canRenderType: "status-list",
|
|
5025
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
5026
|
-
title ? /* @__PURE__ */ (0,
|
|
5174
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: getMargin(margin), children: [
|
|
5175
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components61.Header, { title }) : null,
|
|
5027
5176
|
items.map((item) => {
|
|
5028
5177
|
const { callToAction, description, title: itemTitle } = item;
|
|
5029
|
-
return /* @__PURE__ */ (0,
|
|
5030
|
-
|
|
5178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
5179
|
+
import_components61.ListItem,
|
|
5031
5180
|
{
|
|
5032
5181
|
title: itemTitle,
|
|
5033
5182
|
subtitle: description,
|
|
5034
|
-
media: /* @__PURE__ */ (0,
|
|
5035
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
5036
|
-
|
|
5183
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(StatusListItemMedia, __spreadValues({}, item)),
|
|
5184
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
5185
|
+
import_components61.ListItem.AdditionalInfo,
|
|
5037
5186
|
{
|
|
5038
5187
|
action: __spreadValues({
|
|
5039
5188
|
label: callToAction.title
|
|
@@ -5051,10 +5200,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
5051
5200
|
return void 0;
|
|
5052
5201
|
}
|
|
5053
5202
|
if ("name" in icon) {
|
|
5054
|
-
return /* @__PURE__ */ (0,
|
|
5203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components61.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
5055
5204
|
}
|
|
5056
5205
|
if ("text" in icon) {
|
|
5057
|
-
return /* @__PURE__ */ (0,
|
|
5206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_components61.AvatarView, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
5058
5207
|
}
|
|
5059
5208
|
return void 0;
|
|
5060
5209
|
};
|
|
@@ -5072,12 +5221,12 @@ var StatusListRenderer_default = StatusListRenderer;
|
|
|
5072
5221
|
|
|
5073
5222
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
5074
5223
|
var import_components_theming = require("@wise/components-theming");
|
|
5075
|
-
var
|
|
5224
|
+
var import_react24 = require("react");
|
|
5076
5225
|
var ThemeRequiredEventName = "Theme Required";
|
|
5077
5226
|
var useCustomTheme = (theme, trackEvent) => {
|
|
5078
5227
|
const theming = (0, import_components_theming.useTheme)();
|
|
5079
|
-
const previousTheme = (0,
|
|
5080
|
-
(0,
|
|
5228
|
+
const previousTheme = (0, import_react24.useMemo)(() => theming.theme, []);
|
|
5229
|
+
(0, import_react24.useEffect)(() => {
|
|
5081
5230
|
theming.setTheme(theme);
|
|
5082
5231
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
5083
5232
|
return theme !== previousTheme ? () => {
|
|
@@ -5089,13 +5238,13 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
5089
5238
|
};
|
|
5090
5239
|
|
|
5091
5240
|
// ../renderers/src/step/StepHeader.tsx
|
|
5092
|
-
var
|
|
5093
|
-
var
|
|
5241
|
+
var import_components62 = require("@transferwise/components");
|
|
5242
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
5094
5243
|
var StepHeader = ({ title, description, tags }) => {
|
|
5095
5244
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
5096
|
-
return /* @__PURE__ */ (0,
|
|
5097
|
-
title ? /* @__PURE__ */ (0,
|
|
5098
|
-
description ? /* @__PURE__ */ (0,
|
|
5245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
5246
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components62.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
5247
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
5099
5248
|
] });
|
|
5100
5249
|
};
|
|
5101
5250
|
var getHeaderStyle = (tags) => {
|
|
@@ -5106,13 +5255,13 @@ var getHeaderStyle = (tags) => {
|
|
|
5106
5255
|
};
|
|
5107
5256
|
|
|
5108
5257
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5109
|
-
var
|
|
5258
|
+
var import_components63 = require("@transferwise/components");
|
|
5110
5259
|
var import_icons6 = require("@transferwise/icons");
|
|
5111
|
-
var
|
|
5260
|
+
var import_react_intl28 = require("react-intl");
|
|
5112
5261
|
|
|
5113
5262
|
// ../renderers/src/messages/back.messages.ts
|
|
5114
|
-
var
|
|
5115
|
-
var back_messages_default = (0,
|
|
5263
|
+
var import_react_intl27 = require("react-intl");
|
|
5264
|
+
var back_messages_default = (0, import_react_intl27.defineMessages)({
|
|
5116
5265
|
back: {
|
|
5117
5266
|
id: "df.wise.back.label",
|
|
5118
5267
|
defaultMessage: "Back",
|
|
@@ -5121,31 +5270,31 @@ var back_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
5121
5270
|
});
|
|
5122
5271
|
|
|
5123
5272
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
5124
|
-
var
|
|
5273
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
5125
5274
|
function BackButton({ title, onClick }) {
|
|
5126
|
-
const { formatMessage } = (0,
|
|
5127
|
-
return /* @__PURE__ */ (0,
|
|
5128
|
-
/* @__PURE__ */ (0,
|
|
5129
|
-
/* @__PURE__ */ (0,
|
|
5275
|
+
const { formatMessage } = (0, import_react_intl28.useIntl)();
|
|
5276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_components63.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
5277
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
5278
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_icons6.ArrowLeft, {})
|
|
5130
5279
|
] });
|
|
5131
5280
|
}
|
|
5132
5281
|
|
|
5133
5282
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
5134
|
-
var
|
|
5135
|
-
var
|
|
5283
|
+
var import_components64 = require("@transferwise/components");
|
|
5284
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
5136
5285
|
var Toolbar = ({ items }) => {
|
|
5137
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
5286
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
5138
5287
|
};
|
|
5139
5288
|
function ToolbarButton(props) {
|
|
5140
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
5289
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
5141
5290
|
}
|
|
5142
5291
|
function MediaToolbarButton(props) {
|
|
5143
5292
|
var _a;
|
|
5144
5293
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
5145
5294
|
const priority = getIconButtonPriority(control);
|
|
5146
5295
|
const type = getSentiment2(context);
|
|
5147
|
-
return /* @__PURE__ */ (0,
|
|
5148
|
-
|
|
5296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
5297
|
+
import_components64.IconButton,
|
|
5149
5298
|
{
|
|
5150
5299
|
className: "df-toolbar-button",
|
|
5151
5300
|
disabled,
|
|
@@ -5154,7 +5303,7 @@ function MediaToolbarButton(props) {
|
|
|
5154
5303
|
type,
|
|
5155
5304
|
onClick,
|
|
5156
5305
|
children: [
|
|
5157
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
5306
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
5158
5307
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
5159
5308
|
]
|
|
5160
5309
|
}
|
|
@@ -5165,8 +5314,8 @@ function TextToolbarButton(props) {
|
|
|
5165
5314
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
5166
5315
|
const priority = getPriority2(control);
|
|
5167
5316
|
const sentiment = getSentiment2(context);
|
|
5168
|
-
return /* @__PURE__ */ (0,
|
|
5169
|
-
|
|
5317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
5318
|
+
import_components64.Button,
|
|
5170
5319
|
{
|
|
5171
5320
|
v2: true,
|
|
5172
5321
|
size: "sm",
|
|
@@ -5195,18 +5344,18 @@ var getIconButtonPriority = (control) => {
|
|
|
5195
5344
|
};
|
|
5196
5345
|
|
|
5197
5346
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
5198
|
-
var
|
|
5347
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
5199
5348
|
function TopBar({ back, toolbar, tags }) {
|
|
5200
5349
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
5201
5350
|
const backCTA = isBackAllowed ? back : void 0;
|
|
5202
|
-
return backCTA || toolbar ? /* @__PURE__ */ (0,
|
|
5203
|
-
backCTA ? /* @__PURE__ */ (0,
|
|
5204
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
5351
|
+
return backCTA || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
5352
|
+
backCTA ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(BackButton, __spreadValues({}, backCTA)) : null,
|
|
5353
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
5205
5354
|
] }) : null;
|
|
5206
5355
|
}
|
|
5207
5356
|
|
|
5208
5357
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
5209
|
-
var
|
|
5358
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
5210
5359
|
var SplashCelebrationStepRenderer = {
|
|
5211
5360
|
canRenderType: "step",
|
|
5212
5361
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -5215,16 +5364,16 @@ var SplashCelebrationStepRenderer = {
|
|
|
5215
5364
|
function SplashCelebrationStepRendererComponent(props) {
|
|
5216
5365
|
const { back, title, description, toolbar, children, footer, tags, trackEvent } = props;
|
|
5217
5366
|
useCustomTheme("forest-green", trackEvent);
|
|
5218
|
-
return /* @__PURE__ */ (0,
|
|
5219
|
-
/* @__PURE__ */ (0,
|
|
5220
|
-
title || description ? /* @__PURE__ */ (0,
|
|
5367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
5368
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TopBar, { back, toolbar, tags }),
|
|
5369
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
5221
5370
|
children,
|
|
5222
|
-
/* @__PURE__ */ (0,
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StepFooter, { footer, tags })
|
|
5223
5372
|
] });
|
|
5224
5373
|
}
|
|
5225
5374
|
|
|
5226
5375
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
5227
|
-
var
|
|
5376
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
5228
5377
|
var SplashStepRenderer = {
|
|
5229
5378
|
canRenderType: "step",
|
|
5230
5379
|
canRender: ({ control }) => control === "splash",
|
|
@@ -5232,63 +5381,63 @@ var SplashStepRenderer = {
|
|
|
5232
5381
|
};
|
|
5233
5382
|
function SplashStepRendererComponent(props) {
|
|
5234
5383
|
const { back, title, description, toolbar, children, footer, tags } = props;
|
|
5235
|
-
return /* @__PURE__ */ (0,
|
|
5236
|
-
/* @__PURE__ */ (0,
|
|
5237
|
-
title || description ? /* @__PURE__ */ (0,
|
|
5384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
5385
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TopBar, { back, toolbar, tags }),
|
|
5386
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
5238
5387
|
children,
|
|
5239
|
-
/* @__PURE__ */ (0,
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(StepFooter, { footer, tags })
|
|
5240
5389
|
] });
|
|
5241
5390
|
}
|
|
5242
5391
|
|
|
5243
5392
|
// ../renderers/src/step/StepRenderer.tsx
|
|
5244
|
-
var
|
|
5245
|
-
var
|
|
5393
|
+
var import_components65 = require("@transferwise/components");
|
|
5394
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
5246
5395
|
var StepRenderer = {
|
|
5247
5396
|
canRenderType: "step",
|
|
5248
5397
|
render: StepRendererComponent
|
|
5249
5398
|
};
|
|
5250
5399
|
function StepRendererComponent(props) {
|
|
5251
5400
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
5252
|
-
return /* @__PURE__ */ (0,
|
|
5253
|
-
/* @__PURE__ */ (0,
|
|
5254
|
-
title || description ? /* @__PURE__ */ (0,
|
|
5255
|
-
error ? /* @__PURE__ */ (0,
|
|
5401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TopBar, { back, toolbar, tags }),
|
|
5403
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
5404
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_components65.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
5256
5405
|
children,
|
|
5257
|
-
/* @__PURE__ */ (0,
|
|
5406
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(StepFooter, { footer, tags })
|
|
5258
5407
|
] });
|
|
5259
5408
|
}
|
|
5260
5409
|
|
|
5261
5410
|
// ../renderers/src/TabsRenderer.tsx
|
|
5262
|
-
var
|
|
5263
|
-
var
|
|
5264
|
-
var
|
|
5411
|
+
var import_components66 = require("@transferwise/components");
|
|
5412
|
+
var import_react25 = require("react");
|
|
5413
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
5265
5414
|
var TabsRenderer = {
|
|
5266
5415
|
canRenderType: "tabs",
|
|
5267
5416
|
render: (props) => {
|
|
5268
5417
|
switch (props.control) {
|
|
5269
5418
|
case "segmented":
|
|
5270
5419
|
if (props.tabs.length > 3) {
|
|
5271
|
-
return /* @__PURE__ */ (0,
|
|
5420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
5272
5421
|
}
|
|
5273
|
-
return /* @__PURE__ */ (0,
|
|
5422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
5274
5423
|
case "chips":
|
|
5275
|
-
return /* @__PURE__ */ (0,
|
|
5424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
5276
5425
|
default:
|
|
5277
|
-
return /* @__PURE__ */ (0,
|
|
5426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
5278
5427
|
}
|
|
5279
5428
|
}
|
|
5280
5429
|
};
|
|
5281
5430
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
5282
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5283
|
-
return /* @__PURE__ */ (0,
|
|
5284
|
-
|
|
5431
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react25.useState)(0);
|
|
5432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5433
|
+
import_components66.Tabs,
|
|
5285
5434
|
{
|
|
5286
5435
|
name: uid,
|
|
5287
5436
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
5288
5437
|
tabs: tabs.map((option) => ({
|
|
5289
5438
|
title: option.title,
|
|
5290
5439
|
disabled: false,
|
|
5291
|
-
content: /* @__PURE__ */ (0,
|
|
5440
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "m-t-2", children: [
|
|
5292
5441
|
" ",
|
|
5293
5442
|
option.children,
|
|
5294
5443
|
" "
|
|
@@ -5300,10 +5449,10 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5300
5449
|
}
|
|
5301
5450
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
5302
5451
|
var _a;
|
|
5303
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5304
|
-
return /* @__PURE__ */ (0,
|
|
5305
|
-
/* @__PURE__ */ (0,
|
|
5306
|
-
|
|
5452
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react25.useState)(0);
|
|
5453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: getMargin(margin), children: [
|
|
5454
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5455
|
+
import_components66.SegmentedControl,
|
|
5307
5456
|
{
|
|
5308
5457
|
name: uid,
|
|
5309
5458
|
value: String(selectedIndex),
|
|
@@ -5317,31 +5466,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
5317
5466
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
5318
5467
|
}
|
|
5319
5468
|
),
|
|
5320
|
-
/* @__PURE__ */ (0,
|
|
5469
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5321
5470
|
] });
|
|
5322
5471
|
}
|
|
5323
5472
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
5324
5473
|
var _a;
|
|
5325
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
5326
|
-
return /* @__PURE__ */ (0,
|
|
5327
|
-
/* @__PURE__ */ (0,
|
|
5328
|
-
|
|
5474
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react25.useState)(0);
|
|
5475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: getMargin(margin), children: [
|
|
5476
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5477
|
+
import_components66.Chips,
|
|
5329
5478
|
{
|
|
5330
5479
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
5331
5480
|
selected: selectedIndex,
|
|
5332
5481
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
5333
5482
|
}
|
|
5334
5483
|
) }),
|
|
5335
|
-
/* @__PURE__ */ (0,
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
5336
5485
|
] });
|
|
5337
5486
|
}
|
|
5338
5487
|
|
|
5339
5488
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5340
|
-
var
|
|
5489
|
+
var import_components68 = require("@transferwise/components");
|
|
5341
5490
|
|
|
5342
5491
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
5343
|
-
var
|
|
5344
|
-
var
|
|
5492
|
+
var import_components67 = require("@transferwise/components");
|
|
5493
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
5345
5494
|
var commonKeys = [
|
|
5346
5495
|
"autoComplete",
|
|
5347
5496
|
"autoCapitalize",
|
|
@@ -5360,12 +5509,12 @@ function VariableTextInput(inputProps) {
|
|
|
5360
5509
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
5361
5510
|
switch (control) {
|
|
5362
5511
|
case "email":
|
|
5363
|
-
return /* @__PURE__ */ (0,
|
|
5512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
5364
5513
|
case "password":
|
|
5365
|
-
return /* @__PURE__ */ (0,
|
|
5514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
5366
5515
|
case "numeric": {
|
|
5367
5516
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
5368
|
-
return /* @__PURE__ */ (0,
|
|
5517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
5369
5518
|
TextInput,
|
|
5370
5519
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
5371
5520
|
onChange: (newValue) => {
|
|
@@ -5376,21 +5525,21 @@ function VariableTextInput(inputProps) {
|
|
|
5376
5525
|
);
|
|
5377
5526
|
}
|
|
5378
5527
|
case "phone-number":
|
|
5379
|
-
return /* @__PURE__ */ (0,
|
|
5528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_components67.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
5380
5529
|
default: {
|
|
5381
|
-
return /* @__PURE__ */ (0,
|
|
5530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
5382
5531
|
}
|
|
5383
5532
|
}
|
|
5384
5533
|
}
|
|
5385
5534
|
function TextInput(props) {
|
|
5386
5535
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
5387
|
-
const InputWithPattern = control === "textarea" ?
|
|
5388
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
5389
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
5536
|
+
const InputWithPattern = control === "textarea" ? import_components67.TextareaWithDisplayFormat : import_components67.InputWithDisplayFormat;
|
|
5537
|
+
const InputWithoutPattern = control === "textarea" ? import_components67.TextArea : import_components67.Input;
|
|
5538
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
5390
5539
|
}
|
|
5391
5540
|
|
|
5392
5541
|
// ../renderers/src/TextInputRenderer.tsx
|
|
5393
|
-
var
|
|
5542
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
5394
5543
|
var TextInputRenderer = {
|
|
5395
5544
|
canRenderType: "input-text",
|
|
5396
5545
|
render: (props) => {
|
|
@@ -5423,7 +5572,7 @@ var TextInputRenderer = {
|
|
|
5423
5572
|
}
|
|
5424
5573
|
}
|
|
5425
5574
|
});
|
|
5426
|
-
return /* @__PURE__ */ (0,
|
|
5575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5427
5576
|
FieldInput_default,
|
|
5428
5577
|
{
|
|
5429
5578
|
id,
|
|
@@ -5434,7 +5583,7 @@ var TextInputRenderer = {
|
|
|
5434
5583
|
loadingState: props.fieldLoadingState,
|
|
5435
5584
|
help,
|
|
5436
5585
|
features: props.features,
|
|
5437
|
-
children: /* @__PURE__ */ (0,
|
|
5586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components68.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
5438
5587
|
}
|
|
5439
5588
|
);
|
|
5440
5589
|
}
|
|
@@ -5442,13 +5591,13 @@ var TextInputRenderer = {
|
|
|
5442
5591
|
var TextInputRenderer_default = TextInputRenderer;
|
|
5443
5592
|
|
|
5444
5593
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
5445
|
-
var
|
|
5594
|
+
var import_components69 = require("@transferwise/components");
|
|
5446
5595
|
|
|
5447
5596
|
// ../renderers/src/utils/getRandomId.ts
|
|
5448
5597
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
5449
5598
|
|
|
5450
5599
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
5451
|
-
var
|
|
5600
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
5452
5601
|
var UploadInputRenderer = {
|
|
5453
5602
|
canRenderType: "input-upload",
|
|
5454
5603
|
render: (props) => {
|
|
@@ -5475,7 +5624,7 @@ var UploadInputRenderer = {
|
|
|
5475
5624
|
};
|
|
5476
5625
|
return (
|
|
5477
5626
|
// We don't pass help here as there is no sensible place to display it
|
|
5478
|
-
/* @__PURE__ */ (0,
|
|
5627
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5479
5628
|
UploadFieldInput_default,
|
|
5480
5629
|
{
|
|
5481
5630
|
id,
|
|
@@ -5483,8 +5632,8 @@ var UploadInputRenderer = {
|
|
|
5483
5632
|
description: void 0,
|
|
5484
5633
|
validation: validationState,
|
|
5485
5634
|
features,
|
|
5486
|
-
children: /* @__PURE__ */ (0,
|
|
5487
|
-
|
|
5635
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5636
|
+
import_components69.UploadInput,
|
|
5488
5637
|
{
|
|
5489
5638
|
id,
|
|
5490
5639
|
description,
|
|
@@ -5494,7 +5643,7 @@ var UploadInputRenderer = {
|
|
|
5494
5643
|
{
|
|
5495
5644
|
id: "my-file",
|
|
5496
5645
|
filename: value.name,
|
|
5497
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
5646
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components69.Status.FAILED : import_components69.Status.SUCCEEDED
|
|
5498
5647
|
}
|
|
5499
5648
|
] : void 0,
|
|
5500
5649
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -5551,7 +5700,7 @@ var LargeUploadRenderer = {
|
|
|
5551
5700
|
};
|
|
5552
5701
|
const filetypes = acceptsToFileTypes(accepts);
|
|
5553
5702
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
5554
|
-
return /* @__PURE__ */ (0,
|
|
5703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5555
5704
|
FieldInput_default,
|
|
5556
5705
|
{
|
|
5557
5706
|
id,
|
|
@@ -5560,8 +5709,8 @@ var LargeUploadRenderer = {
|
|
|
5560
5709
|
validation: validationState,
|
|
5561
5710
|
help,
|
|
5562
5711
|
features,
|
|
5563
|
-
children: /* @__PURE__ */ (0,
|
|
5564
|
-
|
|
5712
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5713
|
+
import_components69.Upload,
|
|
5565
5714
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
5566
5715
|
usAccept,
|
|
5567
5716
|
usDisabled: disabled,
|
|
@@ -5576,18 +5725,18 @@ var LargeUploadRenderer = {
|
|
|
5576
5725
|
};
|
|
5577
5726
|
|
|
5578
5727
|
// ../renderers/src/UpsellRenderer.tsx
|
|
5579
|
-
var
|
|
5580
|
-
var
|
|
5581
|
-
var
|
|
5728
|
+
var import_components70 = require("@transferwise/components");
|
|
5729
|
+
var import_react26 = require("react");
|
|
5730
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
5582
5731
|
var UpsellRenderer = {
|
|
5583
5732
|
canRenderType: "upsell",
|
|
5584
5733
|
render: UpsellRendererComponent
|
|
5585
5734
|
};
|
|
5586
5735
|
function UpsellRendererComponent(props) {
|
|
5587
5736
|
const { text, callToAction, media, margin, onDismiss } = props;
|
|
5588
|
-
const [isVisible, setIsVisible] = (0,
|
|
5589
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
5590
|
-
|
|
5737
|
+
const [isVisible, setIsVisible] = (0, import_react26.useState)(true);
|
|
5738
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
5739
|
+
import_components70.Nudge,
|
|
5591
5740
|
{
|
|
5592
5741
|
className: getMargin(margin),
|
|
5593
5742
|
mediaName: getMediaName(media),
|
|
@@ -5633,9 +5782,9 @@ var supportedMediaNames = [
|
|
|
5633
5782
|
];
|
|
5634
5783
|
|
|
5635
5784
|
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
5636
|
-
var
|
|
5785
|
+
var import_components71 = require("@transferwise/components");
|
|
5637
5786
|
var import_classnames8 = __toESM(require_classnames());
|
|
5638
|
-
var
|
|
5787
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
5639
5788
|
var CircularButtonRenderer = {
|
|
5640
5789
|
canRenderType: "button",
|
|
5641
5790
|
canRender: ({ control }) => control === "circular",
|
|
@@ -5645,8 +5794,8 @@ function CircularButtonComponent(props) {
|
|
|
5645
5794
|
var _a;
|
|
5646
5795
|
const { context, disabled, margin, media, tags, title, onClick } = props;
|
|
5647
5796
|
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
5648
|
-
return /* @__PURE__ */ (0,
|
|
5649
|
-
|
|
5797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5798
|
+
import_components71.CircularButton,
|
|
5650
5799
|
{
|
|
5651
5800
|
disabled,
|
|
5652
5801
|
priority: priority != null ? priority : "secondary",
|
|
@@ -5709,13 +5858,13 @@ var getWiseRenderers = () => [
|
|
|
5709
5858
|
];
|
|
5710
5859
|
|
|
5711
5860
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
5712
|
-
var
|
|
5713
|
-
var
|
|
5861
|
+
var import_components72 = require("@transferwise/components");
|
|
5862
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
5714
5863
|
var InitialLoadingStateRenderer = {
|
|
5715
5864
|
canRenderType: "loading-state",
|
|
5716
5865
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
5717
|
-
render: () => /* @__PURE__ */ (0,
|
|
5718
|
-
|
|
5866
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
5867
|
+
import_components72.Loader,
|
|
5719
5868
|
{
|
|
5720
5869
|
size: "md",
|
|
5721
5870
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
|
|
@@ -5726,25 +5875,25 @@ var InitialLoadingStateRenderer = {
|
|
|
5726
5875
|
|
|
5727
5876
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
5728
5877
|
var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
|
|
5729
|
-
var
|
|
5730
|
-
var
|
|
5878
|
+
var import_components73 = require("@transferwise/components");
|
|
5879
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
5731
5880
|
function DynamicFlowModal(props) {
|
|
5732
5881
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
5733
5882
|
const dfProps = useWiseToCoreProps(rest);
|
|
5734
5883
|
const df = (0, import_dynamic_flow_client.useDynamicFlowModal)(dfProps);
|
|
5735
|
-
return /* @__PURE__ */ (0,
|
|
5736
|
-
|
|
5884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
5885
|
+
import_components73.Modal,
|
|
5737
5886
|
__spreadProps(__spreadValues({
|
|
5738
5887
|
className: `dynamic-flow-modal ${className}`,
|
|
5739
5888
|
disableDimmerClickToClose: true
|
|
5740
5889
|
}, df.modal), {
|
|
5741
|
-
body: /* @__PURE__ */ (0,
|
|
5890
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
5742
5891
|
})
|
|
5743
5892
|
);
|
|
5744
5893
|
}
|
|
5745
5894
|
|
|
5746
5895
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
5747
|
-
var
|
|
5896
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
5748
5897
|
var wiseRenderers = getWiseRenderers();
|
|
5749
5898
|
var getMergedRenderers = (props) => {
|
|
5750
5899
|
var _d, _e;
|
|
@@ -5758,7 +5907,7 @@ var getMergedRenderers = (props) => {
|
|
|
5758
5907
|
method: initialRequest.method,
|
|
5759
5908
|
data: initialRequest.body
|
|
5760
5909
|
};
|
|
5761
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
5910
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
5762
5911
|
DynamicFlowModal,
|
|
5763
5912
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
5764
5913
|
features: subflowFeatures,
|
|
@@ -5837,12 +5986,12 @@ var customEventsToAnalytics = {
|
|
|
5837
5986
|
};
|
|
5838
5987
|
|
|
5839
5988
|
// src/dynamicFlow/useOnCopy.tsx
|
|
5840
|
-
var
|
|
5841
|
-
var
|
|
5989
|
+
var import_react27 = require("react");
|
|
5990
|
+
var import_react_intl30 = require("react-intl");
|
|
5842
5991
|
|
|
5843
5992
|
// src/dynamicFlow/messages.ts
|
|
5844
|
-
var
|
|
5845
|
-
var messages_default = (0,
|
|
5993
|
+
var import_react_intl29 = require("react-intl");
|
|
5994
|
+
var messages_default = (0, import_react_intl29.defineMessages)({
|
|
5846
5995
|
copied: {
|
|
5847
5996
|
id: "df.wise.CopyFeedback.copy",
|
|
5848
5997
|
defaultMessage: "Copied to clipboard",
|
|
@@ -5857,9 +6006,9 @@ var messages_default = (0, import_react_intl28.defineMessages)({
|
|
|
5857
6006
|
|
|
5858
6007
|
// src/dynamicFlow/useOnCopy.tsx
|
|
5859
6008
|
var useOnCopy = () => {
|
|
5860
|
-
const { formatMessage } = (0,
|
|
6009
|
+
const { formatMessage } = (0, import_react_intl30.useIntl)();
|
|
5861
6010
|
const createSnackBar = useSnackBarIfAvailable();
|
|
5862
|
-
return (0,
|
|
6011
|
+
return (0, import_react27.useCallback)(
|
|
5863
6012
|
(copiedContent) => {
|
|
5864
6013
|
if (copiedContent) {
|
|
5865
6014
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -5872,11 +6021,11 @@ var useOnCopy = () => {
|
|
|
5872
6021
|
};
|
|
5873
6022
|
|
|
5874
6023
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
5875
|
-
var
|
|
5876
|
-
var
|
|
6024
|
+
var import_react28 = require("react");
|
|
6025
|
+
var import_react_intl31 = require("react-intl");
|
|
5877
6026
|
var useWiseHttpClient = (httpClient) => {
|
|
5878
|
-
const { locale } = (0,
|
|
5879
|
-
return (0,
|
|
6027
|
+
const { locale } = (0, import_react_intl31.useIntl)();
|
|
6028
|
+
return (0, import_react28.useCallback)(
|
|
5880
6029
|
async (input, init = {}) => {
|
|
5881
6030
|
const headers = new Headers(init.headers);
|
|
5882
6031
|
headers.set("accept-language", locale);
|
|
@@ -5917,10 +6066,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
5917
6066
|
onLog
|
|
5918
6067
|
} = props;
|
|
5919
6068
|
const httpClient = useWiseHttpClient(customFetch);
|
|
5920
|
-
const mergedRenderers = (0,
|
|
6069
|
+
const mergedRenderers = (0, import_react29.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
5921
6070
|
const createSnackBar = useCreateSnackBar();
|
|
5922
|
-
const logEvent = (0,
|
|
5923
|
-
const trackEvent = (0,
|
|
6071
|
+
const logEvent = (0, import_react29.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
6072
|
+
const trackEvent = (0, import_react29.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
5924
6073
|
const onCopy = useOnCopy();
|
|
5925
6074
|
return __spreadProps(__spreadValues({}, props), {
|
|
5926
6075
|
httpClient,
|
|
@@ -5952,38 +6101,38 @@ var openLinkInNewTab = (url) => {
|
|
|
5952
6101
|
};
|
|
5953
6102
|
|
|
5954
6103
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
5955
|
-
var
|
|
6104
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
5956
6105
|
function DynamicFlow(props) {
|
|
5957
6106
|
const { className = "" } = props;
|
|
5958
6107
|
const dfProps = useWiseToCoreProps(props);
|
|
5959
6108
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
5960
6109
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
5961
|
-
return /* @__PURE__ */ (0,
|
|
6110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className, onContextMenu, children: [
|
|
5962
6111
|
df.view,
|
|
5963
6112
|
contextMenu
|
|
5964
6113
|
] });
|
|
5965
6114
|
}
|
|
5966
6115
|
|
|
5967
6116
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
5968
|
-
var
|
|
6117
|
+
var import_react30 = require("react");
|
|
5969
6118
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
5970
|
-
var
|
|
5971
|
-
var DynamicFlowWithRef = (0,
|
|
6119
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
6120
|
+
var DynamicFlowWithRef = (0, import_react30.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
5972
6121
|
const { className = "" } = props;
|
|
5973
6122
|
const dfProps = useWiseToCoreProps(props);
|
|
5974
6123
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
5975
|
-
(0,
|
|
6124
|
+
(0, import_react30.useImperativeHandle)(
|
|
5976
6125
|
ref,
|
|
5977
6126
|
() => ({
|
|
5978
|
-
getValue:
|
|
6127
|
+
getValue: () => {
|
|
5979
6128
|
var _a;
|
|
5980
|
-
return (_a =
|
|
6129
|
+
return (_a = df.controller.getValue()) != null ? _a : null;
|
|
5981
6130
|
},
|
|
5982
6131
|
validate: () => df.controller.validate()
|
|
5983
6132
|
}),
|
|
5984
6133
|
[df]
|
|
5985
6134
|
);
|
|
5986
|
-
return /* @__PURE__ */ (0,
|
|
6135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className, children: df.view });
|
|
5987
6136
|
});
|
|
5988
6137
|
|
|
5989
6138
|
// src/index.ts
|