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