@commercetools-uikit/password-field 15.15.1 → 16.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.
@@ -64,40 +64,33 @@ var messages = reactIntl.defineMessages({
64
64
  });
65
65
 
66
66
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
67
-
68
67
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
69
68
  const sequentialId = utils.createSequentialId('password-field-');
70
69
  const sequentialErrorsId = utils.createSequentialId('password-field-error-')();
71
70
 
71
+ // Similar shape of `FormikErrors` but values are `TFieldErrors` objects.
72
+
72
73
  const hasErrors = errors => {
73
74
  var _context;
74
-
75
75
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
76
76
  };
77
-
78
77
  const defaultProps = {
79
78
  horizontalConstraint: 'scale'
80
79
  };
81
-
82
80
  const PasswordField = props => {
83
81
  const intl = reactIntl.useIntl();
84
-
85
82
  const _useToggleState = hooks.useToggleState(false),
86
- _useToggleState2 = _slicedToArray(_useToggleState, 2),
87
- isPasswordVisible = _useToggleState2[0],
88
- togglePasswordVisibility = _useToggleState2[1];
89
-
83
+ _useToggleState2 = _slicedToArray(_useToggleState, 2),
84
+ isPasswordVisible = _useToggleState2[0],
85
+ togglePasswordVisibility = _useToggleState2[1];
90
86
  const id = hooks.useFieldId(props.id, sequentialId);
91
87
  const hasError = props.touched && hasErrors(props.errors);
92
-
93
88
  if (!props.isReadOnly) {
94
89
  process.env.NODE_ENV !== "production" ? utils.warning(Boolean(props.onChange), 'PasswordField: `onChange` is required when field is not read only.') : void 0;
95
90
  }
96
-
97
91
  if (props.hintIcon) {
98
92
  process.env.NODE_ENV !== "production" ? utils.warning(typeof props.hint === 'string' || /*#__PURE__*/react.isValidElement(props.hint), 'PasswordField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
99
93
  }
100
-
101
94
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
102
95
  max: props.horizontalConstraint,
103
96
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -148,7 +141,6 @@ const PasswordField = props => {
148
141
  })
149
142
  });
150
143
  };
151
-
152
144
  PasswordField.propTypes = process.env.NODE_ENV !== "production" ? {
153
145
  id: _pt__default["default"].string,
154
146
  horizontalConstraint: _pt__default["default"].oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
@@ -180,15 +172,13 @@ PasswordField.defaultProps = defaultProps;
180
172
  * our custom field errors type.
181
173
  * This is primarly useful when using TypeScript.
182
174
  */
183
-
184
175
  PasswordField.toFieldErrors = function toFieldErrors(errors) {
185
176
  return errors;
186
177
  };
187
-
188
178
  var PasswordField$1 = PasswordField;
189
179
 
190
180
  // NOTE: This string will be replaced on build time with the package version.
191
- var version = "15.15.1";
181
+ var version = "16.1.0";
192
182
 
193
183
  exports["default"] = PasswordField$1;
194
184
  exports.version = version;
@@ -63,36 +63,29 @@ var messages = reactIntl.defineMessages({
63
63
  });
64
64
 
65
65
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
66
-
67
66
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
68
67
  const sequentialId = utils.createSequentialId('password-field-');
69
68
  const sequentialErrorsId = utils.createSequentialId('password-field-error-')();
70
69
 
70
+ // Similar shape of `FormikErrors` but values are `TFieldErrors` objects.
71
+
71
72
  const hasErrors = errors => {
72
73
  var _context;
73
-
74
74
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
75
75
  };
76
-
77
76
  const defaultProps = {
78
77
  horizontalConstraint: 'scale'
79
78
  };
80
-
81
79
  const PasswordField = props => {
82
80
  const intl = reactIntl.useIntl();
83
-
84
81
  const _useToggleState = hooks.useToggleState(false),
85
- _useToggleState2 = _slicedToArray(_useToggleState, 2),
86
- isPasswordVisible = _useToggleState2[0],
87
- togglePasswordVisibility = _useToggleState2[1];
88
-
82
+ _useToggleState2 = _slicedToArray(_useToggleState, 2),
83
+ isPasswordVisible = _useToggleState2[0],
84
+ togglePasswordVisibility = _useToggleState2[1];
89
85
  const id = hooks.useFieldId(props.id, sequentialId);
90
86
  const hasError = props.touched && hasErrors(props.errors);
91
-
92
87
  if (!props.isReadOnly) ;
93
-
94
88
  if (props.hintIcon) ;
95
-
96
89
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
97
90
  max: props.horizontalConstraint,
98
91
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -143,7 +136,6 @@ const PasswordField = props => {
143
136
  })
144
137
  });
145
138
  };
146
-
147
139
  PasswordField.propTypes = {};
148
140
  PasswordField.displayName = 'PasswordField';
149
141
  PasswordField.defaultProps = defaultProps;
@@ -152,15 +144,13 @@ PasswordField.defaultProps = defaultProps;
152
144
  * our custom field errors type.
153
145
  * This is primarly useful when using TypeScript.
154
146
  */
155
-
156
147
  PasswordField.toFieldErrors = function toFieldErrors(errors) {
157
148
  return errors;
158
149
  };
159
-
160
150
  var PasswordField$1 = PasswordField;
161
151
 
162
152
  // NOTE: This string will be replaced on build time with the package version.
163
- var version = "15.15.1";
153
+ var version = "16.1.0";
164
154
 
165
155
  exports["default"] = PasswordField$1;
166
156
  exports.version = version;
@@ -39,40 +39,33 @@ var messages = defineMessages({
39
39
  });
40
40
 
41
41
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
42
-
43
42
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
44
43
  const sequentialId = createSequentialId('password-field-');
45
44
  const sequentialErrorsId = createSequentialId('password-field-error-')();
46
45
 
46
+ // Similar shape of `FormikErrors` but values are `TFieldErrors` objects.
47
+
47
48
  const hasErrors = errors => {
48
49
  var _context;
49
-
50
50
  return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
51
51
  };
52
-
53
52
  const defaultProps = {
54
53
  horizontalConstraint: 'scale'
55
54
  };
56
-
57
55
  const PasswordField = props => {
58
56
  const intl = useIntl();
59
-
60
57
  const _useToggleState = useToggleState(false),
61
- _useToggleState2 = _slicedToArray(_useToggleState, 2),
62
- isPasswordVisible = _useToggleState2[0],
63
- togglePasswordVisibility = _useToggleState2[1];
64
-
58
+ _useToggleState2 = _slicedToArray(_useToggleState, 2),
59
+ isPasswordVisible = _useToggleState2[0],
60
+ togglePasswordVisibility = _useToggleState2[1];
65
61
  const id = useFieldId(props.id, sequentialId);
66
62
  const hasError = props.touched && hasErrors(props.errors);
67
-
68
63
  if (!props.isReadOnly) {
69
64
  process.env.NODE_ENV !== "production" ? warning(Boolean(props.onChange), 'PasswordField: `onChange` is required when field is not read only.') : void 0;
70
65
  }
71
-
72
66
  if (props.hintIcon) {
73
67
  process.env.NODE_ENV !== "production" ? warning(typeof props.hint === 'string' || /*#__PURE__*/isValidElement(props.hint), 'PasswordField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
74
68
  }
75
-
76
69
  return jsx(Constraints.Horizontal, {
77
70
  max: props.horizontalConstraint,
78
71
  children: jsxs(Stack, {
@@ -123,7 +116,6 @@ const PasswordField = props => {
123
116
  })
124
117
  });
125
118
  };
126
-
127
119
  PasswordField.propTypes = process.env.NODE_ENV !== "production" ? {
128
120
  id: _pt.string,
129
121
  horizontalConstraint: _pt.oneOf([3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
@@ -155,14 +147,12 @@ PasswordField.defaultProps = defaultProps;
155
147
  * our custom field errors type.
156
148
  * This is primarly useful when using TypeScript.
157
149
  */
158
-
159
150
  PasswordField.toFieldErrors = function toFieldErrors(errors) {
160
151
  return errors;
161
152
  };
162
-
163
153
  var PasswordField$1 = PasswordField;
164
154
 
165
155
  // NOTE: This string will be replaced on build time with the package version.
166
- var version = "15.15.1";
156
+ var version = "16.1.0";
167
157
 
168
158
  export { PasswordField$1 as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/password-field",
3
3
  "description": "A controlled text input component for passwords with validation states.",
4
- "version": "15.15.1",
4
+ "version": "16.1.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,27 +21,27 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "15.15.1",
25
- "@commercetools-uikit/design-system": "15.15.1",
26
- "@commercetools-uikit/field-errors": "15.15.1",
27
- "@commercetools-uikit/field-label": "15.15.1",
28
- "@commercetools-uikit/flat-button": "15.15.1",
29
- "@commercetools-uikit/hooks": "15.15.1",
30
- "@commercetools-uikit/icons": "15.15.1",
31
- "@commercetools-uikit/password-input": "15.15.1",
32
- "@commercetools-uikit/spacings-inline": "15.15.1",
33
- "@commercetools-uikit/spacings-stack": "15.15.1",
34
- "@commercetools-uikit/utils": "15.15.1",
24
+ "@commercetools-uikit/constraints": "16.1.0",
25
+ "@commercetools-uikit/design-system": "16.1.0",
26
+ "@commercetools-uikit/field-errors": "16.1.0",
27
+ "@commercetools-uikit/field-label": "16.1.0",
28
+ "@commercetools-uikit/flat-button": "16.1.0",
29
+ "@commercetools-uikit/hooks": "16.1.0",
30
+ "@commercetools-uikit/icons": "16.1.0",
31
+ "@commercetools-uikit/password-input": "16.1.0",
32
+ "@commercetools-uikit/spacings-inline": "16.1.0",
33
+ "@commercetools-uikit/spacings-stack": "16.1.0",
34
+ "@commercetools-uikit/utils": "16.1.0",
35
35
  "@emotion/react": "^11.10.5",
36
36
  "@emotion/styled": "^11.10.5",
37
37
  "prop-types": "15.8.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "react": "17.0.2",
41
- "react-intl": "^5.25.1"
41
+ "react-intl": "^6.3.2"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "17.x",
45
- "react-intl": "5.x"
45
+ "react-intl": "6.x"
46
46
  }
47
47
  }