@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.mjs
CHANGED
|
@@ -886,8 +886,8 @@ var useRendererHttpClient = () => {
|
|
|
886
886
|
import { Alert } from "@transferwise/components";
|
|
887
887
|
|
|
888
888
|
// ../renderers/src/utils/layout-utils.ts
|
|
889
|
-
var getMargin = (
|
|
890
|
-
switch (
|
|
889
|
+
var getMargin = (size2) => {
|
|
890
|
+
switch (size2) {
|
|
891
891
|
case "xs":
|
|
892
892
|
return "m-b-0";
|
|
893
893
|
case "sm":
|
|
@@ -1108,7 +1108,7 @@ function ButtonRendererComponent({
|
|
|
1108
1108
|
disabled,
|
|
1109
1109
|
margin,
|
|
1110
1110
|
title,
|
|
1111
|
-
size,
|
|
1111
|
+
size: size2,
|
|
1112
1112
|
onClick
|
|
1113
1113
|
}) {
|
|
1114
1114
|
const className = getMargin(margin);
|
|
@@ -1122,7 +1122,7 @@ function ButtonRendererComponent({
|
|
|
1122
1122
|
className,
|
|
1123
1123
|
disabled: isLoading || disabled,
|
|
1124
1124
|
priority: mapControl(control),
|
|
1125
|
-
size: mapSize(
|
|
1125
|
+
size: mapSize(size2),
|
|
1126
1126
|
type,
|
|
1127
1127
|
onClick,
|
|
1128
1128
|
children: title
|
|
@@ -1147,11 +1147,11 @@ var mapControl = (control) => {
|
|
|
1147
1147
|
return "secondary";
|
|
1148
1148
|
}
|
|
1149
1149
|
};
|
|
1150
|
-
var mapSize = (
|
|
1151
|
-
if (!
|
|
1150
|
+
var mapSize = (size2) => {
|
|
1151
|
+
if (!size2) {
|
|
1152
1152
|
return void 0;
|
|
1153
1153
|
}
|
|
1154
|
-
switch (
|
|
1154
|
+
switch (size2) {
|
|
1155
1155
|
case "xs":
|
|
1156
1156
|
case "sm":
|
|
1157
1157
|
return "sm";
|
|
@@ -1448,15 +1448,15 @@ var HeadingRenderer = {
|
|
|
1448
1448
|
render: (props) => /* @__PURE__ */ jsx21(Heading, __spreadValues({}, props))
|
|
1449
1449
|
};
|
|
1450
1450
|
function Heading(props) {
|
|
1451
|
-
const { text, size, align, margin, control } = props;
|
|
1451
|
+
const { text, size: size2, align, margin, control } = props;
|
|
1452
1452
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1453
|
-
return control === "display" ? /* @__PURE__ */ jsx21(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx21(StandardHeading, { size, text, className });
|
|
1453
|
+
return control === "display" ? /* @__PURE__ */ jsx21(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ jsx21(StandardHeading, { size: size2, text, className });
|
|
1454
1454
|
}
|
|
1455
|
-
function DisplayHeading({ size, text, className }) {
|
|
1456
|
-
return /* @__PURE__ */ jsx21(Display, { type: getDisplayType(
|
|
1455
|
+
function DisplayHeading({ size: size2, text, className }) {
|
|
1456
|
+
return /* @__PURE__ */ jsx21(Display, { type: getDisplayType(size2), className, children: text });
|
|
1457
1457
|
}
|
|
1458
|
-
function StandardHeading({ size, text, className }) {
|
|
1459
|
-
switch (
|
|
1458
|
+
function StandardHeading({ size: size2, text, className }) {
|
|
1459
|
+
switch (size2) {
|
|
1460
1460
|
case "xs":
|
|
1461
1461
|
return /* @__PURE__ */ jsx21("h5", { className, children: text });
|
|
1462
1462
|
case "sm":
|
|
@@ -1470,8 +1470,8 @@ function StandardHeading({ size, text, className }) {
|
|
|
1470
1470
|
return /* @__PURE__ */ jsx21("h3", { className, children: text });
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
var getDisplayType = (
|
|
1474
|
-
switch (
|
|
1473
|
+
var getDisplayType = (size2) => {
|
|
1474
|
+
switch (size2) {
|
|
1475
1475
|
case "xs":
|
|
1476
1476
|
case "sm":
|
|
1477
1477
|
return "display-small";
|
|
@@ -1506,7 +1506,7 @@ var ImageRenderer_default = ImageRenderer;
|
|
|
1506
1506
|
function ImageRendererComponent({
|
|
1507
1507
|
accessibilityDescription,
|
|
1508
1508
|
margin,
|
|
1509
|
-
size,
|
|
1509
|
+
size: size2,
|
|
1510
1510
|
url
|
|
1511
1511
|
}) {
|
|
1512
1512
|
const [imageSource, setImageSource] = useState2("");
|
|
@@ -1514,7 +1514,7 @@ function ImageRendererComponent({
|
|
|
1514
1514
|
useEffect2(() => {
|
|
1515
1515
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
1516
1516
|
}, [url, httpClient]);
|
|
1517
|
-
return /* @__PURE__ */ jsx22("div", { className: `df-image ${
|
|
1517
|
+
return /* @__PURE__ */ jsx22("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx22(
|
|
1518
1518
|
Image,
|
|
1519
1519
|
{
|
|
1520
1520
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1576,7 +1576,7 @@ var InstructionsRenderer = {
|
|
|
1576
1576
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1577
1577
|
|
|
1578
1578
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1579
|
-
import { Input } from "@transferwise/components";
|
|
1579
|
+
import { Input, InputGroup } from "@transferwise/components";
|
|
1580
1580
|
|
|
1581
1581
|
// ../renderers/src/utils/input-utils.ts
|
|
1582
1582
|
var onWheel = (event) => {
|
|
@@ -1585,13 +1585,71 @@ var onWheel = (event) => {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
|
-
// ../renderers/src/
|
|
1588
|
+
// ../renderers/src/utils/getIconAvatar.tsx
|
|
1589
|
+
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
1589
1590
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1591
|
+
var size = 24;
|
|
1592
|
+
function getIconAvatar({ icon, image }) {
|
|
1593
|
+
if (image == null ? void 0 : image.url) {
|
|
1594
|
+
return /* @__PURE__ */ jsx24(
|
|
1595
|
+
"img",
|
|
1596
|
+
{
|
|
1597
|
+
src: image.url,
|
|
1598
|
+
alt: image.accessibilityDescription,
|
|
1599
|
+
width: `${size}px`,
|
|
1600
|
+
height: `${size}px`
|
|
1601
|
+
}
|
|
1602
|
+
);
|
|
1603
|
+
}
|
|
1604
|
+
if (isFlagIcon2(icon)) {
|
|
1605
|
+
return /* @__PURE__ */ jsx24(Avatar2, { type: AvatarType2.ICON, size, children: /* @__PURE__ */ jsx24(DynamicIcon_default, { name: icon.name }) });
|
|
1606
|
+
}
|
|
1607
|
+
if (isNamedIcon2(icon)) {
|
|
1608
|
+
return /* @__PURE__ */ jsx24(DynamicIcon_default, { name: icon.name });
|
|
1609
|
+
}
|
|
1610
|
+
if (icon && "text" in icon) {
|
|
1611
|
+
return /* @__PURE__ */ jsx24(Avatar2, { type: AvatarType2.ICON, size, children: icon.text });
|
|
1612
|
+
}
|
|
1613
|
+
return null;
|
|
1614
|
+
}
|
|
1615
|
+
var isNamedIcon2 = (icon) => icon ? "name" in icon : false;
|
|
1616
|
+
var isFlagIcon2 = (icon) => isNamedIcon2(icon) && icon.name.startsWith("flag-");
|
|
1617
|
+
|
|
1618
|
+
// ../renderers/src/utils/getInputGroupAddonStart.tsx
|
|
1619
|
+
var getInputGroupAddonStart = ({ icon, image }) => {
|
|
1620
|
+
const content = getIconAvatar({ icon, image });
|
|
1621
|
+
return content ? { content } : void 0;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1625
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1590
1626
|
var IntegerInputRenderer = {
|
|
1591
1627
|
canRenderType: "input-integer",
|
|
1592
1628
|
render: (props) => {
|
|
1593
|
-
const _a = props, {
|
|
1594
|
-
|
|
1629
|
+
const _a = props, {
|
|
1630
|
+
id,
|
|
1631
|
+
label,
|
|
1632
|
+
description,
|
|
1633
|
+
help,
|
|
1634
|
+
icon,
|
|
1635
|
+
image,
|
|
1636
|
+
type,
|
|
1637
|
+
validationState,
|
|
1638
|
+
value,
|
|
1639
|
+
onChange
|
|
1640
|
+
} = _a, rest = __objRest(_a, [
|
|
1641
|
+
"id",
|
|
1642
|
+
"label",
|
|
1643
|
+
"description",
|
|
1644
|
+
"help",
|
|
1645
|
+
"icon",
|
|
1646
|
+
"image",
|
|
1647
|
+
"type",
|
|
1648
|
+
"validationState",
|
|
1649
|
+
"value",
|
|
1650
|
+
"onChange"
|
|
1651
|
+
]);
|
|
1652
|
+
return /* @__PURE__ */ jsx25(
|
|
1595
1653
|
FieldInput_default,
|
|
1596
1654
|
{
|
|
1597
1655
|
id,
|
|
@@ -1599,7 +1657,7 @@ var IntegerInputRenderer = {
|
|
|
1599
1657
|
description,
|
|
1600
1658
|
validation: validationState,
|
|
1601
1659
|
help,
|
|
1602
|
-
children: /* @__PURE__ */
|
|
1660
|
+
children: /* @__PURE__ */ jsx25(InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx25(
|
|
1603
1661
|
Input,
|
|
1604
1662
|
__spreadValues({
|
|
1605
1663
|
id,
|
|
@@ -1614,7 +1672,7 @@ var IntegerInputRenderer = {
|
|
|
1614
1672
|
},
|
|
1615
1673
|
onWheel
|
|
1616
1674
|
}, rest)
|
|
1617
|
-
)
|
|
1675
|
+
) })
|
|
1618
1676
|
}
|
|
1619
1677
|
);
|
|
1620
1678
|
}
|
|
@@ -1623,13 +1681,13 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1623
1681
|
|
|
1624
1682
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1625
1683
|
import { Loader } from "@transferwise/components";
|
|
1626
|
-
import { jsx as
|
|
1684
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1627
1685
|
var LoadingIndicatorRenderer = {
|
|
1628
1686
|
canRenderType: "loading-indicator",
|
|
1629
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
1687
|
+
render: ({ margin, size: size2 }) => /* @__PURE__ */ jsx26(
|
|
1630
1688
|
Loader,
|
|
1631
1689
|
{
|
|
1632
|
-
size,
|
|
1690
|
+
size: size2,
|
|
1633
1691
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
1634
1692
|
"data-testid": "loading-indicator"
|
|
1635
1693
|
}
|
|
@@ -1639,28 +1697,28 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1639
1697
|
|
|
1640
1698
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1641
1699
|
import { Markdown as Markdown2 } from "@transferwise/components";
|
|
1642
|
-
import { jsx as
|
|
1700
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1643
1701
|
var MarkdownRenderer = {
|
|
1644
1702
|
canRenderType: "markdown",
|
|
1645
|
-
render: ({ content, align, margin }) => /* @__PURE__ */
|
|
1703
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx27("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx27(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1646
1704
|
};
|
|
1647
1705
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1648
1706
|
|
|
1649
1707
|
// ../renderers/src/ModalRenderer.tsx
|
|
1650
1708
|
import { Button as Button2, Modal } from "@transferwise/components";
|
|
1651
1709
|
import { useState as useState3 } from "react";
|
|
1652
|
-
import { jsx as
|
|
1710
|
+
import { jsx as jsx28, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1653
1711
|
var ModalRenderer = {
|
|
1654
1712
|
canRenderType: "modal",
|
|
1655
|
-
render: (props) => /* @__PURE__ */
|
|
1713
|
+
render: (props) => /* @__PURE__ */ jsx28(DFModal, __spreadValues({}, props))
|
|
1656
1714
|
};
|
|
1657
1715
|
var ModalRenderer_default = ModalRenderer;
|
|
1658
1716
|
function DFModal({ content, margin, trigger }) {
|
|
1659
1717
|
const [visible, setVisible] = useState3(false);
|
|
1660
1718
|
const { components, title } = content;
|
|
1661
1719
|
return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ jsx28(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1721
|
+
/* @__PURE__ */ jsx28(
|
|
1664
1722
|
Modal,
|
|
1665
1723
|
{
|
|
1666
1724
|
scroll: "content",
|
|
@@ -1678,17 +1736,17 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1678
1736
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
1679
1737
|
|
|
1680
1738
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1681
|
-
import { Avatar as
|
|
1682
|
-
import { jsx as
|
|
1739
|
+
import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
|
|
1740
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1683
1741
|
function OptionMedia({ icon, image }) {
|
|
1684
1742
|
if (image == null ? void 0 : image.url) {
|
|
1685
|
-
return /* @__PURE__ */
|
|
1743
|
+
return /* @__PURE__ */ jsx29("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1686
1744
|
}
|
|
1687
1745
|
if (icon && "name" in icon) {
|
|
1688
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsx29(Avatar3, { type: AvatarType3.ICON, children: /* @__PURE__ */ jsx29(DynamicIcon_default, { name: icon.name }) });
|
|
1689
1747
|
}
|
|
1690
1748
|
if (icon && "text" in icon) {
|
|
1691
|
-
return /* @__PURE__ */
|
|
1749
|
+
return /* @__PURE__ */ jsx29(Avatar3, { type: AvatarType3.INITIALS, children: icon.text });
|
|
1692
1750
|
}
|
|
1693
1751
|
return null;
|
|
1694
1752
|
}
|
|
@@ -1708,10 +1766,10 @@ var multi_select_messages_default = defineMessages2({
|
|
|
1708
1766
|
|
|
1709
1767
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1710
1768
|
import { useState as useState4 } from "react";
|
|
1711
|
-
import { jsx as
|
|
1769
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1712
1770
|
var MultiSelectInputRenderer = {
|
|
1713
1771
|
canRenderType: "input-multi-select",
|
|
1714
|
-
render: (props) => /* @__PURE__ */
|
|
1772
|
+
render: (props) => /* @__PURE__ */ jsx30(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1715
1773
|
};
|
|
1716
1774
|
function MultiSelectInputRendererComponent(props) {
|
|
1717
1775
|
const { formatMessage } = useIntl2();
|
|
@@ -1753,12 +1811,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1753
1811
|
const contentProps = {
|
|
1754
1812
|
title: option.title,
|
|
1755
1813
|
description: option.description,
|
|
1756
|
-
icon: /* @__PURE__ */
|
|
1814
|
+
icon: /* @__PURE__ */ jsx30(OptionMedia, { icon: option.icon, image: option.image })
|
|
1757
1815
|
};
|
|
1758
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ jsx30(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1759
1817
|
};
|
|
1760
1818
|
const extraProps = { autoComplete };
|
|
1761
|
-
return /* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ jsx30(
|
|
1762
1820
|
FieldInput_default,
|
|
1763
1821
|
{
|
|
1764
1822
|
id,
|
|
@@ -1766,7 +1824,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1766
1824
|
help,
|
|
1767
1825
|
description,
|
|
1768
1826
|
validation: validationState,
|
|
1769
|
-
children: /* @__PURE__ */
|
|
1827
|
+
children: /* @__PURE__ */ jsx30(
|
|
1770
1828
|
SelectInput,
|
|
1771
1829
|
__spreadValues({
|
|
1772
1830
|
id,
|
|
@@ -1810,7 +1868,7 @@ import { UploadInput } from "@transferwise/components";
|
|
|
1810
1868
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1811
1869
|
var import_classnames3 = __toESM(require_classnames());
|
|
1812
1870
|
import { InlineAlert } from "@transferwise/components";
|
|
1813
|
-
import { jsx as
|
|
1871
|
+
import { jsx as jsx31, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1814
1872
|
function UploadFieldInput({
|
|
1815
1873
|
id,
|
|
1816
1874
|
children,
|
|
@@ -1819,7 +1877,7 @@ function UploadFieldInput({
|
|
|
1819
1877
|
help,
|
|
1820
1878
|
validation
|
|
1821
1879
|
}) {
|
|
1822
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1880
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx31(LabelContentWithHelp, { text: label, help }) : label;
|
|
1823
1881
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1824
1882
|
return /* @__PURE__ */ jsxs8(
|
|
1825
1883
|
"div",
|
|
@@ -1828,9 +1886,9 @@ function UploadFieldInput({
|
|
|
1828
1886
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1829
1887
|
}),
|
|
1830
1888
|
children: [
|
|
1831
|
-
/* @__PURE__ */
|
|
1889
|
+
/* @__PURE__ */ jsx31("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1832
1890
|
children,
|
|
1833
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
1891
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx31(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1834
1892
|
]
|
|
1835
1893
|
}
|
|
1836
1894
|
);
|
|
@@ -1862,7 +1920,7 @@ var getFileType = (base64Url) => {
|
|
|
1862
1920
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1863
1921
|
|
|
1864
1922
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1865
|
-
import { jsx as
|
|
1923
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1866
1924
|
var MultiUploadInputRenderer = {
|
|
1867
1925
|
canRenderType: "input-upload-multi",
|
|
1868
1926
|
render: (props) => {
|
|
@@ -1889,7 +1947,7 @@ var MultiUploadInputRenderer = {
|
|
|
1889
1947
|
};
|
|
1890
1948
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1891
1949
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1892
|
-
return /* @__PURE__ */
|
|
1950
|
+
return /* @__PURE__ */ jsx32(
|
|
1893
1951
|
UploadFieldInput_default,
|
|
1894
1952
|
{
|
|
1895
1953
|
id,
|
|
@@ -1897,7 +1955,7 @@ var MultiUploadInputRenderer = {
|
|
|
1897
1955
|
description,
|
|
1898
1956
|
validation: validationState,
|
|
1899
1957
|
help,
|
|
1900
|
-
children: /* @__PURE__ */
|
|
1958
|
+
children: /* @__PURE__ */ jsx32(
|
|
1901
1959
|
UploadInput,
|
|
1902
1960
|
{
|
|
1903
1961
|
id,
|
|
@@ -1920,13 +1978,35 @@ var MultiUploadInputRenderer = {
|
|
|
1920
1978
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
1921
1979
|
|
|
1922
1980
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1923
|
-
import { Input as Input2 } from "@transferwise/components";
|
|
1924
|
-
import { jsx as
|
|
1981
|
+
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1982
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1925
1983
|
var NumberInputRenderer = {
|
|
1926
1984
|
canRenderType: "input-number",
|
|
1927
1985
|
render: (props) => {
|
|
1928
|
-
const _a = props, {
|
|
1929
|
-
|
|
1986
|
+
const _a = props, {
|
|
1987
|
+
id,
|
|
1988
|
+
label,
|
|
1989
|
+
description,
|
|
1990
|
+
help,
|
|
1991
|
+
icon,
|
|
1992
|
+
image,
|
|
1993
|
+
type,
|
|
1994
|
+
validationState,
|
|
1995
|
+
value,
|
|
1996
|
+
onChange
|
|
1997
|
+
} = _a, rest = __objRest(_a, [
|
|
1998
|
+
"id",
|
|
1999
|
+
"label",
|
|
2000
|
+
"description",
|
|
2001
|
+
"help",
|
|
2002
|
+
"icon",
|
|
2003
|
+
"image",
|
|
2004
|
+
"type",
|
|
2005
|
+
"validationState",
|
|
2006
|
+
"value",
|
|
2007
|
+
"onChange"
|
|
2008
|
+
]);
|
|
2009
|
+
return /* @__PURE__ */ jsx33(
|
|
1930
2010
|
FieldInput_default,
|
|
1931
2011
|
{
|
|
1932
2012
|
id,
|
|
@@ -1934,7 +2014,7 @@ var NumberInputRenderer = {
|
|
|
1934
2014
|
description,
|
|
1935
2015
|
validation: validationState,
|
|
1936
2016
|
help,
|
|
1937
|
-
children: /* @__PURE__ */
|
|
2017
|
+
children: /* @__PURE__ */ jsx33(InputGroup2, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx33(
|
|
1938
2018
|
Input2,
|
|
1939
2019
|
__spreadValues({
|
|
1940
2020
|
id,
|
|
@@ -1947,7 +2027,7 @@ var NumberInputRenderer = {
|
|
|
1947
2027
|
},
|
|
1948
2028
|
onWheel
|
|
1949
2029
|
}, rest)
|
|
1950
|
-
)
|
|
2030
|
+
) })
|
|
1951
2031
|
}
|
|
1952
2032
|
);
|
|
1953
2033
|
}
|
|
@@ -1986,17 +2066,17 @@ var paragraph_messages_default = defineMessages3({
|
|
|
1986
2066
|
});
|
|
1987
2067
|
|
|
1988
2068
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1989
|
-
import { jsx as
|
|
2069
|
+
import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1990
2070
|
var ParagraphRenderer = {
|
|
1991
2071
|
canRenderType: "paragraph",
|
|
1992
|
-
render: (props) => /* @__PURE__ */
|
|
2072
|
+
render: (props) => /* @__PURE__ */ jsx34(Paragraph, __spreadValues({}, props))
|
|
1993
2073
|
};
|
|
1994
2074
|
function Paragraph({ align, control, margin, text }) {
|
|
1995
2075
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1996
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2076
|
+
return control === "copyable" ? /* @__PURE__ */ jsx34(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx34(StandardParagraph, { className, text });
|
|
1997
2077
|
}
|
|
1998
2078
|
function StandardParagraph({ text, className }) {
|
|
1999
|
-
return /* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ jsx34("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2000
2080
|
}
|
|
2001
2081
|
function CopyableParagraph({
|
|
2002
2082
|
text,
|
|
@@ -2011,7 +2091,7 @@ function CopyableParagraph({
|
|
|
2011
2091
|
};
|
|
2012
2092
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2013
2093
|
return /* @__PURE__ */ jsxs9("div", { className, children: [
|
|
2014
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ jsx34(
|
|
2015
2095
|
Input3,
|
|
2016
2096
|
{
|
|
2017
2097
|
type: "text",
|
|
@@ -2020,7 +2100,7 @@ function CopyableParagraph({
|
|
|
2020
2100
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
2021
2101
|
}
|
|
2022
2102
|
),
|
|
2023
|
-
/* @__PURE__ */
|
|
2103
|
+
/* @__PURE__ */ jsx34(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2024
2104
|
] });
|
|
2025
2105
|
}
|
|
2026
2106
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
@@ -2058,10 +2138,10 @@ var repeatable_messages_default = defineMessages4({
|
|
|
2058
2138
|
|
|
2059
2139
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2060
2140
|
var import_classnames5 = __toESM(require_classnames());
|
|
2061
|
-
import { Fragment as Fragment2, jsx as
|
|
2141
|
+
import { Fragment as Fragment2, jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2062
2142
|
var RepeatableRenderer = {
|
|
2063
2143
|
canRenderType: "repeatable",
|
|
2064
|
-
render: (props) => /* @__PURE__ */
|
|
2144
|
+
render: (props) => /* @__PURE__ */ jsx35(Repeatable, __spreadValues({}, props))
|
|
2065
2145
|
};
|
|
2066
2146
|
function Repeatable(props) {
|
|
2067
2147
|
const {
|
|
@@ -2101,8 +2181,8 @@ function Repeatable(props) {
|
|
|
2101
2181
|
setOpenModalType(null);
|
|
2102
2182
|
};
|
|
2103
2183
|
return /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2104
|
-
title && /* @__PURE__ */
|
|
2105
|
-
description && /* @__PURE__ */
|
|
2184
|
+
title && /* @__PURE__ */ jsx35(Header4, { title }),
|
|
2185
|
+
description && /* @__PURE__ */ jsx35("p", { children: description }),
|
|
2106
2186
|
/* @__PURE__ */ jsxs10(
|
|
2107
2187
|
"div",
|
|
2108
2188
|
{
|
|
@@ -2110,30 +2190,30 @@ function Repeatable(props) {
|
|
|
2110
2190
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2111
2191
|
}),
|
|
2112
2192
|
children: [
|
|
2113
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2193
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx35(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2194
|
+
/* @__PURE__ */ jsx35(
|
|
2115
2195
|
NavigationOption2,
|
|
2116
2196
|
{
|
|
2117
|
-
media: /* @__PURE__ */
|
|
2197
|
+
media: /* @__PURE__ */ jsx35(Plus, {}),
|
|
2118
2198
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2119
2199
|
showMediaAtAllSizes: true,
|
|
2120
2200
|
onClick: () => onAddItem()
|
|
2121
2201
|
}
|
|
2122
2202
|
),
|
|
2123
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2203
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx35(InlineAlert2, { type: "negative", children: validationState.message })
|
|
2124
2204
|
]
|
|
2125
2205
|
}
|
|
2126
2206
|
),
|
|
2127
|
-
/* @__PURE__ */
|
|
2207
|
+
/* @__PURE__ */ jsx35(
|
|
2128
2208
|
Modal2,
|
|
2129
2209
|
{
|
|
2130
2210
|
open: openModalType !== null,
|
|
2131
2211
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2132
2212
|
body: /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ jsx35("div", { className: "m-b-2", children: editableItem }),
|
|
2134
2214
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
2135
|
-
/* @__PURE__ */
|
|
2136
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsx35(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2216
|
+
/* @__PURE__ */ jsx35(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2137
2217
|
] })
|
|
2138
2218
|
] }),
|
|
2139
2219
|
onClose: () => onCancelEdit()
|
|
@@ -2145,10 +2225,10 @@ function ItemSummaryOption({
|
|
|
2145
2225
|
item,
|
|
2146
2226
|
onClick
|
|
2147
2227
|
}) {
|
|
2148
|
-
return /* @__PURE__ */
|
|
2228
|
+
return /* @__PURE__ */ jsx35(
|
|
2149
2229
|
NavigationOption2,
|
|
2150
2230
|
{
|
|
2151
|
-
media: /* @__PURE__ */
|
|
2231
|
+
media: /* @__PURE__ */ jsx35(NavigationOptionMedia, __spreadValues({}, item)),
|
|
2152
2232
|
title: item.title,
|
|
2153
2233
|
content: item.description,
|
|
2154
2234
|
showMediaAtAllSizes: true,
|
|
@@ -2186,7 +2266,7 @@ var generic_error_messages_default = defineMessages5({
|
|
|
2186
2266
|
|
|
2187
2267
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2188
2268
|
import { Button as Button5 } from "@transferwise/components";
|
|
2189
|
-
import { jsx as
|
|
2269
|
+
import { jsx as jsx36, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2190
2270
|
function ErrorResult({ state }) {
|
|
2191
2271
|
const intl = useIntl5();
|
|
2192
2272
|
const buttonVisualProps = {
|
|
@@ -2197,7 +2277,7 @@ function ErrorResult({ state }) {
|
|
|
2197
2277
|
return /* @__PURE__ */ jsxs11("p", { className: "m-t-2", children: [
|
|
2198
2278
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2199
2279
|
"\xA0",
|
|
2200
|
-
/* @__PURE__ */
|
|
2280
|
+
/* @__PURE__ */ jsx36(
|
|
2201
2281
|
Button5,
|
|
2202
2282
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2203
2283
|
onClick: () => {
|
|
@@ -2224,7 +2304,7 @@ var search_messages_default = defineMessages6({
|
|
|
2224
2304
|
|
|
2225
2305
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2226
2306
|
import { useIntl as useIntl6 } from "react-intl";
|
|
2227
|
-
import { Fragment as Fragment3, jsx as
|
|
2307
|
+
import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2228
2308
|
function BlockSearchRendererComponent({
|
|
2229
2309
|
id,
|
|
2230
2310
|
isLoading,
|
|
@@ -2238,7 +2318,7 @@ function BlockSearchRendererComponent({
|
|
|
2238
2318
|
const trackEvent = useTrackEvent();
|
|
2239
2319
|
const { formatMessage } = useIntl6();
|
|
2240
2320
|
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
2241
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ jsx37(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx37(
|
|
2242
2322
|
Input4,
|
|
2243
2323
|
{
|
|
2244
2324
|
id,
|
|
@@ -2255,7 +2335,7 @@ function BlockSearchRendererComponent({
|
|
|
2255
2335
|
}
|
|
2256
2336
|
}
|
|
2257
2337
|
) }),
|
|
2258
|
-
isLoading ? /* @__PURE__ */
|
|
2338
|
+
isLoading ? /* @__PURE__ */ jsx37(Fragment3, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx37(SearchResultContent, { state, onChange })
|
|
2259
2339
|
] });
|
|
2260
2340
|
}
|
|
2261
2341
|
function SearchResultContent({
|
|
@@ -2264,26 +2344,26 @@ function SearchResultContent({
|
|
|
2264
2344
|
}) {
|
|
2265
2345
|
switch (state.type) {
|
|
2266
2346
|
case "error":
|
|
2267
|
-
return /* @__PURE__ */
|
|
2347
|
+
return /* @__PURE__ */ jsx37(ErrorResult, { state });
|
|
2268
2348
|
case "results":
|
|
2269
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsx37(SearchResults, { state, onChange });
|
|
2270
2350
|
case "noResults":
|
|
2271
|
-
return /* @__PURE__ */
|
|
2351
|
+
return /* @__PURE__ */ jsx37(EmptySearchResult, { state });
|
|
2272
2352
|
case "pending":
|
|
2273
2353
|
default:
|
|
2274
2354
|
return null;
|
|
2275
2355
|
}
|
|
2276
2356
|
}
|
|
2277
2357
|
function EmptySearchResult({ state }) {
|
|
2278
|
-
return /* @__PURE__ */
|
|
2358
|
+
return /* @__PURE__ */ jsx37(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2279
2359
|
}
|
|
2280
2360
|
function SearchResults({
|
|
2281
2361
|
state
|
|
2282
2362
|
}) {
|
|
2283
2363
|
const trackEvent = useTrackEvent();
|
|
2284
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsx37(NavigationOptionsList2, { children: state.results.map((result) => {
|
|
2285
2365
|
const { icon, image } = result;
|
|
2286
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ jsx37(
|
|
2287
2367
|
NavigationOption3,
|
|
2288
2368
|
{
|
|
2289
2369
|
title: result.title,
|
|
@@ -2309,7 +2389,7 @@ import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
|
2309
2389
|
import { Search } from "@transferwise/icons";
|
|
2310
2390
|
import { useState as useState7 } from "react";
|
|
2311
2391
|
import { useIntl as useIntl7 } from "react-intl";
|
|
2312
|
-
import { jsx as
|
|
2392
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
2313
2393
|
function InlineSearchRenderer({
|
|
2314
2394
|
id,
|
|
2315
2395
|
isLoading,
|
|
@@ -2321,7 +2401,7 @@ function InlineSearchRenderer({
|
|
|
2321
2401
|
const [hasSearched, setHasSearched] = useState7(false);
|
|
2322
2402
|
const trackEvent = useTrackEvent();
|
|
2323
2403
|
const intl = useIntl7();
|
|
2324
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ jsx38("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx38(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx38(
|
|
2325
2405
|
Typeahead,
|
|
2326
2406
|
{
|
|
2327
2407
|
id: "typeahead-input-id",
|
|
@@ -2329,10 +2409,10 @@ function InlineSearchRenderer({
|
|
|
2329
2409
|
name: "typeahead-input-name",
|
|
2330
2410
|
size: "md",
|
|
2331
2411
|
maxHeight: 100,
|
|
2332
|
-
footer: /* @__PURE__ */
|
|
2412
|
+
footer: /* @__PURE__ */ jsx38(TypeaheadFooter, { state, isLoading }),
|
|
2333
2413
|
multiple: false,
|
|
2334
2414
|
clearable: false,
|
|
2335
|
-
addon: /* @__PURE__ */
|
|
2415
|
+
addon: /* @__PURE__ */ jsx38(Search, { size: 24 }),
|
|
2336
2416
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2337
2417
|
minQueryLength: 1,
|
|
2338
2418
|
onChange: (values) => {
|
|
@@ -2369,29 +2449,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2369
2449
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2370
2450
|
const { formatMessage } = useIntl7();
|
|
2371
2451
|
if (state.type === "noResults") {
|
|
2372
|
-
return /* @__PURE__ */
|
|
2452
|
+
return /* @__PURE__ */ jsx38(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2373
2453
|
}
|
|
2374
2454
|
if (state.type === "error") {
|
|
2375
|
-
return /* @__PURE__ */
|
|
2455
|
+
return /* @__PURE__ */ jsx38("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx38(ErrorResult, { state }) });
|
|
2376
2456
|
}
|
|
2377
2457
|
if (state.type === "pending" || isLoading) {
|
|
2378
|
-
return /* @__PURE__ */
|
|
2458
|
+
return /* @__PURE__ */ jsx38("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2379
2459
|
}
|
|
2380
2460
|
return null;
|
|
2381
2461
|
}
|
|
2382
2462
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2383
2463
|
|
|
2384
2464
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2385
|
-
import { jsx as
|
|
2465
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2386
2466
|
var SearchRenderer = {
|
|
2387
2467
|
canRenderType: "search",
|
|
2388
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
2468
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx39(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx39(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2389
2469
|
};
|
|
2390
2470
|
var SearchRenderer_default = SearchRenderer;
|
|
2391
2471
|
|
|
2392
2472
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2393
2473
|
import { RadioGroup } from "@transferwise/components";
|
|
2394
|
-
import { Fragment as Fragment4, jsx as
|
|
2474
|
+
import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2395
2475
|
function RadioInputRendererComponent(props) {
|
|
2396
2476
|
const {
|
|
2397
2477
|
id,
|
|
@@ -2406,7 +2486,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2406
2486
|
onSelect
|
|
2407
2487
|
} = props;
|
|
2408
2488
|
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2409
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsx40(
|
|
2410
2490
|
FieldInput_default,
|
|
2411
2491
|
{
|
|
2412
2492
|
id,
|
|
@@ -2414,7 +2494,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2414
2494
|
help,
|
|
2415
2495
|
description,
|
|
2416
2496
|
validation: validationState,
|
|
2417
|
-
children: /* @__PURE__ */
|
|
2497
|
+
children: /* @__PURE__ */ jsx40("span", { children: /* @__PURE__ */ jsx40(
|
|
2418
2498
|
RadioGroup,
|
|
2419
2499
|
{
|
|
2420
2500
|
name: id,
|
|
@@ -2423,7 +2503,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2423
2503
|
value: index,
|
|
2424
2504
|
secondary: option.description,
|
|
2425
2505
|
disabled: option.disabled || disabled,
|
|
2426
|
-
avatar: /* @__PURE__ */
|
|
2506
|
+
avatar: /* @__PURE__ */ jsx40(OptionMedia, { icon: option.icon, image: option.image })
|
|
2427
2507
|
})),
|
|
2428
2508
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2429
2509
|
onChange: onSelect
|
|
@@ -2439,7 +2519,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2439
2519
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2440
2520
|
import { Tabs } from "@transferwise/components";
|
|
2441
2521
|
import { useEffect as useEffect3 } from "react";
|
|
2442
|
-
import { Fragment as Fragment5, jsx as
|
|
2522
|
+
import { Fragment as Fragment5, jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2443
2523
|
function TabInputRendererComponent(props) {
|
|
2444
2524
|
const {
|
|
2445
2525
|
id,
|
|
@@ -2459,7 +2539,7 @@ function TabInputRendererComponent(props) {
|
|
|
2459
2539
|
}
|
|
2460
2540
|
}, [selectedIndex, onSelect, options.length]);
|
|
2461
2541
|
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2462
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx41(
|
|
2463
2543
|
FieldInput_default,
|
|
2464
2544
|
{
|
|
2465
2545
|
id,
|
|
@@ -2467,7 +2547,7 @@ function TabInputRendererComponent(props) {
|
|
|
2467
2547
|
help,
|
|
2468
2548
|
description,
|
|
2469
2549
|
validation: validationState,
|
|
2470
|
-
children: /* @__PURE__ */
|
|
2550
|
+
children: /* @__PURE__ */ jsx41(
|
|
2471
2551
|
Tabs,
|
|
2472
2552
|
{
|
|
2473
2553
|
name: id,
|
|
@@ -2476,7 +2556,7 @@ function TabInputRendererComponent(props) {
|
|
|
2476
2556
|
title: option.title,
|
|
2477
2557
|
// if we pass null, we get some props-types console errors
|
|
2478
2558
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2479
|
-
content: /* @__PURE__ */
|
|
2559
|
+
content: /* @__PURE__ */ jsx41(Fragment5, {}),
|
|
2480
2560
|
disabled: option.disabled || disabled
|
|
2481
2561
|
})),
|
|
2482
2562
|
onTabSelect: onSelect
|
|
@@ -2491,29 +2571,6 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2491
2571
|
|
|
2492
2572
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2493
2573
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
2494
|
-
|
|
2495
|
-
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
2496
|
-
import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
|
|
2497
|
-
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2498
|
-
function SelectTriggerMedia({ icon, image }) {
|
|
2499
|
-
if (image == null ? void 0 : image.url) {
|
|
2500
|
-
return null;
|
|
2501
|
-
}
|
|
2502
|
-
if (isFlagIcon2(icon)) {
|
|
2503
|
-
return /* @__PURE__ */ jsx41(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx41(DynamicIcon_default, { name: icon.name }) });
|
|
2504
|
-
}
|
|
2505
|
-
if (isNamedIcon2(icon)) {
|
|
2506
|
-
return /* @__PURE__ */ jsx41(DynamicIcon_default, { name: icon.name });
|
|
2507
|
-
}
|
|
2508
|
-
if (icon && "text" in icon) {
|
|
2509
|
-
return /* @__PURE__ */ jsx41(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
|
|
2510
|
-
}
|
|
2511
|
-
return null;
|
|
2512
|
-
}
|
|
2513
|
-
var isNamedIcon2 = (icon) => icon ? "name" in icon : false;
|
|
2514
|
-
var isFlagIcon2 = (icon) => isNamedIcon2(icon) && icon.name.startsWith("flag-");
|
|
2515
|
-
|
|
2516
|
-
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2517
2574
|
import { Fragment as Fragment6, jsx as jsx42, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2518
2575
|
function SelectInputRendererComponent(props) {
|
|
2519
2576
|
const {
|
|
@@ -2550,7 +2607,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2550
2607
|
const contentProps = withinTrigger ? {
|
|
2551
2608
|
title: option.title,
|
|
2552
2609
|
note: option.description,
|
|
2553
|
-
icon:
|
|
2610
|
+
icon: getIconAvatar(option)
|
|
2554
2611
|
} : {
|
|
2555
2612
|
title: option.title,
|
|
2556
2613
|
description: option.description,
|
|
@@ -2707,6 +2764,9 @@ var mapStatus = (status) => {
|
|
|
2707
2764
|
return status;
|
|
2708
2765
|
};
|
|
2709
2766
|
|
|
2767
|
+
// ../renderers/src/TextInputRenderer.tsx
|
|
2768
|
+
import { InputGroup as InputGroup3 } from "@transferwise/components";
|
|
2769
|
+
|
|
2710
2770
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2711
2771
|
import {
|
|
2712
2772
|
Input as Input5,
|
|
@@ -2794,6 +2854,8 @@ var TextInputRenderer = {
|
|
|
2794
2854
|
description,
|
|
2795
2855
|
help,
|
|
2796
2856
|
error,
|
|
2857
|
+
icon,
|
|
2858
|
+
image,
|
|
2797
2859
|
maxLength,
|
|
2798
2860
|
minLength,
|
|
2799
2861
|
type,
|
|
@@ -2806,6 +2868,8 @@ var TextInputRenderer = {
|
|
|
2806
2868
|
"description",
|
|
2807
2869
|
"help",
|
|
2808
2870
|
"error",
|
|
2871
|
+
"icon",
|
|
2872
|
+
"image",
|
|
2809
2873
|
"maxLength",
|
|
2810
2874
|
"minLength",
|
|
2811
2875
|
"type",
|
|
@@ -2822,7 +2886,7 @@ var TextInputRenderer = {
|
|
|
2822
2886
|
description,
|
|
2823
2887
|
validation: validationState,
|
|
2824
2888
|
help,
|
|
2825
|
-
children: /* @__PURE__ */ jsx47(VariableTextInput_default, { control, inputProps })
|
|
2889
|
+
children: /* @__PURE__ */ jsx47(InputGroup3, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx47(VariableTextInput_default, { control, inputProps }) })
|
|
2826
2890
|
}
|
|
2827
2891
|
);
|
|
2828
2892
|
}
|