@itcase/forms 1.1.5 → 1.1.6

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.
@@ -19,22 +19,11 @@
19
19
  }
20
20
  .form-field {
21
21
  &_type_checkbox {
22
- display: grid;
23
- grid-template-columns: min-content 1fr;
24
22
  ^&__label {
25
- grid-column-start: 2;
26
- align-self: center;
27
- }
28
- ^&__content {
29
- grid-column-start: 1;
30
- align-self: flex-start;
31
- grid-row: 1;
32
- &-inner {
33
- padding: 2px 0 0 0;
34
- }
23
+ padding: 0 0 0 28px;
35
24
  }
36
25
  ^&__message {
37
- grid-column-start: 2;
26
+ padding: 0 0 0 28px;
38
27
  }
39
28
  }
40
29
  }
@@ -0,0 +1,36 @@
1
+ .form-code {
2
+ position: relative;
3
+ }
4
+
5
+ .form-field {
6
+ &_type {
7
+ &_code {
8
+ &.form-field_size {
9
+ @each $size in xxl, xl, l, m, s, xs, xxs {
10
+ &_$(size) {
11
+ gap: var(--form-filed-code-size-$(size)-gap);
12
+ }
13
+ }
14
+ }
15
+ }
16
+ }
17
+ }
18
+
19
+ .form-field_type_code {
20
+ @each $state in error, success, require, disabled, focus {
21
+ &.form__item_state_$(state) {
22
+ & .form-field__label {
23
+ & .text {
24
+ color: var(--form-code-$(state)-label-color);
25
+ }
26
+ }
27
+ & .form-field__message-item_type-$(state) {
28
+ color: var(--form-code-$(state)-helptext-color);
29
+ }
30
+ }
31
+ }
32
+ }
33
+
34
+ :root {
35
+ --form-filed-code-size-l-gap: 8px;
36
+ }
@@ -0,0 +1,9 @@
1
+ /* @import './css/form-password.css'; */
2
+
3
+ :root {
4
+ --password-success-border: var(--color-success-border-primary);
5
+ --password-success-border-hover: var(--color-surface-border-quaternary);
6
+ --password-error-border: var(--color-error-border-primary);
7
+ --password-focus-background: var(--color-surface-primary);
8
+ --password-focus-border: var(--color-surface-border-quaternary);
9
+ }
@@ -1,6 +1,3 @@
1
- .radiogroup {
2
- border: solid 1px red;
3
- }
4
1
  .form-radio {
5
2
  &_state_success {
6
3
  & .radio__state {
@@ -13,10 +10,26 @@
13
10
  }
14
11
  }
15
12
  }
13
+
14
+ .form-field {
15
+ &_type {
16
+ &_radio {
17
+ &.form-field_size {
18
+ @each $size in xxl, xl, l, m, s, xs, xxs {
19
+ &_$(size) {
20
+ gap: var(--form-filed-radio-size-$(size)-gap);
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+
16
28
  :root {
17
29
  --radio-success-border: var(--color-success-border-primary);
18
30
  --radio-success-border-hover: var(--color-surface-border-quaternary);
19
31
  --radio-error-border: var(--color-error-border-primary);
20
32
  --radio-focus-background: var(--color-surface-primary);
21
33
  --radio-focus-border: var(--color-surface-border-quaternary);
22
- }
34
+ --form-filed-radio-size-m-gap: 4px;
35
+ }
@@ -1,19 +1,51 @@
1
1
  .form-field {
2
2
  &_type_switch {
3
3
  width: 100%;
4
- display: grid;
5
- grid-template-columns: 1fr min-content;
6
- ^&__label {
7
- grid-column-start: 1;
8
- align-self: center;
9
- }
10
- ^&__content {
11
- grid-column-start: 2;
12
- align-self: center;
13
- grid-row: 1;
4
+ }
5
+ }
6
+ .form-switch {
7
+ &&_state {
8
+ @each $state in error, success, require, disabled, focus {
9
+ &_$(state) {
10
+ & .input {
11
+ border: solid 1px var(--form-switch-$(state)-border);
12
+ &:hover {
13
+ border: solid 1px var(--form-switch-$(state)-border-hover);
14
+ }
15
+ }
16
+ }
14
17
  }
15
- ^&__message {
16
- grid-column-start: 1;
18
+ }
19
+ }
20
+ .form-field_type_switch {
21
+ @each $state in error, success, require, disabled, focus {
22
+ &.form__item_state_$(state) {
23
+ & .form-field__label {
24
+ & .text {
25
+ color: var(--form-switch-$(state)-label-color);
26
+ }
27
+ }
28
+ & .form-field__message-item_type-$(state) {
29
+ color: var(--form-switch-$(state)-helptext-color);
30
+ }
17
31
  }
18
32
  }
19
33
  }
34
+ :root {
35
+ --form-switch-error-border: var(--color-error-border-primary);
36
+ --form-switch-error-border-hover: var(--color-error-border-primary);
37
+ --form-switch-error-label-color: var(--color-error-text-primary);
38
+ --form-switch-error-helptext-color: var(--color-error-text-primary);
39
+
40
+ --form-switch-success-border: var(--color-success-border-primary);
41
+ --form-switch-success-border-hover: var(--color-surface-border-quaternary);
42
+
43
+ --form-switch-require-border: var(--color-success-border-primary);
44
+ --form-switch-require-border-hover: var(--color-surface-border-quaternary);
45
+
46
+ --form-switch-disabled-border: var(--color-success-border-primary);
47
+ --form-switch-disabled-border-hover: var(--color-surface-border-quaternary);
48
+
49
+ --form-switch-focus-border: var(--color-surface-border-quaternary);
50
+ --form-switch-focus-border-hover: var(--color-surface-border-quaternary);
51
+ }
@@ -19,6 +19,8 @@
19
19
  }
20
20
  .form {
21
21
  &__item {
22
+ display: flex;
23
+ flex-direction: column;
22
24
  &_reset-fill {
23
25
  & input,
24
26
  & textarea {
@@ -27,24 +29,6 @@
27
29
  }
28
30
  }
29
31
  }
30
- .form {
31
- &__item {
32
- &&_state_error {
33
- }
34
- }
35
- }
36
- .form {
37
- &__item {
38
- &&_state_required {
39
- }
40
- }
41
- }
42
- .form {
43
- &__item {
44
- &&_state_success {
45
- }
46
- }
47
- }
48
32
  .form {
49
33
  &__item {
50
34
  &&_type_float {
@@ -166,10 +150,10 @@
166
150
  }
167
151
  }
168
152
  .form {
169
- width: 100%;
153
+ min-width: 100%;
170
154
  &__wrapper {
171
- width: 100%;
172
155
  height: 100%;
156
+ min-width: 100%;
173
157
  position: relative;
174
158
  }
175
159
  }
@@ -1,5 +1,7 @@
1
1
  .form {
2
2
  &__item {
3
+ display: flex;
4
+ flex-direction: column;
3
5
  &_reset-fill {
4
6
  & input,
5
7
  & textarea {
@@ -3,10 +3,10 @@
3
3
  &-inner {
4
4
  position: relative;
5
5
  display: flex;
6
- gap: 20px;
7
6
  }
8
7
  }
9
8
  &__message {
9
+ padding: 4px 0 0 0;
10
10
  &-item {
11
11
  height: var(--form-field-helptext-height);
12
12
  line-height: var(--form-field-helptext-line-height);
@@ -23,15 +23,6 @@
23
23
  right: 8px;
24
24
  }
25
25
  }
26
- .form {
27
- &-field {
28
- &_type_code {
29
- ^&__content {
30
- justify-content: space-between;
31
- }
32
- }
33
- }
34
- }
35
26
  .form {
36
27
  &^&-field_type_float {
37
28
  padding: var(--form-field_type_float-padding, 12px 0 12px 0);
@@ -83,6 +74,26 @@
83
74
  .form-field {
84
75
  &_type {
85
76
  &_normal {
77
+ 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
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ .form-field {
95
+ &_type {
96
+ &_classic {
86
97
  position: relative;
87
98
  gap: var(--form-field_type_normal-gap, 4px);
88
99
  margin: var(--form-field_type_normal-margin);
@@ -90,6 +101,53 @@
90
101
  }
91
102
  }
92
103
  }
104
+ .form {
105
+ &^&-field_type_ifta {
106
+ margin: var(--form-field_type_ifta-margin);
107
+ position: relative;
108
+ gap: var(--form-field_type_ifta-gap);
109
+ &^&__item_state_focus,
110
+ &^&__item_state_filled {
111
+ & .form {
112
+ &-field {
113
+ &__label {
114
+ transform: scale(0.9) translate(0, 50%);
115
+ }
116
+ }
117
+ }
118
+ & .input {
119
+ &::placeholder {
120
+ opacity: 100%;
121
+ }
122
+ }
123
+ }
124
+ & .form {
125
+ &-field {
126
+ &__label {
127
+ position: absolute;
128
+ display: flex;
129
+ top: 0;
130
+ z-index: 2;
131
+ left: 16px;
132
+ transform: scale(1) translate(0, 100%);
133
+ transition: all 350ms cubic-bezier(0.4, 0, 0.2, 1);
134
+ pointer-events: none;
135
+ transform-origin: top left;
136
+ }
137
+ &__message {
138
+ padding: var(--form-field-type-ifta-message-padding, 0 0 0 16px);
139
+ }
140
+ }
141
+ }
142
+ & .input {
143
+ padding: var(--form-field_type_ifta-padding, 24px 0 12px 16px);
144
+ &::placeholder {
145
+ transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
146
+ opacity: 0%;
147
+ }
148
+ }
149
+ }
150
+ }
93
151
  .form-field {
94
152
  &_state {
95
153
  &_hidden {