@wise/dynamic-flow-client-internal 4.21.0-experimental-fae3d25 → 4.21.0-experimental-a003e45

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.
Files changed (3) hide show
  1. package/build/main.js +25 -198
  2. package/build/main.mjs +37 -210
  3. package/package.json +5 -5
package/build/main.js CHANGED
@@ -850,29 +850,30 @@ var AddressValidationButtonRenderer = {
850
850
  function AddressValidationButtonComponent(props) {
851
851
  const { disabled, margin, title, stepLoadingState, onClick } = props;
852
852
  const { formatMessage } = (0, import_react_intl2.useIntl)();
853
- const [isActive, setActive] = (0, import_react.useState)(false);
854
- const isLoading = isActive && stepLoadingState !== "idle";
853
+ const [spinny, setSpinny] = (0, import_react.useState)(false);
854
+ (0, import_react.useEffect)(() => {
855
+ if (stepLoadingState === "idle") {
856
+ setSpinny(false);
857
+ }
858
+ }, [stepLoadingState]);
855
859
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
856
860
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
857
861
  import_components.Button,
858
862
  {
859
863
  v2: true,
860
864
  block: true,
861
- disabled: isLoading || disabled,
865
+ disabled: stepLoadingState !== "idle" || disabled,
862
866
  priority: "primary",
863
867
  size: "md",
864
- loading: isLoading,
865
- onBlur: () => {
866
- setActive(false);
867
- },
868
+ loading: spinny,
868
869
  onClick: () => {
869
- setActive(true);
870
+ setSpinny(true);
870
871
  onClick();
871
872
  },
872
873
  children: title
873
874
  }
874
875
  ),
875
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
876
+ spinny && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
876
877
  ] });
877
878
  }
878
879
  var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
@@ -937,8 +938,12 @@ var ButtonRenderer = {
937
938
  };
938
939
  function ButtonComponent(props) {
939
940
  const { control, context, disabled, margin, title, size, stepLoadingState, onClick } = props;
940
- const [isActive, setActive] = (0, import_react2.useState)(false);
941
- const isLoading = isActive && stepLoadingState !== "idle";
941
+ const [spinny, setSpinny] = (0, import_react2.useState)(false);
942
+ (0, import_react2.useEffect)(() => {
943
+ if (stepLoadingState === "idle") {
944
+ setSpinny(false);
945
+ }
946
+ }, [stepLoadingState]);
942
947
  const priority = mapControl(control);
943
948
  const type = priority === "tertiary" ? void 0 : mapContext(context);
944
949
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
@@ -946,16 +951,13 @@ function ButtonComponent(props) {
946
951
  {
947
952
  block: true,
948
953
  className: getMargin(margin),
949
- disabled: isLoading ? false : disabled,
954
+ disabled: stepLoadingState !== "idle" || disabled,
950
955
  priority,
951
956
  size: mapSize(size),
952
- loading: isLoading,
957
+ loading: spinny,
953
958
  type,
954
- onBlur: () => {
955
- setActive(false);
956
- },
957
959
  onClick: () => {
958
- setActive(true);
960
+ setSpinny(true);
959
961
  onClick();
960
962
  },
961
963
  children: title
@@ -3548,183 +3550,8 @@ var LargeUploadRenderer = {
3548
3550
  }
3549
3551
  };
3550
3552
 
3551
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3552
- var import_components48 = require("@transferwise/components");
3553
-
3554
- // ../renderers/src/NewListItem/getInlineAlert.tsx
3555
- var import_components47 = require("@transferwise/components");
3556
- var import_jsx_runtime67 = require("react/jsx-runtime");
3557
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components47.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
3558
-
3559
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3560
- var import_jsx_runtime68 = require("react/jsx-runtime");
3561
- var DecisionRenderer2 = {
3562
- canRenderType: "decision",
3563
- render: ({ control, margin, options, title }) => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: getMargin(margin), children: [
3564
- title && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components48.Header, { as: "h2", title }),
3565
- options.map((option) => {
3566
- const {
3567
- description,
3568
- disabled,
3569
- media,
3570
- title: itemTitle,
3571
- tag,
3572
- href,
3573
- additionalText,
3574
- inlineAlert,
3575
- supportingValues,
3576
- onClick
3577
- } = option;
3578
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
3579
- import_components48.ListItem,
3580
- {
3581
- title: itemTitle,
3582
- subtitle: description,
3583
- spotlight: control === "spotlight" ? tag === "spotlight-active" ? "active" : "inactive" : void 0,
3584
- disabled,
3585
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3586
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3587
- media: media ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
3588
- OptionMedia,
3589
- {
3590
- media,
3591
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
3592
- }
3593
- ) : void 0,
3594
- prompt: getInlineAlert(inlineAlert),
3595
- additionalInfo: additionalText ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components48.ListItem.AdditionalInfo, { children: additionalText }) : void 0,
3596
- control: href ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components48.ListItem.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components48.ListItem.Navigation, { onClick })
3597
- },
3598
- JSON.stringify(option)
3599
- );
3600
- })
3601
- ] })
3602
- };
3603
- var NewDecisionRenderer_default = DecisionRenderer2;
3604
-
3605
- // ../renderers/src/NewListItem/NewListRenderer.tsx
3606
- var import_components50 = require("@transferwise/components");
3607
-
3608
- // ../renderers/src/NewListItem/getAdditionalInfo.tsx
3609
- var import_components49 = require("@transferwise/components");
3610
- var import_jsx_runtime69 = require("react/jsx-runtime");
3611
- var getAdditionalInfo = (additionalInfo) => {
3612
- var _a;
3613
- return additionalInfo ? (
3614
- // TODO: this type should have an href so we can render anchors
3615
- additionalInfo.onClick ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
3616
- import_components49.ListItem.AdditionalInfo,
3617
- {
3618
- action: {
3619
- onClick: additionalInfo.onClick,
3620
- label: (_a = additionalInfo.text) != null ? _a : ""
3621
- }
3622
- }
3623
- ) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_components49.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text })
3624
- ) : void 0;
3625
- };
3626
-
3627
- // ../renderers/src/NewListItem/NewListRenderer.tsx
3628
- var import_jsx_runtime70 = require("react/jsx-runtime");
3629
- var ListRenderer2 = {
3630
- canRenderType: "list",
3631
- render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: getMargin(margin), children: [
3632
- (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components50.Header, { as: "h2", title: title != null ? title : "", action: getListAction2(callToAction) }),
3633
- items.map(
3634
- ({
3635
- title: itemTitle,
3636
- description,
3637
- supportingValues,
3638
- media,
3639
- tag,
3640
- additionalInfo,
3641
- inlineAlert
3642
- }) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
3643
- import_components50.ListItem,
3644
- {
3645
- title: itemTitle,
3646
- subtitle: description,
3647
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3648
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3649
- media: media ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
3650
- OptionMedia,
3651
- {
3652
- media,
3653
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
3654
- }
3655
- ) : void 0,
3656
- prompt: getInlineAlert(inlineAlert),
3657
- additionalInfo: getAdditionalInfo(additionalInfo)
3658
- },
3659
- itemTitle
3660
- )
3661
- )
3662
- ] })
3663
- };
3664
- var getListAction2 = (callToAction) => {
3665
- if (callToAction) {
3666
- return __spreadValues({
3667
- "aria-label": callToAction.accessibilityDescription,
3668
- text: callToAction.title,
3669
- onClick: callToAction.onClick
3670
- }, callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
3671
- }
3672
- return void 0;
3673
- };
3674
- var NewListRenderer_default = ListRenderer2;
3675
-
3676
- // ../renderers/src/NewListItem/NewReviewRenderer.tsx
3677
- var import_components51 = require("@transferwise/components");
3678
- var import_jsx_runtime71 = require("react/jsx-runtime");
3679
- var ReviewRenderer2 = {
3680
- canRenderType: "review",
3681
- render: ({ callToAction, control, margin, fields, title }) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: getMargin(margin), children: [
3682
- (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components51.Header, { as: "h2", title: title != null ? title : "", action: getHeaderAction(callToAction) }),
3683
- fields.map(({ label, value, media, tag, additionalInfo, inlineAlert, callToAction: callToAction2 }) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3684
- import_components51.ListItem,
3685
- {
3686
- title: value,
3687
- subtitle: label,
3688
- inverted: true,
3689
- media: media ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3690
- OptionMedia,
3691
- {
3692
- media,
3693
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
3694
- }
3695
- ) : void 0,
3696
- control: getControl(callToAction2),
3697
- prompt: getInlineAlert(inlineAlert),
3698
- additionalInfo: getAdditionalInfo(additionalInfo)
3699
- },
3700
- label
3701
- ))
3702
- ] })
3703
- };
3704
- var getControl = (callToAction) => {
3705
- if (!callToAction) {
3706
- return void 0;
3707
- }
3708
- const { accessibilityDescription, href, title, onClick } = callToAction;
3709
- if (href) {
3710
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_components51.ListItem.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
3711
- }
3712
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
3713
- import_components51.ListItem.Button,
3714
- {
3715
- onClick,
3716
- partiallyInteractive: true,
3717
- "aria-description": accessibilityDescription,
3718
- children: title
3719
- }
3720
- );
3721
- };
3722
- var NewReviewRenderer_default = ReviewRenderer2;
3723
-
3724
3553
  // ../renderers/src/getWiseRenderers.ts
3725
- var internalRenderers = [NewDecisionRenderer_default, NewListRenderer_default, NewReviewRenderer_default];
3726
- var getWiseRenderers = (internal = false) => [
3727
- ...internal ? internalRenderers : [],
3554
+ var getWiseRenderers = () => [
3728
3555
  AddressValidationButtonRenderer_default,
3729
3556
  AlertRenderer_default,
3730
3557
  CheckboxInputRenderer_default,
@@ -3823,12 +3650,12 @@ var messages_default = (0, import_react_intl18.defineMessages)({
3823
3650
  });
3824
3651
 
3825
3652
  // src/dynamicFlow/DynamicFlow.tsx
3826
- var import_jsx_runtime72 = require("react/jsx-runtime");
3827
- var wiseRenderers = getWiseRenderers(true);
3653
+ var import_jsx_runtime67 = require("react/jsx-runtime");
3654
+ var wiseRenderers = getWiseRenderers();
3828
3655
  function DynamicFlowLegacy(props) {
3829
3656
  const { customFetch = globalThis.fetch } = props;
3830
3657
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
3831
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
3658
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
3832
3659
  }
3833
3660
  function DynamicFlowRevamp(props) {
3834
3661
  const {
@@ -3865,7 +3692,7 @@ function DynamicFlowRevamp(props) {
3865
3692
  onLink,
3866
3693
  onCopy
3867
3694
  });
3868
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
3695
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
3869
3696
  }
3870
3697
  var DynamicForm = (0, import_react15.forwardRef)(function DynamicForm2(props, ref) {
3871
3698
  const {
@@ -3902,7 +3729,7 @@ var DynamicForm = (0, import_react15.forwardRef)(function DynamicForm2(props, re
3902
3729
  onLink,
3903
3730
  onCopy
3904
3731
  });
3905
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3732
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3906
3733
  });
3907
3734
  var useWiseHttpClient = (httpClient) => {
3908
3735
  const { locale } = (0, import_react_intl19.useIntl)();
package/build/main.mjs CHANGED
@@ -806,7 +806,7 @@ var loading_button_messages_default = defineMessages({
806
806
  });
807
807
 
808
808
  // ../renderers/src/ButtonRenderer/AddressValidationButtonRenderer.tsx
809
- import { useState } from "react";
809
+ import { useEffect, useState } from "react";
810
810
  import { jsx, jsxs } from "react/jsx-runtime";
811
811
  var AddressValidationButtonRenderer = {
812
812
  canRenderType: "button",
@@ -816,29 +816,30 @@ var AddressValidationButtonRenderer = {
816
816
  function AddressValidationButtonComponent(props) {
817
817
  const { disabled, margin, title, stepLoadingState, onClick } = props;
818
818
  const { formatMessage } = useIntl();
819
- const [isActive, setActive] = useState(false);
820
- const isLoading = isActive && stepLoadingState !== "idle";
819
+ const [spinny, setSpinny] = useState(false);
820
+ useEffect(() => {
821
+ if (stepLoadingState === "idle") {
822
+ setSpinny(false);
823
+ }
824
+ }, [stepLoadingState]);
821
825
  return /* @__PURE__ */ jsxs("div", { className: `d-flex flex-column ${getMargin(margin)}`, children: [
822
826
  /* @__PURE__ */ jsx(
823
827
  Button,
824
828
  {
825
829
  v2: true,
826
830
  block: true,
827
- disabled: isLoading || disabled,
831
+ disabled: stepLoadingState !== "idle" || disabled,
828
832
  priority: "primary",
829
833
  size: "md",
830
- loading: isLoading,
831
- onBlur: () => {
832
- setActive(false);
833
- },
834
+ loading: spinny,
834
835
  onClick: () => {
835
- setActive(true);
836
+ setSpinny(true);
836
837
  onClick();
837
838
  },
838
839
  children: title
839
840
  }
840
841
  ),
841
- isLoading && /* @__PURE__ */ jsx(InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
842
+ spinny && /* @__PURE__ */ jsx(InlineAlert, { type: "warning", className: "m-x-auto", children: formatMessage(loading_button_messages_default.buttonLoadingMessage) })
842
843
  ] });
843
844
  }
844
845
  var AddressValidationButtonRenderer_default = AddressValidationButtonRenderer;
@@ -895,7 +896,7 @@ var BoxRenderer_default = BoxRenderer;
895
896
 
896
897
  // ../renderers/src/ButtonRenderer/ButtonRenderer.tsx
897
898
  import { Button as Button2 } from "@transferwise/components";
898
- import { useState as useState2 } from "react";
899
+ import { useEffect as useEffect2, useState as useState2 } from "react";
899
900
  import { jsx as jsx4 } from "react/jsx-runtime";
900
901
  var ButtonRenderer = {
901
902
  canRenderType: "button",
@@ -903,8 +904,12 @@ var ButtonRenderer = {
903
904
  };
904
905
  function ButtonComponent(props) {
905
906
  const { control, context, disabled, margin, title, size, stepLoadingState, onClick } = props;
906
- const [isActive, setActive] = useState2(false);
907
- const isLoading = isActive && stepLoadingState !== "idle";
907
+ const [spinny, setSpinny] = useState2(false);
908
+ useEffect2(() => {
909
+ if (stepLoadingState === "idle") {
910
+ setSpinny(false);
911
+ }
912
+ }, [stepLoadingState]);
908
913
  const priority = mapControl(control);
909
914
  const type = priority === "tertiary" ? void 0 : mapContext(context);
910
915
  return /* @__PURE__ */ jsx4(
@@ -912,16 +917,13 @@ function ButtonComponent(props) {
912
917
  {
913
918
  block: true,
914
919
  className: getMargin(margin),
915
- disabled: isLoading ? false : disabled,
920
+ disabled: stepLoadingState !== "idle" || disabled,
916
921
  priority,
917
922
  size: mapSize(size),
918
- loading: isLoading,
923
+ loading: spinny,
919
924
  type,
920
- onBlur: () => {
921
- setActive(false);
922
- },
923
925
  onClick: () => {
924
- setActive(true);
926
+ setSpinny(true);
925
927
  onClick();
926
928
  },
927
929
  children: title
@@ -1524,7 +1526,7 @@ var external_confirmation_messages_default = defineMessages3({
1524
1526
 
1525
1527
  // ../renderers/src/ExternalConfirmationRenderer.tsx
1526
1528
  import { useIntl as useIntl3 } from "react-intl";
1527
- import { useEffect } from "react";
1529
+ import { useEffect as useEffect3 } from "react";
1528
1530
  import { Fragment, jsx as jsx25, jsxs as jsxs5 } from "react/jsx-runtime";
1529
1531
  var ExternalConfirmationRenderer = {
1530
1532
  canRenderType: "external-confirmation",
@@ -1538,7 +1540,7 @@ function ExternalConfirmationRendererComponent({
1538
1540
  onCancel
1539
1541
  }) {
1540
1542
  const { formatMessage } = useIntl3();
1541
- useEffect(() => {
1543
+ useEffect3(() => {
1542
1544
  if (url) {
1543
1545
  const w = window.open(url, "_blank");
1544
1546
  if (w) {
@@ -1659,7 +1661,7 @@ var HeadingRenderer_default = HeadingRenderer;
1659
1661
 
1660
1662
  // ../renderers/src/ImageRenderer/UrlImage.tsx
1661
1663
  import { Image } from "@transferwise/components";
1662
- import { useEffect as useEffect2, useState as useState3 } from "react";
1664
+ import { useEffect as useEffect4, useState as useState3 } from "react";
1663
1665
 
1664
1666
  // ../renderers/src/utils/api-utils.ts
1665
1667
  function isRelativePath(url = "") {
@@ -1679,7 +1681,7 @@ function UrlImage({
1679
1681
  httpClient
1680
1682
  }) {
1681
1683
  const [imageSource, setImageSource] = useState3("");
1682
- useEffect2(() => {
1684
+ useEffect4(() => {
1683
1685
  if (!uri.startsWith("urn:")) {
1684
1686
  void getImageSource(httpClient, uri).then(setImageSource);
1685
1687
  }
@@ -2891,7 +2893,7 @@ function RadioInputRendererComponent(props) {
2891
2893
 
2892
2894
  // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
2893
2895
  import { Tabs } from "@transferwise/components";
2894
- import { useEffect as useEffect3 } from "react";
2896
+ import { useEffect as useEffect5 } from "react";
2895
2897
  import { Fragment as Fragment6, jsx as jsx54, jsxs as jsxs18 } from "react/jsx-runtime";
2896
2898
  function TabInputRendererComponent(props) {
2897
2899
  const {
@@ -2906,7 +2908,7 @@ function TabInputRendererComponent(props) {
2906
2908
  validationState,
2907
2909
  onSelect
2908
2910
  } = props;
2909
- useEffect3(() => {
2911
+ useEffect5(() => {
2910
2912
  if (!isValidIndex(selectedIndex, options.length)) {
2911
2913
  onSelect(0);
2912
2914
  }
@@ -3019,7 +3021,7 @@ function SelectInputRendererComponent(props) {
3019
3021
  }
3020
3022
 
3021
3023
  // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
3022
- import { useEffect as useEffect4 } from "react";
3024
+ import { useEffect as useEffect6 } from "react";
3023
3025
  import { SegmentedControl } from "@transferwise/components";
3024
3026
  import { Fragment as Fragment8, jsx as jsx56, jsxs as jsxs20 } from "react/jsx-runtime";
3025
3027
  function SegmentedInputRendererComponent(props) {
@@ -3034,7 +3036,7 @@ function SegmentedInputRendererComponent(props) {
3034
3036
  validationState,
3035
3037
  onSelect
3036
3038
  } = props;
3037
- useEffect4(() => {
3039
+ useEffect6(() => {
3038
3040
  if (!isValidIndex2(selectedIndex, options.length)) {
3039
3041
  onSelect(0);
3040
3042
  }
@@ -3139,12 +3141,12 @@ var mapStatus = (status) => {
3139
3141
 
3140
3142
  // ../renderers/src/utils/useCustomTheme.ts
3141
3143
  import { useTheme } from "@wise/components-theming";
3142
- import { useEffect as useEffect5, useMemo } from "react";
3144
+ import { useEffect as useEffect7, useMemo } from "react";
3143
3145
  var ThemeRequiredEventName = "Theme Required";
3144
3146
  var useCustomTheme = (theme, trackEvent) => {
3145
3147
  const previousThemeHookValue = useTheme();
3146
3148
  const previousTheme = useMemo(() => previousThemeHookValue.theme, []);
3147
- useEffect5(() => {
3149
+ useEffect7(() => {
3148
3150
  trackEvent(ThemeRequiredEventName, { theme });
3149
3151
  return theme !== previousTheme ? () => {
3150
3152
  trackEvent(ThemeRequiredEventName, { theme: previousTheme });
@@ -3524,183 +3526,8 @@ var LargeUploadRenderer = {
3524
3526
  }
3525
3527
  };
3526
3528
 
3527
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3528
- import { Header as Header9, ListItem as ListItem2 } from "@transferwise/components";
3529
-
3530
- // ../renderers/src/NewListItem/getInlineAlert.tsx
3531
- import { ListItem } from "@transferwise/components";
3532
- import { jsx as jsx67 } from "react/jsx-runtime";
3533
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx67(ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
3534
-
3535
- // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3536
- import { jsx as jsx68, jsxs as jsxs27 } from "react/jsx-runtime";
3537
- var DecisionRenderer2 = {
3538
- canRenderType: "decision",
3539
- render: ({ control, margin, options, title }) => /* @__PURE__ */ jsxs27("div", { className: getMargin(margin), children: [
3540
- title && /* @__PURE__ */ jsx68(Header9, { as: "h2", title }),
3541
- options.map((option) => {
3542
- const {
3543
- description,
3544
- disabled,
3545
- media,
3546
- title: itemTitle,
3547
- tag,
3548
- href,
3549
- additionalText,
3550
- inlineAlert,
3551
- supportingValues,
3552
- onClick
3553
- } = option;
3554
- return /* @__PURE__ */ jsx68(
3555
- ListItem2,
3556
- {
3557
- title: itemTitle,
3558
- subtitle: description,
3559
- spotlight: control === "spotlight" ? tag === "spotlight-active" ? "active" : "inactive" : void 0,
3560
- disabled,
3561
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3562
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3563
- media: media ? /* @__PURE__ */ jsx68(
3564
- OptionMedia,
3565
- {
3566
- media,
3567
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
3568
- }
3569
- ) : void 0,
3570
- prompt: getInlineAlert(inlineAlert),
3571
- additionalInfo: additionalText ? /* @__PURE__ */ jsx68(ListItem2.AdditionalInfo, { children: additionalText }) : void 0,
3572
- control: href ? /* @__PURE__ */ jsx68(ListItem2.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx68(ListItem2.Navigation, { onClick })
3573
- },
3574
- JSON.stringify(option)
3575
- );
3576
- })
3577
- ] })
3578
- };
3579
- var NewDecisionRenderer_default = DecisionRenderer2;
3580
-
3581
- // ../renderers/src/NewListItem/NewListRenderer.tsx
3582
- import { Header as Header10, ListItem as ListItem4 } from "@transferwise/components";
3583
-
3584
- // ../renderers/src/NewListItem/getAdditionalInfo.tsx
3585
- import { ListItem as ListItem3 } from "@transferwise/components";
3586
- import { jsx as jsx69 } from "react/jsx-runtime";
3587
- var getAdditionalInfo = (additionalInfo) => {
3588
- var _a;
3589
- return additionalInfo ? (
3590
- // TODO: this type should have an href so we can render anchors
3591
- additionalInfo.onClick ? /* @__PURE__ */ jsx69(
3592
- ListItem3.AdditionalInfo,
3593
- {
3594
- action: {
3595
- onClick: additionalInfo.onClick,
3596
- label: (_a = additionalInfo.text) != null ? _a : ""
3597
- }
3598
- }
3599
- ) : /* @__PURE__ */ jsx69(ListItem3.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text })
3600
- ) : void 0;
3601
- };
3602
-
3603
- // ../renderers/src/NewListItem/NewListRenderer.tsx
3604
- import { jsx as jsx70, jsxs as jsxs28 } from "react/jsx-runtime";
3605
- var ListRenderer2 = {
3606
- canRenderType: "list",
3607
- render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs28("div", { className: getMargin(margin), children: [
3608
- (title || callToAction) && /* @__PURE__ */ jsx70(Header10, { as: "h2", title: title != null ? title : "", action: getListAction2(callToAction) }),
3609
- items.map(
3610
- ({
3611
- title: itemTitle,
3612
- description,
3613
- supportingValues,
3614
- media,
3615
- tag,
3616
- additionalInfo,
3617
- inlineAlert
3618
- }) => /* @__PURE__ */ jsx70(
3619
- ListItem4,
3620
- {
3621
- title: itemTitle,
3622
- subtitle: description,
3623
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3624
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3625
- media: media ? /* @__PURE__ */ jsx70(
3626
- OptionMedia,
3627
- {
3628
- media,
3629
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
3630
- }
3631
- ) : void 0,
3632
- prompt: getInlineAlert(inlineAlert),
3633
- additionalInfo: getAdditionalInfo(additionalInfo)
3634
- },
3635
- itemTitle
3636
- )
3637
- )
3638
- ] })
3639
- };
3640
- var getListAction2 = (callToAction) => {
3641
- if (callToAction) {
3642
- return __spreadValues({
3643
- "aria-label": callToAction.accessibilityDescription,
3644
- text: callToAction.title,
3645
- onClick: callToAction.onClick
3646
- }, callToAction.type === "link" ? { href: callToAction.href, target: "_blank" } : {});
3647
- }
3648
- return void 0;
3649
- };
3650
- var NewListRenderer_default = ListRenderer2;
3651
-
3652
- // ../renderers/src/NewListItem/NewReviewRenderer.tsx
3653
- import { Header as Header11, ListItem as ListItem5 } from "@transferwise/components";
3654
- import { jsx as jsx71, jsxs as jsxs29 } from "react/jsx-runtime";
3655
- var ReviewRenderer2 = {
3656
- canRenderType: "review",
3657
- render: ({ callToAction, control, margin, fields, title }) => /* @__PURE__ */ jsxs29("div", { className: getMargin(margin), children: [
3658
- (title || callToAction) && /* @__PURE__ */ jsx71(Header11, { as: "h2", title: title != null ? title : "", action: getHeaderAction(callToAction) }),
3659
- fields.map(({ label, value, media, tag, additionalInfo, inlineAlert, callToAction: callToAction2 }) => /* @__PURE__ */ jsx71(
3660
- ListItem5,
3661
- {
3662
- title: value,
3663
- subtitle: label,
3664
- inverted: true,
3665
- media: media ? /* @__PURE__ */ jsx71(
3666
- OptionMedia,
3667
- {
3668
- media,
3669
- preferAvatar: control === "with-avatar" || tag === "with-avatar"
3670
- }
3671
- ) : void 0,
3672
- control: getControl(callToAction2),
3673
- prompt: getInlineAlert(inlineAlert),
3674
- additionalInfo: getAdditionalInfo(additionalInfo)
3675
- },
3676
- label
3677
- ))
3678
- ] })
3679
- };
3680
- var getControl = (callToAction) => {
3681
- if (!callToAction) {
3682
- return void 0;
3683
- }
3684
- const { accessibilityDescription, href, title, onClick } = callToAction;
3685
- if (href) {
3686
- return /* @__PURE__ */ jsx71(ListItem5.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
3687
- }
3688
- return /* @__PURE__ */ jsx71(
3689
- ListItem5.Button,
3690
- {
3691
- onClick,
3692
- partiallyInteractive: true,
3693
- "aria-description": accessibilityDescription,
3694
- children: title
3695
- }
3696
- );
3697
- };
3698
- var NewReviewRenderer_default = ReviewRenderer2;
3699
-
3700
3529
  // ../renderers/src/getWiseRenderers.ts
3701
- var internalRenderers = [NewDecisionRenderer_default, NewListRenderer_default, NewReviewRenderer_default];
3702
- var getWiseRenderers = (internal = false) => [
3703
- ...internal ? internalRenderers : [],
3530
+ var getWiseRenderers = () => [
3704
3531
  AddressValidationButtonRenderer_default,
3705
3532
  AlertRenderer_default,
3706
3533
  CheckboxInputRenderer_default,
@@ -3799,12 +3626,12 @@ var messages_default = defineMessages9({
3799
3626
  });
3800
3627
 
3801
3628
  // src/dynamicFlow/DynamicFlow.tsx
3802
- import { jsx as jsx72 } from "react/jsx-runtime";
3803
- var wiseRenderers = getWiseRenderers(true);
3629
+ import { jsx as jsx67 } from "react/jsx-runtime";
3630
+ var wiseRenderers = getWiseRenderers();
3804
3631
  function DynamicFlowLegacy(props) {
3805
3632
  const { customFetch = globalThis.fetch } = props;
3806
3633
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
3807
- return /* @__PURE__ */ jsx72(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
3634
+ return /* @__PURE__ */ jsx67(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
3808
3635
  }
3809
3636
  function DynamicFlowRevamp(props) {
3810
3637
  const {
@@ -3841,7 +3668,7 @@ function DynamicFlowRevamp(props) {
3841
3668
  onLink,
3842
3669
  onCopy
3843
3670
  });
3844
- return /* @__PURE__ */ jsx72("div", { className, children: /* @__PURE__ */ jsx72(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
3671
+ return /* @__PURE__ */ jsx67("div", { className, children: /* @__PURE__ */ jsx67(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
3845
3672
  }
3846
3673
  var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
3847
3674
  const {
@@ -3878,7 +3705,7 @@ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
3878
3705
  onLink,
3879
3706
  onCopy
3880
3707
  });
3881
- return /* @__PURE__ */ jsx72("div", { className, children: /* @__PURE__ */ jsx72(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3708
+ return /* @__PURE__ */ jsx67("div", { className, children: /* @__PURE__ */ jsx67(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3882
3709
  });
3883
3710
  var useWiseHttpClient = (httpClient) => {
3884
3711
  const { locale } = useIntl10();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client-internal",
3
- "version": "4.21.0-experimental-fae3d25",
3
+ "version": "4.21.0-experimental-a003e45",
4
4
  "description": "Dynamic Flow web client for Wise",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -43,7 +43,7 @@
43
43
  "@testing-library/jest-dom": "6.6.4",
44
44
  "@testing-library/react": "16.3.0",
45
45
  "@testing-library/user-event": "14.6.1",
46
- "@transferwise/components": "0.0.0-experimental-4ee52fa",
46
+ "@transferwise/components": "46.101.0",
47
47
  "@transferwise/formatting": "^2.13.4",
48
48
  "@transferwise/icons": "3.22.3",
49
49
  "@transferwise/neptune-css": "14.24.5",
@@ -76,7 +76,7 @@
76
76
  "typescript": "5.9.2",
77
77
  "@wise/dynamic-flow-fixtures": "0.0.1",
78
78
  "@wise/dynamic-flow-renderers": "0.0.0",
79
- "@wise/dynamic-flow-types": "3.10.0-experimental-fae3d25"
79
+ "@wise/dynamic-flow-types": "3.10.0-experimental-a003e45"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "@transferwise/components": "^46.92.0",
@@ -91,8 +91,8 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "classnames": "2.5.1",
94
- "@wise/dynamic-flow-client": "4.12.0-experimental-fae3d25",
95
- "@wise/dynamic-flow-types": "3.10.0-experimental-fae3d25"
94
+ "@wise/dynamic-flow-client": "4.12.0-experimental-a003e45",
95
+ "@wise/dynamic-flow-types": "3.10.0-experimental-a003e45"
96
96
  },
97
97
  "scripts": {
98
98
  "dev": "pnpm build:visual-tests && storybook dev -p 3005",