@rescui/switcher 0.13.2 → 0.13.4
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/README.md +4 -2
- package/lib/index.css +77 -77
- package/lib/switcher.p.module.css.js +19 -19
- package/lib/vertical-switcher.p.module.css.js +20 -20
- package/llm/components/switcher.md +295 -0
- package/llm/index.md +2 -0
- package/package.json +7 -6
package/README.md
CHANGED
package/lib/index.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.
|
|
1
|
+
._themeLight_1bo29yv_6{
|
|
2
2
|
--rs-theme-dark:0;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
._themeDark_1bo29yv_9{
|
|
5
5
|
--rs-theme-dark:1;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._sizeXS_1bo29yv_13{
|
|
8
8
|
--_rs-switcher-border-radius:4px;
|
|
9
9
|
--_rs-switcher-compact-border-radius:var(--_rs-switcher-border-radius);
|
|
10
10
|
--_rs-switcher-option-padding:2px 12px;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
--_rs-switcher-compact-icon-offset:var(--_rs-switcher-icon-offset);
|
|
15
15
|
--_rs-switcher-icon-margin-vertical:2px;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
._sizeXS_1bo29yv_13 [data-rs-internal='switcher__option']{
|
|
18
18
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
19
19
|
--_rs-typography-text-transform:initial;
|
|
20
20
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
50
50
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
._sizeS_1bo29yv_16{
|
|
53
53
|
--_rs-switcher-border-radius:16px;
|
|
54
54
|
--_rs-switcher-compact-border-radius:4px;
|
|
55
55
|
--_rs-switcher-option-padding:6px 16px;
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
--_rs-switcher-compact-icon-offset:4px;
|
|
60
60
|
--_rs-switcher-icon-margin-vertical:0px;
|
|
61
61
|
}
|
|
62
|
-
.
|
|
62
|
+
._sizeS_1bo29yv_16 [data-rs-internal='switcher__option']{
|
|
63
63
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
64
64
|
--_rs-typography-text-transform:initial;
|
|
65
65
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
95
95
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
96
96
|
}
|
|
97
|
-
.
|
|
97
|
+
._sizeM_1bo29yv_19{
|
|
98
98
|
--_rs-switcher-border-radius:20px;
|
|
99
99
|
--_rs-switcher-compact-border-radius:8px;
|
|
100
100
|
--_rs-switcher-option-padding:8px 24px;
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
--_rs-switcher-compact-icon-offset:8px;
|
|
105
105
|
--_rs-switcher-icon-margin-vertical:0px;
|
|
106
106
|
}
|
|
107
|
-
.
|
|
107
|
+
._sizeM_1bo29yv_19 [data-rs-internal='switcher__option']{
|
|
108
108
|
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
109
109
|
--_rs-typography-text-transform:initial;
|
|
110
110
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -143,11 +143,11 @@
|
|
|
143
143
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
144
144
|
}
|
|
145
145
|
@media screen and (max-width: 640px){
|
|
146
|
-
.
|
|
146
|
+
._sizeM_1bo29yv_19 [data-rs-internal='switcher__option']{
|
|
147
147
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
.
|
|
150
|
+
._sizeL_1bo29yv_22{
|
|
151
151
|
--_rs-switcher-border-radius:26px;
|
|
152
152
|
--_rs-switcher-compact-border-radius:12px;
|
|
153
153
|
--_rs-switcher-option-padding:12px 32px;
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
--_rs-switcher-compact-icon-offset:12px;
|
|
158
158
|
--_rs-switcher-icon-margin-vertical:0px;
|
|
159
159
|
}
|
|
160
|
-
.
|
|
160
|
+
._sizeL_1bo29yv_22 [data-rs-internal='switcher__option']{
|
|
161
161
|
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
162
162
|
--_rs-typography-text-transform:initial;
|
|
163
163
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -196,22 +196,22 @@
|
|
|
196
196
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
197
197
|
}
|
|
198
198
|
@media screen and (max-width: 640px){
|
|
199
|
-
.
|
|
199
|
+
._sizeL_1bo29yv_22 [data-rs-internal='switcher__option']{
|
|
200
200
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
.
|
|
203
|
+
._modeClassic_1bo29yv_26{
|
|
204
204
|
--_rs-switcher-option-hover-background:var(--_rs-color-primary-t-fog);
|
|
205
205
|
--_rs-switcher-mark-border-color:var(--_rs-color-primary);
|
|
206
206
|
}
|
|
207
|
-
.
|
|
207
|
+
._modeRock_1bo29yv_29{
|
|
208
208
|
--_rs-switcher-option-hover-background:rgba(
|
|
209
209
|
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),
|
|
210
210
|
0.1
|
|
211
211
|
);
|
|
212
212
|
--_rs-switcher-mark-border-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));
|
|
213
213
|
}
|
|
214
|
-
.
|
|
214
|
+
._compact_1bo29yv_33{
|
|
215
215
|
--_rs-switcher-border-radius-from-compact:var(
|
|
216
216
|
--_rs-switcher-compact-border-radius
|
|
217
217
|
);
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
--_rs-switcher-compact-icon-offset
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
.
|
|
225
|
+
._switcher_1bo29yv_37{
|
|
226
226
|
--_rs-theme-dark:var(
|
|
227
227
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
228
228
|
var(--rs-theme-dark, 0)
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
233
233
|
}
|
|
234
234
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
235
|
-
.
|
|
235
|
+
._switcher_1bo29yv_37{
|
|
236
236
|
--_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)));
|
|
237
237
|
--_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)));
|
|
238
238
|
--_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)));
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
244
|
-
.
|
|
244
|
+
._switcher_1bo29yv_37{
|
|
245
245
|
--_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);
|
|
246
246
|
--_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));
|
|
247
247
|
--_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));
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
--_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));
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
.
|
|
252
|
+
._switcher_1bo29yv_37 {
|
|
253
253
|
|
|
254
254
|
position:relative;
|
|
255
255
|
|
|
@@ -265,16 +265,16 @@
|
|
|
265
265
|
background:transparent;
|
|
266
266
|
box-shadow:inset rgba(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), 0.3) 0 0 0 1px;
|
|
267
267
|
}
|
|
268
|
-
.
|
|
268
|
+
._switcher_1bo29yv_37._disabled_1bo29yv_55{
|
|
269
269
|
box-shadow:inset rgba(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), 0.2) 0 0 0 1px;
|
|
270
270
|
}
|
|
271
|
-
.
|
|
271
|
+
._alignIconLeft_1bo29yv_60{
|
|
272
272
|
--_rs-switcher-option-flex-direction:row;
|
|
273
273
|
}
|
|
274
|
-
.
|
|
274
|
+
._alignIconRight_1bo29yv_63{
|
|
275
275
|
--_rs-switcher-option-flex-direction:row-reverse;
|
|
276
276
|
}
|
|
277
|
-
.
|
|
277
|
+
._option_1bo29yv_67{
|
|
278
278
|
letter-spacing:var(
|
|
279
279
|
--rs-text-base-letter-spacing,
|
|
280
280
|
var(--_rs-typography-letter-spacing)
|
|
@@ -325,26 +325,26 @@
|
|
|
325
325
|
-moz-appearance:none;
|
|
326
326
|
appearance:none;
|
|
327
327
|
}
|
|
328
|
-
.
|
|
328
|
+
._disabled_1bo29yv_55 ._option_1bo29yv_67{
|
|
329
329
|
cursor:not-allowed;
|
|
330
330
|
pointer-events:none;
|
|
331
331
|
}
|
|
332
|
-
.
|
|
332
|
+
._option_1bo29yv_67:has(:focus[data-focus-method='key']){
|
|
333
333
|
box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
334
334
|
}
|
|
335
335
|
@media (hover: hover){
|
|
336
|
-
.
|
|
336
|
+
._option_1bo29yv_67:hover{
|
|
337
337
|
background:var(--_rs-switcher-option-hover-background);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
.
|
|
340
|
+
._option_1bo29yv_67._selected_1bo29yv_118:active{
|
|
341
341
|
background:transparent;
|
|
342
342
|
}
|
|
343
|
-
.
|
|
344
|
-
.
|
|
343
|
+
._option_1bo29yv_67._selected_1bo29yv_118:hover,
|
|
344
|
+
._option_1bo29yv_67._selected_1bo29yv_118:active{
|
|
345
345
|
cursor:default;
|
|
346
346
|
}
|
|
347
|
-
.
|
|
347
|
+
._hiddenMark_1bo29yv_127 ._option_1bo29yv_67._selected_1bo29yv_118::before{
|
|
348
348
|
position:absolute;
|
|
349
349
|
top:0;
|
|
350
350
|
right:0;
|
|
@@ -360,11 +360,11 @@
|
|
|
360
360
|
|
|
361
361
|
content:'';
|
|
362
362
|
}
|
|
363
|
-
.
|
|
363
|
+
._hiddenMark_1bo29yv_127._disabled_1bo29yv_55 ._option_1bo29yv_67._selected_1bo29yv_118::before{
|
|
364
364
|
border-color:rgba(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), 0.2);
|
|
365
365
|
}
|
|
366
|
-
.
|
|
367
|
-
.
|
|
366
|
+
._disabled_1bo29yv_55 ._option_1bo29yv_67,
|
|
367
|
+
._disabled_1bo29yv_55 ._option_1bo29yv_67._selected_1bo29yv_118{
|
|
368
368
|
color:var(
|
|
369
369
|
--rs-color-pale,
|
|
370
370
|
rgba(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), 0.5)
|
|
@@ -374,7 +374,7 @@
|
|
|
374
374
|
|
|
375
375
|
background:transparent;
|
|
376
376
|
}
|
|
377
|
-
.
|
|
377
|
+
._option_1bo29yv_67 ._icon_1bo29yv_158{
|
|
378
378
|
flex:0 0 auto;
|
|
379
379
|
|
|
380
380
|
width:auto;
|
|
@@ -385,7 +385,7 @@
|
|
|
385
385
|
margin-top:var(--_rs-switcher-icon-margin-vertical);
|
|
386
386
|
margin-bottom:var(--_rs-switcher-icon-margin-vertical);
|
|
387
387
|
}
|
|
388
|
-
.
|
|
388
|
+
._mark_1bo29yv_171{
|
|
389
389
|
position:absolute;
|
|
390
390
|
top:0;
|
|
391
391
|
bottom:0;
|
|
@@ -403,13 +403,13 @@
|
|
|
403
403
|
|
|
404
404
|
transition:all var(--_rs-switcher-mark-transition-duration) var(--rs-transition-function, ease);
|
|
405
405
|
}
|
|
406
|
-
.
|
|
406
|
+
._disabled_1bo29yv_55 ._mark_1bo29yv_171{
|
|
407
407
|
border-color:rgba(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), 0.2);
|
|
408
408
|
}
|
|
409
|
-
.
|
|
409
|
+
._hiddenMark_1bo29yv_127 ._mark_1bo29yv_171{
|
|
410
410
|
display:none;
|
|
411
411
|
}
|
|
412
|
-
.
|
|
412
|
+
._radio_1bo29yv_199{
|
|
413
413
|
position:absolute;
|
|
414
414
|
|
|
415
415
|
overflow:hidden;
|
|
@@ -426,13 +426,13 @@
|
|
|
426
426
|
clip-path:inset(50%);
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
-
.
|
|
429
|
+
._themeLight_48av0u_6{
|
|
430
430
|
--rs-theme-dark:0;
|
|
431
431
|
}
|
|
432
|
-
.
|
|
432
|
+
._themeDark_48av0u_9{
|
|
433
433
|
--rs-theme-dark:1;
|
|
434
434
|
}
|
|
435
|
-
.
|
|
435
|
+
._sizeXS_48av0u_13{
|
|
436
436
|
--_rs-switcher-vertical-border-radius:4px;
|
|
437
437
|
--_rs-switcher-vertical-option-vertical-padding:2px;
|
|
438
438
|
--_rs-switcher-vertical-option-horizontal-padding:8px;
|
|
@@ -440,7 +440,7 @@
|
|
|
440
440
|
--_rs-switcher-vertical-icon-offset:4px;
|
|
441
441
|
--_rs-switcher-vertical-icon-margin-vertical:2px;
|
|
442
442
|
}
|
|
443
|
-
.
|
|
443
|
+
._sizeXS_48av0u_13 [data-rs-internal='vertical-switcher__option']{
|
|
444
444
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
445
445
|
--_rs-typography-text-transform:initial;
|
|
446
446
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
476
476
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
477
477
|
}
|
|
478
|
-
.
|
|
478
|
+
._sizeS_48av0u_16{
|
|
479
479
|
--_rs-switcher-vertical-border-radius:4px;
|
|
480
480
|
--_rs-switcher-vertical-option-vertical-padding:6px;
|
|
481
481
|
--_rs-switcher-vertical-option-horizontal-padding:12px;
|
|
@@ -483,7 +483,7 @@
|
|
|
483
483
|
--_rs-switcher-vertical-icon-offset:4px;
|
|
484
484
|
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
485
485
|
}
|
|
486
|
-
.
|
|
486
|
+
._sizeS_48av0u_16 [data-rs-internal='vertical-switcher__option']{
|
|
487
487
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
488
488
|
--_rs-typography-text-transform:initial;
|
|
489
489
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -518,7 +518,7 @@
|
|
|
518
518
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
519
519
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
520
520
|
}
|
|
521
|
-
.
|
|
521
|
+
._sizeM_48av0u_19{
|
|
522
522
|
--_rs-switcher-vertical-border-radius:8px;
|
|
523
523
|
--_rs-switcher-vertical-option-vertical-padding:8px;
|
|
524
524
|
--_rs-switcher-vertical-option-horizontal-padding:16px;
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
--_rs-switcher-vertical-icon-offset:8px;
|
|
527
527
|
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
528
528
|
}
|
|
529
|
-
.
|
|
529
|
+
._sizeM_48av0u_19 [data-rs-internal='vertical-switcher__option']{
|
|
530
530
|
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
531
531
|
--_rs-typography-text-transform:initial;
|
|
532
532
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -565,11 +565,11 @@
|
|
|
565
565
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
566
566
|
}
|
|
567
567
|
@media screen and (max-width: 640px){
|
|
568
|
-
.
|
|
568
|
+
._sizeM_48av0u_19 [data-rs-internal='vertical-switcher__option']{
|
|
569
569
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
.
|
|
572
|
+
._sizeL_48av0u_22{
|
|
573
573
|
--_rs-switcher-vertical-border-radius:12px;
|
|
574
574
|
--_rs-switcher-vertical-option-vertical-padding:12px;
|
|
575
575
|
--_rs-switcher-vertical-option-horizontal-padding:24px;
|
|
@@ -577,7 +577,7 @@
|
|
|
577
577
|
--_rs-switcher-vertical-icon-offset:12px;
|
|
578
578
|
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
579
579
|
}
|
|
580
|
-
.
|
|
580
|
+
._sizeL_48av0u_22 [data-rs-internal='vertical-switcher__option']{
|
|
581
581
|
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
582
582
|
--_rs-typography-text-transform:initial;
|
|
583
583
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -616,17 +616,17 @@
|
|
|
616
616
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
617
617
|
}
|
|
618
618
|
@media screen and (max-width: 640px){
|
|
619
|
-
.
|
|
619
|
+
._sizeL_48av0u_22 [data-rs-internal='vertical-switcher__option']{
|
|
620
620
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
.
|
|
623
|
+
._modeClassic_48av0u_26{
|
|
624
624
|
--_rs-switcher-vertical-option-hover-background:var(
|
|
625
625
|
--_rs-color-primary-t-fog
|
|
626
626
|
);
|
|
627
627
|
--_rs-switcher-vertical-mark-border-color:var(--_rs-color-primary);
|
|
628
628
|
}
|
|
629
|
-
.
|
|
629
|
+
._modeRock_48av0u_29{
|
|
630
630
|
--_rs-switcher-vertical-option-hover-background:rgba(
|
|
631
631
|
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),
|
|
632
632
|
0.1
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
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)
|
|
636
636
|
);
|
|
637
637
|
}
|
|
638
|
-
.
|
|
638
|
+
._verticalSwitcher_48av0u_33{
|
|
639
639
|
--_rs-theme-dark:var(
|
|
640
640
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
641
641
|
var(--rs-theme-dark, 0)
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
646
646
|
}
|
|
647
647
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
648
|
-
.
|
|
648
|
+
._verticalSwitcher_48av0u_33{
|
|
649
649
|
--_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)));
|
|
650
650
|
--_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)));
|
|
651
651
|
--_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)));
|
|
@@ -654,7 +654,7 @@
|
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
657
|
-
.
|
|
657
|
+
._verticalSwitcher_48av0u_33{
|
|
658
658
|
--_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);
|
|
659
659
|
--_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));
|
|
660
660
|
--_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));
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
--_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));
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
.
|
|
665
|
+
._verticalSwitcher_48av0u_33 {
|
|
666
666
|
|
|
667
667
|
position:relative;
|
|
668
668
|
|
|
@@ -677,16 +677,16 @@
|
|
|
677
677
|
background:transparent;
|
|
678
678
|
box-shadow:inset rgba(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), 0.3) 0 0 0 1px;
|
|
679
679
|
}
|
|
680
|
-
.
|
|
680
|
+
._verticalSwitcher_48av0u_33._disabled_48av0u_50{
|
|
681
681
|
box-shadow:inset rgba(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), 0.2) 0 0 0 1px;
|
|
682
682
|
}
|
|
683
|
-
.
|
|
683
|
+
._alignIconLeft_48av0u_55{
|
|
684
684
|
--_rs-switcher-vertical-option-flex-direction:row;
|
|
685
685
|
}
|
|
686
|
-
.
|
|
686
|
+
._alignIconRight_48av0u_58{
|
|
687
687
|
--_rs-switcher-vertical-option-flex-direction:row-reverse;
|
|
688
688
|
}
|
|
689
|
-
.
|
|
689
|
+
._option_48av0u_62{
|
|
690
690
|
letter-spacing:var(
|
|
691
691
|
--rs-text-base-letter-spacing,
|
|
692
692
|
var(--_rs-typography-letter-spacing)
|
|
@@ -730,26 +730,26 @@
|
|
|
730
730
|
-moz-appearance:none;
|
|
731
731
|
appearance:none;
|
|
732
732
|
}
|
|
733
|
-
.
|
|
733
|
+
._disabled_48av0u_50 ._option_48av0u_62{
|
|
734
734
|
cursor:not-allowed;
|
|
735
735
|
pointer-events:none;
|
|
736
736
|
}
|
|
737
|
-
.
|
|
737
|
+
._option_48av0u_62:has(:focus[data-focus-method='key']){
|
|
738
738
|
box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
739
739
|
}
|
|
740
740
|
@media (hover: hover){
|
|
741
|
-
.
|
|
741
|
+
._option_48av0u_62:hover{
|
|
742
742
|
background:var(--_rs-switcher-vertical-option-hover-background);
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
|
-
.
|
|
745
|
+
._option_48av0u_62._selected_48av0u_107:active{
|
|
746
746
|
background:transparent;
|
|
747
747
|
}
|
|
748
|
-
.
|
|
749
|
-
.
|
|
748
|
+
._option_48av0u_62._selected_48av0u_107:hover,
|
|
749
|
+
._option_48av0u_62._selected_48av0u_107:active{
|
|
750
750
|
cursor:default;
|
|
751
751
|
}
|
|
752
|
-
.
|
|
752
|
+
._hiddenMark_48av0u_116 ._option_48av0u_62._selected_48av0u_107::before{
|
|
753
753
|
position:absolute;
|
|
754
754
|
top:0;
|
|
755
755
|
right:0;
|
|
@@ -765,11 +765,11 @@
|
|
|
765
765
|
|
|
766
766
|
content:'';
|
|
767
767
|
}
|
|
768
|
-
.
|
|
768
|
+
._hiddenMark_48av0u_116._disabled_48av0u_50 ._option_48av0u_62._selected_48av0u_107::before{
|
|
769
769
|
border-color:rgba(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), 0.2);
|
|
770
770
|
}
|
|
771
|
-
.
|
|
772
|
-
.
|
|
771
|
+
._disabled_48av0u_50 ._option_48av0u_62,
|
|
772
|
+
._disabled_48av0u_50 ._option_48av0u_62._selected_48av0u_107{
|
|
773
773
|
color:var(
|
|
774
774
|
--rs-color-pale,
|
|
775
775
|
rgba(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), 0.5)
|
|
@@ -779,12 +779,12 @@
|
|
|
779
779
|
|
|
780
780
|
background:transparent;
|
|
781
781
|
}
|
|
782
|
-
.
|
|
782
|
+
._option_48av0u_62 ._optionLabel_48av0u_147{
|
|
783
783
|
flex:1 1 auto;
|
|
784
784
|
|
|
785
785
|
text-align:left;
|
|
786
786
|
}
|
|
787
|
-
.
|
|
787
|
+
._option_48av0u_62 ._icon_48av0u_153{
|
|
788
788
|
flex:0 0 auto;
|
|
789
789
|
|
|
790
790
|
width:auto;
|
|
@@ -795,12 +795,12 @@
|
|
|
795
795
|
|
|
796
796
|
fill:currentColor;
|
|
797
797
|
}
|
|
798
|
-
.
|
|
798
|
+
._option_48av0u_62 ._fakeIcon_48av0u_164{
|
|
799
799
|
display:inline-block;
|
|
800
800
|
|
|
801
801
|
width:var(--_rs-switcher-vertical-icon-size);
|
|
802
802
|
}
|
|
803
|
-
.
|
|
803
|
+
._mark_48av0u_171{
|
|
804
804
|
position:absolute;
|
|
805
805
|
right:0;
|
|
806
806
|
left:0;
|
|
@@ -815,13 +815,13 @@
|
|
|
815
815
|
|
|
816
816
|
transition:all var(--_rs-switcher-vertical-mark-transition-duration) var(--rs-transition-function, ease);
|
|
817
817
|
}
|
|
818
|
-
.
|
|
818
|
+
._disabled_48av0u_50 ._mark_48av0u_171{
|
|
819
819
|
border-color:rgba(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), 0.2);
|
|
820
820
|
}
|
|
821
|
-
.
|
|
821
|
+
._hiddenMark_48av0u_116 ._mark_48av0u_171{
|
|
822
822
|
display:none;
|
|
823
823
|
}
|
|
824
|
-
.
|
|
824
|
+
._radio_48av0u_196{
|
|
825
825
|
position:absolute;
|
|
826
826
|
|
|
827
827
|
overflow:hidden;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"sizeXS": "
|
|
5
|
-
"sizeS": "
|
|
6
|
-
"sizeM": "
|
|
7
|
-
"sizeL": "
|
|
8
|
-
"modeClassic": "
|
|
9
|
-
"modeRock": "
|
|
10
|
-
"compact": "
|
|
11
|
-
"switcher": "
|
|
12
|
-
"disabled": "
|
|
13
|
-
"alignIconLeft": "
|
|
14
|
-
"alignIconRight": "
|
|
15
|
-
"option": "
|
|
16
|
-
"selected": "
|
|
17
|
-
"hiddenMark": "
|
|
18
|
-
"icon": "
|
|
19
|
-
"mark": "
|
|
20
|
-
"radio": "
|
|
2
|
+
"themeLight": "_themeLight_1bo29yv_6",
|
|
3
|
+
"themeDark": "_themeDark_1bo29yv_9",
|
|
4
|
+
"sizeXS": "_sizeXS_1bo29yv_13",
|
|
5
|
+
"sizeS": "_sizeS_1bo29yv_16",
|
|
6
|
+
"sizeM": "_sizeM_1bo29yv_19",
|
|
7
|
+
"sizeL": "_sizeL_1bo29yv_22",
|
|
8
|
+
"modeClassic": "_modeClassic_1bo29yv_26",
|
|
9
|
+
"modeRock": "_modeRock_1bo29yv_29",
|
|
10
|
+
"compact": "_compact_1bo29yv_33",
|
|
11
|
+
"switcher": "_switcher_1bo29yv_37",
|
|
12
|
+
"disabled": "_disabled_1bo29yv_55",
|
|
13
|
+
"alignIconLeft": "_alignIconLeft_1bo29yv_60",
|
|
14
|
+
"alignIconRight": "_alignIconRight_1bo29yv_63",
|
|
15
|
+
"option": "_option_1bo29yv_67",
|
|
16
|
+
"selected": "_selected_1bo29yv_118",
|
|
17
|
+
"hiddenMark": "_hiddenMark_1bo29yv_127",
|
|
18
|
+
"icon": "_icon_1bo29yv_158",
|
|
19
|
+
"mark": "_mark_1bo29yv_171",
|
|
20
|
+
"radio": "_radio_1bo29yv_199"
|
|
21
21
|
};
|
|
22
22
|
export { styles as default };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"sizeXS": "
|
|
5
|
-
"sizeS": "
|
|
6
|
-
"sizeM": "
|
|
7
|
-
"sizeL": "
|
|
8
|
-
"modeClassic": "
|
|
9
|
-
"modeRock": "
|
|
10
|
-
"verticalSwitcher": "
|
|
11
|
-
"disabled": "
|
|
12
|
-
"alignIconLeft": "
|
|
13
|
-
"alignIconRight": "
|
|
14
|
-
"option": "
|
|
15
|
-
"selected": "
|
|
16
|
-
"hiddenMark": "
|
|
17
|
-
"optionLabel": "
|
|
18
|
-
"icon": "
|
|
19
|
-
"fakeIcon": "
|
|
20
|
-
"mark": "
|
|
21
|
-
"radio": "
|
|
2
|
+
"themeLight": "_themeLight_48av0u_6",
|
|
3
|
+
"themeDark": "_themeDark_48av0u_9",
|
|
4
|
+
"sizeXS": "_sizeXS_48av0u_13",
|
|
5
|
+
"sizeS": "_sizeS_48av0u_16",
|
|
6
|
+
"sizeM": "_sizeM_48av0u_19",
|
|
7
|
+
"sizeL": "_sizeL_48av0u_22",
|
|
8
|
+
"modeClassic": "_modeClassic_48av0u_26",
|
|
9
|
+
"modeRock": "_modeRock_48av0u_29",
|
|
10
|
+
"verticalSwitcher": "_verticalSwitcher_48av0u_33",
|
|
11
|
+
"disabled": "_disabled_48av0u_50",
|
|
12
|
+
"alignIconLeft": "_alignIconLeft_48av0u_55",
|
|
13
|
+
"alignIconRight": "_alignIconRight_48av0u_58",
|
|
14
|
+
"option": "_option_48av0u_62",
|
|
15
|
+
"selected": "_selected_48av0u_107",
|
|
16
|
+
"hiddenMark": "_hiddenMark_48av0u_116",
|
|
17
|
+
"optionLabel": "_optionLabel_48av0u_147",
|
|
18
|
+
"icon": "_icon_48av0u_153",
|
|
19
|
+
"fakeIcon": "_fakeIcon_48av0u_164",
|
|
20
|
+
"mark": "_mark_48av0u_171",
|
|
21
|
+
"radio": "_radio_48av0u_196"
|
|
22
22
|
};
|
|
23
23
|
export { styles as default };
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# Switcher
|
|
2
|
+
|
|
3
|
+
A switcher replaces a group of radio buttons, presenting the options with one selected by default.
|
|
4
|
+
|
|
5
|
+
## Basic
|
|
6
|
+
|
|
7
|
+
### Features showcase
|
|
8
|
+
|
|
9
|
+
### Usage
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Switcher } from '@rescui/switcher';
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
|
|
15
|
+
const MySwitcher = () => {
|
|
16
|
+
const [value, setValue] = useState(3);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Switcher
|
|
20
|
+
value={value}
|
|
21
|
+
onChange={setValue}
|
|
22
|
+
options={[
|
|
23
|
+
{ label: 'One', value: 1 },
|
|
24
|
+
{ label: 'Two', value: 2 },
|
|
25
|
+
{ label: 'Three', value: 3 },
|
|
26
|
+
{ label: 'Four', value: 4 },
|
|
27
|
+
{ label: 'Five', value: 5 }
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
render(<MySwitcher />);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Compact mode
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Switcher } from '@rescui/switcher';
|
|
40
|
+
import { useState } from 'react';
|
|
41
|
+
|
|
42
|
+
const MySwitcher = () => {
|
|
43
|
+
const [value, setValue] = useState(3);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Switcher
|
|
47
|
+
value={value}
|
|
48
|
+
onChange={setValue}
|
|
49
|
+
compact
|
|
50
|
+
options={[
|
|
51
|
+
{ label: 'One', value: 1 },
|
|
52
|
+
{ label: 'Two', value: 2 },
|
|
53
|
+
{ label: 'Three', value: 3 },
|
|
54
|
+
{ label: 'Four', value: 4 },
|
|
55
|
+
{ label: 'Five', value: 5 }
|
|
56
|
+
]}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
render(<MySwitcher />);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### With icons
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Switcher } from '@rescui/switcher';
|
|
68
|
+
import {
|
|
69
|
+
HintOutlineIcon,
|
|
70
|
+
PersonOutlineIcon,
|
|
71
|
+
CompanyOutlineIcon
|
|
72
|
+
} from '@rescui/icons';
|
|
73
|
+
import { useState } from 'react';
|
|
74
|
+
|
|
75
|
+
const MySwitcher = () => {
|
|
76
|
+
const [value, setValue] = useState(2);
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<Switcher
|
|
80
|
+
value={value}
|
|
81
|
+
onChange={setValue}
|
|
82
|
+
options={[
|
|
83
|
+
{ label: 'One', value: 1, icon: <HintOutlineIcon /> },
|
|
84
|
+
{ label: 'Two', value: 2, icon: <PersonOutlineIcon /> },
|
|
85
|
+
{ label: 'Three', value: 3, icon: <CompanyOutlineIcon /> }
|
|
86
|
+
]}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
render(<MySwitcher />);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Vertical
|
|
95
|
+
|
|
96
|
+
### Features showcase
|
|
97
|
+
|
|
98
|
+
Do not restrict the component height. If you have to place it into a container with height restrictions, contact the [RescUI team](https://jetbrains.slack.com/app_redirect?channel=CQJRARE95), and we'll find a solution.
|
|
99
|
+
|
|
100
|
+
### Usage
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { VerticalSwitcher } from '@rescui/switcher';
|
|
104
|
+
import { useState } from 'react';
|
|
105
|
+
|
|
106
|
+
const MyVerticalSwitcher = () => {
|
|
107
|
+
const [value, setValue] = useState(3);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<VerticalSwitcher
|
|
111
|
+
value={value}
|
|
112
|
+
onChange={setValue}
|
|
113
|
+
options={[
|
|
114
|
+
{ label: 'One', value: 1 },
|
|
115
|
+
{ label: 'Two', value: 2 },
|
|
116
|
+
{ label: 'Three', value: 3 },
|
|
117
|
+
{ label: 'Four', value: 4 },
|
|
118
|
+
{ label: 'Five', value: 5 }
|
|
119
|
+
]}
|
|
120
|
+
style={{ minWidth: 180 }}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
render(<MyVerticalSwitcher />);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### With icons
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { VerticalSwitcher } from '@rescui/switcher';
|
|
132
|
+
import {
|
|
133
|
+
HintOutlineIcon,
|
|
134
|
+
PersonOutlineIcon,
|
|
135
|
+
CompanyOutlineIcon,
|
|
136
|
+
BellOutlineIcon,
|
|
137
|
+
CloudOutlineIcon
|
|
138
|
+
} from '@rescui/icons';
|
|
139
|
+
import { useState } from 'react';
|
|
140
|
+
|
|
141
|
+
const MyVerticalSwitcher = () => {
|
|
142
|
+
const [value, setValue] = useState(2);
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<VerticalSwitcher
|
|
146
|
+
value={value}
|
|
147
|
+
onChange={setValue}
|
|
148
|
+
options={[
|
|
149
|
+
{ label: 'One', value: 1, icon: <HintOutlineIcon /> },
|
|
150
|
+
{ label: 'Two', value: 2, icon: <PersonOutlineIcon /> },
|
|
151
|
+
{ label: 'Three', value: 3, icon: <CompanyOutlineIcon /> },
|
|
152
|
+
{ label: 'Four', value: 4, icon: <BellOutlineIcon /> },
|
|
153
|
+
{ label: 'Five', value: 5, icon: <CloudOutlineIcon /> }
|
|
154
|
+
]}
|
|
155
|
+
style={{ minWidth: 180 }}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
render(<MyVerticalSwitcher />);
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## CSS Mixins API
|
|
164
|
+
|
|
165
|
+
#### `Switcher` mixins
|
|
166
|
+
|
|
167
|
+
| Mixin name | Details |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| `rs-switcher-size-xs` | prop: `size`<br><br>value: `"xs"` |
|
|
170
|
+
| `rs-switcher-size-s` | prop: `size`<br><br>value: `"s"` |
|
|
171
|
+
| `rs-switcher-size-m` | prop: `size`<br><br>value: `"m"` |
|
|
172
|
+
| `rs-switcher-size-l` | prop: `size`<br><br>value: `"l"` |
|
|
173
|
+
| `rs-switcher-mode-classic` | prop: `mode`<br><br>value: `"classic"` |
|
|
174
|
+
| `rs-switcher-mode-rock` | prop: `mode`<br><br>value: `"rock"` |
|
|
175
|
+
| `rs-switcher-compact-true` | prop: `compact`<br><br>value: `true` |
|
|
176
|
+
| `rs-switcher-compact-false` | prop: `compact`<br><br>value: `false` |
|
|
177
|
+
| `rs-switcher-icon-position-left` | prop: `iconPosition`<br><br>value: `"left"` |
|
|
178
|
+
| `rs-switcher-icon-position-right` | prop: `iconPosition`<br><br>value: `"right"` |
|
|
179
|
+
|
|
180
|
+
##### Demo
|
|
181
|
+
|
|
182
|
+
Use the controls to see the effect at different viewport widths.
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import { useState } from 'react';
|
|
186
|
+
import { Switcher } from '@rescui/switcher';
|
|
187
|
+
import { HintOutlineIcon, PersonOutlineIcon } from '@rescui/icons';
|
|
188
|
+
|
|
189
|
+
const MySwitcher = () => {
|
|
190
|
+
const [value, setValue] = useState(3);
|
|
191
|
+
|
|
192
|
+
return (
|
|
193
|
+
<Switcher
|
|
194
|
+
value={value}
|
|
195
|
+
onChange={setValue}
|
|
196
|
+
options={[
|
|
197
|
+
{ label: 'One', value: 1, icon: <HintOutlineIcon /> },
|
|
198
|
+
{ label: 'Two', value: 2, icon: <PersonOutlineIcon /> },
|
|
199
|
+
{ label: 'Three', value: 3 },
|
|
200
|
+
{ label: 'Four', value: 4 },
|
|
201
|
+
{ label: 'Five', value: 5 }
|
|
202
|
+
]}
|
|
203
|
+
className="my-switcher"
|
|
204
|
+
/>
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
render(<MySwitcher />);
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```postcss attached
|
|
212
|
+
@import '@rescui/switcher/lib/public-api.p.css';
|
|
213
|
+
|
|
214
|
+
.my-switcher {
|
|
215
|
+
@media (max-width: 640px) {
|
|
216
|
+
@mixin rs-switcher-size-l;
|
|
217
|
+
@mixin rs-switcher-mode-rock;
|
|
218
|
+
@mixin rs-switcher-compact-true;
|
|
219
|
+
@mixin rs-switcher-icon-position-right;
|
|
220
|
+
}
|
|
221
|
+
@media (max-width: 500px) {
|
|
222
|
+
@mixin rs-switcher-size-s;
|
|
223
|
+
@mixin rs-switcher-mode-classic;
|
|
224
|
+
@mixin rs-switcher-compact-false;
|
|
225
|
+
@mixin rs-switcher-icon-position-left;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### `VerticalSwitcher` mixins
|
|
231
|
+
|
|
232
|
+
| Mixin name | Details |
|
|
233
|
+
| --- | --- |
|
|
234
|
+
| `rs-vertical-switcher-size-xs` | prop: `size`<br><br>value: `"xs"` |
|
|
235
|
+
| `rs-vertical-switcher-size-s` | prop: `size`<br><br>value: `"s"` |
|
|
236
|
+
| `rs-vertical-switcher-size-m` | prop: `size`<br><br>value: `"m"` |
|
|
237
|
+
| `rs-vertical-switcher-size-l` | prop: `size`<br><br>value: `"l"` |
|
|
238
|
+
| `rs-vertical-switcher-mode-classic` | prop: `mode`<br><br>value: `"classic"` |
|
|
239
|
+
| `rs-vertical-switcher-mode-rock` | prop: `mode`<br><br>value: `"rock"` |
|
|
240
|
+
| `rs-vertical-switcher-icon-position-left` | prop: `iconPosition`<br><br>value: `"left"` |
|
|
241
|
+
| `rs-vertical-switcher-icon-position-right` | prop: `iconPosition`<br><br>value: `"right"` |
|
|
242
|
+
|
|
243
|
+
##### Demo
|
|
244
|
+
|
|
245
|
+
Use the controls to see the effect at different viewport widths.
|
|
246
|
+
|
|
247
|
+
```tsx
|
|
248
|
+
import { useState } from 'react';
|
|
249
|
+
import { VerticalSwitcher } from '@rescui/switcher';
|
|
250
|
+
import {
|
|
251
|
+
HintOutlineIcon,
|
|
252
|
+
PersonOutlineIcon,
|
|
253
|
+
CompanyOutlineIcon,
|
|
254
|
+
BellOutlineIcon,
|
|
255
|
+
CloudOutlineIcon
|
|
256
|
+
} from '@rescui/icons';
|
|
257
|
+
|
|
258
|
+
const MyVerticalSwitcher = () => {
|
|
259
|
+
const [value, setValue] = useState(3);
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<VerticalSwitcher
|
|
263
|
+
value={value}
|
|
264
|
+
onChange={setValue}
|
|
265
|
+
options={[
|
|
266
|
+
{ label: 'One', value: 1, icon: <HintOutlineIcon /> },
|
|
267
|
+
{ label: 'Two', value: 2, icon: <PersonOutlineIcon /> },
|
|
268
|
+
{ label: 'Three', value: 3, icon: <CompanyOutlineIcon /> },
|
|
269
|
+
{ label: 'Four', value: 4, icon: <BellOutlineIcon /> },
|
|
270
|
+
{ label: 'Five', value: 5, icon: <CloudOutlineIcon /> }
|
|
271
|
+
]}
|
|
272
|
+
className="my-vertical-switcher"
|
|
273
|
+
/>
|
|
274
|
+
);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
render(<MyVerticalSwitcher />);
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
```postcss
|
|
281
|
+
@import '@rescui/switcher/lib/public-api.p.css';
|
|
282
|
+
|
|
283
|
+
.my-vertical-switcher {
|
|
284
|
+
@media (max-width: 640px) {
|
|
285
|
+
@mixin rs-vertical-switcher-size-l;
|
|
286
|
+
@mixin rs-vertical-switcher-mode-rock;
|
|
287
|
+
@mixin rs-vertical-switcher-icon-position-right;
|
|
288
|
+
}
|
|
289
|
+
@media (max-width: 500px) {
|
|
290
|
+
@mixin rs-vertical-switcher-size-s;
|
|
291
|
+
@mixin rs-vertical-switcher-mode-classic;
|
|
292
|
+
@mixin rs-vertical-switcher-icon-position-left;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
```
|
package/llm/index.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/switcher",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"src:main": "src/index.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"lib",
|
|
12
|
+
"llm",
|
|
12
13
|
"typings",
|
|
13
14
|
"LICENSE.txt"
|
|
14
15
|
],
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"@babel/runtime-corejs3": "^7.26.0",
|
|
20
|
-
"@rescui/use-resize-observer": "^0.3.
|
|
21
|
+
"@rescui/use-resize-observer": "^0.3.3",
|
|
21
22
|
"classnames": "^2.2.6"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
@@ -26,15 +27,15 @@
|
|
|
26
27
|
"react": ">=16.8.0 <20"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@rescui/colors": "^0.3.
|
|
30
|
-
"@rescui/icons": "^1.8.
|
|
30
|
+
"@rescui/colors": "^0.3.2",
|
|
31
|
+
"@rescui/icons": "^1.8.2",
|
|
31
32
|
"@rescui/scripts": "^0.5.2",
|
|
32
|
-
"@rescui/typography": "^0.27.
|
|
33
|
+
"@rescui/typography": "^0.27.2"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "rescui-scripts build && yarn run build-pcss-api",
|
|
36
37
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
37
38
|
},
|
|
38
39
|
"nx": {},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "7aade8fced69c4a1ac61078a1daf2c1cd4f5a1c9"
|
|
40
41
|
}
|