@kanso-labs/kanso-ui 0.44.1 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -7
- package/dist/chip/index.js +24 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +13 -5
- package/dist/chip/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +14 -2
- package/dist/components/app-bar/index.js +36 -7
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +44 -0
- package/dist/components/autocomplete/index.js +44 -0
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +53 -59
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +11 -3
- package/dist/components/card/index.js +23 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +65 -58
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +46 -30
- package/dist/components/chip/index.js +38 -17
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +5 -2
- package/dist/components/chip-group/index.js +8 -2
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +27 -0
- package/dist/components/dialog/index.js +81 -37
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +14 -4
- package/dist/components/form/index.js +6 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +15 -1
- package/dist/components/icon-button/index.js +15 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +4 -0
- package/dist/components/link/index.js +4 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.d.ts +34 -0
- package/dist/components/list/index.js +47 -13
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +34 -1
- package/dist/components/list-detail/index.js +34 -1
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +21 -2
- package/dist/components/list-item/index.js +6 -0
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +6 -3
- package/dist/components/menu/index.js +3 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +4 -0
- package/dist/components/meter/index.js +4 -0
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +14 -2
- package/dist/components/navigation-bar/index.js +14 -2
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -9
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +7 -1
- package/dist/components/number-field/index.js +7 -1
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +15 -1
- package/dist/components/popover/index.js +15 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +8 -1
- package/dist/components/product-icon/index.js +8 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +12 -6
- package/dist/components/progress-indicator/index.js +57 -46
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +23 -14
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +13 -4
- package/dist/components/search-field/index.js +10 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +2 -0
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +31 -6
- package/dist/components/separator/index.js +30 -6
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +96 -37
- package/dist/components/sheet/index.js +420 -136
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +8 -1
- package/dist/components/snackbar/index.js +7 -0
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +21 -5
- package/dist/components/stack/index.js +10 -0
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/switch/index.js +12 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +39 -9
- package/dist/components/text-field/index.js +29 -7
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/tree/index.js +11 -15
- package/dist/components/tree/index.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +6 -3
- package/dist/hooks/useBottomEdge.js.map +1 -1
- package/dist/hooks/useRipple.js +216 -192
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicator/styles.js +7 -4
- package/dist/indicator/styles.js.map +1 -1
- package/dist/mark/styles.js +11 -5
- package/dist/mark/styles.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/row/index.js +90 -62
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +6 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +8 -0
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +135 -114
- package/dist/theme-scope.d.ts +14 -2
- package/dist/theme-scope.js +12 -0
- package/dist/theme-scope.js.map +1 -1
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -211,6 +211,10 @@
|
|
|
211
211
|
border-style: dashed;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
.xng3xce {
|
|
215
|
+
border-style: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
214
218
|
.x1y0btm7 {
|
|
215
219
|
border-style: solid;
|
|
216
220
|
}
|
|
@@ -243,10 +247,6 @@
|
|
|
243
247
|
gap: 24px;
|
|
244
248
|
}
|
|
245
249
|
|
|
246
|
-
.x1jnr06f {
|
|
247
|
-
gap: 4px;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
250
|
.x1r8zjiw {
|
|
251
251
|
gap: calc(48px - var(--x1ww3f7m));
|
|
252
252
|
}
|
|
@@ -416,6 +416,10 @@
|
|
|
416
416
|
padding-block: calc((40px - var(--xol8812)) / 2);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
+
.xs2ltda {
|
|
420
|
+
padding-block: max(0px,calc((var(--x1ww3f7m) - var(--xkj6wu1)) / 2));
|
|
421
|
+
}
|
|
422
|
+
|
|
419
423
|
.xny1cbh {
|
|
420
424
|
padding-block: var(--x196ey9q);
|
|
421
425
|
}
|
|
@@ -706,10 +710,6 @@
|
|
|
706
710
|
animation-name: x15b941j-B;
|
|
707
711
|
}
|
|
708
712
|
|
|
709
|
-
.xu2fq7p {
|
|
710
|
-
animation-name: x17cjob-B;
|
|
711
|
-
}
|
|
712
|
-
|
|
713
713
|
.xz09zy6 {
|
|
714
714
|
animation-name: x17j028-B, x26nhu8-B;
|
|
715
715
|
}
|
|
@@ -1298,6 +1298,10 @@
|
|
|
1298
1298
|
border-start-end-radius: var(--x1s0h5j3);
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
|
+
.x1u81hx7 {
|
|
1302
|
+
border-start-end-radius: var(--x1w5u0jm);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1301
1305
|
.x1pixlao {
|
|
1302
1306
|
border-start-end-radius: var(--x3hih16);
|
|
1303
1307
|
}
|
|
@@ -1326,6 +1330,10 @@
|
|
|
1326
1330
|
border-start-start-radius: var(--x1s0h5j3);
|
|
1327
1331
|
}
|
|
1328
1332
|
|
|
1333
|
+
.x1uop38w {
|
|
1334
|
+
border-start-start-radius: var(--x1w5u0jm);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1329
1337
|
.xyooppx {
|
|
1330
1338
|
border-start-start-radius: var(--x3hih16);
|
|
1331
1339
|
}
|
|
@@ -1466,6 +1474,10 @@
|
|
|
1466
1474
|
color: #0000;
|
|
1467
1475
|
}
|
|
1468
1476
|
|
|
1477
|
+
.x11wi6qo {
|
|
1478
|
+
color: var(--icon-button-standard-color, var(--x28n2pw));
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1469
1481
|
.x4ii1qj {
|
|
1470
1482
|
color: var(--x12p1wyw);
|
|
1471
1483
|
}
|
|
@@ -2002,10 +2014,6 @@
|
|
|
2002
2014
|
grid-column-start: 2;
|
|
2003
2015
|
}
|
|
2004
2016
|
|
|
2005
|
-
.xx9t13c {
|
|
2006
|
-
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
2017
|
.x1rkzygb {
|
|
2010
2018
|
grid-template-columns: auto minmax(0, 1fr);
|
|
2011
2019
|
}
|
|
@@ -2066,6 +2074,10 @@
|
|
|
2066
2074
|
inset-inline-end: var(--x-insetInlineEnd);
|
|
2067
2075
|
}
|
|
2068
2076
|
|
|
2077
|
+
.x5pnq3g {
|
|
2078
|
+
inset-inline-start: -2px;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2069
2081
|
.x1o0tod {
|
|
2070
2082
|
inset-inline-start: 0;
|
|
2071
2083
|
}
|
|
@@ -2142,6 +2154,14 @@
|
|
|
2142
2154
|
justify-items: center;
|
|
2143
2155
|
}
|
|
2144
2156
|
|
|
2157
|
+
.x1qab1bc {
|
|
2158
|
+
justify-self: end;
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
.x1lqcxt8 {
|
|
2162
|
+
justify-self: start;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2145
2165
|
.x1qn8t5l {
|
|
2146
2166
|
letter-spacing: var(--x10nh56i);
|
|
2147
2167
|
}
|
|
@@ -2298,6 +2318,10 @@
|
|
|
2298
2318
|
margin-inline-end: calc(var(--x6borv4) - var(--x3km7fe));
|
|
2299
2319
|
}
|
|
2300
2320
|
|
|
2321
|
+
.x1c9tiao {
|
|
2322
|
+
margin-inline-end: var(--x-marginInlineEnd);
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2301
2325
|
.xdf1gh2 {
|
|
2302
2326
|
margin-inline-end: var(--x3km7fe);
|
|
2303
2327
|
}
|
|
@@ -2318,6 +2342,10 @@
|
|
|
2318
2342
|
margin-inline-start: 0;
|
|
2319
2343
|
}
|
|
2320
2344
|
|
|
2345
|
+
.xdwrcjd {
|
|
2346
|
+
margin-inline-start: 4px;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2321
2349
|
.xvc5jky {
|
|
2322
2350
|
margin-inline-start: auto;
|
|
2323
2351
|
}
|
|
@@ -2355,6 +2383,10 @@
|
|
|
2355
2383
|
opacity: 0;
|
|
2356
2384
|
}
|
|
2357
2385
|
|
|
2386
|
+
.x1hc1fzr {
|
|
2387
|
+
opacity: 1;
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2358
2390
|
.xcl2av {
|
|
2359
2391
|
opacity: var(--x124j18r);
|
|
2360
2392
|
}
|
|
@@ -2375,6 +2407,10 @@
|
|
|
2375
2407
|
outline-color: currentColor;
|
|
2376
2408
|
}
|
|
2377
2409
|
|
|
2410
|
+
.xat36cu {
|
|
2411
|
+
outline-color: var(--x189y34t);
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2378
2414
|
.x1ulcdur {
|
|
2379
2415
|
outline-color: var(--x1balm44);
|
|
2380
2416
|
}
|
|
@@ -2383,6 +2419,10 @@
|
|
|
2383
2419
|
outline-color: var(--x1cjupv7);
|
|
2384
2420
|
}
|
|
2385
2421
|
|
|
2422
|
+
.xnzrtil {
|
|
2423
|
+
outline-color: var(--xn0syi6);
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2386
2426
|
.x2ssjo2 {
|
|
2387
2427
|
outline-offset: -2px;
|
|
2388
2428
|
}
|
|
@@ -2684,6 +2724,18 @@
|
|
|
2684
2724
|
transform: rotate(90deg);
|
|
2685
2725
|
}
|
|
2686
2726
|
|
|
2727
|
+
.x1a33avv {
|
|
2728
|
+
transform: scale(.5);
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
.x1f85oc2 {
|
|
2732
|
+
transform: scale(0);
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
.x3oybdh {
|
|
2736
|
+
transform: scale(1);
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2687
2739
|
.xpk2tj9 {
|
|
2688
2740
|
transform: scaleX(-1);
|
|
2689
2741
|
}
|
|
@@ -2780,10 +2832,6 @@
|
|
|
2780
2832
|
transition-property: background-color, border-color, box-shadow, color;
|
|
2781
2833
|
}
|
|
2782
2834
|
|
|
2783
|
-
.x1eaenvl {
|
|
2784
|
-
transition-property: background-color, border-color, color;
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2787
2835
|
.xts7igz {
|
|
2788
2836
|
transition-property: background-color, border-color;
|
|
2789
2837
|
}
|
|
@@ -2796,6 +2844,10 @@
|
|
|
2796
2844
|
transition-property: background-color, color;
|
|
2797
2845
|
}
|
|
2798
2846
|
|
|
2847
|
+
.xuo13n2 {
|
|
2848
|
+
transition-property: background-color, transform;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2799
2851
|
.x15406qy {
|
|
2800
2852
|
transition-property: background-color;
|
|
2801
2853
|
}
|
|
@@ -2852,10 +2904,6 @@
|
|
|
2852
2904
|
transition-property: inline-size, opacity;
|
|
2853
2905
|
}
|
|
2854
2906
|
|
|
2855
|
-
.x1j4rzew {
|
|
2856
|
-
transition-property: inline-size;
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
2907
|
.x2hifos {
|
|
2860
2908
|
transition-property: inset-inline-start;
|
|
2861
2909
|
}
|
|
@@ -2868,6 +2916,10 @@
|
|
|
2868
2916
|
transition-property: none;
|
|
2869
2917
|
}
|
|
2870
2918
|
|
|
2919
|
+
.x6o7n8i {
|
|
2920
|
+
transition-property: opacity, transform;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2871
2923
|
.x19991ni {
|
|
2872
2924
|
transition-property: opacity;
|
|
2873
2925
|
}
|
|
@@ -2982,6 +3034,10 @@
|
|
|
2982
3034
|
z-index: 900;
|
|
2983
3035
|
}
|
|
2984
3036
|
|
|
3037
|
+
.x10oam47:focus-visible {
|
|
3038
|
+
background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--x124j18r) * 100%),transparent);
|
|
3039
|
+
}
|
|
3040
|
+
|
|
2985
3041
|
.x13aw6e3:focus-within {
|
|
2986
3042
|
background-color: var(--x13o0mym);
|
|
2987
3043
|
}
|
|
@@ -3066,10 +3122,6 @@
|
|
|
3066
3122
|
line-height: var(--x1lrg4gv);
|
|
3067
3123
|
}
|
|
3068
3124
|
|
|
3069
|
-
.x1ioi8j8:dir(rtl) {
|
|
3070
|
-
animation-name: x18x3npg-B;
|
|
3071
|
-
}
|
|
3072
|
-
|
|
3073
3125
|
.x1kbcym6:dir(rtl) {
|
|
3074
3126
|
box-shadow: inset 1px 0 0 0 var(--x7dbk6n);
|
|
3075
3127
|
}
|
|
@@ -3146,6 +3198,10 @@
|
|
|
3146
3198
|
background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--xhaltwz) * 100%),var(--xi1exwt));
|
|
3147
3199
|
}
|
|
3148
3200
|
|
|
3201
|
+
.xpk4wdd:active {
|
|
3202
|
+
box-shadow: none;
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3149
3205
|
.x1g60mc1:active {
|
|
3150
3206
|
box-shadow: var(--xt04dnm);
|
|
3151
3207
|
}
|
|
@@ -3300,6 +3356,10 @@
|
|
|
3300
3356
|
.x1g12otp.x1g12otp {
|
|
3301
3357
|
forced-color-adjust: none;
|
|
3302
3358
|
}
|
|
3359
|
+
|
|
3360
|
+
.x1tbh5bv.x1tbh5bv {
|
|
3361
|
+
opacity: 1;
|
|
3362
|
+
}
|
|
3303
3363
|
}
|
|
3304
3364
|
|
|
3305
3365
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -3376,6 +3436,12 @@
|
|
|
3376
3436
|
background-color: var(--x1xbp8h6);
|
|
3377
3437
|
}
|
|
3378
3438
|
|
|
3439
|
+
@media (hover: hover) {
|
|
3440
|
+
.xkl27de.xkl27de:focus-visible {
|
|
3441
|
+
background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--x124j18r) * 100%),transparent);
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
|
|
3379
3445
|
@media (forced-colors: active) {
|
|
3380
3446
|
.xi9ts3s.xi9ts3s:focus-within {
|
|
3381
3447
|
outline-style: solid;
|
|
@@ -3440,6 +3506,10 @@
|
|
|
3440
3506
|
.xqmo4o3.xqmo4o3:hover {
|
|
3441
3507
|
box-shadow: var(--x14ermby);
|
|
3442
3508
|
}
|
|
3509
|
+
|
|
3510
|
+
.x1jblvwk.x1jblvwk:hover {
|
|
3511
|
+
box-shadow: var(--xt04dnm);
|
|
3512
|
+
}
|
|
3443
3513
|
}
|
|
3444
3514
|
|
|
3445
3515
|
@media (forced-colors: active) {
|
|
@@ -3469,6 +3539,10 @@
|
|
|
3469
3539
|
background-color: color-mix(in srgb,var(--xn0syi6) calc(var(--xhaltwz) * 100%),var(--xi1exwt));
|
|
3470
3540
|
}
|
|
3471
3541
|
|
|
3542
|
+
.x1xzfgx1.x1xzfgx1:active {
|
|
3543
|
+
box-shadow: none;
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3472
3546
|
.x14zlms8.x14zlms8:active {
|
|
3473
3547
|
box-shadow: var(--xt04dnm);
|
|
3474
3548
|
}
|
|
@@ -3818,6 +3892,10 @@
|
|
|
3818
3892
|
max-height: 100%;
|
|
3819
3893
|
}
|
|
3820
3894
|
|
|
3895
|
+
.xv4ka1z {
|
|
3896
|
+
max-height: calc(100dvh - 72px);
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3821
3899
|
.xfwfbzp {
|
|
3822
3900
|
max-height: calc(100dvh * 2 / 3 - var(--x1hfhk6y) - 1px);
|
|
3823
3901
|
}
|
|
@@ -3826,10 +3904,6 @@
|
|
|
3826
3904
|
max-height: inherit;
|
|
3827
3905
|
}
|
|
3828
3906
|
|
|
3829
|
-
.x7ab17h {
|
|
3830
|
-
max-height: none;
|
|
3831
|
-
}
|
|
3832
|
-
|
|
3833
3907
|
.x193iq5w {
|
|
3834
3908
|
max-width: 100%;
|
|
3835
3909
|
}
|
|
@@ -4054,6 +4128,10 @@
|
|
|
4054
4128
|
overflow-y: auto;
|
|
4055
4129
|
}
|
|
4056
4130
|
|
|
4131
|
+
.x1s73dr8 {
|
|
4132
|
+
overflow-y: clip;
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4057
4135
|
.x10wlt62 {
|
|
4058
4136
|
overflow-y: hidden;
|
|
4059
4137
|
}
|
|
@@ -4076,6 +4154,10 @@
|
|
|
4076
4154
|
padding-bottom: 0;
|
|
4077
4155
|
}
|
|
4078
4156
|
|
|
4157
|
+
.x11wnguw {
|
|
4158
|
+
padding-bottom: calc(var(--x3km7fe) - max(0px,calc((var(--x1ww3f7m) - var(--xkj6wu1)) / 2)));
|
|
4159
|
+
}
|
|
4160
|
+
|
|
4079
4161
|
.x1u7mh7p {
|
|
4080
4162
|
padding-bottom: calc(var(--xod9tvo) + env(safe-area-inset-bottom, 0px));
|
|
4081
4163
|
}
|
|
@@ -4100,14 +4182,14 @@
|
|
|
4100
4182
|
padding-bottom: var(--xod9tvo);
|
|
4101
4183
|
}
|
|
4102
4184
|
|
|
4103
|
-
.x1uhho1l {
|
|
4104
|
-
padding-left: 0;
|
|
4105
|
-
}
|
|
4106
|
-
|
|
4107
4185
|
.xbpsoft {
|
|
4108
4186
|
padding-left: calc(var(--xod9tvo) + env(safe-area-inset-left, 0px));
|
|
4109
4187
|
}
|
|
4110
4188
|
|
|
4189
|
+
.x196z7tn {
|
|
4190
|
+
padding-left: env(safe-area-inset-left, 0px);
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4111
4193
|
.xq5vm52 {
|
|
4112
4194
|
padding-right: calc(var(--xod9tvo) + env(safe-area-inset-right, 0px));
|
|
4113
4195
|
}
|
|
@@ -4124,6 +4206,10 @@
|
|
|
4124
4206
|
padding-top: 44px;
|
|
4125
4207
|
}
|
|
4126
4208
|
|
|
4209
|
+
.x1837goc {
|
|
4210
|
+
padding-top: calc(var(--x196ey9q) - max(0px,calc((var(--x1ww3f7m) - var(--xkj6wu1)) / 2)));
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4127
4213
|
.x1mrd0q {
|
|
4128
4214
|
padding-top: env(safe-area-inset-top, 0px);
|
|
4129
4215
|
}
|
|
@@ -4394,14 +4480,6 @@
|
|
|
4394
4480
|
}
|
|
4395
4481
|
}
|
|
4396
4482
|
|
|
4397
|
-
.x1lodr2j:dir(rtl) {
|
|
4398
|
-
padding-left: env(safe-area-inset-left, 0px);
|
|
4399
|
-
}
|
|
4400
|
-
|
|
4401
|
-
.xg4bq00:dir(rtl) {
|
|
4402
|
-
padding-right: 0;
|
|
4403
|
-
}
|
|
4404
|
-
|
|
4405
4483
|
.x1g31smg:first-child {
|
|
4406
4484
|
border-top-width: 0;
|
|
4407
4485
|
}
|
|
@@ -4506,7 +4584,15 @@
|
|
|
4506
4584
|
.x1nouyz5.x1nouyz5 {
|
|
4507
4585
|
padding-block: 0;
|
|
4508
4586
|
}
|
|
4587
|
+
}
|
|
4588
|
+
|
|
4589
|
+
@media (width < 600px) {
|
|
4590
|
+
.xa4amcs.xa4amcs {
|
|
4591
|
+
padding-block: 0;
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4509
4594
|
|
|
4595
|
+
@media (width >= 600px) {
|
|
4510
4596
|
.xze1m75.xze1m75 {
|
|
4511
4597
|
padding-inline: var(--x3km7fe);
|
|
4512
4598
|
}
|
|
@@ -4541,10 +4627,6 @@
|
|
|
4541
4627
|
}
|
|
4542
4628
|
|
|
4543
4629
|
@media (width < 600px) {
|
|
4544
|
-
.x18ihq2d.x18ihq2d {
|
|
4545
|
-
animation-name: x15b941j-B;
|
|
4546
|
-
}
|
|
4547
|
-
|
|
4548
4630
|
.x1ebxanj.x1ebxanj {
|
|
4549
4631
|
animation-name: x1itx4s0-B;
|
|
4550
4632
|
}
|
|
@@ -4585,18 +4667,6 @@
|
|
|
4585
4667
|
}
|
|
4586
4668
|
|
|
4587
4669
|
@media (width < 600px) {
|
|
4588
|
-
.xb0nsol.xb0nsol {
|
|
4589
|
-
border-end-start-radius: var(--x1lckk6t);
|
|
4590
|
-
}
|
|
4591
|
-
|
|
4592
|
-
.xys6ro8.xys6ro8 {
|
|
4593
|
-
border-start-end-radius: var(--x1w5u0jm);
|
|
4594
|
-
}
|
|
4595
|
-
|
|
4596
|
-
.x9t1vth.x9t1vth {
|
|
4597
|
-
border-start-start-radius: var(--x1w5u0jm);
|
|
4598
|
-
}
|
|
4599
|
-
|
|
4600
4670
|
.xzvmenf.xzvmenf {
|
|
4601
4671
|
box-shadow: none;
|
|
4602
4672
|
}
|
|
@@ -4745,10 +4815,6 @@
|
|
|
4745
4815
|
inset-inline-start: 0 !important;
|
|
4746
4816
|
}
|
|
4747
4817
|
|
|
4748
|
-
.x1upgybz.x1upgybz {
|
|
4749
|
-
inset-inline-start: 0;
|
|
4750
|
-
}
|
|
4751
|
-
|
|
4752
4818
|
.x1khanjg.x1khanjg {
|
|
4753
4819
|
letter-spacing: var(--xt8l743);
|
|
4754
4820
|
}
|
|
@@ -4788,12 +4854,6 @@
|
|
|
4788
4854
|
.xa9fysw.xa9fysw {
|
|
4789
4855
|
transform-origin: center;
|
|
4790
4856
|
}
|
|
4791
|
-
|
|
4792
|
-
@media (forced-colors: active) {
|
|
4793
|
-
.x1cfajip.x1cfajip.x1cfajip {
|
|
4794
|
-
border-inline-start-style: none;
|
|
4795
|
-
}
|
|
4796
|
-
}
|
|
4797
4857
|
}
|
|
4798
4858
|
}
|
|
4799
4859
|
|
|
@@ -4917,10 +4977,6 @@
|
|
|
4917
4977
|
max-height: calc(100dvh - 2 * var(--x3km7fe)) !important;
|
|
4918
4978
|
}
|
|
4919
4979
|
|
|
4920
|
-
.x11ijow0.x11ijow0 {
|
|
4921
|
-
max-height: calc(100dvh - 72px);
|
|
4922
|
-
}
|
|
4923
|
-
|
|
4924
4980
|
.x10iheve.x10iheve {
|
|
4925
4981
|
max-height: none !important;
|
|
4926
4982
|
}
|
|
@@ -4973,10 +5029,6 @@
|
|
|
4973
5029
|
padding-right: env(safe-area-inset-right, 0px);
|
|
4974
5030
|
}
|
|
4975
5031
|
|
|
4976
|
-
.x5ubeis.x5ubeis {
|
|
4977
|
-
padding-top: 0;
|
|
4978
|
-
}
|
|
4979
|
-
|
|
4980
5032
|
.xg8iv3o.xg8iv3o {
|
|
4981
5033
|
padding-top: env(safe-area-inset-top, 0px);
|
|
4982
5034
|
}
|
|
@@ -4992,10 +5044,6 @@
|
|
|
4992
5044
|
.xbvrusa.xbvrusa {
|
|
4993
5045
|
top: 0 !important;
|
|
4994
5046
|
}
|
|
4995
|
-
|
|
4996
|
-
.xmpip4z.xmpip4z {
|
|
4997
|
-
top: auto;
|
|
4998
|
-
}
|
|
4999
5047
|
}
|
|
5000
5048
|
|
|
5001
5049
|
@media (width >= 600px) {
|
|
@@ -5005,10 +5053,6 @@
|
|
|
5005
5053
|
}
|
|
5006
5054
|
|
|
5007
5055
|
@media (width < 600px) {
|
|
5008
|
-
.xwvxfow.xwvxfow {
|
|
5009
|
-
width: 100%;
|
|
5010
|
-
}
|
|
5011
|
-
|
|
5012
5056
|
.x14gilbs.x14gilbs {
|
|
5013
5057
|
width: 100vw;
|
|
5014
5058
|
}
|
|
@@ -5023,14 +5067,6 @@
|
|
|
5023
5067
|
border-style: dashed;
|
|
5024
5068
|
}
|
|
5025
5069
|
}
|
|
5026
|
-
|
|
5027
|
-
@media (width < 600px) {
|
|
5028
|
-
@media (forced-colors: active) {
|
|
5029
|
-
.xuz63mn.xuz63mn.xuz63mn {
|
|
5030
|
-
border-top-style: solid;
|
|
5031
|
-
}
|
|
5032
|
-
}
|
|
5033
|
-
}
|
|
5034
5070
|
}
|
|
5035
5071
|
|
|
5036
5072
|
@layer kanso.priority9 {
|
|
@@ -5179,6 +5215,11 @@
|
|
|
5179
5215
|
inherits: false
|
|
5180
5216
|
}
|
|
5181
5217
|
|
|
5218
|
+
@property --x-marginInlineEnd {
|
|
5219
|
+
syntax: "*";
|
|
5220
|
+
inherits: false
|
|
5221
|
+
}
|
|
5222
|
+
|
|
5182
5223
|
@property --x-maskImage {
|
|
5183
5224
|
syntax: "*";
|
|
5184
5225
|
inherits: false
|
|
@@ -5309,30 +5350,6 @@
|
|
|
5309
5350
|
}
|
|
5310
5351
|
}
|
|
5311
5352
|
|
|
5312
|
-
@keyframes x17cjob-B {
|
|
5313
|
-
from {
|
|
5314
|
-
opacity: 0;
|
|
5315
|
-
transform: translateX(100%);
|
|
5316
|
-
}
|
|
5317
|
-
|
|
5318
|
-
to {
|
|
5319
|
-
opacity: 1;
|
|
5320
|
-
transform: translateX(0);
|
|
5321
|
-
}
|
|
5322
|
-
}
|
|
5323
|
-
|
|
5324
|
-
@keyframes x18x3npg-B {
|
|
5325
|
-
from {
|
|
5326
|
-
opacity: 0;
|
|
5327
|
-
transform: translateX(-100%);
|
|
5328
|
-
}
|
|
5329
|
-
|
|
5330
|
-
to {
|
|
5331
|
-
opacity: 1;
|
|
5332
|
-
transform: translateX(0);
|
|
5333
|
-
}
|
|
5334
|
-
}
|
|
5335
|
-
|
|
5336
5353
|
@keyframes x15b941j-B {
|
|
5337
5354
|
from {
|
|
5338
5355
|
opacity: 0;
|
|
@@ -6079,6 +6096,10 @@
|
|
|
6079
6096
|
--x1mnnhxz: #efb8c8;
|
|
6080
6097
|
}
|
|
6081
6098
|
|
|
6099
|
+
.x155k8fu {
|
|
6100
|
+
--icon-button-standard-color: var(--xn0syi6);
|
|
6101
|
+
}
|
|
6102
|
+
|
|
6082
6103
|
.x111hk5a {
|
|
6083
6104
|
--segment-indicator-radius-end: var(--x1lckk6t);
|
|
6084
6105
|
}
|
package/dist/theme-scope.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ type ThemeScopeProps = RenderComponentProps<'div'> & {
|
|
|
7
7
|
* reader's OS asks for. A pinned scope paints its own surface and text in
|
|
8
8
|
* that scheme and sets `color-scheme` for the native controls inside, so
|
|
9
9
|
* it reads on any page. Left unset, the scope paints nothing and keeps the
|
|
10
|
-
* scheme around it: the one an enclosing scope or
|
|
11
|
-
* pins, or the OS's.
|
|
10
|
+
* scheme around it: the one an enclosing scope or a `colorScheme` class
|
|
11
|
+
* pins, on the `<html>` element or nearer, or else the OS's.
|
|
12
12
|
*/
|
|
13
13
|
scheme?: 'dark' | 'light' | undefined;
|
|
14
14
|
/**
|
|
@@ -52,6 +52,18 @@ type ThemeScopeProps = RenderComponentProps<'div'> & {
|
|
|
52
52
|
* `<div>` added inside the scope's element, so an element whose content is
|
|
53
53
|
* restricted — a list, whose children have to be list items, a paragraph,
|
|
54
54
|
* or a part of a table — is not a scope: put the scope around it instead.
|
|
55
|
+
*
|
|
56
|
+
* That container comes after whatever the scope renders, and it has no box,
|
|
57
|
+
* so layout never sees it, but selectors do. Inside the scope the last
|
|
58
|
+
* element the call site rendered is not `:last-child` and is counted wrong
|
|
59
|
+
* by `:nth-last-child()`, a lone child is not `:only-child`, and a scope
|
|
60
|
+
* with nothing in it is not `:empty`. Key a rule like that on something of
|
|
61
|
+
* the call site's own, such as a class, or put the scope around the element
|
|
62
|
+
* whose children it counts.
|
|
63
|
+
*
|
|
64
|
+
* What reaches a scope from around it is the scheme and the `--kui-*`
|
|
65
|
+
* properties. It resolves every token again from those two, so a theme
|
|
66
|
+
* applied around it in any other way stops at its edge.
|
|
55
67
|
*/
|
|
56
68
|
declare function ThemeScope({ children, render, scheme, theme, ...props }: ThemeScopeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
57
69
|
//#endregion
|
package/dist/theme-scope.js
CHANGED
|
@@ -50,6 +50,18 @@ const containers = /* @__PURE__ */ new WeakMap();
|
|
|
50
50
|
* `<div>` added inside the scope's element, so an element whose content is
|
|
51
51
|
* restricted — a list, whose children have to be list items, a paragraph,
|
|
52
52
|
* or a part of a table — is not a scope: put the scope around it instead.
|
|
53
|
+
*
|
|
54
|
+
* That container comes after whatever the scope renders, and it has no box,
|
|
55
|
+
* so layout never sees it, but selectors do. Inside the scope the last
|
|
56
|
+
* element the call site rendered is not `:last-child` and is counted wrong
|
|
57
|
+
* by `:nth-last-child()`, a lone child is not `:only-child`, and a scope
|
|
58
|
+
* with nothing in it is not `:empty`. Key a rule like that on something of
|
|
59
|
+
* the call site's own, such as a class, or put the scope around the element
|
|
60
|
+
* whose children it counts.
|
|
61
|
+
*
|
|
62
|
+
* What reaches a scope from around it is the scheme and the `--kui-*`
|
|
63
|
+
* properties. It resolves every token again from those two, so a theme
|
|
64
|
+
* applied around it in any other way stops at its edge.
|
|
53
65
|
*/
|
|
54
66
|
function ThemeScope(t0) {
|
|
55
67
|
const $ = c(29);
|
package/dist/theme-scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-scope.js","names":["c","_c","stylex","useCallback","useMemo","useState","UNSAFE_PortalProvider","PortalProvider","RenderComponentProps","KuiTheme","mergeRefs","useRender","mergeStyles","pinnedScheme","colorDefaultsDarkTheme","colorDefaultsLightTheme","tokenScope","styles","root","kB7OPa","$$css","schemes","dark","light","ThemeScopeProps","scheme","theme","containerClassName","className","containers","WeakMap","Element","HTMLDivElement","ThemeScope","t0","$","children","props","render","container","setContainer","t1","getContainer","t2","Symbol","for","scope","made","get","undefined","ownerDocument","createElement","append","set","attach","t3","ref","t4","t5","t6","style","t7","t8","defaultTagName","_c","props","stylex.props","PortalProvider"],"sources":["../src/theme-scope.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useState } from 'react';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria/PortalProvider';\nimport type { RenderComponentProps } from './render/useRender';\nimport type { KuiTheme } from './tokens/theme';\nimport { mergeRefs } from './render/ref';\nimport { useRender } from './render/useRender';\nimport { mergeStyles } from './styles/merge';\nimport { pinnedScheme } from './styles/scheme';\nimport { colorDefaultsDarkTheme, colorDefaultsLightTheme, tokenScope } from './tokens/design.tokens.stylex';\n\n// The component form of `themeScope` and `colorScheme` in ./color-scheme.ts:\n// the same classes, on an element of its own, plus the one thing a class\n// cannot do — take the overlays along. A pinned scheme paints the scope's\n// surface and sets its `color-scheme` too; see src/styles/scheme.ts.\n//\n// React Aria portals every overlay to the end of `<body>` unless a portal\n// provider names another container, so a popover, a sheet, a tooltip or a\n// toast opened inside a themed element renders outside it, and keeps the\n// tokens of the page. The container here is inside the scope's own element,\n// which is what makes the overlays inherit whatever the scope inherits: its\n// scheme, and the `--kui-*` overrides declared on it or on any element around\n// it. A container appended to the body and given the scope's classes would\n// carry the classes alone, losing every override declared above the scope.\n//\n// It is appended to the scope's element once that element is in the document,\n// rather than rendered as one of its children. A rendered `<div>` was a child\n// of whatever the scope rendered as, so a scope rendered as a `<p>` drew\n// React's nesting error and a hydration warning, and the server's markup held\n// a `<div>` inside it. Appended, it is in neither React's tree nor the\n// server's markup, and it is there before anything can open into it.\n//\n// `display: contents` keeps that container out of the layout, so a scope\n// that is a grid or a flex container gains no item and no gap from it. React\n// Aria positions an overlay against the overlay's own containing block rather\n// than the container's box, so a container with no box of its own changes\n// nothing about where a popover lands.\nconst styles = {\n root: {\n kB7OPa: \"x9f619\",\n $$css: true\n }\n};\nconst schemes = {\n dark: colorDefaultsDarkTheme,\n light: colorDefaultsLightTheme\n};\ntype ThemeScopeProps = RenderComponentProps<'div'> & {\n /**\n * Pins the scope to the library's light or dark scheme, whatever the\n * reader's OS asks for. A pinned scope paints its own surface and text in\n * that scheme and sets `color-scheme` for the native controls inside, so\n * it reads on any page. Left unset, the scope paints nothing and keeps the\n * scheme around it: the one an enclosing scope or the `<html>` element\n * pins, or the OS's.\n */\n scheme?: 'dark' | 'light' | undefined;\n /**\n * `--kui-*` overrides for everything inside, as a map of the custom\n * properties `tokens.css` lists to CSS values. The scope declares them on\n * its own element, as an override in `style` would be, with `style` winning\n * where the two set the same property.\n *\n * The values hold for both schemes. To give light and dark a value each,\n * keep two maps and hand the scope the one for the scheme in use.\n */\n theme?: KuiTheme | undefined;\n};\n\n// The container's class, the one thing it carries: it is made with\n// `createElement`, which takes no props.\nconst containerClassName = {\n className: \"x9f619 xjp7ctv\"\n}.className ?? '';\n\n// The container made for each scope's element. A ref attaches again whenever\n// the call site hands a ref of a new identity, and a new container each time\n// would move every open overlay into it, which remounts them. So the one an\n// element already holds is kept as it is — not even appended again, since\n// moving a node blurs whatever inside it has focus — and a new one is made\n// only for a new element, as when `render` changes the tag. React removes an\n// old element with its container in it, and the map lets both go.\nconst containers = new WeakMap<Element, HTMLDivElement>();\n\n/**\n * Themes what is inside it, overlays included.\n *\n * A `--kui-*` override declared on the scope — through `theme`, `className`\n * or `style` — or on any element around it reaches every component inside,\n * where on any element but `<html>` it would otherwise reach none, since the\n * tokens resolve once on `:root`. Popovers, sheets, tooltips and toasts\n * opened inside portal into the scope rather than into the body, so they\n * follow it too. The rest of the page keeps its own tokens.\n *\n * ```tsx\n * const accent: KuiTheme = { '--kui-color-primary': '#7d5260' }\n *\n * <ThemeScope scheme=\"dark\" theme={accent}>\n * <Select label=\"Label\">…</Select>\n * </ThemeScope>\n * ```\n *\n * Because the overlays render inside the scope, an ancestor that confines\n * its descendants confines them too: a `transform` or a `filter` makes a\n * sheet's fixed scrim cover that ancestor rather than the viewport, and\n * `overflow: hidden` with a position clips a popover. Put the scope around\n * such an element rather than inside it.\n *\n * `render` swaps the element, for a scope that should be a `<main>`, a\n * `<section>`, an `<article>`, or the `<body>` itself — any element that\n * takes flow content, as a `<div>` does. The overlays' container is a\n * `<div>` added inside the scope's element, so an element whose content is\n * restricted — a list, whose children have to be list items, a paragraph,\n * or a part of a table — is not a scope: put the scope around it instead.\n */\nfunction ThemeScope({\n children,\n render,\n scheme,\n theme,\n ...props\n}: ThemeScopeProps) {\n // State rather than a ref, so the overlays render again once the container\n // exists. React Aria renders an overlay nowhere while `getContainer` hands\n // back nothing, and one open on the scope's first render would otherwise\n // stay that way.\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const getContainer = useCallback(() => container, [container]);\n const attach = useCallback((scope: HTMLDivElement | null) => {\n if (scope === null) {\n return;\n }\n let made = containers.get(scope);\n if (made === undefined) {\n made = scope.ownerDocument.createElement('div');\n made.className = containerClassName;\n scope.append(made);\n containers.set(scope, made);\n }\n setContainer(made);\n }, []);\n // The call site's ref lands on the same element. Read off `props` rather\n // than destructured, as `useRender` reads it, so the compiler sees a prop\n // holding still rather than a ref read during render.\n const ref = useMemo(() => mergeRefs(attach, props.ref ?? undefined), [attach, props.ref]);\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n ref,\n ...mergeStyles(stylex.props(styles.root, tokenScope, scheme !== undefined && schemes[scheme], scheme !== undefined && pinnedScheme[scheme]), theme === undefined ? props : {\n ...props,\n style: {\n ...theme,\n ...props.style\n }\n }),\n children: <PortalProvider getContainer={getContainer}>{children}</PortalProvider>\n },\n render\n });\n}\nexport type { KuiTheme } from './tokens/theme';\nexport type { ThemeScopeProps };\nexport { ThemeScope };"],"mappings":";;;;;;;;;;;;AAuCA,MAAMiB,SAAS,EACbC,MAAM;CACJC,QAAQ;CACRC,OAAO;AACT,EACF;AACA,MAAMC,UAAU;CACdC,MAAMR;CACNS,OAAOR;AACT;AAyBA,MAAMY,qBAAqB,EACzBC,WAAW,iBACb,EAAEA,aAAa;AASf,MAAMC,6BAAa,IAAIC,QAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCxD,SAAAG,WAAAC,IAAA;CAAA,MAAAC,IAAAlC,EAAA,EAAA;CAAA,IAAAmC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAb;CAAA,IAAAC;CAAA,IAA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vB;EAEH;EAACH,EAAA,MAAAG;EAAAH,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;CAAA,OAAAA,KAAA3B,EAAA;CAAA,OAfMxB,UAAUmD,EAehB;AAAC"}
|
|
1
|
+
{"version":3,"file":"theme-scope.js","names":["c","_c","stylex","useCallback","useMemo","useState","UNSAFE_PortalProvider","PortalProvider","RenderComponentProps","KuiTheme","mergeRefs","useRender","mergeStyles","pinnedScheme","colorDefaultsDarkTheme","colorDefaultsLightTheme","tokenScope","styles","root","kB7OPa","$$css","schemes","dark","light","ThemeScopeProps","scheme","theme","containerClassName","className","containers","WeakMap","Element","HTMLDivElement","ThemeScope","t0","$","children","props","render","container","setContainer","t1","getContainer","t2","Symbol","for","scope","made","get","undefined","ownerDocument","createElement","append","set","attach","t3","ref","t4","t5","t6","style","t7","t8","defaultTagName","_c","props","stylex.props","PortalProvider"],"sources":["../src/theme-scope.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useMemo, useState } from 'react';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria/PortalProvider';\nimport type { RenderComponentProps } from './render/useRender';\nimport type { KuiTheme } from './tokens/theme';\nimport { mergeRefs } from './render/ref';\nimport { useRender } from './render/useRender';\nimport { mergeStyles } from './styles/merge';\nimport { pinnedScheme } from './styles/scheme';\nimport { colorDefaultsDarkTheme, colorDefaultsLightTheme, tokenScope } from './tokens/design.tokens.stylex';\n\n// The component form of `themeScope` and `colorScheme` in ./color-scheme.ts:\n// the same classes, on an element of its own, plus the one thing a class\n// cannot do — take the overlays along. A pinned scheme paints the scope's\n// surface and sets its `color-scheme` too; see src/styles/scheme.ts.\n//\n// React Aria portals every overlay to the end of `<body>` unless a portal\n// provider names another container, so a popover, a sheet, a tooltip or a\n// toast opened inside a themed element renders outside it, and keeps the\n// tokens of the page. The container here is inside the scope's own element,\n// which is what makes the overlays inherit whatever the scope inherits: its\n// scheme, and the `--kui-*` overrides declared on it or on any element around\n// it. A container appended to the body and given the scope's classes would\n// carry the classes alone, losing every override declared above the scope.\n//\n// It is appended to the scope's element once that element is in the document,\n// rather than rendered as one of its children. A rendered `<div>` was a child\n// of whatever the scope rendered as, so a scope rendered as a `<p>` drew\n// React's nesting error and a hydration warning, and the server's markup held\n// a `<div>` inside it. Appended, it is in neither React's tree nor the\n// server's markup, and it is there before anything can open into it.\n//\n// `display: contents` keeps that container out of the layout, so a scope\n// that is a grid or a flex container gains no item and no gap from it. React\n// Aria positions an overlay against the overlay's own containing block rather\n// than the container's box, so a container with no box of its own changes\n// nothing about where a popover lands. It is still an element, so a selector\n// that counts the scope's children counts it; the description below says\n// what that changes for a call site.\nconst styles = {\n root: {\n kB7OPa: \"x9f619\",\n $$css: true\n }\n};\nconst schemes = {\n dark: colorDefaultsDarkTheme,\n light: colorDefaultsLightTheme\n};\ntype ThemeScopeProps = RenderComponentProps<'div'> & {\n /**\n * Pins the scope to the library's light or dark scheme, whatever the\n * reader's OS asks for. A pinned scope paints its own surface and text in\n * that scheme and sets `color-scheme` for the native controls inside, so\n * it reads on any page. Left unset, the scope paints nothing and keeps the\n * scheme around it: the one an enclosing scope or a `colorScheme` class\n * pins, on the `<html>` element or nearer, or else the OS's.\n */\n scheme?: 'dark' | 'light' | undefined;\n /**\n * `--kui-*` overrides for everything inside, as a map of the custom\n * properties `tokens.css` lists to CSS values. The scope declares them on\n * its own element, as an override in `style` would be, with `style` winning\n * where the two set the same property.\n *\n * The values hold for both schemes. To give light and dark a value each,\n * keep two maps and hand the scope the one for the scheme in use.\n */\n theme?: KuiTheme | undefined;\n};\n\n// The container's class, the one thing it carries: it is made with\n// `createElement`, which takes no props.\nconst containerClassName = {\n className: \"x9f619 xjp7ctv\"\n}.className ?? '';\n\n// The container made for each scope's element. A ref attaches again whenever\n// the call site hands a ref of a new identity, and a new container each time\n// would move every open overlay into it, which remounts them. So the one an\n// element already holds is kept as it is — not even appended again, since\n// moving a node blurs whatever inside it has focus — and a new one is made\n// only for a new element, as when `render` changes the tag. React removes an\n// old element with its container in it, and the map lets both go.\nconst containers = new WeakMap<Element, HTMLDivElement>();\n\n/**\n * Themes what is inside it, overlays included.\n *\n * A `--kui-*` override declared on the scope — through `theme`, `className`\n * or `style` — or on any element around it reaches every component inside,\n * where on any element but `<html>` it would otherwise reach none, since the\n * tokens resolve once on `:root`. Popovers, sheets, tooltips and toasts\n * opened inside portal into the scope rather than into the body, so they\n * follow it too. The rest of the page keeps its own tokens.\n *\n * ```tsx\n * const accent: KuiTheme = { '--kui-color-primary': '#7d5260' }\n *\n * <ThemeScope scheme=\"dark\" theme={accent}>\n * <Select label=\"Label\">…</Select>\n * </ThemeScope>\n * ```\n *\n * Because the overlays render inside the scope, an ancestor that confines\n * its descendants confines them too: a `transform` or a `filter` makes a\n * sheet's fixed scrim cover that ancestor rather than the viewport, and\n * `overflow: hidden` with a position clips a popover. Put the scope around\n * such an element rather than inside it.\n *\n * `render` swaps the element, for a scope that should be a `<main>`, a\n * `<section>`, an `<article>`, or the `<body>` itself — any element that\n * takes flow content, as a `<div>` does. The overlays' container is a\n * `<div>` added inside the scope's element, so an element whose content is\n * restricted — a list, whose children have to be list items, a paragraph,\n * or a part of a table — is not a scope: put the scope around it instead.\n *\n * That container comes after whatever the scope renders, and it has no box,\n * so layout never sees it, but selectors do. Inside the scope the last\n * element the call site rendered is not `:last-child` and is counted wrong\n * by `:nth-last-child()`, a lone child is not `:only-child`, and a scope\n * with nothing in it is not `:empty`. Key a rule like that on something of\n * the call site's own, such as a class, or put the scope around the element\n * whose children it counts.\n *\n * What reaches a scope from around it is the scheme and the `--kui-*`\n * properties. It resolves every token again from those two, so a theme\n * applied around it in any other way stops at its edge.\n */\nfunction ThemeScope({\n children,\n render,\n scheme,\n theme,\n ...props\n}: ThemeScopeProps) {\n // State rather than a ref, so the overlays render again once the container\n // exists. React Aria renders an overlay nowhere while `getContainer` hands\n // back nothing, and one open on the scope's first render would otherwise\n // stay that way.\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const getContainer = useCallback(() => container, [container]);\n const attach = useCallback((scope: HTMLDivElement | null) => {\n if (scope === null) {\n return;\n }\n let made = containers.get(scope);\n if (made === undefined) {\n made = scope.ownerDocument.createElement('div');\n made.className = containerClassName;\n scope.append(made);\n containers.set(scope, made);\n }\n setContainer(made);\n }, []);\n // The call site's ref lands on the same element. Read off `props` rather\n // than destructured, as `useRender` reads it, so the compiler sees a prop\n // holding still rather than a ref read during render.\n const ref = useMemo(() => mergeRefs(attach, props.ref ?? undefined), [attach, props.ref]);\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n ref,\n ...mergeStyles(stylex.props(styles.root, tokenScope, scheme !== undefined && schemes[scheme], scheme !== undefined && pinnedScheme[scheme]), theme === undefined ? props : {\n ...props,\n style: {\n ...theme,\n ...props.style\n }\n }),\n children: <PortalProvider getContainer={getContainer}>{children}</PortalProvider>\n },\n render\n });\n}\nexport type { KuiTheme } from './tokens/theme';\nexport type { ThemeScopeProps };\nexport { ThemeScope };"],"mappings":";;;;;;;;;;;;AAyCA,MAAMiB,SAAS,EACbC,MAAM;CACJC,QAAQ;CACRC,OAAO;AACT,EACF;AACA,MAAMC,UAAU;CACdC,MAAMR;CACNS,OAAOR;AACT;AAyBA,MAAMY,qBAAqB,EACzBC,WAAW,iBACb,EAAEA,aAAa;AASf,MAAMC,6BAAa,IAAIC,QAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CxD,SAAAG,WAAAC,IAAA;CAAA,MAAAC,IAAAlC,EAAA,EAAA;CAAA,IAAAmC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAb;CAAA,IAAAC;CAAA,IAAAS,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAE,UAAAE,QAAAb,QAAAC,OAAA,GAAAW,WAAAH;EAMFC,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,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
|
1
1
|
{
|
|
2
2
|
"name": "@kanso-labs/kanso-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "A React component library built on React Aria Components primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@commitlint/cli": "21.2.4",
|
|
86
86
|
"@commitlint/config-conventional": "21.2.4",
|
|
87
87
|
"@eslint/js": "10.0.1",
|
|
88
|
-
"@kanso-labs/unplugin-style-dictionary": "0.10.
|
|
88
|
+
"@kanso-labs/unplugin-style-dictionary": "0.10.37",
|
|
89
89
|
"@microsoft/api-extractor": "7.59.4",
|
|
90
90
|
"@rolldown/plugin-babel": "0.2.4",
|
|
91
91
|
"@storybook/addon-a11y": "10.6.3",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"tsdown": "0.23.1",
|
|
129
129
|
"typescript": "6.0.3",
|
|
130
130
|
"typescript-eslint": "8.72.0",
|
|
131
|
-
"vite": "8.3.
|
|
131
|
+
"vite": "8.3.5",
|
|
132
132
|
"vitest": "5.0.5"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|