@wise/dynamic-flow-client-internal 3.14.1 → 3.15.1
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 +427 -370
- package/build/main.min.js +1 -1
- package/build/main.mjs +240 -183
- package/build/types/i18n/index.d.ts +1 -1
- package/package.json +3 -3
package/build/main.js
CHANGED
|
@@ -34,6 +34,9 @@ var __objRest = (source, exclude) => {
|
|
|
34
34
|
}
|
|
35
35
|
return target;
|
|
36
36
|
};
|
|
37
|
+
var __esm = (fn, res) => function __init() {
|
|
38
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
39
|
+
};
|
|
37
40
|
var __commonJS = (cb, mod) => function __require() {
|
|
38
41
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
39
42
|
};
|
|
@@ -120,6 +123,158 @@ var require_classnames = __commonJS({
|
|
|
120
123
|
}
|
|
121
124
|
});
|
|
122
125
|
|
|
126
|
+
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
127
|
+
function r(e) {
|
|
128
|
+
var t, f, n = "";
|
|
129
|
+
if ("string" == typeof e || "number" == typeof e)
|
|
130
|
+
n += e;
|
|
131
|
+
else if ("object" == typeof e)
|
|
132
|
+
if (Array.isArray(e)) {
|
|
133
|
+
var o = e.length;
|
|
134
|
+
for (t = 0; t < o; t++)
|
|
135
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
136
|
+
} else
|
|
137
|
+
for (f in e)
|
|
138
|
+
e[f] && (n && (n += " "), n += f);
|
|
139
|
+
return n;
|
|
140
|
+
}
|
|
141
|
+
function clsx() {
|
|
142
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
|
|
143
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
144
|
+
return n;
|
|
145
|
+
}
|
|
146
|
+
var init_clsx = __esm({
|
|
147
|
+
"../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"() {
|
|
148
|
+
"use strict";
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
|
|
153
|
+
var import_react3, import_jsx_runtime12, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
|
|
154
|
+
var init_index_93a0c34e_esm = __esm({
|
|
155
|
+
"../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
|
|
156
|
+
"use strict";
|
|
157
|
+
init_clsx();
|
|
158
|
+
import_react3 = require("react");
|
|
159
|
+
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
160
|
+
unknownFlagName = "wise";
|
|
161
|
+
Flag = ({
|
|
162
|
+
code,
|
|
163
|
+
intrinsicSize = 64,
|
|
164
|
+
className = void 0
|
|
165
|
+
}) => {
|
|
166
|
+
const [fallback, setFallback] = (0, import_react3.useState)(null);
|
|
167
|
+
(0, import_react3.useEffect)(() => {
|
|
168
|
+
setFallback(null);
|
|
169
|
+
}, [code]);
|
|
170
|
+
const detailed = intrinsicSize >= 150;
|
|
171
|
+
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("img", {
|
|
173
|
+
className: clsx(`wds-flag wds-flag-${name}`, className),
|
|
174
|
+
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
175
|
+
alt: "",
|
|
176
|
+
width: intrinsicSize,
|
|
177
|
+
height: intrinsicSize,
|
|
178
|
+
onError: () => {
|
|
179
|
+
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
(function(Sizes2) {
|
|
184
|
+
Sizes2["SMALL"] = "small";
|
|
185
|
+
Sizes2["MEDIUM"] = "medium";
|
|
186
|
+
Sizes2["LARGE"] = "large";
|
|
187
|
+
})(Sizes || (Sizes = {}));
|
|
188
|
+
ImageSizes = {
|
|
189
|
+
[Sizes.SMALL]: 200,
|
|
190
|
+
[Sizes.MEDIUM]: 300,
|
|
191
|
+
[Sizes.LARGE]: 500
|
|
192
|
+
};
|
|
193
|
+
imageSizes = {
|
|
194
|
+
[Sizes.SMALL]: 200,
|
|
195
|
+
[Sizes.MEDIUM]: 300,
|
|
196
|
+
[Sizes.LARGE]: 500
|
|
197
|
+
};
|
|
198
|
+
(function(Assets2) {
|
|
199
|
+
Assets2["BELL"] = "bell";
|
|
200
|
+
Assets2["BRIEFCASE"] = "briefcase";
|
|
201
|
+
Assets2["BUSINESS_CARD"] = "business-card";
|
|
202
|
+
Assets2["CALENDAR"] = "calendar";
|
|
203
|
+
Assets2["CHECK_MARK"] = "check-mark";
|
|
204
|
+
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
205
|
+
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
206
|
+
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
207
|
+
Assets2["CONFETTI"] = "confetti";
|
|
208
|
+
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
209
|
+
Assets2["CONVERT"] = "convert";
|
|
210
|
+
Assets2["COOKIE"] = "cookie";
|
|
211
|
+
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
212
|
+
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
213
|
+
Assets2["DOCUMENTS"] = "documents";
|
|
214
|
+
Assets2["DOOR"] = "door";
|
|
215
|
+
Assets2["ECO_CARD"] = "eco-card";
|
|
216
|
+
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
217
|
+
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
218
|
+
Assets2["EMAIL"] = "email";
|
|
219
|
+
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
220
|
+
Assets2["FLAG"] = "flag";
|
|
221
|
+
Assets2["FLOWER"] = "flower";
|
|
222
|
+
Assets2["GEAR"] = "gear";
|
|
223
|
+
Assets2["GLOBE"] = "globe";
|
|
224
|
+
Assets2["GRAPH"] = "graph";
|
|
225
|
+
Assets2["HEART_2"] = "heart-2";
|
|
226
|
+
Assets2["HEART_3"] = "heart-3";
|
|
227
|
+
Assets2["HEART_4"] = "heart-4";
|
|
228
|
+
Assets2["HEART_5"] = "heart-5";
|
|
229
|
+
Assets2["HEART"] = "heart";
|
|
230
|
+
Assets2["HOUSE"] = "house";
|
|
231
|
+
Assets2["ID_CARD"] = "id-card";
|
|
232
|
+
Assets2["INFINITE"] = "infinite";
|
|
233
|
+
Assets2["INTEREST"] = "interest";
|
|
234
|
+
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
235
|
+
Assets2["JARS"] = "jars";
|
|
236
|
+
Assets2["KEY"] = "key";
|
|
237
|
+
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
238
|
+
Assets2["LOCK_PLATFORM"] = "lock-platform";
|
|
239
|
+
Assets2["LOCK"] = "lock";
|
|
240
|
+
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
241
|
+
Assets2["MAP"] = "map";
|
|
242
|
+
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
243
|
+
Assets2["MARBLE_CARD"] = "marble-card";
|
|
244
|
+
Assets2["MARBLE"] = "marble";
|
|
245
|
+
Assets2["MEGAPHONE"] = "megaphone";
|
|
246
|
+
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
247
|
+
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
248
|
+
Assets2["PALM_TREE"] = "palm-tree";
|
|
249
|
+
Assets2["PERCENTAGE"] = "percentage";
|
|
250
|
+
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
251
|
+
Assets2["PHONES"] = "phones";
|
|
252
|
+
Assets2["PIE_CHART"] = "pie-chart";
|
|
253
|
+
Assets2["PLANE_2"] = "plane-2";
|
|
254
|
+
Assets2["PLANE"] = "plane";
|
|
255
|
+
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
256
|
+
Assets2["QUESTION_MARK"] = "question-mark";
|
|
257
|
+
Assets2["RECEIVE"] = "receive";
|
|
258
|
+
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
259
|
+
Assets2["SAND_TIMER"] = "sand-timer";
|
|
260
|
+
Assets2["SATELLITE_PLATFORM"] = "satellite-platform";
|
|
261
|
+
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
262
|
+
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
263
|
+
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
264
|
+
Assets2["STOPWATCH_PLATFORM"] = "stopwatch-platform";
|
|
265
|
+
Assets2["TARGET_PLATFORM"] = "target-platform";
|
|
266
|
+
Assets2["TOOL"] = "tool";
|
|
267
|
+
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
268
|
+
Assets2["WALLET"] = "wallet";
|
|
269
|
+
})(Assets || (Assets = {}));
|
|
270
|
+
(function(RenderMode2) {
|
|
271
|
+
RenderMode2[RenderMode2["INIT"] = 0] = "INIT";
|
|
272
|
+
RenderMode2[RenderMode2["FALLBACK"] = 1] = "FALLBACK";
|
|
273
|
+
RenderMode2[RenderMode2["ASSET_3D"] = 2] = "ASSET_3D";
|
|
274
|
+
})(RenderMode || (RenderMode = {}));
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
|
|
123
278
|
// src/index.ts
|
|
124
279
|
var src_exports = {};
|
|
125
280
|
__export(src_exports, {
|
|
@@ -713,7 +868,7 @@ var translations = languages.reduce(
|
|
|
713
868
|
var i18n_default = translations;
|
|
714
869
|
|
|
715
870
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
716
|
-
var
|
|
871
|
+
var import_react16 = require("react");
|
|
717
872
|
var import_react_intl13 = require("react-intl");
|
|
718
873
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
719
874
|
|
|
@@ -1078,124 +1233,26 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
1078
1233
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1079
1234
|
var import_components8 = require("@transferwise/components");
|
|
1080
1235
|
|
|
1081
|
-
// ../../node_modules/.pnpm/@wise+art@2.
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
code,
|
|
1087
|
-
intrinsicSize = 64
|
|
1088
|
-
}) => {
|
|
1089
|
-
const [fallback, setFallback] = (0, import_react3.useState)(null);
|
|
1090
|
-
(0, import_react3.useEffect)(() => {
|
|
1091
|
-
setFallback(null);
|
|
1092
|
-
}, [code]);
|
|
1093
|
-
const detailed = intrinsicSize >= 150;
|
|
1094
|
-
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
1095
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("img", {
|
|
1096
|
-
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
1097
|
-
alt: "",
|
|
1098
|
-
width: intrinsicSize,
|
|
1099
|
-
height: intrinsicSize,
|
|
1100
|
-
onError: () => {
|
|
1101
|
-
setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
|
|
1102
|
-
}
|
|
1103
|
-
});
|
|
1104
|
-
};
|
|
1105
|
-
var Sizes;
|
|
1106
|
-
(function(Sizes2) {
|
|
1107
|
-
Sizes2["SMALL"] = "small";
|
|
1108
|
-
Sizes2["MEDIUM"] = "medium";
|
|
1109
|
-
Sizes2["LARGE"] = "large";
|
|
1110
|
-
})(Sizes || (Sizes = {}));
|
|
1111
|
-
var imageSizes = {
|
|
1112
|
-
[Sizes.SMALL]: 200,
|
|
1113
|
-
[Sizes.MEDIUM]: 300,
|
|
1114
|
-
[Sizes.LARGE]: 500
|
|
1115
|
-
};
|
|
1116
|
-
var Assets;
|
|
1117
|
-
(function(Assets2) {
|
|
1118
|
-
Assets2["BELL"] = "bell";
|
|
1119
|
-
Assets2["BRIEFCASE"] = "briefcase";
|
|
1120
|
-
Assets2["BUSINESS_CARD"] = "business-card";
|
|
1121
|
-
Assets2["CALENDAR"] = "calendar";
|
|
1122
|
-
Assets2["CHECK_MARK"] = "check-mark";
|
|
1123
|
-
Assets2["CLOSED_WINDOW"] = "closed-window";
|
|
1124
|
-
Assets2["COIN_PILE_DOWN"] = "coin-pile-down";
|
|
1125
|
-
Assets2["COIN_PILE_UP"] = "coin-pile-up";
|
|
1126
|
-
Assets2["CONFETTI"] = "confetti";
|
|
1127
|
-
Assets2["CONSTRUCTION_FENCE"] = "construction-fence";
|
|
1128
|
-
Assets2["CONVERT"] = "convert";
|
|
1129
|
-
Assets2["COOKIE"] = "cookie";
|
|
1130
|
-
Assets2["DIGITAL_CARD_2"] = "digital-card-2";
|
|
1131
|
-
Assets2["DIGITAL_CARD"] = "digital-card";
|
|
1132
|
-
Assets2["DOCUMENTS"] = "documents";
|
|
1133
|
-
Assets2["DOOR"] = "door";
|
|
1134
|
-
Assets2["ECO_CARD"] = "eco-card";
|
|
1135
|
-
Assets2["ELECTRIC_PLUG"] = "electric-plug";
|
|
1136
|
-
Assets2["EMAIL_SUCCESS"] = "email-success";
|
|
1137
|
-
Assets2["EMAIL"] = "email";
|
|
1138
|
-
Assets2["EXCLAMATION_MARK"] = "exclamation-mark";
|
|
1139
|
-
Assets2["FLAG"] = "flag";
|
|
1140
|
-
Assets2["FLOWER"] = "flower";
|
|
1141
|
-
Assets2["GEAR"] = "gear";
|
|
1142
|
-
Assets2["GLOBE"] = "globe";
|
|
1143
|
-
Assets2["GRAPH"] = "graph";
|
|
1144
|
-
Assets2["HEART_2"] = "heart-2";
|
|
1145
|
-
Assets2["HEART_3"] = "heart-3";
|
|
1146
|
-
Assets2["HEART_4"] = "heart-4";
|
|
1147
|
-
Assets2["HEART_5"] = "heart-5";
|
|
1148
|
-
Assets2["HEART"] = "heart";
|
|
1149
|
-
Assets2["HOUSE"] = "house";
|
|
1150
|
-
Assets2["ID_CARD"] = "id-card";
|
|
1151
|
-
Assets2["INFINITE"] = "infinite";
|
|
1152
|
-
Assets2["INVITE_LETTER"] = "invite-letter";
|
|
1153
|
-
Assets2["JARS"] = "jars";
|
|
1154
|
-
Assets2["KEY"] = "key";
|
|
1155
|
-
Assets2["LIGHT_BULB"] = "light-bulb";
|
|
1156
|
-
Assets2["LOCK"] = "lock";
|
|
1157
|
-
Assets2["MAGNIFYING_GLASS"] = "magnifying-glass";
|
|
1158
|
-
Assets2["MAP"] = "map";
|
|
1159
|
-
Assets2["MARBLE_CARD_BUSINESS"] = "marble-card-business";
|
|
1160
|
-
Assets2["MARBLE_CARD"] = "marble-card";
|
|
1161
|
-
Assets2["MARBLE"] = "marble";
|
|
1162
|
-
Assets2["MEGAPHONE"] = "megaphone";
|
|
1163
|
-
Assets2["MULTI_CURRENCY"] = "multi-currency";
|
|
1164
|
-
Assets2["ONE_INVITE_LETTER_OPENED"] = "one-invite-letter-opened";
|
|
1165
|
-
Assets2["PALM_TREE"] = "palm-tree";
|
|
1166
|
-
Assets2["PERCENTAGE"] = "percentage";
|
|
1167
|
-
Assets2["PERSONAL_CARD"] = "personal-card";
|
|
1168
|
-
Assets2["PHONES"] = "phones";
|
|
1169
|
-
Assets2["PIE_CHART"] = "pie-chart";
|
|
1170
|
-
Assets2["PLANE_2"] = "plane-2";
|
|
1171
|
-
Assets2["PLANE"] = "plane";
|
|
1172
|
-
Assets2["PUZZLE_PIECES"] = "puzzle-pieces";
|
|
1173
|
-
Assets2["QUESTION_MARK"] = "question-mark";
|
|
1174
|
-
Assets2["RECEIVE"] = "receive";
|
|
1175
|
-
Assets2["REMINDER_LETTER"] = "reminder-letter";
|
|
1176
|
-
Assets2["SAND_TIMER"] = "sand-timer";
|
|
1177
|
-
Assets2["SHOPPING_BAG"] = "shopping-bag";
|
|
1178
|
-
Assets2["SKIP_AUTHENTICATION"] = "skip-authentication";
|
|
1179
|
-
Assets2["SPEECH_BUBBLE"] = "speech-bubble";
|
|
1180
|
-
Assets2["TOOL"] = "tool";
|
|
1181
|
-
Assets2["TWO_INVITE_LETTERS_OPENED"] = "two-invite-letters-opened";
|
|
1182
|
-
Assets2["WALLET"] = "wallet";
|
|
1183
|
-
})(Assets || (Assets = {}));
|
|
1236
|
+
// ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.12.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
1237
|
+
init_index_93a0c34e_esm();
|
|
1238
|
+
init_clsx();
|
|
1239
|
+
var import_react4 = require("react");
|
|
1240
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1184
1241
|
|
|
1185
1242
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1186
|
-
var
|
|
1243
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1187
1244
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1188
1245
|
function FlagIcon({ name }) {
|
|
1189
1246
|
if (!isFlagIcon(name)) {
|
|
1190
1247
|
return null;
|
|
1191
1248
|
}
|
|
1192
1249
|
const code = name.substring(5);
|
|
1193
|
-
return /* @__PURE__ */ (0,
|
|
1250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Flag, { code });
|
|
1194
1251
|
}
|
|
1195
1252
|
|
|
1196
1253
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
1197
1254
|
var icons = __toESM(require("@transferwise/icons"));
|
|
1198
|
-
var
|
|
1255
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1199
1256
|
var isNamedIcon = (name) => {
|
|
1200
1257
|
const iconName = toCapitalisedCamelCase(name);
|
|
1201
1258
|
return Object.keys(icons).includes(iconName);
|
|
@@ -1206,19 +1263,19 @@ function NamedIcon({ name }) {
|
|
|
1206
1263
|
}
|
|
1207
1264
|
const iconName = toCapitalisedCamelCase(name);
|
|
1208
1265
|
const Icon = icons[iconName];
|
|
1209
|
-
return /* @__PURE__ */ (0,
|
|
1266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { size: 24 });
|
|
1210
1267
|
}
|
|
1211
1268
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
1212
1269
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
1213
1270
|
|
|
1214
1271
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
1215
|
-
var
|
|
1272
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1216
1273
|
function DynamicIcon({ name }) {
|
|
1217
1274
|
if (isFlagIcon(name)) {
|
|
1218
|
-
return /* @__PURE__ */ (0,
|
|
1275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FlagIcon, { name });
|
|
1219
1276
|
}
|
|
1220
1277
|
if (isNamedIcon(name)) {
|
|
1221
|
-
return /* @__PURE__ */ (0,
|
|
1278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NamedIcon, { name });
|
|
1222
1279
|
}
|
|
1223
1280
|
return null;
|
|
1224
1281
|
}
|
|
@@ -1226,78 +1283,81 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
1226
1283
|
|
|
1227
1284
|
// ../renderers/src/components/icon/NavigationOptionMedia.tsx
|
|
1228
1285
|
var import_components7 = require("@transferwise/components");
|
|
1229
|
-
var
|
|
1286
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1230
1287
|
function NavigationOptionMedia({ icon, image }) {
|
|
1231
1288
|
if (!isNullish(icon)) {
|
|
1232
1289
|
if ("name" in icon) {
|
|
1233
|
-
return /* @__PURE__ */ (0,
|
|
1290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1234
1291
|
}
|
|
1235
1292
|
if (icon.text) {
|
|
1236
|
-
return /* @__PURE__ */ (0,
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components7.Avatar, { type: import_components7.AvatarType.INITIALS, children: icon.text });
|
|
1237
1294
|
}
|
|
1238
1295
|
}
|
|
1239
1296
|
if (image == null ? void 0 : image.url) {
|
|
1240
1297
|
const { url, accessibilityDescription } = image;
|
|
1241
|
-
return /* @__PURE__ */ (0,
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { src: url, alt: accessibilityDescription });
|
|
1242
1299
|
}
|
|
1243
1300
|
return null;
|
|
1244
1301
|
}
|
|
1245
1302
|
|
|
1246
1303
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1247
|
-
var
|
|
1304
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1248
1305
|
var DecisionRenderer = {
|
|
1249
1306
|
canRenderType: "decision",
|
|
1250
1307
|
render: DecisionRendererComponent
|
|
1251
1308
|
};
|
|
1252
1309
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1253
|
-
function DecisionRendererComponent({ margin, options }) {
|
|
1310
|
+
function DecisionRendererComponent({ margin, options, title }) {
|
|
1254
1311
|
const { isLoading } = useLoadingContext();
|
|
1255
|
-
return /* @__PURE__ */ (0,
|
|
1256
|
-
import_components8.
|
|
1257
|
-
{
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: getMargin(margin), children: [
|
|
1313
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.Header, { as: "h2", title }),
|
|
1314
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: title2, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1315
|
+
import_components8.NavigationOption,
|
|
1316
|
+
{
|
|
1317
|
+
title: title2,
|
|
1318
|
+
content: description,
|
|
1319
|
+
disabled: isLoading || disabled,
|
|
1320
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NavigationOptionMedia, { icon, image }),
|
|
1321
|
+
showMediaCircle: false,
|
|
1322
|
+
showMediaAtAllSizes: true,
|
|
1323
|
+
onClick
|
|
1324
|
+
},
|
|
1325
|
+
JSON.stringify(title2)
|
|
1326
|
+
)) })
|
|
1327
|
+
] });
|
|
1268
1328
|
}
|
|
1269
1329
|
|
|
1270
1330
|
// ../renderers/src/DividerRenderer.tsx
|
|
1271
|
-
var
|
|
1331
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1272
1332
|
var DividerRenderer = {
|
|
1273
1333
|
canRenderType: "divider",
|
|
1274
|
-
render: ({ margin }) => /* @__PURE__ */ (0,
|
|
1334
|
+
render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1275
1335
|
};
|
|
1276
1336
|
var DividerRenderer_default = DividerRenderer;
|
|
1277
1337
|
|
|
1278
1338
|
// ../renderers/src/FormRenderer.tsx
|
|
1279
|
-
var
|
|
1339
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1280
1340
|
var FormRenderer = {
|
|
1281
1341
|
canRenderType: "form",
|
|
1282
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1342
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: getMargin(margin), children })
|
|
1283
1343
|
};
|
|
1284
1344
|
var FormRenderer_default = FormRenderer;
|
|
1285
1345
|
|
|
1286
1346
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1287
1347
|
var import_components9 = require("@transferwise/components");
|
|
1288
|
-
var
|
|
1348
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1289
1349
|
var FormSectionRenderer = {
|
|
1290
1350
|
canRenderType: "form-section",
|
|
1291
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1351
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("fieldset", { children: [
|
|
1292
1352
|
title && // TODO - once section headers support help, we could show help in here
|
|
1293
|
-
/* @__PURE__ */ (0,
|
|
1353
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1294
1354
|
import_components9.Header,
|
|
1295
1355
|
{
|
|
1296
1356
|
as: "h2",
|
|
1297
1357
|
title
|
|
1298
1358
|
}
|
|
1299
1359
|
),
|
|
1300
|
-
description && /* @__PURE__ */ (0,
|
|
1360
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: description }),
|
|
1301
1361
|
children
|
|
1302
1362
|
] })
|
|
1303
1363
|
};
|
|
@@ -1305,32 +1365,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1305
1365
|
|
|
1306
1366
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1307
1367
|
var import_components10 = require("@transferwise/components");
|
|
1308
|
-
var
|
|
1368
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1309
1369
|
var HeadingRenderer = {
|
|
1310
1370
|
canRenderType: "heading",
|
|
1311
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1371
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadValues({}, props))
|
|
1312
1372
|
};
|
|
1313
1373
|
function Heading(props) {
|
|
1314
1374
|
const { text, size, align, margin, control } = props;
|
|
1315
1375
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1316
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1376
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StandardHeading, { size, text, className });
|
|
1317
1377
|
}
|
|
1318
1378
|
function DisplayHeading({ size, text, className }) {
|
|
1319
|
-
return /* @__PURE__ */ (0,
|
|
1379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Display, { type: getDisplayType(size), className, children: text });
|
|
1320
1380
|
}
|
|
1321
1381
|
function StandardHeading({ size, text, className }) {
|
|
1322
1382
|
switch (size) {
|
|
1323
1383
|
case "xs":
|
|
1324
|
-
return /* @__PURE__ */ (0,
|
|
1384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h5", { className, children: text });
|
|
1325
1385
|
case "sm":
|
|
1326
|
-
return /* @__PURE__ */ (0,
|
|
1386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { className, children: text });
|
|
1327
1387
|
case "lg":
|
|
1328
|
-
return /* @__PURE__ */ (0,
|
|
1388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className, children: text });
|
|
1329
1389
|
case "xl":
|
|
1330
|
-
return /* @__PURE__ */ (0,
|
|
1390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { className, children: text });
|
|
1331
1391
|
case "md":
|
|
1332
1392
|
default:
|
|
1333
|
-
return /* @__PURE__ */ (0,
|
|
1393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className, children: text });
|
|
1334
1394
|
}
|
|
1335
1395
|
}
|
|
1336
1396
|
var getDisplayType = (size) => {
|
|
@@ -1350,7 +1410,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1350
1410
|
|
|
1351
1411
|
// ../renderers/src/ImageRenderer.tsx
|
|
1352
1412
|
var import_components11 = require("@transferwise/components");
|
|
1353
|
-
var
|
|
1413
|
+
var import_react5 = require("react");
|
|
1354
1414
|
|
|
1355
1415
|
// ../renderers/src/utils/api-utils.ts
|
|
1356
1416
|
function isRelativePath(url = "") {
|
|
@@ -1360,10 +1420,10 @@ function isRelativePath(url = "") {
|
|
|
1360
1420
|
}
|
|
1361
1421
|
|
|
1362
1422
|
// ../renderers/src/ImageRenderer.tsx
|
|
1363
|
-
var
|
|
1423
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1364
1424
|
var ImageRenderer = {
|
|
1365
1425
|
canRenderType: "image",
|
|
1366
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1426
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ImageRendererComponent, __spreadValues({}, props))
|
|
1367
1427
|
};
|
|
1368
1428
|
var ImageRenderer_default = ImageRenderer;
|
|
1369
1429
|
function ImageRendererComponent({
|
|
@@ -1372,12 +1432,12 @@ function ImageRendererComponent({
|
|
|
1372
1432
|
size,
|
|
1373
1433
|
url
|
|
1374
1434
|
}) {
|
|
1375
|
-
const [imageSource, setImageSource] = (0,
|
|
1435
|
+
const [imageSource, setImageSource] = (0, import_react5.useState)("");
|
|
1376
1436
|
const httpClient = useRendererHttpClient();
|
|
1377
|
-
(0,
|
|
1437
|
+
(0, import_react5.useEffect)(() => {
|
|
1378
1438
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
1379
1439
|
}, [url, httpClient]);
|
|
1380
|
-
return /* @__PURE__ */ (0,
|
|
1440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1381
1441
|
import_components11.Image,
|
|
1382
1442
|
{
|
|
1383
1443
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1422,7 +1482,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1422
1482
|
|
|
1423
1483
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1424
1484
|
var import_components12 = require("@transferwise/components");
|
|
1425
|
-
var
|
|
1485
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1426
1486
|
var doContext = ["positive", "neutral"];
|
|
1427
1487
|
var dontContext = ["warning", "negative"];
|
|
1428
1488
|
var InstructionsRenderer = {
|
|
@@ -1430,9 +1490,9 @@ var InstructionsRenderer = {
|
|
|
1430
1490
|
render: ({ items, margin, title }) => {
|
|
1431
1491
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1432
1492
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1433
|
-
return /* @__PURE__ */ (0,
|
|
1434
|
-
title ? /* @__PURE__ */ (0,
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getMargin(margin), children: [
|
|
1494
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.Header, { title }) : null,
|
|
1495
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components12.InstructionsList, { dos, donts })
|
|
1436
1496
|
] });
|
|
1437
1497
|
}
|
|
1438
1498
|
};
|
|
@@ -1449,12 +1509,12 @@ var onWheel = (event) => {
|
|
|
1449
1509
|
};
|
|
1450
1510
|
|
|
1451
1511
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1452
|
-
var
|
|
1512
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1453
1513
|
var IntegerInputRenderer = {
|
|
1454
1514
|
canRenderType: "input-integer",
|
|
1455
1515
|
render: (props) => {
|
|
1456
1516
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
1457
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1458
1518
|
import_components13.Input,
|
|
1459
1519
|
__spreadValues({
|
|
1460
1520
|
id,
|
|
@@ -1476,10 +1536,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1476
1536
|
|
|
1477
1537
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1478
1538
|
var import_components14 = require("@transferwise/components");
|
|
1479
|
-
var
|
|
1539
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1480
1540
|
var LoadingIndicatorRenderer = {
|
|
1481
1541
|
canRenderType: "loading-indicator",
|
|
1482
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
1542
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1483
1543
|
import_components14.Loader,
|
|
1484
1544
|
{
|
|
1485
1545
|
size,
|
|
@@ -1492,27 +1552,27 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1492
1552
|
|
|
1493
1553
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1494
1554
|
var import_components15 = require("@transferwise/components");
|
|
1495
|
-
var
|
|
1555
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1496
1556
|
var MarkdownRenderer = {
|
|
1497
1557
|
canRenderType: "markdown",
|
|
1498
|
-
render: ({ content, align, margin }) => /* @__PURE__ */ (0,
|
|
1558
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components15.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1499
1559
|
};
|
|
1500
1560
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1501
1561
|
|
|
1502
1562
|
// ../renderers/src/ModalRenderer.tsx
|
|
1503
1563
|
var import_components16 = require("@transferwise/components");
|
|
1504
|
-
var
|
|
1505
|
-
var
|
|
1564
|
+
var import_react6 = require("react");
|
|
1565
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1506
1566
|
var ModalRenderer = {
|
|
1507
1567
|
canRenderType: "modal",
|
|
1508
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1568
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DFModal, __spreadValues({}, props))
|
|
1509
1569
|
};
|
|
1510
1570
|
var ModalRenderer_default = ModalRenderer;
|
|
1511
1571
|
function DFModal({ content, margin, trigger }) {
|
|
1512
|
-
const [visible, setVisible] = (0,
|
|
1513
|
-
return /* @__PURE__ */ (0,
|
|
1514
|
-
/* @__PURE__ */ (0,
|
|
1515
|
-
/* @__PURE__ */ (0,
|
|
1572
|
+
const [visible, setVisible] = (0, import_react6.useState)(false);
|
|
1573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: getMargin(margin), children: [
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components16.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1516
1576
|
import_components16.Modal,
|
|
1517
1577
|
{
|
|
1518
1578
|
scroll: "content",
|
|
@@ -1530,16 +1590,16 @@ var import_components18 = require("@transferwise/components");
|
|
|
1530
1590
|
|
|
1531
1591
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1532
1592
|
var import_components17 = require("@transferwise/components");
|
|
1533
|
-
var
|
|
1593
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1534
1594
|
function OptionMedia({ icon, image }) {
|
|
1535
1595
|
if (image == null ? void 0 : image.url) {
|
|
1536
|
-
return /* @__PURE__ */ (0,
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1537
1597
|
}
|
|
1538
1598
|
if (icon && "name" in icon) {
|
|
1539
|
-
return /* @__PURE__ */ (0,
|
|
1599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.Avatar, { type: import_components17.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
1540
1600
|
}
|
|
1541
1601
|
if (icon && "text" in icon) {
|
|
1542
|
-
return /* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.Avatar, { type: import_components17.AvatarType.INITIALS, children: icon.text });
|
|
1543
1603
|
}
|
|
1544
1604
|
return null;
|
|
1545
1605
|
}
|
|
@@ -1558,15 +1618,15 @@ var multi_select_messages_default = (0, import_react_intl3.defineMessages)({
|
|
|
1558
1618
|
});
|
|
1559
1619
|
|
|
1560
1620
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1561
|
-
var
|
|
1562
|
-
var
|
|
1621
|
+
var import_react7 = require("react");
|
|
1622
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1563
1623
|
var MultiSelectInputRenderer = {
|
|
1564
1624
|
canRenderType: "input-multi-select",
|
|
1565
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1625
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1566
1626
|
};
|
|
1567
1627
|
function MultiSelectInputRendererComponent(props) {
|
|
1568
1628
|
const { formatMessage } = (0, import_react_intl4.useIntl)();
|
|
1569
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
1629
|
+
const [stagedIndices, setStagedIndices] = (0, import_react7.useState)();
|
|
1570
1630
|
const {
|
|
1571
1631
|
id,
|
|
1572
1632
|
description,
|
|
@@ -1603,11 +1663,11 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1603
1663
|
const contentProps = {
|
|
1604
1664
|
title: option.title,
|
|
1605
1665
|
description: option.description,
|
|
1606
|
-
icon: /* @__PURE__ */ (0,
|
|
1666
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
1607
1667
|
};
|
|
1608
|
-
return /* @__PURE__ */ (0,
|
|
1668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components18.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1609
1669
|
};
|
|
1610
|
-
return /* @__PURE__ */ (0,
|
|
1670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1611
1671
|
import_components18.SelectInput,
|
|
1612
1672
|
{
|
|
1613
1673
|
id,
|
|
@@ -1649,7 +1709,7 @@ var import_components20 = require("@transferwise/components");
|
|
|
1649
1709
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1650
1710
|
var import_components19 = require("@transferwise/components");
|
|
1651
1711
|
var import_classnames3 = __toESM(require_classnames());
|
|
1652
|
-
var
|
|
1712
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1653
1713
|
function UploadFieldInput({
|
|
1654
1714
|
id,
|
|
1655
1715
|
children,
|
|
@@ -1658,18 +1718,18 @@ function UploadFieldInput({
|
|
|
1658
1718
|
error,
|
|
1659
1719
|
help
|
|
1660
1720
|
}) {
|
|
1661
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
1721
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1662
1722
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1663
|
-
return /* @__PURE__ */ (0,
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1664
1724
|
"div",
|
|
1665
1725
|
{
|
|
1666
1726
|
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1667
1727
|
"has-error": !!error
|
|
1668
1728
|
}),
|
|
1669
1729
|
children: [
|
|
1670
|
-
/* @__PURE__ */ (0,
|
|
1730
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1671
1731
|
children,
|
|
1672
|
-
error && /* @__PURE__ */ (0,
|
|
1732
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components19.InlineAlert, { type: "negative", id: descriptionId, children: error })
|
|
1673
1733
|
]
|
|
1674
1734
|
}
|
|
1675
1735
|
);
|
|
@@ -1701,7 +1761,7 @@ var getFileType = (base64Url) => {
|
|
|
1701
1761
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1702
1762
|
|
|
1703
1763
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1704
|
-
var
|
|
1764
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1705
1765
|
var MultiUploadInputRenderer = {
|
|
1706
1766
|
canRenderType: "input-upload-multi",
|
|
1707
1767
|
render: (props) => {
|
|
@@ -1728,7 +1788,7 @@ var MultiUploadInputRenderer = {
|
|
|
1728
1788
|
};
|
|
1729
1789
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1730
1790
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1731
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1732
1792
|
import_components20.UploadInput,
|
|
1733
1793
|
{
|
|
1734
1794
|
id,
|
|
@@ -1751,12 +1811,12 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
|
1751
1811
|
|
|
1752
1812
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1753
1813
|
var import_components21 = require("@transferwise/components");
|
|
1754
|
-
var
|
|
1814
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1755
1815
|
var NumberInputRenderer = {
|
|
1756
1816
|
canRenderType: "input-number",
|
|
1757
1817
|
render: (props) => {
|
|
1758
1818
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
1759
|
-
return /* @__PURE__ */ (0,
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1760
1820
|
import_components21.Input,
|
|
1761
1821
|
__spreadValues({
|
|
1762
1822
|
id,
|
|
@@ -1779,9 +1839,9 @@ var import_react_intl6 = require("react-intl");
|
|
|
1779
1839
|
|
|
1780
1840
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
1781
1841
|
var import_components22 = require("@transferwise/components");
|
|
1782
|
-
var
|
|
1842
|
+
var import_react8 = require("react");
|
|
1783
1843
|
function useSnackBarIfAvailable() {
|
|
1784
|
-
const context = (0,
|
|
1844
|
+
const context = (0, import_react8.useContext)(import_components22.SnackbarContext);
|
|
1785
1845
|
return context ? context.createSnackbar : () => {
|
|
1786
1846
|
};
|
|
1787
1847
|
}
|
|
@@ -1806,17 +1866,17 @@ var paragraph_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
1806
1866
|
});
|
|
1807
1867
|
|
|
1808
1868
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1809
|
-
var
|
|
1869
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1810
1870
|
var ParagraphRenderer = {
|
|
1811
1871
|
canRenderType: "paragraph",
|
|
1812
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1872
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Paragraph, __spreadValues({}, props))
|
|
1813
1873
|
};
|
|
1814
1874
|
function Paragraph({ align, control, margin, text }) {
|
|
1815
1875
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1816
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
1876
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StandardParagraph, { className, text });
|
|
1817
1877
|
}
|
|
1818
1878
|
function StandardParagraph({ text, className }) {
|
|
1819
|
-
return /* @__PURE__ */ (0,
|
|
1879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className, children: text });
|
|
1820
1880
|
}
|
|
1821
1881
|
function CopyableParagraph({
|
|
1822
1882
|
text,
|
|
@@ -1830,8 +1890,8 @@ function CopyableParagraph({
|
|
|
1830
1890
|
});
|
|
1831
1891
|
};
|
|
1832
1892
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
1833
|
-
return /* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className, children: [
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1835
1895
|
import_components23.Input,
|
|
1836
1896
|
{
|
|
1837
1897
|
type: "text",
|
|
@@ -1840,14 +1900,14 @@ function CopyableParagraph({
|
|
|
1840
1900
|
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
1841
1901
|
}
|
|
1842
1902
|
),
|
|
1843
|
-
/* @__PURE__ */ (0,
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components23.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1844
1904
|
] });
|
|
1845
1905
|
}
|
|
1846
1906
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
1847
1907
|
|
|
1848
1908
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1849
1909
|
var import_components24 = require("@transferwise/components");
|
|
1850
|
-
var
|
|
1910
|
+
var import_react9 = require("react");
|
|
1851
1911
|
var import_icons = require("@transferwise/icons");
|
|
1852
1912
|
var import_react_intl8 = require("react-intl");
|
|
1853
1913
|
|
|
@@ -1878,10 +1938,10 @@ var repeatable_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
1878
1938
|
|
|
1879
1939
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1880
1940
|
var import_classnames5 = __toESM(require_classnames());
|
|
1881
|
-
var
|
|
1941
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1882
1942
|
var RepeatableRenderer = {
|
|
1883
1943
|
canRenderType: "repeatable",
|
|
1884
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1944
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Repeatable, __spreadValues({}, props))
|
|
1885
1945
|
};
|
|
1886
1946
|
function Repeatable(props) {
|
|
1887
1947
|
const {
|
|
@@ -1898,7 +1958,7 @@ function Repeatable(props) {
|
|
|
1898
1958
|
onRemove
|
|
1899
1959
|
} = props;
|
|
1900
1960
|
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
1901
|
-
const [openModalType, setOpenModalType] = (0,
|
|
1961
|
+
const [openModalType, setOpenModalType] = (0, import_react9.useState)(null);
|
|
1902
1962
|
const onAddItem = () => {
|
|
1903
1963
|
onAdd();
|
|
1904
1964
|
setOpenModalType("add");
|
|
@@ -1920,40 +1980,40 @@ function Repeatable(props) {
|
|
|
1920
1980
|
const onCancelEdit = () => {
|
|
1921
1981
|
setOpenModalType(null);
|
|
1922
1982
|
};
|
|
1923
|
-
return /* @__PURE__ */ (0,
|
|
1924
|
-
title && /* @__PURE__ */ (0,
|
|
1925
|
-
description && /* @__PURE__ */ (0,
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
1983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
1984
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.Header, { title }),
|
|
1985
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: description }),
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1927
1987
|
"div",
|
|
1928
1988
|
{
|
|
1929
1989
|
className: (0, import_classnames5.default)("form-group", {
|
|
1930
1990
|
"has-error": error
|
|
1931
1991
|
}),
|
|
1932
1992
|
children: [
|
|
1933
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
1934
|
-
/* @__PURE__ */ (0,
|
|
1993
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
1994
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1935
1995
|
import_components24.NavigationOption,
|
|
1936
1996
|
{
|
|
1937
|
-
media: /* @__PURE__ */ (0,
|
|
1997
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons.Plus, {}),
|
|
1938
1998
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
1939
1999
|
showMediaAtAllSizes: true,
|
|
1940
2000
|
onClick: () => onAddItem()
|
|
1941
2001
|
}
|
|
1942
2002
|
),
|
|
1943
|
-
error && /* @__PURE__ */ (0,
|
|
2003
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.InlineAlert, { type: "negative", children: error })
|
|
1944
2004
|
]
|
|
1945
2005
|
}
|
|
1946
2006
|
),
|
|
1947
|
-
/* @__PURE__ */ (0,
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1948
2008
|
import_components24.Modal,
|
|
1949
2009
|
{
|
|
1950
2010
|
open: openModalType !== null,
|
|
1951
2011
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
1952
|
-
body: /* @__PURE__ */ (0,
|
|
1953
|
-
/* @__PURE__ */ (0,
|
|
1954
|
-
/* @__PURE__ */ (0,
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
2012
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
2013
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
2015
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2016
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components24.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
1957
2017
|
] })
|
|
1958
2018
|
] }),
|
|
1959
2019
|
onClose: () => onCancelEdit()
|
|
@@ -1965,10 +2025,10 @@ function ItemSummaryOption({
|
|
|
1965
2025
|
item,
|
|
1966
2026
|
onClick
|
|
1967
2027
|
}) {
|
|
1968
|
-
return /* @__PURE__ */ (0,
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1969
2029
|
import_components24.NavigationOption,
|
|
1970
2030
|
{
|
|
1971
|
-
media: /* @__PURE__ */ (0,
|
|
2031
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
|
|
1972
2032
|
title: item.title,
|
|
1973
2033
|
content: item.description,
|
|
1974
2034
|
showMediaAtAllSizes: true,
|
|
@@ -2005,13 +2065,13 @@ var generic_error_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
2005
2065
|
});
|
|
2006
2066
|
|
|
2007
2067
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2008
|
-
var
|
|
2068
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2009
2069
|
function ErrorResult({ state }) {
|
|
2010
2070
|
const intl = (0, import_react_intl10.useIntl)();
|
|
2011
|
-
return /* @__PURE__ */ (0,
|
|
2071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { className: "m-t-2", children: [
|
|
2012
2072
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2013
2073
|
"\xA0",
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2015
2075
|
"a",
|
|
2016
2076
|
{
|
|
2017
2077
|
href: "/",
|
|
@@ -2026,8 +2086,8 @@ function ErrorResult({ state }) {
|
|
|
2026
2086
|
}
|
|
2027
2087
|
|
|
2028
2088
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2029
|
-
var
|
|
2030
|
-
var
|
|
2089
|
+
var import_react10 = require("react");
|
|
2090
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2031
2091
|
function BlockSearchRendererComponent({
|
|
2032
2092
|
id,
|
|
2033
2093
|
isLoading,
|
|
@@ -2037,10 +2097,10 @@ function BlockSearchRendererComponent({
|
|
|
2037
2097
|
state,
|
|
2038
2098
|
title
|
|
2039
2099
|
}) {
|
|
2040
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2100
|
+
const [hasSearched, setHasSearched] = (0, import_react10.useState)(false);
|
|
2041
2101
|
const trackEvent = useTrackEvent();
|
|
2042
|
-
return /* @__PURE__ */ (0,
|
|
2043
|
-
/* @__PURE__ */ (0,
|
|
2102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: getMargin(margin), children: [
|
|
2103
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2044
2104
|
import_components25.Input,
|
|
2045
2105
|
{
|
|
2046
2106
|
id,
|
|
@@ -2057,7 +2117,7 @@ function BlockSearchRendererComponent({
|
|
|
2057
2117
|
}
|
|
2058
2118
|
}
|
|
2059
2119
|
) }),
|
|
2060
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2120
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SearchResultContent, { state, onChange })
|
|
2061
2121
|
] });
|
|
2062
2122
|
}
|
|
2063
2123
|
function SearchResultContent({
|
|
@@ -2066,29 +2126,29 @@ function SearchResultContent({
|
|
|
2066
2126
|
}) {
|
|
2067
2127
|
switch (state.type) {
|
|
2068
2128
|
case "error":
|
|
2069
|
-
return /* @__PURE__ */ (0,
|
|
2129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ErrorResult, { state });
|
|
2070
2130
|
case "results":
|
|
2071
|
-
return /* @__PURE__ */ (0,
|
|
2131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SearchResults, { state, onChange });
|
|
2072
2132
|
case "noResults":
|
|
2073
|
-
return /* @__PURE__ */ (0,
|
|
2133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptySearchResult, { state });
|
|
2074
2134
|
case "pending":
|
|
2075
2135
|
default:
|
|
2076
2136
|
return null;
|
|
2077
2137
|
}
|
|
2078
2138
|
}
|
|
2079
2139
|
function EmptySearchResult({ state }) {
|
|
2080
|
-
return /* @__PURE__ */ (0,
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components25.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2081
2141
|
}
|
|
2082
2142
|
function SearchResults({
|
|
2083
2143
|
state
|
|
2084
2144
|
}) {
|
|
2085
2145
|
const trackEvent = useTrackEvent();
|
|
2086
|
-
return /* @__PURE__ */ (0,
|
|
2146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components25.NavigationOptionsList, { children: state.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2087
2147
|
import_components25.NavigationOption,
|
|
2088
2148
|
{
|
|
2089
2149
|
title: result.title,
|
|
2090
2150
|
content: result.description,
|
|
2091
|
-
media: /* @__PURE__ */ (0,
|
|
2151
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(NavigationOptionMedia, __spreadValues({}, result)),
|
|
2092
2152
|
showMediaCircle: false,
|
|
2093
2153
|
showMediaAtAllSizes: true,
|
|
2094
2154
|
onClick: () => {
|
|
@@ -2106,8 +2166,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2106
2166
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2107
2167
|
var import_components26 = require("@transferwise/components");
|
|
2108
2168
|
var import_icons2 = require("@transferwise/icons");
|
|
2109
|
-
var
|
|
2110
|
-
var
|
|
2169
|
+
var import_react11 = require("react");
|
|
2170
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2111
2171
|
function InlineSearchRenderer({
|
|
2112
2172
|
id,
|
|
2113
2173
|
isLoading,
|
|
@@ -2116,45 +2176,42 @@ function InlineSearchRenderer({
|
|
|
2116
2176
|
state,
|
|
2117
2177
|
title
|
|
2118
2178
|
}) {
|
|
2119
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2179
|
+
const [hasSearched, setHasSearched] = (0, import_react11.useState)(false);
|
|
2120
2180
|
const trackEvent = useTrackEvent();
|
|
2121
|
-
return /* @__PURE__ */ (0,
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
2144
|
-
result.onClick();
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
},
|
|
2148
|
-
onInputChange: (query) => {
|
|
2149
|
-
if (!hasSearched) {
|
|
2150
|
-
setHasSearched(true);
|
|
2151
|
-
trackEvent("Search Started");
|
|
2181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2182
|
+
import_components26.Typeahead,
|
|
2183
|
+
{
|
|
2184
|
+
id: "typeahead-input-id",
|
|
2185
|
+
name: "typeahead-input-name",
|
|
2186
|
+
size: "md",
|
|
2187
|
+
maxHeight: 100,
|
|
2188
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2189
|
+
multiple: false,
|
|
2190
|
+
clearable: false,
|
|
2191
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons2.Search, { size: 24 }),
|
|
2192
|
+
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2193
|
+
minQueryLength: 1,
|
|
2194
|
+
onChange: (values) => {
|
|
2195
|
+
if (values.length > 0) {
|
|
2196
|
+
const [updatedValue] = values;
|
|
2197
|
+
const { value: result } = updatedValue;
|
|
2198
|
+
if (result) {
|
|
2199
|
+
trackEvent("Search Result Selected", __spreadValues({
|
|
2200
|
+
type: result.type
|
|
2201
|
+
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
2202
|
+
result.onClick();
|
|
2152
2203
|
}
|
|
2153
|
-
onChange(query);
|
|
2154
2204
|
}
|
|
2205
|
+
},
|
|
2206
|
+
onInputChange: (query) => {
|
|
2207
|
+
if (!hasSearched) {
|
|
2208
|
+
setHasSearched(true);
|
|
2209
|
+
trackEvent("Search Started");
|
|
2210
|
+
}
|
|
2211
|
+
onChange(query);
|
|
2155
2212
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2213
|
+
}
|
|
2214
|
+
) }) });
|
|
2158
2215
|
}
|
|
2159
2216
|
function mapResultToTypeaheadOption(result) {
|
|
2160
2217
|
return {
|
|
@@ -2167,29 +2224,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2167
2224
|
}
|
|
2168
2225
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2169
2226
|
if (state.type === "noResults") {
|
|
2170
|
-
return /* @__PURE__ */ (0,
|
|
2227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components26.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2171
2228
|
}
|
|
2172
2229
|
if (state.type === "error") {
|
|
2173
|
-
return /* @__PURE__ */ (0,
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorResult, { state }) });
|
|
2174
2231
|
}
|
|
2175
2232
|
if (state.type === "pending" || isLoading) {
|
|
2176
|
-
return /* @__PURE__ */ (0,
|
|
2233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
2177
2234
|
}
|
|
2178
2235
|
return null;
|
|
2179
2236
|
}
|
|
2180
2237
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2181
2238
|
|
|
2182
2239
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2183
|
-
var
|
|
2240
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2184
2241
|
var SearchRenderer = {
|
|
2185
2242
|
canRenderType: "search",
|
|
2186
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
2243
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2187
2244
|
};
|
|
2188
2245
|
var SearchRenderer_default = SearchRenderer;
|
|
2189
2246
|
|
|
2190
2247
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2191
2248
|
var import_components27 = require("@transferwise/components");
|
|
2192
|
-
var
|
|
2249
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2193
2250
|
function RadioInputRendererComponent(props) {
|
|
2194
2251
|
const {
|
|
2195
2252
|
id,
|
|
@@ -2203,8 +2260,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2203
2260
|
selectedIndex,
|
|
2204
2261
|
onSelect
|
|
2205
2262
|
} = props;
|
|
2206
|
-
return /* @__PURE__ */ (0,
|
|
2207
|
-
/* @__PURE__ */ (0,
|
|
2263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2208
2265
|
import_components27.RadioGroup,
|
|
2209
2266
|
{
|
|
2210
2267
|
name: id,
|
|
@@ -2213,7 +2270,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2213
2270
|
value: index,
|
|
2214
2271
|
secondary: option.description,
|
|
2215
2272
|
disabled: option.disabled || disabled,
|
|
2216
|
-
avatar: /* @__PURE__ */ (0,
|
|
2273
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2217
2274
|
})),
|
|
2218
2275
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2219
2276
|
onChange: onSelect
|
|
@@ -2226,8 +2283,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2226
2283
|
|
|
2227
2284
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2228
2285
|
var import_components28 = require("@transferwise/components");
|
|
2229
|
-
var
|
|
2230
|
-
var
|
|
2286
|
+
var import_react12 = require("react");
|
|
2287
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2231
2288
|
function TabInputRendererComponent(props) {
|
|
2232
2289
|
const {
|
|
2233
2290
|
id,
|
|
@@ -2241,13 +2298,13 @@ function TabInputRendererComponent(props) {
|
|
|
2241
2298
|
selectedIndex,
|
|
2242
2299
|
onSelect
|
|
2243
2300
|
} = props;
|
|
2244
|
-
(0,
|
|
2301
|
+
(0, import_react12.useEffect)(() => {
|
|
2245
2302
|
if (!isValidIndex(selectedIndex, options.length)) {
|
|
2246
2303
|
onSelect(0);
|
|
2247
2304
|
}
|
|
2248
2305
|
}, [selectedIndex, onSelect, options.length]);
|
|
2249
|
-
return /* @__PURE__ */ (0,
|
|
2250
|
-
/* @__PURE__ */ (0,
|
|
2306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2251
2308
|
import_components28.Tabs,
|
|
2252
2309
|
{
|
|
2253
2310
|
name: id,
|
|
@@ -2256,7 +2313,7 @@ function TabInputRendererComponent(props) {
|
|
|
2256
2313
|
title: option.title,
|
|
2257
2314
|
// if we pass null, we get some props-types console errors
|
|
2258
2315
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2259
|
-
content: /* @__PURE__ */ (0,
|
|
2316
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, {}),
|
|
2260
2317
|
disabled: option.disabled || disabled
|
|
2261
2318
|
})),
|
|
2262
2319
|
onTabSelect: onSelect
|
|
@@ -2272,22 +2329,22 @@ var import_components30 = require("@transferwise/components");
|
|
|
2272
2329
|
|
|
2273
2330
|
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
2274
2331
|
var import_components29 = require("@transferwise/components");
|
|
2275
|
-
var
|
|
2332
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2276
2333
|
function SelectTriggerMedia({ icon, image }) {
|
|
2277
2334
|
if (image == null ? void 0 : image.url) {
|
|
2278
2335
|
return null;
|
|
2279
2336
|
}
|
|
2280
2337
|
if (icon && "name" in icon) {
|
|
2281
|
-
return /* @__PURE__ */ (0,
|
|
2338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components29.Avatar, { type: import_components29.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
2282
2339
|
}
|
|
2283
2340
|
if (icon && "text" in icon) {
|
|
2284
|
-
return /* @__PURE__ */ (0,
|
|
2341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components29.Avatar, { type: import_components29.AvatarType.ICON, size: 24, children: icon.text });
|
|
2285
2342
|
}
|
|
2286
2343
|
return null;
|
|
2287
2344
|
}
|
|
2288
2345
|
|
|
2289
2346
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2290
|
-
var
|
|
2347
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2291
2348
|
function SelectInputRendererComponent(props) {
|
|
2292
2349
|
const {
|
|
2293
2350
|
id,
|
|
@@ -2322,16 +2379,16 @@ function SelectInputRendererComponent(props) {
|
|
|
2322
2379
|
const contentProps = withinTrigger ? {
|
|
2323
2380
|
title: option.title,
|
|
2324
2381
|
note: option.description,
|
|
2325
|
-
icon: /* @__PURE__ */ (0,
|
|
2382
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
2326
2383
|
} : {
|
|
2327
2384
|
title: option.title,
|
|
2328
2385
|
description: option.description,
|
|
2329
|
-
icon: /* @__PURE__ */ (0,
|
|
2386
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(OptionMedia, { icon: option.icon, image: option.image })
|
|
2330
2387
|
};
|
|
2331
|
-
return /* @__PURE__ */ (0,
|
|
2388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components30.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2332
2389
|
};
|
|
2333
|
-
return /* @__PURE__ */ (0,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
2391
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2335
2392
|
import_components30.SelectInput,
|
|
2336
2393
|
{
|
|
2337
2394
|
name: id,
|
|
@@ -2350,18 +2407,18 @@ function SelectInputRendererComponent(props) {
|
|
|
2350
2407
|
}
|
|
2351
2408
|
|
|
2352
2409
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2353
|
-
var
|
|
2410
|
+
var import_react13 = require("react");
|
|
2354
2411
|
var import_components31 = require("@transferwise/components");
|
|
2355
|
-
var
|
|
2412
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2356
2413
|
function SegmentedInputRendererComponent(props) {
|
|
2357
2414
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
2358
|
-
(0,
|
|
2415
|
+
(0, import_react13.useEffect)(() => {
|
|
2359
2416
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2360
2417
|
onSelect(0);
|
|
2361
2418
|
}
|
|
2362
2419
|
}, [selectedIndex, onSelect, options.length]);
|
|
2363
|
-
return /* @__PURE__ */ (0,
|
|
2364
|
-
/* @__PURE__ */ (0,
|
|
2420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
2421
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2365
2422
|
import_components31.SegmentedControl,
|
|
2366
2423
|
{
|
|
2367
2424
|
name: `${id}-segmented-control`,
|
|
@@ -2376,26 +2433,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2376
2433
|
onChange: (value) => onSelect(Number(value))
|
|
2377
2434
|
}
|
|
2378
2435
|
) }),
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { id: `${id}-children`, children })
|
|
2380
2437
|
] });
|
|
2381
2438
|
}
|
|
2382
2439
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2383
2440
|
|
|
2384
2441
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2385
|
-
var
|
|
2442
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2386
2443
|
var SelectInputRenderer = {
|
|
2387
2444
|
canRenderType: "input-select",
|
|
2388
2445
|
render: (props) => {
|
|
2389
2446
|
switch (props.control) {
|
|
2390
2447
|
case "radio":
|
|
2391
|
-
return /* @__PURE__ */ (0,
|
|
2448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2392
2449
|
case "tab":
|
|
2393
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2450
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2394
2451
|
case "segmented":
|
|
2395
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
2452
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2396
2453
|
case "select":
|
|
2397
2454
|
default:
|
|
2398
|
-
return /* @__PURE__ */ (0,
|
|
2455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2399
2456
|
}
|
|
2400
2457
|
}
|
|
2401
2458
|
};
|
|
@@ -2403,17 +2460,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2403
2460
|
|
|
2404
2461
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2405
2462
|
var import_components32 = require("@transferwise/components");
|
|
2406
|
-
var
|
|
2463
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2407
2464
|
var StatusListRenderer = {
|
|
2408
2465
|
canRenderType: "status-list",
|
|
2409
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0,
|
|
2410
|
-
title ? /* @__PURE__ */ (0,
|
|
2411
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0,
|
|
2466
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: getMargin(margin), children: [
|
|
2467
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components32.Header, { title }) : null,
|
|
2468
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2412
2469
|
import_components32.Summary,
|
|
2413
2470
|
{
|
|
2414
2471
|
title: itemTitle,
|
|
2415
2472
|
description,
|
|
2416
|
-
icon: icon && "name" in icon ? /* @__PURE__ */ (0,
|
|
2473
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) : null,
|
|
2417
2474
|
status: mapStatus(status)
|
|
2418
2475
|
},
|
|
2419
2476
|
`${title}/${description || ""}`
|
|
@@ -2430,31 +2487,31 @@ var mapStatus = (status) => {
|
|
|
2430
2487
|
|
|
2431
2488
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2432
2489
|
var import_components33 = require("@transferwise/components");
|
|
2433
|
-
var
|
|
2490
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2434
2491
|
function VariableTextInput({
|
|
2435
2492
|
control,
|
|
2436
2493
|
inputProps
|
|
2437
2494
|
}) {
|
|
2438
2495
|
switch (control) {
|
|
2439
2496
|
case "password":
|
|
2440
|
-
return /* @__PURE__ */ (0,
|
|
2497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
2441
2498
|
case "email":
|
|
2442
|
-
return /* @__PURE__ */ (0,
|
|
2499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
2443
2500
|
case "textarea":
|
|
2444
|
-
return /* @__PURE__ */ (0,
|
|
2501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextAreaInput, __spreadValues({}, inputProps));
|
|
2445
2502
|
case "numeric":
|
|
2446
|
-
return /* @__PURE__ */ (0,
|
|
2503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
2447
2504
|
case "phone-number":
|
|
2448
|
-
return /* @__PURE__ */ (0,
|
|
2505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
2449
2506
|
default:
|
|
2450
|
-
return /* @__PURE__ */ (0,
|
|
2507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
2451
2508
|
}
|
|
2452
2509
|
}
|
|
2453
2510
|
function TextInput(_a) {
|
|
2454
2511
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2455
2512
|
if (typeof displayFormat === "string") {
|
|
2456
2513
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
2457
|
-
return /* @__PURE__ */ (0,
|
|
2514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2458
2515
|
import_components33.InputWithDisplayFormat,
|
|
2459
2516
|
__spreadValues({
|
|
2460
2517
|
displayPattern: displayFormat,
|
|
@@ -2462,29 +2519,29 @@ function TextInput(_a) {
|
|
|
2462
2519
|
}, inputProps)
|
|
2463
2520
|
);
|
|
2464
2521
|
}
|
|
2465
|
-
return /* @__PURE__ */ (0,
|
|
2522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
2466
2523
|
}
|
|
2467
2524
|
function TextAreaInput(_a) {
|
|
2468
2525
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2469
2526
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
2470
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
2527
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2471
2528
|
import_components33.TextareaWithDisplayFormat,
|
|
2472
2529
|
__spreadValues({
|
|
2473
2530
|
displayPattern: displayFormat,
|
|
2474
2531
|
onChange: (newValue) => onChange(newValue)
|
|
2475
2532
|
}, textAreaProps)
|
|
2476
|
-
) : /* @__PURE__ */ (0,
|
|
2533
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
2477
2534
|
}
|
|
2478
2535
|
function NumericInput(_a) {
|
|
2479
2536
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2480
2537
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
2481
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */ (0,
|
|
2538
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2482
2539
|
import_components33.InputWithDisplayFormat,
|
|
2483
2540
|
__spreadValues({
|
|
2484
2541
|
displayPattern: displayFormat,
|
|
2485
2542
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
2486
2543
|
}, numericProps)
|
|
2487
|
-
) : /* @__PURE__ */ (0,
|
|
2544
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2488
2545
|
import_components33.Input,
|
|
2489
2546
|
__spreadValues({
|
|
2490
2547
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
@@ -2493,12 +2550,12 @@ function NumericInput(_a) {
|
|
|
2493
2550
|
}
|
|
2494
2551
|
function PhoneNumberInput(_a) {
|
|
2495
2552
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
2496
|
-
return /* @__PURE__ */ (0,
|
|
2553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components33.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
|
|
2497
2554
|
}
|
|
2498
2555
|
var VariableTextInput_default = VariableTextInput;
|
|
2499
2556
|
|
|
2500
2557
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2501
|
-
var
|
|
2558
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2502
2559
|
var TextInputRenderer = {
|
|
2503
2560
|
canRenderType: "input-text",
|
|
2504
2561
|
render: (props) => {
|
|
@@ -2523,14 +2580,14 @@ var TextInputRenderer = {
|
|
|
2523
2580
|
]);
|
|
2524
2581
|
const value = initialValue != null ? initialValue : "";
|
|
2525
2582
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2526
|
-
return /* @__PURE__ */ (0,
|
|
2583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(VariableTextInput_default, { control, inputProps }) });
|
|
2527
2584
|
}
|
|
2528
2585
|
};
|
|
2529
2586
|
var TextInputRenderer_default = TextInputRenderer;
|
|
2530
2587
|
|
|
2531
2588
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2532
2589
|
var import_components34 = require("@transferwise/components");
|
|
2533
|
-
var
|
|
2590
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2534
2591
|
var UploadInputRenderer = {
|
|
2535
2592
|
canRenderType: "input-upload",
|
|
2536
2593
|
render: (props) => {
|
|
@@ -2546,7 +2603,7 @@ var UploadInputRenderer = {
|
|
|
2546
2603
|
};
|
|
2547
2604
|
return (
|
|
2548
2605
|
// We don't pass help here as there is no sensible place to display it
|
|
2549
|
-
/* @__PURE__ */ (0,
|
|
2606
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2550
2607
|
import_components34.UploadInput,
|
|
2551
2608
|
{
|
|
2552
2609
|
id,
|
|
@@ -2601,7 +2658,7 @@ var LargeUploadRenderer = {
|
|
|
2601
2658
|
throw e;
|
|
2602
2659
|
}
|
|
2603
2660
|
};
|
|
2604
|
-
return /* @__PURE__ */ (0,
|
|
2661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2605
2662
|
import_components34.Upload,
|
|
2606
2663
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2607
2664
|
usAccept: getAcceptsString(accepts),
|
|
@@ -2616,7 +2673,7 @@ var LargeUploadRenderer = {
|
|
|
2616
2673
|
|
|
2617
2674
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2618
2675
|
var import_components35 = require("@transferwise/components");
|
|
2619
|
-
var
|
|
2676
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2620
2677
|
var ReviewRenderer = {
|
|
2621
2678
|
canRenderType: "review",
|
|
2622
2679
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -2628,9 +2685,9 @@ var ReviewRenderer = {
|
|
|
2628
2685
|
callToAction.onClick();
|
|
2629
2686
|
}
|
|
2630
2687
|
} : void 0;
|
|
2631
|
-
return /* @__PURE__ */ (0,
|
|
2632
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
2633
|
-
/* @__PURE__ */ (0,
|
|
2688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: getMargin(margin), children: [
|
|
2689
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components35.Header, { title: title != null ? title : "", action }),
|
|
2690
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2634
2691
|
import_components35.DefinitionList,
|
|
2635
2692
|
{
|
|
2636
2693
|
layout: orientation,
|
|
@@ -2662,21 +2719,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2662
2719
|
};
|
|
2663
2720
|
var getFieldValue = (value, help, orientation) => {
|
|
2664
2721
|
if (help) {
|
|
2665
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0,
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
2722
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
2723
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help }),
|
|
2667
2724
|
" ",
|
|
2668
2725
|
value
|
|
2669
|
-
] }) : /* @__PURE__ */ (0,
|
|
2726
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
2670
2727
|
value,
|
|
2671
2728
|
" ",
|
|
2672
|
-
/* @__PURE__ */ (0,
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Help_default, { help })
|
|
2673
2730
|
] });
|
|
2674
2731
|
}
|
|
2675
2732
|
return value;
|
|
2676
2733
|
};
|
|
2677
2734
|
|
|
2678
2735
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2679
|
-
var
|
|
2736
|
+
var import_react15 = require("react");
|
|
2680
2737
|
|
|
2681
2738
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
2682
2739
|
var import_react_intl12 = require("react-intl");
|
|
@@ -2708,17 +2765,17 @@ var external_confirmation_messages_default = (0, import_react_intl11.defineMessa
|
|
|
2708
2765
|
|
|
2709
2766
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
2710
2767
|
var import_components36 = require("@transferwise/components");
|
|
2711
|
-
var
|
|
2768
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2712
2769
|
function ExternalConfirmationDialog({
|
|
2713
2770
|
external,
|
|
2714
2771
|
onClose
|
|
2715
2772
|
}) {
|
|
2716
2773
|
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
2717
|
-
return /* @__PURE__ */ (0,
|
|
2718
|
-
/* @__PURE__ */ (0,
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2720
|
-
/* @__PURE__ */ (0,
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
2775
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
2776
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components36.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
2778
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2722
2779
|
import_components36.Button,
|
|
2723
2780
|
{
|
|
2724
2781
|
block: true,
|
|
@@ -2732,7 +2789,7 @@ function ExternalConfirmationDialog({
|
|
|
2732
2789
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2733
2790
|
}
|
|
2734
2791
|
),
|
|
2735
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components36.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2736
2793
|
] }) })
|
|
2737
2794
|
] }) });
|
|
2738
2795
|
}
|
|
@@ -2745,12 +2802,12 @@ function getOrigin(url) {
|
|
|
2745
2802
|
}
|
|
2746
2803
|
|
|
2747
2804
|
// ../renderers/src/step/useExternal.tsx
|
|
2748
|
-
var
|
|
2805
|
+
var import_react14 = require("react");
|
|
2749
2806
|
function useExternal(url) {
|
|
2750
|
-
const [externalWindow, setExternalWindow] = (0,
|
|
2751
|
-
const [hasDismissed, setHasDismissed] = (0,
|
|
2807
|
+
const [externalWindow, setExternalWindow] = (0, import_react14.useState)(null);
|
|
2808
|
+
const [hasDismissed, setHasDismissed] = (0, import_react14.useState)(false);
|
|
2752
2809
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
2753
|
-
(0,
|
|
2810
|
+
(0, import_react14.useEffect)(() => {
|
|
2754
2811
|
if (url) {
|
|
2755
2812
|
setHasDismissed(false);
|
|
2756
2813
|
setExternalWindow(window.open(url, "_blank"));
|
|
@@ -2763,9 +2820,9 @@ function useExternal(url) {
|
|
|
2763
2820
|
// ../renderers/src/step/BackButton.tsx
|
|
2764
2821
|
var import_components37 = require("@transferwise/components");
|
|
2765
2822
|
var import_icons3 = require("@transferwise/icons");
|
|
2766
|
-
var
|
|
2823
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2767
2824
|
function BackButton({ title, onClick }) {
|
|
2768
|
-
return /* @__PURE__ */ (0,
|
|
2825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
2769
2826
|
"a",
|
|
2770
2827
|
{
|
|
2771
2828
|
href: "/",
|
|
@@ -2776,8 +2833,8 @@ function BackButton({ title, onClick }) {
|
|
|
2776
2833
|
onClick();
|
|
2777
2834
|
},
|
|
2778
2835
|
children: [
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2836
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: title }),
|
|
2837
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components37.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
|
|
2781
2838
|
]
|
|
2782
2839
|
}
|
|
2783
2840
|
);
|
|
@@ -2786,23 +2843,23 @@ var BackButton_default = BackButton;
|
|
|
2786
2843
|
|
|
2787
2844
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2788
2845
|
var import_components38 = require("@transferwise/components");
|
|
2789
|
-
var
|
|
2846
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2790
2847
|
var StepRenderer = {
|
|
2791
2848
|
canRenderType: "step",
|
|
2792
2849
|
render: StepRendererComponent
|
|
2793
2850
|
};
|
|
2794
2851
|
function StepRendererComponent(props) {
|
|
2795
2852
|
const { back, description, error, external, loadingState, title, trackEvent, children } = props;
|
|
2796
|
-
const value = (0,
|
|
2853
|
+
const value = (0, import_react15.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
2797
2854
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
2798
2855
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
2799
|
-
return /* @__PURE__ */ (0,
|
|
2856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
2800
2857
|
}
|
|
2801
|
-
return /* @__PURE__ */ (0,
|
|
2802
|
-
back ? /* @__PURE__ */ (0,
|
|
2803
|
-
title ? /* @__PURE__ */ (0,
|
|
2804
|
-
description ? /* @__PURE__ */ (0,
|
|
2805
|
-
error ? /* @__PURE__ */ (0,
|
|
2858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(StepRendererContextProvider, { value, children: [
|
|
2859
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(BackButton_default, __spreadValues({}, back)) : null,
|
|
2860
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2861
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
|
|
2862
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components38.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2806
2863
|
children
|
|
2807
2864
|
] });
|
|
2808
2865
|
}
|
|
@@ -2842,30 +2899,30 @@ var getWiseRenderers = () => [
|
|
|
2842
2899
|
];
|
|
2843
2900
|
|
|
2844
2901
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
2845
|
-
var
|
|
2902
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2846
2903
|
var wiseRenderers = getWiseRenderers();
|
|
2847
2904
|
function DynamicFlowLegacy(props) {
|
|
2848
2905
|
const { customFetch = globalThis.fetch } = props;
|
|
2849
2906
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
2850
|
-
return /* @__PURE__ */ (0,
|
|
2907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
2851
2908
|
}
|
|
2852
2909
|
function DynamicFlowRevamp(props) {
|
|
2853
2910
|
const { customFetch = globalThis.fetch, renderers } = props;
|
|
2854
2911
|
const httpClient = useWiseHttpClient(customFetch);
|
|
2855
|
-
const mergedRenderers = (0,
|
|
2912
|
+
const mergedRenderers = (0, import_react16.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
2856
2913
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers });
|
|
2857
|
-
return /* @__PURE__ */ (0,
|
|
2914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
2858
2915
|
}
|
|
2859
|
-
var DynamicFragment = (0,
|
|
2916
|
+
var DynamicFragment = (0, import_react16.forwardRef)(function DynamicFragment2(props, ref) {
|
|
2860
2917
|
const { customFetch = globalThis.fetch, renderers } = props;
|
|
2861
2918
|
const httpClient = useWiseHttpClient(customFetch);
|
|
2862
|
-
const mergedRenderers = (0,
|
|
2919
|
+
const mergedRenderers = (0, import_react16.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
2863
2920
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers });
|
|
2864
|
-
return /* @__PURE__ */ (0,
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_dynamic_flow_client2.DynamicFragmentCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
2865
2922
|
});
|
|
2866
2923
|
var useWiseHttpClient = (httpClient) => {
|
|
2867
2924
|
const { locale } = (0, import_react_intl13.useIntl)();
|
|
2868
|
-
return (0,
|
|
2925
|
+
return (0, import_react16.useCallback)(
|
|
2869
2926
|
async (input, init = {}) => {
|
|
2870
2927
|
const headers = new Headers(init.headers);
|
|
2871
2928
|
headers.set("accept-language", locale);
|