@wise/dynamic-flow-client 3.32.0 → 3.34.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.
@@ -1,5 +1,5 @@
1
- import type { Icon, Image } from '@wise/dynamic-flow-types/build/next';
2
- import type { LayoutComponent } from '../types';
1
+ import type { Icon } from '@wise/dynamic-flow-types/build/next';
2
+ import type { Image, LayoutComponent } from '../types';
3
3
  export type DecisionComponent = LayoutComponent & {
4
4
  type: 'decision';
5
5
  options: DecisionOption[];
@@ -8,6 +8,7 @@ export type DecisionComponent = LayoutComponent & {
8
8
  export type DecisionOption = {
9
9
  description?: string;
10
10
  disabled?: boolean;
11
+ href?: string;
11
12
  icon?: Icon;
12
13
  image?: Image;
13
14
  title: string;
@@ -0,0 +1,30 @@
1
+ import { Icon } from "@wise/dynamic-flow-types/build/next";
2
+ import { Image, LayoutComponent } from "../types";
3
+ export type ListComponent = LayoutComponent & {
4
+ type: 'list';
5
+ items: ListItem[];
6
+ title?: string;
7
+ callToAction?: ListCallToActionAction | ListCallToActionLink;
8
+ };
9
+ export type ListCallToActionLink = {
10
+ type: 'link';
11
+ accessibilityDescription?: string;
12
+ href: string;
13
+ title: string;
14
+ onClick: () => void;
15
+ };
16
+ export type ListCallToActionAction = {
17
+ type: 'action';
18
+ accessibilityDescription?: string;
19
+ title: string;
20
+ onClick: () => void;
21
+ };
22
+ export type ListItem = {
23
+ icon?: Icon;
24
+ image?: Image;
25
+ title?: string;
26
+ subtitle?: string;
27
+ value?: string;
28
+ subvalue?: string;
29
+ };
30
+ export declare const createListComponent: (listProps: Pick<ListComponent, "uid" | "callToAction" | "control" | "items" | "margin" | "title">) => ListComponent;
@@ -28,5 +28,5 @@ export declare const mergeSummaries: (summaryA: RepeatableSummary, summaryB: Rep
28
28
  title: string | undefined;
29
29
  description: string | undefined;
30
30
  icon: Icon | undefined;
31
- image: Image | undefined;
31
+ image: import("../../types").Image | undefined;
32
32
  };
@@ -1,3 +1,8 @@
1
- import type { DecisionLayout } from '@wise/dynamic-flow-types/build/next';
1
+ import type { DecisionLayout, DecisionLayoutOption } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { MapperProps } from '../schema/types';
3
- export declare const decisionLayoutToComponent: (uid: string, { control, margin, options, title }: DecisionLayout, { onAction, step }: MapperProps) => import("../../components/DecisionComponent").DecisionComponent;
3
+ import { SpecNextBehavior } from '../../types';
4
+ export declare const decisionLayoutToComponent: (uid: string, { control, margin, options, title }: Omit<DecisionLayout, "options"> & {
5
+ options: (DecisionLayoutOption & {
6
+ behavior?: SpecNextBehavior;
7
+ })[];
8
+ }, mapperProps: MapperProps) => import("../../components/DecisionComponent").DecisionComponent;
@@ -0,0 +1,2 @@
1
+ import type { ListLayout } from '@wise/dynamic-flow-types/build/next';
2
+ export declare const deprecatedListLayoutToComponent: (uid: string, { control, items, margin, title }: ListLayout) => import("../../components/StatusListComponent").StatusListComponent;
@@ -1,2 +1,4 @@
1
- import type { ListLayout } from '@wise/dynamic-flow-types/build/next';
2
- export declare const listLayoutToComponent: (uid: string, { control, items, margin, title }: ListLayout) => import("../../components/StatusListComponent").StatusListComponent;
1
+ import { ListLayout } from "@wise/dynamic-flow-types/build/next";
2
+ import { ListComponent } from "../../components/ListComponent";
3
+ import { MapperProps } from "../schema/types";
4
+ export declare const listLayoutToComponent: (uid: string, { callToAction, control, items, margin, title }: ListLayout, mapperProps: MapperProps) => ListComponent;
@@ -1,4 +1,4 @@
1
- import type { Action, Icon, Image, JsonElement, Margin, Model } from '@wise/dynamic-flow-types/build/next';
1
+ import type { Action, Icon, JsonElement, Margin, Model } from '@wise/dynamic-flow-types/build/next';
2
2
  import type { AlertComponent } from './components/AlertComponent';
3
3
  import type { AllOfComponent } from './components/AllOfComponent';
4
4
  import type { BooleanInputComponent } from './components/BooleanInputComponent';
@@ -32,7 +32,8 @@ import type { StepDomainComponent } from './components/StepDomainComponent';
32
32
  import type { TextInputComponent } from './components/TextInputComponent';
33
33
  import { TupleComponent } from './components/TupleComponent';
34
34
  import type { UploadInputComponent } from './components/UploadInputComponent';
35
- export type DomainComponent = StepDomainComponent | AlertComponent | AllOfComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ConstComponent | ContainerComponent | DateInputComponent | DecisionComponent | DividerComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | IntegerInputComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | MultiSelectComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | RepeatableComponent | ReviewComponent | SearchComponent | SelectInputComponent | StatusListComponent | TextInputComponent | TupleComponent | UploadInputComponent;
35
+ import { ListComponent } from './components/ListComponent';
36
+ export type DomainComponent = StepDomainComponent | AlertComponent | AllOfComponent | BooleanInputComponent | BoxComponent | ButtonComponent | ColumnsComponent | ConstComponent | ContainerComponent | DateInputComponent | DecisionComponent | DividerComponent | FormComponent | HeadingComponent | ImageComponent | InstructionsComponent | IntegerInputComponent | ListComponent | LoadingIndicatorComponent | MarkdownComponent | ModalComponent | MultiSelectComponent | MultiUploadInputComponent | NumberInputComponent | ObjectComponent | ParagraphComponent | RepeatableComponent | ReviewComponent | SearchComponent | SelectInputComponent | StatusListComponent | TextInputComponent | TupleComponent | UploadInputComponent;
36
37
  export type LocalValue = LocalValuePrimitive | LocalValueObject | LocalValueArray;
37
38
  export type LocalValuePrimitive = string | number | boolean | File | null;
38
39
  export interface LocalValueObject extends Record<string, LocalValuePrimitive | LocalValueObject | LocalValueArray> {
@@ -55,6 +56,12 @@ export type LayoutComponent = BaseComponent & {
55
56
  margin: Margin;
56
57
  getLocalValue: () => LocalValue;
57
58
  };
59
+ export type Image = {
60
+ url?: string;
61
+ uri?: string;
62
+ accessibilityDescription?: string;
63
+ text?: string;
64
+ };
58
65
  export type ComponentWithTitle = BaseComponent & {
59
66
  control?: string;
60
67
  description?: string;
@@ -0,0 +1,3 @@
1
+ import type { ListComponent } from '../../domain/components/ListComponent';
2
+ import type { ListRendererProps } from '@wise/dynamic-flow-renderers';
3
+ export declare const listComponentToProps: (component: ListComponent) => ListRendererProps;
@@ -10,7 +10,11 @@ export declare const inputComponentToProps: <T extends string, V extends LocalVa
10
10
  help: string | undefined;
11
11
  icon: import("@wise/dynamic-flow-renderers").Icon | undefined;
12
12
  id: string;
13
- image: import("@wise/dynamic-flow-renderers").Image | undefined;
13
+ image: {
14
+ accessibilityDescription: string | undefined;
15
+ uri: string | undefined;
16
+ url: string;
17
+ } | undefined;
14
18
  label: string | undefined;
15
19
  placeholder: string | undefined;
16
20
  required: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.32.0",
3
+ "version": "3.34.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -53,7 +53,7 @@
53
53
  "@testing-library/jest-dom": "6.6.3",
54
54
  "@testing-library/react": "16.2.0",
55
55
  "@testing-library/user-event": "14.6.1",
56
- "@transferwise/components": "46.87.0",
56
+ "@transferwise/components": "46.87.1",
57
57
  "@transferwise/formatting": "^2.13.0",
58
58
  "@transferwise/icons": "3.18.0",
59
59
  "@transferwise/neptune-css": "14.20.1",
@@ -85,8 +85,8 @@
85
85
  "tsx": "4.19.2",
86
86
  "typescript": "5.7.3",
87
87
  "webpack": "5.97.1",
88
- "@wise/dynamic-flow-renderers": "0.0.0",
89
- "@wise/dynamic-flow-fixtures": "0.0.1"
88
+ "@wise/dynamic-flow-fixtures": "0.0.1",
89
+ "@wise/dynamic-flow-renderers": "0.0.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@transferwise/components": "^46.31",
@@ -102,7 +102,7 @@
102
102
  "classnames": "2.5.1",
103
103
  "react-webcam": "^7.2.0",
104
104
  "screenfull": "^5.2.0",
105
- "@wise/dynamic-flow-types": "2.31.0"
105
+ "@wise/dynamic-flow-types": "2.32.0"
106
106
  },
107
107
  "scripts": {
108
108
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",