@wise/dynamic-flow-client 1.3.0 → 1.3.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.
Files changed (135) hide show
  1. package/build/main.js +614 -3429
  2. package/build/main.min.js +1 -22
  3. package/build/types/common/constants/index.d.ts +0 -1
  4. package/build/types/common/hooks/useExternalStepPolling/useExternalStepPolling.d.ts +1 -10
  5. package/build/types/common/hooks/usePersistAsync/usePersistAsync.d.ts +1 -1
  6. package/build/types/common/hooks/useStepPolling/useStepPolling.d.ts +1 -1
  7. package/build/types/common/utils/index.d.ts +3 -1
  8. package/build/types/common/utils/misc-utils.d.ts +2 -0
  9. package/build/types/{types/specification/Model.d.ts → common/utils/model-utils.d.ts} +1 -6
  10. package/build/types/common/utils/schema-utils.d.ts +23 -11
  11. package/build/types/common/utils/step-utils.d.ts +1 -1
  12. package/build/types/common/validators/models/model-validators.d.ts +1 -1
  13. package/build/types/common/validators/models/models.utils.d.ts +1 -1
  14. package/build/types/common/validators/schemas/schema-validators.d.ts +1 -1
  15. package/build/types/common/validators/validationFailures/validation-failures.d.ts +1 -1
  16. package/build/types/dynamicFlow/DynamicFlowStep.d.ts +1 -1
  17. package/build/types/dynamicFlow/DynamicFlowTypes.d.ts +1 -1
  18. package/build/types/dynamicFlow/utils/responseParsers/response-parsers.d.ts +1 -1
  19. package/build/types/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.d.ts +2 -1
  20. package/build/types/dynamicFlow/utils/useDynamicFlowState.d.ts +1 -1
  21. package/build/types/formControl/FormControl.d.ts +58 -2
  22. package/build/types/index.d.ts +1 -2
  23. package/build/types/jsonSchemaForm/JsonSchemaForm.d.ts +1 -1
  24. package/build/types/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -1
  25. package/build/types/jsonSchemaForm/arrayTypeSchema/ArraySchema.d.ts +1 -1
  26. package/build/types/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.d.ts +1 -1
  27. package/build/types/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.d.ts +1 -2
  28. package/build/types/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.d.ts +1 -1
  29. package/build/types/jsonSchemaForm/controlFeedback/ControlFeedback.d.ts +1 -1
  30. package/build/types/jsonSchemaForm/genericSchema/GenericSchema.d.ts +1 -1
  31. package/build/types/jsonSchemaForm/objectSchema/ObjectSchema.d.ts +1 -1
  32. package/build/types/jsonSchemaForm/oneOfSchema/OneOfSchema.d.ts +1 -1
  33. package/build/types/jsonSchemaForm/oneOfSchema/{utils/one-of-utils.d.ts → utils.d.ts} +1 -2
  34. package/build/types/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.d.ts +1 -1
  35. package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.d.ts +1 -1
  36. package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.d.ts +1 -1
  37. package/build/types/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.d.ts +1 -1
  38. package/build/types/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.d.ts +1 -1
  39. package/build/types/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.d.ts +1 -1
  40. package/build/types/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.d.ts +1 -1
  41. package/build/types/jsonSchemaForm/readOnlySchema/ReadOnlySchema.d.ts +1 -1
  42. package/build/types/jsonSchemaForm/schemaFormControl/SchemaFormControl.d.ts +1 -1
  43. package/build/types/jsonSchemaForm/schemaFormControl/utils/mapping-utils.d.ts +1 -1
  44. package/build/types/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.d.ts +1 -2
  45. package/build/types/layout/DynamicLayout.d.ts +1 -1
  46. package/build/types/layout/alert/DynamicAlert.d.ts +1 -1
  47. package/build/types/layout/box/DynamicBox.d.ts +1 -1
  48. package/build/types/layout/button/DynamicButton.d.ts +1 -1
  49. package/build/types/layout/button/utils.d.ts +1 -2
  50. package/build/types/layout/columns/DynamicColumns.d.ts +1 -1
  51. package/build/types/layout/decision/DynamicDecision.d.ts +1 -1
  52. package/build/types/layout/divider/DynamicDivider.d.ts +1 -1
  53. package/build/types/layout/external/DynamicExternal.d.ts +1 -1
  54. package/build/types/layout/form/DynamicForm.d.ts +1 -1
  55. package/build/types/layout/heading/DynamicHeading.d.ts +1 -1
  56. package/build/types/layout/image/DynamicImage.d.ts +1 -1
  57. package/build/types/layout/list/DynamicList.d.ts +1 -1
  58. package/build/types/layout/loadingIndicator/DynamicLoadingIndicator.d.ts +1 -1
  59. package/build/types/layout/markdown/DynamicMarkdown.d.ts +1 -1
  60. package/build/types/layout/paragraph/DynamicParagraph.d.ts +1 -1
  61. package/build/types/layout/review/DynamicReview.d.ts +1 -1
  62. package/build/types/layout/utils.d.ts +1 -1
  63. package/build/types/step/cameraStep/CameraStep.d.ts +1 -1
  64. package/build/types/step/cameraStep/cameraCapture/CameraCapture.d.ts +1 -1
  65. package/build/types/step/cameraStep/cameraCapture/hooks/index.d.ts +1 -1
  66. package/build/types/step/cameraStep/cameraCapture/tracking/index.d.ts +1 -1
  67. package/build/types/step/layoutStep/LayoutStep.d.ts +1 -1
  68. package/build/types/step/layoutStep/utils/inline-reference-utils.d.ts +1 -1
  69. package/build/types/step/layoutStep/utils/layout-utils.d.ts +1 -1
  70. package/package.json +4 -2
  71. package/build/types/common/constants/SchemaType.d.ts +0 -11
  72. package/build/types/fixtures/components/alert.d.ts +0 -3
  73. package/build/types/fixtures/components/box.d.ts +0 -3
  74. package/build/types/fixtures/components/button.d.ts +0 -3
  75. package/build/types/fixtures/components/columns.d.ts +0 -3
  76. package/build/types/fixtures/components/copyable.d.ts +0 -3
  77. package/build/types/fixtures/components/decision-flags.d.ts +0 -3
  78. package/build/types/fixtures/components/decision-icons.d.ts +0 -3
  79. package/build/types/fixtures/components/decision.d.ts +0 -3
  80. package/build/types/fixtures/components/heading.d.ts +0 -3
  81. package/build/types/fixtures/components/image.d.ts +0 -3
  82. package/build/types/fixtures/components/index.d.ts +0 -15
  83. package/build/types/fixtures/components/info.d.ts +0 -3
  84. package/build/types/fixtures/components/list.d.ts +0 -3
  85. package/build/types/fixtures/components/loading-indicator.d.ts +0 -3
  86. package/build/types/fixtures/components/paragraph.d.ts +0 -3
  87. package/build/types/fixtures/components/review.d.ts +0 -3
  88. package/build/types/fixtures/examples/camera-capture.d.ts +0 -3
  89. package/build/types/fixtures/examples/index.d.ts +0 -5
  90. package/build/types/fixtures/examples/recipient-update.d.ts +0 -3
  91. package/build/types/fixtures/examples/recipient.d.ts +0 -3
  92. package/build/types/fixtures/examples/single-file-upload.d.ts +0 -3
  93. package/build/types/fixtures/examples/step-validation-errors.d.ts +0 -3
  94. package/build/types/fixtures/features/action-response.d.ts +0 -3
  95. package/build/types/fixtures/features/external.d.ts +0 -3
  96. package/build/types/fixtures/features/index.d.ts +0 -5
  97. package/build/types/fixtures/features/persist-async.d.ts +0 -3
  98. package/build/types/fixtures/features/polling.d.ts +0 -3
  99. package/build/types/fixtures/features/validation-async.d.ts +0 -3
  100. package/build/types/fixtures/index.d.ts +0 -50
  101. package/build/types/fixtures/jsonSchemaForm/allOf.d.ts +0 -3
  102. package/build/types/fixtures/layouts/all.d.ts +0 -3
  103. package/build/types/fixtures/layouts/final-step-layout.d.ts +0 -3
  104. package/build/types/fixtures/layouts/index.d.ts +0 -6
  105. package/build/types/fixtures/layouts/list.d.ts +0 -3
  106. package/build/types/fixtures/layouts/pay-in.d.ts +0 -3
  107. package/build/types/fixtures/layouts/review.d.ts +0 -3
  108. package/build/types/fixtures/layouts/success.d.ts +0 -3
  109. package/build/types/fixtures/responses/action-response-final.d.ts +0 -3
  110. package/build/types/fixtures/responses/action.d.ts +0 -5
  111. package/build/types/fixtures/responses/exit.d.ts +0 -6
  112. package/build/types/fixtures/responses/index.d.ts +0 -4
  113. package/build/types/fixtures/responses/recipient-update-final.d.ts +0 -3
  114. package/build/types/fixtures/schemas/all-of.d.ts +0 -3
  115. package/build/types/fixtures/schemas/basic-form.d.ts +0 -3
  116. package/build/types/fixtures/schemas/boolean.d.ts +0 -3
  117. package/build/types/fixtures/schemas/index.d.ts +0 -6
  118. package/build/types/fixtures/schemas/number-and-integer.d.ts +0 -3
  119. package/build/types/fixtures/schemas/one-of.d.ts +0 -3
  120. package/build/types/fixtures/schemas/string-formats.d.ts +0 -3
  121. package/build/types/fixtures/utils/image-util.d.ts +0 -2
  122. package/build/types/jsonSchemaForm/oneOfSchema/utils/const-schema-utils.d.ts +0 -3
  123. package/build/types/jsonSchemaForm/oneOfSchema/utils/index.d.ts +0 -2
  124. package/build/types/types/common/FormControl.d.ts +0 -57
  125. package/build/types/types/index.d.ts +0 -15
  126. package/build/types/types/specification/Action.d.ts +0 -19
  127. package/build/types/types/specification/FileUploadSchema.d.ts +0 -23
  128. package/build/types/types/specification/LayoutComponent.d.ts +0 -145
  129. package/build/types/types/specification/PersistAsync.d.ts +0 -8
  130. package/build/types/types/specification/Polling.d.ts +0 -12
  131. package/build/types/types/specification/Promotion.d.ts +0 -20
  132. package/build/types/types/specification/Schema.d.ts +0 -192
  133. package/build/types/types/specification/Step.d.ts +0 -118
  134. package/build/types/types/specification/ValidationAsync.d.ts +0 -6
  135. package/build/types/types/specification/core.d.ts +0 -29
@@ -1,5 +1,4 @@
1
1
  export * from './DateMode';
2
2
  export * from './FormControlType';
3
3
  export * from './MonthFormat';
4
- export * from './SchemaType';
5
4
  export * from './Size';
@@ -1,12 +1,3 @@
1
- import { Action, PollingConfiguration } from '../../../types';
2
- export type ExternalStepPollingConfiguration = PollingConfiguration & {
3
- maxConsecutiveFails: number;
4
- responseHandlers: ResponseHandler[];
5
- };
6
- type ResponseHandler = {
7
- result: string;
8
- action: Action;
9
- };
1
+ import { Action, ExternalStepPollingConfiguration } from '@wise/dynamic-flow-types';
10
2
  /** @deprecated External step is no longer supported */
11
3
  export declare function useExternalStepPolling(polling: ExternalStepPollingConfiguration | undefined, onAction: (action: Action) => void): void;
12
- export {};
@@ -1,4 +1,4 @@
1
- import { PersistAsync } from '../../../types';
1
+ import { PersistAsync } from '@wise/dynamic-flow-types';
2
2
  type PersistAsyncModel = string | Blob | null;
3
3
  type PerformPersistAsyncFunction = (payload: PersistAsyncModel) => Promise<{
4
4
  data: string | number;
@@ -1,2 +1,2 @@
1
- import { Action, PollingConfiguration } from '../../../types';
1
+ import { Action, PollingConfiguration } from '@wise/dynamic-flow-types';
2
2
  export declare function useStepPolling(polling: PollingConfiguration | undefined, onAction: (action: Action) => void): void;
@@ -4,5 +4,7 @@ export * from './debounce';
4
4
  export * from './is-equal';
5
5
  export * from './file-utils';
6
6
  export * from './id-utils';
7
- export * from './schema-utils';
8
7
  export * from './step-utils';
8
+ export * from './model-utils';
9
+ export * from './misc-utils';
10
+ export * from './schema-utils';
@@ -0,0 +1,2 @@
1
+ import { FormErrors } from '@wise/dynamic-flow-types';
2
+ export declare const isBasicError: (error: FormErrors) => error is string | null;
@@ -1,9 +1,4 @@
1
- export type BasicModel = boolean | number | string;
2
- export type ObjectModel = {
3
- [key: string]: Model;
4
- };
5
- export type ArrayModel = Array<BasicModel | null>;
6
- export type Model = BasicModel | ObjectModel | ArrayModel | null;
1
+ import { ArrayModel, BasicModel, Model, ObjectModel } from '@wise/dynamic-flow-types';
7
2
  export declare const isObjectModel: (model: Model) => model is ObjectModel;
8
3
  export declare const isNullableObjectModel: (model: Model) => model is ObjectModel | null;
9
4
  export declare const isNullableBasicModel: (model: Model) => model is BasicModel | null;
@@ -1,13 +1,25 @@
1
- import { Schema, isAllOfSchema as isAllOfSchemaDF, isOneOfSchema as isOneOfSchemaDF } from '../../types';
1
+ import { AllOfSchema, ArraySchema, BasicSchema, BlobSchema, ConstSchema, FileUploadSchema, ListArraySchema, MultipleFileUploadSchema, ObjectSchema, OneOfObjectSchema, OneOfSchema, PersistAsyncSchema, Schema, StringSchema, TupleArraySchema, ValidationAsyncSchema } from '@wise/dynamic-flow-types';
2
+ export declare function isConstSchema(schema: Schema | undefined): schema is ConstSchema;
3
+ export declare function isNoNConstSchema(schema: Schema | undefined): boolean;
2
4
  export declare const isReadOnlySchema: (schema: Schema) => boolean;
3
5
  export declare const isPromotedOneOfSchema: (schema: Schema) => boolean;
4
- /**
5
- * @deprecated Please use isOneOfSchema type guard function from "dynamic-flow-types"
6
- */
7
- export declare const isOneOfSchema: typeof isOneOfSchemaDF;
8
- /**
9
- * @deprecated Please use isAllOfSchema type guard function from "dynamic-flow-types"
10
- */
11
- export declare const isAllOfSchema: typeof isAllOfSchemaDF;
12
- export declare const getSchemaType: (schema: Schema) => string | null;
13
- export declare function shouldDebounceSchema(schema: Schema): boolean;
6
+ export declare const basicTypes: Set<string>;
7
+ export declare function isBasicSchema(schema: Schema): schema is BasicSchema;
8
+ export declare function isObjectSchema(schema: Schema): schema is ObjectSchema;
9
+ export declare function isOneOfObjectSchema(schema: Schema): schema is OneOfObjectSchema;
10
+ export declare function isOneOfSchema(schema: Schema): schema is OneOfSchema;
11
+ export declare function isAllOfSchema(schema: Schema): schema is AllOfSchema;
12
+ export declare function isBlobSchema(schema: Schema): schema is BlobSchema;
13
+ export declare function isArraySchema(schema: Schema): schema is ArraySchema;
14
+ export declare function isTupleArraySchema(schema: ArraySchema): schema is TupleArraySchema;
15
+ export declare function isListArraySchema(schema: ArraySchema): schema is ListArraySchema;
16
+ export declare function isStringSchema(schema: Schema): schema is StringSchema;
17
+ export declare function isPersistAsyncSchema(schema: Schema): schema is PersistAsyncSchema;
18
+ export declare function isPersistAsyncFileSchema(schema: Schema): schema is PersistAsyncSchema;
19
+ export declare const isValidationAsyncSchema: (schema: Schema) => schema is ValidationAsyncSchema;
20
+ export declare function isFileUploadSchema(schema: {
21
+ type?: string;
22
+ format?: string;
23
+ }): schema is FileUploadSchema;
24
+ export declare const isMultipleFileUploadSchema: (schema: Schema) => schema is MultipleFileUploadSchema;
25
+ export declare const getSchemaType: (schema: Schema) => "persistAsync" | "array" | "object" | "allOf" | "oneOf" | "readOnly" | "validationAsync" | "promotedOneOf" | "basic" | null;
@@ -1,3 +1,3 @@
1
- import { Schema, Step } from '../../types';
1
+ import { Schema, Step } from '@wise/dynamic-flow-types';
2
2
  export declare const isCameraStep: (step: Step) => boolean;
3
3
  export declare const filterHiddenSchemas: (schemas: Schema[]) => Schema[];
@@ -1,4 +1,4 @@
1
- import { BasicModel, Model, ObjectModel, Schema } from '../../../types';
1
+ import { BasicModel, Model, ObjectModel, Schema } from '@wise/dynamic-flow-types';
2
2
  export declare const getValidModelParts: (model: Model, schema: Schema) => Model;
3
3
  export declare function getValidBasicModelOrNull(model: BasicModel | null, schema: Schema): BasicModel | null;
4
4
  export declare function getValidObjectModelParts(model: ObjectModel | null, schema: Schema): ObjectModel | null;
@@ -1,4 +1,4 @@
1
- import { AllOfSchema, ArrayModel, ArraySchema, BasicModel, Model, ObjectModel, ObjectSchema, OneOfSchema } from '../../../types';
1
+ import { AllOfSchema, ArrayModel, ArraySchema, BasicModel, Model, ObjectModel, ObjectSchema, OneOfSchema } from '@wise/dynamic-flow-types';
2
2
  export declare function cleanBasicModelWithOneOfSchema(model: BasicModel, schema: OneOfSchema): BasicModel | null;
3
3
  export declare function cleanArrayModelWithOneOfSchema(model: ArrayModel, schema: OneOfSchema): ArrayModel | null;
4
4
  export declare function cleanModelWithStringSchema(model: Model): string | null;
@@ -1,4 +1,4 @@
1
- import { Model, Schema } from '../../../types';
1
+ import { Model, Schema } from '@wise/dynamic-flow-types';
2
2
  /**
3
3
  * Validate any value against a given schema
4
4
  *
@@ -1,4 +1,4 @@
1
- import { BlobSchema, NumberSchema, IntegerSchema, Model, Schema, AllOfSchema, OneOfSchema, StringSchema } from '../../../types';
1
+ import { BlobSchema, NumberSchema, IntegerSchema, Model, Schema, AllOfSchema, OneOfSchema, StringSchema } from '@wise/dynamic-flow-types';
2
2
  declare function getValidationFailures(value: Model, schema: Schema, isRequired: boolean): string[];
3
3
  declare function getStringValidationFailures(value: Model, schema: StringSchema, isRequired?: boolean): string[];
4
4
  declare function getNumberValidationFailures(value: Model, schema: AllOfSchema | OneOfSchema | NumberSchema | IntegerSchema, isRequired?: boolean): string[];
@@ -1,5 +1,5 @@
1
+ import { GlobalError, Step } from '@wise/dynamic-flow-types';
1
2
  import { LayoutStepProps } from '../step/layoutStep/LayoutStep';
2
- import { GlobalError, Step } from '../types';
3
3
  type DynamicFlowStepProps = Omit<LayoutStepProps, 'stepSpecification'> & {
4
4
  step: Step | undefined;
5
5
  globalError: GlobalError;
@@ -1,6 +1,6 @@
1
+ import { Action, Schema, Size, Step } from '@wise/dynamic-flow-types';
1
2
  import { EventHandler, LogEventHandler } from '../common/contexts';
2
3
  import { OnChangeProps } from '../jsonSchemaForm/JsonSchemaForm';
3
- import { Action, Schema, Size, Step } from '../types';
4
4
  export type DynamicFlowPropsBasic = {
5
5
  flowId: string;
6
6
  loaderConfig?: LoaderConfig;
@@ -1,4 +1,4 @@
1
- import { ActionResponseBody, ErrorResponseBody, Step } from '../../../types';
1
+ import { ActionResponseBody, ErrorResponseBody, Step } from '@wise/dynamic-flow-types';
2
2
  import { DynamicFlowProps } from '../../DynamicFlowTypes';
3
3
  type ParsedBody = {
4
4
  type: 'exit';
@@ -1,5 +1,6 @@
1
- import { Schema } from '../../../types';
1
+ import { Schema } from '@wise/dynamic-flow-types';
2
2
  import { ETag } from '../../DynamicFlowTypes';
3
3
  type FetchRefresh = (url: string, data: unknown, etag: ETag | undefined) => Promise<void | null>;
4
4
  export declare function useDebouncedRefresh(fetchRefresh: FetchRefresh): (url: string, data: unknown, etag: ETag | undefined, schema: Schema) => void;
5
+ export declare const shouldDebounceSchema: (schema: Schema) => boolean;
5
6
  export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { FormErrors, GlobalError, ObjectModel, Step } from '../../types';
2
+ import { FormErrors, GlobalError, ObjectModel, Step } from '@wise/dynamic-flow-types';
3
3
  type ModelsMap = {
4
4
  [key: string]: ObjectModel;
5
5
  };
@@ -1,6 +1,8 @@
1
1
  import { RadioGroupRadios } from '@transferwise/components/build/types/radioGroup/RadioGroup';
2
+ import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
3
+ import { ReactNode } from 'react';
2
4
  import { PureComponent } from 'react';
3
- import { FormControlProps, FormControlState, FormControlOption } from '../types';
5
+ import { FormControlType } from '../common/constants';
4
6
  export default class FormControl extends PureComponent<FormControlProps, FormControlState> {
5
7
  static Type: {
6
8
  RADIO: string;
@@ -44,7 +46,7 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
44
46
  * is present. Chrome ignores autocomplete=off, the only way to disable it is
45
47
  * to provide an 'invalid' value, for which 'disabled' serves.
46
48
  */
47
- getAutocompleteStatus: () => "disabled" | "on";
49
+ getAutocompleteStatus: () => "on" | "disabled";
48
50
  handleOnChange: (value: string | number | boolean | null) => void;
49
51
  handleInputOnChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
50
52
  handleOnFocus: () => void;
@@ -84,3 +86,57 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
84
86
  value: null;
85
87
  };
86
88
  }
89
+ type FormControlOption = {
90
+ value: number | string | boolean;
91
+ label: string;
92
+ disabled?: boolean;
93
+ note?: string;
94
+ secondary?: string;
95
+ };
96
+ type FormControlSelectedOption = {
97
+ value: number | string | boolean;
98
+ label: string;
99
+ icon?: ReactNode;
100
+ currency?: string;
101
+ note?: ReactNode;
102
+ secondary?: ReactNode;
103
+ };
104
+ type FormControlProps = {
105
+ name: string;
106
+ onChange: (value: string | number | boolean | null, type?: 'init' | 'user') => void;
107
+ autoComplete?: boolean;
108
+ countryCode?: string;
109
+ disabled?: boolean;
110
+ displayPattern?: string;
111
+ id: string;
112
+ label?: string;
113
+ max?: number;
114
+ maxDate?: Date;
115
+ maxLength?: number;
116
+ min?: number;
117
+ minDate?: Date;
118
+ minLength?: number;
119
+ mode?: 'day-month-year' | 'month-year';
120
+ monthFormat?: 'long' | 'short';
121
+ onBlur?: () => void;
122
+ onFocus?: () => void;
123
+ onSearchChange?: (searchValue: string) => void;
124
+ options: Array<FormControlOption>;
125
+ placeholder?: string;
126
+ readOnly?: boolean;
127
+ required?: boolean;
128
+ searchPlaceholder?: string;
129
+ searchValue?: string;
130
+ selectedOption?: FormControlSelectedOption;
131
+ size?: 'sm' | 'md' | 'lg';
132
+ step?: number;
133
+ type?: (typeof FormControlType)[keyof typeof FormControlType];
134
+ uploadProps: UploadProps;
135
+ value: Date | string | number | boolean | null;
136
+ };
137
+ type FormControlState = {
138
+ prevValue: FormControlProps['value'];
139
+ selectedOption: FormControlSelectedOption | undefined;
140
+ touched: boolean;
141
+ };
142
+ export {};
@@ -4,8 +4,7 @@ export { makeHttpClient } from './common/makeHttpClient';
4
4
  export { default as JsonSchemaForm } from './jsonSchemaForm';
5
5
  export { DynamicLayout as Layout } from './layout';
6
6
  export { isValidSchema } from './common/validators';
7
- export { fixtures } from './fixtures';
8
7
  export { default as translations } from './i18n';
9
8
  export * from './dynamicFlow/DynamicFlow';
10
9
  export type { DynamicFlowProps, InitialAction } from './dynamicFlow/DynamicFlowTypes';
11
- export type { Step } from './types';
10
+ export type { Step } from '@wise/dynamic-flow-types';
@@ -1,6 +1,6 @@
1
+ import { FormErrors, Model, Schema } from '@wise/dynamic-flow-types';
1
2
  import { EventHandler, LogEventHandler } from '../common/contexts';
2
3
  import { OnPersistAsync } from '../dynamicFlow/DynamicFlowTypes';
3
- import { FormErrors, Model, Schema } from '../types';
4
4
  declare const JsonSchemaForm: (props: JsonSchemaFormProps) => JSX.Element;
5
5
  export type OnChange = (parameters: OnChangeProps) => void;
6
6
  export type OnChangeProps = {
@@ -1,4 +1,4 @@
1
- import { AllOfSchema as AllOfSchemaType, ObjectModel } from '../../types';
1
+ import { AllOfSchema as AllOfSchemaType, ObjectModel } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
3
  declare const AllOfSchema: {
4
4
  (props: AllOfSchemaProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ArrayModel, ArraySchema as ArraySchemaType } from '../../types';
1
+ import { ArrayModel, ArraySchema as ArraySchemaType } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
3
  declare const ArraySchema: {
4
4
  (props: ArraySchemaProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ArrayModel, ArraySchema as ArraySchemaType } from '../../../types';
1
+ import { ArrayModel, ArraySchema as ArraySchemaType } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
3
3
  declare const ArrayListSchema: {
4
4
  (props: Props): JSX.Element;
@@ -1,5 +1,4 @@
1
- import { ArrayModel } from '../../../../types';
2
- import { MultipleFileUploadSchema as MultipleFileUploadSchemaType } from '../../../../types';
1
+ import { ArrayModel, MultipleFileUploadSchema as MultipleFileUploadSchemaType } from '@wise/dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../../../genericSchema/GenericSchema';
4
3
  declare const MultipleFileUploadSchema: {
5
4
  (props: Props): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BasicModel, BasicSchema } from '../../types';
1
+ import { BasicModel, BasicSchema } from '@wise/dynamic-flow-types';
2
2
  import { OnChange } from '../JsonSchemaForm';
3
3
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
4
  declare const BasicTypeSchema: {
@@ -1,4 +1,4 @@
1
- import { Schema } from '../../types';
1
+ import { Schema } from '@wise/dynamic-flow-types';
2
2
  declare const ControlFeedback: {
3
3
  (props: ControlFeedbackProps): JSX.Element;
4
4
  defaultProps: {
@@ -1,5 +1,5 @@
1
+ import { FormErrors, Model, Schema } from '@wise/dynamic-flow-types';
1
2
  import { OnPersistAsync } from '../../dynamicFlow/DynamicFlowTypes';
2
- import { FormErrors, Model, Schema } from '../../types';
3
3
  import { OnChange } from '../JsonSchemaForm';
4
4
  declare const GenericSchemaForm: (props: GenericSchemaFormProps) => JSX.Element;
5
5
  export type GenericSchemaProps = {
@@ -1,4 +1,4 @@
1
- import { ObjectModel, ObjectSchema as ObjectSchemaType } from '../../types';
1
+ import { ObjectModel, ObjectSchema as ObjectSchemaType } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
3
  declare const ObjectSchema: {
4
4
  (props: ObjectSchemaProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { OneOfSchema as OneOfSchemaType } from '../../types';
1
+ import { OneOfSchema as OneOfSchemaType } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
3
  declare const OneOfSchema: {
4
4
  (props: OneOfSchemaProps): JSX.Element | null;
@@ -1,5 +1,4 @@
1
- import { Model, ObjectModel, OneOfSchema } from '../../../types';
2
- import { OneOfObjectSchema } from '../../../types';
1
+ import { Model, ObjectModel, OneOfSchema, OneOfObjectSchema } from '@wise/dynamic-flow-types';
3
2
  export declare const getActiveSchemaIndex: (schema: OneOfSchema, model: Model) => number | null;
4
3
  export declare const getValidIndexFromValue: (schema: OneOfSchema, value: Model | undefined) => number;
5
4
  export declare function getBestMatchingSchemaIndexForValue(schema: OneOfObjectSchema, value: ObjectModel): number | null;
@@ -1,4 +1,4 @@
1
- import { PersistAsyncSchema as PersistAsyncSchemaType } from '../../types';
1
+ import { PersistAsyncSchema as PersistAsyncSchemaType } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
3
  declare const PersistAsyncSchema: {
4
4
  (props: PersistAsyncSchemaProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { PersistAsync, Schema } from '../../../types';
1
+ import { PersistAsync, Schema } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
3
3
  export declare const getIdFromResponse: (idProperty: string, response: Record<string, unknown>) => string | number;
4
4
  export declare const getErrorFromResponse: (errorProperty: string, response: {
@@ -1,4 +1,4 @@
1
- import { BlobSchema, PersistAsync, Schema } from '../../../types';
1
+ import { BlobSchema, PersistAsync, Schema } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../../genericSchema/GenericSchema';
3
3
  declare const PersistAsyncBlobSchema: {
4
4
  (props: PersistAsyncBlobSchemaProps): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { UploadProps } from '@transferwise/components/build/types/upload/Upload';
2
+ import { PersistAsync } from '@wise/dynamic-flow-types';
2
3
  import { HttpClient } from '../../../dynamicFlow/DynamicFlowTypes';
3
- import { PersistAsync } from '../../../types';
4
4
  type Props = UploadProps & {
5
5
  id: string;
6
6
  httpClient: HttpClient;
@@ -1,4 +1,4 @@
1
- import { ObjectModel, OneOfObjectSchema } from '../../types';
1
+ import { ObjectModel, OneOfObjectSchema } from '@wise/dynamic-flow-types';
2
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
3
3
  declare const PromotedOneOfSchema: (props: PromotedOneOfSchemaProps) => JSX.Element;
4
4
  export type PromotedOneOfSchemaProps = Omit<GenericSchemaProps, 'schema' | 'model'> & {
@@ -1,2 +1,2 @@
1
- import { ObjectModel, OneOfObjectSchema } from '../../types';
1
+ import { ObjectModel, OneOfObjectSchema } from '@wise/dynamic-flow-types';
2
2
  export declare const getSelectionFromModel: (schema: OneOfObjectSchema, model: ObjectModel) => "promoted" | "other" | null;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Icon, Image, Promotion } from '../../../types';
2
+ import { Icon, Image, Promotion } from '@wise/dynamic-flow-types';
3
3
  declare const PromotedOneOfControl: {
4
4
  (props: PromotedOneOfControlProps): JSX.Element;
5
5
  defaultProps: {
@@ -1,4 +1,4 @@
1
- import { Model, Schema } from '../../types';
1
+ import { Model, Schema } from '@wise/dynamic-flow-types';
2
2
  type ReadOnlySchemaProps = {
3
3
  schema: Schema;
4
4
  model: Model;
@@ -1,5 +1,5 @@
1
+ import { BasicModel, Schema } from '@wise/dynamic-flow-types';
1
2
  import { FormControlType } from '../../common/constants';
2
- import { BasicModel, Schema } from '../../types';
3
3
  export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
4
4
  declare const SchemaFormControl: {
5
5
  (props: SchemaFormControlProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { Icon, Image, Schema } from '../../../types';
1
+ import { Icon, Image, Schema } from '@wise/dynamic-flow-types';
2
2
  declare const mapConstSchemaToOption: <ControlType extends string>(schema: Schema, controlType?: ControlType | undefined) => ControlType extends "select" ? SelectOption : RadioOption;
3
3
  type RadioOption = {
4
4
  disabled?: boolean | undefined;
@@ -1,5 +1,4 @@
1
- import { BasicModel } from '../../types';
2
- import { ValidationAsyncSchema as ValidationAsyncSchemaType } from '../../types';
1
+ import { BasicModel, ValidationAsyncSchema as ValidationAsyncSchemaType } from '@wise/dynamic-flow-types';
3
2
  import { GenericSchemaProps } from '../genericSchema/GenericSchema';
4
3
  declare const ValidationAsyncSchema: {
5
4
  (props: ValidationAsyncSchemaProps): JSX.Element;
@@ -1,5 +1,5 @@
1
+ import { FormErrors, LayoutComponent, Model } from '@wise/dynamic-flow-types';
1
2
  import { OnAction, OnModelChange, OnPersistAsync } from '../dynamicFlow/DynamicFlowTypes';
2
- import { FormErrors, LayoutComponent, Model } from '../types';
3
3
  export type CommonLayoutProps = {
4
4
  model?: Model;
5
5
  submitted: boolean;
@@ -1,4 +1,4 @@
1
- import { Alert as AlertType } from '../../types';
1
+ import { Alert as AlertType } from '@wise/dynamic-flow-types';
2
2
  declare const DynamicAlert: (props: {
3
3
  component: AlertType;
4
4
  }) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BoxLayout } from '../../types';
1
+ import { BoxLayout } from '@wise/dynamic-flow-types';
2
2
  import { CommonLayoutProps } from '../DynamicLayout';
3
3
  type Props = CommonLayoutProps & {
4
4
  component: BoxLayout;
@@ -1,4 +1,4 @@
1
- import { ButtonLayout } from '../../types';
1
+ import { ButtonLayout } from '@wise/dynamic-flow-types';
2
2
  import { CommonLayoutProps } from '../DynamicLayout';
3
3
  type Props = Omit<CommonLayoutProps, 'submitted' | 'onModelChange' | 'onPersistAsync'> & {
4
4
  component: ButtonLayout;
@@ -1,5 +1,4 @@
1
- import { ButtonLayout } from '../../types';
2
- import { Size } from '../../types';
1
+ import { ButtonLayout, Size } from '@wise/dynamic-flow-types';
3
2
  export declare const getButtonPriority: (component: ButtonLayout) => "primary" | "secondary" | "tertiary";
4
3
  export declare const getButtonType: (component: ButtonLayout) => "positive" | "negative" | "accent";
5
4
  export declare const getButtonSize: (size: Size | undefined) => "sm" | "md" | "lg";
@@ -1,4 +1,4 @@
1
- import { ColumnsLayout } from '../../types';
1
+ import { ColumnsLayout } from '@wise/dynamic-flow-types';
2
2
  import { CommonLayoutProps } from '../DynamicLayout';
3
3
  type Props = CommonLayoutProps & {
4
4
  component: ColumnsLayout;
@@ -1,5 +1,5 @@
1
+ import { DecisionLayout } from '@wise/dynamic-flow-types';
1
2
  import { OnAction } from '../../dynamicFlow/DynamicFlowTypes';
2
- import { DecisionLayout } from '../../types';
3
3
  type Props = {
4
4
  component: DecisionLayout;
5
5
  onAction: OnAction;
@@ -1,4 +1,4 @@
1
- import { DividerLayout } from '../../types';
1
+ import { DividerLayout } from '@wise/dynamic-flow-types';
2
2
  type Props = {
3
3
  component: DividerLayout;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { Action, ExternalLayout } from '../../types';
1
+ import { Action, ExternalLayout } from '@wise/dynamic-flow-types';
2
2
  type Props = {
3
3
  component: ExternalLayout;
4
4
  onAction: (action: Action) => void;
@@ -1,4 +1,4 @@
1
- import { FormLayout } from '../../types';
1
+ import { FormLayout } from '@wise/dynamic-flow-types';
2
2
  import { CommonLayoutProps } from '../DynamicLayout';
3
3
  type Props = Omit<CommonLayoutProps, 'onAction'> & {
4
4
  component: FormLayout;
@@ -1,4 +1,4 @@
1
- import { HeadingLayout } from '../../types';
1
+ import { HeadingLayout } from '@wise/dynamic-flow-types';
2
2
  declare const DynamicHeading: (props: {
3
3
  component: HeadingLayout;
4
4
  }) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ImageLayout } from '../../types';
1
+ import { ImageLayout } from '@wise/dynamic-flow-types';
2
2
  type DynamicImageProps = {
3
3
  component: ImageLayout;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { Action, ListLayout } from '../../types';
1
+ import { Action, ListLayout } from '@wise/dynamic-flow-types';
2
2
  type Props = {
3
3
  component: ListLayout;
4
4
  onAction: (action: Action) => void;
@@ -1,4 +1,4 @@
1
- import { LoadingIndicatorLayout } from '../../types';
1
+ import { LoadingIndicatorLayout } from '@wise/dynamic-flow-types';
2
2
  type Props = {
3
3
  component: LoadingIndicatorLayout;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { InfoLayout, MarkdownLayout } from '../../types';
1
+ import { InfoLayout, MarkdownLayout } from '@wise/dynamic-flow-types';
2
2
  type DynamicMarkdownProps = {
3
3
  component: MarkdownLayout;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { ParagraphLayout } from '../../types';
1
+ import { ParagraphLayout } from '@wise/dynamic-flow-types';
2
2
  type Props = {
3
3
  component: ParagraphLayout;
4
4
  };
@@ -1,5 +1,5 @@
1
+ import { ReviewLayout } from '@wise/dynamic-flow-types';
1
2
  import { OnAction } from '../../dynamicFlow/DynamicFlowTypes';
2
- import { ReviewLayout } from '../../types';
3
3
  type Props = {
4
4
  component: ReviewLayout;
5
5
  onAction: OnAction;
@@ -1,4 +1,4 @@
1
- import { Align, Size } from '../types';
1
+ import { Align, Size } from '@wise/dynamic-flow-types';
2
2
  declare const getMarginBottom: (size: Size | undefined) => "" | "m-b-0" | "m-b-1" | "m-b-2" | "m-b-3" | "m-b-5";
3
3
  declare const getTextAlignmentAndMargin: (component: {
4
4
  align?: Align;
@@ -1,5 +1,5 @@
1
+ import { Step } from '@wise/dynamic-flow-types';
1
2
  import { CommonLayoutProps } from '../../layout/DynamicLayout';
2
- import { Step } from '../../types';
3
3
  export type CameraStepProps = Omit<CommonLayoutProps, 'onPersistAsync' | 'baseUrl'> & {
4
4
  step: Step;
5
5
  };
@@ -1,5 +1,5 @@
1
+ import { CameraDirection } from '@wise/dynamic-flow-types';
1
2
  import { EventHandler } from '../../../common/contexts';
2
- import { CameraDirection } from '../../../types';
3
3
  type Props = {
4
4
  direction?: CameraDirection;
5
5
  overlay?: string;
@@ -1,4 +1,4 @@
1
- import { CameraDirection } from '../../../../types';
1
+ import { CameraDirection } from '@wise/dynamic-flow-types';
2
2
  export declare const useVideoConstraints: (direction: CameraDirection) => {
3
3
  videoConstraints: MediaTrackConstraints | undefined;
4
4
  };
@@ -1,5 +1,5 @@
1
+ import { CameraDirection } from '@wise/dynamic-flow-types';
1
2
  import { EventHandler } from '../../../../common/contexts';
2
- import { CameraDirection } from '../../../../types';
3
3
  export declare const trackCameraPermissionDenied: (onEvent: EventHandler | undefined) => void | undefined;
4
4
  export declare const trackCameraFeedStarted: (onEvent: EventHandler | undefined, props: {
5
5
  direction?: CameraDirection;