@wise/dynamic-flow-client-internal 4.24.1-experimental-5566f24 → 4.25.0-experimental-5356389

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 CHANGED
@@ -62,10 +62,11 @@ __export(index_exports, {
62
62
  DynamicFlowLegacy: () => DynamicFlowLegacy,
63
63
  DynamicFlowRevamp: () => DynamicFlowRevamp,
64
64
  DynamicForm: () => DynamicForm,
65
- Header: () => Header7,
65
+ Header: () => Header11,
66
66
  JsonSchemaForm: () => import_dynamic_flow_client4.JsonSchemaForm,
67
67
  findRendererPropsByType: () => import_dynamic_flow_client4.findRendererPropsByType,
68
- getMargin: () => getMargin,
68
+ getListItemRenderers: () => getListItemRenderers,
69
+ getMargin: () => getMargin2,
69
70
  isValidSchema: () => import_dynamic_flow_client4.isValidSchema,
70
71
  makeCustomFetch: () => import_dynamic_flow_client3.makeHttpClient,
71
72
  translations: () => i18n_default
@@ -312,7 +313,6 @@ function Help({ help, onClick }) {
312
313
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
313
314
  import_components4.Info,
314
315
  {
315
- className: "m-l-1",
316
316
  content: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components4.Markdown, { config: { link: { target: "_blank" } }, children: help }),
317
317
  presentation: "POPOVER",
318
318
  size: "sm",
@@ -530,86 +530,6 @@ var DateInputRenderer_default = DateInputRenderer;
530
530
 
531
531
  // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
532
532
  var import_components14 = require("@transferwise/components");
533
- var import_react_intl7 = require("react-intl");
534
-
535
- // ../renderers/src/messages/decision.messages.ts
536
- var import_react_intl5 = require("react-intl");
537
- var decision_messages_default = (0, import_react_intl5.defineMessages)({
538
- all: {
539
- id: "df.wise.Decision.all",
540
- defaultMessage: "All",
541
- description: "Label for the group of options that encompasses all options"
542
- },
543
- popular: {
544
- id: "df.wise.Decision.popular",
545
- defaultMessage: "Popular",
546
- description: "Label for the group of options that are tagged as popular"
547
- },
548
- recent: {
549
- id: "df.wise.Decision.recent",
550
- defaultMessage: "Recent",
551
- description: "Label for the group of options that are tagged as recent"
552
- },
553
- filterPlaceholder: {
554
- id: "df.wise.Decision.filterPlaceholder",
555
- defaultMessage: "Start typing to search",
556
- description: "Placeholder for the filter input"
557
- },
558
- results: {
559
- id: "df.wise.Decision.results",
560
- defaultMessage: "Search results",
561
- description: "Label for the results section"
562
- },
563
- noResults: {
564
- id: "df.wise.Decision.noResults",
565
- defaultMessage: "No results",
566
- description: "Message for if there are no results"
567
- }
568
- });
569
-
570
- // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
571
- var import_react3 = require("react");
572
-
573
- // ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
574
- function filterAndSortDecisionOptions(selectOptions, query) {
575
- const upperQuery = query.toUpperCase().trim();
576
- const filteredItems = selectOptions.filter((option) => {
577
- var _a, _b, _c, _d;
578
- const searchableWords = [
579
- option.title,
580
- option.description,
581
- option.additionalText,
582
- (_a = option.supportingValues) == null ? void 0 : _a.value,
583
- (_b = option.supportingValues) == null ? void 0 : _b.subvalue,
584
- ...(_c = option.keywords) != null ? _c : []
585
- ];
586
- return (_d = searchableWords.some((word) => word == null ? void 0 : word.toUpperCase().includes(upperQuery))) != null ? _d : false;
587
- });
588
- return [...filteredItems].sort((a, b) => {
589
- const aTitleUpper = a.title.toUpperCase();
590
- const bTitleUpper = b.title.toUpperCase();
591
- const aTitleStarts = aTitleUpper.startsWith(upperQuery);
592
- const bTitleStarts = bTitleUpper.startsWith(upperQuery);
593
- if (aTitleStarts && !bTitleStarts) {
594
- return -1;
595
- }
596
- if (!aTitleStarts && bTitleStarts) {
597
- return 1;
598
- }
599
- const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
600
- const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
601
- if (aWordStarts && !bWordStarts) {
602
- return -1;
603
- }
604
- if (!aWordStarts && bWordStarts) {
605
- return 1;
606
- }
607
- return a.title.localeCompare(b.title);
608
- });
609
- }
610
-
611
- // ../renderers/src/DecisionRenderer/DecisionList.tsx
612
- var import_components12 = require("@transferwise/components");
613
533
 
614
534
  // ../renderers/src/utils/UrnFlag.tsx
615
535
  var import_art = require("@wise/art");
@@ -874,64 +794,71 @@ var import_jsx_runtime22 = require("react/jsx-runtime");
874
794
  var getInlineMedia = (media) => media ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Media, { media, preferAvatar: false, size: 24 }) : null;
875
795
 
876
796
  // ../renderers/src/DecisionRenderer/DecisionList.tsx
877
- var import_jsx_runtime23 = require("react/jsx-runtime");
878
- var DecisionList = ({
879
- options,
880
- control,
881
- className
882
- }) => {
883
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.NavigationOptionsList, { children: options.map((option) => {
884
- const { description, disabled, media, title: itemTitle, tag, onClick } = option;
885
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
886
- import_components12.NavigationOption,
887
- {
888
- title: itemTitle,
889
- content: description,
890
- disabled,
891
- media: media ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
892
- OptionMedia,
893
- {
894
- media,
895
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
896
- }
897
- ) : null,
898
- showMediaCircle: false,
899
- showMediaAtAllSizes: true,
900
- onClick
901
- },
902
- JSON.stringify(option)
903
- );
904
- }) }) });
905
- };
906
- var DecisionList_default = DecisionList;
797
+ var import_components13 = require("@transferwise/components");
907
798
 
908
799
  // ../renderers/src/DecisionRenderer/GroupedList.tsx
909
- var import_components13 = require("@transferwise/components");
800
+ var import_components12 = require("@transferwise/components");
910
801
  var import_react_intl6 = require("react-intl");
911
- var import_jsx_runtime24 = require("react/jsx-runtime");
802
+
803
+ // ../renderers/src/messages/decision.messages.ts
804
+ var import_react_intl5 = require("react-intl");
805
+ var decision_messages_default = (0, import_react_intl5.defineMessages)({
806
+ all: {
807
+ id: "df.wise.Decision.all",
808
+ defaultMessage: "All",
809
+ description: "Label for the group of options that encompasses all options"
810
+ },
811
+ popular: {
812
+ id: "df.wise.Decision.popular",
813
+ defaultMessage: "Popular",
814
+ description: "Label for the group of options that are tagged as popular"
815
+ },
816
+ recent: {
817
+ id: "df.wise.Decision.recent",
818
+ defaultMessage: "Recent",
819
+ description: "Label for the group of options that are tagged as recent"
820
+ },
821
+ filterPlaceholder: {
822
+ id: "df.wise.Decision.filterPlaceholder",
823
+ defaultMessage: "Start typing to search",
824
+ description: "Placeholder for the filter input"
825
+ },
826
+ results: {
827
+ id: "df.wise.Decision.results",
828
+ defaultMessage: "Search results",
829
+ description: "Label for the results section"
830
+ },
831
+ noResults: {
832
+ id: "df.wise.Decision.noResults",
833
+ defaultMessage: "No results",
834
+ description: "Message for if there are no results"
835
+ }
836
+ });
837
+
838
+ // ../renderers/src/DecisionRenderer/GroupedList.tsx
839
+ var import_jsx_runtime23 = require("react/jsx-runtime");
912
840
  var OPTION_GROUPS = {
913
841
  popular: "popular",
914
842
  recent: "recent"
915
843
  };
916
- var GroupedList = ({
917
- options,
918
- control
919
- }) => {
844
+ var GroupedList = (_a) => {
845
+ var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
920
846
  const { formatMessage } = (0, import_react_intl6.useIntl)();
847
+ const { options } = rest;
921
848
  const popularOptions = options.filter((option) => option.tag === OPTION_GROUPS.popular);
922
849
  const recentOptions = options.filter((option) => option.tag === OPTION_GROUPS.recent);
923
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
924
- popularOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_components13.Section, { children: [
925
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Header, { as: "h2", title: formatMessage(decision_messages_default.popular) }),
926
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DecisionList_default, { options: popularOptions, control })
850
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
851
+ popularOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_components12.Section, { children: [
852
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { as: "h2", title: formatMessage(decision_messages_default.popular) }),
853
+ renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
927
854
  ] }) : null,
928
- recentOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_components13.Section, { children: [
929
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Header, { as: "h2", title: formatMessage(decision_messages_default.recent) }),
930
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DecisionList_default, { options: recentOptions, control })
855
+ recentOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_components12.Section, { children: [
856
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { as: "h2", title: formatMessage(decision_messages_default.recent) }),
857
+ renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
931
858
  ] }) : null,
932
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_components13.Section, { children: [
933
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Header, { as: "h2", title: formatMessage(decision_messages_default.all) }),
934
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DecisionList_default, { options, control })
859
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_components12.Section, { children: [
860
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { as: "h2", title: formatMessage(decision_messages_default.all) }),
861
+ renderDecisionList3(rest)
935
862
  ] })
936
863
  ] });
937
864
  };
@@ -940,26 +867,69 @@ var isGroupedDecision = (options) => {
940
867
  return options.some(({ tag }) => tag && possibleGroups.includes(tag));
941
868
  };
942
869
 
943
- // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
944
- var import_jsx_runtime25 = require("react/jsx-runtime");
945
- var DecisionRenderer = {
946
- canRenderType: "decision",
947
- render: (props) => {
948
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getMargin(props.margin), children: [
949
- props.title && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components14.Header, { as: "h2", title: props.title }),
950
- props.control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
951
- ] });
952
- }
870
+ // ../renderers/src/DecisionRenderer/DecisionList.tsx
871
+ var import_react_intl7 = require("react-intl");
872
+ var import_react3 = require("react");
873
+
874
+ // ../renderers/src/DecisionRenderer/filter-and-sort-decision-options.ts
875
+ function filterAndSortDecisionOptions(selectOptions, query) {
876
+ const upperQuery = query.toUpperCase().trim();
877
+ const filteredItems = selectOptions.filter((option) => {
878
+ var _a, _b, _c, _d;
879
+ const searchableWords = [
880
+ option.title,
881
+ option.description,
882
+ option.additionalText,
883
+ (_a = option.supportingValues) == null ? void 0 : _a.value,
884
+ (_b = option.supportingValues) == null ? void 0 : _b.subvalue,
885
+ ...(_c = option.keywords) != null ? _c : []
886
+ ];
887
+ return (_d = searchableWords.some((word) => word == null ? void 0 : word.toUpperCase().includes(upperQuery))) != null ? _d : false;
888
+ });
889
+ return [...filteredItems].sort((a, b) => {
890
+ const aTitleUpper = a.title.toUpperCase();
891
+ const bTitleUpper = b.title.toUpperCase();
892
+ const aTitleStarts = aTitleUpper.startsWith(upperQuery);
893
+ const bTitleStarts = bTitleUpper.startsWith(upperQuery);
894
+ if (aTitleStarts && !bTitleStarts) {
895
+ return -1;
896
+ }
897
+ if (!aTitleStarts && bTitleStarts) {
898
+ return 1;
899
+ }
900
+ const aWordStarts = aTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
901
+ const bWordStarts = bTitleUpper.split(" ").some((word) => word.startsWith(upperQuery));
902
+ if (aWordStarts && !bWordStarts) {
903
+ return -1;
904
+ }
905
+ if (!aWordStarts && bWordStarts) {
906
+ return 1;
907
+ }
908
+ return a.title.localeCompare(b.title);
909
+ });
910
+ }
911
+
912
+ // ../renderers/src/DecisionRenderer/DecisionList.tsx
913
+ var import_jsx_runtime24 = require("react/jsx-runtime");
914
+ var DecisionWrapper = (props) => {
915
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getMargin(props.margin), children: [
916
+ props.title && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Header, { as: "h2", title: props.title }),
917
+ props.control === "filtered" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FilteredDecisionList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UnfilteredDecisionList, __spreadValues({}, props))
918
+ ] });
953
919
  };
954
- var UnfilteredDecisionList = ({ control, options }) => isGroupedDecision(options) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GroupedList, { options, control }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DecisionList_default, { options, control });
955
- var FilteredDecisionList = ({ options, control }) => {
920
+ var UnfilteredDecisionList = (_a) => {
921
+ var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
922
+ return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList3 })) : renderDecisionList3(rest);
923
+ };
924
+ var FilteredDecisionList = (props) => {
956
925
  const { formatMessage } = (0, import_react_intl7.useIntl)();
957
926
  const [query, setQuery] = (0, import_react3.useState)("");
927
+ const { control, options, renderDecisionList: renderDecisionList3 } = props;
958
928
  const filteredOptions = filterAndSortDecisionOptions(options, query);
959
929
  const isGrouped = isGroupedDecision(options);
960
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
961
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
962
- import_components14.SearchInput,
930
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
931
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
932
+ import_components13.SearchInput,
963
933
  {
964
934
  placeholder: formatMessage(decision_messages_default.filterPlaceholder),
965
935
  value: query,
@@ -969,19 +939,49 @@ var FilteredDecisionList = ({ options, control }) => {
969
939
  }
970
940
  }
971
941
  ),
972
- isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GroupedList, { options, control }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
973
- query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components14.Header, { as: "h2", title: formatMessage(decision_messages_default.results), className: "m-t-4" }),
974
- filteredOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
975
- DecisionList_default,
976
- {
977
- options: filteredOptions,
978
- control,
979
- className: query.length === 0 ? "m-t-3" : ""
980
- }
981
- ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: formatMessage(decision_messages_default.noResults) })
942
+ isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GroupedList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
943
+ query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Header, { as: "h2", title: formatMessage(decision_messages_default.results), className: "m-t-4" }),
944
+ filteredOptions.length > 0 ? renderDecisionList3({
945
+ control,
946
+ className: query.length === 0 ? "m-t-3" : "",
947
+ options: filteredOptions
948
+ }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: formatMessage(decision_messages_default.noResults) })
982
949
  ] })
983
950
  ] });
984
951
  };
952
+
953
+ // ../renderers/src/DecisionRenderer/DecisionRenderer.tsx
954
+ var import_jsx_runtime25 = require("react/jsx-runtime");
955
+ var DecisionRenderer = {
956
+ canRenderType: "decision",
957
+ render: (props) => {
958
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList }));
959
+ }
960
+ };
961
+ var renderDecisionList = ({ options, className, control }) => {
962
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components14.NavigationOptionsList, { children: options.map((option) => {
963
+ const { description, disabled, media, title: itemTitle, tag, onClick } = option;
964
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
965
+ import_components14.NavigationOption,
966
+ {
967
+ title: itemTitle,
968
+ content: description,
969
+ disabled,
970
+ media: media ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
971
+ OptionMedia,
972
+ {
973
+ media,
974
+ preferAvatar: control === "with-avatar" || tag === "with-avatar"
975
+ }
976
+ ) : null,
977
+ showMediaCircle: false,
978
+ showMediaAtAllSizes: true,
979
+ onClick
980
+ },
981
+ JSON.stringify(option)
982
+ );
983
+ }) }) });
984
+ };
985
985
  var DecisionRenderer_default = DecisionRenderer;
986
986
 
987
987
  // ../renderers/src/DividerRenderer.tsx
@@ -2102,11 +2102,10 @@ var ReviewRenderer = {
2102
2102
  definitions: fields.map(
2103
2103
  ({ label, value, help, analyticsId: fieldAnalyticsId }, index) => ({
2104
2104
  key: String(index),
2105
- title: label,
2106
- value: getFieldValue(
2107
- value,
2105
+ value,
2106
+ title: getFieldLabel(
2107
+ label,
2108
2108
  help,
2109
- orientation,
2110
2109
  () => trackEvent("Help Pressed", { layoutItemId: fieldAnalyticsId })
2111
2110
  )
2112
2111
  })
@@ -2132,19 +2131,15 @@ var mapControlToDefinitionListLayout = (control) => {
2132
2131
  return "VERTICAL_ONE_COLUMN";
2133
2132
  }
2134
2133
  };
2135
- var getFieldValue = (value, help, orientation, onClick) => {
2134
+ var getFieldLabel = (label, help, onClick) => {
2136
2135
  if (help) {
2137
- return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
2138
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Help_default, { help, onClick }),
2139
- " ",
2140
- value
2141
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
2142
- value,
2136
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
2137
+ label,
2143
2138
  " ",
2144
2139
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Help_default, { help, onClick })
2145
2140
  ] });
2146
2141
  }
2147
- return value;
2142
+ return label;
2148
2143
  };
2149
2144
 
2150
2145
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
@@ -3152,7 +3147,237 @@ var LargeUploadRenderer = {
3152
3147
  }
3153
3148
  };
3154
3149
 
3150
+ // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3151
+ var import_components53 = require("@transferwise/components");
3152
+
3153
+ // ../renderers/src/NewListItem/getInlineAlert.tsx
3154
+ var import_components51 = require("@transferwise/components");
3155
+ var import_jsx_runtime73 = require("react/jsx-runtime");
3156
+ var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components51.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
3157
+
3158
+ // ../renderers/src/NewListItem/getMedia.tsx
3159
+ var import_jsx_runtime74 = require("react/jsx-runtime");
3160
+ var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
3161
+
3162
+ // ../renderers/src/NewListItem/getAdditionalInfo.tsx
3163
+ var import_components52 = require("@transferwise/components");
3164
+ var import_jsx_runtime75 = require("react/jsx-runtime");
3165
+ var getAdditionalInfo = (additionalInfo) => {
3166
+ if (!additionalInfo) {
3167
+ return void 0;
3168
+ }
3169
+ const { href, text, onClick } = additionalInfo;
3170
+ if (href || onClick) {
3171
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
3172
+ import_components52.ListItem.AdditionalInfo,
3173
+ {
3174
+ action: {
3175
+ label: text,
3176
+ href,
3177
+ onClick,
3178
+ target: "_blank"
3179
+ }
3180
+ }
3181
+ );
3182
+ }
3183
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components52.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
3184
+ };
3185
+
3186
+ // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3187
+ var import_jsx_runtime76 = require("react/jsx-runtime");
3188
+ var DecisionRenderer2 = {
3189
+ canRenderType: "decision",
3190
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList: renderDecisionList2 }))
3191
+ };
3192
+ var renderDecisionList2 = ({ options, control }) => {
3193
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_jsx_runtime76.Fragment, { children: options.map((option) => {
3194
+ const {
3195
+ description,
3196
+ disabled,
3197
+ media,
3198
+ title: itemTitle,
3199
+ tag,
3200
+ href,
3201
+ additionalText,
3202
+ inlineAlert,
3203
+ supportingValues,
3204
+ onClick
3205
+ } = option;
3206
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
3207
+ import_components53.ListItem,
3208
+ {
3209
+ title: itemTitle,
3210
+ subtitle: description,
3211
+ spotlight: control === "spotlight" ? tag === "spotlight-active" ? "active" : "inactive" : void 0,
3212
+ disabled,
3213
+ valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3214
+ valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3215
+ media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3216
+ prompt: getInlineAlert(inlineAlert),
3217
+ additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
3218
+ control: href ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components53.ListItem.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components53.ListItem.Navigation, { onClick })
3219
+ },
3220
+ JSON.stringify(option)
3221
+ );
3222
+ }) });
3223
+ };
3224
+ var NewDecisionRenderer_default = DecisionRenderer2;
3225
+
3226
+ // ../renderers/src/NewListItem/NewListRenderer.tsx
3227
+ var import_components54 = require("@transferwise/components");
3228
+ var import_jsx_runtime77 = require("react/jsx-runtime");
3229
+ var ListRenderer2 = {
3230
+ canRenderType: "list",
3231
+ render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: getMargin(margin), children: [
3232
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Header7, { title, callToAction }),
3233
+ items.map((item) => {
3234
+ const {
3235
+ title: itemTitle,
3236
+ description,
3237
+ supportingValues,
3238
+ media,
3239
+ tag,
3240
+ additionalInfo,
3241
+ inlineAlert
3242
+ } = item;
3243
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
3244
+ import_components54.ListItem,
3245
+ {
3246
+ title: itemTitle,
3247
+ subtitle: description,
3248
+ valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3249
+ valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3250
+ media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3251
+ prompt: getInlineAlert(inlineAlert),
3252
+ additionalInfo: getAdditionalInfo(additionalInfo)
3253
+ },
3254
+ itemTitle
3255
+ );
3256
+ })
3257
+ ] })
3258
+ };
3259
+ var NewListRenderer_default = ListRenderer2;
3260
+
3261
+ // ../renderers/src/NewListItem/NewReviewRenderer.tsx
3262
+ var import_components55 = require("@transferwise/components");
3263
+ var import_icons4 = require("@transferwise/icons");
3264
+ var import_jsx_runtime78 = require("react/jsx-runtime");
3265
+ var IGNORED_CONTROLS = [
3266
+ "horizontal",
3267
+ "horizontal-end-aligned",
3268
+ "horizontal-start-aligned",
3269
+ "vertical-two-column"
3270
+ ];
3271
+ var ReviewRenderer2 = {
3272
+ canRenderType: "review",
3273
+ canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
3274
+ render: ({ callToAction, control, margin, fields, title }) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: getMargin(margin), children: [
3275
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Header7, { title, callToAction }),
3276
+ fields.map((field) => {
3277
+ var _a;
3278
+ const {
3279
+ label,
3280
+ value,
3281
+ media,
3282
+ tag,
3283
+ additionalInfo,
3284
+ inlineAlert,
3285
+ help,
3286
+ callToAction: itemCallToAction
3287
+ } = field;
3288
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
3289
+ import_components55.ListItem,
3290
+ {
3291
+ title: value,
3292
+ subtitle: label,
3293
+ inverted: true,
3294
+ media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3295
+ control: (_a = getCTAControl(itemCallToAction)) != null ? _a : getHelpControl(help),
3296
+ prompt: getInlineAlert(inlineAlert),
3297
+ additionalInfo: getAdditionalInfo(additionalInfo)
3298
+ },
3299
+ JSON.stringify(field)
3300
+ );
3301
+ })
3302
+ ] })
3303
+ };
3304
+ var getCTAControl = (callToAction) => {
3305
+ if (!callToAction) {
3306
+ return void 0;
3307
+ }
3308
+ const { accessibilityDescription, href, title, onClick } = callToAction;
3309
+ if (href) {
3310
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.ListItem.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
3311
+ }
3312
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
3313
+ import_components55.ListItem.Button,
3314
+ {
3315
+ "aria-description": accessibilityDescription,
3316
+ partiallyInteractive: true,
3317
+ onClick,
3318
+ children: title
3319
+ }
3320
+ );
3321
+ };
3322
+ var getHelpControl = (help) => {
3323
+ if (!help) {
3324
+ return void 0;
3325
+ }
3326
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.Popover, { content: help, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.ListItem.IconButton, { partiallyInteractive: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_icons4.QuestionMarkCircle, {}) }) });
3327
+ };
3328
+ var NewReviewRenderer_default = ReviewRenderer2;
3329
+
3330
+ // ../renderers/src/NewListItem/NewStatusListRenderer.tsx
3331
+ var import_components56 = require("@transferwise/components");
3332
+ var import_jsx_runtime79 = require("react/jsx-runtime");
3333
+ var NewStatusListRenderer = {
3334
+ canRenderType: "status-list",
3335
+ render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: getMargin(margin), children: [
3336
+ title ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components56.Header, { title, className: "m-b-2" }) : null,
3337
+ items.map((item) => {
3338
+ const { callToAction, description, icon, status, title: itemTitle } = item;
3339
+ return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
3340
+ import_components56.ListItem,
3341
+ {
3342
+ title: itemTitle,
3343
+ subtitle: description,
3344
+ media: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components56.AvatarView, { badge: { status: mapStatus2(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DynamicIcon_default, { name: icon.name }) }) : void 0,
3345
+ additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
3346
+ import_components56.ListItem.AdditionalInfo,
3347
+ {
3348
+ action: {
3349
+ href: callToAction.href,
3350
+ onClick: callToAction.href ? void 0 : callToAction.onClick,
3351
+ label: callToAction.title,
3352
+ target: "_blank"
3353
+ }
3354
+ }
3355
+ ) : void 0
3356
+ },
3357
+ JSON.stringify(item)
3358
+ );
3359
+ })
3360
+ ] })
3361
+ };
3362
+ var mapStatus2 = (status) => {
3363
+ switch (status) {
3364
+ case "done":
3365
+ return "positive";
3366
+ case "pending":
3367
+ return "pending";
3368
+ default:
3369
+ return void 0;
3370
+ }
3371
+ };
3372
+ var NewStatusListRenderer_default = NewStatusListRenderer;
3373
+
3155
3374
  // ../renderers/src/getWiseRenderers.ts
3375
+ var listItemRenderers = [
3376
+ NewDecisionRenderer_default,
3377
+ NewListRenderer_default,
3378
+ NewReviewRenderer_default,
3379
+ NewStatusListRenderer_default
3380
+ ];
3156
3381
  var getWiseRenderers = () => [
3157
3382
  AddressValidationButtonRenderer_default,
3158
3383
  AlertRenderer_default,
@@ -3195,9 +3420,14 @@ var getWiseRenderers = () => [
3195
3420
  ];
3196
3421
 
3197
3422
  // ../renderers/src/ButtonRenderer/ButtonRendererV2.tsx
3198
- var import_components51 = require("@transferwise/components");
3423
+ var import_components57 = require("@transferwise/components");
3199
3424
  var import_react18 = require("react");
3200
- var import_jsx_runtime73 = require("react/jsx-runtime");
3425
+ var import_jsx_runtime80 = require("react/jsx-runtime");
3426
+
3427
+ // src/dynamicFlow/renderers.ts
3428
+ var Header11 = Header7;
3429
+ var getMargin2 = getMargin;
3430
+ var getListItemRenderers = () => listItemRenderers;
3201
3431
 
3202
3432
  // src/i18n/index.ts
3203
3433
  var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
@@ -4088,12 +4318,12 @@ var messages_default = (0, import_react_intl21.defineMessages)({
4088
4318
  });
4089
4319
 
4090
4320
  // src/dynamicFlow/DynamicFlow.tsx
4091
- var import_jsx_runtime74 = require("react/jsx-runtime");
4321
+ var import_jsx_runtime81 = require("react/jsx-runtime");
4092
4322
  var wiseRenderers = getWiseRenderers();
4093
4323
  function DynamicFlowLegacy(props) {
4094
4324
  const { customFetch = globalThis.fetch } = props;
4095
4325
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
4096
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
4326
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
4097
4327
  }
4098
4328
  function DynamicFlowRevamp(props) {
4099
4329
  const {
@@ -4130,7 +4360,7 @@ function DynamicFlowRevamp(props) {
4130
4360
  onLink,
4131
4361
  onCopy
4132
4362
  });
4133
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
4363
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
4134
4364
  }
4135
4365
  var DynamicForm = (0, import_react19.forwardRef)(function DynamicForm2(props, ref) {
4136
4366
  const {
@@ -4167,7 +4397,7 @@ var DynamicForm = (0, import_react19.forwardRef)(function DynamicForm2(props, re
4167
4397
  onLink,
4168
4398
  onCopy
4169
4399
  });
4170
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
4400
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
4171
4401
  });
4172
4402
  var useWiseHttpClient = (httpClient) => {
4173
4403
  const { locale } = (0, import_react_intl22.useIntl)();