@wise/dynamic-flow-client-internal 5.28.4 → 5.29.0-experimental-cadf60b
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 +625 -597
- package/build/main.mjs +457 -429
- 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");
|
|
@@ -3130,11 +3167,11 @@ function useWindowVirtualizer(options) {
|
|
|
3130
3167
|
}
|
|
3131
3168
|
|
|
3132
3169
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3133
|
-
var
|
|
3170
|
+
var import_components16 = require("@transferwise/components");
|
|
3134
3171
|
var import_react9 = require("react");
|
|
3135
3172
|
|
|
3136
3173
|
// ../renderers/src/step/StepFooter.tsx
|
|
3137
|
-
var
|
|
3174
|
+
var import_components15 = require("@transferwise/components");
|
|
3138
3175
|
var import_react8 = require("react");
|
|
3139
3176
|
var import_react_intl7 = require("react-intl");
|
|
3140
3177
|
|
|
@@ -3149,24 +3186,24 @@ var step_messages_default = (0, import_react_intl6.defineMessages)({
|
|
|
3149
3186
|
});
|
|
3150
3187
|
|
|
3151
3188
|
// ../renderers/src/step/StepFooter.tsx
|
|
3152
|
-
var
|
|
3189
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3153
3190
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3154
3191
|
var StepFooter = ({ footer, tags }) => {
|
|
3155
3192
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3156
|
-
return /* @__PURE__ */ (0,
|
|
3193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FooterWithScrollButton, { footer });
|
|
3157
3194
|
}
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DefaultFooter, { footer });
|
|
3159
3196
|
};
|
|
3160
3197
|
var DefaultFooter = ({ footer }) => {
|
|
3161
3198
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3162
|
-
return hasFooter ? /* @__PURE__ */ (0,
|
|
3199
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3163
3200
|
};
|
|
3164
3201
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3165
3202
|
const { formatMessage } = (0, import_react_intl7.useIntl)();
|
|
3166
3203
|
const endOfLayoutRef = (0, import_react8.useRef)(null);
|
|
3167
3204
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3168
|
-
const scrollButton = /* @__PURE__ */ (0,
|
|
3169
|
-
|
|
3205
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3206
|
+
import_components15.Button,
|
|
3170
3207
|
{
|
|
3171
3208
|
className: "m-b-1",
|
|
3172
3209
|
v2: true,
|
|
@@ -3181,11 +3218,11 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3181
3218
|
);
|
|
3182
3219
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3183
3220
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3184
|
-
return /* @__PURE__ */ (0,
|
|
3221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3185
3222
|
}
|
|
3186
|
-
return /* @__PURE__ */ (0,
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3188
|
-
/* @__PURE__ */ (0,
|
|
3223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3189
3226
|
!isElementVisible && scrollButton,
|
|
3190
3227
|
footer
|
|
3191
3228
|
] })
|
|
@@ -3227,7 +3264,7 @@ var collection_messages_default = (0, import_react_intl8.defineMessages)({
|
|
|
3227
3264
|
});
|
|
3228
3265
|
|
|
3229
3266
|
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3230
|
-
var
|
|
3267
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3231
3268
|
var ContentComponent = (props) => {
|
|
3232
3269
|
const { state, status, SectionHeader, Item } = props;
|
|
3233
3270
|
const endOfContentRef = (0, import_react9.useRef)(null);
|
|
@@ -3270,9 +3307,9 @@ var ContentComponent = (props) => {
|
|
|
3270
3307
|
// eslint-disable-next-line react-hooks/refs
|
|
3271
3308
|
scrollMargin: listOffsetRef.current
|
|
3272
3309
|
});
|
|
3273
|
-
return /* @__PURE__ */ (0,
|
|
3310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: listRef, children: [
|
|
3274
3311
|
state.beforeSections,
|
|
3275
|
-
/* @__PURE__ */ (0,
|
|
3312
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3276
3313
|
"div",
|
|
3277
3314
|
{
|
|
3278
3315
|
style: {
|
|
@@ -3285,7 +3322,7 @@ var ContentComponent = (props) => {
|
|
|
3285
3322
|
if (!i) {
|
|
3286
3323
|
return null;
|
|
3287
3324
|
}
|
|
3288
|
-
return /* @__PURE__ */ (0,
|
|
3325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3289
3326
|
"div",
|
|
3290
3327
|
{
|
|
3291
3328
|
ref: virtualizer.measureElement,
|
|
@@ -3297,14 +3334,14 @@ var ContentComponent = (props) => {
|
|
|
3297
3334
|
width: "100%",
|
|
3298
3335
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3299
3336
|
},
|
|
3300
|
-
children: i.type === "header" ? /* @__PURE__ */ (0,
|
|
3337
|
+
children: i.type === "header" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Item, __spreadValues({}, i.item))
|
|
3301
3338
|
},
|
|
3302
3339
|
item.key
|
|
3303
3340
|
);
|
|
3304
3341
|
})
|
|
3305
3342
|
}
|
|
3306
3343
|
),
|
|
3307
|
-
/* @__PURE__ */ (0,
|
|
3344
|
+
/* @__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
3345
|
state.afterSections
|
|
3309
3346
|
] });
|
|
3310
3347
|
};
|
|
@@ -3319,26 +3356,26 @@ var PaginationComponent = ({
|
|
|
3319
3356
|
return null;
|
|
3320
3357
|
}
|
|
3321
3358
|
if (isPaginationError) {
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadMoreButton, { onClick: status.retry });
|
|
3323
3360
|
}
|
|
3324
3361
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
3325
|
-
return /* @__PURE__ */ (0,
|
|
3362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadMoreButton, { onClick: loadMore });
|
|
3326
3363
|
}
|
|
3327
|
-
return /* @__PURE__ */ (0,
|
|
3364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components16.ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
3328
3365
|
};
|
|
3329
3366
|
var LoadMoreButton = ({ onClick }) => {
|
|
3330
3367
|
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
3331
|
-
return /* @__PURE__ */ (0,
|
|
3368
|
+
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
3369
|
};
|
|
3333
3370
|
|
|
3334
3371
|
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
3335
|
-
var
|
|
3336
|
-
var
|
|
3372
|
+
var import_components17 = require("@transferwise/components");
|
|
3373
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3337
3374
|
var FiltersComponent = ({ state }) => {
|
|
3338
3375
|
const { filters } = state;
|
|
3339
|
-
return /* @__PURE__ */ (0,
|
|
3376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
3340
3377
|
var _a;
|
|
3341
|
-
return /* @__PURE__ */ (0,
|
|
3378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
3342
3379
|
}) });
|
|
3343
3380
|
};
|
|
3344
3381
|
var FilterComponent = (filter) => {
|
|
@@ -3346,8 +3383,8 @@ var FilterComponent = (filter) => {
|
|
|
3346
3383
|
if (!options) {
|
|
3347
3384
|
return null;
|
|
3348
3385
|
}
|
|
3349
|
-
return /* @__PURE__ */ (0,
|
|
3350
|
-
|
|
3386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3387
|
+
import_components17.Chips,
|
|
3351
3388
|
{
|
|
3352
3389
|
className: "m-b-1",
|
|
3353
3390
|
multiple: multiSelect,
|
|
@@ -3372,11 +3409,11 @@ var FilterComponent = (filter) => {
|
|
|
3372
3409
|
};
|
|
3373
3410
|
|
|
3374
3411
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3375
|
-
var
|
|
3412
|
+
var import_components20 = require("@transferwise/components");
|
|
3376
3413
|
|
|
3377
3414
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
3378
|
-
var
|
|
3379
|
-
var
|
|
3415
|
+
var import_components18 = require("@transferwise/components");
|
|
3416
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3380
3417
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3381
3418
|
var _a, _b;
|
|
3382
3419
|
if (!additionalInfo) {
|
|
@@ -3384,8 +3421,8 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3384
3421
|
}
|
|
3385
3422
|
const { href, text, onClick } = additionalInfo;
|
|
3386
3423
|
if (href || onClick) {
|
|
3387
|
-
return /* @__PURE__ */ (0,
|
|
3388
|
-
|
|
3424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3425
|
+
import_components18.ListItem.AdditionalInfo,
|
|
3389
3426
|
{
|
|
3390
3427
|
action: __spreadValues({
|
|
3391
3428
|
label: text
|
|
@@ -3393,20 +3430,20 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3393
3430
|
}
|
|
3394
3431
|
);
|
|
3395
3432
|
}
|
|
3396
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components18.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3397
3434
|
};
|
|
3398
3435
|
|
|
3399
3436
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3400
|
-
var
|
|
3401
|
-
var
|
|
3437
|
+
var import_components19 = require("@transferwise/components");
|
|
3438
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3402
3439
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3403
3440
|
if (!callToAction) {
|
|
3404
3441
|
return void 0;
|
|
3405
3442
|
}
|
|
3406
3443
|
const { accessibilityDescription, title, context } = callToAction;
|
|
3407
3444
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
3408
|
-
return /* @__PURE__ */ (0,
|
|
3409
|
-
|
|
3445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3446
|
+
import_components19.ListItem.Button,
|
|
3410
3447
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
3411
3448
|
partiallyInteractive: !fullyInteractive,
|
|
3412
3449
|
priority,
|
|
@@ -3430,7 +3467,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
3430
3467
|
};
|
|
3431
3468
|
|
|
3432
3469
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3433
|
-
var
|
|
3470
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3434
3471
|
var ItemComponent = (props) => {
|
|
3435
3472
|
var _a, _b;
|
|
3436
3473
|
const {
|
|
@@ -3452,8 +3489,8 @@ var ItemComponent = (props) => {
|
|
|
3452
3489
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
3453
3490
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3454
3491
|
};
|
|
3455
|
-
return /* @__PURE__ */ (0,
|
|
3456
|
-
|
|
3492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3493
|
+
import_components20.ListItem,
|
|
3457
3494
|
{
|
|
3458
3495
|
title,
|
|
3459
3496
|
subtitle: description,
|
|
@@ -3469,19 +3506,19 @@ var ItemComponent = (props) => {
|
|
|
3469
3506
|
};
|
|
3470
3507
|
var getNavigationControl = (onClick, href) => {
|
|
3471
3508
|
if (href) {
|
|
3472
|
-
return /* @__PURE__ */ (0,
|
|
3509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ListItem.Navigation, { href });
|
|
3473
3510
|
}
|
|
3474
3511
|
if (onClick) {
|
|
3475
|
-
return /* @__PURE__ */ (0,
|
|
3512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ListItem.Navigation, { onClick });
|
|
3476
3513
|
}
|
|
3477
3514
|
return null;
|
|
3478
3515
|
};
|
|
3479
3516
|
|
|
3480
3517
|
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
3481
|
-
var
|
|
3518
|
+
var import_components21 = require("@transferwise/components");
|
|
3482
3519
|
var import_icons = require("@transferwise/icons");
|
|
3483
3520
|
var import_react_intl10 = require("react-intl");
|
|
3484
|
-
var
|
|
3521
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3485
3522
|
var SearchComponent = ({
|
|
3486
3523
|
state,
|
|
3487
3524
|
status,
|
|
@@ -3497,13 +3534,13 @@ var SearchComponent = ({
|
|
|
3497
3534
|
const getAddon = () => {
|
|
3498
3535
|
var _a;
|
|
3499
3536
|
if (status.type === "loading") {
|
|
3500
|
-
return { content: /* @__PURE__ */ (0,
|
|
3537
|
+
return { content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.ProcessIndicator, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3501
3538
|
}
|
|
3502
3539
|
if ((_a = state.search) == null ? void 0 : _a.query) {
|
|
3503
3540
|
return {
|
|
3504
3541
|
interactive: true,
|
|
3505
|
-
content: /* @__PURE__ */ (0,
|
|
3506
|
-
|
|
3542
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3543
|
+
import_components21.IconButton,
|
|
3507
3544
|
{
|
|
3508
3545
|
priority: "minimal",
|
|
3509
3546
|
size: 24,
|
|
@@ -3512,14 +3549,14 @@ var SearchComponent = ({
|
|
|
3512
3549
|
var _a2;
|
|
3513
3550
|
return (_a2 = state.search) == null ? void 0 : _a2.onChange("");
|
|
3514
3551
|
},
|
|
3515
|
-
children: /* @__PURE__ */ (0,
|
|
3552
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons.CrossCircleFill, {})
|
|
3516
3553
|
}
|
|
3517
3554
|
)
|
|
3518
3555
|
};
|
|
3519
3556
|
}
|
|
3520
3557
|
return void 0;
|
|
3521
3558
|
};
|
|
3522
|
-
return /* @__PURE__ */ (0,
|
|
3559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3523
3560
|
FieldInput_default,
|
|
3524
3561
|
{
|
|
3525
3562
|
id: "search",
|
|
@@ -3530,8 +3567,8 @@ var SearchComponent = ({
|
|
|
3530
3567
|
features,
|
|
3531
3568
|
control,
|
|
3532
3569
|
tags,
|
|
3533
|
-
children: /* @__PURE__ */ (0,
|
|
3534
|
-
|
|
3570
|
+
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)(
|
|
3571
|
+
import_components21.Input,
|
|
3535
3572
|
{
|
|
3536
3573
|
id: "search",
|
|
3537
3574
|
name: "search",
|
|
@@ -3549,14 +3586,14 @@ var SearchComponent = ({
|
|
|
3549
3586
|
};
|
|
3550
3587
|
|
|
3551
3588
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
3552
|
-
var
|
|
3589
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3553
3590
|
var SectionHeaderComponent = ({
|
|
3554
3591
|
title,
|
|
3555
3592
|
callToAction
|
|
3556
|
-
}) => /* @__PURE__ */ (0,
|
|
3593
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Header, { title, callToAction });
|
|
3557
3594
|
|
|
3558
3595
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
3559
|
-
var
|
|
3596
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3560
3597
|
var createCollectionRenderer = (canRender, components) => {
|
|
3561
3598
|
const componentsWithDefaults = __spreadValues({
|
|
3562
3599
|
Search: SearchComponent,
|
|
@@ -3570,35 +3607,35 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
3570
3607
|
canRenderType: "collection",
|
|
3571
3608
|
canRender,
|
|
3572
3609
|
render: (props) => {
|
|
3573
|
-
return /* @__PURE__ */ (0,
|
|
3610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
3574
3611
|
}
|
|
3575
3612
|
};
|
|
3576
3613
|
};
|
|
3577
3614
|
|
|
3578
3615
|
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
3579
3616
|
var import_react_intl11 = require("react-intl");
|
|
3580
|
-
var
|
|
3617
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3581
3618
|
var CollectionRendererComponent = (props) => {
|
|
3582
3619
|
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,
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Search4, __spreadValues({}, props)),
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Filters, __spreadValues({}, props)),
|
|
3623
|
+
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
3624
|
] });
|
|
3588
3625
|
};
|
|
3589
3626
|
var SearchError = ({ retry }) => {
|
|
3590
3627
|
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
3591
|
-
return /* @__PURE__ */ (0,
|
|
3628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_components22.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
3592
3629
|
formatMessage(generic_error_messages_default.genericError),
|
|
3593
3630
|
"\xA0",
|
|
3594
|
-
/* @__PURE__ */ (0,
|
|
3631
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components22.Link, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
3595
3632
|
] });
|
|
3596
3633
|
};
|
|
3597
3634
|
var CollectionRenderer = createCollectionRenderer(() => true);
|
|
3598
3635
|
var CollectionRenderer_default = CollectionRenderer;
|
|
3599
3636
|
|
|
3600
3637
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3601
|
-
var
|
|
3638
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
3602
3639
|
|
|
3603
3640
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
3604
3641
|
var import_react10 = require("react");
|
|
@@ -3621,7 +3658,7 @@ var useIsCollapsed = () => {
|
|
|
3621
3658
|
};
|
|
3622
3659
|
|
|
3623
3660
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3624
|
-
var
|
|
3661
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3625
3662
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
3626
3663
|
var ColumnsRenderer = {
|
|
3627
3664
|
canRenderType: "columns",
|
|
@@ -3632,12 +3669,12 @@ function ColumnsRendererComponent(props) {
|
|
|
3632
3669
|
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3633
3670
|
const isCollapsed = useIsCollapsed();
|
|
3634
3671
|
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,
|
|
3672
|
+
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
3673
|
+
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
3674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3638
3675
|
"div",
|
|
3639
3676
|
{
|
|
3640
|
-
className: (0,
|
|
3677
|
+
className: (0, import_classnames11.default)(
|
|
3641
3678
|
"df-columns-renderer-container",
|
|
3642
3679
|
getMargin(margin),
|
|
3643
3680
|
{
|
|
@@ -3656,7 +3693,7 @@ function ColumnsRendererComponent(props) {
|
|
|
3656
3693
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
3657
3694
|
|
|
3658
3695
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
3659
|
-
var
|
|
3696
|
+
var import_components23 = require("@transferwise/components");
|
|
3660
3697
|
|
|
3661
3698
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3662
3699
|
var import_react11 = require("react");
|
|
@@ -3756,7 +3793,7 @@ var matchesDateRule = (date, weekday, rule) => {
|
|
|
3756
3793
|
var isDate = (date) => date !== null;
|
|
3757
3794
|
|
|
3758
3795
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
3759
|
-
var
|
|
3796
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3760
3797
|
function VariableDateInput({
|
|
3761
3798
|
control,
|
|
3762
3799
|
inputProps
|
|
@@ -3774,8 +3811,8 @@ function VariableDateInput({
|
|
|
3774
3811
|
} = inputProps;
|
|
3775
3812
|
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
3776
3813
|
if (control === "date-lookup") {
|
|
3777
|
-
return /* @__PURE__ */ (0,
|
|
3778
|
-
|
|
3814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3815
|
+
import_components23.DateLookup,
|
|
3779
3816
|
{
|
|
3780
3817
|
value: dateStringToDateOrNull(inputProps.value),
|
|
3781
3818
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -3795,8 +3832,8 @@ function VariableDateInput({
|
|
|
3795
3832
|
}
|
|
3796
3833
|
);
|
|
3797
3834
|
}
|
|
3798
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
-
|
|
3835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3836
|
+
import_components23.DateInput,
|
|
3800
3837
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
3801
3838
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
3802
3839
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -3812,7 +3849,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
3812
3849
|
var VariableDateInput_default = VariableDateInput;
|
|
3813
3850
|
|
|
3814
3851
|
// ../renderers/src/DateInputRenderer.tsx
|
|
3815
|
-
var
|
|
3852
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3816
3853
|
var DateInputRenderer = {
|
|
3817
3854
|
canRenderType: "input-date",
|
|
3818
3855
|
render: (props) => {
|
|
@@ -3837,7 +3874,7 @@ var DateInputRenderer = {
|
|
|
3837
3874
|
]);
|
|
3838
3875
|
const value = initialValue != null ? initialValue : "";
|
|
3839
3876
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
3840
|
-
return /* @__PURE__ */ (0,
|
|
3877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3841
3878
|
FieldInput_default,
|
|
3842
3879
|
{
|
|
3843
3880
|
id,
|
|
@@ -3850,7 +3887,7 @@ var DateInputRenderer = {
|
|
|
3850
3887
|
features: props.features,
|
|
3851
3888
|
control,
|
|
3852
3889
|
tags: props.tags,
|
|
3853
|
-
children: /* @__PURE__ */ (0,
|
|
3890
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(VariableDateInput_default, { control, inputProps })
|
|
3854
3891
|
}
|
|
3855
3892
|
);
|
|
3856
3893
|
}
|
|
@@ -3858,10 +3895,10 @@ var DateInputRenderer = {
|
|
|
3858
3895
|
var DateInputRenderer_default = DateInputRenderer;
|
|
3859
3896
|
|
|
3860
3897
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
3861
|
-
var
|
|
3898
|
+
var import_components26 = require("@transferwise/components");
|
|
3862
3899
|
|
|
3863
3900
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3864
|
-
var
|
|
3901
|
+
var import_components25 = require("@transferwise/components");
|
|
3865
3902
|
var import_react12 = require("react");
|
|
3866
3903
|
var import_react_intl17 = require("react-intl");
|
|
3867
3904
|
|
|
@@ -3933,7 +3970,7 @@ function filterAndSortItems(options, query) {
|
|
|
3933
3970
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
3934
3971
|
|
|
3935
3972
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3936
|
-
var
|
|
3973
|
+
var import_components24 = require("@transferwise/components");
|
|
3937
3974
|
var import_react_intl16 = require("react-intl");
|
|
3938
3975
|
|
|
3939
3976
|
// ../renderers/src/messages/group.messages.ts
|
|
@@ -3972,7 +4009,7 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
3972
4009
|
};
|
|
3973
4010
|
|
|
3974
4011
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3975
|
-
var
|
|
4012
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3976
4013
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3977
4014
|
var isGroupedDecision = (options) => {
|
|
3978
4015
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
@@ -3982,9 +4019,9 @@ var GroupedDecisionList = (_a) => {
|
|
|
3982
4019
|
const { formatMessage } = (0, import_react_intl16.useIntl)();
|
|
3983
4020
|
const { options } = rest;
|
|
3984
4021
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
3985
|
-
return /* @__PURE__ */ (0,
|
|
3986
|
-
/* @__PURE__ */ (0,
|
|
3987
|
-
|
|
4022
|
+
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: [
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4024
|
+
import_components24.Header,
|
|
3988
4025
|
{
|
|
3989
4026
|
as: "h2",
|
|
3990
4027
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -3995,18 +4032,18 @@ var GroupedDecisionList = (_a) => {
|
|
|
3995
4032
|
};
|
|
3996
4033
|
|
|
3997
4034
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3998
|
-
var
|
|
3999
|
-
var
|
|
4035
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
4036
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4000
4037
|
var DecisionWrapper = (props) => {
|
|
4001
4038
|
const { margin, control, title, tags } = props;
|
|
4002
|
-
return /* @__PURE__ */ (0,
|
|
4003
|
-
title && /* @__PURE__ */ (0,
|
|
4004
|
-
control === "filtered" ? /* @__PURE__ */ (0,
|
|
4039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: (0, import_classnames12.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4040
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components25.Header, { as: "h2", title }),
|
|
4041
|
+
control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
4005
4042
|
] });
|
|
4006
4043
|
};
|
|
4007
4044
|
var UnfilteredDecisionList = (_a) => {
|
|
4008
4045
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4009
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
4046
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
4010
4047
|
};
|
|
4011
4048
|
var FilteredDecisionList = (props) => {
|
|
4012
4049
|
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
@@ -4014,9 +4051,9 @@ var FilteredDecisionList = (props) => {
|
|
|
4014
4051
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
4015
4052
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
4016
4053
|
const isGrouped = isGroupedDecision(options);
|
|
4017
|
-
return /* @__PURE__ */ (0,
|
|
4018
|
-
/* @__PURE__ */ (0,
|
|
4019
|
-
|
|
4054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
4055
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4056
|
+
import_components25.SearchInput,
|
|
4020
4057
|
{
|
|
4021
4058
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
4022
4059
|
value: query,
|
|
@@ -4027,25 +4064,25 @@ var FilteredDecisionList = (props) => {
|
|
|
4027
4064
|
}
|
|
4028
4065
|
}
|
|
4029
4066
|
),
|
|
4030
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
4031
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
4067
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
4068
|
+
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
4069
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
4033
4070
|
control,
|
|
4034
4071
|
className: query.length === 0 ? "m-t-3" : "",
|
|
4035
4072
|
options: filteredOptions
|
|
4036
|
-
}) : /* @__PURE__ */ (0,
|
|
4073
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
4037
4074
|
] })
|
|
4038
4075
|
] });
|
|
4039
4076
|
};
|
|
4040
4077
|
|
|
4041
4078
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4042
|
-
var
|
|
4079
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4043
4080
|
var DecisionRenderer = {
|
|
4044
4081
|
canRenderType: "decision",
|
|
4045
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4082
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
4046
4083
|
};
|
|
4047
4084
|
var renderDecisionList = ({ options, control }) => {
|
|
4048
|
-
return /* @__PURE__ */ (0,
|
|
4085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: options.map((_a) => {
|
|
4049
4086
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
4050
4087
|
const {
|
|
4051
4088
|
description,
|
|
@@ -4058,8 +4095,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4058
4095
|
supportingValues,
|
|
4059
4096
|
tags
|
|
4060
4097
|
} = rest;
|
|
4061
|
-
return /* @__PURE__ */ (0,
|
|
4062
|
-
|
|
4098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4099
|
+
import_components26.ListItem,
|
|
4063
4100
|
{
|
|
4064
4101
|
title: itemTitle,
|
|
4065
4102
|
subtitle: description,
|
|
@@ -4070,7 +4107,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4070
4107
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
4071
4108
|
prompt: getInlineAlert(inlineAlert),
|
|
4072
4109
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
4073
|
-
control: /* @__PURE__ */ (0,
|
|
4110
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components26.ListItem.Navigation, __spreadValues({}, getAnchorProps()))
|
|
4074
4111
|
},
|
|
4075
4112
|
JSON.stringify(rest)
|
|
4076
4113
|
);
|
|
@@ -4079,9 +4116,9 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4079
4116
|
var DecisionRenderer_default = DecisionRenderer;
|
|
4080
4117
|
|
|
4081
4118
|
// ../renderers/src/DividerRenderer.tsx
|
|
4082
|
-
var
|
|
4083
|
-
var
|
|
4084
|
-
var
|
|
4119
|
+
var import_components27 = require("@transferwise/components");
|
|
4120
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
4121
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4085
4122
|
var mapControlToLevel = (control) => {
|
|
4086
4123
|
switch (control) {
|
|
4087
4124
|
case "section":
|
|
@@ -4094,10 +4131,10 @@ var mapControlToLevel = (control) => {
|
|
|
4094
4131
|
};
|
|
4095
4132
|
var DividerRenderer = {
|
|
4096
4133
|
canRenderType: "divider",
|
|
4097
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4098
|
-
|
|
4134
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4135
|
+
import_components27.Divider,
|
|
4099
4136
|
{
|
|
4100
|
-
className: (0,
|
|
4137
|
+
className: (0, import_classnames13.default)(
|
|
4101
4138
|
"m-t-0",
|
|
4102
4139
|
"d-block",
|
|
4103
4140
|
getMargin(margin),
|
|
@@ -4110,7 +4147,7 @@ var DividerRenderer = {
|
|
|
4110
4147
|
var DividerRenderer_default = DividerRenderer;
|
|
4111
4148
|
|
|
4112
4149
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4113
|
-
var
|
|
4150
|
+
var import_components28 = require("@transferwise/components");
|
|
4114
4151
|
|
|
4115
4152
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
4116
4153
|
var import_react_intl18 = require("react-intl");
|
|
@@ -4140,7 +4177,7 @@ var external_confirmation_messages_default = (0, import_react_intl18.defineMessa
|
|
|
4140
4177
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4141
4178
|
var import_react_intl19 = require("react-intl");
|
|
4142
4179
|
var import_react13 = require("react");
|
|
4143
|
-
var
|
|
4180
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4144
4181
|
var ExternalConfirmationRenderer = {
|
|
4145
4182
|
canRenderType: "external-confirmation",
|
|
4146
4183
|
render: ExternalConfirmationRendererComponent
|
|
@@ -4157,16 +4194,16 @@ function ExternalConfirmationRendererComponent({
|
|
|
4157
4194
|
(0, import_react13.useEffect)(() => {
|
|
4158
4195
|
open();
|
|
4159
4196
|
}, []);
|
|
4160
|
-
return /* @__PURE__ */ (0,
|
|
4161
|
-
|
|
4197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4198
|
+
import_components28.Modal,
|
|
4162
4199
|
{
|
|
4163
4200
|
open: visible,
|
|
4164
4201
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
4165
|
-
body: /* @__PURE__ */ (0,
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4167
|
-
/* @__PURE__ */ (0,
|
|
4168
|
-
/* @__PURE__ */ (0,
|
|
4169
|
-
|
|
4202
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
4203
|
+
/* @__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) }) }),
|
|
4204
|
+
/* @__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: [
|
|
4205
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4206
|
+
import_components28.Button,
|
|
4170
4207
|
{
|
|
4171
4208
|
v2: true,
|
|
4172
4209
|
block: true,
|
|
@@ -4179,7 +4216,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
4179
4216
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
4180
4217
|
}
|
|
4181
4218
|
),
|
|
4182
|
-
/* @__PURE__ */ (0,
|
|
4219
|
+
/* @__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
4220
|
] }) })
|
|
4184
4221
|
] }),
|
|
4185
4222
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -4197,51 +4234,51 @@ function getOrigin(url) {
|
|
|
4197
4234
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
4198
4235
|
|
|
4199
4236
|
// ../renderers/src/FormRenderer.tsx
|
|
4200
|
-
var
|
|
4201
|
-
var
|
|
4237
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4238
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4202
4239
|
var FormRenderer = {
|
|
4203
4240
|
canRenderType: "form",
|
|
4204
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4241
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: (0, import_classnames14.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
4205
4242
|
};
|
|
4206
4243
|
var FormRenderer_default = FormRenderer;
|
|
4207
4244
|
|
|
4208
4245
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
4209
|
-
var
|
|
4210
|
-
var
|
|
4246
|
+
var import_components29 = require("@transferwise/components");
|
|
4247
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4211
4248
|
var FormSectionRenderer = {
|
|
4212
4249
|
canRenderType: "form-section",
|
|
4213
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0,
|
|
4214
|
-
title && /* @__PURE__ */ (0,
|
|
4215
|
-
|
|
4250
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4251
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4252
|
+
import_components29.Header,
|
|
4216
4253
|
{
|
|
4217
4254
|
as: "h2",
|
|
4218
4255
|
title
|
|
4219
4256
|
}
|
|
4220
4257
|
),
|
|
4221
|
-
description && /* @__PURE__ */ (0,
|
|
4258
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { children: description }),
|
|
4222
4259
|
children
|
|
4223
4260
|
] })
|
|
4224
4261
|
};
|
|
4225
4262
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
4226
4263
|
|
|
4227
4264
|
// ../renderers/src/HeadingRenderer.tsx
|
|
4228
|
-
var
|
|
4229
|
-
var
|
|
4230
|
-
var
|
|
4265
|
+
var import_components30 = require("@transferwise/components");
|
|
4266
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4267
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4231
4268
|
var HeadingRenderer = {
|
|
4232
4269
|
canRenderType: "heading",
|
|
4233
4270
|
render: Heading
|
|
4234
4271
|
};
|
|
4235
4272
|
function Heading(props) {
|
|
4236
4273
|
const { text, size, align, margin, control } = props;
|
|
4237
|
-
const className = (0,
|
|
4274
|
+
const className = (0, import_classnames15.default)(
|
|
4238
4275
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4239
4276
|
controlAndTagsToCSSClass(props)
|
|
4240
4277
|
);
|
|
4241
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
4278
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(StandardHeading, { size, text, className });
|
|
4242
4279
|
}
|
|
4243
4280
|
function DisplayHeading({ size, text, className }) {
|
|
4244
|
-
return /* @__PURE__ */ (0,
|
|
4281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components30.Display, { type: getDisplayType(size), className, children: text });
|
|
4245
4282
|
}
|
|
4246
4283
|
var getDisplayType = (size) => {
|
|
4247
4284
|
switch (size) {
|
|
@@ -4257,7 +4294,7 @@ var getDisplayType = (size) => {
|
|
|
4257
4294
|
}
|
|
4258
4295
|
};
|
|
4259
4296
|
function StandardHeading({ size, text, className }) {
|
|
4260
|
-
return /* @__PURE__ */ (0,
|
|
4297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components30.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
4261
4298
|
}
|
|
4262
4299
|
var getTitleTypeBySize = (size) => {
|
|
4263
4300
|
var _a;
|
|
@@ -4273,8 +4310,8 @@ var getTitleTypeBySize = (size) => {
|
|
|
4273
4310
|
var HeadingRenderer_default = HeadingRenderer;
|
|
4274
4311
|
|
|
4275
4312
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4276
|
-
var
|
|
4277
|
-
var
|
|
4313
|
+
var import_components31 = require("@transferwise/components");
|
|
4314
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4278
4315
|
var import_react14 = require("react");
|
|
4279
4316
|
|
|
4280
4317
|
// ../renderers/src/utils/api-utils.ts
|
|
@@ -4285,7 +4322,7 @@ function isRelativePath(url = "") {
|
|
|
4285
4322
|
}
|
|
4286
4323
|
|
|
4287
4324
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4288
|
-
var
|
|
4325
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4289
4326
|
function UrlImage({
|
|
4290
4327
|
accessibilityDescription,
|
|
4291
4328
|
align,
|
|
@@ -4302,18 +4339,18 @@ function UrlImage({
|
|
|
4302
4339
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
4303
4340
|
}
|
|
4304
4341
|
}, [uri, httpClient]);
|
|
4305
|
-
return /* @__PURE__ */ (0,
|
|
4342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4306
4343
|
"div",
|
|
4307
4344
|
{
|
|
4308
|
-
className: (0,
|
|
4345
|
+
className: (0, import_classnames16.default)(
|
|
4309
4346
|
"df-image",
|
|
4310
4347
|
align,
|
|
4311
4348
|
size || "md",
|
|
4312
4349
|
getMargin(margin),
|
|
4313
4350
|
controlAndTagsToCSSClass({ control, tags })
|
|
4314
4351
|
),
|
|
4315
|
-
children: /* @__PURE__ */ (0,
|
|
4316
|
-
|
|
4352
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4353
|
+
import_components31.Image,
|
|
4317
4354
|
{
|
|
4318
4355
|
className: "df-reserve-space",
|
|
4319
4356
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -4358,19 +4395,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4358
4395
|
};
|
|
4359
4396
|
|
|
4360
4397
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
4361
|
-
var
|
|
4398
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4362
4399
|
var ImageRenderer = {
|
|
4363
4400
|
canRenderType: "image",
|
|
4364
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
4401
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(UrlImage, __spreadValues({}, props))
|
|
4365
4402
|
};
|
|
4366
4403
|
|
|
4367
4404
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
4368
4405
|
var ImageRenderer_default = ImageRenderer;
|
|
4369
4406
|
|
|
4370
4407
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
4371
|
-
var
|
|
4372
|
-
var
|
|
4373
|
-
var
|
|
4408
|
+
var import_components32 = require("@transferwise/components");
|
|
4409
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
4410
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4374
4411
|
var doContext = ["positive", "neutral", "proposition"];
|
|
4375
4412
|
var dontContext = ["warning", "negative"];
|
|
4376
4413
|
var InstructionsRenderer = {
|
|
@@ -4378,16 +4415,16 @@ var InstructionsRenderer = {
|
|
|
4378
4415
|
render: ({ items, margin, title, control, tags }) => {
|
|
4379
4416
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
4380
4417
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
4381
|
-
return /* @__PURE__ */ (0,
|
|
4382
|
-
title ? /* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: (0, import_classnames17.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4419
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components32.Header, { title }) : null,
|
|
4420
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components32.InstructionsList, { dos, donts })
|
|
4384
4421
|
] });
|
|
4385
4422
|
}
|
|
4386
4423
|
};
|
|
4387
4424
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
4388
4425
|
|
|
4389
4426
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4390
|
-
var
|
|
4427
|
+
var import_components33 = require("@transferwise/components");
|
|
4391
4428
|
|
|
4392
4429
|
// ../renderers/src/utils/input-utils.ts
|
|
4393
4430
|
var onWheel = (event) => {
|
|
@@ -4412,7 +4449,7 @@ function pick(obj, ...keys) {
|
|
|
4412
4449
|
}
|
|
4413
4450
|
|
|
4414
4451
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4415
|
-
var
|
|
4452
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4416
4453
|
var IntegerInputRenderer = {
|
|
4417
4454
|
canRenderType: "input-integer",
|
|
4418
4455
|
render: (props) => {
|
|
@@ -4427,7 +4464,7 @@ var IntegerInputRenderer = {
|
|
|
4427
4464
|
"maximum",
|
|
4428
4465
|
"minimum"
|
|
4429
4466
|
);
|
|
4430
|
-
return /* @__PURE__ */ (0,
|
|
4467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4431
4468
|
FieldInput_default,
|
|
4432
4469
|
{
|
|
4433
4470
|
id,
|
|
@@ -4440,8 +4477,8 @@ var IntegerInputRenderer = {
|
|
|
4440
4477
|
features: props.features,
|
|
4441
4478
|
control: props.control,
|
|
4442
4479
|
tags: props.tags,
|
|
4443
|
-
children: /* @__PURE__ */ (0,
|
|
4444
|
-
|
|
4480
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components33.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4481
|
+
import_components33.Input,
|
|
4445
4482
|
__spreadValues({
|
|
4446
4483
|
id,
|
|
4447
4484
|
name: id,
|
|
@@ -4463,13 +4500,13 @@ var IntegerInputRenderer = {
|
|
|
4463
4500
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
4464
4501
|
|
|
4465
4502
|
// ../renderers/src/ListRenderer.tsx
|
|
4466
|
-
var
|
|
4467
|
-
var
|
|
4503
|
+
var import_components35 = require("@transferwise/components");
|
|
4504
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4468
4505
|
|
|
4469
4506
|
// ../renderers/src/components/Header.tsx
|
|
4470
|
-
var
|
|
4471
|
-
var
|
|
4472
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0,
|
|
4507
|
+
var import_components34 = require("@transferwise/components");
|
|
4508
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4509
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components34.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
4473
4510
|
var getHeaderAction = (callToAction) => {
|
|
4474
4511
|
if (!callToAction) {
|
|
4475
4512
|
return void 0;
|
|
@@ -4481,11 +4518,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
4481
4518
|
};
|
|
4482
4519
|
|
|
4483
4520
|
// ../renderers/src/ListRenderer.tsx
|
|
4484
|
-
var
|
|
4521
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4485
4522
|
var ListRenderer = {
|
|
4486
4523
|
canRenderType: "list",
|
|
4487
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
4488
|
-
/* @__PURE__ */ (0,
|
|
4524
|
+
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: [
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Header, { title, callToAction }),
|
|
4489
4526
|
items.map((item) => {
|
|
4490
4527
|
var _a, _b;
|
|
4491
4528
|
const {
|
|
@@ -4502,8 +4539,8 @@ var ListRenderer = {
|
|
|
4502
4539
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4503
4540
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4504
4541
|
};
|
|
4505
|
-
return /* @__PURE__ */ (0,
|
|
4506
|
-
|
|
4542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4543
|
+
import_components35.ListItem,
|
|
4507
4544
|
{
|
|
4508
4545
|
title: itemTitle,
|
|
4509
4546
|
subtitle: description,
|
|
@@ -4522,17 +4559,17 @@ var ListRenderer = {
|
|
|
4522
4559
|
var ListRenderer_default = ListRenderer;
|
|
4523
4560
|
|
|
4524
4561
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
4525
|
-
var
|
|
4526
|
-
var
|
|
4527
|
-
var
|
|
4562
|
+
var import_components36 = require("@transferwise/components");
|
|
4563
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4564
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4528
4565
|
var LoadingIndicatorRenderer = {
|
|
4529
4566
|
canRenderType: "loading-indicator",
|
|
4530
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4531
|
-
|
|
4567
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4568
|
+
import_components36.Loader,
|
|
4532
4569
|
{
|
|
4533
4570
|
size,
|
|
4534
4571
|
classNames: {
|
|
4535
|
-
"tw-loader": (0,
|
|
4572
|
+
"tw-loader": (0, import_classnames19.default)(
|
|
4536
4573
|
"tw-loader",
|
|
4537
4574
|
"m-x-auto",
|
|
4538
4575
|
getMargin(margin),
|
|
@@ -4546,24 +4583,24 @@ var LoadingIndicatorRenderer = {
|
|
|
4546
4583
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
4547
4584
|
|
|
4548
4585
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
4549
|
-
var
|
|
4550
|
-
var
|
|
4551
|
-
var
|
|
4586
|
+
var import_components37 = require("@transferwise/components");
|
|
4587
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4588
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4552
4589
|
var MarkdownRenderer = {
|
|
4553
4590
|
canRenderType: "markdown",
|
|
4554
4591
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
4555
4592
|
const isLarge = !["xs", "sm"].includes(size);
|
|
4556
|
-
return /* @__PURE__ */ (0,
|
|
4593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4557
4594
|
"div",
|
|
4558
4595
|
{
|
|
4559
|
-
className: (0,
|
|
4596
|
+
className: (0, import_classnames20.default)(
|
|
4560
4597
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4561
4598
|
controlAndTagsToCSSClass({ control, tags })
|
|
4562
4599
|
),
|
|
4563
|
-
children: /* @__PURE__ */ (0,
|
|
4564
|
-
|
|
4600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4601
|
+
import_components37.Markdown,
|
|
4565
4602
|
{
|
|
4566
|
-
className: (0,
|
|
4603
|
+
className: (0, import_classnames20.default)("df-markdown", {
|
|
4567
4604
|
"np-text-body-large": isLarge,
|
|
4568
4605
|
"np-text-body-default": !isLarge
|
|
4569
4606
|
}),
|
|
@@ -4578,17 +4615,17 @@ var MarkdownRenderer = {
|
|
|
4578
4615
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
4579
4616
|
|
|
4580
4617
|
// ../renderers/src/MediaRenderer.tsx
|
|
4581
|
-
var
|
|
4582
|
-
var
|
|
4618
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
4619
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4583
4620
|
var MediaRenderer = {
|
|
4584
4621
|
canRenderType: "media",
|
|
4585
4622
|
render: (_a) => {
|
|
4586
4623
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
4587
4624
|
switch (media.type) {
|
|
4588
4625
|
case "avatar":
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
4626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4590
4627
|
case "image":
|
|
4591
|
-
return /* @__PURE__ */ (0,
|
|
4628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4592
4629
|
case "legacy":
|
|
4593
4630
|
return null;
|
|
4594
4631
|
}
|
|
@@ -4602,16 +4639,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
4602
4639
|
control,
|
|
4603
4640
|
tags
|
|
4604
4641
|
}) => {
|
|
4605
|
-
return /* @__PURE__ */ (0,
|
|
4642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4606
4643
|
"div",
|
|
4607
4644
|
{
|
|
4608
|
-
className: (0,
|
|
4645
|
+
className: (0, import_classnames21.default)(
|
|
4609
4646
|
"df-media-layout-avatar",
|
|
4610
4647
|
align,
|
|
4611
4648
|
getMargin(margin),
|
|
4612
4649
|
controlAndTagsToCSSClass({ control, tags })
|
|
4613
4650
|
),
|
|
4614
|
-
children: /* @__PURE__ */ (0,
|
|
4651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Media, { media, size: mapAvatarMediaSize(size) })
|
|
4615
4652
|
}
|
|
4616
4653
|
);
|
|
4617
4654
|
};
|
|
@@ -4621,7 +4658,7 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
4621
4658
|
} = _b, rest = __objRest(_b, [
|
|
4622
4659
|
"media"
|
|
4623
4660
|
]);
|
|
4624
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
4661
|
+
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
4662
|
};
|
|
4626
4663
|
var mapAvatarMediaSize = (size) => {
|
|
4627
4664
|
switch (size) {
|
|
@@ -4639,22 +4676,22 @@ var mapAvatarMediaSize = (size) => {
|
|
|
4639
4676
|
};
|
|
4640
4677
|
|
|
4641
4678
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
4642
|
-
var
|
|
4643
|
-
var
|
|
4679
|
+
var import_components38 = require("@transferwise/components");
|
|
4680
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
4644
4681
|
var import_react15 = require("react");
|
|
4645
|
-
var
|
|
4682
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4646
4683
|
var ModalLayoutRenderer = {
|
|
4647
4684
|
canRenderType: "modal-layout",
|
|
4648
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4685
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DFModal, __spreadValues({}, props))
|
|
4649
4686
|
};
|
|
4650
4687
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
4651
4688
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
4652
4689
|
const [visible, setVisible] = (0, import_react15.useState)(false);
|
|
4653
4690
|
const { children, title } = content;
|
|
4654
|
-
return /* @__PURE__ */ (0,
|
|
4655
|
-
/* @__PURE__ */ (0,
|
|
4656
|
-
/* @__PURE__ */ (0,
|
|
4657
|
-
|
|
4691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: (0, import_classnames22.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components38.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
4693
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4694
|
+
import_components38.Modal,
|
|
4658
4695
|
{
|
|
4659
4696
|
scroll: "content",
|
|
4660
4697
|
open: visible,
|
|
@@ -4668,13 +4705,13 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
4668
4705
|
}
|
|
4669
4706
|
|
|
4670
4707
|
// ../renderers/src/ModalRenderer.tsx
|
|
4671
|
-
var
|
|
4672
|
-
var
|
|
4708
|
+
var import_components39 = require("@transferwise/components");
|
|
4709
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4673
4710
|
var ModalRenderer = {
|
|
4674
4711
|
canRenderType: "modal",
|
|
4675
4712
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
4676
|
-
return /* @__PURE__ */ (0,
|
|
4677
|
-
|
|
4713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4714
|
+
import_components39.Modal,
|
|
4678
4715
|
{
|
|
4679
4716
|
open,
|
|
4680
4717
|
title,
|
|
@@ -4687,10 +4724,10 @@ var ModalRenderer = {
|
|
|
4687
4724
|
};
|
|
4688
4725
|
|
|
4689
4726
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
4690
|
-
var
|
|
4727
|
+
var import_components40 = require("@transferwise/components");
|
|
4691
4728
|
var import_react16 = require("react");
|
|
4692
4729
|
var import_react_intl20 = require("react-intl");
|
|
4693
|
-
var
|
|
4730
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4694
4731
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4695
4732
|
var MoneyInputRenderer = {
|
|
4696
4733
|
canRenderType: "money-input",
|
|
@@ -4720,7 +4757,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
4720
4757
|
}
|
|
4721
4758
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
4722
4759
|
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
4723
|
-
return /* @__PURE__ */ (0,
|
|
4760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4724
4761
|
FieldInput_default,
|
|
4725
4762
|
{
|
|
4726
4763
|
id: uid,
|
|
@@ -4731,8 +4768,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
4731
4768
|
features,
|
|
4732
4769
|
control,
|
|
4733
4770
|
tags,
|
|
4734
|
-
children: /* @__PURE__ */ (0,
|
|
4735
|
-
|
|
4771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4772
|
+
import_components40.MoneyInput,
|
|
4736
4773
|
{
|
|
4737
4774
|
amount: parseFloatOrNull(amountValue),
|
|
4738
4775
|
searchPlaceholder: "",
|
|
@@ -4793,7 +4830,7 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
4793
4830
|
}
|
|
4794
4831
|
|
|
4795
4832
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4796
|
-
var
|
|
4833
|
+
var import_components41 = require("@transferwise/components");
|
|
4797
4834
|
var import_react17 = require("react");
|
|
4798
4835
|
var import_react_intl21 = require("react-intl");
|
|
4799
4836
|
|
|
@@ -4803,7 +4840,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
4803
4840
|
}));
|
|
4804
4841
|
|
|
4805
4842
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4806
|
-
var
|
|
4843
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4807
4844
|
function InlineComponent(props) {
|
|
4808
4845
|
const {
|
|
4809
4846
|
id,
|
|
@@ -4824,9 +4861,9 @@ function InlineComponent(props) {
|
|
|
4824
4861
|
const { formatMessage } = (0, import_react_intl21.useIntl)();
|
|
4825
4862
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
4826
4863
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
4827
|
-
return /* @__PURE__ */ (0,
|
|
4828
|
-
filtered && /* @__PURE__ */ (0,
|
|
4829
|
-
|
|
4864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
4865
|
+
filtered && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4866
|
+
import_components41.SearchInput,
|
|
4830
4867
|
{
|
|
4831
4868
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
4832
4869
|
disabled,
|
|
@@ -4838,7 +4875,7 @@ function InlineComponent(props) {
|
|
|
4838
4875
|
}
|
|
4839
4876
|
}
|
|
4840
4877
|
),
|
|
4841
|
-
/* @__PURE__ */ (0,
|
|
4878
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4842
4879
|
FieldInput_default,
|
|
4843
4880
|
{
|
|
4844
4881
|
id,
|
|
@@ -4863,8 +4900,8 @@ function InlineComponent(props) {
|
|
|
4863
4900
|
childrenProps
|
|
4864
4901
|
} = option;
|
|
4865
4902
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4867
|
-
|
|
4903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4904
|
+
import_components41.ListItem,
|
|
4868
4905
|
{
|
|
4869
4906
|
title: itemTitle,
|
|
4870
4907
|
subtitle,
|
|
@@ -4872,10 +4909,10 @@ function InlineComponent(props) {
|
|
|
4872
4909
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
4873
4910
|
media: getMedia(media, false),
|
|
4874
4911
|
prompt: getInlineAlert(inlineAlert),
|
|
4875
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
4912
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components41.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
4876
4913
|
disabled: disabled || optionDisabled,
|
|
4877
|
-
control: /* @__PURE__ */ (0,
|
|
4878
|
-
|
|
4914
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4915
|
+
import_components41.ListItem.Checkbox,
|
|
4879
4916
|
{
|
|
4880
4917
|
checked: selectedIndices.includes(index),
|
|
4881
4918
|
onChange: (e) => {
|
|
@@ -4894,7 +4931,7 @@ function InlineComponent(props) {
|
|
|
4894
4931
|
}
|
|
4895
4932
|
|
|
4896
4933
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
4897
|
-
var
|
|
4934
|
+
var import_components42 = require("@transferwise/components");
|
|
4898
4935
|
var import_react18 = require("react");
|
|
4899
4936
|
var import_react_intl23 = require("react-intl");
|
|
4900
4937
|
|
|
@@ -4909,7 +4946,7 @@ var multi_select_messages_default = (0, import_react_intl22.defineMessages)({
|
|
|
4909
4946
|
});
|
|
4910
4947
|
|
|
4911
4948
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
4912
|
-
var
|
|
4949
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4913
4950
|
function DefaultComponent(props) {
|
|
4914
4951
|
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
4915
4952
|
const [stagedIndices, setStagedIndices] = (0, import_react18.useState)();
|
|
@@ -4953,12 +4990,12 @@ function DefaultComponent(props) {
|
|
|
4953
4990
|
const contentProps = {
|
|
4954
4991
|
title: option.title,
|
|
4955
4992
|
description: option.description,
|
|
4956
|
-
icon: /* @__PURE__ */ (0,
|
|
4993
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
4957
4994
|
};
|
|
4958
|
-
return /* @__PURE__ */ (0,
|
|
4995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components42.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
4959
4996
|
};
|
|
4960
4997
|
const extraProps = { autoComplete };
|
|
4961
|
-
return /* @__PURE__ */ (0,
|
|
4998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4962
4999
|
FieldInput_default,
|
|
4963
5000
|
{
|
|
4964
5001
|
id,
|
|
@@ -4969,8 +5006,8 @@ function DefaultComponent(props) {
|
|
|
4969
5006
|
features,
|
|
4970
5007
|
control,
|
|
4971
5008
|
tags,
|
|
4972
|
-
children: /* @__PURE__ */ (0,
|
|
4973
|
-
|
|
5009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5010
|
+
import_components42.SelectInput,
|
|
4974
5011
|
__spreadValues({
|
|
4975
5012
|
id,
|
|
4976
5013
|
items: options.map((option, index) => {
|
|
@@ -5008,8 +5045,8 @@ function DefaultComponent(props) {
|
|
|
5008
5045
|
}
|
|
5009
5046
|
|
|
5010
5047
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
5011
|
-
var
|
|
5012
|
-
var
|
|
5048
|
+
var import_components43 = require("@transferwise/components");
|
|
5049
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5013
5050
|
function InlineCheckboxComponent(props) {
|
|
5014
5051
|
const {
|
|
5015
5052
|
id,
|
|
@@ -5025,7 +5062,7 @@ function InlineCheckboxComponent(props) {
|
|
|
5025
5062
|
tags,
|
|
5026
5063
|
onSelect
|
|
5027
5064
|
} = props;
|
|
5028
|
-
return /* @__PURE__ */ (0,
|
|
5065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5029
5066
|
FieldInput_default,
|
|
5030
5067
|
{
|
|
5031
5068
|
id,
|
|
@@ -5056,35 +5093,35 @@ function InlineCheckboxComponent(props) {
|
|
|
5056
5093
|
onSelect(newSelectedIndices);
|
|
5057
5094
|
}
|
|
5058
5095
|
};
|
|
5059
|
-
return /* @__PURE__ */ (0,
|
|
5096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components43.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
5060
5097
|
})
|
|
5061
5098
|
}
|
|
5062
5099
|
);
|
|
5063
5100
|
}
|
|
5064
5101
|
|
|
5065
5102
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
5066
|
-
var
|
|
5103
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5067
5104
|
var MultiSelectInputRenderer = {
|
|
5068
5105
|
canRenderType: "input-multi-select",
|
|
5069
5106
|
render: (props) => {
|
|
5070
5107
|
switch (props.control) {
|
|
5071
5108
|
case "inline":
|
|
5072
|
-
return /* @__PURE__ */ (0,
|
|
5109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(InlineComponent, __spreadValues({}, props));
|
|
5073
5110
|
case "inline-checkbox-group":
|
|
5074
|
-
return /* @__PURE__ */ (0,
|
|
5111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
5075
5112
|
default:
|
|
5076
|
-
return /* @__PURE__ */ (0,
|
|
5113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
5077
5114
|
}
|
|
5078
5115
|
}
|
|
5079
5116
|
};
|
|
5080
5117
|
|
|
5081
5118
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5082
|
-
var
|
|
5119
|
+
var import_components45 = require("@transferwise/components");
|
|
5083
5120
|
|
|
5084
5121
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
5085
|
-
var
|
|
5086
|
-
var
|
|
5087
|
-
var
|
|
5122
|
+
var import_components44 = require("@transferwise/components");
|
|
5123
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
5124
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5088
5125
|
function UploadFieldInput({
|
|
5089
5126
|
id,
|
|
5090
5127
|
children,
|
|
@@ -5096,14 +5133,14 @@ function UploadFieldInput({
|
|
|
5096
5133
|
control,
|
|
5097
5134
|
tags
|
|
5098
5135
|
}) {
|
|
5099
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
5136
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
5100
5137
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5101
5138
|
const { ref } = useScrollToError(validation, features);
|
|
5102
|
-
return /* @__PURE__ */ (0,
|
|
5139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
5103
5140
|
"div",
|
|
5104
5141
|
{
|
|
5105
5142
|
ref,
|
|
5106
|
-
className: (0,
|
|
5143
|
+
className: (0, import_classnames23.default)(
|
|
5107
5144
|
"form-group d-block",
|
|
5108
5145
|
{
|
|
5109
5146
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -5111,9 +5148,9 @@ function UploadFieldInput({
|
|
|
5111
5148
|
controlAndTagsToCSSClass({ control, tags })
|
|
5112
5149
|
),
|
|
5113
5150
|
children: [
|
|
5114
|
-
/* @__PURE__ */ (0,
|
|
5151
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
5115
5152
|
children,
|
|
5116
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5153
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components44.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
5117
5154
|
]
|
|
5118
5155
|
}
|
|
5119
5156
|
);
|
|
@@ -5148,7 +5185,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
5148
5185
|
};
|
|
5149
5186
|
|
|
5150
5187
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5151
|
-
var
|
|
5188
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5152
5189
|
var MultiUploadInputRenderer = {
|
|
5153
5190
|
canRenderType: "input-upload-multi",
|
|
5154
5191
|
render: (props) => {
|
|
@@ -5176,7 +5213,7 @@ var MultiUploadInputRenderer = {
|
|
|
5176
5213
|
};
|
|
5177
5214
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
5178
5215
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5179
|
-
return /* @__PURE__ */ (0,
|
|
5216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5180
5217
|
UploadFieldInput_default,
|
|
5181
5218
|
{
|
|
5182
5219
|
id,
|
|
@@ -5187,8 +5224,8 @@ var MultiUploadInputRenderer = {
|
|
|
5187
5224
|
features,
|
|
5188
5225
|
control,
|
|
5189
5226
|
tags,
|
|
5190
|
-
children: /* @__PURE__ */ (0,
|
|
5191
|
-
|
|
5227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5228
|
+
import_components45.UploadInput,
|
|
5192
5229
|
{
|
|
5193
5230
|
id,
|
|
5194
5231
|
"aria-describedby": descriptionId,
|
|
@@ -5197,7 +5234,7 @@ var MultiUploadInputRenderer = {
|
|
|
5197
5234
|
files: value.map(({ id: fileId, file, validationState: fileValidationState }) => ({
|
|
5198
5235
|
id: fileId,
|
|
5199
5236
|
filename: file.name,
|
|
5200
|
-
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ?
|
|
5237
|
+
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ? import_components45.Status.FAILED : import_components45.Status.SUCCEEDED
|
|
5201
5238
|
})),
|
|
5202
5239
|
fileTypes: acceptsToFileTypes(accepts),
|
|
5203
5240
|
maxFiles: maxItems,
|
|
@@ -5215,8 +5252,8 @@ var MultiUploadInputRenderer = {
|
|
|
5215
5252
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
5216
5253
|
|
|
5217
5254
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
5218
|
-
var
|
|
5219
|
-
var
|
|
5255
|
+
var import_components46 = require("@transferwise/components");
|
|
5256
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5220
5257
|
var NumberInputRenderer = {
|
|
5221
5258
|
canRenderType: "input-number",
|
|
5222
5259
|
render: (props) => {
|
|
@@ -5230,7 +5267,7 @@ var NumberInputRenderer = {
|
|
|
5230
5267
|
"maximum",
|
|
5231
5268
|
"minimum"
|
|
5232
5269
|
);
|
|
5233
|
-
return /* @__PURE__ */ (0,
|
|
5270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5234
5271
|
FieldInput_default,
|
|
5235
5272
|
{
|
|
5236
5273
|
id,
|
|
@@ -5243,8 +5280,8 @@ var NumberInputRenderer = {
|
|
|
5243
5280
|
features: props.features,
|
|
5244
5281
|
control: props.control,
|
|
5245
5282
|
tags: props.tags,
|
|
5246
|
-
children: /* @__PURE__ */ (0,
|
|
5247
|
-
|
|
5283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components46.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5284
|
+
import_components46.Input,
|
|
5248
5285
|
__spreadValues({
|
|
5249
5286
|
id,
|
|
5250
5287
|
name: id,
|
|
@@ -5264,15 +5301,15 @@ var NumberInputRenderer = {
|
|
|
5264
5301
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
5265
5302
|
|
|
5266
5303
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5267
|
-
var
|
|
5268
|
-
var
|
|
5304
|
+
var import_components48 = require("@transferwise/components");
|
|
5305
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5269
5306
|
var import_react_intl25 = require("react-intl");
|
|
5270
5307
|
|
|
5271
5308
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
5272
|
-
var
|
|
5309
|
+
var import_components47 = require("@transferwise/components");
|
|
5273
5310
|
var import_react19 = require("react");
|
|
5274
5311
|
function useSnackBarIfAvailable() {
|
|
5275
|
-
const context = (0, import_react19.useContext)(
|
|
5312
|
+
const context = (0, import_react19.useContext)(import_components47.SnackbarContext);
|
|
5276
5313
|
return context ? context.createSnackbar : () => {
|
|
5277
5314
|
};
|
|
5278
5315
|
}
|
|
@@ -5293,18 +5330,18 @@ var paragraph_messages_default = (0, import_react_intl24.defineMessages)({
|
|
|
5293
5330
|
});
|
|
5294
5331
|
|
|
5295
5332
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5296
|
-
var
|
|
5333
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5297
5334
|
var ParagraphRenderer = {
|
|
5298
5335
|
canRenderType: "paragraph",
|
|
5299
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5336
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Paragraph, __spreadValues({}, props))
|
|
5300
5337
|
};
|
|
5301
5338
|
function Paragraph(props) {
|
|
5302
5339
|
const { align, control, margin, size, text } = props;
|
|
5303
|
-
const className = (0,
|
|
5340
|
+
const className = (0, import_classnames24.default)(
|
|
5304
5341
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5305
5342
|
controlAndTagsToCSSClass(props)
|
|
5306
5343
|
);
|
|
5307
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
5344
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5308
5345
|
"p",
|
|
5309
5346
|
{
|
|
5310
5347
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -5324,34 +5361,34 @@ function CopyableParagraph({
|
|
|
5324
5361
|
});
|
|
5325
5362
|
};
|
|
5326
5363
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
5327
|
-
return /* @__PURE__ */ (0,
|
|
5328
|
-
/* @__PURE__ */ (0,
|
|
5329
|
-
|
|
5364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className, children: [
|
|
5365
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5366
|
+
import_components48.Input,
|
|
5330
5367
|
{
|
|
5331
5368
|
type: "text",
|
|
5332
5369
|
value: text,
|
|
5333
5370
|
readOnly: true,
|
|
5334
|
-
className: (0,
|
|
5371
|
+
className: (0, import_classnames24.default)("text-ellipsis", inputAlignmentClasses)
|
|
5335
5372
|
}
|
|
5336
5373
|
),
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5374
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components48.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5338
5375
|
] });
|
|
5339
5376
|
}
|
|
5340
5377
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
5341
5378
|
|
|
5342
5379
|
// ../renderers/src/ProgressRenderer.tsx
|
|
5343
|
-
var
|
|
5344
|
-
var
|
|
5345
|
-
var
|
|
5380
|
+
var import_components49 = require("@transferwise/components");
|
|
5381
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5382
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5346
5383
|
var ProgressRenderer = {
|
|
5347
5384
|
canRenderType: "progress",
|
|
5348
5385
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
5349
|
-
return /* @__PURE__ */ (0,
|
|
5350
|
-
|
|
5386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5387
|
+
import_components49.ProgressBar,
|
|
5351
5388
|
{
|
|
5352
5389
|
id: uid,
|
|
5353
|
-
className: (0,
|
|
5354
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
5390
|
+
className: (0, import_classnames25.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5391
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
5355
5392
|
description,
|
|
5356
5393
|
progress: {
|
|
5357
5394
|
max: 1,
|
|
@@ -5364,9 +5401,9 @@ var ProgressRenderer = {
|
|
|
5364
5401
|
};
|
|
5365
5402
|
|
|
5366
5403
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5367
|
-
var
|
|
5404
|
+
var import_components50 = require("@transferwise/components");
|
|
5368
5405
|
var import_icons2 = require("@transferwise/icons");
|
|
5369
|
-
var
|
|
5406
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5370
5407
|
var import_react20 = require("react");
|
|
5371
5408
|
var import_react_intl27 = require("react-intl");
|
|
5372
5409
|
|
|
@@ -5396,10 +5433,10 @@ var repeatable_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
5396
5433
|
});
|
|
5397
5434
|
|
|
5398
5435
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5399
|
-
var
|
|
5436
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5400
5437
|
var RepeatableRenderer = {
|
|
5401
5438
|
canRenderType: "repeatable",
|
|
5402
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5439
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Repeatable, __spreadValues({}, props))
|
|
5403
5440
|
};
|
|
5404
5441
|
function Repeatable(props) {
|
|
5405
5442
|
const {
|
|
@@ -5440,43 +5477,43 @@ function Repeatable(props) {
|
|
|
5440
5477
|
const onCancelEdit = () => {
|
|
5441
5478
|
setOpenModalType(null);
|
|
5442
5479
|
};
|
|
5443
|
-
return /* @__PURE__ */ (0,
|
|
5444
|
-
/* @__PURE__ */ (0,
|
|
5445
|
-
title && /* @__PURE__ */ (0,
|
|
5446
|
-
description && /* @__PURE__ */ (0,
|
|
5447
|
-
/* @__PURE__ */ (0,
|
|
5480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5482
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components50.Header, { title }),
|
|
5483
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { children: description }),
|
|
5484
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
5448
5485
|
"div",
|
|
5449
5486
|
{
|
|
5450
|
-
className: (0,
|
|
5487
|
+
className: (0, import_classnames26.default)("form-group", {
|
|
5451
5488
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
5452
5489
|
}),
|
|
5453
5490
|
children: [
|
|
5454
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
5455
|
-
/* @__PURE__ */ (0,
|
|
5456
|
-
|
|
5491
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5492
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5493
|
+
import_components50.NavigationOption,
|
|
5457
5494
|
{
|
|
5458
|
-
media: /* @__PURE__ */ (0,
|
|
5495
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_icons2.Plus, {}),
|
|
5459
5496
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5460
5497
|
showMediaAtAllSizes: true,
|
|
5461
5498
|
onClick: () => onAddItem()
|
|
5462
5499
|
}
|
|
5463
5500
|
),
|
|
5464
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5501
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components50.InlineAlert, { type: "negative", children: validationState.message })
|
|
5465
5502
|
]
|
|
5466
5503
|
}
|
|
5467
5504
|
)
|
|
5468
5505
|
] }),
|
|
5469
|
-
/* @__PURE__ */ (0,
|
|
5470
|
-
|
|
5506
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5507
|
+
import_components50.Modal,
|
|
5471
5508
|
{
|
|
5472
5509
|
open: openModalType !== null,
|
|
5473
5510
|
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
|
-
|
|
5511
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
5512
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { children: [
|
|
5514
|
+
/* @__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) }),
|
|
5515
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5516
|
+
import_components50.Button,
|
|
5480
5517
|
{
|
|
5481
5518
|
v2: true,
|
|
5482
5519
|
priority: "secondary",
|
|
@@ -5497,10 +5534,10 @@ function ItemSummaryOption({
|
|
|
5497
5534
|
item,
|
|
5498
5535
|
onClick
|
|
5499
5536
|
}) {
|
|
5500
|
-
return /* @__PURE__ */ (0,
|
|
5501
|
-
|
|
5537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5538
|
+
import_components50.NavigationOption,
|
|
5502
5539
|
{
|
|
5503
|
-
media: /* @__PURE__ */ (0,
|
|
5540
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
5504
5541
|
title: item.title,
|
|
5505
5542
|
content: item.description,
|
|
5506
5543
|
showMediaAtAllSizes: true,
|
|
@@ -5512,17 +5549,17 @@ function ItemSummaryOption({
|
|
|
5512
5549
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
5513
5550
|
|
|
5514
5551
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
5515
|
-
var
|
|
5516
|
-
var
|
|
5517
|
-
var
|
|
5552
|
+
var import_components51 = require("@transferwise/components");
|
|
5553
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5554
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5518
5555
|
var ReviewRenderer = {
|
|
5519
5556
|
canRenderType: "review",
|
|
5520
5557
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
5521
5558
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
5522
|
-
return /* @__PURE__ */ (0,
|
|
5523
|
-
/* @__PURE__ */ (0,
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5525
|
-
|
|
5559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_classnames27.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5560
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Header, { title, callToAction }),
|
|
5561
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5562
|
+
import_components51.DefinitionList,
|
|
5526
5563
|
{
|
|
5527
5564
|
layout: orientation,
|
|
5528
5565
|
definitions: fields.map(
|
|
@@ -5559,21 +5596,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
5559
5596
|
};
|
|
5560
5597
|
var getFieldLabel = (label, help, onClick) => {
|
|
5561
5598
|
if (help) {
|
|
5562
|
-
return /* @__PURE__ */ (0,
|
|
5599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
5563
5600
|
label,
|
|
5564
5601
|
" ",
|
|
5565
|
-
/* @__PURE__ */ (0,
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Help_default, { help, onClick })
|
|
5566
5603
|
] });
|
|
5567
5604
|
}
|
|
5568
5605
|
return label;
|
|
5569
5606
|
};
|
|
5570
5607
|
|
|
5571
5608
|
// ../renderers/src/ReviewRenderer.tsx
|
|
5572
|
-
var
|
|
5609
|
+
var import_components52 = require("@transferwise/components");
|
|
5573
5610
|
var import_icons3 = require("@transferwise/icons");
|
|
5574
|
-
var
|
|
5611
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5575
5612
|
var import_react_intl28 = require("react-intl");
|
|
5576
|
-
var
|
|
5613
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5577
5614
|
var IGNORED_CONTROLS = [
|
|
5578
5615
|
"horizontal",
|
|
5579
5616
|
"horizontal-end-aligned",
|
|
@@ -5583,7 +5620,7 @@ var IGNORED_CONTROLS = [
|
|
|
5583
5620
|
var ReviewRenderer2 = {
|
|
5584
5621
|
canRenderType: "review",
|
|
5585
5622
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
5586
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5623
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Review, __spreadValues({}, props))
|
|
5587
5624
|
};
|
|
5588
5625
|
var Review = ({
|
|
5589
5626
|
callToAction,
|
|
@@ -5595,8 +5632,8 @@ var Review = ({
|
|
|
5595
5632
|
trackEvent
|
|
5596
5633
|
}) => {
|
|
5597
5634
|
const intl = (0, import_react_intl28.useIntl)();
|
|
5598
|
-
return /* @__PURE__ */ (0,
|
|
5599
|
-
/* @__PURE__ */ (0,
|
|
5635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_classnames28.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5636
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Header, { title, callToAction }),
|
|
5600
5637
|
fields.map((field) => {
|
|
5601
5638
|
var _a, _b, _c;
|
|
5602
5639
|
const {
|
|
@@ -5614,8 +5651,8 @@ var Review = ({
|
|
|
5614
5651
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
5615
5652
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
5616
5653
|
};
|
|
5617
|
-
return /* @__PURE__ */ (0,
|
|
5618
|
-
|
|
5654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5655
|
+
import_components52.ListItem,
|
|
5619
5656
|
{
|
|
5620
5657
|
title: value,
|
|
5621
5658
|
subtitle: label,
|
|
@@ -5635,12 +5672,12 @@ var Review = ({
|
|
|
5635
5672
|
] });
|
|
5636
5673
|
};
|
|
5637
5674
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
5638
|
-
return /* @__PURE__ */ (0,
|
|
5675
|
+
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
5676
|
};
|
|
5640
5677
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
5641
5678
|
|
|
5642
5679
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5643
|
-
var
|
|
5680
|
+
var import_components54 = require("@transferwise/components");
|
|
5644
5681
|
var import_react21 = require("react");
|
|
5645
5682
|
var import_react_intl31 = require("react-intl");
|
|
5646
5683
|
|
|
@@ -5656,20 +5693,20 @@ var search_messages_default = (0, import_react_intl29.defineMessages)({
|
|
|
5656
5693
|
|
|
5657
5694
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
5658
5695
|
var import_react_intl30 = require("react-intl");
|
|
5659
|
-
var
|
|
5660
|
-
var
|
|
5696
|
+
var import_components53 = require("@transferwise/components");
|
|
5697
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5661
5698
|
function ErrorResult({ state }) {
|
|
5662
5699
|
const intl = (0, import_react_intl30.useIntl)();
|
|
5663
|
-
return /* @__PURE__ */ (0,
|
|
5700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("p", { className: "m-t-2", children: [
|
|
5664
5701
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
5665
5702
|
"\xA0",
|
|
5666
|
-
/* @__PURE__ */ (0,
|
|
5703
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components53.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
5667
5704
|
] });
|
|
5668
5705
|
}
|
|
5669
5706
|
|
|
5670
5707
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5671
5708
|
var import_icons4 = require("@transferwise/icons");
|
|
5672
|
-
var
|
|
5709
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5673
5710
|
function BlockSearchRendererComponent({
|
|
5674
5711
|
id,
|
|
5675
5712
|
hint,
|
|
@@ -5686,8 +5723,8 @@ function BlockSearchRendererComponent({
|
|
|
5686
5723
|
}) {
|
|
5687
5724
|
const [hasSearched, setHasSearched] = (0, import_react21.useState)(false);
|
|
5688
5725
|
const { formatMessage } = (0, import_react_intl31.useIntl)();
|
|
5689
|
-
return /* @__PURE__ */ (0,
|
|
5690
|
-
/* @__PURE__ */ (0,
|
|
5726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: getMargin(margin), children: [
|
|
5727
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5691
5728
|
FieldInput_default,
|
|
5692
5729
|
{
|
|
5693
5730
|
id,
|
|
@@ -5698,8 +5735,8 @@ function BlockSearchRendererComponent({
|
|
|
5698
5735
|
features,
|
|
5699
5736
|
control,
|
|
5700
5737
|
tags,
|
|
5701
|
-
children: /* @__PURE__ */ (0,
|
|
5702
|
-
|
|
5738
|
+
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)(
|
|
5739
|
+
import_components54.Input,
|
|
5703
5740
|
{
|
|
5704
5741
|
id,
|
|
5705
5742
|
name: id,
|
|
@@ -5718,7 +5755,7 @@ function BlockSearchRendererComponent({
|
|
|
5718
5755
|
) })
|
|
5719
5756
|
}
|
|
5720
5757
|
),
|
|
5721
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
5758
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SearchResultContent, { state, trackEvent })
|
|
5722
5759
|
] });
|
|
5723
5760
|
}
|
|
5724
5761
|
function SearchResultContent({
|
|
@@ -5727,39 +5764,39 @@ function SearchResultContent({
|
|
|
5727
5764
|
}) {
|
|
5728
5765
|
switch (state.type) {
|
|
5729
5766
|
case "error":
|
|
5730
|
-
return /* @__PURE__ */ (0,
|
|
5767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ErrorResult, { state });
|
|
5731
5768
|
case "results":
|
|
5732
|
-
return /* @__PURE__ */ (0,
|
|
5769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SearchResults, { state, trackEvent });
|
|
5733
5770
|
case "layout":
|
|
5734
|
-
return /* @__PURE__ */ (0,
|
|
5771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
5735
5772
|
" ",
|
|
5736
5773
|
state.layout,
|
|
5737
5774
|
" "
|
|
5738
5775
|
] });
|
|
5739
5776
|
case "noResults":
|
|
5740
|
-
return /* @__PURE__ */ (0,
|
|
5777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(EmptySearchResult, { state });
|
|
5741
5778
|
case "pending":
|
|
5742
5779
|
default:
|
|
5743
5780
|
return null;
|
|
5744
5781
|
}
|
|
5745
5782
|
}
|
|
5746
5783
|
function EmptySearchResult({ state }) {
|
|
5747
|
-
return /* @__PURE__ */ (0,
|
|
5784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5748
5785
|
}
|
|
5749
5786
|
function SearchResults({
|
|
5750
5787
|
state,
|
|
5751
5788
|
trackEvent
|
|
5752
5789
|
}) {
|
|
5753
|
-
return /* @__PURE__ */ (0,
|
|
5790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.List, { children: state.results.map((result) => {
|
|
5754
5791
|
const { media } = result;
|
|
5755
|
-
return /* @__PURE__ */ (0,
|
|
5756
|
-
|
|
5792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5793
|
+
import_components54.ListItem,
|
|
5757
5794
|
{
|
|
5758
5795
|
title: result.title,
|
|
5759
5796
|
subtitle: result.description,
|
|
5760
|
-
media: media ? /* @__PURE__ */ (0,
|
|
5761
|
-
control: /* @__PURE__ */ (0,
|
|
5762
|
-
|
|
5797
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
5798
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5799
|
+
import_components54.ListItem.Navigation,
|
|
5763
5800
|
{
|
|
5764
5801
|
onClick: () => {
|
|
5765
5802
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -5777,11 +5814,11 @@ function SearchResults({
|
|
|
5777
5814
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
5778
5815
|
|
|
5779
5816
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
5780
|
-
var
|
|
5817
|
+
var import_components55 = require("@transferwise/components");
|
|
5781
5818
|
var import_icons5 = require("@transferwise/icons");
|
|
5782
5819
|
var import_react22 = require("react");
|
|
5783
5820
|
var import_react_intl32 = require("react-intl");
|
|
5784
|
-
var
|
|
5821
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
5785
5822
|
function InlineSearchRenderer({
|
|
5786
5823
|
id,
|
|
5787
5824
|
hint,
|
|
@@ -5797,7 +5834,7 @@ function InlineSearchRenderer({
|
|
|
5797
5834
|
}) {
|
|
5798
5835
|
const [hasSearched, setHasSearched] = (0, import_react22.useState)(false);
|
|
5799
5836
|
const intl = (0, import_react_intl32.useIntl)();
|
|
5800
|
-
return /* @__PURE__ */ (0,
|
|
5837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5801
5838
|
FieldInput_default,
|
|
5802
5839
|
{
|
|
5803
5840
|
id,
|
|
@@ -5808,8 +5845,8 @@ function InlineSearchRenderer({
|
|
|
5808
5845
|
features,
|
|
5809
5846
|
control,
|
|
5810
5847
|
tags,
|
|
5811
|
-
children: /* @__PURE__ */ (0,
|
|
5812
|
-
|
|
5848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5849
|
+
import_components55.Typeahead,
|
|
5813
5850
|
{
|
|
5814
5851
|
id: "typeahead-input-id",
|
|
5815
5852
|
intl,
|
|
@@ -5817,10 +5854,10 @@ function InlineSearchRenderer({
|
|
|
5817
5854
|
size: "md",
|
|
5818
5855
|
placeholder: hint,
|
|
5819
5856
|
maxHeight: 100,
|
|
5820
|
-
footer: /* @__PURE__ */ (0,
|
|
5857
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
5821
5858
|
multiple: false,
|
|
5822
5859
|
clearable: false,
|
|
5823
|
-
addon: /* @__PURE__ */ (0,
|
|
5860
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_icons5.Search, { size: 24 }),
|
|
5824
5861
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
5825
5862
|
minQueryLength: 1,
|
|
5826
5863
|
onChange: (values) => {
|
|
@@ -5859,32 +5896,32 @@ function mapResultToTypeaheadOption(result) {
|
|
|
5859
5896
|
function TypeaheadFooter({ state, isLoading }) {
|
|
5860
5897
|
const { formatMessage } = (0, import_react_intl32.useIntl)();
|
|
5861
5898
|
if (state.type === "layout") {
|
|
5862
|
-
return /* @__PURE__ */ (0,
|
|
5899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
5863
5900
|
}
|
|
5864
5901
|
if (state.type === "noResults") {
|
|
5865
|
-
return /* @__PURE__ */ (0,
|
|
5902
|
+
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
5903
|
}
|
|
5867
5904
|
if (state.type === "error") {
|
|
5868
|
-
return /* @__PURE__ */ (0,
|
|
5905
|
+
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
5906
|
}
|
|
5870
5907
|
if (state.type === "pending" || isLoading) {
|
|
5871
|
-
return /* @__PURE__ */ (0,
|
|
5908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
5872
5909
|
}
|
|
5873
5910
|
return null;
|
|
5874
5911
|
}
|
|
5875
5912
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
5876
5913
|
|
|
5877
5914
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
5878
|
-
var
|
|
5915
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5879
5916
|
var SearchRenderer = {
|
|
5880
5917
|
canRenderType: "search",
|
|
5881
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
5918
|
+
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
5919
|
};
|
|
5883
5920
|
var SearchRenderer_default = SearchRenderer;
|
|
5884
5921
|
|
|
5885
5922
|
// ../renderers/src/SectionRenderer.tsx
|
|
5886
|
-
var
|
|
5887
|
-
var
|
|
5923
|
+
var import_components56 = require("@transferwise/components");
|
|
5924
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
5888
5925
|
|
|
5889
5926
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
5890
5927
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -5908,16 +5945,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
5908
5945
|
};
|
|
5909
5946
|
|
|
5910
5947
|
// ../renderers/src/SectionRenderer.tsx
|
|
5911
|
-
var
|
|
5948
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5912
5949
|
var SectionRenderer = {
|
|
5913
5950
|
canRenderType: "section",
|
|
5914
5951
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
5915
|
-
return /* @__PURE__ */ (0,
|
|
5952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
5916
5953
|
"section",
|
|
5917
5954
|
{
|
|
5918
|
-
className: (0,
|
|
5955
|
+
className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5919
5956
|
children: [
|
|
5920
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
5957
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components56.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
5921
5958
|
children
|
|
5922
5959
|
]
|
|
5923
5960
|
}
|
|
@@ -5927,8 +5964,8 @@ var SectionRenderer = {
|
|
|
5927
5964
|
var SectionRenderer_default = SectionRenderer;
|
|
5928
5965
|
|
|
5929
5966
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
5930
|
-
var
|
|
5931
|
-
var
|
|
5967
|
+
var import_components57 = require("@transferwise/components");
|
|
5968
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
5932
5969
|
function RadioInputRendererComponent(props) {
|
|
5933
5970
|
const {
|
|
5934
5971
|
id,
|
|
@@ -5945,8 +5982,8 @@ function RadioInputRendererComponent(props) {
|
|
|
5945
5982
|
tags,
|
|
5946
5983
|
onSelect
|
|
5947
5984
|
} = props;
|
|
5948
|
-
return /* @__PURE__ */ (0,
|
|
5949
|
-
/* @__PURE__ */ (0,
|
|
5985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
5986
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5950
5987
|
FieldInput_default,
|
|
5951
5988
|
{
|
|
5952
5989
|
id,
|
|
@@ -5957,8 +5994,8 @@ function RadioInputRendererComponent(props) {
|
|
|
5957
5994
|
features,
|
|
5958
5995
|
control,
|
|
5959
5996
|
tags,
|
|
5960
|
-
children: /* @__PURE__ */ (0,
|
|
5961
|
-
|
|
5997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
5998
|
+
import_components57.RadioGroup,
|
|
5962
5999
|
{
|
|
5963
6000
|
name: id,
|
|
5964
6001
|
radios: options.map((option, index) => ({
|
|
@@ -5966,7 +6003,7 @@ function RadioInputRendererComponent(props) {
|
|
|
5966
6003
|
value: index,
|
|
5967
6004
|
secondary: option.description,
|
|
5968
6005
|
disabled: option.disabled || disabled,
|
|
5969
|
-
avatar: /* @__PURE__ */ (0,
|
|
6006
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5970
6007
|
})),
|
|
5971
6008
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
5972
6009
|
onChange: onSelect
|
|
@@ -5980,9 +6017,9 @@ function RadioInputRendererComponent(props) {
|
|
|
5980
6017
|
}
|
|
5981
6018
|
|
|
5982
6019
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
5983
|
-
var
|
|
6020
|
+
var import_components58 = require("@transferwise/components");
|
|
5984
6021
|
var import_react23 = require("react");
|
|
5985
|
-
var
|
|
6022
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5986
6023
|
function TabInputRendererComponent(props) {
|
|
5987
6024
|
const {
|
|
5988
6025
|
id,
|
|
@@ -6004,8 +6041,8 @@ function TabInputRendererComponent(props) {
|
|
|
6004
6041
|
onSelect(0);
|
|
6005
6042
|
}
|
|
6006
6043
|
}, [selectedIndex, onSelect, options.length]);
|
|
6007
|
-
return /* @__PURE__ */ (0,
|
|
6008
|
-
/* @__PURE__ */ (0,
|
|
6044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
6045
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6009
6046
|
FieldInput_default,
|
|
6010
6047
|
{
|
|
6011
6048
|
id,
|
|
@@ -6016,8 +6053,8 @@ function TabInputRendererComponent(props) {
|
|
|
6016
6053
|
features,
|
|
6017
6054
|
control,
|
|
6018
6055
|
tags,
|
|
6019
|
-
children: /* @__PURE__ */ (0,
|
|
6020
|
-
|
|
6056
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
6057
|
+
import_components58.Tabs,
|
|
6021
6058
|
{
|
|
6022
6059
|
name: id,
|
|
6023
6060
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -6025,7 +6062,7 @@ function TabInputRendererComponent(props) {
|
|
|
6025
6062
|
title: option.title,
|
|
6026
6063
|
// if we pass null, we get some props-types console errors
|
|
6027
6064
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
6028
|
-
content: /* @__PURE__ */ (0,
|
|
6065
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, {}),
|
|
6029
6066
|
disabled: option.disabled || disabled
|
|
6030
6067
|
})),
|
|
6031
6068
|
onTabSelect: onSelect
|
|
@@ -6039,8 +6076,8 @@ function TabInputRendererComponent(props) {
|
|
|
6039
6076
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6040
6077
|
|
|
6041
6078
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
6042
|
-
var
|
|
6043
|
-
var
|
|
6079
|
+
var import_components59 = require("@transferwise/components");
|
|
6080
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
6044
6081
|
function SelectInputRendererComponent(props) {
|
|
6045
6082
|
const {
|
|
6046
6083
|
id,
|
|
@@ -6083,13 +6120,13 @@ function SelectInputRendererComponent(props) {
|
|
|
6083
6120
|
} : {
|
|
6084
6121
|
title: option.title,
|
|
6085
6122
|
description: option.description,
|
|
6086
|
-
icon: /* @__PURE__ */ (0,
|
|
6123
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6087
6124
|
};
|
|
6088
|
-
return /* @__PURE__ */ (0,
|
|
6125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components59.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
6089
6126
|
};
|
|
6090
6127
|
const extraProps = { autoComplete };
|
|
6091
|
-
return /* @__PURE__ */ (0,
|
|
6092
|
-
/* @__PURE__ */ (0,
|
|
6128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
6129
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6093
6130
|
FieldInput_default,
|
|
6094
6131
|
{
|
|
6095
6132
|
id,
|
|
@@ -6100,8 +6137,8 @@ function SelectInputRendererComponent(props) {
|
|
|
6100
6137
|
features,
|
|
6101
6138
|
control,
|
|
6102
6139
|
tags,
|
|
6103
|
-
children: /* @__PURE__ */ (0,
|
|
6104
|
-
|
|
6140
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6141
|
+
import_components59.SelectInput,
|
|
6105
6142
|
__spreadValues({
|
|
6106
6143
|
name: id,
|
|
6107
6144
|
placeholder,
|
|
@@ -6122,8 +6159,8 @@ function SelectInputRendererComponent(props) {
|
|
|
6122
6159
|
|
|
6123
6160
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
6124
6161
|
var import_react24 = require("react");
|
|
6125
|
-
var
|
|
6126
|
-
var
|
|
6162
|
+
var import_components60 = require("@transferwise/components");
|
|
6163
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
6127
6164
|
function SegmentedInputRendererComponent(props) {
|
|
6128
6165
|
const {
|
|
6129
6166
|
id,
|
|
@@ -6144,8 +6181,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6144
6181
|
onSelect(0);
|
|
6145
6182
|
}
|
|
6146
6183
|
}, [selectedIndex, onSelect, options.length]);
|
|
6147
|
-
return /* @__PURE__ */ (0,
|
|
6148
|
-
/* @__PURE__ */ (0,
|
|
6184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
6149
6186
|
FieldInput_default,
|
|
6150
6187
|
{
|
|
6151
6188
|
id,
|
|
@@ -6156,8 +6193,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6156
6193
|
features,
|
|
6157
6194
|
control,
|
|
6158
6195
|
tags,
|
|
6159
|
-
children: /* @__PURE__ */ (0,
|
|
6160
|
-
|
|
6196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
6197
|
+
import_components60.SegmentedControl,
|
|
6161
6198
|
{
|
|
6162
6199
|
name: `${id}-segmented-control`,
|
|
6163
6200
|
value: String(selectedIndex),
|
|
@@ -6173,14 +6210,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6173
6210
|
)
|
|
6174
6211
|
}
|
|
6175
6212
|
),
|
|
6176
|
-
/* @__PURE__ */ (0,
|
|
6213
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { id: `${id}-children`, children })
|
|
6177
6214
|
] });
|
|
6178
6215
|
}
|
|
6179
6216
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6180
6217
|
|
|
6181
6218
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
6182
|
-
var
|
|
6183
|
-
var
|
|
6219
|
+
var import_components61 = require("@transferwise/components");
|
|
6220
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6184
6221
|
function RadioItemRendererComponent(props) {
|
|
6185
6222
|
const {
|
|
6186
6223
|
id,
|
|
@@ -6196,23 +6233,23 @@ function RadioItemRendererComponent(props) {
|
|
|
6196
6233
|
onSelect
|
|
6197
6234
|
} = props;
|
|
6198
6235
|
const { ref } = useScrollToError(validationState, features);
|
|
6199
|
-
return /* @__PURE__ */ (0,
|
|
6200
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
6201
|
-
|
|
6236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6237
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6238
|
+
import_components61.Header,
|
|
6202
6239
|
{
|
|
6203
6240
|
as: "h2",
|
|
6204
|
-
title: help ? /* @__PURE__ */ (0,
|
|
6241
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
6205
6242
|
}
|
|
6206
6243
|
),
|
|
6207
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
6208
|
-
/* @__PURE__ */ (0,
|
|
6209
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
6210
|
-
|
|
6244
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { children: rootDescription }),
|
|
6245
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components61.List, { children: options.map(
|
|
6246
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6247
|
+
import_components61.ListItem,
|
|
6211
6248
|
__spreadValues({
|
|
6212
6249
|
title,
|
|
6213
6250
|
subtitle: description,
|
|
6214
|
-
control: /* @__PURE__ */ (0,
|
|
6215
|
-
|
|
6251
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6252
|
+
import_components61.ListItem.Radio,
|
|
6216
6253
|
{
|
|
6217
6254
|
name: title,
|
|
6218
6255
|
checked: selectedIndex === index,
|
|
@@ -6227,51 +6264,51 @@ function RadioItemRendererComponent(props) {
|
|
|
6227
6264
|
title
|
|
6228
6265
|
)
|
|
6229
6266
|
) }, `${id}-${selectedIndex}`),
|
|
6230
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
6267
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components61.InlineAlert, { type: "negative", children: validationState.message }),
|
|
6231
6268
|
children
|
|
6232
6269
|
] });
|
|
6233
6270
|
}
|
|
6234
6271
|
|
|
6235
6272
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
6236
|
-
var
|
|
6273
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
6237
6274
|
var SelectInputRenderer = {
|
|
6238
6275
|
canRenderType: "input-select",
|
|
6239
6276
|
render: (props) => {
|
|
6240
6277
|
switch (props.control) {
|
|
6241
6278
|
case "radio":
|
|
6242
|
-
return /* @__PURE__ */ (0,
|
|
6279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
6243
6280
|
case "radio-item":
|
|
6244
|
-
return /* @__PURE__ */ (0,
|
|
6281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
6245
6282
|
case "tab":
|
|
6246
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6283
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
6247
6284
|
case "segmented":
|
|
6248
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6285
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
6249
6286
|
case "select":
|
|
6250
6287
|
default:
|
|
6251
|
-
return /* @__PURE__ */ (0,
|
|
6288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
6252
6289
|
}
|
|
6253
6290
|
}
|
|
6254
6291
|
};
|
|
6255
6292
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
6256
6293
|
|
|
6257
6294
|
// ../renderers/src/StatusListRenderer.tsx
|
|
6258
|
-
var
|
|
6259
|
-
var
|
|
6260
|
-
var
|
|
6295
|
+
var import_components62 = require("@transferwise/components");
|
|
6296
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
6297
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
6261
6298
|
var StatusListRenderer = {
|
|
6262
6299
|
canRenderType: "status-list",
|
|
6263
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0,
|
|
6264
|
-
title ? /* @__PURE__ */ (0,
|
|
6300
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: (0, import_classnames30.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6301
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components62.Header, { title }) : null,
|
|
6265
6302
|
items.map((item) => {
|
|
6266
6303
|
const { callToAction, description, title: itemTitle } = item;
|
|
6267
|
-
return /* @__PURE__ */ (0,
|
|
6268
|
-
|
|
6304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6305
|
+
import_components62.ListItem,
|
|
6269
6306
|
{
|
|
6270
6307
|
title: itemTitle,
|
|
6271
6308
|
subtitle: description,
|
|
6272
|
-
media: /* @__PURE__ */ (0,
|
|
6273
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
6274
|
-
|
|
6309
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(StatusListItemMedia, __spreadValues({}, item)),
|
|
6310
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6311
|
+
import_components62.ListItem.AdditionalInfo,
|
|
6275
6312
|
{
|
|
6276
6313
|
action: __spreadValues({
|
|
6277
6314
|
label: callToAction.title
|
|
@@ -6289,10 +6326,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
6289
6326
|
return void 0;
|
|
6290
6327
|
}
|
|
6291
6328
|
if ("name" in icon) {
|
|
6292
|
-
return /* @__PURE__ */ (0,
|
|
6329
|
+
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
6330
|
}
|
|
6294
6331
|
if ("text" in icon) {
|
|
6295
|
-
return /* @__PURE__ */ (0,
|
|
6332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components62.AvatarView, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
6296
6333
|
}
|
|
6297
6334
|
return void 0;
|
|
6298
6335
|
};
|
|
@@ -6309,7 +6346,7 @@ var mapStatus = (status) => {
|
|
|
6309
6346
|
var StatusListRenderer_default = StatusListRenderer;
|
|
6310
6347
|
|
|
6311
6348
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6312
|
-
var
|
|
6349
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6313
6350
|
|
|
6314
6351
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
6315
6352
|
var import_components_theming = require("@wise/components-theming");
|
|
@@ -6330,13 +6367,13 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
6330
6367
|
};
|
|
6331
6368
|
|
|
6332
6369
|
// ../renderers/src/step/StepHeader.tsx
|
|
6333
|
-
var
|
|
6334
|
-
var
|
|
6370
|
+
var import_components63 = require("@transferwise/components");
|
|
6371
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
6335
6372
|
var StepHeader = ({ title, description, tags }) => {
|
|
6336
6373
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
6337
|
-
return /* @__PURE__ */ (0,
|
|
6338
|
-
title ? /* @__PURE__ */ (0,
|
|
6339
|
-
description ? /* @__PURE__ */ (0,
|
|
6374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
6375
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components63.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6376
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
6340
6377
|
] });
|
|
6341
6378
|
};
|
|
6342
6379
|
var getHeaderStyle = (tags) => {
|
|
@@ -6347,7 +6384,7 @@ var getHeaderStyle = (tags) => {
|
|
|
6347
6384
|
};
|
|
6348
6385
|
|
|
6349
6386
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6350
|
-
var
|
|
6387
|
+
var import_components64 = require("@transferwise/components");
|
|
6351
6388
|
var import_icons6 = require("@transferwise/icons");
|
|
6352
6389
|
var import_react_intl34 = require("react-intl");
|
|
6353
6390
|
|
|
@@ -6362,31 +6399,31 @@ var back_messages_default = (0, import_react_intl33.defineMessages)({
|
|
|
6362
6399
|
});
|
|
6363
6400
|
|
|
6364
6401
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6365
|
-
var
|
|
6402
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
6366
6403
|
function BackButton({ title, onClick }) {
|
|
6367
6404
|
const { formatMessage } = (0, import_react_intl34.useIntl)();
|
|
6368
|
-
return /* @__PURE__ */ (0,
|
|
6369
|
-
/* @__PURE__ */ (0,
|
|
6370
|
-
/* @__PURE__ */ (0,
|
|
6405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_components64.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6406
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6407
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_icons6.ArrowLeft, {})
|
|
6371
6408
|
] });
|
|
6372
6409
|
}
|
|
6373
6410
|
|
|
6374
6411
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
6375
|
-
var
|
|
6376
|
-
var
|
|
6412
|
+
var import_components65 = require("@transferwise/components");
|
|
6413
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
6377
6414
|
var Toolbar = ({ items }) => {
|
|
6378
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
6415
|
+
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
6416
|
};
|
|
6380
6417
|
function ToolbarButton(props) {
|
|
6381
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
6418
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
6382
6419
|
}
|
|
6383
6420
|
function MediaToolbarButton(props) {
|
|
6384
6421
|
var _a;
|
|
6385
6422
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
6386
6423
|
const priority = getIconButtonPriority(control);
|
|
6387
6424
|
const type = getSentiment2(context);
|
|
6388
|
-
return /* @__PURE__ */ (0,
|
|
6389
|
-
|
|
6425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
|
|
6426
|
+
import_components65.IconButton,
|
|
6390
6427
|
{
|
|
6391
6428
|
className: "df-toolbar-button",
|
|
6392
6429
|
disabled,
|
|
@@ -6395,7 +6432,7 @@ function MediaToolbarButton(props) {
|
|
|
6395
6432
|
type,
|
|
6396
6433
|
onClick,
|
|
6397
6434
|
children: [
|
|
6398
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
6435
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
6399
6436
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
6400
6437
|
]
|
|
6401
6438
|
}
|
|
@@ -6406,8 +6443,8 @@ function TextToolbarButton(props) {
|
|
|
6406
6443
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
6407
6444
|
const priority = getPriority2(control);
|
|
6408
6445
|
const sentiment = getSentiment2(context);
|
|
6409
|
-
return /* @__PURE__ */ (0,
|
|
6410
|
-
|
|
6446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
6447
|
+
import_components65.Button,
|
|
6411
6448
|
{
|
|
6412
6449
|
v2: true,
|
|
6413
6450
|
size: "sm",
|
|
@@ -6436,18 +6473,18 @@ var getIconButtonPriority = (control) => {
|
|
|
6436
6473
|
};
|
|
6437
6474
|
|
|
6438
6475
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
6439
|
-
var
|
|
6476
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
6440
6477
|
function TopBar({ back, toolbar, tags }) {
|
|
6441
6478
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
6442
6479
|
const backCTA = isBackAllowed ? back : void 0;
|
|
6443
|
-
return backCTA || toolbar ? /* @__PURE__ */ (0,
|
|
6444
|
-
backCTA ? /* @__PURE__ */ (0,
|
|
6445
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
6480
|
+
return backCTA || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
6481
|
+
backCTA ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6482
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
6446
6483
|
] }) : null;
|
|
6447
6484
|
}
|
|
6448
6485
|
|
|
6449
6486
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6450
|
-
var
|
|
6487
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
6451
6488
|
var SplashCelebrationStepRenderer = {
|
|
6452
6489
|
canRenderType: "step",
|
|
6453
6490
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -6456,23 +6493,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
6456
6493
|
function SplashCelebrationStepRendererComponent(props) {
|
|
6457
6494
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
6458
6495
|
useCustomTheme("forest-green", trackEvent);
|
|
6459
|
-
return /* @__PURE__ */ (0,
|
|
6496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
6460
6497
|
"div",
|
|
6461
6498
|
{
|
|
6462
|
-
className: (0,
|
|
6499
|
+
className: (0, import_classnames31.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6463
6500
|
children: [
|
|
6464
|
-
/* @__PURE__ */ (0,
|
|
6465
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6501
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TopBar, { back, toolbar, tags }),
|
|
6502
|
+
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
6503
|
children,
|
|
6467
|
-
/* @__PURE__ */ (0,
|
|
6504
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(StepFooter, { footer, tags })
|
|
6468
6505
|
]
|
|
6469
6506
|
}
|
|
6470
6507
|
);
|
|
6471
6508
|
}
|
|
6472
6509
|
|
|
6473
6510
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
6474
|
-
var
|
|
6475
|
-
var
|
|
6511
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6512
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
6476
6513
|
var SplashStepRenderer = {
|
|
6477
6514
|
canRenderType: "step",
|
|
6478
6515
|
canRender: ({ control }) => control === "splash",
|
|
@@ -6480,70 +6517,70 @@ var SplashStepRenderer = {
|
|
|
6480
6517
|
};
|
|
6481
6518
|
function SplashStepRendererComponent(props) {
|
|
6482
6519
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
6483
|
-
return /* @__PURE__ */ (0,
|
|
6520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
6484
6521
|
"div",
|
|
6485
6522
|
{
|
|
6486
|
-
className: (0,
|
|
6523
|
+
className: (0, import_classnames32.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6487
6524
|
children: [
|
|
6488
|
-
/* @__PURE__ */ (0,
|
|
6489
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6525
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TopBar, { back, toolbar, tags }),
|
|
6526
|
+
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
6527
|
children,
|
|
6491
|
-
/* @__PURE__ */ (0,
|
|
6528
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(StepFooter, { footer, tags })
|
|
6492
6529
|
]
|
|
6493
6530
|
}
|
|
6494
6531
|
);
|
|
6495
6532
|
}
|
|
6496
6533
|
|
|
6497
6534
|
// ../renderers/src/step/StepRenderer.tsx
|
|
6498
|
-
var
|
|
6499
|
-
var
|
|
6535
|
+
var import_components66 = require("@transferwise/components");
|
|
6536
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
6500
6537
|
var StepRenderer = {
|
|
6501
6538
|
canRenderType: "step",
|
|
6502
6539
|
render: StepRendererComponent
|
|
6503
6540
|
};
|
|
6504
6541
|
function StepRendererComponent(props) {
|
|
6505
6542
|
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,
|
|
6543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
6544
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TopBar, { back, toolbar, tags }),
|
|
6545
|
+
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,
|
|
6546
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components66.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
6510
6547
|
children,
|
|
6511
|
-
/* @__PURE__ */ (0,
|
|
6548
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(StepFooter, { footer, tags })
|
|
6512
6549
|
] });
|
|
6513
6550
|
}
|
|
6514
6551
|
|
|
6515
6552
|
// ../renderers/src/TabsRenderer.tsx
|
|
6516
|
-
var
|
|
6517
|
-
var
|
|
6553
|
+
var import_components67 = require("@transferwise/components");
|
|
6554
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6518
6555
|
var import_react26 = require("react");
|
|
6519
|
-
var
|
|
6556
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
6520
6557
|
var TabsRenderer = {
|
|
6521
6558
|
canRenderType: "tabs",
|
|
6522
6559
|
render: (props) => {
|
|
6523
6560
|
switch (props.control) {
|
|
6524
6561
|
case "segmented":
|
|
6525
6562
|
if (props.tabs.length > 3) {
|
|
6526
|
-
return /* @__PURE__ */ (0,
|
|
6563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
6527
6564
|
}
|
|
6528
|
-
return /* @__PURE__ */ (0,
|
|
6565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
6529
6566
|
case "chips":
|
|
6530
|
-
return /* @__PURE__ */ (0,
|
|
6567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
6531
6568
|
default:
|
|
6532
|
-
return /* @__PURE__ */ (0,
|
|
6569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
6533
6570
|
}
|
|
6534
6571
|
}
|
|
6535
6572
|
};
|
|
6536
6573
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6537
6574
|
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6538
|
-
return /* @__PURE__ */ (0,
|
|
6539
|
-
|
|
6575
|
+
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)(
|
|
6576
|
+
import_components67.Tabs,
|
|
6540
6577
|
{
|
|
6541
6578
|
name: uid,
|
|
6542
6579
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
6543
6580
|
tabs: tabs.map((option) => ({
|
|
6544
6581
|
title: option.title,
|
|
6545
6582
|
disabled: false,
|
|
6546
|
-
content: /* @__PURE__ */ (0,
|
|
6583
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "m-t-2", children: [
|
|
6547
6584
|
" ",
|
|
6548
6585
|
option.children,
|
|
6549
6586
|
" "
|
|
@@ -6556,9 +6593,9 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6556
6593
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6557
6594
|
var _a;
|
|
6558
6595
|
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6559
|
-
return /* @__PURE__ */ (0,
|
|
6560
|
-
/* @__PURE__ */ (0,
|
|
6561
|
-
|
|
6596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: (0, import_classnames33.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
6598
|
+
import_components67.SegmentedControl,
|
|
6562
6599
|
{
|
|
6563
6600
|
name: uid,
|
|
6564
6601
|
value: String(selectedIndex),
|
|
@@ -6572,31 +6609,32 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6572
6609
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
6573
6610
|
}
|
|
6574
6611
|
),
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6612
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6576
6613
|
] });
|
|
6577
6614
|
}
|
|
6578
6615
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
6579
6616
|
var _a;
|
|
6580
6617
|
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6581
|
-
return /* @__PURE__ */ (0,
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6583
|
-
|
|
6618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: (0, import_classnames33.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6619
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
6620
|
+
import_components67.Chips,
|
|
6584
6621
|
{
|
|
6585
6622
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
6586
6623
|
selected: selectedIndex,
|
|
6587
6624
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
6588
6625
|
}
|
|
6589
6626
|
) }),
|
|
6590
|
-
/* @__PURE__ */ (0,
|
|
6627
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6591
6628
|
] });
|
|
6592
6629
|
}
|
|
6593
6630
|
|
|
6594
6631
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6595
|
-
var
|
|
6632
|
+
var import_components69 = require("@transferwise/components");
|
|
6596
6633
|
|
|
6597
6634
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6598
|
-
var
|
|
6599
|
-
var
|
|
6635
|
+
var import_components68 = require("@transferwise/components");
|
|
6636
|
+
var import_WithDisplayFormat = __toESM(require("@transferwise/components/build/WithDisplayFormat/WithDisplayFormat"));
|
|
6637
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
6600
6638
|
var commonKeys = [
|
|
6601
6639
|
"autoComplete",
|
|
6602
6640
|
"autoCapitalize",
|
|
@@ -6611,16 +6649,21 @@ var commonKeys = [
|
|
|
6611
6649
|
"value"
|
|
6612
6650
|
];
|
|
6613
6651
|
function VariableTextInput(inputProps) {
|
|
6614
|
-
const { id, value, control, onChange } = inputProps;
|
|
6652
|
+
const { id, value, control, displayFormat, onChange } = inputProps;
|
|
6615
6653
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6654
|
+
if (control === "ssn-input" || displayFormat === "***-***-***" || displayFormat === "***-**-****") {
|
|
6655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SsnInput, __spreadProps(__spreadValues({}, commonProps), { onChange }));
|
|
6656
|
+
}
|
|
6616
6657
|
switch (control) {
|
|
6617
6658
|
case "email":
|
|
6618
|
-
return /* @__PURE__ */ (0,
|
|
6659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6619
6660
|
case "password":
|
|
6620
|
-
return /* @__PURE__ */ (0,
|
|
6661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
6662
|
+
case "ssn-input":
|
|
6663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(SsnInput, __spreadProps(__spreadValues({}, commonProps), { onChange }));
|
|
6621
6664
|
case "numeric": {
|
|
6622
6665
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6623
|
-
return /* @__PURE__ */ (0,
|
|
6666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6624
6667
|
TextInput,
|
|
6625
6668
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
6626
6669
|
onChange: (newValue) => {
|
|
@@ -6631,21 +6674,32 @@ function VariableTextInput(inputProps) {
|
|
|
6631
6674
|
);
|
|
6632
6675
|
}
|
|
6633
6676
|
case "phone-number":
|
|
6634
|
-
return /* @__PURE__ */ (0,
|
|
6677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components68.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
6635
6678
|
default: {
|
|
6636
|
-
return /* @__PURE__ */ (0,
|
|
6679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
6637
6680
|
}
|
|
6638
6681
|
}
|
|
6639
6682
|
}
|
|
6640
6683
|
function TextInput(props) {
|
|
6641
|
-
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,
|
|
6684
|
+
const _a = props, { control, displayFormat, onChange, type } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange", "type"]);
|
|
6685
|
+
const InputWithPattern = control === "textarea" ? import_components68.TextareaWithDisplayFormat : import_components68.InputWithDisplayFormat;
|
|
6686
|
+
const InputWithoutPattern = control === "textarea" ? import_components68.TextArea : import_components68.Input;
|
|
6687
|
+
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), { type, onChange: (e) => onChange(e.target.value) }));
|
|
6688
|
+
}
|
|
6689
|
+
function SsnInput(props) {
|
|
6690
|
+
const _a = props, { onChange, type: _type } = _a, commonProps = __objRest(_a, ["onChange", "type"]);
|
|
6691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
6692
|
+
"input",
|
|
6693
|
+
__spreadProps(__spreadValues({}, commonProps), {
|
|
6694
|
+
className: "form-control np-form-control np-form-control--size-auto np-input np-input--shape-rectangle",
|
|
6695
|
+
type: "password",
|
|
6696
|
+
onChange: (event) => onChange(event.target.value.replace(/[^0-9]/g, ""))
|
|
6697
|
+
})
|
|
6698
|
+
);
|
|
6645
6699
|
}
|
|
6646
6700
|
|
|
6647
6701
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6648
|
-
var
|
|
6702
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
6649
6703
|
var TextInputRenderer = {
|
|
6650
6704
|
canRenderType: "input-text",
|
|
6651
6705
|
render: (props) => {
|
|
@@ -6678,7 +6732,7 @@ var TextInputRenderer = {
|
|
|
6678
6732
|
}
|
|
6679
6733
|
}
|
|
6680
6734
|
});
|
|
6681
|
-
return /* @__PURE__ */ (0,
|
|
6735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6682
6736
|
FieldInput_default,
|
|
6683
6737
|
{
|
|
6684
6738
|
id,
|
|
@@ -6691,21 +6745,31 @@ var TextInputRenderer = {
|
|
|
6691
6745
|
features: props.features,
|
|
6692
6746
|
control: props.control,
|
|
6693
6747
|
tags: props.tags,
|
|
6694
|
-
children: /* @__PURE__ */ (0,
|
|
6748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_components69.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
6695
6749
|
}
|
|
6696
6750
|
);
|
|
6697
6751
|
}
|
|
6698
6752
|
};
|
|
6699
6753
|
var TextInputRenderer_default = TextInputRenderer;
|
|
6700
6754
|
|
|
6755
|
+
// ../renderers/src/UpdatableRenderer.tsx
|
|
6756
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
6757
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
6758
|
+
var UpdatableRenderer = {
|
|
6759
|
+
canRenderType: "updatable",
|
|
6760
|
+
render: ({ children, control, margin, tags }) => {
|
|
6761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: (0, import_classnames34.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children });
|
|
6762
|
+
}
|
|
6763
|
+
};
|
|
6764
|
+
|
|
6701
6765
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
6702
|
-
var
|
|
6766
|
+
var import_components70 = require("@transferwise/components");
|
|
6703
6767
|
|
|
6704
6768
|
// ../renderers/src/utils/getRandomId.ts
|
|
6705
6769
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
6706
6770
|
|
|
6707
6771
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
6708
|
-
var
|
|
6772
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
6709
6773
|
var UploadInputRenderer = {
|
|
6710
6774
|
canRenderType: "input-upload",
|
|
6711
6775
|
render: (props) => {
|
|
@@ -6734,7 +6798,7 @@ var UploadInputRenderer = {
|
|
|
6734
6798
|
};
|
|
6735
6799
|
return (
|
|
6736
6800
|
// We don't pass help here as there is no sensible place to display it
|
|
6737
|
-
/* @__PURE__ */ (0,
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6738
6802
|
UploadFieldInput_default,
|
|
6739
6803
|
{
|
|
6740
6804
|
id,
|
|
@@ -6744,8 +6808,8 @@ var UploadInputRenderer = {
|
|
|
6744
6808
|
features,
|
|
6745
6809
|
control,
|
|
6746
6810
|
tags,
|
|
6747
|
-
children: /* @__PURE__ */ (0,
|
|
6748
|
-
|
|
6811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6812
|
+
import_components70.UploadInput,
|
|
6749
6813
|
{
|
|
6750
6814
|
id,
|
|
6751
6815
|
description,
|
|
@@ -6755,7 +6819,7 @@ var UploadInputRenderer = {
|
|
|
6755
6819
|
{
|
|
6756
6820
|
id: "my-file",
|
|
6757
6821
|
filename: value.name,
|
|
6758
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
6822
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components70.Status.FAILED : import_components70.Status.SUCCEEDED
|
|
6759
6823
|
}
|
|
6760
6824
|
] : void 0,
|
|
6761
6825
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -6814,7 +6878,7 @@ var LargeUploadRenderer = {
|
|
|
6814
6878
|
};
|
|
6815
6879
|
const filetypes = acceptsToFileTypes(accepts);
|
|
6816
6880
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
6817
|
-
return /* @__PURE__ */ (0,
|
|
6881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6818
6882
|
FieldInput_default,
|
|
6819
6883
|
{
|
|
6820
6884
|
id,
|
|
@@ -6825,8 +6889,8 @@ var LargeUploadRenderer = {
|
|
|
6825
6889
|
features,
|
|
6826
6890
|
control,
|
|
6827
6891
|
tags,
|
|
6828
|
-
children: /* @__PURE__ */ (0,
|
|
6829
|
-
|
|
6892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
6893
|
+
import_components70.Upload,
|
|
6830
6894
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
6831
6895
|
usAccept,
|
|
6832
6896
|
usDisabled: disabled,
|
|
@@ -6841,10 +6905,10 @@ var LargeUploadRenderer = {
|
|
|
6841
6905
|
};
|
|
6842
6906
|
|
|
6843
6907
|
// ../renderers/src/UpsellRenderer.tsx
|
|
6844
|
-
var
|
|
6845
|
-
var
|
|
6908
|
+
var import_components71 = require("@transferwise/components");
|
|
6909
|
+
var import_classnames35 = __toESM(require_classnames());
|
|
6846
6910
|
var import_react27 = require("react");
|
|
6847
|
-
var
|
|
6911
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
6848
6912
|
var UpsellRenderer = {
|
|
6849
6913
|
canRenderType: "upsell",
|
|
6850
6914
|
render: UpsellRendererComponent
|
|
@@ -6852,10 +6916,10 @@ var UpsellRenderer = {
|
|
|
6852
6916
|
function UpsellRendererComponent(props) {
|
|
6853
6917
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
6854
6918
|
const [isVisible, setIsVisible] = (0, import_react27.useState)(true);
|
|
6855
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
6856
|
-
|
|
6919
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
6920
|
+
import_components71.Nudge,
|
|
6857
6921
|
{
|
|
6858
|
-
className: (0,
|
|
6922
|
+
className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6859
6923
|
mediaName: getMediaName(media),
|
|
6860
6924
|
title: text,
|
|
6861
6925
|
action: __spreadValues({
|
|
@@ -6898,43 +6962,6 @@ var supportedMediaNames = [
|
|
|
6898
6962
|
"wallet"
|
|
6899
6963
|
];
|
|
6900
6964
|
|
|
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
6965
|
// ../renderers/src/getWiseRenderers.ts
|
|
6939
6966
|
var getWiseRenderers = () => [
|
|
6940
6967
|
AddressValidationButtonRenderer_default,
|
|
@@ -6979,6 +7006,7 @@ var getWiseRenderers = () => [
|
|
|
6979
7006
|
TextInputRenderer_default,
|
|
6980
7007
|
UploadInputRenderer,
|
|
6981
7008
|
ColoredUpsellRenderer,
|
|
7009
|
+
UpdatableRenderer,
|
|
6982
7010
|
UpsellRenderer,
|
|
6983
7011
|
SplashStepRenderer,
|
|
6984
7012
|
SplashCelebrationStepRenderer,
|
|
@@ -6989,11 +7017,11 @@ var getWiseRenderers = () => [
|
|
|
6989
7017
|
|
|
6990
7018
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
6991
7019
|
var import_components72 = require("@transferwise/components");
|
|
6992
|
-
var
|
|
7020
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
6993
7021
|
var InitialLoadingStateRenderer = {
|
|
6994
7022
|
canRenderType: "loading-state",
|
|
6995
7023
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
6996
|
-
render: () => /* @__PURE__ */ (0,
|
|
7024
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
6997
7025
|
import_components72.Loader,
|
|
6998
7026
|
{
|
|
6999
7027
|
size: "md",
|
|
@@ -7006,24 +7034,24 @@ var InitialLoadingStateRenderer = {
|
|
|
7006
7034
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
7007
7035
|
var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
|
|
7008
7036
|
var import_components73 = require("@transferwise/components");
|
|
7009
|
-
var
|
|
7037
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
7010
7038
|
function DynamicFlowModal(props) {
|
|
7011
7039
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
7012
7040
|
const dfProps = useWiseToCoreProps(rest);
|
|
7013
7041
|
const df = (0, import_dynamic_flow_client.useDynamicFlowModal)(dfProps);
|
|
7014
|
-
return /* @__PURE__ */ (0,
|
|
7042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
7015
7043
|
import_components73.Modal,
|
|
7016
7044
|
__spreadProps(__spreadValues({
|
|
7017
7045
|
className: `dynamic-flow-modal ${className}`,
|
|
7018
7046
|
disableDimmerClickToClose: true
|
|
7019
7047
|
}, df.modal), {
|
|
7020
|
-
body: /* @__PURE__ */ (0,
|
|
7048
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
7021
7049
|
})
|
|
7022
7050
|
);
|
|
7023
7051
|
}
|
|
7024
7052
|
|
|
7025
7053
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
7026
|
-
var
|
|
7054
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
7027
7055
|
var wiseRenderers = getWiseRenderers();
|
|
7028
7056
|
var getMergedRenderers = (props) => {
|
|
7029
7057
|
var _d, _e;
|
|
@@ -7037,7 +7065,7 @@ var getMergedRenderers = (props) => {
|
|
|
7037
7065
|
method: initialRequest.method,
|
|
7038
7066
|
data: initialRequest.body
|
|
7039
7067
|
};
|
|
7040
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
7068
|
+
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
7069
|
DynamicFlowModal,
|
|
7042
7070
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
7043
7071
|
features: subflowFeatures,
|
|
@@ -7234,13 +7262,13 @@ var openLinkInNewTab = (url) => {
|
|
|
7234
7262
|
};
|
|
7235
7263
|
|
|
7236
7264
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7237
|
-
var
|
|
7265
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
7238
7266
|
function DynamicFlow(props) {
|
|
7239
7267
|
const { className = "" } = props;
|
|
7240
7268
|
const dfProps = useWiseToCoreProps(props);
|
|
7241
7269
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
7242
7270
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
7243
|
-
return /* @__PURE__ */ (0,
|
|
7271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className, onContextMenu, children: [
|
|
7244
7272
|
df.view,
|
|
7245
7273
|
contextMenu
|
|
7246
7274
|
] });
|
|
@@ -7249,7 +7277,7 @@ function DynamicFlow(props) {
|
|
|
7249
7277
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
7250
7278
|
var import_react31 = require("react");
|
|
7251
7279
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
7252
|
-
var
|
|
7280
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
7253
7281
|
var DynamicFlowWithRef = (0, import_react31.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
7254
7282
|
const { className = "" } = props;
|
|
7255
7283
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -7265,7 +7293,7 @@ var DynamicFlowWithRef = (0, import_react31.forwardRef)(function DynamicFlowWith
|
|
|
7265
7293
|
}),
|
|
7266
7294
|
[df]
|
|
7267
7295
|
);
|
|
7268
|
-
return /* @__PURE__ */ (0,
|
|
7296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className, children: df.view });
|
|
7269
7297
|
});
|
|
7270
7298
|
|
|
7271
7299
|
// src/index.ts
|