@wise/dynamic-flow-client-internal 3.25.0 → 3.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/nl.json +33 -0
- package/build/main.js +250 -186
- package/build/main.min.js +1 -1
- package/build/main.mjs +193 -129
- package/package.json +18 -18
package/build/main.js
CHANGED
|
@@ -900,8 +900,8 @@ var useRendererHttpClient = () => {
|
|
|
900
900
|
var import_components = require("@transferwise/components");
|
|
901
901
|
|
|
902
902
|
// ../renderers/src/utils/layout-utils.ts
|
|
903
|
-
var getMargin = (
|
|
904
|
-
switch (
|
|
903
|
+
var getMargin = (size2) => {
|
|
904
|
+
switch (size2) {
|
|
905
905
|
case "xs":
|
|
906
906
|
return "m-b-0";
|
|
907
907
|
case "sm":
|
|
@@ -1122,7 +1122,7 @@ function ButtonRendererComponent({
|
|
|
1122
1122
|
disabled,
|
|
1123
1123
|
margin,
|
|
1124
1124
|
title,
|
|
1125
|
-
size,
|
|
1125
|
+
size: size2,
|
|
1126
1126
|
onClick
|
|
1127
1127
|
}) {
|
|
1128
1128
|
const className = getMargin(margin);
|
|
@@ -1136,7 +1136,7 @@ function ButtonRendererComponent({
|
|
|
1136
1136
|
className,
|
|
1137
1137
|
disabled: isLoading || disabled,
|
|
1138
1138
|
priority: mapControl(control),
|
|
1139
|
-
size: mapSize(
|
|
1139
|
+
size: mapSize(size2),
|
|
1140
1140
|
type,
|
|
1141
1141
|
onClick,
|
|
1142
1142
|
children: title
|
|
@@ -1161,11 +1161,11 @@ var mapControl = (control) => {
|
|
|
1161
1161
|
return "secondary";
|
|
1162
1162
|
}
|
|
1163
1163
|
};
|
|
1164
|
-
var mapSize = (
|
|
1165
|
-
if (!
|
|
1164
|
+
var mapSize = (size2) => {
|
|
1165
|
+
if (!size2) {
|
|
1166
1166
|
return void 0;
|
|
1167
1167
|
}
|
|
1168
|
-
switch (
|
|
1168
|
+
switch (size2) {
|
|
1169
1169
|
case "xs":
|
|
1170
1170
|
case "sm":
|
|
1171
1171
|
return "sm";
|
|
@@ -1462,15 +1462,15 @@ var HeadingRenderer = {
|
|
|
1462
1462
|
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadValues({}, props))
|
|
1463
1463
|
};
|
|
1464
1464
|
function Heading(props) {
|
|
1465
|
-
const { text, size, align, margin, control } = props;
|
|
1465
|
+
const { text, size: size2, align, margin, control } = props;
|
|
1466
1466
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1467
|
-
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StandardHeading, { size, text, className });
|
|
1467
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StandardHeading, { size: size2, text, className });
|
|
1468
1468
|
}
|
|
1469
|
-
function DisplayHeading({ size, text, className }) {
|
|
1470
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Display, { type: getDisplayType(
|
|
1469
|
+
function DisplayHeading({ size: size2, text, className }) {
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Display, { type: getDisplayType(size2), className, children: text });
|
|
1471
1471
|
}
|
|
1472
|
-
function StandardHeading({ size, text, className }) {
|
|
1473
|
-
switch (
|
|
1472
|
+
function StandardHeading({ size: size2, text, className }) {
|
|
1473
|
+
switch (size2) {
|
|
1474
1474
|
case "xs":
|
|
1475
1475
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h5", { className, children: text });
|
|
1476
1476
|
case "sm":
|
|
@@ -1484,8 +1484,8 @@ function StandardHeading({ size, text, className }) {
|
|
|
1484
1484
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className, children: text });
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
|
-
var getDisplayType = (
|
|
1488
|
-
switch (
|
|
1487
|
+
var getDisplayType = (size2) => {
|
|
1488
|
+
switch (size2) {
|
|
1489
1489
|
case "xs":
|
|
1490
1490
|
case "sm":
|
|
1491
1491
|
return "display-small";
|
|
@@ -1520,7 +1520,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
1520
1520
|
function ImageRendererComponent({
|
|
1521
1521
|
accessibilityDescription,
|
|
1522
1522
|
margin,
|
|
1523
|
-
size,
|
|
1523
|
+
size: size2,
|
|
1524
1524
|
url
|
|
1525
1525
|
}) {
|
|
1526
1526
|
const [imageSource, setImageSource] = (0, import_react5.useState)("");
|
|
@@ -1528,7 +1528,7 @@ function ImageRendererComponent({
|
|
|
1528
1528
|
(0, import_react5.useEffect)(() => {
|
|
1529
1529
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
1530
1530
|
}, [url, httpClient]);
|
|
1531
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${
|
|
1531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1532
1532
|
import_components11.Image,
|
|
1533
1533
|
{
|
|
1534
1534
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1590,7 +1590,7 @@ var InstructionsRenderer = {
|
|
|
1590
1590
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1591
1591
|
|
|
1592
1592
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1593
|
-
var
|
|
1593
|
+
var import_components14 = require("@transferwise/components");
|
|
1594
1594
|
|
|
1595
1595
|
// ../renderers/src/utils/input-utils.ts
|
|
1596
1596
|
var onWheel = (event) => {
|
|
@@ -1599,13 +1599,71 @@ var onWheel = (event) => {
|
|
|
1599
1599
|
}
|
|
1600
1600
|
};
|
|
1601
1601
|
|
|
1602
|
-
// ../renderers/src/
|
|
1602
|
+
// ../renderers/src/utils/getIconAvatar.tsx
|
|
1603
|
+
var import_components13 = require("@transferwise/components");
|
|
1603
1604
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1605
|
+
var size = 24;
|
|
1606
|
+
function getIconAvatar({ icon, image }) {
|
|
1607
|
+
if (image == null ? void 0 : image.url) {
|
|
1608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1609
|
+
"img",
|
|
1610
|
+
{
|
|
1611
|
+
src: image.url,
|
|
1612
|
+
alt: image.accessibilityDescription,
|
|
1613
|
+
width: `${size}px`,
|
|
1614
|
+
height: `${size}px`
|
|
1615
|
+
}
|
|
1616
|
+
);
|
|
1617
|
+
}
|
|
1618
|
+
if (isFlagIcon2(icon)) {
|
|
1619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1620
|
+
}
|
|
1621
|
+
if (isNamedIcon2(icon)) {
|
|
1622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name });
|
|
1623
|
+
}
|
|
1624
|
+
if (icon && "text" in icon) {
|
|
1625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, size, children: icon.text });
|
|
1626
|
+
}
|
|
1627
|
+
return null;
|
|
1628
|
+
}
|
|
1629
|
+
var isNamedIcon2 = (icon) => icon ? "name" in icon : false;
|
|
1630
|
+
var isFlagIcon2 = (icon) => isNamedIcon2(icon) && icon.name.startsWith("flag-");
|
|
1631
|
+
|
|
1632
|
+
// ../renderers/src/utils/getInputGroupAddonStart.tsx
|
|
1633
|
+
var getInputGroupAddonStart = ({ icon, image }) => {
|
|
1634
|
+
const content = getIconAvatar({ icon, image });
|
|
1635
|
+
return content ? { content } : void 0;
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1638
|
+
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1639
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1604
1640
|
var IntegerInputRenderer = {
|
|
1605
1641
|
canRenderType: "input-integer",
|
|
1606
1642
|
render: (props) => {
|
|
1607
|
-
const _a = props, {
|
|
1608
|
-
|
|
1643
|
+
const _a = props, {
|
|
1644
|
+
id,
|
|
1645
|
+
label,
|
|
1646
|
+
description,
|
|
1647
|
+
help,
|
|
1648
|
+
icon,
|
|
1649
|
+
image,
|
|
1650
|
+
type,
|
|
1651
|
+
validationState,
|
|
1652
|
+
value,
|
|
1653
|
+
onChange
|
|
1654
|
+
} = _a, rest = __objRest(_a, [
|
|
1655
|
+
"id",
|
|
1656
|
+
"label",
|
|
1657
|
+
"description",
|
|
1658
|
+
"help",
|
|
1659
|
+
"icon",
|
|
1660
|
+
"image",
|
|
1661
|
+
"type",
|
|
1662
|
+
"validationState",
|
|
1663
|
+
"value",
|
|
1664
|
+
"onChange"
|
|
1665
|
+
]);
|
|
1666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1609
1667
|
FieldInput_default,
|
|
1610
1668
|
{
|
|
1611
1669
|
id,
|
|
@@ -1613,8 +1671,8 @@ var IntegerInputRenderer = {
|
|
|
1613
1671
|
description,
|
|
1614
1672
|
validation: validationState,
|
|
1615
1673
|
help,
|
|
1616
|
-
children: /* @__PURE__ */ (0,
|
|
1617
|
-
|
|
1674
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components14.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1675
|
+
import_components14.Input,
|
|
1618
1676
|
__spreadValues({
|
|
1619
1677
|
id,
|
|
1620
1678
|
name: id,
|
|
@@ -1628,7 +1686,7 @@ var IntegerInputRenderer = {
|
|
|
1628
1686
|
},
|
|
1629
1687
|
onWheel
|
|
1630
1688
|
}, rest)
|
|
1631
|
-
)
|
|
1689
|
+
) })
|
|
1632
1690
|
}
|
|
1633
1691
|
);
|
|
1634
1692
|
}
|
|
@@ -1636,14 +1694,14 @@ var IntegerInputRenderer = {
|
|
|
1636
1694
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1637
1695
|
|
|
1638
1696
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1639
|
-
var
|
|
1640
|
-
var
|
|
1697
|
+
var import_components15 = require("@transferwise/components");
|
|
1698
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1641
1699
|
var LoadingIndicatorRenderer = {
|
|
1642
1700
|
canRenderType: "loading-indicator",
|
|
1643
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
1644
|
-
|
|
1701
|
+
render: ({ margin, size: size2 }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1702
|
+
import_components15.Loader,
|
|
1645
1703
|
{
|
|
1646
|
-
size,
|
|
1704
|
+
size: size2,
|
|
1647
1705
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
1648
1706
|
"data-testid": "loading-indicator"
|
|
1649
1707
|
}
|
|
@@ -1652,30 +1710,30 @@ var LoadingIndicatorRenderer = {
|
|
|
1652
1710
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
1653
1711
|
|
|
1654
1712
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1655
|
-
var
|
|
1656
|
-
var
|
|
1713
|
+
var import_components16 = require("@transferwise/components");
|
|
1714
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1657
1715
|
var MarkdownRenderer = {
|
|
1658
1716
|
canRenderType: "markdown",
|
|
1659
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
1717
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1660
1718
|
};
|
|
1661
1719
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1662
1720
|
|
|
1663
1721
|
// ../renderers/src/ModalRenderer.tsx
|
|
1664
|
-
var
|
|
1722
|
+
var import_components17 = require("@transferwise/components");
|
|
1665
1723
|
var import_react6 = require("react");
|
|
1666
|
-
var
|
|
1724
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1667
1725
|
var ModalRenderer = {
|
|
1668
1726
|
canRenderType: "modal",
|
|
1669
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1727
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DFModal, __spreadValues({}, props))
|
|
1670
1728
|
};
|
|
1671
1729
|
var ModalRenderer_default = ModalRenderer;
|
|
1672
1730
|
function DFModal({ content, margin, trigger }) {
|
|
1673
1731
|
const [visible, setVisible] = (0, import_react6.useState)(false);
|
|
1674
1732
|
const { components, title } = content;
|
|
1675
|
-
return /* @__PURE__ */ (0,
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1678
|
-
|
|
1733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getMargin(margin), children: [
|
|
1734
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1735
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1736
|
+
import_components17.Modal,
|
|
1679
1737
|
{
|
|
1680
1738
|
scroll: "content",
|
|
1681
1739
|
open: visible,
|
|
@@ -1689,20 +1747,20 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1689
1747
|
}
|
|
1690
1748
|
|
|
1691
1749
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1692
|
-
var
|
|
1750
|
+
var import_components19 = require("@transferwise/components");
|
|
1693
1751
|
|
|
1694
1752
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1695
|
-
var
|
|
1696
|
-
var
|
|
1753
|
+
var import_components18 = require("@transferwise/components");
|
|
1754
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1697
1755
|
function OptionMedia({ icon, image }) {
|
|
1698
1756
|
if (image == null ? void 0 : image.url) {
|
|
1699
|
-
return /* @__PURE__ */ (0,
|
|
1757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1700
1758
|
}
|
|
1701
1759
|
if (icon && "name" in icon) {
|
|
1702
|
-
return /* @__PURE__ */ (0,
|
|
1760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1703
1761
|
}
|
|
1704
1762
|
if (icon && "text" in icon) {
|
|
1705
|
-
return /* @__PURE__ */ (0,
|
|
1763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.Avatar, { type: import_components18.AvatarType.INITIALS, children: icon.text });
|
|
1706
1764
|
}
|
|
1707
1765
|
return null;
|
|
1708
1766
|
}
|
|
@@ -1722,10 +1780,10 @@ var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1722
1780
|
|
|
1723
1781
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1724
1782
|
var import_react7 = require("react");
|
|
1725
|
-
var
|
|
1783
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1726
1784
|
var MultiSelectInputRenderer = {
|
|
1727
1785
|
canRenderType: "input-multi-select",
|
|
1728
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1786
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1729
1787
|
};
|
|
1730
1788
|
function MultiSelectInputRendererComponent(props) {
|
|
1731
1789
|
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
@@ -1767,12 +1825,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1767
1825
|
const contentProps = {
|
|
1768
1826
|
title: option.title,
|
|
1769
1827
|
description: option.description,
|
|
1770
|
-
icon: /* @__PURE__ */ (0,
|
|
1828
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
1771
1829
|
};
|
|
1772
|
-
return /* @__PURE__ */ (0,
|
|
1830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components19.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1773
1831
|
};
|
|
1774
1832
|
const extraProps = { autoComplete };
|
|
1775
|
-
return /* @__PURE__ */ (0,
|
|
1833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1776
1834
|
FieldInput_default,
|
|
1777
1835
|
{
|
|
1778
1836
|
id,
|
|
@@ -1780,8 +1838,8 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1780
1838
|
help,
|
|
1781
1839
|
description,
|
|
1782
1840
|
validation: validationState,
|
|
1783
|
-
children: /* @__PURE__ */ (0,
|
|
1784
|
-
|
|
1841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1842
|
+
import_components19.SelectInput,
|
|
1785
1843
|
__spreadValues({
|
|
1786
1844
|
id,
|
|
1787
1845
|
items: options.map((option, index) => {
|
|
@@ -1819,12 +1877,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1819
1877
|
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
1820
1878
|
|
|
1821
1879
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1822
|
-
var
|
|
1880
|
+
var import_components21 = require("@transferwise/components");
|
|
1823
1881
|
|
|
1824
1882
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1825
|
-
var
|
|
1883
|
+
var import_components20 = require("@transferwise/components");
|
|
1826
1884
|
var import_classnames3 = __toESM(require_classnames());
|
|
1827
|
-
var
|
|
1885
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1828
1886
|
function UploadFieldInput({
|
|
1829
1887
|
id,
|
|
1830
1888
|
children,
|
|
@@ -1833,18 +1891,18 @@ function UploadFieldInput({
|
|
|
1833
1891
|
help,
|
|
1834
1892
|
validation
|
|
1835
1893
|
}) {
|
|
1836
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1894
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1837
1895
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1838
|
-
return /* @__PURE__ */ (0,
|
|
1896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1839
1897
|
"div",
|
|
1840
1898
|
{
|
|
1841
1899
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1842
1900
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1843
1901
|
}),
|
|
1844
1902
|
children: [
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1846
1904
|
children,
|
|
1847
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
1905
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1848
1906
|
]
|
|
1849
1907
|
}
|
|
1850
1908
|
);
|
|
@@ -1876,7 +1934,7 @@ var getFileType = (base64Url) => {
|
|
|
1876
1934
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1877
1935
|
|
|
1878
1936
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1879
|
-
var
|
|
1937
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1880
1938
|
var MultiUploadInputRenderer = {
|
|
1881
1939
|
canRenderType: "input-upload-multi",
|
|
1882
1940
|
render: (props) => {
|
|
@@ -1903,7 +1961,7 @@ var MultiUploadInputRenderer = {
|
|
|
1903
1961
|
};
|
|
1904
1962
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1905
1963
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1906
|
-
return /* @__PURE__ */ (0,
|
|
1964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1907
1965
|
UploadFieldInput_default,
|
|
1908
1966
|
{
|
|
1909
1967
|
id,
|
|
@@ -1911,8 +1969,8 @@ var MultiUploadInputRenderer = {
|
|
|
1911
1969
|
description,
|
|
1912
1970
|
validation: validationState,
|
|
1913
1971
|
help,
|
|
1914
|
-
children: /* @__PURE__ */ (0,
|
|
1915
|
-
|
|
1972
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1973
|
+
import_components21.UploadInput,
|
|
1916
1974
|
{
|
|
1917
1975
|
id,
|
|
1918
1976
|
"aria-describedby": descriptionId,
|
|
@@ -1934,13 +1992,35 @@ var MultiUploadInputRenderer = {
|
|
|
1934
1992
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
1935
1993
|
|
|
1936
1994
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1937
|
-
var
|
|
1938
|
-
var
|
|
1995
|
+
var import_components22 = require("@transferwise/components");
|
|
1996
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1939
1997
|
var NumberInputRenderer = {
|
|
1940
1998
|
canRenderType: "input-number",
|
|
1941
1999
|
render: (props) => {
|
|
1942
|
-
const _a = props, {
|
|
1943
|
-
|
|
2000
|
+
const _a = props, {
|
|
2001
|
+
id,
|
|
2002
|
+
label,
|
|
2003
|
+
description,
|
|
2004
|
+
help,
|
|
2005
|
+
icon,
|
|
2006
|
+
image,
|
|
2007
|
+
type,
|
|
2008
|
+
validationState,
|
|
2009
|
+
value,
|
|
2010
|
+
onChange
|
|
2011
|
+
} = _a, rest = __objRest(_a, [
|
|
2012
|
+
"id",
|
|
2013
|
+
"label",
|
|
2014
|
+
"description",
|
|
2015
|
+
"help",
|
|
2016
|
+
"icon",
|
|
2017
|
+
"image",
|
|
2018
|
+
"type",
|
|
2019
|
+
"validationState",
|
|
2020
|
+
"value",
|
|
2021
|
+
"onChange"
|
|
2022
|
+
]);
|
|
2023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1944
2024
|
FieldInput_default,
|
|
1945
2025
|
{
|
|
1946
2026
|
id,
|
|
@@ -1948,8 +2028,8 @@ var NumberInputRenderer = {
|
|
|
1948
2028
|
description,
|
|
1949
2029
|
validation: validationState,
|
|
1950
2030
|
help,
|
|
1951
|
-
children: /* @__PURE__ */ (0,
|
|
1952
|
-
|
|
2031
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components22.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2032
|
+
import_components22.Input,
|
|
1953
2033
|
__spreadValues({
|
|
1954
2034
|
id,
|
|
1955
2035
|
name: id,
|
|
@@ -1961,7 +2041,7 @@ var NumberInputRenderer = {
|
|
|
1961
2041
|
},
|
|
1962
2042
|
onWheel
|
|
1963
2043
|
}, rest)
|
|
1964
|
-
)
|
|
2044
|
+
) })
|
|
1965
2045
|
}
|
|
1966
2046
|
);
|
|
1967
2047
|
}
|
|
@@ -1972,16 +2052,16 @@ var NumberInputRenderer_default = NumberInputRenderer;
|
|
|
1972
2052
|
var import_react_intl6 = require("react-intl");
|
|
1973
2053
|
|
|
1974
2054
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
1975
|
-
var
|
|
2055
|
+
var import_components23 = require("@transferwise/components");
|
|
1976
2056
|
var import_react8 = require("react");
|
|
1977
2057
|
function useSnackBarIfAvailable() {
|
|
1978
|
-
const context = (0, import_react8.useContext)(
|
|
2058
|
+
const context = (0, import_react8.useContext)(import_components23.SnackbarContext);
|
|
1979
2059
|
return context ? context.createSnackbar : () => {
|
|
1980
2060
|
};
|
|
1981
2061
|
}
|
|
1982
2062
|
|
|
1983
2063
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1984
|
-
var
|
|
2064
|
+
var import_components24 = require("@transferwise/components");
|
|
1985
2065
|
var import_classnames4 = __toESM(require_classnames());
|
|
1986
2066
|
|
|
1987
2067
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
@@ -2000,17 +2080,17 @@ var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
2000
2080
|
});
|
|
2001
2081
|
|
|
2002
2082
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2003
|
-
var
|
|
2083
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2004
2084
|
var ParagraphRenderer = {
|
|
2005
2085
|
canRenderType: "paragraph",
|
|
2006
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2086
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Paragraph, __spreadValues({}, props))
|
|
2007
2087
|
};
|
|
2008
2088
|
function Paragraph({ align, control, margin, text }) {
|
|
2009
2089
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2010
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
2090
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(StandardParagraph, { className, text });
|
|
2011
2091
|
}
|
|
2012
2092
|
function StandardParagraph({ text, className }) {
|
|
2013
|
-
return /* @__PURE__ */ (0,
|
|
2093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2014
2094
|
}
|
|
2015
2095
|
function CopyableParagraph({
|
|
2016
2096
|
text,
|
|
@@ -2024,9 +2104,9 @@ function CopyableParagraph({
|
|
|
2024
2104
|
});
|
|
2025
2105
|
};
|
|
2026
2106
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2027
|
-
return /* @__PURE__ */ (0,
|
|
2028
|
-
/* @__PURE__ */ (0,
|
|
2029
|
-
|
|
2107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className, children: [
|
|
2108
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2109
|
+
import_components24.Input,
|
|
2030
2110
|
{
|
|
2031
2111
|
type: "text",
|
|
2032
2112
|
value: text,
|
|
@@ -2034,13 +2114,13 @@ function CopyableParagraph({
|
|
|
2034
2114
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
2035
2115
|
}
|
|
2036
2116
|
),
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2038
2118
|
] });
|
|
2039
2119
|
}
|
|
2040
2120
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2041
2121
|
|
|
2042
2122
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2043
|
-
var
|
|
2123
|
+
var import_components25 = require("@transferwise/components");
|
|
2044
2124
|
var import_react9 = require("react");
|
|
2045
2125
|
var import_icons = require("@transferwise/icons");
|
|
2046
2126
|
var import_react_intl8 = require("react-intl");
|
|
@@ -2072,10 +2152,10 @@ var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
2072
2152
|
|
|
2073
2153
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2074
2154
|
var import_classnames5 = __toESM(require_classnames());
|
|
2075
|
-
var
|
|
2155
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2076
2156
|
var RepeatableRenderer = {
|
|
2077
2157
|
canRenderType: "repeatable",
|
|
2078
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2158
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Repeatable, __spreadValues({}, props))
|
|
2079
2159
|
};
|
|
2080
2160
|
function Repeatable(props) {
|
|
2081
2161
|
const {
|
|
@@ -2114,40 +2194,40 @@ function Repeatable(props) {
|
|
|
2114
2194
|
const onCancelEdit = () => {
|
|
2115
2195
|
setOpenModalType(null);
|
|
2116
2196
|
};
|
|
2117
|
-
return /* @__PURE__ */ (0,
|
|
2118
|
-
title && /* @__PURE__ */ (0,
|
|
2119
|
-
description && /* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2198
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Header, { title }),
|
|
2199
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { children: description }),
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2121
2201
|
"div",
|
|
2122
2202
|
{
|
|
2123
2203
|
className: (0, import_classnames5.default)("form-group", {
|
|
2124
2204
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2125
2205
|
}),
|
|
2126
2206
|
children: [
|
|
2127
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2129
|
-
|
|
2207
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2209
|
+
import_components25.NavigationOption,
|
|
2130
2210
|
{
|
|
2131
|
-
media: /* @__PURE__ */ (0,
|
|
2211
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons.Plus, {}),
|
|
2132
2212
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2133
2213
|
showMediaAtAllSizes: true,
|
|
2134
2214
|
onClick: () => onAddItem()
|
|
2135
2215
|
}
|
|
2136
2216
|
),
|
|
2137
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2217
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.InlineAlert, { type: "negative", children: validationState.message })
|
|
2138
2218
|
]
|
|
2139
2219
|
}
|
|
2140
2220
|
),
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2142
|
-
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2222
|
+
import_components25.Modal,
|
|
2143
2223
|
{
|
|
2144
2224
|
open: openModalType !== null,
|
|
2145
2225
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2146
|
-
body: /* @__PURE__ */ (0,
|
|
2147
|
-
/* @__PURE__ */ (0,
|
|
2148
|
-
/* @__PURE__ */ (0,
|
|
2149
|
-
/* @__PURE__ */ (0,
|
|
2150
|
-
/* @__PURE__ */ (0,
|
|
2226
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2151
2231
|
] })
|
|
2152
2232
|
] }),
|
|
2153
2233
|
onClose: () => onCancelEdit()
|
|
@@ -2159,10 +2239,10 @@ function ItemSummaryOption({
|
|
|
2159
2239
|
item,
|
|
2160
2240
|
onClick
|
|
2161
2241
|
}) {
|
|
2162
|
-
return /* @__PURE__ */ (0,
|
|
2163
|
-
|
|
2242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2243
|
+
import_components25.NavigationOption,
|
|
2164
2244
|
{
|
|
2165
|
-
media: /* @__PURE__ */ (0,
|
|
2245
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
|
|
2166
2246
|
title: item.title,
|
|
2167
2247
|
content: item.description,
|
|
2168
2248
|
showMediaAtAllSizes: true,
|
|
@@ -2173,7 +2253,7 @@ function ItemSummaryOption({
|
|
|
2173
2253
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2174
2254
|
|
|
2175
2255
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2176
|
-
var
|
|
2256
|
+
var import_components27 = require("@transferwise/components");
|
|
2177
2257
|
|
|
2178
2258
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2179
2259
|
var import_react_intl10 = require("react-intl");
|
|
@@ -2199,8 +2279,8 @@ var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
2199
2279
|
});
|
|
2200
2280
|
|
|
2201
2281
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2202
|
-
var
|
|
2203
|
-
var
|
|
2282
|
+
var import_components26 = require("@transferwise/components");
|
|
2283
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2204
2284
|
function ErrorResult({ state }) {
|
|
2205
2285
|
const intl = (0, import_react_intl10.useIntl)();
|
|
2206
2286
|
const buttonVisualProps = {
|
|
@@ -2208,11 +2288,11 @@ function ErrorResult({ state }) {
|
|
|
2208
2288
|
size: "sm",
|
|
2209
2289
|
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2210
2290
|
};
|
|
2211
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "m-t-2", children: [
|
|
2212
2292
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2213
2293
|
"\xA0",
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2215
|
-
|
|
2294
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2295
|
+
import_components26.Button,
|
|
2216
2296
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2217
2297
|
onClick: () => {
|
|
2218
2298
|
state.onRetry();
|
|
@@ -2238,7 +2318,7 @@ var search_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
2238
2318
|
|
|
2239
2319
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2240
2320
|
var import_react_intl12 = require("react-intl");
|
|
2241
|
-
var
|
|
2321
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2242
2322
|
function BlockSearchRendererComponent({
|
|
2243
2323
|
id,
|
|
2244
2324
|
isLoading,
|
|
@@ -2251,9 +2331,9 @@ function BlockSearchRendererComponent({
|
|
|
2251
2331
|
const [hasSearched, setHasSearched] = (0, import_react10.useState)(false);
|
|
2252
2332
|
const trackEvent = useTrackEvent();
|
|
2253
2333
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2254
|
-
return /* @__PURE__ */ (0,
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
|
|
2334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: getMargin(margin), children: [
|
|
2335
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2336
|
+
import_components27.Input,
|
|
2257
2337
|
{
|
|
2258
2338
|
id,
|
|
2259
2339
|
name: id,
|
|
@@ -2269,7 +2349,7 @@ function BlockSearchRendererComponent({
|
|
|
2269
2349
|
}
|
|
2270
2350
|
}
|
|
2271
2351
|
) }),
|
|
2272
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2352
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SearchResultContent, { state, onChange })
|
|
2273
2353
|
] });
|
|
2274
2354
|
}
|
|
2275
2355
|
function SearchResultContent({
|
|
@@ -2278,27 +2358,27 @@ function SearchResultContent({
|
|
|
2278
2358
|
}) {
|
|
2279
2359
|
switch (state.type) {
|
|
2280
2360
|
case "error":
|
|
2281
|
-
return /* @__PURE__ */ (0,
|
|
2361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state });
|
|
2282
2362
|
case "results":
|
|
2283
|
-
return /* @__PURE__ */ (0,
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SearchResults, { state, onChange });
|
|
2284
2364
|
case "noResults":
|
|
2285
|
-
return /* @__PURE__ */ (0,
|
|
2365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(EmptySearchResult, { state });
|
|
2286
2366
|
case "pending":
|
|
2287
2367
|
default:
|
|
2288
2368
|
return null;
|
|
2289
2369
|
}
|
|
2290
2370
|
}
|
|
2291
2371
|
function EmptySearchResult({ state }) {
|
|
2292
|
-
return /* @__PURE__ */ (0,
|
|
2372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2293
2373
|
}
|
|
2294
2374
|
function SearchResults({
|
|
2295
2375
|
state
|
|
2296
2376
|
}) {
|
|
2297
2377
|
const trackEvent = useTrackEvent();
|
|
2298
|
-
return /* @__PURE__ */ (0,
|
|
2378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.NavigationOptionsList, { children: state.results.map((result) => {
|
|
2299
2379
|
const { icon, image } = result;
|
|
2300
|
-
return /* @__PURE__ */ (0,
|
|
2301
|
-
|
|
2380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2381
|
+
import_components27.NavigationOption,
|
|
2302
2382
|
{
|
|
2303
2383
|
title: result.title,
|
|
2304
2384
|
content: result.description,
|
|
@@ -2319,11 +2399,11 @@ function SearchResults({
|
|
|
2319
2399
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
2320
2400
|
|
|
2321
2401
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2322
|
-
var
|
|
2402
|
+
var import_components28 = require("@transferwise/components");
|
|
2323
2403
|
var import_icons2 = require("@transferwise/icons");
|
|
2324
2404
|
var import_react11 = require("react");
|
|
2325
2405
|
var import_react_intl13 = require("react-intl");
|
|
2326
|
-
var
|
|
2406
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2327
2407
|
function InlineSearchRenderer({
|
|
2328
2408
|
id,
|
|
2329
2409
|
isLoading,
|
|
@@ -2335,18 +2415,18 @@ function InlineSearchRenderer({
|
|
|
2335
2415
|
const [hasSearched, setHasSearched] = (0, import_react11.useState)(false);
|
|
2336
2416
|
const trackEvent = useTrackEvent();
|
|
2337
2417
|
const intl = (0, import_react_intl13.useIntl)();
|
|
2338
|
-
return /* @__PURE__ */ (0,
|
|
2339
|
-
|
|
2418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2419
|
+
import_components28.Typeahead,
|
|
2340
2420
|
{
|
|
2341
2421
|
id: "typeahead-input-id",
|
|
2342
2422
|
intl,
|
|
2343
2423
|
name: "typeahead-input-name",
|
|
2344
2424
|
size: "md",
|
|
2345
2425
|
maxHeight: 100,
|
|
2346
|
-
footer: /* @__PURE__ */ (0,
|
|
2426
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2347
2427
|
multiple: false,
|
|
2348
2428
|
clearable: false,
|
|
2349
|
-
addon: /* @__PURE__ */ (0,
|
|
2429
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons2.Search, { size: 24 }),
|
|
2350
2430
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2351
2431
|
minQueryLength: 1,
|
|
2352
2432
|
onChange: (values) => {
|
|
@@ -2383,29 +2463,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2383
2463
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2384
2464
|
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2385
2465
|
if (state.type === "noResults") {
|
|
2386
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components28.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2387
2467
|
}
|
|
2388
2468
|
if (state.type === "error") {
|
|
2389
|
-
return /* @__PURE__ */ (0,
|
|
2469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ErrorResult, { state }) });
|
|
2390
2470
|
}
|
|
2391
2471
|
if (state.type === "pending" || isLoading) {
|
|
2392
|
-
return /* @__PURE__ */ (0,
|
|
2472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2393
2473
|
}
|
|
2394
2474
|
return null;
|
|
2395
2475
|
}
|
|
2396
2476
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2397
2477
|
|
|
2398
2478
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2399
|
-
var
|
|
2479
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2400
2480
|
var SearchRenderer = {
|
|
2401
2481
|
canRenderType: "search",
|
|
2402
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2482
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2403
2483
|
};
|
|
2404
2484
|
var SearchRenderer_default = SearchRenderer;
|
|
2405
2485
|
|
|
2406
2486
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2407
|
-
var
|
|
2408
|
-
var
|
|
2487
|
+
var import_components29 = require("@transferwise/components");
|
|
2488
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2409
2489
|
function RadioInputRendererComponent(props) {
|
|
2410
2490
|
const {
|
|
2411
2491
|
id,
|
|
@@ -2419,8 +2499,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2419
2499
|
validationState,
|
|
2420
2500
|
onSelect
|
|
2421
2501
|
} = props;
|
|
2422
|
-
return /* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2424
2504
|
FieldInput_default,
|
|
2425
2505
|
{
|
|
2426
2506
|
id,
|
|
@@ -2428,8 +2508,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2428
2508
|
help,
|
|
2429
2509
|
description,
|
|
2430
2510
|
validation: validationState,
|
|
2431
|
-
children: /* @__PURE__ */ (0,
|
|
2432
|
-
|
|
2511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2512
|
+
import_components29.RadioGroup,
|
|
2433
2513
|
{
|
|
2434
2514
|
name: id,
|
|
2435
2515
|
radios: options.map((option, index) => ({
|
|
@@ -2437,7 +2517,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2437
2517
|
value: index,
|
|
2438
2518
|
secondary: option.description,
|
|
2439
2519
|
disabled: option.disabled || disabled,
|
|
2440
|
-
avatar: /* @__PURE__ */ (0,
|
|
2520
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2441
2521
|
})),
|
|
2442
2522
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2443
2523
|
onChange: onSelect
|
|
@@ -2451,9 +2531,9 @@ function RadioInputRendererComponent(props) {
|
|
|
2451
2531
|
}
|
|
2452
2532
|
|
|
2453
2533
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2454
|
-
var
|
|
2534
|
+
var import_components30 = require("@transferwise/components");
|
|
2455
2535
|
var import_react12 = require("react");
|
|
2456
|
-
var
|
|
2536
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2457
2537
|
function TabInputRendererComponent(props) {
|
|
2458
2538
|
const {
|
|
2459
2539
|
id,
|
|
@@ -2472,8 +2552,8 @@ function TabInputRendererComponent(props) {
|
|
|
2472
2552
|
onSelect(0);
|
|
2473
2553
|
}
|
|
2474
2554
|
}, [selectedIndex, onSelect, options.length]);
|
|
2475
|
-
return /* @__PURE__ */ (0,
|
|
2476
|
-
/* @__PURE__ */ (0,
|
|
2555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2477
2557
|
FieldInput_default,
|
|
2478
2558
|
{
|
|
2479
2559
|
id,
|
|
@@ -2481,8 +2561,8 @@ function TabInputRendererComponent(props) {
|
|
|
2481
2561
|
help,
|
|
2482
2562
|
description,
|
|
2483
2563
|
validation: validationState,
|
|
2484
|
-
children: /* @__PURE__ */ (0,
|
|
2485
|
-
|
|
2564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2565
|
+
import_components30.Tabs,
|
|
2486
2566
|
{
|
|
2487
2567
|
name: id,
|
|
2488
2568
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -2490,7 +2570,7 @@ function TabInputRendererComponent(props) {
|
|
|
2490
2570
|
title: option.title,
|
|
2491
2571
|
// if we pass null, we get some props-types console errors
|
|
2492
2572
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2493
|
-
content: /* @__PURE__ */ (0,
|
|
2573
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, {}),
|
|
2494
2574
|
disabled: option.disabled || disabled
|
|
2495
2575
|
})),
|
|
2496
2576
|
onTabSelect: onSelect
|
|
@@ -2505,29 +2585,6 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2505
2585
|
|
|
2506
2586
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2507
2587
|
var import_components31 = require("@transferwise/components");
|
|
2508
|
-
|
|
2509
|
-
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
2510
|
-
var import_components30 = require("@transferwise/components");
|
|
2511
|
-
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2512
|
-
function SelectTriggerMedia({ icon, image }) {
|
|
2513
|
-
if (image == null ? void 0 : image.url) {
|
|
2514
|
-
return null;
|
|
2515
|
-
}
|
|
2516
|
-
if (isFlagIcon2(icon)) {
|
|
2517
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
2518
|
-
}
|
|
2519
|
-
if (isNamedIcon2(icon)) {
|
|
2520
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DynamicIcon_default, { name: icon.name });
|
|
2521
|
-
}
|
|
2522
|
-
if (icon && "text" in icon) {
|
|
2523
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: icon.text });
|
|
2524
|
-
}
|
|
2525
|
-
return null;
|
|
2526
|
-
}
|
|
2527
|
-
var isNamedIcon2 = (icon) => icon ? "name" in icon : false;
|
|
2528
|
-
var isFlagIcon2 = (icon) => isNamedIcon2(icon) && icon.name.startsWith("flag-");
|
|
2529
|
-
|
|
2530
|
-
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2531
2588
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2532
2589
|
function SelectInputRendererComponent(props) {
|
|
2533
2590
|
const {
|
|
@@ -2564,7 +2621,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2564
2621
|
const contentProps = withinTrigger ? {
|
|
2565
2622
|
title: option.title,
|
|
2566
2623
|
note: option.description,
|
|
2567
|
-
icon:
|
|
2624
|
+
icon: getIconAvatar(option)
|
|
2568
2625
|
} : {
|
|
2569
2626
|
title: option.title,
|
|
2570
2627
|
description: option.description,
|
|
@@ -2721,6 +2778,9 @@ var mapStatus = (status) => {
|
|
|
2721
2778
|
return status;
|
|
2722
2779
|
};
|
|
2723
2780
|
|
|
2781
|
+
// ../renderers/src/TextInputRenderer.tsx
|
|
2782
|
+
var import_components35 = require("@transferwise/components");
|
|
2783
|
+
|
|
2724
2784
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2725
2785
|
var import_components34 = require("@transferwise/components");
|
|
2726
2786
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -2802,6 +2862,8 @@ var TextInputRenderer = {
|
|
|
2802
2862
|
description,
|
|
2803
2863
|
help,
|
|
2804
2864
|
error,
|
|
2865
|
+
icon,
|
|
2866
|
+
image,
|
|
2805
2867
|
maxLength,
|
|
2806
2868
|
minLength,
|
|
2807
2869
|
type,
|
|
@@ -2814,6 +2876,8 @@ var TextInputRenderer = {
|
|
|
2814
2876
|
"description",
|
|
2815
2877
|
"help",
|
|
2816
2878
|
"error",
|
|
2879
|
+
"icon",
|
|
2880
|
+
"image",
|
|
2817
2881
|
"maxLength",
|
|
2818
2882
|
"minLength",
|
|
2819
2883
|
"type",
|
|
@@ -2830,7 +2894,7 @@ var TextInputRenderer = {
|
|
|
2830
2894
|
description,
|
|
2831
2895
|
validation: validationState,
|
|
2832
2896
|
help,
|
|
2833
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps })
|
|
2897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps }) })
|
|
2834
2898
|
}
|
|
2835
2899
|
);
|
|
2836
2900
|
}
|
|
@@ -2838,7 +2902,7 @@ var TextInputRenderer = {
|
|
|
2838
2902
|
var TextInputRenderer_default = TextInputRenderer;
|
|
2839
2903
|
|
|
2840
2904
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2841
|
-
var
|
|
2905
|
+
var import_components36 = require("@transferwise/components");
|
|
2842
2906
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2843
2907
|
var UploadInputRenderer = {
|
|
2844
2908
|
canRenderType: "input-upload",
|
|
@@ -2863,7 +2927,7 @@ var UploadInputRenderer = {
|
|
|
2863
2927
|
description: void 0,
|
|
2864
2928
|
validation: validationState,
|
|
2865
2929
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2866
|
-
|
|
2930
|
+
import_components36.UploadInput,
|
|
2867
2931
|
{
|
|
2868
2932
|
id,
|
|
2869
2933
|
description,
|
|
@@ -2928,7 +2992,7 @@ var LargeUploadRenderer = {
|
|
|
2928
2992
|
validation: validationState,
|
|
2929
2993
|
help,
|
|
2930
2994
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2931
|
-
|
|
2995
|
+
import_components36.Upload,
|
|
2932
2996
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2933
2997
|
usAccept: getAcceptsString(accepts),
|
|
2934
2998
|
usDisabled: disabled,
|
|
@@ -2943,16 +3007,16 @@ var LargeUploadRenderer = {
|
|
|
2943
3007
|
};
|
|
2944
3008
|
|
|
2945
3009
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2946
|
-
var
|
|
3010
|
+
var import_components37 = require("@transferwise/components");
|
|
2947
3011
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2948
3012
|
var ReviewRenderer = {
|
|
2949
3013
|
canRenderType: "review",
|
|
2950
3014
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
2951
3015
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2952
3016
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
|
|
2953
|
-
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3017
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components37.Header, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
|
|
2954
3018
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2955
|
-
|
|
3019
|
+
import_components37.DefinitionList,
|
|
2956
3020
|
{
|
|
2957
3021
|
layout: orientation,
|
|
2958
3022
|
definitions: fields.map(({ label, value, help }, index) => ({
|
|
@@ -3050,7 +3114,7 @@ var external_confirmation_messages_default = (0, import_react_intl14.defineMessa
|
|
|
3050
3114
|
});
|
|
3051
3115
|
|
|
3052
3116
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
3053
|
-
var
|
|
3117
|
+
var import_components38 = require("@transferwise/components");
|
|
3054
3118
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3055
3119
|
function ExternalConfirmationDialog({
|
|
3056
3120
|
external,
|
|
@@ -3059,10 +3123,10 @@ function ExternalConfirmationDialog({
|
|
|
3059
3123
|
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
3060
3124
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
3061
3125
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
3062
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components38.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
3063
3127
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
3064
3128
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3065
|
-
|
|
3129
|
+
import_components38.Button,
|
|
3066
3130
|
{
|
|
3067
3131
|
block: true,
|
|
3068
3132
|
className: "m-b-2",
|
|
@@ -3075,7 +3139,7 @@ function ExternalConfirmationDialog({
|
|
|
3075
3139
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
3076
3140
|
}
|
|
3077
3141
|
),
|
|
3078
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3142
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components38.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
3079
3143
|
] }) })
|
|
3080
3144
|
] }) });
|
|
3081
3145
|
}
|
|
@@ -3104,7 +3168,7 @@ function useExternal(url) {
|
|
|
3104
3168
|
}
|
|
3105
3169
|
|
|
3106
3170
|
// ../renderers/src/step/BackButton.tsx
|
|
3107
|
-
var
|
|
3171
|
+
var import_components39 = require("@transferwise/components");
|
|
3108
3172
|
var import_icons3 = require("@transferwise/icons");
|
|
3109
3173
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3110
3174
|
function BackButton({ title, onClick }) {
|
|
@@ -3118,7 +3182,7 @@ function BackButton({ title, onClick }) {
|
|
|
3118
3182
|
onClick,
|
|
3119
3183
|
children: [
|
|
3120
3184
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: title }),
|
|
3121
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3185
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components39.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
3122
3186
|
]
|
|
3123
3187
|
}
|
|
3124
3188
|
) });
|
|
@@ -3126,7 +3190,7 @@ function BackButton({ title, onClick }) {
|
|
|
3126
3190
|
var BackButton_default = BackButton;
|
|
3127
3191
|
|
|
3128
3192
|
// ../renderers/src/step/StepRenderer.tsx
|
|
3129
|
-
var
|
|
3193
|
+
var import_components40 = require("@transferwise/components");
|
|
3130
3194
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3131
3195
|
var StepRenderer = {
|
|
3132
3196
|
canRenderType: "step",
|
|
@@ -3142,10 +3206,10 @@ function StepRendererComponent(props) {
|
|
|
3142
3206
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(StepRendererContextProvider, { value, children: [
|
|
3143
3207
|
back ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
3144
3208
|
title || description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "m-b-4", children: [
|
|
3145
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3209
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components40.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
3146
3210
|
description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
3147
3211
|
] }) : void 0,
|
|
3148
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3212
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components40.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
3149
3213
|
children
|
|
3150
3214
|
] });
|
|
3151
3215
|
}
|