@itcase/forms 1.1.18 → 1.1.19

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.
@@ -1546,10 +1546,10 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
1546
1546
  }
1547
1547
  }, [onChange, input.onChange]);
1548
1548
  const {
1549
- isErrorState,
1550
- isValidState,
1551
1549
  errorKey,
1552
- errorMessage
1550
+ errorMessage,
1551
+ isErrorState,
1552
+ isValidState
1553
1553
  } = useFieldValidationState({
1554
1554
  fieldProps: fieldProps,
1555
1555
  input: input,
@@ -1559,6 +1559,7 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
1559
1559
  inputProps: inputProps,
1560
1560
  validationStateKey: isErrorState ? errorKey : 'success'
1561
1561
  });
1562
+ const isIconRevealableString = typeof iconRevealableHide === 'string' && typeof iconRevealableShow === 'string';
1562
1563
  return /*#__PURE__*/React__default.default.createElement(FieldWrapper, Object.assign({
1563
1564
  className: clsx__default.default('form-field_type_input', 'form__item_type_input', classNameGroupItem),
1564
1565
  errorKey: errorKey,
@@ -1589,18 +1590,18 @@ const InputField = /*#__PURE__*/React__default.default.memo(function InputField(
1589
1590
  size: iconSize,
1590
1591
  iconFill: iconFill,
1591
1592
  iconFillHover: iconFillHover,
1592
- imageSrc: isRevealed ? iconRevealableHide : iconRevealableShow,
1593
+ imageSrc: isRevealed && isIconRevealableString ? iconRevealableHide : iconRevealableShow,
1593
1594
  shape: iconShape,
1594
- SvgImage: isRevealed ? iconRevealableHide : iconRevealableShow,
1595
+ SvgImage: isRevealed && !isIconRevealableString ? iconRevealableHide : iconRevealableShow,
1595
1596
  onClick: onClickIconReveal
1596
1597
  }), clearIcon && /*#__PURE__*/React__default.default.createElement(Icon.Icon, {
1597
1598
  className: "form-field__icon",
1598
1599
  size: clearIconSize,
1599
1600
  iconFill: clearIconFill,
1600
1601
  iconFillHover: clearIconFillHover,
1601
- imageSrc: clearIcon,
1602
+ imageSrc: typeof clearIcon === 'string' && clearIcon,
1602
1603
  shape: clearIconShape,
1603
- SvgImage: clearIcon,
1604
+ SvgImage: typeof clearIcon !== 'string' && clearIcon,
1604
1605
  onClick: onClickClearIcon
1605
1606
  }));
1606
1607
  });
@@ -1535,10 +1535,10 @@ const InputField = /*#__PURE__*/React$1.memo(function InputField(props) {
1535
1535
  }
1536
1536
  }, [onChange, input.onChange]);
1537
1537
  const {
1538
- isErrorState,
1539
- isValidState,
1540
1538
  errorKey,
1541
- errorMessage
1539
+ errorMessage,
1540
+ isErrorState,
1541
+ isValidState
1542
1542
  } = useFieldValidationState({
1543
1543
  fieldProps: fieldProps,
1544
1544
  input: input,
@@ -1548,6 +1548,7 @@ const InputField = /*#__PURE__*/React$1.memo(function InputField(props) {
1548
1548
  inputProps: inputProps,
1549
1549
  validationStateKey: isErrorState ? errorKey : 'success'
1550
1550
  });
1551
+ const isIconRevealableString = typeof iconRevealableHide === 'string' && typeof iconRevealableShow === 'string';
1551
1552
  return /*#__PURE__*/React$1.createElement(FieldWrapper, Object.assign({
1552
1553
  className: clsx('form-field_type_input', 'form__item_type_input', classNameGroupItem),
1553
1554
  errorKey: errorKey,
@@ -1578,18 +1579,18 @@ const InputField = /*#__PURE__*/React$1.memo(function InputField(props) {
1578
1579
  size: iconSize,
1579
1580
  iconFill: iconFill,
1580
1581
  iconFillHover: iconFillHover,
1581
- imageSrc: isRevealed ? iconRevealableHide : iconRevealableShow,
1582
+ imageSrc: isRevealed && isIconRevealableString ? iconRevealableHide : iconRevealableShow,
1582
1583
  shape: iconShape,
1583
- SvgImage: isRevealed ? iconRevealableHide : iconRevealableShow,
1584
+ SvgImage: isRevealed && !isIconRevealableString ? iconRevealableHide : iconRevealableShow,
1584
1585
  onClick: onClickIconReveal
1585
1586
  }), clearIcon && /*#__PURE__*/React$1.createElement(Icon, {
1586
1587
  className: "form-field__icon",
1587
1588
  size: clearIconSize,
1588
1589
  iconFill: clearIconFill,
1589
1590
  iconFillHover: clearIconFillHover,
1590
- imageSrc: clearIcon,
1591
+ imageSrc: typeof clearIcon === 'string' && clearIcon,
1591
1592
  shape: clearIconShape,
1592
- SvgImage: clearIcon,
1593
+ SvgImage: typeof clearIcon !== 'string' && clearIcon,
1593
1594
  onClick: onClickClearIcon
1594
1595
  }));
1595
1596
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/forms",
3
- "version": "1.1.18",
3
+ "version": "1.1.19",
4
4
  "description": "Forms fields, inputs, etc.",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "@itcase/storybook-config": "^1.1.14",
39
39
  "@itcase/tokens-am": "^1.1.9",
40
40
  "@itcase/tokens-baikal": "^1.1.9",
41
- "@itcase/ui": "^1.8.36",
41
+ "@itcase/ui": "^1.8.39",
42
42
  "axios": "^1.10.0",
43
43
  "clsx": "^2.1.1",
44
44
  "final-form": "4.20.10",
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@itcase/lint": "^1.1.19",
60
- "@babel/core": "^7.27.4",
61
- "@babel/eslint-parser": "^7.27.5",
62
- "@babel/preset-env": "^7.27.2",
60
+ "@babel/core": "^7.28.0",
61
+ "@babel/eslint-parser": "^7.28.0",
62
+ "@babel/preset-env": "^7.28.0",
63
63
  "@babel/preset-react": "^7.27.1",
64
64
  "@commitlint/cli": "^19.8.1",
65
65
  "@commitlint/config-conventional": "^19.8.1",
@@ -76,15 +76,15 @@
76
76
  "babel-plugin-inline-react-svg": "^2.0.2",
77
77
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
78
78
  "conventional-changelog-conventionalcommits": "^9.0.0",
79
- "eslint": "9.29.0",
79
+ "eslint": "9.30.1",
80
80
  "husky": "^9.1.7",
81
81
  "lint-staged": "^16.1.2",
82
82
  "postcss": "^8.5.6",
83
- "prettier": "3.6.1",
83
+ "prettier": "3.6.2",
84
84
  "rollup": "^4.44.1",
85
85
  "rollup-plugin-peer-deps-external": "^2.2.4",
86
- "semantic-release": "^24.2.5",
87
- "stylelint": "^16.21.0",
86
+ "semantic-release": "^24.2.6",
87
+ "stylelint": "^16.21.1",
88
88
  "typescript": "^5.8.3",
89
89
  "yup": "^1.6.1"
90
90
  }