@wise/dynamic-flow-client-internal 5.28.4 → 5.29.0-experimental-6048bca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +764 -633
- package/build/main.mjs +623 -492
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
package/build/main.js
CHANGED
|
@@ -70,7 +70,7 @@ var require_classnames = __commonJS({
|
|
|
70
70
|
(function() {
|
|
71
71
|
"use strict";
|
|
72
72
|
var hasOwn = {}.hasOwnProperty;
|
|
73
|
-
function
|
|
73
|
+
function classNames36() {
|
|
74
74
|
var classes = "";
|
|
75
75
|
for (var i = 0; i < arguments.length; i++) {
|
|
76
76
|
var arg = arguments[i];
|
|
@@ -88,7 +88,7 @@ var require_classnames = __commonJS({
|
|
|
88
88
|
return "";
|
|
89
89
|
}
|
|
90
90
|
if (Array.isArray(arg)) {
|
|
91
|
-
return
|
|
91
|
+
return classNames36.apply(null, arg);
|
|
92
92
|
}
|
|
93
93
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
94
94
|
return arg.toString();
|
|
@@ -111,14 +111,14 @@ var require_classnames = __commonJS({
|
|
|
111
111
|
return value + newClass;
|
|
112
112
|
}
|
|
113
113
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
114
|
-
|
|
115
|
-
module2.exports =
|
|
114
|
+
classNames36.default = classNames36;
|
|
115
|
+
module2.exports = classNames36;
|
|
116
116
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
117
117
|
define("classnames", [], function() {
|
|
118
|
-
return
|
|
118
|
+
return classNames36;
|
|
119
119
|
});
|
|
120
120
|
} else {
|
|
121
|
-
window.classNames =
|
|
121
|
+
window.classNames = classNames36;
|
|
122
122
|
}
|
|
123
123
|
})();
|
|
124
124
|
}
|
|
@@ -1360,11 +1360,48 @@ var getPriority = (control, tags) => {
|
|
|
1360
1360
|
return control && isButtonPriority(control) ? control : "secondary";
|
|
1361
1361
|
};
|
|
1362
1362
|
|
|
1363
|
+
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
1364
|
+
var import_components9 = require("@transferwise/components");
|
|
1365
|
+
var import_classnames10 = __toESM(require_classnames());
|
|
1366
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1367
|
+
var CircularButtonRenderer = {
|
|
1368
|
+
canRenderType: "button",
|
|
1369
|
+
canRender: ({ control }) => control === "circular",
|
|
1370
|
+
render: CircularButtonComponent
|
|
1371
|
+
};
|
|
1372
|
+
function CircularButtonComponent(props) {
|
|
1373
|
+
var _a;
|
|
1374
|
+
const { context, control, disabled, margin, media, tags, title, onClick } = props;
|
|
1375
|
+
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
1376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1377
|
+
"div",
|
|
1378
|
+
{
|
|
1379
|
+
className: (0, import_classnames10.default)(
|
|
1380
|
+
getMargin(margin),
|
|
1381
|
+
"df-button",
|
|
1382
|
+
"circular",
|
|
1383
|
+
controlAndTagsToCSSClass({ control, tags })
|
|
1384
|
+
),
|
|
1385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1386
|
+
import_components9.CircularButton,
|
|
1387
|
+
{
|
|
1388
|
+
disabled,
|
|
1389
|
+
priority: priority != null ? priority : "secondary",
|
|
1390
|
+
type: context === "negative" ? "negative" : "default",
|
|
1391
|
+
icon: media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : void 0,
|
|
1392
|
+
onClick,
|
|
1393
|
+
children: title
|
|
1394
|
+
}
|
|
1395
|
+
)
|
|
1396
|
+
}
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1363
1400
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1364
|
-
var
|
|
1401
|
+
var import_components14 = require("@transferwise/components");
|
|
1365
1402
|
|
|
1366
1403
|
// ../renderers/src/components/FieldInput.tsx
|
|
1367
|
-
var
|
|
1404
|
+
var import_components11 = require("@transferwise/components");
|
|
1368
1405
|
|
|
1369
1406
|
// ../renderers/src/utils/useScrollToError.ts
|
|
1370
1407
|
var import_react7 = require("react");
|
|
@@ -1389,7 +1426,7 @@ var scrollToIfNotVisible = (ref) => {
|
|
|
1389
1426
|
};
|
|
1390
1427
|
|
|
1391
1428
|
// ../renderers/src/components/Help.tsx
|
|
1392
|
-
var
|
|
1429
|
+
var import_components10 = require("@transferwise/components");
|
|
1393
1430
|
var import_react_intl4 = require("react-intl");
|
|
1394
1431
|
|
|
1395
1432
|
// ../renderers/src/messages/help.messages.ts
|
|
@@ -1403,13 +1440,13 @@ var help_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1403
1440
|
});
|
|
1404
1441
|
|
|
1405
1442
|
// ../renderers/src/components/Help.tsx
|
|
1406
|
-
var
|
|
1443
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1407
1444
|
function Help({ help, onClick }) {
|
|
1408
1445
|
const intl = (0, import_react_intl4.useIntl)();
|
|
1409
|
-
return /* @__PURE__ */ (0,
|
|
1410
|
-
|
|
1446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1447
|
+
import_components10.Info,
|
|
1411
1448
|
{
|
|
1412
|
-
content: /* @__PURE__ */ (0,
|
|
1449
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components10.Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
1413
1450
|
presentation: "POPOVER",
|
|
1414
1451
|
size: "sm",
|
|
1415
1452
|
"aria-label": intl.formatMessage(help_messages_default.helpAria),
|
|
@@ -1420,16 +1457,16 @@ function Help({ help, onClick }) {
|
|
|
1420
1457
|
var Help_default = Help;
|
|
1421
1458
|
|
|
1422
1459
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
1423
|
-
var
|
|
1460
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1424
1461
|
function LabelContentWithHelp({ text, help }) {
|
|
1425
|
-
return /* @__PURE__ */ (0,
|
|
1462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
1426
1463
|
text,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Help_default, { help })
|
|
1428
1465
|
] });
|
|
1429
1466
|
}
|
|
1430
1467
|
|
|
1431
1468
|
// ../renderers/src/components/FieldInput.tsx
|
|
1432
|
-
var
|
|
1469
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1433
1470
|
function FieldInput({
|
|
1434
1471
|
id,
|
|
1435
1472
|
children,
|
|
@@ -1444,10 +1481,10 @@ function FieldInput({
|
|
|
1444
1481
|
tags
|
|
1445
1482
|
}) {
|
|
1446
1483
|
var _a;
|
|
1447
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1484
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1448
1485
|
const { ref } = useScrollToError(validation, features);
|
|
1449
|
-
return /* @__PURE__ */ (0,
|
|
1450
|
-
|
|
1486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1487
|
+
import_components11.Field,
|
|
1451
1488
|
{
|
|
1452
1489
|
id,
|
|
1453
1490
|
label: labelContent,
|
|
@@ -1474,27 +1511,27 @@ var mapStatusToSentiment = (validation, defaultContext) => {
|
|
|
1474
1511
|
var FieldInput_default = FieldInput;
|
|
1475
1512
|
|
|
1476
1513
|
// ../renderers/src/utils/listItem/getAdditionalText.tsx
|
|
1477
|
-
var
|
|
1478
|
-
var
|
|
1514
|
+
var import_components12 = require("@transferwise/components");
|
|
1515
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1479
1516
|
var getAdditionalText = (additionalText) => {
|
|
1480
1517
|
if (!additionalText) {
|
|
1481
1518
|
return void 0;
|
|
1482
1519
|
}
|
|
1483
|
-
return /* @__PURE__ */ (0,
|
|
1520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components12.ListItem.AdditionalInfo, { children: additionalText });
|
|
1484
1521
|
};
|
|
1485
1522
|
|
|
1486
1523
|
// ../renderers/src/utils/listItem/getInlineAlert.tsx
|
|
1487
|
-
var
|
|
1488
|
-
var
|
|
1524
|
+
var import_components13 = require("@transferwise/components");
|
|
1525
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1489
1526
|
var getInlineAlert = (inlineAlert) => {
|
|
1490
1527
|
if (!inlineAlert) return void 0;
|
|
1491
1528
|
const { context, media, content } = inlineAlert;
|
|
1492
|
-
return /* @__PURE__ */ (0,
|
|
1529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components13.ListItem.Prompt, { sentiment: context, media: media && getInlinePromptMedia(media), children: content });
|
|
1493
1530
|
};
|
|
1494
1531
|
|
|
1495
1532
|
// ../renderers/src/utils/listItem/getMedia.tsx
|
|
1496
|
-
var
|
|
1497
|
-
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0,
|
|
1533
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1534
|
+
var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
|
|
1498
1535
|
|
|
1499
1536
|
// ../renderers/src/utils/listItem/getSupportingValues.ts
|
|
1500
1537
|
var getSupportingValues = (supportingValues) => {
|
|
@@ -1502,18 +1539,18 @@ var getSupportingValues = (supportingValues) => {
|
|
|
1502
1539
|
};
|
|
1503
1540
|
|
|
1504
1541
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1505
|
-
var
|
|
1542
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1506
1543
|
var CheckboxInputRenderer = {
|
|
1507
1544
|
canRenderType: "input-checkbox",
|
|
1508
1545
|
render: (props) => {
|
|
1509
1546
|
switch (props.control) {
|
|
1510
1547
|
case "switch-item":
|
|
1511
|
-
return /* @__PURE__ */ (0,
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SwitchItemComponent, __spreadValues({}, props));
|
|
1512
1549
|
case "checkbox-item":
|
|
1513
|
-
return /* @__PURE__ */ (0,
|
|
1550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CheckboxItemComponent, __spreadValues({}, props));
|
|
1514
1551
|
case "checkbox":
|
|
1515
1552
|
default:
|
|
1516
|
-
return /* @__PURE__ */ (0,
|
|
1553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CheckboxComponent, __spreadValues({}, props));
|
|
1517
1554
|
}
|
|
1518
1555
|
}
|
|
1519
1556
|
};
|
|
@@ -1538,7 +1575,7 @@ var CheckboxComponent = (props) => {
|
|
|
1538
1575
|
"value"
|
|
1539
1576
|
]);
|
|
1540
1577
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
|
|
1541
|
-
return /* @__PURE__ */ (0,
|
|
1578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1542
1579
|
FieldInput_default,
|
|
1543
1580
|
{
|
|
1544
1581
|
id,
|
|
@@ -1551,7 +1588,7 @@ var CheckboxComponent = (props) => {
|
|
|
1551
1588
|
features: rest.features,
|
|
1552
1589
|
control,
|
|
1553
1590
|
tags: rest.tags,
|
|
1554
|
-
children: /* @__PURE__ */ (0,
|
|
1591
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components14.Checkbox, __spreadValues({ id }, checkboxProps))
|
|
1555
1592
|
}
|
|
1556
1593
|
);
|
|
1557
1594
|
};
|
|
@@ -1570,8 +1607,8 @@ var CheckboxItemComponent = (props) => {
|
|
|
1570
1607
|
onChange
|
|
1571
1608
|
} = props;
|
|
1572
1609
|
const { ref } = useScrollToError(validationState, features);
|
|
1573
|
-
return /* @__PURE__ */ (0,
|
|
1574
|
-
|
|
1610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1611
|
+
import_components14.ListItem,
|
|
1575
1612
|
__spreadProps(__spreadValues({
|
|
1576
1613
|
title,
|
|
1577
1614
|
subtitle: description,
|
|
@@ -1579,7 +1616,7 @@ var CheckboxItemComponent = (props) => {
|
|
|
1579
1616
|
media: getMedia(media, false),
|
|
1580
1617
|
disabled,
|
|
1581
1618
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1582
|
-
control: /* @__PURE__ */ (0,
|
|
1619
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components14.ListItem.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
1583
1620
|
}, getSupportingValues(supportingValues)), {
|
|
1584
1621
|
className: controlAndTagsToCSSClass(props)
|
|
1585
1622
|
})
|
|
@@ -1600,8 +1637,8 @@ var SwitchItemComponent = (props) => {
|
|
|
1600
1637
|
onChange
|
|
1601
1638
|
} = props;
|
|
1602
1639
|
const { ref } = useScrollToError(validationState, features);
|
|
1603
|
-
return /* @__PURE__ */ (0,
|
|
1604
|
-
|
|
1640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1641
|
+
import_components14.ListItem,
|
|
1605
1642
|
__spreadProps(__spreadValues({
|
|
1606
1643
|
title,
|
|
1607
1644
|
subtitle: description,
|
|
@@ -1609,7 +1646,7 @@ var SwitchItemComponent = (props) => {
|
|
|
1609
1646
|
media: getMedia(media, false),
|
|
1610
1647
|
disabled,
|
|
1611
1648
|
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1612
|
-
control: /* @__PURE__ */ (0,
|
|
1649
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components14.ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
1613
1650
|
}, getSupportingValues(supportingValues)), {
|
|
1614
1651
|
className: controlAndTagsToCSSClass(props)
|
|
1615
1652
|
})
|
|
@@ -1617,14 +1654,14 @@ var SwitchItemComponent = (props) => {
|
|
|
1617
1654
|
};
|
|
1618
1655
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
1619
1656
|
if ((validationState == null ? void 0 : validationState.status) === "invalid") {
|
|
1620
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components14.ListItem.Prompt, { sentiment: "negative", children: validationState.message });
|
|
1621
1658
|
}
|
|
1622
1659
|
return getInlineAlert(inlineAlert);
|
|
1623
1660
|
};
|
|
1624
1661
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1625
1662
|
|
|
1626
1663
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
1627
|
-
var
|
|
1664
|
+
var import_components22 = require("@transferwise/components");
|
|
1628
1665
|
|
|
1629
1666
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
1630
1667
|
var import_react_intl5 = require("react-intl");
|
|
@@ -1771,6 +1808,10 @@ var isIOSWebKit = () => {
|
|
|
1771
1808
|
const mtp = navigator.maxTouchPoints;
|
|
1772
1809
|
return _isIOSResult = navigator.platform === "MacIntel" && mtp !== void 0 && mtp > 0;
|
|
1773
1810
|
};
|
|
1811
|
+
var getRect = (element) => {
|
|
1812
|
+
const { offsetWidth, offsetHeight } = element;
|
|
1813
|
+
return { width: offsetWidth, height: offsetHeight };
|
|
1814
|
+
};
|
|
1774
1815
|
var defaultKeyExtractor = (index) => index;
|
|
1775
1816
|
var defaultRangeExtractor = (range) => {
|
|
1776
1817
|
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
@@ -1782,6 +1823,43 @@ var defaultRangeExtractor = (range) => {
|
|
|
1782
1823
|
}
|
|
1783
1824
|
return arr;
|
|
1784
1825
|
};
|
|
1826
|
+
var observeElementRect = (instance, cb) => {
|
|
1827
|
+
const element = instance.scrollElement;
|
|
1828
|
+
if (!element) {
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
const targetWindow = instance.targetWindow;
|
|
1832
|
+
if (!targetWindow) {
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
const handler = (rect) => {
|
|
1836
|
+
const { width, height } = rect;
|
|
1837
|
+
cb({ width: Math.round(width), height: Math.round(height) });
|
|
1838
|
+
};
|
|
1839
|
+
handler(getRect(element));
|
|
1840
|
+
if (!targetWindow.ResizeObserver) {
|
|
1841
|
+
return () => {
|
|
1842
|
+
};
|
|
1843
|
+
}
|
|
1844
|
+
const observer = new targetWindow.ResizeObserver((entries) => {
|
|
1845
|
+
const run = () => {
|
|
1846
|
+
const entry = entries[0];
|
|
1847
|
+
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
1848
|
+
const box = entry.borderBoxSize[0];
|
|
1849
|
+
if (box) {
|
|
1850
|
+
handler({ width: box.inlineSize, height: box.blockSize });
|
|
1851
|
+
return;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
handler(getRect(element));
|
|
1855
|
+
};
|
|
1856
|
+
instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
1857
|
+
});
|
|
1858
|
+
observer.observe(element, { box: "border-box" });
|
|
1859
|
+
return () => {
|
|
1860
|
+
observer.unobserve(element);
|
|
1861
|
+
};
|
|
1862
|
+
};
|
|
1785
1863
|
var addEventListenerOptions = {
|
|
1786
1864
|
passive: true
|
|
1787
1865
|
};
|
|
@@ -1835,6 +1913,10 @@ var observeOffset = (instance, cb, readOffset) => {
|
|
|
1835
1913
|
fallback == null ? void 0 : fallback.cancel();
|
|
1836
1914
|
};
|
|
1837
1915
|
};
|
|
1916
|
+
var observeElementOffset = (instance, cb) => observeOffset(instance, cb, (el) => {
|
|
1917
|
+
const { horizontal, isRtl } = instance.options;
|
|
1918
|
+
return horizontal ? el.scrollLeft * (isRtl && -1 || 1) : el.scrollTop;
|
|
1919
|
+
});
|
|
1838
1920
|
var observeWindowOffset = (instance, cb) => observeOffset(
|
|
1839
1921
|
instance,
|
|
1840
1922
|
cb,
|
|
@@ -1877,6 +1959,7 @@ var scrollWithAdjustments = (offset, {
|
|
|
1877
1959
|
});
|
|
1878
1960
|
};
|
|
1879
1961
|
var windowScroll = scrollWithAdjustments;
|
|
1962
|
+
var elementScroll = scrollWithAdjustments;
|
|
1880
1963
|
var Virtualizer = class {
|
|
1881
1964
|
constructor(opts) {
|
|
1882
1965
|
this.unsubs = [];
|
|
@@ -3119,6 +3202,13 @@ function useVirtualizerBase(_a) {
|
|
|
3119
3202
|
});
|
|
3120
3203
|
return instance;
|
|
3121
3204
|
}
|
|
3205
|
+
function useVirtualizer(options) {
|
|
3206
|
+
return useVirtualizerBase(__spreadValues({
|
|
3207
|
+
observeElementRect,
|
|
3208
|
+
observeElementOffset,
|
|
3209
|
+
scrollToFn: elementScroll
|
|
3210
|
+
}, options));
|
|
3211
|
+
}
|
|
3122
3212
|
function useWindowVirtualizer(options) {
|
|
3123
3213
|
return useVirtualizerBase(__spreadValues({
|
|
3124
3214
|
getScrollElement: () => typeof document !== "undefined" ? window : null,
|
|
@@ -3130,11 +3220,11 @@ function useWindowVirtualizer(options) {
|
|
|
3130
3220
|
}
|
|
3131
3221
|
|
|
3132
3222
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3133
|
-
var
|
|
3223
|
+
var import_components16 = require("@transferwise/components");
|
|
3134
3224
|
var import_react9 = require("react");
|
|
3135
3225
|
|
|
3136
3226
|
// ../renderers/src/step/StepFooter.tsx
|
|
3137
|
-
var
|
|
3227
|
+
var import_components15 = require("@transferwise/components");
|
|
3138
3228
|
var import_react8 = require("react");
|
|
3139
3229
|
var import_react_intl7 = require("react-intl");
|
|
3140
3230
|
|
|
@@ -3149,24 +3239,24 @@ var step_messages_default = (0, import_react_intl6.defineMessages)({
|
|
|
3149
3239
|
});
|
|
3150
3240
|
|
|
3151
3241
|
// ../renderers/src/step/StepFooter.tsx
|
|
3152
|
-
var
|
|
3242
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3153
3243
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3154
3244
|
var StepFooter = ({ footer, tags }) => {
|
|
3155
3245
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3156
|
-
return /* @__PURE__ */ (0,
|
|
3246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FooterWithScrollButton, { footer });
|
|
3157
3247
|
}
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DefaultFooter, { footer });
|
|
3159
3249
|
};
|
|
3160
3250
|
var DefaultFooter = ({ footer }) => {
|
|
3161
3251
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3162
|
-
return hasFooter ? /* @__PURE__ */ (0,
|
|
3252
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3163
3253
|
};
|
|
3164
3254
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3165
3255
|
const { formatMessage } = (0, import_react_intl7.useIntl)();
|
|
3166
3256
|
const endOfLayoutRef = (0, import_react8.useRef)(null);
|
|
3167
3257
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3168
|
-
const scrollButton = /* @__PURE__ */ (0,
|
|
3169
|
-
|
|
3258
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3259
|
+
import_components15.Button,
|
|
3170
3260
|
{
|
|
3171
3261
|
className: "m-b-1",
|
|
3172
3262
|
v2: true,
|
|
@@ -3181,17 +3271,17 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3181
3271
|
);
|
|
3182
3272
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3183
3273
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3184
|
-
return /* @__PURE__ */ (0,
|
|
3274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3185
3275
|
}
|
|
3186
|
-
return /* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3277
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3189
3279
|
!isElementVisible && scrollButton,
|
|
3190
3280
|
footer
|
|
3191
3281
|
] })
|
|
3192
3282
|
] });
|
|
3193
3283
|
};
|
|
3194
|
-
var useIsElementVisible = (elementRef) => {
|
|
3284
|
+
var useIsElementVisible = (elementRef, root = null) => {
|
|
3195
3285
|
const [isVisible, setIsVisible] = (0, import_react8.useState)(false);
|
|
3196
3286
|
(0, import_react8.useEffect)(() => {
|
|
3197
3287
|
const element = elementRef.current;
|
|
@@ -3200,11 +3290,11 @@ var useIsElementVisible = (elementRef) => {
|
|
|
3200
3290
|
([entry]) => {
|
|
3201
3291
|
setIsVisible(entry.isIntersecting);
|
|
3202
3292
|
},
|
|
3203
|
-
{ rootMargin: "1px" }
|
|
3293
|
+
{ root, rootMargin: "1px" }
|
|
3204
3294
|
);
|
|
3205
3295
|
observer.observe(element);
|
|
3206
3296
|
return () => observer.disconnect();
|
|
3207
|
-
}, [elementRef]);
|
|
3297
|
+
}, [elementRef, root]);
|
|
3208
3298
|
return isVisible;
|
|
3209
3299
|
};
|
|
3210
3300
|
|
|
@@ -3226,12 +3316,40 @@ var collection_messages_default = (0, import_react_intl8.defineMessages)({
|
|
|
3226
3316
|
}
|
|
3227
3317
|
});
|
|
3228
3318
|
|
|
3319
|
+
// ../renderers/src/CollectionRenderer/components/getScrollableAncestor.ts
|
|
3320
|
+
var SCROLLABLE_OVERFLOW_VALUES = /* @__PURE__ */ new Set(["auto", "overlay", "scroll"]);
|
|
3321
|
+
var getScrollableAncestor = (element) => {
|
|
3322
|
+
var _a;
|
|
3323
|
+
const view = element == null ? void 0 : element.ownerDocument.defaultView;
|
|
3324
|
+
let ancestor = (_a = element == null ? void 0 : element.parentElement) != null ? _a : null;
|
|
3325
|
+
if (!view) {
|
|
3326
|
+
return null;
|
|
3327
|
+
}
|
|
3328
|
+
while (ancestor) {
|
|
3329
|
+
const { overflowY } = view.getComputedStyle(ancestor);
|
|
3330
|
+
const hasScrollableOverflow = SCROLLABLE_OVERFLOW_VALUES.has(overflowY);
|
|
3331
|
+
if (hasScrollableOverflow && ancestor.scrollHeight > ancestor.clientHeight) {
|
|
3332
|
+
return ancestor;
|
|
3333
|
+
}
|
|
3334
|
+
ancestor = ancestor.parentElement;
|
|
3335
|
+
}
|
|
3336
|
+
return null;
|
|
3337
|
+
};
|
|
3338
|
+
|
|
3229
3339
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3230
|
-
var
|
|
3340
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3231
3341
|
var ContentComponent = (props) => {
|
|
3232
3342
|
const { state, status, SectionHeader, Item } = props;
|
|
3343
|
+
const contentRef = (0, import_react9.useRef)(null);
|
|
3344
|
+
const [scrollElement, setScrollElement] = (0, import_react9.useState)(null);
|
|
3345
|
+
(0, import_react9.useLayoutEffect)(() => {
|
|
3346
|
+
const nextScrollElement = getScrollableAncestor(contentRef.current);
|
|
3347
|
+
setScrollElement(
|
|
3348
|
+
(currentScrollElement) => currentScrollElement === nextScrollElement ? currentScrollElement : nextScrollElement
|
|
3349
|
+
);
|
|
3350
|
+
}, []);
|
|
3233
3351
|
const endOfContentRef = (0, import_react9.useRef)(null);
|
|
3234
|
-
const isBottomVisible = useIsElementVisible(endOfContentRef);
|
|
3352
|
+
const isBottomVisible = useIsElementVisible(endOfContentRef, scrollElement);
|
|
3235
3353
|
(0, import_react9.useEffect)(() => {
|
|
3236
3354
|
const shouldAutoLoad = isBottomVisible && status.type === "idle" && state.afterSectionsProps.length === 0;
|
|
3237
3355
|
if (shouldAutoLoad && status.loadMore) {
|
|
@@ -3263,51 +3381,90 @@ var ContentComponent = (props) => {
|
|
|
3263
3381
|
var _a, _b;
|
|
3264
3382
|
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
3265
3383
|
});
|
|
3266
|
-
|
|
3267
|
-
count: stateCount,
|
|
3268
|
-
estimateSize: () => 120,
|
|
3269
|
-
overscan: 10,
|
|
3270
|
-
// eslint-disable-next-line react-hooks/refs
|
|
3271
|
-
scrollMargin: listOffsetRef.current
|
|
3272
|
-
});
|
|
3273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref: listRef, children: [
|
|
3384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: contentRef, children: [
|
|
3274
3385
|
state.beforeSections,
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3276
|
-
|
|
3386
|
+
scrollElement ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3387
|
+
ElementVirtualizedItems,
|
|
3277
3388
|
{
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
ref: virtualizer.measureElement,
|
|
3292
|
-
"data-index": item.index,
|
|
3293
|
-
style: {
|
|
3294
|
-
position: "absolute",
|
|
3295
|
-
top: 0,
|
|
3296
|
-
left: 0,
|
|
3297
|
-
width: "100%",
|
|
3298
|
-
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3299
|
-
},
|
|
3300
|
-
children: i.type === "header" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Item, __spreadValues({}, i.item))
|
|
3301
|
-
},
|
|
3302
|
-
item.key
|
|
3303
|
-
);
|
|
3304
|
-
})
|
|
3389
|
+
Item,
|
|
3390
|
+
SectionHeader,
|
|
3391
|
+
items,
|
|
3392
|
+
scrollElement,
|
|
3393
|
+
stateCount
|
|
3394
|
+
}
|
|
3395
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3396
|
+
WindowVirtualizedItems,
|
|
3397
|
+
{
|
|
3398
|
+
Item,
|
|
3399
|
+
SectionHeader,
|
|
3400
|
+
items,
|
|
3401
|
+
stateCount
|
|
3305
3402
|
}
|
|
3306
3403
|
),
|
|
3307
|
-
/* @__PURE__ */ (0,
|
|
3404
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PaginationComponent, { status, state }) }),
|
|
3308
3405
|
state.afterSections
|
|
3309
3406
|
] });
|
|
3310
3407
|
};
|
|
3408
|
+
var WindowVirtualizedItems = (props) => {
|
|
3409
|
+
const { stateCount } = props;
|
|
3410
|
+
const virtualItemsRef = (0, import_react9.useRef)(null);
|
|
3411
|
+
const virtualizer = useWindowVirtualizer({
|
|
3412
|
+
count: stateCount,
|
|
3413
|
+
estimateSize: () => 120,
|
|
3414
|
+
overscan: 10
|
|
3415
|
+
});
|
|
3416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3417
|
+
};
|
|
3418
|
+
var ElementVirtualizedItems = (props) => {
|
|
3419
|
+
const { scrollElement, stateCount } = props;
|
|
3420
|
+
const virtualItemsRef = (0, import_react9.useRef)(null);
|
|
3421
|
+
const virtualizer = useVirtualizer({
|
|
3422
|
+
count: stateCount,
|
|
3423
|
+
getScrollElement: () => scrollElement,
|
|
3424
|
+
estimateSize: () => 120,
|
|
3425
|
+
overscan: 10
|
|
3426
|
+
});
|
|
3427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3428
|
+
};
|
|
3429
|
+
var VirtualizedItems = ({
|
|
3430
|
+
Item,
|
|
3431
|
+
SectionHeader,
|
|
3432
|
+
items,
|
|
3433
|
+
virtualItemsRef,
|
|
3434
|
+
virtualizer
|
|
3435
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3436
|
+
"div",
|
|
3437
|
+
{
|
|
3438
|
+
ref: virtualItemsRef,
|
|
3439
|
+
style: {
|
|
3440
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
3441
|
+
width: "100%",
|
|
3442
|
+
position: "relative"
|
|
3443
|
+
},
|
|
3444
|
+
children: virtualizer.getVirtualItems().map((item) => {
|
|
3445
|
+
const i = items[item.index];
|
|
3446
|
+
if (!i) {
|
|
3447
|
+
return null;
|
|
3448
|
+
}
|
|
3449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3450
|
+
"div",
|
|
3451
|
+
{
|
|
3452
|
+
ref: virtualizer.measureElement,
|
|
3453
|
+
"data-index": item.index,
|
|
3454
|
+
style: {
|
|
3455
|
+
position: "absolute",
|
|
3456
|
+
top: 0,
|
|
3457
|
+
left: 0,
|
|
3458
|
+
width: "100%",
|
|
3459
|
+
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3460
|
+
},
|
|
3461
|
+
children: i.type === "header" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Item, __spreadValues({}, i.item))
|
|
3462
|
+
},
|
|
3463
|
+
item.key
|
|
3464
|
+
);
|
|
3465
|
+
})
|
|
3466
|
+
}
|
|
3467
|
+
);
|
|
3311
3468
|
var PaginationComponent = ({
|
|
3312
3469
|
status,
|
|
3313
3470
|
state
|
|
@@ -3319,26 +3476,26 @@ var PaginationComponent = ({
|
|
|
3319
3476
|
return null;
|
|
3320
3477
|
}
|
|
3321
3478
|
if (isPaginationError) {
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadMoreButton, { onClick: status.retry });
|
|
3323
3480
|
}
|
|
3324
3481
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
3325
|
-
return /* @__PURE__ */ (0,
|
|
3482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadMoreButton, { onClick: loadMore });
|
|
3326
3483
|
}
|
|
3327
|
-
return /* @__PURE__ */ (0,
|
|
3484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components16.ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
3328
3485
|
};
|
|
3329
3486
|
var LoadMoreButton = ({ onClick }) => {
|
|
3330
3487
|
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
3331
|
-
return /* @__PURE__ */ (0,
|
|
3488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components16.Button, { v2: true, size: "sm", priority: "secondary-neutral", onClick, children: formatMessage(collection_messages_default.loadMoreButton) }) });
|
|
3332
3489
|
};
|
|
3333
3490
|
|
|
3334
3491
|
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
3335
|
-
var
|
|
3336
|
-
var
|
|
3492
|
+
var import_components17 = require("@transferwise/components");
|
|
3493
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3337
3494
|
var FiltersComponent = ({ state }) => {
|
|
3338
3495
|
const { filters } = state;
|
|
3339
|
-
return /* @__PURE__ */ (0,
|
|
3496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
3340
3497
|
var _a;
|
|
3341
|
-
return /* @__PURE__ */ (0,
|
|
3498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
3342
3499
|
}) });
|
|
3343
3500
|
};
|
|
3344
3501
|
var FilterComponent = (filter) => {
|
|
@@ -3346,8 +3503,8 @@ var FilterComponent = (filter) => {
|
|
|
3346
3503
|
if (!options) {
|
|
3347
3504
|
return null;
|
|
3348
3505
|
}
|
|
3349
|
-
return /* @__PURE__ */ (0,
|
|
3350
|
-
|
|
3506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3507
|
+
import_components17.Chips,
|
|
3351
3508
|
{
|
|
3352
3509
|
className: "m-b-1",
|
|
3353
3510
|
multiple: multiSelect,
|
|
@@ -3372,11 +3529,11 @@ var FilterComponent = (filter) => {
|
|
|
3372
3529
|
};
|
|
3373
3530
|
|
|
3374
3531
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3375
|
-
var
|
|
3532
|
+
var import_components20 = require("@transferwise/components");
|
|
3376
3533
|
|
|
3377
3534
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
3378
|
-
var
|
|
3379
|
-
var
|
|
3535
|
+
var import_components18 = require("@transferwise/components");
|
|
3536
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3380
3537
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3381
3538
|
var _a, _b;
|
|
3382
3539
|
if (!additionalInfo) {
|
|
@@ -3384,8 +3541,8 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3384
3541
|
}
|
|
3385
3542
|
const { href, text, onClick } = additionalInfo;
|
|
3386
3543
|
if (href || onClick) {
|
|
3387
|
-
return /* @__PURE__ */ (0,
|
|
3388
|
-
|
|
3544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3545
|
+
import_components18.ListItem.AdditionalInfo,
|
|
3389
3546
|
{
|
|
3390
3547
|
action: __spreadValues({
|
|
3391
3548
|
label: text
|
|
@@ -3393,20 +3550,20 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3393
3550
|
}
|
|
3394
3551
|
);
|
|
3395
3552
|
}
|
|
3396
|
-
return /* @__PURE__ */ (0,
|
|
3553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components18.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3397
3554
|
};
|
|
3398
3555
|
|
|
3399
3556
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3400
|
-
var
|
|
3401
|
-
var
|
|
3557
|
+
var import_components19 = require("@transferwise/components");
|
|
3558
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3402
3559
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3403
3560
|
if (!callToAction) {
|
|
3404
3561
|
return void 0;
|
|
3405
3562
|
}
|
|
3406
3563
|
const { accessibilityDescription, title, context } = callToAction;
|
|
3407
3564
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
3408
|
-
return /* @__PURE__ */ (0,
|
|
3409
|
-
|
|
3565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3566
|
+
import_components19.ListItem.Button,
|
|
3410
3567
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
3411
3568
|
partiallyInteractive: !fullyInteractive,
|
|
3412
3569
|
priority,
|
|
@@ -3430,7 +3587,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
3430
3587
|
};
|
|
3431
3588
|
|
|
3432
3589
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3433
|
-
var
|
|
3590
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3434
3591
|
var ItemComponent = (props) => {
|
|
3435
3592
|
var _a, _b;
|
|
3436
3593
|
const {
|
|
@@ -3452,8 +3609,8 @@ var ItemComponent = (props) => {
|
|
|
3452
3609
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
3453
3610
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3454
3611
|
};
|
|
3455
|
-
return /* @__PURE__ */ (0,
|
|
3456
|
-
|
|
3612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3613
|
+
import_components20.ListItem,
|
|
3457
3614
|
{
|
|
3458
3615
|
title,
|
|
3459
3616
|
subtitle: description,
|
|
@@ -3469,19 +3626,19 @@ var ItemComponent = (props) => {
|
|
|
3469
3626
|
};
|
|
3470
3627
|
var getNavigationControl = (onClick, href) => {
|
|
3471
3628
|
if (href) {
|
|
3472
|
-
return /* @__PURE__ */ (0,
|
|
3629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ListItem.Navigation, { href });
|
|
3473
3630
|
}
|
|
3474
3631
|
if (onClick) {
|
|
3475
|
-
return /* @__PURE__ */ (0,
|
|
3632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ListItem.Navigation, { onClick });
|
|
3476
3633
|
}
|
|
3477
3634
|
return null;
|
|
3478
3635
|
};
|
|
3479
3636
|
|
|
3480
3637
|
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
3481
|
-
var
|
|
3638
|
+
var import_components21 = require("@transferwise/components");
|
|
3482
3639
|
var import_icons = require("@transferwise/icons");
|
|
3483
3640
|
var import_react_intl10 = require("react-intl");
|
|
3484
|
-
var
|
|
3641
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3485
3642
|
var SearchComponent = ({
|
|
3486
3643
|
state,
|
|
3487
3644
|
status,
|
|
@@ -3497,13 +3654,13 @@ var SearchComponent = ({
|
|
|
3497
3654
|
const getAddon = () => {
|
|
3498
3655
|
var _a;
|
|
3499
3656
|
if (status.type === "loading") {
|
|
3500
|
-
return { content: /* @__PURE__ */ (0,
|
|
3657
|
+
return { content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.ProcessIndicator, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3501
3658
|
}
|
|
3502
3659
|
if ((_a = state.search) == null ? void 0 : _a.query) {
|
|
3503
3660
|
return {
|
|
3504
3661
|
interactive: true,
|
|
3505
|
-
content: /* @__PURE__ */ (0,
|
|
3506
|
-
|
|
3662
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3663
|
+
import_components21.IconButton,
|
|
3507
3664
|
{
|
|
3508
3665
|
priority: "minimal",
|
|
3509
3666
|
size: 24,
|
|
@@ -3512,14 +3669,14 @@ var SearchComponent = ({
|
|
|
3512
3669
|
var _a2;
|
|
3513
3670
|
return (_a2 = state.search) == null ? void 0 : _a2.onChange("");
|
|
3514
3671
|
},
|
|
3515
|
-
children: /* @__PURE__ */ (0,
|
|
3672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons.CrossCircleFill, {})
|
|
3516
3673
|
}
|
|
3517
3674
|
)
|
|
3518
3675
|
};
|
|
3519
3676
|
}
|
|
3520
3677
|
return void 0;
|
|
3521
3678
|
};
|
|
3522
|
-
return /* @__PURE__ */ (0,
|
|
3679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3523
3680
|
FieldInput_default,
|
|
3524
3681
|
{
|
|
3525
3682
|
id: "search",
|
|
@@ -3530,8 +3687,8 @@ var SearchComponent = ({
|
|
|
3530
3687
|
features,
|
|
3531
3688
|
control,
|
|
3532
3689
|
tags,
|
|
3533
|
-
children: /* @__PURE__ */ (0,
|
|
3534
|
-
|
|
3690
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons.Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3691
|
+
import_components21.Input,
|
|
3535
3692
|
{
|
|
3536
3693
|
id: "search",
|
|
3537
3694
|
name: "search",
|
|
@@ -3549,14 +3706,14 @@ var SearchComponent = ({
|
|
|
3549
3706
|
};
|
|
3550
3707
|
|
|
3551
3708
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
3552
|
-
var
|
|
3709
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3553
3710
|
var SectionHeaderComponent = ({
|
|
3554
3711
|
title,
|
|
3555
3712
|
callToAction
|
|
3556
|
-
}) => /* @__PURE__ */ (0,
|
|
3713
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Header, { title, callToAction });
|
|
3557
3714
|
|
|
3558
3715
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
3559
|
-
var
|
|
3716
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3560
3717
|
var createCollectionRenderer = (canRender, components) => {
|
|
3561
3718
|
const componentsWithDefaults = __spreadValues({
|
|
3562
3719
|
Search: SearchComponent,
|
|
@@ -3570,35 +3727,35 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
3570
3727
|
canRenderType: "collection",
|
|
3571
3728
|
canRender,
|
|
3572
3729
|
render: (props) => {
|
|
3573
|
-
return /* @__PURE__ */ (0,
|
|
3730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
3574
3731
|
}
|
|
3575
3732
|
};
|
|
3576
3733
|
};
|
|
3577
3734
|
|
|
3578
3735
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
3579
3736
|
var import_react_intl11 = require("react-intl");
|
|
3580
|
-
var
|
|
3737
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3581
3738
|
var CollectionRendererComponent = (props) => {
|
|
3582
3739
|
const { status, Search: Search4, Filters, Results } = props;
|
|
3583
|
-
return /* @__PURE__ */ (0,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3585
|
-
/* @__PURE__ */ (0,
|
|
3586
|
-
status.type === "error" && status.reason === "search" ? /* @__PURE__ */ (0,
|
|
3740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3741
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Search4, __spreadValues({}, props)),
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Filters, __spreadValues({}, props)),
|
|
3743
|
+
status.type === "error" && status.reason === "search" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SearchError, { retry: status.retry }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Results, __spreadValues({}, props))
|
|
3587
3744
|
] });
|
|
3588
3745
|
};
|
|
3589
3746
|
var SearchError = ({ retry }) => {
|
|
3590
3747
|
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
3591
|
-
return /* @__PURE__ */ (0,
|
|
3748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_components22.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
3592
3749
|
formatMessage(generic_error_messages_default.genericError),
|
|
3593
3750
|
"\xA0",
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components22.Link, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
3595
3752
|
] });
|
|
3596
3753
|
};
|
|
3597
3754
|
var CollectionRenderer = createCollectionRenderer(() => true);
|
|
3598
3755
|
var CollectionRenderer_default = CollectionRenderer;
|
|
3599
3756
|
|
|
3600
3757
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3601
|
-
var
|
|
3758
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
3602
3759
|
|
|
3603
3760
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
3604
3761
|
var import_react10 = require("react");
|
|
@@ -3621,7 +3778,7 @@ var useIsCollapsed = () => {
|
|
|
3621
3778
|
};
|
|
3622
3779
|
|
|
3623
3780
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3624
|
-
var
|
|
3781
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3625
3782
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
3626
3783
|
var ColumnsRenderer = {
|
|
3627
3784
|
canRenderType: "columns",
|
|
@@ -3632,12 +3789,12 @@ function ColumnsRendererComponent(props) {
|
|
|
3632
3789
|
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3633
3790
|
const isCollapsed = useIsCollapsed();
|
|
3634
3791
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
3635
|
-
const startColumn = /* @__PURE__ */ (0,
|
|
3636
|
-
const endColumn = /* @__PURE__ */ (0,
|
|
3637
|
-
return /* @__PURE__ */ (0,
|
|
3792
|
+
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
3793
|
+
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
3794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3638
3795
|
"div",
|
|
3639
3796
|
{
|
|
3640
|
-
className: (0,
|
|
3797
|
+
className: (0, import_classnames11.default)(
|
|
3641
3798
|
"df-columns-renderer-container",
|
|
3642
3799
|
getMargin(margin),
|
|
3643
3800
|
{
|
|
@@ -3656,7 +3813,7 @@ function ColumnsRendererComponent(props) {
|
|
|
3656
3813
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
3657
3814
|
|
|
3658
3815
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
3659
|
-
var
|
|
3816
|
+
var import_components23 = require("@transferwise/components");
|
|
3660
3817
|
|
|
3661
3818
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3662
3819
|
var import_react11 = require("react");
|
|
@@ -3756,7 +3913,7 @@ var matchesDateRule = (date, weekday, rule) => {
|
|
|
3756
3913
|
var isDate = (date) => date !== null;
|
|
3757
3914
|
|
|
3758
3915
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
3759
|
-
var
|
|
3916
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3760
3917
|
function VariableDateInput({
|
|
3761
3918
|
control,
|
|
3762
3919
|
inputProps
|
|
@@ -3774,8 +3931,8 @@ function VariableDateInput({
|
|
|
3774
3931
|
} = inputProps;
|
|
3775
3932
|
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
3776
3933
|
if (control === "date-lookup") {
|
|
3777
|
-
return /* @__PURE__ */ (0,
|
|
3778
|
-
|
|
3934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3935
|
+
import_components23.DateLookup,
|
|
3779
3936
|
{
|
|
3780
3937
|
value: dateStringToDateOrNull(inputProps.value),
|
|
3781
3938
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -3795,8 +3952,8 @@ function VariableDateInput({
|
|
|
3795
3952
|
}
|
|
3796
3953
|
);
|
|
3797
3954
|
}
|
|
3798
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
-
|
|
3955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3956
|
+
import_components23.DateInput,
|
|
3800
3957
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
3801
3958
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
3802
3959
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -3812,7 +3969,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
3812
3969
|
var VariableDateInput_default = VariableDateInput;
|
|
3813
3970
|
|
|
3814
3971
|
// ../renderers/src/DateInputRenderer.tsx
|
|
3815
|
-
var
|
|
3972
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3816
3973
|
var DateInputRenderer = {
|
|
3817
3974
|
canRenderType: "input-date",
|
|
3818
3975
|
render: (props) => {
|
|
@@ -3837,7 +3994,7 @@ var DateInputRenderer = {
|
|
|
3837
3994
|
]);
|
|
3838
3995
|
const value = initialValue != null ? initialValue : "";
|
|
3839
3996
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
3840
|
-
return /* @__PURE__ */ (0,
|
|
3997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3841
3998
|
FieldInput_default,
|
|
3842
3999
|
{
|
|
3843
4000
|
id,
|
|
@@ -3850,7 +4007,7 @@ var DateInputRenderer = {
|
|
|
3850
4007
|
features: props.features,
|
|
3851
4008
|
control,
|
|
3852
4009
|
tags: props.tags,
|
|
3853
|
-
children: /* @__PURE__ */ (0,
|
|
4010
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(VariableDateInput_default, { control, inputProps })
|
|
3854
4011
|
}
|
|
3855
4012
|
);
|
|
3856
4013
|
}
|
|
@@ -3858,10 +4015,10 @@ var DateInputRenderer = {
|
|
|
3858
4015
|
var DateInputRenderer_default = DateInputRenderer;
|
|
3859
4016
|
|
|
3860
4017
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
3861
|
-
var
|
|
4018
|
+
var import_components26 = require("@transferwise/components");
|
|
3862
4019
|
|
|
3863
4020
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3864
|
-
var
|
|
4021
|
+
var import_components25 = require("@transferwise/components");
|
|
3865
4022
|
var import_react12 = require("react");
|
|
3866
4023
|
var import_react_intl17 = require("react-intl");
|
|
3867
4024
|
|
|
@@ -3933,7 +4090,7 @@ function filterAndSortItems(options, query) {
|
|
|
3933
4090
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
3934
4091
|
|
|
3935
4092
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3936
|
-
var
|
|
4093
|
+
var import_components24 = require("@transferwise/components");
|
|
3937
4094
|
var import_react_intl16 = require("react-intl");
|
|
3938
4095
|
|
|
3939
4096
|
// ../renderers/src/messages/group.messages.ts
|
|
@@ -3972,7 +4129,7 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
3972
4129
|
};
|
|
3973
4130
|
|
|
3974
4131
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3975
|
-
var
|
|
4132
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3976
4133
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3977
4134
|
var isGroupedDecision = (options) => {
|
|
3978
4135
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
@@ -3982,9 +4139,9 @@ var GroupedDecisionList = (_a) => {
|
|
|
3982
4139
|
const { formatMessage } = (0, import_react_intl16.useIntl)();
|
|
3983
4140
|
const { options } = rest;
|
|
3984
4141
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
3985
|
-
return /* @__PURE__ */ (0,
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
3987
|
-
|
|
4142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_components24.Section, { children: [
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4144
|
+
import_components24.Header,
|
|
3988
4145
|
{
|
|
3989
4146
|
as: "h2",
|
|
3990
4147
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -3995,18 +4152,18 @@ var GroupedDecisionList = (_a) => {
|
|
|
3995
4152
|
};
|
|
3996
4153
|
|
|
3997
4154
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3998
|
-
var
|
|
3999
|
-
var
|
|
4155
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
4156
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4000
4157
|
var DecisionWrapper = (props) => {
|
|
4001
4158
|
const { margin, control, title, tags } = props;
|
|
4002
|
-
return /* @__PURE__ */ (0,
|
|
4003
|
-
title && /* @__PURE__ */ (0,
|
|
4004
|
-
control === "filtered" ? /* @__PURE__ */ (0,
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: (0, import_classnames12.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4160
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components25.Header, { as: "h2", title }),
|
|
4161
|
+
control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
4005
4162
|
] });
|
|
4006
4163
|
};
|
|
4007
4164
|
var UnfilteredDecisionList = (_a) => {
|
|
4008
4165
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4009
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
4166
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
4010
4167
|
};
|
|
4011
4168
|
var FilteredDecisionList = (props) => {
|
|
4012
4169
|
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
@@ -4014,9 +4171,9 @@ var FilteredDecisionList = (props) => {
|
|
|
4014
4171
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
4015
4172
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
4016
4173
|
const isGrouped = isGroupedDecision(options);
|
|
4017
|
-
return /* @__PURE__ */ (0,
|
|
4018
|
-
/* @__PURE__ */ (0,
|
|
4019
|
-
|
|
4174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4176
|
+
import_components25.SearchInput,
|
|
4020
4177
|
{
|
|
4021
4178
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
4022
4179
|
value: query,
|
|
@@ -4027,25 +4184,25 @@ var FilteredDecisionList = (props) => {
|
|
|
4027
4184
|
}
|
|
4028
4185
|
}
|
|
4029
4186
|
),
|
|
4030
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
4031
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
4187
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
4188
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components25.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
4032
4189
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
4033
4190
|
control,
|
|
4034
4191
|
className: query.length === 0 ? "m-t-3" : "",
|
|
4035
4192
|
options: filteredOptions
|
|
4036
|
-
}) : /* @__PURE__ */ (0,
|
|
4193
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
4037
4194
|
] })
|
|
4038
4195
|
] });
|
|
4039
4196
|
};
|
|
4040
4197
|
|
|
4041
4198
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4042
|
-
var
|
|
4199
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4043
4200
|
var DecisionRenderer = {
|
|
4044
4201
|
canRenderType: "decision",
|
|
4045
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4202
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
4046
4203
|
};
|
|
4047
4204
|
var renderDecisionList = ({ options, control }) => {
|
|
4048
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: options.map((_a) => {
|
|
4049
4206
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
4050
4207
|
const {
|
|
4051
4208
|
description,
|
|
@@ -4058,8 +4215,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4058
4215
|
supportingValues,
|
|
4059
4216
|
tags
|
|
4060
4217
|
} = rest;
|
|
4061
|
-
return /* @__PURE__ */ (0,
|
|
4062
|
-
|
|
4218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4219
|
+
import_components26.ListItem,
|
|
4063
4220
|
{
|
|
4064
4221
|
title: itemTitle,
|
|
4065
4222
|
subtitle: description,
|
|
@@ -4070,7 +4227,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4070
4227
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
4071
4228
|
prompt: getInlineAlert(inlineAlert),
|
|
4072
4229
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
4073
|
-
control: /* @__PURE__ */ (0,
|
|
4230
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components26.ListItem.Navigation, __spreadValues({}, getAnchorProps()))
|
|
4074
4231
|
},
|
|
4075
4232
|
JSON.stringify(rest)
|
|
4076
4233
|
);
|
|
@@ -4079,9 +4236,9 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4079
4236
|
var DecisionRenderer_default = DecisionRenderer;
|
|
4080
4237
|
|
|
4081
4238
|
// ../renderers/src/DividerRenderer.tsx
|
|
4082
|
-
var
|
|
4083
|
-
var
|
|
4084
|
-
var
|
|
4239
|
+
var import_components27 = require("@transferwise/components");
|
|
4240
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
4241
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4085
4242
|
var mapControlToLevel = (control) => {
|
|
4086
4243
|
switch (control) {
|
|
4087
4244
|
case "section":
|
|
@@ -4094,10 +4251,10 @@ var mapControlToLevel = (control) => {
|
|
|
4094
4251
|
};
|
|
4095
4252
|
var DividerRenderer = {
|
|
4096
4253
|
canRenderType: "divider",
|
|
4097
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4098
|
-
|
|
4254
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4255
|
+
import_components27.Divider,
|
|
4099
4256
|
{
|
|
4100
|
-
className: (0,
|
|
4257
|
+
className: (0, import_classnames13.default)(
|
|
4101
4258
|
"m-t-0",
|
|
4102
4259
|
"d-block",
|
|
4103
4260
|
getMargin(margin),
|
|
@@ -4110,7 +4267,7 @@ var DividerRenderer = {
|
|
|
4110
4267
|
var DividerRenderer_default = DividerRenderer;
|
|
4111
4268
|
|
|
4112
4269
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4113
|
-
var
|
|
4270
|
+
var import_components28 = require("@transferwise/components");
|
|
4114
4271
|
|
|
4115
4272
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
4116
4273
|
var import_react_intl18 = require("react-intl");
|
|
@@ -4140,7 +4297,7 @@ var external_confirmation_messages_default = (0, import_react_intl18.defineMessa
|
|
|
4140
4297
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4141
4298
|
var import_react_intl19 = require("react-intl");
|
|
4142
4299
|
var import_react13 = require("react");
|
|
4143
|
-
var
|
|
4300
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4144
4301
|
var ExternalConfirmationRenderer = {
|
|
4145
4302
|
canRenderType: "external-confirmation",
|
|
4146
4303
|
render: ExternalConfirmationRendererComponent
|
|
@@ -4157,16 +4314,16 @@ function ExternalConfirmationRendererComponent({
|
|
|
4157
4314
|
(0, import_react13.useEffect)(() => {
|
|
4158
4315
|
open();
|
|
4159
4316
|
}, []);
|
|
4160
|
-
return /* @__PURE__ */ (0,
|
|
4161
|
-
|
|
4317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4318
|
+
import_components28.Modal,
|
|
4162
4319
|
{
|
|
4163
4320
|
open: visible,
|
|
4164
4321
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
4165
|
-
body: /* @__PURE__ */ (0,
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4167
|
-
/* @__PURE__ */ (0,
|
|
4168
|
-
/* @__PURE__ */ (0,
|
|
4169
|
-
|
|
4322
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components28.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4326
|
+
import_components28.Button,
|
|
4170
4327
|
{
|
|
4171
4328
|
v2: true,
|
|
4172
4329
|
block: true,
|
|
@@ -4179,7 +4336,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
4179
4336
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
4180
4337
|
}
|
|
4181
4338
|
),
|
|
4182
|
-
/* @__PURE__ */ (0,
|
|
4339
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components28.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
4183
4340
|
] }) })
|
|
4184
4341
|
] }),
|
|
4185
4342
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -4197,51 +4354,51 @@ function getOrigin(url) {
|
|
|
4197
4354
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
4198
4355
|
|
|
4199
4356
|
// ../renderers/src/FormRenderer.tsx
|
|
4200
|
-
var
|
|
4201
|
-
var
|
|
4357
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4358
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4202
4359
|
var FormRenderer = {
|
|
4203
4360
|
canRenderType: "form",
|
|
4204
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4361
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: (0, import_classnames14.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
4205
4362
|
};
|
|
4206
4363
|
var FormRenderer_default = FormRenderer;
|
|
4207
4364
|
|
|
4208
4365
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
4209
|
-
var
|
|
4210
|
-
var
|
|
4366
|
+
var import_components29 = require("@transferwise/components");
|
|
4367
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4211
4368
|
var FormSectionRenderer = {
|
|
4212
4369
|
canRenderType: "form-section",
|
|
4213
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0,
|
|
4214
|
-
title && /* @__PURE__ */ (0,
|
|
4215
|
-
|
|
4370
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4371
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4372
|
+
import_components29.Header,
|
|
4216
4373
|
{
|
|
4217
4374
|
as: "h2",
|
|
4218
4375
|
title
|
|
4219
4376
|
}
|
|
4220
4377
|
),
|
|
4221
|
-
description && /* @__PURE__ */ (0,
|
|
4378
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { children: description }),
|
|
4222
4379
|
children
|
|
4223
4380
|
] })
|
|
4224
4381
|
};
|
|
4225
4382
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
4226
4383
|
|
|
4227
4384
|
// ../renderers/src/HeadingRenderer.tsx
|
|
4228
|
-
var
|
|
4229
|
-
var
|
|
4230
|
-
var
|
|
4385
|
+
var import_components30 = require("@transferwise/components");
|
|
4386
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4387
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4231
4388
|
var HeadingRenderer = {
|
|
4232
4389
|
canRenderType: "heading",
|
|
4233
4390
|
render: Heading
|
|
4234
4391
|
};
|
|
4235
4392
|
function Heading(props) {
|
|
4236
4393
|
const { text, size, align, margin, control } = props;
|
|
4237
|
-
const className = (0,
|
|
4394
|
+
const className = (0, import_classnames15.default)(
|
|
4238
4395
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4239
4396
|
controlAndTagsToCSSClass(props)
|
|
4240
4397
|
);
|
|
4241
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
4398
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(StandardHeading, { size, text, className });
|
|
4242
4399
|
}
|
|
4243
4400
|
function DisplayHeading({ size, text, className }) {
|
|
4244
|
-
return /* @__PURE__ */ (0,
|
|
4401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components30.Display, { type: getDisplayType(size), className, children: text });
|
|
4245
4402
|
}
|
|
4246
4403
|
var getDisplayType = (size) => {
|
|
4247
4404
|
switch (size) {
|
|
@@ -4257,7 +4414,7 @@ var getDisplayType = (size) => {
|
|
|
4257
4414
|
}
|
|
4258
4415
|
};
|
|
4259
4416
|
function StandardHeading({ size, text, className }) {
|
|
4260
|
-
return /* @__PURE__ */ (0,
|
|
4417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components30.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
4261
4418
|
}
|
|
4262
4419
|
var getTitleTypeBySize = (size) => {
|
|
4263
4420
|
var _a;
|
|
@@ -4273,8 +4430,8 @@ var getTitleTypeBySize = (size) => {
|
|
|
4273
4430
|
var HeadingRenderer_default = HeadingRenderer;
|
|
4274
4431
|
|
|
4275
4432
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4276
|
-
var
|
|
4277
|
-
var
|
|
4433
|
+
var import_components31 = require("@transferwise/components");
|
|
4434
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4278
4435
|
var import_react14 = require("react");
|
|
4279
4436
|
|
|
4280
4437
|
// ../renderers/src/utils/api-utils.ts
|
|
@@ -4285,7 +4442,7 @@ function isRelativePath(url = "") {
|
|
|
4285
4442
|
}
|
|
4286
4443
|
|
|
4287
4444
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4288
|
-
var
|
|
4445
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4289
4446
|
function UrlImage({
|
|
4290
4447
|
accessibilityDescription,
|
|
4291
4448
|
align,
|
|
@@ -4302,18 +4459,18 @@ function UrlImage({
|
|
|
4302
4459
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
4303
4460
|
}
|
|
4304
4461
|
}, [uri, httpClient]);
|
|
4305
|
-
return /* @__PURE__ */ (0,
|
|
4462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4306
4463
|
"div",
|
|
4307
4464
|
{
|
|
4308
|
-
className: (0,
|
|
4465
|
+
className: (0, import_classnames16.default)(
|
|
4309
4466
|
"df-image",
|
|
4310
4467
|
align,
|
|
4311
4468
|
size || "md",
|
|
4312
4469
|
getMargin(margin),
|
|
4313
4470
|
controlAndTagsToCSSClass({ control, tags })
|
|
4314
4471
|
),
|
|
4315
|
-
children: /* @__PURE__ */ (0,
|
|
4316
|
-
|
|
4472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4473
|
+
import_components31.Image,
|
|
4317
4474
|
{
|
|
4318
4475
|
className: "df-reserve-space",
|
|
4319
4476
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -4358,19 +4515,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4358
4515
|
};
|
|
4359
4516
|
|
|
4360
4517
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
4361
|
-
var
|
|
4518
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4362
4519
|
var ImageRenderer = {
|
|
4363
4520
|
canRenderType: "image",
|
|
4364
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
4521
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(UrlImage, __spreadValues({}, props))
|
|
4365
4522
|
};
|
|
4366
4523
|
|
|
4367
4524
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
4368
4525
|
var ImageRenderer_default = ImageRenderer;
|
|
4369
4526
|
|
|
4370
4527
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
4371
|
-
var
|
|
4372
|
-
var
|
|
4373
|
-
var
|
|
4528
|
+
var import_components32 = require("@transferwise/components");
|
|
4529
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
4530
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4374
4531
|
var doContext = ["positive", "neutral", "proposition"];
|
|
4375
4532
|
var dontContext = ["warning", "negative"];
|
|
4376
4533
|
var InstructionsRenderer = {
|
|
@@ -4378,16 +4535,16 @@ var InstructionsRenderer = {
|
|
|
4378
4535
|
render: ({ items, margin, title, control, tags }) => {
|
|
4379
4536
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
4380
4537
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
4381
|
-
return /* @__PURE__ */ (0,
|
|
4382
|
-
title ? /* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: (0, import_classnames17.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4539
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components32.Header, { title }) : null,
|
|
4540
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components32.InstructionsList, { dos, donts })
|
|
4384
4541
|
] });
|
|
4385
4542
|
}
|
|
4386
4543
|
};
|
|
4387
4544
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
4388
4545
|
|
|
4389
4546
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4390
|
-
var
|
|
4547
|
+
var import_components33 = require("@transferwise/components");
|
|
4391
4548
|
|
|
4392
4549
|
// ../renderers/src/utils/input-utils.ts
|
|
4393
4550
|
var onWheel = (event) => {
|
|
@@ -4412,7 +4569,7 @@ function pick(obj, ...keys) {
|
|
|
4412
4569
|
}
|
|
4413
4570
|
|
|
4414
4571
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4415
|
-
var
|
|
4572
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4416
4573
|
var IntegerInputRenderer = {
|
|
4417
4574
|
canRenderType: "input-integer",
|
|
4418
4575
|
render: (props) => {
|
|
@@ -4427,7 +4584,7 @@ var IntegerInputRenderer = {
|
|
|
4427
4584
|
"maximum",
|
|
4428
4585
|
"minimum"
|
|
4429
4586
|
);
|
|
4430
|
-
return /* @__PURE__ */ (0,
|
|
4587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4431
4588
|
FieldInput_default,
|
|
4432
4589
|
{
|
|
4433
4590
|
id,
|
|
@@ -4440,8 +4597,8 @@ var IntegerInputRenderer = {
|
|
|
4440
4597
|
features: props.features,
|
|
4441
4598
|
control: props.control,
|
|
4442
4599
|
tags: props.tags,
|
|
4443
|
-
children: /* @__PURE__ */ (0,
|
|
4444
|
-
|
|
4600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components33.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4601
|
+
import_components33.Input,
|
|
4445
4602
|
__spreadValues({
|
|
4446
4603
|
id,
|
|
4447
4604
|
name: id,
|
|
@@ -4463,13 +4620,13 @@ var IntegerInputRenderer = {
|
|
|
4463
4620
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
4464
4621
|
|
|
4465
4622
|
// ../renderers/src/ListRenderer.tsx
|
|
4466
|
-
var
|
|
4467
|
-
var
|
|
4623
|
+
var import_components35 = require("@transferwise/components");
|
|
4624
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4468
4625
|
|
|
4469
4626
|
// ../renderers/src/components/Header.tsx
|
|
4470
|
-
var
|
|
4471
|
-
var
|
|
4472
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0,
|
|
4627
|
+
var import_components34 = require("@transferwise/components");
|
|
4628
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4629
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components34.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
4473
4630
|
var getHeaderAction = (callToAction) => {
|
|
4474
4631
|
if (!callToAction) {
|
|
4475
4632
|
return void 0;
|
|
@@ -4481,11 +4638,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
4481
4638
|
};
|
|
4482
4639
|
|
|
4483
4640
|
// ../renderers/src/ListRenderer.tsx
|
|
4484
|
-
var
|
|
4641
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4485
4642
|
var ListRenderer = {
|
|
4486
4643
|
canRenderType: "list",
|
|
4487
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
4488
|
-
/* @__PURE__ */ (0,
|
|
4644
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: (0, import_classnames18.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4645
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Header, { title, callToAction }),
|
|
4489
4646
|
items.map((item) => {
|
|
4490
4647
|
var _a, _b;
|
|
4491
4648
|
const {
|
|
@@ -4502,8 +4659,8 @@ var ListRenderer = {
|
|
|
4502
4659
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4503
4660
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4504
4661
|
};
|
|
4505
|
-
return /* @__PURE__ */ (0,
|
|
4506
|
-
|
|
4662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4663
|
+
import_components35.ListItem,
|
|
4507
4664
|
{
|
|
4508
4665
|
title: itemTitle,
|
|
4509
4666
|
subtitle: description,
|
|
@@ -4522,17 +4679,17 @@ var ListRenderer = {
|
|
|
4522
4679
|
var ListRenderer_default = ListRenderer;
|
|
4523
4680
|
|
|
4524
4681
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
4525
|
-
var
|
|
4526
|
-
var
|
|
4527
|
-
var
|
|
4528
|
-
var LoadingIndicatorRenderer = {
|
|
4682
|
+
var import_components36 = require("@transferwise/components");
|
|
4683
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4684
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4685
|
+
var LoadingIndicatorRenderer = {
|
|
4529
4686
|
canRenderType: "loading-indicator",
|
|
4530
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4531
|
-
|
|
4687
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4688
|
+
import_components36.Loader,
|
|
4532
4689
|
{
|
|
4533
4690
|
size,
|
|
4534
4691
|
classNames: {
|
|
4535
|
-
"tw-loader": (0,
|
|
4692
|
+
"tw-loader": (0, import_classnames19.default)(
|
|
4536
4693
|
"tw-loader",
|
|
4537
4694
|
"m-x-auto",
|
|
4538
4695
|
getMargin(margin),
|
|
@@ -4546,24 +4703,24 @@ var LoadingIndicatorRenderer = {
|
|
|
4546
4703
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
4547
4704
|
|
|
4548
4705
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
4549
|
-
var
|
|
4550
|
-
var
|
|
4551
|
-
var
|
|
4706
|
+
var import_components37 = require("@transferwise/components");
|
|
4707
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4708
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4552
4709
|
var MarkdownRenderer = {
|
|
4553
4710
|
canRenderType: "markdown",
|
|
4554
4711
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
4555
4712
|
const isLarge = !["xs", "sm"].includes(size);
|
|
4556
|
-
return /* @__PURE__ */ (0,
|
|
4713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4557
4714
|
"div",
|
|
4558
4715
|
{
|
|
4559
|
-
className: (0,
|
|
4716
|
+
className: (0, import_classnames20.default)(
|
|
4560
4717
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4561
4718
|
controlAndTagsToCSSClass({ control, tags })
|
|
4562
4719
|
),
|
|
4563
|
-
children: /* @__PURE__ */ (0,
|
|
4564
|
-
|
|
4720
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4721
|
+
import_components37.Markdown,
|
|
4565
4722
|
{
|
|
4566
|
-
className: (0,
|
|
4723
|
+
className: (0, import_classnames20.default)("df-markdown", {
|
|
4567
4724
|
"np-text-body-large": isLarge,
|
|
4568
4725
|
"np-text-body-default": !isLarge
|
|
4569
4726
|
}),
|
|
@@ -4578,17 +4735,17 @@ var MarkdownRenderer = {
|
|
|
4578
4735
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
4579
4736
|
|
|
4580
4737
|
// ../renderers/src/MediaRenderer.tsx
|
|
4581
|
-
var
|
|
4582
|
-
var
|
|
4738
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
4739
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4583
4740
|
var MediaRenderer = {
|
|
4584
4741
|
canRenderType: "media",
|
|
4585
4742
|
render: (_a) => {
|
|
4586
4743
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
4587
4744
|
switch (media.type) {
|
|
4588
4745
|
case "avatar":
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
4746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4590
4747
|
case "image":
|
|
4591
|
-
return /* @__PURE__ */ (0,
|
|
4748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4592
4749
|
case "legacy":
|
|
4593
4750
|
return null;
|
|
4594
4751
|
}
|
|
@@ -4602,16 +4759,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
4602
4759
|
control,
|
|
4603
4760
|
tags
|
|
4604
4761
|
}) => {
|
|
4605
|
-
return /* @__PURE__ */ (0,
|
|
4762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4606
4763
|
"div",
|
|
4607
4764
|
{
|
|
4608
|
-
className: (0,
|
|
4765
|
+
className: (0, import_classnames21.default)(
|
|
4609
4766
|
"df-media-layout-avatar",
|
|
4610
4767
|
align,
|
|
4611
4768
|
getMargin(margin),
|
|
4612
4769
|
controlAndTagsToCSSClass({ control, tags })
|
|
4613
4770
|
),
|
|
4614
|
-
children: /* @__PURE__ */ (0,
|
|
4771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Media, { media, size: mapAvatarMediaSize(size) })
|
|
4615
4772
|
}
|
|
4616
4773
|
);
|
|
4617
4774
|
};
|
|
@@ -4621,7 +4778,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
4621
4778
|
} = _b, rest = __objRest(_b, [
|
|
4622
4779
|
"media"
|
|
4623
4780
|
]);
|
|
4624
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
4781
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
4625
4782
|
};
|
|
4626
4783
|
var mapAvatarMediaSize = (size) => {
|
|
4627
4784
|
switch (size) {
|
|
@@ -4639,22 +4796,22 @@ var mapAvatarMediaSize = (size) => {
|
|
|
4639
4796
|
};
|
|
4640
4797
|
|
|
4641
4798
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
4642
|
-
var
|
|
4643
|
-
var
|
|
4799
|
+
var import_components38 = require("@transferwise/components");
|
|
4800
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
4644
4801
|
var import_react15 = require("react");
|
|
4645
|
-
var
|
|
4802
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4646
4803
|
var ModalLayoutRenderer = {
|
|
4647
4804
|
canRenderType: "modal-layout",
|
|
4648
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4805
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DFModal, __spreadValues({}, props))
|
|
4649
4806
|
};
|
|
4650
4807
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
4651
4808
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
4652
4809
|
const [visible, setVisible] = (0, import_react15.useState)(false);
|
|
4653
4810
|
const { children, title } = content;
|
|
4654
|
-
return /* @__PURE__ */ (0,
|
|
4655
|
-
/* @__PURE__ */ (0,
|
|
4656
|
-
/* @__PURE__ */ (0,
|
|
4657
|
-
|
|
4811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: (0, import_classnames22.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4812
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components38.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
4813
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4814
|
+
import_components38.Modal,
|
|
4658
4815
|
{
|
|
4659
4816
|
scroll: "content",
|
|
4660
4817
|
open: visible,
|
|
@@ -4668,13 +4825,13 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
4668
4825
|
}
|
|
4669
4826
|
|
|
4670
4827
|
// ../renderers/src/ModalRenderer.tsx
|
|
4671
|
-
var
|
|
4672
|
-
var
|
|
4828
|
+
var import_components39 = require("@transferwise/components");
|
|
4829
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4673
4830
|
var ModalRenderer = {
|
|
4674
4831
|
canRenderType: "modal",
|
|
4675
4832
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
4676
|
-
return /* @__PURE__ */ (0,
|
|
4677
|
-
|
|
4833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4834
|
+
import_components39.Modal,
|
|
4678
4835
|
{
|
|
4679
4836
|
open,
|
|
4680
4837
|
title,
|
|
@@ -4687,10 +4844,10 @@ var ModalRenderer = {
|
|
|
4687
4844
|
};
|
|
4688
4845
|
|
|
4689
4846
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
4690
|
-
var
|
|
4847
|
+
var import_components40 = require("@transferwise/components");
|
|
4691
4848
|
var import_react16 = require("react");
|
|
4692
4849
|
var import_react_intl20 = require("react-intl");
|
|
4693
|
-
var
|
|
4850
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4694
4851
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4695
4852
|
var MoneyInputRenderer = {
|
|
4696
4853
|
canRenderType: "money-input",
|
|
@@ -4720,7 +4877,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
4720
4877
|
}
|
|
4721
4878
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
4722
4879
|
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
4723
|
-
return /* @__PURE__ */ (0,
|
|
4880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4724
4881
|
FieldInput_default,
|
|
4725
4882
|
{
|
|
4726
4883
|
id: uid,
|
|
@@ -4731,8 +4888,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
4731
4888
|
features,
|
|
4732
4889
|
control,
|
|
4733
4890
|
tags,
|
|
4734
|
-
children: /* @__PURE__ */ (0,
|
|
4735
|
-
|
|
4891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4892
|
+
import_components40.MoneyInput,
|
|
4736
4893
|
{
|
|
4737
4894
|
amount: parseFloatOrNull(amountValue),
|
|
4738
4895
|
searchPlaceholder: "",
|
|
@@ -4793,7 +4950,7 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
4793
4950
|
}
|
|
4794
4951
|
|
|
4795
4952
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4796
|
-
var
|
|
4953
|
+
var import_components41 = require("@transferwise/components");
|
|
4797
4954
|
var import_react17 = require("react");
|
|
4798
4955
|
var import_react_intl21 = require("react-intl");
|
|
4799
4956
|
|
|
@@ -4803,7 +4960,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
4803
4960
|
}));
|
|
4804
4961
|
|
|
4805
4962
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4806
|
-
var
|
|
4963
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4807
4964
|
function InlineComponent(props) {
|
|
4808
4965
|
const {
|
|
4809
4966
|
id,
|
|
@@ -4824,9 +4981,9 @@ function InlineComponent(props) {
|
|
|
4824
4981
|
const { formatMessage } = (0, import_react_intl21.useIntl)();
|
|
4825
4982
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
4826
4983
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
4827
|
-
return /* @__PURE__ */ (0,
|
|
4828
|
-
filtered && /* @__PURE__ */ (0,
|
|
4829
|
-
|
|
4984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
4985
|
+
filtered && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4986
|
+
import_components41.SearchInput,
|
|
4830
4987
|
{
|
|
4831
4988
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
4832
4989
|
disabled,
|
|
@@ -4838,7 +4995,7 @@ function InlineComponent(props) {
|
|
|
4838
4995
|
}
|
|
4839
4996
|
}
|
|
4840
4997
|
),
|
|
4841
|
-
/* @__PURE__ */ (0,
|
|
4998
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4842
4999
|
FieldInput_default,
|
|
4843
5000
|
{
|
|
4844
5001
|
id,
|
|
@@ -4863,8 +5020,8 @@ function InlineComponent(props) {
|
|
|
4863
5020
|
childrenProps
|
|
4864
5021
|
} = option;
|
|
4865
5022
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
-
|
|
5023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5024
|
+
import_components41.ListItem,
|
|
4868
5025
|
{
|
|
4869
5026
|
title: itemTitle,
|
|
4870
5027
|
subtitle,
|
|
@@ -4872,10 +5029,10 @@ function InlineComponent(props) {
|
|
|
4872
5029
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
4873
5030
|
media: getMedia(media, false),
|
|
4874
5031
|
prompt: getInlineAlert(inlineAlert),
|
|
4875
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
5032
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components41.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
4876
5033
|
disabled: disabled || optionDisabled,
|
|
4877
|
-
control: /* @__PURE__ */ (0,
|
|
4878
|
-
|
|
5034
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
5035
|
+
import_components41.ListItem.Checkbox,
|
|
4879
5036
|
{
|
|
4880
5037
|
checked: selectedIndices.includes(index),
|
|
4881
5038
|
onChange: (e) => {
|
|
@@ -4894,7 +5051,7 @@ function InlineComponent(props) {
|
|
|
4894
5051
|
}
|
|
4895
5052
|
|
|
4896
5053
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
4897
|
-
var
|
|
5054
|
+
var import_components42 = require("@transferwise/components");
|
|
4898
5055
|
var import_react18 = require("react");
|
|
4899
5056
|
var import_react_intl23 = require("react-intl");
|
|
4900
5057
|
|
|
@@ -4909,7 +5066,7 @@ var multi_select_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
4909
5066
|
});
|
|
4910
5067
|
|
|
4911
5068
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
4912
|
-
var
|
|
5069
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4913
5070
|
function DefaultComponent(props) {
|
|
4914
5071
|
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
4915
5072
|
const [stagedIndices, setStagedIndices] = (0, import_react18.useState)();
|
|
@@ -4953,12 +5110,12 @@ function DefaultComponent(props) {
|
|
|
4953
5110
|
const contentProps = {
|
|
4954
5111
|
title: option.title,
|
|
4955
5112
|
description: option.description,
|
|
4956
|
-
icon: /* @__PURE__ */ (0,
|
|
5113
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4957
5114
|
};
|
|
4958
|
-
return /* @__PURE__ */ (0,
|
|
5115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components42.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
4959
5116
|
};
|
|
4960
5117
|
const extraProps = { autoComplete };
|
|
4961
|
-
return /* @__PURE__ */ (0,
|
|
5118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4962
5119
|
FieldInput_default,
|
|
4963
5120
|
{
|
|
4964
5121
|
id,
|
|
@@ -4969,8 +5126,8 @@ function DefaultComponent(props) {
|
|
|
4969
5126
|
features,
|
|
4970
5127
|
control,
|
|
4971
5128
|
tags,
|
|
4972
|
-
children: /* @__PURE__ */ (0,
|
|
4973
|
-
|
|
5129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5130
|
+
import_components42.SelectInput,
|
|
4974
5131
|
__spreadValues({
|
|
4975
5132
|
id,
|
|
4976
5133
|
items: options.map((option, index) => {
|
|
@@ -5008,8 +5165,8 @@ function DefaultComponent(props) {
|
|
|
5008
5165
|
}
|
|
5009
5166
|
|
|
5010
5167
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
5011
|
-
var
|
|
5012
|
-
var
|
|
5168
|
+
var import_components43 = require("@transferwise/components");
|
|
5169
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5013
5170
|
function InlineCheckboxComponent(props) {
|
|
5014
5171
|
const {
|
|
5015
5172
|
id,
|
|
@@ -5025,7 +5182,7 @@ function InlineCheckboxComponent(props) {
|
|
|
5025
5182
|
tags,
|
|
5026
5183
|
onSelect
|
|
5027
5184
|
} = props;
|
|
5028
|
-
return /* @__PURE__ */ (0,
|
|
5185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5029
5186
|
FieldInput_default,
|
|
5030
5187
|
{
|
|
5031
5188
|
id,
|
|
@@ -5056,35 +5213,35 @@ function InlineCheckboxComponent(props) {
|
|
|
5056
5213
|
onSelect(newSelectedIndices);
|
|
5057
5214
|
}
|
|
5058
5215
|
};
|
|
5059
|
-
return /* @__PURE__ */ (0,
|
|
5216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components43.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
5060
5217
|
})
|
|
5061
5218
|
}
|
|
5062
5219
|
);
|
|
5063
5220
|
}
|
|
5064
5221
|
|
|
5065
5222
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
5066
|
-
var
|
|
5223
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5067
5224
|
var MultiSelectInputRenderer = {
|
|
5068
5225
|
canRenderType: "input-multi-select",
|
|
5069
5226
|
render: (props) => {
|
|
5070
5227
|
switch (props.control) {
|
|
5071
5228
|
case "inline":
|
|
5072
|
-
return /* @__PURE__ */ (0,
|
|
5229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(InlineComponent, __spreadValues({}, props));
|
|
5073
5230
|
case "inline-checkbox-group":
|
|
5074
|
-
return /* @__PURE__ */ (0,
|
|
5231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
5075
5232
|
default:
|
|
5076
|
-
return /* @__PURE__ */ (0,
|
|
5233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
5077
5234
|
}
|
|
5078
5235
|
}
|
|
5079
5236
|
};
|
|
5080
5237
|
|
|
5081
5238
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5082
|
-
var
|
|
5239
|
+
var import_components45 = require("@transferwise/components");
|
|
5083
5240
|
|
|
5084
5241
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
5085
|
-
var
|
|
5086
|
-
var
|
|
5087
|
-
var
|
|
5242
|
+
var import_components44 = require("@transferwise/components");
|
|
5243
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
5244
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5088
5245
|
function UploadFieldInput({
|
|
5089
5246
|
id,
|
|
5090
5247
|
children,
|
|
@@ -5096,14 +5253,14 @@ function UploadFieldInput({
|
|
|
5096
5253
|
control,
|
|
5097
5254
|
tags
|
|
5098
5255
|
}) {
|
|
5099
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
5256
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
5100
5257
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5101
5258
|
const { ref } = useScrollToError(validation, features);
|
|
5102
|
-
return /* @__PURE__ */ (0,
|
|
5259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
5103
5260
|
"div",
|
|
5104
5261
|
{
|
|
5105
5262
|
ref,
|
|
5106
|
-
className: (0,
|
|
5263
|
+
className: (0, import_classnames23.default)(
|
|
5107
5264
|
"form-group d-block",
|
|
5108
5265
|
{
|
|
5109
5266
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -5111,9 +5268,9 @@ function UploadFieldInput({
|
|
|
5111
5268
|
controlAndTagsToCSSClass({ control, tags })
|
|
5112
5269
|
),
|
|
5113
5270
|
children: [
|
|
5114
|
-
/* @__PURE__ */ (0,
|
|
5271
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
5115
5272
|
children,
|
|
5116
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5273
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components44.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
5117
5274
|
]
|
|
5118
5275
|
}
|
|
5119
5276
|
);
|
|
@@ -5148,7 +5305,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
5148
5305
|
};
|
|
5149
5306
|
|
|
5150
5307
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5151
|
-
var
|
|
5308
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5152
5309
|
var MultiUploadInputRenderer = {
|
|
5153
5310
|
canRenderType: "input-upload-multi",
|
|
5154
5311
|
render: (props) => {
|
|
@@ -5176,7 +5333,7 @@ var MultiUploadInputRenderer = {
|
|
|
5176
5333
|
};
|
|
5177
5334
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
5178
5335
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5179
|
-
return /* @__PURE__ */ (0,
|
|
5336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5180
5337
|
UploadFieldInput_default,
|
|
5181
5338
|
{
|
|
5182
5339
|
id,
|
|
@@ -5187,8 +5344,8 @@ var MultiUploadInputRenderer = {
|
|
|
5187
5344
|
features,
|
|
5188
5345
|
control,
|
|
5189
5346
|
tags,
|
|
5190
|
-
children: /* @__PURE__ */ (0,
|
|
5191
|
-
|
|
5347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5348
|
+
import_components45.UploadInput,
|
|
5192
5349
|
{
|
|
5193
5350
|
id,
|
|
5194
5351
|
"aria-describedby": descriptionId,
|
|
@@ -5197,7 +5354,7 @@ var MultiUploadInputRenderer = {
|
|
|
5197
5354
|
files: value.map(({ id: fileId, file, validationState: fileValidationState }) => ({
|
|
5198
5355
|
id: fileId,
|
|
5199
5356
|
filename: file.name,
|
|
5200
|
-
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ?
|
|
5357
|
+
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ? import_components45.Status.FAILED : import_components45.Status.SUCCEEDED
|
|
5201
5358
|
})),
|
|
5202
5359
|
fileTypes: acceptsToFileTypes(accepts),
|
|
5203
5360
|
maxFiles: maxItems,
|
|
@@ -5215,8 +5372,8 @@ var MultiUploadInputRenderer = {
|
|
|
5215
5372
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
5216
5373
|
|
|
5217
5374
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
5218
|
-
var
|
|
5219
|
-
var
|
|
5375
|
+
var import_components46 = require("@transferwise/components");
|
|
5376
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5220
5377
|
var NumberInputRenderer = {
|
|
5221
5378
|
canRenderType: "input-number",
|
|
5222
5379
|
render: (props) => {
|
|
@@ -5230,7 +5387,7 @@ var NumberInputRenderer = {
|
|
|
5230
5387
|
"maximum",
|
|
5231
5388
|
"minimum"
|
|
5232
5389
|
);
|
|
5233
|
-
return /* @__PURE__ */ (0,
|
|
5390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5234
5391
|
FieldInput_default,
|
|
5235
5392
|
{
|
|
5236
5393
|
id,
|
|
@@ -5243,8 +5400,8 @@ var NumberInputRenderer = {
|
|
|
5243
5400
|
features: props.features,
|
|
5244
5401
|
control: props.control,
|
|
5245
5402
|
tags: props.tags,
|
|
5246
|
-
children: /* @__PURE__ */ (0,
|
|
5247
|
-
|
|
5403
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components46.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5404
|
+
import_components46.Input,
|
|
5248
5405
|
__spreadValues({
|
|
5249
5406
|
id,
|
|
5250
5407
|
name: id,
|
|
@@ -5264,15 +5421,15 @@ var NumberInputRenderer = {
|
|
|
5264
5421
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
5265
5422
|
|
|
5266
5423
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5267
|
-
var
|
|
5268
|
-
var
|
|
5424
|
+
var import_components48 = require("@transferwise/components");
|
|
5425
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5269
5426
|
var import_react_intl25 = require("react-intl");
|
|
5270
5427
|
|
|
5271
5428
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
5272
|
-
var
|
|
5429
|
+
var import_components47 = require("@transferwise/components");
|
|
5273
5430
|
var import_react19 = require("react");
|
|
5274
5431
|
function useSnackBarIfAvailable() {
|
|
5275
|
-
const context = (0, import_react19.useContext)(
|
|
5432
|
+
const context = (0, import_react19.useContext)(import_components47.SnackbarContext);
|
|
5276
5433
|
return context ? context.createSnackbar : () => {
|
|
5277
5434
|
};
|
|
5278
5435
|
}
|
|
@@ -5293,18 +5450,18 @@ var paragraph_messages_default = (0, import_react_intl24.defineMessages)({
|
|
|
5293
5450
|
});
|
|
5294
5451
|
|
|
5295
5452
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5296
|
-
var
|
|
5453
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5297
5454
|
var ParagraphRenderer = {
|
|
5298
5455
|
canRenderType: "paragraph",
|
|
5299
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5456
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Paragraph, __spreadValues({}, props))
|
|
5300
5457
|
};
|
|
5301
5458
|
function Paragraph(props) {
|
|
5302
5459
|
const { align, control, margin, size, text } = props;
|
|
5303
|
-
const className = (0,
|
|
5460
|
+
const className = (0, import_classnames24.default)(
|
|
5304
5461
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5305
5462
|
controlAndTagsToCSSClass(props)
|
|
5306
5463
|
);
|
|
5307
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
5464
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5308
5465
|
"p",
|
|
5309
5466
|
{
|
|
5310
5467
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -5324,34 +5481,34 @@ function CopyableParagraph({
|
|
|
5324
5481
|
});
|
|
5325
5482
|
};
|
|
5326
5483
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
5327
|
-
return /* @__PURE__ */ (0,
|
|
5328
|
-
/* @__PURE__ */ (0,
|
|
5329
|
-
|
|
5484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className, children: [
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5486
|
+
import_components48.Input,
|
|
5330
5487
|
{
|
|
5331
5488
|
type: "text",
|
|
5332
5489
|
value: text,
|
|
5333
5490
|
readOnly: true,
|
|
5334
|
-
className: (0,
|
|
5491
|
+
className: (0, import_classnames24.default)("text-ellipsis", inputAlignmentClasses)
|
|
5335
5492
|
}
|
|
5336
5493
|
),
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5494
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components48.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5338
5495
|
] });
|
|
5339
5496
|
}
|
|
5340
5497
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
5341
5498
|
|
|
5342
5499
|
// ../renderers/src/ProgressRenderer.tsx
|
|
5343
|
-
var
|
|
5344
|
-
var
|
|
5345
|
-
var
|
|
5500
|
+
var import_components49 = require("@transferwise/components");
|
|
5501
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5502
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5346
5503
|
var ProgressRenderer = {
|
|
5347
5504
|
canRenderType: "progress",
|
|
5348
5505
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
5349
|
-
return /* @__PURE__ */ (0,
|
|
5350
|
-
|
|
5506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5507
|
+
import_components49.ProgressBar,
|
|
5351
5508
|
{
|
|
5352
5509
|
id: uid,
|
|
5353
|
-
className: (0,
|
|
5354
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
5510
|
+
className: (0, import_classnames25.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5511
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
5355
5512
|
description,
|
|
5356
5513
|
progress: {
|
|
5357
5514
|
max: 1,
|
|
@@ -5364,9 +5521,9 @@ var ProgressRenderer = {
|
|
|
5364
5521
|
};
|
|
5365
5522
|
|
|
5366
5523
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5367
|
-
var
|
|
5524
|
+
var import_components50 = require("@transferwise/components");
|
|
5368
5525
|
var import_icons2 = require("@transferwise/icons");
|
|
5369
|
-
var
|
|
5526
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5370
5527
|
var import_react20 = require("react");
|
|
5371
5528
|
var import_react_intl27 = require("react-intl");
|
|
5372
5529
|
|
|
@@ -5396,10 +5553,10 @@ var repeatable_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
5396
5553
|
});
|
|
5397
5554
|
|
|
5398
5555
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5399
|
-
var
|
|
5556
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5400
5557
|
var RepeatableRenderer = {
|
|
5401
5558
|
canRenderType: "repeatable",
|
|
5402
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5559
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Repeatable, __spreadValues({}, props))
|
|
5403
5560
|
};
|
|
5404
5561
|
function Repeatable(props) {
|
|
5405
5562
|
const {
|
|
@@ -5440,43 +5597,43 @@ function Repeatable(props) {
|
|
|
5440
5597
|
const onCancelEdit = () => {
|
|
5441
5598
|
setOpenModalType(null);
|
|
5442
5599
|
};
|
|
5443
|
-
return /* @__PURE__ */ (0,
|
|
5444
|
-
/* @__PURE__ */ (0,
|
|
5445
|
-
title && /* @__PURE__ */ (0,
|
|
5446
|
-
description && /* @__PURE__ */ (0,
|
|
5447
|
-
/* @__PURE__ */ (0,
|
|
5600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
5601
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5602
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components50.Header, { title }),
|
|
5603
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { children: description }),
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
5448
5605
|
"div",
|
|
5449
5606
|
{
|
|
5450
|
-
className: (0,
|
|
5607
|
+
className: (0, import_classnames26.default)("form-group", {
|
|
5451
5608
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
5452
5609
|
}),
|
|
5453
5610
|
children: [
|
|
5454
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
5455
|
-
/* @__PURE__ */ (0,
|
|
5456
|
-
|
|
5611
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5612
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5613
|
+
import_components50.NavigationOption,
|
|
5457
5614
|
{
|
|
5458
|
-
media: /* @__PURE__ */ (0,
|
|
5615
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_icons2.Plus, {}),
|
|
5459
5616
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5460
5617
|
showMediaAtAllSizes: true,
|
|
5461
5618
|
onClick: () => onAddItem()
|
|
5462
5619
|
}
|
|
5463
5620
|
),
|
|
5464
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5621
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components50.InlineAlert, { type: "negative", children: validationState.message })
|
|
5465
5622
|
]
|
|
5466
5623
|
}
|
|
5467
5624
|
)
|
|
5468
5625
|
] }),
|
|
5469
|
-
/* @__PURE__ */ (0,
|
|
5470
|
-
|
|
5626
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5627
|
+
import_components50.Modal,
|
|
5471
5628
|
{
|
|
5472
5629
|
open: openModalType !== null,
|
|
5473
5630
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5474
|
-
body: /* @__PURE__ */ (0,
|
|
5475
|
-
/* @__PURE__ */ (0,
|
|
5476
|
-
/* @__PURE__ */ (0,
|
|
5477
|
-
/* @__PURE__ */ (0,
|
|
5478
|
-
/* @__PURE__ */ (0,
|
|
5479
|
-
|
|
5631
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
5632
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
5633
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { children: [
|
|
5634
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components50.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
5635
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5636
|
+
import_components50.Button,
|
|
5480
5637
|
{
|
|
5481
5638
|
v2: true,
|
|
5482
5639
|
priority: "secondary",
|
|
@@ -5497,10 +5654,10 @@ function ItemSummaryOption({
|
|
|
5497
5654
|
item,
|
|
5498
5655
|
onClick
|
|
5499
5656
|
}) {
|
|
5500
|
-
return /* @__PURE__ */ (0,
|
|
5501
|
-
|
|
5657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5658
|
+
import_components50.NavigationOption,
|
|
5502
5659
|
{
|
|
5503
|
-
media: /* @__PURE__ */ (0,
|
|
5660
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
5504
5661
|
title: item.title,
|
|
5505
5662
|
content: item.description,
|
|
5506
5663
|
showMediaAtAllSizes: true,
|
|
@@ -5512,17 +5669,17 @@ function ItemSummaryOption({
|
|
|
5512
5669
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
5513
5670
|
|
|
5514
5671
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
5515
|
-
var
|
|
5516
|
-
var
|
|
5517
|
-
var
|
|
5672
|
+
var import_components51 = require("@transferwise/components");
|
|
5673
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5674
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5518
5675
|
var ReviewRenderer = {
|
|
5519
5676
|
canRenderType: "review",
|
|
5520
5677
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
5521
5678
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
5522
|
-
return /* @__PURE__ */ (0,
|
|
5523
|
-
/* @__PURE__ */ (0,
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5525
|
-
|
|
5679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_classnames27.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5680
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Header, { title, callToAction }),
|
|
5681
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5682
|
+
import_components51.DefinitionList,
|
|
5526
5683
|
{
|
|
5527
5684
|
layout: orientation,
|
|
5528
5685
|
definitions: fields.map(
|
|
@@ -5559,21 +5716,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
5559
5716
|
};
|
|
5560
5717
|
var getFieldLabel = (label, help, onClick) => {
|
|
5561
5718
|
if (help) {
|
|
5562
|
-
return /* @__PURE__ */ (0,
|
|
5719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
5563
5720
|
label,
|
|
5564
5721
|
" ",
|
|
5565
|
-
/* @__PURE__ */ (0,
|
|
5722
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Help_default, { help, onClick })
|
|
5566
5723
|
] });
|
|
5567
5724
|
}
|
|
5568
5725
|
return label;
|
|
5569
5726
|
};
|
|
5570
5727
|
|
|
5571
5728
|
// ../renderers/src/ReviewRenderer.tsx
|
|
5572
|
-
var
|
|
5729
|
+
var import_components52 = require("@transferwise/components");
|
|
5573
5730
|
var import_icons3 = require("@transferwise/icons");
|
|
5574
|
-
var
|
|
5731
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5575
5732
|
var import_react_intl28 = require("react-intl");
|
|
5576
|
-
var
|
|
5733
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5577
5734
|
var IGNORED_CONTROLS = [
|
|
5578
5735
|
"horizontal",
|
|
5579
5736
|
"horizontal-end-aligned",
|
|
@@ -5583,7 +5740,7 @@ var IGNORED_CONTROLS = [
|
|
|
5583
5740
|
var ReviewRenderer2 = {
|
|
5584
5741
|
canRenderType: "review",
|
|
5585
5742
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
5586
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5743
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Review, __spreadValues({}, props))
|
|
5587
5744
|
};
|
|
5588
5745
|
var Review = ({
|
|
5589
5746
|
callToAction,
|
|
@@ -5595,8 +5752,8 @@ var Review = ({
|
|
|
5595
5752
|
trackEvent
|
|
5596
5753
|
}) => {
|
|
5597
5754
|
const intl = (0, import_react_intl28.useIntl)();
|
|
5598
|
-
return /* @__PURE__ */ (0,
|
|
5599
|
-
/* @__PURE__ */ (0,
|
|
5755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_classnames28.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5756
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Header, { title, callToAction }),
|
|
5600
5757
|
fields.map((field) => {
|
|
5601
5758
|
var _a, _b, _c;
|
|
5602
5759
|
const {
|
|
@@ -5614,8 +5771,8 @@ var Review = ({
|
|
|
5614
5771
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
5615
5772
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
5616
5773
|
};
|
|
5617
|
-
return /* @__PURE__ */ (0,
|
|
5618
|
-
|
|
5774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5775
|
+
import_components52.ListItem,
|
|
5619
5776
|
{
|
|
5620
5777
|
title: value,
|
|
5621
5778
|
subtitle: label,
|
|
@@ -5635,12 +5792,12 @@ var Review = ({
|
|
|
5635
5792
|
] });
|
|
5636
5793
|
};
|
|
5637
5794
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
5638
|
-
return /* @__PURE__ */ (0,
|
|
5795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_icons3.QuestionMarkCircle, {}) }) });
|
|
5639
5796
|
};
|
|
5640
5797
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
5641
5798
|
|
|
5642
5799
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5643
|
-
var
|
|
5800
|
+
var import_components54 = require("@transferwise/components");
|
|
5644
5801
|
var import_react21 = require("react");
|
|
5645
5802
|
var import_react_intl31 = require("react-intl");
|
|
5646
5803
|
|
|
@@ -5656,20 +5813,20 @@ var search_messages_default = (0, import_react_intl29.defineMessages)({
|
|
|
5656
5813
|
|
|
5657
5814
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
5658
5815
|
var import_react_intl30 = require("react-intl");
|
|
5659
|
-
var
|
|
5660
|
-
var
|
|
5816
|
+
var import_components53 = require("@transferwise/components");
|
|
5817
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5661
5818
|
function ErrorResult({ state }) {
|
|
5662
5819
|
const intl = (0, import_react_intl30.useIntl)();
|
|
5663
|
-
return /* @__PURE__ */ (0,
|
|
5820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("p", { className: "m-t-2", children: [
|
|
5664
5821
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
5665
5822
|
"\xA0",
|
|
5666
|
-
/* @__PURE__ */ (0,
|
|
5823
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components53.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
5667
5824
|
] });
|
|
5668
5825
|
}
|
|
5669
5826
|
|
|
5670
5827
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5671
5828
|
var import_icons4 = require("@transferwise/icons");
|
|
5672
|
-
var
|
|
5829
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5673
5830
|
function BlockSearchRendererComponent({
|
|
5674
5831
|
id,
|
|
5675
5832
|
hint,
|
|
@@ -5686,8 +5843,8 @@ function BlockSearchRendererComponent({
|
|
|
5686
5843
|
}) {
|
|
5687
5844
|
const [hasSearched, setHasSearched] = (0, import_react21.useState)(false);
|
|
5688
5845
|
const { formatMessage } = (0, import_react_intl31.useIntl)();
|
|
5689
|
-
return /* @__PURE__ */ (0,
|
|
5690
|
-
/* @__PURE__ */ (0,
|
|
5846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: getMargin(margin), children: [
|
|
5847
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5691
5848
|
FieldInput_default,
|
|
5692
5849
|
{
|
|
5693
5850
|
id,
|
|
@@ -5698,8 +5855,8 @@ function BlockSearchRendererComponent({
|
|
|
5698
5855
|
features,
|
|
5699
5856
|
control,
|
|
5700
5857
|
tags,
|
|
5701
|
-
children: /* @__PURE__ */ (0,
|
|
5702
|
-
|
|
5858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_icons4.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5859
|
+
import_components54.Input,
|
|
5703
5860
|
{
|
|
5704
5861
|
id,
|
|
5705
5862
|
name: id,
|
|
@@ -5718,7 +5875,7 @@ function BlockSearchRendererComponent({
|
|
|
5718
5875
|
) })
|
|
5719
5876
|
}
|
|
5720
5877
|
),
|
|
5721
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
5878
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SearchResultContent, { state, trackEvent })
|
|
5722
5879
|
] });
|
|
5723
5880
|
}
|
|
5724
5881
|
function SearchResultContent({
|
|
@@ -5727,39 +5884,39 @@ function SearchResultContent({
|
|
|
5727
5884
|
}) {
|
|
5728
5885
|
switch (state.type) {
|
|
5729
5886
|
case "error":
|
|
5730
|
-
return /* @__PURE__ */ (0,
|
|
5887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ErrorResult, { state });
|
|
5731
5888
|
case "results":
|
|
5732
|
-
return /* @__PURE__ */ (0,
|
|
5889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SearchResults, { state, trackEvent });
|
|
5733
5890
|
case "layout":
|
|
5734
|
-
return /* @__PURE__ */ (0,
|
|
5891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
5735
5892
|
" ",
|
|
5736
5893
|
state.layout,
|
|
5737
5894
|
" "
|
|
5738
5895
|
] });
|
|
5739
5896
|
case "noResults":
|
|
5740
|
-
return /* @__PURE__ */ (0,
|
|
5897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(EmptySearchResult, { state });
|
|
5741
5898
|
case "pending":
|
|
5742
5899
|
default:
|
|
5743
5900
|
return null;
|
|
5744
5901
|
}
|
|
5745
5902
|
}
|
|
5746
5903
|
function EmptySearchResult({ state }) {
|
|
5747
|
-
return /* @__PURE__ */ (0,
|
|
5904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5748
5905
|
}
|
|
5749
5906
|
function SearchResults({
|
|
5750
5907
|
state,
|
|
5751
5908
|
trackEvent
|
|
5752
5909
|
}) {
|
|
5753
|
-
return /* @__PURE__ */ (0,
|
|
5910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.List, { children: state.results.map((result) => {
|
|
5754
5911
|
const { media } = result;
|
|
5755
|
-
return /* @__PURE__ */ (0,
|
|
5756
|
-
|
|
5912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5913
|
+
import_components54.ListItem,
|
|
5757
5914
|
{
|
|
5758
5915
|
title: result.title,
|
|
5759
5916
|
subtitle: result.description,
|
|
5760
|
-
media: media ? /* @__PURE__ */ (0,
|
|
5761
|
-
control: /* @__PURE__ */ (0,
|
|
5762
|
-
|
|
5917
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
5918
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5919
|
+
import_components54.ListItem.Navigation,
|
|
5763
5920
|
{
|
|
5764
5921
|
onClick: () => {
|
|
5765
5922
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -5777,11 +5934,11 @@ function SearchResults({
|
|
|
5777
5934
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
5778
5935
|
|
|
5779
5936
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
5780
|
-
var
|
|
5937
|
+
var import_components55 = require("@transferwise/components");
|
|
5781
5938
|
var import_icons5 = require("@transferwise/icons");
|
|
5782
5939
|
var import_react22 = require("react");
|
|
5783
5940
|
var import_react_intl32 = require("react-intl");
|
|
5784
|
-
var
|
|
5941
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
5785
5942
|
function InlineSearchRenderer({
|
|
5786
5943
|
id,
|
|
5787
5944
|
hint,
|
|
@@ -5797,7 +5954,7 @@ function InlineSearchRenderer({
|
|
|
5797
5954
|
}) {
|
|
5798
5955
|
const [hasSearched, setHasSearched] = (0, import_react22.useState)(false);
|
|
5799
5956
|
const intl = (0, import_react_intl32.useIntl)();
|
|
5800
|
-
return /* @__PURE__ */ (0,
|
|
5957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5801
5958
|
FieldInput_default,
|
|
5802
5959
|
{
|
|
5803
5960
|
id,
|
|
@@ -5808,8 +5965,8 @@ function InlineSearchRenderer({
|
|
|
5808
5965
|
features,
|
|
5809
5966
|
control,
|
|
5810
5967
|
tags,
|
|
5811
|
-
children: /* @__PURE__ */ (0,
|
|
5812
|
-
|
|
5968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5969
|
+
import_components55.Typeahead,
|
|
5813
5970
|
{
|
|
5814
5971
|
id: "typeahead-input-id",
|
|
5815
5972
|
intl,
|
|
@@ -5817,10 +5974,10 @@ function InlineSearchRenderer({
|
|
|
5817
5974
|
size: "md",
|
|
5818
5975
|
placeholder: hint,
|
|
5819
5976
|
maxHeight: 100,
|
|
5820
|
-
footer: /* @__PURE__ */ (0,
|
|
5977
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
5821
5978
|
multiple: false,
|
|
5822
5979
|
clearable: false,
|
|
5823
|
-
addon: /* @__PURE__ */ (0,
|
|
5980
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_icons5.Search, { size: 24 }),
|
|
5824
5981
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
5825
5982
|
minQueryLength: 1,
|
|
5826
5983
|
onChange: (values) => {
|
|
@@ -5859,32 +6016,32 @@ function mapResultToTypeaheadOption(result) {
|
|
|
5859
6016
|
function TypeaheadFooter({ state, isLoading }) {
|
|
5860
6017
|
const { formatMessage } = (0, import_react_intl32.useIntl)();
|
|
5861
6018
|
if (state.type === "layout") {
|
|
5862
|
-
return /* @__PURE__ */ (0,
|
|
6019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
5863
6020
|
}
|
|
5864
6021
|
if (state.type === "noResults") {
|
|
5865
|
-
return /* @__PURE__ */ (0,
|
|
6022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components55.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5866
6023
|
}
|
|
5867
6024
|
if (state.type === "error") {
|
|
5868
|
-
return /* @__PURE__ */ (0,
|
|
6025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ErrorResult, { state }) });
|
|
5869
6026
|
}
|
|
5870
6027
|
if (state.type === "pending" || isLoading) {
|
|
5871
|
-
return /* @__PURE__ */ (0,
|
|
6028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
5872
6029
|
}
|
|
5873
6030
|
return null;
|
|
5874
6031
|
}
|
|
5875
6032
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
5876
6033
|
|
|
5877
6034
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
5878
|
-
var
|
|
6035
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5879
6036
|
var SearchRenderer = {
|
|
5880
6037
|
canRenderType: "search",
|
|
5881
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
6038
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
5882
6039
|
};
|
|
5883
6040
|
var SearchRenderer_default = SearchRenderer;
|
|
5884
6041
|
|
|
5885
6042
|
// ../renderers/src/SectionRenderer.tsx
|
|
5886
|
-
var
|
|
5887
|
-
var
|
|
6043
|
+
var import_components56 = require("@transferwise/components");
|
|
6044
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
5888
6045
|
|
|
5889
6046
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
5890
6047
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -5908,16 +6065,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
5908
6065
|
};
|
|
5909
6066
|
|
|
5910
6067
|
// ../renderers/src/SectionRenderer.tsx
|
|
5911
|
-
var
|
|
6068
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5912
6069
|
var SectionRenderer = {
|
|
5913
6070
|
canRenderType: "section",
|
|
5914
6071
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
5915
|
-
return /* @__PURE__ */ (0,
|
|
6072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
5916
6073
|
"section",
|
|
5917
6074
|
{
|
|
5918
|
-
className: (0,
|
|
6075
|
+
className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5919
6076
|
children: [
|
|
5920
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
6077
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components56.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
5921
6078
|
children
|
|
5922
6079
|
]
|
|
5923
6080
|
}
|
|
@@ -5927,8 +6084,8 @@ var SectionRenderer = {
|
|
|
5927
6084
|
var SectionRenderer_default = SectionRenderer;
|
|
5928
6085
|
|
|
5929
6086
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
5930
|
-
var
|
|
5931
|
-
var
|
|
6087
|
+
var import_components57 = require("@transferwise/components");
|
|
6088
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
5932
6089
|
function RadioInputRendererComponent(props) {
|
|
5933
6090
|
const {
|
|
5934
6091
|
id,
|
|
@@ -5945,8 +6102,8 @@ function RadioInputRendererComponent(props) {
|
|
|
5945
6102
|
tags,
|
|
5946
6103
|
onSelect
|
|
5947
6104
|
} = props;
|
|
5948
|
-
return /* @__PURE__ */ (0,
|
|
5949
|
-
/* @__PURE__ */ (0,
|
|
6105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5950
6107
|
FieldInput_default,
|
|
5951
6108
|
{
|
|
5952
6109
|
id,
|
|
@@ -5957,8 +6114,8 @@ function RadioInputRendererComponent(props) {
|
|
|
5957
6114
|
features,
|
|
5958
6115
|
control,
|
|
5959
6116
|
tags,
|
|
5960
|
-
children: /* @__PURE__ */ (0,
|
|
5961
|
-
|
|
6117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
6118
|
+
import_components57.RadioGroup,
|
|
5962
6119
|
{
|
|
5963
6120
|
name: id,
|
|
5964
6121
|
radios: options.map((option, index) => ({
|
|
@@ -5966,7 +6123,7 @@ function RadioInputRendererComponent(props) {
|
|
|
5966
6123
|
value: index,
|
|
5967
6124
|
secondary: option.description,
|
|
5968
6125
|
disabled: option.disabled || disabled,
|
|
5969
|
-
avatar: /* @__PURE__ */ (0,
|
|
6126
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5970
6127
|
})),
|
|
5971
6128
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
5972
6129
|
onChange: onSelect
|
|
@@ -5980,9 +6137,9 @@ function RadioInputRendererComponent(props) {
|
|
|
5980
6137
|
}
|
|
5981
6138
|
|
|
5982
6139
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
5983
|
-
var
|
|
6140
|
+
var import_components58 = require("@transferwise/components");
|
|
5984
6141
|
var import_react23 = require("react");
|
|
5985
|
-
var
|
|
6142
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5986
6143
|
function TabInputRendererComponent(props) {
|
|
5987
6144
|
const {
|
|
5988
6145
|
id,
|
|
@@ -6004,8 +6161,8 @@ function TabInputRendererComponent(props) {
|
|
|
6004
6161
|
onSelect(0);
|
|
6005
6162
|
}
|
|
6006
6163
|
}, [selectedIndex, onSelect, options.length]);
|
|
6007
|
-
return /* @__PURE__ */ (0,
|
|
6008
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6009
6166
|
FieldInput_default,
|
|
6010
6167
|
{
|
|
6011
6168
|
id,
|
|
@@ -6016,8 +6173,8 @@ function TabInputRendererComponent(props) {
|
|
|
6016
6173
|
features,
|
|
6017
6174
|
control,
|
|
6018
6175
|
tags,
|
|
6019
|
-
children: /* @__PURE__ */ (0,
|
|
6020
|
-
|
|
6176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6177
|
+
import_components58.Tabs,
|
|
6021
6178
|
{
|
|
6022
6179
|
name: id,
|
|
6023
6180
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -6025,7 +6182,7 @@ function TabInputRendererComponent(props) {
|
|
|
6025
6182
|
title: option.title,
|
|
6026
6183
|
// if we pass null, we get some props-types console errors
|
|
6027
6184
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
6028
|
-
content: /* @__PURE__ */ (0,
|
|
6185
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, {}),
|
|
6029
6186
|
disabled: option.disabled || disabled
|
|
6030
6187
|
})),
|
|
6031
6188
|
onTabSelect: onSelect
|
|
@@ -6039,8 +6196,8 @@ function TabInputRendererComponent(props) {
|
|
|
6039
6196
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6040
6197
|
|
|
6041
6198
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
6042
|
-
var
|
|
6043
|
-
var
|
|
6199
|
+
var import_components59 = require("@transferwise/components");
|
|
6200
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
6044
6201
|
function SelectInputRendererComponent(props) {
|
|
6045
6202
|
const {
|
|
6046
6203
|
id,
|
|
@@ -6083,13 +6240,13 @@ function SelectInputRendererComponent(props) {
|
|
|
6083
6240
|
} : {
|
|
6084
6241
|
title: option.title,
|
|
6085
6242
|
description: option.description,
|
|
6086
|
-
icon: /* @__PURE__ */ (0,
|
|
6243
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6087
6244
|
};
|
|
6088
|
-
return /* @__PURE__ */ (0,
|
|
6245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components59.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
6089
6246
|
};
|
|
6090
6247
|
const extraProps = { autoComplete };
|
|
6091
|
-
return /* @__PURE__ */ (0,
|
|
6092
|
-
/* @__PURE__ */ (0,
|
|
6248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
6249
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6093
6250
|
FieldInput_default,
|
|
6094
6251
|
{
|
|
6095
6252
|
id,
|
|
@@ -6100,8 +6257,8 @@ function SelectInputRendererComponent(props) {
|
|
|
6100
6257
|
features,
|
|
6101
6258
|
control,
|
|
6102
6259
|
tags,
|
|
6103
|
-
children: /* @__PURE__ */ (0,
|
|
6104
|
-
|
|
6260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6261
|
+
import_components59.SelectInput,
|
|
6105
6262
|
__spreadValues({
|
|
6106
6263
|
name: id,
|
|
6107
6264
|
placeholder,
|
|
@@ -6122,8 +6279,8 @@ function SelectInputRendererComponent(props) {
|
|
|
6122
6279
|
|
|
6123
6280
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
6124
6281
|
var import_react24 = require("react");
|
|
6125
|
-
var
|
|
6126
|
-
var
|
|
6282
|
+
var import_components60 = require("@transferwise/components");
|
|
6283
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
6127
6284
|
function SegmentedInputRendererComponent(props) {
|
|
6128
6285
|
const {
|
|
6129
6286
|
id,
|
|
@@ -6144,8 +6301,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6144
6301
|
onSelect(0);
|
|
6145
6302
|
}
|
|
6146
6303
|
}, [selectedIndex, onSelect, options.length]);
|
|
6147
|
-
return /* @__PURE__ */ (0,
|
|
6148
|
-
/* @__PURE__ */ (0,
|
|
6304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
6305
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
6149
6306
|
FieldInput_default,
|
|
6150
6307
|
{
|
|
6151
6308
|
id,
|
|
@@ -6156,8 +6313,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6156
6313
|
features,
|
|
6157
6314
|
control,
|
|
6158
6315
|
tags,
|
|
6159
|
-
children: /* @__PURE__ */ (0,
|
|
6160
|
-
|
|
6316
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
6317
|
+
import_components60.SegmentedControl,
|
|
6161
6318
|
{
|
|
6162
6319
|
name: `${id}-segmented-control`,
|
|
6163
6320
|
value: String(selectedIndex),
|
|
@@ -6173,14 +6330,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6173
6330
|
)
|
|
6174
6331
|
}
|
|
6175
6332
|
),
|
|
6176
|
-
/* @__PURE__ */ (0,
|
|
6333
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { id: `${id}-children`, children })
|
|
6177
6334
|
] });
|
|
6178
6335
|
}
|
|
6179
6336
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6180
6337
|
|
|
6181
6338
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
6182
|
-
var
|
|
6183
|
-
var
|
|
6339
|
+
var import_components61 = require("@transferwise/components");
|
|
6340
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6184
6341
|
function RadioItemRendererComponent(props) {
|
|
6185
6342
|
const {
|
|
6186
6343
|
id,
|
|
@@ -6196,23 +6353,23 @@ function RadioItemRendererComponent(props) {
|
|
|
6196
6353
|
onSelect
|
|
6197
6354
|
} = props;
|
|
6198
6355
|
const { ref } = useScrollToError(validationState, features);
|
|
6199
|
-
return /* @__PURE__ */ (0,
|
|
6200
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
6201
|
-
|
|
6356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6357
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6358
|
+
import_components61.Header,
|
|
6202
6359
|
{
|
|
6203
6360
|
as: "h2",
|
|
6204
|
-
title: help ? /* @__PURE__ */ (0,
|
|
6361
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
6205
6362
|
}
|
|
6206
6363
|
),
|
|
6207
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
6208
|
-
/* @__PURE__ */ (0,
|
|
6209
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
6210
|
-
|
|
6364
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { children: rootDescription }),
|
|
6365
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components61.List, { children: options.map(
|
|
6366
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6367
|
+
import_components61.ListItem,
|
|
6211
6368
|
__spreadValues({
|
|
6212
6369
|
title,
|
|
6213
6370
|
subtitle: description,
|
|
6214
|
-
control: /* @__PURE__ */ (0,
|
|
6215
|
-
|
|
6371
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6372
|
+
import_components61.ListItem.Radio,
|
|
6216
6373
|
{
|
|
6217
6374
|
name: title,
|
|
6218
6375
|
checked: selectedIndex === index,
|
|
@@ -6227,51 +6384,51 @@ function RadioItemRendererComponent(props) {
|
|
|
6227
6384
|
title
|
|
6228
6385
|
)
|
|
6229
6386
|
) }, `${id}-${selectedIndex}`),
|
|
6230
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
6387
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components61.InlineAlert, { type: "negative", children: validationState.message }),
|
|
6231
6388
|
children
|
|
6232
6389
|
] });
|
|
6233
6390
|
}
|
|
6234
6391
|
|
|
6235
6392
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
6236
|
-
var
|
|
6393
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
6237
6394
|
var SelectInputRenderer = {
|
|
6238
6395
|
canRenderType: "input-select",
|
|
6239
6396
|
render: (props) => {
|
|
6240
6397
|
switch (props.control) {
|
|
6241
6398
|
case "radio":
|
|
6242
|
-
return /* @__PURE__ */ (0,
|
|
6399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
6243
6400
|
case "radio-item":
|
|
6244
|
-
return /* @__PURE__ */ (0,
|
|
6401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
6245
6402
|
case "tab":
|
|
6246
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6403
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
6247
6404
|
case "segmented":
|
|
6248
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6405
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
6249
6406
|
case "select":
|
|
6250
6407
|
default:
|
|
6251
|
-
return /* @__PURE__ */ (0,
|
|
6408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
6252
6409
|
}
|
|
6253
6410
|
}
|
|
6254
6411
|
};
|
|
6255
6412
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
6256
6413
|
|
|
6257
6414
|
// ../renderers/src/StatusListRenderer.tsx
|
|
6258
|
-
var
|
|
6259
|
-
var
|
|
6260
|
-
var
|
|
6415
|
+
var import_components62 = require("@transferwise/components");
|
|
6416
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
6417
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
6261
6418
|
var StatusListRenderer = {
|
|
6262
6419
|
canRenderType: "status-list",
|
|
6263
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0,
|
|
6264
|
-
title ? /* @__PURE__ */ (0,
|
|
6420
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: (0, import_classnames30.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6421
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components62.Header, { title }) : null,
|
|
6265
6422
|
items.map((item) => {
|
|
6266
6423
|
const { callToAction, description, title: itemTitle } = item;
|
|
6267
|
-
return /* @__PURE__ */ (0,
|
|
6268
|
-
|
|
6424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6425
|
+
import_components62.ListItem,
|
|
6269
6426
|
{
|
|
6270
6427
|
title: itemTitle,
|
|
6271
6428
|
subtitle: description,
|
|
6272
|
-
media: /* @__PURE__ */ (0,
|
|
6273
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
6274
|
-
|
|
6429
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(StatusListItemMedia, __spreadValues({}, item)),
|
|
6430
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6431
|
+
import_components62.ListItem.AdditionalInfo,
|
|
6275
6432
|
{
|
|
6276
6433
|
action: __spreadValues({
|
|
6277
6434
|
label: callToAction.title
|
|
@@ -6289,10 +6446,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
6289
6446
|
return void 0;
|
|
6290
6447
|
}
|
|
6291
6448
|
if ("name" in icon) {
|
|
6292
|
-
return /* @__PURE__ */ (0,
|
|
6449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components62.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
6293
6450
|
}
|
|
6294
6451
|
if ("text" in icon) {
|
|
6295
|
-
return /* @__PURE__ */ (0,
|
|
6452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components62.AvatarView, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
6296
6453
|
}
|
|
6297
6454
|
return void 0;
|
|
6298
6455
|
};
|
|
@@ -6309,7 +6466,7 @@ var mapStatus = (status) => {
|
|
|
6309
6466
|
var StatusListRenderer_default = StatusListRenderer;
|
|
6310
6467
|
|
|
6311
6468
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6312
|
-
var
|
|
6469
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6313
6470
|
|
|
6314
6471
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
6315
6472
|
var import_components_theming = require("@wise/components-theming");
|
|
@@ -6330,13 +6487,13 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
6330
6487
|
};
|
|
6331
6488
|
|
|
6332
6489
|
// ../renderers/src/step/StepHeader.tsx
|
|
6333
|
-
var
|
|
6334
|
-
var
|
|
6490
|
+
var import_components63 = require("@transferwise/components");
|
|
6491
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
6335
6492
|
var StepHeader = ({ title, description, tags }) => {
|
|
6336
6493
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
6337
|
-
return /* @__PURE__ */ (0,
|
|
6338
|
-
title ? /* @__PURE__ */ (0,
|
|
6339
|
-
description ? /* @__PURE__ */ (0,
|
|
6494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
6495
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components63.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6496
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
6340
6497
|
] });
|
|
6341
6498
|
};
|
|
6342
6499
|
var getHeaderStyle = (tags) => {
|
|
@@ -6347,7 +6504,7 @@ var getHeaderStyle = (tags) => {
|
|
|
6347
6504
|
};
|
|
6348
6505
|
|
|
6349
6506
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6350
|
-
var
|
|
6507
|
+
var import_components64 = require("@transferwise/components");
|
|
6351
6508
|
var import_icons6 = require("@transferwise/icons");
|
|
6352
6509
|
var import_react_intl34 = require("react-intl");
|
|
6353
6510
|
|
|
@@ -6362,31 +6519,31 @@ var back_messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
6362
6519
|
});
|
|
6363
6520
|
|
|
6364
6521
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6365
|
-
var
|
|
6522
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
6366
6523
|
function BackButton({ title, onClick }) {
|
|
6367
6524
|
const { formatMessage } = (0, import_react_intl34.useIntl)();
|
|
6368
|
-
return /* @__PURE__ */ (0,
|
|
6369
|
-
/* @__PURE__ */ (0,
|
|
6370
|
-
/* @__PURE__ */ (0,
|
|
6525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_components64.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6526
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6527
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_icons6.ArrowLeft, {})
|
|
6371
6528
|
] });
|
|
6372
6529
|
}
|
|
6373
6530
|
|
|
6374
6531
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
6375
|
-
var
|
|
6376
|
-
var
|
|
6532
|
+
var import_components65 = require("@transferwise/components");
|
|
6533
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
6377
6534
|
var Toolbar = ({ items }) => {
|
|
6378
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
6535
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
6379
6536
|
};
|
|
6380
6537
|
function ToolbarButton(props) {
|
|
6381
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
6538
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
6382
6539
|
}
|
|
6383
6540
|
function MediaToolbarButton(props) {
|
|
6384
6541
|
var _a;
|
|
6385
6542
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
6386
6543
|
const priority = getIconButtonPriority(control);
|
|
6387
6544
|
const type = getSentiment2(context);
|
|
6388
|
-
return /* @__PURE__ */ (0,
|
|
6389
|
-
|
|
6545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
6546
|
+
import_components65.IconButton,
|
|
6390
6547
|
{
|
|
6391
6548
|
className: "df-toolbar-button",
|
|
6392
6549
|
disabled,
|
|
@@ -6395,7 +6552,7 @@ function MediaToolbarButton(props) {
|
|
|
6395
6552
|
type,
|
|
6396
6553
|
onClick,
|
|
6397
6554
|
children: [
|
|
6398
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
6555
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
6399
6556
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
6400
6557
|
]
|
|
6401
6558
|
}
|
|
@@ -6406,8 +6563,8 @@ function TextToolbarButton(props) {
|
|
|
6406
6563
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
6407
6564
|
const priority = getPriority2(control);
|
|
6408
6565
|
const sentiment = getSentiment2(context);
|
|
6409
|
-
return /* @__PURE__ */ (0,
|
|
6410
|
-
|
|
6566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
6567
|
+
import_components65.Button,
|
|
6411
6568
|
{
|
|
6412
6569
|
v2: true,
|
|
6413
6570
|
size: "sm",
|
|
@@ -6436,18 +6593,18 @@ var getIconButtonPriority = (control) => {
|
|
|
6436
6593
|
};
|
|
6437
6594
|
|
|
6438
6595
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
6439
|
-
var
|
|
6596
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
6440
6597
|
function TopBar({ back, toolbar, tags }) {
|
|
6441
6598
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
6442
6599
|
const backCTA = isBackAllowed ? back : void 0;
|
|
6443
|
-
return backCTA || toolbar ? /* @__PURE__ */ (0,
|
|
6444
|
-
backCTA ? /* @__PURE__ */ (0,
|
|
6445
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
6600
|
+
return backCTA || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
6601
|
+
backCTA ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6602
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
6446
6603
|
] }) : null;
|
|
6447
6604
|
}
|
|
6448
6605
|
|
|
6449
6606
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6450
|
-
var
|
|
6607
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
6451
6608
|
var SplashCelebrationStepRenderer = {
|
|
6452
6609
|
canRenderType: "step",
|
|
6453
6610
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -6456,23 +6613,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
6456
6613
|
function SplashCelebrationStepRendererComponent(props) {
|
|
6457
6614
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
6458
6615
|
useCustomTheme("forest-green", trackEvent);
|
|
6459
|
-
return /* @__PURE__ */ (0,
|
|
6616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
6460
6617
|
"div",
|
|
6461
6618
|
{
|
|
6462
|
-
className: (0,
|
|
6619
|
+
className: (0, import_classnames31.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6463
6620
|
children: [
|
|
6464
|
-
/* @__PURE__ */ (0,
|
|
6465
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6621
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TopBar, { back, toolbar, tags }),
|
|
6622
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6466
6623
|
children,
|
|
6467
|
-
/* @__PURE__ */ (0,
|
|
6624
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(StepFooter, { footer, tags })
|
|
6468
6625
|
]
|
|
6469
6626
|
}
|
|
6470
6627
|
);
|
|
6471
6628
|
}
|
|
6472
6629
|
|
|
6473
6630
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
6474
|
-
var
|
|
6475
|
-
var
|
|
6631
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6632
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
6476
6633
|
var SplashStepRenderer = {
|
|
6477
6634
|
canRenderType: "step",
|
|
6478
6635
|
canRender: ({ control }) => control === "splash",
|
|
@@ -6480,70 +6637,70 @@ var SplashStepRenderer = {
|
|
|
6480
6637
|
};
|
|
6481
6638
|
function SplashStepRendererComponent(props) {
|
|
6482
6639
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
6484
6641
|
"div",
|
|
6485
6642
|
{
|
|
6486
|
-
className: (0,
|
|
6643
|
+
className: (0, import_classnames32.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6487
6644
|
children: [
|
|
6488
|
-
/* @__PURE__ */ (0,
|
|
6489
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6645
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TopBar, { back, toolbar, tags }),
|
|
6646
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6490
6647
|
children,
|
|
6491
|
-
/* @__PURE__ */ (0,
|
|
6648
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(StepFooter, { footer, tags })
|
|
6492
6649
|
]
|
|
6493
6650
|
}
|
|
6494
6651
|
);
|
|
6495
6652
|
}
|
|
6496
6653
|
|
|
6497
6654
|
// ../renderers/src/step/StepRenderer.tsx
|
|
6498
|
-
var
|
|
6499
|
-
var
|
|
6655
|
+
var import_components66 = require("@transferwise/components");
|
|
6656
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
6500
6657
|
var StepRenderer = {
|
|
6501
6658
|
canRenderType: "step",
|
|
6502
6659
|
render: StepRendererComponent
|
|
6503
6660
|
};
|
|
6504
6661
|
function StepRendererComponent(props) {
|
|
6505
6662
|
const { back, description, error, title, children, toolbar, footer, control, tags } = props;
|
|
6506
|
-
return /* @__PURE__ */ (0,
|
|
6507
|
-
/* @__PURE__ */ (0,
|
|
6508
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6509
|
-
error ? /* @__PURE__ */ (0,
|
|
6663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
6664
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TopBar, { back, toolbar, tags }),
|
|
6665
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6666
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components66.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
6510
6667
|
children,
|
|
6511
|
-
/* @__PURE__ */ (0,
|
|
6668
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(StepFooter, { footer, tags })
|
|
6512
6669
|
] });
|
|
6513
6670
|
}
|
|
6514
6671
|
|
|
6515
6672
|
// ../renderers/src/TabsRenderer.tsx
|
|
6516
|
-
var
|
|
6517
|
-
var
|
|
6673
|
+
var import_components67 = require("@transferwise/components");
|
|
6674
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6518
6675
|
var import_react26 = require("react");
|
|
6519
|
-
var
|
|
6676
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
6520
6677
|
var TabsRenderer = {
|
|
6521
6678
|
canRenderType: "tabs",
|
|
6522
6679
|
render: (props) => {
|
|
6523
6680
|
switch (props.control) {
|
|
6524
6681
|
case "segmented":
|
|
6525
6682
|
if (props.tabs.length > 3) {
|
|
6526
|
-
return /* @__PURE__ */ (0,
|
|
6683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
6527
6684
|
}
|
|
6528
|
-
return /* @__PURE__ */ (0,
|
|
6685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
6529
6686
|
case "chips":
|
|
6530
|
-
return /* @__PURE__ */ (0,
|
|
6687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
6531
6688
|
default:
|
|
6532
|
-
return /* @__PURE__ */ (0,
|
|
6689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
6533
6690
|
}
|
|
6534
6691
|
}
|
|
6535
6692
|
};
|
|
6536
6693
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6537
6694
|
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6538
|
-
return /* @__PURE__ */ (0,
|
|
6539
|
-
|
|
6695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: (0, import_classnames33.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
6696
|
+
import_components67.Tabs,
|
|
6540
6697
|
{
|
|
6541
6698
|
name: uid,
|
|
6542
6699
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
6543
6700
|
tabs: tabs.map((option) => ({
|
|
6544
6701
|
title: option.title,
|
|
6545
6702
|
disabled: false,
|
|
6546
|
-
content: /* @__PURE__ */ (0,
|
|
6703
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "m-t-2", children: [
|
|
6547
6704
|
" ",
|
|
6548
6705
|
option.children,
|
|
6549
6706
|
" "
|
|
@@ -6556,9 +6713,9 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6556
6713
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6557
6714
|
var _a;
|
|
6558
6715
|
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6559
|
-
return /* @__PURE__ */ (0,
|
|
6560
|
-
/* @__PURE__ */ (0,
|
|
6561
|
-
|
|
6716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: (0, import_classnames33.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6717
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
6718
|
+
import_components67.SegmentedControl,
|
|
6562
6719
|
{
|
|
6563
6720
|
name: uid,
|
|
6564
6721
|
value: String(selectedIndex),
|
|
@@ -6572,31 +6729,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6572
6729
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
6573
6730
|
}
|
|
6574
6731
|
),
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6732
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6576
6733
|
] });
|
|
6577
6734
|
}
|
|
6578
6735
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
6579
6736
|
var _a;
|
|
6580
6737
|
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6581
|
-
return /* @__PURE__ */ (0,
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6583
|
-
|
|
6738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: (0, import_classnames33.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6739
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
6740
|
+
import_components67.Chips,
|
|
6584
6741
|
{
|
|
6585
6742
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
6586
6743
|
selected: selectedIndex,
|
|
6587
6744
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
6588
6745
|
}
|
|
6589
6746
|
) }),
|
|
6590
|
-
/* @__PURE__ */ (0,
|
|
6747
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6591
6748
|
] });
|
|
6592
6749
|
}
|
|
6593
6750
|
|
|
6594
6751
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6595
|
-
var
|
|
6752
|
+
var import_components69 = require("@transferwise/components");
|
|
6596
6753
|
|
|
6597
6754
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6598
|
-
var
|
|
6599
|
-
var
|
|
6755
|
+
var import_components68 = require("@transferwise/components");
|
|
6756
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
6600
6757
|
var commonKeys = [
|
|
6601
6758
|
"autoComplete",
|
|
6602
6759
|
"autoCapitalize",
|
|
@@ -6615,12 +6772,12 @@ function VariableTextInput(inputProps) {
|
|
|
6615
6772
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6616
6773
|
switch (control) {
|
|
6617
6774
|
case "email":
|
|
6618
|
-
return /* @__PURE__ */ (0,
|
|
6775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6619
6776
|
case "password":
|
|
6620
|
-
return /* @__PURE__ */ (0,
|
|
6777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
6621
6778
|
case "numeric": {
|
|
6622
6779
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6623
|
-
return /* @__PURE__ */ (0,
|
|
6780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6624
6781
|
TextInput,
|
|
6625
6782
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
6626
6783
|
onChange: (newValue) => {
|
|
@@ -6631,21 +6788,21 @@ function VariableTextInput(inputProps) {
|
|
|
6631
6788
|
);
|
|
6632
6789
|
}
|
|
6633
6790
|
case "phone-number":
|
|
6634
|
-
return /* @__PURE__ */ (0,
|
|
6791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components68.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
6635
6792
|
default: {
|
|
6636
|
-
return /* @__PURE__ */ (0,
|
|
6793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
6637
6794
|
}
|
|
6638
6795
|
}
|
|
6639
6796
|
}
|
|
6640
6797
|
function TextInput(props) {
|
|
6641
6798
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
6642
|
-
const InputWithPattern = control === "textarea" ?
|
|
6643
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
6644
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
6799
|
+
const InputWithPattern = control === "textarea" ? import_components68.TextareaWithDisplayFormat : import_components68.InputWithDisplayFormat;
|
|
6800
|
+
const InputWithoutPattern = control === "textarea" ? import_components68.TextArea : import_components68.Input;
|
|
6801
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
6645
6802
|
}
|
|
6646
6803
|
|
|
6647
6804
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6648
|
-
var
|
|
6805
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
6649
6806
|
var TextInputRenderer = {
|
|
6650
6807
|
canRenderType: "input-text",
|
|
6651
6808
|
render: (props) => {
|
|
@@ -6678,7 +6835,7 @@ var TextInputRenderer = {
|
|
|
6678
6835
|
}
|
|
6679
6836
|
}
|
|
6680
6837
|
});
|
|
6681
|
-
return /* @__PURE__ */ (0,
|
|
6838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6682
6839
|
FieldInput_default,
|
|
6683
6840
|
{
|
|
6684
6841
|
id,
|
|
@@ -6691,21 +6848,31 @@ var TextInputRenderer = {
|
|
|
6691
6848
|
features: props.features,
|
|
6692
6849
|
control: props.control,
|
|
6693
6850
|
tags: props.tags,
|
|
6694
|
-
children: /* @__PURE__ */ (0,
|
|
6851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_components69.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
6695
6852
|
}
|
|
6696
6853
|
);
|
|
6697
6854
|
}
|
|
6698
6855
|
};
|
|
6699
6856
|
var TextInputRenderer_default = TextInputRenderer;
|
|
6700
6857
|
|
|
6858
|
+
// ../renderers/src/UpdatableRenderer.tsx
|
|
6859
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
6860
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
6861
|
+
var UpdatableRenderer = {
|
|
6862
|
+
canRenderType: "updatable",
|
|
6863
|
+
render: ({ children, control, margin, tags }) => {
|
|
6864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: (0, import_classnames34.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children });
|
|
6865
|
+
}
|
|
6866
|
+
};
|
|
6867
|
+
|
|
6701
6868
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
6702
|
-
var
|
|
6869
|
+
var import_components70 = require("@transferwise/components");
|
|
6703
6870
|
|
|
6704
6871
|
// ../renderers/src/utils/getRandomId.ts
|
|
6705
6872
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
6706
6873
|
|
|
6707
6874
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
6708
|
-
var
|
|
6875
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
6709
6876
|
var UploadInputRenderer = {
|
|
6710
6877
|
canRenderType: "input-upload",
|
|
6711
6878
|
render: (props) => {
|
|
@@ -6734,7 +6901,7 @@ var UploadInputRenderer = {
|
|
|
6734
6901
|
};
|
|
6735
6902
|
return (
|
|
6736
6903
|
// We don't pass help here as there is no sensible place to display it
|
|
6737
|
-
/* @__PURE__ */ (0,
|
|
6904
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6738
6905
|
UploadFieldInput_default,
|
|
6739
6906
|
{
|
|
6740
6907
|
id,
|
|
@@ -6744,8 +6911,8 @@ var UploadInputRenderer = {
|
|
|
6744
6911
|
features,
|
|
6745
6912
|
control,
|
|
6746
6913
|
tags,
|
|
6747
|
-
children: /* @__PURE__ */ (0,
|
|
6748
|
-
|
|
6914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6915
|
+
import_components70.UploadInput,
|
|
6749
6916
|
{
|
|
6750
6917
|
id,
|
|
6751
6918
|
description,
|
|
@@ -6755,7 +6922,7 @@ var UploadInputRenderer = {
|
|
|
6755
6922
|
{
|
|
6756
6923
|
id: "my-file",
|
|
6757
6924
|
filename: value.name,
|
|
6758
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
6925
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components70.Status.FAILED : import_components70.Status.SUCCEEDED
|
|
6759
6926
|
}
|
|
6760
6927
|
] : void 0,
|
|
6761
6928
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -6814,7 +6981,7 @@ var LargeUploadRenderer = {
|
|
|
6814
6981
|
};
|
|
6815
6982
|
const filetypes = acceptsToFileTypes(accepts);
|
|
6816
6983
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
6817
|
-
return /* @__PURE__ */ (0,
|
|
6984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6818
6985
|
FieldInput_default,
|
|
6819
6986
|
{
|
|
6820
6987
|
id,
|
|
@@ -6825,8 +6992,8 @@ var LargeUploadRenderer = {
|
|
|
6825
6992
|
features,
|
|
6826
6993
|
control,
|
|
6827
6994
|
tags,
|
|
6828
|
-
children: /* @__PURE__ */ (0,
|
|
6829
|
-
|
|
6995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6996
|
+
import_components70.Upload,
|
|
6830
6997
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
6831
6998
|
usAccept,
|
|
6832
6999
|
usDisabled: disabled,
|
|
@@ -6841,10 +7008,10 @@ var LargeUploadRenderer = {
|
|
|
6841
7008
|
};
|
|
6842
7009
|
|
|
6843
7010
|
// ../renderers/src/UpsellRenderer.tsx
|
|
6844
|
-
var
|
|
6845
|
-
var
|
|
7011
|
+
var import_components71 = require("@transferwise/components");
|
|
7012
|
+
var import_classnames35 = __toESM(require_classnames());
|
|
6846
7013
|
var import_react27 = require("react");
|
|
6847
|
-
var
|
|
7014
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
6848
7015
|
var UpsellRenderer = {
|
|
6849
7016
|
canRenderType: "upsell",
|
|
6850
7017
|
render: UpsellRendererComponent
|
|
@@ -6852,10 +7019,10 @@ var UpsellRenderer = {
|
|
|
6852
7019
|
function UpsellRendererComponent(props) {
|
|
6853
7020
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
6854
7021
|
const [isVisible, setIsVisible] = (0, import_react27.useState)(true);
|
|
6855
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
6856
|
-
|
|
7022
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
7023
|
+
import_components71.Nudge,
|
|
6857
7024
|
{
|
|
6858
|
-
className: (0,
|
|
7025
|
+
className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6859
7026
|
mediaName: getMediaName(media),
|
|
6860
7027
|
title: text,
|
|
6861
7028
|
action: __spreadValues({
|
|
@@ -6898,43 +7065,6 @@ var supportedMediaNames = [
|
|
|
6898
7065
|
"wallet"
|
|
6899
7066
|
];
|
|
6900
7067
|
|
|
6901
|
-
// ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
|
|
6902
|
-
var import_components71 = require("@transferwise/components");
|
|
6903
|
-
var import_classnames34 = __toESM(require_classnames());
|
|
6904
|
-
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
6905
|
-
var CircularButtonRenderer = {
|
|
6906
|
-
canRenderType: "button",
|
|
6907
|
-
canRender: ({ control }) => control === "circular",
|
|
6908
|
-
render: CircularButtonComponent
|
|
6909
|
-
};
|
|
6910
|
-
function CircularButtonComponent(props) {
|
|
6911
|
-
var _a;
|
|
6912
|
-
const { context, control, disabled, margin, media, tags, title, onClick } = props;
|
|
6913
|
-
const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
|
|
6914
|
-
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6915
|
-
"div",
|
|
6916
|
-
{
|
|
6917
|
-
className: (0, import_classnames34.default)(
|
|
6918
|
-
getMargin(margin),
|
|
6919
|
-
"df-button",
|
|
6920
|
-
"circular",
|
|
6921
|
-
controlAndTagsToCSSClass({ control, tags })
|
|
6922
|
-
),
|
|
6923
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6924
|
-
import_components71.CircularButton,
|
|
6925
|
-
{
|
|
6926
|
-
disabled,
|
|
6927
|
-
priority: priority != null ? priority : "secondary",
|
|
6928
|
-
type: context === "negative" ? "negative" : "default",
|
|
6929
|
-
icon: media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : void 0,
|
|
6930
|
-
onClick,
|
|
6931
|
-
children: title
|
|
6932
|
-
}
|
|
6933
|
-
)
|
|
6934
|
-
}
|
|
6935
|
-
);
|
|
6936
|
-
}
|
|
6937
|
-
|
|
6938
7068
|
// ../renderers/src/getWiseRenderers.ts
|
|
6939
7069
|
var getWiseRenderers = () => [
|
|
6940
7070
|
AddressValidationButtonRenderer_default,
|
|
@@ -6979,6 +7109,7 @@ var getWiseRenderers = () => [
|
|
|
6979
7109
|
TextInputRenderer_default,
|
|
6980
7110
|
UploadInputRenderer,
|
|
6981
7111
|
ColoredUpsellRenderer,
|
|
7112
|
+
UpdatableRenderer,
|
|
6982
7113
|
UpsellRenderer,
|
|
6983
7114
|
SplashStepRenderer,
|
|
6984
7115
|
SplashCelebrationStepRenderer,
|
|
@@ -6989,11 +7120,11 @@ var getWiseRenderers = () => [
|
|
|
6989
7120
|
|
|
6990
7121
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
6991
7122
|
var import_components72 = require("@transferwise/components");
|
|
6992
|
-
var
|
|
7123
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
6993
7124
|
var InitialLoadingStateRenderer = {
|
|
6994
7125
|
canRenderType: "loading-state",
|
|
6995
7126
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
6996
|
-
render: () => /* @__PURE__ */ (0,
|
|
7127
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
6997
7128
|
import_components72.Loader,
|
|
6998
7129
|
{
|
|
6999
7130
|
size: "md",
|
|
@@ -7006,24 +7137,24 @@ var InitialLoadingStateRenderer = {
|
|
|
7006
7137
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
7007
7138
|
var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
|
|
7008
7139
|
var import_components73 = require("@transferwise/components");
|
|
7009
|
-
var
|
|
7140
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
7010
7141
|
function DynamicFlowModal(props) {
|
|
7011
7142
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
7012
7143
|
const dfProps = useWiseToCoreProps(rest);
|
|
7013
7144
|
const df = (0, import_dynamic_flow_client.useDynamicFlowModal)(dfProps);
|
|
7014
|
-
return /* @__PURE__ */ (0,
|
|
7145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
7015
7146
|
import_components73.Modal,
|
|
7016
7147
|
__spreadProps(__spreadValues({
|
|
7017
7148
|
className: `dynamic-flow-modal ${className}`,
|
|
7018
7149
|
disableDimmerClickToClose: true
|
|
7019
7150
|
}, df.modal), {
|
|
7020
|
-
body: /* @__PURE__ */ (0,
|
|
7151
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
7021
7152
|
})
|
|
7022
7153
|
);
|
|
7023
7154
|
}
|
|
7024
7155
|
|
|
7025
7156
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
7026
|
-
var
|
|
7157
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
7027
7158
|
var wiseRenderers = getWiseRenderers();
|
|
7028
7159
|
var getMergedRenderers = (props) => {
|
|
7029
7160
|
var _d, _e;
|
|
@@ -7037,7 +7168,7 @@ var getMergedRenderers = (props) => {
|
|
|
7037
7168
|
method: initialRequest.method,
|
|
7038
7169
|
data: initialRequest.body
|
|
7039
7170
|
};
|
|
7040
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
7171
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
7041
7172
|
DynamicFlowModal,
|
|
7042
7173
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
7043
7174
|
features: subflowFeatures,
|
|
@@ -7234,13 +7365,13 @@ var openLinkInNewTab = (url) => {
|
|
|
7234
7365
|
};
|
|
7235
7366
|
|
|
7236
7367
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7237
|
-
var
|
|
7368
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
7238
7369
|
function DynamicFlow(props) {
|
|
7239
7370
|
const { className = "" } = props;
|
|
7240
7371
|
const dfProps = useWiseToCoreProps(props);
|
|
7241
7372
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
7242
7373
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
7243
|
-
return /* @__PURE__ */ (0,
|
|
7374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className, onContextMenu, children: [
|
|
7244
7375
|
df.view,
|
|
7245
7376
|
contextMenu
|
|
7246
7377
|
] });
|
|
@@ -7249,7 +7380,7 @@ function DynamicFlow(props) {
|
|
|
7249
7380
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
7250
7381
|
var import_react31 = require("react");
|
|
7251
7382
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
7252
|
-
var
|
|
7383
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
7253
7384
|
var DynamicFlowWithRef = (0, import_react31.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
7254
7385
|
const { className = "" } = props;
|
|
7255
7386
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -7265,7 +7396,7 @@ var DynamicFlowWithRef = (0, import_react31.forwardRef)(function DynamicFlowWith
|
|
|
7265
7396
|
}),
|
|
7266
7397
|
[df]
|
|
7267
7398
|
);
|
|
7268
|
-
return /* @__PURE__ */ (0,
|
|
7399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className, children: df.view });
|
|
7269
7400
|
});
|
|
7270
7401
|
|
|
7271
7402
|
// src/index.ts
|