@rescui/collapse 0.5.8 → 0.5.10-RUI-226-Update-card-cn-6e43cc89.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_virtual/index.css.js +12 -7
- package/lib/_virtual/plus.js +106 -0
- package/lib/_virtual/right.js +90 -21
- package/lib/accordion.js +35 -60
- package/lib/collapse.js +80 -111
- package/lib/collapse.p.module.css.js +32 -32
- package/lib/context.js +1 -1
- package/lib/index.css +123 -130
- package/lib/public-api.p.css +32 -20
- package/lib/public-api.pcss +32 -20
- package/lib/use-collapse-state.js +17 -29
- package/package.json +10 -10
- package/lib/_virtual/add-outline.js +0 -37
package/lib/public-api.p.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--_rs-collapse-icon-size:20px;
|
|
6
6
|
}
|
|
7
7
|
&[class] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
8
|
-
--_rs-typography-letter-spacing:normal;
|
|
8
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
9
9
|
--_rs-typography-text-transform:initial;
|
|
10
10
|
--_rs-typography-font-variant-numeric:initial;
|
|
11
11
|
--_rs-typography-font-family:var(
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
37
37
|
}
|
|
38
38
|
&[class] > [data-rs-internal='collapse__content']{
|
|
39
|
-
--_rs-typography-letter-spacing:0.0045em;
|
|
39
|
+
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
40
40
|
--_rs-typography-text-transform:initial;
|
|
41
41
|
--_rs-typography-font-variant-numeric:initial;
|
|
42
42
|
--_rs-typography-font-family:var(
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
--_rs-collapse-icon-size:24px;
|
|
78
78
|
}
|
|
79
79
|
&[class] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
80
|
-
--_rs-typography-letter-spacing:normal;
|
|
80
|
+
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
81
81
|
--_rs-typography-text-transform:initial;
|
|
82
82
|
--_rs-typography-font-variant-numeric:initial;
|
|
83
83
|
--_rs-typography-font-family:var(
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
109
109
|
}
|
|
110
110
|
&[class] > [data-rs-internal='collapse__content']{
|
|
111
|
-
--_rs-typography-letter-spacing:0.0015em;
|
|
111
|
+
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
112
112
|
--_rs-typography-text-transform:initial;
|
|
113
113
|
--_rs-typography-font-variant-numeric:initial;
|
|
114
114
|
--_rs-typography-font-family:var(
|
|
@@ -136,14 +136,17 @@
|
|
|
136
136
|
--_rs-typography-text-auto-offset:16px;
|
|
137
137
|
--_rs-typography-ul-list-li-padding-left:22px;
|
|
138
138
|
--_rs-typography-ol-list-li-padding-left:26px;
|
|
139
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
139
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
140
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
141
|
+
16px
|
|
142
|
+
);
|
|
140
143
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
141
144
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
142
145
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
143
146
|
}
|
|
144
147
|
@media screen and (max-width: 640px){
|
|
145
148
|
&[class] > [data-rs-internal='collapse__content']{
|
|
146
|
-
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
149
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|
|
@@ -154,7 +157,7 @@
|
|
|
154
157
|
--_rs-collapse-icon-size:28px;
|
|
155
158
|
}
|
|
156
159
|
&[class] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
157
|
-
--_rs-typography-letter-spacing:normal;
|
|
160
|
+
--_rs-typography-letter-spacing:var(--rs-h3-letter-spacing, normal);
|
|
158
161
|
--_rs-typography-text-transform:initial;
|
|
159
162
|
--_rs-typography-font-variant-numeric:initial;
|
|
160
163
|
--_rs-typography-font-family:var(
|
|
@@ -185,7 +188,7 @@
|
|
|
185
188
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
186
189
|
}
|
|
187
190
|
&[class] > [data-rs-internal='collapse__content']{
|
|
188
|
-
--_rs-typography-letter-spacing:normal;
|
|
191
|
+
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
189
192
|
--_rs-typography-text-transform:initial;
|
|
190
193
|
--_rs-typography-font-variant-numeric:initial;
|
|
191
194
|
--_rs-typography-font-family:var(
|
|
@@ -213,14 +216,17 @@
|
|
|
213
216
|
--_rs-typography-text-auto-offset:32px;
|
|
214
217
|
--_rs-typography-ul-list-li-padding-left:26px;
|
|
215
218
|
--_rs-typography-ol-list-li-padding-left:32px;
|
|
216
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
219
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
220
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text,
|
|
221
|
+
24px
|
|
222
|
+
);
|
|
217
223
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
218
224
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
219
225
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
220
226
|
}
|
|
221
227
|
@media screen and (max-width: 640px){
|
|
222
228
|
&[class] > [data-rs-internal='collapse__content']{
|
|
223
|
-
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
229
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
224
230
|
}
|
|
225
231
|
}
|
|
226
232
|
}
|
|
@@ -295,7 +301,7 @@
|
|
|
295
301
|
--_rs-collapse-icon-size:20px;
|
|
296
302
|
}
|
|
297
303
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
298
|
-
--_rs-typography-letter-spacing:normal;
|
|
304
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
299
305
|
--_rs-typography-text-transform:initial;
|
|
300
306
|
--_rs-typography-font-variant-numeric:initial;
|
|
301
307
|
--_rs-typography-font-family:var(
|
|
@@ -326,7 +332,7 @@
|
|
|
326
332
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
327
333
|
}
|
|
328
334
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
329
|
-
--_rs-typography-letter-spacing:0.0045em;
|
|
335
|
+
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
330
336
|
--_rs-typography-text-transform:initial;
|
|
331
337
|
--_rs-typography-font-variant-numeric:initial;
|
|
332
338
|
--_rs-typography-font-family:var(
|
|
@@ -367,7 +373,7 @@
|
|
|
367
373
|
--_rs-collapse-icon-size:24px;
|
|
368
374
|
}
|
|
369
375
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
370
|
-
--_rs-typography-letter-spacing:normal;
|
|
376
|
+
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
371
377
|
--_rs-typography-text-transform:initial;
|
|
372
378
|
--_rs-typography-font-variant-numeric:initial;
|
|
373
379
|
--_rs-typography-font-family:var(
|
|
@@ -398,7 +404,7 @@
|
|
|
398
404
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
399
405
|
}
|
|
400
406
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
401
|
-
--_rs-typography-letter-spacing:0.0015em;
|
|
407
|
+
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
402
408
|
--_rs-typography-text-transform:initial;
|
|
403
409
|
--_rs-typography-font-variant-numeric:initial;
|
|
404
410
|
--_rs-typography-font-family:var(
|
|
@@ -426,14 +432,17 @@
|
|
|
426
432
|
--_rs-typography-text-auto-offset:16px;
|
|
427
433
|
--_rs-typography-ul-list-li-padding-left:22px;
|
|
428
434
|
--_rs-typography-ol-list-li-padding-left:26px;
|
|
429
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
435
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
436
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
437
|
+
16px
|
|
438
|
+
);
|
|
430
439
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
431
440
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
432
441
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
433
442
|
}
|
|
434
443
|
@media screen and (max-width: 640px){
|
|
435
444
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
436
|
-
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
445
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
437
446
|
}
|
|
438
447
|
}
|
|
439
448
|
}
|
|
@@ -444,7 +453,7 @@
|
|
|
444
453
|
--_rs-collapse-icon-size:28px;
|
|
445
454
|
}
|
|
446
455
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
447
|
-
--_rs-typography-letter-spacing:normal;
|
|
456
|
+
--_rs-typography-letter-spacing:var(--rs-h3-letter-spacing, normal);
|
|
448
457
|
--_rs-typography-text-transform:initial;
|
|
449
458
|
--_rs-typography-font-variant-numeric:initial;
|
|
450
459
|
--_rs-typography-font-family:var(
|
|
@@ -475,7 +484,7 @@
|
|
|
475
484
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
476
485
|
}
|
|
477
486
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
478
|
-
--_rs-typography-letter-spacing:normal;
|
|
487
|
+
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
479
488
|
--_rs-typography-text-transform:initial;
|
|
480
489
|
--_rs-typography-font-variant-numeric:initial;
|
|
481
490
|
--_rs-typography-font-family:var(
|
|
@@ -503,14 +512,17 @@
|
|
|
503
512
|
--_rs-typography-text-auto-offset:32px;
|
|
504
513
|
--_rs-typography-ul-list-li-padding-left:26px;
|
|
505
514
|
--_rs-typography-ol-list-li-padding-left:32px;
|
|
506
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
515
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
516
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text,
|
|
517
|
+
24px
|
|
518
|
+
);
|
|
507
519
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
508
520
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
509
521
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
510
522
|
}
|
|
511
523
|
@media screen and (max-width: 640px){
|
|
512
524
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
513
|
-
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
525
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
514
526
|
}
|
|
515
527
|
}
|
|
516
528
|
}
|
package/lib/public-api.pcss
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--_rs-collapse-icon-size:20px;
|
|
6
6
|
}
|
|
7
7
|
&[class] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
8
|
-
--_rs-typography-letter-spacing:normal;
|
|
8
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
9
9
|
--_rs-typography-text-transform:initial;
|
|
10
10
|
--_rs-typography-font-variant-numeric:initial;
|
|
11
11
|
--_rs-typography-font-family:var(
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
37
37
|
}
|
|
38
38
|
&[class] > [data-rs-internal='collapse__content']{
|
|
39
|
-
--_rs-typography-letter-spacing:0.0045em;
|
|
39
|
+
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
40
40
|
--_rs-typography-text-transform:initial;
|
|
41
41
|
--_rs-typography-font-variant-numeric:initial;
|
|
42
42
|
--_rs-typography-font-family:var(
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
--_rs-collapse-icon-size:24px;
|
|
78
78
|
}
|
|
79
79
|
&[class] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
80
|
-
--_rs-typography-letter-spacing:normal;
|
|
80
|
+
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
81
81
|
--_rs-typography-text-transform:initial;
|
|
82
82
|
--_rs-typography-font-variant-numeric:initial;
|
|
83
83
|
--_rs-typography-font-family:var(
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
109
109
|
}
|
|
110
110
|
&[class] > [data-rs-internal='collapse__content']{
|
|
111
|
-
--_rs-typography-letter-spacing:0.0015em;
|
|
111
|
+
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
112
112
|
--_rs-typography-text-transform:initial;
|
|
113
113
|
--_rs-typography-font-variant-numeric:initial;
|
|
114
114
|
--_rs-typography-font-family:var(
|
|
@@ -136,14 +136,17 @@
|
|
|
136
136
|
--_rs-typography-text-auto-offset:16px;
|
|
137
137
|
--_rs-typography-ul-list-li-padding-left:22px;
|
|
138
138
|
--_rs-typography-ol-list-li-padding-left:26px;
|
|
139
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
139
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
140
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
141
|
+
16px
|
|
142
|
+
);
|
|
140
143
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
141
144
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
142
145
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
143
146
|
}
|
|
144
147
|
@media screen and (max-width: 640px){
|
|
145
148
|
&[class] > [data-rs-internal='collapse__content']{
|
|
146
|
-
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
149
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|
|
@@ -154,7 +157,7 @@
|
|
|
154
157
|
--_rs-collapse-icon-size:28px;
|
|
155
158
|
}
|
|
156
159
|
&[class] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
157
|
-
--_rs-typography-letter-spacing:normal;
|
|
160
|
+
--_rs-typography-letter-spacing:var(--rs-h3-letter-spacing, normal);
|
|
158
161
|
--_rs-typography-text-transform:initial;
|
|
159
162
|
--_rs-typography-font-variant-numeric:initial;
|
|
160
163
|
--_rs-typography-font-family:var(
|
|
@@ -185,7 +188,7 @@
|
|
|
185
188
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
186
189
|
}
|
|
187
190
|
&[class] > [data-rs-internal='collapse__content']{
|
|
188
|
-
--_rs-typography-letter-spacing:normal;
|
|
191
|
+
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
189
192
|
--_rs-typography-text-transform:initial;
|
|
190
193
|
--_rs-typography-font-variant-numeric:initial;
|
|
191
194
|
--_rs-typography-font-family:var(
|
|
@@ -213,14 +216,17 @@
|
|
|
213
216
|
--_rs-typography-text-auto-offset:32px;
|
|
214
217
|
--_rs-typography-ul-list-li-padding-left:26px;
|
|
215
218
|
--_rs-typography-ol-list-li-padding-left:32px;
|
|
216
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
219
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
220
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text,
|
|
221
|
+
24px
|
|
222
|
+
);
|
|
217
223
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
218
224
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
219
225
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
220
226
|
}
|
|
221
227
|
@media screen and (max-width: 640px){
|
|
222
228
|
&[class] > [data-rs-internal='collapse__content']{
|
|
223
|
-
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
229
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
224
230
|
}
|
|
225
231
|
}
|
|
226
232
|
}
|
|
@@ -295,7 +301,7 @@
|
|
|
295
301
|
--_rs-collapse-icon-size:20px;
|
|
296
302
|
}
|
|
297
303
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
298
|
-
--_rs-typography-letter-spacing:normal;
|
|
304
|
+
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
299
305
|
--_rs-typography-text-transform:initial;
|
|
300
306
|
--_rs-typography-font-variant-numeric:initial;
|
|
301
307
|
--_rs-typography-font-family:var(
|
|
@@ -326,7 +332,7 @@
|
|
|
326
332
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
327
333
|
}
|
|
328
334
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
329
|
-
--_rs-typography-letter-spacing:0.0045em;
|
|
335
|
+
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
330
336
|
--_rs-typography-text-transform:initial;
|
|
331
337
|
--_rs-typography-font-variant-numeric:initial;
|
|
332
338
|
--_rs-typography-font-family:var(
|
|
@@ -367,7 +373,7 @@
|
|
|
367
373
|
--_rs-collapse-icon-size:24px;
|
|
368
374
|
}
|
|
369
375
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
370
|
-
--_rs-typography-letter-spacing:normal;
|
|
376
|
+
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
371
377
|
--_rs-typography-text-transform:initial;
|
|
372
378
|
--_rs-typography-font-variant-numeric:initial;
|
|
373
379
|
--_rs-typography-font-family:var(
|
|
@@ -398,7 +404,7 @@
|
|
|
398
404
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
399
405
|
}
|
|
400
406
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
401
|
-
--_rs-typography-letter-spacing:0.0015em;
|
|
407
|
+
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
402
408
|
--_rs-typography-text-transform:initial;
|
|
403
409
|
--_rs-typography-font-variant-numeric:initial;
|
|
404
410
|
--_rs-typography-font-family:var(
|
|
@@ -426,14 +432,17 @@
|
|
|
426
432
|
--_rs-typography-text-auto-offset:16px;
|
|
427
433
|
--_rs-typography-ul-list-li-padding-left:22px;
|
|
428
434
|
--_rs-typography-ol-list-li-padding-left:26px;
|
|
429
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
435
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
436
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
437
|
+
16px
|
|
438
|
+
);
|
|
430
439
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
431
440
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
432
441
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
433
442
|
}
|
|
434
443
|
@media screen and (max-width: 640px){
|
|
435
444
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
436
|
-
--_rs-typography-list-li-margin-top-from-text:12px;
|
|
445
|
+
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
437
446
|
}
|
|
438
447
|
}
|
|
439
448
|
}
|
|
@@ -444,7 +453,7 @@
|
|
|
444
453
|
--_rs-collapse-icon-size:28px;
|
|
445
454
|
}
|
|
446
455
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
447
|
-
--_rs-typography-letter-spacing:normal;
|
|
456
|
+
--_rs-typography-letter-spacing:var(--rs-h3-letter-spacing, normal);
|
|
448
457
|
--_rs-typography-text-transform:initial;
|
|
449
458
|
--_rs-typography-font-variant-numeric:initial;
|
|
450
459
|
--_rs-typography-font-family:var(
|
|
@@ -475,7 +484,7 @@
|
|
|
475
484
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
476
485
|
}
|
|
477
486
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
478
|
-
--_rs-typography-letter-spacing:normal;
|
|
487
|
+
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
479
488
|
--_rs-typography-text-transform:initial;
|
|
480
489
|
--_rs-typography-font-variant-numeric:initial;
|
|
481
490
|
--_rs-typography-font-family:var(
|
|
@@ -503,14 +512,17 @@
|
|
|
503
512
|
--_rs-typography-text-auto-offset:32px;
|
|
504
513
|
--_rs-typography-ul-list-li-padding-left:26px;
|
|
505
514
|
--_rs-typography-ol-list-li-padding-left:32px;
|
|
506
|
-
--_rs-typography-list-li-margin-top-from-text:
|
|
515
|
+
--_rs-typography-list-li-margin-top-from-text:var(
|
|
516
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text,
|
|
517
|
+
24px
|
|
518
|
+
);
|
|
507
519
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
508
520
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
509
521
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
510
522
|
}
|
|
511
523
|
@media screen and (max-width: 640px){
|
|
512
524
|
& [data-rs-internal="collapse__collapse"] > [data-rs-internal='collapse__content']{
|
|
513
|
-
--_rs-typography-list-li-margin-top-from-text:16px;
|
|
525
|
+
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
514
526
|
}
|
|
515
527
|
}
|
|
516
528
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
1
|
import { useState, useRef, useCallback } from 'react';
|
|
3
2
|
var COLLAPSE_STATES;
|
|
4
3
|
|
|
@@ -11,27 +10,21 @@ var COLLAPSE_STATES;
|
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
function useCollapseState(_ref) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var stateRef = useRef(COLLAPSE_STATES.CLOSE);
|
|
22
|
-
var onAnimationEnd = useCallback(function () {
|
|
13
|
+
let {
|
|
14
|
+
shouldBeOpened,
|
|
15
|
+
cancelAnimation
|
|
16
|
+
} = _ref;
|
|
17
|
+
const [, setDummyState] = useState(false);
|
|
18
|
+
const stateRef = useRef(COLLAPSE_STATES.CLOSE);
|
|
19
|
+
const onAnimationEnd = useCallback(() => {
|
|
23
20
|
if ((stateRef.current === COLLAPSE_STATES.CLOSING || stateRef.current === COLLAPSE_STATES.OPENING) && !shouldBeOpened) {
|
|
24
21
|
stateRef.current = COLLAPSE_STATES.CLOSE; //force rerender
|
|
25
22
|
|
|
26
|
-
setDummyState(
|
|
27
|
-
return !s;
|
|
28
|
-
});
|
|
23
|
+
setDummyState(s => !s);
|
|
29
24
|
} else if (stateRef.current === COLLAPSE_STATES.OPENING && shouldBeOpened) {
|
|
30
25
|
stateRef.current = COLLAPSE_STATES.OPEN; //force rerender
|
|
31
26
|
|
|
32
|
-
setDummyState(
|
|
33
|
-
return !s;
|
|
34
|
-
});
|
|
27
|
+
setDummyState(s => !s);
|
|
35
28
|
}
|
|
36
29
|
}, [shouldBeOpened]);
|
|
37
30
|
|
|
@@ -42,25 +35,22 @@ function useCollapseState(_ref) {
|
|
|
42
35
|
}
|
|
43
36
|
|
|
44
37
|
return {
|
|
45
|
-
onAnimationEnd
|
|
38
|
+
onAnimationEnd,
|
|
46
39
|
state: stateRef.current
|
|
47
40
|
};
|
|
48
41
|
}
|
|
49
42
|
|
|
50
43
|
function useStartedClosing(state) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var _useState3 = useState(false),
|
|
56
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
-
setDummyState = _useState4[1];
|
|
44
|
+
const isStartedClosingRef = useRef(false);
|
|
45
|
+
const prevState = useRef(state);
|
|
46
|
+
const contentRef = useRef(null);
|
|
47
|
+
const [, setDummyState] = useState(false);
|
|
58
48
|
|
|
59
49
|
if (prevState.current === COLLAPSE_STATES.OPEN && state === COLLAPSE_STATES.CLOSING) {
|
|
60
50
|
isStartedClosingRef.current = true; // the next frame we need to force layout recalculations and new render
|
|
61
51
|
|
|
62
52
|
if (typeof window !== 'undefined') {
|
|
63
|
-
requestAnimationFrame(
|
|
53
|
+
requestAnimationFrame(() => {
|
|
64
54
|
if (!contentRef.current || !isStartedClosingRef.current) {
|
|
65
55
|
return;
|
|
66
56
|
} // force layout recalc, without this step firefox doesn't register style values for transitions
|
|
@@ -69,9 +59,7 @@ function useStartedClosing(state) {
|
|
|
69
59
|
|
|
70
60
|
contentRef.current.offsetHeight;
|
|
71
61
|
isStartedClosingRef.current = false;
|
|
72
|
-
setDummyState(
|
|
73
|
-
return !s;
|
|
74
|
-
});
|
|
62
|
+
setDummyState(s => !s);
|
|
75
63
|
});
|
|
76
64
|
}
|
|
77
65
|
}
|
|
@@ -79,7 +67,7 @@ function useStartedClosing(state) {
|
|
|
79
67
|
prevState.current = state;
|
|
80
68
|
return {
|
|
81
69
|
isStartedClosing: isStartedClosingRef.current,
|
|
82
|
-
contentRef
|
|
70
|
+
contentRef
|
|
83
71
|
};
|
|
84
72
|
}
|
|
85
73
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/collapse",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
|
+
"module": "lib/index.js",
|
|
8
9
|
"src:main": "src/index.ts",
|
|
9
10
|
"files": [
|
|
10
11
|
"lib",
|
|
@@ -14,10 +15,9 @@
|
|
|
14
15
|
"access": "public"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@babel/runtime-corejs3": "^7.
|
|
18
|
-
"@rescui/use-resize-observer": "
|
|
19
|
-
"classnames": "^2.2.6"
|
|
20
|
-
"core-js": "^3.9.1"
|
|
18
|
+
"@babel/runtime-corejs3": "^7.26.0",
|
|
19
|
+
"@rescui/use-resize-observer": "0.2.6-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
|
|
20
|
+
"classnames": "^2.2.6"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@rescui/ui-contexts": "^0.5.0",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"react": ">=16.8.0 <19"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@rescui/colors": "
|
|
29
|
-
"@rescui/scripts": "
|
|
30
|
-
"@rescui/typography": "
|
|
31
|
-
"@rescui/visual-regression": "
|
|
28
|
+
"@rescui/colors": "0.2.7-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
|
|
29
|
+
"@rescui/scripts": "0.4.0",
|
|
30
|
+
"@rescui/typography": "0.19.2-RUI-226-Update-card-cn-6e43cc89.60+6e43cc89",
|
|
31
|
+
"@rescui/visual-regression": "0.1.2",
|
|
32
32
|
"@types/classnames": "^2.2.11"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
37
37
|
},
|
|
38
38
|
"nx": {},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "6e43cc893fafb22b990273901bc0a070fb15761f"
|
|
40
40
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
2
|
-
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import cn from 'classnames';
|
|
6
|
-
import styles from './index.css.js';
|
|
7
|
-
var _excluded = ["theme", "size", "className"];
|
|
8
|
-
var sizeStyles = {
|
|
9
|
-
"xs": styles.sizeXS,
|
|
10
|
-
"s": styles.sizeS,
|
|
11
|
-
"m": styles.sizeM,
|
|
12
|
-
"l": styles.sizeL
|
|
13
|
-
};
|
|
14
|
-
var AddOutlineIcon = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
15
|
-
var theme = _ref.theme,
|
|
16
|
-
size = _ref.size,
|
|
17
|
-
className = _ref.className,
|
|
18
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
-
|
|
20
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
21
|
-
viewBox: "0 0 24 24"
|
|
22
|
-
}, props, {
|
|
23
|
-
className: cn(styles.icon, styles[theme], sizeStyles[size], className),
|
|
24
|
-
ref: ref
|
|
25
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
26
|
-
d: "M12.997 3h-2v8H3v2h7.997v8h2v-8H21v-2h-8.003V3z"
|
|
27
|
-
}));
|
|
28
|
-
});
|
|
29
|
-
AddOutlineIcon.propTypes = {
|
|
30
|
-
className: PropTypes.string,
|
|
31
|
-
theme: PropTypes.oneOf(["light", "dark"]),
|
|
32
|
-
size: PropTypes.oneOf(["xs", "s", "m", "l"])
|
|
33
|
-
};
|
|
34
|
-
AddOutlineIcon.defaultProps = {
|
|
35
|
-
size: "m"
|
|
36
|
-
};
|
|
37
|
-
export { AddOutlineIcon as default };
|