@wise/dynamic-flow-client-internal 3.21.2 → 3.22.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
@@ -979,10 +979,29 @@ function LabelContentWithHelp({ text, help }) {
979
979
 
980
980
  // ../renderers/src/components/FieldInput.tsx
981
981
  var import_jsx_runtime5 = require("react/jsx-runtime");
982
- function FieldInput({ id, children, label, error, description, help }) {
982
+ function FieldInput({ id, children, label, validation, description, help }) {
983
983
  const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LabelContentWithHelp, { text: label, help }) : label;
984
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components3.Field, { id, label: labelContent, hint: description, error, children });
984
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
985
+ import_components3.Field,
986
+ {
987
+ id,
988
+ label: labelContent,
989
+ description,
990
+ message: validation == null ? void 0 : validation.message,
991
+ sentiment: mapStatusToSentiment(validation),
992
+ children
993
+ }
994
+ );
985
995
  }
996
+ var mapStatusToSentiment = (validation) => {
997
+ if (validation) {
998
+ if (validation.status === "valid") {
999
+ return "positive";
1000
+ }
1001
+ return "negative";
1002
+ }
1003
+ return void 0;
1004
+ };
986
1005
  var FieldInput_default = FieldInput;
987
1006
 
988
1007
  // ../renderers/src/BooleanInputRenderer.tsx
@@ -991,9 +1010,27 @@ var import_jsx_runtime6 = require("react/jsx-runtime");
991
1010
  var BooleanInputRenderer = {
992
1011
  canRenderType: "input-boolean",
993
1012
  render: (props) => {
994
- const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
1013
+ const _a = props, {
1014
+ id,
1015
+ control,
1016
+ label = "",
1017
+ description,
1018
+ help,
1019
+ type,
1020
+ validationState,
1021
+ value
1022
+ } = _a, rest = __objRest(_a, [
1023
+ "id",
1024
+ "control",
1025
+ "label",
1026
+ "description",
1027
+ "help",
1028
+ "type",
1029
+ "validationState",
1030
+ "value"
1031
+ ]);
995
1032
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
996
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_components4.Checkbox, __spreadValues({ id }, checkboxProps)) });
1033
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_components4.Checkbox, __spreadValues({ id }, checkboxProps)) });
997
1034
  }
998
1035
  };
999
1036
  var BooleanInputRenderer_default = BooleanInputRenderer;
@@ -1218,23 +1255,33 @@ var DateInputRenderer = {
1218
1255
  control,
1219
1256
  label,
1220
1257
  description,
1221
- error,
1222
1258
  type,
1223
1259
  help,
1260
+ validationState,
1224
1261
  value: initialValue
1225
1262
  } = _a, rest = __objRest(_a, [
1226
1263
  "id",
1227
1264
  "control",
1228
1265
  "label",
1229
1266
  "description",
1230
- "error",
1231
1267
  "type",
1232
1268
  "help",
1269
+ "validationState",
1233
1270
  "value"
1234
1271
  ]);
1235
1272
  const value = initialValue != null ? initialValue : "";
1236
1273
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
1237
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(VariableDateInput_default, { control, inputProps }) });
1274
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1275
+ FieldInput_default,
1276
+ {
1277
+ id,
1278
+ label,
1279
+ description,
1280
+ validation: validationState,
1281
+ help,
1282
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(VariableDateInput_default, { control, inputProps })
1283
+ }
1284
+ );
1238
1285
  }
1239
1286
  };
1240
1287
  var DateInputRenderer_default = DateInputRenderer;
@@ -1522,23 +1569,33 @@ var import_jsx_runtime25 = require("react/jsx-runtime");
1522
1569
  var IntegerInputRenderer = {
1523
1570
  canRenderType: "input-integer",
1524
1571
  render: (props) => {
1525
- const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
1526
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1527
- import_components13.Input,
1528
- __spreadValues({
1572
+ const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
1573
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1574
+ FieldInput_default,
1575
+ {
1529
1576
  id,
1530
- name: id,
1531
- type: "number",
1532
- step: "1",
1533
- pattern: "\\d+",
1534
- value: value != null ? value : "",
1535
- onChange: ({ target: { value: newValue } }) => {
1536
- const parsedValue = Number.parseInt(newValue, 10);
1537
- onChange(Number.isNaN(parsedValue) ? null : parsedValue);
1538
- },
1539
- onWheel
1540
- }, rest)
1541
- ) });
1577
+ label,
1578
+ description,
1579
+ validation: validationState,
1580
+ help,
1581
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1582
+ import_components13.Input,
1583
+ __spreadValues({
1584
+ id,
1585
+ name: id,
1586
+ type: "number",
1587
+ step: "1",
1588
+ pattern: "\\d+",
1589
+ value: value != null ? value : "",
1590
+ onChange: ({ target: { value: newValue } }) => {
1591
+ const parsedValue = Number.parseInt(newValue, 10);
1592
+ onChange(Number.isNaN(parsedValue) ? null : parsedValue);
1593
+ },
1594
+ onWheel
1595
+ }, rest)
1596
+ )
1597
+ }
1598
+ );
1542
1599
  }
1543
1600
  };
1544
1601
  var IntegerInputRenderer_default = IntegerInputRenderer;
@@ -1644,10 +1701,10 @@ function MultiSelectInputRendererComponent(props) {
1644
1701
  disabled,
1645
1702
  label,
1646
1703
  help,
1647
- error,
1648
1704
  options,
1649
1705
  placeholder,
1650
1706
  selectedIndices,
1707
+ validationState,
1651
1708
  onSelect
1652
1709
  } = props;
1653
1710
  const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
@@ -1678,39 +1735,49 @@ function MultiSelectInputRendererComponent(props) {
1678
1735
  };
1679
1736
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.SelectInputOptionContent, __spreadValues({}, contentProps));
1680
1737
  };
1681
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1682
- import_components18.SelectInput,
1738
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1739
+ FieldInput_default,
1683
1740
  {
1684
1741
  id,
1685
- items: options.map((option, index) => {
1686
- var _a, _b, _c;
1687
- return {
1688
- type: "option",
1689
- value: index,
1690
- filterMatchers: [
1691
- ...(_a = option.keywords) != null ? _a : [],
1692
- (_b = option.title) != null ? _b : "",
1693
- (_c = option.description) != null ? _c : ""
1694
- ],
1695
- disabled: option.disabled
1696
- };
1697
- }),
1698
- disabled,
1699
- placeholder,
1700
- value: mergedIndices,
1701
- renderValue,
1702
- multiple: true,
1703
- onChange: (values) => {
1704
- setStagedIndices(values);
1705
- },
1706
- onClose: () => {
1707
- if (stagedIndices) {
1708
- onSelect(stagedIndices);
1709
- setStagedIndices(void 0);
1742
+ label,
1743
+ help,
1744
+ description,
1745
+ validation: validationState,
1746
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1747
+ import_components18.SelectInput,
1748
+ {
1749
+ id,
1750
+ items: options.map((option, index) => {
1751
+ var _a, _b, _c;
1752
+ return {
1753
+ type: "option",
1754
+ value: index,
1755
+ filterMatchers: [
1756
+ ...(_a = option.keywords) != null ? _a : [],
1757
+ (_b = option.title) != null ? _b : "",
1758
+ (_c = option.description) != null ? _c : ""
1759
+ ],
1760
+ disabled: option.disabled
1761
+ };
1762
+ }),
1763
+ disabled,
1764
+ placeholder,
1765
+ value: mergedIndices,
1766
+ renderValue,
1767
+ multiple: true,
1768
+ onChange: (values) => {
1769
+ setStagedIndices(values);
1770
+ },
1771
+ onClose: () => {
1772
+ if (stagedIndices) {
1773
+ onSelect(stagedIndices);
1774
+ setStagedIndices(void 0);
1775
+ }
1776
+ }
1710
1777
  }
1711
- }
1778
+ )
1712
1779
  }
1713
- ) });
1780
+ );
1714
1781
  }
1715
1782
  var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
1716
1783
 
@@ -1726,8 +1793,8 @@ function UploadFieldInput({
1726
1793
  children,
1727
1794
  label,
1728
1795
  description,
1729
- error,
1730
- help
1796
+ help,
1797
+ validation
1731
1798
  }) {
1732
1799
  const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LabelContentWithHelp, { text: label, help }) : label;
1733
1800
  const descriptionId = description ? `${id}-description` : void 0;
@@ -1735,12 +1802,12 @@ function UploadFieldInput({
1735
1802
  "div",
1736
1803
  {
1737
1804
  className: (0, import_classnames3.default)("form-group d-block", {
1738
- "has-error": !!error
1805
+ "has-error": (validation == null ? void 0 : validation.status) === "invalid"
1739
1806
  }),
1740
1807
  children: [
1741
1808
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
1742
1809
  children,
1743
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components19.InlineAlert, { type: "negative", id: descriptionId, children: error })
1810
+ (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components19.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
1744
1811
  ]
1745
1812
  }
1746
1813
  );
@@ -1783,10 +1850,10 @@ var MultiUploadInputRenderer = {
1783
1850
  label,
1784
1851
  description,
1785
1852
  disabled,
1786
- error,
1787
1853
  maxSize,
1788
1854
  maxItems,
1789
1855
  uploadLabel,
1856
+ validationState,
1790
1857
  onUpload,
1791
1858
  onDelete
1792
1859
  } = props;
@@ -1799,22 +1866,32 @@ var MultiUploadInputRenderer = {
1799
1866
  };
1800
1867
  const onDeleteFile = async (fileId) => onDelete(String(fileId));
1801
1868
  const descriptionId = description ? `${id}-description` : void 0;
1802
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1803
- import_components20.UploadInput,
1869
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1870
+ UploadFieldInput_default,
1804
1871
  {
1805
1872
  id,
1806
- "aria-describedby": descriptionId,
1873
+ label,
1807
1874
  description,
1808
- disabled,
1809
- fileTypes: getAcceptsString(accepts),
1810
- maxFiles: maxItems,
1811
- multiple: true,
1812
- sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
1813
- uploadButtonTitle: uploadLabel,
1814
- onDeleteFile,
1815
- onUploadFile
1875
+ validation: validationState,
1876
+ help,
1877
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1878
+ import_components20.UploadInput,
1879
+ {
1880
+ id,
1881
+ "aria-describedby": descriptionId,
1882
+ description,
1883
+ disabled,
1884
+ fileTypes: getAcceptsString(accepts),
1885
+ maxFiles: maxItems,
1886
+ multiple: true,
1887
+ sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
1888
+ uploadButtonTitle: uploadLabel,
1889
+ onDeleteFile,
1890
+ onUploadFile
1891
+ }
1892
+ )
1816
1893
  }
1817
- ) });
1894
+ );
1818
1895
  }
1819
1896
  };
1820
1897
  var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
@@ -1825,21 +1902,31 @@ var import_jsx_runtime33 = require("react/jsx-runtime");
1825
1902
  var NumberInputRenderer = {
1826
1903
  canRenderType: "input-number",
1827
1904
  render: (props) => {
1828
- const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
1829
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1830
- import_components21.Input,
1831
- __spreadValues({
1905
+ const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
1906
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1907
+ FieldInput_default,
1908
+ {
1832
1909
  id,
1833
- name: id,
1834
- type: "number",
1835
- value: value != null ? value : "",
1836
- onChange: ({ target: { value: newValue } }) => {
1837
- const parsedValue = Number.parseFloat(newValue);
1838
- onChange(Number.isNaN(parsedValue) ? null : parsedValue);
1839
- },
1840
- onWheel
1841
- }, rest)
1842
- ) });
1910
+ label,
1911
+ description,
1912
+ validation: validationState,
1913
+ help,
1914
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1915
+ import_components21.Input,
1916
+ __spreadValues({
1917
+ id,
1918
+ name: id,
1919
+ type: "number",
1920
+ value: value != null ? value : "",
1921
+ onChange: ({ target: { value: newValue } }) => {
1922
+ const parsedValue = Number.parseFloat(newValue);
1923
+ onChange(Number.isNaN(parsedValue) ? null : parsedValue);
1924
+ },
1925
+ onWheel
1926
+ }, rest)
1927
+ )
1928
+ }
1929
+ );
1843
1930
  }
1844
1931
  };
1845
1932
  var NumberInputRenderer_default = NumberInputRenderer;
@@ -1959,9 +2046,9 @@ function Repeatable(props) {
1959
2046
  description,
1960
2047
  editableItem,
1961
2048
  editItemTitle,
1962
- error,
1963
2049
  items,
1964
2050
  title,
2051
+ validationState,
1965
2052
  onEdit,
1966
2053
  onAdd,
1967
2054
  onSave,
@@ -1997,7 +2084,7 @@ function Repeatable(props) {
1997
2084
  "div",
1998
2085
  {
1999
2086
  className: (0, import_classnames5.default)("form-group", {
2000
- "has-error": error
2087
+ "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
2001
2088
  }),
2002
2089
  children: [
2003
2090
  items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
@@ -2010,7 +2097,7 @@ function Repeatable(props) {
2010
2097
  onClick: () => onAddItem()
2011
2098
  }
2012
2099
  ),
2013
- error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.InlineAlert, { type: "negative", children: error })
2100
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.InlineAlert, { type: "negative", children: validationState.message })
2014
2101
  ]
2015
2102
  }
2016
2103
  ),
@@ -2049,7 +2136,7 @@ function ItemSummaryOption({
2049
2136
  var RepeatableRenderer_default = RepeatableRenderer;
2050
2137
 
2051
2138
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2052
- var import_components25 = require("@transferwise/components");
2139
+ var import_components26 = require("@transferwise/components");
2053
2140
 
2054
2141
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2055
2142
  var import_react_intl10 = require("react-intl");
@@ -2075,22 +2162,26 @@ var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
2075
2162
  });
2076
2163
 
2077
2164
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2165
+ var import_components25 = require("@transferwise/components");
2078
2166
  var import_jsx_runtime36 = require("react/jsx-runtime");
2079
2167
  function ErrorResult({ state }) {
2080
2168
  const intl = (0, import_react_intl10.useIntl)();
2169
+ const buttonVisualProps = {
2170
+ priority: "tertiary",
2171
+ size: "sm",
2172
+ style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
2173
+ };
2081
2174
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "m-t-2", children: [
2082
2175
  intl.formatMessage(generic_error_messages_default.genericError),
2083
2176
  "\xA0",
2084
2177
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2085
- "a",
2086
- {
2087
- href: "/",
2088
- onClick: (e) => {
2089
- e.preventDefault();
2178
+ import_components25.Button,
2179
+ __spreadProps(__spreadValues({}, buttonVisualProps), {
2180
+ onClick: () => {
2090
2181
  state.onRetry();
2091
2182
  },
2092
2183
  children: intl.formatMessage(generic_error_messages_default.retry)
2093
- }
2184
+ })
2094
2185
  )
2095
2186
  ] });
2096
2187
  }
@@ -2110,8 +2201,8 @@ function BlockSearchRendererComponent({
2110
2201
  const [hasSearched, setHasSearched] = (0, import_react10.useState)(false);
2111
2202
  const trackEvent = useTrackEvent();
2112
2203
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getMargin(margin), children: [
2113
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2114
- import_components25.Input,
2204
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2205
+ import_components26.Input,
2115
2206
  {
2116
2207
  id,
2117
2208
  name: id,
@@ -2147,16 +2238,16 @@ function SearchResultContent({
2147
2238
  }
2148
2239
  }
2149
2240
  function EmptySearchResult({ state }) {
2150
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components25.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2241
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components26.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2151
2242
  }
2152
2243
  function SearchResults({
2153
2244
  state
2154
2245
  }) {
2155
2246
  const trackEvent = useTrackEvent();
2156
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components25.NavigationOptionsList, { children: state.results.map((result) => {
2247
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components26.NavigationOptionsList, { children: state.results.map((result) => {
2157
2248
  const { icon, image } = result;
2158
2249
  return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2159
- import_components25.NavigationOption,
2250
+ import_components26.NavigationOption,
2160
2251
  {
2161
2252
  title: result.title,
2162
2253
  content: result.description,
@@ -2177,7 +2268,7 @@ function SearchResults({
2177
2268
  var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
2178
2269
 
2179
2270
  // ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
2180
- var import_components26 = require("@transferwise/components");
2271
+ var import_components27 = require("@transferwise/components");
2181
2272
  var import_icons2 = require("@transferwise/icons");
2182
2273
  var import_react11 = require("react");
2183
2274
  var import_react_intl11 = require("react-intl");
@@ -2193,8 +2284,8 @@ function InlineSearchRenderer({
2193
2284
  const [hasSearched, setHasSearched] = (0, import_react11.useState)(false);
2194
2285
  const trackEvent = useTrackEvent();
2195
2286
  const intl = (0, import_react_intl11.useIntl)();
2196
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2197
- import_components26.Typeahead,
2287
+ 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)(
2288
+ import_components27.Typeahead,
2198
2289
  {
2199
2290
  id: "typeahead-input-id",
2200
2291
  intl,
@@ -2240,7 +2331,7 @@ function mapResultToTypeaheadOption(result) {
2240
2331
  }
2241
2332
  function TypeaheadFooter({ state, isLoading }) {
2242
2333
  if (state.type === "noResults") {
2243
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components26.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2334
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components27.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2244
2335
  }
2245
2336
  if (state.type === "error") {
2246
2337
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state }) });
@@ -2261,7 +2352,7 @@ var SearchRenderer = {
2261
2352
  var SearchRenderer_default = SearchRenderer;
2262
2353
 
2263
2354
  // ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
2264
- var import_components27 = require("@transferwise/components");
2355
+ var import_components28 = require("@transferwise/components");
2265
2356
  var import_jsx_runtime40 = require("react/jsx-runtime");
2266
2357
  function RadioInputRendererComponent(props) {
2267
2358
  const {
@@ -2269,36 +2360,46 @@ function RadioInputRendererComponent(props) {
2269
2360
  children,
2270
2361
  description,
2271
2362
  disabled,
2272
- error,
2273
2363
  help,
2274
2364
  label,
2275
2365
  options,
2276
2366
  selectedIndex,
2367
+ validationState,
2277
2368
  onSelect
2278
2369
  } = props;
2279
2370
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
2280
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2281
- import_components27.RadioGroup,
2371
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2372
+ FieldInput_default,
2282
2373
  {
2283
- name: id,
2284
- radios: options.map((option, index) => ({
2285
- label: option.title,
2286
- value: index,
2287
- secondary: option.description,
2288
- disabled: option.disabled || disabled,
2289
- avatar: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2290
- })),
2291
- selectedValue: selectedIndex != null ? selectedIndex : void 0,
2292
- onChange: onSelect
2293
- },
2294
- `${id}-${selectedIndex}`
2295
- ) }) }),
2374
+ id,
2375
+ label,
2376
+ help,
2377
+ description,
2378
+ validation: validationState,
2379
+ children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
2380
+ import_components28.RadioGroup,
2381
+ {
2382
+ name: id,
2383
+ radios: options.map((option, index) => ({
2384
+ label: option.title,
2385
+ value: index,
2386
+ secondary: option.description,
2387
+ disabled: option.disabled || disabled,
2388
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2389
+ })),
2390
+ selectedValue: selectedIndex != null ? selectedIndex : void 0,
2391
+ onChange: onSelect
2392
+ },
2393
+ `${id}-${selectedIndex}`
2394
+ ) })
2395
+ }
2396
+ ),
2296
2397
  children
2297
2398
  ] });
2298
2399
  }
2299
2400
 
2300
2401
  // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
2301
- var import_components28 = require("@transferwise/components");
2402
+ var import_components29 = require("@transferwise/components");
2302
2403
  var import_react12 = require("react");
2303
2404
  var import_jsx_runtime41 = require("react/jsx-runtime");
2304
2405
  function TabInputRendererComponent(props) {
@@ -2307,11 +2408,11 @@ function TabInputRendererComponent(props) {
2307
2408
  children,
2308
2409
  description,
2309
2410
  disabled,
2310
- error,
2311
2411
  help,
2312
2412
  label,
2313
2413
  options,
2314
2414
  selectedIndex,
2415
+ validationState,
2315
2416
  onSelect
2316
2417
  } = props;
2317
2418
  (0, import_react12.useEffect)(() => {
@@ -2320,41 +2421,51 @@ function TabInputRendererComponent(props) {
2320
2421
  }
2321
2422
  }, [selectedIndex, onSelect, options.length]);
2322
2423
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
2323
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2324
- import_components28.Tabs,
2424
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2425
+ FieldInput_default,
2325
2426
  {
2326
- name: id,
2327
- selected: selectedIndex != null ? selectedIndex : 0,
2328
- tabs: options.map((option) => ({
2329
- title: option.title,
2330
- // if we pass null, we get some props-types console errors
2331
- // eslint-disable-next-line react/jsx-no-useless-fragment
2332
- content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, {}),
2333
- disabled: option.disabled || disabled
2334
- })),
2335
- onTabSelect: onSelect
2427
+ id,
2428
+ label,
2429
+ help,
2430
+ description,
2431
+ validation: validationState,
2432
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2433
+ import_components29.Tabs,
2434
+ {
2435
+ name: id,
2436
+ selected: selectedIndex != null ? selectedIndex : 0,
2437
+ tabs: options.map((option) => ({
2438
+ title: option.title,
2439
+ // if we pass null, we get some props-types console errors
2440
+ // eslint-disable-next-line react/jsx-no-useless-fragment
2441
+ content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, {}),
2442
+ disabled: option.disabled || disabled
2443
+ })),
2444
+ onTabSelect: onSelect
2445
+ }
2446
+ )
2336
2447
  }
2337
- ) }),
2448
+ ),
2338
2449
  children
2339
2450
  ] });
2340
2451
  }
2341
2452
  var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
2342
2453
 
2343
2454
  // ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
2344
- var import_components30 = require("@transferwise/components");
2455
+ var import_components31 = require("@transferwise/components");
2345
2456
 
2346
2457
  // ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
2347
- var import_components29 = require("@transferwise/components");
2458
+ var import_components30 = require("@transferwise/components");
2348
2459
  var import_jsx_runtime42 = require("react/jsx-runtime");
2349
2460
  function SelectTriggerMedia({ icon, image }) {
2350
2461
  if (image == null ? void 0 : image.url) {
2351
2462
  return null;
2352
2463
  }
2353
2464
  if (icon && "name" in icon) {
2354
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components29.Avatar, { type: import_components29.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DynamicIcon_default, { name: icon.name }) });
2465
+ 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 }) });
2355
2466
  }
2356
2467
  if (icon && "text" in icon) {
2357
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components29.Avatar, { type: import_components29.AvatarType.ICON, size: 24, children: icon.text });
2468
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components30.Avatar, { type: import_components30.AvatarType.ICON, size: 24, children: icon.text });
2358
2469
  }
2359
2470
  return null;
2360
2471
  }
@@ -2367,13 +2478,13 @@ function SelectInputRendererComponent(props) {
2367
2478
  children,
2368
2479
  description,
2369
2480
  disabled,
2370
- error,
2371
2481
  help,
2372
2482
  label,
2373
2483
  options,
2374
2484
  placeholder,
2375
2485
  required,
2376
2486
  selectedIndex,
2487
+ validationState,
2377
2488
  onSelect
2378
2489
  } = props;
2379
2490
  const items = options.map(
@@ -2401,54 +2512,84 @@ function SelectInputRendererComponent(props) {
2401
2512
  description: option.description,
2402
2513
  icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image })
2403
2514
  };
2404
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components30.SelectInputOptionContent, __spreadValues({}, contentProps));
2515
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components31.SelectInputOptionContent, __spreadValues({}, contentProps));
2405
2516
  };
2406
2517
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
2407
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2408
- import_components30.SelectInput,
2518
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2519
+ FieldInput_default,
2409
2520
  {
2410
- name: id,
2411
- placeholder,
2412
- items,
2413
- disabled,
2414
- value: selectedIndex,
2415
- renderValue,
2416
- filterable: items.length >= 8,
2417
- onChange: onSelect,
2418
- onClear: required ? void 0 : () => onSelect(null)
2521
+ id,
2522
+ label,
2523
+ help,
2524
+ description,
2525
+ validation: validationState,
2526
+ children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
2527
+ import_components31.SelectInput,
2528
+ {
2529
+ name: id,
2530
+ placeholder,
2531
+ items,
2532
+ disabled,
2533
+ value: selectedIndex,
2534
+ renderValue,
2535
+ filterable: items.length >= 8,
2536
+ onChange: onSelect,
2537
+ onClear: required ? void 0 : () => onSelect(null)
2538
+ }
2539
+ )
2419
2540
  }
2420
- ) }),
2541
+ ),
2421
2542
  children
2422
2543
  ] });
2423
2544
  }
2424
2545
 
2425
2546
  // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
2426
2547
  var import_react13 = require("react");
2427
- var import_components31 = require("@transferwise/components");
2548
+ var import_components32 = require("@transferwise/components");
2428
2549
  var import_jsx_runtime44 = require("react/jsx-runtime");
2429
2550
  function SegmentedInputRendererComponent(props) {
2430
- const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
2551
+ const {
2552
+ id,
2553
+ children,
2554
+ description,
2555
+ help,
2556
+ label,
2557
+ options,
2558
+ selectedIndex,
2559
+ validationState,
2560
+ onSelect
2561
+ } = props;
2431
2562
  (0, import_react13.useEffect)(() => {
2432
2563
  if (!isValidIndex2(selectedIndex, options.length)) {
2433
2564
  onSelect(0);
2434
2565
  }
2435
2566
  }, [selectedIndex, onSelect, options.length]);
2436
2567
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
2437
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2438
- import_components31.SegmentedControl,
2568
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2569
+ FieldInput_default,
2439
2570
  {
2440
- name: `${id}-segmented-control`,
2441
- value: String(selectedIndex),
2442
- mode: "view",
2443
- segments: options.map((option, index) => ({
2444
- id: String(index),
2445
- value: String(index),
2446
- label: option.title,
2447
- controls: `${id}-children`
2448
- })),
2449
- onChange: (value) => onSelect(Number(value))
2571
+ id,
2572
+ label,
2573
+ help,
2574
+ description,
2575
+ validation: validationState,
2576
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
2577
+ import_components32.SegmentedControl,
2578
+ {
2579
+ name: `${id}-segmented-control`,
2580
+ value: String(selectedIndex),
2581
+ mode: "view",
2582
+ segments: options.map((option, index) => ({
2583
+ id: String(index),
2584
+ value: String(index),
2585
+ label: option.title,
2586
+ controls: `${id}-children`
2587
+ })),
2588
+ onChange: (value) => onSelect(Number(value))
2589
+ }
2590
+ )
2450
2591
  }
2451
- ) }),
2592
+ ),
2452
2593
  /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { id: `${id}-children`, children })
2453
2594
  ] });
2454
2595
  }
@@ -2475,21 +2616,28 @@ var SelectInputRenderer = {
2475
2616
  var SelectInputRenderer_default = SelectInputRenderer;
2476
2617
 
2477
2618
  // ../renderers/src/StatusListRenderer.tsx
2478
- var import_components32 = require("@transferwise/components");
2619
+ var import_components33 = require("@transferwise/components");
2479
2620
  var import_jsx_runtime46 = require("react/jsx-runtime");
2480
2621
  var StatusListRenderer = {
2481
2622
  canRenderType: "status-list",
2482
2623
  render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: getMargin(margin), children: [
2483
- title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components32.Header, { title }) : null,
2484
- items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2485
- import_components32.Summary,
2624
+ title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components33.Header, { title }) : null,
2625
+ items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
2626
+ import_components33.Summary,
2486
2627
  {
2487
2628
  title: itemTitle,
2488
2629
  description,
2489
2630
  icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) : null,
2490
- status: mapStatus(status)
2631
+ status: mapStatus(status),
2632
+ action: callToAction ? {
2633
+ "aria-label": callToAction.accessibilityDescription,
2634
+ href: callToAction.href,
2635
+ text: callToAction.title,
2636
+ target: callToAction.href ? "_blank" : void 0,
2637
+ onClick: callToAction.href ? void 0 : callToAction.onClick
2638
+ } : void 0
2491
2639
  },
2492
- `${title}/${description || ""}`
2640
+ `${itemTitle}/${description || ""}`
2493
2641
  ))
2494
2642
  ] })
2495
2643
  };
@@ -2502,7 +2650,7 @@ var mapStatus = (status) => {
2502
2650
  };
2503
2651
 
2504
2652
  // ../renderers/src/components/VariableTextInput.tsx
2505
- var import_components33 = require("@transferwise/components");
2653
+ var import_components34 = require("@transferwise/components");
2506
2654
  var import_jsx_runtime47 = require("react/jsx-runtime");
2507
2655
  function VariableTextInput({
2508
2656
  control,
@@ -2528,37 +2676,37 @@ function TextInput(_a) {
2528
2676
  if (typeof displayFormat === "string") {
2529
2677
  const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
2530
2678
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2531
- import_components33.InputWithDisplayFormat,
2679
+ import_components34.InputWithDisplayFormat,
2532
2680
  __spreadValues({
2533
2681
  displayPattern: displayFormat,
2534
2682
  onChange: (newValue) => onChange(newValue)
2535
2683
  }, inputProps)
2536
2684
  );
2537
2685
  }
2538
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
2686
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
2539
2687
  }
2540
2688
  function TextAreaInput(_a) {
2541
2689
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2542
2690
  const textAreaProps = __spreadValues({ id, name: id }, rest);
2543
2691
  return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2544
- import_components33.TextareaWithDisplayFormat,
2692
+ import_components34.TextareaWithDisplayFormat,
2545
2693
  __spreadValues({
2546
2694
  displayPattern: displayFormat,
2547
2695
  onChange: (newValue) => onChange(newValue)
2548
2696
  }, textAreaProps)
2549
- ) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
2697
+ ) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
2550
2698
  }
2551
2699
  function NumericInput(_a) {
2552
2700
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2553
2701
  const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
2554
2702
  return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2555
- import_components33.InputWithDisplayFormat,
2703
+ import_components34.InputWithDisplayFormat,
2556
2704
  __spreadValues({
2557
2705
  displayPattern: displayFormat,
2558
2706
  onChange: (newValue) => onChange(numericValueOrNull(newValue))
2559
2707
  }, numericProps)
2560
2708
  ) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
2561
- import_components33.Input,
2709
+ import_components34.Input,
2562
2710
  __spreadValues({
2563
2711
  onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
2564
2712
  }, numericProps)
@@ -2566,7 +2714,7 @@ function NumericInput(_a) {
2566
2714
  }
2567
2715
  function PhoneNumberInput(_a) {
2568
2716
  var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
2569
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
2717
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
2570
2718
  }
2571
2719
  var VariableTextInput_default = VariableTextInput;
2572
2720
 
@@ -2585,6 +2733,7 @@ var TextInputRenderer = {
2585
2733
  maxLength,
2586
2734
  minLength,
2587
2735
  type,
2736
+ validationState,
2588
2737
  value: initialValue
2589
2738
  } = _a, rest = __objRest(_a, [
2590
2739
  "id",
@@ -2596,22 +2745,33 @@ var TextInputRenderer = {
2596
2745
  "maxLength",
2597
2746
  "minLength",
2598
2747
  "type",
2748
+ "validationState",
2599
2749
  "value"
2600
2750
  ]);
2601
2751
  const value = initialValue != null ? initialValue : "";
2602
2752
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
2603
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps }) });
2753
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
2754
+ FieldInput_default,
2755
+ {
2756
+ id,
2757
+ label,
2758
+ description,
2759
+ validation: validationState,
2760
+ help,
2761
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps })
2762
+ }
2763
+ );
2604
2764
  }
2605
2765
  };
2606
2766
  var TextInputRenderer_default = TextInputRenderer;
2607
2767
 
2608
2768
  // ../renderers/src/UploadInputRenderer.tsx
2609
- var import_components34 = require("@transferwise/components");
2769
+ var import_components35 = require("@transferwise/components");
2610
2770
  var import_jsx_runtime49 = require("react/jsx-runtime");
2611
2771
  var UploadInputRenderer = {
2612
2772
  canRenderType: "input-upload",
2613
2773
  render: (props) => {
2614
- const { id, accepts, error, label, description, disabled, maxSize, onUpload } = props;
2774
+ const { id, accepts, label, description, disabled, maxSize, validationState, onUpload } = props;
2615
2775
  const onUploadFile = async (formData) => {
2616
2776
  const file = formData.get("file");
2617
2777
  return onUpload(file).then(() => ({
@@ -2623,19 +2783,28 @@ var UploadInputRenderer = {
2623
2783
  };
2624
2784
  return (
2625
2785
  // We don't pass help here as there is no sensible place to display it
2626
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2627
- import_components34.UploadInput,
2786
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2787
+ UploadFieldInput_default,
2628
2788
  {
2629
2789
  id,
2630
- description,
2631
- disabled,
2632
- fileTypes: getAcceptsString(accepts),
2633
- sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
2634
- uploadButtonTitle: label,
2635
- onDeleteFile,
2636
- onUploadFile
2790
+ label: void 0,
2791
+ description: void 0,
2792
+ validation: validationState,
2793
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2794
+ import_components35.UploadInput,
2795
+ {
2796
+ id,
2797
+ description,
2798
+ disabled,
2799
+ fileTypes: getAcceptsString(accepts),
2800
+ sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
2801
+ uploadButtonTitle: label,
2802
+ onDeleteFile,
2803
+ onUploadFile
2804
+ }
2805
+ )
2637
2806
  }
2638
- ) })
2807
+ )
2639
2808
  );
2640
2809
  }
2641
2810
  };
@@ -2650,10 +2819,10 @@ var LargeUploadRenderer = {
2650
2819
  label,
2651
2820
  description,
2652
2821
  disabled,
2653
- error,
2654
2822
  help,
2655
2823
  maxSize,
2656
2824
  type,
2825
+ validationState,
2657
2826
  onUpload
2658
2827
  } = _a, rest = __objRest(_a, [
2659
2828
  "id",
@@ -2662,10 +2831,10 @@ var LargeUploadRenderer = {
2662
2831
  "label",
2663
2832
  "description",
2664
2833
  "disabled",
2665
- "error",
2666
2834
  "help",
2667
2835
  "maxSize",
2668
2836
  "type",
2837
+ "validationState",
2669
2838
  "onUpload"
2670
2839
  ]);
2671
2840
  const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
@@ -2678,21 +2847,31 @@ var LargeUploadRenderer = {
2678
2847
  throw e;
2679
2848
  }
2680
2849
  };
2681
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2682
- import_components34.Upload,
2683
- __spreadProps(__spreadValues({}, uploadProps), {
2684
- usAccept: getAcceptsString(accepts),
2685
- usDisabled: disabled,
2686
- onSuccess: onUploadFile,
2687
- onFailure: async () => onUpload(null),
2688
- onCancel: async () => onUpload(null)
2689
- })
2690
- ) });
2850
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2851
+ FieldInput_default,
2852
+ {
2853
+ id,
2854
+ label,
2855
+ description,
2856
+ validation: validationState,
2857
+ help,
2858
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
2859
+ import_components35.Upload,
2860
+ __spreadProps(__spreadValues({}, uploadProps), {
2861
+ usAccept: getAcceptsString(accepts),
2862
+ usDisabled: disabled,
2863
+ onSuccess: onUploadFile,
2864
+ onFailure: async () => onUpload(null),
2865
+ onCancel: async () => onUpload(null)
2866
+ })
2867
+ )
2868
+ }
2869
+ );
2691
2870
  }
2692
2871
  };
2693
2872
 
2694
2873
  // ../renderers/src/ReviewRenderer.tsx
2695
- var import_components35 = require("@transferwise/components");
2874
+ var import_components36 = require("@transferwise/components");
2696
2875
  var import_jsx_runtime50 = require("react/jsx-runtime");
2697
2876
  var ReviewRenderer = {
2698
2877
  canRenderType: "review",
@@ -2706,9 +2885,9 @@ var ReviewRenderer = {
2706
2885
  }
2707
2886
  } : void 0;
2708
2887
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
2709
- (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components35.Header, { title: title != null ? title : "", action }),
2888
+ (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components36.Header, { title: title != null ? title : "", action }),
2710
2889
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
2711
- import_components35.DefinitionList,
2890
+ import_components36.DefinitionList,
2712
2891
  {
2713
2892
  layout: orientation,
2714
2893
  definitions: fields.map(({ label, value, help }, index) => ({
@@ -2784,7 +2963,7 @@ var external_confirmation_messages_default = (0, import_react_intl12.defineMessa
2784
2963
  });
2785
2964
 
2786
2965
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
2787
- var import_components36 = require("@transferwise/components");
2966
+ var import_components37 = require("@transferwise/components");
2788
2967
  var import_jsx_runtime51 = require("react/jsx-runtime");
2789
2968
  function ExternalConfirmationDialog({
2790
2969
  external,
@@ -2793,10 +2972,10 @@ function ExternalConfirmationDialog({
2793
2972
  const { formatMessage } = (0, import_react_intl13.useIntl)();
2794
2973
  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: [
2795
2974
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
2796
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components36.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
2975
+ /* @__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) }) }),
2797
2976
  /* @__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: [
2798
2977
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
2799
- import_components36.Button,
2978
+ import_components37.Button,
2800
2979
  {
2801
2980
  block: true,
2802
2981
  className: "m-b-2",
@@ -2809,7 +2988,7 @@ function ExternalConfirmationDialog({
2809
2988
  children: formatMessage(external_confirmation_messages_default.open)
2810
2989
  }
2811
2990
  ),
2812
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components36.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
2991
+ /* @__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) })
2813
2992
  ] }) })
2814
2993
  ] }) });
2815
2994
  }
@@ -2838,23 +3017,21 @@ function useExternal(url) {
2838
3017
  }
2839
3018
 
2840
3019
  // ../renderers/src/step/BackButton.tsx
2841
- var import_components37 = require("@transferwise/components");
3020
+ var import_components38 = require("@transferwise/components");
2842
3021
  var import_icons3 = require("@transferwise/icons");
2843
3022
  var import_jsx_runtime52 = require("react/jsx-runtime");
2844
3023
  function BackButton({ title, onClick }) {
2845
3024
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "m-b-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
2846
- "a",
3025
+ "button",
2847
3026
  {
2848
- href: "/",
3027
+ type: "button",
2849
3028
  className: "df-back-btn",
3029
+ title,
2850
3030
  "aria-label": title,
2851
- onClick: (event) => {
2852
- event.preventDefault();
2853
- onClick();
2854
- },
3031
+ onClick,
2855
3032
  children: [
2856
3033
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: title }),
2857
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components37.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
3034
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components38.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
2858
3035
  ]
2859
3036
  }
2860
3037
  ) });
@@ -2862,7 +3039,7 @@ function BackButton({ title, onClick }) {
2862
3039
  var BackButton_default = BackButton;
2863
3040
 
2864
3041
  // ../renderers/src/step/StepRenderer.tsx
2865
- var import_components38 = require("@transferwise/components");
3042
+ var import_components39 = require("@transferwise/components");
2866
3043
  var import_jsx_runtime53 = require("react/jsx-runtime");
2867
3044
  var StepRenderer = {
2868
3045
  canRenderType: "step",
@@ -2878,10 +3055,10 @@ function StepRendererComponent(props) {
2878
3055
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(StepRendererContextProvider, { value, children: [
2879
3056
  back ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BackButton_default, __spreadValues({}, back)) : null,
2880
3057
  title || description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "m-b-4", children: [
2881
- title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components38.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
3058
+ 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,
2882
3059
  description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
2883
3060
  ] }) : void 0,
2884
- error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components38.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
3061
+ error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components39.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
2885
3062
  children
2886
3063
  ] });
2887
3064
  }