@commercetools-uikit/number-field 20.4.0 → 20.6.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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -->
2
- <!-- This file is created by the `yarn generate-readme` script. -->
2
+ <!-- This file is created by the `pnpm generate-readme` script. -->
3
3
 
4
4
  # NumberField
5
5
 
@@ -10,7 +10,7 @@ A controlled input component for numbers with validation states and a label.
10
10
  ## Installation
11
11
 
12
12
  ```
13
- yarn add @commercetools-uikit/number-field
13
+ pnpm add @commercetools-uikit/number-field
14
14
  ```
15
15
 
16
16
  ```
@@ -20,7 +20,7 @@ npm --save install @commercetools-uikit/number-field
20
20
  Additionally install the peer dependencies (if not present)
21
21
 
22
22
  ```
23
- yarn add react
23
+ pnpm add react
24
24
  ```
25
25
 
26
26
  ```
@@ -147,8 +147,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
147
147
  }
148
148
  const hasError = this.props.touched && hasErrors(this.props.errors);
149
149
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
150
- const errorsContainerId = "".concat(this.state.id, "-errors");
151
- const warningsContainerId = "".concat(this.state.id, "-warnings");
150
+ const errorsContainerId = `${this.state.id}-errors`;
151
+ const warningsContainerId = `${this.state.id}-warnings`;
152
152
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
153
153
  max: this.props.horizontalConstraint,
154
154
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -188,13 +188,9 @@ let NumberField = /*#__PURE__*/function (_Component) {
188
188
  id: errorsContainerId,
189
189
  errors: this.props.errors,
190
190
  isVisible: hasError,
191
- renderError: (key, error) => {
192
- var _this$props$renderErr, _this$props;
193
- return (
194
- // Custom errors take precedence over the default errors
195
- ((_this$props$renderErr = (_this$props = this.props).renderError) === null || _this$props$renderErr === void 0 ? void 0 : _this$props$renderErr.call(_this$props, key, error)) || this.renderError(key)
196
- );
197
- }
191
+ renderError: (key, error) =>
192
+ // Custom errors take precedence over the default errors
193
+ this.props.renderError?.(key, error) || this.renderError(key)
198
194
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
199
195
  id: warningsContainerId,
200
196
  warnings: this.props.warnings,
@@ -227,7 +223,7 @@ NumberField.getDerivedStateFromProps = (props, state) => ({
227
223
  var NumberField$1 = NumberField;
228
224
 
229
225
  // NOTE: This string will be replaced on build time with the package version.
230
- var version = "20.4.0";
226
+ var version = "20.6.0";
231
227
 
232
228
  exports["default"] = NumberField$1;
233
229
  exports.version = version;
@@ -143,8 +143,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
143
143
  if (this.props.hintIcon) ;
144
144
  const hasError = this.props.touched && hasErrors(this.props.errors);
145
145
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
146
- const errorsContainerId = "".concat(this.state.id, "-errors");
147
- const warningsContainerId = "".concat(this.state.id, "-warnings");
146
+ const errorsContainerId = `${this.state.id}-errors`;
147
+ const warningsContainerId = `${this.state.id}-warnings`;
148
148
  return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
149
149
  max: this.props.horizontalConstraint,
150
150
  children: jsxRuntime.jsxs(Stack__default["default"], {
@@ -184,13 +184,9 @@ let NumberField = /*#__PURE__*/function (_Component) {
184
184
  id: errorsContainerId,
185
185
  errors: this.props.errors,
186
186
  isVisible: hasError,
187
- renderError: (key, error) => {
188
- var _this$props$renderErr, _this$props;
189
- return (
190
- // Custom errors take precedence over the default errors
191
- ((_this$props$renderErr = (_this$props = this.props).renderError) === null || _this$props$renderErr === void 0 ? void 0 : _this$props$renderErr.call(_this$props, key, error)) || this.renderError(key)
192
- );
193
- }
187
+ renderError: (key, error) =>
188
+ // Custom errors take precedence over the default errors
189
+ this.props.renderError?.(key, error) || this.renderError(key)
194
190
  }), jsxRuntime.jsx(FieldWarnings__default["default"], {
195
191
  id: warningsContainerId,
196
192
  warnings: this.props.warnings,
@@ -223,7 +219,7 @@ NumberField.getDerivedStateFromProps = (props, state) => ({
223
219
  var NumberField$1 = NumberField;
224
220
 
225
221
  // NOTE: This string will be replaced on build time with the package version.
226
- var version = "20.4.0";
222
+ var version = "20.6.0";
227
223
 
228
224
  exports["default"] = NumberField$1;
229
225
  exports.version = version;
@@ -123,8 +123,8 @@ let NumberField = /*#__PURE__*/function (_Component) {
123
123
  }
124
124
  const hasError = this.props.touched && hasErrors(this.props.errors);
125
125
  const hasWarning = this.props.touched && hasWarnings(this.props.warnings);
126
- const errorsContainerId = "".concat(this.state.id, "-errors");
127
- const warningsContainerId = "".concat(this.state.id, "-warnings");
126
+ const errorsContainerId = `${this.state.id}-errors`;
127
+ const warningsContainerId = `${this.state.id}-warnings`;
128
128
  return jsx(Constraints.Horizontal, {
129
129
  max: this.props.horizontalConstraint,
130
130
  children: jsxs(Stack, {
@@ -164,13 +164,9 @@ let NumberField = /*#__PURE__*/function (_Component) {
164
164
  id: errorsContainerId,
165
165
  errors: this.props.errors,
166
166
  isVisible: hasError,
167
- renderError: (key, error) => {
168
- var _this$props$renderErr, _this$props;
169
- return (
170
- // Custom errors take precedence over the default errors
171
- ((_this$props$renderErr = (_this$props = this.props).renderError) === null || _this$props$renderErr === void 0 ? void 0 : _this$props$renderErr.call(_this$props, key, error)) || this.renderError(key)
172
- );
173
- }
167
+ renderError: (key, error) =>
168
+ // Custom errors take precedence over the default errors
169
+ this.props.renderError?.(key, error) || this.renderError(key)
174
170
  }), jsx(FieldWarnings, {
175
171
  id: warningsContainerId,
176
172
  warnings: this.props.warnings,
@@ -203,6 +199,6 @@ NumberField.getDerivedStateFromProps = (props, state) => ({
203
199
  var NumberField$1 = NumberField;
204
200
 
205
201
  // NOTE: This string will be replaced on build time with the package version.
206
- var version = "20.4.0";
202
+ var version = "20.6.0";
207
203
 
208
204
  export { NumberField$1 as default, version };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/number-field",
3
3
  "description": "A controlled input component for numbers with validation states and a label.",
4
- "version": "20.4.0",
4
+ "version": "20.6.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -9,7 +9,13 @@
9
9
  "directory": "packages/components/fields/number-field"
10
10
  },
11
11
  "homepage": "https://uikit.commercetools.com",
12
- "keywords": ["javascript", "typescript", "design-system", "react", "uikit"],
12
+ "keywords": [
13
+ "javascript",
14
+ "typescript",
15
+ "design-system",
16
+ "react",
17
+ "uikit"
18
+ ],
13
19
  "license": "MIT",
14
20
  "publishConfig": {
15
21
  "access": "public"
@@ -17,26 +23,29 @@
17
23
  "sideEffects": false,
18
24
  "main": "dist/commercetools-uikit-number-field.cjs.js",
19
25
  "module": "dist/commercetools-uikit-number-field.esm.js",
20
- "files": ["dist"],
26
+ "files": [
27
+ "dist"
28
+ ],
21
29
  "dependencies": {
22
30
  "@babel/runtime": "^7.20.13",
23
31
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/constraints": "20.4.0",
25
- "@commercetools-uikit/design-system": "20.4.0",
26
- "@commercetools-uikit/field-errors": "20.4.0",
27
- "@commercetools-uikit/field-label": "20.4.0",
28
- "@commercetools-uikit/field-warnings": "20.4.0",
29
- "@commercetools-uikit/number-input": "20.4.0",
30
- "@commercetools-uikit/spacings-stack": "20.4.0",
31
- "@commercetools-uikit/utils": "20.4.0",
32
32
  "@emotion/react": "^11.10.5",
33
33
  "@emotion/styled": "^11.10.5",
34
- "react-intl": "^7.1.4"
34
+ "react-intl": "^7.1.4",
35
+ "@commercetools-uikit/constraints": "^20.6.0",
36
+ "@commercetools-uikit/design-system": "^20.6.0",
37
+ "@commercetools-uikit/field-errors": "^20.6.0",
38
+ "@commercetools-uikit/field-label": "^20.6.0",
39
+ "@commercetools-uikit/field-warnings": "^20.6.0",
40
+ "@commercetools-uikit/number-input": "^20.6.0",
41
+ "@commercetools-uikit/spacings-stack": "^20.6.0",
42
+ "@commercetools-uikit/utils": "^20.6.0"
35
43
  },
36
44
  "devDependencies": {
45
+ "prop-types": "^15.8.1",
37
46
  "react": "19.2.0"
38
47
  },
39
48
  "peerDependencies": {
40
49
  "react": "19.x"
41
50
  }
42
- }
51
+ }