@wise/dynamic-flow-client-internal 3.14.0-export-map-experimental-58f00fb → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.js +279 -366
- package/build/main.min.js +1 -1
- package/build/main.mjs +278 -365
- package/package.json +12 -6
- package/build/dynamicFlow/DynamicFlow.js +0 -104
- package/build/dynamicFlow/DynamicFlow.test.js +0 -116
- package/build/i18n/index.js +0 -62
- package/build/index.js +0 -5
- package/build/stories/DynamicFlow.story.js +0 -52
- package/build/stories/DynamicFragment.story.js +0 -132
- package/build/stories/Editable.story.js +0 -70
- package/build/stories/Examples.story.js +0 -29
- package/build/stories/Features.story.js +0 -33
- package/build/stories/utils/DynamicFlowSideBySide.js +0 -30
- package/build/stories/utils/fixtureHttpClient.js +0 -119
- package/build/stories/visual-tests/generated.story.js +0 -216
- package/build/stories/visual-tests/layouts.story.js +0 -108
- package/build/stories/visual-tests/schemas.story.js +0 -84
- package/build/stories/visual-tests/step.story.js +0 -30
- package/build/test-utils/NeptuneProviders.js +0 -23
- package/build/test-utils/rtl-utils.js +0 -20
- package/build/tests/renderers/RadioInputRendererComponent.test.js +0 -76
- package/build/tests/renderers/value-utils.test.js +0 -33
- package/build/types/stories/visual-tests/generated.story.d.ts +0 -39
- package/build/types/stories/visual-tests/layouts.story.d.ts +0 -21
- package/build/types/stories/visual-tests/schemas.story.d.ts +0 -17
- package/build/types/stories/visual-tests/step.story.d.ts +0 -8
package/build/main.mjs
CHANGED
|
@@ -60,7 +60,7 @@ var require_classnames = __commonJS({
|
|
|
60
60
|
(function() {
|
|
61
61
|
"use strict";
|
|
62
62
|
var hasOwn = {}.hasOwnProperty;
|
|
63
|
-
function
|
|
63
|
+
function classNames6() {
|
|
64
64
|
var classes = "";
|
|
65
65
|
for (var i = 0; i < arguments.length; i++) {
|
|
66
66
|
var arg = arguments[i];
|
|
@@ -78,7 +78,7 @@ var require_classnames = __commonJS({
|
|
|
78
78
|
return "";
|
|
79
79
|
}
|
|
80
80
|
if (Array.isArray(arg)) {
|
|
81
|
-
return
|
|
81
|
+
return classNames6.apply(null, arg);
|
|
82
82
|
}
|
|
83
83
|
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
84
84
|
return arg.toString();
|
|
@@ -101,14 +101,14 @@ var require_classnames = __commonJS({
|
|
|
101
101
|
return value + newClass;
|
|
102
102
|
}
|
|
103
103
|
if (typeof module !== "undefined" && module.exports) {
|
|
104
|
-
|
|
105
|
-
module.exports =
|
|
104
|
+
classNames6.default = classNames6;
|
|
105
|
+
module.exports = classNames6;
|
|
106
106
|
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
107
107
|
define("classnames", [], function() {
|
|
108
|
-
return
|
|
108
|
+
return classNames6;
|
|
109
109
|
});
|
|
110
110
|
} else {
|
|
111
|
-
window.classNames =
|
|
111
|
+
window.classNames = classNames6;
|
|
112
112
|
}
|
|
113
113
|
})();
|
|
114
114
|
}
|
|
@@ -695,7 +695,7 @@ var translations = languages.reduce(
|
|
|
695
695
|
var i18n_default = translations;
|
|
696
696
|
|
|
697
697
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
698
|
-
import { forwardRef as
|
|
698
|
+
import { forwardRef as forwardRef2, useCallback, useMemo as useMemo2 } from "react";
|
|
699
699
|
import { useIntl as useIntl7 } from "react-intl";
|
|
700
700
|
import {
|
|
701
701
|
DynamicFlow as DynamicFlowCoreLegacy,
|
|
@@ -756,95 +756,8 @@ var AlertRenderer = {
|
|
|
756
756
|
};
|
|
757
757
|
var AlertRenderer_default = AlertRenderer;
|
|
758
758
|
|
|
759
|
-
//
|
|
760
|
-
import
|
|
761
|
-
|
|
762
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
763
|
-
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
|
|
764
|
-
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : () => {
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
768
|
-
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
|
|
769
|
-
var $1746a345f3d73bb7$var$count = 0;
|
|
770
|
-
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
771
|
-
const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
|
|
772
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
773
|
-
if (!deterministicId)
|
|
774
|
-
setId(
|
|
775
|
-
(reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
776
|
-
);
|
|
777
|
-
}, [
|
|
778
|
-
deterministicId
|
|
779
|
-
]);
|
|
780
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
// ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.37.0_@transferwise+icons@3.13.0_react@18.3.1__@_lhivqbosx5xdelixwbny3eajv4/node_modules/@wise/forms/dist/index.mjs
|
|
784
|
-
var import_classnames = __toESM(require_classnames(), 1);
|
|
785
|
-
import { InlineAlert, Sentiment, Input, TextArea } from "@transferwise/components";
|
|
786
|
-
import { createContext as createContext2, useContext as useContext2, forwardRef } from "react";
|
|
787
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
788
|
-
var InputIdContext = /* @__PURE__ */ createContext2(void 0);
|
|
789
|
-
var InputIdContextProvider = InputIdContext.Provider;
|
|
790
|
-
var FormControlDescribedByContext = /* @__PURE__ */ createContext2(void 0);
|
|
791
|
-
var FormControlDescribedByProvider = FormControlDescribedByContext.Provider;
|
|
792
|
-
var FormControlInvalidContext = /* @__PURE__ */ createContext2(void 0);
|
|
793
|
-
var FormControlInvalidProvider = FormControlInvalidContext.Provider;
|
|
794
|
-
var Label = ({
|
|
795
|
-
id,
|
|
796
|
-
htmlFor,
|
|
797
|
-
className,
|
|
798
|
-
children
|
|
799
|
-
}) => {
|
|
800
|
-
return /* @__PURE__ */ jsx3("label", {
|
|
801
|
-
id,
|
|
802
|
-
htmlFor,
|
|
803
|
-
className: (0, import_classnames.default)("control-label d-flex flex-column gap-y-1 m-b-0", className),
|
|
804
|
-
children
|
|
805
|
-
});
|
|
806
|
-
};
|
|
807
|
-
var Field = ({
|
|
808
|
-
id,
|
|
809
|
-
label,
|
|
810
|
-
hint,
|
|
811
|
-
error,
|
|
812
|
-
className,
|
|
813
|
-
children
|
|
814
|
-
}) => {
|
|
815
|
-
const hasError = Boolean(error);
|
|
816
|
-
const hasHint = Boolean(hint) && !hasError;
|
|
817
|
-
const fallbackInputId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
818
|
-
const inputId = id !== null ? id != null ? id : fallbackInputId : void 0;
|
|
819
|
-
const descriptionId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
820
|
-
return /* @__PURE__ */ jsx3(InputIdContextProvider, {
|
|
821
|
-
value: inputId,
|
|
822
|
-
children: /* @__PURE__ */ jsx3(FormControlDescribedByProvider, {
|
|
823
|
-
value: hasError || hasHint ? descriptionId : void 0,
|
|
824
|
-
children: /* @__PURE__ */ jsx3(FormControlInvalidProvider, {
|
|
825
|
-
value: hasError,
|
|
826
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
827
|
-
className: (0, import_classnames.default)("form-group d-block", {
|
|
828
|
-
"has-error": hasError,
|
|
829
|
-
"has-info": hasHint
|
|
830
|
-
}, className),
|
|
831
|
-
children: [/* @__PURE__ */ jsxs(Label, {
|
|
832
|
-
htmlFor: inputId,
|
|
833
|
-
children: [label, children]
|
|
834
|
-
}), hasHint && /* @__PURE__ */ jsx3(InlineAlert, {
|
|
835
|
-
type: Sentiment.NEUTRAL,
|
|
836
|
-
id: descriptionId,
|
|
837
|
-
children: hint
|
|
838
|
-
}), hasError && /* @__PURE__ */ jsx3(InlineAlert, {
|
|
839
|
-
type: Sentiment.NEGATIVE,
|
|
840
|
-
id: descriptionId,
|
|
841
|
-
children: error
|
|
842
|
-
})]
|
|
843
|
-
})
|
|
844
|
-
})
|
|
845
|
-
})
|
|
846
|
-
});
|
|
847
|
-
};
|
|
759
|
+
// ../renderers/src/components/FieldInput.tsx
|
|
760
|
+
import { Field } from "@transferwise/components";
|
|
848
761
|
|
|
849
762
|
// ../renderers/src/components/Help.tsx
|
|
850
763
|
import { Info, Markdown } from "@transferwise/components";
|
|
@@ -861,14 +774,14 @@ var help_messages_default = defineMessages({
|
|
|
861
774
|
});
|
|
862
775
|
|
|
863
776
|
// ../renderers/src/components/Help.tsx
|
|
864
|
-
import { jsx as
|
|
777
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
865
778
|
function Help({ help }) {
|
|
866
779
|
const intl = useIntl();
|
|
867
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ jsx3(
|
|
868
781
|
Info,
|
|
869
782
|
{
|
|
870
783
|
className: "m-l-1",
|
|
871
|
-
content: /* @__PURE__ */
|
|
784
|
+
content: /* @__PURE__ */ jsx3(Markdown, { config: { link: { target: "_blank" } }, children: help }),
|
|
872
785
|
presentation: "POPOVER",
|
|
873
786
|
size: "sm",
|
|
874
787
|
"aria-label": intl.formatMessage(help_messages_default.helpAria)
|
|
@@ -878,46 +791,46 @@ function Help({ help }) {
|
|
|
878
791
|
var Help_default = Help;
|
|
879
792
|
|
|
880
793
|
// ../renderers/src/components/LabelContentWithHelp.tsx
|
|
881
|
-
import { jsx as
|
|
794
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
882
795
|
function LabelContentWithHelp({ text, help }) {
|
|
883
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
884
797
|
text,
|
|
885
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ jsx4(Help_default, { help })
|
|
886
799
|
] });
|
|
887
800
|
}
|
|
888
801
|
|
|
889
802
|
// ../renderers/src/components/FieldInput.tsx
|
|
890
|
-
import { jsx as
|
|
803
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
891
804
|
function FieldInput({ id, children, label, error, description, help }) {
|
|
892
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
893
|
-
return /* @__PURE__ */
|
|
805
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx5(LabelContentWithHelp, { text: label, help }) : label;
|
|
806
|
+
return /* @__PURE__ */ jsx5(Field, { id, label: labelContent, hint: description, error, children });
|
|
894
807
|
}
|
|
895
808
|
var FieldInput_default = FieldInput;
|
|
896
809
|
|
|
897
810
|
// ../renderers/src/BooleanInputRenderer.tsx
|
|
898
811
|
import { Checkbox } from "@transferwise/components";
|
|
899
|
-
import { jsx as
|
|
812
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
900
813
|
var BooleanInputRenderer = {
|
|
901
814
|
canRenderType: "input-boolean",
|
|
902
815
|
render: (props) => {
|
|
903
816
|
const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
|
|
904
817
|
const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
|
|
905
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ jsx6(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ jsx6(Checkbox, __spreadValues({ id }, checkboxProps)) });
|
|
906
819
|
}
|
|
907
820
|
};
|
|
908
821
|
var BooleanInputRenderer_default = BooleanInputRenderer;
|
|
909
822
|
|
|
910
823
|
// ../renderers/src/BoxRenderer.tsx
|
|
911
|
-
var
|
|
912
|
-
import { jsx as
|
|
824
|
+
var import_classnames = __toESM(require_classnames());
|
|
825
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
913
826
|
var BoxRenderer = {
|
|
914
827
|
canRenderType: "box",
|
|
915
828
|
render: ({ border, children, margin, width }) => {
|
|
916
829
|
const hasFixedWidth = width !== "xl";
|
|
917
|
-
const contents = /* @__PURE__ */
|
|
830
|
+
const contents = /* @__PURE__ */ jsx7(
|
|
918
831
|
"div",
|
|
919
832
|
{
|
|
920
|
-
className: (0,
|
|
833
|
+
className: (0, import_classnames.default)({
|
|
921
834
|
"df-box-renderer-border": border,
|
|
922
835
|
[`df-box-renderer-width-${width}`]: hasFixedWidth,
|
|
923
836
|
[getMargin(margin)]: !hasFixedWidth
|
|
@@ -925,7 +838,7 @@ var BoxRenderer = {
|
|
|
925
838
|
children
|
|
926
839
|
}
|
|
927
840
|
);
|
|
928
|
-
return hasFixedWidth ? /* @__PURE__ */
|
|
841
|
+
return hasFixedWidth ? /* @__PURE__ */ jsx7("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
|
|
929
842
|
}
|
|
930
843
|
};
|
|
931
844
|
var BoxRenderer_default = BoxRenderer;
|
|
@@ -934,21 +847,21 @@ var BoxRenderer_default = BoxRenderer;
|
|
|
934
847
|
import { Button } from "@transferwise/components";
|
|
935
848
|
|
|
936
849
|
// ../renderers/src/step/StepRendererContext.tsx
|
|
937
|
-
import { createContext as
|
|
938
|
-
var StepRendererContext =
|
|
850
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
851
|
+
var StepRendererContext = createContext2({ loadingState: "idle", trackEvent: () => {
|
|
939
852
|
} });
|
|
940
853
|
var StepRendererContextProvider = StepRendererContext.Provider;
|
|
941
854
|
var useLoadingContext = () => {
|
|
942
|
-
const { loadingState } =
|
|
855
|
+
const { loadingState } = useContext2(StepRendererContext);
|
|
943
856
|
return { loadingState, isLoading: loadingState !== "idle" };
|
|
944
857
|
};
|
|
945
858
|
var useTrackEvent = () => {
|
|
946
|
-
const { trackEvent } =
|
|
859
|
+
const { trackEvent } = useContext2(StepRendererContext);
|
|
947
860
|
return trackEvent;
|
|
948
861
|
};
|
|
949
862
|
|
|
950
863
|
// ../renderers/src/ButtonRenderer.tsx
|
|
951
|
-
import { jsx as
|
|
864
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
952
865
|
var ButtonRenderer = {
|
|
953
866
|
canRenderType: "button",
|
|
954
867
|
render: ButtonRendererComponent
|
|
@@ -966,7 +879,7 @@ function ButtonRendererComponent({
|
|
|
966
879
|
const priority = mapControl(control);
|
|
967
880
|
const type = priority === "tertiary" ? void 0 : mapContext(context);
|
|
968
881
|
const { isLoading } = useLoadingContext();
|
|
969
|
-
return /* @__PURE__ */
|
|
882
|
+
return /* @__PURE__ */ jsx8(
|
|
970
883
|
Button,
|
|
971
884
|
{
|
|
972
885
|
block: true,
|
|
@@ -1017,20 +930,20 @@ var mapSize = (size) => {
|
|
|
1017
930
|
var ButtonRenderer_default = ButtonRenderer;
|
|
1018
931
|
|
|
1019
932
|
// ../renderers/src/ColumnsRenderer.tsx
|
|
1020
|
-
var
|
|
1021
|
-
import { jsx as
|
|
933
|
+
var import_classnames2 = __toESM(require_classnames());
|
|
934
|
+
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1022
935
|
var ColumnsRenderer = {
|
|
1023
936
|
canRenderType: "columns",
|
|
1024
|
-
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */
|
|
937
|
+
render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs2(
|
|
1025
938
|
"div",
|
|
1026
939
|
{
|
|
1027
|
-
className: (0,
|
|
940
|
+
className: (0, import_classnames2.default)("df-columns-renderer-container", getMargin(margin), {
|
|
1028
941
|
"df-columns-renderer-bias-start": bias === "start",
|
|
1029
942
|
"df-columns-renderer-bias-end": bias === "end"
|
|
1030
943
|
}),
|
|
1031
944
|
children: [
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: startChildren }),
|
|
946
|
+
/* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: endChildren })
|
|
1034
947
|
]
|
|
1035
948
|
}
|
|
1036
949
|
)
|
|
@@ -1069,7 +982,7 @@ var dateToDateString = (date) => {
|
|
|
1069
982
|
};
|
|
1070
983
|
|
|
1071
984
|
// ../renderers/src/components/VariableDateInput.tsx
|
|
1072
|
-
import { jsx as
|
|
985
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1073
986
|
function VariableDateInput({
|
|
1074
987
|
control,
|
|
1075
988
|
inputProps
|
|
@@ -1085,7 +998,7 @@ function VariableDateInput({
|
|
|
1085
998
|
onFocus
|
|
1086
999
|
} = inputProps;
|
|
1087
1000
|
if (control === "date-lookup") {
|
|
1088
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ jsx10(
|
|
1089
1002
|
DateLookup,
|
|
1090
1003
|
{
|
|
1091
1004
|
value: dateStringToDateOrNull(inputProps.value),
|
|
@@ -1101,7 +1014,7 @@ function VariableDateInput({
|
|
|
1101
1014
|
}
|
|
1102
1015
|
);
|
|
1103
1016
|
}
|
|
1104
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ jsx10(
|
|
1105
1018
|
DateInput,
|
|
1106
1019
|
__spreadProps(__spreadValues({}, inputProps), {
|
|
1107
1020
|
dayAutoComplete: getAutocompleteString(autoComplete, "day"),
|
|
@@ -1118,7 +1031,7 @@ var getAutocompleteString = (value, suffix) => {
|
|
|
1118
1031
|
var VariableDateInput_default = VariableDateInput;
|
|
1119
1032
|
|
|
1120
1033
|
// ../renderers/src/DateInputRenderer.tsx
|
|
1121
|
-
import { jsx as
|
|
1034
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1122
1035
|
var DateInputRenderer = {
|
|
1123
1036
|
canRenderType: "input-date",
|
|
1124
1037
|
render: (props) => {
|
|
@@ -1143,7 +1056,7 @@ var DateInputRenderer = {
|
|
|
1143
1056
|
]);
|
|
1144
1057
|
const value = initialValue != null ? initialValue : "";
|
|
1145
1058
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
1146
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ jsx11(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx11(VariableDateInput_default, { control, inputProps }) });
|
|
1147
1060
|
}
|
|
1148
1061
|
};
|
|
1149
1062
|
var DateInputRenderer_default = DateInputRenderer;
|
|
@@ -1152,20 +1065,20 @@ var DateInputRenderer_default = DateInputRenderer;
|
|
|
1152
1065
|
import { NavigationOptionsList, NavigationOption } from "@transferwise/components";
|
|
1153
1066
|
|
|
1154
1067
|
// ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
|
|
1155
|
-
import { useState
|
|
1156
|
-
import { jsx as
|
|
1068
|
+
import { useState, useEffect, forwardRef } from "react";
|
|
1069
|
+
import { jsx as jsx12, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
|
|
1157
1070
|
var unknownFlagName = "wise";
|
|
1158
1071
|
var Flag = ({
|
|
1159
1072
|
code,
|
|
1160
1073
|
intrinsicSize = 64
|
|
1161
1074
|
}) => {
|
|
1162
|
-
const [fallback, setFallback] =
|
|
1075
|
+
const [fallback, setFallback] = useState(null);
|
|
1163
1076
|
useEffect(() => {
|
|
1164
1077
|
setFallback(null);
|
|
1165
1078
|
}, [code]);
|
|
1166
1079
|
const detailed = intrinsicSize >= 150;
|
|
1167
1080
|
const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
|
|
1168
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ jsx12("img", {
|
|
1169
1082
|
src: `https://wise.com/web-art/assets/flags/${name}.svg`,
|
|
1170
1083
|
alt: "",
|
|
1171
1084
|
width: intrinsicSize,
|
|
@@ -1256,19 +1169,19 @@ var Assets;
|
|
|
1256
1169
|
})(Assets || (Assets = {}));
|
|
1257
1170
|
|
|
1258
1171
|
// ../renderers/src/components/icon/FlagIcon.tsx
|
|
1259
|
-
import { jsx as
|
|
1172
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1260
1173
|
var isFlagIcon = (name) => name.startsWith("flag-");
|
|
1261
1174
|
function FlagIcon({ name }) {
|
|
1262
1175
|
if (!isFlagIcon(name)) {
|
|
1263
1176
|
return null;
|
|
1264
1177
|
}
|
|
1265
1178
|
const code = name.substring(5);
|
|
1266
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ jsx13(Flag, { code });
|
|
1267
1180
|
}
|
|
1268
1181
|
|
|
1269
1182
|
// ../renderers/src/components/icon/NamedIcon.tsx
|
|
1270
1183
|
import * as icons from "@transferwise/icons";
|
|
1271
|
-
import { jsx as
|
|
1184
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1272
1185
|
var isNamedIcon = (name) => {
|
|
1273
1186
|
const iconName = toCapitalisedCamelCase(name);
|
|
1274
1187
|
return Object.keys(icons).includes(iconName);
|
|
@@ -1279,19 +1192,19 @@ function NamedIcon({ name }) {
|
|
|
1279
1192
|
}
|
|
1280
1193
|
const iconName = toCapitalisedCamelCase(name);
|
|
1281
1194
|
const Icon = icons[iconName];
|
|
1282
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ jsx14(Icon, { size: 24 });
|
|
1283
1196
|
}
|
|
1284
1197
|
var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
|
|
1285
1198
|
var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
|
|
1286
1199
|
|
|
1287
1200
|
// ../renderers/src/components/icon/DynamicIcon.tsx
|
|
1288
|
-
import { jsx as
|
|
1201
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1289
1202
|
function DynamicIcon({ name }) {
|
|
1290
1203
|
if (isFlagIcon(name)) {
|
|
1291
|
-
return /* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ jsx15(FlagIcon, { name });
|
|
1292
1205
|
}
|
|
1293
1206
|
if (isNamedIcon(name)) {
|
|
1294
|
-
return /* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ jsx15(NamedIcon, { name });
|
|
1295
1208
|
}
|
|
1296
1209
|
return null;
|
|
1297
1210
|
}
|
|
@@ -1299,25 +1212,25 @@ var DynamicIcon_default = DynamicIcon;
|
|
|
1299
1212
|
|
|
1300
1213
|
// ../renderers/src/components/icon/NavigationOptionMedia.tsx
|
|
1301
1214
|
import { Avatar, AvatarType } from "@transferwise/components";
|
|
1302
|
-
import { jsx as
|
|
1215
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1303
1216
|
function NavigationOptionMedia({ icon, image }) {
|
|
1304
1217
|
if (!isNullish(icon)) {
|
|
1305
1218
|
if ("name" in icon) {
|
|
1306
|
-
return /* @__PURE__ */
|
|
1219
|
+
return /* @__PURE__ */ jsx16(Avatar, { type: AvatarType.ICON, children: /* @__PURE__ */ jsx16(DynamicIcon_default, { name: icon.name }) });
|
|
1307
1220
|
}
|
|
1308
1221
|
if (icon.text) {
|
|
1309
|
-
return /* @__PURE__ */
|
|
1222
|
+
return /* @__PURE__ */ jsx16(Avatar, { type: AvatarType.INITIALS, children: icon.text });
|
|
1310
1223
|
}
|
|
1311
1224
|
}
|
|
1312
1225
|
if (image == null ? void 0 : image.url) {
|
|
1313
1226
|
const { url, accessibilityDescription } = image;
|
|
1314
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ jsx16("img", { src: url, alt: accessibilityDescription });
|
|
1315
1228
|
}
|
|
1316
1229
|
return null;
|
|
1317
1230
|
}
|
|
1318
1231
|
|
|
1319
1232
|
// ../renderers/src/DecisionRenderer.tsx
|
|
1320
|
-
import { jsx as
|
|
1233
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1321
1234
|
var DecisionRenderer = {
|
|
1322
1235
|
canRenderType: "decision",
|
|
1323
1236
|
render: DecisionRendererComponent
|
|
@@ -1325,13 +1238,13 @@ var DecisionRenderer = {
|
|
|
1325
1238
|
var DecisionRenderer_default = DecisionRenderer;
|
|
1326
1239
|
function DecisionRendererComponent({ margin, options }) {
|
|
1327
1240
|
const { isLoading } = useLoadingContext();
|
|
1328
|
-
return /* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ jsx17("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx17(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title, onClick }) => /* @__PURE__ */ jsx17(
|
|
1329
1242
|
NavigationOption,
|
|
1330
1243
|
{
|
|
1331
1244
|
title,
|
|
1332
1245
|
content: description,
|
|
1333
1246
|
disabled: isLoading || disabled,
|
|
1334
|
-
media: /* @__PURE__ */
|
|
1247
|
+
media: /* @__PURE__ */ jsx17(NavigationOptionMedia, { icon, image }),
|
|
1335
1248
|
showMediaCircle: false,
|
|
1336
1249
|
showMediaAtAllSizes: true,
|
|
1337
1250
|
onClick
|
|
@@ -1341,36 +1254,36 @@ function DecisionRendererComponent({ margin, options }) {
|
|
|
1341
1254
|
}
|
|
1342
1255
|
|
|
1343
1256
|
// ../renderers/src/DividerRenderer.tsx
|
|
1344
|
-
import { jsx as
|
|
1257
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1345
1258
|
var DividerRenderer = {
|
|
1346
1259
|
canRenderType: "divider",
|
|
1347
|
-
render: ({ margin }) => /* @__PURE__ */
|
|
1260
|
+
render: ({ margin }) => /* @__PURE__ */ jsx18("hr", { className: `m-t-0 ${getMargin(margin)}` })
|
|
1348
1261
|
};
|
|
1349
1262
|
var DividerRenderer_default = DividerRenderer;
|
|
1350
1263
|
|
|
1351
1264
|
// ../renderers/src/FormRenderer.tsx
|
|
1352
|
-
import { jsx as
|
|
1265
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1353
1266
|
var FormRenderer = {
|
|
1354
1267
|
canRenderType: "form",
|
|
1355
|
-
render: ({ children, margin }) => /* @__PURE__ */
|
|
1268
|
+
render: ({ children, margin }) => /* @__PURE__ */ jsx19("div", { className: getMargin(margin), children })
|
|
1356
1269
|
};
|
|
1357
1270
|
var FormRenderer_default = FormRenderer;
|
|
1358
1271
|
|
|
1359
1272
|
// ../renderers/src/FormSectionRenderer.tsx
|
|
1360
1273
|
import { Header } from "@transferwise/components";
|
|
1361
|
-
import { jsx as
|
|
1274
|
+
import { jsx as jsx20, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1362
1275
|
var FormSectionRenderer = {
|
|
1363
1276
|
canRenderType: "form-section",
|
|
1364
|
-
render: ({ title, description, children }) => /* @__PURE__ */
|
|
1277
|
+
render: ({ title, description, children }) => /* @__PURE__ */ jsxs4("fieldset", { children: [
|
|
1365
1278
|
title && // TODO - once section headers support help, we could show help in here
|
|
1366
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ jsx20(
|
|
1367
1280
|
Header,
|
|
1368
1281
|
{
|
|
1369
1282
|
as: "h2",
|
|
1370
1283
|
title
|
|
1371
1284
|
}
|
|
1372
1285
|
),
|
|
1373
|
-
description && /* @__PURE__ */
|
|
1286
|
+
description && /* @__PURE__ */ jsx20("p", { children: description }),
|
|
1374
1287
|
children
|
|
1375
1288
|
] })
|
|
1376
1289
|
};
|
|
@@ -1378,32 +1291,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
|
|
|
1378
1291
|
|
|
1379
1292
|
// ../renderers/src/HeadingRenderer.tsx
|
|
1380
1293
|
import { Display } from "@transferwise/components";
|
|
1381
|
-
import { jsx as
|
|
1294
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1382
1295
|
var HeadingRenderer = {
|
|
1383
1296
|
canRenderType: "heading",
|
|
1384
|
-
render: (props) => /* @__PURE__ */
|
|
1297
|
+
render: (props) => /* @__PURE__ */ jsx21(Heading, __spreadValues({}, props))
|
|
1385
1298
|
};
|
|
1386
1299
|
function Heading(props) {
|
|
1387
1300
|
const { text, size, align, margin, control } = props;
|
|
1388
1301
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1389
|
-
return control === "display" ? /* @__PURE__ */
|
|
1302
|
+
return control === "display" ? /* @__PURE__ */ jsx21(DisplayHeading, { size, text, className }) : /* @__PURE__ */ jsx21(StandardHeading, { size, text, className });
|
|
1390
1303
|
}
|
|
1391
1304
|
function DisplayHeading({ size, text, className }) {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ jsx21(Display, { type: getDisplayType(size), className, children: text });
|
|
1393
1306
|
}
|
|
1394
1307
|
function StandardHeading({ size, text, className }) {
|
|
1395
1308
|
switch (size) {
|
|
1396
1309
|
case "xs":
|
|
1397
|
-
return /* @__PURE__ */
|
|
1310
|
+
return /* @__PURE__ */ jsx21("h5", { className, children: text });
|
|
1398
1311
|
case "sm":
|
|
1399
|
-
return /* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ jsx21("h4", { className, children: text });
|
|
1400
1313
|
case "lg":
|
|
1401
|
-
return /* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ jsx21("h2", { className, children: text });
|
|
1402
1315
|
case "xl":
|
|
1403
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ jsx21("h1", { className, children: text });
|
|
1404
1317
|
case "md":
|
|
1405
1318
|
default:
|
|
1406
|
-
return /* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ jsx21("h3", { className, children: text });
|
|
1407
1320
|
}
|
|
1408
1321
|
}
|
|
1409
1322
|
var getDisplayType = (size) => {
|
|
@@ -1423,7 +1336,7 @@ var HeadingRenderer_default = HeadingRenderer;
|
|
|
1423
1336
|
|
|
1424
1337
|
// ../renderers/src/ImageRenderer.tsx
|
|
1425
1338
|
import { Image } from "@transferwise/components";
|
|
1426
|
-
import { useEffect as useEffect2, useState as
|
|
1339
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
1427
1340
|
|
|
1428
1341
|
// ../renderers/src/utils/api-utils.ts
|
|
1429
1342
|
function isRelativePath(url = "") {
|
|
@@ -1433,10 +1346,10 @@ function isRelativePath(url = "") {
|
|
|
1433
1346
|
}
|
|
1434
1347
|
|
|
1435
1348
|
// ../renderers/src/ImageRenderer.tsx
|
|
1436
|
-
import { jsx as
|
|
1349
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1437
1350
|
var ImageRenderer = {
|
|
1438
1351
|
canRenderType: "image",
|
|
1439
|
-
render: (props) => /* @__PURE__ */
|
|
1352
|
+
render: (props) => /* @__PURE__ */ jsx22(ImageRendererComponent, __spreadValues({}, props))
|
|
1440
1353
|
};
|
|
1441
1354
|
var ImageRenderer_default = ImageRenderer;
|
|
1442
1355
|
function ImageRendererComponent({
|
|
@@ -1445,12 +1358,12 @@ function ImageRendererComponent({
|
|
|
1445
1358
|
size,
|
|
1446
1359
|
url
|
|
1447
1360
|
}) {
|
|
1448
|
-
const [imageSource, setImageSource] =
|
|
1361
|
+
const [imageSource, setImageSource] = useState2("");
|
|
1449
1362
|
const httpClient = useRendererHttpClient();
|
|
1450
1363
|
useEffect2(() => {
|
|
1451
1364
|
void getImageSource(httpClient, url).then(setImageSource);
|
|
1452
1365
|
}, [url, httpClient]);
|
|
1453
|
-
return /* @__PURE__ */
|
|
1366
|
+
return /* @__PURE__ */ jsx22("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx22(
|
|
1454
1367
|
Image,
|
|
1455
1368
|
{
|
|
1456
1369
|
className: `img-responsive ${getMargin(margin)}`,
|
|
@@ -1495,7 +1408,7 @@ var getImageSource = async (httpClient, imageUrl) => {
|
|
|
1495
1408
|
|
|
1496
1409
|
// ../renderers/src/InstructionsRenderer.tsx
|
|
1497
1410
|
import { Header as Header2, InstructionsList } from "@transferwise/components";
|
|
1498
|
-
import { jsx as
|
|
1411
|
+
import { jsx as jsx23, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1499
1412
|
var doContext = ["positive", "neutral"];
|
|
1500
1413
|
var dontContext = ["warning", "negative"];
|
|
1501
1414
|
var InstructionsRenderer = {
|
|
@@ -1503,16 +1416,16 @@ var InstructionsRenderer = {
|
|
|
1503
1416
|
render: ({ items, margin, title }) => {
|
|
1504
1417
|
const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
|
|
1505
1418
|
const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
title ? /* @__PURE__ */
|
|
1508
|
-
/* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ jsxs5("div", { className: getMargin(margin), children: [
|
|
1420
|
+
title ? /* @__PURE__ */ jsx23(Header2, { title }) : null,
|
|
1421
|
+
/* @__PURE__ */ jsx23(InstructionsList, { dos, donts })
|
|
1509
1422
|
] });
|
|
1510
1423
|
}
|
|
1511
1424
|
};
|
|
1512
1425
|
var InstructionsRenderer_default = InstructionsRenderer;
|
|
1513
1426
|
|
|
1514
1427
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1515
|
-
import { Input
|
|
1428
|
+
import { Input } from "@transferwise/components";
|
|
1516
1429
|
|
|
1517
1430
|
// ../renderers/src/utils/input-utils.ts
|
|
1518
1431
|
var onWheel = (event) => {
|
|
@@ -1522,13 +1435,13 @@ var onWheel = (event) => {
|
|
|
1522
1435
|
};
|
|
1523
1436
|
|
|
1524
1437
|
// ../renderers/src/IntegerInputRenderer.tsx
|
|
1525
|
-
import { jsx as
|
|
1438
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1526
1439
|
var IntegerInputRenderer = {
|
|
1527
1440
|
canRenderType: "input-integer",
|
|
1528
1441
|
render: (props) => {
|
|
1529
1442
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
1530
|
-
return /* @__PURE__ */
|
|
1531
|
-
|
|
1443
|
+
return /* @__PURE__ */ jsx24(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx24(
|
|
1444
|
+
Input,
|
|
1532
1445
|
__spreadValues({
|
|
1533
1446
|
id,
|
|
1534
1447
|
name: id,
|
|
@@ -1549,10 +1462,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
|
|
|
1549
1462
|
|
|
1550
1463
|
// ../renderers/src/LoadingIndicatorRenderer.tsx
|
|
1551
1464
|
import { Loader } from "@transferwise/components";
|
|
1552
|
-
import { jsx as
|
|
1465
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1553
1466
|
var LoadingIndicatorRenderer = {
|
|
1554
1467
|
canRenderType: "loading-indicator",
|
|
1555
|
-
render: ({ margin, size }) => /* @__PURE__ */
|
|
1468
|
+
render: ({ margin, size }) => /* @__PURE__ */ jsx25(
|
|
1556
1469
|
Loader,
|
|
1557
1470
|
{
|
|
1558
1471
|
size,
|
|
@@ -1565,27 +1478,27 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
|
|
|
1565
1478
|
|
|
1566
1479
|
// ../renderers/src/MarkdownRenderer.tsx
|
|
1567
1480
|
import { Markdown as Markdown2 } from "@transferwise/components";
|
|
1568
|
-
import { jsx as
|
|
1481
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1569
1482
|
var MarkdownRenderer = {
|
|
1570
1483
|
canRenderType: "markdown",
|
|
1571
|
-
render: ({ content, align, margin }) => /* @__PURE__ */
|
|
1484
|
+
render: ({ content, align, margin }) => /* @__PURE__ */ jsx26("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx26(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
|
|
1572
1485
|
};
|
|
1573
1486
|
var MarkdownRenderer_default = MarkdownRenderer;
|
|
1574
1487
|
|
|
1575
1488
|
// ../renderers/src/ModalRenderer.tsx
|
|
1576
1489
|
import { Button as Button2, Modal } from "@transferwise/components";
|
|
1577
|
-
import { useState as
|
|
1578
|
-
import { jsx as
|
|
1490
|
+
import { useState as useState3 } from "react";
|
|
1491
|
+
import { jsx as jsx27, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1579
1492
|
var ModalRenderer = {
|
|
1580
1493
|
canRenderType: "modal",
|
|
1581
|
-
render: (props) => /* @__PURE__ */
|
|
1494
|
+
render: (props) => /* @__PURE__ */ jsx27(DFModal, __spreadValues({}, props))
|
|
1582
1495
|
};
|
|
1583
1496
|
var ModalRenderer_default = ModalRenderer;
|
|
1584
1497
|
function DFModal({ content, margin, trigger }) {
|
|
1585
|
-
const [visible, setVisible] =
|
|
1586
|
-
return /* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1498
|
+
const [visible, setVisible] = useState3(false);
|
|
1499
|
+
return /* @__PURE__ */ jsxs6("div", { className: getMargin(margin), children: [
|
|
1500
|
+
/* @__PURE__ */ jsx27(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
|
|
1501
|
+
/* @__PURE__ */ jsx27(
|
|
1589
1502
|
Modal,
|
|
1590
1503
|
{
|
|
1591
1504
|
scroll: "content",
|
|
@@ -1603,16 +1516,16 @@ import { SelectInput, SelectInputOptionContent } from "@transferwise/components"
|
|
|
1603
1516
|
|
|
1604
1517
|
// ../renderers/src/SelectInputRenderer/OptionMedia.tsx
|
|
1605
1518
|
import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
|
|
1606
|
-
import { jsx as
|
|
1519
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1607
1520
|
function OptionMedia({ icon, image }) {
|
|
1608
1521
|
if (image == null ? void 0 : image.url) {
|
|
1609
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ jsx28("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
|
|
1610
1523
|
}
|
|
1611
1524
|
if (icon && "name" in icon) {
|
|
1612
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ jsx28(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx28(DynamicIcon_default, { name: icon.name }) });
|
|
1613
1526
|
}
|
|
1614
1527
|
if (icon && "text" in icon) {
|
|
1615
|
-
return /* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ jsx28(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
|
|
1616
1529
|
}
|
|
1617
1530
|
return null;
|
|
1618
1531
|
}
|
|
@@ -1631,15 +1544,15 @@ var multi_select_messages_default = defineMessages2({
|
|
|
1631
1544
|
});
|
|
1632
1545
|
|
|
1633
1546
|
// ../renderers/src/MultiSelectInputRenderer.tsx
|
|
1634
|
-
import { useState as
|
|
1635
|
-
import { jsx as
|
|
1547
|
+
import { useState as useState4 } from "react";
|
|
1548
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1636
1549
|
var MultiSelectInputRenderer = {
|
|
1637
1550
|
canRenderType: "input-multi-select",
|
|
1638
|
-
render: (props) => /* @__PURE__ */
|
|
1551
|
+
render: (props) => /* @__PURE__ */ jsx29(MultiSelectInputRendererComponent, __spreadValues({}, props))
|
|
1639
1552
|
};
|
|
1640
1553
|
function MultiSelectInputRendererComponent(props) {
|
|
1641
1554
|
const { formatMessage } = useIntl2();
|
|
1642
|
-
const [stagedIndices, setStagedIndices] =
|
|
1555
|
+
const [stagedIndices, setStagedIndices] = useState4();
|
|
1643
1556
|
const {
|
|
1644
1557
|
id,
|
|
1645
1558
|
description,
|
|
@@ -1676,11 +1589,11 @@ function MultiSelectInputRendererComponent(props) {
|
|
|
1676
1589
|
const contentProps = {
|
|
1677
1590
|
title: option.title,
|
|
1678
1591
|
description: option.description,
|
|
1679
|
-
icon: /* @__PURE__ */
|
|
1592
|
+
icon: /* @__PURE__ */ jsx29(OptionMedia, { icon: option.icon, image: option.image })
|
|
1680
1593
|
};
|
|
1681
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx29(SelectInputOptionContent, __spreadValues({}, contentProps));
|
|
1682
1595
|
};
|
|
1683
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ jsx29(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx29(
|
|
1684
1597
|
SelectInput,
|
|
1685
1598
|
{
|
|
1686
1599
|
id,
|
|
@@ -1720,9 +1633,9 @@ var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
|
|
|
1720
1633
|
import { UploadInput } from "@transferwise/components";
|
|
1721
1634
|
|
|
1722
1635
|
// ../renderers/src/components/UploadFieldInput.tsx
|
|
1723
|
-
var
|
|
1724
|
-
import { InlineAlert
|
|
1725
|
-
import { jsx as
|
|
1636
|
+
var import_classnames3 = __toESM(require_classnames());
|
|
1637
|
+
import { InlineAlert } from "@transferwise/components";
|
|
1638
|
+
import { jsx as jsx30, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1726
1639
|
function UploadFieldInput({
|
|
1727
1640
|
id,
|
|
1728
1641
|
children,
|
|
@@ -1731,18 +1644,18 @@ function UploadFieldInput({
|
|
|
1731
1644
|
error,
|
|
1732
1645
|
help
|
|
1733
1646
|
}) {
|
|
1734
|
-
const labelContent = label && help ? /* @__PURE__ */
|
|
1647
|
+
const labelContent = label && help ? /* @__PURE__ */ jsx30(LabelContentWithHelp, { text: label, help }) : label;
|
|
1735
1648
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1736
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ jsxs7(
|
|
1737
1650
|
"div",
|
|
1738
1651
|
{
|
|
1739
|
-
className: (0,
|
|
1652
|
+
className: (0, import_classnames3.default)("form-group d-block", {
|
|
1740
1653
|
"has-error": !!error
|
|
1741
1654
|
}),
|
|
1742
1655
|
children: [
|
|
1743
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ jsx30("label", { htmlFor: id, className: "control-label", children: labelContent }),
|
|
1744
1657
|
children,
|
|
1745
|
-
error && /* @__PURE__ */
|
|
1658
|
+
error && /* @__PURE__ */ jsx30(InlineAlert, { type: "negative", id: descriptionId, children: error })
|
|
1746
1659
|
]
|
|
1747
1660
|
}
|
|
1748
1661
|
);
|
|
@@ -1774,7 +1687,7 @@ var getFileType = (base64Url) => {
|
|
|
1774
1687
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1775
1688
|
|
|
1776
1689
|
// ../renderers/src/MultiUploadInputRenderer.tsx
|
|
1777
|
-
import { jsx as
|
|
1690
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1778
1691
|
var MultiUploadInputRenderer = {
|
|
1779
1692
|
canRenderType: "input-upload-multi",
|
|
1780
1693
|
render: (props) => {
|
|
@@ -1801,7 +1714,7 @@ var MultiUploadInputRenderer = {
|
|
|
1801
1714
|
};
|
|
1802
1715
|
const onDeleteFile = async (fileId) => onDelete(String(fileId));
|
|
1803
1716
|
const descriptionId = description ? `${id}-description` : void 0;
|
|
1804
|
-
return /* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ jsx31(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx31(
|
|
1805
1718
|
UploadInput,
|
|
1806
1719
|
{
|
|
1807
1720
|
id,
|
|
@@ -1823,14 +1736,14 @@ var MultiUploadInputRenderer = {
|
|
|
1823
1736
|
var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
|
|
1824
1737
|
|
|
1825
1738
|
// ../renderers/src/NumberInputRenderer.tsx
|
|
1826
|
-
import { Input as
|
|
1827
|
-
import { jsx as
|
|
1739
|
+
import { Input as Input2 } from "@transferwise/components";
|
|
1740
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1828
1741
|
var NumberInputRenderer = {
|
|
1829
1742
|
canRenderType: "input-number",
|
|
1830
1743
|
render: (props) => {
|
|
1831
1744
|
const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
|
|
1745
|
+
return /* @__PURE__ */ jsx32(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx32(
|
|
1746
|
+
Input2,
|
|
1834
1747
|
__spreadValues({
|
|
1835
1748
|
id,
|
|
1836
1749
|
name: id,
|
|
@@ -1852,16 +1765,16 @@ import { useIntl as useIntl3 } from "react-intl";
|
|
|
1852
1765
|
|
|
1853
1766
|
// ../renderers/src/hooks/useSnackBarIfAvailable.ts
|
|
1854
1767
|
import { SnackbarContext } from "@transferwise/components";
|
|
1855
|
-
import { useContext as
|
|
1768
|
+
import { useContext as useContext3 } from "react";
|
|
1856
1769
|
function useSnackBarIfAvailable() {
|
|
1857
|
-
const context =
|
|
1770
|
+
const context = useContext3(SnackbarContext);
|
|
1858
1771
|
return context ? context.createSnackbar : () => {
|
|
1859
1772
|
};
|
|
1860
1773
|
}
|
|
1861
1774
|
|
|
1862
1775
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1863
|
-
var
|
|
1864
|
-
import { Button as Button3, Input as
|
|
1776
|
+
var import_classnames4 = __toESM(require_classnames());
|
|
1777
|
+
import { Button as Button3, Input as Input3 } from "@transferwise/components";
|
|
1865
1778
|
|
|
1866
1779
|
// ../renderers/src/messages/paragraph.messages.ts
|
|
1867
1780
|
import { defineMessages as defineMessages3 } from "react-intl";
|
|
@@ -1879,17 +1792,17 @@ var paragraph_messages_default = defineMessages3({
|
|
|
1879
1792
|
});
|
|
1880
1793
|
|
|
1881
1794
|
// ../renderers/src/ParagraphRenderer.tsx
|
|
1882
|
-
import { jsx as
|
|
1795
|
+
import { jsx as jsx33, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1883
1796
|
var ParagraphRenderer = {
|
|
1884
1797
|
canRenderType: "paragraph",
|
|
1885
|
-
render: (props) => /* @__PURE__ */
|
|
1798
|
+
render: (props) => /* @__PURE__ */ jsx33(Paragraph, __spreadValues({}, props))
|
|
1886
1799
|
};
|
|
1887
1800
|
function Paragraph({ align, control, margin, text }) {
|
|
1888
1801
|
const className = getTextAlignmentAndMargin({ align, margin });
|
|
1889
|
-
return control === "copyable" ? /* @__PURE__ */
|
|
1802
|
+
return control === "copyable" ? /* @__PURE__ */ jsx33(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx33(StandardParagraph, { className, text });
|
|
1890
1803
|
}
|
|
1891
1804
|
function StandardParagraph({ text, className }) {
|
|
1892
|
-
return /* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ jsx33("p", { className, children: text });
|
|
1893
1806
|
}
|
|
1894
1807
|
function CopyableParagraph({
|
|
1895
1808
|
text,
|
|
@@ -1903,24 +1816,24 @@ function CopyableParagraph({
|
|
|
1903
1816
|
});
|
|
1904
1817
|
};
|
|
1905
1818
|
const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
|
|
1906
|
-
return /* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
|
|
1819
|
+
return /* @__PURE__ */ jsxs8("div", { className, children: [
|
|
1820
|
+
/* @__PURE__ */ jsx33(
|
|
1821
|
+
Input3,
|
|
1909
1822
|
{
|
|
1910
1823
|
type: "text",
|
|
1911
1824
|
value: text,
|
|
1912
1825
|
readOnly: true,
|
|
1913
|
-
className: (0,
|
|
1826
|
+
className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
|
|
1914
1827
|
}
|
|
1915
1828
|
),
|
|
1916
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ jsx33(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
|
|
1917
1830
|
] });
|
|
1918
1831
|
}
|
|
1919
1832
|
var ParagraphRenderer_default = ParagraphRenderer;
|
|
1920
1833
|
|
|
1921
1834
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1922
|
-
import { Button as Button4, Header as Header3, Modal as Modal2, NavigationOption as NavigationOption2, InlineAlert as
|
|
1923
|
-
import { useState as
|
|
1835
|
+
import { Button as Button4, Header as Header3, Modal as Modal2, NavigationOption as NavigationOption2, InlineAlert as InlineAlert2 } from "@transferwise/components";
|
|
1836
|
+
import { useState as useState5 } from "react";
|
|
1924
1837
|
import { Plus } from "@transferwise/icons";
|
|
1925
1838
|
import { useIntl as useIntl4 } from "react-intl";
|
|
1926
1839
|
|
|
@@ -1950,11 +1863,11 @@ var repeatable_messages_default = defineMessages4({
|
|
|
1950
1863
|
});
|
|
1951
1864
|
|
|
1952
1865
|
// ../renderers/src/RepeatableRenderer.tsx
|
|
1953
|
-
var
|
|
1954
|
-
import { Fragment as Fragment2, jsx as
|
|
1866
|
+
var import_classnames5 = __toESM(require_classnames());
|
|
1867
|
+
import { Fragment as Fragment2, jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1955
1868
|
var RepeatableRenderer = {
|
|
1956
1869
|
canRenderType: "repeatable",
|
|
1957
|
-
render: (props) => /* @__PURE__ */
|
|
1870
|
+
render: (props) => /* @__PURE__ */ jsx34(Repeatable, __spreadValues({}, props))
|
|
1958
1871
|
};
|
|
1959
1872
|
function Repeatable(props) {
|
|
1960
1873
|
const {
|
|
@@ -1971,7 +1884,7 @@ function Repeatable(props) {
|
|
|
1971
1884
|
onRemove
|
|
1972
1885
|
} = props;
|
|
1973
1886
|
const { formatMessage } = useIntl4();
|
|
1974
|
-
const [openModalType, setOpenModalType] =
|
|
1887
|
+
const [openModalType, setOpenModalType] = useState5(null);
|
|
1975
1888
|
const onAddItem = () => {
|
|
1976
1889
|
onAdd();
|
|
1977
1890
|
setOpenModalType("add");
|
|
@@ -1993,40 +1906,40 @@ function Repeatable(props) {
|
|
|
1993
1906
|
const onCancelEdit = () => {
|
|
1994
1907
|
setOpenModalType(null);
|
|
1995
1908
|
};
|
|
1996
|
-
return /* @__PURE__ */
|
|
1997
|
-
title && /* @__PURE__ */
|
|
1998
|
-
description && /* @__PURE__ */
|
|
1999
|
-
/* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1910
|
+
title && /* @__PURE__ */ jsx34(Header3, { title }),
|
|
1911
|
+
description && /* @__PURE__ */ jsx34("p", { children: description }),
|
|
1912
|
+
/* @__PURE__ */ jsxs9(
|
|
2000
1913
|
"div",
|
|
2001
1914
|
{
|
|
2002
|
-
className: (0,
|
|
1915
|
+
className: (0, import_classnames5.default)("form-group", {
|
|
2003
1916
|
"has-error": error
|
|
2004
1917
|
}),
|
|
2005
1918
|
children: [
|
|
2006
|
-
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */
|
|
2007
|
-
/* @__PURE__ */
|
|
1919
|
+
items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx34(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
|
|
1920
|
+
/* @__PURE__ */ jsx34(
|
|
2008
1921
|
NavigationOption2,
|
|
2009
1922
|
{
|
|
2010
|
-
media: /* @__PURE__ */
|
|
1923
|
+
media: /* @__PURE__ */ jsx34(Plus, {}),
|
|
2011
1924
|
title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2012
1925
|
showMediaAtAllSizes: true,
|
|
2013
1926
|
onClick: () => onAddItem()
|
|
2014
1927
|
}
|
|
2015
1928
|
),
|
|
2016
|
-
error && /* @__PURE__ */
|
|
1929
|
+
error && /* @__PURE__ */ jsx34(InlineAlert2, { type: "negative", children: error })
|
|
2017
1930
|
]
|
|
2018
1931
|
}
|
|
2019
1932
|
),
|
|
2020
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsx34(
|
|
2021
1934
|
Modal2,
|
|
2022
1935
|
{
|
|
2023
1936
|
open: openModalType !== null,
|
|
2024
1937
|
title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
|
|
2025
|
-
body: /* @__PURE__ */
|
|
2026
|
-
/* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */
|
|
2029
|
-
/* @__PURE__ */
|
|
1938
|
+
body: /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1939
|
+
/* @__PURE__ */ jsx34("div", { className: "m-b-2", children: editableItem }),
|
|
1940
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
1941
|
+
/* @__PURE__ */ jsx34(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
|
|
1942
|
+
/* @__PURE__ */ jsx34(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
|
|
2030
1943
|
] })
|
|
2031
1944
|
] }),
|
|
2032
1945
|
onClose: () => onCancelEdit()
|
|
@@ -2038,10 +1951,10 @@ function ItemSummaryOption({
|
|
|
2038
1951
|
item,
|
|
2039
1952
|
onClick
|
|
2040
1953
|
}) {
|
|
2041
|
-
return /* @__PURE__ */
|
|
1954
|
+
return /* @__PURE__ */ jsx34(
|
|
2042
1955
|
NavigationOption2,
|
|
2043
1956
|
{
|
|
2044
|
-
media: /* @__PURE__ */
|
|
1957
|
+
media: /* @__PURE__ */ jsx34(NavigationOptionMedia, __spreadValues({}, item)),
|
|
2045
1958
|
title: item.title,
|
|
2046
1959
|
content: item.description,
|
|
2047
1960
|
showMediaAtAllSizes: true,
|
|
@@ -2052,7 +1965,7 @@ function ItemSummaryOption({
|
|
|
2052
1965
|
var RepeatableRenderer_default = RepeatableRenderer;
|
|
2053
1966
|
|
|
2054
1967
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2055
|
-
import { Input as
|
|
1968
|
+
import { Input as Input4, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
|
|
2056
1969
|
|
|
2057
1970
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2058
1971
|
import { useIntl as useIntl5 } from "react-intl";
|
|
@@ -2078,13 +1991,13 @@ var generic_error_messages_default = defineMessages5({
|
|
|
2078
1991
|
});
|
|
2079
1992
|
|
|
2080
1993
|
// ../renderers/src/SearchRenderer/ErrorResult.tsx
|
|
2081
|
-
import { jsx as
|
|
1994
|
+
import { jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2082
1995
|
function ErrorResult({ state }) {
|
|
2083
1996
|
const intl = useIntl5();
|
|
2084
|
-
return /* @__PURE__ */
|
|
1997
|
+
return /* @__PURE__ */ jsxs10("p", { className: "m-t-2", children: [
|
|
2085
1998
|
intl.formatMessage(generic_error_messages_default.genericError),
|
|
2086
1999
|
"\xA0",
|
|
2087
|
-
/* @__PURE__ */
|
|
2000
|
+
/* @__PURE__ */ jsx35(
|
|
2088
2001
|
"a",
|
|
2089
2002
|
{
|
|
2090
2003
|
href: "/",
|
|
@@ -2099,8 +2012,8 @@ function ErrorResult({ state }) {
|
|
|
2099
2012
|
}
|
|
2100
2013
|
|
|
2101
2014
|
// ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
|
|
2102
|
-
import { useState as
|
|
2103
|
-
import { Fragment as Fragment3, jsx as
|
|
2015
|
+
import { useState as useState6 } from "react";
|
|
2016
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2104
2017
|
function BlockSearchRendererComponent({
|
|
2105
2018
|
id,
|
|
2106
2019
|
isLoading,
|
|
@@ -2110,11 +2023,11 @@ function BlockSearchRendererComponent({
|
|
|
2110
2023
|
state,
|
|
2111
2024
|
title
|
|
2112
2025
|
}) {
|
|
2113
|
-
const [hasSearched, setHasSearched] =
|
|
2026
|
+
const [hasSearched, setHasSearched] = useState6(false);
|
|
2114
2027
|
const trackEvent = useTrackEvent();
|
|
2115
|
-
return /* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
|
|
2028
|
+
return /* @__PURE__ */ jsxs11("div", { className: getMargin(margin), children: [
|
|
2029
|
+
/* @__PURE__ */ jsx36(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx36(
|
|
2030
|
+
Input4,
|
|
2118
2031
|
{
|
|
2119
2032
|
id,
|
|
2120
2033
|
name: id,
|
|
@@ -2130,7 +2043,7 @@ function BlockSearchRendererComponent({
|
|
|
2130
2043
|
}
|
|
2131
2044
|
}
|
|
2132
2045
|
) }),
|
|
2133
|
-
isLoading ? /* @__PURE__ */
|
|
2046
|
+
isLoading ? /* @__PURE__ */ jsx36(Fragment3, { children: "Loading..." }) : /* @__PURE__ */ jsx36(SearchResultContent, { state, onChange })
|
|
2134
2047
|
] });
|
|
2135
2048
|
}
|
|
2136
2049
|
function SearchResultContent({
|
|
@@ -2139,29 +2052,29 @@ function SearchResultContent({
|
|
|
2139
2052
|
}) {
|
|
2140
2053
|
switch (state.type) {
|
|
2141
2054
|
case "error":
|
|
2142
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ jsx36(ErrorResult, { state });
|
|
2143
2056
|
case "results":
|
|
2144
|
-
return /* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ jsx36(SearchResults, { state, onChange });
|
|
2145
2058
|
case "noResults":
|
|
2146
|
-
return /* @__PURE__ */
|
|
2059
|
+
return /* @__PURE__ */ jsx36(EmptySearchResult, { state });
|
|
2147
2060
|
case "pending":
|
|
2148
2061
|
default:
|
|
2149
2062
|
return null;
|
|
2150
2063
|
}
|
|
2151
2064
|
}
|
|
2152
2065
|
function EmptySearchResult({ state }) {
|
|
2153
|
-
return /* @__PURE__ */
|
|
2066
|
+
return /* @__PURE__ */ jsx36(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2154
2067
|
}
|
|
2155
2068
|
function SearchResults({
|
|
2156
2069
|
state
|
|
2157
2070
|
}) {
|
|
2158
2071
|
const trackEvent = useTrackEvent();
|
|
2159
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsx36(NavigationOptionsList2, { children: state.results.map((result) => /* @__PURE__ */ jsx36(
|
|
2160
2073
|
NavigationOption3,
|
|
2161
2074
|
{
|
|
2162
2075
|
title: result.title,
|
|
2163
2076
|
content: result.description,
|
|
2164
|
-
media: /* @__PURE__ */
|
|
2077
|
+
media: /* @__PURE__ */ jsx36(NavigationOptionMedia, __spreadValues({}, result)),
|
|
2165
2078
|
showMediaCircle: false,
|
|
2166
2079
|
showMediaAtAllSizes: true,
|
|
2167
2080
|
onClick: () => {
|
|
@@ -2179,8 +2092,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
|
|
|
2179
2092
|
// ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
|
|
2180
2093
|
import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
|
|
2181
2094
|
import { Search } from "@transferwise/icons";
|
|
2182
|
-
import { useState as
|
|
2183
|
-
import { jsx as
|
|
2095
|
+
import { useState as useState7 } from "react";
|
|
2096
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2184
2097
|
function InlineSearchRenderer({
|
|
2185
2098
|
id,
|
|
2186
2099
|
isLoading,
|
|
@@ -2189,21 +2102,21 @@ function InlineSearchRenderer({
|
|
|
2189
2102
|
state,
|
|
2190
2103
|
title
|
|
2191
2104
|
}) {
|
|
2192
|
-
const [hasSearched, setHasSearched] =
|
|
2105
|
+
const [hasSearched, setHasSearched] = useState7(false);
|
|
2193
2106
|
const trackEvent = useTrackEvent();
|
|
2194
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ jsx37("div", { className: getMargin(margin), children: /* @__PURE__ */ jsxs12(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
|
|
2195
2108
|
id,
|
|
2196
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsx37(
|
|
2197
2110
|
Typeahead,
|
|
2198
2111
|
{
|
|
2199
2112
|
id: "typeahead-input-id",
|
|
2200
2113
|
name: "typeahead-input-name",
|
|
2201
2114
|
size: "md",
|
|
2202
2115
|
maxHeight: 100,
|
|
2203
|
-
footer: /* @__PURE__ */
|
|
2116
|
+
footer: /* @__PURE__ */ jsx37(TypeaheadFooter, { state, isLoading }),
|
|
2204
2117
|
multiple: false,
|
|
2205
2118
|
clearable: false,
|
|
2206
|
-
addon: /* @__PURE__ */
|
|
2119
|
+
addon: /* @__PURE__ */ jsx37(Search, { size: 24 }),
|
|
2207
2120
|
options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
|
|
2208
2121
|
minQueryLength: 1,
|
|
2209
2122
|
onChange: (values) => {
|
|
@@ -2240,29 +2153,29 @@ function mapResultToTypeaheadOption(result) {
|
|
|
2240
2153
|
}
|
|
2241
2154
|
function TypeaheadFooter({ state, isLoading }) {
|
|
2242
2155
|
if (state.type === "noResults") {
|
|
2243
|
-
return /* @__PURE__ */
|
|
2156
|
+
return /* @__PURE__ */ jsx37(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
|
|
2244
2157
|
}
|
|
2245
2158
|
if (state.type === "error") {
|
|
2246
|
-
return /* @__PURE__ */
|
|
2159
|
+
return /* @__PURE__ */ jsx37("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx37(ErrorResult, { state }) });
|
|
2247
2160
|
}
|
|
2248
2161
|
if (state.type === "pending" || isLoading) {
|
|
2249
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ jsx37("p", { className: "m-t-2 m-x-2", children: "Loading..." });
|
|
2250
2163
|
}
|
|
2251
2164
|
return null;
|
|
2252
2165
|
}
|
|
2253
2166
|
var InlineSearchRendererComponent_default = InlineSearchRenderer;
|
|
2254
2167
|
|
|
2255
2168
|
// ../renderers/src/SearchRenderer/SearchRenderer.tsx
|
|
2256
|
-
import { jsx as
|
|
2169
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
2257
2170
|
var SearchRenderer = {
|
|
2258
2171
|
canRenderType: "search",
|
|
2259
|
-
render: (props) => props.control === "inline" ? /* @__PURE__ */
|
|
2172
|
+
render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx38(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx38(BlockSearchRendererComponent_default, __spreadValues({}, props))
|
|
2260
2173
|
};
|
|
2261
2174
|
var SearchRenderer_default = SearchRenderer;
|
|
2262
2175
|
|
|
2263
2176
|
// ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
|
|
2264
2177
|
import { RadioGroup } from "@transferwise/components";
|
|
2265
|
-
import { Fragment as Fragment4, jsx as
|
|
2178
|
+
import { Fragment as Fragment4, jsx as jsx39, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2266
2179
|
function RadioInputRendererComponent(props) {
|
|
2267
2180
|
const {
|
|
2268
2181
|
id,
|
|
@@ -2276,8 +2189,8 @@ function RadioInputRendererComponent(props) {
|
|
|
2276
2189
|
selectedIndex,
|
|
2277
2190
|
onSelect
|
|
2278
2191
|
} = props;
|
|
2279
|
-
return /* @__PURE__ */
|
|
2280
|
-
/* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
2193
|
+
/* @__PURE__ */ jsx39(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx39("span", { children: /* @__PURE__ */ jsx39(
|
|
2281
2194
|
RadioGroup,
|
|
2282
2195
|
{
|
|
2283
2196
|
name: id,
|
|
@@ -2286,7 +2199,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2286
2199
|
value: index,
|
|
2287
2200
|
secondary: option.description,
|
|
2288
2201
|
disabled: option.disabled || disabled,
|
|
2289
|
-
avatar: /* @__PURE__ */
|
|
2202
|
+
avatar: /* @__PURE__ */ jsx39(OptionMedia, { icon: option.icon, image: option.image })
|
|
2290
2203
|
})),
|
|
2291
2204
|
selectedValue: selectedIndex != null ? selectedIndex : void 0,
|
|
2292
2205
|
onChange: onSelect
|
|
@@ -2300,7 +2213,7 @@ function RadioInputRendererComponent(props) {
|
|
|
2300
2213
|
// ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
|
|
2301
2214
|
import { Tabs } from "@transferwise/components";
|
|
2302
2215
|
import { useEffect as useEffect3 } from "react";
|
|
2303
|
-
import { Fragment as Fragment5, jsx as
|
|
2216
|
+
import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2304
2217
|
function TabInputRendererComponent(props) {
|
|
2305
2218
|
const {
|
|
2306
2219
|
id,
|
|
@@ -2319,8 +2232,8 @@ function TabInputRendererComponent(props) {
|
|
|
2319
2232
|
onSelect(0);
|
|
2320
2233
|
}
|
|
2321
2234
|
}, [selectedIndex, onSelect, options.length]);
|
|
2322
|
-
return /* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
2236
|
+
/* @__PURE__ */ jsx40(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx40(
|
|
2324
2237
|
Tabs,
|
|
2325
2238
|
{
|
|
2326
2239
|
name: id,
|
|
@@ -2329,7 +2242,7 @@ function TabInputRendererComponent(props) {
|
|
|
2329
2242
|
title: option.title,
|
|
2330
2243
|
// if we pass null, we get some props-types console errors
|
|
2331
2244
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
2332
|
-
content: /* @__PURE__ */
|
|
2245
|
+
content: /* @__PURE__ */ jsx40(Fragment5, {}),
|
|
2333
2246
|
disabled: option.disabled || disabled
|
|
2334
2247
|
})),
|
|
2335
2248
|
onTabSelect: onSelect
|
|
@@ -2345,22 +2258,22 @@ import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOpt
|
|
|
2345
2258
|
|
|
2346
2259
|
// ../renderers/src/SelectInputRenderer/SelectTriggerMedia.tsx
|
|
2347
2260
|
import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
|
|
2348
|
-
import { jsx as
|
|
2261
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2349
2262
|
function SelectTriggerMedia({ icon, image }) {
|
|
2350
2263
|
if (image == null ? void 0 : image.url) {
|
|
2351
2264
|
return null;
|
|
2352
2265
|
}
|
|
2353
2266
|
if (icon && "name" in icon) {
|
|
2354
|
-
return /* @__PURE__ */
|
|
2267
|
+
return /* @__PURE__ */ jsx41(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx41(DynamicIcon_default, { name: icon.name }) });
|
|
2355
2268
|
}
|
|
2356
2269
|
if (icon && "text" in icon) {
|
|
2357
|
-
return /* @__PURE__ */
|
|
2270
|
+
return /* @__PURE__ */ jsx41(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
|
|
2358
2271
|
}
|
|
2359
2272
|
return null;
|
|
2360
2273
|
}
|
|
2361
2274
|
|
|
2362
2275
|
// ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
|
|
2363
|
-
import { Fragment as Fragment6, jsx as
|
|
2276
|
+
import { Fragment as Fragment6, jsx as jsx42, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2364
2277
|
function SelectInputRendererComponent(props) {
|
|
2365
2278
|
const {
|
|
2366
2279
|
id,
|
|
@@ -2395,16 +2308,16 @@ function SelectInputRendererComponent(props) {
|
|
|
2395
2308
|
const contentProps = withinTrigger ? {
|
|
2396
2309
|
title: option.title,
|
|
2397
2310
|
note: option.description,
|
|
2398
|
-
icon: /* @__PURE__ */
|
|
2311
|
+
icon: /* @__PURE__ */ jsx42(SelectTriggerMedia, { icon: option.icon, image: option.image })
|
|
2399
2312
|
} : {
|
|
2400
2313
|
title: option.title,
|
|
2401
2314
|
description: option.description,
|
|
2402
|
-
icon: /* @__PURE__ */
|
|
2315
|
+
icon: /* @__PURE__ */ jsx42(OptionMedia, { icon: option.icon, image: option.image })
|
|
2403
2316
|
};
|
|
2404
|
-
return /* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ jsx42(SelectInputOptionContent2, __spreadValues({}, contentProps));
|
|
2405
2318
|
};
|
|
2406
|
-
return /* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2319
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
2320
|
+
/* @__PURE__ */ jsx42(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx42(
|
|
2408
2321
|
SelectInput2,
|
|
2409
2322
|
{
|
|
2410
2323
|
name: id,
|
|
@@ -2425,7 +2338,7 @@ function SelectInputRendererComponent(props) {
|
|
|
2425
2338
|
// ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
|
|
2426
2339
|
import { useEffect as useEffect4 } from "react";
|
|
2427
2340
|
import { SegmentedControl } from "@transferwise/components";
|
|
2428
|
-
import { Fragment as Fragment7, jsx as
|
|
2341
|
+
import { Fragment as Fragment7, jsx as jsx43, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2429
2342
|
function SegmentedInputRendererComponent(props) {
|
|
2430
2343
|
const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
|
|
2431
2344
|
useEffect4(() => {
|
|
@@ -2433,8 +2346,8 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2433
2346
|
onSelect(0);
|
|
2434
2347
|
}
|
|
2435
2348
|
}, [selectedIndex, onSelect, options.length]);
|
|
2436
|
-
return /* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsxs16(Fragment7, { children: [
|
|
2350
|
+
/* @__PURE__ */ jsx43(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx43(
|
|
2438
2351
|
SegmentedControl,
|
|
2439
2352
|
{
|
|
2440
2353
|
name: `${id}-segmented-control`,
|
|
@@ -2449,26 +2362,26 @@ function SegmentedInputRendererComponent(props) {
|
|
|
2449
2362
|
onChange: (value) => onSelect(Number(value))
|
|
2450
2363
|
}
|
|
2451
2364
|
) }),
|
|
2452
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ jsx43("div", { id: `${id}-children`, children })
|
|
2453
2366
|
] });
|
|
2454
2367
|
}
|
|
2455
2368
|
var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
|
|
2456
2369
|
|
|
2457
2370
|
// ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
|
|
2458
|
-
import { jsx as
|
|
2371
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2459
2372
|
var SelectInputRenderer = {
|
|
2460
2373
|
canRenderType: "input-select",
|
|
2461
2374
|
render: (props) => {
|
|
2462
2375
|
switch (props.control) {
|
|
2463
2376
|
case "radio":
|
|
2464
|
-
return /* @__PURE__ */
|
|
2377
|
+
return /* @__PURE__ */ jsx44(RadioInputRendererComponent, __spreadValues({}, props));
|
|
2465
2378
|
case "tab":
|
|
2466
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2379
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx44(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx44(TabInputRendererComponent, __spreadValues({}, props));
|
|
2467
2380
|
case "segmented":
|
|
2468
|
-
return props.options.length > 3 ? /* @__PURE__ */
|
|
2381
|
+
return props.options.length > 3 ? /* @__PURE__ */ jsx44(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx44(SegmentedInputRendererComponent, __spreadValues({}, props));
|
|
2469
2382
|
case "select":
|
|
2470
2383
|
default:
|
|
2471
|
-
return /* @__PURE__ */
|
|
2384
|
+
return /* @__PURE__ */ jsx44(SelectInputRendererComponent, __spreadValues({}, props));
|
|
2472
2385
|
}
|
|
2473
2386
|
}
|
|
2474
2387
|
};
|
|
@@ -2476,17 +2389,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
|
|
|
2476
2389
|
|
|
2477
2390
|
// ../renderers/src/StatusListRenderer.tsx
|
|
2478
2391
|
import { Header as Header4, Summary } from "@transferwise/components";
|
|
2479
|
-
import { jsx as
|
|
2392
|
+
import { jsx as jsx45, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2480
2393
|
var StatusListRenderer = {
|
|
2481
2394
|
canRenderType: "status-list",
|
|
2482
|
-
render: ({ margin, items, title }) => /* @__PURE__ */
|
|
2483
|
-
title ? /* @__PURE__ */
|
|
2484
|
-
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */
|
|
2395
|
+
render: ({ margin, items, title }) => /* @__PURE__ */ jsxs17("div", { className: getMargin(margin), children: [
|
|
2396
|
+
title ? /* @__PURE__ */ jsx45(Header4, { title }) : null,
|
|
2397
|
+
items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx45(
|
|
2485
2398
|
Summary,
|
|
2486
2399
|
{
|
|
2487
2400
|
title: itemTitle,
|
|
2488
2401
|
description,
|
|
2489
|
-
icon: icon && "name" in icon ? /* @__PURE__ */
|
|
2402
|
+
icon: icon && "name" in icon ? /* @__PURE__ */ jsx45(DynamicIcon_default, { name: icon.name }) : null,
|
|
2490
2403
|
status: mapStatus(status)
|
|
2491
2404
|
},
|
|
2492
2405
|
`${title}/${description || ""}`
|
|
@@ -2503,37 +2416,37 @@ var mapStatus = (status) => {
|
|
|
2503
2416
|
|
|
2504
2417
|
// ../renderers/src/components/VariableTextInput.tsx
|
|
2505
2418
|
import {
|
|
2506
|
-
Input as
|
|
2419
|
+
Input as Input5,
|
|
2507
2420
|
InputWithDisplayFormat,
|
|
2508
2421
|
PhoneNumberInput as PhoneNumber,
|
|
2509
|
-
TextArea
|
|
2422
|
+
TextArea,
|
|
2510
2423
|
TextareaWithDisplayFormat
|
|
2511
2424
|
} from "@transferwise/components";
|
|
2512
|
-
import { jsx as
|
|
2425
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2513
2426
|
function VariableTextInput({
|
|
2514
2427
|
control,
|
|
2515
2428
|
inputProps
|
|
2516
2429
|
}) {
|
|
2517
2430
|
switch (control) {
|
|
2518
2431
|
case "password":
|
|
2519
|
-
return /* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ jsx46(TextInput, __spreadValues({ type: "password" }, inputProps));
|
|
2520
2433
|
case "email":
|
|
2521
|
-
return /* @__PURE__ */
|
|
2434
|
+
return /* @__PURE__ */ jsx46(TextInput, __spreadValues({ type: "email" }, inputProps));
|
|
2522
2435
|
case "textarea":
|
|
2523
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ jsx46(TextAreaInput, __spreadValues({}, inputProps));
|
|
2524
2437
|
case "numeric":
|
|
2525
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ jsx46(NumericInput, __spreadValues({ type: "number" }, inputProps));
|
|
2526
2439
|
case "phone-number":
|
|
2527
|
-
return /* @__PURE__ */
|
|
2440
|
+
return /* @__PURE__ */ jsx46(PhoneNumberInput, __spreadValues({}, inputProps));
|
|
2528
2441
|
default:
|
|
2529
|
-
return /* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ jsx46(TextInput, __spreadValues({ type: "text" }, inputProps));
|
|
2530
2443
|
}
|
|
2531
2444
|
}
|
|
2532
2445
|
function TextInput(_a) {
|
|
2533
2446
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2534
2447
|
if (typeof displayFormat === "string") {
|
|
2535
2448
|
const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
|
|
2536
|
-
return /* @__PURE__ */
|
|
2449
|
+
return /* @__PURE__ */ jsx46(
|
|
2537
2450
|
InputWithDisplayFormat,
|
|
2538
2451
|
__spreadValues({
|
|
2539
2452
|
displayPattern: displayFormat,
|
|
@@ -2541,30 +2454,30 @@ function TextInput(_a) {
|
|
|
2541
2454
|
}, inputProps)
|
|
2542
2455
|
);
|
|
2543
2456
|
}
|
|
2544
|
-
return /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ jsx46(Input5, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
|
|
2545
2458
|
}
|
|
2546
2459
|
function TextAreaInput(_a) {
|
|
2547
2460
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2548
2461
|
const textAreaProps = __spreadValues({ id, name: id }, rest);
|
|
2549
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
2462
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx46(
|
|
2550
2463
|
TextareaWithDisplayFormat,
|
|
2551
2464
|
__spreadValues({
|
|
2552
2465
|
displayPattern: displayFormat,
|
|
2553
2466
|
onChange: (newValue) => onChange(newValue)
|
|
2554
2467
|
}, textAreaProps)
|
|
2555
|
-
) : /* @__PURE__ */
|
|
2468
|
+
) : /* @__PURE__ */ jsx46(TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
|
|
2556
2469
|
}
|
|
2557
2470
|
function NumericInput(_a) {
|
|
2558
2471
|
var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
|
|
2559
2472
|
const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
|
|
2560
|
-
return typeof displayFormat === "string" ? /* @__PURE__ */
|
|
2473
|
+
return typeof displayFormat === "string" ? /* @__PURE__ */ jsx46(
|
|
2561
2474
|
InputWithDisplayFormat,
|
|
2562
2475
|
__spreadValues({
|
|
2563
2476
|
displayPattern: displayFormat,
|
|
2564
2477
|
onChange: (newValue) => onChange(numericValueOrNull(newValue))
|
|
2565
2478
|
}, numericProps)
|
|
2566
|
-
) : /* @__PURE__ */
|
|
2567
|
-
|
|
2479
|
+
) : /* @__PURE__ */ jsx46(
|
|
2480
|
+
Input5,
|
|
2568
2481
|
__spreadValues({
|
|
2569
2482
|
onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
|
|
2570
2483
|
}, numericProps)
|
|
@@ -2572,12 +2485,12 @@ function NumericInput(_a) {
|
|
|
2572
2485
|
}
|
|
2573
2486
|
function PhoneNumberInput(_a) {
|
|
2574
2487
|
var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
|
|
2575
|
-
return /* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ jsx46(PhoneNumber, __spreadValues({ initialValue: value }, rest));
|
|
2576
2489
|
}
|
|
2577
2490
|
var VariableTextInput_default = VariableTextInput;
|
|
2578
2491
|
|
|
2579
2492
|
// ../renderers/src/TextInputRenderer.tsx
|
|
2580
|
-
import { jsx as
|
|
2493
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2581
2494
|
var TextInputRenderer = {
|
|
2582
2495
|
canRenderType: "input-text",
|
|
2583
2496
|
render: (props) => {
|
|
@@ -2602,14 +2515,14 @@ var TextInputRenderer = {
|
|
|
2602
2515
|
]);
|
|
2603
2516
|
const value = initialValue != null ? initialValue : "";
|
|
2604
2517
|
const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
|
|
2605
|
-
return /* @__PURE__ */
|
|
2518
|
+
return /* @__PURE__ */ jsx47(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx47(VariableTextInput_default, { control, inputProps }) });
|
|
2606
2519
|
}
|
|
2607
2520
|
};
|
|
2608
2521
|
var TextInputRenderer_default = TextInputRenderer;
|
|
2609
2522
|
|
|
2610
2523
|
// ../renderers/src/UploadInputRenderer.tsx
|
|
2611
2524
|
import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
|
|
2612
|
-
import { jsx as
|
|
2525
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2613
2526
|
var UploadInputRenderer = {
|
|
2614
2527
|
canRenderType: "input-upload",
|
|
2615
2528
|
render: (props) => {
|
|
@@ -2625,7 +2538,7 @@ var UploadInputRenderer = {
|
|
|
2625
2538
|
};
|
|
2626
2539
|
return (
|
|
2627
2540
|
// We don't pass help here as there is no sensible place to display it
|
|
2628
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ jsx48(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx48(
|
|
2629
2542
|
UploadInput2,
|
|
2630
2543
|
{
|
|
2631
2544
|
id,
|
|
@@ -2680,7 +2593,7 @@ var LargeUploadRenderer = {
|
|
|
2680
2593
|
throw e;
|
|
2681
2594
|
}
|
|
2682
2595
|
};
|
|
2683
|
-
return /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ jsx48(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx48(
|
|
2684
2597
|
Upload,
|
|
2685
2598
|
__spreadProps(__spreadValues({}, uploadProps), {
|
|
2686
2599
|
usAccept: getAcceptsString(accepts),
|
|
@@ -2695,7 +2608,7 @@ var LargeUploadRenderer = {
|
|
|
2695
2608
|
|
|
2696
2609
|
// ../renderers/src/ReviewRenderer.tsx
|
|
2697
2610
|
import { DefinitionList, Header as Header5 } from "@transferwise/components";
|
|
2698
|
-
import { Fragment as Fragment8, jsx as
|
|
2611
|
+
import { Fragment as Fragment8, jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2699
2612
|
var ReviewRenderer = {
|
|
2700
2613
|
canRenderType: "review",
|
|
2701
2614
|
render: ({ callToAction, control, fields, margin, title }) => {
|
|
@@ -2707,9 +2620,9 @@ var ReviewRenderer = {
|
|
|
2707
2620
|
callToAction.onClick();
|
|
2708
2621
|
}
|
|
2709
2622
|
} : void 0;
|
|
2710
|
-
return /* @__PURE__ */
|
|
2711
|
-
(title || callToAction) && /* @__PURE__ */
|
|
2712
|
-
/* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
|
|
2624
|
+
(title || callToAction) && /* @__PURE__ */ jsx49(Header5, { title: title != null ? title : "", action }),
|
|
2625
|
+
/* @__PURE__ */ jsx49("div", { className: margin, children: /* @__PURE__ */ jsx49(
|
|
2713
2626
|
DefinitionList,
|
|
2714
2627
|
{
|
|
2715
2628
|
layout: orientation,
|
|
@@ -2741,14 +2654,14 @@ var mapControlToDefinitionListLayout = (control) => {
|
|
|
2741
2654
|
};
|
|
2742
2655
|
var getFieldValue = (value, help, orientation) => {
|
|
2743
2656
|
if (help) {
|
|
2744
|
-
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2657
|
+
return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
2658
|
+
/* @__PURE__ */ jsx49(Help_default, { help }),
|
|
2746
2659
|
" ",
|
|
2747
2660
|
value
|
|
2748
|
-
] }) : /* @__PURE__ */
|
|
2661
|
+
] }) : /* @__PURE__ */ jsxs18(Fragment8, { children: [
|
|
2749
2662
|
value,
|
|
2750
2663
|
" ",
|
|
2751
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ jsx49(Help_default, { help })
|
|
2752
2665
|
] });
|
|
2753
2666
|
}
|
|
2754
2667
|
return value;
|
|
@@ -2787,17 +2700,17 @@ var external_confirmation_messages_default = defineMessages6({
|
|
|
2787
2700
|
|
|
2788
2701
|
// ../renderers/src/step/ExternalConfirmationDialog.tsx
|
|
2789
2702
|
import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
|
|
2790
|
-
import { jsx as
|
|
2703
|
+
import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2791
2704
|
function ExternalConfirmationDialog({
|
|
2792
2705
|
external,
|
|
2793
2706
|
onClose
|
|
2794
2707
|
}) {
|
|
2795
2708
|
const { formatMessage } = useIntl6();
|
|
2796
|
-
return /* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
|
|
2710
|
+
/* @__PURE__ */ jsx50("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
|
|
2711
|
+
/* @__PURE__ */ jsx50(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
|
|
2712
|
+
/* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
|
|
2713
|
+
/* @__PURE__ */ jsx50(
|
|
2801
2714
|
Button5,
|
|
2802
2715
|
{
|
|
2803
2716
|
block: true,
|
|
@@ -2811,7 +2724,7 @@ function ExternalConfirmationDialog({
|
|
|
2811
2724
|
children: formatMessage(external_confirmation_messages_default.open)
|
|
2812
2725
|
}
|
|
2813
2726
|
),
|
|
2814
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx50(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
|
|
2815
2728
|
] }) })
|
|
2816
2729
|
] }) });
|
|
2817
2730
|
}
|
|
@@ -2824,10 +2737,10 @@ function getOrigin(url) {
|
|
|
2824
2737
|
}
|
|
2825
2738
|
|
|
2826
2739
|
// ../renderers/src/step/useExternal.tsx
|
|
2827
|
-
import { useEffect as useEffect5, useState as
|
|
2740
|
+
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
2828
2741
|
function useExternal(url) {
|
|
2829
|
-
const [externalWindow, setExternalWindow] =
|
|
2830
|
-
const [hasDismissed, setHasDismissed] =
|
|
2742
|
+
const [externalWindow, setExternalWindow] = useState8(null);
|
|
2743
|
+
const [hasDismissed, setHasDismissed] = useState8(false);
|
|
2831
2744
|
const dismissConfirmation = () => setHasDismissed(true);
|
|
2832
2745
|
useEffect5(() => {
|
|
2833
2746
|
if (url) {
|
|
@@ -2842,9 +2755,9 @@ function useExternal(url) {
|
|
|
2842
2755
|
// ../renderers/src/step/BackButton.tsx
|
|
2843
2756
|
import { Avatar as Avatar4 } from "@transferwise/components";
|
|
2844
2757
|
import { ArrowLeft } from "@transferwise/icons";
|
|
2845
|
-
import { jsx as
|
|
2758
|
+
import { jsx as jsx51, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2846
2759
|
function BackButton({ title, onClick }) {
|
|
2847
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ jsxs20(
|
|
2848
2761
|
"a",
|
|
2849
2762
|
{
|
|
2850
2763
|
href: "/",
|
|
@@ -2855,8 +2768,8 @@ function BackButton({ title, onClick }) {
|
|
|
2855
2768
|
onClick();
|
|
2856
2769
|
},
|
|
2857
2770
|
children: [
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: title }),
|
|
2772
|
+
/* @__PURE__ */ jsx51(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx51(ArrowLeft, { size: "24" }) })
|
|
2860
2773
|
]
|
|
2861
2774
|
}
|
|
2862
2775
|
);
|
|
@@ -2865,7 +2778,7 @@ var BackButton_default = BackButton;
|
|
|
2865
2778
|
|
|
2866
2779
|
// ../renderers/src/step/StepRenderer.tsx
|
|
2867
2780
|
import { Alert as Alert2 } from "@transferwise/components";
|
|
2868
|
-
import { jsx as
|
|
2781
|
+
import { jsx as jsx52, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2869
2782
|
var StepRenderer = {
|
|
2870
2783
|
canRenderType: "step",
|
|
2871
2784
|
render: StepRendererComponent
|
|
@@ -2875,13 +2788,13 @@ function StepRendererComponent(props) {
|
|
|
2875
2788
|
const value = useMemo(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
|
|
2876
2789
|
const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
|
|
2877
2790
|
if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
|
|
2878
|
-
return /* @__PURE__ */
|
|
2791
|
+
return /* @__PURE__ */ jsx52(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
|
|
2879
2792
|
}
|
|
2880
|
-
return /* @__PURE__ */
|
|
2881
|
-
back ? /* @__PURE__ */
|
|
2882
|
-
title ? /* @__PURE__ */
|
|
2883
|
-
description ? /* @__PURE__ */
|
|
2884
|
-
error ? /* @__PURE__ */
|
|
2793
|
+
return /* @__PURE__ */ jsxs21(StepRendererContextProvider, { value, children: [
|
|
2794
|
+
back ? /* @__PURE__ */ jsx52(BackButton_default, __spreadValues({}, back)) : null,
|
|
2795
|
+
title ? /* @__PURE__ */ jsx52("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
|
|
2796
|
+
description ? /* @__PURE__ */ jsx52("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
|
|
2797
|
+
error ? /* @__PURE__ */ jsx52(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
|
|
2885
2798
|
children
|
|
2886
2799
|
] });
|
|
2887
2800
|
}
|
|
@@ -2921,26 +2834,26 @@ var getWiseRenderers = () => [
|
|
|
2921
2834
|
];
|
|
2922
2835
|
|
|
2923
2836
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
2924
|
-
import { jsx as
|
|
2837
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2925
2838
|
var wiseRenderers = getWiseRenderers();
|
|
2926
2839
|
function DynamicFlowLegacy(props) {
|
|
2927
2840
|
const { customFetch = globalThis.fetch } = props;
|
|
2928
2841
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
2929
|
-
return /* @__PURE__ */
|
|
2842
|
+
return /* @__PURE__ */ jsx53(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
|
|
2930
2843
|
}
|
|
2931
2844
|
function DynamicFlowRevamp(props) {
|
|
2932
2845
|
const { customFetch = globalThis.fetch, renderers } = props;
|
|
2933
2846
|
const httpClient = useWiseHttpClient(customFetch);
|
|
2934
2847
|
const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
2935
2848
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers });
|
|
2936
|
-
return /* @__PURE__ */
|
|
2849
|
+
return /* @__PURE__ */ jsx53(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx53(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
2937
2850
|
}
|
|
2938
|
-
var DynamicFragment =
|
|
2851
|
+
var DynamicFragment = forwardRef2(function DynamicFragment2(props, ref) {
|
|
2939
2852
|
const { customFetch = globalThis.fetch, renderers } = props;
|
|
2940
2853
|
const httpClient = useWiseHttpClient(customFetch);
|
|
2941
2854
|
const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
|
|
2942
2855
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient, renderers: mergedRenderers });
|
|
2943
|
-
return /* @__PURE__ */
|
|
2856
|
+
return /* @__PURE__ */ jsx53(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx53(DynamicFragmentCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
2944
2857
|
});
|
|
2945
2858
|
var useWiseHttpClient = (httpClient) => {
|
|
2946
2859
|
const { locale } = useIntl7();
|