@itcase/forms 1.1.17 → 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.
@@ -97,16 +97,14 @@
97
97
  }
98
98
  }
99
99
  .form-notification {
100
- &_type {
101
- &_sticky {
102
- position: sticky;
103
- left: 0;
104
- top: 20px;
105
- z-index: 100;
106
- }
107
- &_global {
108
- margin: 0 0 16px 0;
109
- }
100
+ &_sticky {
101
+ position: sticky;
102
+ left: 0;
103
+ top: 20px;
104
+ z-index: 100;
105
+ }
106
+ &_global {
107
+ margin: 0 0 16px 0;
110
108
  }
111
109
  &__item {
112
110
  text-align: center;
@@ -1,18 +1,15 @@
1
1
  .form-notification {
2
- &_type {
3
- &_sticky {
4
- position: sticky;
5
- left: 0;
6
- top: 20px;
7
- z-index: 100;
8
- }
9
- &_global {
10
- margin: 0 0 16px 0;
11
- }
2
+ &_sticky {
3
+ position: sticky;
4
+ left: 0;
5
+ top: 20px;
6
+ z-index: 100;
7
+ }
8
+ &_global {
9
+ margin: 0 0 16px 0;
12
10
  }
13
11
  &__item {
14
12
  text-align: center;
15
13
  border-radius: 12px;
16
14
  }
17
15
  }
18
-
@@ -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
  });
@@ -2764,14 +2765,14 @@ const FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalF
2764
2765
  textColor: descTextColor,
2765
2766
  textWeight: descTextWeight
2766
2767
  }, desc), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React__default.default.createElement("div", {
2767
- className: clsx__default.default('notification', 'form-notification', notificationType ? `form-notification_type_${notificationType}` : 'form-notification_type_global')
2768
+ className: clsx__default.default('notification', 'form-notification', notificationType ? `form-notification_${notificationType}` : 'form-notification_global')
2768
2769
  }, /*#__PURE__*/React__default.default.createElement(Notification.Notification, {
2769
2770
  className: "form-notification__item",
2771
+ appearance: "errorPrimary",
2770
2772
  title: form.getState().submitError,
2771
2773
  titleTextSize: "h6",
2772
2774
  status: "error",
2773
- closeButton: notificationCloseButton,
2774
- set: "form"
2775
+ closeButton: notificationCloseButton
2775
2776
  })), onChangeFormValues && /*#__PURE__*/React__default.default.createElement(reactFinalForm.FormSpy, {
2776
2777
  subscription: {
2777
2778
  values: true
@@ -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
  });
@@ -2753,14 +2754,14 @@ const FinalForm = /*#__PURE__*/React$1.forwardRef(function FinalForm(props, ref)
2753
2754
  textColor: descTextColor,
2754
2755
  textWeight: descTextWeight
2755
2756
  }, desc), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React$1.createElement("div", {
2756
- className: clsx('notification', 'form-notification', notificationType ? `form-notification_type_${notificationType}` : 'form-notification_type_global')
2757
+ className: clsx('notification', 'form-notification', notificationType ? `form-notification_${notificationType}` : 'form-notification_global')
2757
2758
  }, /*#__PURE__*/React$1.createElement(Notification, {
2758
2759
  className: "form-notification__item",
2760
+ appearance: "errorPrimary",
2759
2761
  title: form.getState().submitError,
2760
2762
  titleTextSize: "h6",
2761
2763
  status: "error",
2762
- closeButton: notificationCloseButton,
2763
- set: "form"
2764
+ closeButton: notificationCloseButton
2764
2765
  })), onChangeFormValues && /*#__PURE__*/React$1.createElement(FormSpy, {
2765
2766
  subscription: {
2766
2767
  values: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/forms",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "description": "Forms fields, inputs, etc.",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -34,11 +34,11 @@
34
34
  "dependencies": {
35
35
  "@itcase/common": "^1.2.28",
36
36
  "@itcase/config": "^1.0.48",
37
- "@itcase/icons": "^1.1.6",
37
+ "@itcase/icons": "^1.2.6",
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.32",
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",
@@ -56,10 +56,10 @@
56
56
  "react-select": "^5.10.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@itcase/lint": "^1.1.18",
60
- "@babel/core": "^7.27.4",
61
- "@babel/eslint-parser": "^7.27.5",
62
- "@babel/preset-env": "^7.27.2",
59
+ "@itcase/lint": "^1.1.19",
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.5.3",
84
- "rollup": "^4.44.0",
83
+ "prettier": "3.6.2",
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
  }