@machinerd/js-module 0.5.0 → 0.5.1
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 +131 -1
- package/dist/ui/index.d.cts +14 -14
- package/dist/ui/index.d.mts +3 -3
- package/dist/ui-client/index.cjs +1 -1
- package/dist/ui-client/index.d.cts +9 -9
- package/dist/ui-client/index.d.mts +15 -15
- 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_runtime9 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_runtime9.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
|
@@ -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
|
}
|
|
@@ -228,6 +238,9 @@
|
|
|
228
238
|
.komc\:max-h-\[90dvh\] {
|
|
229
239
|
max-height: 90dvh;
|
|
230
240
|
}
|
|
241
|
+
.komc\:max-h-full {
|
|
242
|
+
max-height: 100%;
|
|
243
|
+
}
|
|
231
244
|
.komc\:min-h-0 {
|
|
232
245
|
min-height: calc(var(--komc-spacing) * 0);
|
|
233
246
|
}
|
|
@@ -249,6 +262,9 @@
|
|
|
249
262
|
.komc\:min-h-96 {
|
|
250
263
|
min-height: calc(var(--komc-spacing) * 96);
|
|
251
264
|
}
|
|
265
|
+
.komc\:min-h-\[28vh\] {
|
|
266
|
+
min-height: 28vh;
|
|
267
|
+
}
|
|
252
268
|
.komc\:min-h-screen {
|
|
253
269
|
min-height: 100vh;
|
|
254
270
|
}
|
|
@@ -309,6 +325,9 @@
|
|
|
309
325
|
.komc\:min-w-\[min\(100\%\,320px\)\] {
|
|
310
326
|
min-width: min(100%, 320px);
|
|
311
327
|
}
|
|
328
|
+
.komc\:flex-1 {
|
|
329
|
+
flex: 1;
|
|
330
|
+
}
|
|
312
331
|
.komc\:shrink-0 {
|
|
313
332
|
flex-shrink: 0;
|
|
314
333
|
}
|
|
@@ -403,6 +422,13 @@
|
|
|
403
422
|
.komc\:gap-6 {
|
|
404
423
|
gap: calc(var(--komc-spacing) * 6);
|
|
405
424
|
}
|
|
425
|
+
.komc\:space-y-3 {
|
|
426
|
+
:where(& > :not(:last-child)) {
|
|
427
|
+
--tw-space-y-reverse: 0;
|
|
428
|
+
margin-block-start: calc(calc(var(--komc-spacing) * 3) * var(--tw-space-y-reverse));
|
|
429
|
+
margin-block-end: calc(calc(var(--komc-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
|
|
430
|
+
}
|
|
431
|
+
}
|
|
406
432
|
.komc\:gap-x-2 {
|
|
407
433
|
column-gap: calc(var(--komc-spacing) * 2);
|
|
408
434
|
}
|
|
@@ -412,6 +438,9 @@
|
|
|
412
438
|
.komc\:overflow-hidden {
|
|
413
439
|
overflow: hidden;
|
|
414
440
|
}
|
|
441
|
+
.komc\:overflow-y-auto {
|
|
442
|
+
overflow-y: auto;
|
|
443
|
+
}
|
|
415
444
|
.komc\:rounded {
|
|
416
445
|
border-radius: 0.25rem;
|
|
417
446
|
}
|
|
@@ -451,6 +480,10 @@
|
|
|
451
480
|
border-top-style: var(--tw-border-style);
|
|
452
481
|
border-top-width: 1px;
|
|
453
482
|
}
|
|
483
|
+
.komc\:border-b {
|
|
484
|
+
border-bottom-style: var(--tw-border-style);
|
|
485
|
+
border-bottom-width: 1px;
|
|
486
|
+
}
|
|
454
487
|
.komc\:border-dashed {
|
|
455
488
|
--tw-border-style: dashed;
|
|
456
489
|
border-style: dashed;
|
|
@@ -475,6 +508,12 @@
|
|
|
475
508
|
.komc\:border-neutral-200 {
|
|
476
509
|
border-color: var(--komc-color-neutral-200);
|
|
477
510
|
}
|
|
511
|
+
.komc\:border-neutral-200\/60 {
|
|
512
|
+
border-color: var(--komc-color-neutral-200);
|
|
513
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
514
|
+
border-color: color-mix(in oklab, var(--komc-color-neutral-200) 60%, transparent);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
478
517
|
.komc\:border-neutral-300 {
|
|
479
518
|
border-color: var(--komc-color-neutral-300);
|
|
480
519
|
}
|
|
@@ -529,6 +568,12 @@
|
|
|
529
568
|
.komc\:bg-neutral-100 {
|
|
530
569
|
background-color: var(--komc-color-neutral-100);
|
|
531
570
|
}
|
|
571
|
+
.komc\:bg-neutral-100\/95 {
|
|
572
|
+
background-color: var(--komc-color-neutral-100);
|
|
573
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
574
|
+
background-color: color-mix(in oklab, var(--komc-color-neutral-100) 95%, transparent);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
532
577
|
.komc\:bg-night-700 {
|
|
533
578
|
background-color: var(--komc-color-night-700);
|
|
534
579
|
}
|
|
@@ -562,6 +607,9 @@
|
|
|
562
607
|
.komc\:p-8 {
|
|
563
608
|
padding: calc(var(--komc-spacing) * 8);
|
|
564
609
|
}
|
|
610
|
+
.komc\:p-10 {
|
|
611
|
+
padding: calc(var(--komc-spacing) * 10);
|
|
612
|
+
}
|
|
565
613
|
.komc\:px-0 {
|
|
566
614
|
padding-inline: calc(var(--komc-spacing) * 0);
|
|
567
615
|
}
|
|
@@ -595,12 +643,24 @@
|
|
|
595
643
|
.komc\:py-2 {
|
|
596
644
|
padding-block: calc(var(--komc-spacing) * 2);
|
|
597
645
|
}
|
|
646
|
+
.komc\:py-3 {
|
|
647
|
+
padding-block: calc(var(--komc-spacing) * 3);
|
|
648
|
+
}
|
|
649
|
+
.komc\:py-4 {
|
|
650
|
+
padding-block: calc(var(--komc-spacing) * 4);
|
|
651
|
+
}
|
|
598
652
|
.komc\:pt-4 {
|
|
599
653
|
padding-top: calc(var(--komc-spacing) * 4);
|
|
600
654
|
}
|
|
655
|
+
.komc\:pb-32 {
|
|
656
|
+
padding-bottom: calc(var(--komc-spacing) * 32);
|
|
657
|
+
}
|
|
601
658
|
.komc\:pl-4 {
|
|
602
659
|
padding-left: calc(var(--komc-spacing) * 4);
|
|
603
660
|
}
|
|
661
|
+
.komc\:text-center {
|
|
662
|
+
text-align: center;
|
|
663
|
+
}
|
|
604
664
|
.komc\:font-mono {
|
|
605
665
|
font-family: var(--komc-font-mono);
|
|
606
666
|
}
|
|
@@ -620,6 +680,10 @@
|
|
|
620
680
|
font-size: var(--komc-text-xs);
|
|
621
681
|
line-height: var(--tw-leading, var(--komc-text-xs--line-height));
|
|
622
682
|
}
|
|
683
|
+
.komc\:leading-relaxed {
|
|
684
|
+
--tw-leading: var(--komc-leading-relaxed);
|
|
685
|
+
line-height: var(--komc-leading-relaxed);
|
|
686
|
+
}
|
|
623
687
|
.komc\:font-black {
|
|
624
688
|
--tw-font-weight: var(--komc-font-weight-black);
|
|
625
689
|
font-weight: var(--komc-font-weight-black);
|
|
@@ -669,6 +733,12 @@
|
|
|
669
733
|
.komc\:text-neutral-600 {
|
|
670
734
|
color: var(--komc-color-neutral-600);
|
|
671
735
|
}
|
|
736
|
+
.komc\:text-neutral-700 {
|
|
737
|
+
color: var(--komc-color-neutral-700);
|
|
738
|
+
}
|
|
739
|
+
.komc\:text-neutral-800 {
|
|
740
|
+
color: var(--komc-color-neutral-800);
|
|
741
|
+
}
|
|
672
742
|
.komc\:text-white {
|
|
673
743
|
color: var(--komc-color-white);
|
|
674
744
|
}
|
|
@@ -720,6 +790,11 @@
|
|
|
720
790
|
--tw-drop-shadow: drop-shadow(var(--komc-drop-shadow-xl));
|
|
721
791
|
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
792
|
}
|
|
793
|
+
.komc\:backdrop-blur-sm {
|
|
794
|
+
--tw-backdrop-blur: blur(var(--komc-blur-sm));
|
|
795
|
+
-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,);
|
|
796
|
+
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,);
|
|
797
|
+
}
|
|
723
798
|
.komc\:transition-all {
|
|
724
799
|
transition-property: all;
|
|
725
800
|
transition-timing-function: var(--tw-ease, var(--komc-default-transition-timing-function));
|
|
@@ -1157,7 +1232,6 @@
|
|
|
1157
1232
|
border: 0 solid;
|
|
1158
1233
|
background-color: transparent;
|
|
1159
1234
|
box-sizing: border-box;
|
|
1160
|
-
line-height: 1.5;
|
|
1161
1235
|
}
|
|
1162
1236
|
button[data-komc] {
|
|
1163
1237
|
cursor: pointer;
|
|
@@ -1181,11 +1255,20 @@
|
|
|
1181
1255
|
inherits: false;
|
|
1182
1256
|
initial-value: 0;
|
|
1183
1257
|
}
|
|
1258
|
+
@property --tw-space-y-reverse {
|
|
1259
|
+
syntax: "*";
|
|
1260
|
+
inherits: false;
|
|
1261
|
+
initial-value: 0;
|
|
1262
|
+
}
|
|
1184
1263
|
@property --tw-border-style {
|
|
1185
1264
|
syntax: "*";
|
|
1186
1265
|
inherits: false;
|
|
1187
1266
|
initial-value: solid;
|
|
1188
1267
|
}
|
|
1268
|
+
@property --tw-leading {
|
|
1269
|
+
syntax: "*";
|
|
1270
|
+
inherits: false;
|
|
1271
|
+
}
|
|
1189
1272
|
@property --tw-font-weight {
|
|
1190
1273
|
syntax: "*";
|
|
1191
1274
|
inherits: false;
|
|
@@ -1308,6 +1391,42 @@
|
|
|
1308
1391
|
syntax: "*";
|
|
1309
1392
|
inherits: false;
|
|
1310
1393
|
}
|
|
1394
|
+
@property --tw-backdrop-blur {
|
|
1395
|
+
syntax: "*";
|
|
1396
|
+
inherits: false;
|
|
1397
|
+
}
|
|
1398
|
+
@property --tw-backdrop-brightness {
|
|
1399
|
+
syntax: "*";
|
|
1400
|
+
inherits: false;
|
|
1401
|
+
}
|
|
1402
|
+
@property --tw-backdrop-contrast {
|
|
1403
|
+
syntax: "*";
|
|
1404
|
+
inherits: false;
|
|
1405
|
+
}
|
|
1406
|
+
@property --tw-backdrop-grayscale {
|
|
1407
|
+
syntax: "*";
|
|
1408
|
+
inherits: false;
|
|
1409
|
+
}
|
|
1410
|
+
@property --tw-backdrop-hue-rotate {
|
|
1411
|
+
syntax: "*";
|
|
1412
|
+
inherits: false;
|
|
1413
|
+
}
|
|
1414
|
+
@property --tw-backdrop-invert {
|
|
1415
|
+
syntax: "*";
|
|
1416
|
+
inherits: false;
|
|
1417
|
+
}
|
|
1418
|
+
@property --tw-backdrop-opacity {
|
|
1419
|
+
syntax: "*";
|
|
1420
|
+
inherits: false;
|
|
1421
|
+
}
|
|
1422
|
+
@property --tw-backdrop-saturate {
|
|
1423
|
+
syntax: "*";
|
|
1424
|
+
inherits: false;
|
|
1425
|
+
}
|
|
1426
|
+
@property --tw-backdrop-sepia {
|
|
1427
|
+
syntax: "*";
|
|
1428
|
+
inherits: false;
|
|
1429
|
+
}
|
|
1311
1430
|
@property --tw-duration {
|
|
1312
1431
|
syntax: "*";
|
|
1313
1432
|
inherits: false;
|
|
@@ -1347,7 +1466,9 @@
|
|
|
1347
1466
|
--tw-translate-x: 0;
|
|
1348
1467
|
--tw-translate-y: 0;
|
|
1349
1468
|
--tw-translate-z: 0;
|
|
1469
|
+
--tw-space-y-reverse: 0;
|
|
1350
1470
|
--tw-border-style: solid;
|
|
1471
|
+
--tw-leading: initial;
|
|
1351
1472
|
--tw-font-weight: initial;
|
|
1352
1473
|
--tw-shadow: 0 0 #0000;
|
|
1353
1474
|
--tw-shadow-color: initial;
|
|
@@ -1376,6 +1497,15 @@
|
|
|
1376
1497
|
--tw-drop-shadow-color: initial;
|
|
1377
1498
|
--tw-drop-shadow-alpha: 100%;
|
|
1378
1499
|
--tw-drop-shadow-size: initial;
|
|
1500
|
+
--tw-backdrop-blur: initial;
|
|
1501
|
+
--tw-backdrop-brightness: initial;
|
|
1502
|
+
--tw-backdrop-contrast: initial;
|
|
1503
|
+
--tw-backdrop-grayscale: initial;
|
|
1504
|
+
--tw-backdrop-hue-rotate: initial;
|
|
1505
|
+
--tw-backdrop-invert: initial;
|
|
1506
|
+
--tw-backdrop-opacity: initial;
|
|
1507
|
+
--tw-backdrop-saturate: initial;
|
|
1508
|
+
--tw-backdrop-sepia: initial;
|
|
1379
1509
|
--tw-duration: initial;
|
|
1380
1510
|
--tw-ease: initial;
|
|
1381
1511
|
--tw-content: "";
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react10 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime8 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
|
|
@@ -24,7 +24,7 @@ declare const classes$2: (props?: ({
|
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
25
|
px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
26
26
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
27
|
-
} &
|
|
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: react10.ForwardRefExoticComponent<(Omit<react10.ClassAttributes<HTMLButtonElement> & react10.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
47
|
outline?: "line";
|
|
48
48
|
variant?: VariantMap["line"];
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "ref"> | Omit<
|
|
51
|
+
}, "ref"> | Omit<react10.ClassAttributes<HTMLButtonElement> & react10.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
52
|
outline: "solid";
|
|
53
53
|
variant?: VariantMap["solid"];
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "ref"> | Omit<
|
|
56
|
+
}, "ref"> | Omit<react10.ClassAttributes<HTMLButtonElement> & react10.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
57
|
outline: "clear";
|
|
58
58
|
variant?: VariantMap["clear"];
|
|
59
59
|
} & {
|
|
60
60
|
asChild?: boolean;
|
|
61
|
-
}, "ref">) &
|
|
61
|
+
}, "ref">) & react10.RefAttributes<HTMLButtonElement>>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
64
64
|
interface ConditionalWrapperProps {
|
|
@@ -70,7 +70,7 @@ declare function ConditionalWrapper({
|
|
|
70
70
|
condition,
|
|
71
71
|
wrapper,
|
|
72
72
|
children
|
|
73
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react10.ReactNode;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/input/input.d.ts
|
|
76
76
|
declare const classes$1: (props?: ({
|
|
@@ -78,7 +78,7 @@ declare const classes$1: (props?: ({
|
|
|
78
78
|
gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | 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: react10.ForwardRefExoticComponent<InputProps & react10.RefAttributes<HTMLInputElement>>;
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
93
93
|
declare const classes: (props?: ({
|
|
94
94
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
|
|
95
95
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
96
|
-
} &
|
|
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_runtime8.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_runtime8.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
|
|
|
@@ -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=(0,a.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=(0,a.useCallback)(()=>{p?.scrollPrev()},[p]),b=(0,a.useCallback)(()=>{p?.scrollNext()},[p]),x=(0,a.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,a.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,a.useEffect)(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),(0,o.jsx)(u.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,o.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:x,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})}const _=(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 v({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:`${_({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 y=(0,s.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),b=(0,a.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,o.jsx)(`img`,{ref:n,...i})}),x=(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)(S,{className:l,children:c}):(0,o.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,o.jsx)(S,{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)(y({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})})]})}),S=({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 C=x;const w=(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`}}}),T=(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 E({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)(w({direction:n,className:l}),T({direction:n,size:s})),role:`dialog`,"aria-modal":`true`,children:c})]}):null}function D({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 O=(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}}),k=(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:O({portal:e,placement:r,className:n}),...i,children:t}));var A=k;const j=(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`}}),M=({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:j({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var N=M;const P=24,F=2,I=180,L=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function R({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=L(a,`top`):o===`top`&&l<i.height&&u>=i.height&&(a=L(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)(A,{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)(N,{placement:f,offset:g})]}),document.body):null}const z=(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)(D,{setOpen:d,children:e}),(0,o.jsx)(R,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(A,{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 B=z;exports.BaseImage=b,exports.Carousel=f,exports.CarouselItem=m,exports.CarouselNext=g,exports.CarouselPrevious=h,exports.CarouselWrapper=p,exports.Dialog=v,exports.EmptyNode=S,exports.Image=C,exports.Sheet=E,exports.Tooltip=B;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ComhjQ-q.cjs";
|
|
2
2
|
import * as react3 from "react";
|
|
3
3
|
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
5
5
|
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
6
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
7
7
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -41,33 +41,33 @@ declare function Carousel({
|
|
|
41
41
|
className,
|
|
42
42
|
children,
|
|
43
43
|
...props
|
|
44
|
-
}: CarouselProps$1):
|
|
44
|
+
}: CarouselProps$1): react_jsx_runtime2.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/ui-client/carousel/carousel-wrapper.d.ts
|
|
47
47
|
declare function CarouselWrapper({
|
|
48
48
|
className,
|
|
49
49
|
...props
|
|
50
|
-
}: React$1.ComponentProps<'div'>):
|
|
50
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/ui-client/carousel/carousel-item.d.ts
|
|
53
53
|
declare function CarouselItem({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React$1.ComponentProps<'div'>):
|
|
56
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime2.JSX.Element;
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/ui-client/carousel/carousel-previous.d.ts
|
|
59
59
|
declare function CarouselPrevious({
|
|
60
60
|
children,
|
|
61
61
|
className,
|
|
62
62
|
...props
|
|
63
|
-
}: React$1.ComponentProps<'button'>):
|
|
63
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/ui-client/carousel/carousel-next.d.ts
|
|
66
66
|
declare function CarouselNext({
|
|
67
67
|
children,
|
|
68
68
|
className,
|
|
69
69
|
...props
|
|
70
|
-
}: React$1.ComponentProps<'button'>):
|
|
70
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime2.JSX.Element;
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/ui-client/dialog/dialog.d.ts
|
|
73
73
|
declare const classes: (props?: ({
|
|
@@ -91,7 +91,7 @@ declare function Dialog({
|
|
|
91
91
|
onClose,
|
|
92
92
|
children,
|
|
93
93
|
...rest
|
|
94
|
-
}: DialogProps):
|
|
94
|
+
}: DialogProps): react_jsx_runtime2.JSX.Element | null;
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/ui-client/image/image.d.ts
|
|
97
97
|
type ImageSubsetProps = {
|
|
@@ -131,7 +131,7 @@ interface EmptyNodeProps {
|
|
|
131
131
|
declare const EmptyNode: ({
|
|
132
132
|
children,
|
|
133
133
|
className
|
|
134
|
-
}: EmptyNodeProps) =>
|
|
134
|
+
}: EmptyNodeProps) => react_jsx_runtime2.JSX.Element;
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/ui-client/sheet/sheet.d.ts
|
|
137
137
|
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -155,7 +155,7 @@ declare function Sheet({
|
|
|
155
155
|
className,
|
|
156
156
|
closeOnBackdropClick,
|
|
157
157
|
zIndex
|
|
158
|
-
}: SheetProps):
|
|
158
|
+
}: SheetProps): react_jsx_runtime2.JSX.Element | null;
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/ui-client/tooltip/tooltip-container.d.ts
|
|
161
161
|
type SubPlacement = 'start' | 'end';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ByfkW7VU.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react3 from "react";
|
|
3
3
|
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime3 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";
|
|
@@ -41,33 +41,33 @@ declare function Carousel({
|
|
|
41
41
|
className,
|
|
42
42
|
children,
|
|
43
43
|
...props
|
|
44
|
-
}: CarouselProps$1):
|
|
44
|
+
}: CarouselProps$1): react_jsx_runtime3.JSX.Element;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/ui-client/carousel/carousel-wrapper.d.ts
|
|
47
47
|
declare function CarouselWrapper({
|
|
48
48
|
className,
|
|
49
49
|
...props
|
|
50
|
-
}: React$1.ComponentProps<'div'>):
|
|
50
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime3.JSX.Element;
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/ui-client/carousel/carousel-item.d.ts
|
|
53
53
|
declare function CarouselItem({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React$1.ComponentProps<'div'>):
|
|
56
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime3.JSX.Element;
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/ui-client/carousel/carousel-previous.d.ts
|
|
59
59
|
declare function CarouselPrevious({
|
|
60
60
|
children,
|
|
61
61
|
className,
|
|
62
62
|
...props
|
|
63
|
-
}: React$1.ComponentProps<'button'>):
|
|
63
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime3.JSX.Element;
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/ui-client/carousel/carousel-next.d.ts
|
|
66
66
|
declare function CarouselNext({
|
|
67
67
|
children,
|
|
68
68
|
className,
|
|
69
69
|
...props
|
|
70
|
-
}: React$1.ComponentProps<'button'>):
|
|
70
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime3.JSX.Element;
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/ui-client/dialog/dialog.d.ts
|
|
73
73
|
declare const classes: (props?: ({
|
|
@@ -91,7 +91,7 @@ declare function Dialog({
|
|
|
91
91
|
onClose,
|
|
92
92
|
children,
|
|
93
93
|
...rest
|
|
94
|
-
}: DialogProps):
|
|
94
|
+
}: DialogProps): react_jsx_runtime3.JSX.Element | null;
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/ui-client/image/image.d.ts
|
|
97
97
|
type ImageSubsetProps = {
|
|
@@ -102,7 +102,7 @@ type ImageSubsetProps = {
|
|
|
102
102
|
skeletonClassName?: string;
|
|
103
103
|
};
|
|
104
104
|
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
105
|
-
declare const BaseImage:
|
|
105
|
+
declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
106
106
|
fill: true;
|
|
107
107
|
sizes: string;
|
|
108
108
|
width?: never;
|
|
@@ -112,8 +112,8 @@ declare const BaseImage: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
112
112
|
sizes?: never;
|
|
113
113
|
width: number;
|
|
114
114
|
height: number;
|
|
115
|
-
}, "ref">) &
|
|
116
|
-
declare const Image:
|
|
115
|
+
}, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
116
|
+
declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
117
117
|
fill: true;
|
|
118
118
|
sizes: string;
|
|
119
119
|
width?: never;
|
|
@@ -123,7 +123,7 @@ declare const Image: react1.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
|
123
123
|
sizes?: never;
|
|
124
124
|
width: number;
|
|
125
125
|
height: number;
|
|
126
|
-
} & ImageSubsetProps, "ref">) &
|
|
126
|
+
} & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
127
127
|
interface EmptyNodeProps {
|
|
128
128
|
children: React.ReactNode;
|
|
129
129
|
className?: string;
|
|
@@ -131,7 +131,7 @@ interface EmptyNodeProps {
|
|
|
131
131
|
declare const EmptyNode: ({
|
|
132
132
|
children,
|
|
133
133
|
className
|
|
134
|
-
}: EmptyNodeProps) =>
|
|
134
|
+
}: EmptyNodeProps) => react_jsx_runtime3.JSX.Element;
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/ui-client/sheet/sheet.d.ts
|
|
137
137
|
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
@@ -155,7 +155,7 @@ declare function Sheet({
|
|
|
155
155
|
className,
|
|
156
156
|
closeOnBackdropClick,
|
|
157
157
|
zIndex
|
|
158
|
-
}: SheetProps):
|
|
158
|
+
}: SheetProps): react_jsx_runtime3.JSX.Element | null;
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/ui-client/tooltip/tooltip-container.d.ts
|
|
161
161
|
type SubPlacement = 'start' | 'end';
|
|
@@ -167,6 +167,6 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
167
167
|
placement?: TooltipPlacement;
|
|
168
168
|
defaultOpen?: boolean;
|
|
169
169
|
}
|
|
170
|
-
declare const TooltipContainer:
|
|
170
|
+
declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
|
|
171
171
|
//#endregion
|
|
172
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 };
|
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=c(e=>{e&&(h(e.canScrollPrev()),v(e.canScrollNext()))},[]),x=c(()=>{d?.scrollPrev()},[d]),S=c(()=>{d?.scrollNext()},[d]),C=c(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 l(()=>{!d||!r||r(d)},[d,r]),l(()=>{if(d)return b(d),d.on(`reInit`,b),d.on(`select`,b),()=>{d?.off(`select`,b)}},[d,b]),m(y.Provider,{value:{carouselRef:u,api:d,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:x,scrollNext:S,canScrollPrev:p,canScrollNext:g},children:m(`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 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})}const E=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 D({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:`${E({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 O=g(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),k=s(({...e},t)=>{let{ref:n,imageProps:r}=i({ref:t,...e});return m(`img`,{ref:n,...r})}),A=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(j,{className:c,children:s}):m(`div`,{"data-komc":!0,style:y,className:b,children:m(j,{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(O({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})})]})}),j=({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 M=A;const N=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`}}}),P=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 F({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(N({direction:r,className:s}),P({direction:r,size:i})),role:`dialog`,"aria-modal":`true`,children:o})]}):null}function I({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 L=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 R=s(({portal:e,children:t,className:n,placement:r,...i},a)=>m(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:L({portal:e,placement:r,className:n}),...i,children:t}));const z=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 B=({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:z({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const V=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function H({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=V(s,`top`):c===`top`&&l<a.height&&u>=a.height&&(s=V(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(R,{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(B,{placement:d,offset:y})]}),document.body):null}var U=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(I,{setOpen:l,children:e}),m(H,{placement:o,className:i,open:c,content:t,hiddenRef:p,containerRef:u}),m(R,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:o,className:a(`komc:opacity-0 komc:invisible`,i),children:m(`span`,{children:t})})]})});export{k as BaseImage,x as Carousel,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,D as Dialog,j as EmptyNode,M as Image,F as Sheet,U as Tooltip};
|