@toptal/picasso-forms 6.0.3 → 7.1.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/Input/Input.js CHANGED
@@ -1,9 +1,24 @@
1
- import React from 'react';
1
+ import React, { useEffect } from 'react';
2
2
  import { Input as PicassoInput } from '@toptal/picasso';
3
3
  import FieldWrapper from '../FieldWrapper';
4
- export const Input = React.forwardRef((props, ref) => (React.createElement(FieldWrapper, Object.assign({}, props), (inputProps) => {
5
- return React.createElement(PicassoInput, Object.assign({}, inputProps, { ref: ref }));
6
- })));
4
+ const warnAutocompleteDisabledInput = (name) => {
5
+ const autocompleteDisabled = name && /^(((field|input)(_|-)?\d+)|tan|otp|title|captcha)$/.test(name);
6
+ if (autocompleteDisabled) {
7
+ console.warn(`
8
+ In Chromium-based browsers, autocomplete might be disabled for input[name="${name}"].
9
+ Known bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1255609
10
+ `);
11
+ }
12
+ };
13
+ export const Input = React.forwardRef((props, ref) => {
14
+ useEffect(() => {
15
+ // TODO: remove this console.warn completely when Chrome fixes autocomplete issue
16
+ // Regex is taken from https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/autocomplete_history_manager.cc;l=53;drc=1d2260f9ed19c755db1631b7fb9b1ba216b323dc
17
+ // according to https://bugs.chromium.org/p/chromium/issues/detail?id=1255609
18
+ warnAutocompleteDisabledInput(props.name);
19
+ }, [props.name]);
20
+ return (React.createElement(FieldWrapper, Object.assign({}, props), (inputProps) => React.createElement(PicassoInput, Object.assign({}, inputProps, { ref: ref }))));
21
+ });
7
22
  Input.defaultProps = {};
8
23
  Input.displayName = 'Input';
9
24
  export default Input;
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,IAAI,YAAY,EAAc,MAAM,i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L,oBAAC,YAAY,oBAAqB,KAAK,GACpC,CAAC,UAAsB,EAAE,EAAE,CAAC,oBAAC,YAAY,oBAAK,UAAU,IAAE,GAAG,EAAE,GAAG,IAAI,CAC1D,CAChB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,KAAK,CAAC,YAAY,GAAG,EAAE,CAAA;AAEvB,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA;AAE3B,eAAe,KAAK,CAAA"}
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export { FORM_ERROR, FormApi, MutableState, AnyObject, FieldValidator, SubmissionErrors, Config, setIn } from 'final-form';
1
+ export type { FormApi, MutableState, AnyObject, FieldValidator, SubmissionErrors, Config } from 'final-form';
2
+ export { FORM_ERROR, setIn } from 'final-form';
2
3
  export { useForm, useField, useFormState, FormSpy, Form as FinalForm, Field as FinalField } from 'react-final-form';
3
4
  export type { FieldMetaState, FieldRenderProps, FormRenderProps, FieldProps, FormProps, FieldInputProps } from 'react-final-form';
4
5
  export { default as arrayMutators } from 'final-form-arrays';
package/index.js CHANGED
@@ -1,4 +1,3 @@
1
- // Final Form exports
2
1
  export { FORM_ERROR, setIn } from 'final-form';
3
2
  export { useForm, useField, useFormState, FormSpy, Form as FinalForm, Field as FinalField } from 'react-final-form';
4
3
  export { default as arrayMutators } from 'final-form-arrays';
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,qBAAqB;AACrB,OAAO,EAAE,UAAU,EAA8E,KAAK,EAAE,MAAM,YAAY,CAAA;AAC1H,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEnH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEzF,wBAAwB;AACxB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAExD,qEAAqE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEnH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEzF,wBAAwB;AACxB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAExD,qEAAqE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/picasso-forms",
3
- "version": "6.0.3",
3
+ "version": "7.1.0",
4
4
  "description": "Picasso form components",
5
5
  "author": "Toptal",
6
6
  "homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso-forms#readme",
@@ -8,22 +8,22 @@
8
8
  "main": "index.js",
9
9
  "module": "index.js",
10
10
  "publishConfig": {
11
- "access": "public"
11
+ "access": "public",
12
+ "directory": "dist-package"
12
13
  },
13
14
  "repository": {
14
15
  "type": "git",
15
16
  "url": "git+https://github.com/toptal/picasso.git"
16
17
  },
17
18
  "scripts": {
18
- "build:package": "cross-env NODE_ENV=production node ../../bin/build.js --tsConfig=./tsconfig.build.json",
19
- "prepublishOnly": "../../bin/prepublish.js"
19
+ "build:package": "cross-env NODE_ENV=production node ../../bin/build.js --tsConfig=./tsconfig.build.json"
20
20
  },
21
21
  "bugs": {
22
22
  "url": "https://github.com/toptal/picasso/issues"
23
23
  },
24
24
  "peerDependencies": {
25
- "@toptal/picasso": "^12",
26
- "@toptal/picasso-lab": "^9",
25
+ "@toptal/picasso": "^13.5.0",
26
+ "@toptal/picasso-lab": "^10.0.0",
27
27
  "@toptal/picasso-shared": "^7",
28
28
  "react": "^16.12.0",
29
29
  "react-dom": "^16.12.0"
@@ -40,6 +40,5 @@
40
40
  "@types/classnames": "^2.3.1",
41
41
  "@types/react-final-form-listeners": "^1.0.0",
42
42
  "storybook-readme": "^5.0.9"
43
- },
44
- "gitHead": "a9395c2baeb83faba283c532c9e509227a6cab43"
43
+ }
45
44
  }