@wise/dynamic-flow-client-internal 5.20.0 → 5.21.1

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
@@ -70,7 +70,7 @@ var require_classnames = __commonJS({
70
70
  (function() {
71
71
  "use strict";
72
72
  var hasOwn = {}.hasOwnProperty;
73
- function classNames7() {
73
+ function classNames8() {
74
74
  var classes = "";
75
75
  for (var i = 0; i < arguments.length; i++) {
76
76
  var arg = arguments[i];
@@ -88,7 +88,7 @@ var require_classnames = __commonJS({
88
88
  return "";
89
89
  }
90
90
  if (Array.isArray(arg)) {
91
- return classNames7.apply(null, arg);
91
+ return classNames8.apply(null, arg);
92
92
  }
93
93
  if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
94
94
  return arg.toString();
@@ -111,14 +111,14 @@ var require_classnames = __commonJS({
111
111
  return value + newClass;
112
112
  }
113
113
  if (typeof module2 !== "undefined" && module2.exports) {
114
- classNames7.default = classNames7;
115
- module2.exports = classNames7;
114
+ classNames8.default = classNames8;
115
+ module2.exports = classNames8;
116
116
  } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
117
117
  define("classnames", [], function() {
118
- return classNames7;
118
+ return classNames8;
119
119
  });
120
120
  } else {
121
- window.classNames = classNames7;
121
+ window.classNames = classNames8;
122
122
  }
123
123
  })();
124
124
  }
@@ -145,7 +145,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
145
145
  // src/dynamicFlow/telemetry/app-version.ts
146
146
  var appVersion = (
147
147
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
148
- typeof process !== "undefined" ? "5.20.0" : "0.0.0"
148
+ typeof process !== "undefined" ? "5.21.1" : "0.0.0"
149
149
  );
150
150
 
151
151
  // src/dynamicFlow/context-menu/useContextMenu.tsx
@@ -329,7 +329,7 @@ var recursivelyRemoveNullish = (element) => {
329
329
  };
330
330
 
331
331
  // src/dynamicFlow/useWiseToCoreProps.tsx
332
- var import_react26 = require("react");
332
+ var import_react25 = require("react");
333
333
 
334
334
  // src/dynamicFlow/getMergedRenderers.tsx
335
335
  var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
@@ -403,7 +403,7 @@ var BoxRenderer = {
403
403
  const contents = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
404
404
  "div",
405
405
  {
406
- className: (0, import_classnames.default)({
406
+ className: (0, import_classnames.default)("df-box-renderer", {
407
407
  "df-box-renderer-border": hasBorder,
408
408
  [`df-box-renderer-width-${width}`]: hasFixedWidth,
409
409
  [getMargin(margin)]: !hasFixedWidth
@@ -869,11 +869,24 @@ var getPriority = (control, tags) => {
869
869
  return control && isButtonPriority(control) ? control : "secondary";
870
870
  };
871
871
 
872
+ // ../renderers/src/CheckboxInputRenderer.tsx
873
+ var import_components11 = require("@transferwise/components");
874
+
872
875
  // ../renderers/src/components/FieldInput.tsx
873
876
  var import_components8 = require("@transferwise/components");
874
- var import_react4 = require("react");
875
877
 
876
- // ../renderers/src/utils/scroll-to-if-not-visible.ts
878
+ // ../renderers/src/utils/useScrollToError.ts
879
+ var import_react4 = require("react");
880
+ var useScrollToError = (validationState, features) => {
881
+ const ref = (0, import_react4.useRef)(null);
882
+ const enabled = (features == null ? void 0 : features.scrollToError) !== false;
883
+ (0, import_react4.useEffect)(() => {
884
+ if ((validationState == null ? void 0 : validationState.status) === "invalid" && (validationState == null ? void 0 : validationState.message) && enabled) {
885
+ scrollToIfNotVisible(ref.current);
886
+ }
887
+ }, [validationState == null ? void 0 : validationState.status, validationState == null ? void 0 : validationState.message, enabled]);
888
+ return { ref };
889
+ };
877
890
  var scrollToIfNotVisible = (ref) => {
878
891
  const rect = ref == null ? void 0 : ref.getBoundingClientRect();
879
892
  if (!ref || !rect) {
@@ -937,22 +950,16 @@ function FieldInput({
937
950
  inlineAlert,
938
951
  features
939
952
  }) {
953
+ var _a;
940
954
  const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LabelContentWithHelp, { text: label, help }) : label;
941
- const message = validation == null ? void 0 : validation.message;
942
- const ref = (0, import_react4.useRef)(null);
943
- const shouldScrollToError = features.scrollToError !== false;
944
- (0, import_react4.useEffect)(() => {
945
- if (message && shouldScrollToError) {
946
- scrollToIfNotVisible(ref.current);
947
- }
948
- }, [message, shouldScrollToError]);
955
+ const { ref } = useScrollToError(validation, features);
949
956
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
950
957
  import_components8.Field,
951
958
  {
952
959
  id,
953
960
  label: labelContent,
954
961
  description,
955
- message: message != null ? message : inlineAlert == null ? void 0 : inlineAlert.content,
962
+ message: (_a = validation == null ? void 0 : validation.message) != null ? _a : inlineAlert == null ? void 0 : inlineAlert.content,
956
963
  messageLoading: loadingState !== "idle",
957
964
  sentiment: mapStatusToSentiment(validation, inlineAlert == null ? void 0 : inlineAlert.context),
958
965
  children
@@ -972,33 +979,30 @@ var mapStatusToSentiment = (validation, defaultContext) => {
972
979
  };
973
980
  var FieldInput_default = FieldInput;
974
981
 
975
- // ../renderers/src/CheckboxInputRenderer.tsx
976
- var import_components11 = require("@transferwise/components");
977
-
978
- // ../renderers/src/utils/listItem/getMedia.tsx
979
- var import_jsx_runtime20 = require("react/jsx-runtime");
980
- var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
981
-
982
982
  // ../renderers/src/utils/listItem/getAdditionalText.tsx
983
983
  var import_components9 = require("@transferwise/components");
984
- var import_jsx_runtime21 = require("react/jsx-runtime");
984
+ var import_jsx_runtime20 = require("react/jsx-runtime");
985
985
  var getAdditionalText = (additionalText) => {
986
986
  if (!additionalText) {
987
987
  return void 0;
988
988
  }
989
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.ListItem.AdditionalInfo, { children: additionalText });
989
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components9.ListItem.AdditionalInfo, { children: additionalText });
990
990
  };
991
991
 
992
+ // ../renderers/src/utils/listItem/getInlineAlert.tsx
993
+ var import_components10 = require("@transferwise/components");
994
+ var import_jsx_runtime21 = require("react/jsx-runtime");
995
+ var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components10.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
996
+
997
+ // ../renderers/src/utils/listItem/getMedia.tsx
998
+ var import_jsx_runtime22 = require("react/jsx-runtime");
999
+ var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
1000
+
992
1001
  // ../renderers/src/utils/listItem/getSupportingValues.ts
993
1002
  var getSupportingValues = (supportingValues) => {
994
1003
  return __spreadValues(__spreadValues({}, (supportingValues == null ? void 0 : supportingValues.value) ? { valueTitle: supportingValues.value } : {}), (supportingValues == null ? void 0 : supportingValues.subvalue) ? { valueSubtitle: supportingValues.subvalue } : {});
995
1004
  };
996
1005
 
997
- // ../renderers/src/utils/listItem/getInlineAlert.tsx
998
- var import_components10 = require("@transferwise/components");
999
- var import_jsx_runtime22 = require("react/jsx-runtime");
1000
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
1001
-
1002
1006
  // ../renderers/src/CheckboxInputRenderer.tsx
1003
1007
  var import_jsx_runtime23 = require("react/jsx-runtime");
1004
1008
  var CheckboxInputRenderer = {
@@ -1062,9 +1066,11 @@ var CheckboxItemComponent = (props) => {
1062
1066
  title,
1063
1067
  validationState,
1064
1068
  value,
1069
+ features,
1065
1070
  onChange
1066
1071
  } = props;
1067
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1072
+ const { ref } = useScrollToError(validationState, features);
1073
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1068
1074
  import_components11.ListItem,
1069
1075
  __spreadValues({
1070
1076
  title,
@@ -1075,7 +1081,7 @@ var CheckboxItemComponent = (props) => {
1075
1081
  prompt: getInlineAlertOrValidation(validationState, inlineAlert),
1076
1082
  control: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components11.ListItem.Checkbox, { checked: value, onChange: () => onChange(!value) })
1077
1083
  }, getSupportingValues(supportingValues))
1078
- );
1084
+ ) });
1079
1085
  };
1080
1086
  var SwitchItemComponent = (props) => {
1081
1087
  const {
@@ -1088,9 +1094,11 @@ var SwitchItemComponent = (props) => {
1088
1094
  title,
1089
1095
  validationState,
1090
1096
  value,
1097
+ features,
1091
1098
  onChange
1092
1099
  } = props;
1093
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1100
+ const { ref } = useScrollToError(validationState, features);
1101
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1094
1102
  import_components11.ListItem,
1095
1103
  __spreadValues({
1096
1104
  title,
@@ -1101,7 +1109,7 @@ var SwitchItemComponent = (props) => {
1101
1109
  prompt: getInlineAlertOrValidation(validationState, inlineAlert),
1102
1110
  control: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components11.ListItem.Switch, { checked: value, onClick: () => onChange(!value) })
1103
1111
  }, getSupportingValues(supportingValues))
1104
- );
1112
+ ) });
1105
1113
  };
1106
1114
  var getInlineAlertOrValidation = (validationState, inlineAlert) => {
1107
1115
  if ((validationState == null ? void 0 : validationState.status) === "invalid") {
@@ -2060,13 +2068,17 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
2060
2068
 
2061
2069
  // ../renderers/src/MarkdownRenderer.tsx
2062
2070
  var import_components28 = require("@transferwise/components");
2071
+ var import_classnames4 = __toESM(require_classnames());
2063
2072
  var import_jsx_runtime48 = require("react/jsx-runtime");
2064
2073
  var MarkdownRenderer = {
2065
2074
  canRenderType: "markdown",
2066
2075
  render: ({ content, align, margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
2067
2076
  import_components28.Markdown,
2068
2077
  {
2069
- className: ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large",
2078
+ className: (0, import_classnames4.default)(
2079
+ "df-markdown",
2080
+ ["xs", "sm"].includes(size) ? "np-text-body-default" : "np-text-body-large"
2081
+ ),
2070
2082
  config: { link: { target: "_blank" } },
2071
2083
  children: content
2072
2084
  }
@@ -2509,8 +2521,7 @@ var import_components36 = require("@transferwise/components");
2509
2521
 
2510
2522
  // ../renderers/src/components/UploadFieldInput.tsx
2511
2523
  var import_components35 = require("@transferwise/components");
2512
- var import_classnames4 = __toESM(require_classnames());
2513
- var import_react13 = require("react");
2524
+ var import_classnames5 = __toESM(require_classnames());
2514
2525
  var import_jsx_runtime57 = require("react/jsx-runtime");
2515
2526
  function UploadFieldInput({
2516
2527
  id,
@@ -2523,19 +2534,12 @@ function UploadFieldInput({
2523
2534
  }) {
2524
2535
  const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(LabelContentWithHelp, { text: label, help }) : label;
2525
2536
  const descriptionId = description ? `${id}-description` : void 0;
2526
- const message = validation == null ? void 0 : validation.message;
2527
- const ref = (0, import_react13.useRef)(null);
2528
- const shouldScrollToError = features.scrollToError !== false;
2529
- (0, import_react13.useEffect)(() => {
2530
- if (message && shouldScrollToError) {
2531
- scrollToIfNotVisible(ref.current);
2532
- }
2533
- }, [message, shouldScrollToError]);
2537
+ const { ref } = useScrollToError(validation, features);
2534
2538
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
2535
2539
  "div",
2536
2540
  {
2537
2541
  ref,
2538
- className: (0, import_classnames4.default)("form-group d-block", {
2542
+ className: (0, import_classnames5.default)("form-group d-block", {
2539
2543
  "has-error": (validation == null ? void 0 : validation.status) === "invalid"
2540
2544
  }),
2541
2545
  children: [
@@ -2690,16 +2694,16 @@ var import_react_intl15 = require("react-intl");
2690
2694
 
2691
2695
  // ../renderers/src/hooks/useSnackBarIfAvailable.ts
2692
2696
  var import_components38 = require("@transferwise/components");
2693
- var import_react14 = require("react");
2697
+ var import_react13 = require("react");
2694
2698
  function useSnackBarIfAvailable() {
2695
- const context = (0, import_react14.useContext)(import_components38.SnackbarContext);
2699
+ const context = (0, import_react13.useContext)(import_components38.SnackbarContext);
2696
2700
  return context ? context.createSnackbar : () => {
2697
2701
  };
2698
2702
  }
2699
2703
 
2700
2704
  // ../renderers/src/ParagraphRenderer.tsx
2701
2705
  var import_components39 = require("@transferwise/components");
2702
- var import_classnames5 = __toESM(require_classnames());
2706
+ var import_classnames6 = __toESM(require_classnames());
2703
2707
 
2704
2708
  // ../renderers/src/messages/paragraph.messages.ts
2705
2709
  var import_react_intl14 = require("react-intl");
@@ -2751,7 +2755,7 @@ function CopyableParagraph({
2751
2755
  type: "text",
2752
2756
  value: text,
2753
2757
  readOnly: true,
2754
- className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
2758
+ className: (0, import_classnames6.default)("text-ellipsis", inputAlignmentClasses)
2755
2759
  }
2756
2760
  ),
2757
2761
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components39.Button, { v2: true, block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
@@ -2785,8 +2789,8 @@ var ProgressRenderer = {
2785
2789
  // ../renderers/src/RepeatableRenderer.tsx
2786
2790
  var import_components41 = require("@transferwise/components");
2787
2791
  var import_icons = require("@transferwise/icons");
2788
- var import_classnames6 = __toESM(require_classnames());
2789
- var import_react15 = require("react");
2792
+ var import_classnames7 = __toESM(require_classnames());
2793
+ var import_react14 = require("react");
2790
2794
  var import_react_intl17 = require("react-intl");
2791
2795
 
2792
2796
  // ../renderers/src/messages/repeatable.messages.ts
@@ -2826,6 +2830,7 @@ function Repeatable(props) {
2826
2830
  description,
2827
2831
  editableItem,
2828
2832
  editItemTitle,
2833
+ features,
2829
2834
  items,
2830
2835
  title,
2831
2836
  validationState,
@@ -2835,7 +2840,8 @@ function Repeatable(props) {
2835
2840
  onRemove
2836
2841
  } = props;
2837
2842
  const { formatMessage } = (0, import_react_intl17.useIntl)();
2838
- const [openModalType, setOpenModalType] = (0, import_react15.useState)(null);
2843
+ const [openModalType, setOpenModalType] = (0, import_react14.useState)(null);
2844
+ const { ref } = useScrollToError(validationState, features);
2839
2845
  const onAddItem = () => {
2840
2846
  onAdd();
2841
2847
  setOpenModalType("add");
@@ -2858,29 +2864,31 @@ function Repeatable(props) {
2858
2864
  setOpenModalType(null);
2859
2865
  };
2860
2866
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
2861
- title && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.Header, { title }),
2862
- description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { children: description }),
2863
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
2864
- "div",
2865
- {
2866
- className: (0, import_classnames6.default)("form-group", {
2867
- "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
2868
- }),
2869
- children: [
2870
- items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2871
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
2872
- import_components41.NavigationOption,
2873
- {
2874
- media: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_icons.Plus, {}),
2875
- title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
2876
- showMediaAtAllSizes: true,
2877
- onClick: () => onAddItem()
2878
- }
2879
- ),
2880
- (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.InlineAlert, { type: "negative", children: validationState.message })
2881
- ]
2882
- }
2883
- ),
2867
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { ref, children: [
2868
+ title && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.Header, { title }),
2869
+ description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { children: description }),
2870
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
2871
+ "div",
2872
+ {
2873
+ className: (0, import_classnames7.default)("form-group", {
2874
+ "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
2875
+ }),
2876
+ children: [
2877
+ items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2878
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
2879
+ import_components41.NavigationOption,
2880
+ {
2881
+ media: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_icons.Plus, {}),
2882
+ title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
2883
+ showMediaAtAllSizes: true,
2884
+ onClick: () => onAddItem()
2885
+ }
2886
+ ),
2887
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_components41.InlineAlert, { type: "negative", children: validationState.message })
2888
+ ]
2889
+ }
2890
+ )
2891
+ ] }),
2884
2892
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
2885
2893
  import_components41.Modal,
2886
2894
  {
@@ -3054,7 +3062,7 @@ var ReviewRenderer_default = ReviewRenderer2;
3054
3062
 
3055
3063
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
3056
3064
  var import_components45 = require("@transferwise/components");
3057
- var import_react16 = require("react");
3065
+ var import_react15 = require("react");
3058
3066
  var import_react_intl22 = require("react-intl");
3059
3067
 
3060
3068
  // ../renderers/src/messages/search.messages.ts
@@ -3117,7 +3125,7 @@ function BlockSearchRendererComponent({
3117
3125
  trackEvent,
3118
3126
  onChange
3119
3127
  }) {
3120
- const [hasSearched, setHasSearched] = (0, import_react16.useState)(false);
3128
+ const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
3121
3129
  const { formatMessage } = (0, import_react_intl22.useIntl)();
3122
3130
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: getMargin(margin), children: [
3123
3131
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
@@ -3209,7 +3217,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
3209
3217
  // ../renderers/src/SearchRenderer/InlineSearchRendererComponent.tsx
3210
3218
  var import_components46 = require("@transferwise/components");
3211
3219
  var import_icons4 = require("@transferwise/icons");
3212
- var import_react17 = require("react");
3220
+ var import_react16 = require("react");
3213
3221
  var import_react_intl23 = require("react-intl");
3214
3222
  var import_jsx_runtime67 = require("react/jsx-runtime");
3215
3223
  function InlineSearchRenderer({
@@ -3223,7 +3231,7 @@ function InlineSearchRenderer({
3223
3231
  onChange,
3224
3232
  trackEvent
3225
3233
  }) {
3226
- const [hasSearched, setHasSearched] = (0, import_react17.useState)(false);
3234
+ const [hasSearched, setHasSearched] = (0, import_react16.useState)(false);
3227
3235
  const intl = (0, import_react_intl23.useIntl)();
3228
3236
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
3229
3237
  FieldInput_default,
@@ -3396,7 +3404,7 @@ function RadioInputRendererComponent(props) {
3396
3404
 
3397
3405
  // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
3398
3406
  var import_components49 = require("@transferwise/components");
3399
- var import_react18 = require("react");
3407
+ var import_react17 = require("react");
3400
3408
  var import_jsx_runtime71 = require("react/jsx-runtime");
3401
3409
  function TabInputRendererComponent(props) {
3402
3410
  const {
@@ -3412,7 +3420,7 @@ function TabInputRendererComponent(props) {
3412
3420
  validationState,
3413
3421
  onSelect
3414
3422
  } = props;
3415
- (0, import_react18.useEffect)(() => {
3423
+ (0, import_react17.useEffect)(() => {
3416
3424
  if (!isValidIndex2(selectedIndex, options.length)) {
3417
3425
  onSelect(0);
3418
3426
  }
@@ -3528,7 +3536,7 @@ function SelectInputRendererComponent(props) {
3528
3536
  }
3529
3537
 
3530
3538
  // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
3531
- var import_react19 = require("react");
3539
+ var import_react18 = require("react");
3532
3540
  var import_components51 = require("@transferwise/components");
3533
3541
  var import_jsx_runtime73 = require("react/jsx-runtime");
3534
3542
  function SegmentedInputRendererComponent(props) {
@@ -3544,7 +3552,7 @@ function SegmentedInputRendererComponent(props) {
3544
3552
  validationState,
3545
3553
  onSelect
3546
3554
  } = props;
3547
- (0, import_react19.useEffect)(() => {
3555
+ (0, import_react18.useEffect)(() => {
3548
3556
  if (!isValidIndex3(selectedIndex, options.length)) {
3549
3557
  onSelect(0);
3550
3558
  }
@@ -3590,6 +3598,7 @@ function RadioItemRendererComponent(props) {
3590
3598
  children,
3591
3599
  description: rootDescription,
3592
3600
  disabled: rootDisabled,
3601
+ features,
3593
3602
  help,
3594
3603
  title: rootTitle,
3595
3604
  options,
@@ -3597,7 +3606,8 @@ function RadioItemRendererComponent(props) {
3597
3606
  validationState,
3598
3607
  onSelect
3599
3608
  } = props;
3600
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
3609
+ const { ref } = useScrollToError(validationState, features);
3610
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { ref, children: [
3601
3611
  rootTitle && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
3602
3612
  import_components52.Header,
3603
3613
  {
@@ -3710,12 +3720,12 @@ var StatusListRenderer_default = StatusListRenderer;
3710
3720
 
3711
3721
  // ../renderers/src/utils/useCustomTheme.ts
3712
3722
  var import_components_theming = require("@wise/components-theming");
3713
- var import_react20 = require("react");
3723
+ var import_react19 = require("react");
3714
3724
  var ThemeRequiredEventName = "Theme Required";
3715
3725
  var useCustomTheme = (theme, trackEvent) => {
3716
3726
  const theming = (0, import_components_theming.useTheme)();
3717
- const previousTheme = (0, import_react20.useMemo)(() => theming.theme, []);
3718
- (0, import_react20.useEffect)(() => {
3727
+ const previousTheme = (0, import_react19.useMemo)(() => theming.theme, []);
3728
+ (0, import_react19.useEffect)(() => {
3719
3729
  theming.setTheme(theme);
3720
3730
  trackEvent(ThemeRequiredEventName, { theme });
3721
3731
  return theme !== previousTheme ? () => {
@@ -3728,7 +3738,7 @@ var useCustomTheme = (theme, trackEvent) => {
3728
3738
 
3729
3739
  // ../renderers/src/step/StepFooter.tsx
3730
3740
  var import_components54 = require("@transferwise/components");
3731
- var import_react21 = require("react");
3741
+ var import_react20 = require("react");
3732
3742
  var import_react_intl25 = require("react-intl");
3733
3743
 
3734
3744
  // ../renderers/src/messages/step.messages.ts
@@ -3756,7 +3766,7 @@ var DefaultFooter = ({ footer }) => {
3756
3766
  };
3757
3767
  var FooterWithScrollButton = ({ footer }) => {
3758
3768
  const { formatMessage } = (0, import_react_intl25.useIntl)();
3759
- const endOfLayoutRef = (0, import_react21.useRef)(null);
3769
+ const endOfLayoutRef = (0, import_react20.useRef)(null);
3760
3770
  const isElementVisible = useIsElementVisible(endOfLayoutRef);
3761
3771
  const scrollButton = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
3762
3772
  import_components54.Button,
@@ -3785,8 +3795,8 @@ var FooterWithScrollButton = ({ footer }) => {
3785
3795
  ] });
3786
3796
  };
3787
3797
  var useIsElementVisible = (elementRef) => {
3788
- const [isVisible, setIsVisible] = (0, import_react21.useState)(false);
3789
- (0, import_react21.useEffect)(() => {
3798
+ const [isVisible, setIsVisible] = (0, import_react20.useState)(false);
3799
+ (0, import_react20.useEffect)(() => {
3790
3800
  const element = elementRef.current;
3791
3801
  if (!element) return;
3792
3802
  const observer = new IntersectionObserver(([entry]) => {
@@ -3970,7 +3980,7 @@ function StepRendererComponent(props) {
3970
3980
 
3971
3981
  // ../renderers/src/TabsRenderer.tsx
3972
3982
  var import_components59 = require("@transferwise/components");
3973
- var import_react22 = require("react");
3983
+ var import_react21 = require("react");
3974
3984
  var import_jsx_runtime85 = require("react/jsx-runtime");
3975
3985
  var TabsRenderer = {
3976
3986
  canRenderType: "tabs",
@@ -3989,7 +3999,7 @@ var TabsRenderer = {
3989
3999
  }
3990
4000
  };
3991
4001
  function TabsRendererComponent({ uid, margin, tabs }) {
3992
- const [selectedIndex, setSelectedIndex] = (0, import_react22.useState)(0);
4002
+ const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
3993
4003
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
3994
4004
  import_components59.Tabs,
3995
4005
  {
@@ -4010,7 +4020,7 @@ function TabsRendererComponent({ uid, margin, tabs }) {
4010
4020
  }
4011
4021
  function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
4012
4022
  var _a;
4013
- const [selectedIndex, setSelectedIndex] = (0, import_react22.useState)(0);
4023
+ const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
4014
4024
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getMargin(margin), children: [
4015
4025
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
4016
4026
  import_components59.SegmentedControl,
@@ -4032,7 +4042,7 @@ function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
4032
4042
  }
4033
4043
  function ChipsTabsRendererComponent({ margin, tabs }) {
4034
4044
  var _a;
4035
- const [selectedIndex, setSelectedIndex] = (0, import_react22.useState)(0);
4045
+ const [selectedIndex, setSelectedIndex] = (0, import_react21.useState)(0);
4036
4046
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: getMargin(margin), children: [
4037
4047
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "chips-container", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
4038
4048
  import_components59.Chips,
@@ -4287,7 +4297,7 @@ var LargeUploadRenderer = {
4287
4297
 
4288
4298
  // ../renderers/src/UpsellRenderer.tsx
4289
4299
  var import_components63 = require("@transferwise/components");
4290
- var import_react23 = require("react");
4300
+ var import_react22 = require("react");
4291
4301
  var import_jsx_runtime89 = require("react/jsx-runtime");
4292
4302
  var UpsellRenderer = {
4293
4303
  canRenderType: "upsell",
@@ -4295,7 +4305,7 @@ var UpsellRenderer = {
4295
4305
  };
4296
4306
  function UpsellRendererComponent(props) {
4297
4307
  const { text, callToAction, media, margin, onDismiss } = props;
4298
- const [isVisible, setIsVisible] = (0, import_react23.useState)(true);
4308
+ const [isVisible, setIsVisible] = (0, import_react22.useState)(true);
4299
4309
  return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4300
4310
  import_components63.Nudge,
4301
4311
  {
@@ -4344,7 +4354,7 @@ var supportedMediaNames = [
4344
4354
 
4345
4355
  // ../renderers/src/ButtonRenderer/CircularButtonRenderer.tsx
4346
4356
  var import_components64 = require("@transferwise/components");
4347
- var import_classnames7 = __toESM(require_classnames());
4357
+ var import_classnames8 = __toESM(require_classnames());
4348
4358
  var import_jsx_runtime90 = require("react/jsx-runtime");
4349
4359
  var CircularButtonRenderer = {
4350
4360
  canRenderType: "button",
@@ -4355,7 +4365,7 @@ function CircularButtonComponent(props) {
4355
4365
  var _a;
4356
4366
  const { context, disabled, margin, media, tags, title, onClick } = props;
4357
4367
  const priority = tags == null ? void 0 : tags.find((tag) => tag === "primary" || tag === "secondary");
4358
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_classnames7.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4368
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_classnames8.default)(getMargin(margin), "df-button", "circular"), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
4359
4369
  import_components64.CircularButton,
4360
4370
  {
4361
4371
  disabled,
@@ -4543,7 +4553,7 @@ var customEventsToAnalytics = {
4543
4553
  };
4544
4554
 
4545
4555
  // src/dynamicFlow/useOnCopy.tsx
4546
- var import_react24 = require("react");
4556
+ var import_react23 = require("react");
4547
4557
  var import_react_intl29 = require("react-intl");
4548
4558
 
4549
4559
  // src/dynamicFlow/messages.ts
@@ -4565,7 +4575,7 @@ var messages_default = (0, import_react_intl28.defineMessages)({
4565
4575
  var useOnCopy = () => {
4566
4576
  const { formatMessage } = (0, import_react_intl29.useIntl)();
4567
4577
  const createSnackBar = useSnackBarIfAvailable();
4568
- return (0, import_react24.useCallback)(
4578
+ return (0, import_react23.useCallback)(
4569
4579
  (copiedContent) => {
4570
4580
  if (copiedContent) {
4571
4581
  createSnackBar({ text: formatMessage(messages_default.copied) });
@@ -4578,11 +4588,11 @@ var useOnCopy = () => {
4578
4588
  };
4579
4589
 
4580
4590
  // src/dynamicFlow/useWiseHttpClient.tsx
4581
- var import_react25 = require("react");
4591
+ var import_react24 = require("react");
4582
4592
  var import_react_intl30 = require("react-intl");
4583
4593
  var useWiseHttpClient = (httpClient) => {
4584
4594
  const { locale } = (0, import_react_intl30.useIntl)();
4585
- return (0, import_react25.useCallback)(
4595
+ return (0, import_react24.useCallback)(
4586
4596
  async (input, init = {}) => {
4587
4597
  const headers = new Headers(init.headers);
4588
4598
  headers.set("accept-language", locale);
@@ -4623,10 +4633,10 @@ var useWiseToCoreProps = (props) => {
4623
4633
  onLog
4624
4634
  } = props;
4625
4635
  const httpClient = useWiseHttpClient(customFetch);
4626
- const mergedRenderers = (0, import_react26.useMemo)(() => getMergedRenderers(props), [renderers]);
4636
+ const mergedRenderers = (0, import_react25.useMemo)(() => getMergedRenderers(props), [renderers]);
4627
4637
  const createSnackBar = useCreateSnackBar();
4628
- const logEvent = (0, import_react26.useMemo)(() => getLogEvent(onLog), [onLog]);
4629
- const trackEvent = (0, import_react26.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
4638
+ const logEvent = (0, import_react25.useMemo)(() => getLogEvent(onLog), [onLog]);
4639
+ const trackEvent = (0, import_react25.useMemo)(() => getTrackEvent(onEvent, onAnalytics), [onEvent, onAnalytics]);
4630
4640
  const onCopy = useOnCopy();
4631
4641
  return __spreadProps(__spreadValues({}, props), {
4632
4642
  httpClient,
@@ -4671,14 +4681,14 @@ function DynamicFlow(props) {
4671
4681
  }
4672
4682
 
4673
4683
  // src/dynamicFlow/DynamicFlowWithRef.tsx
4674
- var import_react27 = require("react");
4684
+ var import_react26 = require("react");
4675
4685
  var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
4676
4686
  var import_jsx_runtime95 = require("react/jsx-runtime");
4677
- var DynamicFlowWithRef = (0, import_react27.forwardRef)(function DynamicFlowWithRef2(props, ref) {
4687
+ var DynamicFlowWithRef = (0, import_react26.forwardRef)(function DynamicFlowWithRef2(props, ref) {
4678
4688
  const { className = "" } = props;
4679
4689
  const dfProps = useWiseToCoreProps(props);
4680
4690
  const df = (0, import_dynamic_flow_client5.useDynamicFlow)(dfProps);
4681
- (0, import_react27.useImperativeHandle)(
4691
+ (0, import_react26.useImperativeHandle)(
4682
4692
  ref,
4683
4693
  () => ({
4684
4694
  getValue: async () => {