@wise/dynamic-flow-client 2.6.0 → 2.6.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.
@@ -1,6 +1,6 @@
1
1
  import { RadioGroupRadios } from '@transferwise/components/build/types/radioGroup/RadioGroup';
2
2
  import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
3
- import { AutocompleteHint } from '@wise/dynamic-flow-types';
3
+ import { AutocompleteToken } from '@wise/dynamic-flow-types';
4
4
  import { ReactNode } from 'react';
5
5
  import { PureComponent } from 'react';
6
6
  import { FormControlType } from '../common/constants';
@@ -104,7 +104,7 @@ type FormControlProps = {
104
104
  onChange: (value: string | number | boolean | null, type?: 'init' | 'user') => void;
105
105
  /** @deprecated - Use autocompleteHint instead */
106
106
  autoComplete?: boolean;
107
- autocompleteHint?: AutocompleteHint[];
107
+ autocompleteHint?: AutocompleteToken[];
108
108
  countryCode?: string;
109
109
  disabled?: boolean;
110
110
  displayPattern?: string;
@@ -1,2 +1,2 @@
1
- import { AutocompleteHint } from '@wise/dynamic-flow-types';
2
- export declare const getAutocompleteString: (hints: AutocompleteHint[]) => string;
1
+ import { AutocompleteToken } from '@wise/dynamic-flow-types';
2
+ export declare const getAutocompleteString: (hints: AutocompleteToken[]) => string;
@@ -0,0 +1,18 @@
1
+ import { Margin, Model, Size } from '@wise/dynamic-flow-types';
2
+ import { RenderableComponent, StepComponent } from '../types';
3
+ export type BoxComponent = RenderableComponent & {
4
+ type: 'box';
5
+ border: boolean;
6
+ width: Size;
7
+ margin: Margin;
8
+ components: StepComponent[];
9
+ getChildren: () => StepComponent[];
10
+ getValue: () => Model;
11
+ };
12
+ export declare const createBoxComponent: (boxProps: {
13
+ uid: string;
14
+ border: boolean;
15
+ width: Size;
16
+ margin: Margin;
17
+ components: StepComponent[];
18
+ }) => BoxComponent;
@@ -0,0 +1,4 @@
1
+ import { BoxLayout } from '@wise/dynamic-flow-types';
2
+ import { StepComponent } from '../../types';
3
+ import { MapperProps } from '../schema/types';
4
+ export declare const boxLayoutToComponent: ({ components, width, margin, border }: BoxLayout, mapperProps: MapperProps) => StepComponent;
@@ -0,0 +1,4 @@
1
+ import { LayoutComponent } from '@wise/dynamic-flow-types';
2
+ import { StepComponent } from '../types';
3
+ import { MapperProps } from './schema/types';
4
+ export declare const mapLayoutToComponent: (layout: LayoutComponent, mapperProps: MapperProps) => StepComponent;
@@ -1,4 +1,4 @@
1
1
  import { Schema } from '@wise/dynamic-flow-types';
2
2
  import { StepComponent } from '../types';
3
3
  import { MapperProps } from './schema/types';
4
- export declare const mapSchemaToComponents: (schema: Schema, mapperProps: MapperProps) => StepComponent;
4
+ export declare const mapSchemaToComponent: (schema: Schema, mapperProps: MapperProps) => StepComponent;
@@ -1,9 +1,9 @@
1
1
  import { Step as DFStep } from '@wise/dynamic-flow-types';
2
- import { OnAction, StepComponent, UpdateComponent } from '../types';
2
+ import { OnAction, UpdateComponent } from '../types';
3
3
  type MapStepToComponentsProps = {
4
4
  step: DFStep;
5
5
  updateComponent: UpdateComponent;
6
6
  onAction: OnAction;
7
7
  };
8
- export declare const mapStepToComponents: (mapStepToComponentsProps: MapStepToComponentsProps) => StepComponent[];
8
+ export declare const mapStepToComponents: (mapStepToComponentsProps: MapStepToComponentsProps) => import("../types").StepComponent[];
9
9
  export {};
@@ -1,12 +1,13 @@
1
1
  import { Action, Margin, Model } from '@wise/dynamic-flow-types';
2
2
  import { AlertComponent } from './components/AlertComponent';
3
+ import { BoxComponent } from './components/BoxComponent';
3
4
  import { ButtonComponent } from './components/ButtonComponent';
4
5
  import { HeadingComponent } from './components/HeadingComponent';
5
6
  import { ObjectComponent } from './components/ObjectComponent';
6
7
  import { ParagraphComponent } from './components/ParagraphComponent';
7
8
  import { TextInputComponent } from './components/TextInputComponent';
8
- export type StepComponent = AlertComponent | HeadingComponent | ParagraphComponent | ObjectComponent | TextInputComponent | ButtonComponent;
9
- export type ContainerComponent = ObjectComponent;
9
+ export type StepComponent = AlertComponent | BoxComponent | ButtonComponent | HeadingComponent | ObjectComponent | ParagraphComponent | TextInputComponent;
10
+ export type ContainerComponent = ObjectComponent | BoxComponent;
10
11
  export type BaseComponent = {
11
12
  type: string;
12
13
  uid: string;
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ import { BoxComponent } from '../../domain/components/BoxComponent';
3
+ import { BoxRendererProps } from '../types';
4
+ export declare const boxComponentToProps: ({ keyProp, border, width, margin }: BoxComponent, children: ReactNode) => BoxRendererProps;
@@ -18,6 +18,13 @@ export interface AlertRendererProps extends RendererProps {
18
18
  context: Context;
19
19
  margin: Margin;
20
20
  }
21
+ export interface BoxRendererProps extends RendererProps {
22
+ type: 'box';
23
+ border: boolean;
24
+ width: Size;
25
+ margin: Margin;
26
+ children: ReactNode;
27
+ }
21
28
  export interface HeadingRendererProps extends RendererProps {
22
29
  type: 'heading';
23
30
  text: string;
@@ -1,4 +1,4 @@
1
1
  import { Model } from '@wise/dynamic-flow-types';
2
- import { StepComponent } from '../domain/types';
3
- export declare const isContainerComponent: (component: StepComponent) => component is import("../domain/components/ObjectComponent").ObjectComponent;
2
+ import { ContainerComponent, StepComponent } from '../domain/types';
3
+ export declare const isContainerComponent: (component: StepComponent) => component is ContainerComponent;
4
4
  export declare const isObjectModel: (model: Model) => model is Record<string, Model>;
@@ -0,0 +1,3 @@
1
+ import { BoxRendererProps, Renderer } from '../../renderers/types';
2
+ declare const BoxRenderer: Renderer<BoxRendererProps>;
3
+ export default BoxRenderer;
@@ -1,7 +1,7 @@
1
1
  import { Align, Size } from '../../../renderers/types';
2
- declare const getTopMargin: (size: Size) => "" | "m-t-1" | "m-t-2" | "m-t-0" | "m-t-3" | "m-t-5";
3
- declare const getTextAlignmentAndTopMargin: (component: {
2
+ declare const getMargin: (size: Size) => "" | "m-b-0" | "m-b-1" | "m-b-2" | "m-b-3" | "m-b-5";
3
+ declare const getTextAlignmentAndMargin: (component: {
4
4
  align: Align;
5
5
  margin: Size;
6
6
  }) => string;
7
- export { getTopMargin, getTextAlignmentAndTopMargin };
7
+ export { getMargin, getTextAlignmentAndMargin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -94,7 +94,7 @@
94
94
  "classnames": "2.3.2",
95
95
  "react-webcam": "^7.2.0",
96
96
  "screenfull": "^5.2.0",
97
- "@wise/dynamic-flow-types": "2.2.0"
97
+ "@wise/dynamic-flow-types": "2.2.1"
98
98
  },
99
99
  "prettier": "@transferwise/eslint-config/.prettierrc.js",
100
100
  "scripts": {