@wise/dynamic-flow-client-internal 5.31.0 → 5.33.0-experimental-f7c2300
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/ar.json +2 -0
- package/build/i18n/cs.json +2 -0
- package/build/i18n/de.json +2 -0
- package/build/i18n/en.json +4 -0
- package/build/i18n/es.json +2 -0
- package/build/i18n/fr.json +2 -0
- package/build/i18n/hu.json +2 -0
- package/build/i18n/id.json +2 -0
- package/build/i18n/it.json +2 -0
- package/build/i18n/ja.json +2 -0
- package/build/i18n/ko.json +2 -0
- package/build/i18n/nl.json +2 -0
- package/build/i18n/pl.json +2 -0
- package/build/i18n/pt.json +2 -0
- package/build/i18n/ro.json +2 -0
- package/build/i18n/ru.json +2 -0
- package/build/i18n/sv.json +2 -0
- package/build/i18n/th.json +2 -0
- package/build/i18n/tr.json +2 -0
- package/build/i18n/uk.json +2 -0
- package/build/i18n/zh_CN.json +2 -0
- package/build/i18n/zh_HK.json +2 -0
- package/build/main.css +24 -0
- package/build/main.js +1515 -887
- package/build/main.mjs +1339 -705
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +8 -7
- 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 -44
- 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
|
}
|
|
@@ -127,7 +127,7 @@ import { useDynamicFlow } from "@wise/dynamic-flow-client";
|
|
|
127
127
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
128
128
|
var appVersion = (
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
130
|
-
typeof process !== "undefined" ? "5.
|
|
130
|
+
typeof process !== "undefined" ? "5.32.0" : "0.0.0"
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
// src/dynamicFlow/context-menu/useContextMenu.tsx
|
|
@@ -1535,6 +1535,7 @@ var getSupportingValues = (supportingValues) => {
|
|
|
1535
1535
|
};
|
|
1536
1536
|
|
|
1537
1537
|
// ../renderers/src/CheckboxInputRenderer.tsx
|
|
1538
|
+
var import_classnames11 = __toESM(require_classnames());
|
|
1538
1539
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1539
1540
|
var CheckboxInputRenderer = {
|
|
1540
1541
|
canRenderType: "input-checkbox",
|
|
@@ -1589,36 +1590,26 @@ var CheckboxComponent = (props) => {
|
|
|
1589
1590
|
);
|
|
1590
1591
|
};
|
|
1591
1592
|
var CheckboxItemComponent = (props) => {
|
|
1592
|
-
const {
|
|
1593
|
-
additionalText,
|
|
1594
|
-
description,
|
|
1595
|
-
disabled,
|
|
1596
|
-
inlineAlert,
|
|
1597
|
-
media,
|
|
1598
|
-
supportingValues,
|
|
1599
|
-
title,
|
|
1600
|
-
validationState,
|
|
1601
|
-
value,
|
|
1602
|
-
features,
|
|
1603
|
-
onChange
|
|
1604
|
-
} = props;
|
|
1593
|
+
const { validationState, value, features, onChange } = props;
|
|
1605
1594
|
const { ref } = useScrollToError(validationState, features);
|
|
1606
1595
|
return /* @__PURE__ */ jsx34("div", { ref, children: /* @__PURE__ */ jsx34(
|
|
1607
1596
|
ListItem3,
|
|
1608
|
-
__spreadProps(__spreadValues({
|
|
1609
|
-
title,
|
|
1610
|
-
subtitle: description,
|
|
1611
|
-
additionalInfo: getAdditionalText(additionalText),
|
|
1612
|
-
media: getMedia(media, false),
|
|
1613
|
-
disabled,
|
|
1614
|
-
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1597
|
+
__spreadProps(__spreadValues({}, getListItemProps(props)), {
|
|
1615
1598
|
control: /* @__PURE__ */ jsx34(ListItem3.Checkbox, { checked: value, onChange: () => onChange(!value) })
|
|
1616
|
-
}, getSupportingValues(supportingValues)), {
|
|
1617
|
-
className: controlAndTagsToCSSClass(props)
|
|
1618
1599
|
})
|
|
1619
1600
|
) });
|
|
1620
1601
|
};
|
|
1621
1602
|
var SwitchItemComponent = (props) => {
|
|
1603
|
+
const { validationState, value, features, onChange } = props;
|
|
1604
|
+
const { ref } = useScrollToError(validationState, features);
|
|
1605
|
+
return /* @__PURE__ */ jsx34("div", { ref, children: /* @__PURE__ */ jsx34(
|
|
1606
|
+
ListItem3,
|
|
1607
|
+
__spreadProps(__spreadValues({}, getListItemProps(props)), {
|
|
1608
|
+
control: /* @__PURE__ */ jsx34(ListItem3.Switch, { checked: value, onClick: () => onChange(!value) })
|
|
1609
|
+
})
|
|
1610
|
+
) });
|
|
1611
|
+
};
|
|
1612
|
+
var getListItemProps = (props) => {
|
|
1622
1613
|
const {
|
|
1623
1614
|
additionalText,
|
|
1624
1615
|
description,
|
|
@@ -1626,27 +1617,23 @@ var SwitchItemComponent = (props) => {
|
|
|
1626
1617
|
inlineAlert,
|
|
1627
1618
|
media,
|
|
1628
1619
|
supportingValues,
|
|
1620
|
+
tags,
|
|
1629
1621
|
title,
|
|
1630
|
-
validationState
|
|
1631
|
-
value,
|
|
1632
|
-
features,
|
|
1633
|
-
onChange
|
|
1622
|
+
validationState
|
|
1634
1623
|
} = props;
|
|
1635
|
-
const
|
|
1636
|
-
return
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
})
|
|
1649
|
-
) });
|
|
1624
|
+
const spotlight = (tags == null ? void 0 : tags.includes("spotlight-active")) ? "active" : (tags == null ? void 0 : tags.includes("spotlight-inactive")) ? "inactive" : void 0;
|
|
1625
|
+
return __spreadValues({
|
|
1626
|
+
additionalInfo: getAdditionalText(additionalText),
|
|
1627
|
+
className: (0, import_classnames11.default)(controlAndTagsToCSSClass(props), {
|
|
1628
|
+
"m-b-1": spotlight
|
|
1629
|
+
}),
|
|
1630
|
+
disabled,
|
|
1631
|
+
media: getMedia(media, false),
|
|
1632
|
+
prompt: getInlineAlertOrValidation(validationState, inlineAlert),
|
|
1633
|
+
spotlight,
|
|
1634
|
+
subtitle: description,
|
|
1635
|
+
title
|
|
1636
|
+
}, getSupportingValues(supportingValues));
|
|
1650
1637
|
};
|
|
1651
1638
|
var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
1652
1639
|
if ((validationState == null ? void 0 : validationState.status) === "invalid") {
|
|
@@ -1656,8 +1643,9 @@ var getInlineAlertOrValidation = (validationState, inlineAlert) => {
|
|
|
1656
1643
|
};
|
|
1657
1644
|
var CheckboxInputRenderer_default = CheckboxInputRenderer;
|
|
1658
1645
|
|
|
1659
|
-
// ../renderers/src/CollectionRenderer/
|
|
1646
|
+
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1660
1647
|
import { InlinePrompt, Link as DSLink } from "@transferwise/components";
|
|
1648
|
+
import { AnimatePresence, motion, MotionConfig } from "motion/react";
|
|
1661
1649
|
|
|
1662
1650
|
// ../renderers/src/messages/generic-error.messages.ts
|
|
1663
1651
|
import { defineMessages as defineMessages3 } from "react-intl";
|
|
@@ -1679,6 +1667,58 @@ var generic_error_messages_default = defineMessages3({
|
|
|
1679
1667
|
}
|
|
1680
1668
|
});
|
|
1681
1669
|
|
|
1670
|
+
// ../renderers/src/CollectionRenderer/CollectionRendererComponent.tsx
|
|
1671
|
+
import { useIntl as useIntl3 } from "react-intl";
|
|
1672
|
+
import { jsx as jsx35, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1673
|
+
var CollectionRendererComponent = (props) => {
|
|
1674
|
+
const { state, depth, pop, Search: Search5, Filters, Results, FocusedResults } = props;
|
|
1675
|
+
const { status, search } = state;
|
|
1676
|
+
const isForked = depth > 0;
|
|
1677
|
+
const isError = status.type === "error" && (status.reason === "search" || status.reason === "filter");
|
|
1678
|
+
return /* @__PURE__ */ jsx35(
|
|
1679
|
+
"div",
|
|
1680
|
+
{
|
|
1681
|
+
role: "presentation",
|
|
1682
|
+
onBlur: (event) => {
|
|
1683
|
+
const { target, relatedTarget, currentTarget } = event;
|
|
1684
|
+
const lostFocus = relatedTarget === null && (!target.isConnected || target.matches(":disabled"));
|
|
1685
|
+
if (isForked && !(search == null ? void 0 : search.query) && !lostFocus && !currentTarget.contains(relatedTarget)) {
|
|
1686
|
+
pop();
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
children: /* @__PURE__ */ jsxs6(MotionConfig, { reducedMotion: "user", children: [
|
|
1690
|
+
/* @__PURE__ */ jsx35(Search5, __spreadValues({}, props)),
|
|
1691
|
+
/* @__PURE__ */ jsx35(Filters, __spreadValues({}, props)),
|
|
1692
|
+
/* @__PURE__ */ jsx35(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx35(
|
|
1693
|
+
motion.div,
|
|
1694
|
+
{
|
|
1695
|
+
variants: contentVariants,
|
|
1696
|
+
initial: "enter",
|
|
1697
|
+
animate: "visible",
|
|
1698
|
+
exit: "exit",
|
|
1699
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
1700
|
+
children: isError ? /* @__PURE__ */ jsx35(SearchError, { retry: status.retry }) : isForked ? /* @__PURE__ */ jsx35(FocusedResults, __spreadValues({}, props)) : /* @__PURE__ */ jsx35(Results, __spreadValues({}, props))
|
|
1701
|
+
},
|
|
1702
|
+
isForked ? "forked" : "root"
|
|
1703
|
+
) })
|
|
1704
|
+
] })
|
|
1705
|
+
}
|
|
1706
|
+
);
|
|
1707
|
+
};
|
|
1708
|
+
var contentVariants = {
|
|
1709
|
+
enter: () => ({ opacity: 0, y: 12 }),
|
|
1710
|
+
visible: { opacity: 1, y: 0 },
|
|
1711
|
+
exit: () => ({ opacity: 0, y: -12 })
|
|
1712
|
+
};
|
|
1713
|
+
var SearchError = ({ retry }) => {
|
|
1714
|
+
const { formatMessage } = useIntl3();
|
|
1715
|
+
return /* @__PURE__ */ jsxs6(InlinePrompt, { width: "full", sentiment: "negative", children: [
|
|
1716
|
+
formatMessage(generic_error_messages_default.genericError),
|
|
1717
|
+
"\xA0",
|
|
1718
|
+
/* @__PURE__ */ jsx35(DSLink, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
1719
|
+
] });
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1682
1722
|
// ../../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
|
|
1683
1723
|
import * as React from "react";
|
|
1684
1724
|
import { flushSync } from "react-dom";
|
|
@@ -3215,14 +3255,14 @@ function useWindowVirtualizer(options) {
|
|
|
3215
3255
|
}, options));
|
|
3216
3256
|
}
|
|
3217
3257
|
|
|
3218
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3258
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3219
3259
|
import { ProcessIndicator, Button as Button4 } from "@transferwise/components";
|
|
3220
3260
|
import { useRef as useRef4, useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useState as useState8 } from "react";
|
|
3221
3261
|
|
|
3222
3262
|
// ../renderers/src/step/StepFooter.tsx
|
|
3223
3263
|
import { Button as Button3 } from "@transferwise/components";
|
|
3224
3264
|
import { useEffect as useEffect6, useRef as useRef3, useState as useState7 } from "react";
|
|
3225
|
-
import { useIntl as
|
|
3265
|
+
import { useIntl as useIntl4 } from "react-intl";
|
|
3226
3266
|
|
|
3227
3267
|
// ../renderers/src/messages/step.messages.ts
|
|
3228
3268
|
import { defineMessages as defineMessages4 } from "react-intl";
|
|
@@ -3235,23 +3275,23 @@ var step_messages_default = defineMessages4({
|
|
|
3235
3275
|
});
|
|
3236
3276
|
|
|
3237
3277
|
// ../renderers/src/step/StepFooter.tsx
|
|
3238
|
-
import { Fragment as Fragment2, jsx as
|
|
3278
|
+
import { Fragment as Fragment2, jsx as jsx36, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3239
3279
|
var SCROLL_TO_BOTTOM = "scroll-to-bottom";
|
|
3240
3280
|
var StepFooter = ({ footer, tags }) => {
|
|
3241
3281
|
if (tags == null ? void 0 : tags.includes(SCROLL_TO_BOTTOM)) {
|
|
3242
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx36(FooterWithScrollButton, { footer });
|
|
3243
3283
|
}
|
|
3244
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ jsx36(DefaultFooter, { footer });
|
|
3245
3285
|
};
|
|
3246
3286
|
var DefaultFooter = ({ footer }) => {
|
|
3247
3287
|
const hasFooter = footer && Array.isArray(footer) && footer.length > 0;
|
|
3248
|
-
return hasFooter ? /* @__PURE__ */
|
|
3288
|
+
return hasFooter ? /* @__PURE__ */ jsx36("div", { className: "df-step-fixed__footer", children: footer }) : void 0;
|
|
3249
3289
|
};
|
|
3250
3290
|
var FooterWithScrollButton = ({ footer }) => {
|
|
3251
|
-
const { formatMessage } =
|
|
3291
|
+
const { formatMessage } = useIntl4();
|
|
3252
3292
|
const endOfLayoutRef = useRef3(null);
|
|
3253
3293
|
const isElementVisible = useIsElementVisible(endOfLayoutRef);
|
|
3254
|
-
const scrollButton = /* @__PURE__ */
|
|
3294
|
+
const scrollButton = /* @__PURE__ */ jsx36(
|
|
3255
3295
|
Button3,
|
|
3256
3296
|
{
|
|
3257
3297
|
className: "m-b-1",
|
|
@@ -3267,11 +3307,11 @@ var FooterWithScrollButton = ({ footer }) => {
|
|
|
3267
3307
|
);
|
|
3268
3308
|
const hasStepFooterContent = footer && Array.isArray(footer) && footer.length > 0;
|
|
3269
3309
|
if (isElementVisible && !hasStepFooterContent) {
|
|
3270
|
-
return /* @__PURE__ */
|
|
3310
|
+
return /* @__PURE__ */ jsx36("div", { ref: endOfLayoutRef, "aria-hidden": "true" });
|
|
3271
3311
|
}
|
|
3272
|
-
return /* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3312
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
3313
|
+
/* @__PURE__ */ jsx36("div", { ref: endOfLayoutRef, "aria-hidden": "true" }),
|
|
3314
|
+
/* @__PURE__ */ jsxs7("div", { className: "df-step-fixed__footer", children: [
|
|
3275
3315
|
!isElementVisible && scrollButton,
|
|
3276
3316
|
footer
|
|
3277
3317
|
] })
|
|
@@ -3294,8 +3334,8 @@ var useIsElementVisible = (elementRef, root = null) => {
|
|
|
3294
3334
|
return isVisible;
|
|
3295
3335
|
};
|
|
3296
3336
|
|
|
3297
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3298
|
-
import { useIntl as
|
|
3337
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3338
|
+
import { useIntl as useIntl5 } from "react-intl";
|
|
3299
3339
|
|
|
3300
3340
|
// ../renderers/src/messages/collection.messages.ts
|
|
3301
3341
|
import { defineMessages as defineMessages5 } from "react-intl";
|
|
@@ -3309,6 +3349,16 @@ var collection_messages_default = defineMessages5({
|
|
|
3309
3349
|
id: "df.wise.Collection.clearText",
|
|
3310
3350
|
defaultMessage: "Clear text",
|
|
3311
3351
|
description: "A message shown at the edge of the search bar to clear the users query"
|
|
3352
|
+
},
|
|
3353
|
+
showMoreResultsButton: {
|
|
3354
|
+
id: "df.wise.Collection.showMoreResultsButton",
|
|
3355
|
+
defaultMessage: "Show all {count} results",
|
|
3356
|
+
description: "A message shown at the bottom of a truncated list of items, clicking will expand to show more"
|
|
3357
|
+
},
|
|
3358
|
+
showLessResultsButton: {
|
|
3359
|
+
id: "df.wise.Collection.showLessResultsButton",
|
|
3360
|
+
defaultMessage: "Show less results",
|
|
3361
|
+
description: "A message shown at the bottom of an expanded list of items, clicking will truncate to show only a few"
|
|
3312
3362
|
}
|
|
3313
3363
|
});
|
|
3314
3364
|
|
|
@@ -3332,10 +3382,48 @@ var getScrollableAncestor = (element) => {
|
|
|
3332
3382
|
return null;
|
|
3333
3383
|
};
|
|
3334
3384
|
|
|
3335
|
-
// ../renderers/src/CollectionRenderer/components/
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3385
|
+
// ../renderers/src/CollectionRenderer/components/flattenCollectionItems.ts
|
|
3386
|
+
var flattenCollectionItems = (sections) => {
|
|
3387
|
+
return sections.flatMap((section) => {
|
|
3388
|
+
if (section.type === "items") {
|
|
3389
|
+
return flattenItemsBody(section);
|
|
3390
|
+
}
|
|
3391
|
+
if (section.type === "layout") {
|
|
3392
|
+
return flattenLayoutBody(section);
|
|
3393
|
+
}
|
|
3394
|
+
return [];
|
|
3395
|
+
});
|
|
3396
|
+
};
|
|
3397
|
+
var flattenItemsBody = (section) => {
|
|
3398
|
+
return [
|
|
3399
|
+
...flattenSectionHeader(section),
|
|
3400
|
+
...section.items.map((item) => ({
|
|
3401
|
+
item,
|
|
3402
|
+
type: "item"
|
|
3403
|
+
}))
|
|
3404
|
+
];
|
|
3405
|
+
};
|
|
3406
|
+
var flattenLayoutBody = (section) => [
|
|
3407
|
+
...flattenSectionHeader(section),
|
|
3408
|
+
__spreadProps(__spreadValues({}, section), {
|
|
3409
|
+
type: "layout"
|
|
3410
|
+
})
|
|
3411
|
+
];
|
|
3412
|
+
var flattenSectionHeader = (section) => section.title ? [
|
|
3413
|
+
{
|
|
3414
|
+
type: "header",
|
|
3415
|
+
title: section.title,
|
|
3416
|
+
items: section.type === "items" ? section.items : void 0,
|
|
3417
|
+
id: section.id,
|
|
3418
|
+
callToAction: section.callToAction
|
|
3419
|
+
}
|
|
3420
|
+
] : [];
|
|
3421
|
+
|
|
3422
|
+
// ../renderers/src/CollectionRenderer/components/VirtualisedContentComponent.tsx
|
|
3423
|
+
import { jsx as jsx37, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3424
|
+
var VirtualisedContentComponent = (props) => {
|
|
3425
|
+
const { state, SectionHeader, Item } = props;
|
|
3426
|
+
const { status } = state;
|
|
3339
3427
|
const contentRef = useRef4(null);
|
|
3340
3428
|
const [scrollElement, setScrollElement] = useState8(null);
|
|
3341
3429
|
useLayoutEffect2(() => {
|
|
@@ -3352,34 +3440,20 @@ var ContentComponent = (props) => {
|
|
|
3352
3440
|
status.loadMore();
|
|
3353
3441
|
}
|
|
3354
3442
|
}, [isBottomVisible, state.afterSectionsProps.length, status]);
|
|
3355
|
-
const stateCount = state.sections.reduce(
|
|
3356
|
-
|
|
3357
|
-
0
|
|
3358
|
-
);
|
|
3359
|
-
const items = state.sections
|
|
3360
|
-
...section.title ? [
|
|
3361
|
-
{
|
|
3362
|
-
type: "header",
|
|
3363
|
-
title: section.title,
|
|
3364
|
-
items: section.items,
|
|
3365
|
-
id: section.id,
|
|
3366
|
-
callToAction: section.callToAction
|
|
3367
|
-
}
|
|
3368
|
-
] : [],
|
|
3369
|
-
...section.items.map((item) => ({
|
|
3370
|
-
item,
|
|
3371
|
-
type: "item"
|
|
3372
|
-
}))
|
|
3373
|
-
]);
|
|
3443
|
+
const stateCount = state.sections.reduce((total, section) => {
|
|
3444
|
+
const count = section.type === "items" ? section.items.length : 1;
|
|
3445
|
+
return count + total + (section.title ? 1 : 0);
|
|
3446
|
+
}, 0);
|
|
3447
|
+
const items = flattenCollectionItems(state.sections);
|
|
3374
3448
|
const listRef = useRef4(null);
|
|
3375
3449
|
const listOffsetRef = useRef4(0);
|
|
3376
3450
|
useLayoutEffect2(() => {
|
|
3377
3451
|
var _a, _b;
|
|
3378
3452
|
listOffsetRef.current = (_b = (_a = listRef.current) == null ? void 0 : _a.offsetTop) != null ? _b : 0;
|
|
3379
3453
|
});
|
|
3380
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ jsxs8("div", { ref: contentRef, children: [
|
|
3381
3455
|
state.beforeSections,
|
|
3382
|
-
scrollElement ? /* @__PURE__ */
|
|
3456
|
+
scrollElement ? /* @__PURE__ */ jsx37(
|
|
3383
3457
|
ElementVirtualizedItems,
|
|
3384
3458
|
{
|
|
3385
3459
|
Item,
|
|
@@ -3388,7 +3462,7 @@ var ContentComponent = (props) => {
|
|
|
3388
3462
|
scrollElement,
|
|
3389
3463
|
stateCount
|
|
3390
3464
|
}
|
|
3391
|
-
) : /* @__PURE__ */
|
|
3465
|
+
) : /* @__PURE__ */ jsx37(
|
|
3392
3466
|
WindowVirtualizedItems,
|
|
3393
3467
|
{
|
|
3394
3468
|
Item,
|
|
@@ -3397,7 +3471,7 @@ var ContentComponent = (props) => {
|
|
|
3397
3471
|
stateCount
|
|
3398
3472
|
}
|
|
3399
3473
|
),
|
|
3400
|
-
/* @__PURE__ */
|
|
3474
|
+
/* @__PURE__ */ jsx37("div", { ref: endOfContentRef, className: "d-flex m-x-auto m-y-2", children: /* @__PURE__ */ jsx37(PaginationComponent, { state }) }),
|
|
3401
3475
|
state.afterSections
|
|
3402
3476
|
] });
|
|
3403
3477
|
};
|
|
@@ -3409,7 +3483,7 @@ var WindowVirtualizedItems = (props) => {
|
|
|
3409
3483
|
estimateSize: () => 120,
|
|
3410
3484
|
overscan: 10
|
|
3411
3485
|
});
|
|
3412
|
-
return /* @__PURE__ */
|
|
3486
|
+
return /* @__PURE__ */ jsx37(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3413
3487
|
};
|
|
3414
3488
|
var ElementVirtualizedItems = (props) => {
|
|
3415
3489
|
const { scrollElement, stateCount } = props;
|
|
@@ -3420,7 +3494,7 @@ var ElementVirtualizedItems = (props) => {
|
|
|
3420
3494
|
estimateSize: () => 120,
|
|
3421
3495
|
overscan: 10
|
|
3422
3496
|
});
|
|
3423
|
-
return /* @__PURE__ */
|
|
3497
|
+
return /* @__PURE__ */ jsx37(VirtualizedItems, __spreadProps(__spreadValues({}, props), { virtualItemsRef, virtualizer }));
|
|
3424
3498
|
};
|
|
3425
3499
|
var VirtualizedItems = ({
|
|
3426
3500
|
Item,
|
|
@@ -3428,7 +3502,7 @@ var VirtualizedItems = ({
|
|
|
3428
3502
|
items,
|
|
3429
3503
|
virtualItemsRef,
|
|
3430
3504
|
virtualizer
|
|
3431
|
-
}) => /* @__PURE__ */
|
|
3505
|
+
}) => /* @__PURE__ */ jsx37(
|
|
3432
3506
|
"div",
|
|
3433
3507
|
{
|
|
3434
3508
|
ref: virtualItemsRef,
|
|
@@ -3442,7 +3516,7 @@ var VirtualizedItems = ({
|
|
|
3442
3516
|
if (!i) {
|
|
3443
3517
|
return null;
|
|
3444
3518
|
}
|
|
3445
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsxs8(
|
|
3446
3520
|
"div",
|
|
3447
3521
|
{
|
|
3448
3522
|
ref: virtualizer.measureElement,
|
|
@@ -3454,17 +3528,19 @@ var VirtualizedItems = ({
|
|
|
3454
3528
|
width: "100%",
|
|
3455
3529
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
3456
3530
|
},
|
|
3457
|
-
children:
|
|
3531
|
+
children: [
|
|
3532
|
+
i.type === "header" && /* @__PURE__ */ jsx37(SectionHeader, __spreadValues({}, i)),
|
|
3533
|
+
i.type === "item" && /* @__PURE__ */ jsx37(Item, __spreadValues({}, i.item)),
|
|
3534
|
+
i.type === "layout" && i.children
|
|
3535
|
+
]
|
|
3458
3536
|
},
|
|
3459
3537
|
item.key
|
|
3460
3538
|
);
|
|
3461
3539
|
})
|
|
3462
3540
|
}
|
|
3463
3541
|
);
|
|
3464
|
-
var PaginationComponent = ({
|
|
3465
|
-
status
|
|
3466
|
-
state
|
|
3467
|
-
}) => {
|
|
3542
|
+
var PaginationComponent = ({ state }) => {
|
|
3543
|
+
const { status } = state;
|
|
3468
3544
|
const isPaginationError = status.type === "error" && status.reason === "pagination";
|
|
3469
3545
|
const isPaginationLoading = status.type === "loading" && status.reason === "pagination";
|
|
3470
3546
|
const loadMore = status.type === "idle" ? status.loadMore : void 0;
|
|
@@ -3472,34 +3548,41 @@ var PaginationComponent = ({
|
|
|
3472
3548
|
return null;
|
|
3473
3549
|
}
|
|
3474
3550
|
if (isPaginationError) {
|
|
3475
|
-
return /* @__PURE__ */
|
|
3551
|
+
return /* @__PURE__ */ jsx37(LoadMoreButton, { onClick: status.retry });
|
|
3476
3552
|
}
|
|
3477
3553
|
if (state.afterSectionsProps.length > 0 && loadMore) {
|
|
3478
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ jsx37(LoadMoreButton, { onClick: loadMore });
|
|
3479
3555
|
}
|
|
3480
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ jsx37(ProcessIndicator, { size: "xs", "data-testid": "collection-pagination-loader" });
|
|
3481
3557
|
};
|
|
3482
3558
|
var LoadMoreButton = ({ onClick }) => {
|
|
3483
|
-
const { formatMessage } =
|
|
3484
|
-
return /* @__PURE__ */
|
|
3559
|
+
const { formatMessage } = useIntl5();
|
|
3560
|
+
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) }) });
|
|
3485
3561
|
};
|
|
3486
3562
|
|
|
3487
|
-
// ../renderers/src/CollectionRenderer/
|
|
3563
|
+
// ../renderers/src/CollectionRenderer/v1/FilterComponent.tsx
|
|
3488
3564
|
import { Chips } from "@transferwise/components";
|
|
3489
|
-
import { jsx as
|
|
3490
|
-
var FiltersComponent = (
|
|
3491
|
-
const {
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3565
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3566
|
+
var FiltersComponent = (props) => {
|
|
3567
|
+
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3568
|
+
const { filters } = collectionProps.state;
|
|
3569
|
+
return /* @__PURE__ */ jsx38("div", { className: "df-filters-container", children: filters.map((filter) => {
|
|
3570
|
+
var _a2;
|
|
3571
|
+
return /* @__PURE__ */ jsx38(
|
|
3572
|
+
Filter,
|
|
3573
|
+
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3574
|
+
filter
|
|
3575
|
+
}),
|
|
3576
|
+
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3577
|
+
);
|
|
3495
3578
|
}) });
|
|
3496
3579
|
};
|
|
3497
|
-
var FilterComponent = (filter) => {
|
|
3580
|
+
var FilterComponent = ({ filter }) => {
|
|
3498
3581
|
const { multiSelect, options } = filter;
|
|
3499
3582
|
if (!options) {
|
|
3500
3583
|
return null;
|
|
3501
3584
|
}
|
|
3502
|
-
return /* @__PURE__ */
|
|
3585
|
+
return /* @__PURE__ */ jsx38(
|
|
3503
3586
|
Chips,
|
|
3504
3587
|
{
|
|
3505
3588
|
className: "m-b-1",
|
|
@@ -3529,7 +3612,7 @@ import { ListItem as ListItem6 } from "@transferwise/components";
|
|
|
3529
3612
|
|
|
3530
3613
|
// ../renderers/src/utils/listItem/getAdditionalInfo.tsx
|
|
3531
3614
|
import { ListItem as ListItem4 } from "@transferwise/components";
|
|
3532
|
-
import { jsx as
|
|
3615
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3533
3616
|
var getAdditionalInfo = (additionalInfo) => {
|
|
3534
3617
|
var _a, _b;
|
|
3535
3618
|
if (!additionalInfo) {
|
|
@@ -3537,7 +3620,7 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3537
3620
|
}
|
|
3538
3621
|
const { href, text, onClick } = additionalInfo;
|
|
3539
3622
|
if (href || onClick) {
|
|
3540
|
-
return /* @__PURE__ */
|
|
3623
|
+
return /* @__PURE__ */ jsx39(
|
|
3541
3624
|
ListItem4.AdditionalInfo,
|
|
3542
3625
|
{
|
|
3543
3626
|
action: __spreadValues({
|
|
@@ -3546,19 +3629,19 @@ var getAdditionalInfo = (additionalInfo) => {
|
|
|
3546
3629
|
}
|
|
3547
3630
|
);
|
|
3548
3631
|
}
|
|
3549
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ jsx39(ListItem4.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
|
|
3550
3633
|
};
|
|
3551
3634
|
|
|
3552
3635
|
// ../renderers/src/utils/listItem/getCTAControl.tsx
|
|
3553
3636
|
import { ListItem as ListItem5 } from "@transferwise/components";
|
|
3554
|
-
import { jsx as
|
|
3637
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3555
3638
|
var getCTAControl = (callToAction, { ctaSecondary, fullyInteractive }) => {
|
|
3556
3639
|
if (!callToAction) {
|
|
3557
3640
|
return void 0;
|
|
3558
3641
|
}
|
|
3559
3642
|
const { accessibilityDescription, title, context } = callToAction;
|
|
3560
3643
|
const { priority, sentiment } = getPriorityAndSentiment(ctaSecondary, context);
|
|
3561
|
-
return /* @__PURE__ */
|
|
3644
|
+
return /* @__PURE__ */ jsx40(
|
|
3562
3645
|
ListItem5.Button,
|
|
3563
3646
|
__spreadProps(__spreadValues({}, callToAction.getAnchorProps()), {
|
|
3564
3647
|
partiallyInteractive: !fullyInteractive,
|
|
@@ -3583,7 +3666,7 @@ var shouldUseAvatar = (control, tags) => {
|
|
|
3583
3666
|
};
|
|
3584
3667
|
|
|
3585
3668
|
// ../renderers/src/CollectionRenderer/components/ItemComponent.tsx
|
|
3586
|
-
import { jsx as
|
|
3669
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3587
3670
|
var ItemComponent = (props) => {
|
|
3588
3671
|
var _a, _b;
|
|
3589
3672
|
const {
|
|
@@ -3605,7 +3688,7 @@ var ItemComponent = (props) => {
|
|
|
3605
3688
|
ctaSecondary: (_a = tags == null ? void 0 : tags.includes("cta-secondary")) != null ? _a : false,
|
|
3606
3689
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
3607
3690
|
};
|
|
3608
|
-
return /* @__PURE__ */
|
|
3691
|
+
return /* @__PURE__ */ jsx41(
|
|
3609
3692
|
ListItem6,
|
|
3610
3693
|
{
|
|
3611
3694
|
title,
|
|
@@ -3622,15 +3705,15 @@ var ItemComponent = (props) => {
|
|
|
3622
3705
|
};
|
|
3623
3706
|
var getNavigationControl = (onClick, href) => {
|
|
3624
3707
|
if (href) {
|
|
3625
|
-
return /* @__PURE__ */
|
|
3708
|
+
return /* @__PURE__ */ jsx41(ListItem6.Navigation, { href });
|
|
3626
3709
|
}
|
|
3627
3710
|
if (onClick) {
|
|
3628
|
-
return /* @__PURE__ */
|
|
3711
|
+
return /* @__PURE__ */ jsx41(ListItem6.Navigation, { onClick });
|
|
3629
3712
|
}
|
|
3630
3713
|
return null;
|
|
3631
3714
|
};
|
|
3632
3715
|
|
|
3633
|
-
// ../renderers/src/CollectionRenderer/
|
|
3716
|
+
// ../renderers/src/CollectionRenderer/v1/SearchComponent.tsx
|
|
3634
3717
|
import {
|
|
3635
3718
|
InputGroup,
|
|
3636
3719
|
Input,
|
|
@@ -3638,46 +3721,41 @@ import {
|
|
|
3638
3721
|
IconButton
|
|
3639
3722
|
} from "@transferwise/components";
|
|
3640
3723
|
import { CrossCircleFill, Search } from "@transferwise/icons";
|
|
3641
|
-
import { useIntl as
|
|
3642
|
-
import { jsx as
|
|
3643
|
-
var SearchComponent = ({
|
|
3644
|
-
|
|
3645
|
-
status,
|
|
3646
|
-
features,
|
|
3647
|
-
control,
|
|
3648
|
-
tags
|
|
3649
|
-
}) => {
|
|
3724
|
+
import { useIntl as useIntl6 } from "react-intl";
|
|
3725
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3726
|
+
var SearchComponent = ({ state, features, control, tags }) => {
|
|
3727
|
+
var _a;
|
|
3650
3728
|
const { search } = state;
|
|
3651
|
-
const { formatMessage } =
|
|
3729
|
+
const { formatMessage } = useIntl6();
|
|
3652
3730
|
if (!search) {
|
|
3653
3731
|
return;
|
|
3654
3732
|
}
|
|
3655
3733
|
const getAddon = () => {
|
|
3656
|
-
var
|
|
3657
|
-
if (status.type === "loading") {
|
|
3658
|
-
return { content: /* @__PURE__ */
|
|
3734
|
+
var _a2;
|
|
3735
|
+
if (state.status.type === "loading") {
|
|
3736
|
+
return { content: /* @__PURE__ */ jsx42(ProcessIndicator2, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3659
3737
|
}
|
|
3660
|
-
if ((
|
|
3738
|
+
if ((_a2 = state.search) == null ? void 0 : _a2.query) {
|
|
3661
3739
|
return {
|
|
3662
3740
|
interactive: true,
|
|
3663
|
-
content: /* @__PURE__ */
|
|
3741
|
+
content: /* @__PURE__ */ jsx42(
|
|
3664
3742
|
IconButton,
|
|
3665
3743
|
{
|
|
3666
3744
|
priority: "minimal",
|
|
3667
3745
|
size: 24,
|
|
3668
3746
|
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
3669
3747
|
onClick: () => {
|
|
3670
|
-
var
|
|
3671
|
-
return (
|
|
3748
|
+
var _a3;
|
|
3749
|
+
return (_a3 = state.search) == null ? void 0 : _a3.onChange("");
|
|
3672
3750
|
},
|
|
3673
|
-
children: /* @__PURE__ */
|
|
3751
|
+
children: /* @__PURE__ */ jsx42(CrossCircleFill, {})
|
|
3674
3752
|
}
|
|
3675
3753
|
)
|
|
3676
3754
|
};
|
|
3677
3755
|
}
|
|
3678
3756
|
return void 0;
|
|
3679
3757
|
};
|
|
3680
|
-
return /* @__PURE__ */
|
|
3758
|
+
return /* @__PURE__ */ jsx42(
|
|
3681
3759
|
FieldInput_default,
|
|
3682
3760
|
{
|
|
3683
3761
|
id: "search",
|
|
@@ -3688,13 +3766,13 @@ var SearchComponent = ({
|
|
|
3688
3766
|
features,
|
|
3689
3767
|
control,
|
|
3690
3768
|
tags,
|
|
3691
|
-
children: /* @__PURE__ */
|
|
3769
|
+
children: /* @__PURE__ */ jsx42(InputGroup, { addonStart: { content: /* @__PURE__ */ jsx42(Search, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ jsx42(
|
|
3692
3770
|
Input,
|
|
3693
3771
|
{
|
|
3694
3772
|
id: "search",
|
|
3695
3773
|
name: "search",
|
|
3696
3774
|
shape: "pill",
|
|
3697
|
-
placeholder: search.
|
|
3775
|
+
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
3698
3776
|
type: "text",
|
|
3699
3777
|
value: search.query,
|
|
3700
3778
|
onChange: ({ currentTarget: { value } }) => {
|
|
@@ -3707,14 +3785,74 @@ var SearchComponent = ({
|
|
|
3707
3785
|
};
|
|
3708
3786
|
|
|
3709
3787
|
// ../renderers/src/CollectionRenderer/components/SectionHeaderComponent.tsx
|
|
3710
|
-
import { jsx as
|
|
3788
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3711
3789
|
var SectionHeaderComponent = ({
|
|
3712
3790
|
title,
|
|
3713
3791
|
callToAction
|
|
3714
|
-
}) => /* @__PURE__ */
|
|
3792
|
+
}) => /* @__PURE__ */ jsx43(Header, { title, callToAction });
|
|
3793
|
+
|
|
3794
|
+
// ../renderers/src/CollectionRenderer/components/CollapsibleContentComponent.tsx
|
|
3795
|
+
import { useState as useState9 } from "react";
|
|
3796
|
+
import { Button as Button5 } from "@transferwise/components";
|
|
3797
|
+
import { useIntl as useIntl7 } from "react-intl";
|
|
3798
|
+
import { Fragment as Fragment3, jsx as jsx44, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3799
|
+
var CollapsibleContentComponent = (props) => {
|
|
3800
|
+
var _a;
|
|
3801
|
+
const { state, SectionHeader, Item } = props;
|
|
3802
|
+
const { search, status } = state;
|
|
3803
|
+
const [isShowingInitialState, setIsShowingInitialState] = useState9(true);
|
|
3804
|
+
const isSearchRunning = status.type === "loading" && status.reason === "search";
|
|
3805
|
+
const shouldShowInitialState = !(search == null ? void 0 : search.query) || isSearchRunning && isShowingInitialState;
|
|
3806
|
+
if (shouldShowInitialState !== isShowingInitialState) {
|
|
3807
|
+
setIsShowingInitialState(shouldShowInitialState);
|
|
3808
|
+
}
|
|
3809
|
+
const sections = shouldShowInitialState ? (_a = search == null ? void 0 : search.initialSections) != null ? _a : state.sections : state.sections;
|
|
3810
|
+
return (
|
|
3811
|
+
// keep focus in the search input when clicking the results, so clicking doesn't blur it and
|
|
3812
|
+
// pop the collection before the click is handled
|
|
3813
|
+
/* @__PURE__ */ jsx44("div", { role: "presentation", onMouseDown: (event) => event.preventDefault(), children: sections.map((section) => {
|
|
3814
|
+
return /* @__PURE__ */ jsx44(Section, { section, SectionHeader, Item }, section.id);
|
|
3815
|
+
}) })
|
|
3816
|
+
);
|
|
3817
|
+
};
|
|
3818
|
+
var Section = ({ section, SectionHeader, Item }) => {
|
|
3819
|
+
const { formatMessage } = useIntl7();
|
|
3820
|
+
const [expanded, setExpanded] = useState9(false);
|
|
3821
|
+
const itemIds = section.type === "items" ? section.items.map(({ id }) => id).join("") : section.id;
|
|
3822
|
+
const [prevItemIds, setPrevItemIds] = useState9(itemIds);
|
|
3823
|
+
if (itemIds !== prevItemIds) {
|
|
3824
|
+
setExpanded(false);
|
|
3825
|
+
setPrevItemIds(itemIds);
|
|
3826
|
+
}
|
|
3827
|
+
const showLoadMore = section.type === "items" && section.items.some((item) => {
|
|
3828
|
+
var _a;
|
|
3829
|
+
return (_a = item.tags) == null ? void 0 : _a.includes("hidden");
|
|
3830
|
+
});
|
|
3831
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3832
|
+
/* @__PURE__ */ jsx44(SectionHeader, __spreadValues({}, section)),
|
|
3833
|
+
section.type === "items" && section.items.filter((item) => {
|
|
3834
|
+
var _a;
|
|
3835
|
+
return expanded || !((_a = item.tags) == null ? void 0 : _a.includes("hidden"));
|
|
3836
|
+
}).map((item) => /* @__PURE__ */ jsx44(Item, __spreadValues({}, item), item.id)),
|
|
3837
|
+
section.type === "layout" && section.children,
|
|
3838
|
+
showLoadMore ? /* @__PURE__ */ jsx44(
|
|
3839
|
+
Button5,
|
|
3840
|
+
{
|
|
3841
|
+
priority: "tertiary",
|
|
3842
|
+
onClick: () => {
|
|
3843
|
+
setExpanded(!expanded);
|
|
3844
|
+
},
|
|
3845
|
+
children: expanded ? /* @__PURE__ */ jsxs9("span", { children: [
|
|
3846
|
+
formatMessage(collection_messages_default.showLessResultsButton),
|
|
3847
|
+
" "
|
|
3848
|
+
] }) : /* @__PURE__ */ jsx44("span", { children: formatMessage(collection_messages_default.showMoreResultsButton, { count: section.items.length }) })
|
|
3849
|
+
}
|
|
3850
|
+
) : void 0
|
|
3851
|
+
] });
|
|
3852
|
+
};
|
|
3715
3853
|
|
|
3716
3854
|
// ../renderers/src/CollectionRenderer/createCollectionRenderer.tsx
|
|
3717
|
-
import { jsx as
|
|
3855
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
3718
3856
|
var createCollectionRenderer = (canRender, components) => {
|
|
3719
3857
|
const componentsWithDefaults = __spreadValues({
|
|
3720
3858
|
Search: SearchComponent,
|
|
@@ -3722,48 +3860,208 @@ var createCollectionRenderer = (canRender, components) => {
|
|
|
3722
3860
|
Filter: FilterComponent,
|
|
3723
3861
|
Item: ItemComponent,
|
|
3724
3862
|
SectionHeader: SectionHeaderComponent,
|
|
3725
|
-
Results:
|
|
3863
|
+
Results: VirtualisedContentComponent,
|
|
3864
|
+
FocusedResults: CollapsibleContentComponent
|
|
3726
3865
|
}, components);
|
|
3727
3866
|
return {
|
|
3728
3867
|
canRenderType: "collection",
|
|
3729
3868
|
canRender,
|
|
3730
3869
|
render: (props) => {
|
|
3731
|
-
return /* @__PURE__ */
|
|
3870
|
+
return /* @__PURE__ */ jsx45(CollectionRendererComponent, __spreadValues(__spreadValues({}, props), componentsWithDefaults));
|
|
3732
3871
|
}
|
|
3733
3872
|
};
|
|
3734
3873
|
};
|
|
3735
3874
|
|
|
3736
|
-
// ../renderers/src/CollectionRenderer/
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3875
|
+
// ../renderers/src/CollectionRenderer/v1/CollectionRendererV1.tsx
|
|
3876
|
+
var CollectionRendererV1 = createCollectionRenderer(
|
|
3877
|
+
() => true
|
|
3878
|
+
);
|
|
3879
|
+
var CollectionRendererV1_default = CollectionRendererV1;
|
|
3880
|
+
|
|
3881
|
+
// ../renderers/src/CollectionRenderer/v2/FilterComponent.tsx
|
|
3882
|
+
var import_classnames12 = __toESM(require_classnames());
|
|
3883
|
+
import { Chips as Chips2 } from "@transferwise/components";
|
|
3884
|
+
import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
|
|
3885
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3886
|
+
var FiltersComponent2 = (props) => {
|
|
3887
|
+
var _b;
|
|
3888
|
+
const _a = props, { Filter } = _a, collectionProps = __objRest(_a, ["Filter"]);
|
|
3889
|
+
const { state, depth } = collectionProps;
|
|
3890
|
+
const { filters, status } = state;
|
|
3891
|
+
const isHidden = depth > 0 && !((_b = state.search) == null ? void 0 : _b.query);
|
|
3892
|
+
return /* @__PURE__ */ jsx46(AnimatePresence2, { initial: false, children: !isHidden && /* @__PURE__ */ jsx46(
|
|
3893
|
+
motion2.div,
|
|
3894
|
+
{
|
|
3895
|
+
variants: filtersVariants,
|
|
3896
|
+
initial: "collapsed",
|
|
3897
|
+
animate: "expanded",
|
|
3898
|
+
exit: "collapsed",
|
|
3899
|
+
transition: { duration: 0.15, ease: "easeOut" },
|
|
3900
|
+
children: /* @__PURE__ */ jsx46(
|
|
3901
|
+
"div",
|
|
3902
|
+
{
|
|
3903
|
+
className: (0, import_classnames12.default)("df-filters-container", {
|
|
3904
|
+
"df-filter-loader": status.type === "loading" && status.reason === "search"
|
|
3905
|
+
}),
|
|
3906
|
+
children: filters.map((filter) => {
|
|
3907
|
+
var _a2;
|
|
3908
|
+
return /* @__PURE__ */ jsx46(
|
|
3909
|
+
Filter,
|
|
3910
|
+
__spreadProps(__spreadValues({}, collectionProps), {
|
|
3911
|
+
filter
|
|
3912
|
+
}),
|
|
3913
|
+
JSON.stringify((_a2 = filter.options) == null ? void 0 : _a2.map((o) => o.value))
|
|
3914
|
+
);
|
|
3915
|
+
})
|
|
3916
|
+
}
|
|
3917
|
+
)
|
|
3918
|
+
},
|
|
3919
|
+
"filters"
|
|
3920
|
+
) });
|
|
3746
3921
|
};
|
|
3747
|
-
var
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
formatMessage(generic_error_messages_default.genericError),
|
|
3751
|
-
"\xA0",
|
|
3752
|
-
/* @__PURE__ */ jsx44(DSLink, { onClick: retry, children: formatMessage(generic_error_messages_default.retry) })
|
|
3753
|
-
] });
|
|
3922
|
+
var filtersVariants = {
|
|
3923
|
+
collapsed: { height: 0, opacity: 0, overflow: "hidden" },
|
|
3924
|
+
expanded: { height: "auto", opacity: 1, transitionEnd: { overflow: "visible" } }
|
|
3754
3925
|
};
|
|
3755
|
-
var
|
|
3756
|
-
|
|
3926
|
+
var FilterComponent2 = ({
|
|
3927
|
+
filter,
|
|
3928
|
+
state
|
|
3929
|
+
}) => {
|
|
3930
|
+
const { multiSelect, options } = filter;
|
|
3931
|
+
const { status } = state;
|
|
3932
|
+
const disabled = status.type === "loading" && status.reason === "search";
|
|
3933
|
+
if (!options) {
|
|
3934
|
+
return null;
|
|
3935
|
+
}
|
|
3936
|
+
return /* @__PURE__ */ jsx46(
|
|
3937
|
+
Chips2,
|
|
3938
|
+
{
|
|
3939
|
+
className: "m-b-1",
|
|
3940
|
+
multiple: multiSelect,
|
|
3941
|
+
selected: options.some((option) => option.selected) ? options.filter((option) => option.selected).map((option) => option.value) : multiSelect ? [] : "",
|
|
3942
|
+
chips: [
|
|
3943
|
+
...options.map((option) => ({
|
|
3944
|
+
value: option.value,
|
|
3945
|
+
label: option.title
|
|
3946
|
+
}))
|
|
3947
|
+
],
|
|
3948
|
+
onChange: (value) => {
|
|
3949
|
+
var _a;
|
|
3950
|
+
if (disabled) {
|
|
3951
|
+
return;
|
|
3952
|
+
}
|
|
3953
|
+
if (value.selectedValue === "") {
|
|
3954
|
+
options == null ? void 0 : options.filter((option) => option.selected).map((option) => option == null ? void 0 : option.onSelect());
|
|
3955
|
+
return;
|
|
3956
|
+
}
|
|
3957
|
+
(_a = options == null ? void 0 : options.find((option) => value.selectedValue === option.value)) == null ? void 0 : _a.onSelect();
|
|
3958
|
+
}
|
|
3959
|
+
},
|
|
3960
|
+
JSON.stringify(options)
|
|
3961
|
+
);
|
|
3962
|
+
};
|
|
3963
|
+
|
|
3964
|
+
// ../renderers/src/CollectionRenderer/v2/SearchComponent.tsx
|
|
3965
|
+
import {
|
|
3966
|
+
InputGroup as InputGroup2,
|
|
3967
|
+
Input as Input2,
|
|
3968
|
+
ProcessIndicator as ProcessIndicator3,
|
|
3969
|
+
IconButton as IconButton2
|
|
3970
|
+
} from "@transferwise/components";
|
|
3971
|
+
import { CrossCircleFill as CrossCircleFill2, Search as Search2 } from "@transferwise/icons";
|
|
3972
|
+
import { useRef as useRef5 } from "react";
|
|
3973
|
+
import { useIntl as useIntl8 } from "react-intl";
|
|
3974
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
3975
|
+
var SearchComponent2 = ({
|
|
3976
|
+
state,
|
|
3977
|
+
depth,
|
|
3978
|
+
fork,
|
|
3979
|
+
features,
|
|
3980
|
+
control,
|
|
3981
|
+
tags
|
|
3982
|
+
}) => {
|
|
3983
|
+
var _a;
|
|
3984
|
+
const { search } = state;
|
|
3985
|
+
const { formatMessage } = useIntl8();
|
|
3986
|
+
const inputRef = useRef5(null);
|
|
3987
|
+
if (!search) {
|
|
3988
|
+
return;
|
|
3989
|
+
}
|
|
3990
|
+
const isForked = depth > 0;
|
|
3991
|
+
const getAddon = () => {
|
|
3992
|
+
if (state.status.type === "loading") {
|
|
3993
|
+
return { content: /* @__PURE__ */ jsx47(ProcessIndicator3, { size: "xs", "data-testid": "collection-search-loader" }) };
|
|
3994
|
+
}
|
|
3995
|
+
if (search.query) {
|
|
3996
|
+
return {
|
|
3997
|
+
interactive: true,
|
|
3998
|
+
content: /* @__PURE__ */ jsx47(
|
|
3999
|
+
IconButton2,
|
|
4000
|
+
{
|
|
4001
|
+
priority: "minimal",
|
|
4002
|
+
size: 24,
|
|
4003
|
+
"aria-label": formatMessage(collection_messages_default.clearTextLabel),
|
|
4004
|
+
onClick: () => {
|
|
4005
|
+
var _a2;
|
|
4006
|
+
search.onChange("");
|
|
4007
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
4008
|
+
},
|
|
4009
|
+
children: /* @__PURE__ */ jsx47(CrossCircleFill2, {})
|
|
4010
|
+
}
|
|
4011
|
+
)
|
|
4012
|
+
};
|
|
4013
|
+
}
|
|
4014
|
+
return void 0;
|
|
4015
|
+
};
|
|
4016
|
+
return /* @__PURE__ */ jsx47(
|
|
4017
|
+
FieldInput_default,
|
|
4018
|
+
{
|
|
4019
|
+
id: "search",
|
|
4020
|
+
description: "",
|
|
4021
|
+
validation: void 0,
|
|
4022
|
+
help: "",
|
|
4023
|
+
label: search.title,
|
|
4024
|
+
features,
|
|
4025
|
+
control,
|
|
4026
|
+
tags,
|
|
4027
|
+
children: /* @__PURE__ */ jsx47(InputGroup2, { addonStart: { content: /* @__PURE__ */ jsx47(Search2, { size: 24 }) }, addonEnd: getAddon(), children: /* @__PURE__ */ jsx47(
|
|
4028
|
+
Input2,
|
|
4029
|
+
{
|
|
4030
|
+
ref: inputRef,
|
|
4031
|
+
id: "search",
|
|
4032
|
+
name: "search",
|
|
4033
|
+
shape: "pill",
|
|
4034
|
+
placeholder: (_a = search.hints) == null ? void 0 : _a[0],
|
|
4035
|
+
type: "text",
|
|
4036
|
+
value: search.query,
|
|
4037
|
+
onFocus: () => {
|
|
4038
|
+
if (!isForked) {
|
|
4039
|
+
fork();
|
|
4040
|
+
}
|
|
4041
|
+
},
|
|
4042
|
+
onChange: ({ currentTarget: { value } }) => search.onChange(value)
|
|
4043
|
+
}
|
|
4044
|
+
) })
|
|
4045
|
+
}
|
|
4046
|
+
);
|
|
4047
|
+
};
|
|
4048
|
+
|
|
4049
|
+
// ../renderers/src/CollectionRenderer/v2/CollectionRendererV2.tsx
|
|
4050
|
+
var CollectionRendererV2 = createCollectionRenderer(
|
|
4051
|
+
({ control }) => control === "contacts-collection-v2",
|
|
4052
|
+
{ Search: SearchComponent2, Filters: FiltersComponent2, Filter: FilterComponent2 }
|
|
4053
|
+
);
|
|
4054
|
+
var CollectionRendererV2_default = CollectionRendererV2;
|
|
3757
4055
|
|
|
3758
4056
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3759
|
-
var
|
|
4057
|
+
var import_classnames13 = __toESM(require_classnames());
|
|
3760
4058
|
|
|
3761
4059
|
// ../renderers/src/utils/useIsCollapsed.ts
|
|
3762
|
-
import { useEffect as useEffect8, useState as
|
|
4060
|
+
import { useEffect as useEffect8, useState as useState10 } from "react";
|
|
3763
4061
|
var COLLAPSE_QUERY = "(max-width: 767.98px)";
|
|
3764
4062
|
var supportsMatchMedia = () => typeof window !== "undefined" && !!window.matchMedia;
|
|
3765
4063
|
var useIsCollapsed = () => {
|
|
3766
|
-
const [collapsed, setCollapsed] =
|
|
4064
|
+
const [collapsed, setCollapsed] = useState10(
|
|
3767
4065
|
() => supportsMatchMedia() && window.matchMedia(COLLAPSE_QUERY).matches
|
|
3768
4066
|
);
|
|
3769
4067
|
useEffect8(() => {
|
|
@@ -3779,7 +4077,7 @@ var useIsCollapsed = () => {
|
|
|
3779
4077
|
};
|
|
3780
4078
|
|
|
3781
4079
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
3782
|
-
import { jsx as
|
|
4080
|
+
import { jsx as jsx48, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3783
4081
|
var RIGHT_FIRST_STACKING = "right-first-stacking";
|
|
3784
4082
|
var ColumnsRenderer = {
|
|
3785
4083
|
canRenderType: "columns",
|
|
@@ -3790,12 +4088,12 @@ function ColumnsRendererComponent(props) {
|
|
|
3790
4088
|
const { bias, margin, startChildren, endChildren, tags } = props;
|
|
3791
4089
|
const isCollapsed = useIsCollapsed();
|
|
3792
4090
|
const reverse = isCollapsed && ((_a = tags == null ? void 0 : tags.includes(RIGHT_FIRST_STACKING)) != null ? _a : false);
|
|
3793
|
-
const startColumn = /* @__PURE__ */
|
|
3794
|
-
const endColumn = /* @__PURE__ */
|
|
3795
|
-
return /* @__PURE__ */
|
|
4091
|
+
const startColumn = /* @__PURE__ */ jsx48("div", { className: "df-columns-renderer-column", children: startChildren });
|
|
4092
|
+
const endColumn = /* @__PURE__ */ jsx48("div", { className: "df-columns-renderer-column", children: endChildren });
|
|
4093
|
+
return /* @__PURE__ */ jsxs10(
|
|
3796
4094
|
"div",
|
|
3797
4095
|
{
|
|
3798
|
-
className: (0,
|
|
4096
|
+
className: (0, import_classnames13.default)(
|
|
3799
4097
|
"df-columns-renderer-container",
|
|
3800
4098
|
getMargin(margin),
|
|
3801
4099
|
{
|
|
@@ -3813,23 +4111,6 @@ function ColumnsRendererComponent(props) {
|
|
|
3813
4111
|
}
|
|
3814
4112
|
var ColumnsRenderer_default = ColumnsRenderer;
|
|
3815
4113
|
|
|
3816
|
-
// ../renderers/src/components/VariableDateInput.tsx
|
|
3817
|
-
import { DateInput, DateLookup } from "@transferwise/components";
|
|
3818
|
-
|
|
3819
|
-
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3820
|
-
import { useState as useState10 } from "react";
|
|
3821
|
-
import { useIntl as useIntl7 } from "react-intl";
|
|
3822
|
-
|
|
3823
|
-
// ../renderers/src/messages/date-input.messages.ts
|
|
3824
|
-
import { defineMessages as defineMessages6 } from "react-intl";
|
|
3825
|
-
var date_input_messages_default = defineMessages6({
|
|
3826
|
-
unavailableDates: {
|
|
3827
|
-
id: "df.wise.DateInput.unavailableDates",
|
|
3828
|
-
defaultMessage: "Some dates are unavailable.",
|
|
3829
|
-
description: "General explanation shown below a calendar containing unavailable dates"
|
|
3830
|
-
}
|
|
3831
|
-
});
|
|
3832
|
-
|
|
3833
4114
|
// ../renderers/src/validators/type-validators.ts
|
|
3834
4115
|
var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
|
|
3835
4116
|
|
|
@@ -3858,14 +4139,31 @@ var dateToDateString = (date) => {
|
|
|
3858
4139
|
return [year, formattedMonth, formattedDay].join("-");
|
|
3859
4140
|
};
|
|
3860
4141
|
|
|
4142
|
+
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
4143
|
+
import { DateLookup } from "@transferwise/components";
|
|
4144
|
+
|
|
4145
|
+
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
4146
|
+
import { useState as useState11 } from "react";
|
|
4147
|
+
import { useIntl as useIntl9 } from "react-intl";
|
|
4148
|
+
|
|
4149
|
+
// ../renderers/src/messages/date-input.messages.ts
|
|
4150
|
+
import { defineMessages as defineMessages6 } from "react-intl";
|
|
4151
|
+
var date_input_messages_default = defineMessages6({
|
|
4152
|
+
unavailableDates: {
|
|
4153
|
+
id: "df.wise.DateInput.unavailableDates",
|
|
4154
|
+
defaultMessage: "Some dates are unavailable.",
|
|
4155
|
+
description: "General explanation shown below a calendar containing unavailable dates"
|
|
4156
|
+
}
|
|
4157
|
+
});
|
|
4158
|
+
|
|
3861
4159
|
// ../renderers/src/hooks/useAvailabilityRules.ts
|
|
3862
4160
|
var useAvailabilityRules = (availability) => {
|
|
3863
4161
|
var _a, _b;
|
|
3864
|
-
const { formatMessage } =
|
|
3865
|
-
const [focusedDate, setFocusedDate] =
|
|
4162
|
+
const { formatMessage } = useIntl9();
|
|
4163
|
+
const [focusedDate, setFocusedDate] = useState11(null);
|
|
3866
4164
|
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);
|
|
3867
4165
|
const onDateSelect = ({ date }) => {
|
|
3868
|
-
setFocusedDate(date);
|
|
4166
|
+
setFocusedDate((current) => (current == null ? void 0 : current.getTime()) === date.getTime() ? current : date);
|
|
3869
4167
|
};
|
|
3870
4168
|
return {
|
|
3871
4169
|
disabledRules: mapAvailabilityToDisabledRules(availability, unavailableMessage),
|
|
@@ -3913,64 +4211,124 @@ var matchesDateRule = (date, weekday, rule) => {
|
|
|
3913
4211
|
};
|
|
3914
4212
|
var isDate = (date) => date !== null;
|
|
3915
4213
|
|
|
3916
|
-
// ../renderers/src/
|
|
3917
|
-
import { jsx as
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
onBlur,
|
|
3930
|
-
onChange,
|
|
3931
|
-
onFocus
|
|
3932
|
-
} = inputProps;
|
|
4214
|
+
// ../renderers/src/DateInputRenderer/DateLookupControl.tsx
|
|
4215
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
4216
|
+
var DateLookupControl = ({
|
|
4217
|
+
value,
|
|
4218
|
+
minimumDate,
|
|
4219
|
+
maximumDate,
|
|
4220
|
+
placeholder,
|
|
4221
|
+
disabled,
|
|
4222
|
+
availability,
|
|
4223
|
+
onChange,
|
|
4224
|
+
onBlur,
|
|
4225
|
+
onFocus
|
|
4226
|
+
}) => {
|
|
3933
4227
|
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
4228
|
+
return /* @__PURE__ */ jsx49(
|
|
4229
|
+
DateLookup,
|
|
4230
|
+
{
|
|
4231
|
+
value: dateStringToDateOrNull(value),
|
|
4232
|
+
min: dateStringToDateOrNull(minimumDate),
|
|
4233
|
+
max: dateStringToDateOrNull(maximumDate),
|
|
4234
|
+
placeholder,
|
|
4235
|
+
disabled,
|
|
4236
|
+
disabledRules,
|
|
4237
|
+
onChange: (date) => {
|
|
4238
|
+
onChange(date !== null ? dateToDateString(date) : null);
|
|
4239
|
+
},
|
|
4240
|
+
onDateSelect,
|
|
4241
|
+
onBlur,
|
|
4242
|
+
onFocus: () => {
|
|
4243
|
+
resetFocusedDate();
|
|
4244
|
+
onFocus();
|
|
4245
|
+
}
|
|
4246
|
+
}
|
|
4247
|
+
);
|
|
4248
|
+
};
|
|
4249
|
+
|
|
4250
|
+
// ../renderers/src/DateInputRenderer/CalendarControl.tsx
|
|
4251
|
+
import { Calendar } from "@transferwise/components";
|
|
4252
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4253
|
+
var CalendarControl = ({
|
|
4254
|
+
id,
|
|
4255
|
+
title,
|
|
4256
|
+
value,
|
|
4257
|
+
minimumDate,
|
|
4258
|
+
maximumDate,
|
|
4259
|
+
validationState,
|
|
4260
|
+
availability,
|
|
4261
|
+
onChange,
|
|
4262
|
+
onFocus,
|
|
4263
|
+
onBlur
|
|
4264
|
+
}) => {
|
|
4265
|
+
const { disabledRules, onDateSelect, resetFocusedDate } = useAvailabilityRules(availability);
|
|
4266
|
+
const handleDateFocus = (date, { isEnabled }) => {
|
|
4267
|
+
if (date === null) {
|
|
4268
|
+
resetFocusedDate();
|
|
4269
|
+
return;
|
|
4270
|
+
}
|
|
4271
|
+
onDateSelect({ date, isEnabled });
|
|
4272
|
+
};
|
|
4273
|
+
return (
|
|
4274
|
+
// Wrapping in a <fieldset> to address some a11y gaps in the current inline Calendar component
|
|
4275
|
+
/* @__PURE__ */ jsx50(
|
|
4276
|
+
"fieldset",
|
|
3937
4277
|
{
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
4278
|
+
id,
|
|
4279
|
+
"aria-label": title,
|
|
4280
|
+
"aria-invalid": (validationState == null ? void 0 : validationState.status) === "invalid",
|
|
4281
|
+
onFocus: (event) => {
|
|
4282
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
4283
|
+
resetFocusedDate();
|
|
4284
|
+
onFocus();
|
|
4285
|
+
}
|
|
3946
4286
|
},
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
4287
|
+
onBlur: (event) => {
|
|
4288
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
4289
|
+
onBlur();
|
|
4290
|
+
}
|
|
4291
|
+
},
|
|
4292
|
+
children: /* @__PURE__ */ jsx50(
|
|
4293
|
+
Calendar,
|
|
4294
|
+
{
|
|
4295
|
+
value: dateStringToDateOrNull(value),
|
|
4296
|
+
min: dateStringToDateOrNull(minimumDate),
|
|
4297
|
+
max: dateStringToDateOrNull(maximumDate),
|
|
4298
|
+
disabledRules,
|
|
4299
|
+
onChange: (date) => {
|
|
4300
|
+
onChange(date !== null ? dateToDateString(date) : null);
|
|
4301
|
+
},
|
|
4302
|
+
onDateFocus: handleDateFocus
|
|
4303
|
+
}
|
|
4304
|
+
)
|
|
3953
4305
|
}
|
|
3954
|
-
)
|
|
3955
|
-
|
|
3956
|
-
|
|
4306
|
+
)
|
|
4307
|
+
);
|
|
4308
|
+
};
|
|
4309
|
+
|
|
4310
|
+
// ../renderers/src/DateInputRenderer/DateInputControl.tsx
|
|
4311
|
+
import { DateInput } from "@transferwise/components";
|
|
4312
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4313
|
+
var DateInputControl = (_a) => {
|
|
4314
|
+
var _b = _a, { autoComplete } = _b, props = __objRest(_b, ["autoComplete"]);
|
|
4315
|
+
return /* @__PURE__ */ jsx51(
|
|
3957
4316
|
DateInput,
|
|
3958
|
-
__spreadProps(__spreadValues({},
|
|
4317
|
+
__spreadProps(__spreadValues({}, props), {
|
|
3959
4318
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
3960
4319
|
yearAutoComplete: getAutocompleteString(autoComplete, "year")
|
|
3961
4320
|
})
|
|
3962
4321
|
);
|
|
3963
|
-
}
|
|
4322
|
+
};
|
|
3964
4323
|
var getAutocompleteString = (value, suffix) => {
|
|
3965
4324
|
if (value === "bday") {
|
|
3966
4325
|
return `${value}-${suffix}`;
|
|
3967
4326
|
}
|
|
3968
4327
|
return void 0;
|
|
3969
4328
|
};
|
|
3970
|
-
var VariableDateInput_default = VariableDateInput;
|
|
3971
4329
|
|
|
3972
|
-
// ../renderers/src/DateInputRenderer.tsx
|
|
3973
|
-
import { jsx as
|
|
4330
|
+
// ../renderers/src/DateInputRenderer/DateInputRenderer.tsx
|
|
4331
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3974
4332
|
var DateInputRenderer = {
|
|
3975
4333
|
canRenderType: "input-date",
|
|
3976
4334
|
render: (props) => {
|
|
@@ -3994,8 +4352,17 @@ var DateInputRenderer = {
|
|
|
3994
4352
|
"value"
|
|
3995
4353
|
]);
|
|
3996
4354
|
const value = initialValue != null ? initialValue : "";
|
|
3997
|
-
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
3998
|
-
|
|
4355
|
+
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id, title, validationState });
|
|
4356
|
+
const UIComponent = (() => {
|
|
4357
|
+
if (control === "calendar") {
|
|
4358
|
+
return !props.disabled ? CalendarControl : DateLookupControl;
|
|
4359
|
+
}
|
|
4360
|
+
if (control === "date-lookup") {
|
|
4361
|
+
return DateLookupControl;
|
|
4362
|
+
}
|
|
4363
|
+
return DateInputControl;
|
|
4364
|
+
})();
|
|
4365
|
+
return /* @__PURE__ */ jsx52(
|
|
3999
4366
|
FieldInput_default,
|
|
4000
4367
|
{
|
|
4001
4368
|
id,
|
|
@@ -4008,7 +4375,7 @@ var DateInputRenderer = {
|
|
|
4008
4375
|
features: props.features,
|
|
4009
4376
|
control,
|
|
4010
4377
|
tags: props.tags,
|
|
4011
|
-
children: /* @__PURE__ */
|
|
4378
|
+
children: /* @__PURE__ */ jsx52(UIComponent, __spreadValues({}, inputProps))
|
|
4012
4379
|
}
|
|
4013
4380
|
);
|
|
4014
4381
|
}
|
|
@@ -4020,8 +4387,8 @@ import { ListItem as ListItem7 } from "@transferwise/components";
|
|
|
4020
4387
|
|
|
4021
4388
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4022
4389
|
import { Header as Header3, SearchInput } from "@transferwise/components";
|
|
4023
|
-
import { useState as
|
|
4024
|
-
import { useIntl as
|
|
4390
|
+
import { useState as useState12 } from "react";
|
|
4391
|
+
import { useIntl as useIntl11 } from "react-intl";
|
|
4025
4392
|
|
|
4026
4393
|
// ../renderers/src/messages/filter.messages.ts
|
|
4027
4394
|
import { defineMessages as defineMessages7 } from "react-intl";
|
|
@@ -4091,8 +4458,8 @@ function filterAndSortItems(options, query) {
|
|
|
4091
4458
|
var normalizeAndRemoveAccents = (text) => text.trim().toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
4092
4459
|
|
|
4093
4460
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4094
|
-
import { Header as Header2, Section } from "@transferwise/components";
|
|
4095
|
-
import { useIntl as
|
|
4461
|
+
import { Header as Header2, Section as Section2 } from "@transferwise/components";
|
|
4462
|
+
import { useIntl as useIntl10 } from "react-intl";
|
|
4096
4463
|
|
|
4097
4464
|
// ../renderers/src/messages/group.messages.ts
|
|
4098
4465
|
import { defineMessages as defineMessages8 } from "react-intl";
|
|
@@ -4130,18 +4497,18 @@ var getGroupsFromTags = (knownTags, items) => {
|
|
|
4130
4497
|
};
|
|
4131
4498
|
|
|
4132
4499
|
// ../renderers/src/DecisionRenderer/GroupedDecisionList.tsx
|
|
4133
|
-
import { Fragment as Fragment4, jsx as
|
|
4500
|
+
import { Fragment as Fragment4, jsx as jsx53, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4134
4501
|
var groupingTags = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4135
4502
|
var isGroupedDecision = (options) => {
|
|
4136
4503
|
return getGroupsFromTags(groupingTags, options).length > 0;
|
|
4137
4504
|
};
|
|
4138
4505
|
var GroupedDecisionList = (_a) => {
|
|
4139
4506
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4140
|
-
const { formatMessage } =
|
|
4507
|
+
const { formatMessage } = useIntl10();
|
|
4141
4508
|
const { options } = rest;
|
|
4142
4509
|
const itemsByTag = [...getGroupsFromTags(groupingTags, options), { tag: "all", items: options }];
|
|
4143
|
-
return /* @__PURE__ */
|
|
4144
|
-
/* @__PURE__ */
|
|
4510
|
+
return /* @__PURE__ */ jsx53(Fragment4, { children: itemsByTag.map(({ tag, items }) => /* @__PURE__ */ jsxs11(Section2, { children: [
|
|
4511
|
+
/* @__PURE__ */ jsx53(
|
|
4145
4512
|
Header2,
|
|
4146
4513
|
{
|
|
4147
4514
|
as: "h2",
|
|
@@ -4153,27 +4520,27 @@ var GroupedDecisionList = (_a) => {
|
|
|
4153
4520
|
};
|
|
4154
4521
|
|
|
4155
4522
|
// ../renderers/src/DecisionRenderer/DecisionWrapper.tsx
|
|
4156
|
-
var
|
|
4157
|
-
import { Fragment as Fragment5, jsx as
|
|
4523
|
+
var import_classnames14 = __toESM(require_classnames());
|
|
4524
|
+
import { Fragment as Fragment5, jsx as jsx54, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4158
4525
|
var DecisionWrapper = (props) => {
|
|
4159
4526
|
const { margin, control, title, tags } = props;
|
|
4160
|
-
return /* @__PURE__ */
|
|
4161
|
-
title && /* @__PURE__ */
|
|
4162
|
-
control === "filtered" ? /* @__PURE__ */
|
|
4527
|
+
return /* @__PURE__ */ jsxs12("div", { className: (0, import_classnames14.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4528
|
+
title && /* @__PURE__ */ jsx54(Header3, { as: "h2", title }),
|
|
4529
|
+
control === "filtered" ? /* @__PURE__ */ jsx54(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsx54(UnfilteredDecisionList, __spreadValues({}, props))
|
|
4163
4530
|
] });
|
|
4164
4531
|
};
|
|
4165
4532
|
var UnfilteredDecisionList = (_a) => {
|
|
4166
4533
|
var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
|
|
4167
|
-
return isGroupedDecision(rest.options) ? /* @__PURE__ */
|
|
4534
|
+
return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx54(GroupedDecisionList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
|
|
4168
4535
|
};
|
|
4169
4536
|
var FilteredDecisionList = (props) => {
|
|
4170
|
-
const { formatMessage } =
|
|
4171
|
-
const [query, setQuery] =
|
|
4537
|
+
const { formatMessage } = useIntl11();
|
|
4538
|
+
const [query, setQuery] = useState12("");
|
|
4172
4539
|
const { control, options, renderDecisionList: renderDecisionList2 } = props;
|
|
4173
4540
|
const filteredOptions = (query == null ? void 0 : query.length) > 0 ? filterAndSortItems(options, query) : options;
|
|
4174
4541
|
const isGrouped = isGroupedDecision(options);
|
|
4175
|
-
return /* @__PURE__ */
|
|
4176
|
-
/* @__PURE__ */
|
|
4542
|
+
return /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
4543
|
+
/* @__PURE__ */ jsx54(
|
|
4177
4544
|
SearchInput,
|
|
4178
4545
|
{
|
|
4179
4546
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -4185,25 +4552,25 @@ var FilteredDecisionList = (props) => {
|
|
|
4185
4552
|
}
|
|
4186
4553
|
}
|
|
4187
4554
|
),
|
|
4188
|
-
isGrouped && query.length === 0 ? /* @__PURE__ */
|
|
4189
|
-
query.length > 0 && /* @__PURE__ */
|
|
4555
|
+
isGrouped && query.length === 0 ? /* @__PURE__ */ jsx54(GroupedDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs12(Fragment5, { children: [
|
|
4556
|
+
query.length > 0 && /* @__PURE__ */ jsx54(Header3, { as: "h2", title: formatMessage(filter_messages_default.results), className: "m-t-4" }),
|
|
4190
4557
|
filteredOptions.length > 0 ? renderDecisionList2({
|
|
4191
4558
|
control,
|
|
4192
4559
|
className: query.length === 0 ? "m-t-3" : "",
|
|
4193
4560
|
options: filteredOptions
|
|
4194
|
-
}) : /* @__PURE__ */
|
|
4561
|
+
}) : /* @__PURE__ */ jsx54("p", { children: formatMessage(filter_messages_default.noResults) })
|
|
4195
4562
|
] })
|
|
4196
4563
|
] });
|
|
4197
4564
|
};
|
|
4198
4565
|
|
|
4199
4566
|
// ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
|
|
4200
|
-
import { Fragment as Fragment6, jsx as
|
|
4567
|
+
import { Fragment as Fragment6, jsx as jsx55 } from "react/jsx-runtime";
|
|
4201
4568
|
var DecisionRenderer = {
|
|
4202
4569
|
canRenderType: "decision",
|
|
4203
|
-
render: (props) => /* @__PURE__ */
|
|
4570
|
+
render: (props) => /* @__PURE__ */ jsx55(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }))
|
|
4204
4571
|
};
|
|
4205
4572
|
var renderDecisionList = ({ options, control }) => {
|
|
4206
|
-
return /* @__PURE__ */
|
|
4573
|
+
return /* @__PURE__ */ jsx55(Fragment6, { children: options.map((_a) => {
|
|
4207
4574
|
var _b = _a, { onClick } = _b, rest = __objRest(_b, ["onClick"]);
|
|
4208
4575
|
const {
|
|
4209
4576
|
description,
|
|
@@ -4216,7 +4583,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4216
4583
|
supportingValues,
|
|
4217
4584
|
tags
|
|
4218
4585
|
} = rest;
|
|
4219
|
-
return /* @__PURE__ */
|
|
4586
|
+
return /* @__PURE__ */ jsx55(
|
|
4220
4587
|
ListItem7,
|
|
4221
4588
|
{
|
|
4222
4589
|
title: itemTitle,
|
|
@@ -4228,7 +4595,7 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4228
4595
|
media: getMedia(media, shouldUseAvatar(control, tags)),
|
|
4229
4596
|
prompt: getInlineAlert(inlineAlert),
|
|
4230
4597
|
additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
|
|
4231
|
-
control: /* @__PURE__ */
|
|
4598
|
+
control: /* @__PURE__ */ jsx55(ListItem7.Navigation, __spreadValues({}, getAnchorProps()))
|
|
4232
4599
|
},
|
|
4233
4600
|
JSON.stringify(rest)
|
|
4234
4601
|
);
|
|
@@ -4237,9 +4604,9 @@ var renderDecisionList = ({ options, control }) => {
|
|
|
4237
4604
|
var DecisionRenderer_default = DecisionRenderer;
|
|
4238
4605
|
|
|
4239
4606
|
// ../renderers/src/DividerRenderer.tsx
|
|
4240
|
-
var
|
|
4607
|
+
var import_classnames15 = __toESM(require_classnames());
|
|
4241
4608
|
import { Divider } from "@transferwise/components";
|
|
4242
|
-
import { jsx as
|
|
4609
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4243
4610
|
var mapControlToLevel = (control) => {
|
|
4244
4611
|
switch (control) {
|
|
4245
4612
|
case "section":
|
|
@@ -4252,10 +4619,10 @@ var mapControlToLevel = (control) => {
|
|
|
4252
4619
|
};
|
|
4253
4620
|
var DividerRenderer = {
|
|
4254
4621
|
canRenderType: "divider",
|
|
4255
|
-
render: ({ margin, control, tags }) => /* @__PURE__ */
|
|
4622
|
+
render: ({ margin, control, tags }) => /* @__PURE__ */ jsx56(
|
|
4256
4623
|
Divider,
|
|
4257
4624
|
{
|
|
4258
|
-
className: (0,
|
|
4625
|
+
className: (0, import_classnames15.default)(
|
|
4259
4626
|
"m-t-0",
|
|
4260
4627
|
"d-block",
|
|
4261
4628
|
getMargin(margin),
|
|
@@ -4268,7 +4635,7 @@ var DividerRenderer = {
|
|
|
4268
4635
|
var DividerRenderer_default = DividerRenderer;
|
|
4269
4636
|
|
|
4270
4637
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4271
|
-
import { Button as
|
|
4638
|
+
import { Button as Button6, Markdown as Markdown3, Modal } from "@transferwise/components";
|
|
4272
4639
|
|
|
4273
4640
|
// ../renderers/src/messages/external-confirmation.messages.ts
|
|
4274
4641
|
import { defineMessages as defineMessages9 } from "react-intl";
|
|
@@ -4296,9 +4663,9 @@ var external_confirmation_messages_default = defineMessages9({
|
|
|
4296
4663
|
});
|
|
4297
4664
|
|
|
4298
4665
|
// ../renderers/src/ExternalConfirmationRenderer.tsx
|
|
4299
|
-
import { useIntl as
|
|
4666
|
+
import { useIntl as useIntl12 } from "react-intl";
|
|
4300
4667
|
import { useEffect as useEffect9 } from "react";
|
|
4301
|
-
import { Fragment as Fragment7, jsx as
|
|
4668
|
+
import { Fragment as Fragment7, jsx as jsx57, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4302
4669
|
var ExternalConfirmationRenderer = {
|
|
4303
4670
|
canRenderType: "external-confirmation",
|
|
4304
4671
|
render: ExternalConfirmationRendererComponent
|
|
@@ -4311,20 +4678,20 @@ function ExternalConfirmationRendererComponent({
|
|
|
4311
4678
|
control,
|
|
4312
4679
|
tags
|
|
4313
4680
|
}) {
|
|
4314
|
-
const { formatMessage } =
|
|
4681
|
+
const { formatMessage } = useIntl12();
|
|
4315
4682
|
useEffect9(() => {
|
|
4316
4683
|
open();
|
|
4317
4684
|
}, []);
|
|
4318
|
-
return /* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ jsx57(
|
|
4319
4686
|
Modal,
|
|
4320
4687
|
{
|
|
4321
4688
|
open: visible,
|
|
4322
4689
|
title: formatMessage(external_confirmation_messages_default.title),
|
|
4323
|
-
body: /* @__PURE__ */
|
|
4324
|
-
/* @__PURE__ */
|
|
4325
|
-
/* @__PURE__ */
|
|
4326
|
-
/* @__PURE__ */
|
|
4327
|
-
|
|
4690
|
+
body: /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
4691
|
+
/* @__PURE__ */ jsx57(Markdown3, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(url) }) }),
|
|
4692
|
+
/* @__PURE__ */ jsx57("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs13("div", { className: "df-box-renderer-width-lg", children: [
|
|
4693
|
+
/* @__PURE__ */ jsx57(
|
|
4694
|
+
Button6,
|
|
4328
4695
|
{
|
|
4329
4696
|
v2: true,
|
|
4330
4697
|
block: true,
|
|
@@ -4337,7 +4704,7 @@ function ExternalConfirmationRendererComponent({
|
|
|
4337
4704
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
4338
4705
|
}
|
|
4339
4706
|
),
|
|
4340
|
-
/* @__PURE__ */
|
|
4707
|
+
/* @__PURE__ */ jsx57(Button6, { v2: true, block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onCancel, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
4341
4708
|
] }) })
|
|
4342
4709
|
] }),
|
|
4343
4710
|
className: controlAndTagsToCSSClass({ control, tags }),
|
|
@@ -4355,51 +4722,51 @@ function getOrigin(url) {
|
|
|
4355
4722
|
var ExternalConfirmationRenderer_default = ExternalConfirmationRenderer;
|
|
4356
4723
|
|
|
4357
4724
|
// ../renderers/src/FormRenderer.tsx
|
|
4358
|
-
var
|
|
4359
|
-
import { jsx as
|
|
4725
|
+
var import_classnames16 = __toESM(require_classnames());
|
|
4726
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4360
4727
|
var FormRenderer = {
|
|
4361
4728
|
canRenderType: "form",
|
|
4362
|
-
render: ({ children, margin, control, tags }) => /* @__PURE__ */
|
|
4729
|
+
render: ({ children, margin, control, tags }) => /* @__PURE__ */ jsx58("div", { className: (0, import_classnames16.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children })
|
|
4363
4730
|
};
|
|
4364
4731
|
var FormRenderer_default = FormRenderer;
|
|
4365
4732
|
|
|
4366
4733
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
4367
4734
|
import { Header as Header4 } from "@transferwise/components";
|
|
4368
|
-
import { jsx as
|
|
4735
|
+
import { jsx as jsx59, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4369
4736
|
var FormSectionRenderer = {
|
|
4370
4737
|
canRenderType: "form-section",
|
|
4371
|
-
render: ({ title, description, children, control, tags }) => /* @__PURE__ */
|
|
4372
|
-
title && /* @__PURE__ */
|
|
4738
|
+
render: ({ title, description, children, control, tags }) => /* @__PURE__ */ jsxs14("fieldset", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
4739
|
+
title && /* @__PURE__ */ jsx59(
|
|
4373
4740
|
Header4,
|
|
4374
4741
|
{
|
|
4375
4742
|
as: "h2",
|
|
4376
4743
|
title
|
|
4377
4744
|
}
|
|
4378
4745
|
),
|
|
4379
|
-
description && /* @__PURE__ */
|
|
4746
|
+
description && /* @__PURE__ */ jsx59("p", { children: description }),
|
|
4380
4747
|
children
|
|
4381
4748
|
] })
|
|
4382
4749
|
};
|
|
4383
4750
|
var FormSectionRenderer_default = FormSectionRenderer;
|
|
4384
4751
|
|
|
4385
4752
|
// ../renderers/src/HeadingRenderer.tsx
|
|
4386
|
-
var
|
|
4753
|
+
var import_classnames17 = __toESM(require_classnames());
|
|
4387
4754
|
import { Display, Title } from "@transferwise/components";
|
|
4388
|
-
import { jsx as
|
|
4755
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
4389
4756
|
var HeadingRenderer = {
|
|
4390
4757
|
canRenderType: "heading",
|
|
4391
4758
|
render: Heading
|
|
4392
4759
|
};
|
|
4393
4760
|
function Heading(props) {
|
|
4394
4761
|
const { text, size, align, margin, control } = props;
|
|
4395
|
-
const className = (0,
|
|
4762
|
+
const className = (0, import_classnames17.default)(
|
|
4396
4763
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4397
4764
|
controlAndTagsToCSSClass(props)
|
|
4398
4765
|
);
|
|
4399
|
-
return control === "display" ? /* @__PURE__ */
|
|
4766
|
+
return control === "display" ? /* @__PURE__ */ jsx60(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx60(StandardHeading, { size, text, className });
|
|
4400
4767
|
}
|
|
4401
4768
|
function DisplayHeading({ size, text, className }) {
|
|
4402
|
-
return /* @__PURE__ */
|
|
4769
|
+
return /* @__PURE__ */ jsx60(Display, { type: getDisplayType(size), className, children: text });
|
|
4403
4770
|
}
|
|
4404
4771
|
var getDisplayType = (size) => {
|
|
4405
4772
|
switch (size) {
|
|
@@ -4415,7 +4782,7 @@ var getDisplayType = (size) => {
|
|
|
4415
4782
|
}
|
|
4416
4783
|
};
|
|
4417
4784
|
function StandardHeading({ size, text, className }) {
|
|
4418
|
-
return /* @__PURE__ */
|
|
4785
|
+
return /* @__PURE__ */ jsx60(Title, { type: getTitleTypeBySize(size), className, children: text });
|
|
4419
4786
|
}
|
|
4420
4787
|
var getTitleTypeBySize = (size) => {
|
|
4421
4788
|
var _a;
|
|
@@ -4431,9 +4798,9 @@ var getTitleTypeBySize = (size) => {
|
|
|
4431
4798
|
var HeadingRenderer_default = HeadingRenderer;
|
|
4432
4799
|
|
|
4433
4800
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4434
|
-
var
|
|
4801
|
+
var import_classnames18 = __toESM(require_classnames());
|
|
4435
4802
|
import { Image } from "@transferwise/components";
|
|
4436
|
-
import { useEffect as useEffect10, useState as
|
|
4803
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
4437
4804
|
|
|
4438
4805
|
// ../renderers/src/utils/api-utils.ts
|
|
4439
4806
|
function isRelativePath(url = "") {
|
|
@@ -4443,7 +4810,7 @@ function isRelativePath(url = "") {
|
|
|
4443
4810
|
}
|
|
4444
4811
|
|
|
4445
4812
|
// ../renderers/src/ImageRenderer/UrlImage.tsx
|
|
4446
|
-
import { jsx as
|
|
4813
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4447
4814
|
function UrlImage({
|
|
4448
4815
|
accessibilityDescription,
|
|
4449
4816
|
align,
|
|
@@ -4454,23 +4821,23 @@ function UrlImage({
|
|
|
4454
4821
|
uri,
|
|
4455
4822
|
httpClient
|
|
4456
4823
|
}) {
|
|
4457
|
-
const [imageSource, setImageSource] =
|
|
4824
|
+
const [imageSource, setImageSource] = useState13("");
|
|
4458
4825
|
useEffect10(() => {
|
|
4459
4826
|
if (!uri.startsWith("urn:")) {
|
|
4460
4827
|
void getImageSource(httpClient, uri).then(setImageSource);
|
|
4461
4828
|
}
|
|
4462
4829
|
}, [uri, httpClient]);
|
|
4463
|
-
return /* @__PURE__ */
|
|
4830
|
+
return /* @__PURE__ */ jsx61(
|
|
4464
4831
|
"div",
|
|
4465
4832
|
{
|
|
4466
|
-
className: (0,
|
|
4833
|
+
className: (0, import_classnames18.default)(
|
|
4467
4834
|
"df-image",
|
|
4468
4835
|
align,
|
|
4469
4836
|
size || "md",
|
|
4470
4837
|
getMargin(margin),
|
|
4471
4838
|
controlAndTagsToCSSClass({ control, tags })
|
|
4472
4839
|
),
|
|
4473
|
-
children: /* @__PURE__ */
|
|
4840
|
+
children: /* @__PURE__ */ jsx61(
|
|
4474
4841
|
Image,
|
|
4475
4842
|
{
|
|
4476
4843
|
className: "df-reserve-space",
|
|
@@ -4516,19 +4883,19 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
4516
4883
|
};
|
|
4517
4884
|
|
|
4518
4885
|
// ../renderers/src/ImageRenderer/ImageRenderer.tsx
|
|
4519
|
-
import { jsx as
|
|
4886
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4520
4887
|
var ImageRenderer = {
|
|
4521
4888
|
canRenderType: "image",
|
|
4522
|
-
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */
|
|
4889
|
+
render: (props) => isUrnImage(props.uri) ? /* @__PURE__ */ jsx62(UrnImage, __spreadValues({}, props)) : /* @__PURE__ */ jsx62(UrlImage, __spreadValues({}, props))
|
|
4523
4890
|
};
|
|
4524
4891
|
|
|
4525
4892
|
// ../renderers/src/ImageRenderer/index.tsx
|
|
4526
4893
|
var ImageRenderer_default = ImageRenderer;
|
|
4527
4894
|
|
|
4528
4895
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
4529
|
-
var
|
|
4896
|
+
var import_classnames19 = __toESM(require_classnames());
|
|
4530
4897
|
import { Header as Header5, InstructionsList } from "@transferwise/components";
|
|
4531
|
-
import { jsx as
|
|
4898
|
+
import { jsx as jsx63, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4532
4899
|
var doContext = ["positive", "neutral", "proposition"];
|
|
4533
4900
|
var dontContext = ["warning", "negative"];
|
|
4534
4901
|
var InstructionsRenderer = {
|
|
@@ -4536,16 +4903,16 @@ var InstructionsRenderer = {
|
|
|
4536
4903
|
render: ({ items, margin, title, control, tags }) => {
|
|
4537
4904
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
4538
4905
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
4539
|
-
return /* @__PURE__ */
|
|
4540
|
-
title ? /* @__PURE__ */
|
|
4541
|
-
/* @__PURE__ */
|
|
4906
|
+
return /* @__PURE__ */ jsxs15("div", { className: (0, import_classnames19.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
4907
|
+
title ? /* @__PURE__ */ jsx63(Header5, { title }) : null,
|
|
4908
|
+
/* @__PURE__ */ jsx63(InstructionsList, { dos, donts })
|
|
4542
4909
|
] });
|
|
4543
4910
|
}
|
|
4544
4911
|
};
|
|
4545
4912
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
4546
4913
|
|
|
4547
4914
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4548
|
-
import { Input as
|
|
4915
|
+
import { Input as Input3, InputGroup as InputGroup3 } from "@transferwise/components";
|
|
4549
4916
|
|
|
4550
4917
|
// ../renderers/src/utils/input-utils.ts
|
|
4551
4918
|
var onWheel = (event) => {
|
|
@@ -4570,7 +4937,7 @@ function pick(obj, ...keys) {
|
|
|
4570
4937
|
}
|
|
4571
4938
|
|
|
4572
4939
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
4573
|
-
import { jsx as
|
|
4940
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4574
4941
|
var IntegerInputRenderer = {
|
|
4575
4942
|
canRenderType: "input-integer",
|
|
4576
4943
|
render: (props) => {
|
|
@@ -4585,7 +4952,7 @@ var IntegerInputRenderer = {
|
|
|
4585
4952
|
"maximum",
|
|
4586
4953
|
"minimum"
|
|
4587
4954
|
);
|
|
4588
|
-
return /* @__PURE__ */
|
|
4955
|
+
return /* @__PURE__ */ jsx64(
|
|
4589
4956
|
FieldInput_default,
|
|
4590
4957
|
{
|
|
4591
4958
|
id,
|
|
@@ -4598,8 +4965,8 @@ var IntegerInputRenderer = {
|
|
|
4598
4965
|
features: props.features,
|
|
4599
4966
|
control: props.control,
|
|
4600
4967
|
tags: props.tags,
|
|
4601
|
-
children: /* @__PURE__ */
|
|
4602
|
-
|
|
4968
|
+
children: /* @__PURE__ */ jsx64(InputGroup3, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx64(
|
|
4969
|
+
Input3,
|
|
4603
4970
|
__spreadValues({
|
|
4604
4971
|
id,
|
|
4605
4972
|
name: id,
|
|
@@ -4621,13 +4988,13 @@ var IntegerInputRenderer = {
|
|
|
4621
4988
|
var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
4622
4989
|
|
|
4623
4990
|
// ../renderers/src/ListRenderer.tsx
|
|
4624
|
-
var
|
|
4991
|
+
var import_classnames20 = __toESM(require_classnames());
|
|
4625
4992
|
import { ListItem as ListItem8 } from "@transferwise/components";
|
|
4626
4993
|
|
|
4627
4994
|
// ../renderers/src/components/Header.tsx
|
|
4628
4995
|
import { Header as DSHeader } from "@transferwise/components";
|
|
4629
|
-
import { jsx as
|
|
4630
|
-
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */
|
|
4996
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
4997
|
+
var Header = ({ title, callToAction }) => (title || callToAction) && /* @__PURE__ */ jsx65(DSHeader, { title: title != null ? title : "", action: getHeaderAction(callToAction) });
|
|
4631
4998
|
var getHeaderAction = (callToAction) => {
|
|
4632
4999
|
if (!callToAction) {
|
|
4633
5000
|
return void 0;
|
|
@@ -4639,11 +5006,11 @@ var getHeaderAction = (callToAction) => {
|
|
|
4639
5006
|
};
|
|
4640
5007
|
|
|
4641
5008
|
// ../renderers/src/ListRenderer.tsx
|
|
4642
|
-
import { jsx as
|
|
5009
|
+
import { jsx as jsx66, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
4643
5010
|
var ListRenderer = {
|
|
4644
5011
|
canRenderType: "list",
|
|
4645
|
-
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */
|
|
4646
|
-
/* @__PURE__ */
|
|
5012
|
+
render: ({ callToAction, control, margin, items, tags, title }) => /* @__PURE__ */ jsxs16("div", { className: (0, import_classnames20.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5013
|
+
/* @__PURE__ */ jsx66(Header, { title, callToAction }),
|
|
4647
5014
|
items.map((item) => {
|
|
4648
5015
|
var _a, _b;
|
|
4649
5016
|
const {
|
|
@@ -4660,7 +5027,7 @@ var ListRenderer = {
|
|
|
4660
5027
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
4661
5028
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
4662
5029
|
};
|
|
4663
|
-
return /* @__PURE__ */
|
|
5030
|
+
return /* @__PURE__ */ jsx66(
|
|
4664
5031
|
ListItem8,
|
|
4665
5032
|
{
|
|
4666
5033
|
title: itemTitle,
|
|
@@ -4680,17 +5047,17 @@ var ListRenderer = {
|
|
|
4680
5047
|
var ListRenderer_default = ListRenderer;
|
|
4681
5048
|
|
|
4682
5049
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
4683
|
-
var
|
|
5050
|
+
var import_classnames21 = __toESM(require_classnames());
|
|
4684
5051
|
import { Loader } from "@transferwise/components";
|
|
4685
|
-
import { jsx as
|
|
5052
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4686
5053
|
var LoadingIndicatorRenderer = {
|
|
4687
5054
|
canRenderType: "loading-indicator",
|
|
4688
|
-
render: ({ size, margin, control, tags }) => /* @__PURE__ */
|
|
5055
|
+
render: ({ size, margin, control, tags }) => /* @__PURE__ */ jsx67(
|
|
4689
5056
|
Loader,
|
|
4690
5057
|
{
|
|
4691
5058
|
size,
|
|
4692
5059
|
classNames: {
|
|
4693
|
-
"tw-loader": (0,
|
|
5060
|
+
"tw-loader": (0, import_classnames21.default)(
|
|
4694
5061
|
"tw-loader",
|
|
4695
5062
|
"m-x-auto",
|
|
4696
5063
|
getMargin(margin),
|
|
@@ -4704,24 +5071,24 @@ var LoadingIndicatorRenderer = {
|
|
|
4704
5071
|
var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
4705
5072
|
|
|
4706
5073
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
4707
|
-
var
|
|
5074
|
+
var import_classnames22 = __toESM(require_classnames());
|
|
4708
5075
|
import { Markdown as Markdown4 } from "@transferwise/components";
|
|
4709
|
-
import { jsx as
|
|
5076
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4710
5077
|
var MarkdownRenderer = {
|
|
4711
5078
|
canRenderType: "markdown",
|
|
4712
5079
|
render: ({ content, align, margin, size, control, tags }) => {
|
|
4713
5080
|
const isLarge = !["xs", "sm"].includes(size);
|
|
4714
|
-
return /* @__PURE__ */
|
|
5081
|
+
return /* @__PURE__ */ jsx68(
|
|
4715
5082
|
"div",
|
|
4716
5083
|
{
|
|
4717
|
-
className: (0,
|
|
5084
|
+
className: (0, import_classnames22.default)(
|
|
4718
5085
|
getTextAlignmentAndMargin({ align, margin }),
|
|
4719
5086
|
controlAndTagsToCSSClass({ control, tags })
|
|
4720
5087
|
),
|
|
4721
|
-
children: /* @__PURE__ */
|
|
5088
|
+
children: /* @__PURE__ */ jsx68(
|
|
4722
5089
|
Markdown4,
|
|
4723
5090
|
{
|
|
4724
|
-
className: (0,
|
|
5091
|
+
className: (0, import_classnames22.default)("df-markdown", {
|
|
4725
5092
|
"np-text-body-large": isLarge,
|
|
4726
5093
|
"np-text-body-default": !isLarge
|
|
4727
5094
|
}),
|
|
@@ -4736,17 +5103,17 @@ var MarkdownRenderer = {
|
|
|
4736
5103
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
4737
5104
|
|
|
4738
5105
|
// ../renderers/src/MediaRenderer.tsx
|
|
4739
|
-
var
|
|
4740
|
-
import { jsx as
|
|
5106
|
+
var import_classnames23 = __toESM(require_classnames());
|
|
5107
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
4741
5108
|
var MediaRenderer = {
|
|
4742
5109
|
canRenderType: "media",
|
|
4743
5110
|
render: (_a) => {
|
|
4744
5111
|
var _b = _a, { media } = _b, rest = __objRest(_b, ["media"]);
|
|
4745
5112
|
switch (media.type) {
|
|
4746
5113
|
case "avatar":
|
|
4747
|
-
return /* @__PURE__ */
|
|
5114
|
+
return /* @__PURE__ */ jsx69(AvatarMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4748
5115
|
case "image":
|
|
4749
|
-
return /* @__PURE__ */
|
|
5116
|
+
return /* @__PURE__ */ jsx69(ImageMediaRendererComponent, __spreadValues({ media }, rest));
|
|
4750
5117
|
case "legacy":
|
|
4751
5118
|
return null;
|
|
4752
5119
|
}
|
|
@@ -4760,16 +5127,16 @@ var AvatarMediaRendererComponent = ({
|
|
|
4760
5127
|
control,
|
|
4761
5128
|
tags
|
|
4762
5129
|
}) => {
|
|
4763
|
-
return /* @__PURE__ */
|
|
5130
|
+
return /* @__PURE__ */ jsx69(
|
|
4764
5131
|
"div",
|
|
4765
5132
|
{
|
|
4766
|
-
className: (0,
|
|
5133
|
+
className: (0, import_classnames23.default)(
|
|
4767
5134
|
"df-media-layout-avatar",
|
|
4768
5135
|
align,
|
|
4769
5136
|
getMargin(margin),
|
|
4770
5137
|
controlAndTagsToCSSClass({ control, tags })
|
|
4771
5138
|
),
|
|
4772
|
-
children: /* @__PURE__ */
|
|
5139
|
+
children: /* @__PURE__ */ jsx69(Media, { media, size: mapAvatarMediaSize(size) })
|
|
4773
5140
|
}
|
|
4774
5141
|
);
|
|
4775
5142
|
};
|
|
@@ -4782,14 +5149,14 @@ var ImageMediaRendererComponent = (_a) => {
|
|
|
4782
5149
|
"size"
|
|
4783
5150
|
]);
|
|
4784
5151
|
var _a2, _b2;
|
|
4785
|
-
return isUrnImage(media.uri) ? /* @__PURE__ */
|
|
5152
|
+
return isUrnImage(media.uri) ? /* @__PURE__ */ jsx69(
|
|
4786
5153
|
UrnImage,
|
|
4787
5154
|
__spreadValues({
|
|
4788
5155
|
uri: media.uri,
|
|
4789
5156
|
size: (_a2 = media.size) != null ? _a2 : size,
|
|
4790
5157
|
accessibilityDescription: media.accessibilityDescription
|
|
4791
5158
|
}, rest)
|
|
4792
|
-
) : /* @__PURE__ */
|
|
5159
|
+
) : /* @__PURE__ */ jsx69(
|
|
4793
5160
|
UrlImage,
|
|
4794
5161
|
__spreadValues({
|
|
4795
5162
|
uri: media.uri,
|
|
@@ -4814,21 +5181,21 @@ var mapAvatarMediaSize = (size) => {
|
|
|
4814
5181
|
};
|
|
4815
5182
|
|
|
4816
5183
|
// ../renderers/src/ModalLayoutRenderer.tsx
|
|
4817
|
-
var
|
|
4818
|
-
import { Button as
|
|
4819
|
-
import { useState as
|
|
4820
|
-
import { jsx as
|
|
5184
|
+
var import_classnames24 = __toESM(require_classnames());
|
|
5185
|
+
import { Button as Button7, Modal as Modal2 } from "@transferwise/components";
|
|
5186
|
+
import { useState as useState14 } from "react";
|
|
5187
|
+
import { jsx as jsx70, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4821
5188
|
var ModalLayoutRenderer = {
|
|
4822
5189
|
canRenderType: "modal-layout",
|
|
4823
|
-
render: (props) => /* @__PURE__ */
|
|
5190
|
+
render: (props) => /* @__PURE__ */ jsx70(DFModal, __spreadValues({}, props))
|
|
4824
5191
|
};
|
|
4825
5192
|
var ModalLayoutRenderer_default = ModalLayoutRenderer;
|
|
4826
5193
|
function DFModal({ content, margin, trigger, control, tags }) {
|
|
4827
|
-
const [visible, setVisible] =
|
|
5194
|
+
const [visible, setVisible] = useState14(false);
|
|
4828
5195
|
const { children, title } = content;
|
|
4829
|
-
return /* @__PURE__ */
|
|
4830
|
-
/* @__PURE__ */
|
|
4831
|
-
/* @__PURE__ */
|
|
5196
|
+
return /* @__PURE__ */ jsxs17("div", { className: (0, import_classnames24.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
5197
|
+
/* @__PURE__ */ jsx70(Button7, { v2: true, priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
5198
|
+
/* @__PURE__ */ jsx70(
|
|
4832
5199
|
Modal2,
|
|
4833
5200
|
{
|
|
4834
5201
|
scroll: "content",
|
|
@@ -4844,11 +5211,11 @@ function DFModal({ content, margin, trigger, control, tags }) {
|
|
|
4844
5211
|
|
|
4845
5212
|
// ../renderers/src/ModalRenderer.tsx
|
|
4846
5213
|
import { Modal as Modal3 } from "@transferwise/components";
|
|
4847
|
-
import { jsx as
|
|
5214
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
4848
5215
|
var ModalRenderer = {
|
|
4849
5216
|
canRenderType: "modal",
|
|
4850
5217
|
render: ({ title, children, open, onClose, control, tags }) => {
|
|
4851
|
-
return /* @__PURE__ */
|
|
5218
|
+
return /* @__PURE__ */ jsx71(
|
|
4852
5219
|
Modal3,
|
|
4853
5220
|
{
|
|
4854
5221
|
open,
|
|
@@ -4864,8 +5231,8 @@ var ModalRenderer = {
|
|
|
4864
5231
|
// ../renderers/src/MoneyInputRenderer.tsx
|
|
4865
5232
|
import { MoneyInput } from "@transferwise/components";
|
|
4866
5233
|
import { useEffect as useEffect11 } from "react";
|
|
4867
|
-
import { useIntl as
|
|
4868
|
-
import { jsx as
|
|
5234
|
+
import { useIntl as useIntl13 } from "react-intl";
|
|
5235
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
4869
5236
|
var groupingTags2 = Object.keys(group_messages_default).filter((key) => key !== "all");
|
|
4870
5237
|
var MoneyInputRenderer = {
|
|
4871
5238
|
canRenderType: "money-input",
|
|
@@ -4894,8 +5261,8 @@ function MoneyInputRendererComponent(props) {
|
|
|
4894
5261
|
onCurrencyChange(0);
|
|
4895
5262
|
}
|
|
4896
5263
|
}, [selectedCurrencyIndex, onCurrencyChange, currencies.length]);
|
|
4897
|
-
const { formatMessage } =
|
|
4898
|
-
return /* @__PURE__ */
|
|
5264
|
+
const { formatMessage } = useIntl13();
|
|
5265
|
+
return /* @__PURE__ */ jsx72(
|
|
4899
5266
|
FieldInput_default,
|
|
4900
5267
|
{
|
|
4901
5268
|
id: uid,
|
|
@@ -4906,7 +5273,7 @@ function MoneyInputRendererComponent(props) {
|
|
|
4906
5273
|
features,
|
|
4907
5274
|
control,
|
|
4908
5275
|
tags,
|
|
4909
|
-
children: /* @__PURE__ */
|
|
5276
|
+
children: /* @__PURE__ */ jsx72(
|
|
4910
5277
|
MoneyInput,
|
|
4911
5278
|
{
|
|
4912
5279
|
amount: parseFloatOrNull(amountValue),
|
|
@@ -4969,8 +5336,8 @@ function assertCurrencyCodeIsString(currencyCode) {
|
|
|
4969
5336
|
|
|
4970
5337
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4971
5338
|
import { ListItem as ListItem9, SearchInput as SearchInput2 } from "@transferwise/components";
|
|
4972
|
-
import { useState as
|
|
4973
|
-
import { useIntl as
|
|
5339
|
+
import { useState as useState15 } from "react";
|
|
5340
|
+
import { useIntl as useIntl14 } from "react-intl";
|
|
4974
5341
|
|
|
4975
5342
|
// ../renderers/src/utils/items-with-index.ts
|
|
4976
5343
|
var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadValues({}, item), {
|
|
@@ -4978,7 +5345,7 @@ var zipWithIndex = (items) => items.map((item, index) => __spreadProps(__spreadV
|
|
|
4978
5345
|
}));
|
|
4979
5346
|
|
|
4980
5347
|
// ../renderers/src/MultiSelectInputRenderer/InlineComponent.tsx
|
|
4981
|
-
import { Fragment as Fragment8, jsx as
|
|
5348
|
+
import { Fragment as Fragment8, jsx as jsx73, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4982
5349
|
function InlineComponent(props) {
|
|
4983
5350
|
const {
|
|
4984
5351
|
id,
|
|
@@ -4995,12 +5362,12 @@ function InlineComponent(props) {
|
|
|
4995
5362
|
onSelect
|
|
4996
5363
|
} = props;
|
|
4997
5364
|
const optionsWithIndex = zipWithIndex(options);
|
|
4998
|
-
const [query, setQuery] =
|
|
4999
|
-
const { formatMessage } =
|
|
5365
|
+
const [query, setQuery] = useState15("");
|
|
5366
|
+
const { formatMessage } = useIntl14();
|
|
5000
5367
|
const filtered = tags == null ? void 0 : tags.includes("filtered");
|
|
5001
5368
|
const filteredOptions = query ? filterAndSortItems(optionsWithIndex, filtered ? query : "") : optionsWithIndex;
|
|
5002
|
-
return /* @__PURE__ */
|
|
5003
|
-
filtered && /* @__PURE__ */
|
|
5369
|
+
return /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
5370
|
+
filtered && /* @__PURE__ */ jsx73(
|
|
5004
5371
|
SearchInput2,
|
|
5005
5372
|
{
|
|
5006
5373
|
placeholder: formatMessage(filter_messages_default.placeholder),
|
|
@@ -5013,7 +5380,7 @@ function InlineComponent(props) {
|
|
|
5013
5380
|
}
|
|
5014
5381
|
}
|
|
5015
5382
|
),
|
|
5016
|
-
/* @__PURE__ */
|
|
5383
|
+
/* @__PURE__ */ jsx73(
|
|
5017
5384
|
FieldInput_default,
|
|
5018
5385
|
{
|
|
5019
5386
|
id,
|
|
@@ -5038,7 +5405,7 @@ function InlineComponent(props) {
|
|
|
5038
5405
|
childrenProps
|
|
5039
5406
|
} = option;
|
|
5040
5407
|
const key = (_a = childrenProps == null ? void 0 : childrenProps.uid) != null ? _a : index;
|
|
5041
|
-
return /* @__PURE__ */
|
|
5408
|
+
return /* @__PURE__ */ jsx73(
|
|
5042
5409
|
ListItem9,
|
|
5043
5410
|
{
|
|
5044
5411
|
title: itemTitle,
|
|
@@ -5047,9 +5414,9 @@ function InlineComponent(props) {
|
|
|
5047
5414
|
valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
|
|
5048
5415
|
media: getMedia(media, false),
|
|
5049
5416
|
prompt: getInlineAlert(inlineAlert),
|
|
5050
|
-
additionalInfo: additionalText ? /* @__PURE__ */
|
|
5417
|
+
additionalInfo: additionalText ? /* @__PURE__ */ jsx73(ListItem9.AdditionalInfo, { children: additionalText }) : void 0,
|
|
5051
5418
|
disabled: disabled || optionDisabled,
|
|
5052
|
-
control: /* @__PURE__ */
|
|
5419
|
+
control: /* @__PURE__ */ jsx73(
|
|
5053
5420
|
ListItem9.Checkbox,
|
|
5054
5421
|
{
|
|
5055
5422
|
checked: selectedIndices.includes(index),
|
|
@@ -5070,8 +5437,8 @@ function InlineComponent(props) {
|
|
|
5070
5437
|
|
|
5071
5438
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5072
5439
|
import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
|
|
5073
|
-
import { useState as
|
|
5074
|
-
import { useIntl as
|
|
5440
|
+
import { useState as useState16 } from "react";
|
|
5441
|
+
import { useIntl as useIntl15 } from "react-intl";
|
|
5075
5442
|
|
|
5076
5443
|
// ../renderers/src/messages/multi-select.messages.ts
|
|
5077
5444
|
import { defineMessages as defineMessages10 } from "react-intl";
|
|
@@ -5084,10 +5451,10 @@ var multi_select_messages_default = defineMessages10({
|
|
|
5084
5451
|
});
|
|
5085
5452
|
|
|
5086
5453
|
// ../renderers/src/MultiSelectInputRenderer/DefaultComponent.tsx
|
|
5087
|
-
import { jsx as
|
|
5454
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
5088
5455
|
function DefaultComponent(props) {
|
|
5089
|
-
const { formatMessage } =
|
|
5090
|
-
const [stagedIndices, setStagedIndices] =
|
|
5456
|
+
const { formatMessage } = useIntl15();
|
|
5457
|
+
const [stagedIndices, setStagedIndices] = useState16();
|
|
5091
5458
|
const {
|
|
5092
5459
|
id,
|
|
5093
5460
|
autoComplete,
|
|
@@ -5128,12 +5495,12 @@ function DefaultComponent(props) {
|
|
|
5128
5495
|
const contentProps = {
|
|
5129
5496
|
title: option.title,
|
|
5130
5497
|
description: option.description,
|
|
5131
|
-
icon: /* @__PURE__ */
|
|
5498
|
+
icon: /* @__PURE__ */ jsx74(OptionMedia, { media: option.media, preferAvatar: false })
|
|
5132
5499
|
};
|
|
5133
|
-
return /* @__PURE__ */
|
|
5500
|
+
return /* @__PURE__ */ jsx74(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
5134
5501
|
};
|
|
5135
5502
|
const extraProps = { autoComplete };
|
|
5136
|
-
return /* @__PURE__ */
|
|
5503
|
+
return /* @__PURE__ */ jsx74(
|
|
5137
5504
|
FieldInput_default,
|
|
5138
5505
|
{
|
|
5139
5506
|
id,
|
|
@@ -5144,7 +5511,7 @@ function DefaultComponent(props) {
|
|
|
5144
5511
|
features,
|
|
5145
5512
|
control,
|
|
5146
5513
|
tags,
|
|
5147
|
-
children: /* @__PURE__ */
|
|
5514
|
+
children: /* @__PURE__ */ jsx74(
|
|
5148
5515
|
SelectInput,
|
|
5149
5516
|
__spreadValues({
|
|
5150
5517
|
id,
|
|
@@ -5184,7 +5551,7 @@ function DefaultComponent(props) {
|
|
|
5184
5551
|
|
|
5185
5552
|
// ../renderers/src/MultiSelectInputRenderer/InlineCheckboxComponent.tsx
|
|
5186
5553
|
import { Checkbox as Checkbox2 } from "@transferwise/components";
|
|
5187
|
-
import { jsx as
|
|
5554
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
5188
5555
|
function InlineCheckboxComponent(props) {
|
|
5189
5556
|
const {
|
|
5190
5557
|
id,
|
|
@@ -5200,7 +5567,7 @@ function InlineCheckboxComponent(props) {
|
|
|
5200
5567
|
tags,
|
|
5201
5568
|
onSelect
|
|
5202
5569
|
} = props;
|
|
5203
|
-
return /* @__PURE__ */
|
|
5570
|
+
return /* @__PURE__ */ jsx75(
|
|
5204
5571
|
FieldInput_default,
|
|
5205
5572
|
{
|
|
5206
5573
|
id,
|
|
@@ -5231,24 +5598,24 @@ function InlineCheckboxComponent(props) {
|
|
|
5231
5598
|
onSelect(newSelectedIndices);
|
|
5232
5599
|
}
|
|
5233
5600
|
};
|
|
5234
|
-
return /* @__PURE__ */
|
|
5601
|
+
return /* @__PURE__ */ jsx75(Checkbox2, __spreadProps(__spreadValues({}, checkboxProps), { className: "m-t-1" }), key);
|
|
5235
5602
|
})
|
|
5236
5603
|
}
|
|
5237
5604
|
);
|
|
5238
5605
|
}
|
|
5239
5606
|
|
|
5240
5607
|
// ../renderers/src/MultiSelectInputRenderer/MultiSelectInputRenderer.tsx
|
|
5241
|
-
import { jsx as
|
|
5608
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
5242
5609
|
var MultiSelectInputRenderer = {
|
|
5243
5610
|
canRenderType: "input-multi-select",
|
|
5244
5611
|
render: (props) => {
|
|
5245
5612
|
switch (props.control) {
|
|
5246
5613
|
case "inline":
|
|
5247
|
-
return /* @__PURE__ */
|
|
5614
|
+
return /* @__PURE__ */ jsx76(InlineComponent, __spreadValues({}, props));
|
|
5248
5615
|
case "inline-checkbox-group":
|
|
5249
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ jsx76(InlineCheckboxComponent, __spreadValues({}, props));
|
|
5250
5617
|
default:
|
|
5251
|
-
return /* @__PURE__ */
|
|
5618
|
+
return /* @__PURE__ */ jsx76(DefaultComponent, __spreadValues({}, props));
|
|
5252
5619
|
}
|
|
5253
5620
|
}
|
|
5254
5621
|
};
|
|
@@ -5258,8 +5625,8 @@ import { Status, UploadInput } from "@transferwise/components";
|
|
|
5258
5625
|
|
|
5259
5626
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
5260
5627
|
import { InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
5261
|
-
var
|
|
5262
|
-
import { jsx as
|
|
5628
|
+
var import_classnames25 = __toESM(require_classnames());
|
|
5629
|
+
import { jsx as jsx77, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5263
5630
|
function UploadFieldInput({
|
|
5264
5631
|
id,
|
|
5265
5632
|
children,
|
|
@@ -5271,14 +5638,14 @@ function UploadFieldInput({
|
|
|
5271
5638
|
control,
|
|
5272
5639
|
tags
|
|
5273
5640
|
}) {
|
|
5274
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
5641
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx77(LabelContentWithHelp, { text: label, help }) : label;
|
|
5275
5642
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5276
5643
|
const { ref } = useScrollToError(validation, features);
|
|
5277
|
-
return /* @__PURE__ */
|
|
5644
|
+
return /* @__PURE__ */ jsxs19(
|
|
5278
5645
|
"div",
|
|
5279
5646
|
{
|
|
5280
5647
|
ref,
|
|
5281
|
-
className: (0,
|
|
5648
|
+
className: (0, import_classnames25.default)(
|
|
5282
5649
|
"form-group d-block",
|
|
5283
5650
|
{
|
|
5284
5651
|
"has-error": (validation == null ? void 0 : validation.status) === "invalid"
|
|
@@ -5286,9 +5653,9 @@ function UploadFieldInput({
|
|
|
5286
5653
|
controlAndTagsToCSSClass({ control, tags })
|
|
5287
5654
|
),
|
|
5288
5655
|
children: [
|
|
5289
|
-
/* @__PURE__ */
|
|
5656
|
+
/* @__PURE__ */ jsx77("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
5290
5657
|
children,
|
|
5291
|
-
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */
|
|
5658
|
+
(validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx77(InlineAlert2, { type: "negative", id: descriptionId, children: validation.message })
|
|
5292
5659
|
]
|
|
5293
5660
|
}
|
|
5294
5661
|
);
|
|
@@ -5323,7 +5690,7 @@ var getSizeLimit = (maxSize) => {
|
|
|
5323
5690
|
};
|
|
5324
5691
|
|
|
5325
5692
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
5326
|
-
import { jsx as
|
|
5693
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
5327
5694
|
var MultiUploadInputRenderer = {
|
|
5328
5695
|
canRenderType: "input-upload-multi",
|
|
5329
5696
|
render: (props) => {
|
|
@@ -5351,7 +5718,7 @@ var MultiUploadInputRenderer = {
|
|
|
5351
5718
|
};
|
|
5352
5719
|
const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
|
|
5353
5720
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
5354
|
-
return /* @__PURE__ */
|
|
5721
|
+
return /* @__PURE__ */ jsx78(
|
|
5355
5722
|
UploadFieldInput_default,
|
|
5356
5723
|
{
|
|
5357
5724
|
id,
|
|
@@ -5362,7 +5729,7 @@ var MultiUploadInputRenderer = {
|
|
|
5362
5729
|
features,
|
|
5363
5730
|
control,
|
|
5364
5731
|
tags,
|
|
5365
|
-
children: /* @__PURE__ */
|
|
5732
|
+
children: /* @__PURE__ */ jsx78(
|
|
5366
5733
|
UploadInput,
|
|
5367
5734
|
{
|
|
5368
5735
|
id,
|
|
@@ -5390,8 +5757,8 @@ var MultiUploadInputRenderer = {
|
|
|
5390
5757
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
5391
5758
|
|
|
5392
5759
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
5393
|
-
import { Input as
|
|
5394
|
-
import { jsx as
|
|
5760
|
+
import { Input as Input4, InputGroup as InputGroup4 } from "@transferwise/components";
|
|
5761
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
5395
5762
|
var NumberInputRenderer = {
|
|
5396
5763
|
canRenderType: "input-number",
|
|
5397
5764
|
render: (props) => {
|
|
@@ -5405,7 +5772,7 @@ var NumberInputRenderer = {
|
|
|
5405
5772
|
"maximum",
|
|
5406
5773
|
"minimum"
|
|
5407
5774
|
);
|
|
5408
|
-
return /* @__PURE__ */
|
|
5775
|
+
return /* @__PURE__ */ jsx79(
|
|
5409
5776
|
FieldInput_default,
|
|
5410
5777
|
{
|
|
5411
5778
|
id,
|
|
@@ -5418,8 +5785,8 @@ var NumberInputRenderer = {
|
|
|
5418
5785
|
features: props.features,
|
|
5419
5786
|
control: props.control,
|
|
5420
5787
|
tags: props.tags,
|
|
5421
|
-
children: /* @__PURE__ */
|
|
5422
|
-
|
|
5788
|
+
children: /* @__PURE__ */ jsx79(InputGroup4, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx79(
|
|
5789
|
+
Input4,
|
|
5423
5790
|
__spreadValues({
|
|
5424
5791
|
id,
|
|
5425
5792
|
name: id,
|
|
@@ -5439,9 +5806,9 @@ var NumberInputRenderer = {
|
|
|
5439
5806
|
var NumberInputRenderer_default = NumberInputRenderer;
|
|
5440
5807
|
|
|
5441
5808
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5442
|
-
var
|
|
5443
|
-
import { Button as
|
|
5444
|
-
import { useIntl as
|
|
5809
|
+
var import_classnames26 = __toESM(require_classnames());
|
|
5810
|
+
import { Button as Button8, Input as Input5 } from "@transferwise/components";
|
|
5811
|
+
import { useIntl as useIntl16 } from "react-intl";
|
|
5445
5812
|
|
|
5446
5813
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
5447
5814
|
import { SnackbarContext } from "@transferwise/components";
|
|
@@ -5468,18 +5835,18 @@ var paragraph_messages_default = defineMessages11({
|
|
|
5468
5835
|
});
|
|
5469
5836
|
|
|
5470
5837
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
5471
|
-
import { jsx as
|
|
5838
|
+
import { jsx as jsx80, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5472
5839
|
var ParagraphRenderer = {
|
|
5473
5840
|
canRenderType: "paragraph",
|
|
5474
|
-
render: (props) => /* @__PURE__ */
|
|
5841
|
+
render: (props) => /* @__PURE__ */ jsx80(Paragraph, __spreadValues({}, props))
|
|
5475
5842
|
};
|
|
5476
5843
|
function Paragraph(props) {
|
|
5477
5844
|
const { align, control, margin, size, text } = props;
|
|
5478
|
-
const className = (0,
|
|
5845
|
+
const className = (0, import_classnames26.default)(
|
|
5479
5846
|
getTextAlignmentAndMargin({ align, margin }),
|
|
5480
5847
|
controlAndTagsToCSSClass(props)
|
|
5481
5848
|
);
|
|
5482
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
5849
|
+
return control === "copyable" ? /* @__PURE__ */ jsx80(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx80(
|
|
5483
5850
|
"p",
|
|
5484
5851
|
{
|
|
5485
5852
|
className: `${["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"} ${className}`,
|
|
@@ -5492,41 +5859,41 @@ function CopyableParagraph({
|
|
|
5492
5859
|
align,
|
|
5493
5860
|
className
|
|
5494
5861
|
}) {
|
|
5495
|
-
const { formatMessage } =
|
|
5862
|
+
const { formatMessage } = useIntl16();
|
|
5496
5863
|
const createSnackbar = useSnackBarIfAvailable();
|
|
5497
5864
|
const copy = () => {
|
|
5498
5865
|
navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
|
|
5499
5866
|
});
|
|
5500
5867
|
};
|
|
5501
5868
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
5502
|
-
return /* @__PURE__ */
|
|
5503
|
-
/* @__PURE__ */
|
|
5504
|
-
|
|
5869
|
+
return /* @__PURE__ */ jsxs20("div", { className, children: [
|
|
5870
|
+
/* @__PURE__ */ jsx80(
|
|
5871
|
+
Input5,
|
|
5505
5872
|
{
|
|
5506
5873
|
type: "text",
|
|
5507
5874
|
value: text,
|
|
5508
5875
|
readOnly: true,
|
|
5509
|
-
className: (0,
|
|
5876
|
+
className: (0, import_classnames26.default)("text-ellipsis", inputAlignmentClasses)
|
|
5510
5877
|
}
|
|
5511
5878
|
),
|
|
5512
|
-
/* @__PURE__ */
|
|
5879
|
+
/* @__PURE__ */ jsx80(Button8, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
5513
5880
|
] });
|
|
5514
5881
|
}
|
|
5515
5882
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
5516
5883
|
|
|
5517
5884
|
// ../renderers/src/ProgressRenderer.tsx
|
|
5518
|
-
var
|
|
5885
|
+
var import_classnames27 = __toESM(require_classnames());
|
|
5519
5886
|
import { ProgressBar } from "@transferwise/components";
|
|
5520
|
-
import { jsx as
|
|
5887
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
5521
5888
|
var ProgressRenderer = {
|
|
5522
5889
|
canRenderType: "progress",
|
|
5523
5890
|
render: ({ uid, title, help, progress, progressText, margin, description, control, tags }) => {
|
|
5524
|
-
return /* @__PURE__ */
|
|
5891
|
+
return /* @__PURE__ */ jsx81(
|
|
5525
5892
|
ProgressBar,
|
|
5526
5893
|
{
|
|
5527
5894
|
id: uid,
|
|
5528
|
-
className: (0,
|
|
5529
|
-
title: title && help ? /* @__PURE__ */
|
|
5895
|
+
className: (0, import_classnames27.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
5896
|
+
title: title && help ? /* @__PURE__ */ jsx81(LabelContentWithHelp, { text: title, help }) : title,
|
|
5530
5897
|
description,
|
|
5531
5898
|
progress: {
|
|
5532
5899
|
max: 1,
|
|
@@ -5539,11 +5906,11 @@ var ProgressRenderer = {
|
|
|
5539
5906
|
};
|
|
5540
5907
|
|
|
5541
5908
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5542
|
-
var
|
|
5543
|
-
import { Button as
|
|
5909
|
+
var import_classnames28 = __toESM(require_classnames());
|
|
5910
|
+
import { Button as Button9, Header as Header6, InlineAlert as InlineAlert3, Modal as Modal4, NavigationOption } from "@transferwise/components";
|
|
5544
5911
|
import { Plus } from "@transferwise/icons";
|
|
5545
|
-
import { useState as
|
|
5546
|
-
import { useIntl as
|
|
5912
|
+
import { useState as useState17 } from "react";
|
|
5913
|
+
import { useIntl as useIntl17 } from "react-intl";
|
|
5547
5914
|
|
|
5548
5915
|
// ../renderers/src/messages/repeatable.messages.ts
|
|
5549
5916
|
import { defineMessages as defineMessages12 } from "react-intl";
|
|
@@ -5571,10 +5938,10 @@ var repeatable_messages_default = defineMessages12({
|
|
|
5571
5938
|
});
|
|
5572
5939
|
|
|
5573
5940
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
5574
|
-
import { Fragment as Fragment9, jsx as
|
|
5941
|
+
import { Fragment as Fragment9, jsx as jsx82, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5575
5942
|
var RepeatableRenderer = {
|
|
5576
5943
|
canRenderType: "repeatable",
|
|
5577
|
-
render: (props) => /* @__PURE__ */
|
|
5944
|
+
render: (props) => /* @__PURE__ */ jsx82(Repeatable, __spreadValues({}, props))
|
|
5578
5945
|
};
|
|
5579
5946
|
function Repeatable(props) {
|
|
5580
5947
|
const {
|
|
@@ -5591,8 +5958,8 @@ function Repeatable(props) {
|
|
|
5591
5958
|
onSave,
|
|
5592
5959
|
onRemove
|
|
5593
5960
|
} = props;
|
|
5594
|
-
const { formatMessage } =
|
|
5595
|
-
const [openModalType, setOpenModalType] =
|
|
5961
|
+
const { formatMessage } = useIntl17();
|
|
5962
|
+
const [openModalType, setOpenModalType] = useState17(null);
|
|
5596
5963
|
const { ref } = useScrollToError(validationState, features);
|
|
5597
5964
|
const onAddItem = () => {
|
|
5598
5965
|
onAdd();
|
|
@@ -5615,43 +5982,43 @@ function Repeatable(props) {
|
|
|
5615
5982
|
const onCancelEdit = () => {
|
|
5616
5983
|
setOpenModalType(null);
|
|
5617
5984
|
};
|
|
5618
|
-
return /* @__PURE__ */
|
|
5619
|
-
/* @__PURE__ */
|
|
5620
|
-
title && /* @__PURE__ */
|
|
5621
|
-
description && /* @__PURE__ */
|
|
5622
|
-
/* @__PURE__ */
|
|
5985
|
+
return /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
5986
|
+
/* @__PURE__ */ jsxs21("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
5987
|
+
title && /* @__PURE__ */ jsx82(Header6, { title }),
|
|
5988
|
+
description && /* @__PURE__ */ jsx82("p", { children: description }),
|
|
5989
|
+
/* @__PURE__ */ jsxs21(
|
|
5623
5990
|
"div",
|
|
5624
5991
|
{
|
|
5625
|
-
className: (0,
|
|
5992
|
+
className: (0, import_classnames28.default)("form-group", {
|
|
5626
5993
|
"has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
|
|
5627
5994
|
}),
|
|
5628
5995
|
children: [
|
|
5629
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
5630
|
-
/* @__PURE__ */
|
|
5996
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx82(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
5997
|
+
/* @__PURE__ */ jsx82(
|
|
5631
5998
|
NavigationOption,
|
|
5632
5999
|
{
|
|
5633
|
-
media: /* @__PURE__ */
|
|
6000
|
+
media: /* @__PURE__ */ jsx82(Plus, {}),
|
|
5634
6001
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5635
6002
|
showMediaAtAllSizes: true,
|
|
5636
6003
|
onClick: () => onAddItem()
|
|
5637
6004
|
}
|
|
5638
6005
|
),
|
|
5639
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
6006
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx82(InlineAlert3, { type: "negative", children: validationState.message })
|
|
5640
6007
|
]
|
|
5641
6008
|
}
|
|
5642
6009
|
)
|
|
5643
6010
|
] }),
|
|
5644
|
-
/* @__PURE__ */
|
|
6011
|
+
/* @__PURE__ */ jsx82(
|
|
5645
6012
|
Modal4,
|
|
5646
6013
|
{
|
|
5647
6014
|
open: openModalType !== null,
|
|
5648
6015
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
5649
|
-
body: /* @__PURE__ */
|
|
5650
|
-
/* @__PURE__ */
|
|
5651
|
-
/* @__PURE__ */
|
|
5652
|
-
/* @__PURE__ */
|
|
5653
|
-
/* @__PURE__ */
|
|
5654
|
-
|
|
6016
|
+
body: /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
6017
|
+
/* @__PURE__ */ jsx82("div", { className: "m-b-2", children: editableItem }),
|
|
6018
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6019
|
+
/* @__PURE__ */ jsx82(Button9, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
6020
|
+
/* @__PURE__ */ jsx82(
|
|
6021
|
+
Button9,
|
|
5655
6022
|
{
|
|
5656
6023
|
v2: true,
|
|
5657
6024
|
priority: "secondary",
|
|
@@ -5672,10 +6039,10 @@ function ItemSummaryOption({
|
|
|
5672
6039
|
item,
|
|
5673
6040
|
onClick
|
|
5674
6041
|
}) {
|
|
5675
|
-
return /* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ jsx82(
|
|
5676
6043
|
NavigationOption,
|
|
5677
6044
|
{
|
|
5678
|
-
media: /* @__PURE__ */
|
|
6045
|
+
media: /* @__PURE__ */ jsx82(OptionMedia, { media: item.media, preferAvatar: false }),
|
|
5679
6046
|
title: item.title,
|
|
5680
6047
|
content: item.description,
|
|
5681
6048
|
showMediaAtAllSizes: true,
|
|
@@ -5687,16 +6054,16 @@ function ItemSummaryOption({
|
|
|
5687
6054
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
5688
6055
|
|
|
5689
6056
|
// ../renderers/src/ReviewLegacyRenderer.tsx
|
|
5690
|
-
var
|
|
6057
|
+
var import_classnames29 = __toESM(require_classnames());
|
|
5691
6058
|
import { DefinitionList } from "@transferwise/components";
|
|
5692
|
-
import { Fragment as Fragment10, jsx as
|
|
6059
|
+
import { Fragment as Fragment10, jsx as jsx83, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5693
6060
|
var ReviewRenderer = {
|
|
5694
6061
|
canRenderType: "review",
|
|
5695
6062
|
render: ({ callToAction, control, fields, margin, title, trackEvent, tags }) => {
|
|
5696
6063
|
const orientation = mapControlToDefinitionListLayout(control);
|
|
5697
|
-
return /* @__PURE__ */
|
|
5698
|
-
/* @__PURE__ */
|
|
5699
|
-
/* @__PURE__ */
|
|
6064
|
+
return /* @__PURE__ */ jsxs22("div", { className: (0, import_classnames29.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6065
|
+
/* @__PURE__ */ jsx83(Header, { title, callToAction }),
|
|
6066
|
+
/* @__PURE__ */ jsx83("div", { className: margin, children: /* @__PURE__ */ jsx83(
|
|
5700
6067
|
DefinitionList,
|
|
5701
6068
|
{
|
|
5702
6069
|
layout: orientation,
|
|
@@ -5734,21 +6101,21 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
5734
6101
|
};
|
|
5735
6102
|
var getFieldLabel = (label, help, onClick) => {
|
|
5736
6103
|
if (help) {
|
|
5737
|
-
return /* @__PURE__ */
|
|
6104
|
+
return /* @__PURE__ */ jsxs22(Fragment10, { children: [
|
|
5738
6105
|
label,
|
|
5739
6106
|
" ",
|
|
5740
|
-
/* @__PURE__ */
|
|
6107
|
+
/* @__PURE__ */ jsx83(Help_default, { help, onClick })
|
|
5741
6108
|
] });
|
|
5742
6109
|
}
|
|
5743
6110
|
return label;
|
|
5744
6111
|
};
|
|
5745
6112
|
|
|
5746
6113
|
// ../renderers/src/ReviewRenderer.tsx
|
|
5747
|
-
var
|
|
6114
|
+
var import_classnames30 = __toESM(require_classnames());
|
|
5748
6115
|
import { ListItem as ListItem10, Markdown as Markdown5, Popover } from "@transferwise/components";
|
|
5749
6116
|
import { QuestionMarkCircle } from "@transferwise/icons";
|
|
5750
|
-
import { useIntl as
|
|
5751
|
-
import { jsx as
|
|
6117
|
+
import { useIntl as useIntl18 } from "react-intl";
|
|
6118
|
+
import { jsx as jsx84, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5752
6119
|
var IGNORED_CONTROLS = [
|
|
5753
6120
|
"horizontal",
|
|
5754
6121
|
"horizontal-end-aligned",
|
|
@@ -5758,7 +6125,7 @@ var IGNORED_CONTROLS = [
|
|
|
5758
6125
|
var ReviewRenderer2 = {
|
|
5759
6126
|
canRenderType: "review",
|
|
5760
6127
|
canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
|
|
5761
|
-
render: (props) => /* @__PURE__ */
|
|
6128
|
+
render: (props) => /* @__PURE__ */ jsx84(Review, __spreadValues({}, props))
|
|
5762
6129
|
};
|
|
5763
6130
|
var Review = ({
|
|
5764
6131
|
callToAction,
|
|
@@ -5769,9 +6136,9 @@ var Review = ({
|
|
|
5769
6136
|
title,
|
|
5770
6137
|
trackEvent
|
|
5771
6138
|
}) => {
|
|
5772
|
-
const intl =
|
|
5773
|
-
return /* @__PURE__ */
|
|
5774
|
-
/* @__PURE__ */
|
|
6139
|
+
const intl = useIntl18();
|
|
6140
|
+
return /* @__PURE__ */ jsxs23("div", { className: (0, import_classnames30.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6141
|
+
/* @__PURE__ */ jsx84(Header, { title, callToAction }),
|
|
5775
6142
|
fields.map((field) => {
|
|
5776
6143
|
var _a, _b, _c;
|
|
5777
6144
|
const {
|
|
@@ -5789,7 +6156,7 @@ var Review = ({
|
|
|
5789
6156
|
ctaSecondary: (_a = itemTags == null ? void 0 : itemTags.includes("cta-secondary")) != null ? _a : false,
|
|
5790
6157
|
fullyInteractive: (_b = (tags == null ? void 0 : tags.includes("fully-interactive")) && (additionalInfo == null ? void 0 : additionalInfo.onClick) == null) != null ? _b : false
|
|
5791
6158
|
};
|
|
5792
|
-
return /* @__PURE__ */
|
|
6159
|
+
return /* @__PURE__ */ jsx84(
|
|
5793
6160
|
ListItem10,
|
|
5794
6161
|
{
|
|
5795
6162
|
title: value,
|
|
@@ -5810,14 +6177,14 @@ var Review = ({
|
|
|
5810
6177
|
] });
|
|
5811
6178
|
};
|
|
5812
6179
|
var getHelpControl = (help, ariaLabel, onClick) => {
|
|
5813
|
-
return /* @__PURE__ */
|
|
6180
|
+
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, {}) }) });
|
|
5814
6181
|
};
|
|
5815
6182
|
var ReviewRenderer_default = ReviewRenderer2;
|
|
5816
6183
|
|
|
5817
6184
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5818
|
-
import { Input as
|
|
5819
|
-
import { useState as
|
|
5820
|
-
import { useIntl as
|
|
6185
|
+
import { Input as Input6, InputGroup as InputGroup5, List, ListItem as ListItem11, Markdown as Markdown6 } from "@transferwise/components";
|
|
6186
|
+
import { useState as useState18 } from "react";
|
|
6187
|
+
import { useIntl as useIntl20 } from "react-intl";
|
|
5821
6188
|
|
|
5822
6189
|
// ../renderers/src/messages/search.messages.ts
|
|
5823
6190
|
import { defineMessages as defineMessages13 } from "react-intl";
|
|
@@ -5830,21 +6197,21 @@ var search_messages_default = defineMessages13({
|
|
|
5830
6197
|
});
|
|
5831
6198
|
|
|
5832
6199
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
5833
|
-
import { useIntl as
|
|
6200
|
+
import { useIntl as useIntl19 } from "react-intl";
|
|
5834
6201
|
import { Link as DSLink2 } from "@transferwise/components";
|
|
5835
|
-
import { jsx as
|
|
6202
|
+
import { jsx as jsx85, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5836
6203
|
function ErrorResult({ state }) {
|
|
5837
|
-
const intl =
|
|
5838
|
-
return /* @__PURE__ */
|
|
6204
|
+
const intl = useIntl19();
|
|
6205
|
+
return /* @__PURE__ */ jsxs24("p", { className: "m-t-2", children: [
|
|
5839
6206
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
5840
6207
|
"\xA0",
|
|
5841
|
-
/* @__PURE__ */
|
|
6208
|
+
/* @__PURE__ */ jsx85(DSLink2, { onClick: () => state.onRetry(), children: intl.formatMessage(generic_error_messages_default.retry) })
|
|
5842
6209
|
] });
|
|
5843
6210
|
}
|
|
5844
6211
|
|
|
5845
6212
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
5846
|
-
import { Search as
|
|
5847
|
-
import { Fragment as Fragment11, jsx as
|
|
6213
|
+
import { Search as Search3 } from "@transferwise/icons";
|
|
6214
|
+
import { Fragment as Fragment11, jsx as jsx86, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5848
6215
|
function BlockSearchRendererComponent({
|
|
5849
6216
|
id,
|
|
5850
6217
|
hint,
|
|
@@ -5859,10 +6226,10 @@ function BlockSearchRendererComponent({
|
|
|
5859
6226
|
trackEvent,
|
|
5860
6227
|
onChange
|
|
5861
6228
|
}) {
|
|
5862
|
-
const [hasSearched, setHasSearched] =
|
|
5863
|
-
const { formatMessage } =
|
|
5864
|
-
return /* @__PURE__ */
|
|
5865
|
-
/* @__PURE__ */
|
|
6229
|
+
const [hasSearched, setHasSearched] = useState18(false);
|
|
6230
|
+
const { formatMessage } = useIntl20();
|
|
6231
|
+
return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
6232
|
+
/* @__PURE__ */ jsx86(
|
|
5866
6233
|
FieldInput_default,
|
|
5867
6234
|
{
|
|
5868
6235
|
id,
|
|
@@ -5873,8 +6240,8 @@ function BlockSearchRendererComponent({
|
|
|
5873
6240
|
features,
|
|
5874
6241
|
control,
|
|
5875
6242
|
tags,
|
|
5876
|
-
children: /* @__PURE__ */
|
|
5877
|
-
|
|
6243
|
+
children: /* @__PURE__ */ jsx86(InputGroup5, { addonStart: { content: /* @__PURE__ */ jsx86(Search3, { size: 24 }) }, children: /* @__PURE__ */ jsx86(
|
|
6244
|
+
Input6,
|
|
5878
6245
|
{
|
|
5879
6246
|
id,
|
|
5880
6247
|
name: id,
|
|
@@ -5893,7 +6260,7 @@ function BlockSearchRendererComponent({
|
|
|
5893
6260
|
) })
|
|
5894
6261
|
}
|
|
5895
6262
|
),
|
|
5896
|
-
isLoading ? /* @__PURE__ */
|
|
6263
|
+
isLoading ? /* @__PURE__ */ jsx86("span", { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx86(SearchResultContent, { state, trackEvent })
|
|
5897
6264
|
] });
|
|
5898
6265
|
}
|
|
5899
6266
|
function SearchResultContent({
|
|
@@ -5902,38 +6269,38 @@ function SearchResultContent({
|
|
|
5902
6269
|
}) {
|
|
5903
6270
|
switch (state.type) {
|
|
5904
6271
|
case "error":
|
|
5905
|
-
return /* @__PURE__ */
|
|
6272
|
+
return /* @__PURE__ */ jsx86(ErrorResult, { state });
|
|
5906
6273
|
case "results":
|
|
5907
|
-
return /* @__PURE__ */
|
|
6274
|
+
return /* @__PURE__ */ jsx86(SearchResults, { state, trackEvent });
|
|
5908
6275
|
case "layout":
|
|
5909
|
-
return /* @__PURE__ */
|
|
6276
|
+
return /* @__PURE__ */ jsxs25(Fragment11, { children: [
|
|
5910
6277
|
" ",
|
|
5911
6278
|
state.layout,
|
|
5912
6279
|
" "
|
|
5913
6280
|
] });
|
|
5914
6281
|
case "noResults":
|
|
5915
|
-
return /* @__PURE__ */
|
|
6282
|
+
return /* @__PURE__ */ jsx86(EmptySearchResult, { state });
|
|
5916
6283
|
case "pending":
|
|
5917
6284
|
default:
|
|
5918
6285
|
return null;
|
|
5919
6286
|
}
|
|
5920
6287
|
}
|
|
5921
6288
|
function EmptySearchResult({ state }) {
|
|
5922
|
-
return /* @__PURE__ */
|
|
6289
|
+
return /* @__PURE__ */ jsx86(Markdown6, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
5923
6290
|
}
|
|
5924
6291
|
function SearchResults({
|
|
5925
6292
|
state,
|
|
5926
6293
|
trackEvent
|
|
5927
6294
|
}) {
|
|
5928
|
-
return /* @__PURE__ */
|
|
6295
|
+
return /* @__PURE__ */ jsx86(List, { children: state.results.map((result) => {
|
|
5929
6296
|
const { media } = result;
|
|
5930
|
-
return /* @__PURE__ */
|
|
6297
|
+
return /* @__PURE__ */ jsx86(
|
|
5931
6298
|
ListItem11,
|
|
5932
6299
|
{
|
|
5933
6300
|
title: result.title,
|
|
5934
6301
|
subtitle: result.description,
|
|
5935
|
-
media: media ? /* @__PURE__ */
|
|
5936
|
-
control: /* @__PURE__ */
|
|
6302
|
+
media: media ? /* @__PURE__ */ jsx86(OptionMedia, { media, preferAvatar: false }) : void 0,
|
|
6303
|
+
control: /* @__PURE__ */ jsx86(
|
|
5937
6304
|
ListItem11.Navigation,
|
|
5938
6305
|
{
|
|
5939
6306
|
onClick: () => {
|
|
@@ -5953,10 +6320,10 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
5953
6320
|
|
|
5954
6321
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
5955
6322
|
import { Markdown as Markdown7, Typeahead } from "@transferwise/components";
|
|
5956
|
-
import { Search as
|
|
5957
|
-
import { useState as
|
|
5958
|
-
import { useIntl as
|
|
5959
|
-
import { jsx as
|
|
6323
|
+
import { Search as Search4 } from "@transferwise/icons";
|
|
6324
|
+
import { useState as useState19 } from "react";
|
|
6325
|
+
import { useIntl as useIntl21 } from "react-intl";
|
|
6326
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
5960
6327
|
function InlineSearchRenderer({
|
|
5961
6328
|
id,
|
|
5962
6329
|
hint,
|
|
@@ -5970,9 +6337,9 @@ function InlineSearchRenderer({
|
|
|
5970
6337
|
onChange,
|
|
5971
6338
|
trackEvent
|
|
5972
6339
|
}) {
|
|
5973
|
-
const [hasSearched, setHasSearched] =
|
|
5974
|
-
const intl =
|
|
5975
|
-
return /* @__PURE__ */
|
|
6340
|
+
const [hasSearched, setHasSearched] = useState19(false);
|
|
6341
|
+
const intl = useIntl21();
|
|
6342
|
+
return /* @__PURE__ */ jsx87("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx87(
|
|
5976
6343
|
FieldInput_default,
|
|
5977
6344
|
{
|
|
5978
6345
|
id,
|
|
@@ -5983,7 +6350,7 @@ function InlineSearchRenderer({
|
|
|
5983
6350
|
features,
|
|
5984
6351
|
control,
|
|
5985
6352
|
tags,
|
|
5986
|
-
children: /* @__PURE__ */
|
|
6353
|
+
children: /* @__PURE__ */ jsx87(
|
|
5987
6354
|
Typeahead,
|
|
5988
6355
|
{
|
|
5989
6356
|
id: "typeahead-input-id",
|
|
@@ -5992,10 +6359,10 @@ function InlineSearchRenderer({
|
|
|
5992
6359
|
size: "md",
|
|
5993
6360
|
placeholder: hint,
|
|
5994
6361
|
maxHeight: 100,
|
|
5995
|
-
footer: /* @__PURE__ */
|
|
6362
|
+
footer: /* @__PURE__ */ jsx87(TypeaheadFooter, { state, isLoading }),
|
|
5996
6363
|
multiple: false,
|
|
5997
6364
|
clearable: false,
|
|
5998
|
-
addon: /* @__PURE__ */
|
|
6365
|
+
addon: /* @__PURE__ */ jsx87(Search4, { size: 24 }),
|
|
5999
6366
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
6000
6367
|
minQueryLength: 1,
|
|
6001
6368
|
onChange: (values) => {
|
|
@@ -6032,33 +6399,33 @@ function mapResultToTypeaheadOption(result) {
|
|
|
6032
6399
|
};
|
|
6033
6400
|
}
|
|
6034
6401
|
function TypeaheadFooter({ state, isLoading }) {
|
|
6035
|
-
const { formatMessage } =
|
|
6402
|
+
const { formatMessage } = useIntl21();
|
|
6036
6403
|
if (state.type === "layout") {
|
|
6037
|
-
return /* @__PURE__ */
|
|
6404
|
+
return /* @__PURE__ */ jsx87("div", { className: "m-x-1 m-y-1", children: state.layout });
|
|
6038
6405
|
}
|
|
6039
6406
|
if (state.type === "noResults") {
|
|
6040
|
-
return /* @__PURE__ */
|
|
6407
|
+
return /* @__PURE__ */ jsx87(Markdown7, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
6041
6408
|
}
|
|
6042
6409
|
if (state.type === "error") {
|
|
6043
|
-
return /* @__PURE__ */
|
|
6410
|
+
return /* @__PURE__ */ jsx87("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx87(ErrorResult, { state }) });
|
|
6044
6411
|
}
|
|
6045
6412
|
if (state.type === "pending" || isLoading) {
|
|
6046
|
-
return /* @__PURE__ */
|
|
6413
|
+
return /* @__PURE__ */ jsx87("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
|
|
6047
6414
|
}
|
|
6048
6415
|
return null;
|
|
6049
6416
|
}
|
|
6050
6417
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
6051
6418
|
|
|
6052
6419
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
6053
|
-
import { jsx as
|
|
6420
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
6054
6421
|
var SearchRenderer = {
|
|
6055
6422
|
canRenderType: "search",
|
|
6056
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
6423
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx88(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx88(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
6057
6424
|
};
|
|
6058
6425
|
var SearchRenderer_default = SearchRenderer;
|
|
6059
6426
|
|
|
6060
6427
|
// ../renderers/src/SectionRenderer.tsx
|
|
6061
|
-
var
|
|
6428
|
+
var import_classnames31 = __toESM(require_classnames());
|
|
6062
6429
|
import { Header as Header7 } from "@transferwise/components";
|
|
6063
6430
|
|
|
6064
6431
|
// ../renderers/src/utils/getHeaderAction.tsx
|
|
@@ -6083,16 +6450,16 @@ var getHeaderAction2 = (callToAction) => {
|
|
|
6083
6450
|
};
|
|
6084
6451
|
|
|
6085
6452
|
// ../renderers/src/SectionRenderer.tsx
|
|
6086
|
-
import { jsx as
|
|
6453
|
+
import { jsx as jsx89, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6087
6454
|
var SectionRenderer = {
|
|
6088
6455
|
canRenderType: "section",
|
|
6089
6456
|
render: ({ children, callToAction, margin, title, control, tags }) => {
|
|
6090
|
-
return /* @__PURE__ */
|
|
6457
|
+
return /* @__PURE__ */ jsxs26(
|
|
6091
6458
|
"section",
|
|
6092
6459
|
{
|
|
6093
|
-
className: (0,
|
|
6460
|
+
className: (0, import_classnames31.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
6094
6461
|
children: [
|
|
6095
|
-
(title || callToAction) && /* @__PURE__ */
|
|
6462
|
+
(title || callToAction) && /* @__PURE__ */ jsx89(Header7, { title: title != null ? title : "", action: getHeaderAction2(callToAction) }),
|
|
6096
6463
|
children
|
|
6097
6464
|
]
|
|
6098
6465
|
}
|
|
@@ -6103,7 +6470,7 @@ var SectionRenderer_default = SectionRenderer;
|
|
|
6103
6470
|
|
|
6104
6471
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
6105
6472
|
import { RadioGroup } from "@transferwise/components";
|
|
6106
|
-
import { Fragment as Fragment12, jsx as
|
|
6473
|
+
import { Fragment as Fragment12, jsx as jsx90, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6107
6474
|
function RadioInputRendererComponent(props) {
|
|
6108
6475
|
const {
|
|
6109
6476
|
id,
|
|
@@ -6120,8 +6487,8 @@ function RadioInputRendererComponent(props) {
|
|
|
6120
6487
|
tags,
|
|
6121
6488
|
onSelect
|
|
6122
6489
|
} = props;
|
|
6123
|
-
return /* @__PURE__ */
|
|
6124
|
-
/* @__PURE__ */
|
|
6490
|
+
return /* @__PURE__ */ jsxs27(Fragment12, { children: [
|
|
6491
|
+
/* @__PURE__ */ jsx90(
|
|
6125
6492
|
FieldInput_default,
|
|
6126
6493
|
{
|
|
6127
6494
|
id,
|
|
@@ -6132,7 +6499,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6132
6499
|
features,
|
|
6133
6500
|
control,
|
|
6134
6501
|
tags,
|
|
6135
|
-
children: /* @__PURE__ */
|
|
6502
|
+
children: /* @__PURE__ */ jsx90("span", { children: /* @__PURE__ */ jsx90(
|
|
6136
6503
|
RadioGroup,
|
|
6137
6504
|
{
|
|
6138
6505
|
name: id,
|
|
@@ -6141,7 +6508,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6141
6508
|
value: index,
|
|
6142
6509
|
secondary: option.description,
|
|
6143
6510
|
disabled: option.disabled || disabled,
|
|
6144
|
-
avatar: /* @__PURE__ */
|
|
6511
|
+
avatar: /* @__PURE__ */ jsx90(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6145
6512
|
})),
|
|
6146
6513
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
6147
6514
|
onChange: onSelect
|
|
@@ -6157,7 +6524,7 @@ function RadioInputRendererComponent(props) {
|
|
|
6157
6524
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
6158
6525
|
import { Tabs } from "@transferwise/components";
|
|
6159
6526
|
import { useEffect as useEffect12 } from "react";
|
|
6160
|
-
import { Fragment as Fragment13, jsx as
|
|
6527
|
+
import { Fragment as Fragment13, jsx as jsx91, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6161
6528
|
function TabInputRendererComponent(props) {
|
|
6162
6529
|
const {
|
|
6163
6530
|
id,
|
|
@@ -6179,8 +6546,8 @@ function TabInputRendererComponent(props) {
|
|
|
6179
6546
|
onSelect(0);
|
|
6180
6547
|
}
|
|
6181
6548
|
}, [selectedIndex, onSelect, options.length]);
|
|
6182
|
-
return /* @__PURE__ */
|
|
6183
|
-
/* @__PURE__ */
|
|
6549
|
+
return /* @__PURE__ */ jsxs28(Fragment13, { children: [
|
|
6550
|
+
/* @__PURE__ */ jsx91(
|
|
6184
6551
|
FieldInput_default,
|
|
6185
6552
|
{
|
|
6186
6553
|
id,
|
|
@@ -6191,7 +6558,7 @@ function TabInputRendererComponent(props) {
|
|
|
6191
6558
|
features,
|
|
6192
6559
|
control,
|
|
6193
6560
|
tags,
|
|
6194
|
-
children: /* @__PURE__ */
|
|
6561
|
+
children: /* @__PURE__ */ jsx91(
|
|
6195
6562
|
Tabs,
|
|
6196
6563
|
{
|
|
6197
6564
|
name: id,
|
|
@@ -6200,7 +6567,7 @@ function TabInputRendererComponent(props) {
|
|
|
6200
6567
|
title: option.title,
|
|
6201
6568
|
// if we pass null, we get some props-types console errors
|
|
6202
6569
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
6203
|
-
content: /* @__PURE__ */
|
|
6570
|
+
content: /* @__PURE__ */ jsx91(Fragment13, {}),
|
|
6204
6571
|
disabled: option.disabled || disabled
|
|
6205
6572
|
})),
|
|
6206
6573
|
onTabSelect: onSelect
|
|
@@ -6215,7 +6582,7 @@ var isValidIndex2 = (index, options) => index !== null && index >= 0 && index <
|
|
|
6215
6582
|
|
|
6216
6583
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
6217
6584
|
import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
|
|
6218
|
-
import { Fragment as Fragment14, jsx as
|
|
6585
|
+
import { Fragment as Fragment14, jsx as jsx92, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6219
6586
|
function SelectInputRendererComponent(props) {
|
|
6220
6587
|
const {
|
|
6221
6588
|
id,
|
|
@@ -6258,13 +6625,13 @@ function SelectInputRendererComponent(props) {
|
|
|
6258
6625
|
} : {
|
|
6259
6626
|
title: option.title,
|
|
6260
6627
|
description: option.description,
|
|
6261
|
-
icon: /* @__PURE__ */
|
|
6628
|
+
icon: /* @__PURE__ */ jsx92(OptionMedia, { media: option.media, preferAvatar: false })
|
|
6262
6629
|
};
|
|
6263
|
-
return /* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ jsx92(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
6264
6631
|
};
|
|
6265
6632
|
const extraProps = { autoComplete };
|
|
6266
|
-
return /* @__PURE__ */
|
|
6267
|
-
/* @__PURE__ */
|
|
6633
|
+
return /* @__PURE__ */ jsxs29(Fragment14, { children: [
|
|
6634
|
+
/* @__PURE__ */ jsx92(
|
|
6268
6635
|
FieldInput_default,
|
|
6269
6636
|
{
|
|
6270
6637
|
id,
|
|
@@ -6275,7 +6642,7 @@ function SelectInputRendererComponent(props) {
|
|
|
6275
6642
|
features,
|
|
6276
6643
|
control,
|
|
6277
6644
|
tags,
|
|
6278
|
-
children: /* @__PURE__ */
|
|
6645
|
+
children: /* @__PURE__ */ jsx92(
|
|
6279
6646
|
SelectInput2,
|
|
6280
6647
|
__spreadValues({
|
|
6281
6648
|
name: id,
|
|
@@ -6298,7 +6665,7 @@ function SelectInputRendererComponent(props) {
|
|
|
6298
6665
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
6299
6666
|
import { useEffect as useEffect13 } from "react";
|
|
6300
6667
|
import { SegmentedControl } from "@transferwise/components";
|
|
6301
|
-
import { Fragment as Fragment15, jsx as
|
|
6668
|
+
import { Fragment as Fragment15, jsx as jsx93, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6302
6669
|
function SegmentedInputRendererComponent(props) {
|
|
6303
6670
|
const {
|
|
6304
6671
|
id,
|
|
@@ -6319,8 +6686,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6319
6686
|
onSelect(0);
|
|
6320
6687
|
}
|
|
6321
6688
|
}, [selectedIndex, onSelect, options.length]);
|
|
6322
|
-
return /* @__PURE__ */
|
|
6323
|
-
/* @__PURE__ */
|
|
6689
|
+
return /* @__PURE__ */ jsxs30(Fragment15, { children: [
|
|
6690
|
+
/* @__PURE__ */ jsx93(
|
|
6324
6691
|
FieldInput_default,
|
|
6325
6692
|
{
|
|
6326
6693
|
id,
|
|
@@ -6331,7 +6698,7 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6331
6698
|
features,
|
|
6332
6699
|
control,
|
|
6333
6700
|
tags,
|
|
6334
|
-
children: /* @__PURE__ */
|
|
6701
|
+
children: /* @__PURE__ */ jsx93(
|
|
6335
6702
|
SegmentedControl,
|
|
6336
6703
|
{
|
|
6337
6704
|
name: `${id}-segmented-control`,
|
|
@@ -6348,14 +6715,14 @@ function SegmentedInputRendererComponent(props) {
|
|
|
6348
6715
|
)
|
|
6349
6716
|
}
|
|
6350
6717
|
),
|
|
6351
|
-
/* @__PURE__ */
|
|
6718
|
+
/* @__PURE__ */ jsx93("div", { id: `${id}-children`, children })
|
|
6352
6719
|
] });
|
|
6353
6720
|
}
|
|
6354
6721
|
var isValidIndex3 = (index, options) => index !== null && index >= 0 && index < options;
|
|
6355
6722
|
|
|
6356
6723
|
// ../renderers/src/SelectInputRenderer/RadioItemRendererComponent.tsx
|
|
6357
6724
|
import { Header as Header8, InlineAlert as InlineAlert4, List as List2, ListItem as ListItem12 } from "@transferwise/components";
|
|
6358
|
-
import { jsx as
|
|
6725
|
+
import { jsx as jsx94, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6359
6726
|
function RadioItemRendererComponent(props) {
|
|
6360
6727
|
const {
|
|
6361
6728
|
id,
|
|
@@ -6371,22 +6738,22 @@ function RadioItemRendererComponent(props) {
|
|
|
6371
6738
|
onSelect
|
|
6372
6739
|
} = props;
|
|
6373
6740
|
const { ref } = useScrollToError(validationState, features);
|
|
6374
|
-
return /* @__PURE__ */
|
|
6375
|
-
rootTitle && /* @__PURE__ */
|
|
6741
|
+
return /* @__PURE__ */ jsxs31("div", { ref, className: controlAndTagsToCSSClass(props), children: [
|
|
6742
|
+
rootTitle && /* @__PURE__ */ jsx94(
|
|
6376
6743
|
Header8,
|
|
6377
6744
|
{
|
|
6378
6745
|
as: "h2",
|
|
6379
|
-
title: help ? /* @__PURE__ */
|
|
6746
|
+
title: help ? /* @__PURE__ */ jsx94(LabelContentWithHelp, { text: rootTitle, help }) : rootTitle
|
|
6380
6747
|
}
|
|
6381
6748
|
),
|
|
6382
|
-
rootDescription && /* @__PURE__ */
|
|
6383
|
-
/* @__PURE__ */
|
|
6384
|
-
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */
|
|
6749
|
+
rootDescription && /* @__PURE__ */ jsx94("p", { children: rootDescription }),
|
|
6750
|
+
/* @__PURE__ */ jsx94(List2, { children: options.map(
|
|
6751
|
+
({ title, description, additionalText, inlineAlert, disabled, media, supportingValues }, index) => /* @__PURE__ */ jsx94(
|
|
6385
6752
|
ListItem12,
|
|
6386
6753
|
__spreadValues({
|
|
6387
6754
|
title,
|
|
6388
6755
|
subtitle: description,
|
|
6389
|
-
control: /* @__PURE__ */
|
|
6756
|
+
control: /* @__PURE__ */ jsx94(
|
|
6390
6757
|
ListItem12.Radio,
|
|
6391
6758
|
{
|
|
6392
6759
|
name: title,
|
|
@@ -6402,50 +6769,50 @@ function RadioItemRendererComponent(props) {
|
|
|
6402
6769
|
title
|
|
6403
6770
|
)
|
|
6404
6771
|
) }, `${id}-${selectedIndex}`),
|
|
6405
|
-
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */
|
|
6772
|
+
(validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx94(InlineAlert4, { type: "negative", children: validationState.message }),
|
|
6406
6773
|
children
|
|
6407
6774
|
] });
|
|
6408
6775
|
}
|
|
6409
6776
|
|
|
6410
6777
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
6411
|
-
import { jsx as
|
|
6778
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
6412
6779
|
var SelectInputRenderer = {
|
|
6413
6780
|
canRenderType: "input-select",
|
|
6414
6781
|
render: (props) => {
|
|
6415
6782
|
switch (props.control) {
|
|
6416
6783
|
case "radio":
|
|
6417
|
-
return /* @__PURE__ */
|
|
6784
|
+
return /* @__PURE__ */ jsx95(RadioInputRendererComponent, __spreadValues({}, props));
|
|
6418
6785
|
case "radio-item":
|
|
6419
|
-
return /* @__PURE__ */
|
|
6786
|
+
return /* @__PURE__ */ jsx95(RadioItemRendererComponent, __spreadValues({}, props));
|
|
6420
6787
|
case "tab":
|
|
6421
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
6788
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx95(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx95(TabInputRendererComponent, __spreadValues({}, props));
|
|
6422
6789
|
case "segmented":
|
|
6423
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
6790
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx95(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx95(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
6424
6791
|
case "select":
|
|
6425
6792
|
default:
|
|
6426
|
-
return /* @__PURE__ */
|
|
6793
|
+
return /* @__PURE__ */ jsx95(SelectInputRendererComponent, __spreadValues({}, props));
|
|
6427
6794
|
}
|
|
6428
6795
|
}
|
|
6429
6796
|
};
|
|
6430
6797
|
var SelectInputRenderer_default = SelectInputRenderer;
|
|
6431
6798
|
|
|
6432
6799
|
// ../renderers/src/StatusListRenderer.tsx
|
|
6433
|
-
var
|
|
6800
|
+
var import_classnames32 = __toESM(require_classnames());
|
|
6434
6801
|
import { AvatarView as AvatarView4, Header as Header9, ListItem as ListItem13 } from "@transferwise/components";
|
|
6435
|
-
import { jsx as
|
|
6802
|
+
import { jsx as jsx96, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6436
6803
|
var StatusListRenderer = {
|
|
6437
6804
|
canRenderType: "status-list",
|
|
6438
|
-
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */
|
|
6439
|
-
title ? /* @__PURE__ */
|
|
6805
|
+
render: ({ margin, items, title, control, tags }) => /* @__PURE__ */ jsxs32("div", { className: (0, import_classnames32.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
6806
|
+
title ? /* @__PURE__ */ jsx96(Header9, { title }) : null,
|
|
6440
6807
|
items.map((item) => {
|
|
6441
6808
|
const { callToAction, description, title: itemTitle } = item;
|
|
6442
|
-
return /* @__PURE__ */
|
|
6809
|
+
return /* @__PURE__ */ jsx96(
|
|
6443
6810
|
ListItem13,
|
|
6444
6811
|
{
|
|
6445
6812
|
title: itemTitle,
|
|
6446
6813
|
subtitle: description,
|
|
6447
|
-
media: /* @__PURE__ */
|
|
6448
|
-
additionalInfo: callToAction ? /* @__PURE__ */
|
|
6814
|
+
media: /* @__PURE__ */ jsx96(StatusListItemMedia, __spreadValues({}, item)),
|
|
6815
|
+
additionalInfo: callToAction ? /* @__PURE__ */ jsx96(
|
|
6449
6816
|
ListItem13.AdditionalInfo,
|
|
6450
6817
|
{
|
|
6451
6818
|
action: __spreadValues({
|
|
@@ -6464,10 +6831,10 @@ var StatusListItemMedia = ({ icon, status }) => {
|
|
|
6464
6831
|
return void 0;
|
|
6465
6832
|
}
|
|
6466
6833
|
if ("name" in icon) {
|
|
6467
|
-
return /* @__PURE__ */
|
|
6834
|
+
return /* @__PURE__ */ jsx96(AvatarView4, { badge: { status: mapStatus(status) }, children: /* @__PURE__ */ jsx96(DynamicIcon_default, { name: icon.name }) });
|
|
6468
6835
|
}
|
|
6469
6836
|
if ("text" in icon) {
|
|
6470
|
-
return /* @__PURE__ */
|
|
6837
|
+
return /* @__PURE__ */ jsx96(AvatarView4, { badge: { status: mapStatus(status) }, children: icon.text });
|
|
6471
6838
|
}
|
|
6472
6839
|
return void 0;
|
|
6473
6840
|
};
|
|
@@ -6484,7 +6851,7 @@ var mapStatus = (status) => {
|
|
|
6484
6851
|
var StatusListRenderer_default = StatusListRenderer;
|
|
6485
6852
|
|
|
6486
6853
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6487
|
-
var
|
|
6854
|
+
var import_classnames33 = __toESM(require_classnames());
|
|
6488
6855
|
|
|
6489
6856
|
// ../renderers/src/utils/useCustomTheme.ts
|
|
6490
6857
|
import { useTheme } from "@wise/components-theming";
|
|
@@ -6506,12 +6873,12 @@ var useCustomTheme = (theme, trackEvent) => {
|
|
|
6506
6873
|
|
|
6507
6874
|
// ../renderers/src/step/StepHeader.tsx
|
|
6508
6875
|
import { Title as Title2 } from "@transferwise/components";
|
|
6509
|
-
import { Fragment as Fragment16, jsx as
|
|
6876
|
+
import { Fragment as Fragment16, jsx as jsx97, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6510
6877
|
var StepHeader = ({ title, description, tags }) => {
|
|
6511
6878
|
const { titleType, alignmentClassName } = getHeaderStyle(tags);
|
|
6512
|
-
return /* @__PURE__ */
|
|
6513
|
-
title ? /* @__PURE__ */
|
|
6514
|
-
description ? /* @__PURE__ */
|
|
6879
|
+
return /* @__PURE__ */ jsxs33(Fragment16, { children: [
|
|
6880
|
+
title ? /* @__PURE__ */ jsx97(Title2, { as: "h1", type: titleType, className: `${alignmentClassName} m-b-2`, children: title }) : void 0,
|
|
6881
|
+
description ? /* @__PURE__ */ jsx97("p", { className: `${alignmentClassName} np-text-body-large`, children: description }) : void 0
|
|
6515
6882
|
] });
|
|
6516
6883
|
};
|
|
6517
6884
|
var getHeaderStyle = (tags) => {
|
|
@@ -6522,9 +6889,9 @@ var getHeaderStyle = (tags) => {
|
|
|
6522
6889
|
};
|
|
6523
6890
|
|
|
6524
6891
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6525
|
-
import { IconButton as
|
|
6892
|
+
import { IconButton as IconButton3 } from "@transferwise/components";
|
|
6526
6893
|
import { ArrowLeft } from "@transferwise/icons";
|
|
6527
|
-
import { useIntl as
|
|
6894
|
+
import { useIntl as useIntl22 } from "react-intl";
|
|
6528
6895
|
|
|
6529
6896
|
// ../renderers/src/messages/back.messages.ts
|
|
6530
6897
|
import { defineMessages as defineMessages14 } from "react-intl";
|
|
@@ -6537,31 +6904,31 @@ var back_messages_default = defineMessages14({
|
|
|
6537
6904
|
});
|
|
6538
6905
|
|
|
6539
6906
|
// ../renderers/src/step/topbar/BackButton.tsx
|
|
6540
|
-
import { jsx as
|
|
6907
|
+
import { jsx as jsx98, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6541
6908
|
function BackButton({ title, onClick }) {
|
|
6542
|
-
const { formatMessage } =
|
|
6543
|
-
return /* @__PURE__ */
|
|
6544
|
-
/* @__PURE__ */
|
|
6545
|
-
/* @__PURE__ */
|
|
6909
|
+
const { formatMessage } = useIntl22();
|
|
6910
|
+
return /* @__PURE__ */ jsxs34(IconButton3, { className: "df-back-button", priority: "tertiary", onClick, children: [
|
|
6911
|
+
/* @__PURE__ */ jsx98("span", { className: "sr-only", children: title != null ? title : formatMessage(back_messages_default.back) }),
|
|
6912
|
+
/* @__PURE__ */ jsx98(ArrowLeft, {})
|
|
6546
6913
|
] });
|
|
6547
6914
|
}
|
|
6548
6915
|
|
|
6549
6916
|
// ../renderers/src/step/topbar/Toolbar.tsx
|
|
6550
|
-
import { Button as
|
|
6551
|
-
import { jsx as
|
|
6917
|
+
import { Button as Button10, IconButton as IconButton4 } from "@transferwise/components";
|
|
6918
|
+
import { jsx as jsx99, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6552
6919
|
var Toolbar = ({ items }) => {
|
|
6553
|
-
return (items == null ? void 0 : items.length) > 0 ? /* @__PURE__ */
|
|
6920
|
+
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;
|
|
6554
6921
|
};
|
|
6555
6922
|
function ToolbarButton(props) {
|
|
6556
|
-
return prefersMedia(props.control) ? /* @__PURE__ */
|
|
6923
|
+
return prefersMedia(props.control) ? /* @__PURE__ */ jsx99(MediaToolbarButton, __spreadValues({}, props)) : /* @__PURE__ */ jsx99(TextToolbarButton, __spreadValues({}, props));
|
|
6557
6924
|
}
|
|
6558
6925
|
function MediaToolbarButton(props) {
|
|
6559
6926
|
var _a;
|
|
6560
6927
|
const { context, control, media, accessibilityDescription, disabled, onClick } = props;
|
|
6561
6928
|
const priority = getIconButtonPriority(control);
|
|
6562
6929
|
const type = getSentiment2(context);
|
|
6563
|
-
return /* @__PURE__ */
|
|
6564
|
-
|
|
6930
|
+
return /* @__PURE__ */ jsxs35(
|
|
6931
|
+
IconButton4,
|
|
6565
6932
|
{
|
|
6566
6933
|
className: "df-toolbar-button",
|
|
6567
6934
|
disabled,
|
|
@@ -6570,7 +6937,7 @@ function MediaToolbarButton(props) {
|
|
|
6570
6937
|
type,
|
|
6571
6938
|
onClick,
|
|
6572
6939
|
children: [
|
|
6573
|
-
accessibilityDescription ? /* @__PURE__ */
|
|
6940
|
+
accessibilityDescription ? /* @__PURE__ */ jsx99("span", { className: "sr-only", children: accessibilityDescription }) : null,
|
|
6574
6941
|
media ? (_a = getAddonStartMedia(media)) == null ? void 0 : _a.value : null
|
|
6575
6942
|
]
|
|
6576
6943
|
}
|
|
@@ -6581,8 +6948,8 @@ function TextToolbarButton(props) {
|
|
|
6581
6948
|
const addonStart = media ? getAddonStartMedia(media) : void 0;
|
|
6582
6949
|
const priority = getPriority2(control);
|
|
6583
6950
|
const sentiment = getSentiment2(context);
|
|
6584
|
-
return /* @__PURE__ */
|
|
6585
|
-
|
|
6951
|
+
return /* @__PURE__ */ jsx99(
|
|
6952
|
+
Button10,
|
|
6586
6953
|
{
|
|
6587
6954
|
v2: true,
|
|
6588
6955
|
size: "sm",
|
|
@@ -6611,18 +6978,18 @@ var getIconButtonPriority = (control) => {
|
|
|
6611
6978
|
};
|
|
6612
6979
|
|
|
6613
6980
|
// ../renderers/src/step/topbar/TopBar.tsx
|
|
6614
|
-
import { jsx as
|
|
6981
|
+
import { jsx as jsx100, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6615
6982
|
function TopBar({ back, toolbar, tags }) {
|
|
6616
6983
|
const isBackAllowed = !(tags == null ? void 0 : tags.includes("non-dismissible"));
|
|
6617
6984
|
const backCTA = isBackAllowed ? back : void 0;
|
|
6618
|
-
return backCTA || toolbar ? /* @__PURE__ */
|
|
6619
|
-
backCTA ? /* @__PURE__ */
|
|
6620
|
-
toolbar ? /* @__PURE__ */
|
|
6985
|
+
return backCTA || toolbar ? /* @__PURE__ */ jsxs36("div", { className: "d-flex m-b-2", children: [
|
|
6986
|
+
backCTA ? /* @__PURE__ */ jsx100(BackButton, __spreadValues({}, backCTA)) : null,
|
|
6987
|
+
toolbar ? /* @__PURE__ */ jsx100(Toolbar, __spreadValues({}, toolbar)) : null
|
|
6621
6988
|
] }) : null;
|
|
6622
6989
|
}
|
|
6623
6990
|
|
|
6624
6991
|
// ../renderers/src/step/SplashCelebrationStepRenderer.tsx
|
|
6625
|
-
import { jsx as
|
|
6992
|
+
import { jsx as jsx101, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6626
6993
|
var SplashCelebrationStepRenderer = {
|
|
6627
6994
|
canRenderType: "step",
|
|
6628
6995
|
canRender: ({ control }) => control === "splash-celebration",
|
|
@@ -6631,23 +6998,23 @@ var SplashCelebrationStepRenderer = {
|
|
|
6631
6998
|
function SplashCelebrationStepRendererComponent(props) {
|
|
6632
6999
|
const { back, title, description, toolbar, children, footer, control, tags, trackEvent } = props;
|
|
6633
7000
|
useCustomTheme("forest-green", trackEvent);
|
|
6634
|
-
return /* @__PURE__ */
|
|
7001
|
+
return /* @__PURE__ */ jsxs37(
|
|
6635
7002
|
"div",
|
|
6636
7003
|
{
|
|
6637
|
-
className: (0,
|
|
7004
|
+
className: (0, import_classnames33.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6638
7005
|
children: [
|
|
6639
|
-
/* @__PURE__ */
|
|
6640
|
-
title || description ? /* @__PURE__ */
|
|
7006
|
+
/* @__PURE__ */ jsx101(TopBar, { back, toolbar, tags }),
|
|
7007
|
+
title || description ? /* @__PURE__ */ jsx101("div", { className: "m-b-4", children: /* @__PURE__ */ jsx101(StepHeader, { title, description, tags }) }) : void 0,
|
|
6641
7008
|
children,
|
|
6642
|
-
/* @__PURE__ */
|
|
7009
|
+
/* @__PURE__ */ jsx101(StepFooter, { footer, tags })
|
|
6643
7010
|
]
|
|
6644
7011
|
}
|
|
6645
7012
|
);
|
|
6646
7013
|
}
|
|
6647
7014
|
|
|
6648
7015
|
// ../renderers/src/step/SplashStepRenderer.tsx
|
|
6649
|
-
var
|
|
6650
|
-
import { jsx as
|
|
7016
|
+
var import_classnames34 = __toESM(require_classnames());
|
|
7017
|
+
import { jsx as jsx102, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6651
7018
|
var SplashStepRenderer = {
|
|
6652
7019
|
canRenderType: "step",
|
|
6653
7020
|
canRender: ({ control }) => control === "splash",
|
|
@@ -6655,15 +7022,15 @@ var SplashStepRenderer = {
|
|
|
6655
7022
|
};
|
|
6656
7023
|
function SplashStepRendererComponent(props) {
|
|
6657
7024
|
const { back, title, description, toolbar, children, footer, control, tags } = props;
|
|
6658
|
-
return /* @__PURE__ */
|
|
7025
|
+
return /* @__PURE__ */ jsxs38(
|
|
6659
7026
|
"div",
|
|
6660
7027
|
{
|
|
6661
|
-
className: (0,
|
|
7028
|
+
className: (0, import_classnames34.default)("splash-screen", "m-t-5", controlAndTagsToCSSClass({ control, tags })),
|
|
6662
7029
|
children: [
|
|
6663
|
-
/* @__PURE__ */
|
|
6664
|
-
title || description ? /* @__PURE__ */
|
|
7030
|
+
/* @__PURE__ */ jsx102(TopBar, { back, toolbar, tags }),
|
|
7031
|
+
title || description ? /* @__PURE__ */ jsx102("div", { className: "m-b-4", children: /* @__PURE__ */ jsx102(StepHeader, { title, description, tags }) }) : void 0,
|
|
6665
7032
|
children,
|
|
6666
|
-
/* @__PURE__ */
|
|
7033
|
+
/* @__PURE__ */ jsx102(StepFooter, { footer, tags })
|
|
6667
7034
|
]
|
|
6668
7035
|
}
|
|
6669
7036
|
);
|
|
@@ -6671,46 +7038,46 @@ function SplashStepRendererComponent(props) {
|
|
|
6671
7038
|
|
|
6672
7039
|
// ../renderers/src/step/StepRenderer.tsx
|
|
6673
7040
|
import { Alert } from "@transferwise/components";
|
|
6674
|
-
import { jsx as
|
|
7041
|
+
import { jsx as jsx103, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6675
7042
|
var StepRenderer = {
|
|
6676
7043
|
canRenderType: "step",
|
|
6677
7044
|
render: StepRendererComponent
|
|
6678
7045
|
};
|
|
6679
7046
|
function StepRendererComponent(props) {
|
|
6680
7047
|
const { back, description, error, title, children, toolbar, footer, control, tags } = props;
|
|
6681
|
-
return /* @__PURE__ */
|
|
6682
|
-
/* @__PURE__ */
|
|
6683
|
-
title || description ? /* @__PURE__ */
|
|
6684
|
-
error ? /* @__PURE__ */
|
|
7048
|
+
return /* @__PURE__ */ jsxs39("div", { className: controlAndTagsToCSSClass({ control, tags }), children: [
|
|
7049
|
+
/* @__PURE__ */ jsx103(TopBar, { back, toolbar, tags }),
|
|
7050
|
+
title || description ? /* @__PURE__ */ jsx103("div", { className: "m-b-4", children: /* @__PURE__ */ jsx103(StepHeader, { title, description, tags }) }) : void 0,
|
|
7051
|
+
error ? /* @__PURE__ */ jsx103(Alert, { type: "negative", className: "m-b-2", message: error }) : null,
|
|
6685
7052
|
children,
|
|
6686
|
-
/* @__PURE__ */
|
|
7053
|
+
/* @__PURE__ */ jsx103(StepFooter, { footer, tags })
|
|
6687
7054
|
] });
|
|
6688
7055
|
}
|
|
6689
7056
|
|
|
6690
7057
|
// ../renderers/src/TabsRenderer.tsx
|
|
6691
|
-
var
|
|
6692
|
-
import { Chips as
|
|
6693
|
-
import { useState as
|
|
6694
|
-
import { jsx as
|
|
7058
|
+
var import_classnames35 = __toESM(require_classnames());
|
|
7059
|
+
import { Chips as Chips3, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
7060
|
+
import { useState as useState20 } from "react";
|
|
7061
|
+
import { jsx as jsx104, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6695
7062
|
var TabsRenderer = {
|
|
6696
7063
|
canRenderType: "tabs",
|
|
6697
7064
|
render: (props) => {
|
|
6698
7065
|
switch (props.control) {
|
|
6699
7066
|
case "segmented":
|
|
6700
7067
|
if (props.tabs.length > 3) {
|
|
6701
|
-
return /* @__PURE__ */
|
|
7068
|
+
return /* @__PURE__ */ jsx104(TabsRendererComponent, __spreadValues({}, props));
|
|
6702
7069
|
}
|
|
6703
|
-
return /* @__PURE__ */
|
|
7070
|
+
return /* @__PURE__ */ jsx104(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
6704
7071
|
case "chips":
|
|
6705
|
-
return /* @__PURE__ */
|
|
7072
|
+
return /* @__PURE__ */ jsx104(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
6706
7073
|
default:
|
|
6707
|
-
return /* @__PURE__ */
|
|
7074
|
+
return /* @__PURE__ */ jsx104(TabsRendererComponent, __spreadValues({}, props));
|
|
6708
7075
|
}
|
|
6709
7076
|
}
|
|
6710
7077
|
};
|
|
6711
7078
|
function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6712
|
-
const [selectedIndex, setSelectedIndex] =
|
|
6713
|
-
return /* @__PURE__ */
|
|
7079
|
+
const [selectedIndex, setSelectedIndex] = useState20(0);
|
|
7080
|
+
return /* @__PURE__ */ jsx104("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: /* @__PURE__ */ jsx104(
|
|
6714
7081
|
Tabs2,
|
|
6715
7082
|
{
|
|
6716
7083
|
name: uid,
|
|
@@ -6718,7 +7085,7 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6718
7085
|
tabs: tabs.map((option) => ({
|
|
6719
7086
|
title: option.title,
|
|
6720
7087
|
disabled: false,
|
|
6721
|
-
content: /* @__PURE__ */
|
|
7088
|
+
content: /* @__PURE__ */ jsxs40("div", { className: "m-t-2", children: [
|
|
6722
7089
|
" ",
|
|
6723
7090
|
option.children,
|
|
6724
7091
|
" "
|
|
@@ -6730,9 +7097,9 @@ function TabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6730
7097
|
}
|
|
6731
7098
|
function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
6732
7099
|
var _a;
|
|
6733
|
-
const [selectedIndex, setSelectedIndex] =
|
|
6734
|
-
return /* @__PURE__ */
|
|
6735
|
-
/* @__PURE__ */
|
|
7100
|
+
const [selectedIndex, setSelectedIndex] = useState20(0);
|
|
7101
|
+
return /* @__PURE__ */ jsxs40("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
7102
|
+
/* @__PURE__ */ jsx104(
|
|
6736
7103
|
SegmentedControl2,
|
|
6737
7104
|
{
|
|
6738
7105
|
name: uid,
|
|
@@ -6747,37 +7114,130 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs, control, tags }) {
|
|
|
6747
7114
|
onChange: (value) => setSelectedIndex(Number(value))
|
|
6748
7115
|
}
|
|
6749
7116
|
),
|
|
6750
|
-
/* @__PURE__ */
|
|
7117
|
+
/* @__PURE__ */ jsx104("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6751
7118
|
] });
|
|
6752
7119
|
}
|
|
6753
7120
|
function ChipsTabsRendererComponent({ margin, tabs, control, tags }) {
|
|
6754
7121
|
var _a;
|
|
6755
|
-
const [selectedIndex, setSelectedIndex] =
|
|
6756
|
-
return /* @__PURE__ */
|
|
6757
|
-
/* @__PURE__ */
|
|
6758
|
-
|
|
7122
|
+
const [selectedIndex, setSelectedIndex] = useState20(0);
|
|
7123
|
+
return /* @__PURE__ */ jsxs40("div", { className: (0, import_classnames35.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children: [
|
|
7124
|
+
/* @__PURE__ */ jsx104("div", { className: "chips-container", children: /* @__PURE__ */ jsx104(
|
|
7125
|
+
Chips3,
|
|
6759
7126
|
{
|
|
6760
7127
|
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
6761
7128
|
selected: selectedIndex,
|
|
6762
7129
|
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
6763
7130
|
}
|
|
6764
7131
|
) }),
|
|
6765
|
-
/* @__PURE__ */
|
|
7132
|
+
/* @__PURE__ */ jsx104("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
6766
7133
|
] });
|
|
6767
7134
|
}
|
|
6768
7135
|
|
|
6769
7136
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6770
|
-
import { InputGroup as
|
|
7137
|
+
import { InputGroup as InputGroup6 } from "@transferwise/components";
|
|
7138
|
+
import { useState as useState22 } from "react";
|
|
6771
7139
|
|
|
6772
7140
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
6773
7141
|
import {
|
|
6774
|
-
|
|
7142
|
+
IconButton as IconButton5,
|
|
7143
|
+
Input as Input7,
|
|
6775
7144
|
InputWithDisplayFormat,
|
|
6776
7145
|
PhoneNumberInput,
|
|
6777
7146
|
TextArea,
|
|
6778
7147
|
TextareaWithDisplayFormat
|
|
6779
7148
|
} from "@transferwise/components";
|
|
6780
|
-
import {
|
|
7149
|
+
import { Eye, EyeShut } from "@transferwise/icons";
|
|
7150
|
+
import { useIntl as useIntl23 } from "react-intl";
|
|
7151
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef6, useState as useState21 } from "react";
|
|
7152
|
+
|
|
7153
|
+
// ../renderers/src/messages/ssn-input.messages.ts
|
|
7154
|
+
import { defineMessages as defineMessages15 } from "react-intl";
|
|
7155
|
+
var ssn_input_messages_default = defineMessages15({
|
|
7156
|
+
showValue: {
|
|
7157
|
+
id: "df.wise.ssnInput.showValue",
|
|
7158
|
+
defaultMessage: "Show value",
|
|
7159
|
+
description: "Accessible label for showing a masked SSN or SIN value"
|
|
7160
|
+
},
|
|
7161
|
+
hideValue: {
|
|
7162
|
+
id: "df.wise.ssnInput.hideValue",
|
|
7163
|
+
defaultMessage: "Hide value",
|
|
7164
|
+
description: "Accessible label for hiding an SSN or SIN value"
|
|
7165
|
+
}
|
|
7166
|
+
});
|
|
7167
|
+
|
|
7168
|
+
// ../renderers/src/components/ssnInputUtils.ts
|
|
7169
|
+
function formatSsnValue(rawValue, displayFormat, isVisible) {
|
|
7170
|
+
if (!displayFormat) {
|
|
7171
|
+
return isVisible ? rawValue : "\u2022".repeat(rawValue.length);
|
|
7172
|
+
}
|
|
7173
|
+
const formattedValue = displayFormat.split("").reduce(
|
|
7174
|
+
({ display, digitsUsed }, character) => {
|
|
7175
|
+
if (character === "*") {
|
|
7176
|
+
return digitsUsed < rawValue.length ? {
|
|
7177
|
+
display: `${display}${isVisible ? rawValue[digitsUsed] : "\u2022"}`,
|
|
7178
|
+
digitsUsed: digitsUsed + 1
|
|
7179
|
+
} : { display, digitsUsed };
|
|
7180
|
+
}
|
|
7181
|
+
return digitsUsed > 0 && digitsUsed < rawValue.length ? { display: `${display}${character}`, digitsUsed } : { display, digitsUsed };
|
|
7182
|
+
},
|
|
7183
|
+
{ display: "", digitsUsed: 0 }
|
|
7184
|
+
).display;
|
|
7185
|
+
const displayFormatDigitCount = displayFormat.split("").filter((character) => character === "*").length;
|
|
7186
|
+
const extraValue = rawValue.slice(displayFormatDigitCount);
|
|
7187
|
+
return `${formattedValue}${isVisible ? extraValue : "\u2022".repeat(extraValue.length)}`;
|
|
7188
|
+
}
|
|
7189
|
+
function getRawOffset(displayValue, displayOffset, rawValueLength) {
|
|
7190
|
+
return Math.min(
|
|
7191
|
+
displayValue.slice(0, displayOffset).split("").filter((character) => character === "\u2022" || /\d/.test(character)).length,
|
|
7192
|
+
rawValueLength
|
|
7193
|
+
);
|
|
7194
|
+
}
|
|
7195
|
+
function replaceSsnSelection(rawValue, displayValue, insertedValue, start, end) {
|
|
7196
|
+
const startOffset = getRawOffset(displayValue, start, rawValue.length);
|
|
7197
|
+
const endOffset = getRawOffset(displayValue, end, rawValue.length);
|
|
7198
|
+
if (!insertedValue) {
|
|
7199
|
+
return void 0;
|
|
7200
|
+
}
|
|
7201
|
+
return {
|
|
7202
|
+
value: `${rawValue.slice(0, startOffset)}${insertedValue}${rawValue.slice(endOffset)}`,
|
|
7203
|
+
caret: startOffset + insertedValue.length
|
|
7204
|
+
};
|
|
7205
|
+
}
|
|
7206
|
+
function deleteSsnSelection(rawValue, displayValue, start, end, backward) {
|
|
7207
|
+
let startOffset = getRawOffset(displayValue, start, rawValue.length);
|
|
7208
|
+
let endOffset = getRawOffset(displayValue, end, rawValue.length);
|
|
7209
|
+
if (startOffset === endOffset) {
|
|
7210
|
+
if (backward) {
|
|
7211
|
+
startOffset = Math.max(0, startOffset - 1);
|
|
7212
|
+
} else {
|
|
7213
|
+
endOffset = Math.min(rawValue.length, endOffset + 1);
|
|
7214
|
+
}
|
|
7215
|
+
}
|
|
7216
|
+
return {
|
|
7217
|
+
value: `${rawValue.slice(0, startOffset)}${rawValue.slice(endOffset)}`,
|
|
7218
|
+
caret: startOffset
|
|
7219
|
+
};
|
|
7220
|
+
}
|
|
7221
|
+
function getDisplayOffset(displayValue, rawOffset) {
|
|
7222
|
+
if (rawOffset === 0) {
|
|
7223
|
+
return 0;
|
|
7224
|
+
}
|
|
7225
|
+
let displayOffset = 0;
|
|
7226
|
+
let digitsSeen = 0;
|
|
7227
|
+
for (const character of displayValue) {
|
|
7228
|
+
if (character === "\u2022" || /\d/.test(character)) {
|
|
7229
|
+
digitsSeen += 1;
|
|
7230
|
+
if (digitsSeen === rawOffset) {
|
|
7231
|
+
return displayOffset + 1;
|
|
7232
|
+
}
|
|
7233
|
+
}
|
|
7234
|
+
displayOffset += 1;
|
|
7235
|
+
}
|
|
7236
|
+
return displayOffset;
|
|
7237
|
+
}
|
|
7238
|
+
|
|
7239
|
+
// ../renderers/src/components/VariableTextInput.tsx
|
|
7240
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
6781
7241
|
var commonKeys = [
|
|
6782
7242
|
"autoComplete",
|
|
6783
7243
|
"autoCapitalize",
|
|
@@ -6792,16 +7252,18 @@ var commonKeys = [
|
|
|
6792
7252
|
"value"
|
|
6793
7253
|
];
|
|
6794
7254
|
function VariableTextInput(inputProps) {
|
|
6795
|
-
const { id, value, control, onChange } = inputProps;
|
|
7255
|
+
const { id, value, control, onChange, isSsnVisible } = inputProps;
|
|
6796
7256
|
const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
|
|
6797
7257
|
switch (control) {
|
|
6798
7258
|
case "email":
|
|
6799
|
-
return /* @__PURE__ */
|
|
7259
|
+
return /* @__PURE__ */ jsx105(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
|
|
6800
7260
|
case "password":
|
|
6801
|
-
return /* @__PURE__ */
|
|
7261
|
+
return /* @__PURE__ */ jsx105(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
|
|
7262
|
+
case "ssn-input":
|
|
7263
|
+
return /* @__PURE__ */ jsx105(SsnInput, __spreadProps(__spreadValues({}, commonProps), { isVisible: isSsnVisible, onChange }));
|
|
6802
7264
|
case "numeric": {
|
|
6803
7265
|
const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
|
|
6804
|
-
return /* @__PURE__ */
|
|
7266
|
+
return /* @__PURE__ */ jsx105(
|
|
6805
7267
|
TextInput,
|
|
6806
7268
|
__spreadProps(__spreadValues({}, numericProps), {
|
|
6807
7269
|
onChange: (newValue) => {
|
|
@@ -6812,80 +7274,213 @@ function VariableTextInput(inputProps) {
|
|
|
6812
7274
|
);
|
|
6813
7275
|
}
|
|
6814
7276
|
case "phone-number":
|
|
6815
|
-
return /* @__PURE__ */
|
|
7277
|
+
return /* @__PURE__ */ jsx105(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
|
|
6816
7278
|
default: {
|
|
6817
|
-
return /* @__PURE__ */
|
|
7279
|
+
return /* @__PURE__ */ jsx105(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
|
|
6818
7280
|
}
|
|
6819
7281
|
}
|
|
6820
7282
|
}
|
|
7283
|
+
function SsnInputToggle({
|
|
7284
|
+
isVisible,
|
|
7285
|
+
onClick
|
|
7286
|
+
}) {
|
|
7287
|
+
const { formatMessage } = useIntl23();
|
|
7288
|
+
return /* @__PURE__ */ jsx105(
|
|
7289
|
+
IconButton5,
|
|
7290
|
+
{
|
|
7291
|
+
priority: "minimal",
|
|
7292
|
+
size: 24,
|
|
7293
|
+
"aria-label": formatMessage(isVisible ? ssn_input_messages_default.hideValue : ssn_input_messages_default.showValue),
|
|
7294
|
+
"aria-pressed": isVisible,
|
|
7295
|
+
onClick,
|
|
7296
|
+
children: isVisible ? /* @__PURE__ */ jsx105(EyeShut, { size: 24 }) : /* @__PURE__ */ jsx105(Eye, { size: 24 })
|
|
7297
|
+
}
|
|
7298
|
+
);
|
|
7299
|
+
}
|
|
6821
7300
|
function TextInput(props) {
|
|
6822
|
-
const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
|
|
7301
|
+
const _a = props, { control, displayFormat, onChange, type } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange", "type"]);
|
|
6823
7302
|
const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
|
|
6824
|
-
const InputWithoutPattern = control === "textarea" ? TextArea :
|
|
6825
|
-
return displayFormat ? /* @__PURE__ */
|
|
7303
|
+
const InputWithoutPattern = control === "textarea" ? TextArea : Input7;
|
|
7304
|
+
return displayFormat ? /* @__PURE__ */ jsx105(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx105(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { type, onChange: (e) => onChange(e.target.value) }));
|
|
7305
|
+
}
|
|
7306
|
+
function SsnInput(props) {
|
|
7307
|
+
const _a = props, { displayFormat = "", isVisible = false, onChange, value = "" } = _a, commonProps = __objRest(_a, ["displayFormat", "isVisible", "onChange", "value"]);
|
|
7308
|
+
const [editVersion, setEditVersion] = useState21(0);
|
|
7309
|
+
const inputRef = useRef6(null);
|
|
7310
|
+
const selection = useRef6({ start: 0, end: 0 });
|
|
7311
|
+
const pendingCaret = useRef6(null);
|
|
7312
|
+
const rawValue = value.replace(/\D/g, "");
|
|
7313
|
+
const formattedValue = formatSsnValue(rawValue, displayFormat, isVisible);
|
|
7314
|
+
const scheduleCaret = (rawOffset) => {
|
|
7315
|
+
pendingCaret.current = rawOffset;
|
|
7316
|
+
setEditVersion((version) => version + 1);
|
|
7317
|
+
};
|
|
7318
|
+
const replaceSelection = (insertedValue, start, end) => {
|
|
7319
|
+
const result = replaceSsnSelection(rawValue, formattedValue, insertedValue, start, end);
|
|
7320
|
+
if (!result) {
|
|
7321
|
+
return;
|
|
7322
|
+
}
|
|
7323
|
+
scheduleCaret(result.caret);
|
|
7324
|
+
onChange(result.value);
|
|
7325
|
+
};
|
|
7326
|
+
const deleteSelection = (start, end, backward) => {
|
|
7327
|
+
const result = deleteSsnSelection(rawValue, formattedValue, start, end, backward);
|
|
7328
|
+
scheduleCaret(result.caret);
|
|
7329
|
+
onChange(result.value);
|
|
7330
|
+
};
|
|
7331
|
+
useLayoutEffect3(() => {
|
|
7332
|
+
if (pendingCaret.current === null || !inputRef.current) {
|
|
7333
|
+
return;
|
|
7334
|
+
}
|
|
7335
|
+
inputRef.current.setSelectionRange(
|
|
7336
|
+
getDisplayOffset(formattedValue, pendingCaret.current),
|
|
7337
|
+
getDisplayOffset(formattedValue, pendingCaret.current)
|
|
7338
|
+
);
|
|
7339
|
+
pendingCaret.current = null;
|
|
7340
|
+
}, [editVersion, formattedValue, rawValue]);
|
|
7341
|
+
return /* @__PURE__ */ jsx105(
|
|
7342
|
+
"input",
|
|
7343
|
+
__spreadProps(__spreadValues({
|
|
7344
|
+
ref: inputRef
|
|
7345
|
+
}, commonProps), {
|
|
7346
|
+
className: "form-control np-form-control np-input np-input--shape-rectangle",
|
|
7347
|
+
type: "text",
|
|
7348
|
+
inputMode: "numeric",
|
|
7349
|
+
value: formattedValue,
|
|
7350
|
+
onChange: (event) => {
|
|
7351
|
+
const nextValue = event.currentTarget.value;
|
|
7352
|
+
const inputType = event.nativeEvent.inputType;
|
|
7353
|
+
const start = selection.current.start;
|
|
7354
|
+
const end = selection.current.end;
|
|
7355
|
+
if (isVisible || /^\d+$/.test(nextValue)) {
|
|
7356
|
+
const nextRawValue = nextValue.replace(/\D/g, "");
|
|
7357
|
+
scheduleCaret(nextRawValue.length);
|
|
7358
|
+
onChange(nextRawValue);
|
|
7359
|
+
} else if ((inputType == null ? void 0 : inputType.startsWith("delete")) || nextValue.length < formattedValue.length) {
|
|
7360
|
+
deleteSelection(start, end, inputType === "deleteContentBackward");
|
|
7361
|
+
} else {
|
|
7362
|
+
replaceSelection(nextValue.replace(/\D/g, ""), start, end);
|
|
7363
|
+
}
|
|
7364
|
+
},
|
|
7365
|
+
onSelect: (event) => {
|
|
7366
|
+
var _a2, _b;
|
|
7367
|
+
selection.current = {
|
|
7368
|
+
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7369
|
+
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7370
|
+
};
|
|
7371
|
+
},
|
|
7372
|
+
onKeyDown: (event) => {
|
|
7373
|
+
var _a2, _b;
|
|
7374
|
+
selection.current = {
|
|
7375
|
+
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7376
|
+
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7377
|
+
};
|
|
7378
|
+
if (/^\d$/.test(event.key)) {
|
|
7379
|
+
event.preventDefault();
|
|
7380
|
+
replaceSelection(event.key, selection.current.start, selection.current.end);
|
|
7381
|
+
} else if (event.key === "Backspace") {
|
|
7382
|
+
event.preventDefault();
|
|
7383
|
+
deleteSelection(selection.current.start, selection.current.end, true);
|
|
7384
|
+
} else if (event.key === "Delete") {
|
|
7385
|
+
event.preventDefault();
|
|
7386
|
+
deleteSelection(selection.current.start, selection.current.end, false);
|
|
7387
|
+
}
|
|
7388
|
+
},
|
|
7389
|
+
onPaste: (event) => {
|
|
7390
|
+
var _a2, _b;
|
|
7391
|
+
event.preventDefault();
|
|
7392
|
+
selection.current = {
|
|
7393
|
+
start: (_a2 = event.currentTarget.selectionStart) != null ? _a2 : 0,
|
|
7394
|
+
end: (_b = event.currentTarget.selectionEnd) != null ? _b : 0
|
|
7395
|
+
};
|
|
7396
|
+
const pastedValue = event.clipboardData.getData("text").replace(/\D/g, "");
|
|
7397
|
+
replaceSelection(pastedValue, selection.current.start, selection.current.end);
|
|
7398
|
+
}
|
|
7399
|
+
})
|
|
7400
|
+
);
|
|
6826
7401
|
}
|
|
6827
7402
|
|
|
6828
7403
|
// ../renderers/src/TextInputRenderer.tsx
|
|
6829
|
-
import { jsx as
|
|
7404
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
6830
7405
|
var TextInputRenderer = {
|
|
6831
7406
|
canRenderType: "input-text",
|
|
6832
|
-
render: (props) => {
|
|
6833
|
-
|
|
7407
|
+
render: (props) => /* @__PURE__ */ jsx106(TextInputRendererComponent, __spreadValues({}, props))
|
|
7408
|
+
};
|
|
7409
|
+
function TextInputRendererComponent(props) {
|
|
7410
|
+
const [isSsnVisible, setIsSsnVisible] = useState22(false);
|
|
7411
|
+
const _a = props, {
|
|
7412
|
+
id,
|
|
7413
|
+
title,
|
|
7414
|
+
description,
|
|
7415
|
+
help,
|
|
7416
|
+
media,
|
|
7417
|
+
validationState,
|
|
7418
|
+
value: initialValue,
|
|
7419
|
+
onChange
|
|
7420
|
+
} = _a, rest = __objRest(_a, [
|
|
7421
|
+
"id",
|
|
7422
|
+
"title",
|
|
7423
|
+
"description",
|
|
7424
|
+
"help",
|
|
7425
|
+
"media",
|
|
7426
|
+
"validationState",
|
|
7427
|
+
"value",
|
|
7428
|
+
"onChange"
|
|
7429
|
+
]);
|
|
7430
|
+
const value = initialValue != null ? initialValue : "";
|
|
7431
|
+
const isSsnInput = props.control === "ssn-input";
|
|
7432
|
+
const inputProps = __spreadProps(__spreadValues({}, rest), {
|
|
7433
|
+
value,
|
|
7434
|
+
id,
|
|
7435
|
+
isSsnVisible,
|
|
7436
|
+
onChange: (newValue) => {
|
|
7437
|
+
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
7438
|
+
onChange(newValue);
|
|
7439
|
+
}
|
|
7440
|
+
}
|
|
7441
|
+
});
|
|
7442
|
+
return /* @__PURE__ */ jsx106(
|
|
7443
|
+
FieldInput_default,
|
|
7444
|
+
{
|
|
6834
7445
|
id,
|
|
6835
|
-
title,
|
|
7446
|
+
label: title,
|
|
6836
7447
|
description,
|
|
7448
|
+
validation: validationState,
|
|
7449
|
+
inlineAlert: props.inlineAlert,
|
|
7450
|
+
loadingState: props.fieldLoadingState,
|
|
6837
7451
|
help,
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
onChange: (newValue) => {
|
|
6857
|
-
if ((value != null ? value : "") !== (newValue != null ? newValue : "")) {
|
|
6858
|
-
onChange(newValue);
|
|
7452
|
+
features: props.features,
|
|
7453
|
+
control: props.control,
|
|
7454
|
+
tags: props.tags,
|
|
7455
|
+
children: /* @__PURE__ */ jsx106(
|
|
7456
|
+
InputGroup6,
|
|
7457
|
+
{
|
|
7458
|
+
addonStart: getInputGroupAddonStart(media),
|
|
7459
|
+
addonEnd: isSsnInput ? {
|
|
7460
|
+
interactive: true,
|
|
7461
|
+
content: /* @__PURE__ */ jsx106(
|
|
7462
|
+
SsnInputToggle,
|
|
7463
|
+
{
|
|
7464
|
+
isVisible: isSsnVisible,
|
|
7465
|
+
onClick: () => setIsSsnVisible((visible) => !visible)
|
|
7466
|
+
}
|
|
7467
|
+
)
|
|
7468
|
+
} : void 0,
|
|
7469
|
+
children: /* @__PURE__ */ jsx106(VariableTextInput, __spreadValues({}, inputProps))
|
|
6859
7470
|
}
|
|
6860
|
-
|
|
6861
|
-
}
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
{
|
|
6865
|
-
id,
|
|
6866
|
-
label: title,
|
|
6867
|
-
description,
|
|
6868
|
-
validation: validationState,
|
|
6869
|
-
inlineAlert: props.inlineAlert,
|
|
6870
|
-
loadingState: props.fieldLoadingState,
|
|
6871
|
-
help,
|
|
6872
|
-
features: props.features,
|
|
6873
|
-
control: props.control,
|
|
6874
|
-
tags: props.tags,
|
|
6875
|
-
children: /* @__PURE__ */ jsx101(InputGroup5, { addonStart: getInputGroupAddonStart(media), children: /* @__PURE__ */ jsx101(VariableTextInput, __spreadValues({}, inputProps)) })
|
|
6876
|
-
}
|
|
6877
|
-
);
|
|
6878
|
-
}
|
|
6879
|
-
};
|
|
7471
|
+
)
|
|
7472
|
+
}
|
|
7473
|
+
);
|
|
7474
|
+
}
|
|
6880
7475
|
var TextInputRenderer_default = TextInputRenderer;
|
|
6881
7476
|
|
|
6882
7477
|
// ../renderers/src/UpdatableRenderer.tsx
|
|
6883
|
-
var
|
|
6884
|
-
import { jsx as
|
|
7478
|
+
var import_classnames36 = __toESM(require_classnames());
|
|
7479
|
+
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
6885
7480
|
var UpdatableRenderer = {
|
|
6886
7481
|
canRenderType: "updatable",
|
|
6887
7482
|
render: ({ children, control, margin, tags }) => {
|
|
6888
|
-
return /* @__PURE__ */
|
|
7483
|
+
return /* @__PURE__ */ jsx107("div", { className: (0, import_classnames36.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })), children });
|
|
6889
7484
|
}
|
|
6890
7485
|
};
|
|
6891
7486
|
|
|
@@ -6896,7 +7491,7 @@ import { Status as Status2, Upload, UploadInput as UploadInput2 } from "@transfe
|
|
|
6896
7491
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
6897
7492
|
|
|
6898
7493
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
6899
|
-
import { jsx as
|
|
7494
|
+
import { jsx as jsx108 } from "react/jsx-runtime";
|
|
6900
7495
|
var UploadInputRenderer = {
|
|
6901
7496
|
canRenderType: "input-upload",
|
|
6902
7497
|
render: (props) => {
|
|
@@ -6925,7 +7520,7 @@ var UploadInputRenderer = {
|
|
|
6925
7520
|
};
|
|
6926
7521
|
return (
|
|
6927
7522
|
// We don't pass help here as there is no sensible place to display it
|
|
6928
|
-
/* @__PURE__ */
|
|
7523
|
+
/* @__PURE__ */ jsx108(
|
|
6929
7524
|
UploadFieldInput_default,
|
|
6930
7525
|
{
|
|
6931
7526
|
id,
|
|
@@ -6935,7 +7530,7 @@ var UploadInputRenderer = {
|
|
|
6935
7530
|
features,
|
|
6936
7531
|
control,
|
|
6937
7532
|
tags,
|
|
6938
|
-
children: /* @__PURE__ */
|
|
7533
|
+
children: /* @__PURE__ */ jsx108(
|
|
6939
7534
|
UploadInput2,
|
|
6940
7535
|
{
|
|
6941
7536
|
id,
|
|
@@ -7005,7 +7600,7 @@ var LargeUploadRenderer = {
|
|
|
7005
7600
|
};
|
|
7006
7601
|
const filetypes = acceptsToFileTypes(accepts);
|
|
7007
7602
|
const usAccept = filetypes === "*" ? "*" : filetypes.join(",");
|
|
7008
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ jsx108(
|
|
7009
7604
|
FieldInput_default,
|
|
7010
7605
|
{
|
|
7011
7606
|
id,
|
|
@@ -7016,7 +7611,7 @@ var LargeUploadRenderer = {
|
|
|
7016
7611
|
features,
|
|
7017
7612
|
control,
|
|
7018
7613
|
tags,
|
|
7019
|
-
children: /* @__PURE__ */
|
|
7614
|
+
children: /* @__PURE__ */ jsx108(
|
|
7020
7615
|
Upload,
|
|
7021
7616
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
7022
7617
|
usAccept,
|
|
@@ -7032,21 +7627,21 @@ var LargeUploadRenderer = {
|
|
|
7032
7627
|
};
|
|
7033
7628
|
|
|
7034
7629
|
// ../renderers/src/UpsellRenderer.tsx
|
|
7035
|
-
var
|
|
7630
|
+
var import_classnames37 = __toESM(require_classnames());
|
|
7036
7631
|
import { Nudge } from "@transferwise/components";
|
|
7037
|
-
import { useState as
|
|
7038
|
-
import { jsx as
|
|
7632
|
+
import { useState as useState23 } from "react";
|
|
7633
|
+
import { jsx as jsx109 } from "react/jsx-runtime";
|
|
7039
7634
|
var UpsellRenderer = {
|
|
7040
7635
|
canRenderType: "upsell",
|
|
7041
7636
|
render: UpsellRendererComponent
|
|
7042
7637
|
};
|
|
7043
7638
|
function UpsellRendererComponent(props) {
|
|
7044
7639
|
const { text, callToAction, media, margin, onDismiss, control, tags } = props;
|
|
7045
|
-
const [isVisible, setIsVisible] =
|
|
7046
|
-
return isVisible ? /* @__PURE__ */
|
|
7640
|
+
const [isVisible, setIsVisible] = useState23(true);
|
|
7641
|
+
return isVisible ? /* @__PURE__ */ jsx109(
|
|
7047
7642
|
Nudge,
|
|
7048
7643
|
{
|
|
7049
|
-
className: (0,
|
|
7644
|
+
className: (0, import_classnames37.default)(getMargin(margin), controlAndTagsToCSSClass({ control, tags })),
|
|
7050
7645
|
mediaName: getMediaName(media),
|
|
7051
7646
|
title: text,
|
|
7052
7647
|
action: __spreadValues({
|
|
@@ -7097,7 +7692,8 @@ var getWiseRenderers = () => [
|
|
|
7097
7692
|
CircularButtonRenderer,
|
|
7098
7693
|
BorderedBackgroundColoredBoxRenderer,
|
|
7099
7694
|
BoxRenderer_default,
|
|
7100
|
-
|
|
7695
|
+
CollectionRendererV2_default,
|
|
7696
|
+
CollectionRendererV1_default,
|
|
7101
7697
|
ButtonRenderer,
|
|
7102
7698
|
ColumnsRenderer_default,
|
|
7103
7699
|
DateInputRenderer_default,
|
|
@@ -7144,11 +7740,11 @@ var getWiseRenderers = () => [
|
|
|
7144
7740
|
|
|
7145
7741
|
// ../renderers/src/InitialLoadingStateRenderer.tsx
|
|
7146
7742
|
import { Loader as Loader2 } from "@transferwise/components";
|
|
7147
|
-
import { jsx as
|
|
7743
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
7148
7744
|
var InitialLoadingStateRenderer = {
|
|
7149
7745
|
canRenderType: "loading-state",
|
|
7150
7746
|
canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
|
|
7151
|
-
render: () => /* @__PURE__ */
|
|
7747
|
+
render: () => /* @__PURE__ */ jsx110(
|
|
7152
7748
|
Loader2,
|
|
7153
7749
|
{
|
|
7154
7750
|
size: "md",
|
|
@@ -7161,24 +7757,24 @@ var InitialLoadingStateRenderer = {
|
|
|
7161
7757
|
// src/dynamicFlow/DynamicFlowModal.tsx
|
|
7162
7758
|
import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
|
|
7163
7759
|
import { Modal as Modal5 } from "@transferwise/components";
|
|
7164
|
-
import { jsx as
|
|
7760
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
7165
7761
|
function DynamicFlowModal(props) {
|
|
7166
7762
|
const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
|
|
7167
7763
|
const dfProps = useWiseToCoreProps(rest);
|
|
7168
7764
|
const df = useDynamicFlowModal(dfProps);
|
|
7169
|
-
return /* @__PURE__ */
|
|
7765
|
+
return /* @__PURE__ */ jsx111(
|
|
7170
7766
|
Modal5,
|
|
7171
7767
|
__spreadProps(__spreadValues({
|
|
7172
7768
|
className: `dynamic-flow-modal ${className}`,
|
|
7173
7769
|
disableDimmerClickToClose: true
|
|
7174
7770
|
}, df.modal), {
|
|
7175
|
-
body: /* @__PURE__ */
|
|
7771
|
+
body: /* @__PURE__ */ jsx111("div", { className: "dynamic-flow-modal", children: df.modal.body })
|
|
7176
7772
|
})
|
|
7177
7773
|
);
|
|
7178
7774
|
}
|
|
7179
7775
|
|
|
7180
7776
|
// src/dynamicFlow/getMergedRenderers.tsx
|
|
7181
|
-
import { jsx as
|
|
7777
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
7182
7778
|
var wiseRenderers = getWiseRenderers();
|
|
7183
7779
|
var getMergedRenderers = (props) => {
|
|
7184
7780
|
var _d, _e;
|
|
@@ -7192,7 +7788,7 @@ var getMergedRenderers = (props) => {
|
|
|
7192
7788
|
method: initialRequest.method,
|
|
7193
7789
|
data: initialRequest.body
|
|
7194
7790
|
};
|
|
7195
|
-
return presentation.type === "push" ? /* @__PURE__ */
|
|
7791
|
+
return presentation.type === "push" ? /* @__PURE__ */ jsx112(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx112(
|
|
7196
7792
|
DynamicFlowModal,
|
|
7197
7793
|
__spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
|
|
7198
7794
|
features: subflowFeatures,
|
|
@@ -7272,11 +7868,11 @@ var customEventsToAnalytics = {
|
|
|
7272
7868
|
|
|
7273
7869
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7274
7870
|
import { useCallback as useCallback2 } from "react";
|
|
7275
|
-
import { useIntl as
|
|
7871
|
+
import { useIntl as useIntl24 } from "react-intl";
|
|
7276
7872
|
|
|
7277
7873
|
// src/dynamicFlow/messages.ts
|
|
7278
|
-
import { defineMessages as
|
|
7279
|
-
var messages_default =
|
|
7874
|
+
import { defineMessages as defineMessages16 } from "react-intl";
|
|
7875
|
+
var messages_default = defineMessages16({
|
|
7280
7876
|
copied: {
|
|
7281
7877
|
id: "df.wise.CopyFeedback.copy",
|
|
7282
7878
|
defaultMessage: "Copied to clipboard",
|
|
@@ -7291,7 +7887,7 @@ var messages_default = defineMessages15({
|
|
|
7291
7887
|
|
|
7292
7888
|
// src/dynamicFlow/useOnCopy.tsx
|
|
7293
7889
|
var useOnCopy = () => {
|
|
7294
|
-
const { formatMessage } =
|
|
7890
|
+
const { formatMessage } = useIntl24();
|
|
7295
7891
|
const createSnackBar = useSnackBarIfAvailable();
|
|
7296
7892
|
return useCallback2(
|
|
7297
7893
|
(copiedContent) => {
|
|
@@ -7307,9 +7903,9 @@ var useOnCopy = () => {
|
|
|
7307
7903
|
|
|
7308
7904
|
// src/dynamicFlow/useWiseHttpClient.tsx
|
|
7309
7905
|
import { useCallback as useCallback3 } from "react";
|
|
7310
|
-
import { useIntl as
|
|
7906
|
+
import { useIntl as useIntl25 } from "react-intl";
|
|
7311
7907
|
var useWiseHttpClient = (httpClient) => {
|
|
7312
|
-
const { locale } =
|
|
7908
|
+
const { locale } = useIntl25();
|
|
7313
7909
|
return useCallback3(
|
|
7314
7910
|
async (input, init = {}) => {
|
|
7315
7911
|
const headers = new Headers(init.headers);
|
|
@@ -7389,13 +7985,13 @@ var openLinkInNewTab = (url) => {
|
|
|
7389
7985
|
};
|
|
7390
7986
|
|
|
7391
7987
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
7392
|
-
import { jsxs as
|
|
7988
|
+
import { jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7393
7989
|
function DynamicFlow(props) {
|
|
7394
7990
|
const { className = "" } = props;
|
|
7395
7991
|
const dfProps = useWiseToCoreProps(props);
|
|
7396
7992
|
const df = useDynamicFlow(dfProps);
|
|
7397
7993
|
const { onContextMenu, contextMenu } = useDFContextMenu(df.controller);
|
|
7398
|
-
return /* @__PURE__ */
|
|
7994
|
+
return /* @__PURE__ */ jsxs41("div", { className, onContextMenu, children: [
|
|
7399
7995
|
df.view,
|
|
7400
7996
|
contextMenu
|
|
7401
7997
|
] });
|
|
@@ -7407,7 +8003,7 @@ import {
|
|
|
7407
8003
|
useImperativeHandle
|
|
7408
8004
|
} from "react";
|
|
7409
8005
|
import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
|
|
7410
|
-
import { jsx as
|
|
8006
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
7411
8007
|
var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
7412
8008
|
const { className = "" } = props;
|
|
7413
8009
|
const dfProps = useWiseToCoreProps(props);
|
|
@@ -7423,7 +8019,7 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
|
|
|
7423
8019
|
}),
|
|
7424
8020
|
[df]
|
|
7425
8021
|
);
|
|
7426
|
-
return /* @__PURE__ */
|
|
8022
|
+
return /* @__PURE__ */ jsx113("div", { className, children: df.view });
|
|
7427
8023
|
});
|
|
7428
8024
|
|
|
7429
8025
|
// src/index.ts
|
|
@@ -7485,6 +8081,8 @@ var cs_default = {
|
|
|
7485
8081
|
"df.wise.group.currencies-with-account-details": "M\u011Bny s detaily \xFA\u010Dtu",
|
|
7486
8082
|
"df.wise.group.popular": "Popul\xE1rn\xED",
|
|
7487
8083
|
"df.wise.group.recent": "Ned\xE1vn\xE9",
|
|
8084
|
+
"df.wise.ssnInput.hideValue": "Skr\xFDt hodnotu",
|
|
8085
|
+
"df.wise.ssnInput.showValue": "Zobrazit hodnotu",
|
|
7488
8086
|
"df.wise.step.scrollToBottom": "P\u0159ej\xEDt na konec"
|
|
7489
8087
|
};
|
|
7490
8088
|
|
|
@@ -7535,6 +8133,8 @@ var de_default = {
|
|
|
7535
8133
|
"df.wise.group.currencies-with-account-details": "W\xE4hrungen mit Bankverbindung",
|
|
7536
8134
|
"df.wise.group.popular": "Beliebt",
|
|
7537
8135
|
"df.wise.group.recent": "K\xFCrzlich verwendet",
|
|
8136
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
8137
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
7538
8138
|
"df.wise.step.scrollToBottom": "Nach unten scrollen"
|
|
7539
8139
|
};
|
|
7540
8140
|
|
|
@@ -7549,6 +8149,8 @@ var en_default = {
|
|
|
7549
8149
|
"df.wise.ButtonLayout.buttonLoadingMessage": "This might take a few seconds",
|
|
7550
8150
|
"df.wise.Collection.clearText": "Clear text",
|
|
7551
8151
|
"df.wise.Collection.loadMoreMessage": "Load more",
|
|
8152
|
+
"df.wise.Collection.showLessResultsButton": "Show less results",
|
|
8153
|
+
"df.wise.Collection.showMoreResultsButton": "Show all {count} results",
|
|
7552
8154
|
"df.wise.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
|
|
7553
8155
|
"df.wise.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
|
|
7554
8156
|
"df.wise.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
|
|
@@ -7585,6 +8187,8 @@ var en_default = {
|
|
|
7585
8187
|
"df.wise.group.currencies-with-account-details": "Currencies with account details",
|
|
7586
8188
|
"df.wise.group.popular": "Popular",
|
|
7587
8189
|
"df.wise.group.recent": "Recent",
|
|
8190
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
8191
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
7588
8192
|
"df.wise.step.scrollToBottom": "Scroll to bottom"
|
|
7589
8193
|
};
|
|
7590
8194
|
|
|
@@ -7635,6 +8239,8 @@ var es_default = {
|
|
|
7635
8239
|
"df.wise.group.currencies-with-account-details": "Divisas con datos de cuenta",
|
|
7636
8240
|
"df.wise.group.popular": "Populares",
|
|
7637
8241
|
"df.wise.group.recent": "Recientes",
|
|
8242
|
+
"df.wise.ssnInput.hideValue": "Ocultar valor",
|
|
8243
|
+
"df.wise.ssnInput.showValue": "Mostrar valor",
|
|
7638
8244
|
"df.wise.step.scrollToBottom": "Despl\xE1zate hasta abajo"
|
|
7639
8245
|
};
|
|
7640
8246
|
|
|
@@ -7685,6 +8291,8 @@ var fr_default = {
|
|
|
7685
8291
|
"df.wise.group.currencies-with-account-details": "Devises avec num\xE9ros de compte",
|
|
7686
8292
|
"df.wise.group.popular": "Populaires",
|
|
7687
8293
|
"df.wise.group.recent": "R\xE9cents",
|
|
8294
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
8295
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
7688
8296
|
"df.wise.step.scrollToBottom": "Faire d\xE9filer vers le bas"
|
|
7689
8297
|
};
|
|
7690
8298
|
|
|
@@ -7735,6 +8343,8 @@ var hu_default = {
|
|
|
7735
8343
|
"df.wise.group.currencies-with-account-details": "P\xE9nznemek sz\xE1mlaadatokkal",
|
|
7736
8344
|
"df.wise.group.popular": "N\xE9pszer\u0171",
|
|
7737
8345
|
"df.wise.group.recent": "Legut\xF3bbi",
|
|
8346
|
+
"df.wise.ssnInput.hideValue": "\xC9rt\xE9k elrejt\xE9se",
|
|
8347
|
+
"df.wise.ssnInput.showValue": "\xC9rt\xE9k megjelen\xEDt\xE9se",
|
|
7738
8348
|
"df.wise.step.scrollToBottom": "G\xF6rgess legalulra"
|
|
7739
8349
|
};
|
|
7740
8350
|
|
|
@@ -7785,6 +8395,8 @@ var id_default = {
|
|
|
7785
8395
|
"df.wise.group.currencies-with-account-details": "Mata uang dengan detail rekening",
|
|
7786
8396
|
"df.wise.group.popular": "Populer",
|
|
7787
8397
|
"df.wise.group.recent": "Terbaru",
|
|
8398
|
+
"df.wise.ssnInput.hideValue": "Sembunyikan nilai",
|
|
8399
|
+
"df.wise.ssnInput.showValue": "Tampilkan nilai",
|
|
7788
8400
|
"df.wise.step.scrollToBottom": "Gulir ke bawah"
|
|
7789
8401
|
};
|
|
7790
8402
|
|
|
@@ -7835,6 +8447,8 @@ var it_default = {
|
|
|
7835
8447
|
"df.wise.group.currencies-with-account-details": "Valute con estremi del conto",
|
|
7836
8448
|
"df.wise.group.popular": "Popolari",
|
|
7837
8449
|
"df.wise.group.recent": "Recenti",
|
|
8450
|
+
"df.wise.ssnInput.hideValue": "Nascondi valore",
|
|
8451
|
+
"df.wise.ssnInput.showValue": "Mostra valore",
|
|
7838
8452
|
"df.wise.step.scrollToBottom": "Scorri fino in fondo"
|
|
7839
8453
|
};
|
|
7840
8454
|
|
|
@@ -7885,6 +8499,8 @@ var ja_default = {
|
|
|
7885
8499
|
"df.wise.group.currencies-with-account-details": "\u53E3\u5EA7\u60C5\u5831\u3092\u53D6\u5F97\u3067\u304D\u308B\u901A\u8CA8",
|
|
7886
8500
|
"df.wise.group.popular": "\u4EBA\u6C17",
|
|
7887
8501
|
"df.wise.group.recent": "\u6700\u8FD1",
|
|
8502
|
+
"df.wise.ssnInput.hideValue": "\u756A\u53F7\u3092\u975E\u8868\u793A",
|
|
8503
|
+
"df.wise.ssnInput.showValue": "\u756A\u53F7\u3092\u8868\u793A",
|
|
7888
8504
|
"df.wise.step.scrollToBottom": "\u4E0B\u307E\u3067\u30B9\u30AF\u30ED\u30FC\u30EB\u3059\u308B"
|
|
7889
8505
|
};
|
|
7890
8506
|
|
|
@@ -7935,6 +8551,8 @@ var nl_default = {
|
|
|
7935
8551
|
"df.wise.group.currencies-with-account-details": "Valuta's met rekeninggegevens",
|
|
7936
8552
|
"df.wise.group.popular": "Populair",
|
|
7937
8553
|
"df.wise.group.recent": "Recent",
|
|
8554
|
+
"df.wise.ssnInput.hideValue": "Waarde verbergen",
|
|
8555
|
+
"df.wise.ssnInput.showValue": "Waarde weergeven",
|
|
7938
8556
|
"df.wise.step.scrollToBottom": "Scrol omlaag"
|
|
7939
8557
|
};
|
|
7940
8558
|
|
|
@@ -7985,6 +8603,8 @@ var pl_default = {
|
|
|
7985
8603
|
"df.wise.group.currencies-with-account-details": "Waluty z danymi bankowymi",
|
|
7986
8604
|
"df.wise.group.popular": "Popularne",
|
|
7987
8605
|
"df.wise.group.recent": "Ostatnie",
|
|
8606
|
+
"df.wise.ssnInput.hideValue": "Ukryj warto\u015B\u0107",
|
|
8607
|
+
"df.wise.ssnInput.showValue": "Poka\u017C warto\u015B\u0107",
|
|
7988
8608
|
"df.wise.step.scrollToBottom": "Przewi\u0144 w d\xF3\u0142"
|
|
7989
8609
|
};
|
|
7990
8610
|
|
|
@@ -8035,6 +8655,8 @@ var pt_default = {
|
|
|
8035
8655
|
"df.wise.group.currencies-with-account-details": "Moedas com dados de conta",
|
|
8036
8656
|
"df.wise.group.popular": "Popular",
|
|
8037
8657
|
"df.wise.group.recent": "Recente",
|
|
8658
|
+
"df.wise.ssnInput.hideValue": "Ocultar valor",
|
|
8659
|
+
"df.wise.ssnInput.showValue": "Exibir valor",
|
|
8038
8660
|
"df.wise.step.scrollToBottom": "Descer at\xE9 o final da p\xE1gina"
|
|
8039
8661
|
};
|
|
8040
8662
|
|
|
@@ -8085,6 +8707,8 @@ var ro_default = {
|
|
|
8085
8707
|
"df.wise.group.currencies-with-account-details": "Monede cu detalii de cont",
|
|
8086
8708
|
"df.wise.group.popular": "Populare",
|
|
8087
8709
|
"df.wise.group.recent": "Recente",
|
|
8710
|
+
"df.wise.ssnInput.hideValue": "Ascunde valoarea",
|
|
8711
|
+
"df.wise.ssnInput.showValue": "Arat\u0103 valoarea",
|
|
8088
8712
|
"df.wise.step.scrollToBottom": "Deruleaz\u0103 \xEEn jos"
|
|
8089
8713
|
};
|
|
8090
8714
|
|
|
@@ -8135,6 +8759,8 @@ var ru_default = {
|
|
|
8135
8759
|
"df.wise.group.currencies-with-account-details": "\u0412\u0430\u043B\u044E\u0442\u044B \u0441 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u0430\u043C\u0438 \u0441\u0447\u0435\u0442\u0430",
|
|
8136
8760
|
"df.wise.group.popular": "\u041F\u043E\u043F\u0443\u043B\u044F\u0440\u043D\u044B\u0435",
|
|
8137
8761
|
"df.wise.group.recent": "\u041D\u0435\u0434\u0430\u0432\u043D\u0438\u0435",
|
|
8762
|
+
"df.wise.ssnInput.hideValue": "\u0421\u043A\u0440\u044B\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",
|
|
8763
|
+
"df.wise.ssnInput.showValue": "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",
|
|
8138
8764
|
"df.wise.step.scrollToBottom": "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0432\u043D\u0438\u0437"
|
|
8139
8765
|
};
|
|
8140
8766
|
|
|
@@ -8185,6 +8811,8 @@ var th_default = {
|
|
|
8185
8811
|
"df.wise.group.currencies-with-account-details": "\u0E2A\u0E01\u0E38\u0E25\u0E40\u0E07\u0E34\u0E19\u0E15\u0E48\u0E32\u0E07\u0E46 \u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E1A\u0E31\u0E0D\u0E0A\u0E35",
|
|
8186
8812
|
"df.wise.group.popular": "\u0E2A\u0E01\u0E38\u0E25\u0E22\u0E2D\u0E14\u0E19\u0E34\u0E22\u0E21",
|
|
8187
8813
|
"df.wise.group.recent": "\u0E25\u0E48\u0E32\u0E2A\u0E38\u0E14",
|
|
8814
|
+
"df.wise.ssnInput.hideValue": "\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E48\u0E32",
|
|
8815
|
+
"df.wise.ssnInput.showValue": "\u0E41\u0E2A\u0E14\u0E07\u0E04\u0E48\u0E32",
|
|
8188
8816
|
"df.wise.step.scrollToBottom": "\u0E40\u0E25\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E1B\u0E14\u0E49\u0E32\u0E19\u0E25\u0E48\u0E32\u0E07"
|
|
8189
8817
|
};
|
|
8190
8818
|
|
|
@@ -8235,6 +8863,8 @@ var tr_default = {
|
|
|
8235
8863
|
"df.wise.group.currencies-with-account-details": "Hesap bilgileri olan bakiyeler",
|
|
8236
8864
|
"df.wise.group.popular": "Pop\xFCler",
|
|
8237
8865
|
"df.wise.group.recent": "Yak\u0131n zamanl\u0131",
|
|
8866
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
8867
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
8238
8868
|
"df.wise.step.scrollToBottom": "A\u015Fa\u011F\u0131 kayd\u0131r"
|
|
8239
8869
|
};
|
|
8240
8870
|
|
|
@@ -8285,6 +8915,8 @@ var zh_CN_default = {
|
|
|
8285
8915
|
"df.wise.group.currencies-with-account-details": "\u5E26\u6709\u8D26\u6237\u8BE6\u7EC6\u4FE1\u606F\u7684\u8D27\u5E01",
|
|
8286
8916
|
"df.wise.group.popular": "\u70ED\u95E8",
|
|
8287
8917
|
"df.wise.group.recent": "\u6700\u8FD1",
|
|
8918
|
+
"df.wise.ssnInput.hideValue": "Hide value",
|
|
8919
|
+
"df.wise.ssnInput.showValue": "Show value",
|
|
8288
8920
|
"df.wise.step.scrollToBottom": "\u6EDA\u52A8\u5230\u5E95\u90E8"
|
|
8289
8921
|
};
|
|
8290
8922
|
|
|
@@ -8335,6 +8967,8 @@ var zh_HK_default = {
|
|
|
8335
8967
|
"df.wise.group.currencies-with-account-details": "\u63D0\u4F9B\u5E33\u6236\u8CC7\u6599\u7684\u8CA8\u5E63",
|
|
8336
8968
|
"df.wise.group.popular": "\u71B1\u9580",
|
|
8337
8969
|
"df.wise.group.recent": "\u6700\u8FD1\u7684",
|
|
8970
|
+
"df.wise.ssnInput.hideValue": "\u96B1\u85CF\u503C",
|
|
8971
|
+
"df.wise.ssnInput.showValue": "\u986F\u793A\u503C",
|
|
8338
8972
|
"df.wise.step.scrollToBottom": "\u6ED1\u52D5\u5230\u6700\u5E95\u90E8"
|
|
8339
8973
|
};
|
|
8340
8974
|
|