@rescui/switcher 0.9.8 → 0.10.0
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/index.css +456 -53
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/public-api.p.css +231 -0
- package/lib/public-api.pcss +231 -0
- package/lib/switcher.js +5 -3
- package/lib/switcher.p.module.css.js +20 -0
- package/lib/vertical-switcher.d.ts +35 -0
- package/lib/vertical-switcher.js +264 -0
- package/lib/vertical-switcher.p.module.css.js +21 -0
- package/package.json +2 -2
- package/lib/index.p.module.css.js +0 -20
package/lib/public-api.p.css
CHANGED
|
@@ -207,9 +207,240 @@
|
|
|
207
207
|
--_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));
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
+
@define-mixin rs-switcher-compact-true{
|
|
211
|
+
&:not(html){
|
|
212
|
+
--_rs-switcher-border-radius-from-compact:var(
|
|
213
|
+
--_rs-switcher-compact-border-radius
|
|
214
|
+
);
|
|
215
|
+
--_rs-switcher-option-padding-from-compact:var(
|
|
216
|
+
--_rs-switcher-compact-option-padding
|
|
217
|
+
);
|
|
218
|
+
--_rs-switcher-icon-offset-from-compact:var(
|
|
219
|
+
--_rs-switcher-compact-icon-offset
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
@define-mixin rs-switcher-compact-false{
|
|
224
|
+
&:not(html){
|
|
225
|
+
--_rs-switcher-border-radius-from-compact:initial;
|
|
226
|
+
--_rs-switcher-option-padding-from-compact:initial;
|
|
227
|
+
--_rs-switcher-icon-offset-from-compact:initial;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
210
230
|
@define-mixin rs-switcher-icon-position-left{
|
|
211
231
|
--_rs-switcher-option-flex-direction:row;
|
|
212
232
|
}
|
|
213
233
|
@define-mixin rs-switcher-icon-position-right{
|
|
214
234
|
--_rs-switcher-option-flex-direction:row-reverse;
|
|
215
235
|
}
|
|
236
|
+
@define-mixin rs-vertical-switcher-size-xs{
|
|
237
|
+
&:not(html){
|
|
238
|
+
--_rs-switcher-vertical-border-radius:4px;
|
|
239
|
+
--_rs-switcher-vertical-option-vertical-padding:2px;
|
|
240
|
+
--_rs-switcher-vertical-option-horizontal-padding:8px;
|
|
241
|
+
--_rs-switcher-vertical-icon-size:16px;
|
|
242
|
+
--_rs-switcher-vertical-icon-offset:4px;
|
|
243
|
+
--_rs-switcher-vertical-icon-margin-vertical:2px;
|
|
244
|
+
}
|
|
245
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
246
|
+
--_rs-typography-letter-spacing:0.0045em;
|
|
247
|
+
--_rs-typography-text-transform:initial;
|
|
248
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
249
|
+
--_rs-typography-font-family:var(
|
|
250
|
+
--rs-font-family-ui,
|
|
251
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
252
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
253
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
254
|
+
);
|
|
255
|
+
--_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
|
|
256
|
+
--_rs-typography-font-weight:var(
|
|
257
|
+
--rs-font-weight-regular,
|
|
258
|
+
400
|
|
259
|
+
);
|
|
260
|
+
--_rs-typography-line-height:var(
|
|
261
|
+
--rs-text-3-line-height,
|
|
262
|
+
20px
|
|
263
|
+
);
|
|
264
|
+
--_rs-typography-base-color:var(
|
|
265
|
+
--_rs-typography-hardness-color,
|
|
266
|
+
var(
|
|
267
|
+
--rs-color-average,
|
|
268
|
+
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.7)
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
--_rs-typography-text-auto-offset:8px;
|
|
272
|
+
--_rs-typography-ul-list-li-padding-left:28px;
|
|
273
|
+
--_rs-typography-ol-list-li-padding-left:21px;
|
|
274
|
+
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
275
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
276
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
277
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
@define-mixin rs-vertical-switcher-size-s{
|
|
281
|
+
&:not(html){
|
|
282
|
+
--_rs-switcher-vertical-border-radius:4px;
|
|
283
|
+
--_rs-switcher-vertical-option-vertical-padding:6px;
|
|
284
|
+
--_rs-switcher-vertical-option-horizontal-padding:12px;
|
|
285
|
+
--_rs-switcher-vertical-icon-size:20px;
|
|
286
|
+
--_rs-switcher-vertical-icon-offset:4px;
|
|
287
|
+
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
288
|
+
}
|
|
289
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
290
|
+
--_rs-typography-letter-spacing:0.0045em;
|
|
291
|
+
--_rs-typography-text-transform:initial;
|
|
292
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
293
|
+
--_rs-typography-font-family:var(
|
|
294
|
+
--rs-font-family-ui,
|
|
295
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
296
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
297
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
298
|
+
);
|
|
299
|
+
--_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
|
|
300
|
+
--_rs-typography-font-weight:var(
|
|
301
|
+
--rs-font-weight-regular,
|
|
302
|
+
400
|
|
303
|
+
);
|
|
304
|
+
--_rs-typography-line-height:var(
|
|
305
|
+
--rs-text-3-line-height,
|
|
306
|
+
20px
|
|
307
|
+
);
|
|
308
|
+
--_rs-typography-base-color:var(
|
|
309
|
+
--_rs-typography-hardness-color,
|
|
310
|
+
var(
|
|
311
|
+
--rs-color-average,
|
|
312
|
+
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.7)
|
|
313
|
+
)
|
|
314
|
+
);
|
|
315
|
+
--_rs-typography-text-auto-offset:8px;
|
|
316
|
+
--_rs-typography-ul-list-li-padding-left:28px;
|
|
317
|
+
--_rs-typography-ol-list-li-padding-left:21px;
|
|
318
|
+
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
319
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
320
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
321
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
@define-mixin rs-vertical-switcher-size-m{
|
|
325
|
+
&:not(html){
|
|
326
|
+
--_rs-switcher-vertical-border-radius:8px;
|
|
327
|
+
--_rs-switcher-vertical-option-vertical-padding:8px;
|
|
328
|
+
--_rs-switcher-vertical-option-horizontal-padding:16px;
|
|
329
|
+
--_rs-switcher-vertical-icon-size:24px;
|
|
330
|
+
--_rs-switcher-vertical-icon-offset:8px;
|
|
331
|
+
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
332
|
+
}
|
|
333
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
334
|
+
--_rs-typography-letter-spacing:0.0015em;
|
|
335
|
+
--_rs-typography-text-transform:initial;
|
|
336
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
337
|
+
--_rs-typography-font-family:var(
|
|
338
|
+
--rs-font-family-ui,
|
|
339
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
340
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
341
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
342
|
+
);
|
|
343
|
+
--_rs-typography-font-size:var(--rs-text-2-font-size, 16px);
|
|
344
|
+
--_rs-typography-font-weight:var(
|
|
345
|
+
--rs-font-weight-regular,
|
|
346
|
+
400
|
|
347
|
+
);
|
|
348
|
+
--_rs-typography-line-height:var(
|
|
349
|
+
--rs-text-2-line-height,
|
|
350
|
+
24px
|
|
351
|
+
);
|
|
352
|
+
--_rs-typography-base-color:var(
|
|
353
|
+
--_rs-typography-hardness-color,
|
|
354
|
+
var(
|
|
355
|
+
--rs-color-average,
|
|
356
|
+
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.7)
|
|
357
|
+
)
|
|
358
|
+
);
|
|
359
|
+
--_rs-typography-text-auto-offset:16px;
|
|
360
|
+
--_rs-typography-ul-list-li-padding-left:22px;
|
|
361
|
+
--_rs-typography-ol-list-li-padding-left:26px;
|
|
362
|
+
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
363
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
364
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
365
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
366
|
+
}
|
|
367
|
+
@media screen and (max-width: 640px){
|
|
368
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
369
|
+
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
@define-mixin rs-vertical-switcher-size-l{
|
|
374
|
+
&:not(html){
|
|
375
|
+
--_rs-switcher-vertical-border-radius:12px;
|
|
376
|
+
--_rs-switcher-vertical-option-vertical-padding:12px;
|
|
377
|
+
--_rs-switcher-vertical-option-horizontal-padding:24px;
|
|
378
|
+
--_rs-switcher-vertical-icon-size:28px;
|
|
379
|
+
--_rs-switcher-vertical-icon-offset:12px;
|
|
380
|
+
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
381
|
+
}
|
|
382
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
383
|
+
--_rs-typography-letter-spacing:normal;
|
|
384
|
+
--_rs-typography-text-transform:initial;
|
|
385
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
386
|
+
--_rs-typography-font-family:var(
|
|
387
|
+
--rs-font-family-ui,
|
|
388
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
389
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
390
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
391
|
+
);
|
|
392
|
+
--_rs-typography-font-size:var(--rs-text-1-font-size, 20px);
|
|
393
|
+
--_rs-typography-font-weight:var(
|
|
394
|
+
--rs-font-weight-regular,
|
|
395
|
+
400
|
|
396
|
+
);
|
|
397
|
+
--_rs-typography-line-height:var(
|
|
398
|
+
--rs-text-1-line-height,
|
|
399
|
+
28px
|
|
400
|
+
);
|
|
401
|
+
--_rs-typography-base-color:var(
|
|
402
|
+
--_rs-typography-hardness-color,
|
|
403
|
+
var(
|
|
404
|
+
--rs-color-average,
|
|
405
|
+
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.7)
|
|
406
|
+
)
|
|
407
|
+
);
|
|
408
|
+
--_rs-typography-text-auto-offset:32px;
|
|
409
|
+
--_rs-typography-ul-list-li-padding-left:26px;
|
|
410
|
+
--_rs-typography-ol-list-li-padding-left:32px;
|
|
411
|
+
--_rs-typography-list-li-margin-top-from-text:24px;
|
|
412
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
413
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
414
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
415
|
+
}
|
|
416
|
+
@media screen and (max-width: 640px){
|
|
417
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
418
|
+
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
@define-mixin rs-vertical-switcher-mode-classic{
|
|
423
|
+
&:not(html){
|
|
424
|
+
--_rs-switcher-vertical-option-hover-background:var(
|
|
425
|
+
--_rs-color-primary-t-fog
|
|
426
|
+
);
|
|
427
|
+
--_rs-switcher-vertical-mark-border-color:var(--_rs-color-primary);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
@define-mixin rs-vertical-switcher-mode-rock{
|
|
431
|
+
&:not(html){
|
|
432
|
+
--_rs-switcher-vertical-option-hover-background:rgba(
|
|
433
|
+
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),
|
|
434
|
+
0.1
|
|
435
|
+
);
|
|
436
|
+
--_rs-switcher-vertical-mark-border-color:rgb(
|
|
437
|
+
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)
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
@define-mixin rs-vertical-switcher-icon-position-left{
|
|
442
|
+
--_rs-switcher-vertical-option-flex-direction:row;
|
|
443
|
+
}
|
|
444
|
+
@define-mixin rs-vertical-switcher-icon-position-right{
|
|
445
|
+
--_rs-switcher-vertical-option-flex-direction:row-reverse;
|
|
446
|
+
}
|
package/lib/public-api.pcss
CHANGED
|
@@ -207,9 +207,240 @@
|
|
|
207
207
|
--_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));
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
+
@define-mixin rs-switcher-compact-true{
|
|
211
|
+
&:not(html){
|
|
212
|
+
--_rs-switcher-border-radius-from-compact:var(
|
|
213
|
+
--_rs-switcher-compact-border-radius
|
|
214
|
+
);
|
|
215
|
+
--_rs-switcher-option-padding-from-compact:var(
|
|
216
|
+
--_rs-switcher-compact-option-padding
|
|
217
|
+
);
|
|
218
|
+
--_rs-switcher-icon-offset-from-compact:var(
|
|
219
|
+
--_rs-switcher-compact-icon-offset
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
@define-mixin rs-switcher-compact-false{
|
|
224
|
+
&:not(html){
|
|
225
|
+
--_rs-switcher-border-radius-from-compact:initial;
|
|
226
|
+
--_rs-switcher-option-padding-from-compact:initial;
|
|
227
|
+
--_rs-switcher-icon-offset-from-compact:initial;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
210
230
|
@define-mixin rs-switcher-icon-position-left{
|
|
211
231
|
--_rs-switcher-option-flex-direction:row;
|
|
212
232
|
}
|
|
213
233
|
@define-mixin rs-switcher-icon-position-right{
|
|
214
234
|
--_rs-switcher-option-flex-direction:row-reverse;
|
|
215
235
|
}
|
|
236
|
+
@define-mixin rs-vertical-switcher-size-xs{
|
|
237
|
+
&:not(html){
|
|
238
|
+
--_rs-switcher-vertical-border-radius:4px;
|
|
239
|
+
--_rs-switcher-vertical-option-vertical-padding:2px;
|
|
240
|
+
--_rs-switcher-vertical-option-horizontal-padding:8px;
|
|
241
|
+
--_rs-switcher-vertical-icon-size:16px;
|
|
242
|
+
--_rs-switcher-vertical-icon-offset:4px;
|
|
243
|
+
--_rs-switcher-vertical-icon-margin-vertical:2px;
|
|
244
|
+
}
|
|
245
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
246
|
+
--_rs-typography-letter-spacing:0.0045em;
|
|
247
|
+
--_rs-typography-text-transform:initial;
|
|
248
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
249
|
+
--_rs-typography-font-family:var(
|
|
250
|
+
--rs-font-family-ui,
|
|
251
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
252
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
253
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
254
|
+
);
|
|
255
|
+
--_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
|
|
256
|
+
--_rs-typography-font-weight:var(
|
|
257
|
+
--rs-font-weight-regular,
|
|
258
|
+
400
|
|
259
|
+
);
|
|
260
|
+
--_rs-typography-line-height:var(
|
|
261
|
+
--rs-text-3-line-height,
|
|
262
|
+
20px
|
|
263
|
+
);
|
|
264
|
+
--_rs-typography-base-color:var(
|
|
265
|
+
--_rs-typography-hardness-color,
|
|
266
|
+
var(
|
|
267
|
+
--rs-color-average,
|
|
268
|
+
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.7)
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
--_rs-typography-text-auto-offset:8px;
|
|
272
|
+
--_rs-typography-ul-list-li-padding-left:28px;
|
|
273
|
+
--_rs-typography-ol-list-li-padding-left:21px;
|
|
274
|
+
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
275
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
276
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
277
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
@define-mixin rs-vertical-switcher-size-s{
|
|
281
|
+
&:not(html){
|
|
282
|
+
--_rs-switcher-vertical-border-radius:4px;
|
|
283
|
+
--_rs-switcher-vertical-option-vertical-padding:6px;
|
|
284
|
+
--_rs-switcher-vertical-option-horizontal-padding:12px;
|
|
285
|
+
--_rs-switcher-vertical-icon-size:20px;
|
|
286
|
+
--_rs-switcher-vertical-icon-offset:4px;
|
|
287
|
+
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
288
|
+
}
|
|
289
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
290
|
+
--_rs-typography-letter-spacing:0.0045em;
|
|
291
|
+
--_rs-typography-text-transform:initial;
|
|
292
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
293
|
+
--_rs-typography-font-family:var(
|
|
294
|
+
--rs-font-family-ui,
|
|
295
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
296
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
297
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
298
|
+
);
|
|
299
|
+
--_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
|
|
300
|
+
--_rs-typography-font-weight:var(
|
|
301
|
+
--rs-font-weight-regular,
|
|
302
|
+
400
|
|
303
|
+
);
|
|
304
|
+
--_rs-typography-line-height:var(
|
|
305
|
+
--rs-text-3-line-height,
|
|
306
|
+
20px
|
|
307
|
+
);
|
|
308
|
+
--_rs-typography-base-color:var(
|
|
309
|
+
--_rs-typography-hardness-color,
|
|
310
|
+
var(
|
|
311
|
+
--rs-color-average,
|
|
312
|
+
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.7)
|
|
313
|
+
)
|
|
314
|
+
);
|
|
315
|
+
--_rs-typography-text-auto-offset:8px;
|
|
316
|
+
--_rs-typography-ul-list-li-padding-left:28px;
|
|
317
|
+
--_rs-typography-ol-list-li-padding-left:21px;
|
|
318
|
+
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
319
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
320
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
321
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
@define-mixin rs-vertical-switcher-size-m{
|
|
325
|
+
&:not(html){
|
|
326
|
+
--_rs-switcher-vertical-border-radius:8px;
|
|
327
|
+
--_rs-switcher-vertical-option-vertical-padding:8px;
|
|
328
|
+
--_rs-switcher-vertical-option-horizontal-padding:16px;
|
|
329
|
+
--_rs-switcher-vertical-icon-size:24px;
|
|
330
|
+
--_rs-switcher-vertical-icon-offset:8px;
|
|
331
|
+
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
332
|
+
}
|
|
333
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
334
|
+
--_rs-typography-letter-spacing:0.0015em;
|
|
335
|
+
--_rs-typography-text-transform:initial;
|
|
336
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
337
|
+
--_rs-typography-font-family:var(
|
|
338
|
+
--rs-font-family-ui,
|
|
339
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
340
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
341
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
342
|
+
);
|
|
343
|
+
--_rs-typography-font-size:var(--rs-text-2-font-size, 16px);
|
|
344
|
+
--_rs-typography-font-weight:var(
|
|
345
|
+
--rs-font-weight-regular,
|
|
346
|
+
400
|
|
347
|
+
);
|
|
348
|
+
--_rs-typography-line-height:var(
|
|
349
|
+
--rs-text-2-line-height,
|
|
350
|
+
24px
|
|
351
|
+
);
|
|
352
|
+
--_rs-typography-base-color:var(
|
|
353
|
+
--_rs-typography-hardness-color,
|
|
354
|
+
var(
|
|
355
|
+
--rs-color-average,
|
|
356
|
+
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.7)
|
|
357
|
+
)
|
|
358
|
+
);
|
|
359
|
+
--_rs-typography-text-auto-offset:16px;
|
|
360
|
+
--_rs-typography-ul-list-li-padding-left:22px;
|
|
361
|
+
--_rs-typography-ol-list-li-padding-left:26px;
|
|
362
|
+
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
363
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
364
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
365
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
366
|
+
}
|
|
367
|
+
@media screen and (max-width: 640px){
|
|
368
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
369
|
+
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
@define-mixin rs-vertical-switcher-size-l{
|
|
374
|
+
&:not(html){
|
|
375
|
+
--_rs-switcher-vertical-border-radius:12px;
|
|
376
|
+
--_rs-switcher-vertical-option-vertical-padding:12px;
|
|
377
|
+
--_rs-switcher-vertical-option-horizontal-padding:24px;
|
|
378
|
+
--_rs-switcher-vertical-icon-size:28px;
|
|
379
|
+
--_rs-switcher-vertical-icon-offset:12px;
|
|
380
|
+
--_rs-switcher-vertical-icon-margin-vertical:0px;
|
|
381
|
+
}
|
|
382
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
383
|
+
--_rs-typography-letter-spacing:normal;
|
|
384
|
+
--_rs-typography-text-transform:initial;
|
|
385
|
+
--_rs-typography-font-variant-numeric:initial;
|
|
386
|
+
--_rs-typography-font-family:var(
|
|
387
|
+
--rs-font-family-ui,
|
|
388
|
+
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
389
|
+
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
390
|
+
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
391
|
+
);
|
|
392
|
+
--_rs-typography-font-size:var(--rs-text-1-font-size, 20px);
|
|
393
|
+
--_rs-typography-font-weight:var(
|
|
394
|
+
--rs-font-weight-regular,
|
|
395
|
+
400
|
|
396
|
+
);
|
|
397
|
+
--_rs-typography-line-height:var(
|
|
398
|
+
--rs-text-1-line-height,
|
|
399
|
+
28px
|
|
400
|
+
);
|
|
401
|
+
--_rs-typography-base-color:var(
|
|
402
|
+
--_rs-typography-hardness-color,
|
|
403
|
+
var(
|
|
404
|
+
--rs-color-average,
|
|
405
|
+
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.7)
|
|
406
|
+
)
|
|
407
|
+
);
|
|
408
|
+
--_rs-typography-text-auto-offset:32px;
|
|
409
|
+
--_rs-typography-ul-list-li-padding-left:26px;
|
|
410
|
+
--_rs-typography-ol-list-li-padding-left:32px;
|
|
411
|
+
--_rs-typography-list-li-margin-top-from-text:24px;
|
|
412
|
+
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
413
|
+
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
414
|
+
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
415
|
+
}
|
|
416
|
+
@media screen and (max-width: 640px){
|
|
417
|
+
&:not(html) [data-rs-internal='vertical-switcher__option']{
|
|
418
|
+
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
@define-mixin rs-vertical-switcher-mode-classic{
|
|
423
|
+
&:not(html){
|
|
424
|
+
--_rs-switcher-vertical-option-hover-background:var(
|
|
425
|
+
--_rs-color-primary-t-fog
|
|
426
|
+
);
|
|
427
|
+
--_rs-switcher-vertical-mark-border-color:var(--_rs-color-primary);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
@define-mixin rs-vertical-switcher-mode-rock{
|
|
431
|
+
&:not(html){
|
|
432
|
+
--_rs-switcher-vertical-option-hover-background:rgba(
|
|
433
|
+
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),
|
|
434
|
+
0.1
|
|
435
|
+
);
|
|
436
|
+
--_rs-switcher-vertical-mark-border-color:rgb(
|
|
437
|
+
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)
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
@define-mixin rs-vertical-switcher-icon-position-left{
|
|
442
|
+
--_rs-switcher-vertical-option-flex-direction:row;
|
|
443
|
+
}
|
|
444
|
+
@define-mixin rs-vertical-switcher-icon-position-right{
|
|
445
|
+
--_rs-switcher-vertical-option-flex-direction:row-reverse;
|
|
446
|
+
}
|
package/lib/switcher.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import cn from 'classnames';
|
|
7
7
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
8
8
|
import { useResizeObserver } from '@rescui/use-resize-observer';
|
|
9
|
-
import styles from './
|
|
9
|
+
import styles from './switcher.p.module.css.js';
|
|
10
10
|
var sizeToClass = {
|
|
11
11
|
l: styles.sizeL,
|
|
12
12
|
m: styles.sizeM,
|
|
@@ -124,8 +124,10 @@ function Switcher(_ref2) {
|
|
|
124
124
|
"data-e2e": e2eId,
|
|
125
125
|
ref: containerRef,
|
|
126
126
|
"data-rs-internal": 'switcher',
|
|
127
|
-
"data-test": "switcher"
|
|
127
|
+
"data-test": cn("switcher", disabled && "switcher-disabled")
|
|
128
128
|
}, _mapInstanceProperty(options).call(options, function (_ref3, index) {
|
|
129
|
+
var _options$activeIndex;
|
|
130
|
+
|
|
129
131
|
var value = _ref3.value,
|
|
130
132
|
label = _ref3.label,
|
|
131
133
|
icon = _ref3.icon;
|
|
@@ -139,7 +141,7 @@ function Switcher(_ref2) {
|
|
|
139
141
|
return onChange(value);
|
|
140
142
|
},
|
|
141
143
|
ref: handleOptionRef(index),
|
|
142
|
-
selected:
|
|
144
|
+
selected: ((_options$activeIndex = options[activeIndex]) === null || _options$activeIndex === void 0 ? void 0 : _options$activeIndex.value) === value
|
|
143
145
|
});
|
|
144
146
|
}), /*#__PURE__*/React.createElement("span", {
|
|
145
147
|
className: cn(styles.mark),
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var styles = {
|
|
2
|
+
"themeLight": "_themeLight_1n7cu7x_6",
|
|
3
|
+
"themeDark": "_themeDark_1n7cu7x_9",
|
|
4
|
+
"sizeXS": "_sizeXS_1n7cu7x_13",
|
|
5
|
+
"sizeS": "_sizeS_1n7cu7x_16",
|
|
6
|
+
"sizeM": "_sizeM_1n7cu7x_19",
|
|
7
|
+
"sizeL": "_sizeL_1n7cu7x_22",
|
|
8
|
+
"modeClassic": "_modeClassic_1n7cu7x_26",
|
|
9
|
+
"modeRock": "_modeRock_1n7cu7x_29",
|
|
10
|
+
"compact": "_compact_1n7cu7x_33",
|
|
11
|
+
"switcher": "_switcher_1n7cu7x_37",
|
|
12
|
+
"disabled": "_disabled_1n7cu7x_55",
|
|
13
|
+
"alignIconLeft": "_alignIconLeft_1n7cu7x_60",
|
|
14
|
+
"alignIconRight": "_alignIconRight_1n7cu7x_63",
|
|
15
|
+
"option": "_option_1n7cu7x_67",
|
|
16
|
+
"selected": "_selected_1n7cu7x_116",
|
|
17
|
+
"icon": "_icon_1n7cu7x_135",
|
|
18
|
+
"mark": "_mark_1n7cu7x_148"
|
|
19
|
+
};
|
|
20
|
+
export { styles as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type VerticalSwitcherOptionIconPosition = 'left' | 'right';
|
|
3
|
+
export declare type VerticalSwitcherSize = 'l' | 'm' | 's' | 'xs';
|
|
4
|
+
export declare type VerticalSwitcherTheme = 'light' | 'dark';
|
|
5
|
+
export declare type VerticalSwitcherMode = 'rock' | 'classic';
|
|
6
|
+
export declare type VerticalSwitcherOption<OptionsValueType> = {
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
value: OptionsValueType;
|
|
9
|
+
/** Additional icon */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare type VerticalSwitcherOptionForDocs = VerticalSwitcherOption<any>;
|
|
13
|
+
export interface VerticalSwitcherProps<ValueType, OptionsValueType extends ValueType> {
|
|
14
|
+
/** Current selected value */
|
|
15
|
+
value: ValueType;
|
|
16
|
+
/** Array of options */
|
|
17
|
+
options?: VerticalSwitcherOption<OptionsValueType>[];
|
|
18
|
+
onChange: (value: OptionsValueType) => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
theme?: VerticalSwitcherTheme;
|
|
21
|
+
size?: VerticalSwitcherSize;
|
|
22
|
+
/** Appearance mode */
|
|
23
|
+
mode?: VerticalSwitcherMode;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Identifier for e2e tests */
|
|
26
|
+
'data-e2e'?: string;
|
|
27
|
+
/** **Works only if the `icon` on options is present.** Additional icon position. */
|
|
28
|
+
iconPosition?: VerticalSwitcherOptionIconPosition;
|
|
29
|
+
/** CSS style object */
|
|
30
|
+
style?: React.CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
export declare function VerticalSwitcher<ValueType, OptionsValueType extends ValueType = ValueType>({ className, theme: themeFromProps, size, disabled, ['data-e2e']: e2eId, options: rawOptions, value: switcherValue, mode, iconPosition, onChange, style }: VerticalSwitcherProps<ValueType, OptionsValueType>): JSX.Element;
|
|
33
|
+
export declare namespace VerticalSwitcher {
|
|
34
|
+
var propTypes: {};
|
|
35
|
+
}
|