@itcase/forms 1.1.5 → 1.1.7

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.
@@ -1,45 +1,10 @@
1
- .form-checkbox {
2
- &&_state {
3
- &_success {
4
- & .checkbox__state {
5
- border: solid 1px var(--checkbox-success-border);
6
- }
7
- }
8
- &_error {
9
- & .checkbox__state {
10
- border: solid 1px var(--checkbox-error-border);
11
- }
12
- }
13
- &_focus {
14
- & .checkbox__state {
15
- /* border: solid 1px var(--checkbox-focus-border); */
16
- }
17
- }
18
- }
19
- }
20
1
  .form-field {
21
2
  &_type_checkbox {
22
- display: grid;
23
- grid-template-columns: min-content 1fr;
24
3
  ^&__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
- }
4
+ padding: 0 0 0 28px;
35
5
  }
36
6
  ^&__message {
37
- grid-column-start: 2;
7
+ padding: 0 0 0 28px;
38
8
  }
39
9
  }
40
- }
41
- :root {
42
- --checkbox-success-border: var(--color-success-border-primary);
43
- --checkbox-error-border: var(--color-error-border-primary);
44
- --checkbox-focus-border: var(--color-surface-border-quaternary);
45
- }
10
+ }
@@ -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
+ }
@@ -1,27 +1,3 @@
1
- .form-datepicker {
2
- &&_state {
3
- &_success {
4
- /* & .input {
5
- border: solid 1px var(--datepicker-success-border);
6
- &:hover {
7
- border: solid 1px var(--datepicker-success-border-hover);
8
- }
9
- } */
10
- }
11
- &_error {
12
- & .input {
13
- border: solid 1px var(--datepicker-error-border);
14
- }
15
- }
16
- &_focus {
17
- /* & .input {
18
- background: var(--datepicker-focus-background);
19
- border: solid 1px var(--datepicker-focus-border);
20
- } */
21
- }
22
- }
23
- }
24
-
25
1
  :root {
26
2
  --datepicker-success-border: var(--color-success-border-primary);
27
3
  --datepicker-success-border-hover: var(--color-surface-border-quaternary);
@@ -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 {
@@ -154,22 +138,32 @@
154
138
  justify-content: space-between;
155
139
  }
156
140
  &_sticky {
141
+ min-height: 100%;
157
142
  position: relative;
158
- &^^&__button {
143
+ display: flex;
144
+ flex-direction: column;
145
+ ^^&__title {
146
+ position: sticky;
147
+ top: 0;
148
+ z-index: 1;
149
+ }
150
+ ^^&__wrapper {
151
+ overflow: scroll;
152
+ flex: 1;
153
+ }
154
+ ^^&__button {
159
155
  width: 100%;
160
- position: fixed;
161
- left: 0;
156
+ position: sticky;
162
157
  bottom: 0;
163
- z-index: 100;
158
+ z-index: 1;
164
159
  }
165
160
  }
166
161
  }
167
162
  }
168
163
  .form {
169
- width: 100%;
164
+ min-width: 100%;
170
165
  &__wrapper {
171
- width: 100%;
172
- height: 100%;
166
+ min-width: 100%;
173
167
  position: relative;
174
168
  }
175
169
  }
@@ -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 {