@machinerd/js-module 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles/index.css +170 -26
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +243 -37
- package/dist/ui/index.d.mts +243 -37
- package/dist/ui/index.mjs +1 -1
- package/package.json +3 -1
package/dist/styles/index.css
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
5
5
|
:root, :host {
|
|
6
|
+
--komc-color-red-500: oklch(63.7% 0.237 25.331);
|
|
6
7
|
--komc-color-blue-500: oklch(62.3% 0.214 259.815);
|
|
7
8
|
--komc-color-blue-600: oklch(54.6% 0.245 262.881);
|
|
8
9
|
--komc-color-gray-100: oklch(96.7% 0.003 264.542);
|
|
@@ -11,10 +12,22 @@
|
|
|
11
12
|
--komc-color-neutral-100: oklch(97% 0 0);
|
|
12
13
|
--komc-color-neutral-200: oklch(92.2% 0 0);
|
|
13
14
|
--komc-color-neutral-300: oklch(87% 0 0);
|
|
15
|
+
--komc-color-neutral-400: oklch(70.8% 0 0);
|
|
14
16
|
--komc-color-neutral-900: oklch(20.5% 0 0);
|
|
15
17
|
--komc-color-black: #000;
|
|
16
18
|
--komc-color-white: #fff;
|
|
17
19
|
--komc-spacing: 0.25rem;
|
|
20
|
+
--komc-container-xs: 20rem;
|
|
21
|
+
--komc-container-sm: 24rem;
|
|
22
|
+
--komc-container-md: 28rem;
|
|
23
|
+
--komc-container-lg: 32rem;
|
|
24
|
+
--komc-container-xl: 36rem;
|
|
25
|
+
--komc-container-2xl: 42rem;
|
|
26
|
+
--komc-container-3xl: 48rem;
|
|
27
|
+
--komc-container-4xl: 56rem;
|
|
28
|
+
--komc-container-5xl: 64rem;
|
|
29
|
+
--komc-container-6xl: 72rem;
|
|
30
|
+
--komc-container-7xl: 80rem;
|
|
18
31
|
--komc-text-xs: 0.75rem;
|
|
19
32
|
--komc-text-xs--line-height: calc(1 / 0.75);
|
|
20
33
|
--komc-radius-sm: 0.25rem;
|
|
@@ -44,6 +57,9 @@
|
|
|
44
57
|
.komc\:relative {
|
|
45
58
|
position: relative;
|
|
46
59
|
}
|
|
60
|
+
.komc\:sticky {
|
|
61
|
+
position: sticky;
|
|
62
|
+
}
|
|
47
63
|
.komc\:top-0 {
|
|
48
64
|
top: calc(var(--komc-spacing) * 0);
|
|
49
65
|
}
|
|
@@ -92,12 +108,24 @@
|
|
|
92
108
|
.komc\:z-99 {
|
|
93
109
|
z-index: 99;
|
|
94
110
|
}
|
|
95
|
-
.komc\:
|
|
96
|
-
|
|
111
|
+
.komc\:z-1000 {
|
|
112
|
+
z-index: 1000;
|
|
113
|
+
}
|
|
114
|
+
.komc\:mx-auto {
|
|
115
|
+
margin-inline: auto;
|
|
116
|
+
}
|
|
117
|
+
.komc\:my-0 {
|
|
118
|
+
margin-block: calc(var(--komc-spacing) * 0);
|
|
97
119
|
}
|
|
98
120
|
.komc\:-mt-1 {
|
|
99
121
|
margin-top: calc(var(--komc-spacing) * -1);
|
|
100
122
|
}
|
|
123
|
+
.komc\:-mt-4 {
|
|
124
|
+
margin-top: calc(var(--komc-spacing) * -4);
|
|
125
|
+
}
|
|
126
|
+
.komc\:mt-1 {
|
|
127
|
+
margin-top: calc(var(--komc-spacing) * 1);
|
|
128
|
+
}
|
|
101
129
|
.komc\:-mr-1 {
|
|
102
130
|
margin-right: calc(var(--komc-spacing) * -1);
|
|
103
131
|
}
|
|
@@ -107,8 +135,11 @@
|
|
|
107
135
|
.komc\:-ml-1 {
|
|
108
136
|
margin-left: calc(var(--komc-spacing) * -1);
|
|
109
137
|
}
|
|
110
|
-
.komc
|
|
111
|
-
|
|
138
|
+
.komc\:-ml-4 {
|
|
139
|
+
margin-left: calc(var(--komc-spacing) * -4);
|
|
140
|
+
}
|
|
141
|
+
.komc\:block {
|
|
142
|
+
display: block;
|
|
112
143
|
}
|
|
113
144
|
.komc\:flex {
|
|
114
145
|
display: flex;
|
|
@@ -155,15 +186,33 @@
|
|
|
155
186
|
.komc\:h-16 {
|
|
156
187
|
height: calc(var(--komc-spacing) * 16);
|
|
157
188
|
}
|
|
189
|
+
.komc\:h-18 {
|
|
190
|
+
height: calc(var(--komc-spacing) * 18);
|
|
191
|
+
}
|
|
158
192
|
.komc\:h-20 {
|
|
159
193
|
height: calc(var(--komc-spacing) * 20);
|
|
160
194
|
}
|
|
195
|
+
.komc\:h-22 {
|
|
196
|
+
height: calc(var(--komc-spacing) * 22);
|
|
197
|
+
}
|
|
198
|
+
.komc\:h-22\.5 {
|
|
199
|
+
height: calc(var(--komc-spacing) * 22.5);
|
|
200
|
+
}
|
|
161
201
|
.komc\:h-24 {
|
|
162
202
|
height: calc(var(--komc-spacing) * 24);
|
|
163
203
|
}
|
|
204
|
+
.komc\:h-26 {
|
|
205
|
+
height: calc(var(--komc-spacing) * 26);
|
|
206
|
+
}
|
|
164
207
|
.komc\:h-28 {
|
|
165
208
|
height: calc(var(--komc-spacing) * 28);
|
|
166
209
|
}
|
|
210
|
+
.komc\:h-30 {
|
|
211
|
+
height: calc(var(--komc-spacing) * 30);
|
|
212
|
+
}
|
|
213
|
+
.komc\:h-50 {
|
|
214
|
+
height: calc(var(--komc-spacing) * 50);
|
|
215
|
+
}
|
|
167
216
|
.komc\:h-400 {
|
|
168
217
|
height: calc(var(--komc-spacing) * 400);
|
|
169
218
|
}
|
|
@@ -176,6 +225,12 @@
|
|
|
176
225
|
.komc\:h-full {
|
|
177
226
|
height: 100%;
|
|
178
227
|
}
|
|
228
|
+
.komc\:h-screen {
|
|
229
|
+
height: 100vh;
|
|
230
|
+
}
|
|
231
|
+
.komc\:min-h-10 {
|
|
232
|
+
min-height: calc(var(--komc-spacing) * 10);
|
|
233
|
+
}
|
|
179
234
|
.komc\:min-h-15 {
|
|
180
235
|
min-height: calc(var(--komc-spacing) * 15);
|
|
181
236
|
}
|
|
@@ -191,12 +246,63 @@
|
|
|
191
246
|
.komc\:w-max {
|
|
192
247
|
width: max-content;
|
|
193
248
|
}
|
|
249
|
+
.komc\:max-w-2xl {
|
|
250
|
+
max-width: var(--komc-container-2xl);
|
|
251
|
+
}
|
|
252
|
+
.komc\:max-w-3xl {
|
|
253
|
+
max-width: var(--komc-container-3xl);
|
|
254
|
+
}
|
|
255
|
+
.komc\:max-w-4xl {
|
|
256
|
+
max-width: var(--komc-container-4xl);
|
|
257
|
+
}
|
|
258
|
+
.komc\:max-w-5xl {
|
|
259
|
+
max-width: var(--komc-container-5xl);
|
|
260
|
+
}
|
|
261
|
+
.komc\:max-w-6xl {
|
|
262
|
+
max-width: var(--komc-container-6xl);
|
|
263
|
+
}
|
|
264
|
+
.komc\:max-w-7xl {
|
|
265
|
+
max-width: var(--komc-container-7xl);
|
|
266
|
+
}
|
|
194
267
|
.komc\:max-w-70 {
|
|
195
268
|
max-width: calc(var(--komc-spacing) * 70);
|
|
196
269
|
}
|
|
270
|
+
.komc\:max-w-330 {
|
|
271
|
+
max-width: calc(var(--komc-spacing) * 330);
|
|
272
|
+
}
|
|
273
|
+
.komc\:max-w-full {
|
|
274
|
+
max-width: 100%;
|
|
275
|
+
}
|
|
276
|
+
.komc\:max-w-lg {
|
|
277
|
+
max-width: var(--komc-container-lg);
|
|
278
|
+
}
|
|
279
|
+
.komc\:max-w-md {
|
|
280
|
+
max-width: var(--komc-container-md);
|
|
281
|
+
}
|
|
282
|
+
.komc\:max-w-sm {
|
|
283
|
+
max-width: var(--komc-container-sm);
|
|
284
|
+
}
|
|
285
|
+
.komc\:max-w-xl {
|
|
286
|
+
max-width: var(--komc-container-xl);
|
|
287
|
+
}
|
|
288
|
+
.komc\:max-w-xs {
|
|
289
|
+
max-width: var(--komc-container-xs);
|
|
290
|
+
}
|
|
291
|
+
.komc\:min-w-0 {
|
|
292
|
+
min-width: calc(var(--komc-spacing) * 0);
|
|
293
|
+
}
|
|
197
294
|
.komc\:shrink-0 {
|
|
198
295
|
flex-shrink: 0;
|
|
199
296
|
}
|
|
297
|
+
.komc\:grow {
|
|
298
|
+
flex-grow: 1;
|
|
299
|
+
}
|
|
300
|
+
.komc\:grow-0 {
|
|
301
|
+
flex-grow: 0;
|
|
302
|
+
}
|
|
303
|
+
.komc\:basis-full {
|
|
304
|
+
flex-basis: 100%;
|
|
305
|
+
}
|
|
200
306
|
.komc\:-translate-x-1\/2 {
|
|
201
307
|
--tw-translate-x: calc(calc(1/2 * 100%) * -1);
|
|
202
308
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -230,9 +336,15 @@
|
|
|
230
336
|
.komc\:grid-cols-4 {
|
|
231
337
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
232
338
|
}
|
|
339
|
+
.komc\:flex-col {
|
|
340
|
+
flex-direction: column;
|
|
341
|
+
}
|
|
233
342
|
.komc\:items-center {
|
|
234
343
|
align-items: center;
|
|
235
344
|
}
|
|
345
|
+
.komc\:justify-between {
|
|
346
|
+
justify-content: space-between;
|
|
347
|
+
}
|
|
236
348
|
.komc\:justify-center {
|
|
237
349
|
justify-content: center;
|
|
238
350
|
}
|
|
@@ -304,9 +416,15 @@
|
|
|
304
416
|
--tw-border-style: none;
|
|
305
417
|
border-style: none;
|
|
306
418
|
}
|
|
419
|
+
.komc\:border-black {
|
|
420
|
+
border-color: var(--komc-color-black);
|
|
421
|
+
}
|
|
307
422
|
.komc\:border-neutral-200 {
|
|
308
423
|
border-color: var(--komc-color-neutral-200);
|
|
309
424
|
}
|
|
425
|
+
.komc\:border-red-500 {
|
|
426
|
+
border-color: var(--komc-color-red-500);
|
|
427
|
+
}
|
|
310
428
|
.komc\:border-transparent {
|
|
311
429
|
border-color: transparent;
|
|
312
430
|
}
|
|
@@ -328,9 +446,6 @@
|
|
|
328
446
|
.komc\:bg-\[rgb\(95\,95\,96\)\] {
|
|
329
447
|
background-color: rgb(95,95,96);
|
|
330
448
|
}
|
|
331
|
-
.komc\:bg-black\! {
|
|
332
|
-
background-color: var(--komc-color-black) !important;
|
|
333
|
-
}
|
|
334
449
|
.komc\:bg-blue-500 {
|
|
335
450
|
background-color: var(--komc-color-blue-500);
|
|
336
451
|
}
|
|
@@ -346,15 +461,21 @@
|
|
|
346
461
|
.komc\:bg-neutral-100 {
|
|
347
462
|
background-color: var(--komc-color-neutral-100);
|
|
348
463
|
}
|
|
464
|
+
.komc\:bg-neutral-200 {
|
|
465
|
+
background-color: var(--komc-color-neutral-200);
|
|
466
|
+
}
|
|
467
|
+
.komc\:bg-neutral-300 {
|
|
468
|
+
background-color: var(--komc-color-neutral-300);
|
|
469
|
+
}
|
|
470
|
+
.komc\:bg-neutral-400\! {
|
|
471
|
+
background-color: var(--komc-color-neutral-400) !important;
|
|
472
|
+
}
|
|
349
473
|
.komc\:bg-transparent {
|
|
350
474
|
background-color: transparent;
|
|
351
475
|
}
|
|
352
476
|
.komc\:bg-white {
|
|
353
477
|
background-color: var(--komc-color-white);
|
|
354
478
|
}
|
|
355
|
-
.komc\:p-0 {
|
|
356
|
-
padding: calc(var(--komc-spacing) * 0);
|
|
357
|
-
}
|
|
358
479
|
.komc\:p-1 {
|
|
359
480
|
padding: calc(var(--komc-spacing) * 1);
|
|
360
481
|
}
|
|
@@ -367,6 +488,12 @@
|
|
|
367
488
|
.komc\:px-2 {
|
|
368
489
|
padding-inline: calc(var(--komc-spacing) * 2);
|
|
369
490
|
}
|
|
491
|
+
.komc\:pt-4 {
|
|
492
|
+
padding-top: calc(var(--komc-spacing) * 4);
|
|
493
|
+
}
|
|
494
|
+
.komc\:pl-4 {
|
|
495
|
+
padding-left: calc(var(--komc-spacing) * 4);
|
|
496
|
+
}
|
|
370
497
|
.komc\:text-xs {
|
|
371
498
|
font-size: var(--komc-text-xs);
|
|
372
499
|
line-height: var(--tw-leading, var(--komc-text-xs--line-height));
|
|
@@ -397,6 +524,11 @@
|
|
|
397
524
|
--tw-drop-shadow: var(--tw-drop-shadow-size);
|
|
398
525
|
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,);
|
|
399
526
|
}
|
|
527
|
+
.komc\:transition-all {
|
|
528
|
+
transition-property: all;
|
|
529
|
+
transition-timing-function: var(--tw-ease, var(--komc-default-transition-timing-function));
|
|
530
|
+
transition-duration: var(--tw-duration, var(--komc-default-transition-duration));
|
|
531
|
+
}
|
|
400
532
|
.komc\:transition-colors {
|
|
401
533
|
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
|
|
402
534
|
transition-timing-function: var(--tw-ease, var(--komc-default-transition-timing-function));
|
|
@@ -495,6 +627,13 @@
|
|
|
495
627
|
}
|
|
496
628
|
}
|
|
497
629
|
}
|
|
630
|
+
.komc\:hover\:bg-neutral-200 {
|
|
631
|
+
&:hover {
|
|
632
|
+
@media (hover: hover) {
|
|
633
|
+
background-color: var(--komc-color-neutral-200);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
498
637
|
.komc\:focus\:border-neutral-300 {
|
|
499
638
|
&:focus {
|
|
500
639
|
border-color: var(--komc-color-neutral-300);
|
|
@@ -520,14 +659,14 @@
|
|
|
520
659
|
opacity: 50%;
|
|
521
660
|
}
|
|
522
661
|
}
|
|
523
|
-
.komc\:xl\:
|
|
662
|
+
.komc\:xl\:max-w-full {
|
|
524
663
|
@media (width >= 80rem) {
|
|
525
|
-
|
|
664
|
+
max-width: 100%;
|
|
526
665
|
}
|
|
527
666
|
}
|
|
528
|
-
.komc
|
|
529
|
-
|
|
530
|
-
|
|
667
|
+
.komc\:xl\:p-10 {
|
|
668
|
+
@media (width >= 80rem) {
|
|
669
|
+
padding: calc(var(--komc-spacing) * 10);
|
|
531
670
|
}
|
|
532
671
|
}
|
|
533
672
|
.komc\:\[\&\>input\]\:h-full {
|
|
@@ -540,17 +679,6 @@
|
|
|
540
679
|
width: 100%;
|
|
541
680
|
}
|
|
542
681
|
}
|
|
543
|
-
.komc\:\[\&\>input\]\:border-none {
|
|
544
|
-
&>input {
|
|
545
|
-
--tw-border-style: none;
|
|
546
|
-
border-style: none;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
.komc\:\[\&\>input\]\:p-0 {
|
|
550
|
-
&>input {
|
|
551
|
-
padding: calc(var(--komc-spacing) * 0);
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
682
|
.komc\:\[\&\>input\]\:outline-none {
|
|
555
683
|
&>input {
|
|
556
684
|
--tw-outline-style: none;
|
|
@@ -574,6 +702,22 @@
|
|
|
574
702
|
}
|
|
575
703
|
}
|
|
576
704
|
}
|
|
705
|
+
@layer base {
|
|
706
|
+
[data-komc], [data-komc] *, [data-komc] *::before, [data-komc] *::after {
|
|
707
|
+
margin: 0;
|
|
708
|
+
padding: 0;
|
|
709
|
+
border: 0 solid;
|
|
710
|
+
background-color: transparent;
|
|
711
|
+
box-sizing: border-box;
|
|
712
|
+
line-height: 1.5;
|
|
713
|
+
}
|
|
714
|
+
button[data-komc] {
|
|
715
|
+
cursor: pointer;
|
|
716
|
+
opacity: 1;
|
|
717
|
+
color: inherit;
|
|
718
|
+
border-radius: 0;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
577
721
|
@property --tw-translate-x {
|
|
578
722
|
syntax: "*";
|
|
579
723
|
inherits: false;
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-CDkao6z3.cjs`),n=require(`../hooks-DPYIex_y.cjs`);let r=require(`lodash-es`),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(`react-dom`);function l({className:e,items:t,render:n,...r}){return(0,o.jsx)(`nav`,{className:(0,i.default)(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0 komc:box-border`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...r,children:(0,o.jsx)(`div`,{className:`komc:grid komc:min-h-15 komc:p-0`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>(0,o.jsx)(a.default.Fragment,{children:n(e)},t))})})}const u=(0,s.cva)(t.f(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200 komc:cursor-pointer`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none komc:box-border`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}}),d=(0,a.forwardRef)(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:s=`blue`,className:c,...l},d)=>(0,o.jsx)(`button`,{ref:d,type:t,className:u({size:n,outline:i,gap:r,rounded:a,variant:s,className:c}),...l,children:e}));var f=d;function p({condition:e,wrapper:t,children:n}){return e?t(n):n}const m=(0,s.cva)(t.f(`komc:flex komc:items-center komc:w-full komc:px-2 komc:box-border`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:border-none komc:[&>input]:h-full`,`komc:[&>input]:p-0 komc:[&>input]:m-0`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}}),h=(0,a.forwardRef)(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:s,...c},l)=>(0,o.jsxs)(`div`,{className:m({size:n,gap:r,outline:i,rounded:a,className:s}),children:[e,(0,o.jsx)(`input`,{ref:l,type:`text`,...c}),t]}));var g=h;const _=(0,s.cva)(t.f(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function v({size:e,rounded:t,width:n,height:r,className:i,...a}){let s=n?typeof n==`string`?n:`${n}px`:void 0,c=r?typeof r==`string`?r:`${r}px`:void 0;return(0,o.jsx)(`div`,{className:_({size:e,rounded:t,className:i}),style:{width:s,height:c},...a})}function y({children:e,setOpen:t}){return(0,o.jsx)(`div`,{className:(0,i.default)(`komc:inline-flex komc:shrink-0 komc:justify-center komc:items-center`,`komc:bg-transparent komc:border-none komc:outline-none`,`komc:p-0 komc:m-0 komc:box-border`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const b=(0,s.cva)(t.f(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2`,`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)]`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-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:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-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:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-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`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}}),x=(0,a.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,o.jsx)(`div`,{ref:a,role:`tooltip`,className:b({portal:e,placement:r,className:n}),...i,children:t}));var S=x;const C=(0,s.cva)(t.f(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.f(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.f(`komc:bottom-full komc:-mb-1 komc:left-1/2`),left:t.f(`komc:left-full komc:-ml-1 komc:top-1/2`),right:t.f(`komc:right-full komc:-mr-1 komc:top-1/2`),"top-start":t.f(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.f(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.f(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.f(`komc:bottom-full komc:-mb-1 komc:right-5`),"left-start":t.f(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":t.f(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":t.f(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":t.f(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}}),w=({placement:e,className:t,offset:n,style:r,...i})=>{let s=(0,a.useMemo)(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return(0,o.jsx)(`div`,{className:C({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var T=w;const E=24,D=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function O({placement:e,className:t,content:n,open:s,hiddenRef:l,containerRef:u}){let[d,f]=(0,a.useState)(!1),p=(0,a.useRef)(null),[m,h]=(0,a.useState)(e),[g,_]=(0,a.useState)({top:0,left:0}),[v,y]=(0,a.useState)({x:0,y:0}),b=(0,a.useCallback)((0,r.debounce)(()=>{let e=u?.current,t=l.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(`-`),c=i+n.top,d=a+n.left+n.width/2-r.width/2;switch(o){case`top`:c-=r.height;break;case`bottom`:c+=n.height;break;case`left`:c+=n.height/2-r.height/2,d-=r.width/2+n.width/2;break;case`right`:c+=n.height/2-r.height/2,d+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:c+=r.height/2+n.height/2-24;break;case`end`:c-=r.height/2+n.height/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),_({top:c,left:f}),y({x:d-f,y:0})},50),[m]),x=(0,a.useCallback)((0,r.debounce)(()=>{if(!l.current)return;let{top:t,height:n}=l.current.getBoundingClientRect();h(r=>{let i=e;return t+n>=window.innerHeight?i=D(r,`top`):t<0&&(i=D(r,`bottom`)),i})},50),[e]);return(0,a.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,a.useEffect)(()=>{d&&b()},[d,b]),d?(0,c.createPortal)((0,o.jsxs)(S,{ref:p,portal:!0,placement:m,className:(0,i.default)(t,s?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(T,{placement:m,offset:v})]}),document.body):null}const k=(0,a.forwardRef)(({children:e,content:t,defaultOpen:r=!1,className:s,placement:c=`top`},l)=>{let[u,d]=(0,a.useState)(r),f=(0,a.useRef)(null),p=(0,a.useRef)(null);return n.t({ref:f,setOpen:d}),(0,o.jsxs)(`div`,{ref:f,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,o.jsx)(y,{setOpen:d,children:e}),(0,o.jsx)(O,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(S,{ref:p,role:`presentation`,placement:c,className:(0,i.default)(`komc:opacity-0 komc:invisible`,s),children:(0,o.jsx)(`span`,{children:t})})]})});var A=k;exports.BottomAppBar=l,exports.Button=f,exports.ConditionalWrapper=p,exports.Input=g,exports.Skeleton=v,exports.Tooltip=A;
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-CDkao6z3.cjs`),n=require(`../hooks-DPYIex_y.cjs`);let r=require(`lodash-es`),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`);function u({className:e,items:t,render:n,...r}){return(0,o.jsx)(`nav`,{"data-komc":!0,className:(0,i.default)(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...r,children:(0,o.jsx)(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>(0,o.jsx)(a.default.Fragment,{children:n(e)},t))})})}const d=(0,s.cva)(t.f(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}}),f=(0,a.forwardRef)(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:s=`blue`,className:c,...l},u)=>(0,o.jsx)(`button`,{ref:u,type:t,"data-komc":!0,className:d({size:n,outline:i,gap:r,rounded:a,variant:s,className:c}),...l,children:e}));var p=f;const m=a.default.createContext(null);function h(){let e=a.default.useContext(m);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function g({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:s,children:l,...u}){let[d,f]=(0,c.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[p,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)(()=>{f?.scrollPrev()},[f]),b=(0,a.useCallback)(()=>{f?.scrollNext()},[f]),x=(0,a.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),y()):e.key===`ArrowRight`&&(e.preventDefault(),b())},[y,b]);return(0,a.useEffect)(()=>{!f||!r||r(f)},[f,r]),(0,a.useEffect)(()=>{if(f)return v(f),f.on(`reInit`,v),f.on(`select`,v),()=>{f?.off(`select`,v)}},[f,v]),(0,o.jsx)(m.Provider,{value:{carouselRef:d,api:f,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:p,canScrollNext:g},children:(0,o.jsx)(`div`,{"data-komc":!0,onKeyDownCapture:x,className:t.f(`komc:relative`,s),...u,children:l})})}function _({className:e,...n}){let{carouselRef:r,orientation:i}=h();return(0,o.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,o.jsx)(`div`,{className:t.f(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function v({className:e,...n}){let{orientation:r}=h();return(0,o.jsx)(`div`,{"data-komc":!0,className:t.f(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function y({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:a}=h();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function b({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:a}=h();return(0,o.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!a,className:(0,i.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function x({condition:e,wrapper:t,children:n}){return e?t(n):n}const S=(0,s.cva)(`komc:flex komc:flex-col komc:w-full komc:max-w-7xl komc:mx-auto`,{variants:{maxWidth:{none:``,xs:`komc:max-w-xs`,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`,"3xl":`komc:max-w-3xl`,"4xl":`komc:max-w-4xl`,"5xl":`komc:max-w-5xl`,"6xl":`komc:max-w-6xl`,"7xl":`komc:max-w-7xl`,full:`komc:max-w-full`}},defaultVariants:{maxWidth:`full`}});function C({className:e,children:t,maxWidth:n,...r}){return(0,o.jsx)(`footer`,{"data-komc":!0,className:(0,i.default)(`komc:block komc:w-full komc:h-full`,`komc:bg-white komc:border-t komc:border-neutral-200`,e),...r,children:(0,o.jsx)(`div`,{className:S({maxWidth:n}),children:t})})}const w=(0,s.cva)(t.f(`komc:flex komc:items-center`,`komc:mx-auto komc:min-h-10`),{variants:{maxWidth:{none:``,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`,"3xl":`komc:max-w-3xl`,"4xl":`komc:max-w-4xl`,"5xl":`komc:max-w-5xl`,"6xl":`komc:max-w-6xl`,"7xl":`komc:max-w-7xl`,"8xl":`komc:max-w-330`,full:`komc:max-w-full`},size:{sm:`komc:h-10`,md:`komc:h-12`,lg:`komc:h-14`,xl:`komc:h-16`,"2xl":`komc:h-18`,"3xl":`komc:h-20`,"4xl":`komc:h-22`,"4.25xl":`komc:h-22.5`,"5xl":`komc:h-24`,"6xl":`komc:h-26`,"7xl":`komc:h-28`,"8xl":`komc:h-30`,full:`komc:h-full`}},defaultVariants:{maxWidth:`full`,size:`xl`}});function T({children:e,maxWidth:t,size:n,className:r,...a}){return(0,o.jsx)(`header`,{"data-komc":!0,className:(0,i.default)(`komc:w-full komc:sticky komc:top-0 komc:z-1000 komc:bg-white`,`komc:transition-all komc:duration-200`,r),...a,children:(0,o.jsx)(`div`,{className:w({maxWidth:t,size:n}),children:e})})}const E=(0,s.cva)(t.f(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}}),D=(0,a.forwardRef)(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:s,...c},l)=>(0,o.jsxs)(`div`,{"data-komc":!0,className:E({size:n,gap:r,outline:i,rounded:a,className:s}),children:[e,(0,o.jsx)(`input`,{ref:l,type:`text`,...c}),t]}));var O=D;const k=(0,s.cva)(`komc:w-full komc:mx-auto komc:relative`,{variants:{type:{main:`komc:flex komc:flex-col`,content:`komc:grow komc:my-0`},maxWidth:{none:``,xs:`komc:max-w-xs komc:xl:max-w-full`,sm:`komc:max-w-sm komc:xl:max-w-full`,md:`komc:max-w-md komc:xl:max-w-full`,lg:`komc:max-w-lg komc:xl:max-w-full`,xl:`komc:max-w-xl komc:xl:max-w-full`,"2xl":`komc:max-w-2xl komc:xl:max-w-full`,"3xl":`komc:max-w-3xl komc:xl:max-w-full`,full:`komc:max-w-full`}},defaultVariants:{type:`main`,maxWidth:`full`}});function A({children:e,className:t,type:n,maxWidth:r,...i}){return(0,o.jsx)(`div`,{"data-komc":!0,className:k({type:n,maxWidth:r,className:t}),...i,children:e})}const j=(0,s.cva)(t.f(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function M({size:e,rounded:t,width:n,height:r,className:i,...a}){let s=n?typeof n==`string`?n:`${n}px`:void 0,c=r?typeof r==`string`?r:`${r}px`:void 0;return(0,o.jsx)(`div`,{"data-komc":!0,className:j({size:e,rounded:t,className:i}),style:{width:s,height:c},...a})}function N({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 P=(0,s.cva)(t.f(`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:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-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:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-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:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-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`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}}),F=(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:P({portal:e,placement:r,className:n}),...i,children:t}));var I=F;const L=(0,s.cva)(t.f(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.f(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.f(`komc:bottom-full komc:-mb-1 komc:left-1/2`),left:t.f(`komc:left-full komc:-ml-1 komc:top-1/2`),right:t.f(`komc:right-full komc:-mr-1 komc:top-1/2`),"top-start":t.f(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.f(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.f(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.f(`komc:bottom-full komc:-mb-1 komc:right-5`),"left-start":t.f(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":t.f(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":t.f(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":t.f(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}}),R=({placement:e,className:t,offset:n,style:r,...i})=>{let s=(0,a.useMemo)(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return(0,o.jsx)(`div`,{className:L({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${s}`},...i})};var z=R;const B=24,V=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function H({placement:e,className:t,content:n,open:s,hiddenRef:c,containerRef:u}){let[d,f]=(0,a.useState)(!1),p=(0,a.useRef)(null),[m,h]=(0,a.useState)(e),[g,_]=(0,a.useState)({top:0,left:0}),[v,y]=(0,a.useState)({x:0,y:0}),b=(0,a.useCallback)((0,r.debounce)(()=>{let e=u?.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(`-`),l=i+n.top,d=a+n.left+n.width/2-r.width/2;switch(o){case`top`:l-=r.height;break;case`bottom`:l+=n.height;break;case`left`:l+=n.height/2-r.height/2,d-=r.width/2+n.width/2;break;case`right`:l+=n.height/2-r.height/2,d+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:l+=r.height/2+n.height/2-24;break;case`end`:l-=r.height/2+n.height/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),_({top:l,left:f}),y({x:d-f,y:0})},50),[m]),x=(0,a.useCallback)((0,r.debounce)(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();h(r=>{let i=e;return t+n>=window.innerHeight?i=V(r,`top`):t<0&&(i=V(r,`bottom`)),i})},50),[e]);return(0,a.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,a.useEffect)(()=>{d&&b()},[d,b]),d?(0,l.createPortal)((0,o.jsxs)(I,{ref:p,portal:!0,"data-komc":!0,placement:m,className:(0,i.default)(t,s?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,o.jsx)(`span`,{children:n}),(0,o.jsx)(z,{placement:m,offset:v})]}),document.body):null}const U=(0,a.forwardRef)(({children:e,content:t,defaultOpen:r=!1,className:s,placement:c=`top`},l)=>{let[u,d]=(0,a.useState)(r),f=(0,a.useRef)(null),p=(0,a.useRef)(null);return n.t({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)(N,{setOpen:d,children:e}),(0,o.jsx)(H,{placement:c,className:s,open:u,content:t,hiddenRef:p,containerRef:f}),(0,o.jsx)(I,{ref:p,role:`presentation`,placement:c,className:(0,i.default)(`komc:opacity-0 komc:invisible`,s),children:(0,o.jsx)(`span`,{children:t})})]})});var W=U;exports.BottomAppBar=u,exports.Button=p,exports.Carousel=g,exports.CarouselItem=v,exports.CarouselNext=b,exports.CarouselPrevious=y,exports.CarouselWrapper=_,exports.ConditionalWrapper=x,exports.Footer=C,exports.Header=T,exports.Input=O,exports.Layout=A,exports.Skeleton=M,exports.Tooltip=W;
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import React$1, { HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
|
+
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
import
|
|
5
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
6
7
|
|
|
7
8
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
8
9
|
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
9
10
|
items: T[];
|
|
10
11
|
render: (item: T) => React$1.ReactNode;
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @param items - Items to render
|
|
15
|
+
* @param render - Render function
|
|
16
|
+
*/
|
|
12
17
|
declare function BottomAppBar<T>({
|
|
13
18
|
className,
|
|
14
19
|
items,
|
|
@@ -17,14 +22,14 @@ declare function BottomAppBar<T>({
|
|
|
17
22
|
}: BottomAppBarProps<T>): React$1.ReactNode;
|
|
18
23
|
//#endregion
|
|
19
24
|
//#region src/ui/button/button.d.ts
|
|
20
|
-
declare const classes$
|
|
25
|
+
declare const classes$5: (props?: ({
|
|
21
26
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
22
|
-
gap?: "xs" | "sm" | "md" | "lg" | "xl" |
|
|
27
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
23
28
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
24
|
-
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "
|
|
29
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "2.5xl" | null | undefined;
|
|
25
30
|
variant?: "default" | "ghost" | "white" | "blue" | "night" | "charcoal" | "slate" | "red" | "yellow" | "black" | null | undefined;
|
|
26
|
-
} &
|
|
27
|
-
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$
|
|
31
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
32
|
+
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$5> {
|
|
28
33
|
/**
|
|
29
34
|
* @param size - Height of the button
|
|
30
35
|
* @default md - 40px
|
|
@@ -38,7 +43,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
38
43
|
* - 2xl: 52px
|
|
39
44
|
* - 3xl: 56px
|
|
40
45
|
*/
|
|
41
|
-
size?: VariantProps<typeof classes$
|
|
46
|
+
size?: VariantProps<typeof classes$5>['size'];
|
|
42
47
|
/**
|
|
43
48
|
* @param gap - Gap between the button and the content
|
|
44
49
|
* @default sm - 8px
|
|
@@ -50,7 +55,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
50
55
|
* - lg: 16px
|
|
51
56
|
* - xl: 20px
|
|
52
57
|
*/
|
|
53
|
-
gap?: VariantProps<typeof classes$
|
|
58
|
+
gap?: VariantProps<typeof classes$5>['gap'];
|
|
54
59
|
/**
|
|
55
60
|
* @param rounded - Border radius of the button
|
|
56
61
|
* @default sm
|
|
@@ -65,7 +70,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
65
70
|
* - 3xl: 24px
|
|
66
71
|
* - full: 100%
|
|
67
72
|
*/
|
|
68
|
-
rounded?: VariantProps<typeof classes$
|
|
73
|
+
rounded?: VariantProps<typeof classes$5>['rounded'];
|
|
69
74
|
/**
|
|
70
75
|
* @param variant - Variant of the button
|
|
71
76
|
* @default blue
|
|
@@ -81,21 +86,100 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
81
86
|
* - yellow
|
|
82
87
|
* - black
|
|
83
88
|
*/
|
|
84
|
-
variant?: VariantProps<typeof classes$
|
|
89
|
+
variant?: VariantProps<typeof classes$5>['variant'];
|
|
85
90
|
disabled?: boolean;
|
|
86
91
|
children?: React.ReactNode;
|
|
87
92
|
}
|
|
88
93
|
/**
|
|
89
|
-
* @param children - Children of the button
|
|
90
|
-
* @param type - Type of the button
|
|
91
94
|
* @param size - Size of the button
|
|
92
95
|
* @param gap - Gap between the button and the content
|
|
93
96
|
* @param outline - Outline of the button
|
|
94
97
|
* @param rounded - Border radius of the button
|
|
95
98
|
* @param variant - Variant of the button
|
|
96
|
-
* @param className - Class name
|
|
97
99
|
*/
|
|
98
|
-
declare const Button:
|
|
100
|
+
declare const Button: react2.ForwardRefExoticComponent<ButtonProps & react2.RefAttributes<HTMLButtonElement>>;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/ui/carousel/carousel-context.d.ts
|
|
103
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
104
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
105
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
106
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
107
|
+
interface CarouselProps {
|
|
108
|
+
options?: CarouselOptions;
|
|
109
|
+
plugins?: CarouselPlugin;
|
|
110
|
+
orientation?: 'horizontal' | 'vertical';
|
|
111
|
+
setApi?: (api: CarouselApi) => void;
|
|
112
|
+
}
|
|
113
|
+
type CarouselContextProps = {
|
|
114
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
115
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
116
|
+
scrollPrev: () => void;
|
|
117
|
+
scrollNext: () => void;
|
|
118
|
+
canScrollPrev: boolean;
|
|
119
|
+
canScrollNext: boolean;
|
|
120
|
+
} & CarouselProps;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/ui/carousel/carousel.d.ts
|
|
123
|
+
interface CarouselProps$1 extends ComponentProps<'div'>, CarouselProps {
|
|
124
|
+
/**
|
|
125
|
+
* @param orientation - Orientation of the carousel
|
|
126
|
+
* @default horizontal
|
|
127
|
+
* @property
|
|
128
|
+
* - horizontal
|
|
129
|
+
* - vertical
|
|
130
|
+
*/
|
|
131
|
+
orientation?: 'horizontal' | 'vertical';
|
|
132
|
+
/**
|
|
133
|
+
* @param options - Options of the carousel
|
|
134
|
+
* @default {}
|
|
135
|
+
*/
|
|
136
|
+
options?: CarouselProps['options'];
|
|
137
|
+
/**
|
|
138
|
+
* @param setApi - Set the API of the carousel
|
|
139
|
+
* @default undefined
|
|
140
|
+
*/
|
|
141
|
+
setApi?: CarouselProps['setApi'];
|
|
142
|
+
/**
|
|
143
|
+
* @param plugins - Plugins of the carousel
|
|
144
|
+
* @default []
|
|
145
|
+
*/
|
|
146
|
+
plugins?: CarouselProps['plugins'];
|
|
147
|
+
}
|
|
148
|
+
declare function Carousel({
|
|
149
|
+
orientation,
|
|
150
|
+
options,
|
|
151
|
+
setApi,
|
|
152
|
+
plugins,
|
|
153
|
+
className,
|
|
154
|
+
children,
|
|
155
|
+
...props
|
|
156
|
+
}: CarouselProps$1): react_jsx_runtime1.JSX.Element;
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/ui/carousel/carousel-wrapper.d.ts
|
|
159
|
+
declare function CarouselWrapper({
|
|
160
|
+
className,
|
|
161
|
+
...props
|
|
162
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/ui/carousel/carousel-item.d.ts
|
|
165
|
+
declare function CarouselItem({
|
|
166
|
+
className,
|
|
167
|
+
...props
|
|
168
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/ui/carousel/carousel-previous.d.ts
|
|
171
|
+
declare function CarouselPrevious({
|
|
172
|
+
children,
|
|
173
|
+
className,
|
|
174
|
+
...props
|
|
175
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/ui/carousel/carousel-next.d.ts
|
|
178
|
+
declare function CarouselNext({
|
|
179
|
+
children,
|
|
180
|
+
className,
|
|
181
|
+
...props
|
|
182
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime1.JSX.Element;
|
|
99
183
|
//#endregion
|
|
100
184
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
101
185
|
interface ConditionalWrapperProps {
|
|
@@ -112,16 +196,103 @@ declare function ConditionalWrapper({
|
|
|
112
196
|
condition,
|
|
113
197
|
wrapper,
|
|
114
198
|
children
|
|
115
|
-
}: ConditionalWrapperProps):
|
|
199
|
+
}: ConditionalWrapperProps): react2.ReactNode;
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/ui/footer/footer.d.ts
|
|
202
|
+
declare const classes$4: (props?: ({
|
|
203
|
+
maxWidth?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | null | undefined;
|
|
204
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
205
|
+
interface FooterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$4> {
|
|
206
|
+
/**
|
|
207
|
+
* @param maxWidth - Maximum width of the footer
|
|
208
|
+
* @default full
|
|
209
|
+
* @property
|
|
210
|
+
* - none: 0
|
|
211
|
+
* - xs: 320px
|
|
212
|
+
* - sm: 384px
|
|
213
|
+
* - md: 448px
|
|
214
|
+
* - lg: 512px
|
|
215
|
+
* - xl: 576px
|
|
216
|
+
* - 2xl: 672px
|
|
217
|
+
* - 3xl: 768px
|
|
218
|
+
* - 4xl: 896px
|
|
219
|
+
* - 5xl: 1024px
|
|
220
|
+
* - 6xl: 1152px
|
|
221
|
+
* - 7xl: 1280px
|
|
222
|
+
* - full: 100%
|
|
223
|
+
*/
|
|
224
|
+
maxWidth?: VariantProps<typeof classes$4>['maxWidth'];
|
|
225
|
+
}
|
|
226
|
+
declare function Footer({
|
|
227
|
+
className,
|
|
228
|
+
children,
|
|
229
|
+
maxWidth,
|
|
230
|
+
...props
|
|
231
|
+
}: FooterProps): react_jsx_runtime1.JSX.Element;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/ui/header/header.d.ts
|
|
234
|
+
declare const classes$3: (props?: ({
|
|
235
|
+
maxWidth?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | "8xl" | null | undefined;
|
|
236
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | "8xl" | "4.25xl" | null | undefined;
|
|
237
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
238
|
+
interface HeaderProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$3> {
|
|
239
|
+
children?: React.ReactNode;
|
|
240
|
+
/**
|
|
241
|
+
* @param maxWidth - Maximum width of the header
|
|
242
|
+
* @default full
|
|
243
|
+
* @property
|
|
244
|
+
* - none: 0
|
|
245
|
+
* - xs: 320px
|
|
246
|
+
* - sm: 384px
|
|
247
|
+
* - md: 448px
|
|
248
|
+
* - lg: 512px
|
|
249
|
+
* - xl: 576px
|
|
250
|
+
* - 2xl: 672px
|
|
251
|
+
* - 3xl: 768px
|
|
252
|
+
* - 4xl: 896px
|
|
253
|
+
* - 5xl: 1024px
|
|
254
|
+
* - 6xl: 1152px
|
|
255
|
+
* - 7xl: 1280px
|
|
256
|
+
* - 8xl: 1320px
|
|
257
|
+
* - full: 100%
|
|
258
|
+
*/
|
|
259
|
+
maxWidth?: VariantProps<typeof classes$3>['maxWidth'];
|
|
260
|
+
/**
|
|
261
|
+
* @param size - Size of the header
|
|
262
|
+
* @default xl
|
|
263
|
+
* @property
|
|
264
|
+
* - sm: 40px
|
|
265
|
+
* - md: 48px
|
|
266
|
+
* - lg: 56px
|
|
267
|
+
* - xl: 64px
|
|
268
|
+
* - 2xl: 72px
|
|
269
|
+
* - 3xl: 88px
|
|
270
|
+
* - 4xl: 80px
|
|
271
|
+
* - 4.25xl: 90px
|
|
272
|
+
* - 5xl: 96px
|
|
273
|
+
* - 6xl: 104px
|
|
274
|
+
* - 7xl: 112px
|
|
275
|
+
* - 8xl: 120px
|
|
276
|
+
* - full: 100%
|
|
277
|
+
*/
|
|
278
|
+
size?: VariantProps<typeof classes$3>['size'];
|
|
279
|
+
}
|
|
280
|
+
declare function Header({
|
|
281
|
+
children,
|
|
282
|
+
maxWidth,
|
|
283
|
+
size,
|
|
284
|
+
className,
|
|
285
|
+
...props
|
|
286
|
+
}: HeaderProps): react_jsx_runtime1.JSX.Element;
|
|
116
287
|
//#endregion
|
|
117
288
|
//#region src/ui/input/input.d.ts
|
|
118
|
-
declare const classes$
|
|
289
|
+
declare const classes$2: (props?: ({
|
|
119
290
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
120
|
-
gap?: "xs" | "sm" | "md" | "lg" | "xl" |
|
|
291
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
121
292
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
122
|
-
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" |
|
|
123
|
-
} &
|
|
124
|
-
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$
|
|
293
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
294
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
295
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$2> {
|
|
125
296
|
/**
|
|
126
297
|
* @param size - Height of the input
|
|
127
298
|
* @default lg - 44px
|
|
@@ -135,7 +306,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
135
306
|
* - 2xl: 52px
|
|
136
307
|
* - 3xl: 56px
|
|
137
308
|
*/
|
|
138
|
-
size?: VariantProps<typeof classes$
|
|
309
|
+
size?: VariantProps<typeof classes$2>['size'];
|
|
139
310
|
/**
|
|
140
311
|
* @param gap - Gap between the input and the prefix/suffix
|
|
141
312
|
* @default xl - 20px
|
|
@@ -147,8 +318,8 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
147
318
|
* - lg: 16px
|
|
148
319
|
* - xl: 20px
|
|
149
320
|
*/
|
|
150
|
-
gap?: VariantProps<typeof classes$
|
|
151
|
-
outline?: VariantProps<typeof classes$
|
|
321
|
+
gap?: VariantProps<typeof classes$2>['gap'];
|
|
322
|
+
outline?: VariantProps<typeof classes$2>['outline'];
|
|
152
323
|
/**
|
|
153
324
|
* @param rounded - Border radius of the input
|
|
154
325
|
* @default lg
|
|
@@ -160,7 +331,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
160
331
|
* - xl: 12px
|
|
161
332
|
* - 2xl: 16px
|
|
162
333
|
*/
|
|
163
|
-
rounded?: VariantProps<typeof classes$
|
|
334
|
+
rounded?: VariantProps<typeof classes$2>['rounded'];
|
|
164
335
|
prefix?: React.ReactNode;
|
|
165
336
|
surffix?: React.ReactNode;
|
|
166
337
|
}
|
|
@@ -171,15 +342,52 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
171
342
|
* @param gap - Gap between the input and the prefix/suffix
|
|
172
343
|
* @param outline - Outline of the input
|
|
173
344
|
* @param rounded - Border radius of the input
|
|
174
|
-
* @param className - Class name
|
|
175
345
|
*/
|
|
176
|
-
declare const Input:
|
|
346
|
+
declare const Input: react2.ForwardRefExoticComponent<InputProps & react2.RefAttributes<HTMLInputElement>>;
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/ui/layout/layout.d.ts
|
|
349
|
+
declare const classes$1: (props?: ({
|
|
350
|
+
type?: "content" | "main" | null | undefined;
|
|
351
|
+
maxWidth?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
352
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
353
|
+
interface LayoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$1> {
|
|
354
|
+
/**
|
|
355
|
+
* @param type - Type of the layout
|
|
356
|
+
* @default main
|
|
357
|
+
* @property
|
|
358
|
+
* - main: flex column
|
|
359
|
+
* - content: grow my-0
|
|
360
|
+
*/
|
|
361
|
+
type?: VariantProps<typeof classes$1>['type'];
|
|
362
|
+
/**
|
|
363
|
+
* @param maxWidth - Maximum width of the layout
|
|
364
|
+
* @default full
|
|
365
|
+
* @property
|
|
366
|
+
* - none: 0
|
|
367
|
+
* - xs: 320px (>=1280px: 100%)
|
|
368
|
+
* - sm: 384px (>=1280px: 100%)
|
|
369
|
+
* - md: 448px (>=1280px: 100%)
|
|
370
|
+
* - lg: 512px (>=1280px: 100%)
|
|
371
|
+
* - xl: 576px (>=1280px: 100%)
|
|
372
|
+
* - 2xl: 672px (>=1280px: 100%)
|
|
373
|
+
* - 3xl: 768px (>=1280px: 100%)
|
|
374
|
+
* - full: 100%
|
|
375
|
+
*/
|
|
376
|
+
maxWidth?: VariantProps<typeof classes$1>['maxWidth'];
|
|
377
|
+
}
|
|
378
|
+
declare function Layout({
|
|
379
|
+
children,
|
|
380
|
+
className,
|
|
381
|
+
type,
|
|
382
|
+
maxWidth,
|
|
383
|
+
...props
|
|
384
|
+
}: LayoutProps): react_jsx_runtime1.JSX.Element;
|
|
177
385
|
//#endregion
|
|
178
386
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
179
387
|
declare const classes: (props?: ({
|
|
180
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "
|
|
181
|
-
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" |
|
|
182
|
-
} &
|
|
388
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "square" | null | undefined;
|
|
389
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
390
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
183
391
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
184
392
|
/**
|
|
185
393
|
* @param width - Width of the skeleton
|
|
@@ -228,7 +436,6 @@ interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typ
|
|
|
228
436
|
* @param rounded - Rounded of the skeleton
|
|
229
437
|
* @param width - Width of the skeleton
|
|
230
438
|
* @param height - Height of the skeleton
|
|
231
|
-
* @param className - Class name
|
|
232
439
|
*/
|
|
233
440
|
declare function Skeleton({
|
|
234
441
|
size,
|
|
@@ -237,7 +444,7 @@ declare function Skeleton({
|
|
|
237
444
|
height,
|
|
238
445
|
className,
|
|
239
446
|
...props
|
|
240
|
-
}: SkeletonProps):
|
|
447
|
+
}: SkeletonProps): react_jsx_runtime1.JSX.Element;
|
|
241
448
|
//#endregion
|
|
242
449
|
//#region src/ui/tooltip/tooltip-container.d.ts
|
|
243
450
|
type SubPlacement = 'start' | 'end';
|
|
@@ -283,9 +490,8 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
283
490
|
* @param children - Trigger element
|
|
284
491
|
* @param content - Tooltip content
|
|
285
492
|
* @param defaultOpen - Default open state of the tooltip
|
|
286
|
-
* @param className - Class name
|
|
287
493
|
* @param placement - Placement of the tooltip
|
|
288
494
|
*/
|
|
289
|
-
declare const TooltipContainer:
|
|
495
|
+
declare const TooltipContainer: react2.ForwardRefExoticComponent<TooltipContainerProps & react2.RefAttributes<HTMLDivElement>>;
|
|
290
496
|
//#endregion
|
|
291
|
-
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
497
|
+
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, ConditionalWrapper, type ConditionalWrapperProps, Footer, type FooterProps, Header, type HeaderProps, Input, type InputProps, Layout, type LayoutProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import React$1, { HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
1
|
+
import * as react3 from "react";
|
|
2
|
+
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
import
|
|
5
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
|
+
import * as class_variance_authority_types3 from "class-variance-authority/types";
|
|
6
7
|
|
|
7
8
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
8
9
|
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
9
10
|
items: T[];
|
|
10
11
|
render: (item: T) => React$1.ReactNode;
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @param items - Items to render
|
|
15
|
+
* @param render - Render function
|
|
16
|
+
*/
|
|
12
17
|
declare function BottomAppBar<T>({
|
|
13
18
|
className,
|
|
14
19
|
items,
|
|
@@ -17,14 +22,14 @@ declare function BottomAppBar<T>({
|
|
|
17
22
|
}: BottomAppBarProps<T>): React$1.ReactNode;
|
|
18
23
|
//#endregion
|
|
19
24
|
//#region src/ui/button/button.d.ts
|
|
20
|
-
declare const classes$
|
|
25
|
+
declare const classes$5: (props?: ({
|
|
21
26
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
22
|
-
gap?: "xs" | "sm" | "md" | "lg" | "xl" |
|
|
27
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
23
28
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
24
|
-
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "
|
|
29
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "2.5xl" | null | undefined;
|
|
25
30
|
variant?: "default" | "ghost" | "white" | "blue" | "night" | "charcoal" | "slate" | "red" | "yellow" | "black" | null | undefined;
|
|
26
|
-
} &
|
|
27
|
-
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$
|
|
31
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
32
|
+
interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$5> {
|
|
28
33
|
/**
|
|
29
34
|
* @param size - Height of the button
|
|
30
35
|
* @default md - 40px
|
|
@@ -38,7 +43,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
38
43
|
* - 2xl: 52px
|
|
39
44
|
* - 3xl: 56px
|
|
40
45
|
*/
|
|
41
|
-
size?: VariantProps<typeof classes$
|
|
46
|
+
size?: VariantProps<typeof classes$5>['size'];
|
|
42
47
|
/**
|
|
43
48
|
* @param gap - Gap between the button and the content
|
|
44
49
|
* @default sm - 8px
|
|
@@ -50,7 +55,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
50
55
|
* - lg: 16px
|
|
51
56
|
* - xl: 20px
|
|
52
57
|
*/
|
|
53
|
-
gap?: VariantProps<typeof classes$
|
|
58
|
+
gap?: VariantProps<typeof classes$5>['gap'];
|
|
54
59
|
/**
|
|
55
60
|
* @param rounded - Border radius of the button
|
|
56
61
|
* @default sm
|
|
@@ -65,7 +70,7 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
65
70
|
* - 3xl: 24px
|
|
66
71
|
* - full: 100%
|
|
67
72
|
*/
|
|
68
|
-
rounded?: VariantProps<typeof classes$
|
|
73
|
+
rounded?: VariantProps<typeof classes$5>['rounded'];
|
|
69
74
|
/**
|
|
70
75
|
* @param variant - Variant of the button
|
|
71
76
|
* @default blue
|
|
@@ -81,21 +86,100 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
81
86
|
* - yellow
|
|
82
87
|
* - black
|
|
83
88
|
*/
|
|
84
|
-
variant?: VariantProps<typeof classes$
|
|
89
|
+
variant?: VariantProps<typeof classes$5>['variant'];
|
|
85
90
|
disabled?: boolean;
|
|
86
91
|
children?: React.ReactNode;
|
|
87
92
|
}
|
|
88
93
|
/**
|
|
89
|
-
* @param children - Children of the button
|
|
90
|
-
* @param type - Type of the button
|
|
91
94
|
* @param size - Size of the button
|
|
92
95
|
* @param gap - Gap between the button and the content
|
|
93
96
|
* @param outline - Outline of the button
|
|
94
97
|
* @param rounded - Border radius of the button
|
|
95
98
|
* @param variant - Variant of the button
|
|
96
|
-
* @param className - Class name
|
|
97
99
|
*/
|
|
98
|
-
declare const Button:
|
|
100
|
+
declare const Button: react3.ForwardRefExoticComponent<ButtonProps & react3.RefAttributes<HTMLButtonElement>>;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/ui/carousel/carousel-context.d.ts
|
|
103
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
104
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
105
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
106
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
107
|
+
interface CarouselProps {
|
|
108
|
+
options?: CarouselOptions;
|
|
109
|
+
plugins?: CarouselPlugin;
|
|
110
|
+
orientation?: 'horizontal' | 'vertical';
|
|
111
|
+
setApi?: (api: CarouselApi) => void;
|
|
112
|
+
}
|
|
113
|
+
type CarouselContextProps = {
|
|
114
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
115
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
116
|
+
scrollPrev: () => void;
|
|
117
|
+
scrollNext: () => void;
|
|
118
|
+
canScrollPrev: boolean;
|
|
119
|
+
canScrollNext: boolean;
|
|
120
|
+
} & CarouselProps;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/ui/carousel/carousel.d.ts
|
|
123
|
+
interface CarouselProps$1 extends ComponentProps<'div'>, CarouselProps {
|
|
124
|
+
/**
|
|
125
|
+
* @param orientation - Orientation of the carousel
|
|
126
|
+
* @default horizontal
|
|
127
|
+
* @property
|
|
128
|
+
* - horizontal
|
|
129
|
+
* - vertical
|
|
130
|
+
*/
|
|
131
|
+
orientation?: 'horizontal' | 'vertical';
|
|
132
|
+
/**
|
|
133
|
+
* @param options - Options of the carousel
|
|
134
|
+
* @default {}
|
|
135
|
+
*/
|
|
136
|
+
options?: CarouselProps['options'];
|
|
137
|
+
/**
|
|
138
|
+
* @param setApi - Set the API of the carousel
|
|
139
|
+
* @default undefined
|
|
140
|
+
*/
|
|
141
|
+
setApi?: CarouselProps['setApi'];
|
|
142
|
+
/**
|
|
143
|
+
* @param plugins - Plugins of the carousel
|
|
144
|
+
* @default []
|
|
145
|
+
*/
|
|
146
|
+
plugins?: CarouselProps['plugins'];
|
|
147
|
+
}
|
|
148
|
+
declare function Carousel({
|
|
149
|
+
orientation,
|
|
150
|
+
options,
|
|
151
|
+
setApi,
|
|
152
|
+
plugins,
|
|
153
|
+
className,
|
|
154
|
+
children,
|
|
155
|
+
...props
|
|
156
|
+
}: CarouselProps$1): react_jsx_runtime6.JSX.Element;
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/ui/carousel/carousel-wrapper.d.ts
|
|
159
|
+
declare function CarouselWrapper({
|
|
160
|
+
className,
|
|
161
|
+
...props
|
|
162
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime6.JSX.Element;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/ui/carousel/carousel-item.d.ts
|
|
165
|
+
declare function CarouselItem({
|
|
166
|
+
className,
|
|
167
|
+
...props
|
|
168
|
+
}: React$1.ComponentProps<'div'>): react_jsx_runtime6.JSX.Element;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/ui/carousel/carousel-previous.d.ts
|
|
171
|
+
declare function CarouselPrevious({
|
|
172
|
+
children,
|
|
173
|
+
className,
|
|
174
|
+
...props
|
|
175
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime6.JSX.Element;
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/ui/carousel/carousel-next.d.ts
|
|
178
|
+
declare function CarouselNext({
|
|
179
|
+
children,
|
|
180
|
+
className,
|
|
181
|
+
...props
|
|
182
|
+
}: React$1.ComponentProps<'button'>): react_jsx_runtime6.JSX.Element;
|
|
99
183
|
//#endregion
|
|
100
184
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
101
185
|
interface ConditionalWrapperProps {
|
|
@@ -112,16 +196,103 @@ declare function ConditionalWrapper({
|
|
|
112
196
|
condition,
|
|
113
197
|
wrapper,
|
|
114
198
|
children
|
|
115
|
-
}: ConditionalWrapperProps):
|
|
199
|
+
}: ConditionalWrapperProps): react3.ReactNode;
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/ui/footer/footer.d.ts
|
|
202
|
+
declare const classes$4: (props?: ({
|
|
203
|
+
maxWidth?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | null | undefined;
|
|
204
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
205
|
+
interface FooterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$4> {
|
|
206
|
+
/**
|
|
207
|
+
* @param maxWidth - Maximum width of the footer
|
|
208
|
+
* @default full
|
|
209
|
+
* @property
|
|
210
|
+
* - none: 0
|
|
211
|
+
* - xs: 320px
|
|
212
|
+
* - sm: 384px
|
|
213
|
+
* - md: 448px
|
|
214
|
+
* - lg: 512px
|
|
215
|
+
* - xl: 576px
|
|
216
|
+
* - 2xl: 672px
|
|
217
|
+
* - 3xl: 768px
|
|
218
|
+
* - 4xl: 896px
|
|
219
|
+
* - 5xl: 1024px
|
|
220
|
+
* - 6xl: 1152px
|
|
221
|
+
* - 7xl: 1280px
|
|
222
|
+
* - full: 100%
|
|
223
|
+
*/
|
|
224
|
+
maxWidth?: VariantProps<typeof classes$4>['maxWidth'];
|
|
225
|
+
}
|
|
226
|
+
declare function Footer({
|
|
227
|
+
className,
|
|
228
|
+
children,
|
|
229
|
+
maxWidth,
|
|
230
|
+
...props
|
|
231
|
+
}: FooterProps): react_jsx_runtime6.JSX.Element;
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/ui/header/header.d.ts
|
|
234
|
+
declare const classes$3: (props?: ({
|
|
235
|
+
maxWidth?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | "8xl" | null | undefined;
|
|
236
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | "8xl" | "4.25xl" | null | undefined;
|
|
237
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
238
|
+
interface HeaderProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$3> {
|
|
239
|
+
children?: React.ReactNode;
|
|
240
|
+
/**
|
|
241
|
+
* @param maxWidth - Maximum width of the header
|
|
242
|
+
* @default full
|
|
243
|
+
* @property
|
|
244
|
+
* - none: 0
|
|
245
|
+
* - xs: 320px
|
|
246
|
+
* - sm: 384px
|
|
247
|
+
* - md: 448px
|
|
248
|
+
* - lg: 512px
|
|
249
|
+
* - xl: 576px
|
|
250
|
+
* - 2xl: 672px
|
|
251
|
+
* - 3xl: 768px
|
|
252
|
+
* - 4xl: 896px
|
|
253
|
+
* - 5xl: 1024px
|
|
254
|
+
* - 6xl: 1152px
|
|
255
|
+
* - 7xl: 1280px
|
|
256
|
+
* - 8xl: 1320px
|
|
257
|
+
* - full: 100%
|
|
258
|
+
*/
|
|
259
|
+
maxWidth?: VariantProps<typeof classes$3>['maxWidth'];
|
|
260
|
+
/**
|
|
261
|
+
* @param size - Size of the header
|
|
262
|
+
* @default xl
|
|
263
|
+
* @property
|
|
264
|
+
* - sm: 40px
|
|
265
|
+
* - md: 48px
|
|
266
|
+
* - lg: 56px
|
|
267
|
+
* - xl: 64px
|
|
268
|
+
* - 2xl: 72px
|
|
269
|
+
* - 3xl: 88px
|
|
270
|
+
* - 4xl: 80px
|
|
271
|
+
* - 4.25xl: 90px
|
|
272
|
+
* - 5xl: 96px
|
|
273
|
+
* - 6xl: 104px
|
|
274
|
+
* - 7xl: 112px
|
|
275
|
+
* - 8xl: 120px
|
|
276
|
+
* - full: 100%
|
|
277
|
+
*/
|
|
278
|
+
size?: VariantProps<typeof classes$3>['size'];
|
|
279
|
+
}
|
|
280
|
+
declare function Header({
|
|
281
|
+
children,
|
|
282
|
+
maxWidth,
|
|
283
|
+
size,
|
|
284
|
+
className,
|
|
285
|
+
...props
|
|
286
|
+
}: HeaderProps): react_jsx_runtime6.JSX.Element;
|
|
116
287
|
//#endregion
|
|
117
288
|
//#region src/ui/input/input.d.ts
|
|
118
|
-
declare const classes$
|
|
289
|
+
declare const classes$2: (props?: ({
|
|
119
290
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
|
|
120
|
-
gap?: "xs" | "sm" | "md" | "lg" | "xl" |
|
|
291
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
121
292
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
122
|
-
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" |
|
|
123
|
-
} &
|
|
124
|
-
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$
|
|
293
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
294
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
295
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$2> {
|
|
125
296
|
/**
|
|
126
297
|
* @param size - Height of the input
|
|
127
298
|
* @default lg - 44px
|
|
@@ -135,7 +306,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
135
306
|
* - 2xl: 52px
|
|
136
307
|
* - 3xl: 56px
|
|
137
308
|
*/
|
|
138
|
-
size?: VariantProps<typeof classes$
|
|
309
|
+
size?: VariantProps<typeof classes$2>['size'];
|
|
139
310
|
/**
|
|
140
311
|
* @param gap - Gap between the input and the prefix/suffix
|
|
141
312
|
* @default xl - 20px
|
|
@@ -147,8 +318,8 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
147
318
|
* - lg: 16px
|
|
148
319
|
* - xl: 20px
|
|
149
320
|
*/
|
|
150
|
-
gap?: VariantProps<typeof classes$
|
|
151
|
-
outline?: VariantProps<typeof classes$
|
|
321
|
+
gap?: VariantProps<typeof classes$2>['gap'];
|
|
322
|
+
outline?: VariantProps<typeof classes$2>['outline'];
|
|
152
323
|
/**
|
|
153
324
|
* @param rounded - Border radius of the input
|
|
154
325
|
* @default lg
|
|
@@ -160,7 +331,7 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
160
331
|
* - xl: 12px
|
|
161
332
|
* - 2xl: 16px
|
|
162
333
|
*/
|
|
163
|
-
rounded?: VariantProps<typeof classes$
|
|
334
|
+
rounded?: VariantProps<typeof classes$2>['rounded'];
|
|
164
335
|
prefix?: React.ReactNode;
|
|
165
336
|
surffix?: React.ReactNode;
|
|
166
337
|
}
|
|
@@ -171,15 +342,52 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
171
342
|
* @param gap - Gap between the input and the prefix/suffix
|
|
172
343
|
* @param outline - Outline of the input
|
|
173
344
|
* @param rounded - Border radius of the input
|
|
174
|
-
* @param className - Class name
|
|
175
345
|
*/
|
|
176
|
-
declare const Input:
|
|
346
|
+
declare const Input: react3.ForwardRefExoticComponent<InputProps & react3.RefAttributes<HTMLInputElement>>;
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/ui/layout/layout.d.ts
|
|
349
|
+
declare const classes$1: (props?: ({
|
|
350
|
+
type?: "content" | "main" | null | undefined;
|
|
351
|
+
maxWidth?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
352
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
353
|
+
interface LayoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$1> {
|
|
354
|
+
/**
|
|
355
|
+
* @param type - Type of the layout
|
|
356
|
+
* @default main
|
|
357
|
+
* @property
|
|
358
|
+
* - main: flex column
|
|
359
|
+
* - content: grow my-0
|
|
360
|
+
*/
|
|
361
|
+
type?: VariantProps<typeof classes$1>['type'];
|
|
362
|
+
/**
|
|
363
|
+
* @param maxWidth - Maximum width of the layout
|
|
364
|
+
* @default full
|
|
365
|
+
* @property
|
|
366
|
+
* - none: 0
|
|
367
|
+
* - xs: 320px (>=1280px: 100%)
|
|
368
|
+
* - sm: 384px (>=1280px: 100%)
|
|
369
|
+
* - md: 448px (>=1280px: 100%)
|
|
370
|
+
* - lg: 512px (>=1280px: 100%)
|
|
371
|
+
* - xl: 576px (>=1280px: 100%)
|
|
372
|
+
* - 2xl: 672px (>=1280px: 100%)
|
|
373
|
+
* - 3xl: 768px (>=1280px: 100%)
|
|
374
|
+
* - full: 100%
|
|
375
|
+
*/
|
|
376
|
+
maxWidth?: VariantProps<typeof classes$1>['maxWidth'];
|
|
377
|
+
}
|
|
378
|
+
declare function Layout({
|
|
379
|
+
children,
|
|
380
|
+
className,
|
|
381
|
+
type,
|
|
382
|
+
maxWidth,
|
|
383
|
+
...props
|
|
384
|
+
}: LayoutProps): react_jsx_runtime6.JSX.Element;
|
|
177
385
|
//#endregion
|
|
178
386
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
179
387
|
declare const classes: (props?: ({
|
|
180
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "
|
|
181
|
-
rounded?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" |
|
|
182
|
-
} &
|
|
388
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "square" | null | undefined;
|
|
389
|
+
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
390
|
+
} & class_variance_authority_types3.ClassProp) | undefined) => string;
|
|
183
391
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
184
392
|
/**
|
|
185
393
|
* @param width - Width of the skeleton
|
|
@@ -228,7 +436,6 @@ interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typ
|
|
|
228
436
|
* @param rounded - Rounded of the skeleton
|
|
229
437
|
* @param width - Width of the skeleton
|
|
230
438
|
* @param height - Height of the skeleton
|
|
231
|
-
* @param className - Class name
|
|
232
439
|
*/
|
|
233
440
|
declare function Skeleton({
|
|
234
441
|
size,
|
|
@@ -237,7 +444,7 @@ declare function Skeleton({
|
|
|
237
444
|
height,
|
|
238
445
|
className,
|
|
239
446
|
...props
|
|
240
|
-
}: SkeletonProps):
|
|
447
|
+
}: SkeletonProps): react_jsx_runtime6.JSX.Element;
|
|
241
448
|
//#endregion
|
|
242
449
|
//#region src/ui/tooltip/tooltip-container.d.ts
|
|
243
450
|
type SubPlacement = 'start' | 'end';
|
|
@@ -283,9 +490,8 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
283
490
|
* @param children - Trigger element
|
|
284
491
|
* @param content - Tooltip content
|
|
285
492
|
* @param defaultOpen - Default open state of the tooltip
|
|
286
|
-
* @param className - Class name
|
|
287
493
|
* @param placement - Placement of the tooltip
|
|
288
494
|
*/
|
|
289
|
-
declare const TooltipContainer:
|
|
495
|
+
declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
|
|
290
496
|
//#endregion
|
|
291
|
-
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
|
497
|
+
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, ConditionalWrapper, type ConditionalWrapperProps, Footer, type FooterProps, Header, type HeaderProps, Input, type InputProps, Layout, type LayoutProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"../util-DCPr_-5a.mjs";import{t}from"../hooks-5I2NBtcY.mjs";import{debounce as n}from"lodash-es";import r from"clsx";import i,{forwardRef as a,useCallback as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{createPortal as m}from"react-dom";function h({className:e,items:t,render:n,...a}){return d(`nav`,{className:r(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0 komc:box-border`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...a,children:d(`div`,{className:`komc:grid komc:min-h-15 komc:p-0`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>d(i.Fragment,{children:n(e)},t))})})}const g=p(e(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200 komc:cursor-pointer`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none komc:box-border`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}});var _=a(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:o=`blue`,className:s,...c},l)=>d(`button`,{ref:l,type:t,className:g({size:n,outline:i,gap:r,rounded:a,variant:o,className:s}),...c,children:e}));function v({condition:e,wrapper:t,children:n}){return e?t(n):n}const y=p(e(`komc:flex komc:items-center komc:w-full komc:px-2 komc:box-border`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:border-none komc:[&>input]:h-full`,`komc:[&>input]:p-0 komc:[&>input]:m-0`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}});var b=a(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:o,...s},c)=>f(`div`,{className:y({size:n,gap:r,outline:i,rounded:a,className:o}),children:[e,d(`input`,{ref:c,type:`text`,...s}),t]}));const x=p(e(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function S({size:e,rounded:t,width:n,height:r,className:i,...a}){let o=n?typeof n==`string`?n:`${n}px`:void 0,s=r?typeof r==`string`?r:`${r}px`:void 0;return d(`div`,{className:x({size:e,rounded:t,className:i}),style:{width:o,height:s},...a})}function C({children:e,setOpen:t}){return d(`div`,{className:r(`komc:inline-flex komc:shrink-0 komc:justify-center komc:items-center`,`komc:bg-transparent komc:border-none komc:outline-none`,`komc:p-0 komc:m-0 komc:box-border`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const w=p(e(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2`,`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)]`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-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:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-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:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-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`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}});var T=a(({portal:e,children:t,className:n,placement:r,...i},a)=>d(`div`,{ref:a,role:`tooltip`,className:w({portal:e,placement:r,className:n}),...i,children:t}));const E=p(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`),left:e(`komc:left-full komc:-ml-1 komc:top-1/2`),right:e(`komc:right-full komc:-mr-1 komc:top-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`),"left-start":e(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":e(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":e(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":e(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}});var D=({placement:e,className:t,offset:n,style:r,...i})=>{let a=c(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return d(`div`,{className:E({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const O=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function k({placement:e,className:t,content:i,open:a,hiddenRef:c,containerRef:p}){let[h,g]=u(!1),_=l(null),[v,y]=u(e),[b,x]=u({top:0,left:0}),[S,C]=u({x:0,y:0}),w=o(n(()=>{let e=p?.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]=v.split(`-`),l=i+n.top,u=a+n.left+n.width/2-r.width/2;switch(o){case`top`:l-=r.height;break;case`bottom`:l+=n.height;break;case`left`:l+=n.height/2-r.height/2,u-=r.width/2+n.width/2;break;case`right`:l+=n.height/2-r.height/2,u+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:u+=r.width/2-24;break;case`end`:u-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:l+=r.height/2+n.height/2-24;break;case`end`:l-=r.height/2+n.height/2-24;break}let d=u,f=window.innerWidth;d+r.width>f-4&&(d=f-r.width-4),d<4&&(d=4),x({top:l,left:d}),C({x:u-d,y:0})},50),[v]),E=o(n(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();y(r=>{let i=e;return t+n>=window.innerHeight?i=O(r,`top`):t<0&&(i=O(r,`bottom`)),i})},50),[e]);return s(()=>(g(!0),E(),window.addEventListener(`scroll`,w,{passive:!0}),window.addEventListener(`resize`,w),window.addEventListener(`scroll`,E,{passive:!0}),window.addEventListener(`resize`,E),()=>{window.removeEventListener(`scroll`,w),window.removeEventListener(`resize`,w),window.removeEventListener(`scroll`,E),window.removeEventListener(`resize`,E)}),[w,E]),s(()=>{h&&w()},[h,w]),h?m(f(T,{ref:_,portal:!0,placement:v,className:r(t,a?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[d(`span`,{children:i}),d(D,{placement:v,offset:S})]}),document.body):null}var A=a(({children:e,content:n,defaultOpen:i=!1,className:a,placement:o=`top`},s)=>{let[c,p]=u(i),m=l(null),h=l(null);return t({ref:m,setOpen:p}),f(`div`,{ref:m,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[d(C,{setOpen:p,children:e}),d(k,{placement:o,className:a,open:c,content:n,hiddenRef:h,containerRef:m}),d(T,{ref:h,role:`presentation`,placement:o,className:r(`komc:opacity-0 komc:invisible`,a),children:d(`span`,{children:n})})]})});export{h as BottomAppBar,_ as Button,v as ConditionalWrapper,b as Input,S as Skeleton,A as Tooltip};
|
|
1
|
+
import{f as e}from"../util-DCPr_-5a.mjs";import{t}from"../hooks-5I2NBtcY.mjs";import{debounce as n}from"lodash-es";import r from"clsx";import i,{forwardRef as a,useCallback as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import m from"embla-carousel-react";import{createPortal as h}from"react-dom";function g({className:e,items:t,render:n,...a}){return d(`nav`,{"data-komc":!0,className:r(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...a,children:d(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>d(i.Fragment,{children:n(e)},t))})})}const _=p(e(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}});var v=a(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:o=`blue`,className:s,...c},l)=>d(`button`,{ref:l,type:t,"data-komc":!0,className:_({size:n,outline:i,gap:r,rounded:a,variant:o,className:s}),...c,children:e}));const y=i.createContext(null);function b(){let e=i.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:c,...l}){let[f,p]=m({...n,axis:t===`horizontal`?`x`:`y`},i),[h,g]=u(!1),[_,v]=u(!1),b=o(e=>{e&&(g(e.canScrollPrev()),v(e.canScrollNext()))},[]),x=o(()=>{p?.scrollPrev()},[p]),S=o(()=>{p?.scrollNext()},[p]),C=o(e=>{e.key===`ArrowLeft`?(e.preventDefault(),x()):e.key===`ArrowRight`&&(e.preventDefault(),S())},[x,S]);return s(()=>{!p||!r||r(p)},[p,r]),s(()=>{if(p)return b(p),p.on(`reInit`,b),p.on(`select`,b),()=>{p?.off(`select`,b)}},[p,b]),d(y.Provider,{value:{carouselRef:f,api:p,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:x,scrollNext:S,canScrollPrev:h,canScrollNext:_},children:d(`div`,{"data-komc":!0,onKeyDownCapture:C,className:e(`komc:relative`,a),...l,children:c})})}function S({className:t,...n}){let{carouselRef:r,orientation:i}=b();return d(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:d(`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 d(`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:i,canScrollPrev:a}=b();return d(`button`,{type:`button`,"data-komc":!0,disabled:!a,className:r(`komc:w-full`,t),onClick:i,...n,children:e})}function T({children:e,className:t,...n}){let{scrollNext:i,canScrollNext:a}=b();return d(`button`,{type:`button`,"data-komc":!0,disabled:!a,className:r(`komc:w-full`,t),onClick:i,...n,children:e})}function E({condition:e,wrapper:t,children:n}){return e?t(n):n}const D=p(`komc:flex komc:flex-col komc:w-full komc:max-w-7xl komc:mx-auto`,{variants:{maxWidth:{none:``,xs:`komc:max-w-xs`,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`,"3xl":`komc:max-w-3xl`,"4xl":`komc:max-w-4xl`,"5xl":`komc:max-w-5xl`,"6xl":`komc:max-w-6xl`,"7xl":`komc:max-w-7xl`,full:`komc:max-w-full`}},defaultVariants:{maxWidth:`full`}});function O({className:e,children:t,maxWidth:n,...i}){return d(`footer`,{"data-komc":!0,className:r(`komc:block komc:w-full komc:h-full`,`komc:bg-white komc:border-t komc:border-neutral-200`,e),...i,children:d(`div`,{className:D({maxWidth:n}),children:t})})}const k=p(e(`komc:flex komc:items-center`,`komc:mx-auto komc:min-h-10`),{variants:{maxWidth:{none:``,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`,"3xl":`komc:max-w-3xl`,"4xl":`komc:max-w-4xl`,"5xl":`komc:max-w-5xl`,"6xl":`komc:max-w-6xl`,"7xl":`komc:max-w-7xl`,"8xl":`komc:max-w-330`,full:`komc:max-w-full`},size:{sm:`komc:h-10`,md:`komc:h-12`,lg:`komc:h-14`,xl:`komc:h-16`,"2xl":`komc:h-18`,"3xl":`komc:h-20`,"4xl":`komc:h-22`,"4.25xl":`komc:h-22.5`,"5xl":`komc:h-24`,"6xl":`komc:h-26`,"7xl":`komc:h-28`,"8xl":`komc:h-30`,full:`komc:h-full`}},defaultVariants:{maxWidth:`full`,size:`xl`}});function A({children:e,maxWidth:t,size:n,className:i,...a}){return d(`header`,{"data-komc":!0,className:r(`komc:w-full komc:sticky komc:top-0 komc:z-1000 komc:bg-white`,`komc:transition-all komc:duration-200`,i),...a,children:d(`div`,{className:k({maxWidth:t,size:n}),children:e})})}const j=p(e(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}});var M=a(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:o,...s},c)=>f(`div`,{"data-komc":!0,className:j({size:n,gap:r,outline:i,rounded:a,className:o}),children:[e,d(`input`,{ref:c,type:`text`,...s}),t]}));const N=p(`komc:w-full komc:mx-auto komc:relative`,{variants:{type:{main:`komc:flex komc:flex-col`,content:`komc:grow komc:my-0`},maxWidth:{none:``,xs:`komc:max-w-xs komc:xl:max-w-full`,sm:`komc:max-w-sm komc:xl:max-w-full`,md:`komc:max-w-md komc:xl:max-w-full`,lg:`komc:max-w-lg komc:xl:max-w-full`,xl:`komc:max-w-xl komc:xl:max-w-full`,"2xl":`komc:max-w-2xl komc:xl:max-w-full`,"3xl":`komc:max-w-3xl komc:xl:max-w-full`,full:`komc:max-w-full`}},defaultVariants:{type:`main`,maxWidth:`full`}});function P({children:e,className:t,type:n,maxWidth:r,...i}){return d(`div`,{"data-komc":!0,className:N({type:n,maxWidth:r,className:t}),...i,children:e})}const F=p(e(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function I({size:e,rounded:t,width:n,height:r,className:i,...a}){let o=n?typeof n==`string`?n:`${n}px`:void 0,s=r?typeof r==`string`?r:`${r}px`:void 0;return d(`div`,{"data-komc":!0,className:F({size:e,rounded:t,className:i}),style:{width:o,height:s},...a})}function L({children:e,setOpen:t}){return d(`div`,{"data-komc":!0,className:r(`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=p(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:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-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:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-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:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-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`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}});var z=a(({portal:e,children:t,className:n,placement:r,...i},a)=>d(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:R({portal:e,placement:r,className:n}),...i,children:t}));const B=p(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`),left:e(`komc:left-full komc:-ml-1 komc:top-1/2`),right:e(`komc:right-full komc:-mr-1 komc:top-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`),"left-start":e(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":e(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":e(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":e(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}});var V=({placement:e,className:t,offset:n,style:r,...i})=>{let a=c(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return d(`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:i,open:a,hiddenRef:c,containerRef:p}){let[m,g]=u(!1),_=l(null),[v,y]=u(e),[b,x]=u({top:0,left:0}),[S,C]=u({x:0,y:0}),w=o(n(()=>{let e=p?.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]=v.split(`-`),l=i+n.top,u=a+n.left+n.width/2-r.width/2;switch(o){case`top`:l-=r.height;break;case`bottom`:l+=n.height;break;case`left`:l+=n.height/2-r.height/2,u-=r.width/2+n.width/2;break;case`right`:l+=n.height/2-r.height/2,u+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:u+=r.width/2-24;break;case`end`:u-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:l+=r.height/2+n.height/2-24;break;case`end`:l-=r.height/2+n.height/2-24;break}let d=u,f=window.innerWidth;d+r.width>f-4&&(d=f-r.width-4),d<4&&(d=4),x({top:l,left:d}),C({x:u-d,y:0})},50),[v]),T=o(n(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();y(r=>{let i=e;return t+n>=window.innerHeight?i=H(r,`top`):t<0&&(i=H(r,`bottom`)),i})},50),[e]);return s(()=>(g(!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]),s(()=>{m&&w()},[m,w]),m?h(f(z,{ref:_,portal:!0,"data-komc":!0,placement:v,className:r(t,a?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[d(`span`,{children:i}),d(V,{placement:v,offset:S})]}),document.body):null}var W=a(({children:e,content:n,defaultOpen:i=!1,className:a,placement:o=`top`},s)=>{let[c,p]=u(i),m=l(null),h=l(null);return t({ref:m,setOpen:p}),f(`div`,{ref:m,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[d(L,{setOpen:p,children:e}),d(U,{placement:o,className:a,open:c,content:n,hiddenRef:h,containerRef:m}),d(z,{ref:h,role:`presentation`,placement:o,className:r(`komc:opacity-0 komc:invisible`,a),children:d(`span`,{children:n})})]})});export{g as BottomAppBar,v as Button,x as Carousel,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,E as ConditionalWrapper,O as Footer,A as Header,M as Input,P as Layout,I as Skeleton,W as Tooltip};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@machinerd/js-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
"class-variance-authority": "^0.7.1",
|
|
53
53
|
"clsx": "^2.1.1",
|
|
54
54
|
"dayjs": "^1.11.19",
|
|
55
|
+
"embla-carousel": "^8.6.0",
|
|
56
|
+
"embla-carousel-react": "^8.6.0",
|
|
55
57
|
"google-libphonenumber": "^3.2.43",
|
|
56
58
|
"js-cookie": "^3.0.5",
|
|
57
59
|
"lodash-es": "^4.17.21",
|