@wise/dynamic-flow-client-internal 4.17.1 → 4.18.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 +219 -222
- package/build/main.mjs +149 -152
- package/package.json +17 -17
package/build/main.mjs
CHANGED
|
@@ -1756,6 +1756,16 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1756
1756
|
] });
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
|
+
// ../renderers/src/ModalRenderer.tsx
|
|
1760
|
+
import { Modal as Modal3 } from "@transferwise/components";
|
|
1761
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1762
|
+
var ModalRenderer = {
|
|
1763
|
+
canRenderType: "modal",
|
|
1764
|
+
render: ({ title, children, open, onClose }) => {
|
|
1765
|
+
return /* @__PURE__ */ jsx35(Modal3, { open, title, body: children, onClose });
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1759
1769
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1760
1770
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
1761
1771
|
import { useState as useState4 } from "react";
|
|
@@ -1772,10 +1782,10 @@ var multi_select_messages_default = defineMessages3({
|
|
|
1772
1782
|
});
|
|
1773
1783
|
|
|
1774
1784
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1775
|
-
import { jsx as
|
|
1785
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1776
1786
|
var MultiSelectInputRenderer = {
|
|
1777
1787
|
canRenderType: "input-multi-select",
|
|
1778
|
-
render: (props) => /* @__PURE__ */
|
|
1788
|
+
render: (props) => /* @__PURE__ */ jsx36(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1779
1789
|
};
|
|
1780
1790
|
function MultiSelectInputRendererComponent(props) {
|
|
1781
1791
|
const { formatMessage } = useIntl3();
|
|
@@ -1817,12 +1827,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1817
1827
|
const contentProps = {
|
|
1818
1828
|
title: option.title,
|
|
1819
1829
|
description: option.description,
|
|
1820
|
-
icon: /* @__PURE__ */
|
|
1830
|
+
icon: /* @__PURE__ */ jsx36(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
1821
1831
|
};
|
|
1822
|
-
return /* @__PURE__ */
|
|
1832
|
+
return /* @__PURE__ */ jsx36(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1823
1833
|
};
|
|
1824
1834
|
const extraProps = { autoComplete };
|
|
1825
|
-
return /* @__PURE__ */
|
|
1835
|
+
return /* @__PURE__ */ jsx36(
|
|
1826
1836
|
FieldInput_default,
|
|
1827
1837
|
{
|
|
1828
1838
|
id,
|
|
@@ -1830,7 +1840,7 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1830
1840
|
help,
|
|
1831
1841
|
description,
|
|
1832
1842
|
validation: validationState,
|
|
1833
|
-
children: /* @__PURE__ */
|
|
1843
|
+
children: /* @__PURE__ */ jsx36(
|
|
1834
1844
|
SelectInput,
|
|
1835
1845
|
__spreadValues({
|
|
1836
1846
|
id,
|
|
@@ -1875,7 +1885,7 @@ import { UploadInput } from "@transferwise/components";
|
|
|
1875
1885
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1876
1886
|
import { InlineAlert } from "@transferwise/components";
|
|
1877
1887
|
import classNames4 from "classnames";
|
|
1878
|
-
import { jsx as
|
|
1888
|
+
import { jsx as jsx37, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1879
1889
|
function UploadFieldInput({
|
|
1880
1890
|
id,
|
|
1881
1891
|
children,
|
|
@@ -1884,7 +1894,7 @@ function UploadFieldInput({
|
|
|
1884
1894
|
help,
|
|
1885
1895
|
validation
|
|
1886
1896
|
}) {
|
|
1887
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1897
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx37(LabelContentWithHelp, { text: label, help }) : label;
|
|
1888
1898
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1889
1899
|
return /* @__PURE__ */ jsxs9(
|
|
1890
1900
|
"div",
|
|
@@ -1893,9 +1903,9 @@ function UploadFieldInput({
|
|
|
1893
1903
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1894
1904
|
}),
|
|
1895
1905
|
children: [
|
|
1896
|
-
/* @__PURE__ */
|
|
1906
|
+
/* @__PURE__ */ jsx37("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1897
1907
|
children,
|
|
1898
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
1908
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx37(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1899
1909
|
]
|
|
1900
1910
|
}
|
|
1901
1911
|
);
|
|
@@ -1903,7 +1913,7 @@ function UploadFieldInput({
|
|
|
1903
1913
|
var UploadFieldInput_default = UploadFieldInput;
|
|
1904
1914
|
|
|
1905
1915
|
// ../renderers/src/utils/file-utils.ts
|
|
1906
|
-
var
|
|
1916
|
+
var acceptsToFileTypes = (accepts) => Array.isArray(accepts) && accepts.length >= 1 ? accepts : "*";
|
|
1907
1917
|
var toKilobytes = (sizeInBytes) => {
|
|
1908
1918
|
const ONE_KB_IN_BYTES = 1024;
|
|
1909
1919
|
return Math.floor(sizeInBytes / ONE_KB_IN_BYTES);
|
|
@@ -1924,7 +1934,7 @@ var getFileType = (base64Url) => {
|
|
|
1924
1934
|
};
|
|
1925
1935
|
|
|
1926
1936
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1927
|
-
import { jsx as
|
|
1937
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1928
1938
|
var MultiUploadInputRenderer = {
|
|
1929
1939
|
canRenderType: "input-upload-multi",
|
|
1930
1940
|
render: (props) => {
|
|
@@ -1949,7 +1959,7 @@ var MultiUploadInputRenderer = {
|
|
|
1949
1959
|
};
|
|
1950
1960
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1951
1961
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1952
|
-
return /* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ jsx38(
|
|
1953
1963
|
UploadFieldInput_default,
|
|
1954
1964
|
{
|
|
1955
1965
|
id,
|
|
@@ -1957,14 +1967,14 @@ var MultiUploadInputRenderer = {
|
|
|
1957
1967
|
description,
|
|
1958
1968
|
validation: validationState,
|
|
1959
1969
|
help,
|
|
1960
|
-
children: /* @__PURE__ */
|
|
1970
|
+
children: /* @__PURE__ */ jsx38(
|
|
1961
1971
|
UploadInput,
|
|
1962
1972
|
{
|
|
1963
1973
|
id,
|
|
1964
1974
|
"aria-describedby": descriptionId,
|
|
1965
1975
|
description,
|
|
1966
1976
|
disabled,
|
|
1967
|
-
fileTypes:
|
|
1977
|
+
fileTypes: acceptsToFileTypes(accepts),
|
|
1968
1978
|
maxFiles: maxItems,
|
|
1969
1979
|
multiple: true,
|
|
1970
1980
|
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
@@ -1981,7 +1991,7 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1981
1991
|
|
|
1982
1992
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1983
1993
|
import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
|
|
1984
|
-
import { jsx as
|
|
1994
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1985
1995
|
var NumberInputRenderer = {
|
|
1986
1996
|
canRenderType: "input-number",
|
|
1987
1997
|
render: (props) => {
|
|
@@ -1995,7 +2005,7 @@ var NumberInputRenderer = {
|
|
|
1995
2005
|
"maximum",
|
|
1996
2006
|
"minimum"
|
|
1997
2007
|
);
|
|
1998
|
-
return /* @__PURE__ */
|
|
2008
|
+
return /* @__PURE__ */ jsx39(
|
|
1999
2009
|
FieldInput_default,
|
|
2000
2010
|
{
|
|
2001
2011
|
id,
|
|
@@ -2003,7 +2013,7 @@ var NumberInputRenderer = {
|
|
|
2003
2013
|
description,
|
|
2004
2014
|
validation: validationState,
|
|
2005
2015
|
help,
|
|
2006
|
-
children: /* @__PURE__ */
|
|
2016
|
+
children: /* @__PURE__ */ jsx39(InputGroup2, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx39(
|
|
2007
2017
|
Input2,
|
|
2008
2018
|
__spreadValues({
|
|
2009
2019
|
id,
|
|
@@ -2055,17 +2065,17 @@ var paragraph_messages_default = defineMessages4({
|
|
|
2055
2065
|
});
|
|
2056
2066
|
|
|
2057
2067
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2058
|
-
import { jsx as
|
|
2068
|
+
import { jsx as jsx40, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2059
2069
|
var ParagraphRenderer = {
|
|
2060
2070
|
canRenderType: "paragraph",
|
|
2061
|
-
render: (props) => /* @__PURE__ */
|
|
2071
|
+
render: (props) => /* @__PURE__ */ jsx40(Paragraph, __spreadValues({}, props))
|
|
2062
2072
|
};
|
|
2063
2073
|
function Paragraph({ align, control, margin, text }) {
|
|
2064
2074
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2065
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
2075
|
+
return control === "copyable" ? /* @__PURE__ */ jsx40(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx40(StandardParagraph, { className, text });
|
|
2066
2076
|
}
|
|
2067
2077
|
function StandardParagraph({ text, className }) {
|
|
2068
|
-
return /* @__PURE__ */
|
|
2078
|
+
return /* @__PURE__ */ jsx40("p", { className: `np-text-body-large ${className}`, children: text });
|
|
2069
2079
|
}
|
|
2070
2080
|
function CopyableParagraph({
|
|
2071
2081
|
text,
|
|
@@ -2080,7 +2090,7 @@ function CopyableParagraph({
|
|
|
2080
2090
|
};
|
|
2081
2091
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2082
2092
|
return /* @__PURE__ */ jsxs10("div", { className, children: [
|
|
2083
|
-
/* @__PURE__ */
|
|
2093
|
+
/* @__PURE__ */ jsx40(
|
|
2084
2094
|
Input3,
|
|
2085
2095
|
{
|
|
2086
2096
|
type: "text",
|
|
@@ -2089,13 +2099,13 @@ function CopyableParagraph({
|
|
|
2089
2099
|
className: classNames5("text-ellipsis", inputAlignmentClasses)
|
|
2090
2100
|
}
|
|
2091
2101
|
),
|
|
2092
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsx40(Button4, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2093
2103
|
] });
|
|
2094
2104
|
}
|
|
2095
2105
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2096
2106
|
|
|
2097
2107
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2098
|
-
import { Button as Button5, Header as Header5, InlineAlert as InlineAlert2, Modal as
|
|
2108
|
+
import { Button as Button5, Header as Header5, InlineAlert as InlineAlert2, Modal as Modal4, NavigationOption as NavigationOption2 } from "@transferwise/components";
|
|
2099
2109
|
import { Plus } from "@transferwise/icons";
|
|
2100
2110
|
import classNames6 from "classnames";
|
|
2101
2111
|
import { useState as useState5 } from "react";
|
|
@@ -2127,10 +2137,10 @@ var repeatable_messages_default = defineMessages5({
|
|
|
2127
2137
|
});
|
|
2128
2138
|
|
|
2129
2139
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2130
|
-
import { Fragment as Fragment2, jsx as
|
|
2140
|
+
import { Fragment as Fragment2, jsx as jsx41, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2131
2141
|
var RepeatableRenderer = {
|
|
2132
2142
|
canRenderType: "repeatable",
|
|
2133
|
-
render: (props) => /* @__PURE__ */
|
|
2143
|
+
render: (props) => /* @__PURE__ */ jsx41(Repeatable, __spreadValues({}, props))
|
|
2134
2144
|
};
|
|
2135
2145
|
function Repeatable(props) {
|
|
2136
2146
|
const {
|
|
@@ -2170,8 +2180,8 @@ function Repeatable(props) {
|
|
|
2170
2180
|
setOpenModalType(null);
|
|
2171
2181
|
};
|
|
2172
2182
|
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
2173
|
-
title && /* @__PURE__ */
|
|
2174
|
-
description && /* @__PURE__ */
|
|
2183
|
+
title && /* @__PURE__ */ jsx41(Header5, { title }),
|
|
2184
|
+
description && /* @__PURE__ */ jsx41("p", { children: description }),
|
|
2175
2185
|
/* @__PURE__ */ jsxs11(
|
|
2176
2186
|
"div",
|
|
2177
2187
|
{
|
|
@@ -2179,30 +2189,30 @@ function Repeatable(props) {
|
|
|
2179
2189
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2180
2190
|
}),
|
|
2181
2191
|
children: [
|
|
2182
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2192
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx41(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2193
|
+
/* @__PURE__ */ jsx41(
|
|
2184
2194
|
NavigationOption2,
|
|
2185
2195
|
{
|
|
2186
|
-
media: /* @__PURE__ */
|
|
2196
|
+
media: /* @__PURE__ */ jsx41(Plus, {}),
|
|
2187
2197
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2188
2198
|
showMediaAtAllSizes: true,
|
|
2189
2199
|
onClick: () => onAddItem()
|
|
2190
2200
|
}
|
|
2191
2201
|
),
|
|
2192
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
2202
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx41(InlineAlert2, { type: "negative", children: validationState.message })
|
|
2193
2203
|
]
|
|
2194
2204
|
}
|
|
2195
2205
|
),
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
|
|
2206
|
+
/* @__PURE__ */ jsx41(
|
|
2207
|
+
Modal4,
|
|
2198
2208
|
{
|
|
2199
2209
|
open: openModalType !== null,
|
|
2200
2210
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2201
2211
|
body: /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
2202
|
-
/* @__PURE__ */
|
|
2212
|
+
/* @__PURE__ */ jsx41("div", { className: "m-b-2", children: editableItem }),
|
|
2203
2213
|
/* @__PURE__ */ jsxs11("div", { children: [
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsx41(Button5, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2215
|
+
/* @__PURE__ */ jsx41(Button5, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2206
2216
|
] })
|
|
2207
2217
|
] }),
|
|
2208
2218
|
onClose: () => onCancelEdit()
|
|
@@ -2214,10 +2224,10 @@ function ItemSummaryOption({
|
|
|
2214
2224
|
item,
|
|
2215
2225
|
onClick
|
|
2216
2226
|
}) {
|
|
2217
|
-
return /* @__PURE__ */
|
|
2227
|
+
return /* @__PURE__ */ jsx41(
|
|
2218
2228
|
NavigationOption2,
|
|
2219
2229
|
{
|
|
2220
|
-
media: /* @__PURE__ */
|
|
2230
|
+
media: /* @__PURE__ */ jsx41(OptionMedia, __spreadProps(__spreadValues({}, item), { preferAvatar: false })),
|
|
2221
2231
|
title: item.title,
|
|
2222
2232
|
content: item.description,
|
|
2223
2233
|
showMediaAtAllSizes: true,
|
|
@@ -2252,14 +2262,14 @@ var getHeaderAction = (callToAction) => {
|
|
|
2252
2262
|
};
|
|
2253
2263
|
|
|
2254
2264
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2255
|
-
import { Fragment as Fragment3, jsx as
|
|
2265
|
+
import { Fragment as Fragment3, jsx as jsx42, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2256
2266
|
var ReviewRenderer = {
|
|
2257
2267
|
canRenderType: "review",
|
|
2258
2268
|
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2259
2269
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2260
2270
|
return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
|
|
2261
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2271
|
+
(title || callToAction) && /* @__PURE__ */ jsx42(Header6, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2272
|
+
/* @__PURE__ */ jsx42("div", { className: margin, children: /* @__PURE__ */ jsx42(
|
|
2263
2273
|
DefinitionList,
|
|
2264
2274
|
{
|
|
2265
2275
|
layout: orientation,
|
|
@@ -2299,13 +2309,13 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2299
2309
|
var getFieldValue = (value, help, orientation, onClick) => {
|
|
2300
2310
|
if (help) {
|
|
2301
2311
|
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
2302
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ jsx42(Help_default, { help, onClick }),
|
|
2303
2313
|
" ",
|
|
2304
2314
|
value
|
|
2305
2315
|
] }) : /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
2306
2316
|
value,
|
|
2307
2317
|
" ",
|
|
2308
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ jsx42(Help_default, { help, onClick })
|
|
2309
2319
|
] });
|
|
2310
2320
|
}
|
|
2311
2321
|
return value;
|
|
@@ -2351,7 +2361,7 @@ var generic_error_messages_default = defineMessages7({
|
|
|
2351
2361
|
|
|
2352
2362
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2353
2363
|
import { Button as Button6 } from "@transferwise/components";
|
|
2354
|
-
import { jsx as
|
|
2364
|
+
import { jsx as jsx43, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2355
2365
|
function ErrorResult({ state }) {
|
|
2356
2366
|
const intl = useIntl6();
|
|
2357
2367
|
const buttonVisualProps = {
|
|
@@ -2362,7 +2372,7 @@ function ErrorResult({ state }) {
|
|
|
2362
2372
|
return /* @__PURE__ */ jsxs13("p", { className: "m-t-2", children: [
|
|
2363
2373
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2364
2374
|
"\xA0",
|
|
2365
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ jsx43(
|
|
2366
2376
|
Button6,
|
|
2367
2377
|
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2368
2378
|
onClick: () => {
|
|
@@ -2375,7 +2385,7 @@ function ErrorResult({ state }) {
|
|
|
2375
2385
|
}
|
|
2376
2386
|
|
|
2377
2387
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2378
|
-
import { Fragment as Fragment4, jsx as
|
|
2388
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2379
2389
|
function BlockSearchRendererComponent({
|
|
2380
2390
|
id,
|
|
2381
2391
|
isLoading,
|
|
@@ -2389,7 +2399,7 @@ function BlockSearchRendererComponent({
|
|
|
2389
2399
|
const [hasSearched, setHasSearched] = useState6(false);
|
|
2390
2400
|
const { formatMessage } = useIntl7();
|
|
2391
2401
|
return /* @__PURE__ */ jsxs14("div", { className: getMargin(margin), children: [
|
|
2392
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx44(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx44(
|
|
2393
2403
|
Input4,
|
|
2394
2404
|
{
|
|
2395
2405
|
id,
|
|
@@ -2406,7 +2416,7 @@ function BlockSearchRendererComponent({
|
|
|
2406
2416
|
}
|
|
2407
2417
|
}
|
|
2408
2418
|
) }),
|
|
2409
|
-
isLoading ? /* @__PURE__ */
|
|
2419
|
+
isLoading ? /* @__PURE__ */ jsx44(Fragment4, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx44(SearchResultContent, { state, trackEvent })
|
|
2410
2420
|
] });
|
|
2411
2421
|
}
|
|
2412
2422
|
function SearchResultContent({
|
|
@@ -2415,26 +2425,26 @@ function SearchResultContent({
|
|
|
2415
2425
|
}) {
|
|
2416
2426
|
switch (state.type) {
|
|
2417
2427
|
case "error":
|
|
2418
|
-
return /* @__PURE__ */
|
|
2428
|
+
return /* @__PURE__ */ jsx44(ErrorResult, { state });
|
|
2419
2429
|
case "results":
|
|
2420
|
-
return /* @__PURE__ */
|
|
2430
|
+
return /* @__PURE__ */ jsx44(SearchResults, { state, trackEvent });
|
|
2421
2431
|
case "noResults":
|
|
2422
|
-
return /* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ jsx44(EmptySearchResult, { state });
|
|
2423
2433
|
case "pending":
|
|
2424
2434
|
default:
|
|
2425
2435
|
return null;
|
|
2426
2436
|
}
|
|
2427
2437
|
}
|
|
2428
2438
|
function EmptySearchResult({ state }) {
|
|
2429
|
-
return /* @__PURE__ */
|
|
2439
|
+
return /* @__PURE__ */ jsx44(Markdown4, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2430
2440
|
}
|
|
2431
2441
|
function SearchResults({
|
|
2432
2442
|
state,
|
|
2433
2443
|
trackEvent
|
|
2434
2444
|
}) {
|
|
2435
|
-
return /* @__PURE__ */
|
|
2445
|
+
return /* @__PURE__ */ jsx44(NavigationOptionsList2, { children: state.results.map((result) => {
|
|
2436
2446
|
const { icon, image } = result;
|
|
2437
|
-
return /* @__PURE__ */
|
|
2447
|
+
return /* @__PURE__ */ jsx44(
|
|
2438
2448
|
NavigationOption3,
|
|
2439
2449
|
{
|
|
2440
2450
|
title: result.title,
|
|
@@ -2460,7 +2470,7 @@ import { Markdown as Markdown5, Typeahead } from "@transferwise/components";
|
|
|
2460
2470
|
import { Search } from "@transferwise/icons";
|
|
2461
2471
|
import { useState as useState7 } from "react";
|
|
2462
2472
|
import { useIntl as useIntl8 } from "react-intl";
|
|
2463
|
-
import { jsx as
|
|
2473
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2464
2474
|
function InlineSearchRenderer({
|
|
2465
2475
|
id,
|
|
2466
2476
|
isLoading,
|
|
@@ -2472,7 +2482,7 @@ function InlineSearchRenderer({
|
|
|
2472
2482
|
}) {
|
|
2473
2483
|
const [hasSearched, setHasSearched] = useState7(false);
|
|
2474
2484
|
const intl = useIntl8();
|
|
2475
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ jsx45("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx45(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx45(
|
|
2476
2486
|
Typeahead,
|
|
2477
2487
|
{
|
|
2478
2488
|
id: "typeahead-input-id",
|
|
@@ -2480,10 +2490,10 @@ function InlineSearchRenderer({
|
|
|
2480
2490
|
name: "typeahead-input-name",
|
|
2481
2491
|
size: "md",
|
|
2482
2492
|
maxHeight: 100,
|
|
2483
|
-
footer: /* @__PURE__ */
|
|
2493
|
+
footer: /* @__PURE__ */ jsx45(TypeaheadFooter, { state, isLoading }),
|
|
2484
2494
|
multiple: false,
|
|
2485
2495
|
clearable: false,
|
|
2486
|
-
addon: /* @__PURE__ */
|
|
2496
|
+
addon: /* @__PURE__ */ jsx45(Search, { size: 24 }),
|
|
2487
2497
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2488
2498
|
minQueryLength: 1,
|
|
2489
2499
|
onChange: (values) => {
|
|
@@ -2520,34 +2530,34 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2520
2530
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2521
2531
|
const { formatMessage } = useIntl8();
|
|
2522
2532
|
if (state.type === "noResults") {
|
|
2523
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ jsx45(Markdown5, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2524
2534
|
}
|
|
2525
2535
|
if (state.type === "error") {
|
|
2526
|
-
return /* @__PURE__ */
|
|
2536
|
+
return /* @__PURE__ */ jsx45("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx45(ErrorResult, { state }) });
|
|
2527
2537
|
}
|
|
2528
2538
|
if (state.type === "pending" || isLoading) {
|
|
2529
|
-
return /* @__PURE__ */
|
|
2539
|
+
return /* @__PURE__ */ jsx45("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2530
2540
|
}
|
|
2531
2541
|
return null;
|
|
2532
2542
|
}
|
|
2533
2543
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2534
2544
|
|
|
2535
2545
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2536
|
-
import { jsx as
|
|
2546
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2537
2547
|
var SearchRenderer = {
|
|
2538
2548
|
canRenderType: "search",
|
|
2539
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
2549
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx46(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx46(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2540
2550
|
};
|
|
2541
2551
|
var SearchRenderer_default = SearchRenderer;
|
|
2542
2552
|
|
|
2543
2553
|
// ../renderers/src/SectionRenderer.tsx
|
|
2544
2554
|
import { Header as Header7 } from "@transferwise/components";
|
|
2545
|
-
import { jsx as
|
|
2555
|
+
import { jsx as jsx47, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2546
2556
|
var SectionRenderer = {
|
|
2547
2557
|
canRenderType: "section",
|
|
2548
2558
|
render: ({ children, callToAction, margin, title }) => {
|
|
2549
2559
|
return /* @__PURE__ */ jsxs15("section", { className: getMargin(margin), children: [
|
|
2550
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2560
|
+
(title || callToAction) && /* @__PURE__ */ jsx47(Header7, { title: title != null ? title : "", action: getHeaderAction(callToAction) }),
|
|
2551
2561
|
children
|
|
2552
2562
|
] });
|
|
2553
2563
|
}
|
|
@@ -2556,7 +2566,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
2556
2566
|
|
|
2557
2567
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2558
2568
|
import { RadioGroup } from "@transferwise/components";
|
|
2559
|
-
import { Fragment as Fragment5, jsx as
|
|
2569
|
+
import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2560
2570
|
function RadioInputRendererComponent(props) {
|
|
2561
2571
|
const {
|
|
2562
2572
|
id,
|
|
@@ -2571,7 +2581,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2571
2581
|
onSelect
|
|
2572
2582
|
} = props;
|
|
2573
2583
|
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
2574
|
-
/* @__PURE__ */
|
|
2584
|
+
/* @__PURE__ */ jsx48(
|
|
2575
2585
|
FieldInput_default,
|
|
2576
2586
|
{
|
|
2577
2587
|
id,
|
|
@@ -2579,7 +2589,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2579
2589
|
help,
|
|
2580
2590
|
description,
|
|
2581
2591
|
validation: validationState,
|
|
2582
|
-
children: /* @__PURE__ */
|
|
2592
|
+
children: /* @__PURE__ */ jsx48("span", { children: /* @__PURE__ */ jsx48(
|
|
2583
2593
|
RadioGroup,
|
|
2584
2594
|
{
|
|
2585
2595
|
name: id,
|
|
@@ -2588,7 +2598,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2588
2598
|
value: index,
|
|
2589
2599
|
secondary: option.description,
|
|
2590
2600
|
disabled: option.disabled || disabled,
|
|
2591
|
-
avatar: /* @__PURE__ */
|
|
2601
|
+
avatar: /* @__PURE__ */ jsx48(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
2592
2602
|
})),
|
|
2593
2603
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2594
2604
|
onChange: onSelect
|
|
@@ -2604,7 +2614,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2604
2614
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2605
2615
|
import { Tabs } from "@transferwise/components";
|
|
2606
2616
|
import { useEffect as useEffect3 } from "react";
|
|
2607
|
-
import { Fragment as Fragment6, jsx as
|
|
2617
|
+
import { Fragment as Fragment6, jsx as jsx49, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2608
2618
|
function TabInputRendererComponent(props) {
|
|
2609
2619
|
const {
|
|
2610
2620
|
id,
|
|
@@ -2624,7 +2634,7 @@ function TabInputRendererComponent(props) {
|
|
|
2624
2634
|
}
|
|
2625
2635
|
}, [selectedIndex, onSelect, options.length]);
|
|
2626
2636
|
return /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
2627
|
-
/* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ jsx49(
|
|
2628
2638
|
FieldInput_default,
|
|
2629
2639
|
{
|
|
2630
2640
|
id,
|
|
@@ -2632,7 +2642,7 @@ function TabInputRendererComponent(props) {
|
|
|
2632
2642
|
help,
|
|
2633
2643
|
description,
|
|
2634
2644
|
validation: validationState,
|
|
2635
|
-
children: /* @__PURE__ */
|
|
2645
|
+
children: /* @__PURE__ */ jsx49(
|
|
2636
2646
|
Tabs,
|
|
2637
2647
|
{
|
|
2638
2648
|
name: id,
|
|
@@ -2641,7 +2651,7 @@ function TabInputRendererComponent(props) {
|
|
|
2641
2651
|
title: option.title,
|
|
2642
2652
|
// if we pass null, we get some props-types console errors
|
|
2643
2653
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2644
|
-
content: /* @__PURE__ */
|
|
2654
|
+
content: /* @__PURE__ */ jsx49(Fragment6, {}),
|
|
2645
2655
|
disabled: option.disabled || disabled
|
|
2646
2656
|
})),
|
|
2647
2657
|
onTabSelect: onSelect
|
|
@@ -2656,7 +2666,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
|
|
|
2656
2666
|
|
|
2657
2667
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2658
2668
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
2659
|
-
import { Fragment as Fragment7, jsx as
|
|
2669
|
+
import { Fragment as Fragment7, jsx as jsx50, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2660
2670
|
function SelectInputRendererComponent(props) {
|
|
2661
2671
|
const {
|
|
2662
2672
|
id,
|
|
@@ -2696,13 +2706,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2696
2706
|
} : {
|
|
2697
2707
|
title: option.title,
|
|
2698
2708
|
description: option.description,
|
|
2699
|
-
icon: /* @__PURE__ */
|
|
2709
|
+
icon: /* @__PURE__ */ jsx50(OptionMedia, { icon: option.icon, image: option.image, preferAvatar: false })
|
|
2700
2710
|
};
|
|
2701
|
-
return /* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ jsx50(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
2702
2712
|
};
|
|
2703
2713
|
const extraProps = { autoComplete };
|
|
2704
2714
|
return /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
2705
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ jsx50(
|
|
2706
2716
|
FieldInput_default,
|
|
2707
2717
|
{
|
|
2708
2718
|
id,
|
|
@@ -2710,7 +2720,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2710
2720
|
help,
|
|
2711
2721
|
description,
|
|
2712
2722
|
validation: validationState,
|
|
2713
|
-
children: /* @__PURE__ */
|
|
2723
|
+
children: /* @__PURE__ */ jsx50(
|
|
2714
2724
|
SelectInput2,
|
|
2715
2725
|
__spreadValues({
|
|
2716
2726
|
name: id,
|
|
@@ -2733,7 +2743,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2733
2743
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2734
2744
|
import { useEffect as useEffect4 } from "react";
|
|
2735
2745
|
import { SegmentedControl } from "@transferwise/components";
|
|
2736
|
-
import { Fragment as Fragment8, jsx as
|
|
2746
|
+
import { Fragment as Fragment8, jsx as jsx51, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2737
2747
|
function SegmentedInputRendererComponent(props) {
|
|
2738
2748
|
const {
|
|
2739
2749
|
id,
|
|
@@ -2752,7 +2762,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2752
2762
|
}
|
|
2753
2763
|
}, [selectedIndex, onSelect, options.length]);
|
|
2754
2764
|
return /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ jsx51(
|
|
2756
2766
|
FieldInput_default,
|
|
2757
2767
|
{
|
|
2758
2768
|
id,
|
|
@@ -2760,7 +2770,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2760
2770
|
help,
|
|
2761
2771
|
description,
|
|
2762
2772
|
validation: validationState,
|
|
2763
|
-
children: /* @__PURE__ */
|
|
2773
|
+
children: /* @__PURE__ */ jsx51(
|
|
2764
2774
|
SegmentedControl,
|
|
2765
2775
|
{
|
|
2766
2776
|
name: `${id}-segmented-control`,
|
|
@@ -2777,26 +2787,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2777
2787
|
)
|
|
2778
2788
|
}
|
|
2779
2789
|
),
|
|
2780
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ jsx51("div", { id: `${id}-children`, children })
|
|
2781
2791
|
] });
|
|
2782
2792
|
}
|
|
2783
2793
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2784
2794
|
|
|
2785
2795
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2786
|
-
import { jsx as
|
|
2796
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2787
2797
|
var SelectInputRenderer = {
|
|
2788
2798
|
canRenderType: "input-select",
|
|
2789
2799
|
render: (props) => {
|
|
2790
2800
|
switch (props.control) {
|
|
2791
2801
|
case "radio":
|
|
2792
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ jsx52(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2793
2803
|
case "tab":
|
|
2794
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2804
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx52(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx52(TabInputRendererComponent, __spreadValues({}, props));
|
|
2795
2805
|
case "segmented":
|
|
2796
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2806
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx52(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx52(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2797
2807
|
case "select":
|
|
2798
2808
|
default:
|
|
2799
|
-
return /* @__PURE__ */
|
|
2809
|
+
return /* @__PURE__ */ jsx52(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2800
2810
|
}
|
|
2801
2811
|
}
|
|
2802
2812
|
};
|
|
@@ -2804,17 +2814,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2804
2814
|
|
|
2805
2815
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2806
2816
|
import { Header as Header8, Summary } from "@transferwise/components";
|
|
2807
|
-
import { jsx as
|
|
2817
|
+
import { jsx as jsx53, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2808
2818
|
var StatusListRenderer = {
|
|
2809
2819
|
canRenderType: "status-list",
|
|
2810
2820
|
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
|
|
2811
|
-
title ? /* @__PURE__ */
|
|
2812
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
2821
|
+
title ? /* @__PURE__ */ jsx53(Header8, { title, className: "m-b-2" }) : null,
|
|
2822
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx53(
|
|
2813
2823
|
Summary,
|
|
2814
2824
|
{
|
|
2815
2825
|
title: itemTitle,
|
|
2816
2826
|
description,
|
|
2817
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
2827
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx53(DynamicIcon_default, { name: icon.name }) : null,
|
|
2818
2828
|
status: mapStatus(status),
|
|
2819
2829
|
action: getSummaryAction(callToAction)
|
|
2820
2830
|
},
|
|
@@ -2868,9 +2878,9 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
2868
2878
|
// ../renderers/src/step/BackButton.tsx
|
|
2869
2879
|
import { AvatarView as AvatarView4 } from "@transferwise/components";
|
|
2870
2880
|
import { ArrowLeft } from "@transferwise/icons";
|
|
2871
|
-
import { jsx as
|
|
2881
|
+
import { jsx as jsx54, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2872
2882
|
function BackButton({ title, onClick }) {
|
|
2873
|
-
return /* @__PURE__ */
|
|
2883
|
+
return /* @__PURE__ */ jsx54("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs21(
|
|
2874
2884
|
"button",
|
|
2875
2885
|
{
|
|
2876
2886
|
type: "button",
|
|
@@ -2879,8 +2889,8 @@ function BackButton({ title, onClick }) {
|
|
|
2879
2889
|
"aria-label": title,
|
|
2880
2890
|
onClick,
|
|
2881
2891
|
children: [
|
|
2882
|
-
/* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2892
|
+
/* @__PURE__ */ jsx54("span", { className: "sr-only", children: title }),
|
|
2893
|
+
/* @__PURE__ */ jsx54(AvatarView4, { interactive: true, children: /* @__PURE__ */ jsx54(ArrowLeft, { size: "24" }) })
|
|
2884
2894
|
]
|
|
2885
2895
|
}
|
|
2886
2896
|
) });
|
|
@@ -2888,7 +2898,7 @@ function BackButton({ title, onClick }) {
|
|
|
2888
2898
|
var BackButton_default = BackButton;
|
|
2889
2899
|
|
|
2890
2900
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
2891
|
-
import { jsx as
|
|
2901
|
+
import { jsx as jsx55, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2892
2902
|
var SplashCelebrationStepRenderer = {
|
|
2893
2903
|
canRenderType: "step",
|
|
2894
2904
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -2898,13 +2908,13 @@ function SplashCelebrationStepRendererComponent(props) {
|
|
|
2898
2908
|
const { back, children, trackEvent } = props;
|
|
2899
2909
|
useCustomTheme("forest-green", trackEvent);
|
|
2900
2910
|
return /* @__PURE__ */ jsxs22("div", { className: "splash-screen m-t-5", children: [
|
|
2901
|
-
back ? /* @__PURE__ */
|
|
2911
|
+
back ? /* @__PURE__ */ jsx55(BackButton_default, __spreadValues({}, back)) : null,
|
|
2902
2912
|
children
|
|
2903
2913
|
] });
|
|
2904
2914
|
}
|
|
2905
2915
|
|
|
2906
2916
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
2907
|
-
import { jsx as
|
|
2917
|
+
import { jsx as jsx56, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2908
2918
|
var SplashStepRenderer = {
|
|
2909
2919
|
canRenderType: "step",
|
|
2910
2920
|
canRender: ({ control }) => control === "splash",
|
|
@@ -2913,14 +2923,14 @@ var SplashStepRenderer = {
|
|
|
2913
2923
|
function SplashStepRendererComponent(props) {
|
|
2914
2924
|
const { back, children } = props;
|
|
2915
2925
|
return /* @__PURE__ */ jsxs23("div", { className: "splash-screen m-t-5", children: [
|
|
2916
|
-
back ? /* @__PURE__ */
|
|
2926
|
+
back ? /* @__PURE__ */ jsx56(BackButton_default, __spreadValues({}, back)) : null,
|
|
2917
2927
|
children
|
|
2918
2928
|
] });
|
|
2919
2929
|
}
|
|
2920
2930
|
|
|
2921
2931
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2922
2932
|
import { Alert as Alert2, Title as Title2 } from "@transferwise/components";
|
|
2923
|
-
import { Fragment as Fragment9, jsx as
|
|
2933
|
+
import { Fragment as Fragment9, jsx as jsx57, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2924
2934
|
var StepRenderer = {
|
|
2925
2935
|
canRenderType: "step",
|
|
2926
2936
|
render: StepRendererComponent
|
|
@@ -2928,12 +2938,12 @@ var StepRenderer = {
|
|
|
2928
2938
|
function StepRendererComponent(props) {
|
|
2929
2939
|
const { back, description, error, title, children } = props;
|
|
2930
2940
|
return /* @__PURE__ */ jsxs24(Fragment9, { children: [
|
|
2931
|
-
back ? /* @__PURE__ */
|
|
2941
|
+
back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
|
|
2932
2942
|
title || description ? /* @__PURE__ */ jsxs24("div", { className: "m-b-4", children: [
|
|
2933
|
-
title ? /* @__PURE__ */
|
|
2934
|
-
description ? /* @__PURE__ */
|
|
2943
|
+
title ? /* @__PURE__ */ jsx57(Title2, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2944
|
+
description ? /* @__PURE__ */ jsx57("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2935
2945
|
] }) : void 0,
|
|
2936
|
-
error ? /* @__PURE__ */
|
|
2946
|
+
error ? /* @__PURE__ */ jsx57(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2937
2947
|
children
|
|
2938
2948
|
] });
|
|
2939
2949
|
}
|
|
@@ -2941,26 +2951,26 @@ function StepRendererComponent(props) {
|
|
|
2941
2951
|
// ../renderers/src/TabsRenderer.tsx
|
|
2942
2952
|
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
2943
2953
|
import { useState as useState8 } from "react";
|
|
2944
|
-
import { jsx as
|
|
2954
|
+
import { jsx as jsx58, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2945
2955
|
var TabsRenderer = {
|
|
2946
2956
|
canRenderType: "tabs",
|
|
2947
2957
|
render: (props) => {
|
|
2948
2958
|
switch (props.control) {
|
|
2949
2959
|
case "segmented":
|
|
2950
2960
|
if (props.tabs.length > 3) {
|
|
2951
|
-
return /* @__PURE__ */
|
|
2961
|
+
return /* @__PURE__ */ jsx58(TabsRendererComponent, __spreadValues({}, props));
|
|
2952
2962
|
}
|
|
2953
|
-
return /* @__PURE__ */
|
|
2963
|
+
return /* @__PURE__ */ jsx58(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
2954
2964
|
case "chips":
|
|
2955
|
-
return /* @__PURE__ */
|
|
2965
|
+
return /* @__PURE__ */ jsx58(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
2956
2966
|
default:
|
|
2957
|
-
return /* @__PURE__ */
|
|
2967
|
+
return /* @__PURE__ */ jsx58(TabsRendererComponent, __spreadValues({}, props));
|
|
2958
2968
|
}
|
|
2959
2969
|
}
|
|
2960
2970
|
};
|
|
2961
2971
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
2962
2972
|
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
2963
|
-
return /* @__PURE__ */
|
|
2973
|
+
return /* @__PURE__ */ jsx58("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx58(
|
|
2964
2974
|
Tabs2,
|
|
2965
2975
|
{
|
|
2966
2976
|
name: uid,
|
|
@@ -2982,7 +2992,7 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2982
2992
|
var _a;
|
|
2983
2993
|
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
2984
2994
|
return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
2985
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx58(
|
|
2986
2996
|
SegmentedControl2,
|
|
2987
2997
|
{
|
|
2988
2998
|
name: uid,
|
|
@@ -2997,14 +3007,14 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2997
3007
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
2998
3008
|
}
|
|
2999
3009
|
),
|
|
3000
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx58("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3001
3011
|
] });
|
|
3002
3012
|
}
|
|
3003
3013
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3004
3014
|
var _a;
|
|
3005
3015
|
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
3006
3016
|
return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
3007
|
-
/* @__PURE__ */
|
|
3017
|
+
/* @__PURE__ */ jsx58("div", { className: "chips-container", children: /* @__PURE__ */ jsx58(
|
|
3008
3018
|
Chips,
|
|
3009
3019
|
{
|
|
3010
3020
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
@@ -3012,7 +3022,7 @@ function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
|
3012
3022
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3013
3023
|
}
|
|
3014
3024
|
) }),
|
|
3015
|
-
/* @__PURE__ */
|
|
3025
|
+
/* @__PURE__ */ jsx58("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3016
3026
|
] });
|
|
3017
3027
|
}
|
|
3018
3028
|
|
|
@@ -3027,7 +3037,7 @@ import {
|
|
|
3027
3037
|
TextArea,
|
|
3028
3038
|
TextareaWithDisplayFormat
|
|
3029
3039
|
} from "@transferwise/components";
|
|
3030
|
-
import { jsx as
|
|
3040
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
3031
3041
|
var commonKeys = [
|
|
3032
3042
|
"autoComplete",
|
|
3033
3043
|
"autoCapitalize",
|
|
@@ -3046,12 +3056,12 @@ function VariableTextInput(inputProps) {
|
|
|
3046
3056
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3047
3057
|
switch (control) {
|
|
3048
3058
|
case "email":
|
|
3049
|
-
return /* @__PURE__ */
|
|
3059
|
+
return /* @__PURE__ */ jsx59(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3050
3060
|
case "password":
|
|
3051
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ jsx59(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3052
3062
|
case "numeric": {
|
|
3053
3063
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3054
|
-
return /* @__PURE__ */
|
|
3064
|
+
return /* @__PURE__ */ jsx59(
|
|
3055
3065
|
TextInput,
|
|
3056
3066
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3057
3067
|
onChange: (newValue) => {
|
|
@@ -3062,9 +3072,9 @@ function VariableTextInput(inputProps) {
|
|
|
3062
3072
|
);
|
|
3063
3073
|
}
|
|
3064
3074
|
case "phone-number":
|
|
3065
|
-
return /* @__PURE__ */
|
|
3075
|
+
return /* @__PURE__ */ jsx59(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3066
3076
|
default: {
|
|
3067
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ jsx59(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3068
3078
|
}
|
|
3069
3079
|
}
|
|
3070
3080
|
}
|
|
@@ -3072,11 +3082,11 @@ function TextInput(props) {
|
|
|
3072
3082
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3073
3083
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
3074
3084
|
const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
|
|
3075
|
-
return displayFormat ? /* @__PURE__ */
|
|
3085
|
+
return displayFormat ? /* @__PURE__ */ jsx59(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx59(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3076
3086
|
}
|
|
3077
3087
|
|
|
3078
3088
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3079
|
-
import { jsx as
|
|
3089
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3080
3090
|
var TextInputRenderer = {
|
|
3081
3091
|
canRenderType: "input-text",
|
|
3082
3092
|
render: (props) => {
|
|
@@ -3111,7 +3121,7 @@ var TextInputRenderer = {
|
|
|
3111
3121
|
}
|
|
3112
3122
|
}
|
|
3113
3123
|
});
|
|
3114
|
-
return /* @__PURE__ */
|
|
3124
|
+
return /* @__PURE__ */ jsx60(
|
|
3115
3125
|
FieldInput_default,
|
|
3116
3126
|
{
|
|
3117
3127
|
id,
|
|
@@ -3119,7 +3129,7 @@ var TextInputRenderer = {
|
|
|
3119
3129
|
description,
|
|
3120
3130
|
validation: validationState,
|
|
3121
3131
|
help,
|
|
3122
|
-
children: /* @__PURE__ */
|
|
3132
|
+
children: /* @__PURE__ */ jsx60(InputGroup3, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx60(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3123
3133
|
}
|
|
3124
3134
|
);
|
|
3125
3135
|
}
|
|
@@ -3133,7 +3143,7 @@ import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
|
3133
3143
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3134
3144
|
|
|
3135
3145
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3136
|
-
import { jsx as
|
|
3146
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3137
3147
|
var UploadInputRenderer = {
|
|
3138
3148
|
canRenderType: "input-upload",
|
|
3139
3149
|
render: (props) => {
|
|
@@ -3149,20 +3159,20 @@ var UploadInputRenderer = {
|
|
|
3149
3159
|
};
|
|
3150
3160
|
return (
|
|
3151
3161
|
// We don't pass help here as there is no sensible place to display it
|
|
3152
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsx61(
|
|
3153
3163
|
UploadFieldInput_default,
|
|
3154
3164
|
{
|
|
3155
3165
|
id,
|
|
3156
3166
|
label: void 0,
|
|
3157
3167
|
description: void 0,
|
|
3158
3168
|
validation: validationState,
|
|
3159
|
-
children: /* @__PURE__ */
|
|
3169
|
+
children: /* @__PURE__ */ jsx61(
|
|
3160
3170
|
UploadInput2,
|
|
3161
3171
|
{
|
|
3162
3172
|
id,
|
|
3163
3173
|
description,
|
|
3164
3174
|
disabled,
|
|
3165
|
-
fileTypes:
|
|
3175
|
+
fileTypes: acceptsToFileTypes(accepts),
|
|
3166
3176
|
sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
|
|
3167
3177
|
uploadButtonTitle: title,
|
|
3168
3178
|
onDeleteFile,
|
|
@@ -3211,7 +3221,9 @@ var LargeUploadRenderer = {
|
|
|
3211
3221
|
throw e;
|
|
3212
3222
|
}
|
|
3213
3223
|
};
|
|
3214
|
-
|
|
3224
|
+
const filetypes = acceptsToFileTypes(accepts);
|
|
3225
|
+
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3226
|
+
return /* @__PURE__ */ jsx61(
|
|
3215
3227
|
FieldInput_default,
|
|
3216
3228
|
{
|
|
3217
3229
|
id,
|
|
@@ -3219,10 +3231,10 @@ var LargeUploadRenderer = {
|
|
|
3219
3231
|
description,
|
|
3220
3232
|
validation: validationState,
|
|
3221
3233
|
help,
|
|
3222
|
-
children: /* @__PURE__ */
|
|
3234
|
+
children: /* @__PURE__ */ jsx61(
|
|
3223
3235
|
Upload,
|
|
3224
3236
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3225
|
-
usAccept
|
|
3237
|
+
usAccept,
|
|
3226
3238
|
usDisabled: disabled,
|
|
3227
3239
|
onSuccess: onUploadFile,
|
|
3228
3240
|
onFailure: async () => onUpload(null),
|
|
@@ -3255,6 +3267,7 @@ var getWiseRenderers = () => [
|
|
|
3255
3267
|
ListRenderer_default,
|
|
3256
3268
|
LoadingIndicatorRenderer_default,
|
|
3257
3269
|
MarkdownRenderer_default,
|
|
3270
|
+
ModalRenderer,
|
|
3258
3271
|
ModalLayoutRenderer_default,
|
|
3259
3272
|
MultiSelectInputRenderer_default,
|
|
3260
3273
|
MultiUploadInputRenderer_default,
|
|
@@ -3274,20 +3287,10 @@ var getWiseRenderers = () => [
|
|
|
3274
3287
|
StepRenderer
|
|
3275
3288
|
];
|
|
3276
3289
|
|
|
3277
|
-
// ../renderers/src/ModalContentRenderer.tsx
|
|
3278
|
-
import { Modal as Modal4 } from "@transferwise/components";
|
|
3279
|
-
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3280
|
-
var ModalContentRenderer = {
|
|
3281
|
-
canRenderType: "modal",
|
|
3282
|
-
render: ({ title, children, open, onClose }) => {
|
|
3283
|
-
return /* @__PURE__ */ jsx61(Modal4, { open, title, body: children, onClose });
|
|
3284
|
-
}
|
|
3285
|
-
};
|
|
3286
|
-
|
|
3287
3290
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3288
3291
|
var appVersion = (
|
|
3289
3292
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3290
|
-
typeof process !== "undefined" ? "4.
|
|
3293
|
+
typeof process !== "undefined" ? "4.18.0" : "0.0.0"
|
|
3291
3294
|
);
|
|
3292
3295
|
|
|
3293
3296
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -3346,10 +3349,7 @@ function DynamicFlowRevamp(props) {
|
|
|
3346
3349
|
onThemeChange
|
|
3347
3350
|
} = props;
|
|
3348
3351
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3349
|
-
const mergedRenderers = useMemo2(
|
|
3350
|
-
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3351
|
-
[renderers]
|
|
3352
|
-
);
|
|
3352
|
+
const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3353
3353
|
const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
|
|
3354
3354
|
const trackEvent = useMemo2(
|
|
3355
3355
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
@@ -3376,10 +3376,7 @@ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
|
3376
3376
|
onThemeChange
|
|
3377
3377
|
} = props;
|
|
3378
3378
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3379
|
-
const mergedRenderers = useMemo2(
|
|
3380
|
-
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3381
|
-
[renderers]
|
|
3382
|
-
);
|
|
3379
|
+
const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
3383
3380
|
const logEvent = useMemo2(() => getLogEvent(onLog), [onLog]);
|
|
3384
3381
|
const trackEvent = useMemo2(
|
|
3385
3382
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|