@wallarm-org/design-system 0.68.1 → 0.68.2-rc-fix-AS-1171-release.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.
@@ -14,14 +14,16 @@ export declare const isValueOfType: (value: string | number | boolean, type: Fie
14
14
  * options. Only consulted when the current field doesn't define the value
15
15
  * itself.
16
16
  *
17
- * String/enum fields always may: a value carried over after a field change keeps
18
- * the label it had on its origin field (accepted trade-off, AS-1134). Typed
19
- * fields (integer/float/date/boolean) may borrow only for a value that is NOT a
20
- * valid value of their own type — such a value must have been carried from a
21
- * differently-typed field. A type-conforming value (e.g. `1` typed into the
22
- * integer `total_requests` field) is a genuine user entry and must never be
23
- * relabelled from an unrelated field that happens to define the same value
24
- * (AS-1171).
17
+ * Borrowing is allowed only for a value that is *foreign* to the current field
18
+ * one that fails the field's own type/allowlist validation. Such a value cannot
19
+ * have been entered into this field directly, so it was carried over from the
20
+ * field it came from (after a field change) and keeps that field's label
21
+ * (AS-1085, AS-1134). A value that is *valid* for the current field is a genuine
22
+ * user entry (e.g. `1` typed into the freeform `total_requests` field) and must
23
+ * never be relabelled from an unrelated field that happens to define the same
24
+ * value — even on untyped string/enum fields (AS-1171).
25
+ *
26
+ * An unknown field can't validate, so its values may always borrow.
25
27
  */
26
28
  export declare const canBorrowCrossFieldLabel: (field: FieldMetadata | null | undefined, value: string | number | boolean | null | undefined) => boolean;
27
29
  /** Find a field value option matching by label or value (case-insensitive) */
@@ -30,14 +30,10 @@ const isValueOfType = (value, type)=>{
30
30
  return true;
31
31
  }
32
32
  };
33
- const UNTYPED_FIELD_TYPES = new Set([
34
- 'string',
35
- 'enum'
36
- ]);
37
33
  const canBorrowCrossFieldLabel = (field, value)=>{
38
34
  if (null == value) return false;
39
- if (!field || UNTYPED_FIELD_TYPES.has(field.type)) return true;
40
- return !isValueOfType(value, field.type);
35
+ if (!field) return true;
36
+ return validateValueForField(field, value);
41
37
  };
42
38
  const findMatchingFieldValue = (fieldValues, text)=>fieldValues.find((v)=>v.label.toLowerCase() === text.toLowerCase() || String(v.value).toLowerCase() === text.toLowerCase());
43
39
  const isValidFieldValue = (fieldValues, v)=>fieldValues.some((opt)=>opt.value === v || String(opt.value).toLowerCase() === String(v).toLowerCase());
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.68.0",
3
- "generatedAt": "2026-06-26T11:12:51.835Z",
2
+ "version": "0.68.1",
3
+ "generatedAt": "2026-06-29T10:05:25.661Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "Accordion",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallarm-org/design-system",
3
- "version": "0.68.1",
3
+ "version": "0.68.2-rc-fix-AS-1171-release.1",
4
4
  "description": "Core design system library with React components and Storybook documentation",
5
5
  "publishConfig": {
6
6
  "access": "public",