@elcrm/form 0.0.73 → 0.0.75

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.
@@ -9,7 +9,6 @@
9
9
  & > dt,
10
10
  & > dd {
11
11
  margin: 0;
12
- padding: 0;
13
12
  }
14
13
  &[data-field="group"] {
15
14
  & div {
@@ -22,10 +21,14 @@
22
21
  border-bottom: 0;
23
22
  }
24
23
  }
24
+ /* contentEditable: псевдо-placeholder — тот же вес и насыщенность, что у нативного ::placeholder */
25
25
  & [placeholder]:empty:before {
26
26
  content: attr(placeholder);
27
27
  display: block;
28
28
  color: var(--field-placeholder);
29
+ font-weight: 400;
30
+ font-style: normal;
31
+ opacity: 1;
29
32
  }
30
33
  & [placeholder]:focus:before {
31
34
  display: none;
@@ -42,7 +45,8 @@
42
45
  overflow: hidden;
43
46
  background: var(--field-background);
44
47
  color: var(--field-color);
45
- padding: 0 var(--field-side-padding, 14px);
48
+ /* Внутренний отступ теперь на контейнере dd (.f), а не на дочернем div */
49
+ padding: var(--control-inner-padding, 0 var(--field-side-padding, 14px));
46
50
  transition:
47
51
  border-color 0.16s ease,
48
52
  box-shadow 0.16s ease,
@@ -78,7 +82,7 @@
78
82
  margin: 0;
79
83
  min-height: var(--field-height);
80
84
  line-height: calc(var(--field-height) - 2px);
81
- padding: var(--field-inner-padding, 0 2px);
85
+ padding: 0;
82
86
  font-size: var(--control-font-size, 14px);
83
87
  text-wrap: pretty;
84
88
 
@@ -98,6 +102,29 @@
98
102
  height: 20px;
99
103
  }
100
104
  }
105
+
106
+ /*
107
+ Нативный placeholder: без UA-«обесцвечивания» (Firefox/WebKit снижают opacity по умолчанию).
108
+ Цвет = --field-placeholder, как у [placeholder]:empty:before у contentEditable.
109
+ */
110
+ input::placeholder,
111
+ textarea::placeholder {
112
+ color: var(--field-placeholder);
113
+ opacity: 1;
114
+ font-weight: 400;
115
+ }
116
+ input::-webkit-input-placeholder,
117
+ textarea::-webkit-input-placeholder {
118
+ color: var(--field-placeholder);
119
+ opacity: 1;
120
+ font-weight: 400;
121
+ }
122
+ input::-moz-placeholder,
123
+ textarea::-moz-placeholder {
124
+ color: var(--field-placeholder);
125
+ opacity: 1;
126
+ font-weight: 400;
127
+ }
101
128
  }
102
129
 
103
130
  // textarea
@@ -188,7 +215,8 @@
188
215
  &:empty:before {
189
216
  content: attr(placeholder);
190
217
  color: var(--field-placeholder);
191
- opacity: 0.6;
218
+ font-weight: 400;
219
+ opacity: 1;
192
220
  }
193
221
 
194
222
  &:focus:empty:before {
@@ -212,6 +240,21 @@
212
240
  padding-bottom: 10px;
213
241
  }
214
242
 
243
+ .affix {
244
+ display: inline-flex;
245
+ align-items: center;
246
+ justify-content: center;
247
+ flex: 0 0 auto;
248
+ padding: 0;
249
+ margin: 0;
250
+ color: var(--field-icon-color, var(--field-placeholder));
251
+ font-size: inherit;
252
+ line-height: 1;
253
+ user-select: none;
254
+ }
255
+
256
+ /* Отступ аффиксов от краёв капсулы (как визуально у Password), без увеличения зазора до текста */
257
+
215
258
  .g {
216
259
  flex-direction: column;
217
260
  }
@@ -267,6 +310,82 @@
267
310
  }
268
311
  }
269
312
 
313
+ // checkbox — капсула с квадратом слева и текстом справа
314
+ .checkbox {
315
+ & > div {
316
+ min-height: var(--field-height);
317
+ display: flex;
318
+ align-items: flex-start;
319
+ width: 100%;
320
+ padding: 0;
321
+ line-height: normal;
322
+ }
323
+ }
324
+
325
+ .checkControl {
326
+ width: 100%;
327
+ min-height: var(--field-height);
328
+ display: flex;
329
+ align-items: flex-start;
330
+ gap: 12px;
331
+ border: 0;
332
+ margin: 0;
333
+ padding: 10px 0;
334
+ background: transparent;
335
+ color: inherit;
336
+ font: inherit;
337
+ text-align: left;
338
+ cursor: pointer;
339
+ outline: none;
340
+
341
+ &:focus-visible {
342
+ box-shadow: 0 0 0 3px var(--field-focus-ring, #0000);
343
+ border-radius: calc(var(--field-radius) - 2px);
344
+ }
345
+
346
+ &[aria-disabled="true"] {
347
+ cursor: not-allowed;
348
+ }
349
+ }
350
+
351
+ .checkBox {
352
+ width: 22px;
353
+ height: 22px;
354
+ border-radius: 8px;
355
+ border: var(--field-check-box-border, var(--field-border));
356
+ background: transparent;
357
+ display: inline-flex;
358
+ align-items: center;
359
+ justify-content: center;
360
+ flex: 0 0 auto;
361
+ transition:
362
+ background-color 0.16s ease,
363
+ border-color 0.16s ease,
364
+ opacity 0.16s ease;
365
+ }
366
+
367
+ .checkMark {
368
+ width: 11px;
369
+ height: 6px;
370
+ border: 2px solid #fcfff4;
371
+ border-top: none;
372
+ border-right: none;
373
+ transform: translateY(-1px) rotate(-45deg);
374
+ }
375
+
376
+ .checkText {
377
+ flex: 1 1 auto;
378
+ min-width: 0;
379
+ color: inherit;
380
+ font-size: var(--control-font-size, 14px);
381
+ line-height: 1.25;
382
+ padding-top: 2px;
383
+ }
384
+
385
+ .checkControl[aria-checked="true"] .checkBox {
386
+ background: var(--field-background-active);
387
+ }
388
+
270
389
  // checkBox
271
390
  .h {
272
391
  --field-border: 0;
@@ -93,6 +93,12 @@
93
93
  top: var(--select-icon-padding);
94
94
  }
95
95
 
96
+ /** Нет выбранного значения: текст подсказки — цвет placeholder, не --field-color (иначе как обычный label) */
97
+ .placeholderValue {
98
+ color: var(--field-placeholder);
99
+ font-weight: 400;
100
+ }
101
+
96
102
  .f {
97
103
  cursor: pointer;
98
104
  &[aria-disabled="true"] {
@@ -36,7 +36,6 @@
36
36
  --field-icon-color: #8e8e93;
37
37
  --field-icon-gap: 10px;
38
38
  --field-side-padding: var(--control-side-padding);
39
- --field-inner-padding: var(--control-inner-padding);
40
39
  --field-block-gap: 0;
41
40
  --field-note-height: 100px;
42
41
  --field-note-line-height: 1.5;
@@ -34,7 +34,6 @@
34
34
  --field-icon-color: #8e8e93;
35
35
  --field-icon-gap: 10px;
36
36
  --field-side-padding: var(--control-side-padding);
37
- --field-inner-padding: var(--control-inner-padding);
38
37
  --field-block-gap: 0;
39
38
  --field-note-height: 100px;
40
39
  --field-note-line-height: 1.5;