@wise/dynamic-flow-client-internal 5.6.2 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.css +24 -0
- package/build/main.js +1239 -1048
- package/build/main.mjs +1080 -883
- package/build/types/dynamicFlow/DynamicFlow.d.ts +1 -0
- package/build/types/dynamicFlow/DynamicFlow.d.ts.map +1 -0
- package/build/types/dynamicFlow/DynamicFlowModal.d.ts +1 -0
- package/build/types/dynamicFlow/DynamicFlowModal.d.ts.map +1 -0
- package/build/types/dynamicFlow/DynamicFlowWiseProps.d.ts +1 -0
- package/build/types/dynamicFlow/DynamicFlowWiseProps.d.ts.map +1 -0
- package/build/types/dynamicFlow/DynamicFlowWithRef.d.ts +1 -0
- package/build/types/dynamicFlow/DynamicFlowWithRef.d.ts.map +1 -0
- package/build/types/dynamicFlow/getMergedRenderers.d.ts +1 -0
- package/build/types/dynamicFlow/getMergedRenderers.d.ts.map +1 -0
- package/build/types/dynamicFlow/messages.d.ts +1 -0
- package/build/types/dynamicFlow/messages.d.ts.map +1 -0
- package/build/types/dynamicFlow/renderers.d.ts +2 -1
- package/build/types/dynamicFlow/renderers.d.ts.map +1 -0
- package/build/types/dynamicFlow/telemetry/app-version.d.ts +1 -0
- package/build/types/dynamicFlow/telemetry/app-version.d.ts.map +1 -0
- package/build/types/dynamicFlow/telemetry/getLogEvent.d.ts +1 -0
- package/build/types/dynamicFlow/telemetry/getLogEvent.d.ts.map +1 -0
- package/build/types/dynamicFlow/telemetry/getTrackEvent.d.ts +1 -0
- package/build/types/dynamicFlow/telemetry/getTrackEvent.d.ts.map +1 -0
- package/build/types/dynamicFlow/telemetry/index.d.ts +1 -0
- package/build/types/dynamicFlow/telemetry/index.d.ts.map +1 -0
- package/build/types/dynamicFlow/useOnCopy.d.ts +1 -0
- package/build/types/dynamicFlow/useOnCopy.d.ts.map +1 -0
- package/build/types/dynamicFlow/useWiseHttpClient.d.ts +1 -0
- package/build/types/dynamicFlow/useWiseHttpClient.d.ts.map +1 -0
- package/build/types/dynamicFlow/useWiseToCoreProps.d.ts +1 -0
- package/build/types/dynamicFlow/useWiseToCoreProps.d.ts.map +1 -0
- package/build/types/i18n/index.d.ts +1 -0
- package/build/types/i18n/index.d.ts.map +1 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/stories/utils/fixtureHttpClient.d.ts +1 -0
- package/build/types/stories/utils/fixtureHttpClient.d.ts.map +1 -0
- package/build/types/test-utils/NeptuneProviders.d.ts +1 -0
- package/build/types/test-utils/NeptuneProviders.d.ts.map +1 -0
- package/build/types/test-utils/index.d.ts +1 -0
- package/build/types/test-utils/index.d.ts.map +1 -0
- package/build/types/test-utils/respond-with.d.ts +1 -0
- package/build/types/test-utils/respond-with.d.ts.map +1 -0
- package/build/types/test-utils/rtl-utils.d.ts +1 -0
- package/build/types/test-utils/rtl-utils.d.ts.map +1 -0
- package/build/types/test-utils/wait.d.ts +1 -0
- package/build/types/test-utils/wait.d.ts.map +1 -0
- package/package.json +18 -18
package/build/main.js
CHANGED
|
@@ -139,12 +139,12 @@ var import_dynamic_flow_client6 = require("@wise/dynamic-flow-client");
|
|
|
139
139
|
var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
|
|
140
140
|
|
|
141
141
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
142
|
-
var
|
|
142
|
+
var import_react22 = require("react");
|
|
143
143
|
|
|
144
144
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
145
145
|
var appVersion = (
|
|
146
146
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
147
|
-
typeof process !== "undefined" ? "5.
|
|
147
|
+
typeof process !== "undefined" ? "5.8.0" : "0.0.0"
|
|
148
148
|
);
|
|
149
149
|
|
|
150
150
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
@@ -693,7 +693,10 @@ function ButtonComponent(props) {
|
|
|
693
693
|
const buttonProps = {
|
|
694
694
|
v2: true,
|
|
695
695
|
block: control !== "small",
|
|
696
|
-
className: (0, import_classnames2.default)(getMargin(margin),
|
|
696
|
+
className: (0, import_classnames2.default)(getMargin(margin), "df-button", {
|
|
697
|
+
small: control === "small",
|
|
698
|
+
"align-center": tags == null ? void 0 : tags.includes("align-center")
|
|
699
|
+
}),
|
|
697
700
|
addonStart: control === "small" && media ? getAddonStartMedia(media) : void 0,
|
|
698
701
|
disabled,
|
|
699
702
|
priority: getPriority(control, tags),
|
|
@@ -1050,9 +1053,258 @@ var DateInputRenderer = {
|
|
|
1050
1053
|
};
|
|
1051
1054
|
var DateInputRenderer_default = DateInputRenderer;
|
|
1052
1055
|
|
|
1053
|
-
// ../renderers/src/
|
|
1056
|
+
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1057
|
+
var import_components16 = require("@transferwise/components");
|
|
1058
|
+
|
|
1059
|
+
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
1054
1060
|
var import_components13 = require("@transferwise/components");
|
|
1055
1061
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1062
|
+
var getAdditionalInfo = (additionalInfo) => {
|
|
1063
|
+
if (!additionalInfo) {
|
|
1064
|
+
return void 0;
|
|
1065
|
+
}
|
|
1066
|
+
const { href, text, onClick } = additionalInfo;
|
|
1067
|
+
if (href || onClick) {
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1069
|
+
import_components13.ListItem.AdditionalInfo,
|
|
1070
|
+
{
|
|
1071
|
+
action: {
|
|
1072
|
+
label: text,
|
|
1073
|
+
href,
|
|
1074
|
+
onClick,
|
|
1075
|
+
target: "_blank"
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
);
|
|
1079
|
+
}
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components13.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
1084
|
+
var shouldUseAvatar = (control, tags) => {
|
|
1085
|
+
var _a;
|
|
1086
|
+
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1090
|
+
var import_components15 = require("@transferwise/components");
|
|
1091
|
+
var import_react3 = require("react");
|
|
1092
|
+
var import_react_intl8 = require("react-intl");
|
|
1093
|
+
|
|
1094
|
+
// ../renderers/src/messages/filter.messages.ts
|
|
1095
|
+
var import_react_intl5 = require("react-intl");
|
|
1096
|
+
var filter_messages_default = (0, import_react_intl5.defineMessages)({
|
|
1097
|
+
placeholder: {
|
|
1098
|
+
id: "df.wise.filter.placeholder",
|
|
1099
|
+
defaultMessage: "Start typing to search",
|
|
1100
|
+
description: "Placeholder for the filter input"
|
|
1101
|
+
},
|
|
1102
|
+
results: {
|
|
1103
|
+
id: "df.wise.filter.results",
|
|
1104
|
+
defaultMessage: "Search results",
|
|
1105
|
+
description: "Label for the results section"
|
|
1106
|
+
},
|
|
1107
|
+
noResults: {
|
|
1108
|
+
id: "df.wise.filter.noResults",
|
|
1109
|
+
defaultMessage: "No results",
|
|
1110
|
+
description: "Message for if there are no results"
|
|
1111
|
+
}
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
// ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
|
|
1115
|
+
function filterAndSortDecisionOptions(selectOptions, query) {
|
|
1116
|
+
const upperQuery = normalizeAndRemoveAccents(query);
|
|
1117
|
+
const filteredItems = selectOptions.filter((option) => {
|
|
1118
|
+
var _a, _b, _c, _d;
|
|
1119
|
+
const searchableWords = [
|
|
1120
|
+
option.title,
|
|
1121
|
+
option.description,
|
|
1122
|
+
option.additionalText,
|
|
1123
|
+
(_a = option.supportingValues) == null ? void 0 : _a.value,
|
|
1124
|
+
(_b = option.supportingValues) == null ? void 0 : _b.subvalue,
|
|
1125
|
+
...(_c = option.keywords) != null ? _c : []
|
|
1126
|
+
];
|
|
1127
|
+
return (_d = searchableWords.some(
|
|
1128
|
+
(word) => word && normalizeAndRemoveAccents(word).includes(upperQuery)
|
|
1129
|
+
)) != null ? _d : false;
|
|
1130
|
+
});
|
|
1131
|
+
return [...filteredItems].sort((a, b) => {
|
|
1132
|
+
if (a.disabled && !b.disabled) {
|
|
1133
|
+
return 1;
|
|
1134
|
+
}
|
|
1135
|
+
if (!a.disabled && b.disabled) {
|
|
1136
|
+
return -1;
|
|
1137
|
+
}
|
|
1138
|
+
const aTitleUpper = a.title.toUpperCase();
|
|
1139
|
+
const bTitleUpper = b.title.toUpperCase();
|
|
1140
|
+
const aTitleStarts = aTitleUpper.startsWith(upperQuery);
|
|
1141
|
+
const bTitleStarts = bTitleUpper.startsWith(upperQuery);
|
|
1142
|
+
if (aTitleStarts && !bTitleStarts) {
|
|
1143
|
+
return -1;
|
|
1144
|
+
}
|
|
1145
|
+
if (!aTitleStarts && bTitleStarts) {
|
|
1146
|
+
return 1;
|
|
1147
|
+
}
|
|
1148
|
+
const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
|
|
1149
|
+
const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
|
|
1150
|
+
if (aWordStarts && !bWordStarts) {
|
|
1151
|
+
return -1;
|
|
1152
|
+
}
|
|
1153
|
+
if (!aWordStarts && bWordStarts) {
|
|
1154
|
+
return 1;
|
|
1155
|
+
}
|
|
1156
|
+
return a.title.localeCompare(b.title);
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
1160
|
+
|
|
1161
|
+
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1162
|
+
var import_components14 = require("@transferwise/components");
|
|
1163
|
+
var import_react_intl7 = require("react-intl");
|
|
1164
|
+
|
|
1165
|
+
// ../renderers/src/messages/group.messages.ts
|
|
1166
|
+
var import_react_intl6 = require("react-intl");
|
|
1167
|
+
var group_messages_default = (0, import_react_intl6.defineMessages)({
|
|
1168
|
+
all: {
|
|
1169
|
+
id: "df.wise.group.all",
|
|
1170
|
+
defaultMessage: "All",
|
|
1171
|
+
description: "Label for the group of options that encompasses all options"
|
|
1172
|
+
},
|
|
1173
|
+
popular: {
|
|
1174
|
+
id: "df.wise.group.popular",
|
|
1175
|
+
defaultMessage: "Popular",
|
|
1176
|
+
description: "Label for the group of options that are tagged as popular"
|
|
1177
|
+
},
|
|
1178
|
+
recent: {
|
|
1179
|
+
id: "df.wise.group.recent",
|
|
1180
|
+
defaultMessage: "Recent",
|
|
1181
|
+
description: "Label for the group of options that are tagged as recent"
|
|
1182
|
+
},
|
|
1183
|
+
"currencies-with-account-details": {
|
|
1184
|
+
id: "df.wise.group.currencies-with-account-details",
|
|
1185
|
+
defaultMessage: "Currencies with account details",
|
|
1186
|
+
description: "Label for the group of options that are tagged as currencies with account details"
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
|
|
1190
|
+
// ../renderers/src/utils/grouping-utils.ts
|
|
1191
|
+
var getGroupsFromTags = (knownTags, items) => {
|
|
1192
|
+
return knownTags.map((tag) => {
|
|
1193
|
+
return { tag, items: items.filter((item) => {
|
|
1194
|
+
var _a;
|
|
1195
|
+
return (_a = item.tags) == null ? void 0 : _a.includes(tag);
|
|
1196
|
+
}) };
|
|
1197
|
+
}).filter((group) => group.items.length > 0);
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
1201
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1202
|
+
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1203
|
+
var isGroupedDecision = (options) => {
|
|
1204
|
+
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
1205
|
+
};
|
|
1206
|
+
var GroupedDecisionList = (_a) => {
|
|
1207
|
+
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1208
|
+
const { formatMessage } = (0, import_react_intl7.useIntl)();
|
|
1209
|
+
const { options } = rest;
|
|
1210
|
+
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_components14.Section, { children: [
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1213
|
+
import_components14.Header,
|
|
1214
|
+
{
|
|
1215
|
+
as: "h2",
|
|
1216
|
+
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
1217
|
+
}
|
|
1218
|
+
),
|
|
1219
|
+
renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: items }))
|
|
1220
|
+
] }, tag)) });
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
1224
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1225
|
+
var DecisionWrapper = (props) => {
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: getMargin(props.margin), children: [
|
|
1227
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components15.Header, { as: "h2", title: props.title }),
|
|
1228
|
+
props.control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
1229
|
+
] });
|
|
1230
|
+
};
|
|
1231
|
+
var UnfilteredDecisionList = (_a) => {
|
|
1232
|
+
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
1233
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
1234
|
+
};
|
|
1235
|
+
var FilteredDecisionList = (props) => {
|
|
1236
|
+
const { formatMessage } = (0, import_react_intl8.useIntl)();
|
|
1237
|
+
const [query, setQuery] = (0, import_react3.useState)("");
|
|
1238
|
+
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
1239
|
+
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
1240
|
+
const isGrouped = isGroupedDecision(options);
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1243
|
+
import_components15.SearchInput,
|
|
1244
|
+
{
|
|
1245
|
+
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
1246
|
+
value: query,
|
|
1247
|
+
className: "m-b-2",
|
|
1248
|
+
onChange: (e) => {
|
|
1249
|
+
var _a;
|
|
1250
|
+
return setQuery((_a = e.target.value) != null ? _a : "");
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
),
|
|
1254
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1255
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components15.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
1256
|
+
filteredOptions.length > 0 ? renderDecisionList2({
|
|
1257
|
+
control,
|
|
1258
|
+
className: query.length === 0 ? "m-t-3" : "",
|
|
1259
|
+
options: filteredOptions
|
|
1260
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
1261
|
+
] })
|
|
1262
|
+
] });
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
1266
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1267
|
+
var DecisionRenderer = {
|
|
1268
|
+
canRenderType: "decision",
|
|
1269
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
1270
|
+
};
|
|
1271
|
+
var renderDecisionList = ({ options, control }) => {
|
|
1272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: options.map((_a) => {
|
|
1273
|
+
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
1274
|
+
const {
|
|
1275
|
+
description,
|
|
1276
|
+
disabled,
|
|
1277
|
+
media,
|
|
1278
|
+
title: itemTitle,
|
|
1279
|
+
href,
|
|
1280
|
+
additionalText,
|
|
1281
|
+
inlineAlert,
|
|
1282
|
+
supportingValues,
|
|
1283
|
+
tags
|
|
1284
|
+
} = rest;
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1286
|
+
import_components16.ListItem,
|
|
1287
|
+
{
|
|
1288
|
+
title: itemTitle,
|
|
1289
|
+
subtitle: description,
|
|
1290
|
+
spotlight: control === "spotlight" ? (tags == null ? void 0 : tags.includes("spotlight-active")) ? "active" : "inactive" : void 0,
|
|
1291
|
+
disabled,
|
|
1292
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
1293
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
1294
|
+
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
1295
|
+
prompt: getInlineAlert(inlineAlert),
|
|
1296
|
+
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
1297
|
+
control: href ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components16.ListItem.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components16.ListItem.Navigation, { onClick })
|
|
1298
|
+
},
|
|
1299
|
+
JSON.stringify(rest)
|
|
1300
|
+
);
|
|
1301
|
+
}) });
|
|
1302
|
+
};
|
|
1303
|
+
var DecisionRenderer_default = DecisionRenderer;
|
|
1304
|
+
|
|
1305
|
+
// ../renderers/src/DividerRenderer.tsx
|
|
1306
|
+
var import_components17 = require("@transferwise/components");
|
|
1307
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1056
1308
|
var mapControlToLevel = (control) => {
|
|
1057
1309
|
switch (control) {
|
|
1058
1310
|
case "section":
|
|
@@ -1065,16 +1317,16 @@ var mapControlToLevel = (control) => {
|
|
|
1065
1317
|
};
|
|
1066
1318
|
var DividerRenderer = {
|
|
1067
1319
|
canRenderType: "divider",
|
|
1068
|
-
render: ({ margin, control }) => /* @__PURE__ */ (0,
|
|
1320
|
+
render: ({ margin, control }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components17.Divider, { className: `m-t-0 d-block ${getMargin(margin)}`, level: mapControlToLevel(control) })
|
|
1069
1321
|
};
|
|
1070
1322
|
var DividerRenderer_default = DividerRenderer;
|
|
1071
1323
|
|
|
1072
1324
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1073
|
-
var
|
|
1325
|
+
var import_components18 = require("@transferwise/components");
|
|
1074
1326
|
|
|
1075
1327
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
1076
|
-
var
|
|
1077
|
-
var external_confirmation_messages_default = (0,
|
|
1328
|
+
var import_react_intl9 = require("react-intl");
|
|
1329
|
+
var external_confirmation_messages_default = (0, import_react_intl9.defineMessages)({
|
|
1078
1330
|
title: {
|
|
1079
1331
|
id: "df.wise.ExternalConfirmation.title",
|
|
1080
1332
|
defaultMessage: "Please confirm",
|
|
@@ -1098,9 +1350,9 @@ var external_confirmation_messages_default = (0, import_react_intl5.defineMessag
|
|
|
1098
1350
|
});
|
|
1099
1351
|
|
|
1100
1352
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
1101
|
-
var
|
|
1102
|
-
var
|
|
1103
|
-
var
|
|
1353
|
+
var import_react_intl10 = require("react-intl");
|
|
1354
|
+
var import_react4 = require("react");
|
|
1355
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1104
1356
|
var ExternalConfirmationRenderer = {
|
|
1105
1357
|
canRenderType: "external-confirmation",
|
|
1106
1358
|
render: ExternalConfirmationRendererComponent
|
|
@@ -1112,8 +1364,8 @@ function ExternalConfirmationRendererComponent({
|
|
|
1112
1364
|
onFailure,
|
|
1113
1365
|
onCancel
|
|
1114
1366
|
}) {
|
|
1115
|
-
const { formatMessage } = (0,
|
|
1116
|
-
(0,
|
|
1367
|
+
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
1368
|
+
(0, import_react4.useEffect)(() => {
|
|
1117
1369
|
if (url) {
|
|
1118
1370
|
const w = window.open(url, "_blank");
|
|
1119
1371
|
if (w) {
|
|
@@ -1123,16 +1375,16 @@ function ExternalConfirmationRendererComponent({
|
|
|
1123
1375
|
}
|
|
1124
1376
|
}
|
|
1125
1377
|
}, []);
|
|
1126
|
-
return /* @__PURE__ */ (0,
|
|
1127
|
-
|
|
1378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1379
|
+
import_components18.Modal,
|
|
1128
1380
|
{
|
|
1129
1381
|
open: status === "failure",
|
|
1130
1382
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
1131
|
-
body: /* @__PURE__ */ (0,
|
|
1132
|
-
/* @__PURE__ */ (0,
|
|
1133
|
-
/* @__PURE__ */ (0,
|
|
1134
|
-
/* @__PURE__ */ (0,
|
|
1135
|
-
|
|
1383
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components18.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1387
|
+
import_components18.Button,
|
|
1136
1388
|
{
|
|
1137
1389
|
v2: true,
|
|
1138
1390
|
block: true,
|
|
@@ -1146,7 +1398,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
1146
1398
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
1147
1399
|
}
|
|
1148
1400
|
),
|
|
1149
|
-
/* @__PURE__ */ (0,
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components18.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
1150
1402
|
] }) })
|
|
1151
1403
|
] }),
|
|
1152
1404
|
onClose: onCancel
|
|
@@ -1163,46 +1415,46 @@ function getOrigin(url) {
|
|
|
1163
1415
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
1164
1416
|
|
|
1165
1417
|
// ../renderers/src/FormRenderer.tsx
|
|
1166
|
-
var
|
|
1418
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1167
1419
|
var FormRenderer = {
|
|
1168
1420
|
canRenderType: "form",
|
|
1169
|
-
render: ({ children, margin }) => /* @__PURE__ */ (0,
|
|
1421
|
+
render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getMargin(margin), children })
|
|
1170
1422
|
};
|
|
1171
1423
|
var FormRenderer_default = FormRenderer;
|
|
1172
1424
|
|
|
1173
1425
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1174
|
-
var
|
|
1175
|
-
var
|
|
1426
|
+
var import_components19 = require("@transferwise/components");
|
|
1427
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1176
1428
|
var FormSectionRenderer = {
|
|
1177
1429
|
canRenderType: "form-section",
|
|
1178
|
-
render: ({ title, description, children }) => /* @__PURE__ */ (0,
|
|
1179
|
-
title && /* @__PURE__ */ (0,
|
|
1180
|
-
|
|
1430
|
+
render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("fieldset", { children: [
|
|
1431
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1432
|
+
import_components19.Header,
|
|
1181
1433
|
{
|
|
1182
1434
|
as: "h2",
|
|
1183
1435
|
title
|
|
1184
1436
|
}
|
|
1185
1437
|
),
|
|
1186
|
-
description && /* @__PURE__ */ (0,
|
|
1438
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: description }),
|
|
1187
1439
|
children
|
|
1188
1440
|
] })
|
|
1189
1441
|
};
|
|
1190
1442
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
1191
1443
|
|
|
1192
1444
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1193
|
-
var
|
|
1194
|
-
var
|
|
1445
|
+
var import_components20 = require("@transferwise/components");
|
|
1446
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1195
1447
|
var HeadingRenderer = {
|
|
1196
1448
|
canRenderType: "heading",
|
|
1197
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1449
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Heading, __spreadValues({}, props))
|
|
1198
1450
|
};
|
|
1199
1451
|
function Heading(props) {
|
|
1200
1452
|
const { text, size, align, margin, control } = props;
|
|
1201
1453
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1202
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
1454
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StandardHeading, { size, text, className });
|
|
1203
1455
|
}
|
|
1204
1456
|
function DisplayHeading({ size, text, className }) {
|
|
1205
|
-
return /* @__PURE__ */ (0,
|
|
1457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components20.Display, { type: getDisplayType(size), className, children: text });
|
|
1206
1458
|
}
|
|
1207
1459
|
var getDisplayType = (size) => {
|
|
1208
1460
|
switch (size) {
|
|
@@ -1218,7 +1470,7 @@ var getDisplayType = (size) => {
|
|
|
1218
1470
|
}
|
|
1219
1471
|
};
|
|
1220
1472
|
function StandardHeading({ size, text, className }) {
|
|
1221
|
-
return /* @__PURE__ */ (0,
|
|
1473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components20.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
1222
1474
|
}
|
|
1223
1475
|
var getTitleTypeBySize = (size) => {
|
|
1224
1476
|
var _a;
|
|
@@ -1234,8 +1486,8 @@ var getTitleTypeBySize = (size) => {
|
|
|
1234
1486
|
var HeadingRenderer_default = HeadingRenderer;
|
|
1235
1487
|
|
|
1236
1488
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1237
|
-
var
|
|
1238
|
-
var
|
|
1489
|
+
var import_components21 = require("@transferwise/components");
|
|
1490
|
+
var import_react5 = require("react");
|
|
1239
1491
|
|
|
1240
1492
|
// ../renderers/src/utils/api-utils.ts
|
|
1241
1493
|
function isRelativePath(url = "") {
|
|
@@ -1245,7 +1497,7 @@ function isRelativePath(url = "") {
|
|
|
1245
1497
|
}
|
|
1246
1498
|
|
|
1247
1499
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
1248
|
-
var
|
|
1500
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1249
1501
|
function UrlImage({
|
|
1250
1502
|
accessibilityDescription,
|
|
1251
1503
|
align,
|
|
@@ -1254,14 +1506,14 @@ function UrlImage({
|
|
|
1254
1506
|
uri,
|
|
1255
1507
|
httpClient
|
|
1256
1508
|
}) {
|
|
1257
|
-
const [imageSource, setImageSource] = (0,
|
|
1258
|
-
(0,
|
|
1509
|
+
const [imageSource, setImageSource] = (0, import_react5.useState)("");
|
|
1510
|
+
(0, import_react5.useEffect)(() => {
|
|
1259
1511
|
if (!uri.startsWith("urn:")) {
|
|
1260
1512
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
1261
1513
|
}
|
|
1262
1514
|
}, [uri, httpClient]);
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1264
|
-
|
|
1515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `df-image ${align} ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1516
|
+
import_components21.Image,
|
|
1265
1517
|
{
|
|
1266
1518
|
className: `img-responsive ${getMargin(margin)}`,
|
|
1267
1519
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -1304,7 +1556,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1304
1556
|
};
|
|
1305
1557
|
|
|
1306
1558
|
// ../renderers/src/ImageRenderer/UrnFlagImage.tsx
|
|
1307
|
-
var
|
|
1559
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1308
1560
|
var maxFlagSize = 600;
|
|
1309
1561
|
function UrnFlagImage({
|
|
1310
1562
|
accessibilityDescription,
|
|
@@ -1313,12 +1565,12 @@ function UrnFlagImage({
|
|
|
1313
1565
|
size,
|
|
1314
1566
|
uri
|
|
1315
1567
|
}) {
|
|
1316
|
-
return /* @__PURE__ */ (0,
|
|
1568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `df-image ${align} ${size || "md"} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(UrnFlag, { size: maxFlagSize, urn: uri, accessibilityDescription }) });
|
|
1317
1569
|
}
|
|
1318
1570
|
|
|
1319
1571
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1320
1572
|
var import_art4 = require("@wise/art");
|
|
1321
|
-
var
|
|
1573
|
+
var import_react7 = require("react");
|
|
1322
1574
|
|
|
1323
1575
|
// ../renderers/src/ImageRenderer/isAnimated.ts
|
|
1324
1576
|
var isAnimated = (uri) => {
|
|
@@ -1328,9 +1580,9 @@ var isAnimated = (uri) => {
|
|
|
1328
1580
|
|
|
1329
1581
|
// ../renderers/src/ImageRenderer/SafeIllustration3D.tsx
|
|
1330
1582
|
var import_art3 = require("@wise/art");
|
|
1331
|
-
var
|
|
1332
|
-
var
|
|
1333
|
-
var Illustration3DErrorBoundary = class extends
|
|
1583
|
+
var import_react6 = require("react");
|
|
1584
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1585
|
+
var Illustration3DErrorBoundary = class extends import_react6.Component {
|
|
1334
1586
|
constructor(props) {
|
|
1335
1587
|
super(props);
|
|
1336
1588
|
this.state = { hasError: false };
|
|
@@ -1353,12 +1605,12 @@ var SafeIllustration3D = ({
|
|
|
1353
1605
|
size,
|
|
1354
1606
|
onError
|
|
1355
1607
|
}) => {
|
|
1356
|
-
return /* @__PURE__ */ (0,
|
|
1608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Illustration3DErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_art3.Illustration3D, { name, size }) });
|
|
1357
1609
|
};
|
|
1358
1610
|
var SafeIllustration3D_default = SafeIllustration3D;
|
|
1359
1611
|
|
|
1360
1612
|
// ../renderers/src/ImageRenderer/UrnIllustration.tsx
|
|
1361
|
-
var
|
|
1613
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1362
1614
|
var urnPrefix = "urn:wise:illustrations:";
|
|
1363
1615
|
var isUrnIllustration = (uri) => uri.startsWith(urnPrefix);
|
|
1364
1616
|
function UrnIllustration({
|
|
@@ -1368,12 +1620,12 @@ function UrnIllustration({
|
|
|
1368
1620
|
size,
|
|
1369
1621
|
uri
|
|
1370
1622
|
}) {
|
|
1371
|
-
const [has3DFailed, setHas3DFailed] = (0,
|
|
1623
|
+
const [has3DFailed, setHas3DFailed] = (0, import_react7.useState)(false);
|
|
1372
1624
|
const illustrationSize = getIllustrationSize(size);
|
|
1373
1625
|
const illustrationName = getIllustrationName(uri);
|
|
1374
1626
|
const illustration3DName = getIllustration3DName(uri);
|
|
1375
1627
|
if (illustration3DName && isAnimated(uri) && !has3DFailed) {
|
|
1376
|
-
return /* @__PURE__ */ (0,
|
|
1628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1377
1629
|
SafeIllustration3D_default,
|
|
1378
1630
|
{
|
|
1379
1631
|
name: illustration3DName,
|
|
@@ -1382,7 +1634,7 @@ function UrnIllustration({
|
|
|
1382
1634
|
}
|
|
1383
1635
|
) });
|
|
1384
1636
|
}
|
|
1385
|
-
return /* @__PURE__ */ (0,
|
|
1637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: `df-image ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1386
1638
|
import_art4.Illustration,
|
|
1387
1639
|
{
|
|
1388
1640
|
className: "df-illustration",
|
|
@@ -1402,32 +1654,32 @@ var getIllustration3DName = (uri) => {
|
|
|
1402
1654
|
};
|
|
1403
1655
|
|
|
1404
1656
|
// ../renderers/src/ImageRenderer/UrnImage.tsx
|
|
1405
|
-
var
|
|
1657
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1406
1658
|
var isUrnImage = (uri) => uri.startsWith("urn:");
|
|
1407
1659
|
function UrnImage(props) {
|
|
1408
1660
|
const { uri } = props;
|
|
1409
1661
|
if (isUrnIllustration(uri)) {
|
|
1410
|
-
return /* @__PURE__ */ (0,
|
|
1662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(UrnIllustration, __spreadValues({}, props));
|
|
1411
1663
|
}
|
|
1412
1664
|
if (isUrnFlag(uri)) {
|
|
1413
|
-
return /* @__PURE__ */ (0,
|
|
1665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(UrnFlagImage, __spreadValues({}, props));
|
|
1414
1666
|
}
|
|
1415
1667
|
return null;
|
|
1416
1668
|
}
|
|
1417
1669
|
|
|
1418
1670
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
1419
|
-
var
|
|
1671
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1420
1672
|
var ImageRenderer = {
|
|
1421
1673
|
canRenderType: "image",
|
|
1422
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
1674
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(UrlImage, __spreadValues({}, props))
|
|
1423
1675
|
};
|
|
1424
1676
|
|
|
1425
1677
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
1426
1678
|
var ImageRenderer_default = ImageRenderer;
|
|
1427
1679
|
|
|
1428
1680
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1681
|
+
var import_components22 = require("@transferwise/components");
|
|
1682
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1431
1683
|
var doContext = ["positive", "neutral"];
|
|
1432
1684
|
var dontContext = ["warning", "negative"];
|
|
1433
1685
|
var InstructionsRenderer = {
|
|
@@ -1435,16 +1687,16 @@ var InstructionsRenderer = {
|
|
|
1435
1687
|
render: ({ items, margin, title }) => {
|
|
1436
1688
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1437
1689
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1438
|
-
return /* @__PURE__ */ (0,
|
|
1439
|
-
title ? /* @__PURE__ */ (0,
|
|
1440
|
-
/* @__PURE__ */ (0,
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: getMargin(margin), children: [
|
|
1691
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components22.Header, { title }) : null,
|
|
1692
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components22.InstructionsList, { dos, donts })
|
|
1441
1693
|
] });
|
|
1442
1694
|
}
|
|
1443
1695
|
};
|
|
1444
1696
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1445
1697
|
|
|
1446
1698
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1447
|
-
var
|
|
1699
|
+
var import_components23 = require("@transferwise/components");
|
|
1448
1700
|
|
|
1449
1701
|
// ../renderers/src/utils/input-utils.ts
|
|
1450
1702
|
var onWheel = (event) => {
|
|
@@ -1469,7 +1721,7 @@ function pick(obj, ...keys) {
|
|
|
1469
1721
|
}
|
|
1470
1722
|
|
|
1471
1723
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1472
|
-
var
|
|
1724
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1473
1725
|
var IntegerInputRenderer = {
|
|
1474
1726
|
canRenderType: "input-integer",
|
|
1475
1727
|
render: (props) => {
|
|
@@ -1484,7 +1736,7 @@ var IntegerInputRenderer = {
|
|
|
1484
1736
|
"maximum",
|
|
1485
1737
|
"minimum"
|
|
1486
1738
|
);
|
|
1487
|
-
return /* @__PURE__ */ (0,
|
|
1739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1488
1740
|
FieldInput_default,
|
|
1489
1741
|
{
|
|
1490
1742
|
id,
|
|
@@ -1492,8 +1744,8 @@ var IntegerInputRenderer = {
|
|
|
1492
1744
|
description,
|
|
1493
1745
|
validation: validationState,
|
|
1494
1746
|
help,
|
|
1495
|
-
children: /* @__PURE__ */ (0,
|
|
1496
|
-
|
|
1747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components23.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1748
|
+
import_components23.Input,
|
|
1497
1749
|
__spreadValues({
|
|
1498
1750
|
id,
|
|
1499
1751
|
name: id,
|
|
@@ -1514,13 +1766,122 @@ var IntegerInputRenderer = {
|
|
|
1514
1766
|
};
|
|
1515
1767
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
1516
1768
|
|
|
1769
|
+
// ../renderers/src/ListRenderer.tsx
|
|
1770
|
+
var import_components26 = require("@transferwise/components");
|
|
1771
|
+
|
|
1772
|
+
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
1773
|
+
var import_components24 = require("@transferwise/components");
|
|
1774
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1775
|
+
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
1776
|
+
if (!callToAction) {
|
|
1777
|
+
return void 0;
|
|
1778
|
+
}
|
|
1779
|
+
const { accessibilityDescription, href, title, context, onClick } = callToAction;
|
|
1780
|
+
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
1781
|
+
if (href) {
|
|
1782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1783
|
+
import_components24.ListItem.Button,
|
|
1784
|
+
{
|
|
1785
|
+
href,
|
|
1786
|
+
partiallyInteractive: !fullyInteractive,
|
|
1787
|
+
priority,
|
|
1788
|
+
"aria-description": accessibilityDescription,
|
|
1789
|
+
sentiment,
|
|
1790
|
+
children: title
|
|
1791
|
+
}
|
|
1792
|
+
);
|
|
1793
|
+
}
|
|
1794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1795
|
+
import_components24.ListItem.Button,
|
|
1796
|
+
{
|
|
1797
|
+
"aria-description": accessibilityDescription,
|
|
1798
|
+
partiallyInteractive: !fullyInteractive,
|
|
1799
|
+
priority,
|
|
1800
|
+
sentiment,
|
|
1801
|
+
onClick,
|
|
1802
|
+
children: title
|
|
1803
|
+
}
|
|
1804
|
+
);
|
|
1805
|
+
};
|
|
1806
|
+
var getPriorityAndSentiment = (ctaSecondary, context) => {
|
|
1807
|
+
if (context === "negative") {
|
|
1808
|
+
return { priority: "secondary", sentiment: "negative" };
|
|
1809
|
+
}
|
|
1810
|
+
return { priority: ctaSecondary ? "secondary" : "secondary-neutral", sentiment: "default" };
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
// ../renderers/src/components/Header.tsx
|
|
1814
|
+
var import_components25 = require("@transferwise/components");
|
|
1815
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1816
|
+
var Header5 = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components25.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
1817
|
+
var getHeaderAction = (callToAction) => {
|
|
1818
|
+
if (!callToAction) {
|
|
1819
|
+
return void 0;
|
|
1820
|
+
}
|
|
1821
|
+
const { accessibilityDescription, href, title, onClick } = callToAction;
|
|
1822
|
+
return href ? {
|
|
1823
|
+
"aria-label": accessibilityDescription,
|
|
1824
|
+
text: title,
|
|
1825
|
+
href,
|
|
1826
|
+
target: "_blank"
|
|
1827
|
+
} : {
|
|
1828
|
+
"aria-label": accessibilityDescription,
|
|
1829
|
+
text: title,
|
|
1830
|
+
onClick: (event) => {
|
|
1831
|
+
event.preventDefault();
|
|
1832
|
+
onClick();
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1837
|
+
// ../renderers/src/ListRenderer.tsx
|
|
1838
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1839
|
+
var ListRenderer = {
|
|
1840
|
+
canRenderType: "list",
|
|
1841
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(margin), children: [
|
|
1842
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Header5, { title, callToAction }),
|
|
1843
|
+
items.map((item) => {
|
|
1844
|
+
var _a, _b;
|
|
1845
|
+
const {
|
|
1846
|
+
title: itemTitle,
|
|
1847
|
+
description,
|
|
1848
|
+
supportingValues,
|
|
1849
|
+
media,
|
|
1850
|
+
additionalInfo,
|
|
1851
|
+
inlineAlert,
|
|
1852
|
+
callToAction: itemCallToAction,
|
|
1853
|
+
tags: itemTags
|
|
1854
|
+
} = item;
|
|
1855
|
+
const controlOptions = {
|
|
1856
|
+
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
1857
|
+
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
1858
|
+
};
|
|
1859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1860
|
+
import_components26.ListItem,
|
|
1861
|
+
{
|
|
1862
|
+
title: itemTitle,
|
|
1863
|
+
subtitle: description,
|
|
1864
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
1865
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
1866
|
+
media: getMedia(media, shouldUseAvatar(control, itemTags)),
|
|
1867
|
+
prompt: getInlineAlert(inlineAlert),
|
|
1868
|
+
additionalInfo: getAdditionalInfo(additionalInfo),
|
|
1869
|
+
control: getCTAControl(itemCallToAction, controlOptions)
|
|
1870
|
+
},
|
|
1871
|
+
itemTitle
|
|
1872
|
+
);
|
|
1873
|
+
})
|
|
1874
|
+
] })
|
|
1875
|
+
};
|
|
1876
|
+
var ListRenderer_default = ListRenderer;
|
|
1877
|
+
|
|
1517
1878
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1518
|
-
var
|
|
1519
|
-
var
|
|
1879
|
+
var import_components27 = require("@transferwise/components");
|
|
1880
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1520
1881
|
var LoadingIndicatorRenderer = {
|
|
1521
1882
|
canRenderType: "loading-indicator",
|
|
1522
|
-
render: ({ margin, size }) => /* @__PURE__ */ (0,
|
|
1523
|
-
|
|
1883
|
+
render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1884
|
+
import_components27.Loader,
|
|
1524
1885
|
{
|
|
1525
1886
|
size,
|
|
1526
1887
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
|
|
@@ -1531,12 +1892,12 @@ var LoadingIndicatorRenderer = {
|
|
|
1531
1892
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
1532
1893
|
|
|
1533
1894
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1534
|
-
var
|
|
1535
|
-
var
|
|
1895
|
+
var import_components28 = require("@transferwise/components");
|
|
1896
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1536
1897
|
var MarkdownRenderer = {
|
|
1537
1898
|
canRenderType: "markdown",
|
|
1538
|
-
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0,
|
|
1539
|
-
|
|
1899
|
+
render: ({ content, align, margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
1900
|
+
import_components28.Markdown,
|
|
1540
1901
|
{
|
|
1541
1902
|
className: ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large",
|
|
1542
1903
|
config: { link: { target: "_blank" } },
|
|
@@ -1546,22 +1907,69 @@ var MarkdownRenderer = {
|
|
|
1546
1907
|
};
|
|
1547
1908
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1548
1909
|
|
|
1910
|
+
// ../renderers/src/MediaRenderer.tsx
|
|
1911
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1912
|
+
var MediaRenderer = {
|
|
1913
|
+
canRenderType: "media",
|
|
1914
|
+
render: (_a) => {
|
|
1915
|
+
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
1916
|
+
switch (media.type) {
|
|
1917
|
+
case "avatar":
|
|
1918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
1919
|
+
case "image":
|
|
1920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
1921
|
+
case "legacy":
|
|
1922
|
+
return null;
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
};
|
|
1926
|
+
var AvatarMediaRendererComponent = ({
|
|
1927
|
+
media,
|
|
1928
|
+
align,
|
|
1929
|
+
margin,
|
|
1930
|
+
size
|
|
1931
|
+
}) => {
|
|
1932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: `df-media-layout-avatar ${align} ${getMargin(margin)}`, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Media, { media, size: mapAvatarMediaSize(size) }) });
|
|
1933
|
+
};
|
|
1934
|
+
var ImageMediaRendererComponent = (_a) => {
|
|
1935
|
+
var _b = _a, {
|
|
1936
|
+
media
|
|
1937
|
+
} = _b, rest = __objRest(_b, [
|
|
1938
|
+
"media"
|
|
1939
|
+
]);
|
|
1940
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(UrnImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(UrlImage, __spreadValues({ uri: media.uri, accessibilityDescription: media.accessibilityDescription }, rest));
|
|
1941
|
+
};
|
|
1942
|
+
var mapAvatarMediaSize = (size) => {
|
|
1943
|
+
switch (size) {
|
|
1944
|
+
case "xs":
|
|
1945
|
+
return 32;
|
|
1946
|
+
case "sm":
|
|
1947
|
+
return 40;
|
|
1948
|
+
case "md":
|
|
1949
|
+
return 48;
|
|
1950
|
+
case "lg":
|
|
1951
|
+
return 56;
|
|
1952
|
+
case "xl":
|
|
1953
|
+
return 72;
|
|
1954
|
+
}
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1549
1957
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
1550
|
-
var
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
1958
|
+
var import_components29 = require("@transferwise/components");
|
|
1959
|
+
var import_react8 = require("react");
|
|
1960
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1553
1961
|
var ModalLayoutRenderer = {
|
|
1554
1962
|
canRenderType: "modal-layout",
|
|
1555
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
1963
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DFModal, __spreadValues({}, props))
|
|
1556
1964
|
};
|
|
1557
1965
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
1558
1966
|
function DFModal({ content, margin, trigger }) {
|
|
1559
|
-
const [visible, setVisible] = (0,
|
|
1967
|
+
const [visible, setVisible] = (0, import_react8.useState)(false);
|
|
1560
1968
|
const { children, title } = content;
|
|
1561
|
-
return /* @__PURE__ */ (0,
|
|
1562
|
-
/* @__PURE__ */ (0,
|
|
1563
|
-
/* @__PURE__ */ (0,
|
|
1564
|
-
|
|
1969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: getMargin(margin), children: [
|
|
1970
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components29.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1971
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
1972
|
+
import_components29.Modal,
|
|
1565
1973
|
{
|
|
1566
1974
|
scroll: "content",
|
|
1567
1975
|
open: visible,
|
|
@@ -1575,60 +1983,21 @@ function DFModal({ content, margin, trigger }) {
|
|
|
1575
1983
|
}
|
|
1576
1984
|
|
|
1577
1985
|
// ../renderers/src/ModalRenderer.tsx
|
|
1578
|
-
var
|
|
1579
|
-
var
|
|
1986
|
+
var import_components30 = require("@transferwise/components");
|
|
1987
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1580
1988
|
var ModalRenderer = {
|
|
1581
1989
|
canRenderType: "modal",
|
|
1582
1990
|
render: ({ title, children, open, onClose }) => {
|
|
1583
|
-
return /* @__PURE__ */ (0,
|
|
1991
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components30.Modal, { open, title, body: children, onClose });
|
|
1584
1992
|
}
|
|
1585
1993
|
};
|
|
1586
1994
|
|
|
1587
1995
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
1588
|
-
var
|
|
1589
|
-
var
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
var
|
|
1593
|
-
return knownTags.map((tag) => {
|
|
1594
|
-
return { tag, items: items.filter((item) => {
|
|
1595
|
-
var _a;
|
|
1596
|
-
return (_a = item.tags) == null ? void 0 : _a.includes(tag);
|
|
1597
|
-
}) };
|
|
1598
|
-
}).filter((group) => group.items.length > 0);
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
|
-
// ../renderers/src/MoneyInputRenderer.tsx
|
|
1602
|
-
var import_react_intl8 = require("react-intl");
|
|
1603
|
-
|
|
1604
|
-
// ../renderers/src/messages/group.messages.ts
|
|
1605
|
-
var import_react_intl7 = require("react-intl");
|
|
1606
|
-
var group_messages_default = (0, import_react_intl7.defineMessages)({
|
|
1607
|
-
all: {
|
|
1608
|
-
id: "df.wise.group.all",
|
|
1609
|
-
defaultMessage: "All",
|
|
1610
|
-
description: "Label for the group of options that encompasses all options"
|
|
1611
|
-
},
|
|
1612
|
-
popular: {
|
|
1613
|
-
id: "df.wise.group.popular",
|
|
1614
|
-
defaultMessage: "Popular",
|
|
1615
|
-
description: "Label for the group of options that are tagged as popular"
|
|
1616
|
-
},
|
|
1617
|
-
recent: {
|
|
1618
|
-
id: "df.wise.group.recent",
|
|
1619
|
-
defaultMessage: "Recent",
|
|
1620
|
-
description: "Label for the group of options that are tagged as recent"
|
|
1621
|
-
},
|
|
1622
|
-
"currencies-with-account-details": {
|
|
1623
|
-
id: "df.wise.group.currencies-with-account-details",
|
|
1624
|
-
defaultMessage: "Currencies with account details",
|
|
1625
|
-
description: "Label for the group of options that are tagged as currencies with account details"
|
|
1626
|
-
}
|
|
1627
|
-
});
|
|
1628
|
-
|
|
1629
|
-
// ../renderers/src/MoneyInputRenderer.tsx
|
|
1630
|
-
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1631
|
-
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1996
|
+
var import_components31 = require("@transferwise/components");
|
|
1997
|
+
var import_react9 = require("react");
|
|
1998
|
+
var import_react_intl11 = require("react-intl");
|
|
1999
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2000
|
+
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
1632
2001
|
var MoneyInputRenderer = {
|
|
1633
2002
|
canRenderType: "money-input",
|
|
1634
2003
|
render: MoneyInputRendererComponent
|
|
@@ -1648,13 +2017,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
1648
2017
|
onAmountChange,
|
|
1649
2018
|
onCurrencyChange
|
|
1650
2019
|
} = props;
|
|
1651
|
-
(0,
|
|
2020
|
+
(0, import_react9.useEffect)(() => {
|
|
1652
2021
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
1653
2022
|
onCurrencyChange(0);
|
|
1654
2023
|
}
|
|
1655
2024
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
1656
|
-
const { formatMessage } = (0,
|
|
1657
|
-
return /* @__PURE__ */ (0,
|
|
2025
|
+
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
2026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
1658
2027
|
FieldInput_default,
|
|
1659
2028
|
{
|
|
1660
2029
|
id: uid,
|
|
@@ -1662,8 +2031,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
1662
2031
|
description,
|
|
1663
2032
|
validation: validationState,
|
|
1664
2033
|
help,
|
|
1665
|
-
children: /* @__PURE__ */ (0,
|
|
1666
|
-
|
|
2034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2035
|
+
import_components31.MoneyInput,
|
|
1667
2036
|
{
|
|
1668
2037
|
amount: parseFloatOrNull(amountValue),
|
|
1669
2038
|
searchPlaceholder: "",
|
|
@@ -1691,7 +2060,7 @@ var parseFloatOrNull = (value) => {
|
|
|
1691
2060
|
return Number.isNaN(parsed) ? null : parsed;
|
|
1692
2061
|
};
|
|
1693
2062
|
var mapCurrencies = (options, formatMessage) => {
|
|
1694
|
-
const groupsFromTags = getGroupsFromTags(
|
|
2063
|
+
const groupsFromTags = getGroupsFromTags(groupingTags2, options);
|
|
1695
2064
|
if (groupsFromTags.length > 0) {
|
|
1696
2065
|
return [...groupsFromTags, { tag: "all", items: options }].flatMap(({ tag, items }) => {
|
|
1697
2066
|
return [
|
|
@@ -1723,14 +2092,79 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
1723
2092
|
}
|
|
1724
2093
|
}
|
|
1725
2094
|
|
|
1726
|
-
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1727
|
-
var
|
|
1728
|
-
var
|
|
1729
|
-
|
|
2095
|
+
// ../renderers/src/MultiSelectInputRenderer/InlineMultiSelectInputRendererComponent.tsx
|
|
2096
|
+
var import_components32 = require("@transferwise/components");
|
|
2097
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2098
|
+
function InlineMultiSelectInputRendererComponent(props) {
|
|
2099
|
+
const {
|
|
2100
|
+
id,
|
|
2101
|
+
description,
|
|
2102
|
+
disabled,
|
|
2103
|
+
help,
|
|
2104
|
+
options,
|
|
2105
|
+
selectedIndices,
|
|
2106
|
+
title,
|
|
2107
|
+
validationState,
|
|
2108
|
+
onSelect
|
|
2109
|
+
} = props;
|
|
2110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2111
|
+
FieldInput_default,
|
|
2112
|
+
{
|
|
2113
|
+
id,
|
|
2114
|
+
label: title,
|
|
2115
|
+
help,
|
|
2116
|
+
description,
|
|
2117
|
+
validation: validationState,
|
|
2118
|
+
children: options.map((option, index) => {
|
|
2119
|
+
var _a;
|
|
2120
|
+
const {
|
|
2121
|
+
title: itemTitle,
|
|
2122
|
+
description: subtitle,
|
|
2123
|
+
disabled: optionDisabled,
|
|
2124
|
+
media,
|
|
2125
|
+
additionalText,
|
|
2126
|
+
inlineAlert,
|
|
2127
|
+
supportingValues,
|
|
2128
|
+
childrenProps
|
|
2129
|
+
} = option;
|
|
2130
|
+
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
2131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2132
|
+
import_components32.ListItem,
|
|
2133
|
+
{
|
|
2134
|
+
title: itemTitle,
|
|
2135
|
+
subtitle,
|
|
2136
|
+
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
2137
|
+
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
2138
|
+
media: getMedia(media, false),
|
|
2139
|
+
prompt: getInlineAlert(inlineAlert),
|
|
2140
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components32.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
2141
|
+
disabled: disabled || optionDisabled,
|
|
2142
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2143
|
+
import_components32.ListItem.Checkbox,
|
|
2144
|
+
{
|
|
2145
|
+
checked: selectedIndices.includes(index),
|
|
2146
|
+
onChange: (e) => {
|
|
2147
|
+
const newSelectedIndices = e.target.checked ? [...selectedIndices, index] : selectedIndices.filter((i) => i !== index);
|
|
2148
|
+
onSelect(newSelectedIndices);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
)
|
|
2152
|
+
},
|
|
2153
|
+
key
|
|
2154
|
+
);
|
|
2155
|
+
})
|
|
2156
|
+
}
|
|
2157
|
+
);
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRendererComponent.tsx
|
|
2161
|
+
var import_components33 = require("@transferwise/components");
|
|
2162
|
+
var import_react10 = require("react");
|
|
2163
|
+
var import_react_intl13 = require("react-intl");
|
|
1730
2164
|
|
|
1731
2165
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
1732
|
-
var
|
|
1733
|
-
var multi_select_messages_default = (0,
|
|
2166
|
+
var import_react_intl12 = require("react-intl");
|
|
2167
|
+
var multi_select_messages_default = (0, import_react_intl12.defineMessages)({
|
|
1734
2168
|
summary: {
|
|
1735
2169
|
id: "df.wise.MultiSelect.summary",
|
|
1736
2170
|
defaultMessage: "{first} and {count} more",
|
|
@@ -1738,15 +2172,11 @@ var multi_select_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
1738
2172
|
}
|
|
1739
2173
|
});
|
|
1740
2174
|
|
|
1741
|
-
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1742
|
-
var
|
|
1743
|
-
var MultiSelectInputRenderer = {
|
|
1744
|
-
canRenderType: "input-multi-select",
|
|
1745
|
-
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1746
|
-
};
|
|
2175
|
+
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRendererComponent.tsx
|
|
2176
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
1747
2177
|
function MultiSelectInputRendererComponent(props) {
|
|
1748
|
-
const { formatMessage } = (0,
|
|
1749
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
2178
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
2179
|
+
const [stagedIndices, setStagedIndices] = (0, import_react10.useState)();
|
|
1750
2180
|
const {
|
|
1751
2181
|
id,
|
|
1752
2182
|
autoComplete,
|
|
@@ -1784,12 +2214,12 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1784
2214
|
const contentProps = {
|
|
1785
2215
|
title: option.title,
|
|
1786
2216
|
description: option.description,
|
|
1787
|
-
icon: /* @__PURE__ */ (0,
|
|
2217
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
1788
2218
|
};
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
2219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components33.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1790
2220
|
};
|
|
1791
2221
|
const extraProps = { autoComplete };
|
|
1792
|
-
return /* @__PURE__ */ (0,
|
|
2222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
1793
2223
|
FieldInput_default,
|
|
1794
2224
|
{
|
|
1795
2225
|
id,
|
|
@@ -1797,8 +2227,8 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1797
2227
|
help,
|
|
1798
2228
|
description,
|
|
1799
2229
|
validation: validationState,
|
|
1800
|
-
children: /* @__PURE__ */ (0,
|
|
1801
|
-
|
|
2230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2231
|
+
import_components33.SelectInput,
|
|
1802
2232
|
__spreadValues({
|
|
1803
2233
|
id,
|
|
1804
2234
|
items: options.map((option, index) => {
|
|
@@ -1834,15 +2264,23 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1834
2264
|
}
|
|
1835
2265
|
);
|
|
1836
2266
|
}
|
|
1837
|
-
var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
1838
|
-
|
|
1839
|
-
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1840
|
-
var import_components27 = require("@transferwise/components");
|
|
1841
2267
|
|
|
1842
|
-
// ../renderers/src/
|
|
1843
|
-
var
|
|
2268
|
+
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
2269
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2270
|
+
var MultiSelectInputRenderer = {
|
|
2271
|
+
canRenderType: "input-multi-select",
|
|
2272
|
+
render: (props) => {
|
|
2273
|
+
return props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(InlineMultiSelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(MultiSelectInputRendererComponent, __spreadValues({}, props));
|
|
2274
|
+
}
|
|
2275
|
+
};
|
|
2276
|
+
|
|
2277
|
+
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
2278
|
+
var import_components35 = require("@transferwise/components");
|
|
2279
|
+
|
|
2280
|
+
// ../renderers/src/components/UploadFieldInput.tsx
|
|
2281
|
+
var import_components34 = require("@transferwise/components");
|
|
1844
2282
|
var import_classnames4 = __toESM(require_classnames());
|
|
1845
|
-
var
|
|
2283
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
1846
2284
|
function UploadFieldInput({
|
|
1847
2285
|
id,
|
|
1848
2286
|
children,
|
|
@@ -1851,18 +2289,18 @@ function UploadFieldInput({
|
|
|
1851
2289
|
help,
|
|
1852
2290
|
validation
|
|
1853
2291
|
}) {
|
|
1854
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
2292
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
1855
2293
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1856
|
-
return /* @__PURE__ */ (0,
|
|
2294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
1857
2295
|
"div",
|
|
1858
2296
|
{
|
|
1859
2297
|
className: (0, import_classnames4.default)("form-group d-block", {
|
|
1860
2298
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
1861
2299
|
}),
|
|
1862
2300
|
children: [
|
|
1863
|
-
/* @__PURE__ */ (0,
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1864
2302
|
children,
|
|
1865
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2303
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components34.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
1866
2304
|
]
|
|
1867
2305
|
}
|
|
1868
2306
|
);
|
|
@@ -1897,7 +2335,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
1897
2335
|
};
|
|
1898
2336
|
|
|
1899
2337
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1900
|
-
var
|
|
2338
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
1901
2339
|
var MultiUploadInputRenderer = {
|
|
1902
2340
|
canRenderType: "input-upload-multi",
|
|
1903
2341
|
render: (props) => {
|
|
@@ -1922,7 +2360,7 @@ var MultiUploadInputRenderer = {
|
|
|
1922
2360
|
};
|
|
1923
2361
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
1924
2362
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1925
|
-
return /* @__PURE__ */ (0,
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
1926
2364
|
UploadFieldInput_default,
|
|
1927
2365
|
{
|
|
1928
2366
|
id,
|
|
@@ -1930,8 +2368,8 @@ var MultiUploadInputRenderer = {
|
|
|
1930
2368
|
description,
|
|
1931
2369
|
validation: validationState,
|
|
1932
2370
|
help,
|
|
1933
|
-
children: /* @__PURE__ */ (0,
|
|
1934
|
-
|
|
2371
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2372
|
+
import_components35.UploadInput,
|
|
1935
2373
|
{
|
|
1936
2374
|
id,
|
|
1937
2375
|
"aria-describedby": descriptionId,
|
|
@@ -1940,7 +2378,7 @@ var MultiUploadInputRenderer = {
|
|
|
1940
2378
|
files: value.map(({ id: id2, file, validationState: validationState2 }) => ({
|
|
1941
2379
|
id: id2,
|
|
1942
2380
|
filename: file.name,
|
|
1943
|
-
status: (validationState2 == null ? void 0 : validationState2.status) === "invalid" ?
|
|
2381
|
+
status: (validationState2 == null ? void 0 : validationState2.status) === "invalid" ? import_components35.Status.FAILED : import_components35.Status.SUCCEEDED
|
|
1944
2382
|
})),
|
|
1945
2383
|
fileTypes: acceptsToFileTypes(accepts),
|
|
1946
2384
|
maxFiles: maxItems,
|
|
@@ -1958,8 +2396,8 @@ var MultiUploadInputRenderer = {
|
|
|
1958
2396
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
1959
2397
|
|
|
1960
2398
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1961
|
-
var
|
|
1962
|
-
var
|
|
2399
|
+
var import_components36 = require("@transferwise/components");
|
|
2400
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
1963
2401
|
var NumberInputRenderer = {
|
|
1964
2402
|
canRenderType: "input-number",
|
|
1965
2403
|
render: (props) => {
|
|
@@ -1973,7 +2411,7 @@ var NumberInputRenderer = {
|
|
|
1973
2411
|
"maximum",
|
|
1974
2412
|
"minimum"
|
|
1975
2413
|
);
|
|
1976
|
-
return /* @__PURE__ */ (0,
|
|
2414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
1977
2415
|
FieldInput_default,
|
|
1978
2416
|
{
|
|
1979
2417
|
id,
|
|
@@ -1981,8 +2419,8 @@ var NumberInputRenderer = {
|
|
|
1981
2419
|
description,
|
|
1982
2420
|
validation: validationState,
|
|
1983
2421
|
help,
|
|
1984
|
-
children: /* @__PURE__ */ (0,
|
|
1985
|
-
|
|
2422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components36.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2423
|
+
import_components36.Input,
|
|
1986
2424
|
__spreadValues({
|
|
1987
2425
|
id,
|
|
1988
2426
|
name: id,
|
|
@@ -2002,24 +2440,24 @@ var NumberInputRenderer = {
|
|
|
2002
2440
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
2003
2441
|
|
|
2004
2442
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2005
|
-
var
|
|
2443
|
+
var import_react_intl15 = require("react-intl");
|
|
2006
2444
|
|
|
2007
2445
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
2008
|
-
var
|
|
2009
|
-
var
|
|
2446
|
+
var import_components37 = require("@transferwise/components");
|
|
2447
|
+
var import_react11 = require("react");
|
|
2010
2448
|
function useSnackBarIfAvailable() {
|
|
2011
|
-
const context = (0,
|
|
2449
|
+
const context = (0, import_react11.useContext)(import_components37.SnackbarContext);
|
|
2012
2450
|
return context ? context.createSnackbar : () => {
|
|
2013
2451
|
};
|
|
2014
2452
|
}
|
|
2015
2453
|
|
|
2016
2454
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2017
|
-
var
|
|
2455
|
+
var import_components38 = require("@transferwise/components");
|
|
2018
2456
|
var import_classnames5 = __toESM(require_classnames());
|
|
2019
2457
|
|
|
2020
2458
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
2021
|
-
var
|
|
2022
|
-
var paragraph_messages_default = (0,
|
|
2459
|
+
var import_react_intl14 = require("react-intl");
|
|
2460
|
+
var paragraph_messages_default = (0, import_react_intl14.defineMessages)({
|
|
2023
2461
|
copy: {
|
|
2024
2462
|
id: "df.wise.DynamicParagraph.copy",
|
|
2025
2463
|
defaultMessage: "Copy",
|
|
@@ -2033,14 +2471,14 @@ var paragraph_messages_default = (0, import_react_intl11.defineMessages)({
|
|
|
2033
2471
|
});
|
|
2034
2472
|
|
|
2035
2473
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
2036
|
-
var
|
|
2474
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2037
2475
|
var ParagraphRenderer = {
|
|
2038
2476
|
canRenderType: "paragraph",
|
|
2039
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2477
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Paragraph, __spreadValues({}, props))
|
|
2040
2478
|
};
|
|
2041
2479
|
function Paragraph({ align, control, margin, size, text }) {
|
|
2042
2480
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
2043
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
2481
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2044
2482
|
"p",
|
|
2045
2483
|
{
|
|
2046
2484
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -2053,16 +2491,16 @@ function CopyableParagraph({
|
|
|
2053
2491
|
align,
|
|
2054
2492
|
className
|
|
2055
2493
|
}) {
|
|
2056
|
-
const { formatMessage } = (0,
|
|
2494
|
+
const { formatMessage } = (0, import_react_intl15.useIntl)();
|
|
2057
2495
|
const createSnackbar = useSnackBarIfAvailable();
|
|
2058
2496
|
const copy = () => {
|
|
2059
2497
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
2060
2498
|
});
|
|
2061
2499
|
};
|
|
2062
2500
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
2063
|
-
return /* @__PURE__ */ (0,
|
|
2064
|
-
/* @__PURE__ */ (0,
|
|
2065
|
-
|
|
2501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className, children: [
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2503
|
+
import_components38.Input,
|
|
2066
2504
|
{
|
|
2067
2505
|
type: "text",
|
|
2068
2506
|
value: text,
|
|
@@ -2070,21 +2508,44 @@ function CopyableParagraph({
|
|
|
2070
2508
|
className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
|
|
2071
2509
|
}
|
|
2072
2510
|
),
|
|
2073
|
-
/* @__PURE__ */ (0,
|
|
2511
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components38.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
2074
2512
|
] });
|
|
2075
2513
|
}
|
|
2076
2514
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
2077
2515
|
|
|
2516
|
+
// ../renderers/src/ProgressRenderer.tsx
|
|
2517
|
+
var import_components39 = require("@transferwise/components");
|
|
2518
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2519
|
+
var ProgressRenderer = {
|
|
2520
|
+
canRenderType: "progress",
|
|
2521
|
+
render: ({ uid, title, help, progress, progressText, margin, description }) => {
|
|
2522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
2523
|
+
import_components39.ProgressBar,
|
|
2524
|
+
{
|
|
2525
|
+
id: uid,
|
|
2526
|
+
className: getMargin(margin),
|
|
2527
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
2528
|
+
description,
|
|
2529
|
+
progress: {
|
|
2530
|
+
max: 1,
|
|
2531
|
+
value: progress
|
|
2532
|
+
},
|
|
2533
|
+
textEnd: progressText
|
|
2534
|
+
}
|
|
2535
|
+
);
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
|
|
2078
2539
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2079
|
-
var
|
|
2540
|
+
var import_components40 = require("@transferwise/components");
|
|
2080
2541
|
var import_icons = require("@transferwise/icons");
|
|
2081
2542
|
var import_classnames6 = __toESM(require_classnames());
|
|
2082
|
-
var
|
|
2083
|
-
var
|
|
2543
|
+
var import_react12 = require("react");
|
|
2544
|
+
var import_react_intl17 = require("react-intl");
|
|
2084
2545
|
|
|
2085
2546
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
2086
|
-
var
|
|
2087
|
-
var repeatable_messages_default = (0,
|
|
2547
|
+
var import_react_intl16 = require("react-intl");
|
|
2548
|
+
var repeatable_messages_default = (0, import_react_intl16.defineMessages)({
|
|
2088
2549
|
addItemTitle: {
|
|
2089
2550
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
2090
2551
|
defaultMessage: "Add Item",
|
|
@@ -2108,10 +2569,10 @@ var repeatable_messages_default = (0, import_react_intl13.defineMessages)({
|
|
|
2108
2569
|
});
|
|
2109
2570
|
|
|
2110
2571
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
2111
|
-
var
|
|
2572
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2112
2573
|
var RepeatableRenderer = {
|
|
2113
2574
|
canRenderType: "repeatable",
|
|
2114
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
2575
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Repeatable, __spreadValues({}, props))
|
|
2115
2576
|
};
|
|
2116
2577
|
function Repeatable(props) {
|
|
2117
2578
|
const {
|
|
@@ -2127,8 +2588,8 @@ function Repeatable(props) {
|
|
|
2127
2588
|
onSave,
|
|
2128
2589
|
onRemove
|
|
2129
2590
|
} = props;
|
|
2130
|
-
const { formatMessage } = (0,
|
|
2131
|
-
const [openModalType, setOpenModalType] = (0,
|
|
2591
|
+
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
2592
|
+
const [openModalType, setOpenModalType] = (0, import_react12.useState)(null);
|
|
2132
2593
|
const onAddItem = () => {
|
|
2133
2594
|
onAdd();
|
|
2134
2595
|
setOpenModalType("add");
|
|
@@ -2150,41 +2611,41 @@ function Repeatable(props) {
|
|
|
2150
2611
|
const onCancelEdit = () => {
|
|
2151
2612
|
setOpenModalType(null);
|
|
2152
2613
|
};
|
|
2153
|
-
return /* @__PURE__ */ (0,
|
|
2154
|
-
title && /* @__PURE__ */ (0,
|
|
2155
|
-
description && /* @__PURE__ */ (0,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
2615
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components40.Header, { title }),
|
|
2616
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { children: description }),
|
|
2617
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
2157
2618
|
"div",
|
|
2158
2619
|
{
|
|
2159
2620
|
className: (0, import_classnames6.default)("form-group", {
|
|
2160
2621
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
2161
2622
|
}),
|
|
2162
2623
|
children: [
|
|
2163
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
2164
|
-
/* @__PURE__ */ (0,
|
|
2165
|
-
|
|
2624
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
2625
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2626
|
+
import_components40.NavigationOption,
|
|
2166
2627
|
{
|
|
2167
|
-
media: /* @__PURE__ */ (0,
|
|
2628
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_icons.Plus, {}),
|
|
2168
2629
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2169
2630
|
showMediaAtAllSizes: true,
|
|
2170
2631
|
onClick: () => onAddItem()
|
|
2171
2632
|
}
|
|
2172
2633
|
),
|
|
2173
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
2634
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components40.InlineAlert, { type: "negative", children: validationState.message })
|
|
2174
2635
|
]
|
|
2175
2636
|
}
|
|
2176
2637
|
),
|
|
2177
|
-
/* @__PURE__ */ (0,
|
|
2178
|
-
|
|
2638
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2639
|
+
import_components40.Modal,
|
|
2179
2640
|
{
|
|
2180
2641
|
open: openModalType !== null,
|
|
2181
2642
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2182
|
-
body: /* @__PURE__ */ (0,
|
|
2183
|
-
/* @__PURE__ */ (0,
|
|
2184
|
-
/* @__PURE__ */ (0,
|
|
2185
|
-
/* @__PURE__ */ (0,
|
|
2186
|
-
/* @__PURE__ */ (0,
|
|
2187
|
-
|
|
2643
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
2645
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
2646
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components40.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
2647
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2648
|
+
import_components40.Button,
|
|
2188
2649
|
{
|
|
2189
2650
|
v2: true,
|
|
2190
2651
|
priority: "secondary",
|
|
@@ -2205,10 +2666,10 @@ function ItemSummaryOption({
|
|
|
2205
2666
|
item,
|
|
2206
2667
|
onClick
|
|
2207
2668
|
}) {
|
|
2208
|
-
return /* @__PURE__ */ (0,
|
|
2209
|
-
|
|
2669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2670
|
+
import_components40.NavigationOption,
|
|
2210
2671
|
{
|
|
2211
|
-
media: /* @__PURE__ */ (0,
|
|
2672
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
2212
2673
|
title: item.title,
|
|
2213
2674
|
content: item.description,
|
|
2214
2675
|
showMediaAtAllSizes: true,
|
|
@@ -2219,14 +2680,140 @@ function ItemSummaryOption({
|
|
|
2219
2680
|
}
|
|
2220
2681
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2221
2682
|
|
|
2222
|
-
// ../renderers/src/
|
|
2223
|
-
var
|
|
2224
|
-
var
|
|
2683
|
+
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
2684
|
+
var import_components41 = require("@transferwise/components");
|
|
2685
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2686
|
+
var ReviewRenderer = {
|
|
2687
|
+
canRenderType: "review",
|
|
2688
|
+
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
2689
|
+
const orientation = mapControlToDefinitionListLayout(control);
|
|
2690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: getMargin(margin), children: [
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Header5, { title, callToAction }),
|
|
2692
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2693
|
+
import_components41.DefinitionList,
|
|
2694
|
+
{
|
|
2695
|
+
layout: orientation,
|
|
2696
|
+
definitions: fields.map(
|
|
2697
|
+
({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
|
|
2698
|
+
key: String(index),
|
|
2699
|
+
value,
|
|
2700
|
+
title: getFieldLabel(
|
|
2701
|
+
label,
|
|
2702
|
+
help,
|
|
2703
|
+
() => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
|
|
2704
|
+
)
|
|
2705
|
+
})
|
|
2706
|
+
)
|
|
2707
|
+
}
|
|
2708
|
+
) })
|
|
2709
|
+
] });
|
|
2710
|
+
}
|
|
2711
|
+
};
|
|
2712
|
+
var ReviewLegacyRenderer_default = ReviewRenderer;
|
|
2713
|
+
var mapControlToDefinitionListLayout = (control) => {
|
|
2714
|
+
switch (control) {
|
|
2715
|
+
case "horizontal":
|
|
2716
|
+
case "horizontal-end-aligned":
|
|
2717
|
+
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
2718
|
+
case "horizontal-start-aligned":
|
|
2719
|
+
return "HORIZONTAL_LEFT_ALIGNED";
|
|
2720
|
+
case "vertical-two-column":
|
|
2721
|
+
return "VERTICAL_TWO_COLUMN";
|
|
2722
|
+
case "vertical":
|
|
2723
|
+
case "vertical-one-column":
|
|
2724
|
+
default:
|
|
2725
|
+
return "VERTICAL_ONE_COLUMN";
|
|
2726
|
+
}
|
|
2727
|
+
};
|
|
2728
|
+
var getFieldLabel = (label, help, onClick) => {
|
|
2729
|
+
if (help) {
|
|
2730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
2731
|
+
label,
|
|
2732
|
+
" ",
|
|
2733
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Help_default, { help, onClick })
|
|
2734
|
+
] });
|
|
2735
|
+
}
|
|
2736
|
+
return label;
|
|
2737
|
+
};
|
|
2738
|
+
|
|
2739
|
+
// ../renderers/src/ReviewRenderer.tsx
|
|
2740
|
+
var import_components42 = require("@transferwise/components");
|
|
2741
|
+
var import_icons2 = require("@transferwise/icons");
|
|
2225
2742
|
var import_react_intl18 = require("react-intl");
|
|
2743
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2744
|
+
var IGNORED_CONTROLS = [
|
|
2745
|
+
"horizontal",
|
|
2746
|
+
"horizontal-end-aligned",
|
|
2747
|
+
"horizontal-start-aligned",
|
|
2748
|
+
"vertical-two-column"
|
|
2749
|
+
];
|
|
2750
|
+
var ReviewRenderer2 = {
|
|
2751
|
+
canRenderType: "review",
|
|
2752
|
+
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
2753
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Review, __spreadValues({}, props))
|
|
2754
|
+
};
|
|
2755
|
+
var Review = ({
|
|
2756
|
+
callToAction,
|
|
2757
|
+
control,
|
|
2758
|
+
margin,
|
|
2759
|
+
fields,
|
|
2760
|
+
tags,
|
|
2761
|
+
title,
|
|
2762
|
+
trackEvent
|
|
2763
|
+
}) => {
|
|
2764
|
+
const intl = (0, import_react_intl18.useIntl)();
|
|
2765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: getMargin(margin), children: [
|
|
2766
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Header5, { title, callToAction }),
|
|
2767
|
+
fields.map((field) => {
|
|
2768
|
+
var _a, _b, _c;
|
|
2769
|
+
const {
|
|
2770
|
+
label,
|
|
2771
|
+
value,
|
|
2772
|
+
media,
|
|
2773
|
+
additionalInfo,
|
|
2774
|
+
inlineAlert,
|
|
2775
|
+
help,
|
|
2776
|
+
analyticsId,
|
|
2777
|
+
callToAction: itemCallToAction,
|
|
2778
|
+
tags: itemTags
|
|
2779
|
+
} = field;
|
|
2780
|
+
const controlOptions = {
|
|
2781
|
+
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
2782
|
+
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
2783
|
+
};
|
|
2784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
2785
|
+
import_components42.ListItem,
|
|
2786
|
+
{
|
|
2787
|
+
title: value,
|
|
2788
|
+
subtitle: label,
|
|
2789
|
+
inverted: true,
|
|
2790
|
+
media: getMedia(media, shouldUseAvatar(control, itemTags)),
|
|
2791
|
+
control: (_c = getCTAControl(itemCallToAction, controlOptions)) != null ? _c : help ? getHelpControl(
|
|
2792
|
+
help,
|
|
2793
|
+
intl.formatMessage(help_messages_default.helpAria),
|
|
2794
|
+
() => trackEvent("Help Pressed", { layoutItemId: analyticsId })
|
|
2795
|
+
) : void 0,
|
|
2796
|
+
prompt: getInlineAlert(inlineAlert),
|
|
2797
|
+
additionalInfo: getAdditionalInfo(additionalInfo)
|
|
2798
|
+
},
|
|
2799
|
+
JSON.stringify(field)
|
|
2800
|
+
);
|
|
2801
|
+
})
|
|
2802
|
+
] });
|
|
2803
|
+
};
|
|
2804
|
+
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
2805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components42.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components42.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components42.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_icons2.QuestionMarkCircle, {}) }) });
|
|
2806
|
+
};
|
|
2807
|
+
var ReviewRenderer_default = ReviewRenderer2;
|
|
2808
|
+
|
|
2809
|
+
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2810
|
+
var import_components44 = require("@transferwise/components");
|
|
2811
|
+
var import_react13 = require("react");
|
|
2812
|
+
var import_react_intl22 = require("react-intl");
|
|
2226
2813
|
|
|
2227
2814
|
// ../renderers/src/messages/search.messages.ts
|
|
2228
|
-
var
|
|
2229
|
-
var search_messages_default = (0,
|
|
2815
|
+
var import_react_intl19 = require("react-intl");
|
|
2816
|
+
var search_messages_default = (0, import_react_intl19.defineMessages)({
|
|
2230
2817
|
loading: {
|
|
2231
2818
|
id: "df.wise.SearchLayout.loading",
|
|
2232
2819
|
defaultMessage: "Loading...",
|
|
@@ -2235,11 +2822,11 @@ var search_messages_default = (0, import_react_intl15.defineMessages)({
|
|
|
2235
2822
|
});
|
|
2236
2823
|
|
|
2237
2824
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2238
|
-
var
|
|
2825
|
+
var import_react_intl21 = require("react-intl");
|
|
2239
2826
|
|
|
2240
2827
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
2241
|
-
var
|
|
2242
|
-
var generic_error_messages_default = (0,
|
|
2828
|
+
var import_react_intl20 = require("react-intl");
|
|
2829
|
+
var generic_error_messages_default = (0, import_react_intl20.defineMessages)({
|
|
2243
2830
|
genericErrorRetryHint: {
|
|
2244
2831
|
id: "df.wise.PersistAsyncSchema.genericError",
|
|
2245
2832
|
defaultMessage: "Something went wrong, please try again.",
|
|
@@ -2258,21 +2845,23 @@ var generic_error_messages_default = (0, import_react_intl16.defineMessages)({
|
|
|
2258
2845
|
});
|
|
2259
2846
|
|
|
2260
2847
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2261
|
-
var
|
|
2262
|
-
var
|
|
2848
|
+
var import_components43 = require("@transferwise/components");
|
|
2849
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
2263
2850
|
function ErrorResult({ state }) {
|
|
2264
|
-
const intl = (0,
|
|
2265
|
-
return /* @__PURE__ */ (0,
|
|
2851
|
+
const intl = (0, import_react_intl21.useIntl)();
|
|
2852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("p", { className: "m-t-2", children: [
|
|
2266
2853
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2267
2854
|
"\xA0",
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2855
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_components43.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
2269
2856
|
] });
|
|
2270
2857
|
}
|
|
2271
2858
|
|
|
2272
2859
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2273
|
-
var
|
|
2860
|
+
var import_icons3 = require("@transferwise/icons");
|
|
2861
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
2274
2862
|
function BlockSearchRendererComponent({
|
|
2275
2863
|
id,
|
|
2864
|
+
hint,
|
|
2276
2865
|
isLoading,
|
|
2277
2866
|
margin,
|
|
2278
2867
|
query,
|
|
@@ -2281,17 +2870,17 @@ function BlockSearchRendererComponent({
|
|
|
2281
2870
|
trackEvent,
|
|
2282
2871
|
onChange
|
|
2283
2872
|
}) {
|
|
2284
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2285
|
-
const { formatMessage } = (0,
|
|
2286
|
-
return /* @__PURE__ */ (0,
|
|
2287
|
-
/* @__PURE__ */ (0,
|
|
2288
|
-
|
|
2873
|
+
const [hasSearched, setHasSearched] = (0, import_react13.useState)(false);
|
|
2874
|
+
const { formatMessage } = (0, import_react_intl22.useIntl)();
|
|
2875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: getMargin(margin), children: [
|
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components44.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_icons3.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2877
|
+
import_components44.Input,
|
|
2289
2878
|
{
|
|
2290
2879
|
id,
|
|
2291
2880
|
name: id,
|
|
2881
|
+
placeholder: hint,
|
|
2292
2882
|
type: "text",
|
|
2293
2883
|
value: query,
|
|
2294
|
-
className: "m-t-1",
|
|
2295
2884
|
onChange: ({ currentTarget: { value } }) => {
|
|
2296
2885
|
if (!hasSearched) {
|
|
2297
2886
|
setHasSearched(true);
|
|
@@ -2300,8 +2889,8 @@ function BlockSearchRendererComponent({
|
|
|
2300
2889
|
onChange(value);
|
|
2301
2890
|
}
|
|
2302
2891
|
}
|
|
2303
|
-
) }),
|
|
2304
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
2892
|
+
) }) }),
|
|
2893
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SearchResultContent, { state, trackEvent })
|
|
2305
2894
|
] });
|
|
2306
2895
|
}
|
|
2307
2896
|
function SearchResultContent({
|
|
@@ -2310,39 +2899,42 @@ function SearchResultContent({
|
|
|
2310
2899
|
}) {
|
|
2311
2900
|
switch (state.type) {
|
|
2312
2901
|
case "error":
|
|
2313
|
-
return /* @__PURE__ */ (0,
|
|
2902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ErrorResult, { state });
|
|
2314
2903
|
case "results":
|
|
2315
|
-
return /* @__PURE__ */ (0,
|
|
2904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(SearchResults, { state, trackEvent });
|
|
2316
2905
|
case "noResults":
|
|
2317
|
-
return /* @__PURE__ */ (0,
|
|
2906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(EmptySearchResult, { state });
|
|
2318
2907
|
case "pending":
|
|
2319
2908
|
default:
|
|
2320
2909
|
return null;
|
|
2321
2910
|
}
|
|
2322
2911
|
}
|
|
2323
2912
|
function EmptySearchResult({ state }) {
|
|
2324
|
-
return /* @__PURE__ */ (0,
|
|
2913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components44.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2325
2914
|
}
|
|
2326
2915
|
function SearchResults({
|
|
2327
2916
|
state,
|
|
2328
2917
|
trackEvent
|
|
2329
2918
|
}) {
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components44.List, { children: state.results.map((result) => {
|
|
2331
2920
|
const { media } = result;
|
|
2332
|
-
return /* @__PURE__ */ (0,
|
|
2333
|
-
|
|
2921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2922
|
+
import_components44.ListItem,
|
|
2334
2923
|
{
|
|
2335
2924
|
title: result.title,
|
|
2336
|
-
|
|
2337
|
-
media: media ? /* @__PURE__ */ (0,
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2925
|
+
subtitle: result.description,
|
|
2926
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
2927
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
2928
|
+
import_components44.ListItem.Navigation,
|
|
2929
|
+
{
|
|
2930
|
+
onClick: () => {
|
|
2931
|
+
trackEvent("Search Result Selected", __spreadValues({
|
|
2932
|
+
type: result.type
|
|
2933
|
+
}, result.type === "action" ? { actionId: result.id } : {}));
|
|
2934
|
+
result.onClick();
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
)
|
|
2346
2938
|
},
|
|
2347
2939
|
JSON.stringify(result)
|
|
2348
2940
|
);
|
|
@@ -2351,13 +2943,14 @@ function SearchResults({
|
|
|
2351
2943
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
2352
2944
|
|
|
2353
2945
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2354
|
-
var
|
|
2355
|
-
var
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2358
|
-
var
|
|
2946
|
+
var import_components45 = require("@transferwise/components");
|
|
2947
|
+
var import_icons4 = require("@transferwise/icons");
|
|
2948
|
+
var import_react14 = require("react");
|
|
2949
|
+
var import_react_intl23 = require("react-intl");
|
|
2950
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
2359
2951
|
function InlineSearchRenderer({
|
|
2360
2952
|
id,
|
|
2953
|
+
hint,
|
|
2361
2954
|
isLoading,
|
|
2362
2955
|
margin,
|
|
2363
2956
|
onChange,
|
|
@@ -2365,20 +2958,21 @@ function InlineSearchRenderer({
|
|
|
2365
2958
|
title,
|
|
2366
2959
|
trackEvent
|
|
2367
2960
|
}) {
|
|
2368
|
-
const [hasSearched, setHasSearched] = (0,
|
|
2369
|
-
const intl = (0,
|
|
2370
|
-
return /* @__PURE__ */ (0,
|
|
2371
|
-
|
|
2961
|
+
const [hasSearched, setHasSearched] = (0, import_react14.useState)(false);
|
|
2962
|
+
const intl = (0, import_react_intl23.useIntl)();
|
|
2963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
2964
|
+
import_components45.Typeahead,
|
|
2372
2965
|
{
|
|
2373
2966
|
id: "typeahead-input-id",
|
|
2374
2967
|
intl,
|
|
2375
2968
|
name: "typeahead-input-name",
|
|
2376
2969
|
size: "md",
|
|
2970
|
+
placeholder: hint,
|
|
2377
2971
|
maxHeight: 100,
|
|
2378
|
-
footer: /* @__PURE__ */ (0,
|
|
2972
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
2379
2973
|
multiple: false,
|
|
2380
2974
|
clearable: false,
|
|
2381
|
-
addon: /* @__PURE__ */ (0,
|
|
2975
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons4.Search, { size: 24 }),
|
|
2382
2976
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2383
2977
|
minQueryLength: 1,
|
|
2384
2978
|
onChange: (values) => {
|
|
@@ -2413,33 +3007,33 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2413
3007
|
};
|
|
2414
3008
|
}
|
|
2415
3009
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2416
|
-
const { formatMessage } = (0,
|
|
3010
|
+
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
2417
3011
|
if (state.type === "noResults") {
|
|
2418
|
-
return /* @__PURE__ */ (0,
|
|
3012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components45.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2419
3013
|
}
|
|
2420
3014
|
if (state.type === "error") {
|
|
2421
|
-
return /* @__PURE__ */ (0,
|
|
3015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ErrorResult, { state }) });
|
|
2422
3016
|
}
|
|
2423
3017
|
if (state.type === "pending" || isLoading) {
|
|
2424
|
-
return /* @__PURE__ */ (0,
|
|
3018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
2425
3019
|
}
|
|
2426
3020
|
return null;
|
|
2427
3021
|
}
|
|
2428
3022
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2429
3023
|
|
|
2430
3024
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2431
|
-
var
|
|
3025
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
2432
3026
|
var SearchRenderer = {
|
|
2433
3027
|
canRenderType: "search",
|
|
2434
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
3028
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2435
3029
|
};
|
|
2436
3030
|
var SearchRenderer_default = SearchRenderer;
|
|
2437
3031
|
|
|
2438
3032
|
// ../renderers/src/SectionRenderer.tsx
|
|
2439
|
-
var
|
|
3033
|
+
var import_components46 = require("@transferwise/components");
|
|
2440
3034
|
|
|
2441
3035
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
2442
|
-
var
|
|
3036
|
+
var getHeaderAction2 = (callToAction) => {
|
|
2443
3037
|
if (!callToAction) {
|
|
2444
3038
|
return void 0;
|
|
2445
3039
|
}
|
|
@@ -2460,12 +3054,12 @@ var getHeaderAction = (callToAction) => {
|
|
|
2460
3054
|
};
|
|
2461
3055
|
|
|
2462
3056
|
// ../renderers/src/SectionRenderer.tsx
|
|
2463
|
-
var
|
|
3057
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
2464
3058
|
var SectionRenderer = {
|
|
2465
3059
|
canRenderType: "section",
|
|
2466
3060
|
render: ({ children, callToAction, margin, title }) => {
|
|
2467
|
-
return /* @__PURE__ */ (0,
|
|
2468
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
3061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("section", { className: getMargin(margin), children: [
|
|
3062
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components46.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
2469
3063
|
children
|
|
2470
3064
|
] });
|
|
2471
3065
|
}
|
|
@@ -2473,8 +3067,8 @@ var SectionRenderer = {
|
|
|
2473
3067
|
var SectionRenderer_default = SectionRenderer;
|
|
2474
3068
|
|
|
2475
3069
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2476
|
-
var
|
|
2477
|
-
var
|
|
3070
|
+
var import_components47 = require("@transferwise/components");
|
|
3071
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
2478
3072
|
function RadioInputRendererComponent(props) {
|
|
2479
3073
|
const {
|
|
2480
3074
|
id,
|
|
@@ -2488,8 +3082,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2488
3082
|
validationState,
|
|
2489
3083
|
onSelect
|
|
2490
3084
|
} = props;
|
|
2491
|
-
return /* @__PURE__ */ (0,
|
|
2492
|
-
/* @__PURE__ */ (0,
|
|
3085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
3086
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
2493
3087
|
FieldInput_default,
|
|
2494
3088
|
{
|
|
2495
3089
|
id,
|
|
@@ -2497,8 +3091,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2497
3091
|
help,
|
|
2498
3092
|
description,
|
|
2499
3093
|
validation: validationState,
|
|
2500
|
-
children: /* @__PURE__ */ (0,
|
|
2501
|
-
|
|
3094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3095
|
+
import_components47.RadioGroup,
|
|
2502
3096
|
{
|
|
2503
3097
|
name: id,
|
|
2504
3098
|
radios: options.map((option, index) => ({
|
|
@@ -2506,7 +3100,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2506
3100
|
value: index,
|
|
2507
3101
|
secondary: option.description,
|
|
2508
3102
|
disabled: option.disabled || disabled,
|
|
2509
|
-
avatar: /* @__PURE__ */ (0,
|
|
3103
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2510
3104
|
})),
|
|
2511
3105
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2512
3106
|
onChange: onSelect
|
|
@@ -2520,9 +3114,9 @@ function RadioInputRendererComponent(props) {
|
|
|
2520
3114
|
}
|
|
2521
3115
|
|
|
2522
3116
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2523
|
-
var
|
|
2524
|
-
var
|
|
2525
|
-
var
|
|
3117
|
+
var import_components48 = require("@transferwise/components");
|
|
3118
|
+
var import_react15 = require("react");
|
|
3119
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
2526
3120
|
function TabInputRendererComponent(props) {
|
|
2527
3121
|
const {
|
|
2528
3122
|
id,
|
|
@@ -2536,13 +3130,13 @@ function TabInputRendererComponent(props) {
|
|
|
2536
3130
|
validationState,
|
|
2537
3131
|
onSelect
|
|
2538
3132
|
} = props;
|
|
2539
|
-
(0,
|
|
3133
|
+
(0, import_react15.useEffect)(() => {
|
|
2540
3134
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
2541
3135
|
onSelect(0);
|
|
2542
3136
|
}
|
|
2543
3137
|
}, [selectedIndex, onSelect, options.length]);
|
|
2544
|
-
return /* @__PURE__ */ (0,
|
|
2545
|
-
/* @__PURE__ */ (0,
|
|
3138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
2546
3140
|
FieldInput_default,
|
|
2547
3141
|
{
|
|
2548
3142
|
id,
|
|
@@ -2550,8 +3144,8 @@ function TabInputRendererComponent(props) {
|
|
|
2550
3144
|
help,
|
|
2551
3145
|
description,
|
|
2552
3146
|
validation: validationState,
|
|
2553
|
-
children: /* @__PURE__ */ (0,
|
|
2554
|
-
|
|
3147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3148
|
+
import_components48.Tabs,
|
|
2555
3149
|
{
|
|
2556
3150
|
name: id,
|
|
2557
3151
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -2559,7 +3153,7 @@ function TabInputRendererComponent(props) {
|
|
|
2559
3153
|
title: option.title,
|
|
2560
3154
|
// if we pass null, we get some props-types console errors
|
|
2561
3155
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2562
|
-
content: /* @__PURE__ */ (0,
|
|
3156
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, {}),
|
|
2563
3157
|
disabled: option.disabled || disabled
|
|
2564
3158
|
})),
|
|
2565
3159
|
onTabSelect: onSelect
|
|
@@ -2573,8 +3167,8 @@ function TabInputRendererComponent(props) {
|
|
|
2573
3167
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2574
3168
|
|
|
2575
3169
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2576
|
-
var
|
|
2577
|
-
var
|
|
3170
|
+
var import_components49 = require("@transferwise/components");
|
|
3171
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
2578
3172
|
function SelectInputRendererComponent(props) {
|
|
2579
3173
|
const {
|
|
2580
3174
|
id,
|
|
@@ -2614,13 +3208,13 @@ function SelectInputRendererComponent(props) {
|
|
|
2614
3208
|
} : {
|
|
2615
3209
|
title: option.title,
|
|
2616
3210
|
description: option.description,
|
|
2617
|
-
icon: /* @__PURE__ */ (0,
|
|
3211
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
2618
3212
|
};
|
|
2619
|
-
return /* @__PURE__ */ (0,
|
|
3213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components49.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
2620
3214
|
};
|
|
2621
3215
|
const extraProps = { autoComplete };
|
|
2622
|
-
return /* @__PURE__ */ (0,
|
|
2623
|
-
/* @__PURE__ */ (0,
|
|
3216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
2624
3218
|
FieldInput_default,
|
|
2625
3219
|
{
|
|
2626
3220
|
id,
|
|
@@ -2628,8 +3222,8 @@ function SelectInputRendererComponent(props) {
|
|
|
2628
3222
|
help,
|
|
2629
3223
|
description,
|
|
2630
3224
|
validation: validationState,
|
|
2631
|
-
children: /* @__PURE__ */ (0,
|
|
2632
|
-
|
|
3225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
3226
|
+
import_components49.SelectInput,
|
|
2633
3227
|
__spreadValues({
|
|
2634
3228
|
name: id,
|
|
2635
3229
|
placeholder,
|
|
@@ -2649,9 +3243,9 @@ function SelectInputRendererComponent(props) {
|
|
|
2649
3243
|
}
|
|
2650
3244
|
|
|
2651
3245
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2652
|
-
var
|
|
2653
|
-
var
|
|
2654
|
-
var
|
|
3246
|
+
var import_react16 = require("react");
|
|
3247
|
+
var import_components50 = require("@transferwise/components");
|
|
3248
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
2655
3249
|
function SegmentedInputRendererComponent(props) {
|
|
2656
3250
|
const {
|
|
2657
3251
|
id,
|
|
@@ -2664,13 +3258,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2664
3258
|
validationState,
|
|
2665
3259
|
onSelect
|
|
2666
3260
|
} = props;
|
|
2667
|
-
(0,
|
|
3261
|
+
(0, import_react16.useEffect)(() => {
|
|
2668
3262
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
2669
3263
|
onSelect(0);
|
|
2670
3264
|
}
|
|
2671
3265
|
}, [selectedIndex, onSelect, options.length]);
|
|
2672
|
-
return /* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
3266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
2674
3268
|
FieldInput_default,
|
|
2675
3269
|
{
|
|
2676
3270
|
id,
|
|
@@ -2678,8 +3272,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2678
3272
|
help,
|
|
2679
3273
|
description,
|
|
2680
3274
|
validation: validationState,
|
|
2681
|
-
children: /* @__PURE__ */ (0,
|
|
2682
|
-
|
|
3275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3276
|
+
import_components50.SegmentedControl,
|
|
2683
3277
|
{
|
|
2684
3278
|
name: `${id}-segmented-control`,
|
|
2685
3279
|
value: String(selectedIndex),
|
|
@@ -2695,14 +3289,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2695
3289
|
)
|
|
2696
3290
|
}
|
|
2697
3291
|
),
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
3292
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { id: `${id}-children`, children })
|
|
2699
3293
|
] });
|
|
2700
3294
|
}
|
|
2701
3295
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2702
3296
|
|
|
2703
3297
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
2704
|
-
var
|
|
2705
|
-
var
|
|
3298
|
+
var import_components51 = require("@transferwise/components");
|
|
3299
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
2706
3300
|
function RadioItemRendererComponent(props) {
|
|
2707
3301
|
const {
|
|
2708
3302
|
id,
|
|
@@ -2716,23 +3310,23 @@ function RadioItemRendererComponent(props) {
|
|
|
2716
3310
|
validationState,
|
|
2717
3311
|
onSelect
|
|
2718
3312
|
} = props;
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
2720
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
2721
|
-
|
|
3313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
|
|
3314
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3315
|
+
import_components51.Header,
|
|
2722
3316
|
{
|
|
2723
3317
|
as: "h2",
|
|
2724
|
-
title: help ? /* @__PURE__ */ (0,
|
|
3318
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
2725
3319
|
}
|
|
2726
3320
|
),
|
|
2727
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
2728
|
-
/* @__PURE__ */ (0,
|
|
2729
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
2730
|
-
|
|
3321
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { children: rootDescription }),
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components51.List, { children: options.map(
|
|
3323
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3324
|
+
import_components51.ListItem,
|
|
2731
3325
|
__spreadValues({
|
|
2732
3326
|
title,
|
|
2733
3327
|
subtitle: description,
|
|
2734
|
-
control: /* @__PURE__ */ (0,
|
|
2735
|
-
|
|
3328
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3329
|
+
import_components51.ListItem.Radio,
|
|
2736
3330
|
{
|
|
2737
3331
|
name: title,
|
|
2738
3332
|
checked: selectedIndex === index,
|
|
@@ -2747,41 +3341,85 @@ function RadioItemRendererComponent(props) {
|
|
|
2747
3341
|
title
|
|
2748
3342
|
)
|
|
2749
3343
|
) }, `${id}-${selectedIndex}`),
|
|
2750
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
3344
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components51.InlineAlert, { type: "negative", children: validationState.message }),
|
|
2751
3345
|
children
|
|
2752
3346
|
] });
|
|
2753
3347
|
}
|
|
2754
3348
|
|
|
2755
3349
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2756
|
-
var
|
|
3350
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
2757
3351
|
var SelectInputRenderer = {
|
|
2758
3352
|
canRenderType: "input-select",
|
|
2759
3353
|
render: (props) => {
|
|
2760
3354
|
switch (props.control) {
|
|
2761
3355
|
case "radio":
|
|
2762
|
-
return /* @__PURE__ */ (0,
|
|
3356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2763
3357
|
case "radio-item":
|
|
2764
|
-
return /* @__PURE__ */ (0,
|
|
3358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
2765
3359
|
case "tab":
|
|
2766
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
3360
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
2767
3361
|
case "segmented":
|
|
2768
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
3362
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2769
3363
|
case "select":
|
|
2770
3364
|
default:
|
|
2771
|
-
return /* @__PURE__ */ (0,
|
|
3365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2772
3366
|
}
|
|
2773
3367
|
}
|
|
2774
3368
|
};
|
|
2775
3369
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
2776
3370
|
|
|
2777
|
-
// ../renderers/src/
|
|
2778
|
-
var
|
|
2779
|
-
var
|
|
3371
|
+
// ../renderers/src/StatusListRenderer.tsx
|
|
3372
|
+
var import_components52 = require("@transferwise/components");
|
|
3373
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3374
|
+
var StatusListRenderer = {
|
|
3375
|
+
canRenderType: "status-list",
|
|
3376
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: getMargin(margin), children: [
|
|
3377
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components52.Header, { title }) : null,
|
|
3378
|
+
items.map((item) => {
|
|
3379
|
+
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3381
|
+
import_components52.ListItem,
|
|
3382
|
+
{
|
|
3383
|
+
title: itemTitle,
|
|
3384
|
+
subtitle: description,
|
|
3385
|
+
media: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components52.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(DynamicIcon_default, { name: icon.name }) }) : void 0,
|
|
3386
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3387
|
+
import_components52.ListItem.AdditionalInfo,
|
|
3388
|
+
{
|
|
3389
|
+
action: {
|
|
3390
|
+
href: callToAction.href,
|
|
3391
|
+
onClick: callToAction.href ? void 0 : callToAction.onClick,
|
|
3392
|
+
label: callToAction.title,
|
|
3393
|
+
target: "_blank"
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
) : void 0
|
|
3397
|
+
},
|
|
3398
|
+
JSON.stringify(item)
|
|
3399
|
+
);
|
|
3400
|
+
})
|
|
3401
|
+
] })
|
|
3402
|
+
};
|
|
3403
|
+
var mapStatus = (status) => {
|
|
3404
|
+
switch (status) {
|
|
3405
|
+
case "done":
|
|
3406
|
+
return "positive";
|
|
3407
|
+
case "pending":
|
|
3408
|
+
return "pending";
|
|
3409
|
+
default:
|
|
3410
|
+
return void 0;
|
|
3411
|
+
}
|
|
3412
|
+
};
|
|
3413
|
+
var StatusListRenderer_default = StatusListRenderer;
|
|
3414
|
+
|
|
3415
|
+
// ../renderers/src/utils/useCustomTheme.ts
|
|
3416
|
+
var import_components_theming = require("@wise/components-theming");
|
|
3417
|
+
var import_react17 = require("react");
|
|
2780
3418
|
var ThemeRequiredEventName = "Theme Required";
|
|
2781
3419
|
var useCustomTheme = (theme, trackEvent) => {
|
|
2782
3420
|
const theming = (0, import_components_theming.useTheme)();
|
|
2783
|
-
const previousTheme = (0,
|
|
2784
|
-
(0,
|
|
3421
|
+
const previousTheme = (0, import_react17.useMemo)(() => theming.theme, []);
|
|
3422
|
+
(0, import_react17.useEffect)(() => {
|
|
2785
3423
|
theming.setTheme(theme);
|
|
2786
3424
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
2787
3425
|
return theme !== previousTheme ? () => {
|
|
@@ -2793,13 +3431,13 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
2793
3431
|
};
|
|
2794
3432
|
|
|
2795
3433
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
2796
|
-
var
|
|
2797
|
-
var
|
|
2798
|
-
var
|
|
3434
|
+
var import_components53 = require("@transferwise/components");
|
|
3435
|
+
var import_icons5 = require("@transferwise/icons");
|
|
3436
|
+
var import_react_intl25 = require("react-intl");
|
|
2799
3437
|
|
|
2800
3438
|
// ../renderers/src/messages/back.messages.ts
|
|
2801
|
-
var
|
|
2802
|
-
var back_messages_default = (0,
|
|
3439
|
+
var import_react_intl24 = require("react-intl");
|
|
3440
|
+
var back_messages_default = (0, import_react_intl24.defineMessages)({
|
|
2803
3441
|
back: {
|
|
2804
3442
|
id: "df.wise.back.label",
|
|
2805
3443
|
defaultMessage: "Back",
|
|
@@ -2808,31 +3446,31 @@ var back_messages_default = (0, import_react_intl20.defineMessages)({
|
|
|
2808
3446
|
});
|
|
2809
3447
|
|
|
2810
3448
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
2811
|
-
var
|
|
3449
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
2812
3450
|
function BackButton({ title, onClick }) {
|
|
2813
|
-
const { formatMessage } = (0,
|
|
2814
|
-
return /* @__PURE__ */ (0,
|
|
2815
|
-
/* @__PURE__ */ (0,
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
3451
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_components53.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_icons5.ArrowLeft, {})
|
|
2817
3455
|
] });
|
|
2818
3456
|
}
|
|
2819
3457
|
|
|
2820
3458
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
2821
|
-
var
|
|
2822
|
-
var
|
|
3459
|
+
var import_components54 = require("@transferwise/components");
|
|
3460
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
2823
3461
|
var Toolbar = ({ items }) => {
|
|
2824
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
3462
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
2825
3463
|
};
|
|
2826
3464
|
function ToolbarButton(props) {
|
|
2827
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
3465
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
2828
3466
|
}
|
|
2829
3467
|
function MediaToolbarButton(props) {
|
|
2830
3468
|
var _a;
|
|
2831
3469
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
2832
3470
|
const priority = getIconButtonPriority(control);
|
|
2833
3471
|
const type = getSentiment2(context);
|
|
2834
|
-
return /* @__PURE__ */ (0,
|
|
2835
|
-
|
|
3472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
3473
|
+
import_components54.IconButton,
|
|
2836
3474
|
{
|
|
2837
3475
|
className: "df-toolbar-button",
|
|
2838
3476
|
disabled,
|
|
@@ -2841,7 +3479,7 @@ function MediaToolbarButton(props) {
|
|
|
2841
3479
|
type,
|
|
2842
3480
|
onClick,
|
|
2843
3481
|
children: [
|
|
2844
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
3482
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
2845
3483
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
2846
3484
|
]
|
|
2847
3485
|
}
|
|
@@ -2852,8 +3490,8 @@ function TextToolbarButton(props) {
|
|
|
2852
3490
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
2853
3491
|
const priority = getPriority2(control);
|
|
2854
3492
|
const sentiment = getSentiment2(context);
|
|
2855
|
-
return /* @__PURE__ */ (0,
|
|
2856
|
-
|
|
3493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3494
|
+
import_components54.Button,
|
|
2857
3495
|
{
|
|
2858
3496
|
v2: true,
|
|
2859
3497
|
size: "sm",
|
|
@@ -2882,16 +3520,16 @@ var getIconButtonPriority = (control) => {
|
|
|
2882
3520
|
};
|
|
2883
3521
|
|
|
2884
3522
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
2885
|
-
var
|
|
3523
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
2886
3524
|
function TopBar({ back, toolbar }) {
|
|
2887
|
-
return back || toolbar ? /* @__PURE__ */ (0,
|
|
2888
|
-
back ? /* @__PURE__ */ (0,
|
|
2889
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
3525
|
+
return back || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
3526
|
+
back ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(BackButton, __spreadValues({}, back)) : null,
|
|
3527
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
2890
3528
|
] }) : null;
|
|
2891
3529
|
}
|
|
2892
3530
|
|
|
2893
3531
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
2894
|
-
var
|
|
3532
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
2895
3533
|
var SplashCelebrationStepRenderer = {
|
|
2896
3534
|
canRenderType: "step",
|
|
2897
3535
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -2901,15 +3539,15 @@ function SplashCelebrationStepRendererComponent(props) {
|
|
|
2901
3539
|
const { back, toolbar, children, footer, trackEvent } = props;
|
|
2902
3540
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2903
3541
|
useCustomTheme("forest-green", trackEvent);
|
|
2904
|
-
return /* @__PURE__ */ (0,
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3543
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TopBar, { back, toolbar }),
|
|
2906
3544
|
children,
|
|
2907
|
-
hasFooter ? /* @__PURE__ */ (0,
|
|
3545
|
+
hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0
|
|
2908
3546
|
] });
|
|
2909
3547
|
}
|
|
2910
3548
|
|
|
2911
3549
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
2912
|
-
var
|
|
3550
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
2913
3551
|
var SplashStepRenderer = {
|
|
2914
3552
|
canRenderType: "step",
|
|
2915
3553
|
canRender: ({ control }) => control === "splash",
|
|
@@ -2918,16 +3556,16 @@ var SplashStepRenderer = {
|
|
|
2918
3556
|
function SplashStepRendererComponent(props) {
|
|
2919
3557
|
const { back, toolbar, children, footer } = props;
|
|
2920
3558
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2921
|
-
return /* @__PURE__ */ (0,
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
3559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "splash-screen m-t-5", children: [
|
|
3560
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TopBar, { back, toolbar }),
|
|
2923
3561
|
children,
|
|
2924
|
-
hasFooter ? /* @__PURE__ */ (0,
|
|
3562
|
+
hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0
|
|
2925
3563
|
] });
|
|
2926
3564
|
}
|
|
2927
3565
|
|
|
2928
3566
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2929
|
-
var
|
|
2930
|
-
var
|
|
3567
|
+
var import_components55 = require("@transferwise/components");
|
|
3568
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
2931
3569
|
var StepRenderer = {
|
|
2932
3570
|
canRenderType: "step",
|
|
2933
3571
|
render: StepRendererComponent
|
|
@@ -2935,19 +3573,19 @@ var StepRenderer = {
|
|
|
2935
3573
|
function StepRendererComponent(props) {
|
|
2936
3574
|
const { back, description, error, title, children, toolbar, footer, tags } = props;
|
|
2937
3575
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
2938
|
-
return /* @__PURE__ */ (0,
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
title || description ? /* @__PURE__ */ (0,
|
|
2941
|
-
error ? /* @__PURE__ */ (0,
|
|
3576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { children: [
|
|
3577
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TopBar, { back, toolbar }),
|
|
3578
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Header10, { title, description, tags }) }) : void 0,
|
|
3579
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components55.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
2942
3580
|
children,
|
|
2943
|
-
hasFooter ? /* @__PURE__ */ (0,
|
|
3581
|
+
hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0
|
|
2944
3582
|
] });
|
|
2945
3583
|
}
|
|
2946
|
-
var
|
|
3584
|
+
var Header10 = ({ title, description, tags }) => {
|
|
2947
3585
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
2948
|
-
return /* @__PURE__ */ (0,
|
|
2949
|
-
title ? /* @__PURE__ */ (0,
|
|
2950
|
-
description ? /* @__PURE__ */ (0,
|
|
3586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
3587
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components55.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
3588
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
2951
3589
|
] });
|
|
2952
3590
|
};
|
|
2953
3591
|
var getHeaderStyle = (tags) => {
|
|
@@ -2958,36 +3596,36 @@ var getHeaderStyle = (tags) => {
|
|
|
2958
3596
|
};
|
|
2959
3597
|
|
|
2960
3598
|
// ../renderers/src/TabsRenderer.tsx
|
|
2961
|
-
var
|
|
2962
|
-
var
|
|
2963
|
-
var
|
|
3599
|
+
var import_components56 = require("@transferwise/components");
|
|
3600
|
+
var import_react18 = require("react");
|
|
3601
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
2964
3602
|
var TabsRenderer = {
|
|
2965
3603
|
canRenderType: "tabs",
|
|
2966
3604
|
render: (props) => {
|
|
2967
3605
|
switch (props.control) {
|
|
2968
3606
|
case "segmented":
|
|
2969
3607
|
if (props.tabs.length > 3) {
|
|
2970
|
-
return /* @__PURE__ */ (0,
|
|
3608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
2971
3609
|
}
|
|
2972
|
-
return /* @__PURE__ */ (0,
|
|
3610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
2973
3611
|
case "chips":
|
|
2974
|
-
return /* @__PURE__ */ (0,
|
|
3612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
2975
3613
|
default:
|
|
2976
|
-
return /* @__PURE__ */ (0,
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
2977
3615
|
}
|
|
2978
3616
|
}
|
|
2979
3617
|
};
|
|
2980
3618
|
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
2981
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
2982
|
-
return /* @__PURE__ */ (0,
|
|
2983
|
-
|
|
3619
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react18.useState)(0);
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3621
|
+
import_components56.Tabs,
|
|
2984
3622
|
{
|
|
2985
3623
|
name: uid,
|
|
2986
3624
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
2987
3625
|
tabs: tabs.map((option) => ({
|
|
2988
3626
|
title: option.title,
|
|
2989
3627
|
disabled: false,
|
|
2990
|
-
content: /* @__PURE__ */ (0,
|
|
3628
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "m-t-2", children: [
|
|
2991
3629
|
" ",
|
|
2992
3630
|
option.children,
|
|
2993
3631
|
" "
|
|
@@ -2999,10 +3637,10 @@ function TabsRendererComponent({ uid, margin, tabs }) {
|
|
|
2999
3637
|
}
|
|
3000
3638
|
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3001
3639
|
var _a;
|
|
3002
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3003
|
-
return /* @__PURE__ */ (0,
|
|
3004
|
-
/* @__PURE__ */ (0,
|
|
3005
|
-
|
|
3640
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react18.useState)(0);
|
|
3641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: getMargin(margin), children: [
|
|
3642
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3643
|
+
import_components56.SegmentedControl,
|
|
3006
3644
|
{
|
|
3007
3645
|
name: uid,
|
|
3008
3646
|
value: String(selectedIndex),
|
|
@@ -3016,31 +3654,31 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
|
3016
3654
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
3017
3655
|
}
|
|
3018
3656
|
),
|
|
3019
|
-
/* @__PURE__ */ (0,
|
|
3657
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3020
3658
|
] });
|
|
3021
3659
|
}
|
|
3022
3660
|
function ChipsTabsRendererComponent({ margin, tabs }) {
|
|
3023
3661
|
var _a;
|
|
3024
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
3025
|
-
return /* @__PURE__ */ (0,
|
|
3026
|
-
/* @__PURE__ */ (0,
|
|
3027
|
-
|
|
3662
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react18.useState)(0);
|
|
3663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: getMargin(margin), children: [
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3665
|
+
import_components56.Chips,
|
|
3028
3666
|
{
|
|
3029
3667
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3030
3668
|
selected: selectedIndex,
|
|
3031
3669
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3032
3670
|
}
|
|
3033
3671
|
) }),
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3672
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3035
3673
|
] });
|
|
3036
3674
|
}
|
|
3037
3675
|
|
|
3038
3676
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3039
|
-
var
|
|
3677
|
+
var import_components58 = require("@transferwise/components");
|
|
3040
3678
|
|
|
3041
3679
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
3042
|
-
var
|
|
3043
|
-
var
|
|
3680
|
+
var import_components57 = require("@transferwise/components");
|
|
3681
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3044
3682
|
var commonKeys = [
|
|
3045
3683
|
"autoComplete",
|
|
3046
3684
|
"autoCapitalize",
|
|
@@ -3059,12 +3697,12 @@ function VariableTextInput(inputProps) {
|
|
|
3059
3697
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
3060
3698
|
switch (control) {
|
|
3061
3699
|
case "email":
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
3063
3701
|
case "password":
|
|
3064
|
-
return /* @__PURE__ */ (0,
|
|
3702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
3065
3703
|
case "numeric": {
|
|
3066
3704
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
3067
|
-
return /* @__PURE__ */ (0,
|
|
3705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3068
3706
|
TextInput,
|
|
3069
3707
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
3070
3708
|
onChange: (newValue) => {
|
|
@@ -3075,21 +3713,21 @@ function VariableTextInput(inputProps) {
|
|
|
3075
3713
|
);
|
|
3076
3714
|
}
|
|
3077
3715
|
case "phone-number":
|
|
3078
|
-
return /* @__PURE__ */ (0,
|
|
3716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components57.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
3079
3717
|
default: {
|
|
3080
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
3081
3719
|
}
|
|
3082
3720
|
}
|
|
3083
3721
|
}
|
|
3084
3722
|
function TextInput(props) {
|
|
3085
3723
|
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
3086
|
-
const InputWithPattern = control === "textarea" ?
|
|
3087
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
3088
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
3724
|
+
const InputWithPattern = control === "textarea" ? import_components57.TextareaWithDisplayFormat : import_components57.InputWithDisplayFormat;
|
|
3725
|
+
const InputWithoutPattern = control === "textarea" ? import_components57.TextArea : import_components57.Input;
|
|
3726
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
|
|
3089
3727
|
}
|
|
3090
3728
|
|
|
3091
3729
|
// ../renderers/src/TextInputRenderer.tsx
|
|
3092
|
-
var
|
|
3730
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3093
3731
|
var TextInputRenderer = {
|
|
3094
3732
|
canRenderType: "input-text",
|
|
3095
3733
|
render: (props) => {
|
|
@@ -3122,7 +3760,7 @@ var TextInputRenderer = {
|
|
|
3122
3760
|
}
|
|
3123
3761
|
}
|
|
3124
3762
|
});
|
|
3125
|
-
return /* @__PURE__ */ (0,
|
|
3763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
3126
3764
|
FieldInput_default,
|
|
3127
3765
|
{
|
|
3128
3766
|
id,
|
|
@@ -3130,7 +3768,7 @@ var TextInputRenderer = {
|
|
|
3130
3768
|
description,
|
|
3131
3769
|
validation: validationState,
|
|
3132
3770
|
help,
|
|
3133
|
-
children: /* @__PURE__ */ (0,
|
|
3771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components58.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
3134
3772
|
}
|
|
3135
3773
|
);
|
|
3136
3774
|
}
|
|
@@ -3138,13 +3776,13 @@ var TextInputRenderer = {
|
|
|
3138
3776
|
var TextInputRenderer_default = TextInputRenderer;
|
|
3139
3777
|
|
|
3140
3778
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3141
|
-
var
|
|
3779
|
+
var import_components59 = require("@transferwise/components");
|
|
3142
3780
|
|
|
3143
3781
|
// ../renderers/src/utils/getRandomId.ts
|
|
3144
3782
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
3145
3783
|
|
|
3146
3784
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
3147
|
-
var
|
|
3785
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
3148
3786
|
var UploadInputRenderer = {
|
|
3149
3787
|
canRenderType: "input-upload",
|
|
3150
3788
|
render: (props) => {
|
|
@@ -3160,15 +3798,15 @@ var UploadInputRenderer = {
|
|
|
3160
3798
|
};
|
|
3161
3799
|
return (
|
|
3162
3800
|
// We don't pass help here as there is no sensible place to display it
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3801
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3164
3802
|
UploadFieldInput_default,
|
|
3165
3803
|
{
|
|
3166
3804
|
id,
|
|
3167
3805
|
label: void 0,
|
|
3168
3806
|
description: void 0,
|
|
3169
3807
|
validation: validationState,
|
|
3170
|
-
children: /* @__PURE__ */ (0,
|
|
3171
|
-
|
|
3808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3809
|
+
import_components59.UploadInput,
|
|
3172
3810
|
{
|
|
3173
3811
|
id,
|
|
3174
3812
|
description,
|
|
@@ -3178,7 +3816,7 @@ var UploadInputRenderer = {
|
|
|
3178
3816
|
{
|
|
3179
3817
|
id: "my-file",
|
|
3180
3818
|
filename: value.name,
|
|
3181
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
3819
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components59.Status.FAILED : import_components59.Status.SUCCEEDED
|
|
3182
3820
|
}
|
|
3183
3821
|
] : void 0,
|
|
3184
3822
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -3233,7 +3871,7 @@ var LargeUploadRenderer = {
|
|
|
3233
3871
|
};
|
|
3234
3872
|
const filetypes = acceptsToFileTypes(accepts);
|
|
3235
3873
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
3236
|
-
return /* @__PURE__ */ (0,
|
|
3874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3237
3875
|
FieldInput_default,
|
|
3238
3876
|
{
|
|
3239
3877
|
id,
|
|
@@ -3241,8 +3879,8 @@ var LargeUploadRenderer = {
|
|
|
3241
3879
|
description,
|
|
3242
3880
|
validation: validationState,
|
|
3243
3881
|
help,
|
|
3244
|
-
children: /* @__PURE__ */ (0,
|
|
3245
|
-
|
|
3882
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
3883
|
+
import_components59.Upload,
|
|
3246
3884
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
3247
3885
|
usAccept,
|
|
3248
3886
|
usDisabled: disabled,
|
|
@@ -3256,625 +3894,178 @@ var LargeUploadRenderer = {
|
|
|
3256
3894
|
}
|
|
3257
3895
|
};
|
|
3258
3896
|
|
|
3259
|
-
// ../renderers/src/
|
|
3260
|
-
var
|
|
3261
|
-
var
|
|
3262
|
-
var
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3897
|
+
// ../renderers/src/UpsellRenderer.tsx
|
|
3898
|
+
var import_components60 = require("@transferwise/components");
|
|
3899
|
+
var import_react19 = require("react");
|
|
3900
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3901
|
+
var UpsellRenderer = {
|
|
3902
|
+
canRenderType: "upsell",
|
|
3903
|
+
render: UpsellRendererComponent
|
|
3904
|
+
};
|
|
3905
|
+
function UpsellRendererComponent(props) {
|
|
3906
|
+
const { text, callToAction, media, margin, onDismiss } = props;
|
|
3907
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(true);
|
|
3908
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3909
|
+
import_components60.Nudge,
|
|
3910
|
+
{
|
|
3911
|
+
className: getMargin(margin),
|
|
3912
|
+
mediaName: getMediaName(media),
|
|
3913
|
+
title: text,
|
|
3914
|
+
link: callToAction.title,
|
|
3915
|
+
href: callToAction.href,
|
|
3916
|
+
onClick: callToAction.onClick,
|
|
3917
|
+
onDismiss: onDismiss ? () => {
|
|
3918
|
+
setIsVisible(false);
|
|
3919
|
+
onDismiss();
|
|
3920
|
+
} : void 0
|
|
3921
|
+
}
|
|
3922
|
+
) : null;
|
|
3923
|
+
}
|
|
3924
|
+
var urnPrefix2 = "urn:wise:illustrations:";
|
|
3925
|
+
var getMediaName = (media) => {
|
|
3926
|
+
if (media && media.type === "image" && media.uri.startsWith(urnPrefix2)) {
|
|
3927
|
+
const mediaName = media.uri.substring(urnPrefix2.length);
|
|
3928
|
+
if (supportedMediaNames.includes(mediaName)) {
|
|
3929
|
+
return mediaName;
|
|
3930
|
+
}
|
|
3279
3931
|
}
|
|
3280
|
-
|
|
3932
|
+
return "globe";
|
|
3933
|
+
};
|
|
3934
|
+
var supportedMediaNames = [
|
|
3935
|
+
"backpack",
|
|
3936
|
+
"business-card",
|
|
3937
|
+
"calendar",
|
|
3938
|
+
"digital-card",
|
|
3939
|
+
"digital-card-2",
|
|
3940
|
+
"flower",
|
|
3941
|
+
"gear",
|
|
3942
|
+
"globe",
|
|
3943
|
+
"heart",
|
|
3944
|
+
"invite-letter",
|
|
3945
|
+
"lock",
|
|
3946
|
+
"magnifying-glass",
|
|
3947
|
+
"multi-currency",
|
|
3948
|
+
"personal-card",
|
|
3949
|
+
"plane",
|
|
3950
|
+
"shopping-bag",
|
|
3951
|
+
"wallet"
|
|
3952
|
+
];
|
|
3281
3953
|
|
|
3282
|
-
// ../renderers/src/
|
|
3283
|
-
var
|
|
3284
|
-
|
|
3285
|
-
|
|
3954
|
+
// ../renderers/src/getWiseRenderers.ts
|
|
3955
|
+
var getWiseRenderers = () => [
|
|
3956
|
+
AddressValidationButtonRenderer_default,
|
|
3957
|
+
AlertRenderer_default,
|
|
3958
|
+
CheckboxInputRenderer_default,
|
|
3959
|
+
BoxRenderer_default,
|
|
3960
|
+
ButtonRenderer,
|
|
3961
|
+
ColumnsRenderer_default,
|
|
3962
|
+
DateInputRenderer_default,
|
|
3963
|
+
DecisionRenderer_default,
|
|
3964
|
+
DividerRenderer_default,
|
|
3965
|
+
ExternalConfirmationRenderer_default,
|
|
3966
|
+
FormRenderer_default,
|
|
3967
|
+
FormSectionRenderer_default,
|
|
3968
|
+
HeadingRenderer_default,
|
|
3969
|
+
ImageRenderer_default,
|
|
3970
|
+
InstructionsRenderer_default,
|
|
3971
|
+
IntegerInputRenderer_default,
|
|
3972
|
+
LargeUploadRenderer,
|
|
3973
|
+
ListRenderer_default,
|
|
3974
|
+
LoadingIndicatorRenderer_default,
|
|
3975
|
+
MarkdownRenderer_default,
|
|
3976
|
+
MediaRenderer,
|
|
3977
|
+
ModalRenderer,
|
|
3978
|
+
ModalLayoutRenderer_default,
|
|
3979
|
+
MoneyInputRenderer,
|
|
3980
|
+
MultiSelectInputRenderer,
|
|
3981
|
+
MultiUploadInputRenderer_default,
|
|
3982
|
+
NumberInputRenderer_default,
|
|
3983
|
+
ParagraphRenderer_default,
|
|
3984
|
+
ProgressRenderer,
|
|
3985
|
+
RepeatableRenderer_default,
|
|
3986
|
+
ReviewRenderer_default,
|
|
3987
|
+
SearchRenderer_default,
|
|
3988
|
+
SelectInputRenderer_default,
|
|
3989
|
+
SectionRenderer_default,
|
|
3990
|
+
StatusListRenderer_default,
|
|
3991
|
+
TabsRenderer,
|
|
3992
|
+
TextInputRenderer_default,
|
|
3993
|
+
UploadInputRenderer,
|
|
3994
|
+
UpsellRenderer,
|
|
3995
|
+
SplashStepRenderer,
|
|
3996
|
+
SplashCelebrationStepRenderer,
|
|
3997
|
+
StepRenderer,
|
|
3998
|
+
// Legacy renderer must come afterwards
|
|
3999
|
+
ReviewLegacyRenderer_default
|
|
4000
|
+
];
|
|
3286
4001
|
|
|
3287
|
-
// ../renderers/src/
|
|
3288
|
-
var
|
|
3289
|
-
var
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
4002
|
+
// ../renderers/src/subflow/getSubflowRenderer.tsx
|
|
4003
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
4004
|
+
var getSubflowRenderer = ({
|
|
4005
|
+
Component: Component2,
|
|
4006
|
+
canRender
|
|
4007
|
+
}) => {
|
|
4008
|
+
return {
|
|
4009
|
+
canRenderType: "subflow",
|
|
4010
|
+
canRender,
|
|
4011
|
+
render: (props) => {
|
|
4012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4013
|
+
Component2,
|
|
4014
|
+
{
|
|
4015
|
+
presentation: props.presentation,
|
|
4016
|
+
requestCache: props.requestCache,
|
|
4017
|
+
initialRequest: props.initialRequest,
|
|
4018
|
+
onCompletion: props.onCompletion,
|
|
4019
|
+
onError: props.onError,
|
|
4020
|
+
onCancellation: props.onCancellation,
|
|
4021
|
+
onEvent: props.onEvent
|
|
4022
|
+
}
|
|
4023
|
+
);
|
|
3307
4024
|
}
|
|
3308
4025
|
};
|
|
3309
4026
|
};
|
|
3310
4027
|
|
|
3311
|
-
//
|
|
3312
|
-
var
|
|
3313
|
-
var
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
4028
|
+
// src/dynamicFlow/useOnCopy.tsx
|
|
4029
|
+
var import_react20 = require("react");
|
|
4030
|
+
var import_react_intl27 = require("react-intl");
|
|
4031
|
+
|
|
4032
|
+
// src/dynamicFlow/messages.ts
|
|
4033
|
+
var import_react_intl26 = require("react-intl");
|
|
4034
|
+
var messages_default = (0, import_react_intl26.defineMessages)({
|
|
4035
|
+
copied: {
|
|
4036
|
+
id: "df.wise.CopyFeedback.copy",
|
|
4037
|
+
defaultMessage: "Copied to clipboard",
|
|
4038
|
+
description: "Appears in a snackbar when the copy operation succeeds."
|
|
4039
|
+
},
|
|
4040
|
+
copyFailed: {
|
|
4041
|
+
id: "df.wise.CopyFeedback.copyFailed",
|
|
4042
|
+
defaultMessage: "Failed to copy to clipboard",
|
|
4043
|
+
description: "Appears in a snackbar when the copy operation fails."
|
|
3317
4044
|
}
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
4045
|
+
});
|
|
4046
|
+
|
|
4047
|
+
// src/dynamicFlow/useOnCopy.tsx
|
|
4048
|
+
var useOnCopy = () => {
|
|
4049
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
4050
|
+
const createSnackBar = useSnackBarIfAvailable();
|
|
4051
|
+
return (0, import_react20.useCallback)(
|
|
4052
|
+
(copiedContent) => {
|
|
4053
|
+
if (copiedContent) {
|
|
4054
|
+
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
4055
|
+
} else {
|
|
4056
|
+
createSnackBar({ text: formatMessage(messages_default.copyFailed) });
|
|
3329
4057
|
}
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
};
|
|
3334
|
-
|
|
3335
|
-
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3336
|
-
var import_components51 = require("@transferwise/components");
|
|
3337
|
-
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3338
|
-
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3339
|
-
if (!callToAction) {
|
|
3340
|
-
return void 0;
|
|
3341
|
-
}
|
|
3342
|
-
const { accessibilityDescription, href, title, onClick } = callToAction;
|
|
3343
|
-
const priority = ctaSecondary ? "secondary" : "secondary-neutral";
|
|
3344
|
-
if (href) {
|
|
3345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3346
|
-
import_components51.ListItem.Button,
|
|
3347
|
-
{
|
|
3348
|
-
href,
|
|
3349
|
-
partiallyInteractive: !fullyInteractive,
|
|
3350
|
-
priority,
|
|
3351
|
-
"aria-description": accessibilityDescription,
|
|
3352
|
-
children: title
|
|
3353
|
-
}
|
|
3354
|
-
);
|
|
3355
|
-
}
|
|
3356
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
3357
|
-
import_components51.ListItem.Button,
|
|
3358
|
-
{
|
|
3359
|
-
"aria-description": accessibilityDescription,
|
|
3360
|
-
partiallyInteractive: !fullyInteractive,
|
|
3361
|
-
priority,
|
|
3362
|
-
onClick,
|
|
3363
|
-
children: title
|
|
3364
|
-
}
|
|
3365
|
-
);
|
|
3366
|
-
};
|
|
3367
|
-
|
|
3368
|
-
// ../renderers/src/utils/listItem/shouldUseAvatar.ts
|
|
3369
|
-
var shouldUseAvatar = (control, tags) => {
|
|
3370
|
-
var _a;
|
|
3371
|
-
return control === "with-avatar" || ((_a = tags == null ? void 0 : tags.includes("with-avatar")) != null ? _a : false);
|
|
3372
|
-
};
|
|
3373
|
-
|
|
3374
|
-
// ../renderers/src/ReviewRenderer.tsx
|
|
3375
|
-
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3376
|
-
var IGNORED_CONTROLS = [
|
|
3377
|
-
"horizontal",
|
|
3378
|
-
"horizontal-end-aligned",
|
|
3379
|
-
"horizontal-start-aligned",
|
|
3380
|
-
"vertical-two-column"
|
|
3381
|
-
];
|
|
3382
|
-
var ReviewRenderer = {
|
|
3383
|
-
canRenderType: "review",
|
|
3384
|
-
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
3385
|
-
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Review, __spreadValues({}, props))
|
|
3386
|
-
};
|
|
3387
|
-
var Review = ({
|
|
3388
|
-
callToAction,
|
|
3389
|
-
control,
|
|
3390
|
-
margin,
|
|
3391
|
-
fields,
|
|
3392
|
-
tags,
|
|
3393
|
-
title,
|
|
3394
|
-
trackEvent
|
|
3395
|
-
}) => {
|
|
3396
|
-
const intl = (0, import_react_intl22.useIntl)();
|
|
3397
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: getMargin(margin), children: [
|
|
3398
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Header7, { title, callToAction }),
|
|
3399
|
-
fields.map((field) => {
|
|
3400
|
-
var _a, _b, _c;
|
|
3401
|
-
const {
|
|
3402
|
-
label,
|
|
3403
|
-
value,
|
|
3404
|
-
media,
|
|
3405
|
-
additionalInfo,
|
|
3406
|
-
inlineAlert,
|
|
3407
|
-
help,
|
|
3408
|
-
analyticsId,
|
|
3409
|
-
callToAction: itemCallToAction,
|
|
3410
|
-
tags: itemTags
|
|
3411
|
-
} = field;
|
|
3412
|
-
const controlOptions = {
|
|
3413
|
-
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3414
|
-
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3415
|
-
};
|
|
3416
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
3417
|
-
import_components52.ListItem,
|
|
3418
|
-
{
|
|
3419
|
-
title: value,
|
|
3420
|
-
subtitle: label,
|
|
3421
|
-
inverted: true,
|
|
3422
|
-
media: getMedia(media, shouldUseAvatar(control, itemTags)),
|
|
3423
|
-
control: (_c = getCTAControl(itemCallToAction, controlOptions)) != null ? _c : help ? getHelpControl(
|
|
3424
|
-
help,
|
|
3425
|
-
intl.formatMessage(help_messages_default.helpAria),
|
|
3426
|
-
() => trackEvent("Help Pressed", { layoutItemId: analyticsId })
|
|
3427
|
-
) : void 0,
|
|
3428
|
-
prompt: getInlineAlert(inlineAlert),
|
|
3429
|
-
additionalInfo: getAdditionalInfo(additionalInfo)
|
|
3430
|
-
},
|
|
3431
|
-
JSON.stringify(field)
|
|
3432
|
-
);
|
|
3433
|
-
})
|
|
3434
|
-
] });
|
|
3435
|
-
};
|
|
3436
|
-
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
3437
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components52.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components52.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components52.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_icons4.QuestionMarkCircle, {}) }) });
|
|
3438
|
-
};
|
|
3439
|
-
var ReviewRenderer_default = ReviewRenderer;
|
|
3440
|
-
|
|
3441
|
-
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
3442
|
-
var import_components55 = require("@transferwise/components");
|
|
3443
|
-
|
|
3444
|
-
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3445
|
-
var import_components54 = require("@transferwise/components");
|
|
3446
|
-
var import_react18 = require("react");
|
|
3447
|
-
var import_react_intl25 = require("react-intl");
|
|
3448
|
-
|
|
3449
|
-
// ../renderers/src/messages/filter.messages.ts
|
|
3450
|
-
var import_react_intl23 = require("react-intl");
|
|
3451
|
-
var filter_messages_default = (0, import_react_intl23.defineMessages)({
|
|
3452
|
-
placeholder: {
|
|
3453
|
-
id: "df.wise.filter.placeholder",
|
|
3454
|
-
defaultMessage: "Start typing to search",
|
|
3455
|
-
description: "Placeholder for the filter input"
|
|
3456
|
-
},
|
|
3457
|
-
results: {
|
|
3458
|
-
id: "df.wise.filter.results",
|
|
3459
|
-
defaultMessage: "Search results",
|
|
3460
|
-
description: "Label for the results section"
|
|
3461
|
-
},
|
|
3462
|
-
noResults: {
|
|
3463
|
-
id: "df.wise.filter.noResults",
|
|
3464
|
-
defaultMessage: "No results",
|
|
3465
|
-
description: "Message for if there are no results"
|
|
3466
|
-
}
|
|
3467
|
-
});
|
|
3468
|
-
|
|
3469
|
-
// ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
|
|
3470
|
-
function filterAndSortDecisionOptions(selectOptions, query) {
|
|
3471
|
-
const upperQuery = normalizeAndRemoveAccents(query);
|
|
3472
|
-
const filteredItems = selectOptions.filter((option) => {
|
|
3473
|
-
var _a, _b, _c, _d;
|
|
3474
|
-
const searchableWords = [
|
|
3475
|
-
option.title,
|
|
3476
|
-
option.description,
|
|
3477
|
-
option.additionalText,
|
|
3478
|
-
(_a = option.supportingValues) == null ? void 0 : _a.value,
|
|
3479
|
-
(_b = option.supportingValues) == null ? void 0 : _b.subvalue,
|
|
3480
|
-
...(_c = option.keywords) != null ? _c : []
|
|
3481
|
-
];
|
|
3482
|
-
return (_d = searchableWords.some(
|
|
3483
|
-
(word) => word && normalizeAndRemoveAccents(word).includes(upperQuery)
|
|
3484
|
-
)) != null ? _d : false;
|
|
3485
|
-
});
|
|
3486
|
-
return [...filteredItems].sort((a, b) => {
|
|
3487
|
-
if (a.disabled && !b.disabled) {
|
|
3488
|
-
return 1;
|
|
3489
|
-
}
|
|
3490
|
-
if (!a.disabled && b.disabled) {
|
|
3491
|
-
return -1;
|
|
3492
|
-
}
|
|
3493
|
-
const aTitleUpper = a.title.toUpperCase();
|
|
3494
|
-
const bTitleUpper = b.title.toUpperCase();
|
|
3495
|
-
const aTitleStarts = aTitleUpper.startsWith(upperQuery);
|
|
3496
|
-
const bTitleStarts = bTitleUpper.startsWith(upperQuery);
|
|
3497
|
-
if (aTitleStarts && !bTitleStarts) {
|
|
3498
|
-
return -1;
|
|
3499
|
-
}
|
|
3500
|
-
if (!aTitleStarts && bTitleStarts) {
|
|
3501
|
-
return 1;
|
|
3502
|
-
}
|
|
3503
|
-
const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
|
|
3504
|
-
const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
|
|
3505
|
-
if (aWordStarts && !bWordStarts) {
|
|
3506
|
-
return -1;
|
|
3507
|
-
}
|
|
3508
|
-
if (!aWordStarts && bWordStarts) {
|
|
3509
|
-
return 1;
|
|
3510
|
-
}
|
|
3511
|
-
return a.title.localeCompare(b.title);
|
|
3512
|
-
});
|
|
3513
|
-
}
|
|
3514
|
-
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
3515
|
-
|
|
3516
|
-
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
3517
|
-
var import_components53 = require("@transferwise/components");
|
|
3518
|
-
var import_react_intl24 = require("react-intl");
|
|
3519
|
-
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3520
|
-
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
3521
|
-
var isGroupedDecision = (options) => {
|
|
3522
|
-
return getGroupsFromTags(groupingTags2, options).length > 0;
|
|
3523
|
-
};
|
|
3524
|
-
var GroupedDecisionList = (_a) => {
|
|
3525
|
-
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
3526
|
-
const { formatMessage } = (0, import_react_intl24.useIntl)();
|
|
3527
|
-
const { options } = rest;
|
|
3528
|
-
const itemsByTag = [...getGroupsFromTags(groupingTags2, options), { tag: "all", items: options }];
|
|
3529
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_jsx_runtime76.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_components53.Section, { children: [
|
|
3530
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3531
|
-
import_components53.Header,
|
|
3532
|
-
{
|
|
3533
|
-
as: "h2",
|
|
3534
|
-
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
3535
|
-
}
|
|
3536
|
-
),
|
|
3537
|
-
renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: items }))
|
|
3538
|
-
] }, tag)) });
|
|
3539
|
-
};
|
|
3540
|
-
|
|
3541
|
-
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
3542
|
-
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3543
|
-
var DecisionWrapper = (props) => {
|
|
3544
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: getMargin(props.margin), children: [
|
|
3545
|
-
props.title && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components54.Header, { as: "h2", title: props.title }),
|
|
3546
|
-
props.control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
3547
|
-
] });
|
|
3548
|
-
};
|
|
3549
|
-
var UnfilteredDecisionList = (_a) => {
|
|
3550
|
-
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
3551
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
3552
|
-
};
|
|
3553
|
-
var FilteredDecisionList = (props) => {
|
|
3554
|
-
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
3555
|
-
const [query, setQuery] = (0, import_react18.useState)("");
|
|
3556
|
-
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
3557
|
-
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortDecisionOptions(options, query) : options;
|
|
3558
|
-
const isGrouped = isGroupedDecision(options);
|
|
3559
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
3560
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
3561
|
-
import_components54.SearchInput,
|
|
3562
|
-
{
|
|
3563
|
-
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
3564
|
-
value: query,
|
|
3565
|
-
className: "m-b-2",
|
|
3566
|
-
onChange: (e) => {
|
|
3567
|
-
var _a;
|
|
3568
|
-
return setQuery((_a = e.target.value) != null ? _a : "");
|
|
3569
|
-
}
|
|
3570
|
-
}
|
|
3571
|
-
),
|
|
3572
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
3573
|
-
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components54.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
3574
|
-
filteredOptions.length > 0 ? renderDecisionList2({
|
|
3575
|
-
control,
|
|
3576
|
-
className: query.length === 0 ? "m-t-3" : "",
|
|
3577
|
-
options: filteredOptions
|
|
3578
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
3579
|
-
] })
|
|
3580
|
-
] });
|
|
3581
|
-
};
|
|
3582
|
-
|
|
3583
|
-
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
3584
|
-
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3585
|
-
var DecisionRenderer = {
|
|
3586
|
-
canRenderType: "decision",
|
|
3587
|
-
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
3588
|
-
};
|
|
3589
|
-
var renderDecisionList = ({ options, control }) => {
|
|
3590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_jsx_runtime78.Fragment, { children: options.map((_a) => {
|
|
3591
|
-
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
3592
|
-
const {
|
|
3593
|
-
description,
|
|
3594
|
-
disabled,
|
|
3595
|
-
media,
|
|
3596
|
-
title: itemTitle,
|
|
3597
|
-
href,
|
|
3598
|
-
additionalText,
|
|
3599
|
-
inlineAlert,
|
|
3600
|
-
supportingValues,
|
|
3601
|
-
tags
|
|
3602
|
-
} = rest;
|
|
3603
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3604
|
-
import_components55.ListItem,
|
|
3605
|
-
{
|
|
3606
|
-
title: itemTitle,
|
|
3607
|
-
subtitle: description,
|
|
3608
|
-
spotlight: control === "spotlight" ? (tags == null ? void 0 : tags.includes("spotlight-active")) ? "active" : "inactive" : void 0,
|
|
3609
|
-
disabled,
|
|
3610
|
-
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
3611
|
-
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
3612
|
-
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
3613
|
-
prompt: getInlineAlert(inlineAlert),
|
|
3614
|
-
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
3615
|
-
control: href ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.ListItem.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.ListItem.Navigation, { onClick })
|
|
3616
|
-
},
|
|
3617
|
-
JSON.stringify(rest)
|
|
3618
|
-
);
|
|
3619
|
-
}) });
|
|
3620
|
-
};
|
|
3621
|
-
var DecisionRenderer_default = DecisionRenderer;
|
|
3622
|
-
|
|
3623
|
-
// ../renderers/src/ListRenderer.tsx
|
|
3624
|
-
var import_components56 = require("@transferwise/components");
|
|
3625
|
-
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3626
|
-
var ListRenderer = {
|
|
3627
|
-
canRenderType: "list",
|
|
3628
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: getMargin(margin), children: [
|
|
3629
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Header7, { title, callToAction }),
|
|
3630
|
-
items.map((item) => {
|
|
3631
|
-
var _a, _b;
|
|
3632
|
-
const {
|
|
3633
|
-
title: itemTitle,
|
|
3634
|
-
description,
|
|
3635
|
-
supportingValues,
|
|
3636
|
-
media,
|
|
3637
|
-
additionalInfo,
|
|
3638
|
-
inlineAlert,
|
|
3639
|
-
callToAction: itemCallToAction,
|
|
3640
|
-
tags: itemTags
|
|
3641
|
-
} = item;
|
|
3642
|
-
const controlOptions = {
|
|
3643
|
-
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
3644
|
-
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3645
|
-
};
|
|
3646
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
3647
|
-
import_components56.ListItem,
|
|
3648
|
-
{
|
|
3649
|
-
title: itemTitle,
|
|
3650
|
-
subtitle: description,
|
|
3651
|
-
valueTitle: supportingValues == null ? void 0 : supportingValues.value,
|
|
3652
|
-
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
3653
|
-
media: getMedia(media, shouldUseAvatar(control, itemTags)),
|
|
3654
|
-
prompt: getInlineAlert(inlineAlert),
|
|
3655
|
-
additionalInfo: getAdditionalInfo(additionalInfo),
|
|
3656
|
-
control: getCTAControl(itemCallToAction, controlOptions)
|
|
3657
|
-
},
|
|
3658
|
-
itemTitle
|
|
3659
|
-
);
|
|
3660
|
-
})
|
|
3661
|
-
] })
|
|
3662
|
-
};
|
|
3663
|
-
var ListRenderer_default = ListRenderer;
|
|
3664
|
-
|
|
3665
|
-
// ../renderers/src/StatusListRenderer.tsx
|
|
3666
|
-
var import_components57 = require("@transferwise/components");
|
|
3667
|
-
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3668
|
-
var StatusListRenderer = {
|
|
3669
|
-
canRenderType: "status-list",
|
|
3670
|
-
render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: getMargin(margin), children: [
|
|
3671
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components57.Header, { title }) : null,
|
|
3672
|
-
items.map((item) => {
|
|
3673
|
-
const { callToAction, description, icon, status, title: itemTitle } = item;
|
|
3674
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3675
|
-
import_components57.ListItem,
|
|
3676
|
-
{
|
|
3677
|
-
title: itemTitle,
|
|
3678
|
-
subtitle: description,
|
|
3679
|
-
media: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components57.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(DynamicIcon_default, { name: icon.name }) }) : void 0,
|
|
3680
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3681
|
-
import_components57.ListItem.AdditionalInfo,
|
|
3682
|
-
{
|
|
3683
|
-
action: {
|
|
3684
|
-
href: callToAction.href,
|
|
3685
|
-
onClick: callToAction.href ? void 0 : callToAction.onClick,
|
|
3686
|
-
label: callToAction.title,
|
|
3687
|
-
target: "_blank"
|
|
3688
|
-
}
|
|
3689
|
-
}
|
|
3690
|
-
) : void 0
|
|
3691
|
-
},
|
|
3692
|
-
JSON.stringify(item)
|
|
3693
|
-
);
|
|
3694
|
-
})
|
|
3695
|
-
] })
|
|
3696
|
-
};
|
|
3697
|
-
var mapStatus = (status) => {
|
|
3698
|
-
switch (status) {
|
|
3699
|
-
case "done":
|
|
3700
|
-
return "positive";
|
|
3701
|
-
case "pending":
|
|
3702
|
-
return "pending";
|
|
3703
|
-
default:
|
|
3704
|
-
return void 0;
|
|
3705
|
-
}
|
|
3706
|
-
};
|
|
3707
|
-
var StatusListRenderer_default = StatusListRenderer;
|
|
3708
|
-
|
|
3709
|
-
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
3710
|
-
var import_components58 = require("@transferwise/components");
|
|
3711
|
-
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3712
|
-
var ReviewRenderer2 = {
|
|
3713
|
-
canRenderType: "review",
|
|
3714
|
-
render: ({ callToAction, control, fields, margin, title, trackEvent }) => {
|
|
3715
|
-
const orientation = mapControlToDefinitionListLayout(control);
|
|
3716
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: getMargin(margin), children: [
|
|
3717
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Header7, { title, callToAction }),
|
|
3718
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
3719
|
-
import_components58.DefinitionList,
|
|
3720
|
-
{
|
|
3721
|
-
layout: orientation,
|
|
3722
|
-
definitions: fields.map(
|
|
3723
|
-
({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
|
|
3724
|
-
key: String(index),
|
|
3725
|
-
value,
|
|
3726
|
-
title: getFieldLabel(
|
|
3727
|
-
label,
|
|
3728
|
-
help,
|
|
3729
|
-
() => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
|
|
3730
|
-
)
|
|
3731
|
-
})
|
|
3732
|
-
)
|
|
3733
|
-
}
|
|
3734
|
-
) })
|
|
3735
|
-
] });
|
|
3736
|
-
}
|
|
3737
|
-
};
|
|
3738
|
-
var ReviewLegacyRenderer_default = ReviewRenderer2;
|
|
3739
|
-
var mapControlToDefinitionListLayout = (control) => {
|
|
3740
|
-
switch (control) {
|
|
3741
|
-
case "horizontal":
|
|
3742
|
-
case "horizontal-end-aligned":
|
|
3743
|
-
return "HORIZONTAL_RIGHT_ALIGNED";
|
|
3744
|
-
case "horizontal-start-aligned":
|
|
3745
|
-
return "HORIZONTAL_LEFT_ALIGNED";
|
|
3746
|
-
case "vertical-two-column":
|
|
3747
|
-
return "VERTICAL_TWO_COLUMN";
|
|
3748
|
-
case "vertical":
|
|
3749
|
-
case "vertical-one-column":
|
|
3750
|
-
default:
|
|
3751
|
-
return "VERTICAL_ONE_COLUMN";
|
|
3752
|
-
}
|
|
3753
|
-
};
|
|
3754
|
-
var getFieldLabel = (label, help, onClick) => {
|
|
3755
|
-
if (help) {
|
|
3756
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
3757
|
-
label,
|
|
3758
|
-
" ",
|
|
3759
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Help_default, { help, onClick })
|
|
3760
|
-
] });
|
|
3761
|
-
}
|
|
3762
|
-
return label;
|
|
3763
|
-
};
|
|
3764
|
-
|
|
3765
|
-
// ../renderers/src/getWiseRenderers.ts
|
|
3766
|
-
var getWiseRenderers = () => [
|
|
3767
|
-
AddressValidationButtonRenderer_default,
|
|
3768
|
-
AlertRenderer_default,
|
|
3769
|
-
CheckboxInputRenderer_default,
|
|
3770
|
-
BoxRenderer_default,
|
|
3771
|
-
ButtonRenderer,
|
|
3772
|
-
ColumnsRenderer_default,
|
|
3773
|
-
DateInputRenderer_default,
|
|
3774
|
-
DecisionRenderer_default,
|
|
3775
|
-
DividerRenderer_default,
|
|
3776
|
-
ExternalConfirmationRenderer_default,
|
|
3777
|
-
FormRenderer_default,
|
|
3778
|
-
FormSectionRenderer_default,
|
|
3779
|
-
HeadingRenderer_default,
|
|
3780
|
-
ImageRenderer_default,
|
|
3781
|
-
InstructionsRenderer_default,
|
|
3782
|
-
IntegerInputRenderer_default,
|
|
3783
|
-
LargeUploadRenderer,
|
|
3784
|
-
ListRenderer_default,
|
|
3785
|
-
LoadingIndicatorRenderer_default,
|
|
3786
|
-
MarkdownRenderer_default,
|
|
3787
|
-
ModalRenderer,
|
|
3788
|
-
ModalLayoutRenderer_default,
|
|
3789
|
-
MoneyInputRenderer,
|
|
3790
|
-
MultiSelectInputRenderer_default,
|
|
3791
|
-
MultiUploadInputRenderer_default,
|
|
3792
|
-
NumberInputRenderer_default,
|
|
3793
|
-
ParagraphRenderer_default,
|
|
3794
|
-
ProgressRenderer,
|
|
3795
|
-
RepeatableRenderer_default,
|
|
3796
|
-
ReviewRenderer_default,
|
|
3797
|
-
SearchRenderer_default,
|
|
3798
|
-
SelectInputRenderer_default,
|
|
3799
|
-
SectionRenderer_default,
|
|
3800
|
-
StatusListRenderer_default,
|
|
3801
|
-
TabsRenderer,
|
|
3802
|
-
TextInputRenderer_default,
|
|
3803
|
-
UploadInputRenderer,
|
|
3804
|
-
SplashStepRenderer,
|
|
3805
|
-
SplashCelebrationStepRenderer,
|
|
3806
|
-
StepRenderer,
|
|
3807
|
-
// Legacy renderer must come afterwards
|
|
3808
|
-
ReviewLegacyRenderer_default
|
|
3809
|
-
];
|
|
3810
|
-
|
|
3811
|
-
// ../renderers/src/subflow/getSubflowRenderer.tsx
|
|
3812
|
-
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3813
|
-
var getSubflowRenderer = ({
|
|
3814
|
-
Component: Component2,
|
|
3815
|
-
canRender
|
|
3816
|
-
}) => {
|
|
3817
|
-
return {
|
|
3818
|
-
canRenderType: "subflow",
|
|
3819
|
-
canRender,
|
|
3820
|
-
render: (props) => {
|
|
3821
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
3822
|
-
Component2,
|
|
3823
|
-
{
|
|
3824
|
-
presentation: props.presentation,
|
|
3825
|
-
requestCache: props.requestCache,
|
|
3826
|
-
initialRequest: props.initialRequest,
|
|
3827
|
-
onCompletion: props.onCompletion,
|
|
3828
|
-
onError: props.onError,
|
|
3829
|
-
onCancellation: props.onCancellation,
|
|
3830
|
-
onEvent: props.onEvent
|
|
3831
|
-
}
|
|
3832
|
-
);
|
|
3833
|
-
}
|
|
3834
|
-
};
|
|
3835
|
-
};
|
|
3836
|
-
|
|
3837
|
-
// src/dynamicFlow/useOnCopy.tsx
|
|
3838
|
-
var import_react19 = require("react");
|
|
3839
|
-
var import_react_intl27 = require("react-intl");
|
|
3840
|
-
|
|
3841
|
-
// src/dynamicFlow/messages.ts
|
|
3842
|
-
var import_react_intl26 = require("react-intl");
|
|
3843
|
-
var messages_default = (0, import_react_intl26.defineMessages)({
|
|
3844
|
-
copied: {
|
|
3845
|
-
id: "df.wise.CopyFeedback.copy",
|
|
3846
|
-
defaultMessage: "Copied to clipboard",
|
|
3847
|
-
description: "Appears in a snackbar when the copy operation succeeds."
|
|
3848
|
-
},
|
|
3849
|
-
copyFailed: {
|
|
3850
|
-
id: "df.wise.CopyFeedback.copyFailed",
|
|
3851
|
-
defaultMessage: "Failed to copy to clipboard",
|
|
3852
|
-
description: "Appears in a snackbar when the copy operation fails."
|
|
3853
|
-
}
|
|
3854
|
-
});
|
|
3855
|
-
|
|
3856
|
-
// src/dynamicFlow/useOnCopy.tsx
|
|
3857
|
-
var useOnCopy = () => {
|
|
3858
|
-
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
3859
|
-
const createSnackBar = useSnackBarIfAvailable();
|
|
3860
|
-
return (0, import_react19.useCallback)(
|
|
3861
|
-
(copiedContent) => {
|
|
3862
|
-
if (copiedContent) {
|
|
3863
|
-
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
3864
|
-
} else {
|
|
3865
|
-
createSnackBar({ text: formatMessage(messages_default.copyFailed) });
|
|
3866
|
-
}
|
|
3867
|
-
},
|
|
3868
|
-
[createSnackBar, formatMessage]
|
|
3869
|
-
);
|
|
4058
|
+
},
|
|
4059
|
+
[createSnackBar, formatMessage]
|
|
4060
|
+
);
|
|
3870
4061
|
};
|
|
3871
4062
|
|
|
3872
4063
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
3873
|
-
var
|
|
4064
|
+
var import_react21 = require("react");
|
|
3874
4065
|
var import_react_intl28 = require("react-intl");
|
|
3875
4066
|
var useWiseHttpClient = (httpClient) => {
|
|
3876
4067
|
const { locale } = (0, import_react_intl28.useIntl)();
|
|
3877
|
-
return (0,
|
|
4068
|
+
return (0, import_react21.useCallback)(
|
|
3878
4069
|
async (input, init = {}) => {
|
|
3879
4070
|
const headers = new Headers(init.headers);
|
|
3880
4071
|
headers.set("accept-language", locale);
|
|
@@ -3897,25 +4088,25 @@ var handleRejection = (error) => {
|
|
|
3897
4088
|
|
|
3898
4089
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
3899
4090
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
3900
|
-
var
|
|
3901
|
-
var
|
|
4091
|
+
var import_components61 = require("@transferwise/components");
|
|
4092
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
3902
4093
|
function DynamicFlowModal(props) {
|
|
3903
4094
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
3904
4095
|
const dfProps = useWiseToCoreProps(rest);
|
|
3905
4096
|
const df = (0, import_dynamic_flow_client2.useDynamicFlowModal)(dfProps);
|
|
3906
|
-
return /* @__PURE__ */ (0,
|
|
3907
|
-
|
|
4097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4098
|
+
import_components61.Modal,
|
|
3908
4099
|
__spreadProps(__spreadValues({
|
|
3909
4100
|
className: `dynamic-flow-modal ${className}`,
|
|
3910
4101
|
disableDimmerClickToClose: true
|
|
3911
4102
|
}, df.modal), {
|
|
3912
|
-
body: /* @__PURE__ */ (0,
|
|
4103
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
3913
4104
|
})
|
|
3914
4105
|
);
|
|
3915
4106
|
}
|
|
3916
4107
|
|
|
3917
4108
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
3918
|
-
var
|
|
4109
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
3919
4110
|
var wiseRenderers = getWiseRenderers();
|
|
3920
4111
|
var getMergedRenderers = (props) => {
|
|
3921
4112
|
var _d;
|
|
@@ -3929,7 +4120,7 @@ var getMergedRenderers = (props) => {
|
|
|
3929
4120
|
method: initialRequest.method,
|
|
3930
4121
|
data: initialRequest.body
|
|
3931
4122
|
};
|
|
3932
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
4123
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
3933
4124
|
DynamicFlowModal,
|
|
3934
4125
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
3935
4126
|
features: subflowFeatures,
|
|
@@ -3954,9 +4145,9 @@ var useWiseToCoreProps = (props) => {
|
|
|
3954
4145
|
onLog
|
|
3955
4146
|
} = props;
|
|
3956
4147
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3957
|
-
const mergedRenderers = (0,
|
|
3958
|
-
const logEvent = (0,
|
|
3959
|
-
const trackEvent = (0,
|
|
4148
|
+
const mergedRenderers = (0, import_react22.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
4149
|
+
const logEvent = (0, import_react22.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
4150
|
+
const trackEvent = (0, import_react22.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
3960
4151
|
const onCopy = useOnCopy();
|
|
3961
4152
|
return __spreadProps(__spreadValues({}, props), {
|
|
3962
4153
|
httpClient,
|
|
@@ -3979,23 +4170,23 @@ var openLinkInNewTab = (url) => {
|
|
|
3979
4170
|
};
|
|
3980
4171
|
|
|
3981
4172
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3982
|
-
var
|
|
4173
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
3983
4174
|
function DynamicFlow(props) {
|
|
3984
4175
|
const { className = "" } = props;
|
|
3985
4176
|
const dfProps = useWiseToCoreProps(props);
|
|
3986
4177
|
const df = (0, import_dynamic_flow_client3.useDynamicFlow)(dfProps);
|
|
3987
|
-
return /* @__PURE__ */ (0,
|
|
4178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className, children: df.view });
|
|
3988
4179
|
}
|
|
3989
4180
|
|
|
3990
4181
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
3991
|
-
var
|
|
4182
|
+
var import_react23 = require("react");
|
|
3992
4183
|
var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
3993
|
-
var
|
|
3994
|
-
var DynamicFlowWithRef = (0,
|
|
4184
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4185
|
+
var DynamicFlowWithRef = (0, import_react23.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
3995
4186
|
const { className = "" } = props;
|
|
3996
4187
|
const dfProps = useWiseToCoreProps(props);
|
|
3997
4188
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
3998
|
-
(0,
|
|
4189
|
+
(0, import_react23.useImperativeHandle)(
|
|
3999
4190
|
ref,
|
|
4000
4191
|
() => ({
|
|
4001
4192
|
getValue: async () => {
|
|
@@ -4006,14 +4197,14 @@ var DynamicFlowWithRef = (0, import_react22.forwardRef)(function DynamicFlowWith
|
|
|
4006
4197
|
}),
|
|
4007
4198
|
[df]
|
|
4008
4199
|
);
|
|
4009
|
-
return /* @__PURE__ */ (0,
|
|
4200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className, children: df.view });
|
|
4010
4201
|
});
|
|
4011
4202
|
|
|
4012
4203
|
// src/index.ts
|
|
4013
4204
|
var import_dynamic_flow_client7 = require("@wise/dynamic-flow-client");
|
|
4014
4205
|
|
|
4015
4206
|
// src/dynamicFlow/renderers.tsx
|
|
4016
|
-
var Header11 =
|
|
4207
|
+
var Header11 = Header5;
|
|
4017
4208
|
var Media2 = Media;
|
|
4018
4209
|
var getMargin2 = getMargin;
|
|
4019
4210
|
|