@wise/dynamic-flow-client-internal 5.33.0 → 5.34.0-experimental-18a8b47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n/en.json +2 -0
- package/build/main.css +54 -0
- package/build/main.js +1024 -746
- package/build/main.mjs +870 -587
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/build/dynamicFlow/DynamicFlow.js +0 -11
- package/build/dynamicFlow/DynamicFlowModal.js +0 -21
- package/build/dynamicFlow/DynamicFlowWiseProps.js +0 -1
- package/build/dynamicFlow/DynamicFlowWithRef.js +0 -19
- package/build/dynamicFlow/context-menu/useContextMenu.js +0 -33
- package/build/dynamicFlow/context-menu/useDFContextMenu.js +0 -135
- package/build/dynamicFlow/context-menu/useDFContextMenu.test.js +0 -101
- package/build/dynamicFlow/getMergedRenderers.js +0 -36
- package/build/dynamicFlow/messages.js +0 -13
- package/build/dynamicFlow/renderers.js +0 -10
- package/build/dynamicFlow/telemetry/app-version.js +0 -4
- package/build/dynamicFlow/telemetry/dispatchAnalyticsEvent.js +0 -8
- package/build/dynamicFlow/telemetry/getLogEvent.js +0 -22
- package/build/dynamicFlow/telemetry/getTrackEvent.js +0 -39
- package/build/dynamicFlow/telemetry/index.js +0 -2
- package/build/dynamicFlow/useCreateSnackBar.js +0 -9
- package/build/dynamicFlow/useOnCopy.js +0 -16
- package/build/dynamicFlow/useWiseHttpClient.js +0 -24
- package/build/dynamicFlow/useWiseToCoreProps.js +0 -42
- package/build/i18n/index.js +0 -43
- package/build/index.js +0 -6
- package/build/stories/ButtonLoader.story.js +0 -109
- package/build/stories/ContainerQueries.story.js +0 -74
- package/build/stories/DynamicFlow.story.js +0 -37
- package/build/stories/DynamicFlowWithRef.story.js +0 -72
- package/build/stories/Editable.story.js +0 -58
- package/build/stories/Initialisation.story.js +0 -33
- package/build/stories/PinnedButtons.story.js +0 -94
- package/build/stories/SCAIntegration.story.js +0 -67
- package/build/stories/utils/fixtureHttpClient.js +0 -59
- package/build/test-utils/NeptuneProviders.js +0 -11
- package/build/test-utils/index.js +0 -4
- package/build/test-utils/respond-with.js +0 -6
- package/build/test-utils/rtl-utils.js +0 -7
- package/build/test-utils/wait.js +0 -3
- package/build/tests/DynamicFlow.test.js +0 -177
- package/build/tests/HideStepTitle.test.js +0 -58
- package/build/tests/RequestCache.test.js +0 -34
- package/build/tests/SCARejectionHandling.test.js +0 -71
- package/build/tests/Subflow.Wise.test.js +0 -650
- package/build/tests/events.test.js +0 -124
- package/build/tests/logging.test.js +0 -12
- package/build/tests/onNotification.test.js +0 -96
- package/build/tests/renderers/ControlAndTags.test.js +0 -225
- package/build/tests/renderers/ImageRenderer.test.js +0 -129
- package/build/tests/renderers/RadioInputRendererComponent.test.js +0 -89
- package/build/tests/renderers/ReviewRenderer.test.js +0 -41
- package/build/tests/renderers/TextInputRenderer.test.js +0 -245
- package/build/tests/renderers/TimeZoneHeader.test.js +0 -19
- package/build/tests/renderers/UploadInputRenderer.maxSize.test.js +0 -22
- package/build/tests/renderers/value-utils.test.js +0 -24
package/build/main.mjs
CHANGED
|
@@ -64,7 +64,7 @@ var require_classnames = __commonJS({
|
|
|
64
64
|
(function() {
|
|
65
65
|
"use strict";
|
|
66
66
|
var hasOwn = {}.hasOwnProperty;
|
|
67
|
-
function
|
|
67
|
+
function classNames38() {
|
|
68
68
|
var classes = "";
|
|
69
69
|
for (var i = 0; i < arguments.length; i++) {
|
|
70
70
|
var arg = arguments[i];
|
|
@@ -82,7 +82,7 @@ var require_classnames = __commonJS({
|
|
|
82
82
|
return "";
|
|
83
83
|
}
|
|
84
84
|
if (Array.isArray(arg)) {
|
|
85
|
-
return
|
|
85
|
+
return classNames38.apply(null, arg);
|
|
86
86
|
}
|
|
87
87
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
88
88
|
return arg.toString();
|
|
@@ -105,14 +105,14 @@ var require_classnames = __commonJS({
|
|
|
105
105
|
return value + newClass;
|
|
106
106
|
}
|
|
107
107
|
if (typeof module !== "undefined" && module.exports) {
|
|
108
|
-
|
|
109
|
-
module.exports =
|
|
108
|
+
classNames38.default = classNames38;
|
|
109
|
+
module.exports = classNames38;
|
|
110
110
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
111
111
|
define("classnames", [], function() {
|
|
112
|
-
return
|
|
112
|
+
return classNames38;
|
|
113
113
|
});
|
|
114
114
|
} else {
|
|
115
|
-
window.classNames =
|
|
115
|
+
window.classNames = classNames38;
|
|
116
116
|
}
|
|
117
117
|
})();
|
|
118
118
|
}
|
|
@@ -1643,7 +1643,7 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1643
1643
|
};
|
|
1644
1644
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1645
1645
|
|
|
1646
|
-
// ../renderers/src/CollectionRenderer/
|
|
1646
|
+
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1647
1647
|
import { InlinePrompt, Link as DSLink } from "@transferwise/components";
|
|
1648
1648
|
|
|
1649
1649
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
@@ -1666,6 +1666,29 @@ var generic_error_messages_default = defineMessages3({
|
|
|
1666
1666
|
}
|
|
1667
1667
|
});
|
|
1668
1668
|
|
|
1669
|
+
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1670
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
1671
|
+
import { Fragment as Fragment2, jsx as jsx35, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1672
|
+
var CollectionRendererComponent = (props) => {
|
|
1673
|
+
const { state, depth, Search: Search5, Filters, Results, FocusedResults } = props;
|
|
1674
|
+
const { status } = state;
|
|
1675
|
+
const isForked = depth > 0;
|
|
1676
|
+
const isError = status.type === "error" && (status.reason === "search" || status.reason === "filter");
|
|
1677
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1678
|
+
/* @__PURE__ */ jsx35(Search5, __spreadValues({}, props)),
|
|
1679
|
+
/* @__PURE__ */ jsx35(Filters, __spreadValues({}, props)),
|
|
1680
|
+
isError ? /* @__PURE__ */ jsx35(SearchError, { retry: status.retry }) : isForked ? /* @__PURE__ */ jsx35(FocusedResults, __spreadValues({}, props)) : /* @__PURE__ */ jsx35(Results, __spreadValues({}, props))
|
|
1681
|
+
] });
|
|
1682
|
+
};
|
|
1683
|
+
var SearchError = ({ retry }) => {
|
|
1684
|
+
const { formatMessage } = useIntl3();
|
|
1685
|
+
return /* @__PURE__ */ jsxs6(InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
1686
|
+
formatMessage(generic_error_messages_default.genericError),
|
|
1687
|
+
"\xA0",
|
|
1688
|
+
/* @__PURE__ */ jsx35(DSLink, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
1689
|
+
] });
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1669
1692
|
// ../../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
|
|
1670
1693
|
import * as React from "react";
|
|
1671
1694
|
import { flushSync } from "react-dom";
|
|
@@ -3202,14 +3225,14 @@ function useWindowVirtualizer(options) {
|
|
|
3202
3225
|
}, options));
|
|
3203
3226
|
}
|
|
3204
3227
|
|
|
3205
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3228
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3206
3229
|
import { ProcessIndicator, Button as Button4 } from "@transferwise/components";
|
|
3207
3230
|
import { useRef as useRef4, useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useState as useState8 } from "react";
|
|
3208
3231
|
|
|
3209
3232
|
// ../renderers/src/step/StepFooter.tsx
|
|
3210
3233
|
import { Button as Button3 } from "@transferwise/components";
|
|
3211
3234
|
import { useEffect as useEffect6, useRef as useRef3, useState as useState7 } from "react";
|
|
3212
|
-
import { useIntl as
|
|
3235
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
3213
3236
|
|
|
3214
3237
|
// ../renderers/src/messages/step.messages.ts
|
|
3215
3238
|
import { defineMessages as defineMessages4 } from "react-intl";
|
|
@@ -3222,23 +3245,23 @@ var step_messages_default = defineMessages4({
|
|
|
3222
3245
|
});
|
|
3223
3246
|
|
|
3224
3247
|
// ../renderers/src/step/StepFooter.tsx
|
|
3225
|
-
import { Fragment as
|
|
3248
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3226
3249
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3227
3250
|
var StepFooter = ({ footer, tags }) => {
|
|
3228
3251
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3229
|
-
return /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ jsx36(FooterWithScrollButton, { footer });
|
|
3230
3253
|
}
|
|
3231
|
-
return /* @__PURE__ */
|
|
3254
|
+
return /* @__PURE__ */ jsx36(DefaultFooter, { footer });
|
|
3232
3255
|
};
|
|
3233
3256
|
var DefaultFooter = ({ footer }) => {
|
|
3234
3257
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3235
|
-
return hasFooter ? /* @__PURE__ */
|
|
3258
|
+
return hasFooter ? /* @__PURE__ */ jsx36("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3236
3259
|
};
|
|
3237
3260
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3238
|
-
const { formatMessage } =
|
|
3261
|
+
const { formatMessage } = useIntl4();
|
|
3239
3262
|
const endOfLayoutRef = useRef3(null);
|
|
3240
3263
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3241
|
-
const scrollButton = /* @__PURE__ */
|
|
3264
|
+
const scrollButton = /* @__PURE__ */ jsx36(
|
|
3242
3265
|
Button3,
|
|
3243
3266
|
{
|
|
3244
3267
|
className: "m-b-1",
|
|
@@ -3254,11 +3277,11 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3254
3277
|
);
|
|
3255
3278
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3256
3279
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3257
|
-
return /* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ jsx36("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3258
3281
|
}
|
|
3259
|
-
return /* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3261
|
-
/* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsxs7(Fragment3, { children: [
|
|
3283
|
+
/* @__PURE__ */ jsx36("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3284
|
+
/* @__PURE__ */ jsxs7("div", { className: "df-step-fixed__footer", children: [
|
|
3262
3285
|
!isElementVisible && scrollButton,
|
|
3263
3286
|
footer
|
|
3264
3287
|
] })
|
|
@@ -3281,8 +3304,8 @@ var useIsElementVisible = (elementRef, root = null) => {
|
|
|
3281
3304
|
return isVisible;
|
|
3282
3305
|
};
|
|
3283
3306
|
|
|
3284
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3285
|
-
import { useIntl as
|
|
3307
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3308
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
3286
3309
|
|
|
3287
3310
|
// ../renderers/src/messages/collection.messages.ts
|
|
3288
3311
|
import { defineMessages as defineMessages5 } from "react-intl";
|
|
@@ -3296,6 +3319,16 @@ var collection_messages_default = defineMessages5({
|
|
|
3296
3319
|
id: "df.wise.Collection.clearText",
|
|
3297
3320
|
defaultMessage: "Clear text",
|
|
3298
3321
|
description: "A message shown at the edge of the search bar to clear the users query"
|
|
3322
|
+
},
|
|
3323
|
+
showMoreResultsButton: {
|
|
3324
|
+
id: "df.wise.Collection.showMoreResultsButton",
|
|
3325
|
+
defaultMessage: "Show all {count} results",
|
|
3326
|
+
description: "A message shown at the bottom of a truncated list of items, clicking will expand to show more"
|
|
3327
|
+
},
|
|
3328
|
+
showLessResultsButton: {
|
|
3329
|
+
id: "df.wise.Collection.showLessResultsButton",
|
|
3330
|
+
defaultMessage: "Show less results",
|
|
3331
|
+
description: "A message shown at the bottom of an expanded list of items, clicking will truncate to show only a few"
|
|
3299
3332
|
}
|
|
3300
3333
|
});
|
|
3301
3334
|
|
|
@@ -3319,10 +3352,48 @@ var getScrollableAncestor = (element) => {
|
|
|
3319
3352
|
return null;
|
|
3320
3353
|
};
|
|
3321
3354
|
|
|
3322
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3355
|
+
// ../renderers/src/CollectionRenderer/components/flattenCollectionItems.ts
|
|
3356
|
+
var flattenCollectionItems = (sections) => {
|
|
3357
|
+
return sections.flatMap((section) => {
|
|
3358
|
+
if (section.type === "items") {
|
|
3359
|
+
return flattenItemsBody(section);
|
|
3360
|
+
}
|
|
3361
|
+
if (section.type === "layout") {
|
|
3362
|
+
return flattenLayoutBody(section);
|
|
3363
|
+
}
|
|
3364
|
+
return [];
|
|
3365
|
+
});
|
|
3366
|
+
};
|
|
3367
|
+
var flattenItemsBody = (section) => {
|
|
3368
|
+
return [
|
|
3369
|
+
...flattenSectionHeader(section),
|
|
3370
|
+
...section.items.map((item) => ({
|
|
3371
|
+
item,
|
|
3372
|
+
type: "item"
|
|
3373
|
+
}))
|
|
3374
|
+
];
|
|
3375
|
+
};
|
|
3376
|
+
var flattenLayoutBody = (section) => [
|
|
3377
|
+
...flattenSectionHeader(section),
|
|
3378
|
+
__spreadProps(__spreadValues({}, section), {
|
|
3379
|
+
type: "layout"
|
|
3380
|
+
})
|
|
3381
|
+
];
|
|
3382
|
+
var flattenSectionHeader = (section) => section.title ? [
|
|
3383
|
+
{
|
|
3384
|
+
type: "header",
|
|
3385
|
+
title: section.title,
|
|
3386
|
+
items: section.type === "items" ? section.items : void 0,
|
|
3387
|
+
id: section.id,
|
|
3388
|
+
callToAction: section.callToAction
|
|
3389
|
+
}
|
|
3390
|
+
] : [];
|
|
3391
|
+
|
|
3392
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3393
|
+
import { jsx as jsx37, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3394
|
+
var VirtualisedContentComponent = (props) => {
|
|
3395
|
+
const { state, SectionHeader, Item } = props;
|
|
3396
|
+
const { status } = state;
|
|
3326
3397
|
const contentRef = useRef4(null);
|
|
3327
3398
|
const [scrollElement, setScrollElement] = useState8(null);
|
|
3328
3399
|
useLayoutEffect2(() => {
|
|
@@ -3339,34 +3410,20 @@ var ContentComponent = (props) => {
|
|
|
3339
3410
|
status.loadMore();
|
|
3340
3411
|
}
|
|
3341
3412
|
}, [isBottomVisible, state.afterSectionsProps.length, status]);
|
|
3342
|
-
const stateCount = state.sections.reduce(
|
|
3343
|
-
|
|
3344
|
-
0
|
|
3345
|
-
);
|
|
3346
|
-
const items = state.sections
|
|
3347
|
-
...section.title ? [
|
|
3348
|
-
{
|
|
3349
|
-
type: "header",
|
|
3350
|
-
title: section.title,
|
|
3351
|
-
items: section.items,
|
|
3352
|
-
id: section.id,
|
|
3353
|
-
callToAction: section.callToAction
|
|
3354
|
-
}
|
|
3355
|
-
] : [],
|
|
3356
|
-
...section.items.map((item) => ({
|
|
3357
|
-
item,
|
|
3358
|
-
type: "item"
|
|
3359
|
-
}))
|
|
3360
|
-
]);
|
|
3413
|
+
const stateCount = state.sections.reduce((total, section) => {
|
|
3414
|
+
const count = section.type === "items" ? section.items.length : 1;
|
|
3415
|
+
return count + total + (section.title ? 1 : 0);
|
|
3416
|
+
}, 0);
|
|
3417
|
+
const items = flattenCollectionItems(state.sections);
|
|
3361
3418
|
const listRef = useRef4(null);
|
|
3362
3419
|
const listOffsetRef = useRef4(0);
|
|
3363
3420
|
useLayoutEffect2(() => {
|
|
3364
3421
|
var _a, _b;
|
|
3365
3422
|
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
3366
3423
|
});
|
|
3367
|
-
return /* @__PURE__ */
|
|
3424
|
+
return /* @__PURE__ */ jsxs8("div", { ref: contentRef, children: [
|
|
3368
3425
|
state.beforeSections,
|
|
3369
|
-
scrollElement ? /* @__PURE__ */
|
|
3426
|
+
scrollElement ? /* @__PURE__ */ jsx37(
|
|
3370
3427
|
ElementVirtualizedItems,
|
|
3371
3428
|
{
|
|
3372
3429
|
Item,
|
|
@@ -3375,7 +3432,7 @@ var ContentComponent = (props) => {
|
|
|
3375
3432
|
scrollElement,
|
|
3376
3433
|
stateCount
|
|
3377
3434
|
}
|
|
3378
|
-
) : /* @__PURE__ */
|
|
3435
|
+
) : /* @__PURE__ */ jsx37(
|
|
3379
3436
|
WindowVirtualizedItems,
|
|
3380
3437
|
{
|
|
3381
3438
|
Item,
|
|
@@ -3384,7 +3441,7 @@ var ContentComponent = (props) => {
|
|
|
3384
3441
|
stateCount
|
|
3385
3442
|
}
|
|
3386
3443
|
),
|
|
3387
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ jsx37("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: /* @__PURE__ */ jsx37(PaginationComponent, { state }) }),
|
|
3388
3445
|
state.afterSections
|
|
3389
3446
|
] });
|
|
3390
3447
|
};
|
|
@@ -3396,7 +3453,7 @@ var WindowVirtualizedItems = (props) => {
|
|
|
3396
3453
|
estimateSize: () => 120,
|
|
3397
3454
|
overscan: 10
|
|
3398
3455
|
});
|
|
3399
|
-
return /* @__PURE__ */
|
|
3456
|
+
return /* @__PURE__ */ jsx37(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3400
3457
|
};
|
|
3401
3458
|
var ElementVirtualizedItems = (props) => {
|
|
3402
3459
|
const { scrollElement, stateCount } = props;
|
|
@@ -3407,7 +3464,7 @@ var ElementVirtualizedItems = (props) => {
|
|
|
3407
3464
|
estimateSize: () => 120,
|
|
3408
3465
|
overscan: 10
|
|
3409
3466
|
});
|
|
3410
|
-
return /* @__PURE__ */
|
|
3467
|
+
return /* @__PURE__ */ jsx37(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3411
3468
|
};
|
|
3412
3469
|
var VirtualizedItems = ({
|
|
3413
3470
|
Item,
|
|
@@ -3415,7 +3472,7 @@ var VirtualizedItems = ({
|
|
|
3415
3472
|
items,
|
|
3416
3473
|
virtualItemsRef,
|
|
3417
3474
|
virtualizer
|
|
3418
|
-
}) => /* @__PURE__ */
|
|
3475
|
+
}) => /* @__PURE__ */ jsx37(
|
|
3419
3476
|
"div",
|
|
3420
3477
|
{
|
|
3421
3478
|
ref: virtualItemsRef,
|
|
@@ -3429,7 +3486,7 @@ var VirtualizedItems = ({
|
|
|
3429
3486
|
if (!i) {
|
|
3430
3487
|
return null;
|
|
3431
3488
|
}
|
|
3432
|
-
return /* @__PURE__ */
|
|
3489
|
+
return /* @__PURE__ */ jsxs8(
|
|
3433
3490
|
"div",
|
|
3434
3491
|
{
|
|
3435
3492
|
ref: virtualizer.measureElement,
|
|
@@ -3441,17 +3498,19 @@ var VirtualizedItems = ({
|
|
|
3441
3498
|
width: "100%",
|
|
3442
3499
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3443
3500
|
},
|
|
3444
|
-
children:
|
|
3501
|
+
children: [
|
|
3502
|
+
i.type === "header" && /* @__PURE__ */ jsx37(SectionHeader, __spreadValues({}, i)),
|
|
3503
|
+
i.type === "item" && /* @__PURE__ */ jsx37(Item, __spreadValues({}, i.item)),
|
|
3504
|
+
i.type === "layout" && i.children
|
|
3505
|
+
]
|
|
3445
3506
|
},
|
|
3446
3507
|
item.key
|
|
3447
3508
|
);
|
|
3448
3509
|
})
|
|
3449
3510
|
}
|
|
3450
3511
|
);
|
|
3451
|
-
var PaginationComponent = ({
|
|
3452
|
-
status
|
|
3453
|
-
state
|
|
3454
|
-
}) => {
|
|
3512
|
+
var PaginationComponent = ({ state }) => {
|
|
3513
|
+
const { status } = state;
|
|
3455
3514
|
const isPaginationError = status.type === "error" && status.reason === "pagination";
|
|
3456
3515
|
const isPaginationLoading = status.type === "loading" && status.reason === "pagination";
|
|
3457
3516
|
const loadMore = status.type === "idle" ? status.loadMore : void 0;
|
|
@@ -3459,34 +3518,41 @@ var PaginationComponent = ({
|
|
|
3459
3518
|
return null;
|
|
3460
3519
|
}
|
|
3461
3520
|
if (isPaginationError) {
|
|
3462
|
-
return /* @__PURE__ */
|
|
3521
|
+
return /* @__PURE__ */ jsx37(LoadMoreButton, { onClick: status.retry });
|
|
3463
3522
|
}
|
|
3464
3523
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
3465
|
-
return /* @__PURE__ */
|
|
3524
|
+
return /* @__PURE__ */ jsx37(LoadMoreButton, { onClick: loadMore });
|
|
3466
3525
|
}
|
|
3467
|
-
return /* @__PURE__ */
|
|
3526
|
+
return /* @__PURE__ */ jsx37(ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
3468
3527
|
};
|
|
3469
3528
|
var LoadMoreButton = ({ onClick }) => {
|
|
3470
|
-
const { formatMessage } =
|
|
3471
|
-
return /* @__PURE__ */
|
|
3529
|
+
const { formatMessage } = useIntl5();
|
|
3530
|
+
return /* @__PURE__ */ jsx37("div", { className: "d-flex m-x-auto", children: /* @__PURE__ */ jsx37(Button4, { v2: true, size: "sm", priority: "secondary-neutral", onClick, children: formatMessage(collection_messages_default.loadMoreButton) }) });
|
|
3472
3531
|
};
|
|
3473
3532
|
|
|
3474
|
-
// ../renderers/src/CollectionRenderer/
|
|
3533
|
+
// ../renderers/src/CollectionRenderer/v1/FilterComponent.tsx
|
|
3475
3534
|
import { Chips } from "@transferwise/components";
|
|
3476
|
-
import { jsx as
|
|
3477
|
-
var FiltersComponent = (
|
|
3478
|
-
const {
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3535
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3536
|
+
var FiltersComponent = (props) => {
|
|
3537
|
+
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3538
|
+
const { filters } = collectionProps.state;
|
|
3539
|
+
return /* @__PURE__ */ jsx38("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
3540
|
+
var _a2;
|
|
3541
|
+
return /* @__PURE__ */ jsx38(
|
|
3542
|
+
Filter,
|
|
3543
|
+
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3544
|
+
filter
|
|
3545
|
+
}),
|
|
3546
|
+
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3547
|
+
);
|
|
3482
3548
|
}) });
|
|
3483
3549
|
};
|
|
3484
|
-
var FilterComponent = (filter) => {
|
|
3550
|
+
var FilterComponent = ({ filter }) => {
|
|
3485
3551
|
const { multiSelect, options } = filter;
|
|
3486
3552
|
if (!options) {
|
|
3487
3553
|
return null;
|
|
3488
3554
|
}
|
|
3489
|
-
return /* @__PURE__ */
|
|
3555
|
+
return /* @__PURE__ */ jsx38(
|
|
3490
3556
|
Chips,
|
|
3491
3557
|
{
|
|
3492
3558
|
className: "m-b-1",
|
|
@@ -3516,7 +3582,7 @@ import { ListItem as ListItem6 } from "@transferwise/components";
|
|
|
3516
3582
|
|
|
3517
3583
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
3518
3584
|
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
3519
|
-
import { jsx as
|
|
3585
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3520
3586
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3521
3587
|
var _a, _b;
|
|
3522
3588
|
if (!additionalInfo) {
|
|
@@ -3524,7 +3590,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3524
3590
|
}
|
|
3525
3591
|
const { href, text, onClick } = additionalInfo;
|
|
3526
3592
|
if (href || onClick) {
|
|
3527
|
-
return /* @__PURE__ */
|
|
3593
|
+
return /* @__PURE__ */ jsx39(
|
|
3528
3594
|
ListItem4.AdditionalInfo,
|
|
3529
3595
|
{
|
|
3530
3596
|
action: __spreadValues({
|
|
@@ -3533,19 +3599,19 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3533
3599
|
}
|
|
3534
3600
|
);
|
|
3535
3601
|
}
|
|
3536
|
-
return /* @__PURE__ */
|
|
3602
|
+
return /* @__PURE__ */ jsx39(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3537
3603
|
};
|
|
3538
3604
|
|
|
3539
3605
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3540
3606
|
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
3541
|
-
import { jsx as
|
|
3607
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3542
3608
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3543
3609
|
if (!callToAction) {
|
|
3544
3610
|
return void 0;
|
|
3545
3611
|
}
|
|
3546
3612
|
const { accessibilityDescription, title, context } = callToAction;
|
|
3547
3613
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
3548
|
-
return /* @__PURE__ */
|
|
3614
|
+
return /* @__PURE__ */ jsx40(
|
|
3549
3615
|
ListItem5.Button,
|
|
3550
3616
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
3551
3617
|
partiallyInteractive: !fullyInteractive,
|
|
@@ -3570,7 +3636,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
3570
3636
|
};
|
|
3571
3637
|
|
|
3572
3638
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3573
|
-
import { jsx as
|
|
3639
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3574
3640
|
var ItemComponent = (props) => {
|
|
3575
3641
|
var _a, _b;
|
|
3576
3642
|
const {
|
|
@@ -3592,7 +3658,7 @@ var ItemComponent = (props) => {
|
|
|
3592
3658
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
3593
3659
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3594
3660
|
};
|
|
3595
|
-
return /* @__PURE__ */
|
|
3661
|
+
return /* @__PURE__ */ jsx41(
|
|
3596
3662
|
ListItem6,
|
|
3597
3663
|
{
|
|
3598
3664
|
title,
|
|
@@ -3609,15 +3675,15 @@ var ItemComponent = (props) => {
|
|
|
3609
3675
|
};
|
|
3610
3676
|
var getNavigationControl = (onClick, href) => {
|
|
3611
3677
|
if (href) {
|
|
3612
|
-
return /* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx41(ListItem6.Navigation, { href });
|
|
3613
3679
|
}
|
|
3614
3680
|
if (onClick) {
|
|
3615
|
-
return /* @__PURE__ */
|
|
3681
|
+
return /* @__PURE__ */ jsx41(ListItem6.Navigation, { onClick });
|
|
3616
3682
|
}
|
|
3617
3683
|
return null;
|
|
3618
3684
|
};
|
|
3619
3685
|
|
|
3620
|
-
// ../renderers/src/CollectionRenderer/
|
|
3686
|
+
// ../renderers/src/CollectionRenderer/v1/SearchComponent.tsx
|
|
3621
3687
|
import {
|
|
3622
3688
|
InputGroup,
|
|
3623
3689
|
Input,
|
|
@@ -3625,46 +3691,41 @@ import {
|
|
|
3625
3691
|
IconButton
|
|
3626
3692
|
} from "@transferwise/components";
|
|
3627
3693
|
import { CrossCircleFill, Search } from "@transferwise/icons";
|
|
3628
|
-
import { useIntl as
|
|
3629
|
-
import { jsx as
|
|
3630
|
-
var SearchComponent = ({
|
|
3631
|
-
|
|
3632
|
-
status,
|
|
3633
|
-
features,
|
|
3634
|
-
control,
|
|
3635
|
-
tags
|
|
3636
|
-
}) => {
|
|
3694
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
3695
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3696
|
+
var SearchComponent = ({ state, features, control, tags }) => {
|
|
3697
|
+
var _a;
|
|
3637
3698
|
const { search } = state;
|
|
3638
|
-
const { formatMessage } =
|
|
3699
|
+
const { formatMessage } = useIntl6();
|
|
3639
3700
|
if (!search) {
|
|
3640
3701
|
return;
|
|
3641
3702
|
}
|
|
3642
3703
|
const getAddon = () => {
|
|
3643
|
-
var
|
|
3644
|
-
if (status.type === "loading") {
|
|
3645
|
-
return { content: /* @__PURE__ */
|
|
3704
|
+
var _a2;
|
|
3705
|
+
if (state.status.type === "loading") {
|
|
3706
|
+
return { content: /* @__PURE__ */ jsx42(ProcessIndicator2, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3646
3707
|
}
|
|
3647
|
-
if ((
|
|
3708
|
+
if ((_a2 = state.search) == null ? void 0 : _a2.query) {
|
|
3648
3709
|
return {
|
|
3649
3710
|
interactive: true,
|
|
3650
|
-
content: /* @__PURE__ */
|
|
3711
|
+
content: /* @__PURE__ */ jsx42(
|
|
3651
3712
|
IconButton,
|
|
3652
3713
|
{
|
|
3653
3714
|
priority: "minimal",
|
|
3654
3715
|
size: 24,
|
|
3655
3716
|
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
3656
3717
|
onClick: () => {
|
|
3657
|
-
var
|
|
3658
|
-
return (
|
|
3718
|
+
var _a3;
|
|
3719
|
+
return (_a3 = state.search) == null ? void 0 : _a3.onChange("");
|
|
3659
3720
|
},
|
|
3660
|
-
children: /* @__PURE__ */
|
|
3721
|
+
children: /* @__PURE__ */ jsx42(CrossCircleFill, {})
|
|
3661
3722
|
}
|
|
3662
3723
|
)
|
|
3663
3724
|
};
|
|
3664
3725
|
}
|
|
3665
3726
|
return void 0;
|
|
3666
3727
|
};
|
|
3667
|
-
return /* @__PURE__ */
|
|
3728
|
+
return /* @__PURE__ */ jsx42(
|
|
3668
3729
|
FieldInput_default,
|
|
3669
3730
|
{
|
|
3670
3731
|
id: "search",
|
|
@@ -3675,13 +3736,13 @@ var SearchComponent = ({
|
|
|
3675
3736
|
features,
|
|
3676
3737
|
control,
|
|
3677
3738
|
tags,
|
|
3678
|
-
children: /* @__PURE__ */
|
|
3739
|
+
children: /* @__PURE__ */ jsx42(InputGroup, { addonStart: { content: /* @__PURE__ */ jsx42(Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ jsx42(
|
|
3679
3740
|
Input,
|
|
3680
3741
|
{
|
|
3681
3742
|
id: "search",
|
|
3682
3743
|
name: "search",
|
|
3683
3744
|
shape: "pill",
|
|
3684
|
-
placeholder: search.
|
|
3745
|
+
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
3685
3746
|
type: "text",
|
|
3686
3747
|
value: search.query,
|
|
3687
3748
|
onChange: ({ currentTarget: { value } }) => {
|
|
@@ -3694,14 +3755,72 @@ var SearchComponent = ({
|
|
|
3694
3755
|
};
|
|
3695
3756
|
|
|
3696
3757
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
3697
|
-
import { jsx as
|
|
3758
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3698
3759
|
var SectionHeaderComponent = ({
|
|
3699
3760
|
title,
|
|
3700
3761
|
callToAction
|
|
3701
|
-
}) => /* @__PURE__ */
|
|
3762
|
+
}) => /* @__PURE__ */ jsx43(Header, { title, callToAction });
|
|
3763
|
+
|
|
3764
|
+
// ../renderers/src/CollectionRenderer/components/CollapsibleContentComponent.tsx
|
|
3765
|
+
import { useState as useState9 } from "react";
|
|
3766
|
+
import { Button as Button5 } from "@transferwise/components";
|
|
3767
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
3768
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3769
|
+
var CollapsibleContentComponent = (props) => {
|
|
3770
|
+
const { state, SectionHeader, Item } = props;
|
|
3771
|
+
const { search, status } = state;
|
|
3772
|
+
const [isShowingInitialState, setIsShowingInitialState] = useState9(true);
|
|
3773
|
+
const isSearchRunning = status.type === "loading" && status.reason === "search";
|
|
3774
|
+
const shouldShowInitialState = !(search == null ? void 0 : search.query) || isSearchRunning && isShowingInitialState;
|
|
3775
|
+
if (shouldShowInitialState !== isShowingInitialState) {
|
|
3776
|
+
setIsShowingInitialState(shouldShowInitialState);
|
|
3777
|
+
}
|
|
3778
|
+
return (
|
|
3779
|
+
// keep focus in the search input when clicking the results, so clicking doesn't blur it and
|
|
3780
|
+
// pop the collection before the click is handled
|
|
3781
|
+
/* @__PURE__ */ jsx44("div", { role: "presentation", onMouseDown: (event) => event.preventDefault(), children: state.sections.map((section) => {
|
|
3782
|
+
return /* @__PURE__ */ jsx44(Section, { section, SectionHeader, Item }, section.id);
|
|
3783
|
+
}) })
|
|
3784
|
+
);
|
|
3785
|
+
};
|
|
3786
|
+
var Section = ({ section, SectionHeader, Item }) => {
|
|
3787
|
+
const { formatMessage } = useIntl7();
|
|
3788
|
+
const [expanded, setExpanded] = useState9(false);
|
|
3789
|
+
const itemIds = section.type === "items" ? section.items.map(({ id }) => id).join("") : section.id;
|
|
3790
|
+
const [prevItemIds, setPrevItemIds] = useState9(itemIds);
|
|
3791
|
+
if (itemIds !== prevItemIds) {
|
|
3792
|
+
setExpanded(false);
|
|
3793
|
+
setPrevItemIds(itemIds);
|
|
3794
|
+
}
|
|
3795
|
+
const showLoadMore = section.type === "items" && section.items.some((item) => {
|
|
3796
|
+
var _a;
|
|
3797
|
+
return (_a = item.tags) == null ? void 0 : _a.includes("hidden");
|
|
3798
|
+
});
|
|
3799
|
+
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
3800
|
+
/* @__PURE__ */ jsx44(SectionHeader, __spreadValues({}, section)),
|
|
3801
|
+
section.type === "items" && section.items.filter((item) => {
|
|
3802
|
+
var _a;
|
|
3803
|
+
return expanded || !((_a = item.tags) == null ? void 0 : _a.includes("hidden"));
|
|
3804
|
+
}).map((item) => /* @__PURE__ */ jsx44(Item, __spreadValues({}, item), item.id)),
|
|
3805
|
+
section.type === "layout" && section.children,
|
|
3806
|
+
showLoadMore ? /* @__PURE__ */ jsx44(
|
|
3807
|
+
Button5,
|
|
3808
|
+
{
|
|
3809
|
+
priority: "tertiary",
|
|
3810
|
+
onClick: () => {
|
|
3811
|
+
setExpanded(!expanded);
|
|
3812
|
+
},
|
|
3813
|
+
children: expanded ? /* @__PURE__ */ jsxs9("span", { children: [
|
|
3814
|
+
formatMessage(collection_messages_default.showLessResultsButton),
|
|
3815
|
+
" "
|
|
3816
|
+
] }) : /* @__PURE__ */ jsx44("span", { children: formatMessage(collection_messages_default.showMoreResultsButton, { count: section.items.length }) })
|
|
3817
|
+
}
|
|
3818
|
+
) : void 0
|
|
3819
|
+
] });
|
|
3820
|
+
};
|
|
3702
3821
|
|
|
3703
3822
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
3704
|
-
import { jsx as
|
|
3823
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3705
3824
|
var createCollectionRenderer = (canRender, components) => {
|
|
3706
3825
|
const componentsWithDefaults = __spreadValues({
|
|
3707
3826
|
Search: SearchComponent,
|
|
@@ -3709,48 +3828,209 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
3709
3828
|
Filter: FilterComponent,
|
|
3710
3829
|
Item: ItemComponent,
|
|
3711
3830
|
SectionHeader: SectionHeaderComponent,
|
|
3712
|
-
Results:
|
|
3831
|
+
Results: VirtualisedContentComponent,
|
|
3832
|
+
FocusedResults: CollapsibleContentComponent
|
|
3713
3833
|
}, components);
|
|
3714
3834
|
return {
|
|
3715
3835
|
canRenderType: "collection",
|
|
3716
3836
|
canRender,
|
|
3717
3837
|
render: (props) => {
|
|
3718
|
-
return /* @__PURE__ */
|
|
3838
|
+
return /* @__PURE__ */ jsx45(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
3719
3839
|
}
|
|
3720
3840
|
};
|
|
3721
3841
|
};
|
|
3722
3842
|
|
|
3723
|
-
// ../renderers/src/CollectionRenderer/
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3843
|
+
// ../renderers/src/CollectionRenderer/v1/CollectionRendererV1.tsx
|
|
3844
|
+
var CollectionRendererV1 = createCollectionRenderer(
|
|
3845
|
+
() => true
|
|
3846
|
+
);
|
|
3847
|
+
var CollectionRendererV1_default = CollectionRendererV1;
|
|
3848
|
+
|
|
3849
|
+
// ../renderers/src/CollectionRenderer/v2/FilterComponent.tsx
|
|
3850
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
3851
|
+
import { Chips as Chips2, Divider } from "@transferwise/components";
|
|
3852
|
+
import { useState as useState10 } from "react";
|
|
3853
|
+
import { jsx as jsx46, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3854
|
+
var FiltersComponent2 = (props) => {
|
|
3855
|
+
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3856
|
+
const { state, depth, tags } = collectionProps;
|
|
3857
|
+
const { filters, status, search } = state;
|
|
3858
|
+
const isForked = depth > 0;
|
|
3859
|
+
const isSearching = status.type === "loading" && status.reason === "search";
|
|
3860
|
+
const [searchedStateId, setSearchedStateId] = useState10();
|
|
3861
|
+
if (isForked && !isSearching && (search == null ? void 0 : search.query) && searchedStateId !== state.id) {
|
|
3862
|
+
setSearchedStateId(state.id);
|
|
3863
|
+
}
|
|
3864
|
+
const isFirstSearchPending = isForked && isSearching && searchedStateId !== state.id;
|
|
3865
|
+
return /* @__PURE__ */ jsx46(
|
|
3866
|
+
"div",
|
|
3867
|
+
{
|
|
3868
|
+
className: (0, import_classnames12.default)("df-filters-collapsible", {
|
|
3869
|
+
"df-filters-collapsible--hidden": isFirstSearchPending
|
|
3870
|
+
}),
|
|
3871
|
+
"aria-hidden": isFirstSearchPending,
|
|
3872
|
+
inert: isFirstSearchPending,
|
|
3873
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "df-filters-collapsible-content", children: [
|
|
3874
|
+
(tags == null ? void 0 : tags.includes("filter-divider")) && /* @__PURE__ */ jsx46(Divider, { className: "m-b-3", level: "subsection" }),
|
|
3875
|
+
/* @__PURE__ */ jsx46("div", { className: (0, import_classnames12.default)("df-filters-container", { "df-filter-loader": isSearching }), children: filters.map((filter) => {
|
|
3876
|
+
var _a2;
|
|
3877
|
+
return /* @__PURE__ */ jsx46(
|
|
3878
|
+
Filter,
|
|
3879
|
+
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3880
|
+
filter
|
|
3881
|
+
}),
|
|
3882
|
+
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3883
|
+
);
|
|
3884
|
+
}) })
|
|
3885
|
+
] })
|
|
3886
|
+
}
|
|
3887
|
+
);
|
|
3733
3888
|
};
|
|
3734
|
-
var
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3889
|
+
var FilterComponent2 = ({
|
|
3890
|
+
filter,
|
|
3891
|
+
state
|
|
3892
|
+
}) => {
|
|
3893
|
+
const { multiSelect, options } = filter;
|
|
3894
|
+
const { status } = state;
|
|
3895
|
+
const disabled = status.type === "loading" && status.reason === "search";
|
|
3896
|
+
if (!options) {
|
|
3897
|
+
return null;
|
|
3898
|
+
}
|
|
3899
|
+
return /* @__PURE__ */ jsx46(
|
|
3900
|
+
Chips2,
|
|
3901
|
+
{
|
|
3902
|
+
className: "m-b-1",
|
|
3903
|
+
multiple: multiSelect,
|
|
3904
|
+
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
3905
|
+
chips: [
|
|
3906
|
+
...options.map((option) => ({
|
|
3907
|
+
value: option.value,
|
|
3908
|
+
label: option.title
|
|
3909
|
+
}))
|
|
3910
|
+
],
|
|
3911
|
+
onChange: (value) => {
|
|
3912
|
+
var _a;
|
|
3913
|
+
if (disabled) {
|
|
3914
|
+
return;
|
|
3915
|
+
}
|
|
3916
|
+
if (value.selectedValue === "") {
|
|
3917
|
+
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
3918
|
+
return;
|
|
3919
|
+
}
|
|
3920
|
+
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
3921
|
+
}
|
|
3922
|
+
},
|
|
3923
|
+
JSON.stringify(options)
|
|
3924
|
+
);
|
|
3741
3925
|
};
|
|
3742
|
-
|
|
3743
|
-
|
|
3926
|
+
|
|
3927
|
+
// ../renderers/src/CollectionRenderer/v2/SearchComponent.tsx
|
|
3928
|
+
import {
|
|
3929
|
+
InputGroup as InputGroup2,
|
|
3930
|
+
Input as Input2,
|
|
3931
|
+
ProcessIndicator as ProcessIndicator3,
|
|
3932
|
+
IconButton as IconButton2
|
|
3933
|
+
} from "@transferwise/components";
|
|
3934
|
+
import { CrossCircleFill as CrossCircleFill2, Search as Search2 } from "@transferwise/icons";
|
|
3935
|
+
import { useRef as useRef5 } from "react";
|
|
3936
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
3937
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3938
|
+
var SearchComponent2 = ({
|
|
3939
|
+
state,
|
|
3940
|
+
depth,
|
|
3941
|
+
fork,
|
|
3942
|
+
pop,
|
|
3943
|
+
features,
|
|
3944
|
+
control,
|
|
3945
|
+
tags
|
|
3946
|
+
}) => {
|
|
3947
|
+
var _a;
|
|
3948
|
+
const { search } = state;
|
|
3949
|
+
const { formatMessage } = useIntl8();
|
|
3950
|
+
const inputRef = useRef5(null);
|
|
3951
|
+
if (!search) {
|
|
3952
|
+
return;
|
|
3953
|
+
}
|
|
3954
|
+
const isForked = depth > 0;
|
|
3955
|
+
const getAddon = () => {
|
|
3956
|
+
if (state.status.type === "loading") {
|
|
3957
|
+
return { content: /* @__PURE__ */ jsx47(ProcessIndicator3, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3958
|
+
}
|
|
3959
|
+
if (search.query) {
|
|
3960
|
+
return {
|
|
3961
|
+
interactive: true,
|
|
3962
|
+
content: /* @__PURE__ */ jsx47(
|
|
3963
|
+
IconButton2,
|
|
3964
|
+
{
|
|
3965
|
+
priority: "minimal",
|
|
3966
|
+
size: 24,
|
|
3967
|
+
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
3968
|
+
onClick: () => {
|
|
3969
|
+
var _a2;
|
|
3970
|
+
search.onChange("");
|
|
3971
|
+
pop();
|
|
3972
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
3973
|
+
},
|
|
3974
|
+
children: /* @__PURE__ */ jsx47(CrossCircleFill2, {})
|
|
3975
|
+
}
|
|
3976
|
+
)
|
|
3977
|
+
};
|
|
3978
|
+
}
|
|
3979
|
+
return void 0;
|
|
3980
|
+
};
|
|
3981
|
+
return /* @__PURE__ */ jsx47(
|
|
3982
|
+
FieldInput_default,
|
|
3983
|
+
{
|
|
3984
|
+
id: "search",
|
|
3985
|
+
description: "",
|
|
3986
|
+
validation: void 0,
|
|
3987
|
+
help: "",
|
|
3988
|
+
label: search.title,
|
|
3989
|
+
features,
|
|
3990
|
+
control,
|
|
3991
|
+
tags,
|
|
3992
|
+
children: /* @__PURE__ */ jsx47(InputGroup2, { addonStart: { content: /* @__PURE__ */ jsx47(Search2, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ jsx47(
|
|
3993
|
+
Input2,
|
|
3994
|
+
{
|
|
3995
|
+
ref: inputRef,
|
|
3996
|
+
id: "search",
|
|
3997
|
+
name: "search",
|
|
3998
|
+
shape: "pill",
|
|
3999
|
+
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
4000
|
+
type: "text",
|
|
4001
|
+
value: search.query,
|
|
4002
|
+
onChange: ({ currentTarget: { value } }) => {
|
|
4003
|
+
if (isForked && value === "") {
|
|
4004
|
+
pop();
|
|
4005
|
+
return;
|
|
4006
|
+
}
|
|
4007
|
+
if (value && !isForked) {
|
|
4008
|
+
fork();
|
|
4009
|
+
}
|
|
4010
|
+
search.onChange(value);
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
) })
|
|
4014
|
+
}
|
|
4015
|
+
);
|
|
4016
|
+
};
|
|
4017
|
+
|
|
4018
|
+
// ../renderers/src/CollectionRenderer/v2/CollectionRendererV2.tsx
|
|
4019
|
+
var CollectionRendererV2 = createCollectionRenderer(
|
|
4020
|
+
({ control }) => control === "contacts-collection-v2",
|
|
4021
|
+
{ Search: SearchComponent2, Filters: FiltersComponent2, Filter: FilterComponent2 }
|
|
4022
|
+
);
|
|
4023
|
+
var CollectionRendererV2_default = CollectionRendererV2;
|
|
3744
4024
|
|
|
3745
4025
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3746
|
-
var
|
|
4026
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
3747
4027
|
|
|
3748
4028
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
3749
|
-
import { useEffect as useEffect8, useState as
|
|
4029
|
+
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
3750
4030
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
3751
4031
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
3752
4032
|
var useIsCollapsed = () => {
|
|
3753
|
-
const [collapsed, setCollapsed] =
|
|
4033
|
+
const [collapsed, setCollapsed] = useState11(
|
|
3754
4034
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
3755
4035
|
);
|
|
3756
4036
|
useEffect8(() => {
|
|
@@ -3766,7 +4046,7 @@ var useIsCollapsed = () => {
|
|
|
3766
4046
|
};
|
|
3767
4047
|
|
|
3768
4048
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3769
|
-
import { jsx as
|
|
4049
|
+
import { jsx as jsx48, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3770
4050
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
3771
4051
|
var ColumnsRenderer = {
|
|
3772
4052
|
canRenderType: "columns",
|
|
@@ -3777,12 +4057,12 @@ function ColumnsRendererComponent(props) {
|
|
|
3777
4057
|
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3778
4058
|
const isCollapsed = useIsCollapsed();
|
|
3779
4059
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
3780
|
-
const startColumn = /* @__PURE__ */
|
|
3781
|
-
const endColumn = /* @__PURE__ */
|
|
3782
|
-
return /* @__PURE__ */
|
|
4060
|
+
const startColumn = /* @__PURE__ */ jsx48("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
4061
|
+
const endColumn = /* @__PURE__ */ jsx48("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
4062
|
+
return /* @__PURE__ */ jsxs11(
|
|
3783
4063
|
"div",
|
|
3784
4064
|
{
|
|
3785
|
-
className: (0,
|
|
4065
|
+
className: (0, import_classnames13.default)(
|
|
3786
4066
|
"df-columns-renderer-container",
|
|
3787
4067
|
getMargin(margin),
|
|
3788
4068
|
{
|
|
@@ -3832,8 +4112,8 @@ var dateToDateString = (date) => {
|
|
|
3832
4112
|
import { DateLookup } from "@transferwise/components";
|
|
3833
4113
|
|
|
3834
4114
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3835
|
-
import { useState as
|
|
3836
|
-
import { useIntl as
|
|
4115
|
+
import { useState as useState12 } from "react";
|
|
4116
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
3837
4117
|
|
|
3838
4118
|
// ../renderers/src/messages/date-input.messages.ts
|
|
3839
4119
|
import { defineMessages as defineMessages6 } from "react-intl";
|
|
@@ -3848,8 +4128,8 @@ var date_input_messages_default = defineMessages6({
|
|
|
3848
4128
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3849
4129
|
var useAvailabilityRules = (availability) => {
|
|
3850
4130
|
var _a, _b;
|
|
3851
|
-
const { formatMessage } =
|
|
3852
|
-
const [focusedDate, setFocusedDate] =
|
|
4131
|
+
const { formatMessage } = useIntl9();
|
|
4132
|
+
const [focusedDate, setFocusedDate] = useState12(null);
|
|
3853
4133
|
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);
|
|
3854
4134
|
const onDateSelect = ({ date }) => {
|
|
3855
4135
|
setFocusedDate((current) => (current == null ? void 0 : current.getTime()) === date.getTime() ? current : date);
|
|
@@ -3901,7 +4181,7 @@ var matchesDateRule = (date, weekday, rule) => {
|
|
|
3901
4181
|
var isDate = (date) => date !== null;
|
|
3902
4182
|
|
|
3903
4183
|
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
3904
|
-
import { jsx as
|
|
4184
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3905
4185
|
var DateLookupControl = ({
|
|
3906
4186
|
value,
|
|
3907
4187
|
minimumDate,
|
|
@@ -3914,7 +4194,7 @@ var DateLookupControl = ({
|
|
|
3914
4194
|
onFocus
|
|
3915
4195
|
}) => {
|
|
3916
4196
|
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
3917
|
-
return /* @__PURE__ */
|
|
4197
|
+
return /* @__PURE__ */ jsx49(
|
|
3918
4198
|
DateLookup,
|
|
3919
4199
|
{
|
|
3920
4200
|
value: dateStringToDateOrNull(value),
|
|
@@ -3938,7 +4218,7 @@ var DateLookupControl = ({
|
|
|
3938
4218
|
|
|
3939
4219
|
// ../renderers/src/DateInputRenderer/CalendarControl.tsx
|
|
3940
4220
|
import { Calendar } from "@transferwise/components";
|
|
3941
|
-
import { jsx as
|
|
4221
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
3942
4222
|
var CalendarControl = ({
|
|
3943
4223
|
id,
|
|
3944
4224
|
title,
|
|
@@ -3961,7 +4241,7 @@ var CalendarControl = ({
|
|
|
3961
4241
|
};
|
|
3962
4242
|
return (
|
|
3963
4243
|
// Wrapping in a <fieldset> to address some a11y gaps in the current inline Calendar component
|
|
3964
|
-
/* @__PURE__ */
|
|
4244
|
+
/* @__PURE__ */ jsx50(
|
|
3965
4245
|
"fieldset",
|
|
3966
4246
|
{
|
|
3967
4247
|
id,
|
|
@@ -3978,7 +4258,7 @@ var CalendarControl = ({
|
|
|
3978
4258
|
onBlur();
|
|
3979
4259
|
}
|
|
3980
4260
|
},
|
|
3981
|
-
children: /* @__PURE__ */
|
|
4261
|
+
children: /* @__PURE__ */ jsx50(
|
|
3982
4262
|
Calendar,
|
|
3983
4263
|
{
|
|
3984
4264
|
value: dateStringToDateOrNull(value),
|
|
@@ -3998,10 +4278,10 @@ var CalendarControl = ({
|
|
|
3998
4278
|
|
|
3999
4279
|
// ../renderers/src/DateInputRenderer/DateInputControl.tsx
|
|
4000
4280
|
import { DateInput } from "@transferwise/components";
|
|
4001
|
-
import { jsx as
|
|
4281
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4002
4282
|
var DateInputControl = (_a) => {
|
|
4003
4283
|
var _b = _a, { autoComplete } = _b, props = __objRest(_b, ["autoComplete"]);
|
|
4004
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsx51(
|
|
4005
4285
|
DateInput,
|
|
4006
4286
|
__spreadProps(__spreadValues({}, props), {
|
|
4007
4287
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -4017,7 +4297,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
4017
4297
|
};
|
|
4018
4298
|
|
|
4019
4299
|
// ../renderers/src/DateInputRenderer/DateInputRenderer.tsx
|
|
4020
|
-
import { jsx as
|
|
4300
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
4021
4301
|
var DateInputRenderer = {
|
|
4022
4302
|
canRenderType: "input-date",
|
|
4023
4303
|
render: (props) => {
|
|
@@ -4051,7 +4331,7 @@ var DateInputRenderer = {
|
|
|
4051
4331
|
}
|
|
4052
4332
|
return DateInputControl;
|
|
4053
4333
|
})();
|
|
4054
|
-
return /* @__PURE__ */
|
|
4334
|
+
return /* @__PURE__ */ jsx52(
|
|
4055
4335
|
FieldInput_default,
|
|
4056
4336
|
{
|
|
4057
4337
|
id,
|
|
@@ -4064,7 +4344,7 @@ var DateInputRenderer = {
|
|
|
4064
4344
|
features: props.features,
|
|
4065
4345
|
control,
|
|
4066
4346
|
tags: props.tags,
|
|
4067
|
-
children: /* @__PURE__ */
|
|
4347
|
+
children: /* @__PURE__ */ jsx52(UIComponent, __spreadValues({}, inputProps))
|
|
4068
4348
|
}
|
|
4069
4349
|
);
|
|
4070
4350
|
}
|
|
@@ -4076,8 +4356,8 @@ import { ListItem as ListItem7 } from "@transferwise/components";
|
|
|
4076
4356
|
|
|
4077
4357
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4078
4358
|
import { Header as Header3, SearchInput } from "@transferwise/components";
|
|
4079
|
-
import { useState as
|
|
4080
|
-
import { useIntl as
|
|
4359
|
+
import { useState as useState13 } from "react";
|
|
4360
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
4081
4361
|
|
|
4082
4362
|
// ../renderers/src/messages/filter.messages.ts
|
|
4083
4363
|
import { defineMessages as defineMessages7 } from "react-intl";
|
|
@@ -4147,8 +4427,8 @@ function filterAndSortItems(options, query) {
|
|
|
4147
4427
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
4148
4428
|
|
|
4149
4429
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4150
|
-
import { Header as Header2, Section } from "@transferwise/components";
|
|
4151
|
-
import { useIntl as
|
|
4430
|
+
import { Header as Header2, Section as Section2 } from "@transferwise/components";
|
|
4431
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
4152
4432
|
|
|
4153
4433
|
// ../renderers/src/messages/group.messages.ts
|
|
4154
4434
|
import { defineMessages as defineMessages8 } from "react-intl";
|
|
@@ -4186,18 +4466,18 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
4186
4466
|
};
|
|
4187
4467
|
|
|
4188
4468
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4189
|
-
import { Fragment as
|
|
4469
|
+
import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4190
4470
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4191
4471
|
var isGroupedDecision = (options) => {
|
|
4192
4472
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
4193
4473
|
};
|
|
4194
4474
|
var GroupedDecisionList = (_a) => {
|
|
4195
4475
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4196
|
-
const { formatMessage } =
|
|
4476
|
+
const { formatMessage } = useIntl10();
|
|
4197
4477
|
const { options } = rest;
|
|
4198
4478
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
4199
|
-
return /* @__PURE__ */
|
|
4200
|
-
/* @__PURE__ */
|
|
4479
|
+
return /* @__PURE__ */ jsx53(Fragment5, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs12(Section2, { children: [
|
|
4480
|
+
/* @__PURE__ */ jsx53(
|
|
4201
4481
|
Header2,
|
|
4202
4482
|
{
|
|
4203
4483
|
as: "h2",
|
|
@@ -4209,27 +4489,27 @@ var GroupedDecisionList = (_a) => {
|
|
|
4209
4489
|
};
|
|
4210
4490
|
|
|
4211
4491
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4212
|
-
var
|
|
4213
|
-
import { Fragment as
|
|
4492
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4493
|
+
import { Fragment as Fragment6, jsx as jsx54, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4214
4494
|
var DecisionWrapper = (props) => {
|
|
4215
4495
|
const { margin, control, title, tags } = props;
|
|
4216
|
-
return /* @__PURE__ */
|
|
4217
|
-
title && /* @__PURE__ */
|
|
4218
|
-
control === "filtered" ? /* @__PURE__ */
|
|
4496
|
+
return /* @__PURE__ */ jsxs13("div", { className: (0, import_classnames14.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4497
|
+
title && /* @__PURE__ */ jsx54(Header3, { as: "h2", title }),
|
|
4498
|
+
control === "filtered" ? /* @__PURE__ */ jsx54(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx54(UnfilteredDecisionList, __spreadValues({}, props))
|
|
4219
4499
|
] });
|
|
4220
4500
|
};
|
|
4221
4501
|
var UnfilteredDecisionList = (_a) => {
|
|
4222
4502
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4223
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
4503
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx54(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
4224
4504
|
};
|
|
4225
4505
|
var FilteredDecisionList = (props) => {
|
|
4226
|
-
const { formatMessage } =
|
|
4227
|
-
const [query, setQuery] =
|
|
4506
|
+
const { formatMessage } = useIntl11();
|
|
4507
|
+
const [query, setQuery] = useState13("");
|
|
4228
4508
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
4229
4509
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
4230
4510
|
const isGrouped = isGroupedDecision(options);
|
|
4231
|
-
return /* @__PURE__ */
|
|
4232
|
-
/* @__PURE__ */
|
|
4511
|
+
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
4512
|
+
/* @__PURE__ */ jsx54(
|
|
4233
4513
|
SearchInput,
|
|
4234
4514
|
{
|
|
4235
4515
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -4241,25 +4521,25 @@ var FilteredDecisionList = (props) => {
|
|
|
4241
4521
|
}
|
|
4242
4522
|
}
|
|
4243
4523
|
),
|
|
4244
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
4245
|
-
query.length > 0 && /* @__PURE__ */
|
|
4524
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx54(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
4525
|
+
query.length > 0 && /* @__PURE__ */ jsx54(Header3, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
4246
4526
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
4247
4527
|
control,
|
|
4248
4528
|
className: query.length === 0 ? "m-t-3" : "",
|
|
4249
4529
|
options: filteredOptions
|
|
4250
|
-
}) : /* @__PURE__ */
|
|
4530
|
+
}) : /* @__PURE__ */ jsx54("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
4251
4531
|
] })
|
|
4252
4532
|
] });
|
|
4253
4533
|
};
|
|
4254
4534
|
|
|
4255
4535
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4256
|
-
import { Fragment as
|
|
4536
|
+
import { Fragment as Fragment7, jsx as jsx55 } from "react/jsx-runtime";
|
|
4257
4537
|
var DecisionRenderer = {
|
|
4258
4538
|
canRenderType: "decision",
|
|
4259
|
-
render: (props) => /* @__PURE__ */
|
|
4539
|
+
render: (props) => /* @__PURE__ */ jsx55(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
4260
4540
|
};
|
|
4261
4541
|
var renderDecisionList = ({ options, control }) => {
|
|
4262
|
-
return /* @__PURE__ */
|
|
4542
|
+
return /* @__PURE__ */ jsx55(Fragment7, { children: options.map((_a) => {
|
|
4263
4543
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
4264
4544
|
const {
|
|
4265
4545
|
description,
|
|
@@ -4272,7 +4552,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4272
4552
|
supportingValues,
|
|
4273
4553
|
tags
|
|
4274
4554
|
} = rest;
|
|
4275
|
-
return /* @__PURE__ */
|
|
4555
|
+
return /* @__PURE__ */ jsx55(
|
|
4276
4556
|
ListItem7,
|
|
4277
4557
|
{
|
|
4278
4558
|
title: itemTitle,
|
|
@@ -4284,7 +4564,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4284
4564
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
4285
4565
|
prompt: getInlineAlert(inlineAlert),
|
|
4286
4566
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
4287
|
-
control: /* @__PURE__ */
|
|
4567
|
+
control: /* @__PURE__ */ jsx55(ListItem7.Navigation, __spreadValues({}, getAnchorProps()))
|
|
4288
4568
|
},
|
|
4289
4569
|
JSON.stringify(rest)
|
|
4290
4570
|
);
|
|
@@ -4293,9 +4573,9 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4293
4573
|
var DecisionRenderer_default = DecisionRenderer;
|
|
4294
4574
|
|
|
4295
4575
|
// ../renderers/src/DividerRenderer.tsx
|
|
4296
|
-
var
|
|
4297
|
-
import { Divider } from "@transferwise/components";
|
|
4298
|
-
import { jsx as
|
|
4576
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4577
|
+
import { Divider as Divider2 } from "@transferwise/components";
|
|
4578
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4299
4579
|
var mapControlToLevel = (control) => {
|
|
4300
4580
|
switch (control) {
|
|
4301
4581
|
case "section":
|
|
@@ -4308,10 +4588,10 @@ var mapControlToLevel = (control) => {
|
|
|
4308
4588
|
};
|
|
4309
4589
|
var DividerRenderer = {
|
|
4310
4590
|
canRenderType: "divider",
|
|
4311
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */
|
|
4312
|
-
|
|
4591
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ jsx56(
|
|
4592
|
+
Divider2,
|
|
4313
4593
|
{
|
|
4314
|
-
className: (0,
|
|
4594
|
+
className: (0, import_classnames15.default)(
|
|
4315
4595
|
"m-t-0",
|
|
4316
4596
|
"d-block",
|
|
4317
4597
|
getMargin(margin),
|
|
@@ -4324,7 +4604,7 @@ var DividerRenderer = {
|
|
|
4324
4604
|
var DividerRenderer_default = DividerRenderer;
|
|
4325
4605
|
|
|
4326
4606
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4327
|
-
import { Button as
|
|
4607
|
+
import { Button as Button6, Markdown as Markdown3, Modal } from "@transferwise/components";
|
|
4328
4608
|
|
|
4329
4609
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
4330
4610
|
import { defineMessages as defineMessages9 } from "react-intl";
|
|
@@ -4352,9 +4632,9 @@ var external_confirmation_messages_default = defineMessages9({
|
|
|
4352
4632
|
});
|
|
4353
4633
|
|
|
4354
4634
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4355
|
-
import { useIntl as
|
|
4635
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
4356
4636
|
import { useEffect as useEffect9 } from "react";
|
|
4357
|
-
import { Fragment as
|
|
4637
|
+
import { Fragment as Fragment8, jsx as jsx57, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4358
4638
|
var ExternalConfirmationRenderer = {
|
|
4359
4639
|
canRenderType: "external-confirmation",
|
|
4360
4640
|
render: ExternalConfirmationRendererComponent
|
|
@@ -4367,20 +4647,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
4367
4647
|
control,
|
|
4368
4648
|
tags
|
|
4369
4649
|
}) {
|
|
4370
|
-
const { formatMessage } =
|
|
4650
|
+
const { formatMessage } = useIntl12();
|
|
4371
4651
|
useEffect9(() => {
|
|
4372
4652
|
open();
|
|
4373
4653
|
}, []);
|
|
4374
|
-
return /* @__PURE__ */
|
|
4654
|
+
return /* @__PURE__ */ jsx57(
|
|
4375
4655
|
Modal,
|
|
4376
4656
|
{
|
|
4377
4657
|
open: visible,
|
|
4378
4658
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
4379
|
-
body: /* @__PURE__ */
|
|
4380
|
-
/* @__PURE__ */
|
|
4381
|
-
/* @__PURE__ */
|
|
4382
|
-
/* @__PURE__ */
|
|
4383
|
-
|
|
4659
|
+
body: /* @__PURE__ */ jsxs14(Fragment8, { children: [
|
|
4660
|
+
/* @__PURE__ */ jsx57(Markdown3, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
4661
|
+
/* @__PURE__ */ jsx57("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs14("div", { className: "df-box-renderer-width-lg", children: [
|
|
4662
|
+
/* @__PURE__ */ jsx57(
|
|
4663
|
+
Button6,
|
|
4384
4664
|
{
|
|
4385
4665
|
v2: true,
|
|
4386
4666
|
block: true,
|
|
@@ -4393,7 +4673,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
4393
4673
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
4394
4674
|
}
|
|
4395
4675
|
),
|
|
4396
|
-
/* @__PURE__ */
|
|
4676
|
+
/* @__PURE__ */ jsx57(Button6, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
4397
4677
|
] }) })
|
|
4398
4678
|
] }),
|
|
4399
4679
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -4411,51 +4691,51 @@ function getOrigin(url) {
|
|
|
4411
4691
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
4412
4692
|
|
|
4413
4693
|
// ../renderers/src/FormRenderer.tsx
|
|
4414
|
-
var
|
|
4415
|
-
import { jsx as
|
|
4694
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4695
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4416
4696
|
var FormRenderer = {
|
|
4417
4697
|
canRenderType: "form",
|
|
4418
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */
|
|
4698
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ jsx58("div", { className: (0, import_classnames16.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
4419
4699
|
};
|
|
4420
4700
|
var FormRenderer_default = FormRenderer;
|
|
4421
4701
|
|
|
4422
4702
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
4423
4703
|
import { Header as Header4 } from "@transferwise/components";
|
|
4424
|
-
import { jsx as
|
|
4704
|
+
import { jsx as jsx59, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4425
4705
|
var FormSectionRenderer = {
|
|
4426
4706
|
canRenderType: "form-section",
|
|
4427
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */
|
|
4428
|
-
title && /* @__PURE__ */
|
|
4707
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ jsxs15("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4708
|
+
title && /* @__PURE__ */ jsx59(
|
|
4429
4709
|
Header4,
|
|
4430
4710
|
{
|
|
4431
4711
|
as: "h2",
|
|
4432
4712
|
title
|
|
4433
4713
|
}
|
|
4434
4714
|
),
|
|
4435
|
-
description && /* @__PURE__ */
|
|
4715
|
+
description && /* @__PURE__ */ jsx59("p", { children: description }),
|
|
4436
4716
|
children
|
|
4437
4717
|
] })
|
|
4438
4718
|
};
|
|
4439
4719
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
4440
4720
|
|
|
4441
4721
|
// ../renderers/src/HeadingRenderer.tsx
|
|
4442
|
-
var
|
|
4722
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
4443
4723
|
import { Display, Title } from "@transferwise/components";
|
|
4444
|
-
import { jsx as
|
|
4724
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
4445
4725
|
var HeadingRenderer = {
|
|
4446
4726
|
canRenderType: "heading",
|
|
4447
4727
|
render: Heading
|
|
4448
4728
|
};
|
|
4449
4729
|
function Heading(props) {
|
|
4450
4730
|
const { text, size, align, margin, control } = props;
|
|
4451
|
-
const className = (0,
|
|
4731
|
+
const className = (0, import_classnames17.default)(
|
|
4452
4732
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4453
4733
|
controlAndTagsToCSSClass(props)
|
|
4454
4734
|
);
|
|
4455
|
-
return control === "display" ? /* @__PURE__ */
|
|
4735
|
+
return control === "display" ? /* @__PURE__ */ jsx60(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx60(StandardHeading, { size, text, className });
|
|
4456
4736
|
}
|
|
4457
4737
|
function DisplayHeading({ size, text, className }) {
|
|
4458
|
-
return /* @__PURE__ */
|
|
4738
|
+
return /* @__PURE__ */ jsx60(Display, { type: getDisplayType(size), className, children: text });
|
|
4459
4739
|
}
|
|
4460
4740
|
var getDisplayType = (size) => {
|
|
4461
4741
|
switch (size) {
|
|
@@ -4471,7 +4751,7 @@ var getDisplayType = (size) => {
|
|
|
4471
4751
|
}
|
|
4472
4752
|
};
|
|
4473
4753
|
function StandardHeading({ size, text, className }) {
|
|
4474
|
-
return /* @__PURE__ */
|
|
4754
|
+
return /* @__PURE__ */ jsx60(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
4475
4755
|
}
|
|
4476
4756
|
var getTitleTypeBySize = (size) => {
|
|
4477
4757
|
var _a;
|
|
@@ -4487,9 +4767,9 @@ var getTitleTypeBySize = (size) => {
|
|
|
4487
4767
|
var HeadingRenderer_default = HeadingRenderer;
|
|
4488
4768
|
|
|
4489
4769
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4490
|
-
var
|
|
4770
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4491
4771
|
import { Image } from "@transferwise/components";
|
|
4492
|
-
import { useEffect as useEffect10, useState as
|
|
4772
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
4493
4773
|
|
|
4494
4774
|
// ../renderers/src/utils/api-utils.ts
|
|
4495
4775
|
function isRelativePath(url = "") {
|
|
@@ -4499,7 +4779,7 @@ function isRelativePath(url = "") {
|
|
|
4499
4779
|
}
|
|
4500
4780
|
|
|
4501
4781
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4502
|
-
import { jsx as
|
|
4782
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4503
4783
|
function UrlImage({
|
|
4504
4784
|
accessibilityDescription,
|
|
4505
4785
|
align,
|
|
@@ -4510,23 +4790,23 @@ function UrlImage({
|
|
|
4510
4790
|
uri,
|
|
4511
4791
|
httpClient
|
|
4512
4792
|
}) {
|
|
4513
|
-
const [imageSource, setImageSource] =
|
|
4793
|
+
const [imageSource, setImageSource] = useState14("");
|
|
4514
4794
|
useEffect10(() => {
|
|
4515
4795
|
if (!uri.startsWith("urn:")) {
|
|
4516
4796
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
4517
4797
|
}
|
|
4518
4798
|
}, [uri, httpClient]);
|
|
4519
|
-
return /* @__PURE__ */
|
|
4799
|
+
return /* @__PURE__ */ jsx61(
|
|
4520
4800
|
"div",
|
|
4521
4801
|
{
|
|
4522
|
-
className: (0,
|
|
4802
|
+
className: (0, import_classnames18.default)(
|
|
4523
4803
|
"df-image",
|
|
4524
4804
|
align,
|
|
4525
4805
|
size || "md",
|
|
4526
4806
|
getMargin(margin),
|
|
4527
4807
|
controlAndTagsToCSSClass({ control, tags })
|
|
4528
4808
|
),
|
|
4529
|
-
children: /* @__PURE__ */
|
|
4809
|
+
children: /* @__PURE__ */ jsx61(
|
|
4530
4810
|
Image,
|
|
4531
4811
|
{
|
|
4532
4812
|
className: "df-reserve-space",
|
|
@@ -4572,19 +4852,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4572
4852
|
};
|
|
4573
4853
|
|
|
4574
4854
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
4575
|
-
import { jsx as
|
|
4855
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4576
4856
|
var ImageRenderer = {
|
|
4577
4857
|
canRenderType: "image",
|
|
4578
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
4858
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx62(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx62(UrlImage, __spreadValues({}, props))
|
|
4579
4859
|
};
|
|
4580
4860
|
|
|
4581
4861
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
4582
4862
|
var ImageRenderer_default = ImageRenderer;
|
|
4583
4863
|
|
|
4584
4864
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
4585
|
-
var
|
|
4865
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4586
4866
|
import { Header as Header5, InstructionsList } from "@transferwise/components";
|
|
4587
|
-
import { jsx as
|
|
4867
|
+
import { jsx as jsx63, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4588
4868
|
var doContext = ["positive", "neutral", "proposition"];
|
|
4589
4869
|
var dontContext = ["warning", "negative"];
|
|
4590
4870
|
var InstructionsRenderer = {
|
|
@@ -4592,16 +4872,16 @@ var InstructionsRenderer = {
|
|
|
4592
4872
|
render: ({ items, margin, title, control, tags }) => {
|
|
4593
4873
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
4594
4874
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
4595
|
-
return /* @__PURE__ */
|
|
4596
|
-
title ? /* @__PURE__ */
|
|
4597
|
-
/* @__PURE__ */
|
|
4875
|
+
return /* @__PURE__ */ jsxs16("div", { className: (0, import_classnames19.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4876
|
+
title ? /* @__PURE__ */ jsx63(Header5, { title }) : null,
|
|
4877
|
+
/* @__PURE__ */ jsx63(InstructionsList, { dos, donts })
|
|
4598
4878
|
] });
|
|
4599
4879
|
}
|
|
4600
4880
|
};
|
|
4601
4881
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
4602
4882
|
|
|
4603
4883
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4604
|
-
import { Input as
|
|
4884
|
+
import { Input as Input3, InputGroup as InputGroup3 } from "@transferwise/components";
|
|
4605
4885
|
|
|
4606
4886
|
// ../renderers/src/utils/input-utils.ts
|
|
4607
4887
|
var onWheel = (event) => {
|
|
@@ -4626,7 +4906,7 @@ function pick(obj, ...keys) {
|
|
|
4626
4906
|
}
|
|
4627
4907
|
|
|
4628
4908
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4629
|
-
import { jsx as
|
|
4909
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4630
4910
|
var IntegerInputRenderer = {
|
|
4631
4911
|
canRenderType: "input-integer",
|
|
4632
4912
|
render: (props) => {
|
|
@@ -4641,7 +4921,7 @@ var IntegerInputRenderer = {
|
|
|
4641
4921
|
"maximum",
|
|
4642
4922
|
"minimum"
|
|
4643
4923
|
);
|
|
4644
|
-
return /* @__PURE__ */
|
|
4924
|
+
return /* @__PURE__ */ jsx64(
|
|
4645
4925
|
FieldInput_default,
|
|
4646
4926
|
{
|
|
4647
4927
|
id,
|
|
@@ -4654,8 +4934,8 @@ var IntegerInputRenderer = {
|
|
|
4654
4934
|
features: props.features,
|
|
4655
4935
|
control: props.control,
|
|
4656
4936
|
tags: props.tags,
|
|
4657
|
-
children: /* @__PURE__ */
|
|
4658
|
-
|
|
4937
|
+
children: /* @__PURE__ */ jsx64(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx64(
|
|
4938
|
+
Input3,
|
|
4659
4939
|
__spreadValues({
|
|
4660
4940
|
id,
|
|
4661
4941
|
name: id,
|
|
@@ -4677,13 +4957,13 @@ var IntegerInputRenderer = {
|
|
|
4677
4957
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
4678
4958
|
|
|
4679
4959
|
// ../renderers/src/ListRenderer.tsx
|
|
4680
|
-
var
|
|
4960
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4681
4961
|
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
4682
4962
|
|
|
4683
4963
|
// ../renderers/src/components/Header.tsx
|
|
4684
4964
|
import { Header as DSHeader } from "@transferwise/components";
|
|
4685
|
-
import { jsx as
|
|
4686
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */
|
|
4965
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
4966
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx65(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
4687
4967
|
var getHeaderAction = (callToAction) => {
|
|
4688
4968
|
if (!callToAction) {
|
|
4689
4969
|
return void 0;
|
|
@@ -4695,11 +4975,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
4695
4975
|
};
|
|
4696
4976
|
|
|
4697
4977
|
// ../renderers/src/ListRenderer.tsx
|
|
4698
|
-
import { jsx as
|
|
4978
|
+
import { jsx as jsx66, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4699
4979
|
var ListRenderer = {
|
|
4700
4980
|
canRenderType: "list",
|
|
4701
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
4702
|
-
/* @__PURE__ */
|
|
4981
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs17("div", { className: (0, import_classnames20.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4982
|
+
/* @__PURE__ */ jsx66(Header, { title, callToAction }),
|
|
4703
4983
|
items.map((item) => {
|
|
4704
4984
|
var _a, _b;
|
|
4705
4985
|
const {
|
|
@@ -4716,7 +4996,7 @@ var ListRenderer = {
|
|
|
4716
4996
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4717
4997
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4718
4998
|
};
|
|
4719
|
-
return /* @__PURE__ */
|
|
4999
|
+
return /* @__PURE__ */ jsx66(
|
|
4720
5000
|
ListItem8,
|
|
4721
5001
|
{
|
|
4722
5002
|
title: itemTitle,
|
|
@@ -4736,17 +5016,17 @@ var ListRenderer = {
|
|
|
4736
5016
|
var ListRenderer_default = ListRenderer;
|
|
4737
5017
|
|
|
4738
5018
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
4739
|
-
var
|
|
5019
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
4740
5020
|
import { Loader } from "@transferwise/components";
|
|
4741
|
-
import { jsx as
|
|
5021
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4742
5022
|
var LoadingIndicatorRenderer = {
|
|
4743
5023
|
canRenderType: "loading-indicator",
|
|
4744
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */
|
|
5024
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ jsx67(
|
|
4745
5025
|
Loader,
|
|
4746
5026
|
{
|
|
4747
5027
|
size,
|
|
4748
5028
|
classNames: {
|
|
4749
|
-
"tw-loader": (0,
|
|
5029
|
+
"tw-loader": (0, import_classnames21.default)(
|
|
4750
5030
|
"tw-loader",
|
|
4751
5031
|
"m-x-auto",
|
|
4752
5032
|
getMargin(margin),
|
|
@@ -4760,24 +5040,24 @@ var LoadingIndicatorRenderer = {
|
|
|
4760
5040
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
4761
5041
|
|
|
4762
5042
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
4763
|
-
var
|
|
5043
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
4764
5044
|
import { Markdown as Markdown4 } from "@transferwise/components";
|
|
4765
|
-
import { jsx as
|
|
5045
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4766
5046
|
var MarkdownRenderer = {
|
|
4767
5047
|
canRenderType: "markdown",
|
|
4768
5048
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
4769
5049
|
const isLarge = !["xs", "sm"].includes(size);
|
|
4770
|
-
return /* @__PURE__ */
|
|
5050
|
+
return /* @__PURE__ */ jsx68(
|
|
4771
5051
|
"div",
|
|
4772
5052
|
{
|
|
4773
|
-
className: (0,
|
|
5053
|
+
className: (0, import_classnames22.default)(
|
|
4774
5054
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4775
5055
|
controlAndTagsToCSSClass({ control, tags })
|
|
4776
5056
|
),
|
|
4777
|
-
children: /* @__PURE__ */
|
|
5057
|
+
children: /* @__PURE__ */ jsx68(
|
|
4778
5058
|
Markdown4,
|
|
4779
5059
|
{
|
|
4780
|
-
className: (0,
|
|
5060
|
+
className: (0, import_classnames22.default)("df-markdown", {
|
|
4781
5061
|
"np-text-body-large": isLarge,
|
|
4782
5062
|
"np-text-body-default": !isLarge
|
|
4783
5063
|
}),
|
|
@@ -4792,17 +5072,17 @@ var MarkdownRenderer = {
|
|
|
4792
5072
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
4793
5073
|
|
|
4794
5074
|
// ../renderers/src/MediaRenderer.tsx
|
|
4795
|
-
var
|
|
4796
|
-
import { jsx as
|
|
5075
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
5076
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
4797
5077
|
var MediaRenderer = {
|
|
4798
5078
|
canRenderType: "media",
|
|
4799
5079
|
render: (_a) => {
|
|
4800
5080
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
4801
5081
|
switch (media.type) {
|
|
4802
5082
|
case "avatar":
|
|
4803
|
-
return /* @__PURE__ */
|
|
5083
|
+
return /* @__PURE__ */ jsx69(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4804
5084
|
case "image":
|
|
4805
|
-
return /* @__PURE__ */
|
|
5085
|
+
return /* @__PURE__ */ jsx69(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4806
5086
|
case "legacy":
|
|
4807
5087
|
return null;
|
|
4808
5088
|
}
|
|
@@ -4816,16 +5096,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
4816
5096
|
control,
|
|
4817
5097
|
tags
|
|
4818
5098
|
}) => {
|
|
4819
|
-
return /* @__PURE__ */
|
|
5099
|
+
return /* @__PURE__ */ jsx69(
|
|
4820
5100
|
"div",
|
|
4821
5101
|
{
|
|
4822
|
-
className: (0,
|
|
5102
|
+
className: (0, import_classnames23.default)(
|
|
4823
5103
|
"df-media-layout-avatar",
|
|
4824
5104
|
align,
|
|
4825
5105
|
getMargin(margin),
|
|
4826
5106
|
controlAndTagsToCSSClass({ control, tags })
|
|
4827
5107
|
),
|
|
4828
|
-
children: /* @__PURE__ */
|
|
5108
|
+
children: /* @__PURE__ */ jsx69(Media, { media, size: mapAvatarMediaSize(size) })
|
|
4829
5109
|
}
|
|
4830
5110
|
);
|
|
4831
5111
|
};
|
|
@@ -4838,14 +5118,14 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
4838
5118
|
"size"
|
|
4839
5119
|
]);
|
|
4840
5120
|
var _a2, _b2;
|
|
4841
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
5121
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx69(
|
|
4842
5122
|
UrnImage,
|
|
4843
5123
|
__spreadValues({
|
|
4844
5124
|
uri: media.uri,
|
|
4845
5125
|
size: (_a2 = media.size) != null ? _a2 : size,
|
|
4846
5126
|
accessibilityDescription: media.accessibilityDescription
|
|
4847
5127
|
}, rest)
|
|
4848
|
-
) : /* @__PURE__ */
|
|
5128
|
+
) : /* @__PURE__ */ jsx69(
|
|
4849
5129
|
UrlImage,
|
|
4850
5130
|
__spreadValues({
|
|
4851
5131
|
uri: media.uri,
|
|
@@ -4870,21 +5150,21 @@ var mapAvatarMediaSize = (size) => {
|
|
|
4870
5150
|
};
|
|
4871
5151
|
|
|
4872
5152
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
4873
|
-
var
|
|
4874
|
-
import { Button as
|
|
4875
|
-
import { useState as
|
|
4876
|
-
import { jsx as
|
|
5153
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5154
|
+
import { Button as Button7, Modal as Modal2 } from "@transferwise/components";
|
|
5155
|
+
import { useState as useState15 } from "react";
|
|
5156
|
+
import { jsx as jsx70, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4877
5157
|
var ModalLayoutRenderer = {
|
|
4878
5158
|
canRenderType: "modal-layout",
|
|
4879
|
-
render: (props) => /* @__PURE__ */
|
|
5159
|
+
render: (props) => /* @__PURE__ */ jsx70(DFModal, __spreadValues({}, props))
|
|
4880
5160
|
};
|
|
4881
5161
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
4882
5162
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
4883
|
-
const [visible, setVisible] =
|
|
5163
|
+
const [visible, setVisible] = useState15(false);
|
|
4884
5164
|
const { children, title } = content;
|
|
4885
|
-
return /* @__PURE__ */
|
|
4886
|
-
/* @__PURE__ */
|
|
4887
|
-
/* @__PURE__ */
|
|
5165
|
+
return /* @__PURE__ */ jsxs18("div", { className: (0, import_classnames24.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5166
|
+
/* @__PURE__ */ jsx70(Button7, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
5167
|
+
/* @__PURE__ */ jsx70(
|
|
4888
5168
|
Modal2,
|
|
4889
5169
|
{
|
|
4890
5170
|
scroll: "content",
|
|
@@ -4900,11 +5180,11 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
4900
5180
|
|
|
4901
5181
|
// ../renderers/src/ModalRenderer.tsx
|
|
4902
5182
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
4903
|
-
import { jsx as
|
|
5183
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
4904
5184
|
var ModalRenderer = {
|
|
4905
5185
|
canRenderType: "modal",
|
|
4906
5186
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
4907
|
-
return /* @__PURE__ */
|
|
5187
|
+
return /* @__PURE__ */ jsx71(
|
|
4908
5188
|
Modal3,
|
|
4909
5189
|
{
|
|
4910
5190
|
open,
|
|
@@ -4920,8 +5200,8 @@ var ModalRenderer = {
|
|
|
4920
5200
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
4921
5201
|
import { MoneyInput } from "@transferwise/components";
|
|
4922
5202
|
import { useEffect as useEffect11 } from "react";
|
|
4923
|
-
import { useIntl as
|
|
4924
|
-
import { jsx as
|
|
5203
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
5204
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
4925
5205
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4926
5206
|
var MoneyInputRenderer = {
|
|
4927
5207
|
canRenderType: "money-input",
|
|
@@ -4950,8 +5230,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
4950
5230
|
onCurrencyChange(0);
|
|
4951
5231
|
}
|
|
4952
5232
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
4953
|
-
const { formatMessage } =
|
|
4954
|
-
return /* @__PURE__ */
|
|
5233
|
+
const { formatMessage } = useIntl13();
|
|
5234
|
+
return /* @__PURE__ */ jsx72(
|
|
4955
5235
|
FieldInput_default,
|
|
4956
5236
|
{
|
|
4957
5237
|
id: uid,
|
|
@@ -4962,7 +5242,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
4962
5242
|
features,
|
|
4963
5243
|
control,
|
|
4964
5244
|
tags,
|
|
4965
|
-
children: /* @__PURE__ */
|
|
5245
|
+
children: /* @__PURE__ */ jsx72(
|
|
4966
5246
|
MoneyInput,
|
|
4967
5247
|
{
|
|
4968
5248
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -5025,8 +5305,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
5025
5305
|
|
|
5026
5306
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
5027
5307
|
import { ListItem as ListItem9, SearchInput as SearchInput2 } from "@transferwise/components";
|
|
5028
|
-
import { useState as
|
|
5029
|
-
import { useIntl as
|
|
5308
|
+
import { useState as useState16 } from "react";
|
|
5309
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
5030
5310
|
|
|
5031
5311
|
// ../renderers/src/utils/items-with-index.ts
|
|
5032
5312
|
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -5034,7 +5314,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
5034
5314
|
}));
|
|
5035
5315
|
|
|
5036
5316
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
5037
|
-
import { Fragment as
|
|
5317
|
+
import { Fragment as Fragment9, jsx as jsx73, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5038
5318
|
function InlineComponent(props) {
|
|
5039
5319
|
const {
|
|
5040
5320
|
id,
|
|
@@ -5051,12 +5331,12 @@ function InlineComponent(props) {
|
|
|
5051
5331
|
onSelect
|
|
5052
5332
|
} = props;
|
|
5053
5333
|
const optionsWithIndex = zipWithIndex(options);
|
|
5054
|
-
const [query, setQuery] =
|
|
5055
|
-
const { formatMessage } =
|
|
5334
|
+
const [query, setQuery] = useState16("");
|
|
5335
|
+
const { formatMessage } = useIntl14();
|
|
5056
5336
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
5057
5337
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
5058
|
-
return /* @__PURE__ */
|
|
5059
|
-
filtered && /* @__PURE__ */
|
|
5338
|
+
return /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
5339
|
+
filtered && /* @__PURE__ */ jsx73(
|
|
5060
5340
|
SearchInput2,
|
|
5061
5341
|
{
|
|
5062
5342
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -5069,7 +5349,7 @@ function InlineComponent(props) {
|
|
|
5069
5349
|
}
|
|
5070
5350
|
}
|
|
5071
5351
|
),
|
|
5072
|
-
/* @__PURE__ */
|
|
5352
|
+
/* @__PURE__ */ jsx73(
|
|
5073
5353
|
FieldInput_default,
|
|
5074
5354
|
{
|
|
5075
5355
|
id,
|
|
@@ -5094,7 +5374,7 @@ function InlineComponent(props) {
|
|
|
5094
5374
|
childrenProps
|
|
5095
5375
|
} = option;
|
|
5096
5376
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
5097
|
-
return /* @__PURE__ */
|
|
5377
|
+
return /* @__PURE__ */ jsx73(
|
|
5098
5378
|
ListItem9,
|
|
5099
5379
|
{
|
|
5100
5380
|
title: itemTitle,
|
|
@@ -5103,9 +5383,9 @@ function InlineComponent(props) {
|
|
|
5103
5383
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
5104
5384
|
media: getMedia(media, false),
|
|
5105
5385
|
prompt: getInlineAlert(inlineAlert),
|
|
5106
|
-
additionalInfo: additionalText ? /* @__PURE__ */
|
|
5386
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx73(ListItem9.AdditionalInfo, { children: additionalText }) : void 0,
|
|
5107
5387
|
disabled: disabled || optionDisabled,
|
|
5108
|
-
control: /* @__PURE__ */
|
|
5388
|
+
control: /* @__PURE__ */ jsx73(
|
|
5109
5389
|
ListItem9.Checkbox,
|
|
5110
5390
|
{
|
|
5111
5391
|
checked: selectedIndices.includes(index),
|
|
@@ -5126,8 +5406,8 @@ function InlineComponent(props) {
|
|
|
5126
5406
|
|
|
5127
5407
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5128
5408
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
5129
|
-
import { useState as
|
|
5130
|
-
import { useIntl as
|
|
5409
|
+
import { useState as useState17 } from "react";
|
|
5410
|
+
import { useIntl as useIntl15 } from "react-intl";
|
|
5131
5411
|
|
|
5132
5412
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
5133
5413
|
import { defineMessages as defineMessages10 } from "react-intl";
|
|
@@ -5140,10 +5420,10 @@ var multi_select_messages_default = defineMessages10({
|
|
|
5140
5420
|
});
|
|
5141
5421
|
|
|
5142
5422
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5143
|
-
import { jsx as
|
|
5423
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
5144
5424
|
function DefaultComponent(props) {
|
|
5145
|
-
const { formatMessage } =
|
|
5146
|
-
const [stagedIndices, setStagedIndices] =
|
|
5425
|
+
const { formatMessage } = useIntl15();
|
|
5426
|
+
const [stagedIndices, setStagedIndices] = useState17();
|
|
5147
5427
|
const {
|
|
5148
5428
|
id,
|
|
5149
5429
|
autoComplete,
|
|
@@ -5184,12 +5464,12 @@ function DefaultComponent(props) {
|
|
|
5184
5464
|
const contentProps = {
|
|
5185
5465
|
title: option.title,
|
|
5186
5466
|
description: option.description,
|
|
5187
|
-
icon: /* @__PURE__ */
|
|
5467
|
+
icon: /* @__PURE__ */ jsx74(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5188
5468
|
};
|
|
5189
|
-
return /* @__PURE__ */
|
|
5469
|
+
return /* @__PURE__ */ jsx74(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
5190
5470
|
};
|
|
5191
5471
|
const extraProps = { autoComplete };
|
|
5192
|
-
return /* @__PURE__ */
|
|
5472
|
+
return /* @__PURE__ */ jsx74(
|
|
5193
5473
|
FieldInput_default,
|
|
5194
5474
|
{
|
|
5195
5475
|
id,
|
|
@@ -5200,7 +5480,7 @@ function DefaultComponent(props) {
|
|
|
5200
5480
|
features,
|
|
5201
5481
|
control,
|
|
5202
5482
|
tags,
|
|
5203
|
-
children: /* @__PURE__ */
|
|
5483
|
+
children: /* @__PURE__ */ jsx74(
|
|
5204
5484
|
SelectInput,
|
|
5205
5485
|
__spreadValues({
|
|
5206
5486
|
id,
|
|
@@ -5240,7 +5520,7 @@ function DefaultComponent(props) {
|
|
|
5240
5520
|
|
|
5241
5521
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
5242
5522
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
5243
|
-
import { jsx as
|
|
5523
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
5244
5524
|
function InlineCheckboxComponent(props) {
|
|
5245
5525
|
const {
|
|
5246
5526
|
id,
|
|
@@ -5256,7 +5536,7 @@ function InlineCheckboxComponent(props) {
|
|
|
5256
5536
|
tags,
|
|
5257
5537
|
onSelect
|
|
5258
5538
|
} = props;
|
|
5259
|
-
return /* @__PURE__ */
|
|
5539
|
+
return /* @__PURE__ */ jsx75(
|
|
5260
5540
|
FieldInput_default,
|
|
5261
5541
|
{
|
|
5262
5542
|
id,
|
|
@@ -5287,24 +5567,24 @@ function InlineCheckboxComponent(props) {
|
|
|
5287
5567
|
onSelect(newSelectedIndices);
|
|
5288
5568
|
}
|
|
5289
5569
|
};
|
|
5290
|
-
return /* @__PURE__ */
|
|
5570
|
+
return /* @__PURE__ */ jsx75(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
5291
5571
|
})
|
|
5292
5572
|
}
|
|
5293
5573
|
);
|
|
5294
5574
|
}
|
|
5295
5575
|
|
|
5296
5576
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
5297
|
-
import { jsx as
|
|
5577
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
5298
5578
|
var MultiSelectInputRenderer = {
|
|
5299
5579
|
canRenderType: "input-multi-select",
|
|
5300
5580
|
render: (props) => {
|
|
5301
5581
|
switch (props.control) {
|
|
5302
5582
|
case "inline":
|
|
5303
|
-
return /* @__PURE__ */
|
|
5583
|
+
return /* @__PURE__ */ jsx76(InlineComponent, __spreadValues({}, props));
|
|
5304
5584
|
case "inline-checkbox-group":
|
|
5305
|
-
return /* @__PURE__ */
|
|
5585
|
+
return /* @__PURE__ */ jsx76(InlineCheckboxComponent, __spreadValues({}, props));
|
|
5306
5586
|
default:
|
|
5307
|
-
return /* @__PURE__ */
|
|
5587
|
+
return /* @__PURE__ */ jsx76(DefaultComponent, __spreadValues({}, props));
|
|
5308
5588
|
}
|
|
5309
5589
|
}
|
|
5310
5590
|
};
|
|
@@ -5314,8 +5594,8 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
5314
5594
|
|
|
5315
5595
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
5316
5596
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
5317
|
-
var
|
|
5318
|
-
import { jsx as
|
|
5597
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5598
|
+
import { jsx as jsx77, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5319
5599
|
function UploadFieldInput({
|
|
5320
5600
|
id,
|
|
5321
5601
|
children,
|
|
@@ -5327,14 +5607,14 @@ function UploadFieldInput({
|
|
|
5327
5607
|
control,
|
|
5328
5608
|
tags
|
|
5329
5609
|
}) {
|
|
5330
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
5610
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx77(LabelContentWithHelp, { text: label, help }) : label;
|
|
5331
5611
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5332
5612
|
const { ref } = useScrollToError(validation, features);
|
|
5333
|
-
return /* @__PURE__ */
|
|
5613
|
+
return /* @__PURE__ */ jsxs20(
|
|
5334
5614
|
"div",
|
|
5335
5615
|
{
|
|
5336
5616
|
ref,
|
|
5337
|
-
className: (0,
|
|
5617
|
+
className: (0, import_classnames25.default)(
|
|
5338
5618
|
"form-group d-block",
|
|
5339
5619
|
{
|
|
5340
5620
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -5342,9 +5622,9 @@ function UploadFieldInput({
|
|
|
5342
5622
|
controlAndTagsToCSSClass({ control, tags })
|
|
5343
5623
|
),
|
|
5344
5624
|
children: [
|
|
5345
|
-
/* @__PURE__ */
|
|
5625
|
+
/* @__PURE__ */ jsx77("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
5346
5626
|
children,
|
|
5347
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
5627
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx77(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
5348
5628
|
]
|
|
5349
5629
|
}
|
|
5350
5630
|
);
|
|
@@ -5379,7 +5659,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
5379
5659
|
};
|
|
5380
5660
|
|
|
5381
5661
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5382
|
-
import { jsx as
|
|
5662
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
5383
5663
|
var MultiUploadInputRenderer = {
|
|
5384
5664
|
canRenderType: "input-upload-multi",
|
|
5385
5665
|
render: (props) => {
|
|
@@ -5407,7 +5687,7 @@ var MultiUploadInputRenderer = {
|
|
|
5407
5687
|
};
|
|
5408
5688
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
5409
5689
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5410
|
-
return /* @__PURE__ */
|
|
5690
|
+
return /* @__PURE__ */ jsx78(
|
|
5411
5691
|
UploadFieldInput_default,
|
|
5412
5692
|
{
|
|
5413
5693
|
id,
|
|
@@ -5418,7 +5698,7 @@ var MultiUploadInputRenderer = {
|
|
|
5418
5698
|
features,
|
|
5419
5699
|
control,
|
|
5420
5700
|
tags,
|
|
5421
|
-
children: /* @__PURE__ */
|
|
5701
|
+
children: /* @__PURE__ */ jsx78(
|
|
5422
5702
|
UploadInput,
|
|
5423
5703
|
{
|
|
5424
5704
|
id,
|
|
@@ -5446,8 +5726,8 @@ var MultiUploadInputRenderer = {
|
|
|
5446
5726
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
5447
5727
|
|
|
5448
5728
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
5449
|
-
import { Input as
|
|
5450
|
-
import { jsx as
|
|
5729
|
+
import { Input as Input4, InputGroup as InputGroup4 } from "@transferwise/components";
|
|
5730
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
5451
5731
|
var NumberInputRenderer = {
|
|
5452
5732
|
canRenderType: "input-number",
|
|
5453
5733
|
render: (props) => {
|
|
@@ -5461,7 +5741,7 @@ var NumberInputRenderer = {
|
|
|
5461
5741
|
"maximum",
|
|
5462
5742
|
"minimum"
|
|
5463
5743
|
);
|
|
5464
|
-
return /* @__PURE__ */
|
|
5744
|
+
return /* @__PURE__ */ jsx79(
|
|
5465
5745
|
FieldInput_default,
|
|
5466
5746
|
{
|
|
5467
5747
|
id,
|
|
@@ -5474,8 +5754,8 @@ var NumberInputRenderer = {
|
|
|
5474
5754
|
features: props.features,
|
|
5475
5755
|
control: props.control,
|
|
5476
5756
|
tags: props.tags,
|
|
5477
|
-
children: /* @__PURE__ */
|
|
5478
|
-
|
|
5757
|
+
children: /* @__PURE__ */ jsx79(InputGroup4, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx79(
|
|
5758
|
+
Input4,
|
|
5479
5759
|
__spreadValues({
|
|
5480
5760
|
id,
|
|
5481
5761
|
name: id,
|
|
@@ -5495,9 +5775,9 @@ var NumberInputRenderer = {
|
|
|
5495
5775
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
5496
5776
|
|
|
5497
5777
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5498
|
-
var
|
|
5499
|
-
import { Button as
|
|
5500
|
-
import { useIntl as
|
|
5778
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5779
|
+
import { Button as Button8, Input as Input5 } from "@transferwise/components";
|
|
5780
|
+
import { useIntl as useIntl16 } from "react-intl";
|
|
5501
5781
|
|
|
5502
5782
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
5503
5783
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -5524,18 +5804,18 @@ var paragraph_messages_default = defineMessages11({
|
|
|
5524
5804
|
});
|
|
5525
5805
|
|
|
5526
5806
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5527
|
-
import { jsx as
|
|
5807
|
+
import { jsx as jsx80, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5528
5808
|
var ParagraphRenderer = {
|
|
5529
5809
|
canRenderType: "paragraph",
|
|
5530
|
-
render: (props) => /* @__PURE__ */
|
|
5810
|
+
render: (props) => /* @__PURE__ */ jsx80(Paragraph, __spreadValues({}, props))
|
|
5531
5811
|
};
|
|
5532
5812
|
function Paragraph(props) {
|
|
5533
5813
|
const { align, control, margin, size, text } = props;
|
|
5534
|
-
const className = (0,
|
|
5814
|
+
const className = (0, import_classnames26.default)(
|
|
5535
5815
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5536
5816
|
controlAndTagsToCSSClass(props)
|
|
5537
5817
|
);
|
|
5538
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
5818
|
+
return control === "copyable" ? /* @__PURE__ */ jsx80(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx80(
|
|
5539
5819
|
"p",
|
|
5540
5820
|
{
|
|
5541
5821
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -5548,41 +5828,41 @@ function CopyableParagraph({
|
|
|
5548
5828
|
align,
|
|
5549
5829
|
className
|
|
5550
5830
|
}) {
|
|
5551
|
-
const { formatMessage } =
|
|
5831
|
+
const { formatMessage } = useIntl16();
|
|
5552
5832
|
const createSnackbar = useSnackBarIfAvailable();
|
|
5553
5833
|
const copy = () => {
|
|
5554
5834
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
5555
5835
|
});
|
|
5556
5836
|
};
|
|
5557
5837
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
5558
|
-
return /* @__PURE__ */
|
|
5559
|
-
/* @__PURE__ */
|
|
5560
|
-
|
|
5838
|
+
return /* @__PURE__ */ jsxs21("div", { className, children: [
|
|
5839
|
+
/* @__PURE__ */ jsx80(
|
|
5840
|
+
Input5,
|
|
5561
5841
|
{
|
|
5562
5842
|
type: "text",
|
|
5563
5843
|
value: text,
|
|
5564
5844
|
readOnly: true,
|
|
5565
|
-
className: (0,
|
|
5845
|
+
className: (0, import_classnames26.default)("text-ellipsis", inputAlignmentClasses)
|
|
5566
5846
|
}
|
|
5567
5847
|
),
|
|
5568
|
-
/* @__PURE__ */
|
|
5848
|
+
/* @__PURE__ */ jsx80(Button8, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5569
5849
|
] });
|
|
5570
5850
|
}
|
|
5571
5851
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
5572
5852
|
|
|
5573
5853
|
// ../renderers/src/ProgressRenderer.tsx
|
|
5574
|
-
var
|
|
5854
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5575
5855
|
import { ProgressBar } from "@transferwise/components";
|
|
5576
|
-
import { jsx as
|
|
5856
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
5577
5857
|
var ProgressRenderer = {
|
|
5578
5858
|
canRenderType: "progress",
|
|
5579
5859
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
5580
|
-
return /* @__PURE__ */
|
|
5860
|
+
return /* @__PURE__ */ jsx81(
|
|
5581
5861
|
ProgressBar,
|
|
5582
5862
|
{
|
|
5583
5863
|
id: uid,
|
|
5584
|
-
className: (0,
|
|
5585
|
-
title: title && help ? /* @__PURE__ */
|
|
5864
|
+
className: (0, import_classnames27.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5865
|
+
title: title && help ? /* @__PURE__ */ jsx81(LabelContentWithHelp, { text: title, help }) : title,
|
|
5586
5866
|
description,
|
|
5587
5867
|
progress: {
|
|
5588
5868
|
max: 1,
|
|
@@ -5595,11 +5875,11 @@ var ProgressRenderer = {
|
|
|
5595
5875
|
};
|
|
5596
5876
|
|
|
5597
5877
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5598
|
-
var
|
|
5599
|
-
import { Button as
|
|
5878
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5879
|
+
import { Button as Button9, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
5600
5880
|
import { Plus } from "@transferwise/icons";
|
|
5601
|
-
import { useState as
|
|
5602
|
-
import { useIntl as
|
|
5881
|
+
import { useState as useState18 } from "react";
|
|
5882
|
+
import { useIntl as useIntl17 } from "react-intl";
|
|
5603
5883
|
|
|
5604
5884
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
5605
5885
|
import { defineMessages as defineMessages12 } from "react-intl";
|
|
@@ -5627,10 +5907,10 @@ var repeatable_messages_default = defineMessages12({
|
|
|
5627
5907
|
});
|
|
5628
5908
|
|
|
5629
5909
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5630
|
-
import { Fragment as
|
|
5910
|
+
import { Fragment as Fragment10, jsx as jsx82, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5631
5911
|
var RepeatableRenderer = {
|
|
5632
5912
|
canRenderType: "repeatable",
|
|
5633
|
-
render: (props) => /* @__PURE__ */
|
|
5913
|
+
render: (props) => /* @__PURE__ */ jsx82(Repeatable, __spreadValues({}, props))
|
|
5634
5914
|
};
|
|
5635
5915
|
function Repeatable(props) {
|
|
5636
5916
|
const {
|
|
@@ -5647,8 +5927,8 @@ function Repeatable(props) {
|
|
|
5647
5927
|
onSave,
|
|
5648
5928
|
onRemove
|
|
5649
5929
|
} = props;
|
|
5650
|
-
const { formatMessage } =
|
|
5651
|
-
const [openModalType, setOpenModalType] =
|
|
5930
|
+
const { formatMessage } = useIntl17();
|
|
5931
|
+
const [openModalType, setOpenModalType] = useState18(null);
|
|
5652
5932
|
const { ref } = useScrollToError(validationState, features);
|
|
5653
5933
|
const onAddItem = () => {
|
|
5654
5934
|
onAdd();
|
|
@@ -5671,43 +5951,43 @@ function Repeatable(props) {
|
|
|
5671
5951
|
const onCancelEdit = () => {
|
|
5672
5952
|
setOpenModalType(null);
|
|
5673
5953
|
};
|
|
5674
|
-
return /* @__PURE__ */
|
|
5675
|
-
/* @__PURE__ */
|
|
5676
|
-
title && /* @__PURE__ */
|
|
5677
|
-
description && /* @__PURE__ */
|
|
5678
|
-
/* @__PURE__ */
|
|
5954
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
5955
|
+
/* @__PURE__ */ jsxs22("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5956
|
+
title && /* @__PURE__ */ jsx82(Header6, { title }),
|
|
5957
|
+
description && /* @__PURE__ */ jsx82("p", { children: description }),
|
|
5958
|
+
/* @__PURE__ */ jsxs22(
|
|
5679
5959
|
"div",
|
|
5680
5960
|
{
|
|
5681
|
-
className: (0,
|
|
5961
|
+
className: (0, import_classnames28.default)("form-group", {
|
|
5682
5962
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
5683
5963
|
}),
|
|
5684
5964
|
children: [
|
|
5685
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
5686
|
-
/* @__PURE__ */
|
|
5965
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx82(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5966
|
+
/* @__PURE__ */ jsx82(
|
|
5687
5967
|
NavigationOption,
|
|
5688
5968
|
{
|
|
5689
|
-
media: /* @__PURE__ */
|
|
5969
|
+
media: /* @__PURE__ */ jsx82(Plus, {}),
|
|
5690
5970
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5691
5971
|
showMediaAtAllSizes: true,
|
|
5692
5972
|
onClick: () => onAddItem()
|
|
5693
5973
|
}
|
|
5694
5974
|
),
|
|
5695
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
5975
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx82(InlineAlert3, { type: "negative", children: validationState.message })
|
|
5696
5976
|
]
|
|
5697
5977
|
}
|
|
5698
5978
|
)
|
|
5699
5979
|
] }),
|
|
5700
|
-
/* @__PURE__ */
|
|
5980
|
+
/* @__PURE__ */ jsx82(
|
|
5701
5981
|
Modal4,
|
|
5702
5982
|
{
|
|
5703
5983
|
open: openModalType !== null,
|
|
5704
5984
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5705
|
-
body: /* @__PURE__ */
|
|
5706
|
-
/* @__PURE__ */
|
|
5707
|
-
/* @__PURE__ */
|
|
5708
|
-
/* @__PURE__ */
|
|
5709
|
-
/* @__PURE__ */
|
|
5710
|
-
|
|
5985
|
+
body: /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
5986
|
+
/* @__PURE__ */ jsx82("div", { className: "m-b-2", children: editableItem }),
|
|
5987
|
+
/* @__PURE__ */ jsxs22("div", { children: [
|
|
5988
|
+
/* @__PURE__ */ jsx82(Button9, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
5989
|
+
/* @__PURE__ */ jsx82(
|
|
5990
|
+
Button9,
|
|
5711
5991
|
{
|
|
5712
5992
|
v2: true,
|
|
5713
5993
|
priority: "secondary",
|
|
@@ -5728,10 +6008,10 @@ function ItemSummaryOption({
|
|
|
5728
6008
|
item,
|
|
5729
6009
|
onClick
|
|
5730
6010
|
}) {
|
|
5731
|
-
return /* @__PURE__ */
|
|
6011
|
+
return /* @__PURE__ */ jsx82(
|
|
5732
6012
|
NavigationOption,
|
|
5733
6013
|
{
|
|
5734
|
-
media: /* @__PURE__ */
|
|
6014
|
+
media: /* @__PURE__ */ jsx82(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
5735
6015
|
title: item.title,
|
|
5736
6016
|
content: item.description,
|
|
5737
6017
|
showMediaAtAllSizes: true,
|
|
@@ -5743,16 +6023,16 @@ function ItemSummaryOption({
|
|
|
5743
6023
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
5744
6024
|
|
|
5745
6025
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
5746
|
-
var
|
|
6026
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
5747
6027
|
import { DefinitionList } from "@transferwise/components";
|
|
5748
|
-
import { Fragment as
|
|
6028
|
+
import { Fragment as Fragment11, jsx as jsx83, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5749
6029
|
var ReviewRenderer = {
|
|
5750
6030
|
canRenderType: "review",
|
|
5751
6031
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
5752
6032
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
5753
|
-
return /* @__PURE__ */
|
|
5754
|
-
/* @__PURE__ */
|
|
5755
|
-
/* @__PURE__ */
|
|
6033
|
+
return /* @__PURE__ */ jsxs23("div", { className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6034
|
+
/* @__PURE__ */ jsx83(Header, { title, callToAction }),
|
|
6035
|
+
/* @__PURE__ */ jsx83("div", { className: margin, children: /* @__PURE__ */ jsx83(
|
|
5756
6036
|
DefinitionList,
|
|
5757
6037
|
{
|
|
5758
6038
|
layout: orientation,
|
|
@@ -5790,21 +6070,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
5790
6070
|
};
|
|
5791
6071
|
var getFieldLabel = (label, help, onClick) => {
|
|
5792
6072
|
if (help) {
|
|
5793
|
-
return /* @__PURE__ */
|
|
6073
|
+
return /* @__PURE__ */ jsxs23(Fragment11, { children: [
|
|
5794
6074
|
label,
|
|
5795
6075
|
" ",
|
|
5796
|
-
/* @__PURE__ */
|
|
6076
|
+
/* @__PURE__ */ jsx83(Help_default, { help, onClick })
|
|
5797
6077
|
] });
|
|
5798
6078
|
}
|
|
5799
6079
|
return label;
|
|
5800
6080
|
};
|
|
5801
6081
|
|
|
5802
6082
|
// ../renderers/src/ReviewRenderer.tsx
|
|
5803
|
-
var
|
|
6083
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
5804
6084
|
import { ListItem as ListItem10, Markdown as Markdown5, Popover } from "@transferwise/components";
|
|
5805
6085
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
5806
|
-
import { useIntl as
|
|
5807
|
-
import { jsx as
|
|
6086
|
+
import { useIntl as useIntl18 } from "react-intl";
|
|
6087
|
+
import { jsx as jsx84, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5808
6088
|
var IGNORED_CONTROLS = [
|
|
5809
6089
|
"horizontal",
|
|
5810
6090
|
"horizontal-end-aligned",
|
|
@@ -5814,7 +6094,7 @@ var IGNORED_CONTROLS = [
|
|
|
5814
6094
|
var ReviewRenderer2 = {
|
|
5815
6095
|
canRenderType: "review",
|
|
5816
6096
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
5817
|
-
render: (props) => /* @__PURE__ */
|
|
6097
|
+
render: (props) => /* @__PURE__ */ jsx84(Review, __spreadValues({}, props))
|
|
5818
6098
|
};
|
|
5819
6099
|
var Review = ({
|
|
5820
6100
|
callToAction,
|
|
@@ -5825,9 +6105,9 @@ var Review = ({
|
|
|
5825
6105
|
title,
|
|
5826
6106
|
trackEvent
|
|
5827
6107
|
}) => {
|
|
5828
|
-
const intl =
|
|
5829
|
-
return /* @__PURE__ */
|
|
5830
|
-
/* @__PURE__ */
|
|
6108
|
+
const intl = useIntl18();
|
|
6109
|
+
return /* @__PURE__ */ jsxs24("div", { className: (0, import_classnames30.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6110
|
+
/* @__PURE__ */ jsx84(Header, { title, callToAction }),
|
|
5831
6111
|
fields.map((field) => {
|
|
5832
6112
|
var _a, _b, _c;
|
|
5833
6113
|
const {
|
|
@@ -5845,7 +6125,7 @@ var Review = ({
|
|
|
5845
6125
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
5846
6126
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
5847
6127
|
};
|
|
5848
|
-
return /* @__PURE__ */
|
|
6128
|
+
return /* @__PURE__ */ jsx84(
|
|
5849
6129
|
ListItem10,
|
|
5850
6130
|
{
|
|
5851
6131
|
title: value,
|
|
@@ -5866,14 +6146,14 @@ var Review = ({
|
|
|
5866
6146
|
] });
|
|
5867
6147
|
};
|
|
5868
6148
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
5869
|
-
return /* @__PURE__ */
|
|
6149
|
+
return /* @__PURE__ */ jsx84(Popover, { content: /* @__PURE__ */ jsx84(Markdown5, { config: { link: { target: "_blank" } }, children: help }), children: /* @__PURE__ */ jsx84(ListItem10.IconButton, { partiallyInteractive: true, "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx84(QuestionMarkCircle, {}) }) });
|
|
5870
6150
|
};
|
|
5871
6151
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
5872
6152
|
|
|
5873
6153
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5874
|
-
import { Input as
|
|
5875
|
-
import { useState as
|
|
5876
|
-
import { useIntl as
|
|
6154
|
+
import { Input as Input6, InputGroup as InputGroup5, List, ListItem as ListItem11, Markdown as Markdown6 } from "@transferwise/components";
|
|
6155
|
+
import { useState as useState19 } from "react";
|
|
6156
|
+
import { useIntl as useIntl20 } from "react-intl";
|
|
5877
6157
|
|
|
5878
6158
|
// ../renderers/src/messages/search.messages.ts
|
|
5879
6159
|
import { defineMessages as defineMessages13 } from "react-intl";
|
|
@@ -5886,21 +6166,21 @@ var search_messages_default = defineMessages13({
|
|
|
5886
6166
|
});
|
|
5887
6167
|
|
|
5888
6168
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
5889
|
-
import { useIntl as
|
|
6169
|
+
import { useIntl as useIntl19 } from "react-intl";
|
|
5890
6170
|
import { Link as DSLink2 } from "@transferwise/components";
|
|
5891
|
-
import { jsx as
|
|
6171
|
+
import { jsx as jsx85, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5892
6172
|
function ErrorResult({ state }) {
|
|
5893
|
-
const intl =
|
|
5894
|
-
return /* @__PURE__ */
|
|
6173
|
+
const intl = useIntl19();
|
|
6174
|
+
return /* @__PURE__ */ jsxs25("p", { className: "m-t-2", children: [
|
|
5895
6175
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
5896
6176
|
"\xA0",
|
|
5897
|
-
/* @__PURE__ */
|
|
6177
|
+
/* @__PURE__ */ jsx85(DSLink2, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
5898
6178
|
] });
|
|
5899
6179
|
}
|
|
5900
6180
|
|
|
5901
6181
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5902
|
-
import { Search as
|
|
5903
|
-
import { Fragment as
|
|
6182
|
+
import { Search as Search3 } from "@transferwise/icons";
|
|
6183
|
+
import { Fragment as Fragment12, jsx as jsx86, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5904
6184
|
function BlockSearchRendererComponent({
|
|
5905
6185
|
id,
|
|
5906
6186
|
hint,
|
|
@@ -5915,10 +6195,10 @@ function BlockSearchRendererComponent({
|
|
|
5915
6195
|
trackEvent,
|
|
5916
6196
|
onChange
|
|
5917
6197
|
}) {
|
|
5918
|
-
const [hasSearched, setHasSearched] =
|
|
5919
|
-
const { formatMessage } =
|
|
5920
|
-
return /* @__PURE__ */
|
|
5921
|
-
/* @__PURE__ */
|
|
6198
|
+
const [hasSearched, setHasSearched] = useState19(false);
|
|
6199
|
+
const { formatMessage } = useIntl20();
|
|
6200
|
+
return /* @__PURE__ */ jsxs26("div", { className: getMargin(margin), children: [
|
|
6201
|
+
/* @__PURE__ */ jsx86(
|
|
5922
6202
|
FieldInput_default,
|
|
5923
6203
|
{
|
|
5924
6204
|
id,
|
|
@@ -5929,8 +6209,8 @@ function BlockSearchRendererComponent({
|
|
|
5929
6209
|
features,
|
|
5930
6210
|
control,
|
|
5931
6211
|
tags,
|
|
5932
|
-
children: /* @__PURE__ */
|
|
5933
|
-
|
|
6212
|
+
children: /* @__PURE__ */ jsx86(InputGroup5, { addonStart: { content: /* @__PURE__ */ jsx86(Search3, { size: 24 }) }, children: /* @__PURE__ */ jsx86(
|
|
6213
|
+
Input6,
|
|
5934
6214
|
{
|
|
5935
6215
|
id,
|
|
5936
6216
|
name: id,
|
|
@@ -5949,7 +6229,7 @@ function BlockSearchRendererComponent({
|
|
|
5949
6229
|
) })
|
|
5950
6230
|
}
|
|
5951
6231
|
),
|
|
5952
|
-
isLoading ? /* @__PURE__ */
|
|
6232
|
+
isLoading ? /* @__PURE__ */ jsx86("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx86(SearchResultContent, { state, trackEvent })
|
|
5953
6233
|
] });
|
|
5954
6234
|
}
|
|
5955
6235
|
function SearchResultContent({
|
|
@@ -5958,38 +6238,38 @@ function SearchResultContent({
|
|
|
5958
6238
|
}) {
|
|
5959
6239
|
switch (state.type) {
|
|
5960
6240
|
case "error":
|
|
5961
|
-
return /* @__PURE__ */
|
|
6241
|
+
return /* @__PURE__ */ jsx86(ErrorResult, { state });
|
|
5962
6242
|
case "results":
|
|
5963
|
-
return /* @__PURE__ */
|
|
6243
|
+
return /* @__PURE__ */ jsx86(SearchResults, { state, trackEvent });
|
|
5964
6244
|
case "layout":
|
|
5965
|
-
return /* @__PURE__ */
|
|
6245
|
+
return /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
5966
6246
|
" ",
|
|
5967
6247
|
state.layout,
|
|
5968
6248
|
" "
|
|
5969
6249
|
] });
|
|
5970
6250
|
case "noResults":
|
|
5971
|
-
return /* @__PURE__ */
|
|
6251
|
+
return /* @__PURE__ */ jsx86(EmptySearchResult, { state });
|
|
5972
6252
|
case "pending":
|
|
5973
6253
|
default:
|
|
5974
6254
|
return null;
|
|
5975
6255
|
}
|
|
5976
6256
|
}
|
|
5977
6257
|
function EmptySearchResult({ state }) {
|
|
5978
|
-
return /* @__PURE__ */
|
|
6258
|
+
return /* @__PURE__ */ jsx86(Markdown6, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5979
6259
|
}
|
|
5980
6260
|
function SearchResults({
|
|
5981
6261
|
state,
|
|
5982
6262
|
trackEvent
|
|
5983
6263
|
}) {
|
|
5984
|
-
return /* @__PURE__ */
|
|
6264
|
+
return /* @__PURE__ */ jsx86(List, { children: state.results.map((result) => {
|
|
5985
6265
|
const { media } = result;
|
|
5986
|
-
return /* @__PURE__ */
|
|
6266
|
+
return /* @__PURE__ */ jsx86(
|
|
5987
6267
|
ListItem11,
|
|
5988
6268
|
{
|
|
5989
6269
|
title: result.title,
|
|
5990
6270
|
subtitle: result.description,
|
|
5991
|
-
media: media ? /* @__PURE__ */
|
|
5992
|
-
control: /* @__PURE__ */
|
|
6271
|
+
media: media ? /* @__PURE__ */ jsx86(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
6272
|
+
control: /* @__PURE__ */ jsx86(
|
|
5993
6273
|
ListItem11.Navigation,
|
|
5994
6274
|
{
|
|
5995
6275
|
onClick: () => {
|
|
@@ -6009,10 +6289,10 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
6009
6289
|
|
|
6010
6290
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
6011
6291
|
import { Markdown as Markdown7, Typeahead } from "@transferwise/components";
|
|
6012
|
-
import { Search as
|
|
6013
|
-
import { useState as
|
|
6014
|
-
import { useIntl as
|
|
6015
|
-
import { jsx as
|
|
6292
|
+
import { Search as Search4 } from "@transferwise/icons";
|
|
6293
|
+
import { useState as useState20 } from "react";
|
|
6294
|
+
import { useIntl as useIntl21 } from "react-intl";
|
|
6295
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
6016
6296
|
function InlineSearchRenderer({
|
|
6017
6297
|
id,
|
|
6018
6298
|
hint,
|
|
@@ -6026,9 +6306,9 @@ function InlineSearchRenderer({
|
|
|
6026
6306
|
onChange,
|
|
6027
6307
|
trackEvent
|
|
6028
6308
|
}) {
|
|
6029
|
-
const [hasSearched, setHasSearched] =
|
|
6030
|
-
const intl =
|
|
6031
|
-
return /* @__PURE__ */
|
|
6309
|
+
const [hasSearched, setHasSearched] = useState20(false);
|
|
6310
|
+
const intl = useIntl21();
|
|
6311
|
+
return /* @__PURE__ */ jsx87("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx87(
|
|
6032
6312
|
FieldInput_default,
|
|
6033
6313
|
{
|
|
6034
6314
|
id,
|
|
@@ -6039,7 +6319,7 @@ function InlineSearchRenderer({
|
|
|
6039
6319
|
features,
|
|
6040
6320
|
control,
|
|
6041
6321
|
tags,
|
|
6042
|
-
children: /* @__PURE__ */
|
|
6322
|
+
children: /* @__PURE__ */ jsx87(
|
|
6043
6323
|
Typeahead,
|
|
6044
6324
|
{
|
|
6045
6325
|
id: "typeahead-input-id",
|
|
@@ -6048,10 +6328,10 @@ function InlineSearchRenderer({
|
|
|
6048
6328
|
size: "md",
|
|
6049
6329
|
placeholder: hint,
|
|
6050
6330
|
maxHeight: 100,
|
|
6051
|
-
footer: /* @__PURE__ */
|
|
6331
|
+
footer: /* @__PURE__ */ jsx87(TypeaheadFooter, { state, isLoading }),
|
|
6052
6332
|
multiple: false,
|
|
6053
6333
|
clearable: false,
|
|
6054
|
-
addon: /* @__PURE__ */
|
|
6334
|
+
addon: /* @__PURE__ */ jsx87(Search4, { size: 24 }),
|
|
6055
6335
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
6056
6336
|
minQueryLength: 1,
|
|
6057
6337
|
onChange: (values) => {
|
|
@@ -6088,33 +6368,33 @@ function mapResultToTypeaheadOption(result) {
|
|
|
6088
6368
|
};
|
|
6089
6369
|
}
|
|
6090
6370
|
function TypeaheadFooter({ state, isLoading }) {
|
|
6091
|
-
const { formatMessage } =
|
|
6371
|
+
const { formatMessage } = useIntl21();
|
|
6092
6372
|
if (state.type === "layout") {
|
|
6093
|
-
return /* @__PURE__ */
|
|
6373
|
+
return /* @__PURE__ */ jsx87("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
6094
6374
|
}
|
|
6095
6375
|
if (state.type === "noResults") {
|
|
6096
|
-
return /* @__PURE__ */
|
|
6376
|
+
return /* @__PURE__ */ jsx87(Markdown7, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
6097
6377
|
}
|
|
6098
6378
|
if (state.type === "error") {
|
|
6099
|
-
return /* @__PURE__ */
|
|
6379
|
+
return /* @__PURE__ */ jsx87("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx87(ErrorResult, { state }) });
|
|
6100
6380
|
}
|
|
6101
6381
|
if (state.type === "pending" || isLoading) {
|
|
6102
|
-
return /* @__PURE__ */
|
|
6382
|
+
return /* @__PURE__ */ jsx87("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
6103
6383
|
}
|
|
6104
6384
|
return null;
|
|
6105
6385
|
}
|
|
6106
6386
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
6107
6387
|
|
|
6108
6388
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
6109
|
-
import { jsx as
|
|
6389
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
6110
6390
|
var SearchRenderer = {
|
|
6111
6391
|
canRenderType: "search",
|
|
6112
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
6392
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx88(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx88(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
6113
6393
|
};
|
|
6114
6394
|
var SearchRenderer_default = SearchRenderer;
|
|
6115
6395
|
|
|
6116
6396
|
// ../renderers/src/SectionRenderer.tsx
|
|
6117
|
-
var
|
|
6397
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6118
6398
|
import { Header as Header7 } from "@transferwise/components";
|
|
6119
6399
|
|
|
6120
6400
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
@@ -6139,16 +6419,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
6139
6419
|
};
|
|
6140
6420
|
|
|
6141
6421
|
// ../renderers/src/SectionRenderer.tsx
|
|
6142
|
-
import { jsx as
|
|
6422
|
+
import { jsx as jsx89, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6143
6423
|
var SectionRenderer = {
|
|
6144
6424
|
canRenderType: "section",
|
|
6145
6425
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
6146
|
-
return /* @__PURE__ */
|
|
6426
|
+
return /* @__PURE__ */ jsxs27(
|
|
6147
6427
|
"section",
|
|
6148
6428
|
{
|
|
6149
|
-
className: (0,
|
|
6429
|
+
className: (0, import_classnames31.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6150
6430
|
children: [
|
|
6151
|
-
(title || callToAction) && /* @__PURE__ */
|
|
6431
|
+
(title || callToAction) && /* @__PURE__ */ jsx89(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
6152
6432
|
children
|
|
6153
6433
|
]
|
|
6154
6434
|
}
|
|
@@ -6159,7 +6439,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
6159
6439
|
|
|
6160
6440
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
6161
6441
|
import { RadioGroup } from "@transferwise/components";
|
|
6162
|
-
import { Fragment as
|
|
6442
|
+
import { Fragment as Fragment13, jsx as jsx90, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6163
6443
|
function RadioInputRendererComponent(props) {
|
|
6164
6444
|
const {
|
|
6165
6445
|
id,
|
|
@@ -6176,8 +6456,8 @@ function RadioInputRendererComponent(props) {
|
|
|
6176
6456
|
tags,
|
|
6177
6457
|
onSelect
|
|
6178
6458
|
} = props;
|
|
6179
|
-
return /* @__PURE__ */
|
|
6180
|
-
/* @__PURE__ */
|
|
6459
|
+
return /* @__PURE__ */ jsxs28(Fragment13, { children: [
|
|
6460
|
+
/* @__PURE__ */ jsx90(
|
|
6181
6461
|
FieldInput_default,
|
|
6182
6462
|
{
|
|
6183
6463
|
id,
|
|
@@ -6188,7 +6468,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6188
6468
|
features,
|
|
6189
6469
|
control,
|
|
6190
6470
|
tags,
|
|
6191
|
-
children: /* @__PURE__ */
|
|
6471
|
+
children: /* @__PURE__ */ jsx90("span", { children: /* @__PURE__ */ jsx90(
|
|
6192
6472
|
RadioGroup,
|
|
6193
6473
|
{
|
|
6194
6474
|
name: id,
|
|
@@ -6197,7 +6477,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6197
6477
|
value: index,
|
|
6198
6478
|
secondary: option.description,
|
|
6199
6479
|
disabled: option.disabled || disabled,
|
|
6200
|
-
avatar: /* @__PURE__ */
|
|
6480
|
+
avatar: /* @__PURE__ */ jsx90(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6201
6481
|
})),
|
|
6202
6482
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
6203
6483
|
onChange: onSelect
|
|
@@ -6213,7 +6493,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6213
6493
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
6214
6494
|
import { Tabs } from "@transferwise/components";
|
|
6215
6495
|
import { useEffect as useEffect12 } from "react";
|
|
6216
|
-
import { Fragment as
|
|
6496
|
+
import { Fragment as Fragment14, jsx as jsx91, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6217
6497
|
function TabInputRendererComponent(props) {
|
|
6218
6498
|
const {
|
|
6219
6499
|
id,
|
|
@@ -6235,8 +6515,8 @@ function TabInputRendererComponent(props) {
|
|
|
6235
6515
|
onSelect(0);
|
|
6236
6516
|
}
|
|
6237
6517
|
}, [selectedIndex, onSelect, options.length]);
|
|
6238
|
-
return /* @__PURE__ */
|
|
6239
|
-
/* @__PURE__ */
|
|
6518
|
+
return /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6519
|
+
/* @__PURE__ */ jsx91(
|
|
6240
6520
|
FieldInput_default,
|
|
6241
6521
|
{
|
|
6242
6522
|
id,
|
|
@@ -6247,7 +6527,7 @@ function TabInputRendererComponent(props) {
|
|
|
6247
6527
|
features,
|
|
6248
6528
|
control,
|
|
6249
6529
|
tags,
|
|
6250
|
-
children: /* @__PURE__ */
|
|
6530
|
+
children: /* @__PURE__ */ jsx91(
|
|
6251
6531
|
Tabs,
|
|
6252
6532
|
{
|
|
6253
6533
|
name: id,
|
|
@@ -6256,7 +6536,7 @@ function TabInputRendererComponent(props) {
|
|
|
6256
6536
|
title: option.title,
|
|
6257
6537
|
// if we pass null, we get some props-types console errors
|
|
6258
6538
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
6259
|
-
content: /* @__PURE__ */
|
|
6539
|
+
content: /* @__PURE__ */ jsx91(Fragment14, {}),
|
|
6260
6540
|
disabled: option.disabled || disabled
|
|
6261
6541
|
})),
|
|
6262
6542
|
onTabSelect: onSelect
|
|
@@ -6271,7 +6551,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
6271
6551
|
|
|
6272
6552
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
6273
6553
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
6274
|
-
import { Fragment as
|
|
6554
|
+
import { Fragment as Fragment15, jsx as jsx92, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6275
6555
|
function SelectInputRendererComponent(props) {
|
|
6276
6556
|
const {
|
|
6277
6557
|
id,
|
|
@@ -6314,13 +6594,13 @@ function SelectInputRendererComponent(props) {
|
|
|
6314
6594
|
} : {
|
|
6315
6595
|
title: option.title,
|
|
6316
6596
|
description: option.description,
|
|
6317
|
-
icon: /* @__PURE__ */
|
|
6597
|
+
icon: /* @__PURE__ */ jsx92(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6318
6598
|
};
|
|
6319
|
-
return /* @__PURE__ */
|
|
6599
|
+
return /* @__PURE__ */ jsx92(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
6320
6600
|
};
|
|
6321
6601
|
const extraProps = { autoComplete };
|
|
6322
|
-
return /* @__PURE__ */
|
|
6323
|
-
/* @__PURE__ */
|
|
6602
|
+
return /* @__PURE__ */ jsxs30(Fragment15, { children: [
|
|
6603
|
+
/* @__PURE__ */ jsx92(
|
|
6324
6604
|
FieldInput_default,
|
|
6325
6605
|
{
|
|
6326
6606
|
id,
|
|
@@ -6331,7 +6611,7 @@ function SelectInputRendererComponent(props) {
|
|
|
6331
6611
|
features,
|
|
6332
6612
|
control,
|
|
6333
6613
|
tags,
|
|
6334
|
-
children: /* @__PURE__ */
|
|
6614
|
+
children: /* @__PURE__ */ jsx92(
|
|
6335
6615
|
SelectInput2,
|
|
6336
6616
|
__spreadValues({
|
|
6337
6617
|
name: id,
|
|
@@ -6354,7 +6634,7 @@ function SelectInputRendererComponent(props) {
|
|
|
6354
6634
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
6355
6635
|
import { useEffect as useEffect13 } from "react";
|
|
6356
6636
|
import { SegmentedControl } from "@transferwise/components";
|
|
6357
|
-
import { Fragment as
|
|
6637
|
+
import { Fragment as Fragment16, jsx as jsx93, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6358
6638
|
function SegmentedInputRendererComponent(props) {
|
|
6359
6639
|
const {
|
|
6360
6640
|
id,
|
|
@@ -6375,8 +6655,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6375
6655
|
onSelect(0);
|
|
6376
6656
|
}
|
|
6377
6657
|
}, [selectedIndex, onSelect, options.length]);
|
|
6378
|
-
return /* @__PURE__ */
|
|
6379
|
-
/* @__PURE__ */
|
|
6658
|
+
return /* @__PURE__ */ jsxs31(Fragment16, { children: [
|
|
6659
|
+
/* @__PURE__ */ jsx93(
|
|
6380
6660
|
FieldInput_default,
|
|
6381
6661
|
{
|
|
6382
6662
|
id,
|
|
@@ -6387,7 +6667,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6387
6667
|
features,
|
|
6388
6668
|
control,
|
|
6389
6669
|
tags,
|
|
6390
|
-
children: /* @__PURE__ */
|
|
6670
|
+
children: /* @__PURE__ */ jsx93(
|
|
6391
6671
|
SegmentedControl,
|
|
6392
6672
|
{
|
|
6393
6673
|
name: `${id}-segmented-control`,
|
|
@@ -6404,14 +6684,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6404
6684
|
)
|
|
6405
6685
|
}
|
|
6406
6686
|
),
|
|
6407
|
-
/* @__PURE__ */
|
|
6687
|
+
/* @__PURE__ */ jsx93("div", { id: `${id}-children`, children })
|
|
6408
6688
|
] });
|
|
6409
6689
|
}
|
|
6410
6690
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6411
6691
|
|
|
6412
6692
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
6413
6693
|
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem12 } from "@transferwise/components";
|
|
6414
|
-
import { jsx as
|
|
6694
|
+
import { jsx as jsx94, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6415
6695
|
function RadioItemRendererComponent(props) {
|
|
6416
6696
|
const {
|
|
6417
6697
|
id,
|
|
@@ -6427,22 +6707,22 @@ function RadioItemRendererComponent(props) {
|
|
|
6427
6707
|
onSelect
|
|
6428
6708
|
} = props;
|
|
6429
6709
|
const { ref } = useScrollToError(validationState, features);
|
|
6430
|
-
return /* @__PURE__ */
|
|
6431
|
-
rootTitle && /* @__PURE__ */
|
|
6710
|
+
return /* @__PURE__ */ jsxs32("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6711
|
+
rootTitle && /* @__PURE__ */ jsx94(
|
|
6432
6712
|
Header8,
|
|
6433
6713
|
{
|
|
6434
6714
|
as: "h2",
|
|
6435
|
-
title: help ? /* @__PURE__ */
|
|
6715
|
+
title: help ? /* @__PURE__ */ jsx94(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
6436
6716
|
}
|
|
6437
6717
|
),
|
|
6438
|
-
rootDescription && /* @__PURE__ */
|
|
6439
|
-
/* @__PURE__ */
|
|
6440
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
6718
|
+
rootDescription && /* @__PURE__ */ jsx94("p", { children: rootDescription }),
|
|
6719
|
+
/* @__PURE__ */ jsx94(List2, { children: options.map(
|
|
6720
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx94(
|
|
6441
6721
|
ListItem12,
|
|
6442
6722
|
__spreadValues({
|
|
6443
6723
|
title,
|
|
6444
6724
|
subtitle: description,
|
|
6445
|
-
control: /* @__PURE__ */
|
|
6725
|
+
control: /* @__PURE__ */ jsx94(
|
|
6446
6726
|
ListItem12.Radio,
|
|
6447
6727
|
{
|
|
6448
6728
|
name: title,
|
|
@@ -6458,50 +6738,50 @@ function RadioItemRendererComponent(props) {
|
|
|
6458
6738
|
title
|
|
6459
6739
|
)
|
|
6460
6740
|
) }, `${id}-${selectedIndex}`),
|
|
6461
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
6741
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx94(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
6462
6742
|
children
|
|
6463
6743
|
] });
|
|
6464
6744
|
}
|
|
6465
6745
|
|
|
6466
6746
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
6467
|
-
import { jsx as
|
|
6747
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
6468
6748
|
var SelectInputRenderer = {
|
|
6469
6749
|
canRenderType: "input-select",
|
|
6470
6750
|
render: (props) => {
|
|
6471
6751
|
switch (props.control) {
|
|
6472
6752
|
case "radio":
|
|
6473
|
-
return /* @__PURE__ */
|
|
6753
|
+
return /* @__PURE__ */ jsx95(RadioInputRendererComponent, __spreadValues({}, props));
|
|
6474
6754
|
case "radio-item":
|
|
6475
|
-
return /* @__PURE__ */
|
|
6755
|
+
return /* @__PURE__ */ jsx95(RadioItemRendererComponent, __spreadValues({}, props));
|
|
6476
6756
|
case "tab":
|
|
6477
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
6757
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx95(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx95(TabInputRendererComponent, __spreadValues({}, props));
|
|
6478
6758
|
case "segmented":
|
|
6479
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
6759
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx95(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx95(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
6480
6760
|
case "select":
|
|
6481
6761
|
default:
|
|
6482
|
-
return /* @__PURE__ */
|
|
6762
|
+
return /* @__PURE__ */ jsx95(SelectInputRendererComponent, __spreadValues({}, props));
|
|
6483
6763
|
}
|
|
6484
6764
|
}
|
|
6485
6765
|
};
|
|
6486
6766
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
6487
6767
|
|
|
6488
6768
|
// ../renderers/src/StatusListRenderer.tsx
|
|
6489
|
-
var
|
|
6769
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6490
6770
|
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem13 } from "@transferwise/components";
|
|
6491
|
-
import { jsx as
|
|
6771
|
+
import { jsx as jsx96, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6492
6772
|
var StatusListRenderer = {
|
|
6493
6773
|
canRenderType: "status-list",
|
|
6494
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */
|
|
6495
|
-
title ? /* @__PURE__ */
|
|
6774
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ jsxs33("div", { className: (0, import_classnames32.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6775
|
+
title ? /* @__PURE__ */ jsx96(Header9, { title }) : null,
|
|
6496
6776
|
items.map((item) => {
|
|
6497
6777
|
const { callToAction, description, title: itemTitle } = item;
|
|
6498
|
-
return /* @__PURE__ */
|
|
6778
|
+
return /* @__PURE__ */ jsx96(
|
|
6499
6779
|
ListItem13,
|
|
6500
6780
|
{
|
|
6501
6781
|
title: itemTitle,
|
|
6502
6782
|
subtitle: description,
|
|
6503
|
-
media: /* @__PURE__ */
|
|
6504
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
6783
|
+
media: /* @__PURE__ */ jsx96(StatusListItemMedia, __spreadValues({}, item)),
|
|
6784
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx96(
|
|
6505
6785
|
ListItem13.AdditionalInfo,
|
|
6506
6786
|
{
|
|
6507
6787
|
action: __spreadValues({
|
|
@@ -6520,10 +6800,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
6520
6800
|
return void 0;
|
|
6521
6801
|
}
|
|
6522
6802
|
if ("name" in icon) {
|
|
6523
|
-
return /* @__PURE__ */
|
|
6803
|
+
return /* @__PURE__ */ jsx96(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx96(DynamicIcon_default, { name: icon.name }) });
|
|
6524
6804
|
}
|
|
6525
6805
|
if ("text" in icon) {
|
|
6526
|
-
return /* @__PURE__ */
|
|
6806
|
+
return /* @__PURE__ */ jsx96(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
6527
6807
|
}
|
|
6528
6808
|
return void 0;
|
|
6529
6809
|
};
|
|
@@ -6540,7 +6820,7 @@ var mapStatus = (status) => {
|
|
|
6540
6820
|
var StatusListRenderer_default = StatusListRenderer;
|
|
6541
6821
|
|
|
6542
6822
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6543
|
-
var
|
|
6823
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6544
6824
|
|
|
6545
6825
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
6546
6826
|
import { useTheme } from "@wise/components-theming";
|
|
@@ -6562,12 +6842,12 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
6562
6842
|
|
|
6563
6843
|
// ../renderers/src/step/StepHeader.tsx
|
|
6564
6844
|
import { Title as Title2 } from "@transferwise/components";
|
|
6565
|
-
import { Fragment as
|
|
6845
|
+
import { Fragment as Fragment17, jsx as jsx97, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6566
6846
|
var StepHeader = ({ title, description, tags }) => {
|
|
6567
6847
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
6568
|
-
return /* @__PURE__ */
|
|
6569
|
-
title ? /* @__PURE__ */
|
|
6570
|
-
description ? /* @__PURE__ */
|
|
6848
|
+
return /* @__PURE__ */ jsxs34(Fragment17, { children: [
|
|
6849
|
+
title ? /* @__PURE__ */ jsx97(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6850
|
+
description ? /* @__PURE__ */ jsx97("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
6571
6851
|
] });
|
|
6572
6852
|
};
|
|
6573
6853
|
var getHeaderStyle = (tags) => {
|
|
@@ -6578,9 +6858,9 @@ var getHeaderStyle = (tags) => {
|
|
|
6578
6858
|
};
|
|
6579
6859
|
|
|
6580
6860
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6581
|
-
import { IconButton as
|
|
6861
|
+
import { IconButton as IconButton3 } from "@transferwise/components";
|
|
6582
6862
|
import { ArrowLeft } from "@transferwise/icons";
|
|
6583
|
-
import { useIntl as
|
|
6863
|
+
import { useIntl as useIntl22 } from "react-intl";
|
|
6584
6864
|
|
|
6585
6865
|
// ../renderers/src/messages/back.messages.ts
|
|
6586
6866
|
import { defineMessages as defineMessages14 } from "react-intl";
|
|
@@ -6593,31 +6873,31 @@ var back_messages_default = defineMessages14({
|
|
|
6593
6873
|
});
|
|
6594
6874
|
|
|
6595
6875
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6596
|
-
import { jsx as
|
|
6876
|
+
import { jsx as jsx98, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6597
6877
|
function BackButton({ title, onClick }) {
|
|
6598
|
-
const { formatMessage } =
|
|
6599
|
-
return /* @__PURE__ */
|
|
6600
|
-
/* @__PURE__ */
|
|
6601
|
-
/* @__PURE__ */
|
|
6878
|
+
const { formatMessage } = useIntl22();
|
|
6879
|
+
return /* @__PURE__ */ jsxs35(IconButton3, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6880
|
+
/* @__PURE__ */ jsx98("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6881
|
+
/* @__PURE__ */ jsx98(ArrowLeft, {})
|
|
6602
6882
|
] });
|
|
6603
6883
|
}
|
|
6604
6884
|
|
|
6605
6885
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
6606
|
-
import { Button as
|
|
6607
|
-
import { jsx as
|
|
6886
|
+
import { Button as Button10, IconButton as IconButton4 } from "@transferwise/components";
|
|
6887
|
+
import { jsx as jsx99, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6608
6888
|
var Toolbar = ({ items }) => {
|
|
6609
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
6889
|
+
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */ jsx99("div", { className: "df-toolbar", children: items.map((item, index) => /* @__PURE__ */ jsx99(ToolbarButton, __spreadValues({}, item), `${item.type}-${index}-${item.title}`)) }) : null;
|
|
6610
6890
|
};
|
|
6611
6891
|
function ToolbarButton(props) {
|
|
6612
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
6892
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx99(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx99(TextToolbarButton, __spreadValues({}, props));
|
|
6613
6893
|
}
|
|
6614
6894
|
function MediaToolbarButton(props) {
|
|
6615
6895
|
var _a;
|
|
6616
6896
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
6617
6897
|
const priority = getIconButtonPriority(control);
|
|
6618
6898
|
const type = getSentiment2(context);
|
|
6619
|
-
return /* @__PURE__ */
|
|
6620
|
-
|
|
6899
|
+
return /* @__PURE__ */ jsxs36(
|
|
6900
|
+
IconButton4,
|
|
6621
6901
|
{
|
|
6622
6902
|
className: "df-toolbar-button",
|
|
6623
6903
|
disabled,
|
|
@@ -6626,7 +6906,7 @@ function MediaToolbarButton(props) {
|
|
|
6626
6906
|
type,
|
|
6627
6907
|
onClick,
|
|
6628
6908
|
children: [
|
|
6629
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
6909
|
+
accessibilityDescription ? /* @__PURE__ */ jsx99("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
6630
6910
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
6631
6911
|
]
|
|
6632
6912
|
}
|
|
@@ -6637,8 +6917,8 @@ function TextToolbarButton(props) {
|
|
|
6637
6917
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
6638
6918
|
const priority = getPriority2(control);
|
|
6639
6919
|
const sentiment = getSentiment2(context);
|
|
6640
|
-
return /* @__PURE__ */
|
|
6641
|
-
|
|
6920
|
+
return /* @__PURE__ */ jsx99(
|
|
6921
|
+
Button10,
|
|
6642
6922
|
{
|
|
6643
6923
|
v2: true,
|
|
6644
6924
|
size: "sm",
|
|
@@ -6667,18 +6947,18 @@ var getIconButtonPriority = (control) => {
|
|
|
6667
6947
|
};
|
|
6668
6948
|
|
|
6669
6949
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
6670
|
-
import { jsx as
|
|
6950
|
+
import { jsx as jsx100, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6671
6951
|
function TopBar({ back, toolbar, tags }) {
|
|
6672
6952
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
6673
6953
|
const backCTA = isBackAllowed ? back : void 0;
|
|
6674
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
6675
|
-
backCTA ? /* @__PURE__ */
|
|
6676
|
-
toolbar ? /* @__PURE__ */
|
|
6954
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs37("div", { className: "d-flex m-b-2", children: [
|
|
6955
|
+
backCTA ? /* @__PURE__ */ jsx100(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6956
|
+
toolbar ? /* @__PURE__ */ jsx100(Toolbar, __spreadValues({}, toolbar)) : null
|
|
6677
6957
|
] }) : null;
|
|
6678
6958
|
}
|
|
6679
6959
|
|
|
6680
6960
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6681
|
-
import { jsx as
|
|
6961
|
+
import { jsx as jsx101, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6682
6962
|
var SplashCelebrationStepRenderer = {
|
|
6683
6963
|
canRenderType: "step",
|
|
6684
6964
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -6687,23 +6967,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
6687
6967
|
function SplashCelebrationStepRendererComponent(props) {
|
|
6688
6968
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
6689
6969
|
useCustomTheme("forest-green", trackEvent);
|
|
6690
|
-
return /* @__PURE__ */
|
|
6970
|
+
return /* @__PURE__ */ jsxs38(
|
|
6691
6971
|
"div",
|
|
6692
6972
|
{
|
|
6693
|
-
className: (0,
|
|
6973
|
+
className: (0, import_classnames33.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6694
6974
|
children: [
|
|
6695
|
-
/* @__PURE__ */
|
|
6696
|
-
title || description ? /* @__PURE__ */
|
|
6975
|
+
/* @__PURE__ */ jsx101(TopBar, { back, toolbar, tags }),
|
|
6976
|
+
title || description ? /* @__PURE__ */ jsx101("div", { className: "m-b-4", children: /* @__PURE__ */ jsx101(StepHeader, { title, description, tags }) }) : void 0,
|
|
6697
6977
|
children,
|
|
6698
|
-
/* @__PURE__ */
|
|
6978
|
+
/* @__PURE__ */ jsx101(StepFooter, { footer, tags })
|
|
6699
6979
|
]
|
|
6700
6980
|
}
|
|
6701
6981
|
);
|
|
6702
6982
|
}
|
|
6703
6983
|
|
|
6704
6984
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
6705
|
-
var
|
|
6706
|
-
import { jsx as
|
|
6985
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
6986
|
+
import { jsx as jsx102, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6707
6987
|
var SplashStepRenderer = {
|
|
6708
6988
|
canRenderType: "step",
|
|
6709
6989
|
canRender: ({ control }) => control === "splash",
|
|
@@ -6711,15 +6991,15 @@ var SplashStepRenderer = {
|
|
|
6711
6991
|
};
|
|
6712
6992
|
function SplashStepRendererComponent(props) {
|
|
6713
6993
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
6714
|
-
return /* @__PURE__ */
|
|
6994
|
+
return /* @__PURE__ */ jsxs39(
|
|
6715
6995
|
"div",
|
|
6716
6996
|
{
|
|
6717
|
-
className: (0,
|
|
6997
|
+
className: (0, import_classnames34.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6718
6998
|
children: [
|
|
6719
|
-
/* @__PURE__ */
|
|
6720
|
-
title || description ? /* @__PURE__ */
|
|
6999
|
+
/* @__PURE__ */ jsx102(TopBar, { back, toolbar, tags }),
|
|
7000
|
+
title || description ? /* @__PURE__ */ jsx102("div", { className: "m-b-4", children: /* @__PURE__ */ jsx102(StepHeader, { title, description, tags }) }) : void 0,
|
|
6721
7001
|
children,
|
|
6722
|
-
/* @__PURE__ */
|
|
7002
|
+
/* @__PURE__ */ jsx102(StepFooter, { footer, tags })
|
|
6723
7003
|
]
|
|
6724
7004
|
}
|
|
6725
7005
|
);
|
|
@@ -6727,46 +7007,46 @@ function SplashStepRendererComponent(props) {
|
|
|
6727
7007
|
|
|
6728
7008
|
// ../renderers/src/step/StepRenderer.tsx
|
|
6729
7009
|
import { Alert } from "@transferwise/components";
|
|
6730
|
-
import { jsx as
|
|
7010
|
+
import { jsx as jsx103, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6731
7011
|
var StepRenderer = {
|
|
6732
7012
|
canRenderType: "step",
|
|
6733
7013
|
render: StepRendererComponent
|
|
6734
7014
|
};
|
|
6735
7015
|
function StepRendererComponent(props) {
|
|
6736
7016
|
const { back, description, error, title, children, toolbar, footer, control, tags } = props;
|
|
6737
|
-
return /* @__PURE__ */
|
|
6738
|
-
/* @__PURE__ */
|
|
6739
|
-
title || description ? /* @__PURE__ */
|
|
6740
|
-
error ? /* @__PURE__ */
|
|
7017
|
+
return /* @__PURE__ */ jsxs40("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
7018
|
+
/* @__PURE__ */ jsx103(TopBar, { back, toolbar, tags }),
|
|
7019
|
+
title || description ? /* @__PURE__ */ jsx103("div", { className: "m-b-4", children: /* @__PURE__ */ jsx103(StepHeader, { title, description, tags }) }) : void 0,
|
|
7020
|
+
error ? /* @__PURE__ */ jsx103(Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
6741
7021
|
children,
|
|
6742
|
-
/* @__PURE__ */
|
|
7022
|
+
/* @__PURE__ */ jsx103(StepFooter, { footer, tags })
|
|
6743
7023
|
] });
|
|
6744
7024
|
}
|
|
6745
7025
|
|
|
6746
7026
|
// ../renderers/src/TabsRenderer.tsx
|
|
6747
|
-
var
|
|
6748
|
-
import { Chips as
|
|
6749
|
-
import { useState as
|
|
6750
|
-
import { jsx as
|
|
7027
|
+
var import_classnames35 = __toESM(require_classnames());
|
|
7028
|
+
import { Chips as Chips3, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
7029
|
+
import { useState as useState21 } from "react";
|
|
7030
|
+
import { jsx as jsx104, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6751
7031
|
var TabsRenderer = {
|
|
6752
7032
|
canRenderType: "tabs",
|
|
6753
7033
|
render: (props) => {
|
|
6754
7034
|
switch (props.control) {
|
|
6755
7035
|
case "segmented":
|
|
6756
7036
|
if (props.tabs.length > 3) {
|
|
6757
|
-
return /* @__PURE__ */
|
|
7037
|
+
return /* @__PURE__ */ jsx104(TabsRendererComponent, __spreadValues({}, props));
|
|
6758
7038
|
}
|
|
6759
|
-
return /* @__PURE__ */
|
|
7039
|
+
return /* @__PURE__ */ jsx104(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
6760
7040
|
case "chips":
|
|
6761
|
-
return /* @__PURE__ */
|
|
7041
|
+
return /* @__PURE__ */ jsx104(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
6762
7042
|
default:
|
|
6763
|
-
return /* @__PURE__ */
|
|
7043
|
+
return /* @__PURE__ */ jsx104(TabsRendererComponent, __spreadValues({}, props));
|
|
6764
7044
|
}
|
|
6765
7045
|
}
|
|
6766
7046
|
};
|
|
6767
7047
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6768
|
-
const [selectedIndex, setSelectedIndex] =
|
|
6769
|
-
return /* @__PURE__ */
|
|
7048
|
+
const [selectedIndex, setSelectedIndex] = useState21(0);
|
|
7049
|
+
return /* @__PURE__ */ jsx104("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: /* @__PURE__ */ jsx104(
|
|
6770
7050
|
Tabs2,
|
|
6771
7051
|
{
|
|
6772
7052
|
name: uid,
|
|
@@ -6774,7 +7054,7 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6774
7054
|
tabs: tabs.map((option) => ({
|
|
6775
7055
|
title: option.title,
|
|
6776
7056
|
disabled: false,
|
|
6777
|
-
content: /* @__PURE__ */
|
|
7057
|
+
content: /* @__PURE__ */ jsxs41("div", { className: "m-t-2", children: [
|
|
6778
7058
|
" ",
|
|
6779
7059
|
option.children,
|
|
6780
7060
|
" "
|
|
@@ -6786,9 +7066,9 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6786
7066
|
}
|
|
6787
7067
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6788
7068
|
var _a;
|
|
6789
|
-
const [selectedIndex, setSelectedIndex] =
|
|
6790
|
-
return /* @__PURE__ */
|
|
6791
|
-
/* @__PURE__ */
|
|
7069
|
+
const [selectedIndex, setSelectedIndex] = useState21(0);
|
|
7070
|
+
return /* @__PURE__ */ jsxs41("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
7071
|
+
/* @__PURE__ */ jsx104(
|
|
6792
7072
|
SegmentedControl2,
|
|
6793
7073
|
{
|
|
6794
7074
|
name: uid,
|
|
@@ -6803,41 +7083,41 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6803
7083
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
6804
7084
|
}
|
|
6805
7085
|
),
|
|
6806
|
-
/* @__PURE__ */
|
|
7086
|
+
/* @__PURE__ */ jsx104("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6807
7087
|
] });
|
|
6808
7088
|
}
|
|
6809
7089
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
6810
7090
|
var _a;
|
|
6811
|
-
const [selectedIndex, setSelectedIndex] =
|
|
6812
|
-
return /* @__PURE__ */
|
|
6813
|
-
/* @__PURE__ */
|
|
6814
|
-
|
|
7091
|
+
const [selectedIndex, setSelectedIndex] = useState21(0);
|
|
7092
|
+
return /* @__PURE__ */ jsxs41("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
7093
|
+
/* @__PURE__ */ jsx104("div", { className: "chips-container", children: /* @__PURE__ */ jsx104(
|
|
7094
|
+
Chips3,
|
|
6815
7095
|
{
|
|
6816
7096
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
6817
7097
|
selected: selectedIndex,
|
|
6818
7098
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
6819
7099
|
}
|
|
6820
7100
|
) }),
|
|
6821
|
-
/* @__PURE__ */
|
|
7101
|
+
/* @__PURE__ */ jsx104("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6822
7102
|
] });
|
|
6823
7103
|
}
|
|
6824
7104
|
|
|
6825
7105
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6826
|
-
import { InputGroup as
|
|
6827
|
-
import { useState as
|
|
7106
|
+
import { InputGroup as InputGroup6 } from "@transferwise/components";
|
|
7107
|
+
import { useState as useState23 } from "react";
|
|
6828
7108
|
|
|
6829
7109
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6830
7110
|
import {
|
|
6831
|
-
IconButton as
|
|
6832
|
-
Input as
|
|
7111
|
+
IconButton as IconButton5,
|
|
7112
|
+
Input as Input7,
|
|
6833
7113
|
InputWithDisplayFormat,
|
|
6834
7114
|
PhoneNumberInput,
|
|
6835
7115
|
TextArea,
|
|
6836
7116
|
TextareaWithDisplayFormat
|
|
6837
7117
|
} from "@transferwise/components";
|
|
6838
7118
|
import { Eye, EyeShut } from "@transferwise/icons";
|
|
6839
|
-
import { useIntl as
|
|
6840
|
-
import { useLayoutEffect as useLayoutEffect3, useRef as
|
|
7119
|
+
import { useIntl as useIntl23 } from "react-intl";
|
|
7120
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef6, useState as useState22 } from "react";
|
|
6841
7121
|
|
|
6842
7122
|
// ../renderers/src/messages/ssn-input.messages.ts
|
|
6843
7123
|
import { defineMessages as defineMessages15 } from "react-intl";
|
|
@@ -6926,7 +7206,7 @@ function getDisplayOffset(displayValue, rawOffset) {
|
|
|
6926
7206
|
}
|
|
6927
7207
|
|
|
6928
7208
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6929
|
-
import { jsx as
|
|
7209
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
6930
7210
|
var commonKeys = [
|
|
6931
7211
|
"autoComplete",
|
|
6932
7212
|
"autoCapitalize",
|
|
@@ -6945,14 +7225,14 @@ function VariableTextInput(inputProps) {
|
|
|
6945
7225
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6946
7226
|
switch (control) {
|
|
6947
7227
|
case "email":
|
|
6948
|
-
return /* @__PURE__ */
|
|
7228
|
+
return /* @__PURE__ */ jsx105(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6949
7229
|
case "password":
|
|
6950
|
-
return /* @__PURE__ */
|
|
7230
|
+
return /* @__PURE__ */ jsx105(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
6951
7231
|
case "ssn-input":
|
|
6952
|
-
return /* @__PURE__ */
|
|
7232
|
+
return /* @__PURE__ */ jsx105(SsnInput, __spreadProps(__spreadValues({}, commonProps), { isVisible: isSsnVisible, onChange }));
|
|
6953
7233
|
case "numeric": {
|
|
6954
7234
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6955
|
-
return /* @__PURE__ */
|
|
7235
|
+
return /* @__PURE__ */ jsx105(
|
|
6956
7236
|
TextInput,
|
|
6957
7237
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
6958
7238
|
onChange: (newValue) => {
|
|
@@ -6963,9 +7243,9 @@ function VariableTextInput(inputProps) {
|
|
|
6963
7243
|
);
|
|
6964
7244
|
}
|
|
6965
7245
|
case "phone-number":
|
|
6966
|
-
return /* @__PURE__ */
|
|
7246
|
+
return /* @__PURE__ */ jsx105(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
6967
7247
|
default: {
|
|
6968
|
-
return /* @__PURE__ */
|
|
7248
|
+
return /* @__PURE__ */ jsx105(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
6969
7249
|
}
|
|
6970
7250
|
}
|
|
6971
7251
|
}
|
|
@@ -6973,31 +7253,31 @@ function SsnInputToggle({
|
|
|
6973
7253
|
isVisible,
|
|
6974
7254
|
onClick
|
|
6975
7255
|
}) {
|
|
6976
|
-
const { formatMessage } =
|
|
6977
|
-
return /* @__PURE__ */
|
|
6978
|
-
|
|
7256
|
+
const { formatMessage } = useIntl23();
|
|
7257
|
+
return /* @__PURE__ */ jsx105(
|
|
7258
|
+
IconButton5,
|
|
6979
7259
|
{
|
|
6980
7260
|
priority: "minimal",
|
|
6981
7261
|
size: 24,
|
|
6982
7262
|
"aria-label": formatMessage(isVisible ? ssn_input_messages_default.hideValue : ssn_input_messages_default.showValue),
|
|
6983
7263
|
"aria-pressed": isVisible,
|
|
6984
7264
|
onClick,
|
|
6985
|
-
children: isVisible ? /* @__PURE__ */
|
|
7265
|
+
children: isVisible ? /* @__PURE__ */ jsx105(EyeShut, { size: 24 }) : /* @__PURE__ */ jsx105(Eye, { size: 24 })
|
|
6986
7266
|
}
|
|
6987
7267
|
);
|
|
6988
7268
|
}
|
|
6989
7269
|
function TextInput(props) {
|
|
6990
7270
|
const _a = props, { control, displayFormat, onChange, type } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange", "type"]);
|
|
6991
7271
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
6992
|
-
const InputWithoutPattern = control === "textarea" ? TextArea :
|
|
6993
|
-
return displayFormat ? /* @__PURE__ */
|
|
7272
|
+
const InputWithoutPattern = control === "textarea" ? TextArea : Input7;
|
|
7273
|
+
return displayFormat ? /* @__PURE__ */ jsx105(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx105(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { type, onChange: (e) => onChange(e.target.value) }));
|
|
6994
7274
|
}
|
|
6995
7275
|
function SsnInput(props) {
|
|
6996
7276
|
const _a = props, { displayFormat = "", isVisible = false, onChange, value = "" } = _a, commonProps = __objRest(_a, ["displayFormat", "isVisible", "onChange", "value"]);
|
|
6997
|
-
const [editVersion, setEditVersion] =
|
|
6998
|
-
const inputRef =
|
|
6999
|
-
const selection =
|
|
7000
|
-
const pendingCaret =
|
|
7277
|
+
const [editVersion, setEditVersion] = useState22(0);
|
|
7278
|
+
const inputRef = useRef6(null);
|
|
7279
|
+
const selection = useRef6({ start: 0, end: 0 });
|
|
7280
|
+
const pendingCaret = useRef6(null);
|
|
7001
7281
|
const rawValue = value.replace(/\D/g, "");
|
|
7002
7282
|
const formattedValue = formatSsnValue(rawValue, displayFormat, isVisible);
|
|
7003
7283
|
const scheduleCaret = (rawOffset) => {
|
|
@@ -7027,7 +7307,7 @@ function SsnInput(props) {
|
|
|
7027
7307
|
);
|
|
7028
7308
|
pendingCaret.current = null;
|
|
7029
7309
|
}, [editVersion, formattedValue, rawValue]);
|
|
7030
|
-
return /* @__PURE__ */
|
|
7310
|
+
return /* @__PURE__ */ jsx105(
|
|
7031
7311
|
"input",
|
|
7032
7312
|
__spreadProps(__spreadValues({
|
|
7033
7313
|
ref: inputRef
|
|
@@ -7090,13 +7370,13 @@ function SsnInput(props) {
|
|
|
7090
7370
|
}
|
|
7091
7371
|
|
|
7092
7372
|
// ../renderers/src/TextInputRenderer.tsx
|
|
7093
|
-
import { jsx as
|
|
7373
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
7094
7374
|
var TextInputRenderer = {
|
|
7095
7375
|
canRenderType: "input-text",
|
|
7096
|
-
render: (props) => /* @__PURE__ */
|
|
7376
|
+
render: (props) => /* @__PURE__ */ jsx106(TextInputRendererComponent, __spreadValues({}, props))
|
|
7097
7377
|
};
|
|
7098
7378
|
function TextInputRendererComponent(props) {
|
|
7099
|
-
const [isSsnVisible, setIsSsnVisible] =
|
|
7379
|
+
const [isSsnVisible, setIsSsnVisible] = useState23(false);
|
|
7100
7380
|
const _a = props, {
|
|
7101
7381
|
id,
|
|
7102
7382
|
title,
|
|
@@ -7128,7 +7408,7 @@ function TextInputRendererComponent(props) {
|
|
|
7128
7408
|
}
|
|
7129
7409
|
}
|
|
7130
7410
|
});
|
|
7131
|
-
return /* @__PURE__ */
|
|
7411
|
+
return /* @__PURE__ */ jsx106(
|
|
7132
7412
|
FieldInput_default,
|
|
7133
7413
|
{
|
|
7134
7414
|
id,
|
|
@@ -7141,13 +7421,13 @@ function TextInputRendererComponent(props) {
|
|
|
7141
7421
|
features: props.features,
|
|
7142
7422
|
control: props.control,
|
|
7143
7423
|
tags: props.tags,
|
|
7144
|
-
children: /* @__PURE__ */
|
|
7145
|
-
|
|
7424
|
+
children: /* @__PURE__ */ jsx106(
|
|
7425
|
+
InputGroup6,
|
|
7146
7426
|
{
|
|
7147
7427
|
addonStart: getInputGroupAddonStart(media),
|
|
7148
7428
|
addonEnd: isSsnInput ? {
|
|
7149
7429
|
interactive: true,
|
|
7150
|
-
content: /* @__PURE__ */
|
|
7430
|
+
content: /* @__PURE__ */ jsx106(
|
|
7151
7431
|
SsnInputToggle,
|
|
7152
7432
|
{
|
|
7153
7433
|
isVisible: isSsnVisible,
|
|
@@ -7155,7 +7435,7 @@ function TextInputRendererComponent(props) {
|
|
|
7155
7435
|
}
|
|
7156
7436
|
)
|
|
7157
7437
|
} : void 0,
|
|
7158
|
-
children: /* @__PURE__ */
|
|
7438
|
+
children: /* @__PURE__ */ jsx106(VariableTextInput, __spreadValues({}, inputProps))
|
|
7159
7439
|
}
|
|
7160
7440
|
)
|
|
7161
7441
|
}
|
|
@@ -7164,12 +7444,12 @@ function TextInputRendererComponent(props) {
|
|
|
7164
7444
|
var TextInputRenderer_default = TextInputRenderer;
|
|
7165
7445
|
|
|
7166
7446
|
// ../renderers/src/UpdatableRenderer.tsx
|
|
7167
|
-
var
|
|
7168
|
-
import { jsx as
|
|
7447
|
+
var import_classnames36 = __toESM(require_classnames());
|
|
7448
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
7169
7449
|
var UpdatableRenderer = {
|
|
7170
7450
|
canRenderType: "updatable",
|
|
7171
7451
|
render: ({ children, control, margin, tags }) => {
|
|
7172
|
-
return /* @__PURE__ */
|
|
7452
|
+
return /* @__PURE__ */ jsx107("div", { className: (0, import_classnames36.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children });
|
|
7173
7453
|
}
|
|
7174
7454
|
};
|
|
7175
7455
|
|
|
@@ -7180,7 +7460,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
7180
7460
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
7181
7461
|
|
|
7182
7462
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
7183
|
-
import { jsx as
|
|
7463
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
7184
7464
|
var UploadInputRenderer = {
|
|
7185
7465
|
canRenderType: "input-upload",
|
|
7186
7466
|
render: (props) => {
|
|
@@ -7209,7 +7489,7 @@ var UploadInputRenderer = {
|
|
|
7209
7489
|
};
|
|
7210
7490
|
return (
|
|
7211
7491
|
// We don't pass help here as there is no sensible place to display it
|
|
7212
|
-
/* @__PURE__ */
|
|
7492
|
+
/* @__PURE__ */ jsx108(
|
|
7213
7493
|
UploadFieldInput_default,
|
|
7214
7494
|
{
|
|
7215
7495
|
id,
|
|
@@ -7219,7 +7499,7 @@ var UploadInputRenderer = {
|
|
|
7219
7499
|
features,
|
|
7220
7500
|
control,
|
|
7221
7501
|
tags,
|
|
7222
|
-
children: /* @__PURE__ */
|
|
7502
|
+
children: /* @__PURE__ */ jsx108(
|
|
7223
7503
|
UploadInput2,
|
|
7224
7504
|
{
|
|
7225
7505
|
id,
|
|
@@ -7289,7 +7569,7 @@ var LargeUploadRenderer = {
|
|
|
7289
7569
|
};
|
|
7290
7570
|
const filetypes = acceptsToFileTypes(accepts);
|
|
7291
7571
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
7292
|
-
return /* @__PURE__ */
|
|
7572
|
+
return /* @__PURE__ */ jsx108(
|
|
7293
7573
|
FieldInput_default,
|
|
7294
7574
|
{
|
|
7295
7575
|
id,
|
|
@@ -7300,7 +7580,7 @@ var LargeUploadRenderer = {
|
|
|
7300
7580
|
features,
|
|
7301
7581
|
control,
|
|
7302
7582
|
tags,
|
|
7303
|
-
children: /* @__PURE__ */
|
|
7583
|
+
children: /* @__PURE__ */ jsx108(
|
|
7304
7584
|
Upload,
|
|
7305
7585
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
7306
7586
|
usAccept,
|
|
@@ -7316,21 +7596,21 @@ var LargeUploadRenderer = {
|
|
|
7316
7596
|
};
|
|
7317
7597
|
|
|
7318
7598
|
// ../renderers/src/UpsellRenderer.tsx
|
|
7319
|
-
var
|
|
7599
|
+
var import_classnames37 = __toESM(require_classnames());
|
|
7320
7600
|
import { Nudge } from "@transferwise/components";
|
|
7321
|
-
import { useState as
|
|
7322
|
-
import { jsx as
|
|
7601
|
+
import { useState as useState24 } from "react";
|
|
7602
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
7323
7603
|
var UpsellRenderer = {
|
|
7324
7604
|
canRenderType: "upsell",
|
|
7325
7605
|
render: UpsellRendererComponent
|
|
7326
7606
|
};
|
|
7327
7607
|
function UpsellRendererComponent(props) {
|
|
7328
7608
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
7329
|
-
const [isVisible, setIsVisible] =
|
|
7330
|
-
return isVisible ? /* @__PURE__ */
|
|
7609
|
+
const [isVisible, setIsVisible] = useState24(true);
|
|
7610
|
+
return isVisible ? /* @__PURE__ */ jsx109(
|
|
7331
7611
|
Nudge,
|
|
7332
7612
|
{
|
|
7333
|
-
className: (0,
|
|
7613
|
+
className: (0, import_classnames37.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
7334
7614
|
mediaName: getMediaName(media),
|
|
7335
7615
|
title: text,
|
|
7336
7616
|
action: __spreadValues({
|
|
@@ -7381,7 +7661,8 @@ var getWiseRenderers = () => [
|
|
|
7381
7661
|
CircularButtonRenderer,
|
|
7382
7662
|
BorderedBackgroundColoredBoxRenderer,
|
|
7383
7663
|
BoxRenderer_default,
|
|
7384
|
-
|
|
7664
|
+
CollectionRendererV2_default,
|
|
7665
|
+
CollectionRendererV1_default,
|
|
7385
7666
|
ButtonRenderer,
|
|
7386
7667
|
ColumnsRenderer_default,
|
|
7387
7668
|
DateInputRenderer_default,
|
|
@@ -7428,11 +7709,11 @@ var getWiseRenderers = () => [
|
|
|
7428
7709
|
|
|
7429
7710
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
7430
7711
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
7431
|
-
import { jsx as
|
|
7712
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
7432
7713
|
var InitialLoadingStateRenderer = {
|
|
7433
7714
|
canRenderType: "loading-state",
|
|
7434
7715
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
7435
|
-
render: () => /* @__PURE__ */
|
|
7716
|
+
render: () => /* @__PURE__ */ jsx110(
|
|
7436
7717
|
Loader2,
|
|
7437
7718
|
{
|
|
7438
7719
|
size: "md",
|
|
@@ -7445,24 +7726,24 @@ var InitialLoadingStateRenderer = {
|
|
|
7445
7726
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
7446
7727
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
7447
7728
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
7448
|
-
import { jsx as
|
|
7729
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
7449
7730
|
function DynamicFlowModal(props) {
|
|
7450
7731
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
7451
7732
|
const dfProps = useWiseToCoreProps(rest);
|
|
7452
7733
|
const df = useDynamicFlowModal(dfProps);
|
|
7453
|
-
return /* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ jsx111(
|
|
7454
7735
|
Modal5,
|
|
7455
7736
|
__spreadProps(__spreadValues({
|
|
7456
7737
|
className: `dynamic-flow-modal ${className}`,
|
|
7457
7738
|
disableDimmerClickToClose: true
|
|
7458
7739
|
}, df.modal), {
|
|
7459
|
-
body: /* @__PURE__ */
|
|
7740
|
+
body: /* @__PURE__ */ jsx111("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
7460
7741
|
})
|
|
7461
7742
|
);
|
|
7462
7743
|
}
|
|
7463
7744
|
|
|
7464
7745
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
7465
|
-
import { jsx as
|
|
7746
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
7466
7747
|
var wiseRenderers = getWiseRenderers();
|
|
7467
7748
|
var getMergedRenderers = (props) => {
|
|
7468
7749
|
var _d, _e;
|
|
@@ -7476,7 +7757,7 @@ var getMergedRenderers = (props) => {
|
|
|
7476
7757
|
method: initialRequest.method,
|
|
7477
7758
|
data: initialRequest.body
|
|
7478
7759
|
};
|
|
7479
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
7760
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx112(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx112(
|
|
7480
7761
|
DynamicFlowModal,
|
|
7481
7762
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
7482
7763
|
features: subflowFeatures,
|
|
@@ -7556,7 +7837,7 @@ var customEventsToAnalytics = {
|
|
|
7556
7837
|
|
|
7557
7838
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7558
7839
|
import { useCallback as useCallback2 } from "react";
|
|
7559
|
-
import { useIntl as
|
|
7840
|
+
import { useIntl as useIntl24 } from "react-intl";
|
|
7560
7841
|
|
|
7561
7842
|
// src/dynamicFlow/messages.ts
|
|
7562
7843
|
import { defineMessages as defineMessages16 } from "react-intl";
|
|
@@ -7575,7 +7856,7 @@ var messages_default = defineMessages16({
|
|
|
7575
7856
|
|
|
7576
7857
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7577
7858
|
var useOnCopy = () => {
|
|
7578
|
-
const { formatMessage } =
|
|
7859
|
+
const { formatMessage } = useIntl24();
|
|
7579
7860
|
const createSnackBar = useSnackBarIfAvailable();
|
|
7580
7861
|
return useCallback2(
|
|
7581
7862
|
(copiedContent) => {
|
|
@@ -7591,9 +7872,9 @@ var useOnCopy = () => {
|
|
|
7591
7872
|
|
|
7592
7873
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
7593
7874
|
import { useCallback as useCallback3 } from "react";
|
|
7594
|
-
import { useIntl as
|
|
7875
|
+
import { useIntl as useIntl25 } from "react-intl";
|
|
7595
7876
|
var useWiseHttpClient = (httpClient) => {
|
|
7596
|
-
const { locale } =
|
|
7877
|
+
const { locale } = useIntl25();
|
|
7597
7878
|
return useCallback3(
|
|
7598
7879
|
async (input, init = {}) => {
|
|
7599
7880
|
const headers = new Headers(init.headers);
|
|
@@ -7673,13 +7954,13 @@ var openLinkInNewTab = (url) => {
|
|
|
7673
7954
|
};
|
|
7674
7955
|
|
|
7675
7956
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7676
|
-
import { jsxs as
|
|
7957
|
+
import { jsxs as jsxs42 } from "react/jsx-runtime";
|
|
7677
7958
|
function DynamicFlow(props) {
|
|
7678
7959
|
const { className = "" } = props;
|
|
7679
7960
|
const dfProps = useWiseToCoreProps(props);
|
|
7680
7961
|
const df = useDynamicFlow(dfProps);
|
|
7681
7962
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
7682
|
-
return /* @__PURE__ */
|
|
7963
|
+
return /* @__PURE__ */ jsxs42("div", { className, onContextMenu, children: [
|
|
7683
7964
|
df.view,
|
|
7684
7965
|
contextMenu
|
|
7685
7966
|
] });
|
|
@@ -7691,7 +7972,7 @@ import {
|
|
|
7691
7972
|
useImperativeHandle
|
|
7692
7973
|
} from "react";
|
|
7693
7974
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
7694
|
-
import { jsx as
|
|
7975
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
7695
7976
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
7696
7977
|
const { className = "" } = props;
|
|
7697
7978
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -7707,7 +7988,7 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
7707
7988
|
}),
|
|
7708
7989
|
[df]
|
|
7709
7990
|
);
|
|
7710
|
-
return /* @__PURE__ */
|
|
7991
|
+
return /* @__PURE__ */ jsx113("div", { className, children: df.view });
|
|
7711
7992
|
});
|
|
7712
7993
|
|
|
7713
7994
|
// src/index.ts
|
|
@@ -7837,6 +8118,8 @@ var en_default = {
|
|
|
7837
8118
|
"df.wise.ButtonLayout.buttonLoadingMessage": "This might take a few seconds",
|
|
7838
8119
|
"df.wise.Collection.clearText": "Clear text",
|
|
7839
8120
|
"df.wise.Collection.loadMoreMessage": "Load more",
|
|
8121
|
+
"df.wise.Collection.showLessResultsButton": "Show less results",
|
|
8122
|
+
"df.wise.Collection.showMoreResultsButton": "Show all {count} results",
|
|
7840
8123
|
"df.wise.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
7841
8124
|
"df.wise.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|
|
7842
8125
|
"df.wise.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
|