@commercetools-uikit/field-errors 19.9.0 → 19.11.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.
@@ -123,7 +123,7 @@ FieldErrors.errorTypes = {
123
123
  var FieldErrors$1 = FieldErrors;
124
124
 
125
125
  // NOTE: This string will be replaced on build time with the package version.
126
- var version = "19.9.0";
126
+ var version = "19.11.0";
127
127
 
128
128
  exports["default"] = FieldErrors$1;
129
129
  exports.version = version;
@@ -116,7 +116,7 @@ FieldErrors.errorTypes = {
116
116
  var FieldErrors$1 = FieldErrors;
117
117
 
118
118
  // NOTE: This string will be replaced on build time with the package version.
119
- var version = "19.9.0";
119
+ var version = "19.11.0";
120
120
 
121
121
  exports["default"] = FieldErrors$1;
122
122
  exports.version = version;
@@ -105,6 +105,6 @@ FieldErrors.errorTypes = {
105
105
  var FieldErrors$1 = FieldErrors;
106
106
 
107
107
  // NOTE: This string will be replaced on build time with the package version.
108
- var version = "19.9.0";
108
+ var version = "19.11.0";
109
109
 
110
110
  export { FieldErrors$1 as default, version };
@@ -2,10 +2,26 @@ import { ReactNode } from 'react';
2
2
  type TErrorRenderer = (key: string, error?: boolean) => ReactNode;
3
3
  export type TFieldErrors = Record<string, boolean>;
4
4
  export type TFieldErrorsProps = {
5
+ /**
6
+ * ID of the error field.
7
+ */
5
8
  id?: string;
9
+ /**
10
+ * List of errors. Only entries with truthy values will count as active errors.
11
+ */
6
12
  errors?: TFieldErrors;
13
+ /**
14
+ * `true` when the error messages should be rendered. Usually you'd pass in a `touched` state of fields.
15
+ */
7
16
  isVisible?: boolean;
17
+ /**
18
+ * Function which gets called with each error key (from the `errors` prop) and may render an error message or return `null` to hand the error handling off to `renderDefaultError`.
19
+ */
8
20
  renderError?: TErrorRenderer;
21
+ /**
22
+ * Function which gets called with each error key (from the `errors` prop) for which `renderError` returned `null`.
23
+ * It may render an error message or return `null` to hand the error handling off to `FieldError`s built-in error handling.
24
+ */
9
25
  renderDefaultError?: TErrorRenderer;
10
26
  };
11
27
  declare const FieldErrors: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-uikit/field-errors",
3
3
  "description": "Renders errors based on configuration.",
4
- "version": "19.9.0",
4
+ "version": "19.11.0",
5
5
  "bugs": "https://github.com/commercetools/ui-kit/issues",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.20.13",
23
23
  "@babel/runtime-corejs3": "^7.20.13",
24
- "@commercetools-uikit/messages": "19.9.0",
24
+ "@commercetools-uikit/messages": "19.11.0",
25
25
  "@emotion/react": "^11.10.5",
26
26
  "@emotion/styled": "^11.10.5",
27
27
  "prop-types": "15.8.1"