@wise/dynamic-flow-client 3.17.1 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.mjs CHANGED
@@ -138,12 +138,12 @@ var init_clsx = __esm({
138
138
  }
139
139
  });
140
140
 
141
- // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
141
+ // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
142
142
  import { useState as useState2, useEffect as useEffect2, forwardRef, Suspense, lazy } from "react";
143
143
  import { jsx as jsx17, jsxs as jsxs4, Fragment as Fragment3 } from "react/jsx-runtime";
144
144
  var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
145
145
  var init_index_93a0c34e_esm = __esm({
146
- "../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
146
+ "../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
147
147
  "use strict";
148
148
  init_clsx();
149
149
  unknownFlagName = "wise";
@@ -1628,9 +1628,9 @@ var markdownComponentToProps = ({
1628
1628
  });
1629
1629
 
1630
1630
  // src/revamp/renderers/mappers/modalComponentToProps.ts
1631
- var modalComponentToProps = ({ control, margin, trigger }, components) => ({
1631
+ var modalComponentToProps = ({ content, control, margin, trigger }, components) => ({
1632
1632
  type: "modal",
1633
- content: { components },
1633
+ content: { components, title: content.title },
1634
1634
  control,
1635
1635
  margin,
1636
1636
  trigger
@@ -9916,13 +9916,14 @@ var createModalComponent = (modalProps) => __spreadProps(__spreadValues({
9916
9916
 
9917
9917
  // src/revamp/domain/mappers/layout/modalLayoutToComponent.ts
9918
9918
  var modalLayoutToComponent = (uid, { content, control, margin = "md", trigger }, mapperProps) => {
9919
- const { components } = content;
9919
+ const { components, title } = content;
9920
9920
  return createModalComponent({
9921
9921
  uid,
9922
9922
  content: {
9923
9923
  components: components.map(
9924
9924
  (component, index) => mapLayoutToComponent(`${uid}.modal-${index}`, component, mapperProps)
9925
- )
9925
+ ),
9926
+ title
9926
9927
  },
9927
9928
  control,
9928
9929
  margin,
@@ -11286,7 +11287,7 @@ var DateInputRenderer_default = DateInputRenderer;
11286
11287
  // ../renderers/src/DecisionRenderer.tsx
11287
11288
  import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
11288
11289
 
11289
- // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11290
+ // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.18.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11290
11291
  init_index_93a0c34e_esm();
11291
11292
  init_clsx();
11292
11293
  import "react";
@@ -11623,6 +11624,7 @@ var ModalRenderer = {
11623
11624
  var ModalRenderer_default = ModalRenderer;
11624
11625
  function DFModal({ content, margin, trigger }) {
11625
11626
  const [visible, setVisible] = useState4(false);
11627
+ const { components, title } = content;
11626
11628
  return /* @__PURE__ */ jsxs8("div", { className: getMargin(margin), children: [
11627
11629
  /* @__PURE__ */ jsx32(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
11628
11630
  /* @__PURE__ */ jsx32(
@@ -11631,7 +11633,8 @@ function DFModal({ content, margin, trigger }) {
11631
11633
  scroll: "content",
11632
11634
  open: visible,
11633
11635
  size: "lg",
11634
- body: content.components,
11636
+ title,
11637
+ body: components,
11635
11638
  onClose: () => setVisible(false)
11636
11639
  }
11637
11640
  )
@@ -18084,6 +18087,7 @@ function DynamicModal(props) {
18084
18087
  scroll: "content",
18085
18088
  open: visible,
18086
18089
  size: "lg",
18090
+ title: component.content.title,
18087
18091
  body: /* @__PURE__ */ jsx115(
18088
18092
  DynamicLayout_default,
18089
18093
  __spreadProps(__spreadValues({}, props), {
@@ -8,5 +8,6 @@ export type ModalComponent = LayoutComponent & {
8
8
  };
9
9
  export type ModalContent = {
10
10
  components: DomainComponent[];
11
+ title?: string;
11
12
  };
12
13
  export declare const createModalComponent: (modalProps: Pick<ModalComponent, "uid" | "content" | "control" | "margin" | "trigger">) => ModalComponent;
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ModalComponent } from '../../domain/components/ModalComponent';
3
3
  import type { ModalRendererProps } from '@wise/dynamic-flow-renderers';
4
- export declare const modalComponentToProps: ({ control, margin, trigger }: ModalComponent, components: ReactNode) => ModalRendererProps;
4
+ export declare const modalComponentToProps: ({ content, control, margin, trigger }: ModalComponent, components: ReactNode) => ModalRendererProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.17.1",
3
+ "version": "3.18.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -52,10 +52,10 @@
52
52
  "@testing-library/react": "16.0.0",
53
53
  "@testing-library/react-hooks": "8.0.1",
54
54
  "@testing-library/user-event": "14.5.2",
55
- "@transferwise/components": "46.65.0",
55
+ "@transferwise/components": "46.70.2",
56
56
  "@transferwise/formatting": "^2.13.0",
57
57
  "@transferwise/icons": "3.13.0",
58
- "@transferwise/neptune-css": "14.15.0",
58
+ "@transferwise/neptune-css": "14.18.0",
59
59
  "@types/enzyme": "^3.10.18",
60
60
  "@types/jest": "29.5.12",
61
61
  "@types/react": "18.3.4",
@@ -104,7 +104,7 @@
104
104
  "nanoid": "5.0.7",
105
105
  "react-webcam": "^7.2.0",
106
106
  "screenfull": "^5.2.0",
107
- "@wise/dynamic-flow-types": "2.20.1"
107
+ "@wise/dynamic-flow-types": "2.21.0"
108
108
  },
109
109
  "scripts": {
110
110
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",