@wise/dynamic-flow-client-internal 5.33.0-experimental-f7c2300 → 5.33.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/dynamicFlow/DynamicFlow.js +11 -0
- package/build/dynamicFlow/DynamicFlowModal.js +21 -0
- package/build/dynamicFlow/DynamicFlowWiseProps.js +1 -0
- package/build/dynamicFlow/DynamicFlowWithRef.js +19 -0
- package/build/dynamicFlow/context-menu/useContextMenu.js +33 -0
- package/build/dynamicFlow/context-menu/useDFContextMenu.js +135 -0
- package/build/dynamicFlow/context-menu/useDFContextMenu.test.js +101 -0
- package/build/dynamicFlow/getMergedRenderers.js +36 -0
- package/build/dynamicFlow/messages.js +13 -0
- package/build/dynamicFlow/renderers.js +10 -0
- package/build/dynamicFlow/telemetry/app-version.js +4 -0
- package/build/dynamicFlow/telemetry/dispatchAnalyticsEvent.js +8 -0
- package/build/dynamicFlow/telemetry/getLogEvent.js +22 -0
- package/build/dynamicFlow/telemetry/getTrackEvent.js +39 -0
- package/build/dynamicFlow/telemetry/index.js +2 -0
- package/build/dynamicFlow/useCreateSnackBar.js +9 -0
- package/build/dynamicFlow/useOnCopy.js +16 -0
- package/build/dynamicFlow/useWiseHttpClient.js +24 -0
- package/build/dynamicFlow/useWiseToCoreProps.js +42 -0
- package/build/i18n/en.json +0 -2
- package/build/i18n/index.js +43 -0
- package/build/index.js +6 -0
- package/build/main.css +0 -24
- package/build/main.js +802 -1111
- package/build/main.mjs +586 -900
- package/build/stories/ButtonLoader.story.js +109 -0
- package/build/stories/ContainerQueries.story.js +74 -0
- package/build/stories/DynamicFlow.story.js +37 -0
- package/build/stories/DynamicFlowWithRef.story.js +72 -0
- package/build/stories/Editable.story.js +58 -0
- package/build/stories/Initialisation.story.js +33 -0
- package/build/stories/PinnedButtons.story.js +94 -0
- package/build/stories/SCAIntegration.story.js +67 -0
- package/build/stories/utils/fixtureHttpClient.js +59 -0
- package/build/test-utils/NeptuneProviders.js +11 -0
- package/build/test-utils/index.js +4 -0
- package/build/test-utils/respond-with.js +6 -0
- package/build/test-utils/rtl-utils.js +7 -0
- package/build/test-utils/wait.js +3 -0
- package/build/tests/DynamicFlow.test.js +177 -0
- package/build/tests/HideStepTitle.test.js +58 -0
- package/build/tests/RequestCache.test.js +34 -0
- package/build/tests/SCARejectionHandling.test.js +71 -0
- package/build/tests/Subflow.Wise.test.js +650 -0
- package/build/tests/events.test.js +124 -0
- package/build/tests/logging.test.js +12 -0
- package/build/tests/onNotification.test.js +96 -0
- package/build/tests/renderers/ControlAndTags.test.js +225 -0
- package/build/tests/renderers/ImageRenderer.test.js +129 -0
- package/build/tests/renderers/RadioInputRendererComponent.test.js +89 -0
- package/build/tests/renderers/ReviewRenderer.test.js +41 -0
- package/build/tests/renderers/TextInputRenderer.test.js +245 -0
- package/build/tests/renderers/TimeZoneHeader.test.js +19 -0
- package/build/tests/renderers/UploadInputRenderer.maxSize.test.js +22 -0
- package/build/tests/renderers/value-utils.test.js +24 -0
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +5 -5
package/build/main.js
CHANGED
|
@@ -70,7 +70,7 @@ var require_classnames = __commonJS({
|
|
|
70
70
|
(function() {
|
|
71
71
|
"use strict";
|
|
72
72
|
var hasOwn = {}.hasOwnProperty;
|
|
73
|
-
function
|
|
73
|
+
function classNames37() {
|
|
74
74
|
var classes = "";
|
|
75
75
|
for (var i = 0; i < arguments.length; i++) {
|
|
76
76
|
var arg = arguments[i];
|
|
@@ -88,7 +88,7 @@ var require_classnames = __commonJS({
|
|
|
88
88
|
return "";
|
|
89
89
|
}
|
|
90
90
|
if (Array.isArray(arg)) {
|
|
91
|
-
return
|
|
91
|
+
return classNames37.apply(null, arg);
|
|
92
92
|
}
|
|
93
93
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
94
94
|
return arg.toString();
|
|
@@ -111,14 +111,14 @@ var require_classnames = __commonJS({
|
|
|
111
111
|
return value + newClass;
|
|
112
112
|
}
|
|
113
113
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
114
|
-
|
|
115
|
-
module2.exports =
|
|
114
|
+
classNames37.default = classNames37;
|
|
115
|
+
module2.exports = classNames37;
|
|
116
116
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
117
117
|
define("classnames", [], function() {
|
|
118
|
-
return
|
|
118
|
+
return classNames37;
|
|
119
119
|
});
|
|
120
120
|
} else {
|
|
121
|
-
window.classNames =
|
|
121
|
+
window.classNames = classNames37;
|
|
122
122
|
}
|
|
123
123
|
})();
|
|
124
124
|
}
|
|
@@ -146,7 +146,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
|
|
|
146
146
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
147
147
|
var appVersion = (
|
|
148
148
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
149
|
-
typeof process !== "undefined" ? "5.
|
|
149
|
+
typeof process !== "undefined" ? "5.33.0" : "0.0.0"
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -336,7 +336,7 @@ var recursivelyRemoveNullish = (element) => {
|
|
|
336
336
|
};
|
|
337
337
|
|
|
338
338
|
// src/dynamicFlow/useWiseToCoreProps.tsx
|
|
339
|
-
var
|
|
339
|
+
var import_react32 = require("react");
|
|
340
340
|
|
|
341
341
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
342
342
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
@@ -1659,9 +1659,8 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1659
1659
|
};
|
|
1660
1660
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1661
1661
|
|
|
1662
|
-
// ../renderers/src/CollectionRenderer/
|
|
1663
|
-
var
|
|
1664
|
-
var import_react8 = require("motion/react");
|
|
1662
|
+
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
1663
|
+
var import_components22 = require("@transferwise/components");
|
|
1665
1664
|
|
|
1666
1665
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
1667
1666
|
var import_react_intl5 = require("react-intl");
|
|
@@ -1683,58 +1682,6 @@ var generic_error_messages_default = (0, import_react_intl5.defineMessages)({
|
|
|
1683
1682
|
}
|
|
1684
1683
|
});
|
|
1685
1684
|
|
|
1686
|
-
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1687
|
-
var import_react_intl6 = require("react-intl");
|
|
1688
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1689
|
-
var CollectionRendererComponent = (props) => {
|
|
1690
|
-
const { state, depth, pop, Search: Search5, Filters, Results, FocusedResults } = props;
|
|
1691
|
-
const { status, search } = state;
|
|
1692
|
-
const isForked = depth > 0;
|
|
1693
|
-
const isError = status.type === "error" && (status.reason === "search" || status.reason === "filter");
|
|
1694
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1695
|
-
"div",
|
|
1696
|
-
{
|
|
1697
|
-
role: "presentation",
|
|
1698
|
-
onBlur: (event) => {
|
|
1699
|
-
const { target, relatedTarget, currentTarget } = event;
|
|
1700
|
-
const lostFocus = relatedTarget === null && (!target.isConnected || target.matches(":disabled"));
|
|
1701
|
-
if (isForked && !(search == null ? void 0 : search.query) && !lostFocus && !currentTarget.contains(relatedTarget)) {
|
|
1702
|
-
pop();
|
|
1703
|
-
}
|
|
1704
|
-
},
|
|
1705
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react8.MotionConfig, { reducedMotion: "user", children: [
|
|
1706
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Search5, __spreadValues({}, props)),
|
|
1707
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Filters, __spreadValues({}, props)),
|
|
1708
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react8.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1709
|
-
import_react8.motion.div,
|
|
1710
|
-
{
|
|
1711
|
-
variants: contentVariants,
|
|
1712
|
-
initial: "enter",
|
|
1713
|
-
animate: "visible",
|
|
1714
|
-
exit: "exit",
|
|
1715
|
-
transition: { duration: 0.15, ease: "easeOut" },
|
|
1716
|
-
children: isError ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SearchError, { retry: status.retry }) : isForked ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FocusedResults, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Results, __spreadValues({}, props))
|
|
1717
|
-
},
|
|
1718
|
-
isForked ? "forked" : "root"
|
|
1719
|
-
) })
|
|
1720
|
-
] })
|
|
1721
|
-
}
|
|
1722
|
-
);
|
|
1723
|
-
};
|
|
1724
|
-
var contentVariants = {
|
|
1725
|
-
enter: () => ({ opacity: 0, y: 12 }),
|
|
1726
|
-
visible: { opacity: 1, y: 0 },
|
|
1727
|
-
exit: () => ({ opacity: 0, y: -12 })
|
|
1728
|
-
};
|
|
1729
|
-
var SearchError = ({ retry }) => {
|
|
1730
|
-
const { formatMessage } = (0, import_react_intl6.useIntl)();
|
|
1731
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_components15.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
1732
|
-
formatMessage(generic_error_messages_default.genericError),
|
|
1733
|
-
"\xA0",
|
|
1734
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components15.Link, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
1735
|
-
] });
|
|
1736
|
-
};
|
|
1737
|
-
|
|
1738
1685
|
// ../../node_modules/.pnpm/@tanstack+react-virtual@3.14.10_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
1739
1686
|
var React = __toESM(require("react"), 1);
|
|
1740
1687
|
var import_react_dom = require("react-dom");
|
|
@@ -3271,18 +3218,18 @@ function useWindowVirtualizer(options) {
|
|
|
3271
3218
|
}, options));
|
|
3272
3219
|
}
|
|
3273
3220
|
|
|
3274
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3275
|
-
var import_components17 = require("@transferwise/components");
|
|
3276
|
-
var import_react10 = require("react");
|
|
3277
|
-
|
|
3278
|
-
// ../renderers/src/step/StepFooter.tsx
|
|
3221
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3279
3222
|
var import_components16 = require("@transferwise/components");
|
|
3280
3223
|
var import_react9 = require("react");
|
|
3281
|
-
var import_react_intl8 = require("react-intl");
|
|
3282
3224
|
|
|
3283
|
-
// ../renderers/src/
|
|
3225
|
+
// ../renderers/src/step/StepFooter.tsx
|
|
3226
|
+
var import_components15 = require("@transferwise/components");
|
|
3227
|
+
var import_react8 = require("react");
|
|
3284
3228
|
var import_react_intl7 = require("react-intl");
|
|
3285
|
-
|
|
3229
|
+
|
|
3230
|
+
// ../renderers/src/messages/step.messages.ts
|
|
3231
|
+
var import_react_intl6 = require("react-intl");
|
|
3232
|
+
var step_messages_default = (0, import_react_intl6.defineMessages)({
|
|
3286
3233
|
scrollToBottom: {
|
|
3287
3234
|
id: "df.wise.step.scrollToBottom",
|
|
3288
3235
|
defaultMessage: "Scroll to bottom",
|
|
@@ -3291,24 +3238,24 @@ var step_messages_default = (0, import_react_intl7.defineMessages)({
|
|
|
3291
3238
|
});
|
|
3292
3239
|
|
|
3293
3240
|
// ../renderers/src/step/StepFooter.tsx
|
|
3294
|
-
var
|
|
3241
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3295
3242
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3296
3243
|
var StepFooter = ({ footer, tags }) => {
|
|
3297
3244
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3298
|
-
return /* @__PURE__ */ (0,
|
|
3245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FooterWithScrollButton, { footer });
|
|
3299
3246
|
}
|
|
3300
|
-
return /* @__PURE__ */ (0,
|
|
3247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DefaultFooter, { footer });
|
|
3301
3248
|
};
|
|
3302
3249
|
var DefaultFooter = ({ footer }) => {
|
|
3303
3250
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3304
|
-
return hasFooter ? /* @__PURE__ */ (0,
|
|
3251
|
+
return hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3305
3252
|
};
|
|
3306
3253
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3307
|
-
const { formatMessage } = (0,
|
|
3308
|
-
const endOfLayoutRef = (0,
|
|
3254
|
+
const { formatMessage } = (0, import_react_intl7.useIntl)();
|
|
3255
|
+
const endOfLayoutRef = (0, import_react8.useRef)(null);
|
|
3309
3256
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3310
|
-
const scrollButton = /* @__PURE__ */ (0,
|
|
3311
|
-
|
|
3257
|
+
const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3258
|
+
import_components15.Button,
|
|
3312
3259
|
{
|
|
3313
3260
|
className: "m-b-1",
|
|
3314
3261
|
v2: true,
|
|
@@ -3323,19 +3270,19 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3323
3270
|
);
|
|
3324
3271
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3325
3272
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3326
|
-
return /* @__PURE__ */ (0,
|
|
3273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3327
3274
|
}
|
|
3328
|
-
return /* @__PURE__ */ (0,
|
|
3329
|
-
/* @__PURE__ */ (0,
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3276
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3277
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "df-step-fixed__footer", children: [
|
|
3331
3278
|
!isElementVisible && scrollButton,
|
|
3332
3279
|
footer
|
|
3333
3280
|
] })
|
|
3334
3281
|
] });
|
|
3335
3282
|
};
|
|
3336
3283
|
var useIsElementVisible = (elementRef, root = null) => {
|
|
3337
|
-
const [isVisible, setIsVisible] = (0,
|
|
3338
|
-
(0,
|
|
3284
|
+
const [isVisible, setIsVisible] = (0, import_react8.useState)(false);
|
|
3285
|
+
(0, import_react8.useEffect)(() => {
|
|
3339
3286
|
const element = elementRef.current;
|
|
3340
3287
|
if (!element) return;
|
|
3341
3288
|
const observer = new IntersectionObserver(
|
|
@@ -3350,12 +3297,12 @@ var useIsElementVisible = (elementRef, root = null) => {
|
|
|
3350
3297
|
return isVisible;
|
|
3351
3298
|
};
|
|
3352
3299
|
|
|
3353
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3354
|
-
var
|
|
3300
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3301
|
+
var import_react_intl9 = require("react-intl");
|
|
3355
3302
|
|
|
3356
3303
|
// ../renderers/src/messages/collection.messages.ts
|
|
3357
|
-
var
|
|
3358
|
-
var collection_messages_default = (0,
|
|
3304
|
+
var import_react_intl8 = require("react-intl");
|
|
3305
|
+
var collection_messages_default = (0, import_react_intl8.defineMessages)({
|
|
3359
3306
|
loadMoreButton: {
|
|
3360
3307
|
id: "df.wise.Collection.loadMoreMessage",
|
|
3361
3308
|
defaultMessage: "Load more",
|
|
@@ -3365,16 +3312,6 @@ var collection_messages_default = (0, import_react_intl9.defineMessages)({
|
|
|
3365
3312
|
id: "df.wise.Collection.clearText",
|
|
3366
3313
|
defaultMessage: "Clear text",
|
|
3367
3314
|
description: "A message shown at the edge of the search bar to clear the users query"
|
|
3368
|
-
},
|
|
3369
|
-
showMoreResultsButton: {
|
|
3370
|
-
id: "df.wise.Collection.showMoreResultsButton",
|
|
3371
|
-
defaultMessage: "Show all {count} results",
|
|
3372
|
-
description: "A message shown at the bottom of a truncated list of items, clicking will expand to show more"
|
|
3373
|
-
},
|
|
3374
|
-
showLessResultsButton: {
|
|
3375
|
-
id: "df.wise.Collection.showLessResultsButton",
|
|
3376
|
-
defaultMessage: "Show less results",
|
|
3377
|
-
description: "A message shown at the bottom of an expanded list of items, clicking will truncate to show only a few"
|
|
3378
3315
|
}
|
|
3379
3316
|
});
|
|
3380
3317
|
|
|
@@ -3398,78 +3335,54 @@ var getScrollableAncestor = (element) => {
|
|
|
3398
3335
|
return null;
|
|
3399
3336
|
};
|
|
3400
3337
|
|
|
3401
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3402
|
-
var
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
return flattenLayoutBody(section);
|
|
3409
|
-
}
|
|
3410
|
-
return [];
|
|
3411
|
-
});
|
|
3412
|
-
};
|
|
3413
|
-
var flattenItemsBody = (section) => {
|
|
3414
|
-
return [
|
|
3415
|
-
...flattenSectionHeader(section),
|
|
3416
|
-
...section.items.map((item) => ({
|
|
3417
|
-
item,
|
|
3418
|
-
type: "item"
|
|
3419
|
-
}))
|
|
3420
|
-
];
|
|
3421
|
-
};
|
|
3422
|
-
var flattenLayoutBody = (section) => [
|
|
3423
|
-
...flattenSectionHeader(section),
|
|
3424
|
-
__spreadProps(__spreadValues({}, section), {
|
|
3425
|
-
type: "layout"
|
|
3426
|
-
})
|
|
3427
|
-
];
|
|
3428
|
-
var flattenSectionHeader = (section) => section.title ? [
|
|
3429
|
-
{
|
|
3430
|
-
type: "header",
|
|
3431
|
-
title: section.title,
|
|
3432
|
-
items: section.type === "items" ? section.items : void 0,
|
|
3433
|
-
id: section.id,
|
|
3434
|
-
callToAction: section.callToAction
|
|
3435
|
-
}
|
|
3436
|
-
] : [];
|
|
3437
|
-
|
|
3438
|
-
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3439
|
-
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3440
|
-
var VirtualisedContentComponent = (props) => {
|
|
3441
|
-
const { state, SectionHeader, Item } = props;
|
|
3442
|
-
const { status } = state;
|
|
3443
|
-
const contentRef = (0, import_react10.useRef)(null);
|
|
3444
|
-
const [scrollElement, setScrollElement] = (0, import_react10.useState)(null);
|
|
3445
|
-
(0, import_react10.useLayoutEffect)(() => {
|
|
3338
|
+
// ../renderers/src/CollectionRenderer/components/ContentComponent.tsx
|
|
3339
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3340
|
+
var ContentComponent = (props) => {
|
|
3341
|
+
const { state, status, SectionHeader, Item } = props;
|
|
3342
|
+
const contentRef = (0, import_react9.useRef)(null);
|
|
3343
|
+
const [scrollElement, setScrollElement] = (0, import_react9.useState)(null);
|
|
3344
|
+
(0, import_react9.useLayoutEffect)(() => {
|
|
3446
3345
|
const nextScrollElement = getScrollableAncestor(contentRef.current);
|
|
3447
3346
|
setScrollElement(
|
|
3448
3347
|
(currentScrollElement) => currentScrollElement === nextScrollElement ? currentScrollElement : nextScrollElement
|
|
3449
3348
|
);
|
|
3450
3349
|
}, []);
|
|
3451
|
-
const endOfContentRef = (0,
|
|
3350
|
+
const endOfContentRef = (0, import_react9.useRef)(null);
|
|
3452
3351
|
const isBottomVisible = useIsElementVisible(endOfContentRef, scrollElement);
|
|
3453
|
-
(0,
|
|
3352
|
+
(0, import_react9.useEffect)(() => {
|
|
3454
3353
|
const shouldAutoLoad = isBottomVisible && status.type === "idle" && state.afterSectionsProps.length === 0;
|
|
3455
3354
|
if (shouldAutoLoad && status.loadMore) {
|
|
3456
3355
|
status.loadMore();
|
|
3457
3356
|
}
|
|
3458
3357
|
}, [isBottomVisible, state.afterSectionsProps.length, status]);
|
|
3459
|
-
const stateCount = state.sections.reduce(
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
const items =
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3358
|
+
const stateCount = state.sections.reduce(
|
|
3359
|
+
(total, section) => section.items.length + total + (section.title ? 1 : 0),
|
|
3360
|
+
0
|
|
3361
|
+
);
|
|
3362
|
+
const items = state.sections.flatMap((section) => [
|
|
3363
|
+
...section.title ? [
|
|
3364
|
+
{
|
|
3365
|
+
type: "header",
|
|
3366
|
+
title: section.title,
|
|
3367
|
+
items: section.items,
|
|
3368
|
+
id: section.id,
|
|
3369
|
+
callToAction: section.callToAction
|
|
3370
|
+
}
|
|
3371
|
+
] : [],
|
|
3372
|
+
...section.items.map((item) => ({
|
|
3373
|
+
item,
|
|
3374
|
+
type: "item"
|
|
3375
|
+
}))
|
|
3376
|
+
]);
|
|
3377
|
+
const listRef = (0, import_react9.useRef)(null);
|
|
3378
|
+
const listOffsetRef = (0, import_react9.useRef)(0);
|
|
3379
|
+
(0, import_react9.useLayoutEffect)(() => {
|
|
3467
3380
|
var _a, _b;
|
|
3468
3381
|
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
3469
3382
|
});
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref: contentRef, children: [
|
|
3471
3384
|
state.beforeSections,
|
|
3472
|
-
scrollElement ? /* @__PURE__ */ (0,
|
|
3385
|
+
scrollElement ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3473
3386
|
ElementVirtualizedItems,
|
|
3474
3387
|
{
|
|
3475
3388
|
Item,
|
|
@@ -3478,7 +3391,7 @@ var VirtualisedContentComponent = (props) => {
|
|
|
3478
3391
|
scrollElement,
|
|
3479
3392
|
stateCount
|
|
3480
3393
|
}
|
|
3481
|
-
) : /* @__PURE__ */ (0,
|
|
3394
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3482
3395
|
WindowVirtualizedItems,
|
|
3483
3396
|
{
|
|
3484
3397
|
Item,
|
|
@@ -3487,30 +3400,30 @@ var VirtualisedContentComponent = (props) => {
|
|
|
3487
3400
|
stateCount
|
|
3488
3401
|
}
|
|
3489
3402
|
),
|
|
3490
|
-
/* @__PURE__ */ (0,
|
|
3403
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(PaginationComponent, { status, state }) }),
|
|
3491
3404
|
state.afterSections
|
|
3492
3405
|
] });
|
|
3493
3406
|
};
|
|
3494
3407
|
var WindowVirtualizedItems = (props) => {
|
|
3495
3408
|
const { stateCount } = props;
|
|
3496
|
-
const virtualItemsRef = (0,
|
|
3409
|
+
const virtualItemsRef = (0, import_react9.useRef)(null);
|
|
3497
3410
|
const virtualizer = useWindowVirtualizer({
|
|
3498
3411
|
count: stateCount,
|
|
3499
3412
|
estimateSize: () => 120,
|
|
3500
3413
|
overscan: 10
|
|
3501
3414
|
});
|
|
3502
|
-
return /* @__PURE__ */ (0,
|
|
3415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3503
3416
|
};
|
|
3504
3417
|
var ElementVirtualizedItems = (props) => {
|
|
3505
3418
|
const { scrollElement, stateCount } = props;
|
|
3506
|
-
const virtualItemsRef = (0,
|
|
3419
|
+
const virtualItemsRef = (0, import_react9.useRef)(null);
|
|
3507
3420
|
const virtualizer = useVirtualizer({
|
|
3508
3421
|
count: stateCount,
|
|
3509
3422
|
getScrollElement: () => scrollElement,
|
|
3510
3423
|
estimateSize: () => 120,
|
|
3511
3424
|
overscan: 10
|
|
3512
3425
|
});
|
|
3513
|
-
return /* @__PURE__ */ (0,
|
|
3426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3514
3427
|
};
|
|
3515
3428
|
var VirtualizedItems = ({
|
|
3516
3429
|
Item,
|
|
@@ -3518,7 +3431,7 @@ var VirtualizedItems = ({
|
|
|
3518
3431
|
items,
|
|
3519
3432
|
virtualItemsRef,
|
|
3520
3433
|
virtualizer
|
|
3521
|
-
}) => /* @__PURE__ */ (0,
|
|
3434
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3522
3435
|
"div",
|
|
3523
3436
|
{
|
|
3524
3437
|
ref: virtualItemsRef,
|
|
@@ -3532,7 +3445,7 @@ var VirtualizedItems = ({
|
|
|
3532
3445
|
if (!i) {
|
|
3533
3446
|
return null;
|
|
3534
3447
|
}
|
|
3535
|
-
return /* @__PURE__ */ (0,
|
|
3448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3536
3449
|
"div",
|
|
3537
3450
|
{
|
|
3538
3451
|
ref: virtualizer.measureElement,
|
|
@@ -3544,19 +3457,17 @@ var VirtualizedItems = ({
|
|
|
3544
3457
|
width: "100%",
|
|
3545
3458
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3546
3459
|
},
|
|
3547
|
-
children:
|
|
3548
|
-
i.type === "header" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SectionHeader, __spreadValues({}, i)),
|
|
3549
|
-
i.type === "item" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Item, __spreadValues({}, i.item)),
|
|
3550
|
-
i.type === "layout" && i.children
|
|
3551
|
-
]
|
|
3460
|
+
children: i.type === "header" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SectionHeader, __spreadValues({}, i)) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Item, __spreadValues({}, i.item))
|
|
3552
3461
|
},
|
|
3553
3462
|
item.key
|
|
3554
3463
|
);
|
|
3555
3464
|
})
|
|
3556
3465
|
}
|
|
3557
3466
|
);
|
|
3558
|
-
var PaginationComponent = ({
|
|
3559
|
-
|
|
3467
|
+
var PaginationComponent = ({
|
|
3468
|
+
status,
|
|
3469
|
+
state
|
|
3470
|
+
}) => {
|
|
3560
3471
|
const isPaginationError = status.type === "error" && status.reason === "pagination";
|
|
3561
3472
|
const isPaginationLoading = status.type === "loading" && status.reason === "pagination";
|
|
3562
3473
|
const loadMore = status.type === "idle" ? status.loadMore : void 0;
|
|
@@ -3564,42 +3475,35 @@ var PaginationComponent = ({ state }) => {
|
|
|
3564
3475
|
return null;
|
|
3565
3476
|
}
|
|
3566
3477
|
if (isPaginationError) {
|
|
3567
|
-
return /* @__PURE__ */ (0,
|
|
3478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadMoreButton, { onClick: status.retry });
|
|
3568
3479
|
}
|
|
3569
3480
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
3570
|
-
return /* @__PURE__ */ (0,
|
|
3481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(LoadMoreButton, { onClick: loadMore });
|
|
3571
3482
|
}
|
|
3572
|
-
return /* @__PURE__ */ (0,
|
|
3483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components16.ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
3573
3484
|
};
|
|
3574
3485
|
var LoadMoreButton = ({ onClick }) => {
|
|
3575
|
-
const { formatMessage } = (0,
|
|
3576
|
-
return /* @__PURE__ */ (0,
|
|
3486
|
+
const { formatMessage } = (0, import_react_intl9.useIntl)();
|
|
3487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components16.Button, { v2: true, size: "sm", priority: "secondary-neutral", onClick, children: formatMessage(collection_messages_default.loadMoreButton) }) });
|
|
3577
3488
|
};
|
|
3578
3489
|
|
|
3579
|
-
// ../renderers/src/CollectionRenderer/
|
|
3580
|
-
var
|
|
3581
|
-
var
|
|
3582
|
-
var FiltersComponent = (
|
|
3583
|
-
const
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3588
|
-
Filter,
|
|
3589
|
-
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3590
|
-
filter
|
|
3591
|
-
}),
|
|
3592
|
-
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3593
|
-
);
|
|
3490
|
+
// ../renderers/src/CollectionRenderer/components/FilterComponent.tsx
|
|
3491
|
+
var import_components17 = require("@transferwise/components");
|
|
3492
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3493
|
+
var FiltersComponent = ({ state }) => {
|
|
3494
|
+
const { filters } = state;
|
|
3495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
3496
|
+
var _a;
|
|
3497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FilterComponent, __spreadValues({}, filter), JSON.stringify((_a = filter.options) == null ? void 0 : _a.map((o) => o.value)));
|
|
3594
3498
|
}) });
|
|
3595
3499
|
};
|
|
3596
|
-
var FilterComponent = (
|
|
3500
|
+
var FilterComponent = (filter) => {
|
|
3597
3501
|
const { multiSelect, options } = filter;
|
|
3598
3502
|
if (!options) {
|
|
3599
3503
|
return null;
|
|
3600
3504
|
}
|
|
3601
|
-
return /* @__PURE__ */ (0,
|
|
3602
|
-
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3506
|
+
import_components17.Chips,
|
|
3603
3507
|
{
|
|
3604
3508
|
className: "m-b-1",
|
|
3605
3509
|
multiple: multiSelect,
|
|
@@ -3624,11 +3528,11 @@ var FilterComponent = ({ filter }) => {
|
|
|
3624
3528
|
};
|
|
3625
3529
|
|
|
3626
3530
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3627
|
-
var
|
|
3531
|
+
var import_components20 = require("@transferwise/components");
|
|
3628
3532
|
|
|
3629
3533
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
3630
|
-
var
|
|
3631
|
-
var
|
|
3534
|
+
var import_components18 = require("@transferwise/components");
|
|
3535
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3632
3536
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3633
3537
|
var _a, _b;
|
|
3634
3538
|
if (!additionalInfo) {
|
|
@@ -3636,8 +3540,8 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3636
3540
|
}
|
|
3637
3541
|
const { href, text, onClick } = additionalInfo;
|
|
3638
3542
|
if (href || onClick) {
|
|
3639
|
-
return /* @__PURE__ */ (0,
|
|
3640
|
-
|
|
3543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3544
|
+
import_components18.ListItem.AdditionalInfo,
|
|
3641
3545
|
{
|
|
3642
3546
|
action: __spreadValues({
|
|
3643
3547
|
label: text
|
|
@@ -3645,20 +3549,20 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3645
3549
|
}
|
|
3646
3550
|
);
|
|
3647
3551
|
}
|
|
3648
|
-
return /* @__PURE__ */ (0,
|
|
3552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components18.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3649
3553
|
};
|
|
3650
3554
|
|
|
3651
3555
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3652
|
-
var
|
|
3653
|
-
var
|
|
3556
|
+
var import_components19 = require("@transferwise/components");
|
|
3557
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3654
3558
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3655
3559
|
if (!callToAction) {
|
|
3656
3560
|
return void 0;
|
|
3657
3561
|
}
|
|
3658
3562
|
const { accessibilityDescription, title, context } = callToAction;
|
|
3659
3563
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
3660
|
-
return /* @__PURE__ */ (0,
|
|
3661
|
-
|
|
3564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3565
|
+
import_components19.ListItem.Button,
|
|
3662
3566
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
3663
3567
|
partiallyInteractive: !fullyInteractive,
|
|
3664
3568
|
priority,
|
|
@@ -3682,7 +3586,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
3682
3586
|
};
|
|
3683
3587
|
|
|
3684
3588
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3685
|
-
var
|
|
3589
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3686
3590
|
var ItemComponent = (props) => {
|
|
3687
3591
|
var _a, _b;
|
|
3688
3592
|
const {
|
|
@@ -3704,8 +3608,8 @@ var ItemComponent = (props) => {
|
|
|
3704
3608
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
3705
3609
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3706
3610
|
};
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
3708
|
-
|
|
3611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3612
|
+
import_components20.ListItem,
|
|
3709
3613
|
{
|
|
3710
3614
|
title,
|
|
3711
3615
|
subtitle: description,
|
|
@@ -3721,52 +3625,57 @@ var ItemComponent = (props) => {
|
|
|
3721
3625
|
};
|
|
3722
3626
|
var getNavigationControl = (onClick, href) => {
|
|
3723
3627
|
if (href) {
|
|
3724
|
-
return /* @__PURE__ */ (0,
|
|
3628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ListItem.Navigation, { href });
|
|
3725
3629
|
}
|
|
3726
3630
|
if (onClick) {
|
|
3727
|
-
return /* @__PURE__ */ (0,
|
|
3631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components20.ListItem.Navigation, { onClick });
|
|
3728
3632
|
}
|
|
3729
3633
|
return null;
|
|
3730
3634
|
};
|
|
3731
3635
|
|
|
3732
|
-
// ../renderers/src/CollectionRenderer/
|
|
3733
|
-
var
|
|
3636
|
+
// ../renderers/src/CollectionRenderer/components/SearchComponent.tsx
|
|
3637
|
+
var import_components21 = require("@transferwise/components");
|
|
3734
3638
|
var import_icons = require("@transferwise/icons");
|
|
3735
|
-
var
|
|
3736
|
-
var
|
|
3737
|
-
var SearchComponent = ({
|
|
3738
|
-
|
|
3639
|
+
var import_react_intl10 = require("react-intl");
|
|
3640
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3641
|
+
var SearchComponent = ({
|
|
3642
|
+
state,
|
|
3643
|
+
status,
|
|
3644
|
+
features,
|
|
3645
|
+
control,
|
|
3646
|
+
tags
|
|
3647
|
+
}) => {
|
|
3739
3648
|
const { search } = state;
|
|
3740
|
-
const { formatMessage } = (0,
|
|
3649
|
+
const { formatMessage } = (0, import_react_intl10.useIntl)();
|
|
3741
3650
|
if (!search) {
|
|
3742
3651
|
return;
|
|
3743
3652
|
}
|
|
3744
3653
|
const getAddon = () => {
|
|
3745
|
-
var
|
|
3746
|
-
if (
|
|
3747
|
-
return { content: /* @__PURE__ */ (0,
|
|
3654
|
+
var _a;
|
|
3655
|
+
if (status.type === "loading") {
|
|
3656
|
+
return { content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.ProcessIndicator, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3748
3657
|
}
|
|
3749
|
-
if ((
|
|
3658
|
+
if ((_a = state.search) == null ? void 0 : _a.query) {
|
|
3750
3659
|
return {
|
|
3751
3660
|
interactive: true,
|
|
3752
|
-
content: /* @__PURE__ */ (0,
|
|
3753
|
-
|
|
3661
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3662
|
+
import_components21.IconButton,
|
|
3754
3663
|
{
|
|
3755
3664
|
priority: "minimal",
|
|
3756
3665
|
size: 24,
|
|
3757
3666
|
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
3758
3667
|
onClick: () => {
|
|
3759
|
-
var
|
|
3760
|
-
return (
|
|
3668
|
+
var _a2;
|
|
3669
|
+
return (_a2 = state.search) == null ? void 0 : _a2.onChange("");
|
|
3761
3670
|
},
|
|
3762
|
-
children: /* @__PURE__ */ (0,
|
|
3671
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons.CrossCircleFill, {})
|
|
3763
3672
|
}
|
|
3764
3673
|
)
|
|
3765
3674
|
};
|
|
3766
3675
|
}
|
|
3767
3676
|
return void 0;
|
|
3768
3677
|
};
|
|
3769
|
-
return /* @__PURE__ */ (0,
|
|
3678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3770
3679
|
FieldInput_default,
|
|
3771
3680
|
{
|
|
3772
3681
|
id: "search",
|
|
@@ -3777,13 +3686,13 @@ var SearchComponent = ({ state, features, control, tags }) => {
|
|
|
3777
3686
|
features,
|
|
3778
3687
|
control,
|
|
3779
3688
|
tags,
|
|
3780
|
-
children: /* @__PURE__ */ (0,
|
|
3781
|
-
|
|
3689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components21.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons.Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3690
|
+
import_components21.Input,
|
|
3782
3691
|
{
|
|
3783
3692
|
id: "search",
|
|
3784
3693
|
name: "search",
|
|
3785
3694
|
shape: "pill",
|
|
3786
|
-
placeholder:
|
|
3695
|
+
placeholder: search.hint,
|
|
3787
3696
|
type: "text",
|
|
3788
3697
|
value: search.query,
|
|
3789
3698
|
onChange: ({ currentTarget: { value } }) => {
|
|
@@ -3796,74 +3705,14 @@ var SearchComponent = ({ state, features, control, tags }) => {
|
|
|
3796
3705
|
};
|
|
3797
3706
|
|
|
3798
3707
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
3799
|
-
var
|
|
3708
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3800
3709
|
var SectionHeaderComponent = ({
|
|
3801
3710
|
title,
|
|
3802
3711
|
callToAction
|
|
3803
|
-
}) => /* @__PURE__ */ (0,
|
|
3804
|
-
|
|
3805
|
-
// ../renderers/src/CollectionRenderer/components/CollapsibleContentComponent.tsx
|
|
3806
|
-
var import_react11 = require("react");
|
|
3807
|
-
var import_components23 = require("@transferwise/components");
|
|
3808
|
-
var import_react_intl12 = require("react-intl");
|
|
3809
|
-
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3810
|
-
var CollapsibleContentComponent = (props) => {
|
|
3811
|
-
var _a;
|
|
3812
|
-
const { state, SectionHeader, Item } = props;
|
|
3813
|
-
const { search, status } = state;
|
|
3814
|
-
const [isShowingInitialState, setIsShowingInitialState] = (0, import_react11.useState)(true);
|
|
3815
|
-
const isSearchRunning = status.type === "loading" && status.reason === "search";
|
|
3816
|
-
const shouldShowInitialState = !(search == null ? void 0 : search.query) || isSearchRunning && isShowingInitialState;
|
|
3817
|
-
if (shouldShowInitialState !== isShowingInitialState) {
|
|
3818
|
-
setIsShowingInitialState(shouldShowInitialState);
|
|
3819
|
-
}
|
|
3820
|
-
const sections = shouldShowInitialState ? (_a = search == null ? void 0 : search.initialSections) != null ? _a : state.sections : state.sections;
|
|
3821
|
-
return (
|
|
3822
|
-
// keep focus in the search input when clicking the results, so clicking doesn't blur it and
|
|
3823
|
-
// pop the collection before the click is handled
|
|
3824
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { role: "presentation", onMouseDown: (event) => event.preventDefault(), children: sections.map((section) => {
|
|
3825
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Section, { section, SectionHeader, Item }, section.id);
|
|
3826
|
-
}) })
|
|
3827
|
-
);
|
|
3828
|
-
};
|
|
3829
|
-
var Section = ({ section, SectionHeader, Item }) => {
|
|
3830
|
-
const { formatMessage } = (0, import_react_intl12.useIntl)();
|
|
3831
|
-
const [expanded, setExpanded] = (0, import_react11.useState)(false);
|
|
3832
|
-
const itemIds = section.type === "items" ? section.items.map(({ id }) => id).join("") : section.id;
|
|
3833
|
-
const [prevItemIds, setPrevItemIds] = (0, import_react11.useState)(itemIds);
|
|
3834
|
-
if (itemIds !== prevItemIds) {
|
|
3835
|
-
setExpanded(false);
|
|
3836
|
-
setPrevItemIds(itemIds);
|
|
3837
|
-
}
|
|
3838
|
-
const showLoadMore = section.type === "items" && section.items.some((item) => {
|
|
3839
|
-
var _a;
|
|
3840
|
-
return (_a = item.tags) == null ? void 0 : _a.includes("hidden");
|
|
3841
|
-
});
|
|
3842
|
-
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3843
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SectionHeader, __spreadValues({}, section)),
|
|
3844
|
-
section.type === "items" && section.items.filter((item) => {
|
|
3845
|
-
var _a;
|
|
3846
|
-
return expanded || !((_a = item.tags) == null ? void 0 : _a.includes("hidden"));
|
|
3847
|
-
}).map((item) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Item, __spreadValues({}, item), item.id)),
|
|
3848
|
-
section.type === "layout" && section.children,
|
|
3849
|
-
showLoadMore ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3850
|
-
import_components23.Button,
|
|
3851
|
-
{
|
|
3852
|
-
priority: "tertiary",
|
|
3853
|
-
onClick: () => {
|
|
3854
|
-
setExpanded(!expanded);
|
|
3855
|
-
},
|
|
3856
|
-
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { children: [
|
|
3857
|
-
formatMessage(collection_messages_default.showLessResultsButton),
|
|
3858
|
-
" "
|
|
3859
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: formatMessage(collection_messages_default.showMoreResultsButton, { count: section.items.length }) })
|
|
3860
|
-
}
|
|
3861
|
-
) : void 0
|
|
3862
|
-
] });
|
|
3863
|
-
};
|
|
3712
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Header, { title, callToAction });
|
|
3864
3713
|
|
|
3865
3714
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
3866
|
-
var
|
|
3715
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3867
3716
|
var createCollectionRenderer = (canRender, components) => {
|
|
3868
3717
|
const componentsWithDefaults = __spreadValues({
|
|
3869
3718
|
Search: SearchComponent,
|
|
@@ -3871,247 +3720,92 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
3871
3720
|
Filter: FilterComponent,
|
|
3872
3721
|
Item: ItemComponent,
|
|
3873
3722
|
SectionHeader: SectionHeaderComponent,
|
|
3874
|
-
Results:
|
|
3875
|
-
FocusedResults: CollapsibleContentComponent
|
|
3723
|
+
Results: ContentComponent
|
|
3876
3724
|
}, components);
|
|
3877
3725
|
return {
|
|
3878
3726
|
canRenderType: "collection",
|
|
3879
3727
|
canRender,
|
|
3880
3728
|
render: (props) => {
|
|
3881
|
-
return /* @__PURE__ */ (0,
|
|
3729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
3882
3730
|
}
|
|
3883
3731
|
};
|
|
3884
3732
|
};
|
|
3885
3733
|
|
|
3886
|
-
// ../renderers/src/CollectionRenderer/
|
|
3887
|
-
var
|
|
3888
|
-
|
|
3889
|
-
)
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3897
|
-
var FiltersComponent2 = (props) => {
|
|
3898
|
-
var _b;
|
|
3899
|
-
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3900
|
-
const { state, depth } = collectionProps;
|
|
3901
|
-
const { filters, status } = state;
|
|
3902
|
-
const isHidden = depth > 0 && !((_b = state.search) == null ? void 0 : _b.query);
|
|
3903
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react12.AnimatePresence, { initial: false, children: !isHidden && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3904
|
-
import_react12.motion.div,
|
|
3905
|
-
{
|
|
3906
|
-
variants: filtersVariants,
|
|
3907
|
-
initial: "collapsed",
|
|
3908
|
-
animate: "expanded",
|
|
3909
|
-
exit: "collapsed",
|
|
3910
|
-
transition: { duration: 0.15, ease: "easeOut" },
|
|
3911
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3912
|
-
"div",
|
|
3913
|
-
{
|
|
3914
|
-
className: (0, import_classnames12.default)("df-filters-container", {
|
|
3915
|
-
"df-filter-loader": status.type === "loading" && status.reason === "search"
|
|
3916
|
-
}),
|
|
3917
|
-
children: filters.map((filter) => {
|
|
3918
|
-
var _a2;
|
|
3919
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3920
|
-
Filter,
|
|
3921
|
-
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3922
|
-
filter
|
|
3923
|
-
}),
|
|
3924
|
-
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3925
|
-
);
|
|
3926
|
-
})
|
|
3927
|
-
}
|
|
3928
|
-
)
|
|
3929
|
-
},
|
|
3930
|
-
"filters"
|
|
3931
|
-
) });
|
|
3734
|
+
// ../renderers/src/CollectionRenderer/CollectionRenderer.tsx
|
|
3735
|
+
var import_react_intl11 = require("react-intl");
|
|
3736
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3737
|
+
var CollectionRendererComponent = (props) => {
|
|
3738
|
+
const { status, Search: Search4, Filters, Results } = props;
|
|
3739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Search4, __spreadValues({}, props)),
|
|
3741
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Filters, __spreadValues({}, props)),
|
|
3742
|
+
status.type === "error" && status.reason === "search" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SearchError, { retry: status.retry }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Results, __spreadValues({}, props))
|
|
3743
|
+
] });
|
|
3932
3744
|
};
|
|
3933
|
-
var
|
|
3934
|
-
|
|
3935
|
-
|
|
3745
|
+
var SearchError = ({ retry }) => {
|
|
3746
|
+
const { formatMessage } = (0, import_react_intl11.useIntl)();
|
|
3747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_components22.InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
3748
|
+
formatMessage(generic_error_messages_default.genericError),
|
|
3749
|
+
"\xA0",
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components22.Link, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
3751
|
+
] });
|
|
3936
3752
|
};
|
|
3937
|
-
var
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
className: "m-b-1",
|
|
3951
|
-
multiple: multiSelect,
|
|
3952
|
-
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
3953
|
-
chips: [
|
|
3954
|
-
...options.map((option) => ({
|
|
3955
|
-
value: option.value,
|
|
3956
|
-
label: option.title
|
|
3957
|
-
}))
|
|
3958
|
-
],
|
|
3959
|
-
onChange: (value) => {
|
|
3960
|
-
var _a;
|
|
3961
|
-
if (disabled) {
|
|
3962
|
-
return;
|
|
3963
|
-
}
|
|
3964
|
-
if (value.selectedValue === "") {
|
|
3965
|
-
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
3966
|
-
return;
|
|
3967
|
-
}
|
|
3968
|
-
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
3969
|
-
}
|
|
3970
|
-
},
|
|
3971
|
-
JSON.stringify(options)
|
|
3753
|
+
var CollectionRenderer = createCollectionRenderer(() => true);
|
|
3754
|
+
var CollectionRenderer_default = CollectionRenderer;
|
|
3755
|
+
|
|
3756
|
+
// ../renderers/src/ColumnsRenderer.tsx
|
|
3757
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
3758
|
+
|
|
3759
|
+
// ../renderers/src/utils/useIsCollapsed.ts
|
|
3760
|
+
var import_react10 = require("react");
|
|
3761
|
+
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
3762
|
+
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
3763
|
+
var useIsCollapsed = () => {
|
|
3764
|
+
const [collapsed, setCollapsed] = (0, import_react10.useState)(
|
|
3765
|
+
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
3972
3766
|
);
|
|
3767
|
+
(0, import_react10.useEffect)(() => {
|
|
3768
|
+
if (supportsMatchMedia()) {
|
|
3769
|
+
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
3770
|
+
const update = () => setCollapsed(mql.matches);
|
|
3771
|
+
mql.addEventListener("change", update);
|
|
3772
|
+
return () => mql.removeEventListener("change", update);
|
|
3773
|
+
}
|
|
3774
|
+
return void 0;
|
|
3775
|
+
}, []);
|
|
3776
|
+
return collapsed;
|
|
3973
3777
|
};
|
|
3974
3778
|
|
|
3975
|
-
// ../renderers/src/
|
|
3976
|
-
var
|
|
3977
|
-
var
|
|
3978
|
-
var
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
depth,
|
|
3984
|
-
fork,
|
|
3985
|
-
features,
|
|
3986
|
-
control,
|
|
3987
|
-
tags
|
|
3988
|
-
}) => {
|
|
3779
|
+
// ../renderers/src/ColumnsRenderer.tsx
|
|
3780
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3781
|
+
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
3782
|
+
var ColumnsRenderer = {
|
|
3783
|
+
canRenderType: "columns",
|
|
3784
|
+
render: ColumnsRendererComponent
|
|
3785
|
+
};
|
|
3786
|
+
function ColumnsRendererComponent(props) {
|
|
3989
3787
|
var _a;
|
|
3990
|
-
const {
|
|
3991
|
-
const
|
|
3992
|
-
const
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
var _a2;
|
|
4012
|
-
search.onChange("");
|
|
4013
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
4014
|
-
},
|
|
4015
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons2.CrossCircleFill, {})
|
|
4016
|
-
}
|
|
4017
|
-
)
|
|
4018
|
-
};
|
|
4019
|
-
}
|
|
4020
|
-
return void 0;
|
|
4021
|
-
};
|
|
4022
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4023
|
-
FieldInput_default,
|
|
4024
|
-
{
|
|
4025
|
-
id: "search",
|
|
4026
|
-
description: "",
|
|
4027
|
-
validation: void 0,
|
|
4028
|
-
help: "",
|
|
4029
|
-
label: search.title,
|
|
4030
|
-
features,
|
|
4031
|
-
control,
|
|
4032
|
-
tags,
|
|
4033
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components25.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_icons2.Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4034
|
-
import_components25.Input,
|
|
4035
|
-
{
|
|
4036
|
-
ref: inputRef,
|
|
4037
|
-
id: "search",
|
|
4038
|
-
name: "search",
|
|
4039
|
-
shape: "pill",
|
|
4040
|
-
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
4041
|
-
type: "text",
|
|
4042
|
-
value: search.query,
|
|
4043
|
-
onFocus: () => {
|
|
4044
|
-
if (!isForked) {
|
|
4045
|
-
fork();
|
|
4046
|
-
}
|
|
4047
|
-
},
|
|
4048
|
-
onChange: ({ currentTarget: { value } }) => search.onChange(value)
|
|
4049
|
-
}
|
|
4050
|
-
) })
|
|
4051
|
-
}
|
|
4052
|
-
);
|
|
4053
|
-
};
|
|
4054
|
-
|
|
4055
|
-
// ../renderers/src/CollectionRenderer/v2/CollectionRendererV2.tsx
|
|
4056
|
-
var CollectionRendererV2 = createCollectionRenderer(
|
|
4057
|
-
({ control }) => control === "contacts-collection-v2",
|
|
4058
|
-
{ Search: SearchComponent2, Filters: FiltersComponent2, Filter: FilterComponent2 }
|
|
4059
|
-
);
|
|
4060
|
-
var CollectionRendererV2_default = CollectionRendererV2;
|
|
4061
|
-
|
|
4062
|
-
// ../renderers/src/ColumnsRenderer.tsx
|
|
4063
|
-
var import_classnames13 = __toESM(require_classnames());
|
|
4064
|
-
|
|
4065
|
-
// ../renderers/src/utils/useIsCollapsed.ts
|
|
4066
|
-
var import_react14 = require("react");
|
|
4067
|
-
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
4068
|
-
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
4069
|
-
var useIsCollapsed = () => {
|
|
4070
|
-
const [collapsed, setCollapsed] = (0, import_react14.useState)(
|
|
4071
|
-
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
4072
|
-
);
|
|
4073
|
-
(0, import_react14.useEffect)(() => {
|
|
4074
|
-
if (supportsMatchMedia()) {
|
|
4075
|
-
const mql = window.matchMedia(COLLAPSE_QUERY);
|
|
4076
|
-
const update = () => setCollapsed(mql.matches);
|
|
4077
|
-
mql.addEventListener("change", update);
|
|
4078
|
-
return () => mql.removeEventListener("change", update);
|
|
4079
|
-
}
|
|
4080
|
-
return void 0;
|
|
4081
|
-
}, []);
|
|
4082
|
-
return collapsed;
|
|
4083
|
-
};
|
|
4084
|
-
|
|
4085
|
-
// ../renderers/src/ColumnsRenderer.tsx
|
|
4086
|
-
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4087
|
-
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
4088
|
-
var ColumnsRenderer = {
|
|
4089
|
-
canRenderType: "columns",
|
|
4090
|
-
render: ColumnsRendererComponent
|
|
4091
|
-
};
|
|
4092
|
-
function ColumnsRendererComponent(props) {
|
|
4093
|
-
var _a;
|
|
4094
|
-
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
4095
|
-
const isCollapsed = useIsCollapsed();
|
|
4096
|
-
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
4097
|
-
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
4098
|
-
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
4099
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
4100
|
-
"div",
|
|
4101
|
-
{
|
|
4102
|
-
className: (0, import_classnames13.default)(
|
|
4103
|
-
"df-columns-renderer-container",
|
|
4104
|
-
getMargin(margin),
|
|
4105
|
-
{
|
|
4106
|
-
"df-columns-renderer-bias-start": bias === "start",
|
|
4107
|
-
"df-columns-renderer-bias-end": bias === "end"
|
|
4108
|
-
},
|
|
4109
|
-
controlAndTagsToCSSClass(props)
|
|
4110
|
-
),
|
|
4111
|
-
children: [
|
|
4112
|
-
reverse ? endColumn : startColumn,
|
|
4113
|
-
reverse ? startColumn : endColumn
|
|
4114
|
-
]
|
|
3788
|
+
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3789
|
+
const isCollapsed = useIsCollapsed();
|
|
3790
|
+
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
3791
|
+
const startColumn = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
3792
|
+
const endColumn = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
3793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3794
|
+
"div",
|
|
3795
|
+
{
|
|
3796
|
+
className: (0, import_classnames12.default)(
|
|
3797
|
+
"df-columns-renderer-container",
|
|
3798
|
+
getMargin(margin),
|
|
3799
|
+
{
|
|
3800
|
+
"df-columns-renderer-bias-start": bias === "start",
|
|
3801
|
+
"df-columns-renderer-bias-end": bias === "end"
|
|
3802
|
+
},
|
|
3803
|
+
controlAndTagsToCSSClass(props)
|
|
3804
|
+
),
|
|
3805
|
+
children: [
|
|
3806
|
+
reverse ? endColumn : startColumn,
|
|
3807
|
+
reverse ? startColumn : endColumn
|
|
3808
|
+
]
|
|
4115
3809
|
}
|
|
4116
3810
|
);
|
|
4117
3811
|
}
|
|
@@ -4146,15 +3840,15 @@ var dateToDateString = (date) => {
|
|
|
4146
3840
|
};
|
|
4147
3841
|
|
|
4148
3842
|
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
4149
|
-
var
|
|
3843
|
+
var import_components23 = require("@transferwise/components");
|
|
4150
3844
|
|
|
4151
3845
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
4152
|
-
var
|
|
4153
|
-
var
|
|
3846
|
+
var import_react11 = require("react");
|
|
3847
|
+
var import_react_intl13 = require("react-intl");
|
|
4154
3848
|
|
|
4155
3849
|
// ../renderers/src/messages/date-input.messages.ts
|
|
4156
|
-
var
|
|
4157
|
-
var date_input_messages_default = (0,
|
|
3850
|
+
var import_react_intl12 = require("react-intl");
|
|
3851
|
+
var date_input_messages_default = (0, import_react_intl12.defineMessages)({
|
|
4158
3852
|
unavailableDates: {
|
|
4159
3853
|
id: "df.wise.DateInput.unavailableDates",
|
|
4160
3854
|
defaultMessage: "Some dates are unavailable.",
|
|
@@ -4165,8 +3859,8 @@ var date_input_messages_default = (0, import_react_intl14.defineMessages)({
|
|
|
4165
3859
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
4166
3860
|
var useAvailabilityRules = (availability) => {
|
|
4167
3861
|
var _a, _b;
|
|
4168
|
-
const { formatMessage } = (0,
|
|
4169
|
-
const [focusedDate, setFocusedDate] = (0,
|
|
3862
|
+
const { formatMessage } = (0, import_react_intl13.useIntl)();
|
|
3863
|
+
const [focusedDate, setFocusedDate] = (0, import_react11.useState)(null);
|
|
4170
3864
|
const unavailableMessage = (_b = (_a = focusedDate ? getUnavailableDateReason(focusedDate, availability) : null) != null ? _a : availability == null ? void 0 : availability.message) != null ? _b : formatMessage(date_input_messages_default.unavailableDates);
|
|
4171
3865
|
const onDateSelect = ({ date }) => {
|
|
4172
3866
|
setFocusedDate((current) => (current == null ? void 0 : current.getTime()) === date.getTime() ? current : date);
|
|
@@ -4218,7 +3912,7 @@ var matchesDateRule = (date, weekday, rule) => {
|
|
|
4218
3912
|
var isDate = (date) => date !== null;
|
|
4219
3913
|
|
|
4220
3914
|
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
4221
|
-
var
|
|
3915
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4222
3916
|
var DateLookupControl = ({
|
|
4223
3917
|
value,
|
|
4224
3918
|
minimumDate,
|
|
@@ -4231,8 +3925,8 @@ var DateLookupControl = ({
|
|
|
4231
3925
|
onFocus
|
|
4232
3926
|
}) => {
|
|
4233
3927
|
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
4234
|
-
return /* @__PURE__ */ (0,
|
|
4235
|
-
|
|
3928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3929
|
+
import_components23.DateLookup,
|
|
4236
3930
|
{
|
|
4237
3931
|
value: dateStringToDateOrNull(value),
|
|
4238
3932
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -4254,8 +3948,8 @@ var DateLookupControl = ({
|
|
|
4254
3948
|
};
|
|
4255
3949
|
|
|
4256
3950
|
// ../renderers/src/DateInputRenderer/CalendarControl.tsx
|
|
4257
|
-
var
|
|
4258
|
-
var
|
|
3951
|
+
var import_components24 = require("@transferwise/components");
|
|
3952
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4259
3953
|
var CalendarControl = ({
|
|
4260
3954
|
id,
|
|
4261
3955
|
title,
|
|
@@ -4278,7 +3972,7 @@ var CalendarControl = ({
|
|
|
4278
3972
|
};
|
|
4279
3973
|
return (
|
|
4280
3974
|
// Wrapping in a <fieldset> to address some a11y gaps in the current inline Calendar component
|
|
4281
|
-
/* @__PURE__ */ (0,
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4282
3976
|
"fieldset",
|
|
4283
3977
|
{
|
|
4284
3978
|
id,
|
|
@@ -4295,8 +3989,8 @@ var CalendarControl = ({
|
|
|
4295
3989
|
onBlur();
|
|
4296
3990
|
}
|
|
4297
3991
|
},
|
|
4298
|
-
children: /* @__PURE__ */ (0,
|
|
4299
|
-
|
|
3992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3993
|
+
import_components24.Calendar,
|
|
4300
3994
|
{
|
|
4301
3995
|
value: dateStringToDateOrNull(value),
|
|
4302
3996
|
min: dateStringToDateOrNull(minimumDate),
|
|
@@ -4314,12 +4008,12 @@ var CalendarControl = ({
|
|
|
4314
4008
|
};
|
|
4315
4009
|
|
|
4316
4010
|
// ../renderers/src/DateInputRenderer/DateInputControl.tsx
|
|
4317
|
-
var
|
|
4318
|
-
var
|
|
4011
|
+
var import_components25 = require("@transferwise/components");
|
|
4012
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4319
4013
|
var DateInputControl = (_a) => {
|
|
4320
4014
|
var _b = _a, { autoComplete } = _b, props = __objRest(_b, ["autoComplete"]);
|
|
4321
|
-
return /* @__PURE__ */ (0,
|
|
4322
|
-
|
|
4015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4016
|
+
import_components25.DateInput,
|
|
4323
4017
|
__spreadProps(__spreadValues({}, props), {
|
|
4324
4018
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
4325
4019
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
@@ -4334,7 +4028,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
4334
4028
|
};
|
|
4335
4029
|
|
|
4336
4030
|
// ../renderers/src/DateInputRenderer/DateInputRenderer.tsx
|
|
4337
|
-
var
|
|
4031
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4338
4032
|
var DateInputRenderer = {
|
|
4339
4033
|
canRenderType: "input-date",
|
|
4340
4034
|
render: (props) => {
|
|
@@ -4368,7 +4062,7 @@ var DateInputRenderer = {
|
|
|
4368
4062
|
}
|
|
4369
4063
|
return DateInputControl;
|
|
4370
4064
|
})();
|
|
4371
|
-
return /* @__PURE__ */ (0,
|
|
4065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4372
4066
|
FieldInput_default,
|
|
4373
4067
|
{
|
|
4374
4068
|
id,
|
|
@@ -4381,7 +4075,7 @@ var DateInputRenderer = {
|
|
|
4381
4075
|
features: props.features,
|
|
4382
4076
|
control,
|
|
4383
4077
|
tags: props.tags,
|
|
4384
|
-
children: /* @__PURE__ */ (0,
|
|
4078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(UIComponent, __spreadValues({}, inputProps))
|
|
4385
4079
|
}
|
|
4386
4080
|
);
|
|
4387
4081
|
}
|
|
@@ -4389,16 +4083,16 @@ var DateInputRenderer = {
|
|
|
4389
4083
|
var DateInputRenderer_default = DateInputRenderer;
|
|
4390
4084
|
|
|
4391
4085
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4392
|
-
var
|
|
4086
|
+
var import_components28 = require("@transferwise/components");
|
|
4393
4087
|
|
|
4394
4088
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4395
|
-
var
|
|
4396
|
-
var
|
|
4397
|
-
var
|
|
4089
|
+
var import_components27 = require("@transferwise/components");
|
|
4090
|
+
var import_react12 = require("react");
|
|
4091
|
+
var import_react_intl17 = require("react-intl");
|
|
4398
4092
|
|
|
4399
4093
|
// ../renderers/src/messages/filter.messages.ts
|
|
4400
|
-
var
|
|
4401
|
-
var filter_messages_default = (0,
|
|
4094
|
+
var import_react_intl14 = require("react-intl");
|
|
4095
|
+
var filter_messages_default = (0, import_react_intl14.defineMessages)({
|
|
4402
4096
|
placeholder: {
|
|
4403
4097
|
id: "df.wise.filter.placeholder",
|
|
4404
4098
|
defaultMessage: "Start typing to search",
|
|
@@ -4464,12 +4158,12 @@ function filterAndSortItems(options, query) {
|
|
|
4464
4158
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
4465
4159
|
|
|
4466
4160
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4467
|
-
var
|
|
4468
|
-
var
|
|
4161
|
+
var import_components26 = require("@transferwise/components");
|
|
4162
|
+
var import_react_intl16 = require("react-intl");
|
|
4469
4163
|
|
|
4470
4164
|
// ../renderers/src/messages/group.messages.ts
|
|
4471
|
-
var
|
|
4472
|
-
var group_messages_default = (0,
|
|
4165
|
+
var import_react_intl15 = require("react-intl");
|
|
4166
|
+
var group_messages_default = (0, import_react_intl15.defineMessages)({
|
|
4473
4167
|
all: {
|
|
4474
4168
|
id: "df.wise.group.all",
|
|
4475
4169
|
defaultMessage: "All",
|
|
@@ -4503,19 +4197,19 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
4503
4197
|
};
|
|
4504
4198
|
|
|
4505
4199
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4506
|
-
var
|
|
4200
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4507
4201
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4508
4202
|
var isGroupedDecision = (options) => {
|
|
4509
4203
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
4510
4204
|
};
|
|
4511
4205
|
var GroupedDecisionList = (_a) => {
|
|
4512
4206
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4513
|
-
const { formatMessage } = (0,
|
|
4207
|
+
const { formatMessage } = (0, import_react_intl16.useIntl)();
|
|
4514
4208
|
const { options } = rest;
|
|
4515
4209
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
4516
|
-
return /* @__PURE__ */ (0,
|
|
4517
|
-
/* @__PURE__ */ (0,
|
|
4518
|
-
|
|
4210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_components26.Section, { children: [
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
4212
|
+
import_components26.Header,
|
|
4519
4213
|
{
|
|
4520
4214
|
as: "h2",
|
|
4521
4215
|
title: tag in group_messages_default ? formatMessage(group_messages_default[tag]) : tag
|
|
@@ -4526,28 +4220,28 @@ var GroupedDecisionList = (_a) => {
|
|
|
4526
4220
|
};
|
|
4527
4221
|
|
|
4528
4222
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4529
|
-
var
|
|
4530
|
-
var
|
|
4223
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
4224
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4531
4225
|
var DecisionWrapper = (props) => {
|
|
4532
4226
|
const { margin, control, title, tags } = props;
|
|
4533
|
-
return /* @__PURE__ */ (0,
|
|
4534
|
-
title && /* @__PURE__ */ (0,
|
|
4535
|
-
control === "filtered" ? /* @__PURE__ */ (0,
|
|
4227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: (0, import_classnames13.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4228
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components27.Header, { as: "h2", title }),
|
|
4229
|
+
control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
|
|
4536
4230
|
] });
|
|
4537
4231
|
};
|
|
4538
4232
|
var UnfilteredDecisionList = (_a) => {
|
|
4539
4233
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4540
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0,
|
|
4234
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
4541
4235
|
};
|
|
4542
4236
|
var FilteredDecisionList = (props) => {
|
|
4543
|
-
const { formatMessage } = (0,
|
|
4544
|
-
const [query, setQuery] = (0,
|
|
4237
|
+
const { formatMessage } = (0, import_react_intl17.useIntl)();
|
|
4238
|
+
const [query, setQuery] = (0, import_react12.useState)("");
|
|
4545
4239
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
4546
4240
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
4547
4241
|
const isGrouped = isGroupedDecision(options);
|
|
4548
|
-
return /* @__PURE__ */ (0,
|
|
4549
|
-
/* @__PURE__ */ (0,
|
|
4550
|
-
|
|
4242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4243
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
4244
|
+
import_components27.SearchInput,
|
|
4551
4245
|
{
|
|
4552
4246
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
4553
4247
|
value: query,
|
|
@@ -4558,25 +4252,25 @@ var FilteredDecisionList = (props) => {
|
|
|
4558
4252
|
}
|
|
4559
4253
|
}
|
|
4560
4254
|
),
|
|
4561
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */ (0,
|
|
4562
|
-
query.length > 0 && /* @__PURE__ */ (0,
|
|
4255
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
4256
|
+
query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components27.Header, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
4563
4257
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
4564
4258
|
control,
|
|
4565
4259
|
className: query.length === 0 ? "m-t-3" : "",
|
|
4566
4260
|
options: filteredOptions
|
|
4567
|
-
}) : /* @__PURE__ */ (0,
|
|
4261
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
4568
4262
|
] })
|
|
4569
4263
|
] });
|
|
4570
4264
|
};
|
|
4571
4265
|
|
|
4572
4266
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4573
|
-
var
|
|
4267
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4574
4268
|
var DecisionRenderer = {
|
|
4575
4269
|
canRenderType: "decision",
|
|
4576
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4270
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
4577
4271
|
};
|
|
4578
4272
|
var renderDecisionList = ({ options, control }) => {
|
|
4579
|
-
return /* @__PURE__ */ (0,
|
|
4273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: options.map((_a) => {
|
|
4580
4274
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
4581
4275
|
const {
|
|
4582
4276
|
description,
|
|
@@ -4589,8 +4283,8 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4589
4283
|
supportingValues,
|
|
4590
4284
|
tags
|
|
4591
4285
|
} = rest;
|
|
4592
|
-
return /* @__PURE__ */ (0,
|
|
4593
|
-
|
|
4286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4287
|
+
import_components28.ListItem,
|
|
4594
4288
|
{
|
|
4595
4289
|
title: itemTitle,
|
|
4596
4290
|
subtitle: description,
|
|
@@ -4601,7 +4295,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4601
4295
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
4602
4296
|
prompt: getInlineAlert(inlineAlert),
|
|
4603
4297
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
4604
|
-
control: /* @__PURE__ */ (0,
|
|
4298
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components28.ListItem.Navigation, __spreadValues({}, getAnchorProps()))
|
|
4605
4299
|
},
|
|
4606
4300
|
JSON.stringify(rest)
|
|
4607
4301
|
);
|
|
@@ -4610,9 +4304,9 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4610
4304
|
var DecisionRenderer_default = DecisionRenderer;
|
|
4611
4305
|
|
|
4612
4306
|
// ../renderers/src/DividerRenderer.tsx
|
|
4613
|
-
var
|
|
4614
|
-
var
|
|
4615
|
-
var
|
|
4307
|
+
var import_components29 = require("@transferwise/components");
|
|
4308
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4309
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4616
4310
|
var mapControlToLevel = (control) => {
|
|
4617
4311
|
switch (control) {
|
|
4618
4312
|
case "section":
|
|
@@ -4625,10 +4319,10 @@ var mapControlToLevel = (control) => {
|
|
|
4625
4319
|
};
|
|
4626
4320
|
var DividerRenderer = {
|
|
4627
4321
|
canRenderType: "divider",
|
|
4628
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4629
|
-
|
|
4322
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4323
|
+
import_components29.Divider,
|
|
4630
4324
|
{
|
|
4631
|
-
className: (0,
|
|
4325
|
+
className: (0, import_classnames14.default)(
|
|
4632
4326
|
"m-t-0",
|
|
4633
4327
|
"d-block",
|
|
4634
4328
|
getMargin(margin),
|
|
@@ -4641,11 +4335,11 @@ var DividerRenderer = {
|
|
|
4641
4335
|
var DividerRenderer_default = DividerRenderer;
|
|
4642
4336
|
|
|
4643
4337
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4644
|
-
var
|
|
4338
|
+
var import_components30 = require("@transferwise/components");
|
|
4645
4339
|
|
|
4646
4340
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
4647
|
-
var
|
|
4648
|
-
var external_confirmation_messages_default = (0,
|
|
4341
|
+
var import_react_intl18 = require("react-intl");
|
|
4342
|
+
var external_confirmation_messages_default = (0, import_react_intl18.defineMessages)({
|
|
4649
4343
|
title: {
|
|
4650
4344
|
id: "df.wise.ExternalConfirmation.title",
|
|
4651
4345
|
defaultMessage: "Please confirm",
|
|
@@ -4669,9 +4363,9 @@ var external_confirmation_messages_default = (0, import_react_intl20.defineMessa
|
|
|
4669
4363
|
});
|
|
4670
4364
|
|
|
4671
4365
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4672
|
-
var
|
|
4673
|
-
var
|
|
4674
|
-
var
|
|
4366
|
+
var import_react_intl19 = require("react-intl");
|
|
4367
|
+
var import_react13 = require("react");
|
|
4368
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4675
4369
|
var ExternalConfirmationRenderer = {
|
|
4676
4370
|
canRenderType: "external-confirmation",
|
|
4677
4371
|
render: ExternalConfirmationRendererComponent
|
|
@@ -4684,20 +4378,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
4684
4378
|
control,
|
|
4685
4379
|
tags
|
|
4686
4380
|
}) {
|
|
4687
|
-
const { formatMessage } = (0,
|
|
4688
|
-
(0,
|
|
4381
|
+
const { formatMessage } = (0, import_react_intl19.useIntl)();
|
|
4382
|
+
(0, import_react13.useEffect)(() => {
|
|
4689
4383
|
open();
|
|
4690
4384
|
}, []);
|
|
4691
|
-
return /* @__PURE__ */ (0,
|
|
4692
|
-
|
|
4385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4386
|
+
import_components30.Modal,
|
|
4693
4387
|
{
|
|
4694
4388
|
open: visible,
|
|
4695
4389
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
4696
|
-
body: /* @__PURE__ */ (0,
|
|
4697
|
-
/* @__PURE__ */ (0,
|
|
4698
|
-
/* @__PURE__ */ (0,
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4700
|
-
|
|
4390
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components30.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
4392
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
|
|
4393
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4394
|
+
import_components30.Button,
|
|
4701
4395
|
{
|
|
4702
4396
|
v2: true,
|
|
4703
4397
|
block: true,
|
|
@@ -4710,7 +4404,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
4710
4404
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
4711
4405
|
}
|
|
4712
4406
|
),
|
|
4713
|
-
/* @__PURE__ */ (0,
|
|
4407
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components30.Button, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
4714
4408
|
] }) })
|
|
4715
4409
|
] }),
|
|
4716
4410
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -4728,51 +4422,51 @@ function getOrigin(url) {
|
|
|
4728
4422
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
4729
4423
|
|
|
4730
4424
|
// ../renderers/src/FormRenderer.tsx
|
|
4731
|
-
var
|
|
4732
|
-
var
|
|
4425
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4426
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4733
4427
|
var FormRenderer = {
|
|
4734
4428
|
canRenderType: "form",
|
|
4735
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
4429
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: (0, import_classnames15.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
4736
4430
|
};
|
|
4737
4431
|
var FormRenderer_default = FormRenderer;
|
|
4738
4432
|
|
|
4739
4433
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
4740
|
-
var
|
|
4741
|
-
var
|
|
4434
|
+
var import_components31 = require("@transferwise/components");
|
|
4435
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4742
4436
|
var FormSectionRenderer = {
|
|
4743
4437
|
canRenderType: "form-section",
|
|
4744
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0,
|
|
4745
|
-
title && /* @__PURE__ */ (0,
|
|
4746
|
-
|
|
4438
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4439
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4440
|
+
import_components31.Header,
|
|
4747
4441
|
{
|
|
4748
4442
|
as: "h2",
|
|
4749
4443
|
title
|
|
4750
4444
|
}
|
|
4751
4445
|
),
|
|
4752
|
-
description && /* @__PURE__ */ (0,
|
|
4446
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { children: description }),
|
|
4753
4447
|
children
|
|
4754
4448
|
] })
|
|
4755
4449
|
};
|
|
4756
4450
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
4757
4451
|
|
|
4758
4452
|
// ../renderers/src/HeadingRenderer.tsx
|
|
4759
|
-
var
|
|
4760
|
-
var
|
|
4761
|
-
var
|
|
4453
|
+
var import_components32 = require("@transferwise/components");
|
|
4454
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4455
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4762
4456
|
var HeadingRenderer = {
|
|
4763
4457
|
canRenderType: "heading",
|
|
4764
4458
|
render: Heading
|
|
4765
4459
|
};
|
|
4766
4460
|
function Heading(props) {
|
|
4767
4461
|
const { text, size, align, margin, control } = props;
|
|
4768
|
-
const className = (0,
|
|
4462
|
+
const className = (0, import_classnames16.default)(
|
|
4769
4463
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4770
4464
|
controlAndTagsToCSSClass(props)
|
|
4771
4465
|
);
|
|
4772
|
-
return control === "display" ? /* @__PURE__ */ (0,
|
|
4466
|
+
return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(StandardHeading, { size, text, className });
|
|
4773
4467
|
}
|
|
4774
4468
|
function DisplayHeading({ size, text, className }) {
|
|
4775
|
-
return /* @__PURE__ */ (0,
|
|
4469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components32.Display, { type: getDisplayType(size), className, children: text });
|
|
4776
4470
|
}
|
|
4777
4471
|
var getDisplayType = (size) => {
|
|
4778
4472
|
switch (size) {
|
|
@@ -4788,7 +4482,7 @@ var getDisplayType = (size) => {
|
|
|
4788
4482
|
}
|
|
4789
4483
|
};
|
|
4790
4484
|
function StandardHeading({ size, text, className }) {
|
|
4791
|
-
return /* @__PURE__ */ (0,
|
|
4485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components32.Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
4792
4486
|
}
|
|
4793
4487
|
var getTitleTypeBySize = (size) => {
|
|
4794
4488
|
var _a;
|
|
@@ -4804,9 +4498,9 @@ var getTitleTypeBySize = (size) => {
|
|
|
4804
4498
|
var HeadingRenderer_default = HeadingRenderer;
|
|
4805
4499
|
|
|
4806
4500
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4807
|
-
var
|
|
4808
|
-
var
|
|
4809
|
-
var
|
|
4501
|
+
var import_components33 = require("@transferwise/components");
|
|
4502
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
4503
|
+
var import_react14 = require("react");
|
|
4810
4504
|
|
|
4811
4505
|
// ../renderers/src/utils/api-utils.ts
|
|
4812
4506
|
function isRelativePath(url = "") {
|
|
@@ -4816,7 +4510,7 @@ function isRelativePath(url = "") {
|
|
|
4816
4510
|
}
|
|
4817
4511
|
|
|
4818
4512
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4819
|
-
var
|
|
4513
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4820
4514
|
function UrlImage({
|
|
4821
4515
|
accessibilityDescription,
|
|
4822
4516
|
align,
|
|
@@ -4827,24 +4521,24 @@ function UrlImage({
|
|
|
4827
4521
|
uri,
|
|
4828
4522
|
httpClient
|
|
4829
4523
|
}) {
|
|
4830
|
-
const [imageSource, setImageSource] = (0,
|
|
4831
|
-
(0,
|
|
4524
|
+
const [imageSource, setImageSource] = (0, import_react14.useState)("");
|
|
4525
|
+
(0, import_react14.useEffect)(() => {
|
|
4832
4526
|
if (!uri.startsWith("urn:")) {
|
|
4833
4527
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
4834
4528
|
}
|
|
4835
4529
|
}, [uri, httpClient]);
|
|
4836
|
-
return /* @__PURE__ */ (0,
|
|
4530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4837
4531
|
"div",
|
|
4838
4532
|
{
|
|
4839
|
-
className: (0,
|
|
4533
|
+
className: (0, import_classnames17.default)(
|
|
4840
4534
|
"df-image",
|
|
4841
4535
|
align,
|
|
4842
4536
|
size || "md",
|
|
4843
4537
|
getMargin(margin),
|
|
4844
4538
|
controlAndTagsToCSSClass({ control, tags })
|
|
4845
4539
|
),
|
|
4846
|
-
children: /* @__PURE__ */ (0,
|
|
4847
|
-
|
|
4540
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4541
|
+
import_components33.Image,
|
|
4848
4542
|
{
|
|
4849
4543
|
className: "df-reserve-space",
|
|
4850
4544
|
alt: accessibilityDescription != null ? accessibilityDescription : "",
|
|
@@ -4889,19 +4583,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4889
4583
|
};
|
|
4890
4584
|
|
|
4891
4585
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
4892
|
-
var
|
|
4586
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4893
4587
|
var ImageRenderer = {
|
|
4894
4588
|
canRenderType: "image",
|
|
4895
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0,
|
|
4589
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(UrlImage, __spreadValues({}, props))
|
|
4896
4590
|
};
|
|
4897
4591
|
|
|
4898
4592
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
4899
4593
|
var ImageRenderer_default = ImageRenderer;
|
|
4900
4594
|
|
|
4901
4595
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
4902
|
-
var
|
|
4903
|
-
var
|
|
4904
|
-
var
|
|
4596
|
+
var import_components34 = require("@transferwise/components");
|
|
4597
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4598
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4905
4599
|
var doContext = ["positive", "neutral", "proposition"];
|
|
4906
4600
|
var dontContext = ["warning", "negative"];
|
|
4907
4601
|
var InstructionsRenderer = {
|
|
@@ -4909,16 +4603,16 @@ var InstructionsRenderer = {
|
|
|
4909
4603
|
render: ({ items, margin, title, control, tags }) => {
|
|
4910
4604
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
4911
4605
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
4912
|
-
return /* @__PURE__ */ (0,
|
|
4913
|
-
title ? /* @__PURE__ */ (0,
|
|
4914
|
-
/* @__PURE__ */ (0,
|
|
4606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: (0, import_classnames18.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4607
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components34.Header, { title }) : null,
|
|
4608
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components34.InstructionsList, { dos, donts })
|
|
4915
4609
|
] });
|
|
4916
4610
|
}
|
|
4917
4611
|
};
|
|
4918
4612
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
4919
4613
|
|
|
4920
4614
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4921
|
-
var
|
|
4615
|
+
var import_components35 = require("@transferwise/components");
|
|
4922
4616
|
|
|
4923
4617
|
// ../renderers/src/utils/input-utils.ts
|
|
4924
4618
|
var onWheel = (event) => {
|
|
@@ -4943,7 +4637,7 @@ function pick(obj, ...keys) {
|
|
|
4943
4637
|
}
|
|
4944
4638
|
|
|
4945
4639
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4946
|
-
var
|
|
4640
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4947
4641
|
var IntegerInputRenderer = {
|
|
4948
4642
|
canRenderType: "input-integer",
|
|
4949
4643
|
render: (props) => {
|
|
@@ -4958,7 +4652,7 @@ var IntegerInputRenderer = {
|
|
|
4958
4652
|
"maximum",
|
|
4959
4653
|
"minimum"
|
|
4960
4654
|
);
|
|
4961
|
-
return /* @__PURE__ */ (0,
|
|
4655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4962
4656
|
FieldInput_default,
|
|
4963
4657
|
{
|
|
4964
4658
|
id,
|
|
@@ -4971,8 +4665,8 @@ var IntegerInputRenderer = {
|
|
|
4971
4665
|
features: props.features,
|
|
4972
4666
|
control: props.control,
|
|
4973
4667
|
tags: props.tags,
|
|
4974
|
-
children: /* @__PURE__ */ (0,
|
|
4975
|
-
|
|
4668
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components35.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4669
|
+
import_components35.Input,
|
|
4976
4670
|
__spreadValues({
|
|
4977
4671
|
id,
|
|
4978
4672
|
name: id,
|
|
@@ -4994,13 +4688,13 @@ var IntegerInputRenderer = {
|
|
|
4994
4688
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
4995
4689
|
|
|
4996
4690
|
// ../renderers/src/ListRenderer.tsx
|
|
4997
|
-
var
|
|
4998
|
-
var
|
|
4691
|
+
var import_components37 = require("@transferwise/components");
|
|
4692
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4999
4693
|
|
|
5000
4694
|
// ../renderers/src/components/Header.tsx
|
|
5001
|
-
var
|
|
5002
|
-
var
|
|
5003
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0,
|
|
4695
|
+
var import_components36 = require("@transferwise/components");
|
|
4696
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4697
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components36.Header, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
5004
4698
|
var getHeaderAction = (callToAction) => {
|
|
5005
4699
|
if (!callToAction) {
|
|
5006
4700
|
return void 0;
|
|
@@ -5012,11 +4706,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
5012
4706
|
};
|
|
5013
4707
|
|
|
5014
4708
|
// ../renderers/src/ListRenderer.tsx
|
|
5015
|
-
var
|
|
4709
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5016
4710
|
var ListRenderer = {
|
|
5017
4711
|
canRenderType: "list",
|
|
5018
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0,
|
|
5019
|
-
/* @__PURE__ */ (0,
|
|
4712
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: (0, import_classnames19.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Header, { title, callToAction }),
|
|
5020
4714
|
items.map((item) => {
|
|
5021
4715
|
var _a, _b;
|
|
5022
4716
|
const {
|
|
@@ -5033,8 +4727,8 @@ var ListRenderer = {
|
|
|
5033
4727
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
5034
4728
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
5035
4729
|
};
|
|
5036
|
-
return /* @__PURE__ */ (0,
|
|
5037
|
-
|
|
4730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4731
|
+
import_components37.ListItem,
|
|
5038
4732
|
{
|
|
5039
4733
|
title: itemTitle,
|
|
5040
4734
|
subtitle: description,
|
|
@@ -5053,17 +4747,17 @@ var ListRenderer = {
|
|
|
5053
4747
|
var ListRenderer_default = ListRenderer;
|
|
5054
4748
|
|
|
5055
4749
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
5056
|
-
var
|
|
5057
|
-
var
|
|
5058
|
-
var
|
|
4750
|
+
var import_components38 = require("@transferwise/components");
|
|
4751
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4752
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5059
4753
|
var LoadingIndicatorRenderer = {
|
|
5060
4754
|
canRenderType: "loading-indicator",
|
|
5061
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0,
|
|
5062
|
-
|
|
4755
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4756
|
+
import_components38.Loader,
|
|
5063
4757
|
{
|
|
5064
4758
|
size,
|
|
5065
4759
|
classNames: {
|
|
5066
|
-
"tw-loader": (0,
|
|
4760
|
+
"tw-loader": (0, import_classnames20.default)(
|
|
5067
4761
|
"tw-loader",
|
|
5068
4762
|
"m-x-auto",
|
|
5069
4763
|
getMargin(margin),
|
|
@@ -5077,24 +4771,24 @@ var LoadingIndicatorRenderer = {
|
|
|
5077
4771
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
5078
4772
|
|
|
5079
4773
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
5080
|
-
var
|
|
5081
|
-
var
|
|
5082
|
-
var
|
|
4774
|
+
var import_components39 = require("@transferwise/components");
|
|
4775
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
4776
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5083
4777
|
var MarkdownRenderer = {
|
|
5084
4778
|
canRenderType: "markdown",
|
|
5085
4779
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
5086
4780
|
const isLarge = !["xs", "sm"].includes(size);
|
|
5087
|
-
return /* @__PURE__ */ (0,
|
|
4781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5088
4782
|
"div",
|
|
5089
4783
|
{
|
|
5090
|
-
className: (0,
|
|
4784
|
+
className: (0, import_classnames21.default)(
|
|
5091
4785
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5092
4786
|
controlAndTagsToCSSClass({ control, tags })
|
|
5093
4787
|
),
|
|
5094
|
-
children: /* @__PURE__ */ (0,
|
|
5095
|
-
|
|
4788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4789
|
+
import_components39.Markdown,
|
|
5096
4790
|
{
|
|
5097
|
-
className: (0,
|
|
4791
|
+
className: (0, import_classnames21.default)("df-markdown", {
|
|
5098
4792
|
"np-text-body-large": isLarge,
|
|
5099
4793
|
"np-text-body-default": !isLarge
|
|
5100
4794
|
}),
|
|
@@ -5109,17 +4803,17 @@ var MarkdownRenderer = {
|
|
|
5109
4803
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
5110
4804
|
|
|
5111
4805
|
// ../renderers/src/MediaRenderer.tsx
|
|
5112
|
-
var
|
|
5113
|
-
var
|
|
4806
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
4807
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5114
4808
|
var MediaRenderer = {
|
|
5115
4809
|
canRenderType: "media",
|
|
5116
4810
|
render: (_a) => {
|
|
5117
4811
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
5118
4812
|
switch (media.type) {
|
|
5119
4813
|
case "avatar":
|
|
5120
|
-
return /* @__PURE__ */ (0,
|
|
4814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
5121
4815
|
case "image":
|
|
5122
|
-
return /* @__PURE__ */ (0,
|
|
4816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
5123
4817
|
case "legacy":
|
|
5124
4818
|
return null;
|
|
5125
4819
|
}
|
|
@@ -5133,16 +4827,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
5133
4827
|
control,
|
|
5134
4828
|
tags
|
|
5135
4829
|
}) => {
|
|
5136
|
-
return /* @__PURE__ */ (0,
|
|
4830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5137
4831
|
"div",
|
|
5138
4832
|
{
|
|
5139
|
-
className: (0,
|
|
4833
|
+
className: (0, import_classnames22.default)(
|
|
5140
4834
|
"df-media-layout-avatar",
|
|
5141
4835
|
align,
|
|
5142
4836
|
getMargin(margin),
|
|
5143
4837
|
controlAndTagsToCSSClass({ control, tags })
|
|
5144
4838
|
),
|
|
5145
|
-
children: /* @__PURE__ */ (0,
|
|
4839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Media, { media, size: mapAvatarMediaSize(size) })
|
|
5146
4840
|
}
|
|
5147
4841
|
);
|
|
5148
4842
|
};
|
|
@@ -5155,14 +4849,14 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
5155
4849
|
"size"
|
|
5156
4850
|
]);
|
|
5157
4851
|
var _a2, _b2;
|
|
5158
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */ (0,
|
|
4852
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5159
4853
|
UrnImage,
|
|
5160
4854
|
__spreadValues({
|
|
5161
4855
|
uri: media.uri,
|
|
5162
4856
|
size: (_a2 = media.size) != null ? _a2 : size,
|
|
5163
4857
|
accessibilityDescription: media.accessibilityDescription
|
|
5164
4858
|
}, rest)
|
|
5165
|
-
) : /* @__PURE__ */ (0,
|
|
4859
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5166
4860
|
UrlImage,
|
|
5167
4861
|
__spreadValues({
|
|
5168
4862
|
uri: media.uri,
|
|
@@ -5187,22 +4881,22 @@ var mapAvatarMediaSize = (size) => {
|
|
|
5187
4881
|
};
|
|
5188
4882
|
|
|
5189
4883
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
5190
|
-
var
|
|
5191
|
-
var
|
|
5192
|
-
var
|
|
5193
|
-
var
|
|
4884
|
+
var import_components40 = require("@transferwise/components");
|
|
4885
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
4886
|
+
var import_react15 = require("react");
|
|
4887
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5194
4888
|
var ModalLayoutRenderer = {
|
|
5195
4889
|
canRenderType: "modal-layout",
|
|
5196
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
4890
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(DFModal, __spreadValues({}, props))
|
|
5197
4891
|
};
|
|
5198
4892
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
5199
4893
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
5200
|
-
const [visible, setVisible] = (0,
|
|
4894
|
+
const [visible, setVisible] = (0, import_react15.useState)(false);
|
|
5201
4895
|
const { children, title } = content;
|
|
5202
|
-
return /* @__PURE__ */ (0,
|
|
5203
|
-
/* @__PURE__ */ (0,
|
|
5204
|
-
/* @__PURE__ */ (0,
|
|
5205
|
-
|
|
4896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: (0, import_classnames23.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4897
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components40.Button, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
4898
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4899
|
+
import_components40.Modal,
|
|
5206
4900
|
{
|
|
5207
4901
|
scroll: "content",
|
|
5208
4902
|
open: visible,
|
|
@@ -5216,13 +4910,13 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
5216
4910
|
}
|
|
5217
4911
|
|
|
5218
4912
|
// ../renderers/src/ModalRenderer.tsx
|
|
5219
|
-
var
|
|
5220
|
-
var
|
|
4913
|
+
var import_components41 = require("@transferwise/components");
|
|
4914
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5221
4915
|
var ModalRenderer = {
|
|
5222
4916
|
canRenderType: "modal",
|
|
5223
4917
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
5224
|
-
return /* @__PURE__ */ (0,
|
|
5225
|
-
|
|
4918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4919
|
+
import_components41.Modal,
|
|
5226
4920
|
{
|
|
5227
4921
|
open,
|
|
5228
4922
|
title,
|
|
@@ -5235,10 +4929,10 @@ var ModalRenderer = {
|
|
|
5235
4929
|
};
|
|
5236
4930
|
|
|
5237
4931
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
5238
|
-
var
|
|
5239
|
-
var
|
|
5240
|
-
var
|
|
5241
|
-
var
|
|
4932
|
+
var import_components42 = require("@transferwise/components");
|
|
4933
|
+
var import_react16 = require("react");
|
|
4934
|
+
var import_react_intl20 = require("react-intl");
|
|
4935
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5242
4936
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
5243
4937
|
var MoneyInputRenderer = {
|
|
5244
4938
|
canRenderType: "money-input",
|
|
@@ -5262,13 +4956,13 @@ function MoneyInputRendererComponent(props) {
|
|
|
5262
4956
|
onAmountChange,
|
|
5263
4957
|
onCurrencyChange
|
|
5264
4958
|
} = props;
|
|
5265
|
-
(0,
|
|
4959
|
+
(0, import_react16.useEffect)(() => {
|
|
5266
4960
|
if (!isValidIndex(selectedCurrencyIndex, currencies.length)) {
|
|
5267
4961
|
onCurrencyChange(0);
|
|
5268
4962
|
}
|
|
5269
4963
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
5270
|
-
const { formatMessage } = (0,
|
|
5271
|
-
return /* @__PURE__ */ (0,
|
|
4964
|
+
const { formatMessage } = (0, import_react_intl20.useIntl)();
|
|
4965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5272
4966
|
FieldInput_default,
|
|
5273
4967
|
{
|
|
5274
4968
|
id: uid,
|
|
@@ -5279,8 +4973,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
5279
4973
|
features,
|
|
5280
4974
|
control,
|
|
5281
4975
|
tags,
|
|
5282
|
-
children: /* @__PURE__ */ (0,
|
|
5283
|
-
|
|
4976
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4977
|
+
import_components42.MoneyInput,
|
|
5284
4978
|
{
|
|
5285
4979
|
amount: parseFloatOrNull(amountValue),
|
|
5286
4980
|
searchPlaceholder: "",
|
|
@@ -5341,9 +5035,9 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
5341
5035
|
}
|
|
5342
5036
|
|
|
5343
5037
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
5344
|
-
var
|
|
5345
|
-
var
|
|
5346
|
-
var
|
|
5038
|
+
var import_components43 = require("@transferwise/components");
|
|
5039
|
+
var import_react17 = require("react");
|
|
5040
|
+
var import_react_intl21 = require("react-intl");
|
|
5347
5041
|
|
|
5348
5042
|
// ../renderers/src/utils/items-with-index.ts
|
|
5349
5043
|
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -5351,7 +5045,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
5351
5045
|
}));
|
|
5352
5046
|
|
|
5353
5047
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
5354
|
-
var
|
|
5048
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5355
5049
|
function InlineComponent(props) {
|
|
5356
5050
|
const {
|
|
5357
5051
|
id,
|
|
@@ -5368,13 +5062,13 @@ function InlineComponent(props) {
|
|
|
5368
5062
|
onSelect
|
|
5369
5063
|
} = props;
|
|
5370
5064
|
const optionsWithIndex = zipWithIndex(options);
|
|
5371
|
-
const [query, setQuery] = (0,
|
|
5372
|
-
const { formatMessage } = (0,
|
|
5065
|
+
const [query, setQuery] = (0, import_react17.useState)("");
|
|
5066
|
+
const { formatMessage } = (0, import_react_intl21.useIntl)();
|
|
5373
5067
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
5374
5068
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
5375
|
-
return /* @__PURE__ */ (0,
|
|
5376
|
-
filtered && /* @__PURE__ */ (0,
|
|
5377
|
-
|
|
5069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
|
|
5070
|
+
filtered && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5071
|
+
import_components43.SearchInput,
|
|
5378
5072
|
{
|
|
5379
5073
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
5380
5074
|
disabled,
|
|
@@ -5386,7 +5080,7 @@ function InlineComponent(props) {
|
|
|
5386
5080
|
}
|
|
5387
5081
|
}
|
|
5388
5082
|
),
|
|
5389
|
-
/* @__PURE__ */ (0,
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5390
5084
|
FieldInput_default,
|
|
5391
5085
|
{
|
|
5392
5086
|
id,
|
|
@@ -5411,8 +5105,8 @@ function InlineComponent(props) {
|
|
|
5411
5105
|
childrenProps
|
|
5412
5106
|
} = option;
|
|
5413
5107
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
5414
|
-
return /* @__PURE__ */ (0,
|
|
5415
|
-
|
|
5108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5109
|
+
import_components43.ListItem,
|
|
5416
5110
|
{
|
|
5417
5111
|
title: itemTitle,
|
|
5418
5112
|
subtitle,
|
|
@@ -5420,10 +5114,10 @@ function InlineComponent(props) {
|
|
|
5420
5114
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
5421
5115
|
media: getMedia(media, false),
|
|
5422
5116
|
prompt: getInlineAlert(inlineAlert),
|
|
5423
|
-
additionalInfo: additionalText ? /* @__PURE__ */ (0,
|
|
5117
|
+
additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components43.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
|
|
5424
5118
|
disabled: disabled || optionDisabled,
|
|
5425
|
-
control: /* @__PURE__ */ (0,
|
|
5426
|
-
|
|
5119
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5120
|
+
import_components43.ListItem.Checkbox,
|
|
5427
5121
|
{
|
|
5428
5122
|
checked: selectedIndices.includes(index),
|
|
5429
5123
|
onChange: (e) => {
|
|
@@ -5442,13 +5136,13 @@ function InlineComponent(props) {
|
|
|
5442
5136
|
}
|
|
5443
5137
|
|
|
5444
5138
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5445
|
-
var
|
|
5446
|
-
var
|
|
5447
|
-
var
|
|
5139
|
+
var import_components44 = require("@transferwise/components");
|
|
5140
|
+
var import_react18 = require("react");
|
|
5141
|
+
var import_react_intl23 = require("react-intl");
|
|
5448
5142
|
|
|
5449
5143
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
5450
|
-
var
|
|
5451
|
-
var multi_select_messages_default = (0,
|
|
5144
|
+
var import_react_intl22 = require("react-intl");
|
|
5145
|
+
var multi_select_messages_default = (0, import_react_intl22.defineMessages)({
|
|
5452
5146
|
summary: {
|
|
5453
5147
|
id: "df.wise.MultiSelect.summary",
|
|
5454
5148
|
defaultMessage: "{first} and {count} more",
|
|
@@ -5457,10 +5151,10 @@ var multi_select_messages_default = (0, import_react_intl24.defineMessages)({
|
|
|
5457
5151
|
});
|
|
5458
5152
|
|
|
5459
5153
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5460
|
-
var
|
|
5154
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5461
5155
|
function DefaultComponent(props) {
|
|
5462
|
-
const { formatMessage } = (0,
|
|
5463
|
-
const [stagedIndices, setStagedIndices] = (0,
|
|
5156
|
+
const { formatMessage } = (0, import_react_intl23.useIntl)();
|
|
5157
|
+
const [stagedIndices, setStagedIndices] = (0, import_react18.useState)();
|
|
5464
5158
|
const {
|
|
5465
5159
|
id,
|
|
5466
5160
|
autoComplete,
|
|
@@ -5501,12 +5195,12 @@ function DefaultComponent(props) {
|
|
|
5501
5195
|
const contentProps = {
|
|
5502
5196
|
title: option.title,
|
|
5503
5197
|
description: option.description,
|
|
5504
|
-
icon: /* @__PURE__ */ (0,
|
|
5198
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5505
5199
|
};
|
|
5506
|
-
return /* @__PURE__ */ (0,
|
|
5200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components44.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
5507
5201
|
};
|
|
5508
5202
|
const extraProps = { autoComplete };
|
|
5509
|
-
return /* @__PURE__ */ (0,
|
|
5203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5510
5204
|
FieldInput_default,
|
|
5511
5205
|
{
|
|
5512
5206
|
id,
|
|
@@ -5517,8 +5211,8 @@ function DefaultComponent(props) {
|
|
|
5517
5211
|
features,
|
|
5518
5212
|
control,
|
|
5519
5213
|
tags,
|
|
5520
|
-
children: /* @__PURE__ */ (0,
|
|
5521
|
-
|
|
5214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5215
|
+
import_components44.SelectInput,
|
|
5522
5216
|
__spreadValues({
|
|
5523
5217
|
id,
|
|
5524
5218
|
items: options.map((option, index) => {
|
|
@@ -5556,8 +5250,8 @@ function DefaultComponent(props) {
|
|
|
5556
5250
|
}
|
|
5557
5251
|
|
|
5558
5252
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
5559
|
-
var
|
|
5560
|
-
var
|
|
5253
|
+
var import_components45 = require("@transferwise/components");
|
|
5254
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5561
5255
|
function InlineCheckboxComponent(props) {
|
|
5562
5256
|
const {
|
|
5563
5257
|
id,
|
|
@@ -5573,7 +5267,7 @@ function InlineCheckboxComponent(props) {
|
|
|
5573
5267
|
tags,
|
|
5574
5268
|
onSelect
|
|
5575
5269
|
} = props;
|
|
5576
|
-
return /* @__PURE__ */ (0,
|
|
5270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
5577
5271
|
FieldInput_default,
|
|
5578
5272
|
{
|
|
5579
5273
|
id,
|
|
@@ -5604,35 +5298,35 @@ function InlineCheckboxComponent(props) {
|
|
|
5604
5298
|
onSelect(newSelectedIndices);
|
|
5605
5299
|
}
|
|
5606
5300
|
};
|
|
5607
|
-
return /* @__PURE__ */ (0,
|
|
5301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_components45.Checkbox, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
5608
5302
|
})
|
|
5609
5303
|
}
|
|
5610
5304
|
);
|
|
5611
5305
|
}
|
|
5612
5306
|
|
|
5613
5307
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
5614
|
-
var
|
|
5308
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5615
5309
|
var MultiSelectInputRenderer = {
|
|
5616
5310
|
canRenderType: "input-multi-select",
|
|
5617
5311
|
render: (props) => {
|
|
5618
5312
|
switch (props.control) {
|
|
5619
5313
|
case "inline":
|
|
5620
|
-
return /* @__PURE__ */ (0,
|
|
5314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(InlineComponent, __spreadValues({}, props));
|
|
5621
5315
|
case "inline-checkbox-group":
|
|
5622
|
-
return /* @__PURE__ */ (0,
|
|
5316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(InlineCheckboxComponent, __spreadValues({}, props));
|
|
5623
5317
|
default:
|
|
5624
|
-
return /* @__PURE__ */ (0,
|
|
5318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(DefaultComponent, __spreadValues({}, props));
|
|
5625
5319
|
}
|
|
5626
5320
|
}
|
|
5627
5321
|
};
|
|
5628
5322
|
|
|
5629
5323
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5630
|
-
var
|
|
5324
|
+
var import_components47 = require("@transferwise/components");
|
|
5631
5325
|
|
|
5632
5326
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
5633
|
-
var
|
|
5634
|
-
var
|
|
5635
|
-
var
|
|
5327
|
+
var import_components46 = require("@transferwise/components");
|
|
5328
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5329
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5636
5330
|
function UploadFieldInput({
|
|
5637
5331
|
id,
|
|
5638
5332
|
children,
|
|
@@ -5644,14 +5338,14 @@ function UploadFieldInput({
|
|
|
5644
5338
|
control,
|
|
5645
5339
|
tags
|
|
5646
5340
|
}) {
|
|
5647
|
-
const labelContent = label && help ? /* @__PURE__ */ (0,
|
|
5341
|
+
const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(LabelContentWithHelp, { text: label, help }) : label;
|
|
5648
5342
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5649
5343
|
const { ref } = useScrollToError(validation, features);
|
|
5650
|
-
return /* @__PURE__ */ (0,
|
|
5344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
5651
5345
|
"div",
|
|
5652
5346
|
{
|
|
5653
5347
|
ref,
|
|
5654
|
-
className: (0,
|
|
5348
|
+
className: (0, import_classnames24.default)(
|
|
5655
5349
|
"form-group d-block",
|
|
5656
5350
|
{
|
|
5657
5351
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -5659,9 +5353,9 @@ function UploadFieldInput({
|
|
|
5659
5353
|
controlAndTagsToCSSClass({ control, tags })
|
|
5660
5354
|
),
|
|
5661
5355
|
children: [
|
|
5662
|
-
/* @__PURE__ */ (0,
|
|
5356
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
5663
5357
|
children,
|
|
5664
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5358
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_components46.InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
|
|
5665
5359
|
]
|
|
5666
5360
|
}
|
|
5667
5361
|
);
|
|
@@ -5696,7 +5390,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
5696
5390
|
};
|
|
5697
5391
|
|
|
5698
5392
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5699
|
-
var
|
|
5393
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5700
5394
|
var MultiUploadInputRenderer = {
|
|
5701
5395
|
canRenderType: "input-upload-multi",
|
|
5702
5396
|
render: (props) => {
|
|
@@ -5724,7 +5418,7 @@ var MultiUploadInputRenderer = {
|
|
|
5724
5418
|
};
|
|
5725
5419
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
5726
5420
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5727
|
-
return /* @__PURE__ */ (0,
|
|
5421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5728
5422
|
UploadFieldInput_default,
|
|
5729
5423
|
{
|
|
5730
5424
|
id,
|
|
@@ -5735,8 +5429,8 @@ var MultiUploadInputRenderer = {
|
|
|
5735
5429
|
features,
|
|
5736
5430
|
control,
|
|
5737
5431
|
tags,
|
|
5738
|
-
children: /* @__PURE__ */ (0,
|
|
5739
|
-
|
|
5432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5433
|
+
import_components47.UploadInput,
|
|
5740
5434
|
{
|
|
5741
5435
|
id,
|
|
5742
5436
|
"aria-describedby": descriptionId,
|
|
@@ -5745,7 +5439,7 @@ var MultiUploadInputRenderer = {
|
|
|
5745
5439
|
files: value.map(({ id: fileId, file, validationState: fileValidationState }) => ({
|
|
5746
5440
|
id: fileId,
|
|
5747
5441
|
filename: file.name,
|
|
5748
|
-
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ?
|
|
5442
|
+
status: (fileValidationState == null ? void 0 : fileValidationState.status) === "invalid" ? import_components47.Status.FAILED : import_components47.Status.SUCCEEDED
|
|
5749
5443
|
})),
|
|
5750
5444
|
fileTypes: acceptsToFileTypes(accepts),
|
|
5751
5445
|
maxFiles: maxItems,
|
|
@@ -5763,8 +5457,8 @@ var MultiUploadInputRenderer = {
|
|
|
5763
5457
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
5764
5458
|
|
|
5765
5459
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
5766
|
-
var
|
|
5767
|
-
var
|
|
5460
|
+
var import_components48 = require("@transferwise/components");
|
|
5461
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5768
5462
|
var NumberInputRenderer = {
|
|
5769
5463
|
canRenderType: "input-number",
|
|
5770
5464
|
render: (props) => {
|
|
@@ -5778,7 +5472,7 @@ var NumberInputRenderer = {
|
|
|
5778
5472
|
"maximum",
|
|
5779
5473
|
"minimum"
|
|
5780
5474
|
);
|
|
5781
|
-
return /* @__PURE__ */ (0,
|
|
5475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5782
5476
|
FieldInput_default,
|
|
5783
5477
|
{
|
|
5784
5478
|
id,
|
|
@@ -5791,8 +5485,8 @@ var NumberInputRenderer = {
|
|
|
5791
5485
|
features: props.features,
|
|
5792
5486
|
control: props.control,
|
|
5793
5487
|
tags: props.tags,
|
|
5794
|
-
children: /* @__PURE__ */ (0,
|
|
5795
|
-
|
|
5488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components48.InputGroup, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5489
|
+
import_components48.Input,
|
|
5796
5490
|
__spreadValues({
|
|
5797
5491
|
id,
|
|
5798
5492
|
name: id,
|
|
@@ -5812,22 +5506,22 @@ var NumberInputRenderer = {
|
|
|
5812
5506
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
5813
5507
|
|
|
5814
5508
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5815
|
-
var
|
|
5816
|
-
var
|
|
5817
|
-
var
|
|
5509
|
+
var import_components50 = require("@transferwise/components");
|
|
5510
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5511
|
+
var import_react_intl25 = require("react-intl");
|
|
5818
5512
|
|
|
5819
5513
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
5820
|
-
var
|
|
5821
|
-
var
|
|
5514
|
+
var import_components49 = require("@transferwise/components");
|
|
5515
|
+
var import_react19 = require("react");
|
|
5822
5516
|
function useSnackBarIfAvailable() {
|
|
5823
|
-
const context = (0,
|
|
5517
|
+
const context = (0, import_react19.useContext)(import_components49.SnackbarContext);
|
|
5824
5518
|
return context ? context.createSnackbar : () => {
|
|
5825
5519
|
};
|
|
5826
5520
|
}
|
|
5827
5521
|
|
|
5828
5522
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
5829
|
-
var
|
|
5830
|
-
var paragraph_messages_default = (0,
|
|
5523
|
+
var import_react_intl24 = require("react-intl");
|
|
5524
|
+
var paragraph_messages_default = (0, import_react_intl24.defineMessages)({
|
|
5831
5525
|
copy: {
|
|
5832
5526
|
id: "df.wise.DynamicParagraph.copy",
|
|
5833
5527
|
defaultMessage: "Copy",
|
|
@@ -5841,18 +5535,18 @@ var paragraph_messages_default = (0, import_react_intl26.defineMessages)({
|
|
|
5841
5535
|
});
|
|
5842
5536
|
|
|
5843
5537
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5844
|
-
var
|
|
5538
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5845
5539
|
var ParagraphRenderer = {
|
|
5846
5540
|
canRenderType: "paragraph",
|
|
5847
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5541
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Paragraph, __spreadValues({}, props))
|
|
5848
5542
|
};
|
|
5849
5543
|
function Paragraph(props) {
|
|
5850
5544
|
const { align, control, margin, size, text } = props;
|
|
5851
|
-
const className = (0,
|
|
5545
|
+
const className = (0, import_classnames25.default)(
|
|
5852
5546
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5853
5547
|
controlAndTagsToCSSClass(props)
|
|
5854
5548
|
);
|
|
5855
|
-
return control === "copyable" ? /* @__PURE__ */ (0,
|
|
5549
|
+
return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5856
5550
|
"p",
|
|
5857
5551
|
{
|
|
5858
5552
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -5865,41 +5559,41 @@ function CopyableParagraph({
|
|
|
5865
5559
|
align,
|
|
5866
5560
|
className
|
|
5867
5561
|
}) {
|
|
5868
|
-
const { formatMessage } = (0,
|
|
5562
|
+
const { formatMessage } = (0, import_react_intl25.useIntl)();
|
|
5869
5563
|
const createSnackbar = useSnackBarIfAvailable();
|
|
5870
5564
|
const copy = () => {
|
|
5871
5565
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
5872
5566
|
});
|
|
5873
5567
|
};
|
|
5874
5568
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
5875
|
-
return /* @__PURE__ */ (0,
|
|
5876
|
-
/* @__PURE__ */ (0,
|
|
5877
|
-
|
|
5569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className, children: [
|
|
5570
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5571
|
+
import_components50.Input,
|
|
5878
5572
|
{
|
|
5879
5573
|
type: "text",
|
|
5880
5574
|
value: text,
|
|
5881
5575
|
readOnly: true,
|
|
5882
|
-
className: (0,
|
|
5576
|
+
className: (0, import_classnames25.default)("text-ellipsis", inputAlignmentClasses)
|
|
5883
5577
|
}
|
|
5884
5578
|
),
|
|
5885
|
-
/* @__PURE__ */ (0,
|
|
5579
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components50.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5886
5580
|
] });
|
|
5887
5581
|
}
|
|
5888
5582
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
5889
5583
|
|
|
5890
5584
|
// ../renderers/src/ProgressRenderer.tsx
|
|
5891
|
-
var
|
|
5892
|
-
var
|
|
5893
|
-
var
|
|
5585
|
+
var import_components51 = require("@transferwise/components");
|
|
5586
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5587
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5894
5588
|
var ProgressRenderer = {
|
|
5895
5589
|
canRenderType: "progress",
|
|
5896
5590
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
5897
|
-
return /* @__PURE__ */ (0,
|
|
5898
|
-
|
|
5591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5592
|
+
import_components51.ProgressBar,
|
|
5899
5593
|
{
|
|
5900
5594
|
id: uid,
|
|
5901
|
-
className: (0,
|
|
5902
|
-
title: title && help ? /* @__PURE__ */ (0,
|
|
5595
|
+
className: (0, import_classnames26.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5596
|
+
title: title && help ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(LabelContentWithHelp, { text: title, help }) : title,
|
|
5903
5597
|
description,
|
|
5904
5598
|
progress: {
|
|
5905
5599
|
max: 1,
|
|
@@ -5912,15 +5606,15 @@ var ProgressRenderer = {
|
|
|
5912
5606
|
};
|
|
5913
5607
|
|
|
5914
5608
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5915
|
-
var
|
|
5916
|
-
var
|
|
5917
|
-
var
|
|
5918
|
-
var
|
|
5919
|
-
var
|
|
5609
|
+
var import_components52 = require("@transferwise/components");
|
|
5610
|
+
var import_icons2 = require("@transferwise/icons");
|
|
5611
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5612
|
+
var import_react20 = require("react");
|
|
5613
|
+
var import_react_intl27 = require("react-intl");
|
|
5920
5614
|
|
|
5921
5615
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
5922
|
-
var
|
|
5923
|
-
var repeatable_messages_default = (0,
|
|
5616
|
+
var import_react_intl26 = require("react-intl");
|
|
5617
|
+
var repeatable_messages_default = (0, import_react_intl26.defineMessages)({
|
|
5924
5618
|
addItemTitle: {
|
|
5925
5619
|
id: "df.wise.ArraySchema.addItemTitle",
|
|
5926
5620
|
defaultMessage: "Add Item",
|
|
@@ -5944,10 +5638,10 @@ var repeatable_messages_default = (0, import_react_intl28.defineMessages)({
|
|
|
5944
5638
|
});
|
|
5945
5639
|
|
|
5946
5640
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5947
|
-
var
|
|
5641
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5948
5642
|
var RepeatableRenderer = {
|
|
5949
5643
|
canRenderType: "repeatable",
|
|
5950
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5644
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Repeatable, __spreadValues({}, props))
|
|
5951
5645
|
};
|
|
5952
5646
|
function Repeatable(props) {
|
|
5953
5647
|
const {
|
|
@@ -5964,8 +5658,8 @@ function Repeatable(props) {
|
|
|
5964
5658
|
onSave,
|
|
5965
5659
|
onRemove
|
|
5966
5660
|
} = props;
|
|
5967
|
-
const { formatMessage } = (0,
|
|
5968
|
-
const [openModalType, setOpenModalType] = (0,
|
|
5661
|
+
const { formatMessage } = (0, import_react_intl27.useIntl)();
|
|
5662
|
+
const [openModalType, setOpenModalType] = (0, import_react20.useState)(null);
|
|
5969
5663
|
const { ref } = useScrollToError(validationState, features);
|
|
5970
5664
|
const onAddItem = () => {
|
|
5971
5665
|
onAdd();
|
|
@@ -5988,43 +5682,43 @@ function Repeatable(props) {
|
|
|
5988
5682
|
const onCancelEdit = () => {
|
|
5989
5683
|
setOpenModalType(null);
|
|
5990
5684
|
};
|
|
5991
|
-
return /* @__PURE__ */ (0,
|
|
5992
|
-
/* @__PURE__ */ (0,
|
|
5993
|
-
title && /* @__PURE__ */ (0,
|
|
5994
|
-
description && /* @__PURE__ */ (0,
|
|
5995
|
-
/* @__PURE__ */ (0,
|
|
5685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
5686
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5687
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.Header, { title }),
|
|
5688
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { children: description }),
|
|
5689
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
5996
5690
|
"div",
|
|
5997
5691
|
{
|
|
5998
|
-
className: (0,
|
|
5692
|
+
className: (0, import_classnames27.default)("form-group", {
|
|
5999
5693
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
6000
5694
|
}),
|
|
6001
5695
|
children: [
|
|
6002
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0,
|
|
6003
|
-
/* @__PURE__ */ (0,
|
|
6004
|
-
|
|
5696
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5697
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5698
|
+
import_components52.NavigationOption,
|
|
6005
5699
|
{
|
|
6006
|
-
media: /* @__PURE__ */ (0,
|
|
5700
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_icons2.Plus, {}),
|
|
6007
5701
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
6008
5702
|
showMediaAtAllSizes: true,
|
|
6009
5703
|
onClick: () => onAddItem()
|
|
6010
5704
|
}
|
|
6011
5705
|
),
|
|
6012
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
5706
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.InlineAlert, { type: "negative", children: validationState.message })
|
|
6013
5707
|
]
|
|
6014
5708
|
}
|
|
6015
5709
|
)
|
|
6016
5710
|
] }),
|
|
6017
|
-
/* @__PURE__ */ (0,
|
|
6018
|
-
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5712
|
+
import_components52.Modal,
|
|
6019
5713
|
{
|
|
6020
5714
|
open: openModalType !== null,
|
|
6021
5715
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
6022
|
-
body: /* @__PURE__ */ (0,
|
|
6023
|
-
/* @__PURE__ */ (0,
|
|
6024
|
-
/* @__PURE__ */ (0,
|
|
6025
|
-
/* @__PURE__ */ (0,
|
|
6026
|
-
/* @__PURE__ */ (0,
|
|
6027
|
-
|
|
5716
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
5717
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "m-b-2", children: editableItem }),
|
|
5718
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { children: [
|
|
5719
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components52.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
5720
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5721
|
+
import_components52.Button,
|
|
6028
5722
|
{
|
|
6029
5723
|
v2: true,
|
|
6030
5724
|
priority: "secondary",
|
|
@@ -6045,10 +5739,10 @@ function ItemSummaryOption({
|
|
|
6045
5739
|
item,
|
|
6046
5740
|
onClick
|
|
6047
5741
|
}) {
|
|
6048
|
-
return /* @__PURE__ */ (0,
|
|
6049
|
-
|
|
5742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5743
|
+
import_components52.NavigationOption,
|
|
6050
5744
|
{
|
|
6051
|
-
media: /* @__PURE__ */ (0,
|
|
5745
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
6052
5746
|
title: item.title,
|
|
6053
5747
|
content: item.description,
|
|
6054
5748
|
showMediaAtAllSizes: true,
|
|
@@ -6060,17 +5754,17 @@ function ItemSummaryOption({
|
|
|
6060
5754
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
6061
5755
|
|
|
6062
5756
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
6063
|
-
var
|
|
6064
|
-
var
|
|
6065
|
-
var
|
|
5757
|
+
var import_components53 = require("@transferwise/components");
|
|
5758
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5759
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
6066
5760
|
var ReviewRenderer = {
|
|
6067
5761
|
canRenderType: "review",
|
|
6068
5762
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
6069
5763
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
6070
|
-
return /* @__PURE__ */ (0,
|
|
6071
|
-
/* @__PURE__ */ (0,
|
|
6072
|
-
/* @__PURE__ */ (0,
|
|
6073
|
-
|
|
5764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: (0, import_classnames28.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5765
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Header, { title, callToAction }),
|
|
5766
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5767
|
+
import_components53.DefinitionList,
|
|
6074
5768
|
{
|
|
6075
5769
|
layout: orientation,
|
|
6076
5770
|
definitions: fields.map(
|
|
@@ -6107,21 +5801,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
6107
5801
|
};
|
|
6108
5802
|
var getFieldLabel = (label, help, onClick) => {
|
|
6109
5803
|
if (help) {
|
|
6110
|
-
return /* @__PURE__ */ (0,
|
|
5804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
6111
5805
|
label,
|
|
6112
5806
|
" ",
|
|
6113
|
-
/* @__PURE__ */ (0,
|
|
5807
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Help_default, { help, onClick })
|
|
6114
5808
|
] });
|
|
6115
5809
|
}
|
|
6116
5810
|
return label;
|
|
6117
5811
|
};
|
|
6118
5812
|
|
|
6119
5813
|
// ../renderers/src/ReviewRenderer.tsx
|
|
6120
|
-
var
|
|
6121
|
-
var
|
|
6122
|
-
var
|
|
6123
|
-
var
|
|
6124
|
-
var
|
|
5814
|
+
var import_components54 = require("@transferwise/components");
|
|
5815
|
+
var import_icons3 = require("@transferwise/icons");
|
|
5816
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
5817
|
+
var import_react_intl28 = require("react-intl");
|
|
5818
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
6125
5819
|
var IGNORED_CONTROLS = [
|
|
6126
5820
|
"horizontal",
|
|
6127
5821
|
"horizontal-end-aligned",
|
|
@@ -6131,7 +5825,7 @@ var IGNORED_CONTROLS = [
|
|
|
6131
5825
|
var ReviewRenderer2 = {
|
|
6132
5826
|
canRenderType: "review",
|
|
6133
5827
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
6134
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
5828
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Review, __spreadValues({}, props))
|
|
6135
5829
|
};
|
|
6136
5830
|
var Review = ({
|
|
6137
5831
|
callToAction,
|
|
@@ -6142,9 +5836,9 @@ var Review = ({
|
|
|
6142
5836
|
title,
|
|
6143
5837
|
trackEvent
|
|
6144
5838
|
}) => {
|
|
6145
|
-
const intl = (0,
|
|
6146
|
-
return /* @__PURE__ */ (0,
|
|
6147
|
-
/* @__PURE__ */ (0,
|
|
5839
|
+
const intl = (0, import_react_intl28.useIntl)();
|
|
5840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5841
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Header, { title, callToAction }),
|
|
6148
5842
|
fields.map((field) => {
|
|
6149
5843
|
var _a, _b, _c;
|
|
6150
5844
|
const {
|
|
@@ -6162,8 +5856,8 @@ var Review = ({
|
|
|
6162
5856
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
6163
5857
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
6164
5858
|
};
|
|
6165
|
-
return /* @__PURE__ */ (0,
|
|
6166
|
-
|
|
5859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5860
|
+
import_components54.ListItem,
|
|
6167
5861
|
{
|
|
6168
5862
|
title: value,
|
|
6169
5863
|
subtitle: label,
|
|
@@ -6183,18 +5877,18 @@ var Review = ({
|
|
|
6183
5877
|
] });
|
|
6184
5878
|
};
|
|
6185
5879
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
6186
|
-
return /* @__PURE__ */ (0,
|
|
5880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.Popover, { content: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.Markdown, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_components54.ListItem.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_icons3.QuestionMarkCircle, {}) }) });
|
|
6187
5881
|
};
|
|
6188
5882
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
6189
5883
|
|
|
6190
5884
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
6191
|
-
var
|
|
6192
|
-
var
|
|
6193
|
-
var
|
|
5885
|
+
var import_components56 = require("@transferwise/components");
|
|
5886
|
+
var import_react21 = require("react");
|
|
5887
|
+
var import_react_intl31 = require("react-intl");
|
|
6194
5888
|
|
|
6195
5889
|
// ../renderers/src/messages/search.messages.ts
|
|
6196
|
-
var
|
|
6197
|
-
var search_messages_default = (0,
|
|
5890
|
+
var import_react_intl29 = require("react-intl");
|
|
5891
|
+
var search_messages_default = (0, import_react_intl29.defineMessages)({
|
|
6198
5892
|
loading: {
|
|
6199
5893
|
id: "df.wise.SearchLayout.loading",
|
|
6200
5894
|
defaultMessage: "Loading...",
|
|
@@ -6203,21 +5897,21 @@ var search_messages_default = (0, import_react_intl31.defineMessages)({
|
|
|
6203
5897
|
});
|
|
6204
5898
|
|
|
6205
5899
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
6206
|
-
var
|
|
6207
|
-
var
|
|
6208
|
-
var
|
|
5900
|
+
var import_react_intl30 = require("react-intl");
|
|
5901
|
+
var import_components55 = require("@transferwise/components");
|
|
5902
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
6209
5903
|
function ErrorResult({ state }) {
|
|
6210
|
-
const intl = (0,
|
|
6211
|
-
return /* @__PURE__ */ (0,
|
|
5904
|
+
const intl = (0, import_react_intl30.useIntl)();
|
|
5905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("p", { className: "m-t-2", children: [
|
|
6212
5906
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
6213
5907
|
"\xA0",
|
|
6214
|
-
/* @__PURE__ */ (0,
|
|
5908
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_components55.Link, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
6215
5909
|
] });
|
|
6216
5910
|
}
|
|
6217
5911
|
|
|
6218
5912
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
6219
|
-
var
|
|
6220
|
-
var
|
|
5913
|
+
var import_icons4 = require("@transferwise/icons");
|
|
5914
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
6221
5915
|
function BlockSearchRendererComponent({
|
|
6222
5916
|
id,
|
|
6223
5917
|
hint,
|
|
@@ -6232,10 +5926,10 @@ function BlockSearchRendererComponent({
|
|
|
6232
5926
|
trackEvent,
|
|
6233
5927
|
onChange
|
|
6234
5928
|
}) {
|
|
6235
|
-
const [hasSearched, setHasSearched] = (0,
|
|
6236
|
-
const { formatMessage } = (0,
|
|
6237
|
-
return /* @__PURE__ */ (0,
|
|
6238
|
-
/* @__PURE__ */ (0,
|
|
5929
|
+
const [hasSearched, setHasSearched] = (0, import_react21.useState)(false);
|
|
5930
|
+
const { formatMessage } = (0, import_react_intl31.useIntl)();
|
|
5931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: getMargin(margin), children: [
|
|
5932
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
6239
5933
|
FieldInput_default,
|
|
6240
5934
|
{
|
|
6241
5935
|
id,
|
|
@@ -6246,8 +5940,8 @@ function BlockSearchRendererComponent({
|
|
|
6246
5940
|
features,
|
|
6247
5941
|
control,
|
|
6248
5942
|
tags,
|
|
6249
|
-
children: /* @__PURE__ */ (0,
|
|
6250
|
-
|
|
5943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components56.InputGroup, { addonStart: { content: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_icons4.Search, { size: 24 }) }, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
5944
|
+
import_components56.Input,
|
|
6251
5945
|
{
|
|
6252
5946
|
id,
|
|
6253
5947
|
name: id,
|
|
@@ -6266,7 +5960,7 @@ function BlockSearchRendererComponent({
|
|
|
6266
5960
|
) })
|
|
6267
5961
|
}
|
|
6268
5962
|
),
|
|
6269
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
5963
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(SearchResultContent, { state, trackEvent })
|
|
6270
5964
|
] });
|
|
6271
5965
|
}
|
|
6272
5966
|
function SearchResultContent({
|
|
@@ -6275,39 +5969,39 @@ function SearchResultContent({
|
|
|
6275
5969
|
}) {
|
|
6276
5970
|
switch (state.type) {
|
|
6277
5971
|
case "error":
|
|
6278
|
-
return /* @__PURE__ */ (0,
|
|
5972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ErrorResult, { state });
|
|
6279
5973
|
case "results":
|
|
6280
|
-
return /* @__PURE__ */ (0,
|
|
5974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(SearchResults, { state, trackEvent });
|
|
6281
5975
|
case "layout":
|
|
6282
|
-
return /* @__PURE__ */ (0,
|
|
5976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
6283
5977
|
" ",
|
|
6284
5978
|
state.layout,
|
|
6285
5979
|
" "
|
|
6286
5980
|
] });
|
|
6287
5981
|
case "noResults":
|
|
6288
|
-
return /* @__PURE__ */ (0,
|
|
5982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(EmptySearchResult, { state });
|
|
6289
5983
|
case "pending":
|
|
6290
5984
|
default:
|
|
6291
5985
|
return null;
|
|
6292
5986
|
}
|
|
6293
5987
|
}
|
|
6294
5988
|
function EmptySearchResult({ state }) {
|
|
6295
|
-
return /* @__PURE__ */ (0,
|
|
5989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components56.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
6296
5990
|
}
|
|
6297
5991
|
function SearchResults({
|
|
6298
5992
|
state,
|
|
6299
5993
|
trackEvent
|
|
6300
5994
|
}) {
|
|
6301
|
-
return /* @__PURE__ */ (0,
|
|
5995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components56.List, { children: state.results.map((result) => {
|
|
6302
5996
|
const { media } = result;
|
|
6303
|
-
return /* @__PURE__ */ (0,
|
|
6304
|
-
|
|
5997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
5998
|
+
import_components56.ListItem,
|
|
6305
5999
|
{
|
|
6306
6000
|
title: result.title,
|
|
6307
6001
|
subtitle: result.description,
|
|
6308
|
-
media: media ? /* @__PURE__ */ (0,
|
|
6309
|
-
control: /* @__PURE__ */ (0,
|
|
6310
|
-
|
|
6002
|
+
media: media ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
6003
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
6004
|
+
import_components56.ListItem.Navigation,
|
|
6311
6005
|
{
|
|
6312
6006
|
onClick: () => {
|
|
6313
6007
|
trackEvent("Search Result Selected", __spreadValues({
|
|
@@ -6325,11 +6019,11 @@ function SearchResults({
|
|
|
6325
6019
|
var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
6326
6020
|
|
|
6327
6021
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
6328
|
-
var
|
|
6329
|
-
var
|
|
6330
|
-
var
|
|
6331
|
-
var
|
|
6332
|
-
var
|
|
6022
|
+
var import_components57 = require("@transferwise/components");
|
|
6023
|
+
var import_icons5 = require("@transferwise/icons");
|
|
6024
|
+
var import_react22 = require("react");
|
|
6025
|
+
var import_react_intl32 = require("react-intl");
|
|
6026
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
6333
6027
|
function InlineSearchRenderer({
|
|
6334
6028
|
id,
|
|
6335
6029
|
hint,
|
|
@@ -6343,9 +6037,9 @@ function InlineSearchRenderer({
|
|
|
6343
6037
|
onChange,
|
|
6344
6038
|
trackEvent
|
|
6345
6039
|
}) {
|
|
6346
|
-
const [hasSearched, setHasSearched] = (0,
|
|
6347
|
-
const intl = (0,
|
|
6348
|
-
return /* @__PURE__ */ (0,
|
|
6040
|
+
const [hasSearched, setHasSearched] = (0, import_react22.useState)(false);
|
|
6041
|
+
const intl = (0, import_react_intl32.useIntl)();
|
|
6042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
6349
6043
|
FieldInput_default,
|
|
6350
6044
|
{
|
|
6351
6045
|
id,
|
|
@@ -6356,8 +6050,8 @@ function InlineSearchRenderer({
|
|
|
6356
6050
|
features,
|
|
6357
6051
|
control,
|
|
6358
6052
|
tags,
|
|
6359
|
-
children: /* @__PURE__ */ (0,
|
|
6360
|
-
|
|
6053
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
6054
|
+
import_components57.Typeahead,
|
|
6361
6055
|
{
|
|
6362
6056
|
id: "typeahead-input-id",
|
|
6363
6057
|
intl,
|
|
@@ -6365,10 +6059,10 @@ function InlineSearchRenderer({
|
|
|
6365
6059
|
size: "md",
|
|
6366
6060
|
placeholder: hint,
|
|
6367
6061
|
maxHeight: 100,
|
|
6368
|
-
footer: /* @__PURE__ */ (0,
|
|
6062
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TypeaheadFooter, { state, isLoading }),
|
|
6369
6063
|
multiple: false,
|
|
6370
6064
|
clearable: false,
|
|
6371
|
-
addon: /* @__PURE__ */ (0,
|
|
6065
|
+
addon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_icons5.Search, { size: 24 }),
|
|
6372
6066
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
6373
6067
|
minQueryLength: 1,
|
|
6374
6068
|
onChange: (values) => {
|
|
@@ -6405,34 +6099,34 @@ function mapResultToTypeaheadOption(result) {
|
|
|
6405
6099
|
};
|
|
6406
6100
|
}
|
|
6407
6101
|
function TypeaheadFooter({ state, isLoading }) {
|
|
6408
|
-
const { formatMessage } = (0,
|
|
6102
|
+
const { formatMessage } = (0, import_react_intl32.useIntl)();
|
|
6409
6103
|
if (state.type === "layout") {
|
|
6410
|
-
return /* @__PURE__ */ (0,
|
|
6104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
6411
6105
|
}
|
|
6412
6106
|
if (state.type === "noResults") {
|
|
6413
|
-
return /* @__PURE__ */ (0,
|
|
6107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_components57.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
6414
6108
|
}
|
|
6415
6109
|
if (state.type === "error") {
|
|
6416
|
-
return /* @__PURE__ */ (0,
|
|
6110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(ErrorResult, { state }) });
|
|
6417
6111
|
}
|
|
6418
6112
|
if (state.type === "pending" || isLoading) {
|
|
6419
|
-
return /* @__PURE__ */ (0,
|
|
6113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
6420
6114
|
}
|
|
6421
6115
|
return null;
|
|
6422
6116
|
}
|
|
6423
6117
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
6424
6118
|
|
|
6425
6119
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
6426
|
-
var
|
|
6120
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
6427
6121
|
var SearchRenderer = {
|
|
6428
6122
|
canRenderType: "search",
|
|
6429
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0,
|
|
6123
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
6430
6124
|
};
|
|
6431
6125
|
var SearchRenderer_default = SearchRenderer;
|
|
6432
6126
|
|
|
6433
6127
|
// ../renderers/src/SectionRenderer.tsx
|
|
6434
|
-
var
|
|
6435
|
-
var
|
|
6128
|
+
var import_components58 = require("@transferwise/components");
|
|
6129
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
6436
6130
|
|
|
6437
6131
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
6438
6132
|
var getHeaderAction2 = (callToAction) => {
|
|
@@ -6456,16 +6150,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
6456
6150
|
};
|
|
6457
6151
|
|
|
6458
6152
|
// ../renderers/src/SectionRenderer.tsx
|
|
6459
|
-
var
|
|
6153
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
6460
6154
|
var SectionRenderer = {
|
|
6461
6155
|
canRenderType: "section",
|
|
6462
6156
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
6463
|
-
return /* @__PURE__ */ (0,
|
|
6157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
6464
6158
|
"section",
|
|
6465
6159
|
{
|
|
6466
|
-
className: (0,
|
|
6160
|
+
className: (0, import_classnames30.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6467
6161
|
children: [
|
|
6468
|
-
(title || callToAction) && /* @__PURE__ */ (0,
|
|
6162
|
+
(title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components58.Header, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
6469
6163
|
children
|
|
6470
6164
|
]
|
|
6471
6165
|
}
|
|
@@ -6475,8 +6169,8 @@ var SectionRenderer = {
|
|
|
6475
6169
|
var SectionRenderer_default = SectionRenderer;
|
|
6476
6170
|
|
|
6477
6171
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
6478
|
-
var
|
|
6479
|
-
var
|
|
6172
|
+
var import_components59 = require("@transferwise/components");
|
|
6173
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
6480
6174
|
function RadioInputRendererComponent(props) {
|
|
6481
6175
|
const {
|
|
6482
6176
|
id,
|
|
@@ -6493,8 +6187,8 @@ function RadioInputRendererComponent(props) {
|
|
|
6493
6187
|
tags,
|
|
6494
6188
|
onSelect
|
|
6495
6189
|
} = props;
|
|
6496
|
-
return /* @__PURE__ */ (0,
|
|
6497
|
-
/* @__PURE__ */ (0,
|
|
6190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
6191
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6498
6192
|
FieldInput_default,
|
|
6499
6193
|
{
|
|
6500
6194
|
id,
|
|
@@ -6505,8 +6199,8 @@ function RadioInputRendererComponent(props) {
|
|
|
6505
6199
|
features,
|
|
6506
6200
|
control,
|
|
6507
6201
|
tags,
|
|
6508
|
-
children: /* @__PURE__ */ (0,
|
|
6509
|
-
|
|
6202
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6203
|
+
import_components59.RadioGroup,
|
|
6510
6204
|
{
|
|
6511
6205
|
name: id,
|
|
6512
6206
|
radios: options.map((option, index) => ({
|
|
@@ -6514,7 +6208,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6514
6208
|
value: index,
|
|
6515
6209
|
secondary: option.description,
|
|
6516
6210
|
disabled: option.disabled || disabled,
|
|
6517
|
-
avatar: /* @__PURE__ */ (0,
|
|
6211
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6518
6212
|
})),
|
|
6519
6213
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
6520
6214
|
onChange: onSelect
|
|
@@ -6528,9 +6222,9 @@ function RadioInputRendererComponent(props) {
|
|
|
6528
6222
|
}
|
|
6529
6223
|
|
|
6530
6224
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
6531
|
-
var
|
|
6532
|
-
var
|
|
6533
|
-
var
|
|
6225
|
+
var import_components60 = require("@transferwise/components");
|
|
6226
|
+
var import_react23 = require("react");
|
|
6227
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
6534
6228
|
function TabInputRendererComponent(props) {
|
|
6535
6229
|
const {
|
|
6536
6230
|
id,
|
|
@@ -6547,13 +6241,13 @@ function TabInputRendererComponent(props) {
|
|
|
6547
6241
|
tags,
|
|
6548
6242
|
onSelect
|
|
6549
6243
|
} = props;
|
|
6550
|
-
(0,
|
|
6244
|
+
(0, import_react23.useEffect)(() => {
|
|
6551
6245
|
if (!isValidIndex2(selectedIndex, options.length)) {
|
|
6552
6246
|
onSelect(0);
|
|
6553
6247
|
}
|
|
6554
6248
|
}, [selectedIndex, onSelect, options.length]);
|
|
6555
|
-
return /* @__PURE__ */ (0,
|
|
6556
|
-
/* @__PURE__ */ (0,
|
|
6249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
|
|
6250
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
6557
6251
|
FieldInput_default,
|
|
6558
6252
|
{
|
|
6559
6253
|
id,
|
|
@@ -6564,8 +6258,8 @@ function TabInputRendererComponent(props) {
|
|
|
6564
6258
|
features,
|
|
6565
6259
|
control,
|
|
6566
6260
|
tags,
|
|
6567
|
-
children: /* @__PURE__ */ (0,
|
|
6568
|
-
|
|
6261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
6262
|
+
import_components60.Tabs,
|
|
6569
6263
|
{
|
|
6570
6264
|
name: id,
|
|
6571
6265
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
@@ -6573,7 +6267,7 @@ function TabInputRendererComponent(props) {
|
|
|
6573
6267
|
title: option.title,
|
|
6574
6268
|
// if we pass null, we get some props-types console errors
|
|
6575
6269
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
6576
|
-
content: /* @__PURE__ */ (0,
|
|
6270
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_jsx_runtime88.Fragment, {}),
|
|
6577
6271
|
disabled: option.disabled || disabled
|
|
6578
6272
|
})),
|
|
6579
6273
|
onTabSelect: onSelect
|
|
@@ -6587,8 +6281,8 @@ function TabInputRendererComponent(props) {
|
|
|
6587
6281
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6588
6282
|
|
|
6589
6283
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
6590
|
-
var
|
|
6591
|
-
var
|
|
6284
|
+
var import_components61 = require("@transferwise/components");
|
|
6285
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6592
6286
|
function SelectInputRendererComponent(props) {
|
|
6593
6287
|
const {
|
|
6594
6288
|
id,
|
|
@@ -6631,13 +6325,13 @@ function SelectInputRendererComponent(props) {
|
|
|
6631
6325
|
} : {
|
|
6632
6326
|
title: option.title,
|
|
6633
6327
|
description: option.description,
|
|
6634
|
-
icon: /* @__PURE__ */ (0,
|
|
6328
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6635
6329
|
};
|
|
6636
|
-
return /* @__PURE__ */ (0,
|
|
6330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_components61.SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
6637
6331
|
};
|
|
6638
6332
|
const extraProps = { autoComplete };
|
|
6639
|
-
return /* @__PURE__ */ (0,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
6334
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6641
6335
|
FieldInput_default,
|
|
6642
6336
|
{
|
|
6643
6337
|
id,
|
|
@@ -6648,8 +6342,8 @@ function SelectInputRendererComponent(props) {
|
|
|
6648
6342
|
features,
|
|
6649
6343
|
control,
|
|
6650
6344
|
tags,
|
|
6651
|
-
children: /* @__PURE__ */ (0,
|
|
6652
|
-
|
|
6345
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6346
|
+
import_components61.SelectInput,
|
|
6653
6347
|
__spreadValues({
|
|
6654
6348
|
name: id,
|
|
6655
6349
|
placeholder,
|
|
@@ -6669,9 +6363,9 @@ function SelectInputRendererComponent(props) {
|
|
|
6669
6363
|
}
|
|
6670
6364
|
|
|
6671
6365
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
6672
|
-
var
|
|
6673
|
-
var
|
|
6674
|
-
var
|
|
6366
|
+
var import_react24 = require("react");
|
|
6367
|
+
var import_components62 = require("@transferwise/components");
|
|
6368
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
6675
6369
|
function SegmentedInputRendererComponent(props) {
|
|
6676
6370
|
const {
|
|
6677
6371
|
id,
|
|
@@ -6687,13 +6381,13 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6687
6381
|
tags,
|
|
6688
6382
|
onSelect
|
|
6689
6383
|
} = props;
|
|
6690
|
-
(0,
|
|
6384
|
+
(0, import_react24.useEffect)(() => {
|
|
6691
6385
|
if (!isValidIndex3(selectedIndex, options.length)) {
|
|
6692
6386
|
onSelect(0);
|
|
6693
6387
|
}
|
|
6694
6388
|
}, [selectedIndex, onSelect, options.length]);
|
|
6695
|
-
return /* @__PURE__ */ (0,
|
|
6696
|
-
/* @__PURE__ */ (0,
|
|
6389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
|
|
6390
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6697
6391
|
FieldInput_default,
|
|
6698
6392
|
{
|
|
6699
6393
|
id,
|
|
@@ -6704,8 +6398,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6704
6398
|
features,
|
|
6705
6399
|
control,
|
|
6706
6400
|
tags,
|
|
6707
|
-
children: /* @__PURE__ */ (0,
|
|
6708
|
-
|
|
6401
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6402
|
+
import_components62.SegmentedControl,
|
|
6709
6403
|
{
|
|
6710
6404
|
name: `${id}-segmented-control`,
|
|
6711
6405
|
value: String(selectedIndex),
|
|
@@ -6721,14 +6415,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6721
6415
|
)
|
|
6722
6416
|
}
|
|
6723
6417
|
),
|
|
6724
|
-
/* @__PURE__ */ (0,
|
|
6418
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { id: `${id}-children`, children })
|
|
6725
6419
|
] });
|
|
6726
6420
|
}
|
|
6727
6421
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6728
6422
|
|
|
6729
6423
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
6730
|
-
var
|
|
6731
|
-
var
|
|
6424
|
+
var import_components63 = require("@transferwise/components");
|
|
6425
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
6732
6426
|
function RadioItemRendererComponent(props) {
|
|
6733
6427
|
const {
|
|
6734
6428
|
id,
|
|
@@ -6744,23 +6438,23 @@ function RadioItemRendererComponent(props) {
|
|
|
6744
6438
|
onSelect
|
|
6745
6439
|
} = props;
|
|
6746
6440
|
const { ref } = useScrollToError(validationState, features);
|
|
6747
|
-
return /* @__PURE__ */ (0,
|
|
6748
|
-
rootTitle && /* @__PURE__ */ (0,
|
|
6749
|
-
|
|
6441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6442
|
+
rootTitle && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6443
|
+
import_components63.Header,
|
|
6750
6444
|
{
|
|
6751
6445
|
as: "h2",
|
|
6752
|
-
title: help ? /* @__PURE__ */ (0,
|
|
6446
|
+
title: help ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
6753
6447
|
}
|
|
6754
6448
|
),
|
|
6755
|
-
rootDescription && /* @__PURE__ */ (0,
|
|
6756
|
-
/* @__PURE__ */ (0,
|
|
6757
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0,
|
|
6758
|
-
|
|
6449
|
+
rootDescription && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("p", { children: rootDescription }),
|
|
6450
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components63.List, { children: options.map(
|
|
6451
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6452
|
+
import_components63.ListItem,
|
|
6759
6453
|
__spreadValues({
|
|
6760
6454
|
title,
|
|
6761
6455
|
subtitle: description,
|
|
6762
|
-
control: /* @__PURE__ */ (0,
|
|
6763
|
-
|
|
6456
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
6457
|
+
import_components63.ListItem.Radio,
|
|
6764
6458
|
{
|
|
6765
6459
|
name: title,
|
|
6766
6460
|
checked: selectedIndex === index,
|
|
@@ -6775,51 +6469,51 @@ function RadioItemRendererComponent(props) {
|
|
|
6775
6469
|
title
|
|
6776
6470
|
)
|
|
6777
6471
|
) }, `${id}-${selectedIndex}`),
|
|
6778
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0,
|
|
6472
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components63.InlineAlert, { type: "negative", children: validationState.message }),
|
|
6779
6473
|
children
|
|
6780
6474
|
] });
|
|
6781
6475
|
}
|
|
6782
6476
|
|
|
6783
6477
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
6784
|
-
var
|
|
6478
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
6785
6479
|
var SelectInputRenderer = {
|
|
6786
6480
|
canRenderType: "input-select",
|
|
6787
6481
|
render: (props) => {
|
|
6788
6482
|
switch (props.control) {
|
|
6789
6483
|
case "radio":
|
|
6790
|
-
return /* @__PURE__ */ (0,
|
|
6484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
|
|
6791
6485
|
case "radio-item":
|
|
6792
|
-
return /* @__PURE__ */ (0,
|
|
6486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RadioItemRendererComponent, __spreadValues({}, props));
|
|
6793
6487
|
case "tab":
|
|
6794
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6488
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TabInputRendererComponent, __spreadValues({}, props));
|
|
6795
6489
|
case "segmented":
|
|
6796
|
-
return props.options.length > 3 ? /* @__PURE__ */ (0,
|
|
6490
|
+
return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
6797
6491
|
case "select":
|
|
6798
6492
|
default:
|
|
6799
|
-
return /* @__PURE__ */ (0,
|
|
6493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
|
|
6800
6494
|
}
|
|
6801
6495
|
}
|
|
6802
6496
|
};
|
|
6803
6497
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
6804
6498
|
|
|
6805
6499
|
// ../renderers/src/StatusListRenderer.tsx
|
|
6806
|
-
var
|
|
6807
|
-
var
|
|
6808
|
-
var
|
|
6500
|
+
var import_components64 = require("@transferwise/components");
|
|
6501
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6502
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
6809
6503
|
var StatusListRenderer = {
|
|
6810
6504
|
canRenderType: "status-list",
|
|
6811
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0,
|
|
6812
|
-
title ? /* @__PURE__ */ (0,
|
|
6505
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: (0, import_classnames31.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6506
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_components64.Header, { title }) : null,
|
|
6813
6507
|
items.map((item) => {
|
|
6814
6508
|
const { callToAction, description, title: itemTitle } = item;
|
|
6815
|
-
return /* @__PURE__ */ (0,
|
|
6816
|
-
|
|
6509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
6510
|
+
import_components64.ListItem,
|
|
6817
6511
|
{
|
|
6818
6512
|
title: itemTitle,
|
|
6819
6513
|
subtitle: description,
|
|
6820
|
-
media: /* @__PURE__ */ (0,
|
|
6821
|
-
additionalInfo: callToAction ? /* @__PURE__ */ (0,
|
|
6822
|
-
|
|
6514
|
+
media: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(StatusListItemMedia, __spreadValues({}, item)),
|
|
6515
|
+
additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
6516
|
+
import_components64.ListItem.AdditionalInfo,
|
|
6823
6517
|
{
|
|
6824
6518
|
action: __spreadValues({
|
|
6825
6519
|
label: callToAction.title
|
|
@@ -6837,10 +6531,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
6837
6531
|
return void 0;
|
|
6838
6532
|
}
|
|
6839
6533
|
if ("name" in icon) {
|
|
6840
|
-
return /* @__PURE__ */ (0,
|
|
6534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_components64.AvatarView, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DynamicIcon_default, { name: icon.name }) });
|
|
6841
6535
|
}
|
|
6842
6536
|
if ("text" in icon) {
|
|
6843
|
-
return /* @__PURE__ */ (0,
|
|
6537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_components64.AvatarView, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
6844
6538
|
}
|
|
6845
6539
|
return void 0;
|
|
6846
6540
|
};
|
|
@@ -6857,16 +6551,16 @@ var mapStatus = (status) => {
|
|
|
6857
6551
|
var StatusListRenderer_default = StatusListRenderer;
|
|
6858
6552
|
|
|
6859
6553
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6860
|
-
var
|
|
6554
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6861
6555
|
|
|
6862
6556
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
6863
6557
|
var import_components_theming = require("@wise/components-theming");
|
|
6864
|
-
var
|
|
6558
|
+
var import_react25 = require("react");
|
|
6865
6559
|
var ThemeRequiredEventName = "Theme Required";
|
|
6866
6560
|
var useCustomTheme = (theme, trackEvent) => {
|
|
6867
6561
|
const theming = (0, import_components_theming.useTheme)();
|
|
6868
|
-
const previousTheme = (0,
|
|
6869
|
-
(0,
|
|
6562
|
+
const previousTheme = (0, import_react25.useMemo)(() => theming.theme, []);
|
|
6563
|
+
(0, import_react25.useEffect)(() => {
|
|
6870
6564
|
theming.setTheme(theme);
|
|
6871
6565
|
trackEvent(ThemeRequiredEventName, { theme });
|
|
6872
6566
|
return theme !== previousTheme ? () => {
|
|
@@ -6878,13 +6572,13 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
6878
6572
|
};
|
|
6879
6573
|
|
|
6880
6574
|
// ../renderers/src/step/StepHeader.tsx
|
|
6881
|
-
var
|
|
6882
|
-
var
|
|
6575
|
+
var import_components65 = require("@transferwise/components");
|
|
6576
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
6883
6577
|
var StepHeader = ({ title, description, tags }) => {
|
|
6884
6578
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
6885
|
-
return /* @__PURE__ */ (0,
|
|
6886
|
-
title ? /* @__PURE__ */ (0,
|
|
6887
|
-
description ? /* @__PURE__ */ (0,
|
|
6579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
|
|
6580
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_components65.Title, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6581
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
6888
6582
|
] });
|
|
6889
6583
|
};
|
|
6890
6584
|
var getHeaderStyle = (tags) => {
|
|
@@ -6895,13 +6589,13 @@ var getHeaderStyle = (tags) => {
|
|
|
6895
6589
|
};
|
|
6896
6590
|
|
|
6897
6591
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6898
|
-
var
|
|
6899
|
-
var
|
|
6900
|
-
var
|
|
6592
|
+
var import_components66 = require("@transferwise/components");
|
|
6593
|
+
var import_icons6 = require("@transferwise/icons");
|
|
6594
|
+
var import_react_intl34 = require("react-intl");
|
|
6901
6595
|
|
|
6902
6596
|
// ../renderers/src/messages/back.messages.ts
|
|
6903
|
-
var
|
|
6904
|
-
var back_messages_default = (0,
|
|
6597
|
+
var import_react_intl33 = require("react-intl");
|
|
6598
|
+
var back_messages_default = (0, import_react_intl33.defineMessages)({
|
|
6905
6599
|
back: {
|
|
6906
6600
|
id: "df.wise.back.label",
|
|
6907
6601
|
defaultMessage: "Back",
|
|
@@ -6910,31 +6604,31 @@ var back_messages_default = (0, import_react_intl35.defineMessages)({
|
|
|
6910
6604
|
});
|
|
6911
6605
|
|
|
6912
6606
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6913
|
-
var
|
|
6607
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
6914
6608
|
function BackButton({ title, onClick }) {
|
|
6915
|
-
const { formatMessage } = (0,
|
|
6916
|
-
return /* @__PURE__ */ (0,
|
|
6917
|
-
/* @__PURE__ */ (0,
|
|
6918
|
-
/* @__PURE__ */ (0,
|
|
6609
|
+
const { formatMessage } = (0, import_react_intl34.useIntl)();
|
|
6610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_components66.IconButton, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6611
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6612
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_icons6.ArrowLeft, {})
|
|
6919
6613
|
] });
|
|
6920
6614
|
}
|
|
6921
6615
|
|
|
6922
6616
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
6923
|
-
var
|
|
6924
|
-
var
|
|
6617
|
+
var import_components67 = require("@transferwise/components");
|
|
6618
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
6925
6619
|
var Toolbar = ({ items }) => {
|
|
6926
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0,
|
|
6620
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
6927
6621
|
};
|
|
6928
6622
|
function ToolbarButton(props) {
|
|
6929
|
-
return prefersMedia(props.control) ? /* @__PURE__ */ (0,
|
|
6623
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TextToolbarButton, __spreadValues({}, props));
|
|
6930
6624
|
}
|
|
6931
6625
|
function MediaToolbarButton(props) {
|
|
6932
6626
|
var _a;
|
|
6933
6627
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
6934
6628
|
const priority = getIconButtonPriority(control);
|
|
6935
6629
|
const type = getSentiment2(context);
|
|
6936
|
-
return /* @__PURE__ */ (0,
|
|
6937
|
-
|
|
6630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
6631
|
+
import_components67.IconButton,
|
|
6938
6632
|
{
|
|
6939
6633
|
className: "df-toolbar-button",
|
|
6940
6634
|
disabled,
|
|
@@ -6943,7 +6637,7 @@ function MediaToolbarButton(props) {
|
|
|
6943
6637
|
type,
|
|
6944
6638
|
onClick,
|
|
6945
6639
|
children: [
|
|
6946
|
-
accessibilityDescription ? /* @__PURE__ */ (0,
|
|
6640
|
+
accessibilityDescription ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
6947
6641
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
6948
6642
|
]
|
|
6949
6643
|
}
|
|
@@ -6954,8 +6648,8 @@ function TextToolbarButton(props) {
|
|
|
6954
6648
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
6955
6649
|
const priority = getPriority2(control);
|
|
6956
6650
|
const sentiment = getSentiment2(context);
|
|
6957
|
-
return /* @__PURE__ */ (0,
|
|
6958
|
-
|
|
6651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
6652
|
+
import_components67.Button,
|
|
6959
6653
|
{
|
|
6960
6654
|
v2: true,
|
|
6961
6655
|
size: "sm",
|
|
@@ -6984,18 +6678,18 @@ var getIconButtonPriority = (control) => {
|
|
|
6984
6678
|
};
|
|
6985
6679
|
|
|
6986
6680
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
6987
|
-
var
|
|
6681
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
6988
6682
|
function TopBar({ back, toolbar, tags }) {
|
|
6989
6683
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
6990
6684
|
const backCTA = isBackAllowed ? back : void 0;
|
|
6991
|
-
return backCTA || toolbar ? /* @__PURE__ */ (0,
|
|
6992
|
-
backCTA ? /* @__PURE__ */ (0,
|
|
6993
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
6685
|
+
return backCTA || toolbar ? /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "d-flex m-b-2", children: [
|
|
6686
|
+
backCTA ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6687
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Toolbar, __spreadValues({}, toolbar)) : null
|
|
6994
6688
|
] }) : null;
|
|
6995
6689
|
}
|
|
6996
6690
|
|
|
6997
6691
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6998
|
-
var
|
|
6692
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
6999
6693
|
var SplashCelebrationStepRenderer = {
|
|
7000
6694
|
canRenderType: "step",
|
|
7001
6695
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -7004,23 +6698,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
7004
6698
|
function SplashCelebrationStepRendererComponent(props) {
|
|
7005
6699
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
7006
6700
|
useCustomTheme("forest-green", trackEvent);
|
|
7007
|
-
return /* @__PURE__ */ (0,
|
|
6701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
7008
6702
|
"div",
|
|
7009
6703
|
{
|
|
7010
|
-
className: (0,
|
|
6704
|
+
className: (0, import_classnames32.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
7011
6705
|
children: [
|
|
7012
|
-
/* @__PURE__ */ (0,
|
|
7013
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6706
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(TopBar, { back, toolbar, tags }),
|
|
6707
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
7014
6708
|
children,
|
|
7015
|
-
/* @__PURE__ */ (0,
|
|
6709
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(StepFooter, { footer, tags })
|
|
7016
6710
|
]
|
|
7017
6711
|
}
|
|
7018
6712
|
);
|
|
7019
6713
|
}
|
|
7020
6714
|
|
|
7021
6715
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
7022
|
-
var
|
|
7023
|
-
var
|
|
6716
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6717
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
7024
6718
|
var SplashStepRenderer = {
|
|
7025
6719
|
canRenderType: "step",
|
|
7026
6720
|
canRender: ({ control }) => control === "splash",
|
|
@@ -7028,70 +6722,70 @@ var SplashStepRenderer = {
|
|
|
7028
6722
|
};
|
|
7029
6723
|
function SplashStepRendererComponent(props) {
|
|
7030
6724
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
7031
|
-
return /* @__PURE__ */ (0,
|
|
6725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
|
|
7032
6726
|
"div",
|
|
7033
6727
|
{
|
|
7034
|
-
className: (0,
|
|
6728
|
+
className: (0, import_classnames33.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
7035
6729
|
children: [
|
|
7036
|
-
/* @__PURE__ */ (0,
|
|
7037
|
-
title || description ? /* @__PURE__ */ (0,
|
|
6730
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TopBar, { back, toolbar, tags }),
|
|
6731
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
7038
6732
|
children,
|
|
7039
|
-
/* @__PURE__ */ (0,
|
|
6733
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(StepFooter, { footer, tags })
|
|
7040
6734
|
]
|
|
7041
6735
|
}
|
|
7042
6736
|
);
|
|
7043
6737
|
}
|
|
7044
6738
|
|
|
7045
6739
|
// ../renderers/src/step/StepRenderer.tsx
|
|
7046
|
-
var
|
|
7047
|
-
var
|
|
6740
|
+
var import_components68 = require("@transferwise/components");
|
|
6741
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
7048
6742
|
var StepRenderer = {
|
|
7049
6743
|
canRenderType: "step",
|
|
7050
6744
|
render: StepRendererComponent
|
|
7051
6745
|
};
|
|
7052
6746
|
function StepRendererComponent(props) {
|
|
7053
6747
|
const { back, description, error, title, children, toolbar, footer, control, tags } = props;
|
|
7054
|
-
return /* @__PURE__ */ (0,
|
|
7055
|
-
/* @__PURE__ */ (0,
|
|
7056
|
-
title || description ? /* @__PURE__ */ (0,
|
|
7057
|
-
error ? /* @__PURE__ */ (0,
|
|
6748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
6749
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(TopBar, { back, toolbar, tags }),
|
|
6750
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "m-b-4", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(StepHeader, { title, description, tags }) }) : void 0,
|
|
6751
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components68.Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
7058
6752
|
children,
|
|
7059
|
-
/* @__PURE__ */ (0,
|
|
6753
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(StepFooter, { footer, tags })
|
|
7060
6754
|
] });
|
|
7061
6755
|
}
|
|
7062
6756
|
|
|
7063
6757
|
// ../renderers/src/TabsRenderer.tsx
|
|
7064
|
-
var
|
|
7065
|
-
var
|
|
7066
|
-
var
|
|
7067
|
-
var
|
|
6758
|
+
var import_components69 = require("@transferwise/components");
|
|
6759
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
6760
|
+
var import_react26 = require("react");
|
|
6761
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
7068
6762
|
var TabsRenderer = {
|
|
7069
6763
|
canRenderType: "tabs",
|
|
7070
6764
|
render: (props) => {
|
|
7071
6765
|
switch (props.control) {
|
|
7072
6766
|
case "segmented":
|
|
7073
6767
|
if (props.tabs.length > 3) {
|
|
7074
|
-
return /* @__PURE__ */ (0,
|
|
6768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
7075
6769
|
}
|
|
7076
|
-
return /* @__PURE__ */ (0,
|
|
6770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
7077
6771
|
case "chips":
|
|
7078
|
-
return /* @__PURE__ */ (0,
|
|
6772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
7079
6773
|
default:
|
|
7080
|
-
return /* @__PURE__ */ (0,
|
|
6774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
7081
6775
|
}
|
|
7082
6776
|
}
|
|
7083
6777
|
};
|
|
7084
6778
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
7085
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
7086
|
-
return /* @__PURE__ */ (0,
|
|
7087
|
-
|
|
6779
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: (0, import_classnames34.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6781
|
+
import_components69.Tabs,
|
|
7088
6782
|
{
|
|
7089
6783
|
name: uid,
|
|
7090
6784
|
selected: selectedIndex != null ? selectedIndex : 0,
|
|
7091
6785
|
tabs: tabs.map((option) => ({
|
|
7092
6786
|
title: option.title,
|
|
7093
6787
|
disabled: false,
|
|
7094
|
-
content: /* @__PURE__ */ (0,
|
|
6788
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "m-t-2", children: [
|
|
7095
6789
|
" ",
|
|
7096
6790
|
option.children,
|
|
7097
6791
|
" "
|
|
@@ -7103,10 +6797,10 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
7103
6797
|
}
|
|
7104
6798
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
7105
6799
|
var _a;
|
|
7106
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
7107
|
-
return /* @__PURE__ */ (0,
|
|
7108
|
-
/* @__PURE__ */ (0,
|
|
7109
|
-
|
|
6800
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: (0, import_classnames34.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6802
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6803
|
+
import_components69.SegmentedControl,
|
|
7110
6804
|
{
|
|
7111
6805
|
name: uid,
|
|
7112
6806
|
value: String(selectedIndex),
|
|
@@ -7120,38 +6814,38 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
7120
6814
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
7121
6815
|
}
|
|
7122
6816
|
),
|
|
7123
|
-
/* @__PURE__ */ (0,
|
|
6817
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
7124
6818
|
] });
|
|
7125
6819
|
}
|
|
7126
6820
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
7127
6821
|
var _a;
|
|
7128
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
7129
|
-
return /* @__PURE__ */ (0,
|
|
7130
|
-
/* @__PURE__ */ (0,
|
|
7131
|
-
|
|
6822
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react26.useState)(0);
|
|
6823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: (0, import_classnames34.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6824
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6825
|
+
import_components69.Chips,
|
|
7132
6826
|
{
|
|
7133
6827
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
7134
6828
|
selected: selectedIndex,
|
|
7135
6829
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
7136
6830
|
}
|
|
7137
6831
|
) }),
|
|
7138
|
-
/* @__PURE__ */ (0,
|
|
6832
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
7139
6833
|
] });
|
|
7140
6834
|
}
|
|
7141
6835
|
|
|
7142
6836
|
// ../renderers/src/TextInputRenderer.tsx
|
|
7143
|
-
var
|
|
7144
|
-
var
|
|
6837
|
+
var import_components71 = require("@transferwise/components");
|
|
6838
|
+
var import_react28 = require("react");
|
|
7145
6839
|
|
|
7146
6840
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
7147
|
-
var
|
|
7148
|
-
var
|
|
7149
|
-
var
|
|
7150
|
-
var
|
|
6841
|
+
var import_components70 = require("@transferwise/components");
|
|
6842
|
+
var import_icons7 = require("@transferwise/icons");
|
|
6843
|
+
var import_react_intl36 = require("react-intl");
|
|
6844
|
+
var import_react27 = require("react");
|
|
7151
6845
|
|
|
7152
6846
|
// ../renderers/src/messages/ssn-input.messages.ts
|
|
7153
|
-
var
|
|
7154
|
-
var ssn_input_messages_default = (0,
|
|
6847
|
+
var import_react_intl35 = require("react-intl");
|
|
6848
|
+
var ssn_input_messages_default = (0, import_react_intl35.defineMessages)({
|
|
7155
6849
|
showValue: {
|
|
7156
6850
|
id: "df.wise.ssnInput.showValue",
|
|
7157
6851
|
defaultMessage: "Show value",
|
|
@@ -7236,7 +6930,7 @@ function getDisplayOffset(displayValue, rawOffset) {
|
|
|
7236
6930
|
}
|
|
7237
6931
|
|
|
7238
6932
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
7239
|
-
var
|
|
6933
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
7240
6934
|
var commonKeys = [
|
|
7241
6935
|
"autoComplete",
|
|
7242
6936
|
"autoCapitalize",
|
|
@@ -7255,14 +6949,14 @@ function VariableTextInput(inputProps) {
|
|
|
7255
6949
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
7256
6950
|
switch (control) {
|
|
7257
6951
|
case "email":
|
|
7258
|
-
return /* @__PURE__ */ (0,
|
|
6952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
7259
6953
|
case "password":
|
|
7260
|
-
return /* @__PURE__ */ (0,
|
|
6954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
7261
6955
|
case "ssn-input":
|
|
7262
|
-
return /* @__PURE__ */ (0,
|
|
6956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(SsnInput, __spreadProps(__spreadValues({}, commonProps), { isVisible: isSsnVisible, onChange }));
|
|
7263
6957
|
case "numeric": {
|
|
7264
6958
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
7265
|
-
return /* @__PURE__ */ (0,
|
|
6959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
7266
6960
|
TextInput,
|
|
7267
6961
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
7268
6962
|
onChange: (newValue) => {
|
|
@@ -7273,9 +6967,9 @@ function VariableTextInput(inputProps) {
|
|
|
7273
6967
|
);
|
|
7274
6968
|
}
|
|
7275
6969
|
case "phone-number":
|
|
7276
|
-
return /* @__PURE__ */ (0,
|
|
6970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components70.PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
7277
6971
|
default: {
|
|
7278
|
-
return /* @__PURE__ */ (0,
|
|
6972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
7279
6973
|
}
|
|
7280
6974
|
}
|
|
7281
6975
|
}
|
|
@@ -7283,31 +6977,31 @@ function SsnInputToggle({
|
|
|
7283
6977
|
isVisible,
|
|
7284
6978
|
onClick
|
|
7285
6979
|
}) {
|
|
7286
|
-
const { formatMessage } = (0,
|
|
7287
|
-
return /* @__PURE__ */ (0,
|
|
7288
|
-
|
|
6980
|
+
const { formatMessage } = (0, import_react_intl36.useIntl)();
|
|
6981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6982
|
+
import_components70.IconButton,
|
|
7289
6983
|
{
|
|
7290
6984
|
priority: "minimal",
|
|
7291
6985
|
size: 24,
|
|
7292
6986
|
"aria-label": formatMessage(isVisible ? ssn_input_messages_default.hideValue : ssn_input_messages_default.showValue),
|
|
7293
6987
|
"aria-pressed": isVisible,
|
|
7294
6988
|
onClick,
|
|
7295
|
-
children: isVisible ? /* @__PURE__ */ (0,
|
|
6989
|
+
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_icons7.EyeShut, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_icons7.Eye, { size: 24 })
|
|
7296
6990
|
}
|
|
7297
6991
|
);
|
|
7298
6992
|
}
|
|
7299
6993
|
function TextInput(props) {
|
|
7300
6994
|
const _a = props, { control, displayFormat, onChange, type } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange", "type"]);
|
|
7301
|
-
const InputWithPattern = control === "textarea" ?
|
|
7302
|
-
const InputWithoutPattern = control === "textarea" ?
|
|
7303
|
-
return displayFormat ? /* @__PURE__ */ (0,
|
|
6995
|
+
const InputWithPattern = control === "textarea" ? import_components70.TextareaWithDisplayFormat : import_components70.InputWithDisplayFormat;
|
|
6996
|
+
const InputWithoutPattern = control === "textarea" ? import_components70.TextArea : import_components70.Input;
|
|
6997
|
+
return displayFormat ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { type, onChange: (e) => onChange(e.target.value) }));
|
|
7304
6998
|
}
|
|
7305
6999
|
function SsnInput(props) {
|
|
7306
7000
|
const _a = props, { displayFormat = "", isVisible = false, onChange, value = "" } = _a, commonProps = __objRest(_a, ["displayFormat", "isVisible", "onChange", "value"]);
|
|
7307
|
-
const [editVersion, setEditVersion] = (0,
|
|
7308
|
-
const inputRef = (0,
|
|
7309
|
-
const selection = (0,
|
|
7310
|
-
const pendingCaret = (0,
|
|
7001
|
+
const [editVersion, setEditVersion] = (0, import_react27.useState)(0);
|
|
7002
|
+
const inputRef = (0, import_react27.useRef)(null);
|
|
7003
|
+
const selection = (0, import_react27.useRef)({ start: 0, end: 0 });
|
|
7004
|
+
const pendingCaret = (0, import_react27.useRef)(null);
|
|
7311
7005
|
const rawValue = value.replace(/\D/g, "");
|
|
7312
7006
|
const formattedValue = formatSsnValue(rawValue, displayFormat, isVisible);
|
|
7313
7007
|
const scheduleCaret = (rawOffset) => {
|
|
@@ -7327,7 +7021,7 @@ function SsnInput(props) {
|
|
|
7327
7021
|
scheduleCaret(result.caret);
|
|
7328
7022
|
onChange(result.value);
|
|
7329
7023
|
};
|
|
7330
|
-
(0,
|
|
7024
|
+
(0, import_react27.useLayoutEffect)(() => {
|
|
7331
7025
|
if (pendingCaret.current === null || !inputRef.current) {
|
|
7332
7026
|
return;
|
|
7333
7027
|
}
|
|
@@ -7337,7 +7031,7 @@ function SsnInput(props) {
|
|
|
7337
7031
|
);
|
|
7338
7032
|
pendingCaret.current = null;
|
|
7339
7033
|
}, [editVersion, formattedValue, rawValue]);
|
|
7340
|
-
return /* @__PURE__ */ (0,
|
|
7034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
7341
7035
|
"input",
|
|
7342
7036
|
__spreadProps(__spreadValues({
|
|
7343
7037
|
ref: inputRef
|
|
@@ -7400,13 +7094,13 @@ function SsnInput(props) {
|
|
|
7400
7094
|
}
|
|
7401
7095
|
|
|
7402
7096
|
// ../renderers/src/TextInputRenderer.tsx
|
|
7403
|
-
var
|
|
7097
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
7404
7098
|
var TextInputRenderer = {
|
|
7405
7099
|
canRenderType: "input-text",
|
|
7406
|
-
render: (props) => /* @__PURE__ */ (0,
|
|
7100
|
+
render: (props) => /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(TextInputRendererComponent, __spreadValues({}, props))
|
|
7407
7101
|
};
|
|
7408
7102
|
function TextInputRendererComponent(props) {
|
|
7409
|
-
const [isSsnVisible, setIsSsnVisible] = (0,
|
|
7103
|
+
const [isSsnVisible, setIsSsnVisible] = (0, import_react28.useState)(false);
|
|
7410
7104
|
const _a = props, {
|
|
7411
7105
|
id,
|
|
7412
7106
|
title,
|
|
@@ -7438,7 +7132,7 @@ function TextInputRendererComponent(props) {
|
|
|
7438
7132
|
}
|
|
7439
7133
|
}
|
|
7440
7134
|
});
|
|
7441
|
-
return /* @__PURE__ */ (0,
|
|
7135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7442
7136
|
FieldInput_default,
|
|
7443
7137
|
{
|
|
7444
7138
|
id,
|
|
@@ -7451,13 +7145,13 @@ function TextInputRendererComponent(props) {
|
|
|
7451
7145
|
features: props.features,
|
|
7452
7146
|
control: props.control,
|
|
7453
7147
|
tags: props.tags,
|
|
7454
|
-
children: /* @__PURE__ */ (0,
|
|
7455
|
-
|
|
7148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7149
|
+
import_components71.InputGroup,
|
|
7456
7150
|
{
|
|
7457
7151
|
addonStart: getInputGroupAddonStart(media),
|
|
7458
7152
|
addonEnd: isSsnInput ? {
|
|
7459
7153
|
interactive: true,
|
|
7460
|
-
content: /* @__PURE__ */ (0,
|
|
7154
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
7461
7155
|
SsnInputToggle,
|
|
7462
7156
|
{
|
|
7463
7157
|
isVisible: isSsnVisible,
|
|
@@ -7465,7 +7159,7 @@ function TextInputRendererComponent(props) {
|
|
|
7465
7159
|
}
|
|
7466
7160
|
)
|
|
7467
7161
|
} : void 0,
|
|
7468
|
-
children: /* @__PURE__ */ (0,
|
|
7162
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(VariableTextInput, __spreadValues({}, inputProps))
|
|
7469
7163
|
}
|
|
7470
7164
|
)
|
|
7471
7165
|
}
|
|
@@ -7474,23 +7168,23 @@ function TextInputRendererComponent(props) {
|
|
|
7474
7168
|
var TextInputRenderer_default = TextInputRenderer;
|
|
7475
7169
|
|
|
7476
7170
|
// ../renderers/src/UpdatableRenderer.tsx
|
|
7477
|
-
var
|
|
7478
|
-
var
|
|
7171
|
+
var import_classnames35 = __toESM(require_classnames());
|
|
7172
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
7479
7173
|
var UpdatableRenderer = {
|
|
7480
7174
|
canRenderType: "updatable",
|
|
7481
7175
|
render: ({ children, control, margin, tags }) => {
|
|
7482
|
-
return /* @__PURE__ */ (0,
|
|
7176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children });
|
|
7483
7177
|
}
|
|
7484
7178
|
};
|
|
7485
7179
|
|
|
7486
7180
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
7487
|
-
var
|
|
7181
|
+
var import_components72 = require("@transferwise/components");
|
|
7488
7182
|
|
|
7489
7183
|
// ../renderers/src/utils/getRandomId.ts
|
|
7490
7184
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
7491
7185
|
|
|
7492
7186
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
7493
|
-
var
|
|
7187
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
7494
7188
|
var UploadInputRenderer = {
|
|
7495
7189
|
canRenderType: "input-upload",
|
|
7496
7190
|
render: (props) => {
|
|
@@ -7519,7 +7213,7 @@ var UploadInputRenderer = {
|
|
|
7519
7213
|
};
|
|
7520
7214
|
return (
|
|
7521
7215
|
// We don't pass help here as there is no sensible place to display it
|
|
7522
|
-
/* @__PURE__ */ (0,
|
|
7216
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7523
7217
|
UploadFieldInput_default,
|
|
7524
7218
|
{
|
|
7525
7219
|
id,
|
|
@@ -7529,8 +7223,8 @@ var UploadInputRenderer = {
|
|
|
7529
7223
|
features,
|
|
7530
7224
|
control,
|
|
7531
7225
|
tags,
|
|
7532
|
-
children: /* @__PURE__ */ (0,
|
|
7533
|
-
|
|
7226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7227
|
+
import_components72.UploadInput,
|
|
7534
7228
|
{
|
|
7535
7229
|
id,
|
|
7536
7230
|
description,
|
|
@@ -7540,7 +7234,7 @@ var UploadInputRenderer = {
|
|
|
7540
7234
|
{
|
|
7541
7235
|
id: "my-file",
|
|
7542
7236
|
filename: value.name,
|
|
7543
|
-
status: (validationState == null ? void 0 : validationState.status) === "invalid" ?
|
|
7237
|
+
status: (validationState == null ? void 0 : validationState.status) === "invalid" ? import_components72.Status.FAILED : import_components72.Status.SUCCEEDED
|
|
7544
7238
|
}
|
|
7545
7239
|
] : void 0,
|
|
7546
7240
|
fileTypes: acceptsToFileTypes(accepts),
|
|
@@ -7599,7 +7293,7 @@ var LargeUploadRenderer = {
|
|
|
7599
7293
|
};
|
|
7600
7294
|
const filetypes = acceptsToFileTypes(accepts);
|
|
7601
7295
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
7602
|
-
return /* @__PURE__ */ (0,
|
|
7296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7603
7297
|
FieldInput_default,
|
|
7604
7298
|
{
|
|
7605
7299
|
id,
|
|
@@ -7610,8 +7304,8 @@ var LargeUploadRenderer = {
|
|
|
7610
7304
|
features,
|
|
7611
7305
|
control,
|
|
7612
7306
|
tags,
|
|
7613
|
-
children: /* @__PURE__ */ (0,
|
|
7614
|
-
|
|
7307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
7308
|
+
import_components72.Upload,
|
|
7615
7309
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
7616
7310
|
usAccept,
|
|
7617
7311
|
usDisabled: disabled,
|
|
@@ -7626,21 +7320,21 @@ var LargeUploadRenderer = {
|
|
|
7626
7320
|
};
|
|
7627
7321
|
|
|
7628
7322
|
// ../renderers/src/UpsellRenderer.tsx
|
|
7629
|
-
var
|
|
7630
|
-
var
|
|
7631
|
-
var
|
|
7632
|
-
var
|
|
7323
|
+
var import_components73 = require("@transferwise/components");
|
|
7324
|
+
var import_classnames36 = __toESM(require_classnames());
|
|
7325
|
+
var import_react29 = require("react");
|
|
7326
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
7633
7327
|
var UpsellRenderer = {
|
|
7634
7328
|
canRenderType: "upsell",
|
|
7635
7329
|
render: UpsellRendererComponent
|
|
7636
7330
|
};
|
|
7637
7331
|
function UpsellRendererComponent(props) {
|
|
7638
7332
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
7639
|
-
const [isVisible, setIsVisible] = (0,
|
|
7640
|
-
return isVisible ? /* @__PURE__ */ (0,
|
|
7641
|
-
|
|
7333
|
+
const [isVisible, setIsVisible] = (0, import_react29.useState)(true);
|
|
7334
|
+
return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
7335
|
+
import_components73.Nudge,
|
|
7642
7336
|
{
|
|
7643
|
-
className: (0,
|
|
7337
|
+
className: (0, import_classnames36.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
7644
7338
|
mediaName: getMediaName(media),
|
|
7645
7339
|
title: text,
|
|
7646
7340
|
action: __spreadValues({
|
|
@@ -7691,8 +7385,7 @@ var getWiseRenderers = () => [
|
|
|
7691
7385
|
CircularButtonRenderer,
|
|
7692
7386
|
BorderedBackgroundColoredBoxRenderer,
|
|
7693
7387
|
BoxRenderer_default,
|
|
7694
|
-
|
|
7695
|
-
CollectionRendererV1_default,
|
|
7388
|
+
CollectionRenderer_default,
|
|
7696
7389
|
ButtonRenderer,
|
|
7697
7390
|
ColumnsRenderer_default,
|
|
7698
7391
|
DateInputRenderer_default,
|
|
@@ -7738,13 +7431,13 @@ var getWiseRenderers = () => [
|
|
|
7738
7431
|
];
|
|
7739
7432
|
|
|
7740
7433
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
7741
|
-
var
|
|
7742
|
-
var
|
|
7434
|
+
var import_components74 = require("@transferwise/components");
|
|
7435
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
7743
7436
|
var InitialLoadingStateRenderer = {
|
|
7744
7437
|
canRenderType: "loading-state",
|
|
7745
7438
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
7746
|
-
render: () => /* @__PURE__ */ (0,
|
|
7747
|
-
|
|
7439
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
7440
|
+
import_components74.Loader,
|
|
7748
7441
|
{
|
|
7749
7442
|
size: "md",
|
|
7750
7443
|
classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
|
|
@@ -7755,25 +7448,25 @@ var InitialLoadingStateRenderer = {
|
|
|
7755
7448
|
|
|
7756
7449
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
7757
7450
|
var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
|
|
7758
|
-
var
|
|
7759
|
-
var
|
|
7451
|
+
var import_components75 = require("@transferwise/components");
|
|
7452
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
7760
7453
|
function DynamicFlowModal(props) {
|
|
7761
7454
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
7762
7455
|
const dfProps = useWiseToCoreProps(rest);
|
|
7763
7456
|
const df = (0, import_dynamic_flow_client.useDynamicFlowModal)(dfProps);
|
|
7764
|
-
return /* @__PURE__ */ (0,
|
|
7765
|
-
|
|
7457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
7458
|
+
import_components75.Modal,
|
|
7766
7459
|
__spreadProps(__spreadValues({
|
|
7767
7460
|
className: `dynamic-flow-modal ${className}`,
|
|
7768
7461
|
disableDimmerClickToClose: true
|
|
7769
7462
|
}, df.modal), {
|
|
7770
|
-
body: /* @__PURE__ */ (0,
|
|
7463
|
+
body: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
7771
7464
|
})
|
|
7772
7465
|
);
|
|
7773
7466
|
}
|
|
7774
7467
|
|
|
7775
7468
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
7776
|
-
var
|
|
7469
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
7777
7470
|
var wiseRenderers = getWiseRenderers();
|
|
7778
7471
|
var getMergedRenderers = (props) => {
|
|
7779
7472
|
var _d, _e;
|
|
@@ -7787,7 +7480,7 @@ var getMergedRenderers = (props) => {
|
|
|
7787
7480
|
method: initialRequest.method,
|
|
7788
7481
|
data: initialRequest.body
|
|
7789
7482
|
};
|
|
7790
|
-
return presentation.type === "push" ? /* @__PURE__ */ (0,
|
|
7483
|
+
return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
7791
7484
|
DynamicFlowModal,
|
|
7792
7485
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
7793
7486
|
features: subflowFeatures,
|
|
@@ -7866,12 +7559,12 @@ var customEventsToAnalytics = {
|
|
|
7866
7559
|
};
|
|
7867
7560
|
|
|
7868
7561
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7869
|
-
var
|
|
7870
|
-
var
|
|
7562
|
+
var import_react30 = require("react");
|
|
7563
|
+
var import_react_intl38 = require("react-intl");
|
|
7871
7564
|
|
|
7872
7565
|
// src/dynamicFlow/messages.ts
|
|
7873
|
-
var
|
|
7874
|
-
var messages_default = (0,
|
|
7566
|
+
var import_react_intl37 = require("react-intl");
|
|
7567
|
+
var messages_default = (0, import_react_intl37.defineMessages)({
|
|
7875
7568
|
copied: {
|
|
7876
7569
|
id: "df.wise.CopyFeedback.copy",
|
|
7877
7570
|
defaultMessage: "Copied to clipboard",
|
|
@@ -7886,9 +7579,9 @@ var messages_default = (0, import_react_intl39.defineMessages)({
|
|
|
7886
7579
|
|
|
7887
7580
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7888
7581
|
var useOnCopy = () => {
|
|
7889
|
-
const { formatMessage } = (0,
|
|
7582
|
+
const { formatMessage } = (0, import_react_intl38.useIntl)();
|
|
7890
7583
|
const createSnackBar = useSnackBarIfAvailable();
|
|
7891
|
-
return (0,
|
|
7584
|
+
return (0, import_react30.useCallback)(
|
|
7892
7585
|
(copiedContent) => {
|
|
7893
7586
|
if (copiedContent) {
|
|
7894
7587
|
createSnackBar({ text: formatMessage(messages_default.copied) });
|
|
@@ -7901,11 +7594,11 @@ var useOnCopy = () => {
|
|
|
7901
7594
|
};
|
|
7902
7595
|
|
|
7903
7596
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
7904
|
-
var
|
|
7905
|
-
var
|
|
7597
|
+
var import_react31 = require("react");
|
|
7598
|
+
var import_react_intl39 = require("react-intl");
|
|
7906
7599
|
var useWiseHttpClient = (httpClient) => {
|
|
7907
|
-
const { locale } = (0,
|
|
7908
|
-
return (0,
|
|
7600
|
+
const { locale } = (0, import_react_intl39.useIntl)();
|
|
7601
|
+
return (0, import_react31.useCallback)(
|
|
7909
7602
|
async (input, init = {}) => {
|
|
7910
7603
|
const headers = new Headers(init.headers);
|
|
7911
7604
|
headers.set("accept-language", locale);
|
|
@@ -7946,10 +7639,10 @@ var useWiseToCoreProps = (props) => {
|
|
|
7946
7639
|
onLog
|
|
7947
7640
|
} = props;
|
|
7948
7641
|
const httpClient = useWiseHttpClient(customFetch);
|
|
7949
|
-
const mergedRenderers = (0,
|
|
7642
|
+
const mergedRenderers = (0, import_react32.useMemo)(() => getMergedRenderers(props), [renderers]);
|
|
7950
7643
|
const createSnackBar = useCreateSnackBar();
|
|
7951
|
-
const logEvent = (0,
|
|
7952
|
-
const trackEvent = (0,
|
|
7644
|
+
const logEvent = (0, import_react32.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
7645
|
+
const trackEvent = (0, import_react32.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
|
|
7953
7646
|
const onCopy = useOnCopy();
|
|
7954
7647
|
return __spreadProps(__spreadValues({}, props), {
|
|
7955
7648
|
httpClient,
|
|
@@ -7984,27 +7677,27 @@ var openLinkInNewTab = (url) => {
|
|
|
7984
7677
|
};
|
|
7985
7678
|
|
|
7986
7679
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7987
|
-
var
|
|
7680
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
7988
7681
|
function DynamicFlow(props) {
|
|
7989
7682
|
const { className = "" } = props;
|
|
7990
7683
|
const dfProps = useWiseToCoreProps(props);
|
|
7991
7684
|
const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
|
|
7992
7685
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
7993
|
-
return /* @__PURE__ */ (0,
|
|
7686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className, onContextMenu, children: [
|
|
7994
7687
|
df.view,
|
|
7995
7688
|
contextMenu
|
|
7996
7689
|
] });
|
|
7997
7690
|
}
|
|
7998
7691
|
|
|
7999
7692
|
// src/dynamicFlow/DynamicFlowWithRef.tsx
|
|
8000
|
-
var
|
|
7693
|
+
var import_react33 = require("react");
|
|
8001
7694
|
var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
|
|
8002
|
-
var
|
|
8003
|
-
var DynamicFlowWithRef = (0,
|
|
7695
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
7696
|
+
var DynamicFlowWithRef = (0, import_react33.forwardRef)(function DynamicFlowWithRef2(props, ref) {
|
|
8004
7697
|
const { className = "" } = props;
|
|
8005
7698
|
const dfProps = useWiseToCoreProps(props);
|
|
8006
7699
|
const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
|
|
8007
|
-
(0,
|
|
7700
|
+
(0, import_react33.useImperativeHandle)(
|
|
8008
7701
|
ref,
|
|
8009
7702
|
() => ({
|
|
8010
7703
|
getValue: () => {
|
|
@@ -8015,7 +7708,7 @@ var DynamicFlowWithRef = (0, import_react37.forwardRef)(function DynamicFlowWith
|
|
|
8015
7708
|
}),
|
|
8016
7709
|
[df]
|
|
8017
7710
|
);
|
|
8018
|
-
return /* @__PURE__ */ (0,
|
|
7711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className, children: df.view });
|
|
8019
7712
|
});
|
|
8020
7713
|
|
|
8021
7714
|
// src/index.ts
|
|
@@ -8145,8 +7838,6 @@ var en_default = {
|
|
|
8145
7838
|
"df.wise.ButtonLayout.buttonLoadingMessage": "This might take a few seconds",
|
|
8146
7839
|
"df.wise.Collection.clearText": "Clear text",
|
|
8147
7840
|
"df.wise.Collection.loadMoreMessage": "Load more",
|
|
8148
|
-
"df.wise.Collection.showLessResultsButton": "Show less results",
|
|
8149
|
-
"df.wise.Collection.showMoreResultsButton": "Show all {count} results",
|
|
8150
7841
|
"df.wise.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
8151
7842
|
"df.wise.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|
|
8152
7843
|
"df.wise.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
|