@itcase/forms 1.1.19 → 1.1.20

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.
@@ -6,11 +6,10 @@
6
6
  }
7
7
  }
8
8
  &__message {
9
- padding: 4px 0 0 0;
10
9
  &-item {
11
10
  height: var(--form-field-helptext-height);
12
11
  line-height: var(--form-field-helptext-line-height);
13
- padding: var(--form-field-helptext-padding, 0);
12
+ padding: var(--form-field-helptext-padding);
14
13
  display: block;
15
14
  }
16
15
  }
@@ -75,16 +74,16 @@
75
74
  &_type {
76
75
  &_normal {
77
76
  position: relative;
78
- &.form-field {
79
- &_type {
80
- &_input {
81
- @each $size in s, m, l, xl {
82
- &.form-field_size_$(size) {
83
- gap: var(--form-field_type_normal_$(size)-gap, 4px);
84
- margin: var(--form-field_type_normal_$(size)-margin);
85
- padding: var(--form-field_type_normal_$(size)padding);
86
- }
87
- }
77
+ @each $size in xl, l, m, s {
78
+ &.form-field_size_$(size) {
79
+ gap: var(--form-field_type_normal_$(size)-gap);
80
+ padding: var(--form-field_type_normal_$(size)-padding);
81
+ margin: var(--form-field_type_normal_$(size)-margin);
82
+ ^^^&__label {
83
+ padding: var(--form-field_type_normal_$(size)-label-padding);
84
+ }
85
+ ^^^&__message {
86
+ padding: var(--form-field_type_normal_$(size)-message-padding);
88
87
  }
89
88
  }
90
89
  }
@@ -94,10 +93,10 @@
94
93
  .form-field {
95
94
  &_type {
96
95
  &_classic {
97
- position: relative;
98
- gap: var(--form-field_type_normal-gap, 4px);
99
- margin: var(--form-field_type_normal-margin);
100
96
  padding: var(--form-field_type_normal-padding);
97
+ margin: var(--form-field_type_normal-margin);
98
+ position: relative;
99
+ gap: var(--form-field_type_normal-gap);
101
100
  }
102
101
  }
103
102
  }
@@ -163,3 +162,9 @@
163
162
  }
164
163
  }
165
164
  }
165
+ :root {
166
+ --form-field_type_normal_m-gap: 0.5m;
167
+ --form-field_type_normal_m-padding: 1.5m 0;
168
+ --form-field_type_normal_m-label-padding: 0 0.5m;
169
+ --form-field_type_normal_m-message-padding: 0 1.5m;
170
+ }
@@ -23,7 +23,6 @@ var castArray = require('lodash/castArray');
23
23
  var reactDropzone = require('react-dropzone');
24
24
  var common = require('@itcase/common');
25
25
  var Button = require('@itcase/ui/components/Button');
26
- var Group$1 = require('@itcase/ui/components/Group');
27
26
  var Loader = require('@itcase/ui/components/Loader');
28
27
  var Title = require('@itcase/ui/components/Title');
29
28
  var Input = require('@itcase/ui/components/Input');
@@ -34,6 +33,7 @@ var Switch = require('@itcase/ui/components/Switch');
34
33
  var Textarea = require('@itcase/ui/components/Textarea');
35
34
  var reactImask = require('react-imask');
36
35
  var Chips = require('@itcase/ui/components/Chips');
36
+ var Group$1 = require('@itcase/ui/components/Group');
37
37
  var Notification = require('@itcase/ui/components/Notification');
38
38
  var createDecorator = require('final-form-focus');
39
39
 
@@ -130,15 +130,16 @@ function useYupValidationSchema(schema, language) {
130
130
  const defaultFieldProps = {
131
131
  width: 'fill',
132
132
  direction: 'vertical',
133
+ size: 'm',
133
134
  labelTextColor: 'surfaceTextPrimary',
134
- labelTextSize: 'm',
135
+ labelTextSize: 's',
136
+ messageTextColor: 'surfaceTextSecondary',
137
+ messageTextSize: 's',
135
138
  errorMessageTextColor: 'errorTextSecondary',
136
139
  errorMessageTextSize: 's',
137
140
  dividerFill: 'errorPrimary',
138
141
  helpTextColor: 'surfaceTextQuaternary',
139
142
  helpTextSize: 's',
140
- messageTextColor: 'surfaceTextSecondary',
141
- messageTextSize: 's',
142
143
  requiredMessageTextColor: 'warningTextSecondary',
143
144
  requiredMessageTextSize: 's',
144
145
  showMessage: true
@@ -2384,7 +2385,11 @@ function ChipsField(props) {
2384
2385
  showMessage: showMessage,
2385
2386
  isRequired: isRequired,
2386
2387
  isValidState: isValidState
2387
- }, fieldProps), options.length ? options.map(option => /*#__PURE__*/React__default.default.createElement(Chips.Chips, Object.assign({
2388
+ }, fieldProps), options.length ? /*#__PURE__*/React__default.default.createElement(Chips.ChipsGroup, {
2389
+ direction: "horizontal",
2390
+ gap: "1m",
2391
+ wrap: "wrap"
2392
+ }, options.map(option => /*#__PURE__*/React__default.default.createElement(Chips.Chips, Object.assign({
2388
2393
  className: clsx__default.default(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
2389
2394
  key: option.value,
2390
2395
  label: option.label,
@@ -2392,7 +2397,7 @@ function ChipsField(props) {
2392
2397
  value: option.value,
2393
2398
  isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
2394
2399
  onClick: () => onChangeSomeInput(input.value, option.value)
2395
- }, updatedInputProps))) : /*#__PURE__*/React__default.default.createElement(Text.Text, {
2400
+ }, updatedInputProps)))) : /*#__PURE__*/React__default.default.createElement(Text.Text, {
2396
2401
  size: emptyMessageTextSize,
2397
2402
  textColor: emptyMessageTextColor
2398
2403
  }, emptyMessage));
@@ -22,7 +22,6 @@ import castArray from 'lodash/castArray';
22
22
  import { useDropzone, ErrorCode } from 'react-dropzone';
23
23
  import { createFileFromDataURL } from '@itcase/common';
24
24
  import { Button } from '@itcase/ui/components/Button';
25
- import { Group as Group$1 } from '@itcase/ui/components/Group';
26
25
  import { Loader } from '@itcase/ui/components/Loader';
27
26
  import { Title } from '@itcase/ui/components/Title';
28
27
  import { Input } from '@itcase/ui/components/Input';
@@ -32,7 +31,8 @@ import { Select } from '@itcase/ui/components/Select';
32
31
  import { Switch } from '@itcase/ui/components/Switch';
33
32
  import { Textarea } from '@itcase/ui/components/Textarea';
34
33
  import { useIMask } from 'react-imask';
35
- import { Chips } from '@itcase/ui/components/Chips';
34
+ import { ChipsGroup, Chips } from '@itcase/ui/components/Chips';
35
+ import { Group as Group$1 } from '@itcase/ui/components/Group';
36
36
  import { Notification } from '@itcase/ui/components/Notification';
37
37
  import createDecorator from 'final-form-focus';
38
38
 
@@ -119,15 +119,16 @@ function useYupValidationSchema(schema, language) {
119
119
  const defaultFieldProps = {
120
120
  width: 'fill',
121
121
  direction: 'vertical',
122
+ size: 'm',
122
123
  labelTextColor: 'surfaceTextPrimary',
123
- labelTextSize: 'm',
124
+ labelTextSize: 's',
125
+ messageTextColor: 'surfaceTextSecondary',
126
+ messageTextSize: 's',
124
127
  errorMessageTextColor: 'errorTextSecondary',
125
128
  errorMessageTextSize: 's',
126
129
  dividerFill: 'errorPrimary',
127
130
  helpTextColor: 'surfaceTextQuaternary',
128
131
  helpTextSize: 's',
129
- messageTextColor: 'surfaceTextSecondary',
130
- messageTextSize: 's',
131
132
  requiredMessageTextColor: 'warningTextSecondary',
132
133
  requiredMessageTextSize: 's',
133
134
  showMessage: true
@@ -2373,7 +2374,11 @@ function ChipsField(props) {
2373
2374
  showMessage: showMessage,
2374
2375
  isRequired: isRequired,
2375
2376
  isValidState: isValidState
2376
- }, fieldProps), options.length ? options.map(option => /*#__PURE__*/React$1.createElement(Chips, Object.assign({
2377
+ }, fieldProps), options.length ? /*#__PURE__*/React$1.createElement(ChipsGroup, {
2378
+ direction: "horizontal",
2379
+ gap: "1m",
2380
+ wrap: "wrap"
2381
+ }, options.map(option => /*#__PURE__*/React$1.createElement(Chips, Object.assign({
2377
2382
  className: clsx(meta.active && 'form-chips_state_focus', meta.error && meta.touched && `form-chips_state_${errorKey}`),
2378
2383
  key: option.value,
2379
2384
  label: option.label,
@@ -2381,7 +2386,7 @@ function ChipsField(props) {
2381
2386
  value: option.value,
2382
2387
  isActive: activeOptionsList.some(activeOption => activeOption.value === option.value),
2383
2388
  onClick: () => onChangeSomeInput(input.value, option.value)
2384
- }, updatedInputProps))) : /*#__PURE__*/React$1.createElement(Text, {
2389
+ }, updatedInputProps)))) : /*#__PURE__*/React$1.createElement(Text, {
2385
2390
  size: emptyMessageTextSize,
2386
2391
  textColor: emptyMessageTextColor
2387
2392
  }, emptyMessage));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/forms",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "Forms fields, inputs, etc.",
5
5
  "keywords": [],
6
6
  "license": "MIT",