@itcase/forms 1.0.20 → 1.0.21

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.
@@ -12,7 +12,7 @@
12
12
  }
13
13
  &_focus {
14
14
  & .checkbox__state {
15
- background: var(--color-surface-primary);
15
+ /* border: solid 1px var(--color-error-border-primary); */
16
16
  }
17
17
  }
18
18
  }
@@ -30,7 +30,7 @@
30
30
  align-self: flex-start;
31
31
  grid-row: 1;
32
32
  &-inner {
33
- padding: 4px 0 0 0;
33
+ padding: 2px 0 0 0;
34
34
  }
35
35
  }
36
36
  ^&__message {
@@ -1,12 +1,16 @@
1
1
  .form-segmented {
2
- &_state_success {
2
+ &_state_error {
3
3
  & .segmented {
4
- border: solid 1px var(--color-success-border-primary);
4
+ &__item-label-text {
5
+ color: var(--color-error-text-primary);
6
+ }
5
7
  }
6
8
  }
7
- &_state_error {
9
+ &_state_required {
8
10
  & .segmented {
9
- border: solid 1px var(--color-error-border-primary);
11
+ &__item-label-text {
12
+ color: var(--color-active-text-primary);
13
+ }
10
14
  }
11
15
  }
12
16
  }
@@ -203,6 +203,9 @@
203
203
  top: 20px;
204
204
  left: 0;
205
205
  }
206
+ &_global {
207
+ margin: 0 0 16px 0;
208
+ }
206
209
  }
207
210
  &__item {
208
211
  text-align: center;
@@ -6,6 +6,9 @@
6
6
  top: 20px;
7
7
  left: 0;
8
8
  }
9
+ &_global {
10
+ margin: 0 0 16px 0;
11
+ }
9
12
  }
10
13
  &__item {
11
14
  text-align: center;
@@ -56,9 +56,10 @@ var emailValidation = function emailValidation(value, context) {
56
56
  var addRequiredFieldsParamToSchema = function addRequiredFieldsParamToSchema(schema) {
57
57
  var fields = Object.entries(schema.fields);
58
58
  schema.requiredFields = fields.reduce(function (list, _ref) {
59
+ var _validationProps$excl;
59
60
  var fieldName = _ref[0],
60
61
  validationProps = _ref[1];
61
- if (validationProps.exclusiveTests.required) {
62
+ if ((_validationProps$excl = validationProps.exclusiveTests) != null && _validationProps$excl.required) {
62
63
  list.push(fieldName);
63
64
  }
64
65
  return list;
@@ -2573,10 +2574,12 @@ var FinalForm = /*#__PURE__*/React__default.default.forwardRef(function FinalFor
2573
2574
  textColor: descriptionTextColor,
2574
2575
  textWeight: descriptionTextWeight
2575
2576
  }, description), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React__default.default.createElement("div", {
2576
- className: clsx__default.default('notification', 'form-notification', notificationType && "form-notification_type_" + notificationType)
2577
+ className: clsx__default.default('notification', 'form-notification', notificationType ? "form-notification_type_" + notificationType : 'form-notification_type_global')
2577
2578
  }, /*#__PURE__*/React__default.default.createElement(Notification.NotificationItem, {
2578
2579
  className: "form-notification__item",
2579
- text: form.getState().submitError,
2580
+ titleTextSize: "h6",
2581
+ title: form.getState().submitError,
2582
+ set: "form",
2580
2583
  status: "error"
2581
2584
  })), onChangeFormValues && /*#__PURE__*/React__default.default.createElement(reactFinalForm.FormSpy, {
2582
2585
  subscription: {
@@ -46,9 +46,10 @@ var emailValidation = function emailValidation(value, context) {
46
46
  var addRequiredFieldsParamToSchema = function addRequiredFieldsParamToSchema(schema) {
47
47
  var fields = Object.entries(schema.fields);
48
48
  schema.requiredFields = fields.reduce(function (list, _ref) {
49
+ var _validationProps$excl;
49
50
  var fieldName = _ref[0],
50
51
  validationProps = _ref[1];
51
- if (validationProps.exclusiveTests.required) {
52
+ if ((_validationProps$excl = validationProps.exclusiveTests) != null && _validationProps$excl.required) {
52
53
  list.push(fieldName);
53
54
  }
54
55
  return list;
@@ -2563,10 +2564,12 @@ var FinalForm = /*#__PURE__*/React.forwardRef(function FinalForm(props, ref) {
2563
2564
  textColor: descriptionTextColor,
2564
2565
  textWeight: descriptionTextWeight
2565
2566
  }, description), submitError && !modifiedSinceLastSubmit && /*#__PURE__*/React.createElement("div", {
2566
- className: clsx('notification', 'form-notification', notificationType && "form-notification_type_" + notificationType)
2567
+ className: clsx('notification', 'form-notification', notificationType ? "form-notification_type_" + notificationType : 'form-notification_type_global')
2567
2568
  }, /*#__PURE__*/React.createElement(NotificationItem, {
2568
2569
  className: "form-notification__item",
2569
- text: form.getState().submitError,
2570
+ titleTextSize: "h6",
2571
+ title: form.getState().submitError,
2572
+ set: "form",
2570
2573
  status: "error"
2571
2574
  })), onChangeFormValues && /*#__PURE__*/React.createElement(FormSpy, {
2572
2575
  subscription: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/forms",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Forms fields, inputs, etc.",
5
5
  "keywords": [
6
6
  "forms",