@wise/dynamic-flow-client-internal 4.24.0-experimental-renderer-extensions-2-779450d → 4.24.1-experimental-1ea86c5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/cs.json +1 -1
- package/build/i18n/fr.json +1 -1
- package/build/i18n/hu.json +1 -1
- package/build/i18n/id.json +2 -2
- package/build/i18n/it.json +1 -1
- package/build/i18n/nl.json +2 -2
- package/build/i18n/zh_HK.json +1 -1
- package/build/main.js +274 -255
- package/build/main.mjs +213 -196
- package/build/types/index.d.ts +3 -2
- package/package.json +5 -5
- package/build/types/dynamicFlow/extensions/createRendererWithExtensions.d.ts +0 -13
package/build/main.js
CHANGED
|
@@ -62,15 +62,15 @@ __export(index_exports, {
|
|
|
62
62
|
DynamicFlowLegacy: () => DynamicFlowLegacy,
|
|
63
63
|
DynamicFlowRevamp: () => DynamicFlowRevamp,
|
|
64
64
|
DynamicForm: () => DynamicForm,
|
|
65
|
+
Header: () => Header7,
|
|
65
66
|
JsonSchemaForm: () => import_dynamic_flow_client4.JsonSchemaForm,
|
|
66
|
-
createRendererWithExtensions: () => createRendererWithExtensions,
|
|
67
67
|
findRendererPropsByType: () => import_dynamic_flow_client4.findRendererPropsByType,
|
|
68
|
+
getMargin: () => getMargin,
|
|
68
69
|
isValidSchema: () => import_dynamic_flow_client4.isValidSchema,
|
|
69
70
|
makeCustomFetch: () => import_dynamic_flow_client3.makeHttpClient,
|
|
70
71
|
translations: () => i18n_default
|
|
71
72
|
});
|
|
72
73
|
module.exports = __toCommonJS(index_exports);
|
|
73
|
-
var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
|
|
74
74
|
|
|
75
75
|
// ../renderers/src/AlertRenderer.tsx
|
|
76
76
|
var import_components = require("@transferwise/components");
|
|
@@ -210,6 +210,26 @@ var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
|
|
|
210
210
|
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
211
211
|
var import_components3 = require("@transferwise/components");
|
|
212
212
|
var import_react2 = require("react");
|
|
213
|
+
|
|
214
|
+
// ../renderers/src/ButtonRenderer/mapButtonSize.tsx
|
|
215
|
+
var mapButtonSize = (size) => {
|
|
216
|
+
if (!size) {
|
|
217
|
+
return void 0;
|
|
218
|
+
}
|
|
219
|
+
switch (size) {
|
|
220
|
+
case "xs":
|
|
221
|
+
case "sm":
|
|
222
|
+
return "sm";
|
|
223
|
+
case "lg":
|
|
224
|
+
case "xl":
|
|
225
|
+
return "lg";
|
|
226
|
+
case "md":
|
|
227
|
+
default:
|
|
228
|
+
return "md";
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
|
|
213
233
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
214
234
|
var ButtonRenderer = {
|
|
215
235
|
canRenderType: "button",
|
|
@@ -223,8 +243,9 @@ function ButtonComponent(props) {
|
|
|
223
243
|
setSpinny(false);
|
|
224
244
|
}
|
|
225
245
|
}, [stepLoadingState]);
|
|
226
|
-
const priority =
|
|
227
|
-
const type =
|
|
246
|
+
const priority = getPriority(control);
|
|
247
|
+
const type = getButtonType(context, priority);
|
|
248
|
+
const loading = spinny && stepLoadingState !== "idle";
|
|
228
249
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
229
250
|
import_components3.Button,
|
|
230
251
|
{
|
|
@@ -232,8 +253,8 @@ function ButtonComponent(props) {
|
|
|
232
253
|
className: getMargin(margin),
|
|
233
254
|
disabled,
|
|
234
255
|
priority,
|
|
235
|
-
size:
|
|
236
|
-
loading
|
|
256
|
+
size: mapButtonSize(size),
|
|
257
|
+
loading,
|
|
237
258
|
type,
|
|
238
259
|
onClick: () => {
|
|
239
260
|
setSpinny(true);
|
|
@@ -243,16 +264,7 @@ function ButtonComponent(props) {
|
|
|
243
264
|
}
|
|
244
265
|
);
|
|
245
266
|
}
|
|
246
|
-
var
|
|
247
|
-
switch (context) {
|
|
248
|
-
case "neutral":
|
|
249
|
-
case "warning":
|
|
250
|
-
return "accent";
|
|
251
|
-
default:
|
|
252
|
-
return context;
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
var mapControl = (control) => {
|
|
267
|
+
var getPriority = (control) => {
|
|
256
268
|
switch (control) {
|
|
257
269
|
case "primary":
|
|
258
270
|
case "tertiary":
|
|
@@ -261,23 +273,18 @@ var mapControl = (control) => {
|
|
|
261
273
|
return "secondary";
|
|
262
274
|
}
|
|
263
275
|
};
|
|
264
|
-
var
|
|
265
|
-
if (
|
|
276
|
+
var getButtonType = (context, priority) => {
|
|
277
|
+
if (priority === "tertiary") {
|
|
266
278
|
return void 0;
|
|
267
279
|
}
|
|
268
|
-
switch (
|
|
269
|
-
case "
|
|
270
|
-
case "
|
|
271
|
-
return "
|
|
272
|
-
case "lg":
|
|
273
|
-
case "xl":
|
|
274
|
-
return "lg";
|
|
275
|
-
case "md":
|
|
280
|
+
switch (context) {
|
|
281
|
+
case "neutral":
|
|
282
|
+
case "warning":
|
|
283
|
+
return "accent";
|
|
276
284
|
default:
|
|
277
|
-
return
|
|
285
|
+
return context;
|
|
278
286
|
}
|
|
279
287
|
};
|
|
280
|
-
var ButtonRenderer_default = ButtonRenderer;
|
|
281
288
|
|
|
282
289
|
// ../renderers/src/components/FieldInput.tsx
|
|
283
290
|
var import_components5 = require("@transferwise/components");
|
|
@@ -1048,6 +1055,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1048
1055
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1049
1056
|
import_components15.Button,
|
|
1050
1057
|
{
|
|
1058
|
+
v2: true,
|
|
1051
1059
|
block: true,
|
|
1052
1060
|
className: "m-b-2",
|
|
1053
1061
|
priority: "primary",
|
|
@@ -1059,7 +1067,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1059
1067
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1060
1068
|
}
|
|
1061
1069
|
),
|
|
1062
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components15.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components15.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1063
1071
|
] }) })
|
|
1064
1072
|
] }),
|
|
1065
1073
|
onClose: onCancel
|
|
@@ -1538,7 +1546,7 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1538
1546
|
const [visible, setVisible] = (0, import_react8.useState)(false);
|
|
1539
1547
|
const { children, title } = content;
|
|
1540
1548
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: getMargin(margin), children: [
|
|
1541
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components24.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components24.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1542
1550
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1543
1551
|
import_components24.Modal,
|
|
1544
1552
|
{
|
|
@@ -1902,7 +1910,7 @@ function CopyableParagraph({
|
|
|
1902
1910
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
1903
1911
|
}
|
|
1904
1912
|
),
|
|
1905
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components31.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1913
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_components31.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1906
1914
|
] });
|
|
1907
1915
|
}
|
|
1908
1916
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
@@ -2015,7 +2023,17 @@ function Repeatable(props) {
|
|
|
2015
2023
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2016
2024
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { children: [
|
|
2017
2025
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components32.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2018
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2027
|
+
import_components32.Button,
|
|
2028
|
+
{
|
|
2029
|
+
v2: true,
|
|
2030
|
+
priority: "secondary",
|
|
2031
|
+
sentiment: "negative",
|
|
2032
|
+
block: true,
|
|
2033
|
+
onClick: () => onRemoveItem(),
|
|
2034
|
+
children: formatMessage(repeatable_messages_default.removeItem)
|
|
2035
|
+
}
|
|
2036
|
+
)
|
|
2019
2037
|
] })
|
|
2020
2038
|
] }),
|
|
2021
2039
|
onClose: () => onCancelEdit()
|
|
@@ -2041,9 +2059,12 @@ function ItemSummaryOption({
|
|
|
2041
2059
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2042
2060
|
|
|
2043
2061
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2044
|
-
var
|
|
2062
|
+
var import_components34 = require("@transferwise/components");
|
|
2045
2063
|
|
|
2046
|
-
// ../renderers/src/
|
|
2064
|
+
// ../renderers/src/components/Header.tsx
|
|
2065
|
+
var import_components33 = require("@transferwise/components");
|
|
2066
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2067
|
+
var Header7 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components33.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
2047
2068
|
var getHeaderAction = (callToAction) => {
|
|
2048
2069
|
if (!callToAction) {
|
|
2049
2070
|
return void 0;
|
|
@@ -2065,34 +2086,28 @@ var getHeaderAction = (callToAction) => {
|
|
|
2065
2086
|
};
|
|
2066
2087
|
|
|
2067
2088
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2068
|
-
var
|
|
2089
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2069
2090
|
var ReviewRenderer = {
|
|
2070
2091
|
canRenderType: "review",
|
|
2071
|
-
|
|
2072
|
-
field: ({ label, value, help, analyticsId: fieldAnalyticsId, trackEvent, orientation }) => ({
|
|
2073
|
-
key: label,
|
|
2074
|
-
title: label,
|
|
2075
|
-
value: getFieldValue(
|
|
2076
|
-
value,
|
|
2077
|
-
help,
|
|
2078
|
-
orientation,
|
|
2079
|
-
() => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
|
|
2080
|
-
)
|
|
2081
|
-
})
|
|
2082
|
-
},
|
|
2083
|
-
render({ callToAction, control, fields, margin, title, trackEvent }) {
|
|
2092
|
+
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2084
2093
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
2085
|
-
return /* @__PURE__ */ (0,
|
|
2086
|
-
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
2088
|
-
|
|
2094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: getMargin(margin), children: [
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Header7, { title, callToAction }),
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2097
|
+
import_components34.DefinitionList,
|
|
2089
2098
|
{
|
|
2090
2099
|
layout: orientation,
|
|
2091
2100
|
definitions: fields.map(
|
|
2092
|
-
(
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2101
|
+
({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
|
|
2102
|
+
key: String(index),
|
|
2103
|
+
title: label,
|
|
2104
|
+
value: getFieldValue(
|
|
2105
|
+
value,
|
|
2106
|
+
help,
|
|
2107
|
+
orientation,
|
|
2108
|
+
() => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
|
|
2109
|
+
)
|
|
2110
|
+
})
|
|
2096
2111
|
)
|
|
2097
2112
|
}
|
|
2098
2113
|
) })
|
|
@@ -2117,21 +2132,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2117
2132
|
};
|
|
2118
2133
|
var getFieldValue = (value, help, orientation, onClick) => {
|
|
2119
2134
|
if (help) {
|
|
2120
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2135
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Help_default, { help, onClick }),
|
|
2122
2137
|
" ",
|
|
2123
2138
|
value
|
|
2124
|
-
] }) : /* @__PURE__ */ (0,
|
|
2139
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
2125
2140
|
value,
|
|
2126
2141
|
" ",
|
|
2127
|
-
/* @__PURE__ */ (0,
|
|
2142
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Help_default, { help, onClick })
|
|
2128
2143
|
] });
|
|
2129
2144
|
}
|
|
2130
2145
|
return value;
|
|
2131
2146
|
};
|
|
2132
2147
|
|
|
2133
2148
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2134
|
-
var
|
|
2149
|
+
var import_components36 = require("@transferwise/components");
|
|
2135
2150
|
var import_react12 = require("react");
|
|
2136
2151
|
var import_react_intl19 = require("react-intl");
|
|
2137
2152
|
|
|
@@ -2169,32 +2184,19 @@ var generic_error_messages_default = (0, import_react_intl17.defineMessages)({
|
|
|
2169
2184
|
});
|
|
2170
2185
|
|
|
2171
2186
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2172
|
-
var
|
|
2173
|
-
var
|
|
2187
|
+
var import_components35 = require("@transferwise/components");
|
|
2188
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2174
2189
|
function ErrorResult({ state }) {
|
|
2175
2190
|
const intl = (0, import_react_intl18.useIntl)();
|
|
2176
|
-
|
|
2177
|
-
priority: "tertiary",
|
|
2178
|
-
size: "sm",
|
|
2179
|
-
style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
|
|
2180
|
-
};
|
|
2181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("p", { className: "m-t-2", children: [
|
|
2191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "m-t-2", children: [
|
|
2182
2192
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2183
2193
|
"\xA0",
|
|
2184
|
-
/* @__PURE__ */ (0,
|
|
2185
|
-
import_components34.Button,
|
|
2186
|
-
__spreadProps(__spreadValues({}, buttonVisualProps), {
|
|
2187
|
-
onClick: () => {
|
|
2188
|
-
state.onRetry();
|
|
2189
|
-
},
|
|
2190
|
-
children: intl.formatMessage(generic_error_messages_default.retry)
|
|
2191
|
-
})
|
|
2192
|
-
)
|
|
2194
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components35.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
2193
2195
|
] });
|
|
2194
2196
|
}
|
|
2195
2197
|
|
|
2196
2198
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2197
|
-
var
|
|
2199
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2198
2200
|
function BlockSearchRendererComponent({
|
|
2199
2201
|
id,
|
|
2200
2202
|
isLoading,
|
|
@@ -2207,9 +2209,9 @@ function BlockSearchRendererComponent({
|
|
|
2207
2209
|
}) {
|
|
2208
2210
|
const [hasSearched, setHasSearched] = (0, import_react12.useState)(false);
|
|
2209
2211
|
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
2210
|
-
return /* @__PURE__ */ (0,
|
|
2211
|
-
/* @__PURE__ */ (0,
|
|
2212
|
-
|
|
2212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getMargin(margin), children: [
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2214
|
+
import_components36.Input,
|
|
2213
2215
|
{
|
|
2214
2216
|
id,
|
|
2215
2217
|
name: id,
|
|
@@ -2225,7 +2227,7 @@ function BlockSearchRendererComponent({
|
|
|
2225
2227
|
}
|
|
2226
2228
|
}
|
|
2227
2229
|
) }),
|
|
2228
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2230
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SearchResultContent, { state, trackEvent })
|
|
2229
2231
|
] });
|
|
2230
2232
|
}
|
|
2231
2233
|
function SearchResultContent({
|
|
@@ -2234,27 +2236,27 @@ function SearchResultContent({
|
|
|
2234
2236
|
}) {
|
|
2235
2237
|
switch (state.type) {
|
|
2236
2238
|
case "error":
|
|
2237
|
-
return /* @__PURE__ */ (0,
|
|
2239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorResult, { state });
|
|
2238
2240
|
case "results":
|
|
2239
|
-
return /* @__PURE__ */ (0,
|
|
2241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SearchResults, { state, trackEvent });
|
|
2240
2242
|
case "noResults":
|
|
2241
|
-
return /* @__PURE__ */ (0,
|
|
2243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(EmptySearchResult, { state });
|
|
2242
2244
|
case "pending":
|
|
2243
2245
|
default:
|
|
2244
2246
|
return null;
|
|
2245
2247
|
}
|
|
2246
2248
|
}
|
|
2247
2249
|
function EmptySearchResult({ state }) {
|
|
2248
|
-
return /* @__PURE__ */ (0,
|
|
2250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components36.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2249
2251
|
}
|
|
2250
2252
|
function SearchResults({
|
|
2251
2253
|
state,
|
|
2252
2254
|
trackEvent
|
|
2253
2255
|
}) {
|
|
2254
|
-
return /* @__PURE__ */ (0,
|
|
2256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components36.NavigationOptionsList, { children: state.results.map((result) => {
|
|
2255
2257
|
const { media } = result;
|
|
2256
|
-
return /* @__PURE__ */ (0,
|
|
2257
|
-
|
|
2258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2259
|
+
import_components36.NavigationOption,
|
|
2258
2260
|
{
|
|
2259
2261
|
title: result.title,
|
|
2260
2262
|
content: result.description,
|
|
@@ -2275,11 +2277,11 @@ function SearchResults({
|
|
|
2275
2277
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
2276
2278
|
|
|
2277
2279
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2278
|
-
var
|
|
2280
|
+
var import_components37 = require("@transferwise/components");
|
|
2279
2281
|
var import_icons2 = require("@transferwise/icons");
|
|
2280
2282
|
var import_react13 = require("react");
|
|
2281
2283
|
var import_react_intl20 = require("react-intl");
|
|
2282
|
-
var
|
|
2284
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2283
2285
|
function InlineSearchRenderer({
|
|
2284
2286
|
id,
|
|
2285
2287
|
isLoading,
|
|
@@ -2291,18 +2293,18 @@ function InlineSearchRenderer({
|
|
|
2291
2293
|
}) {
|
|
2292
2294
|
const [hasSearched, setHasSearched] = (0, import_react13.useState)(false);
|
|
2293
2295
|
const intl = (0, import_react_intl20.useIntl)();
|
|
2294
|
-
return /* @__PURE__ */ (0,
|
|
2295
|
-
|
|
2296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
2297
|
+
import_components37.Typeahead,
|
|
2296
2298
|
{
|
|
2297
2299
|
id: "typeahead-input-id",
|
|
2298
2300
|
intl,
|
|
2299
2301
|
name: "typeahead-input-name",
|
|
2300
2302
|
size: "md",
|
|
2301
2303
|
maxHeight: 100,
|
|
2302
|
-
footer: /* @__PURE__ */ (0,
|
|
2304
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2303
2305
|
multiple: false,
|
|
2304
2306
|
clearable: false,
|
|
2305
|
-
addon: /* @__PURE__ */ (0,
|
|
2307
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_icons2.Search, { size: 24 }),
|
|
2306
2308
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2307
2309
|
minQueryLength: 1,
|
|
2308
2310
|
onChange: (values) => {
|
|
@@ -2339,34 +2341,57 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2339
2341
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2340
2342
|
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
2341
2343
|
if (state.type === "noResults") {
|
|
2342
|
-
return /* @__PURE__ */ (0,
|
|
2344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components37.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2343
2345
|
}
|
|
2344
2346
|
if (state.type === "error") {
|
|
2345
|
-
return /* @__PURE__ */ (0,
|
|
2347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorResult, { state }) });
|
|
2346
2348
|
}
|
|
2347
2349
|
if (state.type === "pending" || isLoading) {
|
|
2348
|
-
return /* @__PURE__ */ (0,
|
|
2350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2349
2351
|
}
|
|
2350
2352
|
return null;
|
|
2351
2353
|
}
|
|
2352
2354
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2353
2355
|
|
|
2354
2356
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2355
|
-
var
|
|
2357
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2356
2358
|
var SearchRenderer = {
|
|
2357
2359
|
canRenderType: "search",
|
|
2358
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2360
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2359
2361
|
};
|
|
2360
2362
|
var SearchRenderer_default = SearchRenderer;
|
|
2361
2363
|
|
|
2362
2364
|
// ../renderers/src/SectionRenderer.tsx
|
|
2363
|
-
var
|
|
2364
|
-
|
|
2365
|
+
var import_components38 = require("@transferwise/components");
|
|
2366
|
+
|
|
2367
|
+
// ../renderers/src/utils/getHeaderAction.tsx
|
|
2368
|
+
var getHeaderAction2 = (callToAction) => {
|
|
2369
|
+
if (!callToAction) {
|
|
2370
|
+
return void 0;
|
|
2371
|
+
}
|
|
2372
|
+
const { accessibilityDescription, href, title, onClick } = callToAction;
|
|
2373
|
+
return href ? {
|
|
2374
|
+
"aria-label": accessibilityDescription,
|
|
2375
|
+
text: title,
|
|
2376
|
+
href,
|
|
2377
|
+
target: "_blank"
|
|
2378
|
+
} : {
|
|
2379
|
+
"aria-label": accessibilityDescription,
|
|
2380
|
+
text: title,
|
|
2381
|
+
onClick: (event) => {
|
|
2382
|
+
event.preventDefault();
|
|
2383
|
+
onClick();
|
|
2384
|
+
}
|
|
2385
|
+
};
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2388
|
+
// ../renderers/src/SectionRenderer.tsx
|
|
2389
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2365
2390
|
var SectionRenderer = {
|
|
2366
2391
|
canRenderType: "section",
|
|
2367
2392
|
render: ({ children, callToAction, margin, title }) => {
|
|
2368
|
-
return /* @__PURE__ */ (0,
|
|
2369
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
2393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("section", { className: getMargin(margin), children: [
|
|
2394
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components38.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
2370
2395
|
children
|
|
2371
2396
|
] });
|
|
2372
2397
|
}
|
|
@@ -2374,8 +2399,8 @@ var SectionRenderer = {
|
|
|
2374
2399
|
var SectionRenderer_default = SectionRenderer;
|
|
2375
2400
|
|
|
2376
2401
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2377
|
-
var
|
|
2378
|
-
var
|
|
2402
|
+
var import_components39 = require("@transferwise/components");
|
|
2403
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2379
2404
|
function RadioInputRendererComponent(props) {
|
|
2380
2405
|
const {
|
|
2381
2406
|
id,
|
|
@@ -2389,8 +2414,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2389
2414
|
validationState,
|
|
2390
2415
|
onSelect
|
|
2391
2416
|
} = props;
|
|
2392
|
-
return /* @__PURE__ */ (0,
|
|
2393
|
-
/* @__PURE__ */ (0,
|
|
2417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2394
2419
|
FieldInput_default,
|
|
2395
2420
|
{
|
|
2396
2421
|
id,
|
|
@@ -2398,8 +2423,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2398
2423
|
help,
|
|
2399
2424
|
description,
|
|
2400
2425
|
validation: validationState,
|
|
2401
|
-
children: /* @__PURE__ */ (0,
|
|
2402
|
-
|
|
2426
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2427
|
+
import_components39.RadioGroup,
|
|
2403
2428
|
{
|
|
2404
2429
|
name: id,
|
|
2405
2430
|
radios: options.map((option, index) => ({
|
|
@@ -2407,7 +2432,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2407
2432
|
value: index,
|
|
2408
2433
|
secondary: option.description,
|
|
2409
2434
|
disabled: option.disabled || disabled,
|
|
2410
|
-
avatar: /* @__PURE__ */ (0,
|
|
2435
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2411
2436
|
})),
|
|
2412
2437
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2413
2438
|
onChange: onSelect
|
|
@@ -2421,9 +2446,9 @@ function RadioInputRendererComponent(props) {
|
|
|
2421
2446
|
}
|
|
2422
2447
|
|
|
2423
2448
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2424
|
-
var
|
|
2449
|
+
var import_components40 = require("@transferwise/components");
|
|
2425
2450
|
var import_react14 = require("react");
|
|
2426
|
-
var
|
|
2451
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2427
2452
|
function TabInputRendererComponent(props) {
|
|
2428
2453
|
const {
|
|
2429
2454
|
id,
|
|
@@ -2442,8 +2467,8 @@ function TabInputRendererComponent(props) {
|
|
|
2442
2467
|
onSelect(0);
|
|
2443
2468
|
}
|
|
2444
2469
|
}, [selectedIndex, onSelect, options.length]);
|
|
2445
|
-
return /* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2447
2472
|
FieldInput_default,
|
|
2448
2473
|
{
|
|
2449
2474
|
id,
|
|
@@ -2451,8 +2476,8 @@ function TabInputRendererComponent(props) {
|
|
|
2451
2476
|
help,
|
|
2452
2477
|
description,
|
|
2453
2478
|
validation: validationState,
|
|
2454
|
-
children: /* @__PURE__ */ (0,
|
|
2455
|
-
|
|
2479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2480
|
+
import_components40.Tabs,
|
|
2456
2481
|
{
|
|
2457
2482
|
name: id,
|
|
2458
2483
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -2460,7 +2485,7 @@ function TabInputRendererComponent(props) {
|
|
|
2460
2485
|
title: option.title,
|
|
2461
2486
|
// if we pass null, we get some props-types console errors
|
|
2462
2487
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2463
|
-
content: /* @__PURE__ */ (0,
|
|
2488
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, {}),
|
|
2464
2489
|
disabled: option.disabled || disabled
|
|
2465
2490
|
})),
|
|
2466
2491
|
onTabSelect: onSelect
|
|
@@ -2474,8 +2499,8 @@ function TabInputRendererComponent(props) {
|
|
|
2474
2499
|
var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
|
|
2475
2500
|
|
|
2476
2501
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2477
|
-
var
|
|
2478
|
-
var
|
|
2502
|
+
var import_components41 = require("@transferwise/components");
|
|
2503
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2479
2504
|
function SelectInputRendererComponent(props) {
|
|
2480
2505
|
const {
|
|
2481
2506
|
id,
|
|
@@ -2515,13 +2540,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2515
2540
|
} : {
|
|
2516
2541
|
title: option.title,
|
|
2517
2542
|
description: option.description,
|
|
2518
|
-
icon: /* @__PURE__ */ (0,
|
|
2543
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2519
2544
|
};
|
|
2520
|
-
return /* @__PURE__ */ (0,
|
|
2545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components41.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2521
2546
|
};
|
|
2522
2547
|
const extraProps = { autoComplete };
|
|
2523
|
-
return /* @__PURE__ */ (0,
|
|
2524
|
-
/* @__PURE__ */ (0,
|
|
2548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
|
|
2549
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2525
2550
|
FieldInput_default,
|
|
2526
2551
|
{
|
|
2527
2552
|
id,
|
|
@@ -2529,8 +2554,8 @@ function SelectInputRendererComponent(props) {
|
|
|
2529
2554
|
help,
|
|
2530
2555
|
description,
|
|
2531
2556
|
validation: validationState,
|
|
2532
|
-
children: /* @__PURE__ */ (0,
|
|
2533
|
-
|
|
2557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2558
|
+
import_components41.SelectInput,
|
|
2534
2559
|
__spreadValues({
|
|
2535
2560
|
name: id,
|
|
2536
2561
|
placeholder,
|
|
@@ -2551,8 +2576,8 @@ function SelectInputRendererComponent(props) {
|
|
|
2551
2576
|
|
|
2552
2577
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2553
2578
|
var import_react15 = require("react");
|
|
2554
|
-
var
|
|
2555
|
-
var
|
|
2579
|
+
var import_components42 = require("@transferwise/components");
|
|
2580
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2556
2581
|
function SegmentedInputRendererComponent(props) {
|
|
2557
2582
|
const {
|
|
2558
2583
|
id,
|
|
@@ -2570,8 +2595,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2570
2595
|
onSelect(0);
|
|
2571
2596
|
}
|
|
2572
2597
|
}, [selectedIndex, onSelect, options.length]);
|
|
2573
|
-
return /* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2575
2600
|
FieldInput_default,
|
|
2576
2601
|
{
|
|
2577
2602
|
id,
|
|
@@ -2579,8 +2604,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2579
2604
|
help,
|
|
2580
2605
|
description,
|
|
2581
2606
|
validation: validationState,
|
|
2582
|
-
children: /* @__PURE__ */ (0,
|
|
2583
|
-
|
|
2607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2608
|
+
import_components42.SegmentedControl,
|
|
2584
2609
|
{
|
|
2585
2610
|
name: `${id}-segmented-control`,
|
|
2586
2611
|
value: String(selectedIndex),
|
|
@@ -2596,44 +2621,44 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2596
2621
|
)
|
|
2597
2622
|
}
|
|
2598
2623
|
),
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: `${id}-children`, children })
|
|
2600
2625
|
] });
|
|
2601
2626
|
}
|
|
2602
2627
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2603
2628
|
|
|
2604
2629
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2605
|
-
var
|
|
2630
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2606
2631
|
var SelectInputRenderer = {
|
|
2607
2632
|
canRenderType: "input-select",
|
|
2608
2633
|
render: (props) => {
|
|
2609
2634
|
switch (props.control) {
|
|
2610
2635
|
case "radio":
|
|
2611
|
-
return /* @__PURE__ */ (0,
|
|
2636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2612
2637
|
case "tab":
|
|
2613
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2638
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2614
2639
|
case "segmented":
|
|
2615
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2640
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2616
2641
|
case "select":
|
|
2617
2642
|
default:
|
|
2618
|
-
return /* @__PURE__ */ (0,
|
|
2643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2619
2644
|
}
|
|
2620
2645
|
}
|
|
2621
2646
|
};
|
|
2622
2647
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
2623
2648
|
|
|
2624
2649
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2625
|
-
var
|
|
2626
|
-
var
|
|
2650
|
+
var import_components43 = require("@transferwise/components");
|
|
2651
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2627
2652
|
var StatusListRenderer = {
|
|
2628
2653
|
canRenderType: "status-list",
|
|
2629
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
2630
|
-
title ? /* @__PURE__ */ (0,
|
|
2631
|
-
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
2632
|
-
|
|
2654
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: getMargin(margin), children: [
|
|
2655
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components43.Header, { title, className: "m-b-2" }) : null,
|
|
2656
|
+
items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2657
|
+
import_components43.Summary,
|
|
2633
2658
|
{
|
|
2634
2659
|
title: itemTitle,
|
|
2635
2660
|
description,
|
|
2636
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
2661
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
2637
2662
|
status: mapStatus(status),
|
|
2638
2663
|
action: getSummaryAction(callToAction)
|
|
2639
2664
|
},
|
|
@@ -2685,32 +2710,32 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
2685
2710
|
};
|
|
2686
2711
|
|
|
2687
2712
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
2688
|
-
var
|
|
2713
|
+
var import_components44 = require("@transferwise/components");
|
|
2689
2714
|
var import_icons3 = require("@transferwise/icons");
|
|
2690
|
-
var
|
|
2715
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2691
2716
|
function BackButton({ title, onClick }) {
|
|
2692
|
-
return /* @__PURE__ */ (0,
|
|
2693
|
-
/* @__PURE__ */ (0,
|
|
2694
|
-
/* @__PURE__ */ (0,
|
|
2717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_components44.IconButton, { priority: "tertiary", onClick, children: [
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "sr-only", children: title }),
|
|
2719
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons3.ArrowLeft, {})
|
|
2695
2720
|
] });
|
|
2696
2721
|
}
|
|
2697
2722
|
|
|
2698
2723
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
2699
|
-
var
|
|
2700
|
-
var
|
|
2724
|
+
var import_components45 = require("@transferwise/components");
|
|
2725
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2701
2726
|
var Toolbar = ({ items }) => {
|
|
2702
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
2727
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
2703
2728
|
};
|
|
2704
2729
|
function ToolbarButton(props) {
|
|
2705
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
2730
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
2706
2731
|
}
|
|
2707
2732
|
function MediaToolbarButton(props) {
|
|
2708
2733
|
var _a;
|
|
2709
2734
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
2710
2735
|
const priority = getIconButtonPriority(control);
|
|
2711
2736
|
const type = getSentiment(context);
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2713
|
-
|
|
2737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
2738
|
+
import_components45.IconButton,
|
|
2714
2739
|
{
|
|
2715
2740
|
className: "df-toolbar-button",
|
|
2716
2741
|
disabled,
|
|
@@ -2719,7 +2744,7 @@ function MediaToolbarButton(props) {
|
|
|
2719
2744
|
type,
|
|
2720
2745
|
onClick,
|
|
2721
2746
|
children: [
|
|
2722
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
2747
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
2723
2748
|
media ? (_a = getAddonStart(media)) == null ? void 0 : _a.value : null
|
|
2724
2749
|
]
|
|
2725
2750
|
}
|
|
@@ -2728,10 +2753,10 @@ function MediaToolbarButton(props) {
|
|
|
2728
2753
|
function TextToolbarButton(props) {
|
|
2729
2754
|
const { context, control, title, media, disabled, onClick } = props;
|
|
2730
2755
|
const addonStart = media ? getAddonStart(media) : void 0;
|
|
2731
|
-
const priority =
|
|
2756
|
+
const priority = getPriority2(control);
|
|
2732
2757
|
const sentiment = getSentiment(context);
|
|
2733
|
-
return /* @__PURE__ */ (0,
|
|
2734
|
-
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2759
|
+
import_components45.Button,
|
|
2735
2760
|
{
|
|
2736
2761
|
v2: true,
|
|
2737
2762
|
size: "sm",
|
|
@@ -2759,7 +2784,7 @@ var getAddonStart = (media) => {
|
|
|
2759
2784
|
return void 0;
|
|
2760
2785
|
}
|
|
2761
2786
|
};
|
|
2762
|
-
var
|
|
2787
|
+
var getPriority2 = (control) => isKnownControl(control) ? control : "secondary";
|
|
2763
2788
|
var prefersMedia = (control) => {
|
|
2764
2789
|
return false;
|
|
2765
2790
|
};
|
|
@@ -2769,21 +2794,21 @@ var getSentiment = (context) => {
|
|
|
2769
2794
|
return "default";
|
|
2770
2795
|
};
|
|
2771
2796
|
var getIconButtonPriority = (control) => {
|
|
2772
|
-
const priority =
|
|
2797
|
+
const priority = getPriority2(control);
|
|
2773
2798
|
return priority === "secondary-neutral" ? "tertiary" : priority;
|
|
2774
2799
|
};
|
|
2775
2800
|
|
|
2776
2801
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
2777
|
-
var
|
|
2802
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2778
2803
|
function TopBar({ back, toolbar }) {
|
|
2779
|
-
return back || toolbar ? /* @__PURE__ */ (0,
|
|
2780
|
-
back ? /* @__PURE__ */ (0,
|
|
2781
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
2804
|
+
return back || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
2805
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BackButton, __spreadValues({}, back)) : null,
|
|
2806
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
2782
2807
|
] }) : null;
|
|
2783
2808
|
}
|
|
2784
2809
|
|
|
2785
2810
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
2786
|
-
var
|
|
2811
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2787
2812
|
var SplashCelebrationStepRenderer = {
|
|
2788
2813
|
canRenderType: "step",
|
|
2789
2814
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -2792,14 +2817,14 @@ var SplashCelebrationStepRenderer = {
|
|
|
2792
2817
|
function SplashCelebrationStepRendererComponent(props) {
|
|
2793
2818
|
const { back, toolbar, children, trackEvent } = props;
|
|
2794
2819
|
useCustomTheme("forest-green", trackEvent);
|
|
2795
|
-
return /* @__PURE__ */ (0,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TopBar, { back, toolbar }),
|
|
2797
2822
|
children
|
|
2798
2823
|
] });
|
|
2799
2824
|
}
|
|
2800
2825
|
|
|
2801
2826
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
2802
|
-
var
|
|
2827
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2803
2828
|
var SplashStepRenderer = {
|
|
2804
2829
|
canRenderType: "step",
|
|
2805
2830
|
canRender: ({ control }) => control === "splash",
|
|
@@ -2807,63 +2832,63 @@ var SplashStepRenderer = {
|
|
|
2807
2832
|
};
|
|
2808
2833
|
function SplashStepRendererComponent(props) {
|
|
2809
2834
|
const { back, toolbar, children } = props;
|
|
2810
|
-
return /* @__PURE__ */ (0,
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(TopBar, { back, toolbar }),
|
|
2812
2837
|
children
|
|
2813
2838
|
] });
|
|
2814
2839
|
}
|
|
2815
2840
|
|
|
2816
2841
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2817
|
-
var
|
|
2818
|
-
var
|
|
2842
|
+
var import_components46 = require("@transferwise/components");
|
|
2843
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2819
2844
|
var StepRenderer = {
|
|
2820
2845
|
canRenderType: "step",
|
|
2821
2846
|
render: StepRendererComponent
|
|
2822
2847
|
};
|
|
2823
2848
|
function StepRendererComponent(props) {
|
|
2824
2849
|
const { back, description, error, title, children, toolbar } = props;
|
|
2825
|
-
return /* @__PURE__ */ (0,
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
2827
|
-
title || description ? /* @__PURE__ */ (0,
|
|
2828
|
-
title ? /* @__PURE__ */ (0,
|
|
2829
|
-
description ? /* @__PURE__ */ (0,
|
|
2850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TopBar, { back, toolbar }),
|
|
2852
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "m-b-4", children: [
|
|
2853
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components46.Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2854
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
|
|
2830
2855
|
] }) : void 0,
|
|
2831
|
-
error ? /* @__PURE__ */ (0,
|
|
2856
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components46.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2832
2857
|
children
|
|
2833
2858
|
] });
|
|
2834
2859
|
}
|
|
2835
2860
|
|
|
2836
2861
|
// ../renderers/src/TabsRenderer.tsx
|
|
2837
|
-
var
|
|
2862
|
+
var import_components47 = require("@transferwise/components");
|
|
2838
2863
|
var import_react17 = require("react");
|
|
2839
|
-
var
|
|
2864
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2840
2865
|
var TabsRenderer = {
|
|
2841
2866
|
canRenderType: "tabs",
|
|
2842
2867
|
render: (props) => {
|
|
2843
2868
|
switch (props.control) {
|
|
2844
2869
|
case "segmented":
|
|
2845
2870
|
if (props.tabs.length > 3) {
|
|
2846
|
-
return /* @__PURE__ */ (0,
|
|
2871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
2847
2872
|
}
|
|
2848
|
-
return /* @__PURE__ */ (0,
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
2849
2874
|
case "chips":
|
|
2850
|
-
return /* @__PURE__ */ (0,
|
|
2875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
2851
2876
|
default:
|
|
2852
|
-
return /* @__PURE__ */ (0,
|
|
2877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
2853
2878
|
}
|
|
2854
2879
|
}
|
|
2855
2880
|
};
|
|
2856
2881
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
2857
2882
|
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
2858
|
-
return /* @__PURE__ */ (0,
|
|
2859
|
-
|
|
2883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2884
|
+
import_components47.Tabs,
|
|
2860
2885
|
{
|
|
2861
2886
|
name: uid,
|
|
2862
2887
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
2863
2888
|
tabs: tabs.map((option) => ({
|
|
2864
2889
|
title: option.title,
|
|
2865
2890
|
disabled: false,
|
|
2866
|
-
content: /* @__PURE__ */ (0,
|
|
2891
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "m-t-2", children: [
|
|
2867
2892
|
" ",
|
|
2868
2893
|
option.children,
|
|
2869
2894
|
" "
|
|
@@ -2876,9 +2901,9 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2876
2901
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
2877
2902
|
var _a;
|
|
2878
2903
|
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
2879
|
-
return /* @__PURE__ */ (0,
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
2881
|
-
|
|
2904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: getMargin(margin), children: [
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2906
|
+
import_components47.SegmentedControl,
|
|
2882
2907
|
{
|
|
2883
2908
|
name: uid,
|
|
2884
2909
|
value: String(selectedIndex),
|
|
@@ -2892,31 +2917,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2892
2917
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
2893
2918
|
}
|
|
2894
2919
|
),
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2920
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
2896
2921
|
] });
|
|
2897
2922
|
}
|
|
2898
2923
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
2899
2924
|
var _a;
|
|
2900
2925
|
const [selectedIndex, setSelectedIndex] = (0, import_react17.useState)(0);
|
|
2901
|
-
return /* @__PURE__ */ (0,
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
|
|
2926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: getMargin(margin), children: [
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2928
|
+
import_components47.Chips,
|
|
2904
2929
|
{
|
|
2905
2930
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
2906
2931
|
selected: selectedIndex,
|
|
2907
2932
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
2908
2933
|
}
|
|
2909
2934
|
) }),
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
2935
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
2911
2936
|
] });
|
|
2912
2937
|
}
|
|
2913
2938
|
|
|
2914
2939
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2915
|
-
var
|
|
2940
|
+
var import_components49 = require("@transferwise/components");
|
|
2916
2941
|
|
|
2917
2942
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2918
|
-
var
|
|
2919
|
-
var
|
|
2943
|
+
var import_components48 = require("@transferwise/components");
|
|
2944
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2920
2945
|
var commonKeys = [
|
|
2921
2946
|
"autoComplete",
|
|
2922
2947
|
"autoCapitalize",
|
|
@@ -2935,12 +2960,12 @@ function VariableTextInput(inputProps) {
|
|
|
2935
2960
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
2936
2961
|
switch (control) {
|
|
2937
2962
|
case "email":
|
|
2938
|
-
return /* @__PURE__ */ (0,
|
|
2963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
2939
2964
|
case "password":
|
|
2940
|
-
return /* @__PURE__ */ (0,
|
|
2965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
2941
2966
|
case "numeric": {
|
|
2942
2967
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
2943
|
-
return /* @__PURE__ */ (0,
|
|
2968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2944
2969
|
TextInput,
|
|
2945
2970
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
2946
2971
|
onChange: (newValue) => {
|
|
@@ -2951,21 +2976,21 @@ function VariableTextInput(inputProps) {
|
|
|
2951
2976
|
);
|
|
2952
2977
|
}
|
|
2953
2978
|
case "phone-number":
|
|
2954
|
-
return /* @__PURE__ */ (0,
|
|
2979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components48.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
2955
2980
|
default: {
|
|
2956
|
-
return /* @__PURE__ */ (0,
|
|
2981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
2957
2982
|
}
|
|
2958
2983
|
}
|
|
2959
2984
|
}
|
|
2960
2985
|
function TextInput(props) {
|
|
2961
2986
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
2962
|
-
const InputWithPattern = control === "textarea" ?
|
|
2963
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
2964
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
2987
|
+
const InputWithPattern = control === "textarea" ? import_components48.TextareaWithDisplayFormat : import_components48.InputWithDisplayFormat;
|
|
2988
|
+
const InputWithoutPattern = control === "textarea" ? import_components48.TextArea : import_components48.Input;
|
|
2989
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
2965
2990
|
}
|
|
2966
2991
|
|
|
2967
2992
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2968
|
-
var
|
|
2993
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
2969
2994
|
var TextInputRenderer = {
|
|
2970
2995
|
canRenderType: "input-text",
|
|
2971
2996
|
render: (props) => {
|
|
@@ -2998,7 +3023,7 @@ var TextInputRenderer = {
|
|
|
2998
3023
|
}
|
|
2999
3024
|
}
|
|
3000
3025
|
});
|
|
3001
|
-
return /* @__PURE__ */ (0,
|
|
3026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3002
3027
|
FieldInput_default,
|
|
3003
3028
|
{
|
|
3004
3029
|
id,
|
|
@@ -3006,7 +3031,7 @@ var TextInputRenderer = {
|
|
|
3006
3031
|
description,
|
|
3007
3032
|
validation: validationState,
|
|
3008
3033
|
help,
|
|
3009
|
-
children: /* @__PURE__ */ (0,
|
|
3034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components49.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3010
3035
|
}
|
|
3011
3036
|
);
|
|
3012
3037
|
}
|
|
@@ -3014,13 +3039,13 @@ var TextInputRenderer = {
|
|
|
3014
3039
|
var TextInputRenderer_default = TextInputRenderer;
|
|
3015
3040
|
|
|
3016
3041
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3017
|
-
var
|
|
3042
|
+
var import_components50 = require("@transferwise/components");
|
|
3018
3043
|
|
|
3019
3044
|
// ../renderers/src/utils/getRandomId.ts
|
|
3020
3045
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3021
3046
|
|
|
3022
3047
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3023
|
-
var
|
|
3048
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3024
3049
|
var UploadInputRenderer = {
|
|
3025
3050
|
canRenderType: "input-upload",
|
|
3026
3051
|
render: (props) => {
|
|
@@ -3036,15 +3061,15 @@ var UploadInputRenderer = {
|
|
|
3036
3061
|
};
|
|
3037
3062
|
return (
|
|
3038
3063
|
// We don't pass help here as there is no sensible place to display it
|
|
3039
|
-
/* @__PURE__ */ (0,
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3040
3065
|
UploadFieldInput_default,
|
|
3041
3066
|
{
|
|
3042
3067
|
id,
|
|
3043
3068
|
label: void 0,
|
|
3044
3069
|
description: void 0,
|
|
3045
3070
|
validation: validationState,
|
|
3046
|
-
children: /* @__PURE__ */ (0,
|
|
3047
|
-
|
|
3071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3072
|
+
import_components50.UploadInput,
|
|
3048
3073
|
{
|
|
3049
3074
|
id,
|
|
3050
3075
|
description,
|
|
@@ -3102,7 +3127,7 @@ var LargeUploadRenderer = {
|
|
|
3102
3127
|
};
|
|
3103
3128
|
const filetypes = acceptsToFileTypes(accepts);
|
|
3104
3129
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3105
|
-
return /* @__PURE__ */ (0,
|
|
3130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3106
3131
|
FieldInput_default,
|
|
3107
3132
|
{
|
|
3108
3133
|
id,
|
|
@@ -3110,8 +3135,8 @@ var LargeUploadRenderer = {
|
|
|
3110
3135
|
description,
|
|
3111
3136
|
validation: validationState,
|
|
3112
3137
|
help,
|
|
3113
|
-
children: /* @__PURE__ */ (0,
|
|
3114
|
-
|
|
3138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3139
|
+
import_components50.Upload,
|
|
3115
3140
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3116
3141
|
usAccept,
|
|
3117
3142
|
usDisabled: disabled,
|
|
@@ -3131,7 +3156,7 @@ var getWiseRenderers = () => [
|
|
|
3131
3156
|
AlertRenderer_default,
|
|
3132
3157
|
CheckboxInputRenderer_default,
|
|
3133
3158
|
BoxRenderer_default,
|
|
3134
|
-
|
|
3159
|
+
ButtonRenderer,
|
|
3135
3160
|
ColumnsRenderer_default,
|
|
3136
3161
|
DateInputRenderer_default,
|
|
3137
3162
|
DecisionRenderer_default,
|
|
@@ -3167,19 +3192,13 @@ var getWiseRenderers = () => [
|
|
|
3167
3192
|
StepRenderer
|
|
3168
3193
|
];
|
|
3169
3194
|
|
|
3170
|
-
// src/
|
|
3171
|
-
var
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
function createRendererWithExtensions(type, options) {
|
|
3175
|
-
const baseRenderer = RENDERER_REGISTRY[type];
|
|
3176
|
-
const { extensions = {}, canRender, canRenderType } = options;
|
|
3177
|
-
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, baseRenderer), canRenderType ? { canRenderType } : {}), canRender ? { canRender } : {}), {
|
|
3178
|
-
extensions: __spreadValues(__spreadValues({}, baseRenderer.extensions), extensions)
|
|
3179
|
-
});
|
|
3180
|
-
}
|
|
3195
|
+
// ../renderers/src/ButtonRenderer/ButtonRendererV2.tsx
|
|
3196
|
+
var import_components51 = require("@transferwise/components");
|
|
3197
|
+
var import_react18 = require("react");
|
|
3198
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3181
3199
|
|
|
3182
3200
|
// src/index.ts
|
|
3201
|
+
var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
|
|
3183
3202
|
var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
3184
3203
|
|
|
3185
3204
|
// src/i18n/index.ts
|
|
@@ -3207,7 +3226,7 @@ var cs_default = {
|
|
|
3207
3226
|
"df.wise.CopyFeedback.copy": "Zkop\xEDrov\xE1no do schr\xE1nky",
|
|
3208
3227
|
"df.wise.CopyFeedback.copyFailed": "Kop\xEDrov\xE1n\xED do schr\xE1nky se nezda\u0159ilo",
|
|
3209
3228
|
"df.wise.Decision.all": "V\u0161e",
|
|
3210
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3229
|
+
"df.wise.Decision.filterPlaceholder": "Pro vyhled\xE1v\xE1n\xED za\u010Dn\u011Bte ps\xE1t",
|
|
3211
3230
|
"df.wise.Decision.noResults": "\u017D\xE1dn\xE9 v\xFDsledky",
|
|
3212
3231
|
"df.wise.Decision.popular": "Popul\xE1rn\xED",
|
|
3213
3232
|
"df.wise.Decision.recent": "Ned\xE1vn\xE9",
|
|
@@ -3383,7 +3402,7 @@ var fr_default = {
|
|
|
3383
3402
|
"df.wise.CopyFeedback.copy": "Copi\xE9 dans le presse-papier",
|
|
3384
3403
|
"df.wise.CopyFeedback.copyFailed": "Impossible de copier dans le presse-papier",
|
|
3385
3404
|
"df.wise.Decision.all": "Toutes",
|
|
3386
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3405
|
+
"df.wise.Decision.filterPlaceholder": "Commencez \xE0 \xE9crire pour effectuer une recherche",
|
|
3387
3406
|
"df.wise.Decision.noResults": "Aucun r\xE9sultat",
|
|
3388
3407
|
"df.wise.Decision.popular": "Populaires",
|
|
3389
3408
|
"df.wise.Decision.recent": "R\xE9cents",
|
|
@@ -3427,7 +3446,7 @@ var hu_default = {
|
|
|
3427
3446
|
"df.wise.CopyFeedback.copy": "V\xE1g\xF3lapra m\xE1solva",
|
|
3428
3447
|
"df.wise.CopyFeedback.copyFailed": "Nem siker\xFClt a v\xE1g\xF3lapra m\xE1solni",
|
|
3429
3448
|
"df.wise.Decision.all": "\xD6sszes",
|
|
3430
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3449
|
+
"df.wise.Decision.filterPlaceholder": "Kezdj el g\xE9pelni a keres\xE9shez",
|
|
3431
3450
|
"df.wise.Decision.noResults": "Nincs tal\xE1lat",
|
|
3432
3451
|
"df.wise.Decision.popular": "N\xE9pszer\u0171",
|
|
3433
3452
|
"df.wise.Decision.recent": "Legut\xF3bbi",
|
|
@@ -3457,7 +3476,7 @@ var id_default = {
|
|
|
3457
3476
|
"df.wise.ArraySchema.maxItemsError": "Harap tambahkan {maxItems} atau kurang.",
|
|
3458
3477
|
"df.wise.ArraySchema.minItemsError": "Harap tambahkan setidaknya {minItems}.",
|
|
3459
3478
|
"df.wise.ArraySchema.removeItem": "Hapus",
|
|
3460
|
-
"df.wise.ButtonLayout.buttonLoadingMessage": "
|
|
3479
|
+
"df.wise.ButtonLayout.buttonLoadingMessage": "Ini mungkin memakan waktu beberapa detik",
|
|
3461
3480
|
"df.wise.ControlFeedback.maxLength": "Harap masukkan {maxLength} karakter atau kurang.",
|
|
3462
3481
|
"df.wise.ControlFeedback.maximum": "Harap masukkan angka paling besar {maximum} atau kurang dari itu.",
|
|
3463
3482
|
"df.wise.ControlFeedback.maximumDate": "Harap masukkan tanggal pada atau sebelum {maximum}.",
|
|
@@ -3471,7 +3490,7 @@ var id_default = {
|
|
|
3471
3490
|
"df.wise.CopyFeedback.copy": "Disalin ke clipboard",
|
|
3472
3491
|
"df.wise.CopyFeedback.copyFailed": "Gagal menyalin ke clipboard",
|
|
3473
3492
|
"df.wise.Decision.all": "Semua",
|
|
3474
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3493
|
+
"df.wise.Decision.filterPlaceholder": "Mulai mengetik untuk mencari",
|
|
3475
3494
|
"df.wise.Decision.noResults": "Tidak ada hasil",
|
|
3476
3495
|
"df.wise.Decision.popular": "Populer",
|
|
3477
3496
|
"df.wise.Decision.recent": "Terbaru",
|
|
@@ -3515,7 +3534,7 @@ var it_default = {
|
|
|
3515
3534
|
"df.wise.CopyFeedback.copy": "Copiato negli appunti",
|
|
3516
3535
|
"df.wise.CopyFeedback.copyFailed": "Impossibile copiare negli appunti",
|
|
3517
3536
|
"df.wise.Decision.all": "Tutte",
|
|
3518
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3537
|
+
"df.wise.Decision.filterPlaceholder": "Inizia a digitare per cercare",
|
|
3519
3538
|
"df.wise.Decision.noResults": "Nessun risultato",
|
|
3520
3539
|
"df.wise.Decision.popular": "Popolari",
|
|
3521
3540
|
"df.wise.Decision.recent": "Recenti",
|
|
@@ -3589,7 +3608,7 @@ var nl_default = {
|
|
|
3589
3608
|
"df.wise.ArraySchema.maxItemsError": "Voeg {maxItems} of minder toe.",
|
|
3590
3609
|
"df.wise.ArraySchema.minItemsError": "Voeg minimaal {minItems} toe.",
|
|
3591
3610
|
"df.wise.ArraySchema.removeItem": "Verwijderen",
|
|
3592
|
-
"df.wise.ButtonLayout.buttonLoadingMessage": "
|
|
3611
|
+
"df.wise.ButtonLayout.buttonLoadingMessage": "Dit kan enkele seconden duren",
|
|
3593
3612
|
"df.wise.ControlFeedback.maxLength": "Voer {maxLength} of minder tekens in.",
|
|
3594
3613
|
"df.wise.ControlFeedback.maximum": "Voer een getal in dat {maximum} of lager is.",
|
|
3595
3614
|
"df.wise.ControlFeedback.maximumDate": "Voer een datum in die op of voor {maximum} is.",
|
|
@@ -3603,7 +3622,7 @@ var nl_default = {
|
|
|
3603
3622
|
"df.wise.CopyFeedback.copy": "Naar klembord gekopieerd",
|
|
3604
3623
|
"df.wise.CopyFeedback.copyFailed": "Naar klembord kopi\xEBren mislukt",
|
|
3605
3624
|
"df.wise.Decision.all": "Alles",
|
|
3606
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3625
|
+
"df.wise.Decision.filterPlaceholder": "Begin met typen om te zoeken",
|
|
3607
3626
|
"df.wise.Decision.noResults": "Niks gevonden",
|
|
3608
3627
|
"df.wise.Decision.popular": "Populair",
|
|
3609
3628
|
"df.wise.Decision.recent": "Recent",
|
|
@@ -3955,7 +3974,7 @@ var zh_HK_default = {
|
|
|
3955
3974
|
"df.wise.CopyFeedback.copy": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
|
|
3956
3975
|
"df.wise.CopyFeedback.copyFailed": "\u7121\u6CD5\u8907\u88FD\u5230\u526A\u8CBC\u677F",
|
|
3957
3976
|
"df.wise.Decision.all": "\u5168\u90E8",
|
|
3958
|
-
"df.wise.Decision.filterPlaceholder": "
|
|
3977
|
+
"df.wise.Decision.filterPlaceholder": "\u958B\u59CB\u8F38\u5165\u4EE5\u641C\u5C0B",
|
|
3959
3978
|
"df.wise.Decision.noResults": "\u6C92\u6709\u7D50\u679C",
|
|
3960
3979
|
"df.wise.Decision.popular": "\u71B1\u9580",
|
|
3961
3980
|
"df.wise.Decision.recent": "\u6700\u8FD1\u7684",
|
|
@@ -4009,14 +4028,14 @@ var translations = languages.reduce(
|
|
|
4009
4028
|
var i18n_default = translations;
|
|
4010
4029
|
|
|
4011
4030
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4012
|
-
var
|
|
4031
|
+
var import_react19 = require("react");
|
|
4013
4032
|
var import_react_intl22 = require("react-intl");
|
|
4014
4033
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
4015
4034
|
|
|
4016
4035
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
4017
4036
|
var appVersion = (
|
|
4018
4037
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
4019
|
-
typeof process !== "undefined" ? "4.
|
|
4038
|
+
typeof process !== "undefined" ? "4.24.0" : "0.0.0"
|
|
4020
4039
|
);
|
|
4021
4040
|
|
|
4022
4041
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -4071,12 +4090,12 @@ var messages_default = (0, import_react_intl21.defineMessages)({
|
|
|
4071
4090
|
});
|
|
4072
4091
|
|
|
4073
4092
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
4074
|
-
var
|
|
4093
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
4075
4094
|
var wiseRenderers = getWiseRenderers();
|
|
4076
4095
|
function DynamicFlowLegacy(props) {
|
|
4077
4096
|
const { customFetch = globalThis.fetch } = props;
|
|
4078
4097
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
4079
|
-
return /* @__PURE__ */ (0,
|
|
4098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
4080
4099
|
}
|
|
4081
4100
|
function DynamicFlowRevamp(props) {
|
|
4082
4101
|
const {
|
|
@@ -4092,9 +4111,9 @@ function DynamicFlowRevamp(props) {
|
|
|
4092
4111
|
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
4093
4112
|
const createSnackBar = useSnackBarIfAvailable();
|
|
4094
4113
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4095
|
-
const mergedRenderers = (0,
|
|
4096
|
-
const logEvent = (0,
|
|
4097
|
-
const trackEvent = (0,
|
|
4114
|
+
const mergedRenderers = (0, import_react19.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
4115
|
+
const logEvent = (0, import_react19.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4116
|
+
const trackEvent = (0, import_react19.useMemo)(
|
|
4098
4117
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
4099
4118
|
[onEvent, onAnalytics, onThemeChange]
|
|
4100
4119
|
);
|
|
@@ -4113,9 +4132,9 @@ function DynamicFlowRevamp(props) {
|
|
|
4113
4132
|
onLink,
|
|
4114
4133
|
onCopy
|
|
4115
4134
|
});
|
|
4116
|
-
return /* @__PURE__ */ (0,
|
|
4135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
4117
4136
|
}
|
|
4118
|
-
var DynamicForm = (0,
|
|
4137
|
+
var DynamicForm = (0, import_react19.forwardRef)(function DynamicForm2(props, ref) {
|
|
4119
4138
|
const {
|
|
4120
4139
|
className = "",
|
|
4121
4140
|
customFetch = globalThis.fetch,
|
|
@@ -4129,9 +4148,9 @@ var DynamicForm = (0, import_react18.forwardRef)(function DynamicForm2(props, re
|
|
|
4129
4148
|
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
4130
4149
|
const createSnackBar = useSnackBarIfAvailable();
|
|
4131
4150
|
const httpClient = useWiseHttpClient(customFetch);
|
|
4132
|
-
const mergedRenderers = (0,
|
|
4133
|
-
const logEvent = (0,
|
|
4134
|
-
const trackEvent = (0,
|
|
4151
|
+
const mergedRenderers = (0, import_react19.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
4152
|
+
const logEvent = (0, import_react19.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4153
|
+
const trackEvent = (0, import_react19.useMemo)(
|
|
4135
4154
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
4136
4155
|
[onEvent, onAnalytics, onThemeChange]
|
|
4137
4156
|
);
|
|
@@ -4150,11 +4169,11 @@ var DynamicForm = (0, import_react18.forwardRef)(function DynamicForm2(props, re
|
|
|
4150
4169
|
onLink,
|
|
4151
4170
|
onCopy
|
|
4152
4171
|
});
|
|
4153
|
-
return /* @__PURE__ */ (0,
|
|
4172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
4154
4173
|
});
|
|
4155
4174
|
var useWiseHttpClient = (httpClient) => {
|
|
4156
4175
|
const { locale } = (0, import_react_intl22.useIntl)();
|
|
4157
|
-
return (0,
|
|
4176
|
+
return (0, import_react19.useCallback)(
|
|
4158
4177
|
async (input, init = {}) => {
|
|
4159
4178
|
const headers = new Headers(init.headers);
|
|
4160
4179
|
headers.set("accept-language", locale);
|