@machinerd/js-module 0.5.0 → 0.5.2
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/dist/providers/index.d.cts +2 -2
- package/dist/providers/index.d.mts +2 -2
- package/dist/styles/index.css +157 -2
- package/dist/ui/index.d.cts +21 -21
- package/dist/ui/index.d.mts +10 -10
- package/dist/ui-client/index.cjs +1 -1
- package/dist/ui-client/index.d.cts +20 -9
- package/dist/ui-client/index.d.mts +21 -10
- package/dist/ui-client/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ApiConfig, t as ApiClient } from "../index-CH1uVFqx.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/providers/api-client/api-client.d.ts
|
|
5
5
|
declare function ApiClientProvider({
|
|
@@ -8,7 +8,7 @@ declare function ApiClientProvider({
|
|
|
8
8
|
}: {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
config: ApiConfig;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
12
12
|
declare function useApiClient(): ApiClient;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ApiClientProvider, useApiClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ApiConfig, t as ApiClient } from "../index-D6Jzsxc-.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/providers/api-client/api-client.d.ts
|
|
5
5
|
declare function ApiClientProvider({
|
|
@@ -8,7 +8,7 @@ declare function ApiClientProvider({
|
|
|
8
8
|
}: {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
config: ApiConfig;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
12
12
|
declare function useApiClient(): ApiClient;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ApiClientProvider, useApiClient };
|
package/dist/styles/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.
|
|
1
|
+
/*! tailwindcss v4.2.3 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
--komc-color-neutral-300: oklch(87% 0 0);
|
|
24
24
|
--komc-color-neutral-500: oklch(55.6% 0 0);
|
|
25
25
|
--komc-color-neutral-600: oklch(43.9% 0 0);
|
|
26
|
+
--komc-color-neutral-700: oklch(37.1% 0 0);
|
|
27
|
+
--komc-color-neutral-800: oklch(26.9% 0 0);
|
|
26
28
|
--komc-color-black: #000;
|
|
27
29
|
--komc-color-white: #fff;
|
|
28
30
|
--komc-spacing: 0.25rem;
|
|
@@ -46,6 +48,7 @@
|
|
|
46
48
|
--komc-font-weight-bold: 700;
|
|
47
49
|
--komc-font-weight-extrabold: 800;
|
|
48
50
|
--komc-font-weight-black: 900;
|
|
51
|
+
--komc-leading-relaxed: 1.625;
|
|
49
52
|
--komc-radius-sm: 0.25rem;
|
|
50
53
|
--komc-radius-md: 0.375rem;
|
|
51
54
|
--komc-radius-lg: 0.5rem;
|
|
@@ -59,6 +62,7 @@
|
|
|
59
62
|
--komc-drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
|
|
60
63
|
--komc-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
61
64
|
--komc-animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
65
|
+
--komc-blur-sm: 8px;
|
|
62
66
|
--komc-default-transition-duration: 150ms;
|
|
63
67
|
--komc-default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
64
68
|
--komc-color-night-700: #2c5cb7;
|
|
@@ -84,6 +88,9 @@
|
|
|
84
88
|
.komc\:relative {
|
|
85
89
|
position: relative;
|
|
86
90
|
}
|
|
91
|
+
.komc\:sticky {
|
|
92
|
+
position: sticky;
|
|
93
|
+
}
|
|
87
94
|
.komc\:inset-0 {
|
|
88
95
|
inset: calc(var(--komc-spacing) * 0);
|
|
89
96
|
}
|
|
@@ -114,6 +121,9 @@
|
|
|
114
121
|
.komc\:left-5 {
|
|
115
122
|
left: calc(var(--komc-spacing) * 5);
|
|
116
123
|
}
|
|
124
|
+
.komc\:z-0 {
|
|
125
|
+
z-index: 0;
|
|
126
|
+
}
|
|
117
127
|
.komc\:z-10 {
|
|
118
128
|
z-index: 10;
|
|
119
129
|
}
|
|
@@ -129,6 +139,9 @@
|
|
|
129
139
|
.komc\:-mt-4 {
|
|
130
140
|
margin-top: calc(var(--komc-spacing) * -4);
|
|
131
141
|
}
|
|
142
|
+
.komc\:mt-2 {
|
|
143
|
+
margin-top: calc(var(--komc-spacing) * 2);
|
|
144
|
+
}
|
|
132
145
|
.komc\:mt-3 {
|
|
133
146
|
margin-top: calc(var(--komc-spacing) * 3);
|
|
134
147
|
}
|
|
@@ -228,6 +241,9 @@
|
|
|
228
241
|
.komc\:max-h-\[90dvh\] {
|
|
229
242
|
max-height: 90dvh;
|
|
230
243
|
}
|
|
244
|
+
.komc\:max-h-full {
|
|
245
|
+
max-height: 100%;
|
|
246
|
+
}
|
|
231
247
|
.komc\:min-h-0 {
|
|
232
248
|
min-height: calc(var(--komc-spacing) * 0);
|
|
233
249
|
}
|
|
@@ -249,12 +265,18 @@
|
|
|
249
265
|
.komc\:min-h-96 {
|
|
250
266
|
min-height: calc(var(--komc-spacing) * 96);
|
|
251
267
|
}
|
|
268
|
+
.komc\:min-h-\[28vh\] {
|
|
269
|
+
min-height: 28vh;
|
|
270
|
+
}
|
|
252
271
|
.komc\:min-h-screen {
|
|
253
272
|
min-height: 100vh;
|
|
254
273
|
}
|
|
255
274
|
.komc\:w-2 {
|
|
256
275
|
width: calc(var(--komc-spacing) * 2);
|
|
257
276
|
}
|
|
277
|
+
.komc\:w-4 {
|
|
278
|
+
width: calc(var(--komc-spacing) * 4);
|
|
279
|
+
}
|
|
258
280
|
.komc\:w-\[50dvw\] {
|
|
259
281
|
width: 50dvw;
|
|
260
282
|
}
|
|
@@ -309,12 +331,18 @@
|
|
|
309
331
|
.komc\:min-w-\[min\(100\%\,320px\)\] {
|
|
310
332
|
min-width: min(100%, 320px);
|
|
311
333
|
}
|
|
334
|
+
.komc\:flex-1 {
|
|
335
|
+
flex: 1;
|
|
336
|
+
}
|
|
312
337
|
.komc\:shrink-0 {
|
|
313
338
|
flex-shrink: 0;
|
|
314
339
|
}
|
|
315
340
|
.komc\:grow-0 {
|
|
316
341
|
flex-grow: 0;
|
|
317
342
|
}
|
|
343
|
+
.komc\:basis-1\/2\! {
|
|
344
|
+
flex-basis: calc(1 / 2 * 100%) !important;
|
|
345
|
+
}
|
|
318
346
|
.komc\:basis-full {
|
|
319
347
|
flex-basis: 100%;
|
|
320
348
|
}
|
|
@@ -388,6 +416,9 @@
|
|
|
388
416
|
.komc\:gap-1 {
|
|
389
417
|
gap: calc(var(--komc-spacing) * 1);
|
|
390
418
|
}
|
|
419
|
+
.komc\:gap-1\.5 {
|
|
420
|
+
gap: calc(var(--komc-spacing) * 1.5);
|
|
421
|
+
}
|
|
391
422
|
.komc\:gap-2 {
|
|
392
423
|
gap: calc(var(--komc-spacing) * 2);
|
|
393
424
|
}
|
|
@@ -403,6 +434,13 @@
|
|
|
403
434
|
.komc\:gap-6 {
|
|
404
435
|
gap: calc(var(--komc-spacing) * 6);
|
|
405
436
|
}
|
|
437
|
+
.komc\:space-y-3 {
|
|
438
|
+
:where(& > :not(:last-child)) {
|
|
439
|
+
--tw-space-y-reverse: 0;
|
|
440
|
+
margin-block-start: calc(calc(var(--komc-spacing) * 3) * var(--tw-space-y-reverse));
|
|
441
|
+
margin-block-end: calc(calc(var(--komc-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
|
|
442
|
+
}
|
|
443
|
+
}
|
|
406
444
|
.komc\:gap-x-2 {
|
|
407
445
|
column-gap: calc(var(--komc-spacing) * 2);
|
|
408
446
|
}
|
|
@@ -412,6 +450,9 @@
|
|
|
412
450
|
.komc\:overflow-hidden {
|
|
413
451
|
overflow: hidden;
|
|
414
452
|
}
|
|
453
|
+
.komc\:overflow-y-auto {
|
|
454
|
+
overflow-y: auto;
|
|
455
|
+
}
|
|
415
456
|
.komc\:rounded {
|
|
416
457
|
border-radius: 0.25rem;
|
|
417
458
|
}
|
|
@@ -451,6 +492,10 @@
|
|
|
451
492
|
border-top-style: var(--tw-border-style);
|
|
452
493
|
border-top-width: 1px;
|
|
453
494
|
}
|
|
495
|
+
.komc\:border-b {
|
|
496
|
+
border-bottom-style: var(--tw-border-style);
|
|
497
|
+
border-bottom-width: 1px;
|
|
498
|
+
}
|
|
454
499
|
.komc\:border-dashed {
|
|
455
500
|
--tw-border-style: dashed;
|
|
456
501
|
border-style: dashed;
|
|
@@ -475,6 +520,12 @@
|
|
|
475
520
|
.komc\:border-neutral-200 {
|
|
476
521
|
border-color: var(--komc-color-neutral-200);
|
|
477
522
|
}
|
|
523
|
+
.komc\:border-neutral-200\/60 {
|
|
524
|
+
border-color: var(--komc-color-neutral-200);
|
|
525
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
526
|
+
border-color: color-mix(in oklab, var(--komc-color-neutral-200) 60%, transparent);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
478
529
|
.komc\:border-neutral-300 {
|
|
479
530
|
border-color: var(--komc-color-neutral-300);
|
|
480
531
|
}
|
|
@@ -529,6 +580,15 @@
|
|
|
529
580
|
.komc\:bg-neutral-100 {
|
|
530
581
|
background-color: var(--komc-color-neutral-100);
|
|
531
582
|
}
|
|
583
|
+
.komc\:bg-neutral-100\/95 {
|
|
584
|
+
background-color: var(--komc-color-neutral-100);
|
|
585
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
586
|
+
background-color: color-mix(in oklab, var(--komc-color-neutral-100) 95%, transparent);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
.komc\:bg-neutral-300 {
|
|
590
|
+
background-color: var(--komc-color-neutral-300);
|
|
591
|
+
}
|
|
532
592
|
.komc\:bg-night-700 {
|
|
533
593
|
background-color: var(--komc-color-night-700);
|
|
534
594
|
}
|
|
@@ -562,6 +622,9 @@
|
|
|
562
622
|
.komc\:p-8 {
|
|
563
623
|
padding: calc(var(--komc-spacing) * 8);
|
|
564
624
|
}
|
|
625
|
+
.komc\:p-10 {
|
|
626
|
+
padding: calc(var(--komc-spacing) * 10);
|
|
627
|
+
}
|
|
565
628
|
.komc\:px-0 {
|
|
566
629
|
padding-inline: calc(var(--komc-spacing) * 0);
|
|
567
630
|
}
|
|
@@ -595,12 +658,24 @@
|
|
|
595
658
|
.komc\:py-2 {
|
|
596
659
|
padding-block: calc(var(--komc-spacing) * 2);
|
|
597
660
|
}
|
|
661
|
+
.komc\:py-3 {
|
|
662
|
+
padding-block: calc(var(--komc-spacing) * 3);
|
|
663
|
+
}
|
|
664
|
+
.komc\:py-4 {
|
|
665
|
+
padding-block: calc(var(--komc-spacing) * 4);
|
|
666
|
+
}
|
|
598
667
|
.komc\:pt-4 {
|
|
599
668
|
padding-top: calc(var(--komc-spacing) * 4);
|
|
600
669
|
}
|
|
670
|
+
.komc\:pb-32 {
|
|
671
|
+
padding-bottom: calc(var(--komc-spacing) * 32);
|
|
672
|
+
}
|
|
601
673
|
.komc\:pl-4 {
|
|
602
674
|
padding-left: calc(var(--komc-spacing) * 4);
|
|
603
675
|
}
|
|
676
|
+
.komc\:text-center {
|
|
677
|
+
text-align: center;
|
|
678
|
+
}
|
|
604
679
|
.komc\:font-mono {
|
|
605
680
|
font-family: var(--komc-font-mono);
|
|
606
681
|
}
|
|
@@ -620,6 +695,10 @@
|
|
|
620
695
|
font-size: var(--komc-text-xs);
|
|
621
696
|
line-height: var(--tw-leading, var(--komc-text-xs--line-height));
|
|
622
697
|
}
|
|
698
|
+
.komc\:leading-relaxed {
|
|
699
|
+
--tw-leading: var(--komc-leading-relaxed);
|
|
700
|
+
line-height: var(--komc-leading-relaxed);
|
|
701
|
+
}
|
|
623
702
|
.komc\:font-black {
|
|
624
703
|
--tw-font-weight: var(--komc-font-weight-black);
|
|
625
704
|
font-weight: var(--komc-font-weight-black);
|
|
@@ -669,6 +748,12 @@
|
|
|
669
748
|
.komc\:text-neutral-600 {
|
|
670
749
|
color: var(--komc-color-neutral-600);
|
|
671
750
|
}
|
|
751
|
+
.komc\:text-neutral-700 {
|
|
752
|
+
color: var(--komc-color-neutral-700);
|
|
753
|
+
}
|
|
754
|
+
.komc\:text-neutral-800 {
|
|
755
|
+
color: var(--komc-color-neutral-800);
|
|
756
|
+
}
|
|
672
757
|
.komc\:text-white {
|
|
673
758
|
color: var(--komc-color-white);
|
|
674
759
|
}
|
|
@@ -720,6 +805,11 @@
|
|
|
720
805
|
--tw-drop-shadow: drop-shadow(var(--komc-drop-shadow-xl));
|
|
721
806
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
722
807
|
}
|
|
808
|
+
.komc\:backdrop-blur-sm {
|
|
809
|
+
--tw-backdrop-blur: blur(var(--komc-blur-sm));
|
|
810
|
+
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
811
|
+
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
812
|
+
}
|
|
723
813
|
.komc\:transition-all {
|
|
724
814
|
transition-property: all;
|
|
725
815
|
transition-timing-function: var(--tw-ease, var(--komc-default-transition-timing-function));
|
|
@@ -1066,6 +1156,16 @@
|
|
|
1066
1156
|
color: var(--komc-color-gray-800);
|
|
1067
1157
|
}
|
|
1068
1158
|
}
|
|
1159
|
+
.komc\:data-\[selected\=true\]\:bg-blue-500 {
|
|
1160
|
+
&[data-selected="true"] {
|
|
1161
|
+
background-color: var(--komc-color-blue-500);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
.komc\:data-\[selected\=true\]\:text-white {
|
|
1165
|
+
&[data-selected="true"] {
|
|
1166
|
+
color: var(--komc-color-white);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1069
1169
|
.komc\:data-\[state\=closed\]\:scale-95 {
|
|
1070
1170
|
&[data-state="closed"] {
|
|
1071
1171
|
--tw-scale-x: 95%;
|
|
@@ -1157,7 +1257,6 @@
|
|
|
1157
1257
|
border: 0 solid;
|
|
1158
1258
|
background-color: transparent;
|
|
1159
1259
|
box-sizing: border-box;
|
|
1160
|
-
line-height: 1.5;
|
|
1161
1260
|
}
|
|
1162
1261
|
button[data-komc] {
|
|
1163
1262
|
cursor: pointer;
|
|
@@ -1181,11 +1280,20 @@
|
|
|
1181
1280
|
inherits: false;
|
|
1182
1281
|
initial-value: 0;
|
|
1183
1282
|
}
|
|
1283
|
+
@property --tw-space-y-reverse {
|
|
1284
|
+
syntax: "*";
|
|
1285
|
+
inherits: false;
|
|
1286
|
+
initial-value: 0;
|
|
1287
|
+
}
|
|
1184
1288
|
@property --tw-border-style {
|
|
1185
1289
|
syntax: "*";
|
|
1186
1290
|
inherits: false;
|
|
1187
1291
|
initial-value: solid;
|
|
1188
1292
|
}
|
|
1293
|
+
@property --tw-leading {
|
|
1294
|
+
syntax: "*";
|
|
1295
|
+
inherits: false;
|
|
1296
|
+
}
|
|
1189
1297
|
@property --tw-font-weight {
|
|
1190
1298
|
syntax: "*";
|
|
1191
1299
|
inherits: false;
|
|
@@ -1308,6 +1416,42 @@
|
|
|
1308
1416
|
syntax: "*";
|
|
1309
1417
|
inherits: false;
|
|
1310
1418
|
}
|
|
1419
|
+
@property --tw-backdrop-blur {
|
|
1420
|
+
syntax: "*";
|
|
1421
|
+
inherits: false;
|
|
1422
|
+
}
|
|
1423
|
+
@property --tw-backdrop-brightness {
|
|
1424
|
+
syntax: "*";
|
|
1425
|
+
inherits: false;
|
|
1426
|
+
}
|
|
1427
|
+
@property --tw-backdrop-contrast {
|
|
1428
|
+
syntax: "*";
|
|
1429
|
+
inherits: false;
|
|
1430
|
+
}
|
|
1431
|
+
@property --tw-backdrop-grayscale {
|
|
1432
|
+
syntax: "*";
|
|
1433
|
+
inherits: false;
|
|
1434
|
+
}
|
|
1435
|
+
@property --tw-backdrop-hue-rotate {
|
|
1436
|
+
syntax: "*";
|
|
1437
|
+
inherits: false;
|
|
1438
|
+
}
|
|
1439
|
+
@property --tw-backdrop-invert {
|
|
1440
|
+
syntax: "*";
|
|
1441
|
+
inherits: false;
|
|
1442
|
+
}
|
|
1443
|
+
@property --tw-backdrop-opacity {
|
|
1444
|
+
syntax: "*";
|
|
1445
|
+
inherits: false;
|
|
1446
|
+
}
|
|
1447
|
+
@property --tw-backdrop-saturate {
|
|
1448
|
+
syntax: "*";
|
|
1449
|
+
inherits: false;
|
|
1450
|
+
}
|
|
1451
|
+
@property --tw-backdrop-sepia {
|
|
1452
|
+
syntax: "*";
|
|
1453
|
+
inherits: false;
|
|
1454
|
+
}
|
|
1311
1455
|
@property --tw-duration {
|
|
1312
1456
|
syntax: "*";
|
|
1313
1457
|
inherits: false;
|
|
@@ -1347,7 +1491,9 @@
|
|
|
1347
1491
|
--tw-translate-x: 0;
|
|
1348
1492
|
--tw-translate-y: 0;
|
|
1349
1493
|
--tw-translate-z: 0;
|
|
1494
|
+
--tw-space-y-reverse: 0;
|
|
1350
1495
|
--tw-border-style: solid;
|
|
1496
|
+
--tw-leading: initial;
|
|
1351
1497
|
--tw-font-weight: initial;
|
|
1352
1498
|
--tw-shadow: 0 0 #0000;
|
|
1353
1499
|
--tw-shadow-color: initial;
|
|
@@ -1376,6 +1522,15 @@
|
|
|
1376
1522
|
--tw-drop-shadow-color: initial;
|
|
1377
1523
|
--tw-drop-shadow-alpha: 100%;
|
|
1378
1524
|
--tw-drop-shadow-size: initial;
|
|
1525
|
+
--tw-backdrop-blur: initial;
|
|
1526
|
+
--tw-backdrop-brightness: initial;
|
|
1527
|
+
--tw-backdrop-contrast: initial;
|
|
1528
|
+
--tw-backdrop-grayscale: initial;
|
|
1529
|
+
--tw-backdrop-hue-rotate: initial;
|
|
1530
|
+
--tw-backdrop-invert: initial;
|
|
1531
|
+
--tw-backdrop-opacity: initial;
|
|
1532
|
+
--tw-backdrop-saturate: initial;
|
|
1533
|
+
--tw-backdrop-sepia: initial;
|
|
1379
1534
|
--tw-duration: initial;
|
|
1380
1535
|
--tw-ease: initial;
|
|
1381
1536
|
--tw-content: "";
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
4
|
+
import * as class_variance_authority_types1 from "class-variance-authority/types";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
|
|
7
7
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/ui/button/button.d.ts
|
|
20
20
|
declare const classes$2: (props?: ({
|
|
21
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
21
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "xxs" | "4xl" | null | undefined;
|
|
22
22
|
shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
23
23
|
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
|
-
px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
26
|
-
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
27
|
-
} &
|
|
25
|
+
px?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | null | undefined;
|
|
26
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
27
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
28
28
|
interface VariantMap {
|
|
29
29
|
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
30
30
|
solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
|
|
@@ -43,22 +43,22 @@ type ButtonProps = ComponentProps<'button'> & BaseProps & ({
|
|
|
43
43
|
}) & {
|
|
44
44
|
asChild?: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare const Button:
|
|
46
|
+
declare const Button: react4.ForwardRefExoticComponent<(Omit<react4.ClassAttributes<HTMLButtonElement> & react4.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
47
|
outline?: "line";
|
|
48
48
|
variant?: VariantMap["line"];
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "ref"> | Omit<
|
|
51
|
+
}, "ref"> | Omit<react4.ClassAttributes<HTMLButtonElement> & react4.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
52
|
outline: "solid";
|
|
53
53
|
variant?: VariantMap["solid"];
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "ref"> | Omit<
|
|
56
|
+
}, "ref"> | Omit<react4.ClassAttributes<HTMLButtonElement> & react4.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
57
|
outline: "clear";
|
|
58
58
|
variant?: VariantMap["clear"];
|
|
59
59
|
} & {
|
|
60
60
|
asChild?: boolean;
|
|
61
|
-
}, "ref">) &
|
|
61
|
+
}, "ref">) & react4.RefAttributes<HTMLButtonElement>>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
64
64
|
interface ConditionalWrapperProps {
|
|
@@ -70,15 +70,15 @@ declare function ConditionalWrapper({
|
|
|
70
70
|
condition,
|
|
71
71
|
wrapper,
|
|
72
72
|
children
|
|
73
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react4.ReactNode;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/input/input.d.ts
|
|
76
76
|
declare const classes$1: (props?: ({
|
|
77
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
78
|
-
gap?: "none" | "
|
|
77
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
78
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
79
79
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
80
80
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
81
|
-
} &
|
|
81
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
82
82
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
83
83
|
size?: VariantProps<typeof classes$1>['size'];
|
|
84
84
|
gap?: VariantProps<typeof classes$1>['gap'];
|
|
@@ -87,13 +87,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
87
87
|
prefix?: React.ReactNode;
|
|
88
88
|
surffix?: React.ReactNode;
|
|
89
89
|
}
|
|
90
|
-
declare const Input:
|
|
90
|
+
declare const Input: react4.ForwardRefExoticComponent<InputProps & react4.RefAttributes<HTMLInputElement>>;
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
93
93
|
declare const classes: (props?: ({
|
|
94
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
95
|
-
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
96
|
-
} &
|
|
94
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "square" | "full" | null | undefined;
|
|
95
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
96
|
+
} & class_variance_authority_types1.ClassProp) | undefined) => string;
|
|
97
97
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
98
98
|
width?: string | number;
|
|
99
99
|
height?: string | number;
|
|
@@ -107,7 +107,7 @@ declare function Skeleton({
|
|
|
107
107
|
height,
|
|
108
108
|
className,
|
|
109
109
|
...props
|
|
110
|
-
}: SkeletonProps):
|
|
110
|
+
}: SkeletonProps): react_jsx_runtime1.JSX.Element;
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
113
113
|
declare function StableText({
|
|
@@ -116,6 +116,6 @@ declare function StableText({
|
|
|
116
116
|
...props
|
|
117
117
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
118
118
|
children: string | number;
|
|
119
|
-
}):
|
|
119
|
+
}): react_jsx_runtime1.JSX.Element;
|
|
120
120
|
//#endregion
|
|
121
121
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react7 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
|
|
@@ -18,12 +18,12 @@ declare function BottomAppBar<T>({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/ui/button/button.d.ts
|
|
20
20
|
declare const classes$2: (props?: ({
|
|
21
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
21
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "xxs" | "4xl" | null | undefined;
|
|
22
22
|
shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
23
23
|
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
|
-
px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
26
|
-
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
25
|
+
px?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | null | undefined;
|
|
26
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
27
27
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
28
28
|
interface VariantMap {
|
|
29
29
|
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
@@ -74,8 +74,8 @@ declare function ConditionalWrapper({
|
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/input/input.d.ts
|
|
76
76
|
declare const classes$1: (props?: ({
|
|
77
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
78
|
-
gap?: "none" | "
|
|
77
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
78
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
79
79
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
80
80
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
81
81
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
@@ -91,8 +91,8 @@ declare const Input: react7.ForwardRefExoticComponent<InputProps & react7.RefAtt
|
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
93
93
|
declare const classes: (props?: ({
|
|
94
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
95
|
-
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
94
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "square" | "full" | null | undefined;
|
|
95
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
96
96
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
97
97
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
98
98
|
width?: string | number;
|
|
@@ -107,7 +107,7 @@ declare function Skeleton({
|
|
|
107
107
|
height,
|
|
108
108
|
className,
|
|
109
109
|
...props
|
|
110
|
-
}: SkeletonProps):
|
|
110
|
+
}: SkeletonProps): react_jsx_runtime9.JSX.Element;
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
113
113
|
declare function StableText({
|
|
@@ -116,6 +116,6 @@ declare function StableText({
|
|
|
116
116
|
...props
|
|
117
117
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
118
118
|
children: string | number;
|
|
119
|
-
}):
|
|
119
|
+
}): react_jsx_runtime9.JSX.Element;
|
|
120
120
|
//#endregion
|
|
121
121
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui-client/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../src-CjpmdVyv.cjs`);const t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`),r=require(`../hooks-DqgWx1Fa.cjs`);require(`../providers-BNK8Fisc.cjs`);let i=require(`lodash-es`),a=require(`clsx`);a=e.t(a);let o=require(`react`);o=e.t(o);let s=require(`react/jsx-runtime`),c=require(`class-variance-authority`),l=require(`embla-carousel-react`);l=e.t(l);let u=require(`react-dom`);const d=o.default.createContext(null);function f(){let e=o.default.useContext(d);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function p({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:c,...u}){let[f,p]=(0,l.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),v=(0,o.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=(0,o.useCallback)(()=>{p?.scrollPrev()},[p]),b=(0,o.useCallback)(()=>{p?.scrollNext()},[p]),x=(0,o.useCallback)(t=>{e===`horizontal`?t.key===`ArrowLeft`?(t.preventDefault(),y()):t.key===`ArrowRight`&&(t.preventDefault(),b()):t.key===`ArrowUp`?(t.preventDefault(),y()):t.key===`ArrowDown`&&(t.preventDefault(),b())},[y,b,e]);return(0,o.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,o.useEffect)(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),(0,s.jsx)(d.Provider,{value:{carouselRef:f,api:p,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:m,canScrollNext:g},children:(0,s.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:x,className:t.y(`komc:relative`,a),...u,children:c})})}function m({className:e,...n}){let{carouselRef:r,orientation:i}=f();return(0,s.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,s.jsx)(`div`,{className:t.y(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function h({className:e,...n}){let{orientation:r}=f();return(0,s.jsx)(`div`,{"data-komc":!0,className:t.y(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function g({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=f();return(0,s.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:(0,a.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function _({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=f();return(0,s.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:(0,a.default)(`komc:w-full`,t),onClick:r,...n,children:e})}const v=(0,c.cva)(`komc:relative komc:z-10 komc:w-full komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function y({closeOnBackdropClick:e=!0,isOpen:t,zIndex:n=1e4,padding:i,maxWidth:a,className:c,onClose:l,children:u,...d}){let f=r.c(t,300),[p,m]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(t&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else t||m(!1)},[t,f]);let h=(0,o.useCallback)(e=>{e.key===`Escape`&&l()},[l]),g=(0,o.useCallback)(()=>{e&&l()},[e,l]);return(0,o.useEffect)(()=>(t?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[t,h]),f?(0,s.jsxs)(`div`,{"data-komc":!0,className:`komc:flex komc:justify-center komc:items-center komc:fixed komc:inset-0`,style:{zIndex:n},children:[(0,s.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:`komc:w-full komc:h-full komc:bg-black/50 komc:absolute komc:inset-0 komc:cursor-default komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:g,"aria-label":`close dialog`}),(0,s.jsx)(`div`,{"data-state":p?`open`:`closed`,className:`${v({padding:i,maxWidth:a,className:c})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:u})]}):null}const b=(0,c.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),x=(0,o.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,s.jsx)(`img`,{ref:n,...i})}),S=(0,o.forwardRef)(({skeleton:e=!0,layout:t=`stretch`,fallbackSrc:i,className:o,emptyNode:c,emptyNodeClassName:l,skeletonClassName:u,...d},f)=>{let{ref:p,isLoad:m,isError:h,imageProps:g}=r.r({ref:f,fallbackSrc:i,forceLoad:!e,...d}),_=!d.fill&&t===`intrinsic`?{width:`${d.width}px`,height:`${d.height}px`}:void 0,v=(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!d.fill&&t===`stretch`&&`komc:w-full komc:h-full`);return!i&&h&&c?d.fill?(0,s.jsx)(C,{className:l,children:c}):(0,s.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,s.jsx)(C,{className:l,children:c})}):d.fill?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`img`,{ref:p,...g,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:invisible`:`komc:visible`,o)}),(0,s.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,s.jsx)(n.t,{size:`full`,className:u})})]}):(0,s.jsxs)(`div`,{"data-komc":!0,style:_,className:v,children:[(0,s.jsx)(`img`,{ref:p,...g,className:(0,a.default)(b({fill:d.fill,className:o}),e&&!m?`komc:invisible`:`komc:visible`)}),(0,s.jsx)(`div`,{className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,s.jsx)(n.t,{size:`full`,className:u})})]})}),C=({children:e,className:t})=>(0,s.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var w=S;const T=(0,c.cva)((0,a.default)(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),E=(0,c.cva)(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function D({isOpen:e,onClose:t,direction:n=`bottom`,size:i=`full`,children:c,className:l,closeOnBackdropClick:u=!0,zIndex:d=1001}){let f=r.c(e,300),[p,m]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(e&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else e||m(!1)},[e,f]);let h=(0,o.useCallback)(e=>{e.key===`Escape`&&t()},[t]),g=(0,o.useCallback)(()=>{u&&t()},[u,t]);return(0,o.useEffect)(()=>(e?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[e,h]),f?(0,s.jsxs)(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[(0,s.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:(0,a.default)(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:g,"aria-label":`close sheet`}),(0,s.jsx)(`div`,{"data-state":p?`open`:`closed`,className:(0,a.default)(T({direction:n,className:l}),E({direction:n,size:i})),role:`dialog`,"aria-modal":`true`,children:c})]}):null}function O({children:e,setOpen:t}){return(0,s.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const k=(0,c.cva)(t.y(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}}),A=(0,o.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,s.jsx)(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:k({portal:e,placement:r,className:n}),...i,children:t}));var j=A;const M=(0,c.cva)(t.y(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.y(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.y(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.y(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.y(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.y(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.y(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),N=({placement:e,className:t,offset:n,style:r,...i})=>{let a=(0,o.useMemo)(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return(0,s.jsx)(`div`,{className:M({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};var P=N;const F=24,I=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function L({placement:e,className:t,content:n,open:r,hiddenRef:c,containerRef:l}){let[d,f]=(0,o.useState)(!1),p=(0,o.useRef)(null),[m,h]=(0,o.useState)(e),[g,_]=(0,o.useState)({top:0,left:0}),[v,y]=(0,o.useState)({x:0,y:0}),b=(0,o.useCallback)((0,i.debounce)(()=>{let e=l?.current,t=c.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.scrollY||document.documentElement.scrollTop,a=window.scrollX||document.documentElement.scrollLeft,[o,s]=m.split(`-`),u=i+n.top,d=a+n.left+n.width/2-r.width/2;switch(o){case`top`:u-=r.height;break;case`bottom`:u+=n.height;break}switch(s){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),_({top:u,left:f}),y({x:d-f,y:0})},50),[m]),x=(0,o.useCallback)((0,i.debounce)(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();h(r=>{let i=e;return t+n>=window.innerHeight?i=I(r,`top`):t<0&&(i=I(r,`bottom`)),i})},50),[e]);return(0,o.useEffect)(()=>(f(!0),x(),window.addEventListener(`scroll`,b,{passive:!0}),window.addEventListener(`resize`,b),window.addEventListener(`scroll`,x,{passive:!0}),window.addEventListener(`resize`,x),()=>{window.removeEventListener(`scroll`,b),window.removeEventListener(`resize`,b),window.removeEventListener(`scroll`,x),window.removeEventListener(`resize`,x)}),[b,x]),(0,o.useEffect)(()=>{d&&b()},[d,b]),d?(0,u.createPortal)((0,s.jsxs)(j,{ref:p,portal:!0,"data-komc":!0,placement:m,className:(0,a.default)(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,s.jsx)(`span`,{children:n}),(0,s.jsx)(P,{placement:m,offset:v})]}),document.body):null}const R=(0,o.forwardRef)(({children:e,content:t,defaultOpen:n=!1,className:i,placement:c=`top`},l)=>{let[u,d]=(0,o.useState)(n),f=(0,o.useRef)(null),p=(0,o.useRef)(null);return r.o({ref:f,setOpen:d}),(0,s.jsxs)(`div`,{ref:f,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,s.jsx)(O,{setOpen:d,children:e}),(0,s.jsx)(L,{placement:c,className:i,open:u,content:t,hiddenRef:p,containerRef:f}),(0,s.jsx)(j,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:c,className:(0,a.default)(`komc:opacity-0 komc:invisible`,i),children:(0,s.jsx)(`span`,{children:t})})]})});var z=R;exports.BaseImage=x,exports.Carousel=p,exports.CarouselItem=h,exports.CarouselNext=_,exports.CarouselPrevious=g,exports.CarouselWrapper=m,exports.Dialog=y,exports.EmptyNode=C,exports.Image=w,exports.Sheet=D,exports.Tooltip=z;
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../src-CjpmdVyv.cjs`);const t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`),r=require(`../hooks-DqgWx1Fa.cjs`);require(`../providers-BNK8Fisc.cjs`);let i=require(`clsx`);i=e.t(i);let a=require(`react`);a=e.t(a);let o=require(`react/jsx-runtime`),s=require(`class-variance-authority`),c=require(`embla-carousel-react`);c=e.t(c);let l=require(`react-dom`);const u=a.default.createContext(null);function d(){let e=a.default.useContext(u);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function f({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:s,children:l,...d}){let[f,p]=(0,c.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(0),[b,x]=(0,a.useState)(0),S=(0,a.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()),x(e.selectedScrollSnap()))},[]),C=(0,a.useCallback)(()=>{p?.scrollPrev()},[p]),w=(0,a.useCallback)(()=>{p?.scrollNext()},[p]),T=(0,a.useCallback)(e=>{p?.scrollTo(e)},[p]),E=(0,a.useCallback)(()=>{y(p?.scrollSnapList().length||0)},[p]),D=(0,a.useCallback)(t=>{e===`horizontal`?t.key===`ArrowLeft`?(t.preventDefault(),C()):t.key===`ArrowRight`&&(t.preventDefault(),w()):t.key===`ArrowUp`?(t.preventDefault(),C()):t.key===`ArrowDown`&&(t.preventDefault(),w())},[C,w,e]);return(0,a.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,a.useEffect)(()=>{if(p)return S(p),E(),p.on(`reInit`,E),p.on(`reInit`,S),p.on(`select`,S),()=>{p?.off(`select`,S)}},[p,S]),(0,o.jsx)(u.Provider,{value:{carouselRef:f,api:p,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:C,scrollNext:w,canScrollPrev:m,canScrollNext:g,scrollTo:T,dots:v,selectedScrollSnap:b},children:(0,o.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:D,className:t.y(`komc:relative`,s),...d,children:l})})}function p({className:e,...n}){let{carouselRef:r,orientation:i}=d();return(0,o.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,o.jsx)(`div`,{className:t.y(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function m({className:e,...n}){let{orientation:r}=d();return(0,o.jsx)(`div`,{"data-komc":!0,className:t.y(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function h({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:a}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`previous slide`,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function g({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:a}=d();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,"aria-label":`next slide`,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function _({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=d();return(0,o.jsx)(o.Fragment,{children:Array.from({length:n}).map((n,a)=>(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,"data-selected":r===a,"aria-label":`go to slide ${a+1}`,onClick:()=>i(a),...t,children:e(a)},a))})}const v=(0,s.cva)(`komc:relative komc:z-10 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden komc:w-full komc:max-h-full komc:min-w-0 komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function y({closeOnBackdropClick:e=!0,isOpen:t,zIndex:n=1e4,padding:i,maxWidth:s,className:c,onClose:l,children:u,...d}){let f=r.c(t,300),[p,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(t&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else t||m(!1)},[t,f]);let h=(0,a.useCallback)(e=>{e.key===`Escape`&&l()},[l]),g=(0,a.useCallback)(()=>{e&&l()},[e,l]);return(0,a.useEffect)(()=>(t?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[t,h]),f?(0,o.jsx)(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:n},children:(0,o.jsxs)(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[(0,o.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:`komc:fixed komc:inset-0 komc:z-0 komc:cursor-default komc:bg-black/50 komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:g,"aria-label":`close dialog`}),(0,o.jsx)(`div`,{"data-state":p?`open`:`closed`,className:`${v({padding:i,maxWidth:s,className:c})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:u})]})}):null}const b=(0,s.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),x=(0,a.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,o.jsx)(`img`,{ref:n,...i})}),S=(0,a.forwardRef)(({skeleton:e=!0,layout:t=`stretch`,fallbackSrc:a,className:s,emptyNode:c,emptyNodeClassName:l,skeletonClassName:u,...d},f)=>{let{ref:p,isLoad:m,isError:h,imageProps:g}=r.r({ref:f,fallbackSrc:a,forceLoad:!e,...d}),_=!d.fill&&t===`intrinsic`?{width:`${d.width}px`,height:`${d.height}px`}:void 0,v=(0,i.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!d.fill&&t===`stretch`&&`komc:w-full komc:h-full`);return!a&&h&&c?d.fill?(0,o.jsx)(C,{className:l,children:c}):(0,o.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,o.jsx)(C,{className:l,children:c})}):d.fill?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`img`,{ref:p,...g,className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:invisible`:`komc:visible`,s)}),(0,o.jsx)(`div`,{"data-komc":!0,className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,o.jsx)(n.t,{size:`full`,className:u})})]}):(0,o.jsxs)(`div`,{"data-komc":!0,style:_,className:v,children:[(0,o.jsx)(`img`,{ref:p,...g,className:(0,i.default)(b({fill:d.fill,className:s}),e&&!m?`komc:invisible`:`komc:visible`)}),(0,o.jsx)(`div`,{className:(0,i.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,o.jsx)(n.t,{size:`full`,className:u})})]})}),C=({children:e,className:t})=>(0,o.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,i.default)(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var w=S;const T=(0,s.cva)((0,i.default)(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),E=(0,s.cva)(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function D({isOpen:e,onClose:t,direction:n=`bottom`,size:s=`full`,children:c,className:l,closeOnBackdropClick:u=!0,zIndex:d=1001}){let f=r.c(e,300),[p,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(e&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else e||m(!1)},[e,f]);let h=(0,a.useCallback)(e=>{e.key===`Escape`&&t()},[t]),g=(0,a.useCallback)(()=>{u&&t()},[u,t]);return(0,a.useEffect)(()=>(e?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[e,h]),f?(0,o.jsxs)(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[(0,o.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:(0,i.default)(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:g,"aria-label":`close sheet`}),(0,o.jsx)(`div`,{"data-state":p?`open`:`closed`,className:(0,i.default)(T({direction:n,className:l}),E({direction:n,size:s})),role:`dialog`,"aria-modal":`true`,children:c})]}):null}function O({children:e,setOpen:t}){return(0,o.jsx)(`div`,{"data-komc":!0,className:(0,i.default)(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const k=(0,s.cva)(t.y(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}}),A=(0,a.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,o.jsx)(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:k({portal:e,placement:r,className:n}),...i,children:t}));var j=A;const M=(0,s.cva)(t.y(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.y(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.y(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.y(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.y(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.y(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.y(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),N=({placement:e,className:t,offset:n,style:r,...i})=>{let s=(0,a.useMemo)(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return(0,o.jsx)(`div`,{className:M({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var P=N;const F=24,I=2,L=180,R=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function z({placement:e,className:t,content:n,open:r,hiddenRef:s,containerRef:c}){let[u,d]=(0,a.useState)(!1),[f,p]=(0,a.useState)(e),[m,h]=(0,a.useState)({top:0,left:0}),[g,_]=(0,a.useState)({x:0,y:0});(0,a.useEffect)(()=>{d(!0)},[]);let v=(0,a.useCallback)(()=>{let t=c.current,n=s.current;if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=e,[o]=a.split(`-`),l=r.top,u=window.innerHeight-r.bottom;o===`bottom`&&u<i.height&&l>=i.height?a=R(a,`top`):o===`top`&&l<i.height&&u>=i.height&&(a=R(a,`bottom`)),p(a);let[d,f]=a.split(`-`),m=r.top,g=r.left+r.width/2-i.width/2;switch(d){case`top`:m-=i.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:g+=i.width/2-24;break;case`end`:g-=i.width/2-24;break}let v=g,y=window.innerWidth;v+i.width>y-4&&(v=y-i.width-4),v<4&&(v=4),h({top:m,left:v}),_({x:g-v,y:0})},[e,c,s]);return(0,a.useEffect)(()=>{if(!u||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;v();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||v(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let o=0,s=0,l=``,d=()=>{if(e||o>=180)return;let t=c.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===l?s+=1:(s=0,l=n,v())}s<2&&(o+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[u,r,v,c]),u?(0,l.createPortal)((0,o.jsxs)(j,{portal:!0,"data-komc":!0,placement:f,className:(0,i.default)(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...m},children:[(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(P,{placement:f,offset:g})]}),document.body):null}const B=(0,a.forwardRef)(({children:e,content:t,defaultOpen:n=!1,className:s,placement:c=`top`},l)=>{let[u,d]=(0,a.useState)(n),f=(0,a.useRef)(null),p=(0,a.useRef)(null);return r.o({ref:f,setOpen:d}),(0,o.jsxs)(`div`,{ref:f,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,o.jsx)(O,{setOpen:d,children:e}),(0,o.jsx)(z,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(j,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:c,className:(0,i.default)(`komc:opacity-0 komc:invisible`,s),children:(0,o.jsx)(`span`,{children:t})})]})});var V=B;exports.BaseImage=x,exports.Carousel=f,exports.CarouselDot=_,exports.CarouselItem=m,exports.CarouselNext=g,exports.CarouselPrevious=h,exports.CarouselWrapper=p,exports.Dialog=y,exports.EmptyNode=C,exports.Image=w,exports.Sheet=D,exports.Tooltip=V;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ComhjQ-q.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react14 from "react";
|
|
3
3
|
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
4
|
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
5
5
|
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
|
-
import * as
|
|
6
|
+
import * as class_variance_authority_types2 from "class-variance-authority/types";
|
|
7
7
|
import { VariantProps } from "class-variance-authority";
|
|
8
8
|
|
|
9
9
|
//#region src/ui-client/carousel/carousel-context.d.ts
|
|
@@ -24,6 +24,9 @@ type CarouselContextProps = {
|
|
|
24
24
|
scrollNext: () => void;
|
|
25
25
|
canScrollPrev: boolean;
|
|
26
26
|
canScrollNext: boolean;
|
|
27
|
+
scrollTo: (index: number) => void;
|
|
28
|
+
dots: number;
|
|
29
|
+
selectedScrollSnap: number;
|
|
27
30
|
} & CarouselProps;
|
|
28
31
|
//#endregion
|
|
29
32
|
//#region src/ui-client/carousel/carousel.d.ts
|
|
@@ -69,11 +72,19 @@ declare function CarouselNext({
|
|
|
69
72
|
...props
|
|
70
73
|
}: React$1.ComponentProps<'button'>): react_jsx_runtime3.JSX.Element;
|
|
71
74
|
//#endregion
|
|
75
|
+
//#region src/ui-client/carousel/carousel-dot.d.ts
|
|
76
|
+
declare function CarouselDot({
|
|
77
|
+
children,
|
|
78
|
+
...props
|
|
79
|
+
}: Omit<React$1.ComponentProps<'button'>, 'children'> & {
|
|
80
|
+
children: (index: number) => React$1.ReactNode;
|
|
81
|
+
}): react_jsx_runtime3.JSX.Element;
|
|
82
|
+
//#endregion
|
|
72
83
|
//#region src/ui-client/dialog/dialog.d.ts
|
|
73
84
|
declare const classes: (props?: ({
|
|
74
85
|
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
75
86
|
maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
76
|
-
} &
|
|
87
|
+
} & class_variance_authority_types2.ClassProp) | undefined) => string;
|
|
77
88
|
interface DialogProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
78
89
|
closeOnBackdropClick?: boolean;
|
|
79
90
|
isOpen: boolean;
|
|
@@ -102,7 +113,7 @@ type ImageSubsetProps = {
|
|
|
102
113
|
skeletonClassName?: string;
|
|
103
114
|
};
|
|
104
115
|
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
105
|
-
declare const BaseImage:
|
|
116
|
+
declare const BaseImage: react14.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
106
117
|
fill: true;
|
|
107
118
|
sizes: string;
|
|
108
119
|
width?: never;
|
|
@@ -112,8 +123,8 @@ declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
112
123
|
sizes?: never;
|
|
113
124
|
width: number;
|
|
114
125
|
height: number;
|
|
115
|
-
}, "ref">) &
|
|
116
|
-
declare const Image:
|
|
126
|
+
}, "ref">) & react14.RefAttributes<HTMLImageElement>>;
|
|
127
|
+
declare const Image: react14.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
117
128
|
fill: true;
|
|
118
129
|
sizes: string;
|
|
119
130
|
width?: never;
|
|
@@ -123,7 +134,7 @@ declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
123
134
|
sizes?: never;
|
|
124
135
|
width: number;
|
|
125
136
|
height: number;
|
|
126
|
-
} & ImageSubsetProps, "ref">) &
|
|
137
|
+
} & ImageSubsetProps, "ref">) & react14.RefAttributes<HTMLImageElement>>;
|
|
127
138
|
interface EmptyNodeProps {
|
|
128
139
|
children: React.ReactNode;
|
|
129
140
|
className?: string;
|
|
@@ -167,6 +178,6 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
167
178
|
placement?: TooltipPlacement;
|
|
168
179
|
defaultOpen?: boolean;
|
|
169
180
|
}
|
|
170
|
-
declare const TooltipContainer:
|
|
181
|
+
declare const TooltipContainer: react14.ForwardRefExoticComponent<TooltipContainerProps & react14.RefAttributes<HTMLDivElement>>;
|
|
171
182
|
//#endregion
|
|
172
|
-
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
183
|
+
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselDot, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ByfkW7VU.mjs";
|
|
2
2
|
import * as react1 from "react";
|
|
3
3
|
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
7
7
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -24,6 +24,9 @@ type CarouselContextProps = {
|
|
|
24
24
|
scrollNext: () => void;
|
|
25
25
|
canScrollPrev: boolean;
|
|
26
26
|
canScrollNext: boolean;
|
|
27
|
+
scrollTo: (index: number) => void;
|
|
28
|
+
dots: number;
|
|
29
|
+
selectedScrollSnap: number;
|
|
27
30
|
} & CarouselProps;
|
|
28
31
|
//#endregion
|
|
29
32
|
//#region src/ui-client/carousel/carousel.d.ts
|
|
@@ -41,33 +44,41 @@ declare function Carousel({
|
|
|
41
44
|
className,
|
|
42
45
|
children,
|
|
43
46
|
...props
|
|
44
|
-
}: CarouselProps$1):
|
|
47
|
+
}: CarouselProps$1): react_jsx_runtime5.JSX.Element;
|
|
45
48
|
//#endregion
|
|
46
49
|
//#region src/ui-client/carousel/carousel-wrapper.d.ts
|
|
47
50
|
declare function CarouselWrapper({
|
|
48
51
|
className,
|
|
49
52
|
...props
|
|
50
|
-
}: React$1.ComponentProps<'div'>):
|
|
53
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
51
54
|
//#endregion
|
|
52
55
|
//#region src/ui-client/carousel/carousel-item.d.ts
|
|
53
56
|
declare function CarouselItem({
|
|
54
57
|
className,
|
|
55
58
|
...props
|
|
56
|
-
}: React$1.ComponentProps<'div'>):
|
|
59
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
|
|
57
60
|
//#endregion
|
|
58
61
|
//#region src/ui-client/carousel/carousel-previous.d.ts
|
|
59
62
|
declare function CarouselPrevious({
|
|
60
63
|
children,
|
|
61
64
|
className,
|
|
62
65
|
...props
|
|
63
|
-
}: React$1.ComponentProps<'button'>):
|
|
66
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime5.JSX.Element;
|
|
64
67
|
//#endregion
|
|
65
68
|
//#region src/ui-client/carousel/carousel-next.d.ts
|
|
66
69
|
declare function CarouselNext({
|
|
67
70
|
children,
|
|
68
71
|
className,
|
|
69
72
|
...props
|
|
70
|
-
}: React$1.ComponentProps<'button'>):
|
|
73
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime5.JSX.Element;
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/ui-client/carousel/carousel-dot.d.ts
|
|
76
|
+
declare function CarouselDot({
|
|
77
|
+
children,
|
|
78
|
+
...props
|
|
79
|
+
}: Omit<React$1.ComponentProps<'button'>, 'children'> & {
|
|
80
|
+
children: (index: number) => React$1.ReactNode;
|
|
81
|
+
}): react_jsx_runtime5.JSX.Element;
|
|
71
82
|
//#endregion
|
|
72
83
|
//#region src/ui-client/dialog/dialog.d.ts
|
|
73
84
|
declare const classes: (props?: ({
|
|
@@ -91,7 +102,7 @@ declare function Dialog({
|
|
|
91
102
|
onClose,
|
|
92
103
|
children,
|
|
93
104
|
...rest
|
|
94
|
-
}: DialogProps):
|
|
105
|
+
}: DialogProps): react_jsx_runtime5.JSX.Element | null;
|
|
95
106
|
//#endregion
|
|
96
107
|
//#region src/ui-client/image/image.d.ts
|
|
97
108
|
type ImageSubsetProps = {
|
|
@@ -131,7 +142,7 @@ interface EmptyNodeProps {
|
|
|
131
142
|
declare const EmptyNode: ({
|
|
132
143
|
children,
|
|
133
144
|
className
|
|
134
|
-
}: EmptyNodeProps) =>
|
|
145
|
+
}: EmptyNodeProps) => react_jsx_runtime5.JSX.Element;
|
|
135
146
|
//#endregion
|
|
136
147
|
//#region src/ui-client/sheet/sheet.d.ts
|
|
137
148
|
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -155,7 +166,7 @@ declare function Sheet({
|
|
|
155
166
|
className,
|
|
156
167
|
closeOnBackdropClick,
|
|
157
168
|
zIndex
|
|
158
|
-
}: SheetProps):
|
|
169
|
+
}: SheetProps): react_jsx_runtime5.JSX.Element | null;
|
|
159
170
|
//#endregion
|
|
160
171
|
//#region src/ui-client/tooltip/tooltip-container.d.ts
|
|
161
172
|
type SubPlacement = 'start' | 'end';
|
|
@@ -169,4 +180,4 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
169
180
|
}
|
|
170
181
|
declare const TooltipContainer: react1.ForwardRefExoticComponent<TooltipContainerProps & react1.RefAttributes<HTMLDivElement>>;
|
|
171
182
|
//#endregion
|
|
172
|
-
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
183
|
+
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselDot, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
package/dist/ui-client/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../src-C_FmOyer.mjs";import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import{c as n,o as r,r as i}from"../hooks-DBo6LQrH.mjs";import"../providers-5JCPezAS.mjs";import{debounce as a}from"lodash-es";import o from"clsx";import s,{forwardRef as c,useCallback as l,useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import v from"embla-carousel-react";import{createPortal as y}from"react-dom";const b=s.createContext(null);function x(){let e=s.useContext(b);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function S({orientation:t=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:o,...s}){let[c,d]=v({...n,axis:t===`horizontal`?`x`:`y`},i),[f,m]=p(!1),[g,_]=p(!1),y=l(e=>{e&&(m(e.canScrollPrev()),_(e.canScrollNext()))},[]),x=l(()=>{d?.scrollPrev()},[d]),S=l(()=>{d?.scrollNext()},[d]),C=l(e=>{t===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),x()):e.key===`ArrowRight`&&(e.preventDefault(),S()):e.key===`ArrowUp`?(e.preventDefault(),x()):e.key===`ArrowDown`&&(e.preventDefault(),S())},[x,S,t]);return u(()=>{!d||!r||r(d)},[d,r]),u(()=>{if(d)return y(d),d.on(`reInit`,y),d.on(`select`,y),()=>{d?.off(`select`,y)}},[d,y]),h(b.Provider,{value:{carouselRef:c,api:d,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:x,scrollNext:S,canScrollPrev:f,canScrollNext:g},children:h(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:C,className:e(`komc:relative`,a),...s,children:o})})}function C({className:t,...n}){let{carouselRef:r,orientation:i}=x();return h(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:h(`div`,{className:e(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})})}function w({className:t,...n}){let{orientation:r}=x();return h(`div`,{"data-komc":!0,className:e(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,t),...n})}function T({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=x();return h(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:o(`komc:w-full`,t),onClick:r,...n,children:e})}function E({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=x();return h(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:o(`komc:w-full`,t),onClick:r,...n,children:e})}const D=_(`komc:relative komc:z-10 komc:w-full komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function O({closeOnBackdropClick:e=!0,isOpen:t,zIndex:r=1e4,padding:i,maxWidth:a,className:o,onClose:s,children:c,...d}){let f=n(t,300),[m,_]=p(!1);u(()=>{if(t&&f){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else t||_(!1)},[t,f]);let v=l(e=>{e.key===`Escape`&&s()},[s]),y=l(()=>{e&&s()},[e,s]);return u(()=>(t?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[t,v]),f?g(`div`,{"data-komc":!0,className:`komc:flex komc:justify-center komc:items-center komc:fixed komc:inset-0`,style:{zIndex:r},children:[h(`button`,{type:`button`,"data-state":m?`open`:`closed`,className:`komc:w-full komc:h-full komc:bg-black/50 komc:absolute komc:inset-0 komc:cursor-default komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:y,"aria-label":`close dialog`}),h(`div`,{"data-state":m?`open`:`closed`,className:`${D({padding:i,maxWidth:a,className:o})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:c})]}):null}const k=_(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),A=c(({...e},t)=>{let{ref:n,imageProps:r}=i({ref:t,...e});return h(`img`,{ref:n,...r})}),j=c(({skeleton:e=!0,layout:n=`stretch`,fallbackSrc:r,className:a,emptyNode:s,emptyNodeClassName:c,skeletonClassName:l,...u},d)=>{let{ref:f,isLoad:p,isError:_,imageProps:v}=i({ref:d,fallbackSrc:r,forceLoad:!e,...u}),y=!u.fill&&n===`intrinsic`?{width:`${u.width}px`,height:`${u.height}px`}:void 0,b=o(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!u.fill&&n===`stretch`&&`komc:w-full komc:h-full`);return!r&&_&&s?u.fill?h(M,{className:c,children:s}):h(`div`,{"data-komc":!0,style:y,className:b,children:h(M,{className:c,children:s})}):u.fill?g(m,{children:[h(`img`,{ref:f,...v,className:o(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!p?`komc:invisible`:`komc:visible`,a)}),h(`div`,{"data-komc":!0,className:o(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!p?`komc:block`:`komc:hidden`),children:h(t,{size:`full`,className:l})})]}):g(`div`,{"data-komc":!0,style:y,className:b,children:[h(`img`,{ref:f,...v,className:o(k({fill:u.fill,className:a}),e&&!p?`komc:invisible`:`komc:visible`)}),h(`div`,{className:o(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!p?`komc:block`:`komc:hidden`),children:h(t,{size:`full`,className:l})})]})}),M=({children:e,className:t})=>h(`div`,{"data-komc":!0,role:`alert`,className:o(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var N=j;const P=_(o(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),F=_(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function I({isOpen:e,onClose:t,direction:r=`bottom`,size:i=`full`,children:a,className:s,closeOnBackdropClick:c=!0,zIndex:d=1001}){let f=n(e,300),[m,_]=p(!1);u(()=>{if(e&&f){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else e||_(!1)},[e,f]);let v=l(e=>{e.key===`Escape`&&t()},[t]),y=l(()=>{c&&t()},[c,t]);return u(()=>(e?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[e,v]),f?g(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[h(`button`,{type:`button`,"data-state":m?`open`:`closed`,className:o(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:y,"aria-label":`close sheet`}),h(`div`,{"data-state":m?`open`:`closed`,className:o(P({direction:r,className:s}),F({direction:r,size:i})),role:`dialog`,"aria-modal":`true`,children:a})]}):null}function L({children:e,setOpen:t}){return h(`div`,{"data-komc":!0,className:o(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const R=_(e(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var z=c(({portal:e,children:t,className:n,placement:r,...i},a)=>h(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:R({portal:e,placement:r,className:n}),...i,children:t}));const B=_(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var V=({placement:e,className:t,offset:n,style:r,...i})=>{let a=d(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return h(`div`,{className:B({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const H=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function U({placement:e,className:t,content:n,open:r,hiddenRef:i,containerRef:s}){let[c,d]=p(!1),m=f(null),[_,v]=p(e),[b,x]=p({top:0,left:0}),[S,C]=p({x:0,y:0}),w=l(a(()=>{let e=s?.current,t=i.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),a=window.scrollY||document.documentElement.scrollTop,o=window.scrollX||document.documentElement.scrollLeft,[c,l]=_.split(`-`),u=a+n.top,d=o+n.left+n.width/2-r.width/2;switch(c){case`top`:u-=r.height;break;case`bottom`:u+=n.height;break}switch(l){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),x({top:u,left:f}),C({x:d-f,y:0})},50),[_]),T=l(a(()=>{if(!i.current)return;let{top:t,height:n}=i.current.getBoundingClientRect();v(r=>{let i=e;return t+n>=window.innerHeight?i=H(r,`top`):t<0&&(i=H(r,`bottom`)),i})},50),[e]);return u(()=>(d(!0),T(),window.addEventListener(`scroll`,w,{passive:!0}),window.addEventListener(`resize`,w),window.addEventListener(`scroll`,T,{passive:!0}),window.addEventListener(`resize`,T),()=>{window.removeEventListener(`scroll`,w),window.removeEventListener(`resize`,w),window.removeEventListener(`scroll`,T),window.removeEventListener(`resize`,T)}),[w,T]),u(()=>{c&&w()},[c,w]),c?y(g(z,{ref:m,portal:!0,"data-komc":!0,placement:_,className:o(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[h(`span`,{children:n}),h(V,{placement:_,offset:S})]}),document.body):null}var W=c(({children:e,content:t,defaultOpen:n=!1,className:i,placement:a=`top`},s)=>{let[c,l]=p(n),u=f(null),d=f(null);return r({ref:u,setOpen:l}),g(`div`,{ref:u,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[h(L,{setOpen:l,children:e}),h(U,{placement:a,className:i,open:c,content:t,hiddenRef:d,containerRef:u}),h(z,{ref:d,role:`presentation`,"aria-hidden":`true`,placement:a,className:o(`komc:opacity-0 komc:invisible`,i),children:h(`span`,{children:t})})]})});export{A as BaseImage,S as Carousel,w as CarouselItem,E as CarouselNext,T as CarouselPrevious,C as CarouselWrapper,O as Dialog,M as EmptyNode,N as Image,I as Sheet,W as Tooltip};
|
|
1
|
+
import"../src-C_FmOyer.mjs";import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import{c as n,o as r,r as i}from"../hooks-DBo6LQrH.mjs";import"../providers-5JCPezAS.mjs";import a from"clsx";import o,{forwardRef as s,useCallback as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{cva as g}from"class-variance-authority";import _ from"embla-carousel-react";import{createPortal as v}from"react-dom";const y=o.createContext(null);function b(){let e=o.useContext(y);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function x({orientation:t=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:o,...s}){let[u,d]=_({...n,axis:t===`horizontal`?`x`:`y`},i),[p,h]=f(!1),[g,v]=f(!1),[b,x]=f(0),[S,C]=f(0),w=c(e=>{e&&(h(e.canScrollPrev()),v(e.canScrollNext()),C(e.selectedScrollSnap()))},[]),T=c(()=>{d?.scrollPrev()},[d]),E=c(()=>{d?.scrollNext()},[d]),D=c(e=>{d?.scrollTo(e)},[d]),O=c(()=>{x(d?.scrollSnapList().length||0)},[d]),k=c(e=>{t===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),T()):e.key===`ArrowRight`&&(e.preventDefault(),E()):e.key===`ArrowUp`?(e.preventDefault(),T()):e.key===`ArrowDown`&&(e.preventDefault(),E())},[T,E,t]);return l(()=>{!d||!r||r(d)},[d,r]),l(()=>{if(d)return w(d),O(),d.on(`reInit`,O),d.on(`reInit`,w),d.on(`select`,w),()=>{d?.off(`select`,w)}},[d,w]),m(y.Provider,{value:{carouselRef:u,api:d,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:T,scrollNext:E,canScrollPrev:p,canScrollNext:g,scrollTo:D,dots:b,selectedScrollSnap:S},children:m(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:k,className:e(`komc:relative`,a),...s,children:o})})}function S({className:t,...n}){let{carouselRef:r,orientation:i}=b();return m(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:m(`div`,{className:e(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})})}function C({className:t,...n}){let{orientation:r}=b();return m(`div`,{"data-komc":!0,className:e(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,t),...n})}function w({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function T({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=b();return m(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:a(`komc:w-full`,t),onClick:r,...n,children:e})}function E({children:e,...t}){let{dots:n,selectedScrollSnap:r,scrollTo:i}=b();return m(p,{children:Array.from({length:n}).map((n,a)=>m(`button`,{type:`button`,"data-komc":!0,"data-selected":r===a,"aria-label":`go to slide ${a+1}`,onClick:()=>i(a),...t,children:e(a)},a))})}const D=g(`komc:relative komc:z-10 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden komc:w-full komc:max-h-full komc:min-w-0 komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function O({closeOnBackdropClick:e=!0,isOpen:t,zIndex:r=1e4,padding:i,maxWidth:a,className:o,onClose:s,children:u,...d}){let p=n(t,300),[g,_]=f(!1);l(()=>{if(t&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else t||_(!1)},[t,p]);let v=c(e=>{e.key===`Escape`&&s()},[s]),y=c(()=>{e&&s()},[e,s]);return l(()=>(t?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[t,v]),p?m(`div`,{"data-komc":!0,className:`komc:fixed komc:inset-0 komc:flex komc:min-h-0 komc:flex-col komc:overflow-hidden`,style:{zIndex:r},children:h(`div`,{className:`komc:relative komc:flex komc:min-h-0 komc:flex-1 komc:w-full komc:items-center komc:justify-center`,children:[m(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:`komc:fixed komc:inset-0 komc:z-0 komc:cursor-default komc:bg-black/50 komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:y,"aria-label":`close dialog`}),m(`div`,{"data-state":g?`open`:`closed`,className:`${D({padding:i,maxWidth:a,className:o})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:u})]})}):null}const k=g(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),A=s(({...e},t)=>{let{ref:n,imageProps:r}=i({ref:t,...e});return m(`img`,{ref:n,...r})}),j=s(({skeleton:e=!0,layout:n=`stretch`,fallbackSrc:r,className:o,emptyNode:s,emptyNodeClassName:c,skeletonClassName:l,...u},d)=>{let{ref:f,isLoad:g,isError:_,imageProps:v}=i({ref:d,fallbackSrc:r,forceLoad:!e,...u}),y=!u.fill&&n===`intrinsic`?{width:`${u.width}px`,height:`${u.height}px`}:void 0,b=a(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!u.fill&&n===`stretch`&&`komc:w-full komc:h-full`);return!r&&_&&s?u.fill?m(M,{className:c,children:s}):m(`div`,{"data-komc":!0,style:y,className:b,children:m(M,{className:c,children:s})}):u.fill?h(p,{children:[m(`img`,{ref:f,...v,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:invisible`:`komc:visible`,o)}),m(`div`,{"data-komc":!0,className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]}):h(`div`,{"data-komc":!0,style:y,className:b,children:[m(`img`,{ref:f,...v,className:a(k({fill:u.fill,className:o}),e&&!g?`komc:invisible`:`komc:visible`)}),m(`div`,{className:a(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!g?`komc:block`:`komc:hidden`),children:m(t,{size:`full`,className:l})})]})}),M=({children:e,className:t})=>m(`div`,{"data-komc":!0,role:`alert`,className:a(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var N=j;const P=g(a(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),F=g(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function I({isOpen:e,onClose:t,direction:r=`bottom`,size:i=`full`,children:o,className:s,closeOnBackdropClick:u=!0,zIndex:d=1001}){let p=n(e,300),[g,_]=f(!1);l(()=>{if(e&&p){let e=setTimeout(()=>_(!0),10);return()=>clearTimeout(e)}else e||_(!1)},[e,p]);let v=c(e=>{e.key===`Escape`&&t()},[t]),y=c(()=>{u&&t()},[u,t]);return l(()=>(e?(document.addEventListener(`keydown`,v),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,v),document.body.style.overflow=`unset`}),[e,v]),p?h(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[m(`button`,{type:`button`,"data-state":g?`open`:`closed`,className:a(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:y,"aria-label":`close sheet`}),m(`div`,{"data-state":g?`open`:`closed`,className:a(P({direction:r,className:s}),F({direction:r,size:i})),role:`dialog`,"aria-modal":`true`,children:o})]}):null}function L({children:e,setOpen:t}){return m(`div`,{"data-komc":!0,className:a(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const R=g(e(`komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:`komc:fixed`,false:`komc:absolute`},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}});var z=s(({portal:e,children:t,className:n,placement:r,...i},a)=>m(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:R({portal:e,placement:r,className:n}),...i,children:t}));const B=g(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}});var V=({placement:e,className:t,offset:n,style:r,...i})=>{let a=u(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return m(`div`,{className:B({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const H=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function U({placement:e,className:t,content:n,open:r,hiddenRef:i,containerRef:o}){let[s,u]=f(!1),[d,p]=f(e),[g,_]=f({top:0,left:0}),[y,b]=f({x:0,y:0});l(()=>{u(!0)},[]);let x=c(()=>{let t=o.current,n=i.current;if(!t||!n)return;let r=t.getBoundingClientRect(),a=n.getBoundingClientRect(),s=e,[c]=s.split(`-`),l=r.top,u=window.innerHeight-r.bottom;c===`bottom`&&u<a.height&&l>=a.height?s=H(s,`top`):c===`top`&&l<a.height&&u>=a.height&&(s=H(s,`bottom`)),p(s);let[d,f]=s.split(`-`),m=r.top,h=r.left+r.width/2-a.width/2;switch(d){case`top`:m-=a.height;break;case`bottom`:m+=r.height;break}switch(f){case`start`:h+=a.width/2-24;break;case`end`:h-=a.width/2-24;break}let g=h,v=window.innerWidth;g+a.width>v-4&&(g=v-a.width-4),g<4&&(g=4),_({top:m,left:g}),b({x:h-g,y:0})},[e,o,i]);return l(()=>{if(!s||!r)return;console.log(`updateLayout`);let e=!1,t=0,n=0,i=!1;x();let a=()=>{i||=(t=requestAnimationFrame(()=>{e||x(),i=!1}),!0)};window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a);let c=0,l=0,u=``,d=()=>{if(e||c>=180)return;let t=o.current;if(t){let e=t.getBoundingClientRect(),n=`${e.top.toFixed(4)},${e.left.toFixed(4)},${e.width.toFixed(4)},${e.height.toFixed(4)}`;n===u?l+=1:(l=0,u=n,x())}l<2&&(c+=1,n=requestAnimationFrame(d))};return n=requestAnimationFrame(d),()=>{e=!0,cancelAnimationFrame(t),cancelAnimationFrame(n),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[s,r,x,o]),s?v(h(z,{portal:!0,"data-komc":!0,placement:d,className:a(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[m(`span`,{children:n}),m(V,{placement:d,offset:y})]}),document.body):null}var W=s(({children:e,content:t,defaultOpen:n=!1,className:i,placement:o=`top`},s)=>{let[c,l]=f(n),u=d(null),p=d(null);return r({ref:u,setOpen:l}),h(`div`,{ref:u,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[m(L,{setOpen:l,children:e}),m(U,{placement:o,className:i,open:c,content:t,hiddenRef:p,containerRef:u}),m(z,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:o,className:a(`komc:opacity-0 komc:invisible`,i),children:m(`span`,{children:t})})]})});export{A as BaseImage,x as Carousel,E as CarouselDot,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,O as Dialog,M as EmptyNode,N as Image,I as Sheet,W as Tooltip};
|