@rescui/chip-list 0.14.1 → 0.14.3-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.14
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 -3
- package/lib/index.css +46 -46
- package/lib/parts/chip-list.p.module.css.js +24 -24
- package/llm/components/chip-list.md +602 -0
- package/llm/index.md +2 -0
- package/package.json +8 -7
package/README.md
CHANGED
package/lib/index.css
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
.
|
|
1
|
+
._light_1m62at7_8{
|
|
2
2
|
--rs-theme-dark:0;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
._dark_1m62at7_11{
|
|
5
5
|
--rs-theme-dark:1;
|
|
6
6
|
}
|
|
7
|
-
.
|
|
7
|
+
._alignLeft_1m62at7_15{
|
|
8
8
|
--_rs-cl-align:left;
|
|
9
9
|
}
|
|
10
|
-
.
|
|
10
|
+
._alignCenter_1m62at7_18{
|
|
11
11
|
--_rs-cl-align:center;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
._alignRight_1m62at7_21{
|
|
14
14
|
--_rs-cl-align:right;
|
|
15
15
|
}
|
|
16
|
-
.
|
|
16
|
+
._sizeXs_1m62at7_25{
|
|
17
17
|
--_rs-cl-chip-base-border-radius:4px;
|
|
18
18
|
--_rs-cl-chip-compact-border-radius:var(--_rs-cl-chip-base-border-radius);
|
|
19
19
|
--_rs-cl-chip-vertical-padding:2px;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
--_rs-cl-compact-horizontal-gap:4px;
|
|
28
28
|
--_rs-cl-sparse-horizontal-gap:12px;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
._sizeXs_1m62at7_25 [data-rs-internal='chip-list__chip']{
|
|
31
31
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
32
32
|
--_rs-typography-text-transform:initial;
|
|
33
33
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
63
63
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
._sizeS_1m62at7_28{
|
|
66
66
|
--_rs-cl-chip-base-border-radius:16px;
|
|
67
67
|
--_rs-cl-chip-compact-border-radius:4px;
|
|
68
68
|
--_rs-cl-chip-vertical-padding:6px;
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
--_rs-cl-compact-horizontal-gap:6px;
|
|
77
77
|
--_rs-cl-sparse-horizontal-gap:12px;
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
._sizeS_1m62at7_28 [data-rs-internal='chip-list__chip']{
|
|
80
80
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
81
81
|
--_rs-typography-text-transform:initial;
|
|
82
82
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
112
112
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
113
113
|
}
|
|
114
|
-
.
|
|
114
|
+
._sizeM_1m62at7_31{
|
|
115
115
|
--_rs-cl-chip-base-border-radius:20px;
|
|
116
116
|
--_rs-cl-chip-compact-border-radius:8px;
|
|
117
117
|
--_rs-cl-chip-vertical-padding:8px;
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
--_rs-cl-compact-horizontal-gap:6px;
|
|
126
126
|
--_rs-cl-sparse-horizontal-gap:16px;
|
|
127
127
|
}
|
|
128
|
-
.
|
|
128
|
+
._sizeM_1m62at7_31 [data-rs-internal='chip-list__chip']{
|
|
129
129
|
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
130
130
|
--_rs-typography-text-transform:initial;
|
|
131
131
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -164,11 +164,11 @@
|
|
|
164
164
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
165
165
|
}
|
|
166
166
|
@media screen and (max-width: 640px){
|
|
167
|
-
.
|
|
167
|
+
._sizeM_1m62at7_31 [data-rs-internal='chip-list__chip']{
|
|
168
168
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
.
|
|
171
|
+
._sizeL_1m62at7_34{
|
|
172
172
|
--_rs-cl-chip-base-border-radius:26px;
|
|
173
173
|
--_rs-cl-chip-compact-border-radius:12px;
|
|
174
174
|
--_rs-cl-chip-vertical-padding:12px;
|
|
@@ -183,11 +183,11 @@
|
|
|
183
183
|
--_rs-cl-sparse-horizontal-gap:16px;
|
|
184
184
|
}
|
|
185
185
|
@media screen and (max-width: 640px){
|
|
186
|
-
.
|
|
186
|
+
._sizeL_1m62at7_34{
|
|
187
187
|
--_rs-cl-vertical-gap:12px;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
._sizeL_1m62at7_34 [data-rs-internal='chip-list__chip']{
|
|
191
191
|
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
192
192
|
--_rs-typography-text-transform:initial;
|
|
193
193
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -226,34 +226,34 @@
|
|
|
226
226
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
227
227
|
}
|
|
228
228
|
@media screen and (max-width: 640px){
|
|
229
|
-
.
|
|
229
|
+
._sizeL_1m62at7_34 [data-rs-internal='chip-list__chip']{
|
|
230
230
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
.
|
|
233
|
+
._innerOffsetL_1m62at7_38{
|
|
234
234
|
--_rs-cl-horizontal-gap-from-sparse:var(--_rs-cl-sparse-horizontal-gap);
|
|
235
235
|
}
|
|
236
236
|
@media screen and (max-width: 640px){
|
|
237
|
-
.
|
|
237
|
+
._innerOffsetL_1m62at7_38{
|
|
238
238
|
--_rs-cl-horizontal-gap-from-sparse:var(--_rs-cl-base-horizontal-gap);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
.
|
|
241
|
+
._innerOffsetM_1m62at7_41{
|
|
242
242
|
--_rs-cl-horizontal-gap-from-sparse:initial;
|
|
243
243
|
}
|
|
244
|
-
.
|
|
244
|
+
._classic_1m62at7_45{
|
|
245
245
|
--_rs-cl-chip-active-border-color:var(--_rs-color-primary);
|
|
246
246
|
--_rs-cl-chip-selected-border-color:var(--_rs-color-primary);
|
|
247
247
|
--_rs-cl-chip-hover-background:var(--_rs-color-primary-t-fog);
|
|
248
248
|
--_rs-cl-chip-active-background:var(--_rs-color-primary-t-fog);
|
|
249
249
|
}
|
|
250
|
-
.
|
|
250
|
+
._rock_1m62at7_48{
|
|
251
251
|
--_rs-cl-chip-active-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));
|
|
252
252
|
--_rs-cl-chip-selected-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));
|
|
253
253
|
--_rs-cl-chip-hover-background: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.1);
|
|
254
254
|
--_rs-cl-chip-active-background: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.1);
|
|
255
255
|
}
|
|
256
|
-
.
|
|
256
|
+
._compact_1m62at7_52{
|
|
257
257
|
--_rs-cl-chip-border-radius-from-compact:var(
|
|
258
258
|
--_rs-cl-chip-compact-border-radius
|
|
259
259
|
);
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
);
|
|
263
263
|
--_rs-cl-horizontal-gap-from-compact:var(--_rs-cl-compact-horizontal-gap);
|
|
264
264
|
}
|
|
265
|
-
.
|
|
265
|
+
._main_1m62at7_56{
|
|
266
266
|
--_rs-theme-dark:var(
|
|
267
267
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
268
268
|
var(--rs-theme-dark, 0)
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
273
273
|
}
|
|
274
274
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
275
|
-
.
|
|
275
|
+
._main_1m62at7_56{
|
|
276
276
|
--_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)));
|
|
277
277
|
--_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)));
|
|
278
278
|
--_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)));
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
284
|
-
.
|
|
284
|
+
._main_1m62at7_56{
|
|
285
285
|
--_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);
|
|
286
286
|
--_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));
|
|
287
287
|
--_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));
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
--_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));
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
.
|
|
292
|
+
._main_1m62at7_56 {
|
|
293
293
|
--_rs-cl-chip-border-radius:var(
|
|
294
294
|
--_rs-cl-chip-border-radius-from-compact,
|
|
295
295
|
var(--_rs-cl-chip-base-border-radius)
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
var(--_rs-cl-horizontal-gap-from-sparse, var(--_rs-cl-base-horizontal-gap))
|
|
304
304
|
);
|
|
305
305
|
}
|
|
306
|
-
.
|
|
306
|
+
._chipsContainer_1m62at7_62{
|
|
307
307
|
position:relative;
|
|
308
308
|
|
|
309
309
|
display:flex;
|
|
@@ -312,17 +312,17 @@
|
|
|
312
312
|
|
|
313
313
|
gap:var(--_rs-cl-vertical-gap) var(--_rs-cl-horizontal-gap);
|
|
314
314
|
}
|
|
315
|
-
.
|
|
315
|
+
._alignIconLeft_1m62at7_72{
|
|
316
316
|
--_rs-cl-chip-icon-flex-direction:row;
|
|
317
317
|
--_rs-cl-chip-icon-position-multiplier-left:1;
|
|
318
318
|
--_rs-cl-chip-icon-position-multiplier-right:0;
|
|
319
319
|
}
|
|
320
|
-
.
|
|
320
|
+
._alignIconRight_1m62at7_75{
|
|
321
321
|
--_rs-cl-chip-icon-flex-direction:row-reverse;
|
|
322
322
|
--_rs-cl-chip-icon-position-multiplier-left:0;
|
|
323
323
|
--_rs-cl-chip-icon-position-multiplier-right:1;
|
|
324
324
|
}
|
|
325
|
-
.
|
|
325
|
+
._chip_1m62at7_62{
|
|
326
326
|
letter-spacing:var(
|
|
327
327
|
--rs-text-base-letter-spacing,
|
|
328
328
|
var(--_rs-typography-letter-spacing)
|
|
@@ -374,25 +374,25 @@
|
|
|
374
374
|
-moz-osx-font-smoothing:inherit;
|
|
375
375
|
-webkit-appearance:none;
|
|
376
376
|
}
|
|
377
|
-
.
|
|
377
|
+
._chip_1m62at7_62::-moz-focus-inner{
|
|
378
378
|
padding:0;
|
|
379
379
|
|
|
380
380
|
border:none;
|
|
381
381
|
}
|
|
382
|
-
.
|
|
383
|
-
.
|
|
384
|
-
.
|
|
382
|
+
._chip_1m62at7_62:hover,
|
|
383
|
+
._chip_1m62at7_62:focus,
|
|
384
|
+
._chip_1m62at7_62:active{
|
|
385
385
|
outline:none;
|
|
386
386
|
|
|
387
387
|
text-decoration:none;
|
|
388
388
|
}
|
|
389
|
-
.
|
|
389
|
+
._chip_1m62at7_62:focus[data-focus-method='key']{
|
|
390
390
|
box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
391
391
|
}
|
|
392
|
-
.
|
|
392
|
+
._chip_1m62at7_62:has(:focus[data-focus-method='key']){
|
|
393
393
|
box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
394
394
|
}
|
|
395
|
-
.
|
|
395
|
+
._chip_1m62at7_62:focus{
|
|
396
396
|
--_rs-cl-chip-border-color:rgba(
|
|
397
397
|
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),
|
|
398
398
|
calc(0.3 + var(--_rs-theme-dark-coefficient)*0.1)
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
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));
|
|
402
402
|
}
|
|
403
403
|
@media (hover: hover){
|
|
404
|
-
.
|
|
404
|
+
._chip_1m62at7_62:hover{
|
|
405
405
|
--_rs-cl-chip-border-color:rgba(
|
|
406
406
|
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),
|
|
407
407
|
calc(0.3 + var(--_rs-theme-dark-coefficient)*0.1)
|
|
@@ -412,20 +412,20 @@
|
|
|
412
412
|
background:var(--_rs-cl-chip-hover-background);
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
.
|
|
415
|
+
._chip_1m62at7_62:active{
|
|
416
416
|
--_rs-cl-chip-border-color:var(--_rs-cl-chip-active-border-color);
|
|
417
417
|
|
|
418
418
|
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));
|
|
419
419
|
|
|
420
420
|
background:var(--_rs-cl-chip-active-background);
|
|
421
421
|
}
|
|
422
|
-
.
|
|
422
|
+
._chip_1m62at7_62._selected_1m62at7_176{
|
|
423
423
|
--_rs-cl-chip-border-color:var(--_rs-cl-chip-selected-border-color);
|
|
424
424
|
--_rs-cl-chip-border-width:2px;
|
|
425
425
|
|
|
426
426
|
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));
|
|
427
427
|
}
|
|
428
|
-
.
|
|
428
|
+
._disabled_1m62at7_183 ._chip_1m62at7_62{
|
|
429
429
|
--_rs-cl-chip-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);
|
|
430
430
|
|
|
431
431
|
pointer-events:none;
|
|
@@ -434,10 +434,10 @@
|
|
|
434
434
|
|
|
435
435
|
background:transparent;
|
|
436
436
|
}
|
|
437
|
-
.
|
|
437
|
+
._disabled_1m62at7_183 ._chip_1m62at7_62._selected_1m62at7_176{
|
|
438
438
|
--_rs-cl-chip-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.4);
|
|
439
439
|
}
|
|
440
|
-
.
|
|
440
|
+
._chip_1m62at7_62::before{
|
|
441
441
|
position:absolute;
|
|
442
442
|
top:0;
|
|
443
443
|
right:0;
|
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
|
|
455
455
|
transition:border-color 100ms var(--rs-transition-function, ease);
|
|
456
456
|
}
|
|
457
|
-
.
|
|
457
|
+
._chip_1m62at7_62 ._icon_1m62at7_216{
|
|
458
458
|
flex:0 0 auto;
|
|
459
459
|
|
|
460
460
|
width:auto;
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
margin:0;
|
|
464
464
|
fill:currentColor;
|
|
465
465
|
}
|
|
466
|
-
.
|
|
466
|
+
._hiddenInput_1m62at7_227{
|
|
467
467
|
position:absolute;
|
|
468
468
|
|
|
469
469
|
overflow:hidden;
|
|
@@ -479,7 +479,7 @@
|
|
|
479
479
|
white-space:nowrap;
|
|
480
480
|
clip-path:inset(50%);
|
|
481
481
|
}
|
|
482
|
-
.
|
|
482
|
+
._withoutText_1m62at7_244{
|
|
483
483
|
--_rs-cl-chip-horizontal-real-padding:var(--_rs-cl-chip-icon-only-padding);
|
|
484
484
|
--_rs-cl-chip-vertical-real-padding:var(--_rs-cl-chip-icon-only-padding);
|
|
485
485
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"light": "
|
|
3
|
-
"dark": "
|
|
4
|
-
"alignLeft": "
|
|
5
|
-
"alignCenter": "
|
|
6
|
-
"alignRight": "
|
|
7
|
-
"sizeXs": "
|
|
8
|
-
"sizeS": "
|
|
9
|
-
"sizeM": "
|
|
10
|
-
"sizeL": "
|
|
11
|
-
"innerOffsetL": "
|
|
12
|
-
"innerOffsetM": "
|
|
13
|
-
"classic": "
|
|
14
|
-
"rock": "
|
|
15
|
-
"compact": "
|
|
16
|
-
"main": "
|
|
17
|
-
"chipsContainer": "
|
|
18
|
-
"alignIconLeft": "
|
|
19
|
-
"alignIconRight": "
|
|
20
|
-
"chip": "
|
|
21
|
-
"selected": "
|
|
22
|
-
"disabled": "
|
|
23
|
-
"icon": "
|
|
24
|
-
"hiddenInput": "
|
|
25
|
-
"withoutText": "
|
|
2
|
+
"light": "_light_1m62at7_8",
|
|
3
|
+
"dark": "_dark_1m62at7_11",
|
|
4
|
+
"alignLeft": "_alignLeft_1m62at7_15",
|
|
5
|
+
"alignCenter": "_alignCenter_1m62at7_18",
|
|
6
|
+
"alignRight": "_alignRight_1m62at7_21",
|
|
7
|
+
"sizeXs": "_sizeXs_1m62at7_25",
|
|
8
|
+
"sizeS": "_sizeS_1m62at7_28",
|
|
9
|
+
"sizeM": "_sizeM_1m62at7_31",
|
|
10
|
+
"sizeL": "_sizeL_1m62at7_34",
|
|
11
|
+
"innerOffsetL": "_innerOffsetL_1m62at7_38",
|
|
12
|
+
"innerOffsetM": "_innerOffsetM_1m62at7_41",
|
|
13
|
+
"classic": "_classic_1m62at7_45",
|
|
14
|
+
"rock": "_rock_1m62at7_48",
|
|
15
|
+
"compact": "_compact_1m62at7_52",
|
|
16
|
+
"main": "_main_1m62at7_56",
|
|
17
|
+
"chipsContainer": "_chipsContainer_1m62at7_62",
|
|
18
|
+
"alignIconLeft": "_alignIconLeft_1m62at7_72",
|
|
19
|
+
"alignIconRight": "_alignIconRight_1m62at7_75",
|
|
20
|
+
"chip": "_chip_1m62at7_62",
|
|
21
|
+
"selected": "_selected_1m62at7_176",
|
|
22
|
+
"disabled": "_disabled_1m62at7_183",
|
|
23
|
+
"icon": "_icon_1m62at7_216",
|
|
24
|
+
"hiddenInput": "_hiddenInput_1m62at7_227",
|
|
25
|
+
"withoutText": "_withoutText_1m62at7_244"
|
|
26
26
|
};
|
|
27
27
|
export { styles as default };
|
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
# ChipList
|
|
2
|
+
|
|
3
|
+
Created with adaptivity in mind, ChipList is the component for radiogroup-like controls and navigational panels. It wraps items onto a new line if the screen is too narrow to fit all of the content.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### Features showcase
|
|
8
|
+
|
|
9
|
+
`ChipList` component can only be a controlled component. It requires `value` and `onChange` props to function properly.
|
|
10
|
+
|
|
11
|
+
By default, `ChipList` uses `pattern="auto"`. It renders native `input[type="radio"]` elements with `role="radiogroup"` when chips do not have `href`, switches to `role="navigation"` when at least one chip has `href`, and switches to `role="tablist"` when chips use `aria-controls`.
|
|
12
|
+
|
|
13
|
+
`ChipList` interactive overview:
|
|
14
|
+
|
|
15
|
+
#### Content Switcher made of ChipList with default values
|
|
16
|
+
|
|
17
|
+
`ChipList` enumerates `Chip` children components, so by default it has different keys for `onChange` prop function. When chips switch panels, add `aria-controls` to every chip so `pattern="auto"` resolves to `role="tablist"`.
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { useState } from 'react';
|
|
21
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
22
|
+
import { Switcher } from '@rescui/switcher';
|
|
23
|
+
|
|
24
|
+
const ContentSwitcher = ({ index, children }) => {
|
|
25
|
+
return children[index];
|
|
26
|
+
};
|
|
27
|
+
const Demo = () => {
|
|
28
|
+
const [activeIndex, setActiveIndex] = useState(1);
|
|
29
|
+
return (
|
|
30
|
+
<div>
|
|
31
|
+
<Switcher
|
|
32
|
+
size="xs"
|
|
33
|
+
value={activeIndex}
|
|
34
|
+
options={[
|
|
35
|
+
{ label: 'First', value: 0 },
|
|
36
|
+
{ label: 'Second', value: 1 },
|
|
37
|
+
{ label: 'Third', value: 2 }
|
|
38
|
+
]}
|
|
39
|
+
onChange={v => setActiveIndex(v)}
|
|
40
|
+
className="rs-docs-offset-top-12"
|
|
41
|
+
/>
|
|
42
|
+
<ChipList
|
|
43
|
+
value={activeIndex}
|
|
44
|
+
onChange={v => setActiveIndex(v)}
|
|
45
|
+
className="rs-docs-offset-top-12"
|
|
46
|
+
>
|
|
47
|
+
<Chip id="first-default-tab" aria-controls="first-default-panel">
|
|
48
|
+
First
|
|
49
|
+
</Chip>
|
|
50
|
+
<Chip id="second-default-tab" aria-controls="second-default-panel">
|
|
51
|
+
Second
|
|
52
|
+
</Chip>
|
|
53
|
+
<Chip id="third-default-tab" aria-controls="third-default-panel">
|
|
54
|
+
Third
|
|
55
|
+
</Chip>
|
|
56
|
+
</ChipList>
|
|
57
|
+
<div className="rs-docs-offset-top-12">
|
|
58
|
+
<ContentSwitcher index={activeIndex}>
|
|
59
|
+
<div
|
|
60
|
+
id="first-default-panel"
|
|
61
|
+
role="tabpanel"
|
|
62
|
+
aria-labelledby="first-default-tab"
|
|
63
|
+
>
|
|
64
|
+
First
|
|
65
|
+
</div>
|
|
66
|
+
<div
|
|
67
|
+
id="second-default-panel"
|
|
68
|
+
role="tabpanel"
|
|
69
|
+
aria-labelledby="second-default-tab"
|
|
70
|
+
>
|
|
71
|
+
Second
|
|
72
|
+
</div>
|
|
73
|
+
<div
|
|
74
|
+
id="third-default-panel"
|
|
75
|
+
role="tabpanel"
|
|
76
|
+
aria-labelledby="third-default-tab"
|
|
77
|
+
>
|
|
78
|
+
Third
|
|
79
|
+
</div>
|
|
80
|
+
</ContentSwitcher>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
render(<Demo />);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Switcher with custom values on Chips and component for tab content
|
|
90
|
+
|
|
91
|
+
`ChipList` component works as radiogroup-like control with custom `value` on `Chip` components.
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { useState } from 'react';
|
|
95
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
96
|
+
import { Switcher } from '@rescui/switcher';
|
|
97
|
+
|
|
98
|
+
const Content = ({ activeChip }) => {
|
|
99
|
+
switch (activeChip) {
|
|
100
|
+
case 'first':
|
|
101
|
+
return <div>First</div>;
|
|
102
|
+
case 'second':
|
|
103
|
+
return <div>Second</div>;
|
|
104
|
+
case 'third':
|
|
105
|
+
return <div>Third</div>;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const Demo = () => {
|
|
109
|
+
const [activeChip, setActiveChip] = useState('second');
|
|
110
|
+
return (
|
|
111
|
+
<div>
|
|
112
|
+
<div>
|
|
113
|
+
<Switcher
|
|
114
|
+
size="xs"
|
|
115
|
+
value={activeChip}
|
|
116
|
+
options={[
|
|
117
|
+
{ label: 'First', value: 'first' },
|
|
118
|
+
{ label: 'Second', value: 'second' },
|
|
119
|
+
{ label: 'Third', value: 'third' }
|
|
120
|
+
]}
|
|
121
|
+
onChange={tab => setActiveChip(tab)}
|
|
122
|
+
className="rs-docs-offset-top-12"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
<ChipList
|
|
126
|
+
value={activeChip}
|
|
127
|
+
onChange={v => setActiveChip(v)}
|
|
128
|
+
className="rs-docs-offset-top-12"
|
|
129
|
+
>
|
|
130
|
+
<Chip value="first">First</Chip>
|
|
131
|
+
<Chip value="second">Second</Chip>
|
|
132
|
+
<Chip value="third">Third</Chip>
|
|
133
|
+
</ChipList>
|
|
134
|
+
<div className="rs-docs-offset-top-12">
|
|
135
|
+
<Content activeChip={activeChip} />
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
render(<Demo />);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### SEO tip: render the content from every tab and hide it with display: none
|
|
145
|
+
|
|
146
|
+
Content could be rendered to DOM and hidden with CSS. This is a usefull trick for SEO optimization. This is also the most complete tablist pattern because every controlled panel stays in the DOM.
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import { useState, cloneElement } from 'react';
|
|
150
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
151
|
+
|
|
152
|
+
const CSSContentSwitcher = ({ index, children }) => {
|
|
153
|
+
return children.map((ch, i) => {
|
|
154
|
+
const chStyles = ch.props.style || {};
|
|
155
|
+
const addStyles = i === index ? {} : { display: 'none' };
|
|
156
|
+
return cloneElement(ch, { key: i, style: { ...chStyles, ...addStyles } });
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const Demo = () => {
|
|
161
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
162
|
+
return (
|
|
163
|
+
<div className="rs-docs-offset-top-24">
|
|
164
|
+
<ChipList value={activeIndex} onChange={v => setActiveIndex(v)}>
|
|
165
|
+
<Chip id="first-seo-tab" aria-controls="first-seo-panel">
|
|
166
|
+
First
|
|
167
|
+
</Chip>
|
|
168
|
+
<Chip id="second-seo-tab" aria-controls="second-seo-panel">
|
|
169
|
+
Second
|
|
170
|
+
</Chip>
|
|
171
|
+
<Chip id="third-seo-tab" aria-controls="third-seo-panel">
|
|
172
|
+
Third
|
|
173
|
+
</Chip>
|
|
174
|
+
</ChipList>
|
|
175
|
+
<CSSContentSwitcher index={activeIndex}>
|
|
176
|
+
<div
|
|
177
|
+
id="first-seo-panel"
|
|
178
|
+
role="tabpanel"
|
|
179
|
+
aria-labelledby="first-seo-tab"
|
|
180
|
+
>
|
|
181
|
+
First
|
|
182
|
+
</div>
|
|
183
|
+
<div
|
|
184
|
+
id="second-seo-panel"
|
|
185
|
+
role="tabpanel"
|
|
186
|
+
aria-labelledby="second-seo-tab"
|
|
187
|
+
>
|
|
188
|
+
Second
|
|
189
|
+
</div>
|
|
190
|
+
<div
|
|
191
|
+
id="third-seo-panel"
|
|
192
|
+
role="tabpanel"
|
|
193
|
+
aria-labelledby="third-seo-tab"
|
|
194
|
+
>
|
|
195
|
+
Third
|
|
196
|
+
</div>
|
|
197
|
+
</CSSContentSwitcher>
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
render(<Demo />);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
#### Controls for the e2e tests
|
|
206
|
+
|
|
207
|
+
When testing the page, you can get access to the arrows with `data-e2e` attributes. You should set the scope with the `data-e2e` attribute from the outside.
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { useState, cloneElement } from 'react';
|
|
211
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
212
|
+
|
|
213
|
+
const CSSContentSwitcher = ({ index, children }) => {
|
|
214
|
+
return children.map((ch, i) => {
|
|
215
|
+
const chStyles = ch.props.style || {};
|
|
216
|
+
const addStyles = i === index ? {} : { display: 'none' };
|
|
217
|
+
return cloneElement(ch, { key: i, style: { ...chStyles, ...addStyles } });
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const Demo = () => {
|
|
222
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
223
|
+
return (
|
|
224
|
+
<div className="rs-docs-offset-top-24">
|
|
225
|
+
<ChipList
|
|
226
|
+
value={activeIndex}
|
|
227
|
+
onChange={v => setActiveIndex(v)}
|
|
228
|
+
data-e2e={'example-chips'}
|
|
229
|
+
>
|
|
230
|
+
<Chip id="first-e2e-tab" aria-controls="first-e2e-panel">
|
|
231
|
+
First
|
|
232
|
+
</Chip>
|
|
233
|
+
<Chip id="second-e2e-tab" aria-controls="second-e2e-panel">
|
|
234
|
+
Second
|
|
235
|
+
</Chip>
|
|
236
|
+
<Chip id="third-e2e-tab" aria-controls="third-e2e-panel">
|
|
237
|
+
Third
|
|
238
|
+
</Chip>
|
|
239
|
+
</ChipList>
|
|
240
|
+
<CSSContentSwitcher index={activeIndex}>
|
|
241
|
+
<div
|
|
242
|
+
id="first-e2e-panel"
|
|
243
|
+
role="tabpanel"
|
|
244
|
+
aria-labelledby="first-e2e-tab"
|
|
245
|
+
>
|
|
246
|
+
First
|
|
247
|
+
</div>
|
|
248
|
+
<div
|
|
249
|
+
id="second-e2e-panel"
|
|
250
|
+
role="tabpanel"
|
|
251
|
+
aria-labelledby="second-e2e-tab"
|
|
252
|
+
>
|
|
253
|
+
Second
|
|
254
|
+
</div>
|
|
255
|
+
<div
|
|
256
|
+
id="third-e2e-panel"
|
|
257
|
+
role="tabpanel"
|
|
258
|
+
aria-labelledby="third-e2e-tab"
|
|
259
|
+
>
|
|
260
|
+
Third
|
|
261
|
+
</div>
|
|
262
|
+
</CSSContentSwitcher>
|
|
263
|
+
</div>
|
|
264
|
+
);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
render(<Demo />);
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### Usage with Icons
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
import { useState } from 'react';
|
|
274
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
275
|
+
import {
|
|
276
|
+
TeamOutlineIcon,
|
|
277
|
+
WinOutlineIcon,
|
|
278
|
+
ThumbsUpOutlineIcon
|
|
279
|
+
} from '@rescui/icons';
|
|
280
|
+
|
|
281
|
+
const Demo = () => {
|
|
282
|
+
const [activeChip, setActiveChip] = useState('second');
|
|
283
|
+
return (
|
|
284
|
+
<div>
|
|
285
|
+
<ChipList
|
|
286
|
+
value={activeChip}
|
|
287
|
+
onChange={v => setActiveChip(v)}
|
|
288
|
+
className="rs-docs-offset-top-12"
|
|
289
|
+
>
|
|
290
|
+
<Chip icon={<TeamOutlineIcon />} value="first">
|
|
291
|
+
First
|
|
292
|
+
</Chip>
|
|
293
|
+
<Chip icon={<WinOutlineIcon />} value="second">
|
|
294
|
+
Second
|
|
295
|
+
</Chip>
|
|
296
|
+
<Chip icon={<ThumbsUpOutlineIcon />} value="third">
|
|
297
|
+
Third
|
|
298
|
+
</Chip>
|
|
299
|
+
</ChipList>
|
|
300
|
+
</div>
|
|
301
|
+
);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
render(<Demo />);
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
#### Chips as links
|
|
308
|
+
|
|
309
|
+
With the default `pattern="auto"`, chips with `href` switch the whole list to navigation behavior. You can also set `pattern="navigation"` explicitly. In `pattern="radiogroup"`, `href` is ignored and a development warning is printed.
|
|
310
|
+
|
|
311
|
+
```tsx
|
|
312
|
+
import { useState } from 'react';
|
|
313
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
314
|
+
|
|
315
|
+
const Demo = () => {
|
|
316
|
+
const [activeChip, setActiveChip] = useState('second');
|
|
317
|
+
return (
|
|
318
|
+
<div>
|
|
319
|
+
<div>
|
|
320
|
+
<h4 id="first">First</h4>
|
|
321
|
+
<h4 id="second">Second</h4>
|
|
322
|
+
<h4 id="third">Third</h4>
|
|
323
|
+
</div>
|
|
324
|
+
<ChipList
|
|
325
|
+
value={activeChip}
|
|
326
|
+
onChange={v => setActiveChip(v)}
|
|
327
|
+
className="rs-docs-offset-top-24"
|
|
328
|
+
>
|
|
329
|
+
<Chip href="#first" value="first">
|
|
330
|
+
First
|
|
331
|
+
</Chip>
|
|
332
|
+
<Chip href="#second" value="second">
|
|
333
|
+
Second
|
|
334
|
+
</Chip>
|
|
335
|
+
<Chip href="#third" value="third">
|
|
336
|
+
Third
|
|
337
|
+
</Chip>
|
|
338
|
+
</ChipList>
|
|
339
|
+
</div>
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
render(<Demo />);
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### Chips as navigation buttons
|
|
347
|
+
|
|
348
|
+
Use `pattern="navigation"` when chips without `href` should control page navigation through JavaScript.
|
|
349
|
+
|
|
350
|
+
```tsx
|
|
351
|
+
import { useState } from 'react';
|
|
352
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
353
|
+
|
|
354
|
+
const Demo = () => {
|
|
355
|
+
const [activeChip, setActiveChip] = useState('second');
|
|
356
|
+
const navigateToSection = value => {
|
|
357
|
+
setActiveChip(value);
|
|
358
|
+
window.location.hash = `${value}-buttons`;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
return (
|
|
362
|
+
<div>
|
|
363
|
+
<div>
|
|
364
|
+
<h4 id="first-buttons">First</h4>
|
|
365
|
+
<h4 id="second-buttons">Second</h4>
|
|
366
|
+
<h4 id="third-buttons">Third</h4>
|
|
367
|
+
</div>
|
|
368
|
+
<ChipList
|
|
369
|
+
value={activeChip}
|
|
370
|
+
onChange={navigateToSection}
|
|
371
|
+
pattern="navigation"
|
|
372
|
+
className="rs-docs-offset-top-24"
|
|
373
|
+
>
|
|
374
|
+
<Chip value="first">First</Chip>
|
|
375
|
+
<Chip value="second">Second</Chip>
|
|
376
|
+
<Chip value="third">Third</Chip>
|
|
377
|
+
</ChipList>
|
|
378
|
+
</div>
|
|
379
|
+
);
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
render(<Demo />);
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
#### Compact mode
|
|
386
|
+
|
|
387
|
+
```tsx
|
|
388
|
+
import { useState } from 'react';
|
|
389
|
+
import { ChipList, Chip } from '@rescui/chip-list';
|
|
390
|
+
|
|
391
|
+
const Demo = () => {
|
|
392
|
+
const [activeChip, setActiveChip] = useState('second');
|
|
393
|
+
return (
|
|
394
|
+
<div>
|
|
395
|
+
<ChipList
|
|
396
|
+
value={activeChip}
|
|
397
|
+
onChange={v => setActiveChip(v)}
|
|
398
|
+
compact
|
|
399
|
+
className="rs-docs-offset-top-12"
|
|
400
|
+
>
|
|
401
|
+
<Chip value="first">First</Chip>
|
|
402
|
+
<Chip value="second">Second</Chip>
|
|
403
|
+
<Chip value="third">Third</Chip>
|
|
404
|
+
</ChipList>
|
|
405
|
+
</div>
|
|
406
|
+
);
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
render(<Demo />);
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
## ChipListMulti
|
|
413
|
+
|
|
414
|
+
### Features showcase
|
|
415
|
+
|
|
416
|
+
`ChipListMulti` component can only be a controlled component. It requires `value` and `onChange` props to function properly.
|
|
417
|
+
|
|
418
|
+
`ChipListMulti` interactive overview:
|
|
419
|
+
|
|
420
|
+
#### Usage with Icons
|
|
421
|
+
|
|
422
|
+
```tsx
|
|
423
|
+
import { useState } from 'react';
|
|
424
|
+
import { ChipListMulti, Chip } from '@rescui/chip-list';
|
|
425
|
+
import {
|
|
426
|
+
TeamOutlineIcon,
|
|
427
|
+
WinOutlineIcon,
|
|
428
|
+
ThumbsUpOutlineIcon
|
|
429
|
+
} from '@rescui/icons';
|
|
430
|
+
|
|
431
|
+
const Demo = () => {
|
|
432
|
+
const [activeChips, setActiveChips] = useState(['second', 'third']);
|
|
433
|
+
return (
|
|
434
|
+
<div>
|
|
435
|
+
<ChipListMulti
|
|
436
|
+
value={activeChips}
|
|
437
|
+
onChange={setActiveChips}
|
|
438
|
+
className="rs-docs-offset-top-12"
|
|
439
|
+
>
|
|
440
|
+
<Chip icon={<TeamOutlineIcon />} value="first">
|
|
441
|
+
First
|
|
442
|
+
</Chip>
|
|
443
|
+
<Chip icon={<WinOutlineIcon />} value="second">
|
|
444
|
+
Second
|
|
445
|
+
</Chip>
|
|
446
|
+
<Chip icon={<ThumbsUpOutlineIcon />} value="third">
|
|
447
|
+
Third
|
|
448
|
+
</Chip>
|
|
449
|
+
</ChipListMulti>
|
|
450
|
+
</div>
|
|
451
|
+
);
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
render(<Demo />);
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
## CSS Mixins API
|
|
458
|
+
|
|
459
|
+
#### `Chip` mixins
|
|
460
|
+
|
|
461
|
+
| Mixin name | Details |
|
|
462
|
+
| --- | --- |
|
|
463
|
+
| `rs-chip-icon-left` | prop: `iconPosition`<br><br>value: `"left"` |
|
|
464
|
+
| `rs-chip-icon-right` | prop: `iconPosition`<br><br>value: `"right"` |
|
|
465
|
+
|
|
466
|
+
#### `ChipList` mixins
|
|
467
|
+
|
|
468
|
+
| Mixin name | Details |
|
|
469
|
+
| --- | --- |
|
|
470
|
+
| `rs-chip-list-align-left` | prop: `alignItems`<br><br>value: `"left"` |
|
|
471
|
+
| `rs-chip-list-align-center` | prop: `alignItems`<br><br>value: `"center"` |
|
|
472
|
+
| `rs-chip-list-align-right` | prop: `alignItems`<br><br>value: `"right"` |
|
|
473
|
+
| `rs-chip-list-sparse-true` | prop: `sparse`<br><br>value: `true` |
|
|
474
|
+
| `rs-chip-list-sparse-false` | prop: `sparse`<br><br>value: `false` |
|
|
475
|
+
| `rs-chip-list-size-xs` | prop: `size`<br><br>value: `"xs"` |
|
|
476
|
+
| `rs-chip-list-size-s` | prop: `size`<br><br>value: `"s"` |
|
|
477
|
+
| `rs-chip-list-size-m` | prop: `size`<br><br>value: `"m"` |
|
|
478
|
+
| `rs-chip-list-size-l` | prop: `size`<br><br>value: `"l"` |
|
|
479
|
+
| `rs-chip-list-mode-classic` | prop: `mode`<br><br>value: `"classic"` |
|
|
480
|
+
| `rs-chip-list-mode-rock` | prop: `mode`<br><br>value: `"rock"` |
|
|
481
|
+
|
|
482
|
+
#### `ChipListMulti` mixins
|
|
483
|
+
|
|
484
|
+
| Mixin name | Details |
|
|
485
|
+
| --- | --- |
|
|
486
|
+
| `rs-chip-list-multi-align-left` | prop: `alignItems`<br><br>value: `"left"` |
|
|
487
|
+
| `rs-chip-list-multi-align-center` | prop: `alignItems`<br><br>value: `"center"` |
|
|
488
|
+
| `rs-chip-list-multi-align-right` | prop: `alignItems`<br><br>value: `"right"` |
|
|
489
|
+
| `rs-chip-list-multi-sparse-true` | prop: `sparse`<br><br>value: `true` |
|
|
490
|
+
| `rs-chip-list-multi-sparse-false` | prop: `sparse`<br><br>value: `false` |
|
|
491
|
+
| `rs-chip-list-multi-size-xs` | prop: `size`<br><br>value: `"xs"` |
|
|
492
|
+
| `rs-chip-list-multi-size-s` | prop: `size`<br><br>value: `"s"` |
|
|
493
|
+
| `rs-chip-list-multi-size-m` | prop: `size`<br><br>value: `"m"` |
|
|
494
|
+
| `rs-chip-list-multi-size-l` | prop: `size`<br><br>value: `"l"` |
|
|
495
|
+
| `rs-chip-list-multi-mode-classic` | prop: `mode`<br><br>value: `"classic"` |
|
|
496
|
+
| `rs-chip-list-multi-mode-rock` | prop: `mode`<br><br>value: `"rock"` |
|
|
497
|
+
|
|
498
|
+
#### Demo
|
|
499
|
+
|
|
500
|
+
Use the controls to see the effect at different viewport widths.
|
|
501
|
+
|
|
502
|
+
```tsx
|
|
503
|
+
import { ChipList, ChipListMulti, Chip } from '@rescui/chip-list';
|
|
504
|
+
import { useState } from 'react';
|
|
505
|
+
import cn from 'classnames';
|
|
506
|
+
import {
|
|
507
|
+
TeamOutlineIcon,
|
|
508
|
+
WinOutlineIcon,
|
|
509
|
+
ThumbsUpOutlineIcon
|
|
510
|
+
} from '@rescui/icons';
|
|
511
|
+
|
|
512
|
+
const MyChipLists = () => {
|
|
513
|
+
const [activeIndex, setActiveIndex] = useState(1);
|
|
514
|
+
const [activeChips, setActiveChips] = useState(['second', 'third']);
|
|
515
|
+
return (
|
|
516
|
+
<div>
|
|
517
|
+
<ChipList
|
|
518
|
+
value={activeIndex}
|
|
519
|
+
onChange={v => setActiveIndex(v)}
|
|
520
|
+
className="my-chip-list"
|
|
521
|
+
>
|
|
522
|
+
<Chip className="my-chip" icon={<TeamOutlineIcon />}>
|
|
523
|
+
First
|
|
524
|
+
</Chip>
|
|
525
|
+
<Chip className="my-chip" icon={<WinOutlineIcon />}>
|
|
526
|
+
Second
|
|
527
|
+
</Chip>
|
|
528
|
+
<Chip className="my-chip" icon={<ThumbsUpOutlineIcon />}>
|
|
529
|
+
Third
|
|
530
|
+
</Chip>
|
|
531
|
+
</ChipList>
|
|
532
|
+
<ChipListMulti
|
|
533
|
+
value={activeChips}
|
|
534
|
+
onChange={v => setActiveChips(v)}
|
|
535
|
+
className={cn('my-chip-list-multi', 'rs-docs-offset-top-12')}
|
|
536
|
+
>
|
|
537
|
+
<Chip className="my-chip" icon={<TeamOutlineIcon />} value="first">
|
|
538
|
+
First multi
|
|
539
|
+
</Chip>
|
|
540
|
+
<Chip className="my-chip" icon={<WinOutlineIcon />} value="second">
|
|
541
|
+
Second multi
|
|
542
|
+
</Chip>
|
|
543
|
+
<Chip className="my-chip" icon={<ThumbsUpOutlineIcon />} value="third">
|
|
544
|
+
Third multi
|
|
545
|
+
</Chip>
|
|
546
|
+
</ChipListMulti>
|
|
547
|
+
</div>
|
|
548
|
+
);
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
render(<MyChipLists />);
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
```postcss
|
|
555
|
+
@import '@rescui/chip-list/lib/public-api.p.css';
|
|
556
|
+
|
|
557
|
+
.my-chip-list {
|
|
558
|
+
@media (max-width: 640px) {
|
|
559
|
+
@mixin rs-chip-list-size-l;
|
|
560
|
+
@mixin rs-chip-list-mode-rock;
|
|
561
|
+
@mixin rs-chip-list-align-center;
|
|
562
|
+
@mixin rs-chip-list-sparse-true;
|
|
563
|
+
|
|
564
|
+
.my-chip {
|
|
565
|
+
@mixin rs-chip-icon-right;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
@media (max-width: 500px) {
|
|
569
|
+
@mixin rs-chip-list-size-s;
|
|
570
|
+
@mixin rs-chip-list-mode-classic;
|
|
571
|
+
@mixin rs-chip-list-align-right;
|
|
572
|
+
@mixin rs-chip-list-sparse-false;
|
|
573
|
+
|
|
574
|
+
.my-chip {
|
|
575
|
+
@mixin rs-chip-icon-left;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.my-chip-list-multi {
|
|
581
|
+
@media (max-width: 640px) {
|
|
582
|
+
@mixin rs-chip-list-multi-size-l;
|
|
583
|
+
@mixin rs-chip-list-multi-mode-rock;
|
|
584
|
+
@mixin rs-chip-list-multi-align-center;
|
|
585
|
+
@mixin rs-chip-list-multi-sparse-true;
|
|
586
|
+
|
|
587
|
+
.my-chip {
|
|
588
|
+
@mixin rs-chip-icon-right;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
@media (max-width: 500px) {
|
|
592
|
+
@mixin rs-chip-list-multi-size-s;
|
|
593
|
+
@mixin rs-chip-list-multi-mode-classic;
|
|
594
|
+
@mixin rs-chip-list-multi-align-right;
|
|
595
|
+
@mixin rs-chip-list-multi-sparse-false;
|
|
596
|
+
|
|
597
|
+
.my-chip {
|
|
598
|
+
@mixin rs-chip-icon-left;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
```
|
package/llm/index.md
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/chip-list",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.14+dbbefd7b8",
|
|
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
|
"LICENSE.txt"
|
|
13
14
|
],
|
|
14
15
|
"publishConfig": {
|
|
@@ -21,18 +22,18 @@
|
|
|
21
22
|
"peerDependencies": {
|
|
22
23
|
"@rescui/ui-contexts": "^0.6.0",
|
|
23
24
|
"prop-types": "^15",
|
|
24
|
-
"react": ">=
|
|
25
|
+
"react": ">=17.0.0 <20"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@rescui/colors": "
|
|
28
|
-
"@rescui/scripts": "
|
|
29
|
-
"@rescui/typography": "
|
|
30
|
-
"@rescui/visual-regression": "
|
|
28
|
+
"@rescui/colors": "0.3.3-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.14+dbbefd7b8",
|
|
29
|
+
"@rescui/scripts": "0.5.2",
|
|
30
|
+
"@rescui/typography": "0.27.3-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.14+dbbefd7b8",
|
|
31
|
+
"@rescui/visual-regression": "0.1.4"
|
|
31
32
|
},
|
|
32
33
|
"scripts": {
|
|
33
34
|
"build": "rescui-scripts build && yarn run build-pcss-api",
|
|
34
35
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
35
36
|
},
|
|
36
37
|
"nx": {},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "dbbefd7b8e24da18262edf3baffa35039ae01af3"
|
|
38
39
|
}
|