@wise/dynamic-flow-client 2.3.2 → 2.5.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.
@@ -2,11 +2,13 @@ export declare const FormControlType: {
2
2
  RADIO: string;
3
3
  CHECKBOX: string;
4
4
  SELECT: string;
5
+ EMAIL: string;
5
6
  FILE: string;
6
7
  DATE: string;
7
8
  DATETIME: string;
8
9
  DATELOOKUP: string;
9
10
  TEL: string;
11
+ NUMERIC: string;
10
12
  NUMBER: string;
11
13
  HIDDEN: string;
12
14
  PASSWORD: string;
@@ -1,5 +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
4
  import { ReactNode } from 'react';
4
5
  import { PureComponent } from 'react';
5
6
  import { FormControlType } from '../common/constants';
@@ -8,11 +9,13 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
8
9
  RADIO: string;
9
10
  CHECKBOX: string;
10
11
  SELECT: string;
12
+ EMAIL: string;
11
13
  FILE: string;
12
14
  DATE: string;
13
15
  DATETIME: string;
14
16
  DATELOOKUP: string;
15
17
  TEL: string;
18
+ NUMERIC: string;
16
19
  NUMBER: string;
17
20
  HIDDEN: string;
18
21
  PASSWORD: string;
@@ -41,12 +44,7 @@ export default class FormControl extends PureComponent<FormControlProps, FormCon
41
44
  prevValue: string | number | boolean | Date | null;
42
45
  value: string | number | boolean | Date | null;
43
46
  } | null;
44
- /**
45
- * autocomplete hides our form help so we need to disable it when help text
46
- * is present. Chrome ignores autocomplete=off, the only way to disable it is
47
- * to provide an 'invalid' value, for which 'disabled' serves.
48
- */
49
- getAutocompleteStatus: () => "on" | "disabled";
47
+ getAutocompleteValue: () => string;
50
48
  handleOnChange: (value: string | number | boolean | null) => void;
51
49
  handleInputOnChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
52
50
  handleOnFocus: () => void;
@@ -104,7 +102,9 @@ type FormControlSelectedOption = {
104
102
  type FormControlProps = {
105
103
  name: string;
106
104
  onChange: (value: string | number | boolean | null, type?: 'init' | 'user') => void;
105
+ /** @deprecated - Use autocompleteHint instead */
107
106
  autoComplete?: boolean;
107
+ autocompleteHint?: AutocompleteHint[];
108
108
  countryCode?: string;
109
109
  disabled?: boolean;
110
110
  displayPattern?: string;
@@ -0,0 +1,2 @@
1
+ import { AutocompleteHint } from '@wise/dynamic-flow-types';
2
+ export declare const getAutocompleteString: (hints: AutocompleteHint[]) => string;
@@ -1 +1,2 @@
1
1
  export * from './value-utils';
2
+ export { getAutocompleteString } from './getAutocompleteString';
@@ -1,6 +1,7 @@
1
- import { BasicModel, Schema } from '@wise/dynamic-flow-types';
1
+ import { BasicModel, Schema, StringSchema } from '@wise/dynamic-flow-types';
2
2
  import { FormControlType } from '../../common/constants';
3
3
  export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
4
+ export declare const getStringSchemaControlType: ({ format, control, }: StringSchema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
4
5
  declare const SchemaFormControl: {
5
6
  (props: SchemaFormControlProps): JSX.Element;
6
7
  defaultProps: {
@@ -1,5 +1,5 @@
1
1
  import { Align, Size } from '../../../renderers/types';
2
- declare const getTopMargin: (size: Size) => "" | "m-t-2" | "m-t-0" | "m-t-1" | "m-t-3" | "m-t-5";
2
+ declare const getTopMargin: (size: Size) => "" | "m-t-1" | "m-t-2" | "m-t-0" | "m-t-3" | "m-t-5";
3
3
  declare const getTextAlignmentAndTopMargin: (component: {
4
4
  align: Align;
5
5
  margin: Size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "2.3.2",
3
+ "version": "2.5.0",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -18,35 +18,35 @@
18
18
  "url": "git+https://github.com/transferwise/dynamic-flow.git"
19
19
  },
20
20
  "devDependencies": {
21
- "@babel/core": "7.23.2",
22
- "@babel/plugin-syntax-flow": "7.22.5",
21
+ "@babel/core": "7.23.3",
22
+ "@babel/plugin-syntax-flow": "7.23.3",
23
23
  "@babel/plugin-transform-react-jsx": "7.22.15",
24
- "@babel/preset-env": "7.23.2",
25
- "@babel/preset-react": "7.22.15",
26
- "@babel/preset-typescript": "7.23.2",
24
+ "@babel/preset-env": "7.23.3",
25
+ "@babel/preset-react": "7.23.3",
26
+ "@babel/preset-typescript": "7.23.3",
27
27
  "@cfaester/enzyme-adapter-react-18": "0.7.1",
28
28
  "@formatjs/cli": "^4.8.4",
29
- "@storybook/addon-a11y": "7.5.1",
30
- "@storybook/addon-actions": "7.5.1",
31
- "@storybook/addon-essentials": "7.5.1",
32
- "@storybook/addon-interactions": "7.5.1",
33
- "@storybook/addon-links": "7.5.1",
34
- "@storybook/react": "7.5.1",
35
- "@storybook/react-webpack5": "7.5.1",
29
+ "@storybook/addon-a11y": "7.5.3",
30
+ "@storybook/addon-actions": "7.5.3",
31
+ "@storybook/addon-essentials": "7.5.3",
32
+ "@storybook/addon-interactions": "7.5.3",
33
+ "@storybook/addon-links": "7.5.3",
34
+ "@storybook/react": "7.5.3",
35
+ "@storybook/react-webpack5": "7.5.3",
36
36
  "@storybook/testing-library": "0.2.2",
37
37
  "@testing-library/dom": "9.3.3",
38
38
  "@testing-library/jest-dom": "6.1.4",
39
- "@testing-library/react": "14.0.0",
39
+ "@testing-library/react": "14.1.0",
40
40
  "@testing-library/react-hooks": "8.0.1",
41
41
  "@testing-library/user-event": "14.5.1",
42
42
  "@transferwise/components": "45.17.1",
43
43
  "@transferwise/eslint-config": "8.2.0",
44
44
  "@transferwise/formatting": "^2.10.0",
45
- "@transferwise/icons": "3.10.0",
45
+ "@transferwise/icons": "3.12.0",
46
46
  "@transferwise/neptune-css": "14.6.1",
47
47
  "@transferwise/neptune-tokens": "8.5.1",
48
- "@types/enzyme": "^3.10.15",
49
- "@types/jest": "29.5.6",
48
+ "@types/enzyme": "^3.10.16",
49
+ "@types/jest": "29.5.8",
50
50
  "@types/react": "18",
51
51
  "@types/react-dom": "18",
52
52
  "@types/testing-library__jest-dom": "5.14.9",
@@ -57,21 +57,21 @@
57
57
  "currency-flags": "4.0.7",
58
58
  "enzyme": "^3.11.0",
59
59
  "esbuild": "0.19.5",
60
- "eslint": "8.52.0",
60
+ "eslint": "8.53.0",
61
61
  "eslint-plugin-storybook": "0.6.15",
62
62
  "jest": "29.7.0",
63
63
  "jest-environment-jsdom": "29.7.0",
64
64
  "jest-fetch-mock": "^3.0.3",
65
65
  "jest-watch-typeahead": "^2.2.2",
66
66
  "npm-run-all": "4.1.5",
67
- "postcss": "^8.4.21",
67
+ "postcss": "^8.4.31",
68
68
  "postcss-cli": "^10.1.0",
69
69
  "postcss-import": "^15.1.0",
70
70
  "prettier": "2.8.8",
71
71
  "react": "18.2.0",
72
72
  "react-dom": "18.2.0",
73
- "react-intl": "6.5.1",
74
- "storybook": "7.5.1",
73
+ "react-intl": "6.5.4",
74
+ "storybook": "7.5.3",
75
75
  "stylelint": "14.16.1",
76
76
  "stylelint-config-standard": "25.0.0",
77
77
  "stylelint-no-unsupported-browser-features": "5.0.4",
@@ -91,9 +91,9 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "classnames": "2.3.2",
94
- "react-webcam": "^7.1.1",
94
+ "react-webcam": "^7.2.0",
95
95
  "screenfull": "^5.2.0",
96
- "@wise/dynamic-flow-types": "2.0.1"
96
+ "@wise/dynamic-flow-types": "2.2.0"
97
97
  },
98
98
  "prettier": "@transferwise/eslint-config/.prettierrc.js",
99
99
  "scripts": {