@rescui/collapse 0.8.2 → 0.8.4-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.10
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 -12
- package/lib/accordion.js +155 -34
- package/lib/collapse.js +324 -101
- package/lib/collapse.p.module.css.js +32 -32
- package/lib/index.css +73 -73
- package/lib/use-collapse-state.d.ts +7 -6
- package/lib/use-collapse-state.js +160 -43
- package/lib/use-safe-id.d.ts +3 -0
- package/lib/use-safe-id.js +10 -0
- package/llm/components/accordion.md +23 -38
- package/llm/components/collapse.md +19 -34
- package/package.json +11 -10
package/lib/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
._icon_19upof9_4{
|
|
2
2
|
--_rs-theme-dark:var(
|
|
3
3
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
4
4
|
var(--rs-theme-dark, 0)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
9
9
|
}
|
|
10
10
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
11
|
-
.
|
|
11
|
+
._icon_19upof9_4{
|
|
12
12
|
--_rs-color-primary:color-mix(in srgb, var(--rs-color-primary-light-theme, #6B57FF) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dark-theme, #8473FF) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
13
13
|
--_rs-color-primary-dim:color-mix(in srgb, var(--rs-color-primary-dim-light-theme, #8979ff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-dim-dark-theme, #6f61d2) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
14
14
|
--_rs-color-primary-fog:color-mix(in srgb, var(--rs-color-primary-fog-light-theme, #e1ddff) calc(100%*var(--_rs-theme-light-coefficient, 1)), var(--rs-color-primary-fog-dark-theme, #2e2b49) calc(100%*var(--_rs-theme-dark-coefficient, 0)));
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
20
|
-
.
|
|
20
|
+
._icon_19upof9_4{
|
|
21
21
|
--_rs-color-primary:rgb(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255);
|
|
22
22
|
--_rs-color-primary-dim:rgb(calc(var(--_rs-theme-light-coefficient, 1)*137 + var(--_rs-theme-dark-coefficient, 0)*111), calc(var(--_rs-theme-light-coefficient, 1)*121 + var(--_rs-theme-dark-coefficient, 0)*97), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*210));
|
|
23
23
|
--_rs-color-primary-fog:rgb(calc(var(--_rs-theme-light-coefficient, 1)*225 + var(--_rs-theme-dark-coefficient, 0)*46), calc(var(--_rs-theme-light-coefficient, 1)*221 + var(--_rs-theme-dark-coefficient, 0)*43), calc(var(--_rs-theme-light-coefficient, 1)*255 + var(--_rs-theme-dark-coefficient, 0)*73));
|
|
@@ -25,30 +25,30 @@
|
|
|
25
25
|
--_rs-color-primary-t-fog:rgba(calc(var(--_rs-theme-light-coefficient, 1)*107 + var(--_rs-theme-dark-coefficient, 0)*132), calc(var(--_rs-theme-light-coefficient, 1)*87 + var(--_rs-theme-dark-coefficient, 0)*115), 255, calc(var(--_rs-theme-light-coefficient, 1)*0.2 + var(--_rs-theme-dark-coefficient, 0)*0.3));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
._icon_19upof9_4{
|
|
29
29
|
|
|
30
30
|
fill:var(--_rs-icons-themed-fill-or-initial, currentcolor);
|
|
31
31
|
|
|
32
32
|
width:var(--rs-icons-width, auto);
|
|
33
33
|
height:var(--rs-icons-height, var(--_rs-icons-height));
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
._sizeXS_19upof9_14{
|
|
36
36
|
--_rs-icons-height:16px;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
._sizeS_19upof9_18{
|
|
39
39
|
--_rs-icons-height:20px;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
._sizeM_19upof9_22{
|
|
42
42
|
--_rs-icons-height:24px;
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
._sizeL_19upof9_26{
|
|
45
45
|
--_rs-icons-height:28px;
|
|
46
46
|
}
|
|
47
|
-
.
|
|
47
|
+
._light_19upof9_30{
|
|
48
48
|
--rs-theme-dark:0;
|
|
49
49
|
--_rs-icons-themed-fill-or-initial:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
._dark_19upof9_34{
|
|
52
52
|
--rs-theme-dark:1;
|
|
53
53
|
--_rs-icons-themed-fill-or-initial:rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227));
|
|
54
54
|
}
|
|
@@ -60,54 +60,54 @@
|
|
|
60
60
|
transform:rotate(360deg);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
.
|
|
63
|
+
._allVariants_19upof9_48{
|
|
64
64
|
aspect-ratio:var(--rs-icon-ar-width, 1) / var(--rs-icon-ar-height, 1);
|
|
65
65
|
container:rs-icon / size;
|
|
66
66
|
}
|
|
67
|
-
.
|
|
68
|
-
.
|
|
69
|
-
.
|
|
67
|
+
._variant16_19upof9_53,
|
|
68
|
+
._variant20_19upof9_54,
|
|
69
|
+
._variant24_19upof9_55{
|
|
70
70
|
display:none;
|
|
71
71
|
}
|
|
72
|
-
.
|
|
72
|
+
._variant28_19upof9_58{
|
|
73
73
|
display:block;
|
|
74
74
|
}
|
|
75
75
|
@container rs-icon (max-height: 24px){
|
|
76
|
-
.
|
|
76
|
+
._variant24_19upof9_55{
|
|
77
77
|
display:block;
|
|
78
78
|
}
|
|
79
|
-
.
|
|
79
|
+
._variant28_19upof9_58{
|
|
80
80
|
display:none;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
@container rs-icon (max-height: 20px){
|
|
84
|
-
.
|
|
84
|
+
._variant20_19upof9_54{
|
|
85
85
|
display:block;
|
|
86
86
|
}
|
|
87
|
-
.
|
|
87
|
+
._variant24_19upof9_55{
|
|
88
88
|
display:none;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
@container rs-icon (max-height: 16px){
|
|
92
|
-
.
|
|
92
|
+
._variant16_19upof9_53{
|
|
93
93
|
display:block;
|
|
94
94
|
}
|
|
95
|
-
.
|
|
95
|
+
._variant20_19upof9_54{
|
|
96
96
|
display:none;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
.
|
|
99
|
+
._themeLight_1t0qfuj_6{
|
|
100
100
|
--rs-theme-dark:0;
|
|
101
101
|
}
|
|
102
|
-
.
|
|
102
|
+
._themeDark_1t0qfuj_9{
|
|
103
103
|
--rs-theme-dark:1;
|
|
104
104
|
}
|
|
105
|
-
.
|
|
105
|
+
._sizeS_1t0qfuj_13{
|
|
106
106
|
--_rs-collapse-vertical-padding:6px;
|
|
107
107
|
--_rs-collapse-horizontal-padding:8px;
|
|
108
108
|
--_rs-collapse-icon-size:20px;
|
|
109
109
|
}
|
|
110
|
-
.
|
|
110
|
+
._sizeS_1t0qfuj_13 > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
111
111
|
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
112
112
|
--_rs-typography-text-transform:initial;
|
|
113
113
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
140
140
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
141
141
|
}
|
|
142
|
-
.
|
|
142
|
+
._sizeS_1t0qfuj_13 > [data-rs-internal='collapse__content']{
|
|
143
143
|
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
144
144
|
--_rs-typography-text-transform:initial;
|
|
145
145
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -174,12 +174,12 @@
|
|
|
174
174
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
175
175
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
176
176
|
}
|
|
177
|
-
.
|
|
177
|
+
._sizeM_1t0qfuj_16{
|
|
178
178
|
--_rs-collapse-vertical-padding:8px;
|
|
179
179
|
--_rs-collapse-horizontal-padding:8px;
|
|
180
180
|
--_rs-collapse-icon-size:24px;
|
|
181
181
|
}
|
|
182
|
-
.
|
|
182
|
+
._sizeM_1t0qfuj_16 > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
183
183
|
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
184
184
|
--_rs-typography-text-transform:initial;
|
|
185
185
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
212
212
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
213
213
|
}
|
|
214
|
-
.
|
|
214
|
+
._sizeM_1t0qfuj_16 > [data-rs-internal='collapse__content']{
|
|
215
215
|
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
216
216
|
--_rs-typography-text-transform:initial;
|
|
217
217
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -250,16 +250,16 @@
|
|
|
250
250
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
251
251
|
}
|
|
252
252
|
@media screen and (max-width: 640px){
|
|
253
|
-
.
|
|
253
|
+
._sizeM_1t0qfuj_16 > [data-rs-internal='collapse__content']{
|
|
254
254
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
.
|
|
257
|
+
._sizeL_1t0qfuj_19{
|
|
258
258
|
--_rs-collapse-vertical-padding:12px;
|
|
259
259
|
--_rs-collapse-horizontal-padding:16px;
|
|
260
260
|
--_rs-collapse-icon-size:28px;
|
|
261
261
|
}
|
|
262
|
-
.
|
|
262
|
+
._sizeL_1t0qfuj_19 > [data-rs-internal='collapse__button'] > [data-rs-internal='collapse__title']{
|
|
263
263
|
--_rs-typography-letter-spacing:var(--rs-h3-letter-spacing, normal);
|
|
264
264
|
--_rs-typography-text-transform:initial;
|
|
265
265
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
292
292
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
293
293
|
}
|
|
294
|
-
.
|
|
294
|
+
._sizeL_1t0qfuj_19 > [data-rs-internal='collapse__content']{
|
|
295
295
|
--_rs-typography-letter-spacing:var(--rs-text-1-letter-spacing, normal);
|
|
296
296
|
--_rs-typography-text-transform:initial;
|
|
297
297
|
--_rs-typography-font-variant-numeric:initial;
|
|
@@ -330,11 +330,11 @@
|
|
|
330
330
|
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
331
331
|
}
|
|
332
332
|
@media screen and (max-width: 640px){
|
|
333
|
-
.
|
|
333
|
+
._sizeL_1t0qfuj_19 > [data-rs-internal='collapse__content']{
|
|
334
334
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text:16px;
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
.
|
|
337
|
+
._classic_1t0qfuj_23{
|
|
338
338
|
--_rs-collapse-active-theme-flip:0;
|
|
339
339
|
--_rs-collapse-active-background:rgba(
|
|
340
340
|
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),
|
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
);
|
|
349
349
|
--_rs-collapse-button-hover-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), 1);
|
|
350
350
|
}
|
|
351
|
-
.
|
|
351
|
+
._rock_1t0qfuj_26{
|
|
352
352
|
--_rs-collapse-active-theme-flip:1;
|
|
353
353
|
--_rs-collapse-active-background:rgb(calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*230), calc(255 - var(--_rs-theme-dark-coefficient, 0)*227));
|
|
354
354
|
--_rs-collapse-active-border-bottom-to-padding-multiplier:1;
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
);
|
|
360
360
|
--_rs-collapse-button-hover-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), 1);
|
|
361
361
|
}
|
|
362
|
-
.
|
|
362
|
+
._clear_1t0qfuj_29{
|
|
363
363
|
--_rs-collapse-active-theme-flip:0;
|
|
364
364
|
--_rs-collapse-active-background:transparent;
|
|
365
365
|
--_rs-collapse-active-border-bottom-to-padding-multiplier:0;
|
|
@@ -370,27 +370,27 @@
|
|
|
370
370
|
0.7
|
|
371
371
|
);
|
|
372
372
|
}
|
|
373
|
-
.
|
|
373
|
+
._hasBorderBottom_1t0qfuj_33{
|
|
374
374
|
--_rs-collapse-border-bottom-width-or-initial:1px;
|
|
375
375
|
}
|
|
376
|
-
.
|
|
376
|
+
._leftIcon_1t0qfuj_37{
|
|
377
377
|
--_rs-collapse-button-flex-direction:row;
|
|
378
378
|
--_rs-collapse-icon-margin:0 var(--_rs-collapse-horizontal-padding) 0 0;
|
|
379
379
|
--_rs-collapse-inner-wrapper-padding-left-base:calc(var(--_rs-collapse-horizontal-padding)*2 + var(--_rs-collapse-icon-size));
|
|
380
380
|
}
|
|
381
|
-
.
|
|
381
|
+
._rightIcon_1t0qfuj_40{
|
|
382
382
|
--_rs-collapse-button-flex-direction:row-reverse;
|
|
383
383
|
--_rs-collapse-icon-margin:0 0 0 var(--_rs-collapse-horizontal-padding);
|
|
384
384
|
--_rs-collapse-inner-wrapper-padding-left-base:var(
|
|
385
385
|
--_rs-collapse-horizontal-padding
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
|
-
.
|
|
388
|
+
._disableLeftPadding_1t0qfuj_44{
|
|
389
389
|
--_rs-collapse-inner-wrapper-padding-left-from-disable-left-padding-or-initial:var(
|
|
390
390
|
--_rs-collapse-horizontal-padding
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
|
-
.
|
|
393
|
+
._main_1t0qfuj_48{
|
|
394
394
|
--_rs-theme-dark:var(
|
|
395
395
|
--_rs-internal-force-theme-dark-consult-rescui-before-using,
|
|
396
396
|
var(--rs-theme-dark, 0)
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
--_rs-theme-light-coefficient:calc(1 - var(--_rs-theme-dark-coefficient));
|
|
401
401
|
}
|
|
402
402
|
@supports (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
403
|
-
.
|
|
403
|
+
._main_1t0qfuj_48{
|
|
404
404
|
--_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)));
|
|
405
405
|
--_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)));
|
|
406
406
|
--_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)));
|
|
@@ -409,7 +409,7 @@
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
@supports not (color: color-mix(in srgb, #fff 50%, #000 50%)){
|
|
412
|
-
.
|
|
412
|
+
._main_1t0qfuj_48{
|
|
413
413
|
--_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);
|
|
414
414
|
--_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));
|
|
415
415
|
--_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));
|
|
@@ -417,7 +417,7 @@
|
|
|
417
417
|
--_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));
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
.
|
|
420
|
+
._main_1t0qfuj_48 {
|
|
421
421
|
--_rs-collapse-border-bottom-width:var(
|
|
422
422
|
--_rs-collapse-border-bottom-width-or-initial,
|
|
423
423
|
0px
|
|
@@ -432,9 +432,9 @@
|
|
|
432
432
|
border-bottom:var(--_rs-collapse-border-bottom-width) solid 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);
|
|
433
433
|
border-radius:var(--rs-collapse-border-radius, 0px);
|
|
434
434
|
}
|
|
435
|
-
.
|
|
436
|
-
.
|
|
437
|
-
.
|
|
435
|
+
._main_1t0qfuj_48._opening_1t0qfuj_59,
|
|
436
|
+
._main_1t0qfuj_48._opened_1t0qfuj_60,
|
|
437
|
+
._main_1t0qfuj_48._closing_1t0qfuj_61{
|
|
438
438
|
--rs-theme-flip:var(--_rs-collapse-active-theme-flip);
|
|
439
439
|
|
|
440
440
|
padding-bottom:calc(var(--_rs-collapse-border-bottom-width)*var(--_rs-collapse-active-border-bottom-to-padding-multiplier));
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
background:var(--_rs-collapse-active-background);
|
|
445
445
|
}
|
|
446
446
|
@media (hover: hover){
|
|
447
|
-
.
|
|
447
|
+
._main_1t0qfuj_48:hover{
|
|
448
448
|
--rs-theme-flip:var(--_rs-collapse-active-theme-flip);
|
|
449
449
|
|
|
450
450
|
padding-bottom:calc(var(--_rs-collapse-border-bottom-width)*var(--_rs-collapse-active-border-bottom-to-padding-multiplier));
|
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
background:var(--_rs-collapse-active-background);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
.
|
|
457
|
+
._title_1t0qfuj_95{
|
|
458
458
|
letter-spacing:var(
|
|
459
459
|
--rs-text-base-letter-spacing,
|
|
460
460
|
var(--_rs-typography-letter-spacing)
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
|
|
472
472
|
color:inherit;
|
|
473
473
|
}
|
|
474
|
-
.
|
|
474
|
+
._content_1t0qfuj_103{
|
|
475
475
|
letter-spacing:var(
|
|
476
476
|
--rs-text-base-letter-spacing,
|
|
477
477
|
var(--_rs-typography-letter-spacing)
|
|
@@ -492,22 +492,22 @@
|
|
|
492
492
|
|
|
493
493
|
height:0;
|
|
494
494
|
}
|
|
495
|
-
.
|
|
495
|
+
._closed_1t0qfuj_111 > ._content_1t0qfuj_103{
|
|
496
496
|
display:none;
|
|
497
497
|
}
|
|
498
|
-
.
|
|
498
|
+
._opened_1t0qfuj_60 > ._content_1t0qfuj_103{
|
|
499
499
|
height:initial;
|
|
500
500
|
}
|
|
501
|
-
.
|
|
502
|
-
.
|
|
501
|
+
._opening_1t0qfuj_59 > ._content_1t0qfuj_103,
|
|
502
|
+
._closingTransition_1t0qfuj_120 > ._content_1t0qfuj_103{
|
|
503
503
|
overflow:hidden;
|
|
504
504
|
|
|
505
505
|
transition:height 300ms var(--rs-transition-function, ease);
|
|
506
506
|
}
|
|
507
|
-
.
|
|
507
|
+
._innerWrapper_1t0qfuj_127{
|
|
508
508
|
padding:0 var(--_rs-collapse-horizontal-padding) var(--_rs-collapse-horizontal-padding) var(--_rs-collapse-inner-wrapper-padding-left);
|
|
509
509
|
}
|
|
510
|
-
.
|
|
510
|
+
._button_1t0qfuj_133{
|
|
511
511
|
color:var(
|
|
512
512
|
--rs-color-hard,
|
|
513
513
|
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))
|
|
@@ -540,24 +540,24 @@
|
|
|
540
540
|
-moz-osx-font-smoothing:inherit;
|
|
541
541
|
-webkit-appearance:none;
|
|
542
542
|
}
|
|
543
|
-
.
|
|
543
|
+
._button_1t0qfuj_133::-moz-focus-inner{
|
|
544
544
|
padding:0;
|
|
545
545
|
|
|
546
546
|
border:0;
|
|
547
547
|
}
|
|
548
|
-
.
|
|
548
|
+
._button_1t0qfuj_133:focus{
|
|
549
549
|
outline:none;
|
|
550
550
|
}
|
|
551
|
-
.
|
|
551
|
+
._button_1t0qfuj_133:focus[data-focus-method='key']{
|
|
552
552
|
box-shadow:var(--_rs-color-primary-t-dim) 0 0 0 4px;
|
|
553
553
|
}
|
|
554
554
|
@media (hover: hover){
|
|
555
|
-
.
|
|
555
|
+
._button_1t0qfuj_133:hover{
|
|
556
556
|
color:var(--_rs-collapse-button-hover-color);
|
|
557
557
|
background:var(--_rs-collapse-button-hover-background);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
|
-
.
|
|
560
|
+
._icon_1t0qfuj_186{
|
|
561
561
|
position:relative;
|
|
562
562
|
top:0;
|
|
563
563
|
left:0;
|
|
@@ -573,34 +573,34 @@
|
|
|
573
573
|
|
|
574
574
|
will-change:transform;
|
|
575
575
|
}
|
|
576
|
-
.
|
|
577
|
-
.
|
|
576
|
+
._opening_1t0qfuj_59._iconPlus_1t0qfuj_202 > ._button_1t0qfuj_133 > ._icon_1t0qfuj_186,
|
|
577
|
+
._opened_1t0qfuj_60._iconPlus_1t0qfuj_202 > ._button_1t0qfuj_133 > ._icon_1t0qfuj_186{
|
|
578
578
|
transform:rotate(45deg);
|
|
579
579
|
}
|
|
580
|
-
.
|
|
581
|
-
.
|
|
580
|
+
._opening_1t0qfuj_59._iconArrow_1t0qfuj_207 > ._button_1t0qfuj_133 > ._icon_1t0qfuj_186,
|
|
581
|
+
._opened_1t0qfuj_60._iconArrow_1t0qfuj_207 > ._button_1t0qfuj_133 > ._icon_1t0qfuj_186{
|
|
582
582
|
transform:rotate(90deg);
|
|
583
583
|
}
|
|
584
|
-
.
|
|
584
|
+
._accordion_1t0qfuj_213{
|
|
585
585
|
display:flex;
|
|
586
586
|
flex-direction:column;
|
|
587
587
|
row-gap:var(--_rs-collapse-accordion-gap);
|
|
588
588
|
}
|
|
589
|
-
.
|
|
589
|
+
._accordionGap0_1t0qfuj_218{
|
|
590
590
|
--_rs-collapse-accordion-gap:0px;
|
|
591
591
|
}
|
|
592
|
-
.
|
|
592
|
+
._accordionGap8_1t0qfuj_221{
|
|
593
593
|
--_rs-collapse-accordion-gap:8px;
|
|
594
594
|
}
|
|
595
|
-
.
|
|
595
|
+
._accordionGap12_1t0qfuj_224{
|
|
596
596
|
--_rs-collapse-accordion-gap:12px;
|
|
597
597
|
}
|
|
598
|
-
.
|
|
598
|
+
._accordionGap16_1t0qfuj_227{
|
|
599
599
|
--_rs-collapse-accordion-gap:16px;
|
|
600
600
|
}
|
|
601
|
-
.
|
|
601
|
+
._accordionGap24_1t0qfuj_230{
|
|
602
602
|
--_rs-collapse-accordion-gap:24px;
|
|
603
603
|
}
|
|
604
|
-
.
|
|
604
|
+
._accordionGap32_1t0qfuj_233{
|
|
605
605
|
--_rs-collapse-accordion-gap:32px;
|
|
606
606
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
export declare enum COLLAPSE_STATES {
|
|
2
2
|
OPENING = "OPENING",
|
|
3
3
|
OPEN = "OPEN",
|
|
4
|
+
CLOSING_PREPARE = "CLOSING_PREPARE",
|
|
4
5
|
CLOSING = "CLOSING",
|
|
5
6
|
CLOSE = "CLOSE"
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
type InitialState = {
|
|
8
9
|
shouldBeOpened: boolean;
|
|
9
10
|
cancelAnimation?: boolean;
|
|
10
|
-
}): {
|
|
11
|
-
onAnimationEnd: () => void;
|
|
12
|
-
state: COLLAPSE_STATES;
|
|
13
11
|
};
|
|
14
|
-
export declare function
|
|
15
|
-
isStartedClosing: boolean;
|
|
12
|
+
export declare function useCollapseState({ shouldBeOpened, cancelAnimation }: InitialState): {
|
|
16
13
|
contentRef: import("react").RefObject<HTMLDivElement>;
|
|
14
|
+
isStartedClosing: boolean;
|
|
15
|
+
onAnimationEnd: () => void;
|
|
16
|
+
state: COLLAPSE_STATES;
|
|
17
17
|
};
|
|
18
|
+
export {};
|
|
@@ -1,75 +1,192 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { c } from 'react-compiler-runtime';
|
|
3
|
+
import { useReducer, useRef, useLayoutEffect } from 'react';
|
|
3
4
|
var COLLAPSE_STATES;
|
|
4
5
|
|
|
5
6
|
(function (COLLAPSE_STATES) {
|
|
6
7
|
COLLAPSE_STATES["OPENING"] = "OPENING";
|
|
7
8
|
COLLAPSE_STATES["OPEN"] = "OPEN";
|
|
9
|
+
COLLAPSE_STATES["CLOSING_PREPARE"] = "CLOSING_PREPARE";
|
|
8
10
|
COLLAPSE_STATES["CLOSING"] = "CLOSING";
|
|
9
11
|
COLLAPSE_STATES["CLOSE"] = "CLOSE";
|
|
10
|
-
})(COLLAPSE_STATES || (COLLAPSE_STATES = {}));
|
|
12
|
+
})(COLLAPSE_STATES || (COLLAPSE_STATES = {}));
|
|
11
13
|
|
|
14
|
+
function forceLayoutRecalculation(element) {
|
|
15
|
+
'use no memo'; // eslint-disable-next-line no-unused-expressions
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
element.offsetHeight;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getInitialState(_ref) {
|
|
14
21
|
let {
|
|
15
22
|
shouldBeOpened,
|
|
16
23
|
cancelAnimation
|
|
17
24
|
} = _ref;
|
|
18
|
-
const [, setDummyState] = useState(false);
|
|
19
|
-
const stateRef = useRef(COLLAPSE_STATES.CLOSE);
|
|
20
|
-
const onAnimationEnd = useCallback(() => {
|
|
21
|
-
if ((stateRef.current === COLLAPSE_STATES.CLOSING || stateRef.current === COLLAPSE_STATES.OPENING) && !shouldBeOpened) {
|
|
22
|
-
stateRef.current = COLLAPSE_STATES.CLOSE; //force rerender
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
if (!shouldBeOpened) {
|
|
27
|
+
return COLLAPSE_STATES.CLOSE;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return cancelAnimation ? COLLAPSE_STATES.OPEN : COLLAPSE_STATES.OPENING;
|
|
31
|
+
}
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
function getStateForTarget(state, shouldBeOpened, cancelAnimation) {
|
|
34
|
+
if (cancelAnimation) {
|
|
35
|
+
return shouldBeOpened ? COLLAPSE_STATES.OPEN : COLLAPSE_STATES.CLOSE;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (shouldBeOpened) {
|
|
39
|
+
// Closing has not started visually yet, so there is nothing to animate back.
|
|
40
|
+
if (state === COLLAPSE_STATES.CLOSING_PREPARE) {
|
|
41
|
+
return COLLAPSE_STATES.OPEN;
|
|
29
42
|
}
|
|
30
|
-
}, [shouldBeOpened]);
|
|
31
43
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
44
|
+
return state === COLLAPSE_STATES.OPEN || state === COLLAPSE_STATES.OPENING ? state : COLLAPSE_STATES.OPENING;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (state === COLLAPSE_STATES.CLOSE || state === COLLAPSE_STATES.CLOSING_PREPARE || state === COLLAPSE_STATES.CLOSING) {
|
|
48
|
+
return state;
|
|
36
49
|
}
|
|
37
50
|
|
|
38
|
-
return
|
|
39
|
-
onAnimationEnd,
|
|
40
|
-
state: stateRef.current
|
|
41
|
-
};
|
|
51
|
+
return state === COLLAPSE_STATES.OPEN ? COLLAPSE_STATES.CLOSING_PREPARE : COLLAPSE_STATES.CLOSING;
|
|
42
52
|
}
|
|
43
53
|
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
function collapseReducer(state, action) {
|
|
55
|
+
switch (action.type) {
|
|
56
|
+
case 'TARGET_CHANGED':
|
|
57
|
+
return getStateForTarget(state, action.shouldBeOpened, action.cancelAnimation);
|
|
58
|
+
|
|
59
|
+
case 'CLOSING_READY':
|
|
60
|
+
return state === COLLAPSE_STATES.CLOSING_PREPARE ? COLLAPSE_STATES.CLOSING : state;
|
|
61
|
+
|
|
62
|
+
case 'TRANSITION_END':
|
|
63
|
+
if (action.shouldBeOpened && state === COLLAPSE_STATES.OPENING) {
|
|
64
|
+
return COLLAPSE_STATES.OPEN;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!action.shouldBeOpened && state === COLLAPSE_STATES.CLOSING) {
|
|
68
|
+
return COLLAPSE_STATES.CLOSE;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return state;
|
|
72
|
+
|
|
73
|
+
default:
|
|
74
|
+
return state;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function useCollapseState(t0) {
|
|
79
|
+
const $ = c(16);
|
|
80
|
+
const {
|
|
81
|
+
shouldBeOpened,
|
|
82
|
+
cancelAnimation
|
|
83
|
+
} = t0;
|
|
84
|
+
let t1;
|
|
85
|
+
|
|
86
|
+
if ($[0] !== cancelAnimation || $[1] !== shouldBeOpened) {
|
|
87
|
+
t1 = {
|
|
88
|
+
shouldBeOpened,
|
|
89
|
+
cancelAnimation
|
|
90
|
+
};
|
|
91
|
+
$[0] = cancelAnimation;
|
|
92
|
+
$[1] = shouldBeOpened;
|
|
93
|
+
$[2] = t1;
|
|
94
|
+
} else {
|
|
95
|
+
t1 = $[2];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const [state, dispatch] = useReducer(collapseReducer, t1, getInitialState);
|
|
47
99
|
const contentRef = useRef(null);
|
|
48
|
-
|
|
100
|
+
let t2;
|
|
101
|
+
let t3;
|
|
49
102
|
|
|
50
|
-
if (
|
|
51
|
-
|
|
103
|
+
if ($[3] !== cancelAnimation || $[4] !== shouldBeOpened) {
|
|
104
|
+
t2 = () => {
|
|
105
|
+
dispatch({
|
|
106
|
+
type: "TARGET_CHANGED",
|
|
107
|
+
shouldBeOpened,
|
|
108
|
+
cancelAnimation
|
|
109
|
+
});
|
|
110
|
+
};
|
|
52
111
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
112
|
+
t3 = [shouldBeOpened, cancelAnimation];
|
|
113
|
+
$[3] = cancelAnimation;
|
|
114
|
+
$[4] = shouldBeOpened;
|
|
115
|
+
$[5] = t2;
|
|
116
|
+
$[6] = t3;
|
|
117
|
+
} else {
|
|
118
|
+
t2 = $[5];
|
|
119
|
+
t3 = $[6];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
useLayoutEffect(t2, t3);
|
|
123
|
+
let t4;
|
|
124
|
+
let t5;
|
|
59
125
|
|
|
126
|
+
if ($[7] !== state) {
|
|
127
|
+
t4 = () => {
|
|
128
|
+
if (state !== COLLAPSE_STATES.CLOSING_PREPARE) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
60
131
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
132
|
+
const frame = requestAnimationFrame(() => {
|
|
133
|
+
if (contentRef.current) {
|
|
134
|
+
forceLayoutRecalculation(contentRef.current);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
dispatch({
|
|
138
|
+
type: "CLOSING_READY"
|
|
139
|
+
});
|
|
64
140
|
});
|
|
65
|
-
|
|
141
|
+
return () => cancelAnimationFrame(frame);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
t5 = [state];
|
|
145
|
+
$[7] = state;
|
|
146
|
+
$[8] = t4;
|
|
147
|
+
$[9] = t5;
|
|
148
|
+
} else {
|
|
149
|
+
t4 = $[8];
|
|
150
|
+
t5 = $[9];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
useLayoutEffect(t4, t5);
|
|
154
|
+
let t6;
|
|
155
|
+
|
|
156
|
+
if ($[10] !== shouldBeOpened) {
|
|
157
|
+
t6 = () => {
|
|
158
|
+
dispatch({
|
|
159
|
+
type: "TRANSITION_END",
|
|
160
|
+
shouldBeOpened
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
$[10] = shouldBeOpened;
|
|
165
|
+
$[11] = t6;
|
|
166
|
+
} else {
|
|
167
|
+
t6 = $[11];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const onAnimationEnd = t6;
|
|
171
|
+
const t7 = state === COLLAPSE_STATES.CLOSING_PREPARE;
|
|
172
|
+
let t8;
|
|
173
|
+
|
|
174
|
+
if ($[12] !== onAnimationEnd || $[13] !== state || $[14] !== t7) {
|
|
175
|
+
t8 = {
|
|
176
|
+
contentRef,
|
|
177
|
+
isStartedClosing: t7,
|
|
178
|
+
onAnimationEnd,
|
|
179
|
+
state
|
|
180
|
+
};
|
|
181
|
+
$[12] = onAnimationEnd;
|
|
182
|
+
$[13] = state;
|
|
183
|
+
$[14] = t7;
|
|
184
|
+
$[15] = t8;
|
|
185
|
+
} else {
|
|
186
|
+
t8 = $[15];
|
|
66
187
|
}
|
|
67
188
|
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
isStartedClosing: isStartedClosingRef.current,
|
|
71
|
-
contentRef
|
|
72
|
-
};
|
|
189
|
+
return t8;
|
|
73
190
|
}
|
|
74
191
|
|
|
75
|
-
export { COLLAPSE_STATES, useCollapseState
|
|
192
|
+
export { COLLAPSE_STATES, useCollapseState };
|