@rescui/checkbox 0.8.5 → 0.8.7-RUI-226-Update-card-cn-6e43cc89.60
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.
- package/lib/_virtual/index.css.js +12 -7
- package/lib/_virtual/warning.js +90 -21
- package/lib/checkbox.js +32 -44
- package/lib/index.css +117 -110
- package/lib/index.js +1 -1
- package/lib/parts/checkbox-control-inner.js +24 -41
- package/lib/parts/checkbox-control.js +32 -42
- package/lib/parts/checkbox-list.js +25 -37
- package/lib/parts/checkbox-manager.js +31 -45
- package/lib/parts/checkbox.p.module.css.js +28 -28
- package/lib/parts/group-context.js +2 -2
- package/lib/parts/marks.js +35 -52
- package/lib/public-api.p.css +38 -26
- package/lib/public-api.pcss +38 -26
- package/package.json +11 -11
package/lib/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
._icon_15yklic_4{
|
|
2
2
|
--_rs-theme-dark:var(
|
|
3
3
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
4
4
|
var(--rs-theme-dark, 0)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
9
9
|
}
|
|
10
10
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
11
|
-
.
|
|
11
|
+
._icon_15yklic_4{
|
|
12
12
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
13
13
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
14
14
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
20
|
-
.
|
|
20
|
+
._icon_15yklic_4{
|
|
21
21
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
22
22
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
23
23
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -25,60 +25,84 @@
|
|
|
25
25
|
--_rs-color-primary-t-fog:rgba(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255, calc(var(--_rs-theme-light-coefficient, 1)*0.2 + var(--_rs-theme-dark-coefficient, 0)*0.3));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
._icon_15yklic_4{
|
|
29
29
|
|
|
30
30
|
fill:var(--_rs-icons-themed-fill-or-initial, currentcolor);
|
|
31
31
|
|
|
32
32
|
width:auto;
|
|
33
33
|
height:var(--_rs-icons-height);
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
._sizeXS_15yklic_14{
|
|
36
36
|
--_rs-icons-height:16px;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
._sizeS_15yklic_18{
|
|
39
39
|
--_rs-icons-height:20px;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
._sizeM_15yklic_22{
|
|
42
42
|
--_rs-icons-height:24px;
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
._sizeL_15yklic_26{
|
|
45
45
|
--_rs-icons-height:28px;
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
._light_15yklic_30{
|
|
48
48
|
--rs-theme-dark:0;
|
|
49
49
|
--_rs-icons-themed-fill-or-initial:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
._dark_15yklic_34{
|
|
52
52
|
--rs-theme-dark:1;
|
|
53
53
|
--_rs-icons-themed-fill-or-initial:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
@keyframes rs-icon-rotate{
|
|
56
56
|
from{
|
|
57
|
-
|
|
58
|
-
transform:rotate(0deg);
|
|
57
|
+
transform:rotate(0deg);
|
|
59
58
|
}
|
|
60
59
|
to{
|
|
61
|
-
|
|
62
|
-
transform:rotate(360deg);
|
|
60
|
+
transform:rotate(360deg);
|
|
63
61
|
}
|
|
64
62
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
._allVariants_15yklic_48{
|
|
64
|
+
aspect-ratio:var(--rs-icon-ar-width, 1) / var(--rs-icon-ar-height, 1);
|
|
65
|
+
container:rs-icon / size;
|
|
66
|
+
}
|
|
67
|
+
._variant16_15yklic_53,
|
|
68
|
+
._variant20_15yklic_54,
|
|
69
|
+
._variant24_15yklic_55{
|
|
70
|
+
display:none;
|
|
71
|
+
}
|
|
72
|
+
._variant28_15yklic_58{
|
|
73
|
+
display:block;
|
|
74
|
+
}
|
|
75
|
+
@container rs-icon (max-height: 24px){
|
|
76
|
+
._variant24_15yklic_55{
|
|
77
|
+
display:block;
|
|
69
78
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
._variant28_15yklic_58{
|
|
80
|
+
display:none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
@container rs-icon (max-height: 20px){
|
|
84
|
+
._variant20_15yklic_54{
|
|
85
|
+
display:block;
|
|
86
|
+
}
|
|
87
|
+
._variant24_15yklic_55{
|
|
88
|
+
display:none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
@container rs-icon (max-height: 16px){
|
|
92
|
+
._variant16_15yklic_53{
|
|
93
|
+
display:block;
|
|
94
|
+
}
|
|
95
|
+
._variant20_15yklic_54{
|
|
96
|
+
display:none;
|
|
73
97
|
}
|
|
74
98
|
}
|
|
75
|
-
.
|
|
99
|
+
._themeLight_yb7cp9_8{
|
|
76
100
|
--rs-theme-dark:0;
|
|
77
101
|
}
|
|
78
|
-
.
|
|
102
|
+
._themeDark_yb7cp9_11{
|
|
79
103
|
--rs-theme-dark:1;
|
|
80
104
|
}
|
|
81
|
-
.
|
|
105
|
+
._container_yb7cp9_15{
|
|
82
106
|
--_rs-theme-dark:var(
|
|
83
107
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
84
108
|
var(--rs-theme-dark, 0)
|
|
@@ -88,7 +112,7 @@
|
|
|
88
112
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
89
113
|
}
|
|
90
114
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
91
|
-
.
|
|
115
|
+
._container_yb7cp9_15{
|
|
92
116
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
93
117
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
94
118
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -97,7 +121,7 @@
|
|
|
97
121
|
}
|
|
98
122
|
}
|
|
99
123
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
100
|
-
.
|
|
124
|
+
._container_yb7cp9_15{
|
|
101
125
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
102
126
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
103
127
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -105,8 +129,8 @@
|
|
|
105
129
|
--_rs-color-primary-t-fog:rgba(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255, calc(var(--_rs-theme-light-coefficient, 1)*0.2 + var(--_rs-theme-dark-coefficient, 0)*0.3));
|
|
106
130
|
}
|
|
107
131
|
}
|
|
108
|
-
.
|
|
109
|
-
--_rs-typography-letter-spacing:normal;
|
|
132
|
+
._listSizeS_yb7cp9_20 [data-rs-internal='checkbox-list__error-message']{
|
|
133
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
110
134
|
--_rs-typography-text-transform:initial;
|
|
111
135
|
--_rs-typography-font-variant-numeric:initial;
|
|
112
136
|
--_rs-typography-font-family:var(
|
|
@@ -136,11 +160,11 @@
|
|
|
136
160
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
137
161
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
138
162
|
}
|
|
139
|
-
.
|
|
163
|
+
._listSizeS_yb7cp9_20 [data-rs-internal='checkbox-list__error-icon']:not(html){
|
|
140
164
|
--_rs-icons-height:20px;
|
|
141
165
|
}
|
|
142
|
-
.
|
|
143
|
-
--_rs-typography-letter-spacing:normal;
|
|
166
|
+
._listSizeM_yb7cp9_23 [data-rs-internal='checkbox-list__error-message']{
|
|
167
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
144
168
|
--_rs-typography-text-transform:initial;
|
|
145
169
|
--_rs-typography-font-variant-numeric:initial;
|
|
146
170
|
--_rs-typography-font-family:var(
|
|
@@ -170,11 +194,11 @@
|
|
|
170
194
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
171
195
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
172
196
|
}
|
|
173
|
-
.
|
|
197
|
+
._listSizeM_yb7cp9_23 [data-rs-internal='checkbox-list__error-icon']:not(html){
|
|
174
198
|
--_rs-icons-height:20px;
|
|
175
199
|
}
|
|
176
|
-
.
|
|
177
|
-
--_rs-typography-letter-spacing:normal;
|
|
200
|
+
._listSizeL_yb7cp9_26 [data-rs-internal='checkbox-list__error-message']{
|
|
201
|
+
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
178
202
|
--_rs-typography-text-transform:initial;
|
|
179
203
|
--_rs-typography-font-variant-numeric:initial;
|
|
180
204
|
--_rs-typography-font-family:var(
|
|
@@ -204,11 +228,11 @@
|
|
|
204
228
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
205
229
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
206
230
|
}
|
|
207
|
-
.
|
|
231
|
+
._listSizeL_yb7cp9_26 [data-rs-internal='checkbox-list__error-icon']:not(html){
|
|
208
232
|
--_rs-icons-height:24px;
|
|
209
233
|
}
|
|
210
|
-
.
|
|
211
|
-
--_rs-typography-letter-spacing:normal;
|
|
234
|
+
._checkboxSizeS_yb7cp9_30 [data-rs-internal='checkbox__error-message']{
|
|
235
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
212
236
|
--_rs-typography-text-transform:initial;
|
|
213
237
|
--_rs-typography-font-variant-numeric:initial;
|
|
214
238
|
--_rs-typography-font-family:var(
|
|
@@ -238,11 +262,11 @@
|
|
|
238
262
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
239
263
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
240
264
|
}
|
|
241
|
-
.
|
|
265
|
+
._checkboxSizeS_yb7cp9_30 [data-rs-internal='checkbox__error-icon']:not(html){
|
|
242
266
|
--_rs-icons-height:20px;
|
|
243
267
|
}
|
|
244
|
-
.
|
|
245
|
-
--_rs-typography-letter-spacing:normal;
|
|
268
|
+
._checkboxSizeM_yb7cp9_33 [data-rs-internal='checkbox__error-message']{
|
|
269
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
246
270
|
--_rs-typography-text-transform:initial;
|
|
247
271
|
--_rs-typography-font-variant-numeric:initial;
|
|
248
272
|
--_rs-typography-font-family:var(
|
|
@@ -272,11 +296,11 @@
|
|
|
272
296
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
273
297
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
274
298
|
}
|
|
275
|
-
.
|
|
299
|
+
._checkboxSizeM_yb7cp9_33 [data-rs-internal='checkbox__error-icon']:not(html){
|
|
276
300
|
--_rs-icons-height:20px;
|
|
277
301
|
}
|
|
278
|
-
.
|
|
279
|
-
--_rs-typography-letter-spacing:normal;
|
|
302
|
+
._checkboxSizeL_yb7cp9_36 [data-rs-internal='checkbox__error-message']{
|
|
303
|
+
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
280
304
|
--_rs-typography-text-transform:initial;
|
|
281
305
|
--_rs-typography-font-variant-numeric:initial;
|
|
282
306
|
--_rs-typography-font-family:var(
|
|
@@ -306,10 +330,10 @@
|
|
|
306
330
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
307
331
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
308
332
|
}
|
|
309
|
-
.
|
|
333
|
+
._checkboxSizeL_yb7cp9_36 [data-rs-internal='checkbox__error-icon']:not(html){
|
|
310
334
|
--_rs-icons-height:24px;
|
|
311
335
|
}
|
|
312
|
-
.
|
|
336
|
+
._sizeS_yb7cp9_40{
|
|
313
337
|
--_rs-checkbox-ci-mark-s-display:initial;
|
|
314
338
|
--_rs-checkbox-ci-mark-m-display:none;
|
|
315
339
|
--_rs-checkbox-ci-mark-l-display:none;
|
|
@@ -317,7 +341,7 @@
|
|
|
317
341
|
--_rs-checkbox-ci-shadow-size:3px;
|
|
318
342
|
--_rs-checkbox-ci-indeterminate-icon-border-width:6px 3px;
|
|
319
343
|
}
|
|
320
|
-
.
|
|
344
|
+
._sizeM_yb7cp9_43{
|
|
321
345
|
--_rs-checkbox-ci-mark-s-display:none;
|
|
322
346
|
--_rs-checkbox-ci-mark-m-display:initial;
|
|
323
347
|
--_rs-checkbox-ci-mark-l-display:none;
|
|
@@ -325,7 +349,7 @@
|
|
|
325
349
|
--_rs-checkbox-ci-shadow-size:3px;
|
|
326
350
|
--_rs-checkbox-ci-indeterminate-icon-border-width:8px 3px;
|
|
327
351
|
}
|
|
328
|
-
.
|
|
352
|
+
._sizeL_yb7cp9_46{
|
|
329
353
|
--_rs-checkbox-ci-mark-s-display:none;
|
|
330
354
|
--_rs-checkbox-ci-mark-m-display:none;
|
|
331
355
|
--_rs-checkbox-ci-mark-l-display:initial;
|
|
@@ -333,14 +357,14 @@
|
|
|
333
357
|
--_rs-checkbox-ci-shadow-size:4px;
|
|
334
358
|
--_rs-checkbox-ci-indeterminate-icon-border-width:9px 3px;
|
|
335
359
|
}
|
|
336
|
-
.
|
|
360
|
+
._classic_yb7cp9_50{
|
|
337
361
|
--_rs-checkbox-ci-mark-color:#FFFFFF;
|
|
338
362
|
--_rs-checkbox-ci-indeterminate-icon-border-color:var(--_rs-color-primary);
|
|
339
363
|
--_rs-checkbox-ci-indeterminate-icon-background-color:#FFFFFF;
|
|
340
364
|
--_rs-checkbox-ci-checked-icon-border-color:var(--_rs-color-primary);
|
|
341
365
|
--_rs-checkbox-ci-hover-icon-box-shadow:var(--_rs-color-primary-t-fog);
|
|
342
366
|
}
|
|
343
|
-
.
|
|
367
|
+
._rock_yb7cp9_53{
|
|
344
368
|
--_rs-checkbox-ci-mark-color:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*227));
|
|
345
369
|
--_rs-checkbox-ci-indeterminate-icon-border-color:rgb(
|
|
346
370
|
calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227)
|
|
@@ -356,7 +380,7 @@
|
|
|
356
380
|
0.1
|
|
357
381
|
);
|
|
358
382
|
}
|
|
359
|
-
.
|
|
383
|
+
._checkbox_yb7cp9_30{
|
|
360
384
|
--_rs-theme-dark:var(
|
|
361
385
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
362
386
|
var(--rs-theme-dark, 0)
|
|
@@ -366,7 +390,7 @@
|
|
|
366
390
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
367
391
|
}
|
|
368
392
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
369
|
-
.
|
|
393
|
+
._checkbox_yb7cp9_30{
|
|
370
394
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
371
395
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
372
396
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -375,7 +399,7 @@
|
|
|
375
399
|
}
|
|
376
400
|
}
|
|
377
401
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
378
|
-
.
|
|
402
|
+
._checkbox_yb7cp9_30{
|
|
379
403
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
380
404
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
381
405
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -383,15 +407,13 @@
|
|
|
383
407
|
--_rs-color-primary-t-fog:rgba(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255, calc(var(--_rs-theme-light-coefficient, 1)*0.2 + var(--_rs-theme-dark-coefficient, 0)*0.3));
|
|
384
408
|
}
|
|
385
409
|
}
|
|
386
|
-
.
|
|
410
|
+
._checkbox_yb7cp9_30 {
|
|
387
411
|
|
|
388
412
|
position:relative;
|
|
389
413
|
|
|
390
414
|
display:inline-block;
|
|
391
415
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
box-sizing:border-box;
|
|
416
|
+
box-sizing:border-box;
|
|
395
417
|
width:calc(var(--_rs-checkbox-ci-size) + var(--_rs-checkbox-ci-shadow-size)*2);
|
|
396
418
|
height:calc(var(--_rs-checkbox-ci-size) + var(--_rs-checkbox-ci-shadow-size)*2);
|
|
397
419
|
padding:var(--_rs-checkbox-ci-shadow-size);
|
|
@@ -400,7 +422,7 @@
|
|
|
400
422
|
|
|
401
423
|
text-align:left;
|
|
402
424
|
}
|
|
403
|
-
.
|
|
425
|
+
._errorMessage_yb7cp9_79{
|
|
404
426
|
letter-spacing:var(
|
|
405
427
|
--rs-text-base-letter-spacing,
|
|
406
428
|
var(--_rs-typography-letter-spacing)
|
|
@@ -411,33 +433,24 @@
|
|
|
411
433
|
font-weight:var(--_rs-typography-font-weight);
|
|
412
434
|
line-height:var(--_rs-typography-line-height);
|
|
413
435
|
font-variant-numeric:var(--_rs-typography-font-variant-numeric);
|
|
414
|
-
-webkit-font-feature-settings:'kern', 'liga', 'calt';
|
|
415
436
|
font-feature-settings:'kern', 'liga', 'calt';
|
|
416
437
|
|
|
417
|
-
display:-webkit-box;
|
|
418
|
-
|
|
419
|
-
display:-ms-flexbox;
|
|
420
|
-
|
|
421
438
|
display:flex;
|
|
422
|
-
|
|
423
|
-
flex-wrap:nowrap;
|
|
439
|
+
flex-wrap:nowrap;
|
|
424
440
|
|
|
425
441
|
color:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
426
|
-
-
|
|
427
|
-
|
|
428
|
-
column-gap:8px;
|
|
442
|
+
-moz-column-gap:8px;
|
|
443
|
+
column-gap:8px;
|
|
429
444
|
}
|
|
430
|
-
.
|
|
445
|
+
._errorMessage_yb7cp9_79._list_yb7cp9_20{
|
|
431
446
|
margin-bottom:8px;
|
|
432
447
|
}
|
|
433
|
-
.
|
|
434
|
-
|
|
435
|
-
-ms-flex:0 0 auto;
|
|
436
|
-
flex:0 0 auto;
|
|
448
|
+
._errorIcon_yb7cp9_93{
|
|
449
|
+
flex:0 0 auto;
|
|
437
450
|
|
|
438
451
|
color:#F45C4A;
|
|
439
452
|
}
|
|
440
|
-
.
|
|
453
|
+
._input_yb7cp9_99{
|
|
441
454
|
position:absolute;
|
|
442
455
|
z-index:-1;
|
|
443
456
|
|
|
@@ -447,13 +460,11 @@
|
|
|
447
460
|
|
|
448
461
|
border:0;
|
|
449
462
|
}
|
|
450
|
-
.
|
|
463
|
+
._icon_yb7cp9_110{
|
|
451
464
|
display:inline-block;
|
|
452
465
|
float:left;
|
|
453
466
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
box-sizing:border-box;
|
|
467
|
+
box-sizing:border-box;
|
|
457
468
|
width:var(--_rs-checkbox-ci-size);
|
|
458
469
|
height:var(--_rs-checkbox-ci-size);
|
|
459
470
|
|
|
@@ -463,21 +474,19 @@
|
|
|
463
474
|
|
|
464
475
|
background:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*207), calc(255 - var(--_rs-theme-dark-coefficient, 0)*204));
|
|
465
476
|
|
|
466
|
-
-webkit-transition:border-width ease-out 100ms, border-color ease-out 100ms;
|
|
467
|
-
|
|
468
477
|
transition:border-width ease-out 100ms, border-color ease-out 100ms;
|
|
469
478
|
}
|
|
470
|
-
.
|
|
479
|
+
._enabled_yb7cp9_126 ._icon_yb7cp9_110{
|
|
471
480
|
cursor:pointer;
|
|
472
481
|
}
|
|
473
|
-
.
|
|
482
|
+
._indeterminate_yb7cp9_130 ._icon_yb7cp9_110{
|
|
474
483
|
border-width:var(--_rs-checkbox-ci-indeterminate-icon-border-width);
|
|
475
484
|
}
|
|
476
|
-
.
|
|
485
|
+
._input_yb7cp9_99:checked + ._icon_yb7cp9_110{
|
|
477
486
|
border-width:calc(var(--_rs-checkbox-ci-size)/2);
|
|
478
487
|
}
|
|
479
|
-
.
|
|
480
|
-
.
|
|
488
|
+
._disabled_yb7cp9_138 ._icon_yb7cp9_110._icon_yb7cp9_110,
|
|
489
|
+
._input_yb7cp9_99:disabled + ._icon_yb7cp9_110{
|
|
481
490
|
border-color:rgb(calc(186 - var(--_rs-theme-dark-coefficient, 0)*92), calc(186 - var(--_rs-theme-dark-coefficient, 0)*92), calc(187 - var(--_rs-theme-dark-coefficient, 0)*91));
|
|
482
491
|
|
|
483
492
|
cursor:not-allowed;
|
|
@@ -485,27 +494,27 @@
|
|
|
485
494
|
|
|
486
495
|
background:rgb(calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*193));
|
|
487
496
|
}
|
|
488
|
-
.
|
|
489
|
-
.
|
|
497
|
+
._input_yb7cp9_99:hover + ._icon_yb7cp9_110,
|
|
498
|
+
._enabled_yb7cp9_126:hover ._icon_yb7cp9_110{
|
|
490
499
|
background:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*184), calc(255 - var(--_rs-theme-dark-coefficient, 0)*184), calc(255 - var(--_rs-theme-dark-coefficient, 0)*182));
|
|
491
500
|
}
|
|
492
|
-
.
|
|
493
|
-
.
|
|
494
|
-
.
|
|
501
|
+
._enabled_yb7cp9_126._indeterminate_yb7cp9_130 ._icon_yb7cp9_110,
|
|
502
|
+
._enabled_yb7cp9_126._indeterminate_yb7cp9_130:hover ._icon_yb7cp9_110,
|
|
503
|
+
._enabled_yb7cp9_126._indeterminate_yb7cp9_130 ._input_yb7cp9_99:hover + ._icon_yb7cp9_110{
|
|
495
504
|
border-color:var(--_rs-checkbox-ci-indeterminate-icon-border-color);
|
|
496
505
|
|
|
497
506
|
background-color:var(
|
|
498
507
|
--_rs-checkbox-ci-indeterminate-icon-background-color
|
|
499
508
|
);
|
|
500
509
|
}
|
|
501
|
-
.
|
|
510
|
+
._enabled_yb7cp9_126 ._input_yb7cp9_99:checked + ._icon_yb7cp9_110._icon_yb7cp9_110{
|
|
502
511
|
border-color:var(--_rs-checkbox-ci-checked-icon-border-color);
|
|
503
512
|
}
|
|
504
|
-
.
|
|
505
|
-
.
|
|
513
|
+
._error_yb7cp9_79 ._icon_yb7cp9_110._icon_yb7cp9_110._icon_yb7cp9_110._icon_yb7cp9_110,
|
|
514
|
+
._input_yb7cp9_99:invalid + ._icon_yb7cp9_110._icon_yb7cp9_110._icon_yb7cp9_110{
|
|
506
515
|
border-color:#F45C4A;
|
|
507
516
|
}
|
|
508
|
-
.
|
|
517
|
+
._icon_yb7cp9_110::after{
|
|
509
518
|
position:absolute;
|
|
510
519
|
top:var(--_rs-checkbox-ci-shadow-size);
|
|
511
520
|
right:var(--_rs-checkbox-ci-shadow-size);
|
|
@@ -514,17 +523,15 @@
|
|
|
514
523
|
|
|
515
524
|
content:'';
|
|
516
525
|
}
|
|
517
|
-
.
|
|
518
|
-
label:hover .
|
|
519
|
-
.
|
|
520
|
-
|
|
521
|
-
box-shadow:0 0 0 var(--_rs-checkbox-ci-shadow-size) var(--_rs-checkbox-ci-hover-icon-box-shadow);
|
|
526
|
+
._enabled_yb7cp9_126:hover > ._icon_yb7cp9_110::after,
|
|
527
|
+
label:hover ._enabled_yb7cp9_126 > ._icon_yb7cp9_110::after,
|
|
528
|
+
._enabled_yb7cp9_126 ._input_yb7cp9_99:active + ._icon_yb7cp9_110::after{
|
|
529
|
+
box-shadow:0 0 0 var(--_rs-checkbox-ci-shadow-size) var(--_rs-checkbox-ci-hover-icon-box-shadow);
|
|
522
530
|
}
|
|
523
|
-
.
|
|
524
|
-
|
|
525
|
-
box-shadow:0 0 0 1px rgb(calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*181)), 0 0 0 var(--_rs-checkbox-ci-shadow-size) var(--_rs-color-primary-t-dim);
|
|
531
|
+
._enabled_yb7cp9_126 ._input_yb7cp9_99:focus[data-focus-method='key'] + ._icon_yb7cp9_110::after{
|
|
532
|
+
box-shadow:0 0 0 1px rgb(calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*184), calc(232 - var(--_rs-theme-dark-coefficient, 0)*181)), 0 0 0 var(--_rs-checkbox-ci-shadow-size) var(--_rs-color-primary-t-dim);
|
|
526
533
|
}
|
|
527
|
-
.
|
|
534
|
+
._checkmark_yb7cp9_194{
|
|
528
535
|
position:absolute;
|
|
529
536
|
top:var(--_rs-checkbox-ci-shadow-size);
|
|
530
537
|
left:var(--_rs-checkbox-ci-shadow-size);
|
|
@@ -535,22 +542,22 @@
|
|
|
535
542
|
height:var(--_rs-checkbox-ci-size);
|
|
536
543
|
fill:currentColor;
|
|
537
544
|
}
|
|
538
|
-
.
|
|
545
|
+
._enabled_yb7cp9_126 ._checkmark_yb7cp9_194{
|
|
539
546
|
color:var(--_rs-checkbox-ci-mark-color);
|
|
540
547
|
}
|
|
541
|
-
.
|
|
542
|
-
.
|
|
548
|
+
._disabled_yb7cp9_138 ._checkmark_yb7cp9_194,
|
|
549
|
+
._input_yb7cp9_99:disabled + ._icon_yb7cp9_110 > ._checkmark_yb7cp9_194{
|
|
543
550
|
color:rgb(calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*196), calc(244 - var(--_rs-theme-dark-coefficient, 0)*193));
|
|
544
551
|
}
|
|
545
|
-
.
|
|
552
|
+
._input_yb7cp9_99:checked + ._icon_yb7cp9_110 > ._checkmark_yb7cp9_194{
|
|
546
553
|
display:block;
|
|
547
554
|
}
|
|
548
|
-
.
|
|
555
|
+
._markS_yb7cp9_219{
|
|
549
556
|
display:var(--_rs-checkbox-ci-mark-s-display);
|
|
550
557
|
}
|
|
551
|
-
.
|
|
558
|
+
._markM_yb7cp9_222{
|
|
552
559
|
display:var(--_rs-checkbox-ci-mark-m-display);
|
|
553
560
|
}
|
|
554
|
-
.
|
|
561
|
+
._markL_yb7cp9_225{
|
|
555
562
|
display:var(--_rs-checkbox-ci-mark-l-display);
|
|
556
563
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,68 +1,51 @@
|
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
|
2
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
3
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
4
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
5
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
6
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
7
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
8
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
9
|
-
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["className", "children", "theme", "isError", "disabled", "size", "mode", "indeterminate", "notUseLabelTag"];
|
|
11
|
-
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
1
|
import React from 'react';
|
|
17
2
|
import PropTypes from 'prop-types';
|
|
18
3
|
import cn from 'classnames';
|
|
19
4
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
20
5
|
import styles from './checkbox.p.module.css.js';
|
|
21
6
|
import { Mark } from './marks.js';
|
|
22
|
-
|
|
7
|
+
const THEME_STYLES = {
|
|
23
8
|
light: styles.themeLight,
|
|
24
9
|
dark: styles.themeDark
|
|
25
10
|
};
|
|
26
|
-
|
|
11
|
+
const SIZE_STYLES = {
|
|
27
12
|
s: styles.sizeS,
|
|
28
13
|
m: styles.sizeM,
|
|
29
14
|
l: styles.sizeL
|
|
30
15
|
};
|
|
31
|
-
|
|
16
|
+
const MODE_STYLES = {
|
|
32
17
|
classic: styles.classic,
|
|
33
18
|
rock: styles.rock
|
|
34
19
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var theme = useThemeWithUndefined(themeFromProps);
|
|
53
|
-
var RootTag = notUseLabelTag ? 'span' : 'label';
|
|
20
|
+
const DEFAULT_SIZE = 'm';
|
|
21
|
+
const DEFAULT_MODE = 'classic';
|
|
22
|
+
const CheckboxControlInner = /*#__PURE__*/React.forwardRef(function CheckboxControlInner(_ref, ref) {
|
|
23
|
+
let {
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
theme: themeFromProps,
|
|
27
|
+
isError,
|
|
28
|
+
disabled,
|
|
29
|
+
size = DEFAULT_SIZE,
|
|
30
|
+
mode = DEFAULT_MODE,
|
|
31
|
+
indeterminate,
|
|
32
|
+
notUseLabelTag = false,
|
|
33
|
+
...restProps
|
|
34
|
+
} = _ref;
|
|
35
|
+
const theme = useThemeWithUndefined(themeFromProps);
|
|
36
|
+
const RootTag = notUseLabelTag ? 'span' : 'label';
|
|
54
37
|
return /*#__PURE__*/React.createElement(RootTag, {
|
|
55
38
|
className: cn(styles.checkbox, THEME_STYLES[theme], SIZE_STYLES[size] || SIZE_STYLES[DEFAULT_SIZE], MODE_STYLES[mode] || MODE_STYLES[DEFAULT_MODE], disabled ? styles.disabled : styles.enabled, indeterminate && styles.indeterminate, isError && styles.error, className),
|
|
56
39
|
"data-test": "checkbox",
|
|
57
40
|
"data-rs-internal": "checkbox__control"
|
|
58
|
-
}, /*#__PURE__*/React.createElement("input",
|
|
59
|
-
"data-test": "checkbox-input"
|
|
60
|
-
|
|
41
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
42
|
+
"data-test": "checkbox-input",
|
|
43
|
+
...restProps,
|
|
61
44
|
ref: ref,
|
|
62
45
|
className: styles.input,
|
|
63
46
|
type: "checkbox",
|
|
64
47
|
disabled: disabled
|
|
65
|
-
})
|
|
48
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
66
49
|
className: cn(styles.icon, isError && styles.iconError),
|
|
67
50
|
"data-test": 'checkbox-icon'
|
|
68
51
|
}, /*#__PURE__*/React.createElement(Mark, {
|