@commercetools-uikit/localized-text-input 19.11.0 → 19.12.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.
@@ -106,7 +106,7 @@ const LocalizedInput = props => {
106
106
  // the input name anymore.
107
107
  //
108
108
  event.target.language = props.language;
109
- onChange === null || onChange === void 0 || onChange(event);
109
+ onChange?.(event);
110
110
  }, [props.language, onChange]);
111
111
  if (!props.isReadOnly) {
112
112
  process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'LocalizedTextInput: "onChange" is required when isReadOnly is not true') : void 0;
@@ -179,7 +179,6 @@ const LocalizedTextInput = props => {
179
179
  scale: "xs",
180
180
  children: [jsxRuntime.jsx(Stack__default["default"], {
181
181
  children: _mapInstanceProperty__default["default"](languages).call(languages, (language, index) => {
182
- var _props$errors, _props$warnings, _props$additionalInfo;
183
182
  const isFirstLanguage = index === 0;
184
183
  if (!isFirstLanguage && !areLanguagesExpanded) return null;
185
184
  return jsxRuntime.jsx("div", {
@@ -206,11 +205,11 @@ const LocalizedTextInput = props => {
206
205
  /* ARIA */
207
206
  "aria-invalid": props['aria-invalid'],
208
207
  "aria-errormessage": props['aria-errormessage']
209
- })), ((_props$errors = props.errors) === null || _props$errors === void 0 ? void 0 : _props$errors[language]) && jsxRuntime.jsx(messages.ErrorMessage, {
208
+ })), props.errors?.[language] && jsxRuntime.jsx(messages.ErrorMessage, {
210
209
  children: props.errors[language]
211
- }), ((_props$warnings = props.warnings) === null || _props$warnings === void 0 ? void 0 : _props$warnings[language]) && jsxRuntime.jsx(messages.WarningMessage, {
210
+ }), props.warnings?.[language] && jsxRuntime.jsx(messages.WarningMessage, {
212
211
  children: props.warnings[language]
213
- }), ((_props$additionalInfo = props.additionalInfo) === null || _props$additionalInfo === void 0 ? void 0 : _props$additionalInfo[language]) && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
212
+ }), props.additionalInfo?.[language] && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
214
213
  message: props.additionalInfo[language]
215
214
  })]
216
215
  })
@@ -93,7 +93,7 @@ const LocalizedInput = props => {
93
93
  // the input name anymore.
94
94
  //
95
95
  event.target.language = props.language;
96
- onChange === null || onChange === void 0 || onChange(event);
96
+ onChange?.(event);
97
97
  }, [props.language, onChange]);
98
98
  if (!props.isReadOnly) ;
99
99
  return jsxRuntime.jsxs("div", {
@@ -143,7 +143,6 @@ const LocalizedTextInput = props => {
143
143
  scale: "xs",
144
144
  children: [jsxRuntime.jsx(Stack__default["default"], {
145
145
  children: _mapInstanceProperty__default["default"](languages).call(languages, (language, index) => {
146
- var _props$errors, _props$warnings, _props$additionalInfo;
147
146
  const isFirstLanguage = index === 0;
148
147
  if (!isFirstLanguage && !areLanguagesExpanded) return null;
149
148
  return jsxRuntime.jsx("div", {
@@ -170,11 +169,11 @@ const LocalizedTextInput = props => {
170
169
  /* ARIA */
171
170
  "aria-invalid": props['aria-invalid'],
172
171
  "aria-errormessage": props['aria-errormessage']
173
- })), ((_props$errors = props.errors) === null || _props$errors === void 0 ? void 0 : _props$errors[language]) && jsxRuntime.jsx(messages.ErrorMessage, {
172
+ })), props.errors?.[language] && jsxRuntime.jsx(messages.ErrorMessage, {
174
173
  children: props.errors[language]
175
- }), ((_props$warnings = props.warnings) === null || _props$warnings === void 0 ? void 0 : _props$warnings[language]) && jsxRuntime.jsx(messages.WarningMessage, {
174
+ }), props.warnings?.[language] && jsxRuntime.jsx(messages.WarningMessage, {
176
175
  children: props.warnings[language]
177
- }), ((_props$additionalInfo = props.additionalInfo) === null || _props$additionalInfo === void 0 ? void 0 : _props$additionalInfo[language]) && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
176
+ }), props.additionalInfo?.[language] && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
178
177
  message: props.additionalInfo[language]
179
178
  })]
180
179
  })
@@ -86,7 +86,7 @@ const LocalizedInput = props => {
86
86
  // the input name anymore.
87
87
  //
88
88
  event.target.language = props.language;
89
- onChange === null || onChange === void 0 || onChange(event);
89
+ onChange?.(event);
90
90
  }, [props.language, onChange]);
91
91
  if (!props.isReadOnly) {
92
92
  process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'LocalizedTextInput: "onChange" is required when isReadOnly is not true') : void 0;
@@ -159,7 +159,6 @@ const LocalizedTextInput = props => {
159
159
  scale: "xs",
160
160
  children: [jsx(Stack, {
161
161
  children: _mapInstanceProperty(languages).call(languages, (language, index) => {
162
- var _props$errors, _props$warnings, _props$additionalInfo;
163
162
  const isFirstLanguage = index === 0;
164
163
  if (!isFirstLanguage && !areLanguagesExpanded) return null;
165
164
  return jsx("div", {
@@ -186,11 +185,11 @@ const LocalizedTextInput = props => {
186
185
  /* ARIA */
187
186
  "aria-invalid": props['aria-invalid'],
188
187
  "aria-errormessage": props['aria-errormessage']
189
- })), ((_props$errors = props.errors) === null || _props$errors === void 0 ? void 0 : _props$errors[language]) && jsx(ErrorMessage, {
188
+ })), props.errors?.[language] && jsx(ErrorMessage, {
190
189
  children: props.errors[language]
191
- }), ((_props$warnings = props.warnings) === null || _props$warnings === void 0 ? void 0 : _props$warnings[language]) && jsx(WarningMessage, {
190
+ }), props.warnings?.[language] && jsx(WarningMessage, {
192
191
  children: props.warnings[language]
193
- }), ((_props$additionalInfo = props.additionalInfo) === null || _props$additionalInfo === void 0 ? void 0 : _props$additionalInfo[language]) && jsx(AdditionalInfoMessage, {
192
+ }), props.additionalInfo?.[language] && jsx(AdditionalInfoMessage, {
194
193
  message: props.additionalInfo[language]
195
194
  })]
196
195
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/localized-text-input",
3
3
  "description": "A controlled text input component for localized single-line strings with validation states.",
4
- "version": "19.11.0",
4
+ "version": "19.12.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,18 +21,18 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "19.11.0",
25
- "@commercetools-uikit/design-system": "19.11.0",
26
- "@commercetools-uikit/flat-button": "19.11.0",
27
- "@commercetools-uikit/hooks": "19.11.0",
28
- "@commercetools-uikit/icons": "19.11.0",
29
- "@commercetools-uikit/input-utils": "19.11.0",
30
- "@commercetools-uikit/localized-utils": "19.11.0",
31
- "@commercetools-uikit/messages": "19.11.0",
32
- "@commercetools-uikit/spacings-stack": "19.11.0",
33
- "@commercetools-uikit/text": "19.11.0",
34
- "@commercetools-uikit/text-input": "19.11.0",
35
- "@commercetools-uikit/utils": "19.11.0",
24
+ "@commercetools-uikit/constraints": "19.12.0",
25
+ "@commercetools-uikit/design-system": "19.12.0",
26
+ "@commercetools-uikit/flat-button": "19.12.0",
27
+ "@commercetools-uikit/hooks": "19.12.0",
28
+ "@commercetools-uikit/icons": "19.12.0",
29
+ "@commercetools-uikit/input-utils": "19.12.0",
30
+ "@commercetools-uikit/localized-utils": "19.12.0",
31
+ "@commercetools-uikit/messages": "19.12.0",
32
+ "@commercetools-uikit/spacings-stack": "19.12.0",
33
+ "@commercetools-uikit/text": "19.12.0",
34
+ "@commercetools-uikit/text-input": "19.12.0",
35
+ "@commercetools-uikit/utils": "19.12.0",
36
36
  "@emotion/react": "^11.10.5",
37
37
  "@emotion/styled": "^11.10.5",
38
38
  "prop-types": "15.8.1"