@commercetools-uikit/password-field 16.12.1 → 17.0.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,3 +1,3 @@
1
1
  export * from "./declarations/src/index";
2
2
  export { default } from "./declarations/src/index";
3
- //# sourceMappingURL=commercetools-uikit-password-field.cjs.d.ts.map
3
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy11aWtpdC1wYXNzd29yZC1maWVsZC5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -85,6 +85,7 @@ const PasswordField = props => {
85
85
  togglePasswordVisibility = _useToggleState2[1];
86
86
  const id = hooks.useFieldId(props.id, sequentialId);
87
87
  const hasError = props.touched && hasErrors(props.errors);
88
+ const canInteract = !props.isDisabled && !props.isReadOnly;
88
89
  if (!props.isReadOnly) {
89
90
  process.env.NODE_ENV !== "production" ? utils.warning(Boolean(props.onChange), 'PasswordField: `onChange` is required when field is not read only.') : void 0;
90
91
  }
@@ -107,7 +108,7 @@ const PasswordField = props => {
107
108
  description: props.description,
108
109
  onInfoButtonClick: props.onInfoButtonClick,
109
110
  hasRequiredIndicator: props.isRequired
110
- }), !props.isDisabled && !props.isReadOnly && jsxRuntime.jsx(FlatButton__default["default"], {
111
+ }), canInteract && jsxRuntime.jsx(FlatButton__default["default"], {
111
112
  icon: isPasswordVisible ? jsxRuntime.jsx(icons.EyeCrossedIcon, {}) : jsxRuntime.jsx(icons.EyeIcon, {}),
112
113
  label: isPasswordVisible ? intl.formatMessage(messages.hide) : intl.formatMessage(messages.show),
113
114
  onClick: togglePasswordVisibility,
@@ -121,7 +122,7 @@ const PasswordField = props => {
121
122
  onBlur: props.onBlur,
122
123
  onFocus: props.onFocus,
123
124
  isAutofocussed: props.isAutofocussed,
124
- isPasswordVisible: isPasswordVisible,
125
+ isPasswordVisible: canInteract ? isPasswordVisible : false,
125
126
  isDisabled: props.isDisabled,
126
127
  isReadOnly: props.isReadOnly,
127
128
  hasError: hasError,
@@ -178,7 +179,7 @@ PasswordField.toFieldErrors = function toFieldErrors(errors) {
178
179
  var PasswordField$1 = PasswordField;
179
180
 
180
181
  // NOTE: This string will be replaced on build time with the package version.
181
- var version = "16.12.1";
182
+ var version = "17.0.1";
182
183
 
183
184
  exports["default"] = PasswordField$1;
184
185
  exports.version = version;
@@ -84,6 +84,7 @@ const PasswordField = props => {
84
84
  togglePasswordVisibility = _useToggleState2[1];
85
85
  const id = hooks.useFieldId(props.id, sequentialId);
86
86
  const hasError = props.touched && hasErrors(props.errors);
87
+ const canInteract = !props.isDisabled && !props.isReadOnly;
87
88
  if (!props.isReadOnly) ;
88
89
  if (props.hintIcon) ;
89
90
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
@@ -102,7 +103,7 @@ const PasswordField = props => {
102
103
  description: props.description,
103
104
  onInfoButtonClick: props.onInfoButtonClick,
104
105
  hasRequiredIndicator: props.isRequired
105
- }), !props.isDisabled && !props.isReadOnly && jsxRuntime.jsx(FlatButton__default["default"], {
106
+ }), canInteract && jsxRuntime.jsx(FlatButton__default["default"], {
106
107
  icon: isPasswordVisible ? jsxRuntime.jsx(icons.EyeCrossedIcon, {}) : jsxRuntime.jsx(icons.EyeIcon, {}),
107
108
  label: isPasswordVisible ? intl.formatMessage(messages.hide) : intl.formatMessage(messages.show),
108
109
  onClick: togglePasswordVisibility,
@@ -116,7 +117,7 @@ const PasswordField = props => {
116
117
  onBlur: props.onBlur,
117
118
  onFocus: props.onFocus,
118
119
  isAutofocussed: props.isAutofocussed,
119
- isPasswordVisible: isPasswordVisible,
120
+ isPasswordVisible: canInteract ? isPasswordVisible : false,
120
121
  isDisabled: props.isDisabled,
121
122
  isReadOnly: props.isReadOnly,
122
123
  hasError: hasError,
@@ -150,7 +151,7 @@ PasswordField.toFieldErrors = function toFieldErrors(errors) {
150
151
  var PasswordField$1 = PasswordField;
151
152
 
152
153
  // NOTE: This string will be replaced on build time with the package version.
153
- var version = "16.12.1";
154
+ var version = "17.0.1";
154
155
 
155
156
  exports["default"] = PasswordField$1;
156
157
  exports.version = version;
@@ -60,6 +60,7 @@ const PasswordField = props => {
60
60
  togglePasswordVisibility = _useToggleState2[1];
61
61
  const id = useFieldId(props.id, sequentialId);
62
62
  const hasError = props.touched && hasErrors(props.errors);
63
+ const canInteract = !props.isDisabled && !props.isReadOnly;
63
64
  if (!props.isReadOnly) {
64
65
  process.env.NODE_ENV !== "production" ? warning(Boolean(props.onChange), 'PasswordField: `onChange` is required when field is not read only.') : void 0;
65
66
  }
@@ -82,7 +83,7 @@ const PasswordField = props => {
82
83
  description: props.description,
83
84
  onInfoButtonClick: props.onInfoButtonClick,
84
85
  hasRequiredIndicator: props.isRequired
85
- }), !props.isDisabled && !props.isReadOnly && jsx(FlatButton, {
86
+ }), canInteract && jsx(FlatButton, {
86
87
  icon: isPasswordVisible ? jsx(EyeCrossedIcon, {}) : jsx(EyeIcon, {}),
87
88
  label: isPasswordVisible ? intl.formatMessage(messages.hide) : intl.formatMessage(messages.show),
88
89
  onClick: togglePasswordVisibility,
@@ -96,7 +97,7 @@ const PasswordField = props => {
96
97
  onBlur: props.onBlur,
97
98
  onFocus: props.onFocus,
98
99
  isAutofocussed: props.isAutofocussed,
99
- isPasswordVisible: isPasswordVisible,
100
+ isPasswordVisible: canInteract ? isPasswordVisible : false,
100
101
  isDisabled: props.isDisabled,
101
102
  isReadOnly: props.isReadOnly,
102
103
  hasError: hasError,
@@ -153,6 +154,6 @@ PasswordField.toFieldErrors = function toFieldErrors(errors) {
153
154
  var PasswordField$1 = PasswordField;
154
155
 
155
156
  // NOTE: This string will be replaced on build time with the package version.
156
- var version = "16.12.1";
157
+ var version = "17.0.1";
157
158
 
158
159
  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": "16.12.1",
4
+ "version": "17.0.1",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,17 +21,17 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "16.12.1",
25
- "@commercetools-uikit/design-system": "16.12.1",
26
- "@commercetools-uikit/field-errors": "16.12.1",
27
- "@commercetools-uikit/field-label": "16.12.1",
28
- "@commercetools-uikit/flat-button": "16.12.1",
29
- "@commercetools-uikit/hooks": "16.12.1",
30
- "@commercetools-uikit/icons": "16.12.1",
31
- "@commercetools-uikit/password-input": "16.12.1",
32
- "@commercetools-uikit/spacings-inline": "16.12.1",
33
- "@commercetools-uikit/spacings-stack": "16.12.1",
34
- "@commercetools-uikit/utils": "16.12.1",
24
+ "@commercetools-uikit/constraints": "17.0.1",
25
+ "@commercetools-uikit/design-system": "17.0.1",
26
+ "@commercetools-uikit/field-errors": "17.0.1",
27
+ "@commercetools-uikit/field-label": "17.0.1",
28
+ "@commercetools-uikit/flat-button": "17.0.1",
29
+ "@commercetools-uikit/hooks": "17.0.1",
30
+ "@commercetools-uikit/icons": "17.0.1",
31
+ "@commercetools-uikit/password-input": "17.0.1",
32
+ "@commercetools-uikit/spacings-inline": "17.0.1",
33
+ "@commercetools-uikit/spacings-stack": "17.0.1",
34
+ "@commercetools-uikit/utils": "17.0.1",
35
35
  "@emotion/react": "^11.10.5",
36
36
  "@emotion/styled": "^11.10.5",
37
37
  "prop-types": "15.8.1"
@@ -1 +0,0 @@
1
- {"version":3,"file":"commercetools-uikit-password-field.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}