@commercetools-uikit/localized-text-field 19.12.1 → 19.13.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.
@@ -56,8 +56,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
56
56
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
57
57
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
58
58
  const sequentialId = utils.createSequentialId('localized-text-field-');
59
- const sequentialErrorsId = utils.createSequentialId('localized-text-field-error-')();
60
- const sequentialWarningsId = utils.createSequentialId('localized-text-field-warning-')();
61
59
  const hasErrors = errors => {
62
60
  var _context;
63
61
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
@@ -93,6 +91,8 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
93
91
  if (this.props.hideLanguageExpansionControls) {
94
92
  process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.defaultExpandLanguages !== 'boolean', 'LocalizedTextField: "defaultExpandLanguages" does not have any effect when "hideLanguageExpansionControls" is set.') : void 0;
95
93
  }
94
+ const errorsContainerId = `${this.state.id}-errors`;
95
+ const warningsContainerId = `${this.state.id}-warnings`;
96
96
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
97
97
  max: this.props.horizontalConstraint,
98
98
  children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
@@ -128,15 +128,15 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
128
128
  horizontalConstraint: "scale"
129
129
  }, utils.filterDataAttributes(this.props)), {}, {
130
130
  "aria-invalid": hasError,
131
- "aria-errormessage": sequentialErrorsId,
131
+ "aria-errormessage": errorsContainerId,
132
132
  additionalInfo: this.props.additionalInfo && this.props.additionalInfo
133
133
  })), jsxRuntime.jsx(FieldErrors__default["default"], {
134
- id: sequentialErrorsId,
134
+ id: errorsContainerId,
135
135
  errors: this.props.errors,
136
136
  isVisible: hasError,
137
137
  renderError: this.props.renderError
138
138
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
139
- id: sequentialWarningsId,
139
+ id: warningsContainerId,
140
140
  warnings: this.props.warnings,
141
141
  isVisible: hasWarning,
142
142
  renderWarning: this.props.renderWarning
@@ -196,7 +196,7 @@ LocalizedTextField.propTypes = process.env.NODE_ENV !== "production" ? {
196
196
  var LocalizedTextField$1 = LocalizedTextField;
197
197
 
198
198
  // NOTE: This string will be replaced on build time with the package version.
199
- var version = "19.12.1";
199
+ var version = "19.13.0";
200
200
 
201
201
  exports["default"] = LocalizedTextField$1;
202
202
  exports.version = version;
@@ -55,8 +55,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
55
55
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
56
56
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
57
57
  const sequentialId = utils.createSequentialId('localized-text-field-');
58
- const sequentialErrorsId = utils.createSequentialId('localized-text-field-error-')();
59
- const sequentialWarningsId = utils.createSequentialId('localized-text-field-warning-')();
60
58
  const hasErrors = errors => {
61
59
  var _context;
62
60
  return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
@@ -88,6 +86,8 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
88
86
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
89
87
  if (this.props.hintIcon) ;
90
88
  if (this.props.hideLanguageExpansionControls) ;
89
+ const errorsContainerId = `${this.state.id}-errors`;
90
+ const warningsContainerId = `${this.state.id}-warnings`;
91
91
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
92
92
  max: this.props.horizontalConstraint,
93
93
  children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
@@ -123,15 +123,15 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
123
123
  horizontalConstraint: "scale"
124
124
  }, utils.filterDataAttributes(this.props)), {}, {
125
125
  "aria-invalid": hasError,
126
- "aria-errormessage": sequentialErrorsId,
126
+ "aria-errormessage": errorsContainerId,
127
127
  additionalInfo: this.props.additionalInfo && this.props.additionalInfo
128
128
  })), jsxRuntime.jsx(FieldErrors__default["default"], {
129
- id: sequentialErrorsId,
129
+ id: errorsContainerId,
130
130
  errors: this.props.errors,
131
131
  isVisible: hasError,
132
132
  renderError: this.props.renderError
133
133
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
134
- id: sequentialWarningsId,
134
+ id: warningsContainerId,
135
135
  warnings: this.props.warnings,
136
136
  isVisible: hasWarning,
137
137
  renderWarning: this.props.renderWarning
@@ -163,7 +163,7 @@ LocalizedTextField.propTypes = {};
163
163
  var LocalizedTextField$1 = LocalizedTextField;
164
164
 
165
165
  // NOTE: This string will be replaced on build time with the package version.
166
- var version = "19.12.1";
166
+ var version = "19.13.0";
167
167
 
168
168
  exports["default"] = LocalizedTextField$1;
169
169
  exports.version = version;
@@ -31,8 +31,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _co
31
31
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
32
32
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
33
33
  const sequentialId = createSequentialId('localized-text-field-');
34
- const sequentialErrorsId = createSequentialId('localized-text-field-error-')();
35
- const sequentialWarningsId = createSequentialId('localized-text-field-warning-')();
36
34
  const hasErrors = errors => {
37
35
  var _context;
38
36
  return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
@@ -68,6 +66,8 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
68
66
  if (this.props.hideLanguageExpansionControls) {
69
67
  process.env.NODE_ENV !== "production" ? warning(typeof this.props.defaultExpandLanguages !== 'boolean', 'LocalizedTextField: "defaultExpandLanguages" does not have any effect when "hideLanguageExpansionControls" is set.') : void 0;
70
68
  }
69
+ const errorsContainerId = `${this.state.id}-errors`;
70
+ const warningsContainerId = `${this.state.id}-warnings`;
71
71
  return jsx(Constraints.Horizontal, {
72
72
  max: this.props.horizontalConstraint,
73
73
  children: jsxs(Spacings.Stack, {
@@ -103,15 +103,15 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
103
103
  horizontalConstraint: "scale"
104
104
  }, filterDataAttributes(this.props)), {}, {
105
105
  "aria-invalid": hasError,
106
- "aria-errormessage": sequentialErrorsId,
106
+ "aria-errormessage": errorsContainerId,
107
107
  additionalInfo: this.props.additionalInfo && this.props.additionalInfo
108
108
  })), jsx(FieldErrors, {
109
- id: sequentialErrorsId,
109
+ id: errorsContainerId,
110
110
  errors: this.props.errors,
111
111
  isVisible: hasError,
112
112
  renderError: this.props.renderError
113
113
  }), jsx(FieldWarnings, {
114
- id: sequentialWarningsId,
114
+ id: warningsContainerId,
115
115
  warnings: this.props.warnings,
116
116
  isVisible: hasWarning,
117
117
  renderWarning: this.props.renderWarning
@@ -171,6 +171,6 @@ LocalizedTextField.propTypes = process.env.NODE_ENV !== "production" ? {
171
171
  var LocalizedTextField$1 = LocalizedTextField;
172
172
 
173
173
  // NOTE: This string will be replaced on build time with the package version.
174
- var version = "19.12.1";
174
+ var version = "19.13.0";
175
175
 
176
176
  export { LocalizedTextField$1 as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/localized-text-field",
3
3
  "description": "A controlled text input component for localized single-line strings with validation states.",
4
- "version": "19.12.1",
4
+ "version": "19.13.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,14 +21,14 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.12.1",
25
- "@commercetools-uikit/design-system": "19.12.1",
26
- "@commercetools-uikit/field-errors": "19.12.1",
27
- "@commercetools-uikit/field-label": "19.12.1",
28
- "@commercetools-uikit/field-warnings": "19.12.1",
29
- "@commercetools-uikit/localized-text-input": "19.12.1",
30
- "@commercetools-uikit/spacings": "19.12.1",
31
- "@commercetools-uikit/utils": "19.12.1",
24
+ "@commercetools-uikit/constraints": "19.13.0",
25
+ "@commercetools-uikit/design-system": "19.13.0",
26
+ "@commercetools-uikit/field-errors": "19.13.0",
27
+ "@commercetools-uikit/field-label": "19.13.0",
28
+ "@commercetools-uikit/field-warnings": "19.13.0",
29
+ "@commercetools-uikit/localized-text-input": "19.13.0",
30
+ "@commercetools-uikit/spacings": "19.13.0",
31
+ "@commercetools-uikit/utils": "19.13.0",
32
32
  "@emotion/react": "^11.10.5",
33
33
  "@emotion/styled": "^11.10.5",
34
34
  "prop-types": "15.8.1",