@machinerd/js-module 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -4
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.cts +2 -3
- package/dist/hooks/index.d.mts +2 -3
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks-DBo6LQrH.mjs +1 -0
- package/dist/hooks-DqgWx1Fa.cjs +1 -0
- package/dist/{index-CWgr7lXX.d.cts → index-ByfkW7VU.d.mts} +186 -192
- package/dist/{index-CfKO4Lbp.d.mts → index-ComhjQ-q.d.cts} +186 -192
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/providers/index.cjs +1 -0
- package/dist/providers/index.d.cts +14 -0
- package/dist/providers/index.d.mts +14 -0
- package/dist/providers/index.mjs +1 -0
- package/dist/providers-5JCPezAS.mjs +1 -0
- package/dist/providers-BNK8Fisc.cjs +1 -0
- package/dist/{skeleton-BNKvM7GW.mjs → skeleton-S6S1ZnCy.mjs} +1 -1
- package/dist/{skeleton-D80eauT0.cjs → skeleton-g6yXh6D9.cjs} +1 -1
- package/dist/src-C_FmOyer.mjs +1 -0
- package/dist/src-CjpmdVyv.cjs +1 -0
- package/dist/styles/index.css +75 -0
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +16 -16
- package/dist/ui/index.d.mts +16 -16
- package/dist/ui/index.mjs +1 -1
- package/dist/ui-client/index.cjs +1 -1
- package/dist/ui-client/index.d.cts +37 -23
- package/dist/ui-client/index.d.mts +38 -24
- package/dist/ui-client/index.mjs +1 -1
- package/dist/util/index.cjs +1 -1
- package/dist/util/index.d.cts +3 -2
- package/dist/util/index.d.mts +3 -2
- package/dist/util/index.mjs +1 -1
- package/dist/util-o7fjt7iK.cjs +1 -0
- package/dist/util-zXJA6Gnc.mjs +1 -0
- package/package.json +15 -13
- package/dist/hooks-B6OJ8mCP.cjs +0 -1
- package/dist/hooks-Dr3L4nS9.mjs +0 -1
- package/dist/util-BMnQ9hLK.cjs +0 -1
- package/dist/util-BNSPNLzy.mjs +0 -1
- /package/dist/{index-DiZ4xS_f.d.mts → index-CH1uVFqx.d.cts} +0 -0
- /package/dist/{index-OjfbEYpE.d.cts → index-D6Jzsxc-.d.mts} +0 -0
package/dist/styles/index.css
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
5
5
|
:root, :host {
|
|
6
|
+
--komc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
|
7
|
+
monospace;
|
|
6
8
|
--komc-color-sky-950: #006699;
|
|
7
9
|
--komc-color-blue-50: oklch(97% 0.014 254.604);
|
|
8
10
|
--komc-color-blue-500: oklch(62.3% 0.214 259.815);
|
|
@@ -85,6 +87,9 @@
|
|
|
85
87
|
.komc\:inset-0 {
|
|
86
88
|
inset: calc(var(--komc-spacing) * 0);
|
|
87
89
|
}
|
|
90
|
+
.komc\:top-0 {
|
|
91
|
+
top: calc(var(--komc-spacing) * 0);
|
|
92
|
+
}
|
|
88
93
|
.komc\:top-full {
|
|
89
94
|
top: 100%;
|
|
90
95
|
}
|
|
@@ -208,6 +213,9 @@
|
|
|
208
213
|
.komc\:h-56 {
|
|
209
214
|
height: calc(var(--komc-spacing) * 56);
|
|
210
215
|
}
|
|
216
|
+
.komc\:h-\[50dvh\] {
|
|
217
|
+
height: 50dvh;
|
|
218
|
+
}
|
|
211
219
|
.komc\:h-auto {
|
|
212
220
|
height: auto;
|
|
213
221
|
}
|
|
@@ -217,6 +225,9 @@
|
|
|
217
225
|
.komc\:h-full {
|
|
218
226
|
height: 100%;
|
|
219
227
|
}
|
|
228
|
+
.komc\:max-h-\[90dvh\] {
|
|
229
|
+
max-height: 90dvh;
|
|
230
|
+
}
|
|
220
231
|
.komc\:min-h-0 {
|
|
221
232
|
min-height: calc(var(--komc-spacing) * 0);
|
|
222
233
|
}
|
|
@@ -244,6 +255,15 @@
|
|
|
244
255
|
.komc\:w-2 {
|
|
245
256
|
width: calc(var(--komc-spacing) * 2);
|
|
246
257
|
}
|
|
258
|
+
.komc\:w-\[50dvw\] {
|
|
259
|
+
width: 50dvw;
|
|
260
|
+
}
|
|
261
|
+
.komc\:w-\[320px\] {
|
|
262
|
+
width: 320px;
|
|
263
|
+
}
|
|
264
|
+
.komc\:w-auto {
|
|
265
|
+
width: auto;
|
|
266
|
+
}
|
|
247
267
|
.komc\:w-fit {
|
|
248
268
|
width: fit-content;
|
|
249
269
|
}
|
|
@@ -259,6 +279,12 @@
|
|
|
259
279
|
.komc\:max-w-70 {
|
|
260
280
|
max-width: calc(var(--komc-spacing) * 70);
|
|
261
281
|
}
|
|
282
|
+
.komc\:max-w-\[90dvw\] {
|
|
283
|
+
max-width: 90dvw;
|
|
284
|
+
}
|
|
285
|
+
.komc\:max-w-\[320px\] {
|
|
286
|
+
max-width: 320px;
|
|
287
|
+
}
|
|
262
288
|
.komc\:max-w-full {
|
|
263
289
|
max-width: 100%;
|
|
264
290
|
}
|
|
@@ -296,14 +322,30 @@
|
|
|
296
322
|
--tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
|
|
297
323
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
298
324
|
}
|
|
325
|
+
.komc\:-translate-x-full {
|
|
326
|
+
--tw-translate-x: -100%;
|
|
327
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
328
|
+
}
|
|
329
|
+
.komc\:translate-x-full {
|
|
330
|
+
--tw-translate-x: 100%;
|
|
331
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
332
|
+
}
|
|
299
333
|
.komc\:-translate-y-2 {
|
|
300
334
|
--tw-translate-y: calc(var(--komc-spacing) * -2);
|
|
301
335
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
302
336
|
}
|
|
337
|
+
.komc\:-translate-y-full {
|
|
338
|
+
--tw-translate-y: -100%;
|
|
339
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
340
|
+
}
|
|
303
341
|
.komc\:translate-y-2 {
|
|
304
342
|
--tw-translate-y: calc(var(--komc-spacing) * 2);
|
|
305
343
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
306
344
|
}
|
|
345
|
+
.komc\:translate-y-full {
|
|
346
|
+
--tw-translate-y: 100%;
|
|
347
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
348
|
+
}
|
|
307
349
|
.komc\:animate-pulse {
|
|
308
350
|
animation: var(--komc-animate-pulse);
|
|
309
351
|
}
|
|
@@ -364,6 +406,9 @@
|
|
|
364
406
|
.komc\:gap-x-2 {
|
|
365
407
|
column-gap: calc(var(--komc-spacing) * 2);
|
|
366
408
|
}
|
|
409
|
+
.komc\:overflow-auto {
|
|
410
|
+
overflow: auto;
|
|
411
|
+
}
|
|
367
412
|
.komc\:overflow-hidden {
|
|
368
413
|
overflow: hidden;
|
|
369
414
|
}
|
|
@@ -448,6 +493,12 @@
|
|
|
448
493
|
.komc\:bg-\[rgb\(95\,95\,96\)\] {
|
|
449
494
|
background-color: rgb(95,95,96);
|
|
450
495
|
}
|
|
496
|
+
.komc\:bg-black\/40 {
|
|
497
|
+
background-color: var(--komc-color-black);
|
|
498
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
499
|
+
background-color: color-mix(in oklab, var(--komc-color-black) 40%, transparent);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
451
502
|
.komc\:bg-black\/50 {
|
|
452
503
|
background-color: var(--komc-color-black);
|
|
453
504
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -550,6 +601,9 @@
|
|
|
550
601
|
.komc\:pl-4 {
|
|
551
602
|
padding-left: calc(var(--komc-spacing) * 4);
|
|
552
603
|
}
|
|
604
|
+
.komc\:font-mono {
|
|
605
|
+
font-family: var(--komc-font-mono);
|
|
606
|
+
}
|
|
553
607
|
.komc\:text-base {
|
|
554
608
|
font-size: var(--komc-text-base);
|
|
555
609
|
line-height: var(--tw-leading, var(--komc-text-base--line-height));
|
|
@@ -624,6 +678,10 @@
|
|
|
624
678
|
.komc\:opacity-100 {
|
|
625
679
|
opacity: 100%;
|
|
626
680
|
}
|
|
681
|
+
.komc\:shadow-2xl {
|
|
682
|
+
--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / 0.25));
|
|
683
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
684
|
+
}
|
|
627
685
|
.komc\:shadow-lg {
|
|
628
686
|
--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
629
687
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -677,6 +735,11 @@
|
|
|
677
735
|
transition-timing-function: var(--tw-ease, var(--komc-default-transition-timing-function));
|
|
678
736
|
transition-duration: var(--tw-duration, var(--komc-default-transition-duration));
|
|
679
737
|
}
|
|
738
|
+
.komc\:transition-transform {
|
|
739
|
+
transition-property: transform, translate, scale, rotate;
|
|
740
|
+
transition-timing-function: var(--tw-ease, var(--komc-default-transition-timing-function));
|
|
741
|
+
transition-duration: var(--tw-duration, var(--komc-default-transition-duration));
|
|
742
|
+
}
|
|
680
743
|
.komc\:duration-200 {
|
|
681
744
|
--tw-duration: 200ms;
|
|
682
745
|
transition-duration: 200ms;
|
|
@@ -1016,6 +1079,18 @@
|
|
|
1016
1079
|
opacity: 0%;
|
|
1017
1080
|
}
|
|
1018
1081
|
}
|
|
1082
|
+
.komc\:data-\[state\=open\]\:translate-x-0 {
|
|
1083
|
+
&[data-state="open"] {
|
|
1084
|
+
--tw-translate-x: calc(var(--komc-spacing) * 0);
|
|
1085
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
.komc\:data-\[state\=open\]\:translate-y-0 {
|
|
1089
|
+
&[data-state="open"] {
|
|
1090
|
+
--tw-translate-y: calc(var(--komc-spacing) * 0);
|
|
1091
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1019
1094
|
.komc\:data-\[state\=open\]\:scale-100 {
|
|
1020
1095
|
&[data-state="open"] {
|
|
1021
1096
|
--tw-scale-x: 100%;
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`);let r=require(`clsx`);r=e.t(r);let i=require(`react`);i=e.t(i);let a=require(`react/jsx-runtime`),o=require(`class-variance-authority`),s=require(`@radix-ui/react-slot`);function c({className:e,items:t,render:n,...o}){return(0,a.jsx)(`nav`,{"data-komc":!0,"aria-label":`bottom app bar`,className:(0,r.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),...o,children:(0,a.jsx)(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>(0,a.jsx)(i.default.Fragment,{children:n(e)},t))})})}const l=(0,o.cva)(t.y(`komc:flex komc:justify-center komc:items-center komc:gap-x-2 komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:[&_svg]:transition-colors komc:[&_svg]:duration-200`,`komc:cursor-pointer komc:disabled:cursor-default`),{variants:{size:{xxs:`komc:h-7.5`,xs:`komc:h-8`,sm:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`,"4xl":`komc:h-15`},shadow:{none:``,sm:`komc:drop-shadow-sm`,md:`komc:drop-shadow-md`,lg:`komc:drop-shadow-lg`,xl:`komc:drop-shadow-xl`,"2xl":`komc:drop-shadow-2xl`,"3xl":`komc:drop-shadow-3xl`},outline:{line:`komc:border`,solid:`komc:border komc:border-transparent`,clear:`komc:border-none`},variant:{blue:``,duo:``,white:``,gray:``,neutral:``,night:``,black:``,sky:``,"sky-blue":``,indigo:``},px:{none:`komc:px-0`,xs:`komc:px-0.5`,sm:`komc:px-1`,md:`komc:px-1.5`,lg:`komc:px-2`,xl:`komc:px-3`,"2xl":`komc:px-4`,"3xl":`komc:px-5`,"4xl":`komc:px-6`},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`}},compoundVariants:[{outline:`line`,variant:`blue`,className:t.y(`komc:border-blue-500 komc:bg-white komc:text-blue-500`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`duo`,className:t.y(`komc:border-blue-500 komc:bg-white komc:text-brand-blck`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`white`,className:t.y(`komc:border-gray-600 komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200 komc:hover:text-brand-blck`,`komc:active:bg-gray-200 komc:active:text-brand-blck`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`gray`,className:t.y(`komc:border-white komc:bg-transparent komc:text-white`,`komc:hover:bg-[rgb(199,199,199)] komc:hover:text-white`,`komc:active:bg-[rgb(199,199,199)] komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`neutral`,className:t.y(`komc:border-gray-800 komc:bg-transparent komc:text-black`,`komc:hover:bg-gray-200 komc:hover:text-black`,`komc:active:bg-gray-200 komc:active:text-black`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky`,className:t.y(`komc:border-sky-750 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-750 komc:hover:text-white`,`komc:active:bg-sky-750 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky-blue`,className:t.y(`komc:border-sky-450 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-450 komc:hover:text-white`,`komc:active:bg-sky-450 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`solid`,variant:`white`,className:t.y(`komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200`,`komc:active:bg-gray-200`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`gray`,className:t.y(`komc:bg-gray-100 komc:text-blue-500`,`komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`blue`,className:t.y(`komc:bg-blue-500 komc:text-white`,`komc:hover:bg-night-700 komc:hover:text-white`,`komc:active:bg-night-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`night`,className:t.y(`komc:bg-night-700 komc:text-white`,`komc:hover:bg-night-800 komc:hover:text-white`,`komc:active:bg-night-800 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`black`,className:t.y(`komc:bg-[rgb(95,95,96)] komc:text-white`,`komc:hover:bg-[rgb(76,76,77)] komc:hover:text-white`,`komc:active:bg-[rgb(76,76,77)] komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`sky`,className:t.y(`komc:bg-sky-750 komc:text-white`,`komc:hover:bg-sky-950 komc:hover:text-white`,`komc:active:bg-sky-950 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`sky-blue`,className:t.y(`komc:bg-sky-450 komc:text-white`,`komc:hover:bg-sky-650 komc:hover:text-white`,`komc:active:bg-sky-650 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`indigo`,className:t.y(`komc:bg-indigo-600 komc:text-white`,`komc:hover:bg-indigo-700 komc:hover:text-white`,`komc:active:bg-indigo-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`clear`,variant:`sky`,className:t.y(`komc:bg-transparent komc:text-[#1890FF]`,`komc:hover:bg-transparent komc:hover:text-[#1890FF] komc:hover:underline`,`komc:active:bg-transparent komc:active:text-[#1890FF] komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`clear`,variant:`gray`,className:t.y(`komc:bg-transparent komc:text-gray-800`,`komc:hover:bg-transparent komc:hover:text-gray-800 komc:hover:underline`,`komc:active:bg-transparent komc:active:text-gray-800 komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)}],defaultVariants:{size:`md`,shadow:`none`,outline:`line`,variant:`blue`,px:`2xl`,rounded:`sm`}}),u=(0,i.forwardRef)(({type:e=`button`,className:t,id:n,size:r,shadow:i,outline:o,variant:c,px:u,rounded:d,asChild:f,...p},m)=>(0,a.jsx)(f?s.Slot:`button`,{ref:m,...p,type:e,id:n,className:l({size:r,shadow:i,outline:o,variant:c,px:u,rounded:d,className:t})}));var d=u;function f({condition:e,wrapper:t,children:n}){return e?t(n):n}const p=(0,o.cva)(t.y(`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`}}}),m=(0,i.forwardRef)(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:o=`lg`,className:s,...c},l)=>(0,a.jsxs)(`div`,{"data-komc":!0,className:p({size:n,gap:r,outline:i,rounded:o,className:s}),children:[e,(0,a.jsx)(`input`,{ref:l,type:`text`,...c}),t]}));var h=m;function g({children:e,className:t,...n}){return(0,a.jsx)(`span`,{...n,"data-komc":!0,"data-text":`${e}`,className:(0,r.default)(`komc:inline-flex komc:flex-col komc:justify-center komc:items-center`,`komc:after:content-[attr(data-text)] komc:after:font-bold`,`komc:after:h-0 komc:after:invisible komc:after:overflow-hidden`,`komc:after:select-none komc:after:pointer-events-none`,t),children:e})}exports.BottomAppBar=c,exports.Button=d,exports.ConditionalWrapper=f,exports.Input=h,exports.Skeleton=n.t,exports.StableText=g;
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react8 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
4
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
5
|
import { VariantProps } from "class-variance-authority";
|
|
6
6
|
|
|
7
7
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/ui/button/button.d.ts
|
|
20
20
|
declare const classes$2: (props?: ({
|
|
21
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
21
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xxs" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
22
22
|
shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
23
23
|
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
25
|
px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
26
26
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
27
|
-
} &
|
|
27
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
28
28
|
interface VariantMap {
|
|
29
29
|
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
30
30
|
solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
|
|
@@ -43,22 +43,22 @@ type ButtonProps = ComponentProps<'button'> & BaseProps & ({
|
|
|
43
43
|
}) & {
|
|
44
44
|
asChild?: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare const Button:
|
|
46
|
+
declare const Button: react8.ForwardRefExoticComponent<(Omit<react8.ClassAttributes<HTMLButtonElement> & react8.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
47
|
outline?: "line";
|
|
48
48
|
variant?: VariantMap["line"];
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "ref"> | Omit<
|
|
51
|
+
}, "ref"> | Omit<react8.ClassAttributes<HTMLButtonElement> & react8.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
52
|
outline: "solid";
|
|
53
53
|
variant?: VariantMap["solid"];
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "ref"> | Omit<
|
|
56
|
+
}, "ref"> | Omit<react8.ClassAttributes<HTMLButtonElement> & react8.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
57
|
outline: "clear";
|
|
58
58
|
variant?: VariantMap["clear"];
|
|
59
59
|
} & {
|
|
60
60
|
asChild?: boolean;
|
|
61
|
-
}, "ref">) &
|
|
61
|
+
}, "ref">) & react8.RefAttributes<HTMLButtonElement>>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
64
64
|
interface ConditionalWrapperProps {
|
|
@@ -70,15 +70,15 @@ declare function ConditionalWrapper({
|
|
|
70
70
|
condition,
|
|
71
71
|
wrapper,
|
|
72
72
|
children
|
|
73
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react8.ReactNode;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/input/input.d.ts
|
|
76
76
|
declare const classes$1: (props?: ({
|
|
77
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
77
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "base" | "xs" | "3xl" | null | undefined;
|
|
78
78
|
gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
79
79
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
80
80
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
81
|
-
} &
|
|
81
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
82
82
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
83
83
|
size?: VariantProps<typeof classes$1>['size'];
|
|
84
84
|
gap?: VariantProps<typeof classes$1>['gap'];
|
|
@@ -87,13 +87,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
87
87
|
prefix?: React.ReactNode;
|
|
88
88
|
surffix?: React.ReactNode;
|
|
89
89
|
}
|
|
90
|
-
declare const Input:
|
|
90
|
+
declare const Input: react8.ForwardRefExoticComponent<InputProps & react8.RefAttributes<HTMLInputElement>>;
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
93
93
|
declare const classes: (props?: ({
|
|
94
94
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
|
|
95
95
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
96
|
-
} &
|
|
96
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
97
97
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
98
98
|
width?: string | number;
|
|
99
99
|
height?: string | number;
|
|
@@ -107,7 +107,7 @@ declare function Skeleton({
|
|
|
107
107
|
height,
|
|
108
108
|
className,
|
|
109
109
|
...props
|
|
110
|
-
}: SkeletonProps):
|
|
110
|
+
}: SkeletonProps): react_jsx_runtime9.JSX.Element;
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
113
113
|
declare function StableText({
|
|
@@ -116,6 +116,6 @@ declare function StableText({
|
|
|
116
116
|
...props
|
|
117
117
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
118
118
|
children: string | number;
|
|
119
|
-
}):
|
|
119
|
+
}): react_jsx_runtime9.JSX.Element;
|
|
120
120
|
//#endregion
|
|
121
121
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react7 from "react";
|
|
2
2
|
import React$1, { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
|
-
import * as
|
|
5
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
6
|
|
|
7
7
|
//#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
|
|
8
8
|
interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
|
|
@@ -18,13 +18,13 @@ declare function BottomAppBar<T>({
|
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/ui/button/button.d.ts
|
|
20
20
|
declare const classes$2: (props?: ({
|
|
21
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
21
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "xxs" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
22
22
|
shadow?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | null | undefined;
|
|
23
23
|
outline?: "line" | "solid" | "clear" | null | undefined;
|
|
24
24
|
variant?: "blue" | "duo" | "white" | "gray" | "neutral" | "night" | "black" | "sky" | "sky-blue" | "indigo" | null | undefined;
|
|
25
25
|
px?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl" | null | undefined;
|
|
26
26
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
27
|
-
} &
|
|
27
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
28
28
|
interface VariantMap {
|
|
29
29
|
line: 'blue' | 'duo' | 'white' | 'gray' | 'neutral' | 'sky' | 'sky-blue';
|
|
30
30
|
solid: 'white' | 'gray' | 'blue' | 'night' | 'black' | 'sky' | 'sky-blue' | 'indigo';
|
|
@@ -43,22 +43,22 @@ type ButtonProps = ComponentProps<'button'> & BaseProps & ({
|
|
|
43
43
|
}) & {
|
|
44
44
|
asChild?: boolean;
|
|
45
45
|
};
|
|
46
|
-
declare const Button:
|
|
46
|
+
declare const Button: react7.ForwardRefExoticComponent<(Omit<react7.ClassAttributes<HTMLButtonElement> & react7.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
47
47
|
outline?: "line";
|
|
48
48
|
variant?: VariantMap["line"];
|
|
49
49
|
} & {
|
|
50
50
|
asChild?: boolean;
|
|
51
|
-
}, "ref"> | Omit<
|
|
51
|
+
}, "ref"> | Omit<react7.ClassAttributes<HTMLButtonElement> & react7.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
52
52
|
outline: "solid";
|
|
53
53
|
variant?: VariantMap["solid"];
|
|
54
54
|
} & {
|
|
55
55
|
asChild?: boolean;
|
|
56
|
-
}, "ref"> | Omit<
|
|
56
|
+
}, "ref"> | Omit<react7.ClassAttributes<HTMLButtonElement> & react7.ButtonHTMLAttributes<HTMLButtonElement> & BaseProps & {
|
|
57
57
|
outline: "clear";
|
|
58
58
|
variant?: VariantMap["clear"];
|
|
59
59
|
} & {
|
|
60
60
|
asChild?: boolean;
|
|
61
|
-
}, "ref">) &
|
|
61
|
+
}, "ref">) & react7.RefAttributes<HTMLButtonElement>>;
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
|
|
64
64
|
interface ConditionalWrapperProps {
|
|
@@ -70,15 +70,15 @@ declare function ConditionalWrapper({
|
|
|
70
70
|
condition,
|
|
71
71
|
wrapper,
|
|
72
72
|
children
|
|
73
|
-
}: ConditionalWrapperProps):
|
|
73
|
+
}: ConditionalWrapperProps): react7.ReactNode;
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/ui/input/input.d.ts
|
|
76
76
|
declare const classes$1: (props?: ({
|
|
77
|
-
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
77
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "base" | "xs" | "3xl" | null | undefined;
|
|
78
78
|
gap?: "none" | "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
79
79
|
outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
|
|
80
80
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
|
|
81
|
-
} &
|
|
81
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
82
82
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$1> {
|
|
83
83
|
size?: VariantProps<typeof classes$1>['size'];
|
|
84
84
|
gap?: VariantProps<typeof classes$1>['gap'];
|
|
@@ -87,13 +87,13 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
87
87
|
prefix?: React.ReactNode;
|
|
88
88
|
surffix?: React.ReactNode;
|
|
89
89
|
}
|
|
90
|
-
declare const Input:
|
|
90
|
+
declare const Input: react7.ForwardRefExoticComponent<InputProps & react7.RefAttributes<HTMLInputElement>>;
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region src/ui/skeleton/skeleton.d.ts
|
|
93
93
|
declare const classes: (props?: ({
|
|
94
94
|
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "xs" | "3xl" | "square" | null | undefined;
|
|
95
95
|
rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | "3xl" | null | undefined;
|
|
96
|
-
} &
|
|
96
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
97
97
|
interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
98
98
|
width?: string | number;
|
|
99
99
|
height?: string | number;
|
|
@@ -107,7 +107,7 @@ declare function Skeleton({
|
|
|
107
107
|
height,
|
|
108
108
|
className,
|
|
109
109
|
...props
|
|
110
|
-
}: SkeletonProps):
|
|
110
|
+
}: SkeletonProps): react_jsx_runtime8.JSX.Element;
|
|
111
111
|
//#endregion
|
|
112
112
|
//#region src/ui/stable-text/stable-text.d.ts
|
|
113
113
|
declare function StableText({
|
|
@@ -116,6 +116,6 @@ declare function StableText({
|
|
|
116
116
|
...props
|
|
117
117
|
}: Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
118
118
|
children: string | number;
|
|
119
|
-
}):
|
|
119
|
+
}): react_jsx_runtime8.JSX.Element;
|
|
120
120
|
//#endregion
|
|
121
121
|
export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, ConditionalWrapper, type ConditionalWrapperProps, Input, type InputProps, Skeleton, type SkeletonProps, StableText };
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as e}from"../util-
|
|
1
|
+
import{y as e}from"../util-zXJA6Gnc.mjs";import{t}from"../skeleton-S6S1ZnCy.mjs";import n from"clsx";import r,{forwardRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{Slot as c}from"@radix-ui/react-slot";function l({className:e,items:t,render:i,...o}){return a(`nav`,{"data-komc":!0,"aria-label":`bottom app bar`,className:n(`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),...o,children:a(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>a(r.Fragment,{children:i(e)},t))})})}const u=s(e(`komc:flex komc:justify-center komc:items-center komc:gap-x-2 komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:[&_svg]:transition-colors komc:[&_svg]:duration-200`,`komc:cursor-pointer komc:disabled:cursor-default`),{variants:{size:{xxs:`komc:h-7.5`,xs:`komc:h-8`,sm:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`,"4xl":`komc:h-15`},shadow:{none:``,sm:`komc:drop-shadow-sm`,md:`komc:drop-shadow-md`,lg:`komc:drop-shadow-lg`,xl:`komc:drop-shadow-xl`,"2xl":`komc:drop-shadow-2xl`,"3xl":`komc:drop-shadow-3xl`},outline:{line:`komc:border`,solid:`komc:border komc:border-transparent`,clear:`komc:border-none`},variant:{blue:``,duo:``,white:``,gray:``,neutral:``,night:``,black:``,sky:``,"sky-blue":``,indigo:``},px:{none:`komc:px-0`,xs:`komc:px-0.5`,sm:`komc:px-1`,md:`komc:px-1.5`,lg:`komc:px-2`,xl:`komc:px-3`,"2xl":`komc:px-4`,"3xl":`komc:px-5`,"4xl":`komc:px-6`},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`}},compoundVariants:[{outline:`line`,variant:`blue`,className:e(`komc:border-blue-500 komc:bg-white komc:text-blue-500`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`duo`,className:e(`komc:border-blue-500 komc:bg-white komc:text-brand-blck`,`komc:hover:border-transparent komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:border-transparent komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`white`,className:e(`komc:border-gray-600 komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200 komc:hover:text-brand-blck`,`komc:active:bg-gray-200 komc:active:text-brand-blck`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`gray`,className:e(`komc:border-white komc:bg-transparent komc:text-white`,`komc:hover:bg-[rgb(199,199,199)] komc:hover:text-white`,`komc:active:bg-[rgb(199,199,199)] komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-white komc:disabled:text-gray-500`)},{outline:`line`,variant:`neutral`,className:e(`komc:border-gray-800 komc:bg-transparent komc:text-black`,`komc:hover:bg-gray-200 komc:hover:text-black`,`komc:active:bg-gray-200 komc:active:text-black`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky`,className:e(`komc:border-sky-750 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-750 komc:hover:text-white`,`komc:active:bg-sky-750 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`line`,variant:`sky-blue`,className:e(`komc:border-sky-450 komc:bg-transparent komc:text-black`,`komc:hover:bg-sky-450 komc:hover:text-white`,`komc:active:bg-sky-450 komc:active:text-white`,`komc:disabled:border-gray-500 komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`solid`,variant:`white`,className:e(`komc:bg-white komc:text-brand-blck`,`komc:hover:bg-gray-200`,`komc:active:bg-gray-200`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`gray`,className:e(`komc:bg-gray-100 komc:text-blue-500`,`komc:hover:bg-blue-500 komc:hover:text-white`,`komc:active:bg-blue-500 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`blue`,className:e(`komc:bg-blue-500 komc:text-white`,`komc:hover:bg-night-700 komc:hover:text-white`,`komc:active:bg-night-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`night`,className:e(`komc:bg-night-700 komc:text-white`,`komc:hover:bg-night-800 komc:hover:text-white`,`komc:active:bg-night-800 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`black`,className:e(`komc:bg-[rgb(95,95,96)] komc:text-white`,`komc:hover:bg-[rgb(76,76,77)] komc:hover:text-white`,`komc:active:bg-[rgb(76,76,77)] komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-50 komc:disabled:text-gray-800`)},{outline:`solid`,variant:`sky`,className:e(`komc:bg-sky-750 komc:text-white`,`komc:hover:bg-sky-950 komc:hover:text-white`,`komc:active:bg-sky-950 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`sky-blue`,className:e(`komc:bg-sky-450 komc:text-white`,`komc:hover:bg-sky-650 komc:hover:text-white`,`komc:active:bg-sky-650 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`solid`,variant:`indigo`,className:e(`komc:bg-indigo-600 komc:text-white`,`komc:hover:bg-indigo-700 komc:hover:text-white`,`komc:active:bg-indigo-700 komc:active:text-white`,`komc:disabled:border-white komc:disabled:bg-gray-700`)},{outline:`clear`,variant:`sky`,className:e(`komc:bg-transparent komc:text-[#1890FF]`,`komc:hover:bg-transparent komc:hover:text-[#1890FF] komc:hover:underline`,`komc:active:bg-transparent komc:active:text-[#1890FF] komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)},{outline:`clear`,variant:`gray`,className:e(`komc:bg-transparent komc:text-gray-800`,`komc:hover:bg-transparent komc:hover:text-gray-800 komc:hover:underline`,`komc:active:bg-transparent komc:active:text-gray-800 komc:active:underline`,`komc:disabled:border-transparent komc:disabled:bg-transparent komc:disabled:text-gray-500`)}],defaultVariants:{size:`md`,shadow:`none`,outline:`line`,variant:`blue`,px:`2xl`,rounded:`sm`}});var d=i(({type:e=`button`,className:t,id:n,size:r,shadow:i,outline:o,variant:s,px:l,rounded:d,asChild:f,...p},m)=>a(f?c:`button`,{ref:m,...p,type:e,id:n,className:u({size:r,shadow:i,outline:o,variant:s,px:l,rounded:d,className:t})}));function f({condition:e,wrapper:t,children:n}){return e?t(n):n}const p=s(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=i(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:s=`lg`,className:c,...l},u)=>o(`div`,{"data-komc":!0,className:p({size:n,gap:r,outline:i,rounded:s,className:c}),children:[e,a(`input`,{ref:u,type:`text`,...l}),t]}));function h({children:e,className:t,...r}){return a(`span`,{...r,"data-komc":!0,"data-text":`${e}`,className:n(`komc:inline-flex komc:flex-col komc:justify-center komc:items-center`,`komc:after:content-[attr(data-text)] komc:after:font-bold`,`komc:after:h-0 komc:after:invisible komc:after:overflow-hidden`,`komc:after:select-none komc:after:pointer-events-none`,t),children:e})}export{l as BottomAppBar,d as Button,f as ConditionalWrapper,m as Input,t as Skeleton,h as StableText};
|
package/dist/ui-client/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../util-BMnQ9hLK.cjs`),n=require(`../skeleton-D80eauT0.cjs`),r=require(`../hooks-B6OJ8mCP.cjs`);let i=require(`lodash-es`),a=require(`clsx`);a=e.t(a);let o=require(`react`);o=e.t(o);let s=require(`react/jsx-runtime`),c=require(`class-variance-authority`),l=require(`embla-carousel-react`);l=e.t(l);let u=require(`react-dom`);const d=o.default.createContext(null);function f(){let e=o.default.useContext(d);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function p({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:c,...u}){let[f,p]=(0,l.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),v=(0,o.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=(0,o.useCallback)(()=>{p?.scrollPrev()},[p]),b=(0,o.useCallback)(()=>{p?.scrollNext()},[p]),x=(0,o.useCallback)(t=>{e===`horizontal`?t.key===`ArrowLeft`?(t.preventDefault(),y()):t.key===`ArrowRight`&&(t.preventDefault(),b()):t.key===`ArrowUp`?(t.preventDefault(),y()):t.key===`ArrowDown`&&(t.preventDefault(),b())},[y,b,e]);return(0,o.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,o.useEffect)(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),(0,s.jsx)(d.Provider,{value:{carouselRef:f,api:p,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:m,canScrollNext:g},children:(0,s.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:x,className:t.y(`komc:relative`,a),...u,children:c})})}function m({className:e,...n}){let{carouselRef:r,orientation:i}=f();return(0,s.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,s.jsx)(`div`,{className:t.y(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function h({className:e,...n}){let{orientation:r}=f();return(0,s.jsx)(`div`,{"data-komc":!0,className:t.y(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function g({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=f();return(0,s.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:(0,a.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function _({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=f();return(0,s.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:(0,a.default)(`komc:w-full`,t),onClick:r,...n,children:e})}const v=(0,c.cva)(`komc:relative komc:z-10 komc:w-full komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function y({closeOnBackdropClick:e=!0,isOpen:t,zIndex:n=1e4,padding:i,maxWidth:a,className:c,onClose:l,children:u,...d}){let f=r.c(t,300),[p,m]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(t&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else t||m(!1)},[t,f]);let h=(0,o.useCallback)(e=>{e.key===`Escape`&&l()},[l]),g=(0,o.useCallback)(()=>{e&&l()},[e,l]);return(0,o.useEffect)(()=>(t?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[t,h]),f?(0,s.jsxs)(`div`,{"data-komc":!0,className:`komc:flex komc:justify-center komc:items-center komc:fixed komc:inset-0`,style:{zIndex:n},children:[(0,s.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:`komc:w-full komc:h-full komc:bg-black/50 komc:absolute komc:inset-0 komc:cursor-default komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:g,"aria-label":`close dialog`}),(0,s.jsx)(`div`,{"data-state":p?`open`:`closed`,className:`${v({padding:i,maxWidth:a,className:c})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:u})]}):null}const b=(0,c.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),x=(0,o.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,s.jsx)(`img`,{ref:n,...i})}),S=(0,o.forwardRef)(({skeleton:e=!0,layout:t=`stretch`,fallbackSrc:i,className:o,emptyNode:c,emptyNodeClassName:l,skeletonClassName:u,...d},f)=>{let{ref:p,isLoad:m,isError:h,imageProps:g}=r.r({ref:f,fallbackSrc:i,forceLoad:!e,...d}),_=!d.fill&&t===`intrinsic`?{width:`${d.width}px`,height:`${d.height}px`}:void 0,v=(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!d.fill&&t===`stretch`&&`komc:w-full komc:h-full`);return!i&&h&&c?d.fill?(0,s.jsx)(C,{className:l,children:c}):(0,s.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,s.jsx)(C,{className:l,children:c})}):d.fill?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`img`,{ref:p,...g,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:invisible`:`komc:visible`,o)}),(0,s.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,s.jsx)(n.t,{size:`full`,className:u})})]}):(0,s.jsxs)(`div`,{"data-komc":!0,style:_,className:v,children:[(0,s.jsx)(`img`,{ref:p,...g,className:(0,a.default)(b({fill:d.fill,className:o}),e&&!m?`komc:invisible`:`komc:visible`)}),(0,s.jsx)(`div`,{className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,s.jsx)(n.t,{size:`full`,className:u})})]})}),C=({children:e,className:t})=>(0,s.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var w=S;function T({children:e,setOpen:t}){return(0,s.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const E=(0,c.cva)(t.y(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}}),D=(0,o.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,s.jsx)(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:E({portal:e,placement:r,className:n}),...i,children:t}));var O=D;const k=(0,c.cva)(t.y(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.y(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.y(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.y(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.y(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.y(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.y(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),A=({placement:e,className:t,offset:n,style:r,...i})=>{let a=(0,o.useMemo)(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return(0,s.jsx)(`div`,{className:k({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};var j=A;const M=24,N=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function P({placement:e,className:t,content:n,open:r,hiddenRef:c,containerRef:l}){let[d,f]=(0,o.useState)(!1),p=(0,o.useRef)(null),[m,h]=(0,o.useState)(e),[g,_]=(0,o.useState)({top:0,left:0}),[v,y]=(0,o.useState)({x:0,y:0}),b=(0,o.useCallback)((0,i.debounce)(()=>{let e=l?.current,t=c.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.scrollY||document.documentElement.scrollTop,a=window.scrollX||document.documentElement.scrollLeft,[o,s]=m.split(`-`),u=i+n.top,d=a+n.left+n.width/2-r.width/2;switch(o){case`top`:u-=r.height;break;case`bottom`:u+=n.height;break}switch(s){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),_({top:u,left:f}),y({x:d-f,y:0})},50),[m]),x=(0,o.useCallback)((0,i.debounce)(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();h(r=>{let i=e;return t+n>=window.innerHeight?i=N(r,`top`):t<0&&(i=N(r,`bottom`)),i})},50),[e]);return(0,o.useEffect)(()=>(f(!0),x(),window.addEventListener(`scroll`,b,{passive:!0}),window.addEventListener(`resize`,b),window.addEventListener(`scroll`,x,{passive:!0}),window.addEventListener(`resize`,x),()=>{window.removeEventListener(`scroll`,b),window.removeEventListener(`resize`,b),window.removeEventListener(`scroll`,x),window.removeEventListener(`resize`,x)}),[b,x]),(0,o.useEffect)(()=>{d&&b()},[d,b]),d?(0,u.createPortal)((0,s.jsxs)(O,{ref:p,portal:!0,"data-komc":!0,placement:m,className:(0,a.default)(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,s.jsx)(`span`,{children:n}),(0,s.jsx)(j,{placement:m,offset:v})]}),document.body):null}const F=(0,o.forwardRef)(({children:e,content:t,defaultOpen:n=!1,className:i,placement:c=`top`},l)=>{let[u,d]=(0,o.useState)(n),f=(0,o.useRef)(null),p=(0,o.useRef)(null);return r.o({ref:f,setOpen:d}),(0,s.jsxs)(`div`,{ref:f,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,s.jsx)(T,{setOpen:d,children:e}),(0,s.jsx)(P,{placement:c,className:i,open:u,content:t,hiddenRef:p,containerRef:f}),(0,s.jsx)(O,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:c,className:(0,a.default)(`komc:opacity-0 komc:invisible`,i),children:(0,s.jsx)(`span`,{children:t})})]})});var I=F;exports.BaseImage=x,exports.Carousel=p,exports.CarouselItem=h,exports.CarouselNext=_,exports.CarouselPrevious=g,exports.CarouselWrapper=m,exports.Dialog=y,exports.EmptyNode=C,exports.Image=w,exports.Tooltip=I;
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../src-CjpmdVyv.cjs`);const t=require(`../util-o7fjt7iK.cjs`),n=require(`../skeleton-g6yXh6D9.cjs`),r=require(`../hooks-DqgWx1Fa.cjs`);require(`../providers-BNK8Fisc.cjs`);let i=require(`lodash-es`),a=require(`clsx`);a=e.t(a);let o=require(`react`);o=e.t(o);let s=require(`react/jsx-runtime`),c=require(`class-variance-authority`),l=require(`embla-carousel-react`);l=e.t(l);let u=require(`react-dom`);const d=o.default.createContext(null);function f(){let e=o.default.useContext(d);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function p({orientation:e=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:c,...u}){let[f,p]=(0,l.default)({...n,axis:e===`horizontal`?`x`:`y`},i),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)(!1),v=(0,o.useCallback)(e=>{e&&(h(e.canScrollPrev()),_(e.canScrollNext()))},[]),y=(0,o.useCallback)(()=>{p?.scrollPrev()},[p]),b=(0,o.useCallback)(()=>{p?.scrollNext()},[p]),x=(0,o.useCallback)(t=>{e===`horizontal`?t.key===`ArrowLeft`?(t.preventDefault(),y()):t.key===`ArrowRight`&&(t.preventDefault(),b()):t.key===`ArrowUp`?(t.preventDefault(),y()):t.key===`ArrowDown`&&(t.preventDefault(),b())},[y,b,e]);return(0,o.useEffect)(()=>{!p||!r||r(p)},[p,r]),(0,o.useEffect)(()=>{if(p)return v(p),p.on(`reInit`,v),p.on(`select`,v),()=>{p?.off(`select`,v)}},[p,v]),(0,s.jsx)(d.Provider,{value:{carouselRef:f,api:p,options:n,orientation:e||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:y,scrollNext:b,canScrollPrev:m,canScrollNext:g},children:(0,s.jsx)(`div`,{"data-komc":!0,role:`region`,"aria-label":`carousel`,"aria-roledescription":`carousel`,tabIndex:0,onKeyDownCapture:x,className:t.y(`komc:relative`,a),...u,children:c})})}function m({className:e,...n}){let{carouselRef:r,orientation:i}=f();return(0,s.jsx)(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:(0,s.jsx)(`div`,{className:t.y(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,e),...n})})}function h({className:e,...n}){let{orientation:r}=f();return(0,s.jsx)(`div`,{"data-komc":!0,className:t.y(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,e),...n})}function g({children:e,className:t,...n}){let{scrollPrev:r,canScrollPrev:i}=f();return(0,s.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`previous slide`,className:(0,a.default)(`komc:w-full`,t),onClick:r,...n,children:e})}function _({children:e,className:t,...n}){let{scrollNext:r,canScrollNext:i}=f();return(0,s.jsx)(`button`,{type:`button`,"data-komc":!0,disabled:!i,"aria-label":`next slide`,className:(0,a.default)(`komc:w-full`,t),onClick:r,...n,children:e})}const v=(0,c.cva)(`komc:relative komc:z-10 komc:w-full komc:transition-all komc:duration-300 komc:ease-in-out`,{variants:{padding:{sm:`komc:p-2`,md:`komc:p-4`,lg:`komc:p-6`,none:`komc:p-0`},maxWidth:{sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,full:`komc:max-w-full`}},defaultVariants:{padding:`sm`,maxWidth:`md`}});function y({closeOnBackdropClick:e=!0,isOpen:t,zIndex:n=1e4,padding:i,maxWidth:a,className:c,onClose:l,children:u,...d}){let f=r.c(t,300),[p,m]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(t&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else t||m(!1)},[t,f]);let h=(0,o.useCallback)(e=>{e.key===`Escape`&&l()},[l]),g=(0,o.useCallback)(()=>{e&&l()},[e,l]);return(0,o.useEffect)(()=>(t?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[t,h]),f?(0,s.jsxs)(`div`,{"data-komc":!0,className:`komc:flex komc:justify-center komc:items-center komc:fixed komc:inset-0`,style:{zIndex:n},children:[(0,s.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:`komc:w-full komc:h-full komc:bg-black/50 komc:absolute komc:inset-0 komc:cursor-default komc:transition-opacity komc:duration-300 komc:ease-in-out komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100`,onClick:g,"aria-label":`close dialog`}),(0,s.jsx)(`div`,{"data-state":p?`open`:`closed`,className:`${v({padding:i,maxWidth:a,className:c})} komc:data-[state=closed]:opacity-0 komc:data-[state=open]:opacity-100 komc:data-[state=closed]:scale-95 komc:data-[state=open]:scale-100`,role:`dialog`,"aria-modal":`true`,...d,children:u})]}):null}const b=(0,c.cva)(``,{variants:{fill:{true:`komc:w-full komc:h-full komc:absolute komc:inset-0`,false:``}},defaultVariants:{fill:!1}}),x=(0,o.forwardRef)(({...e},t)=>{let{ref:n,imageProps:i}=r.r({ref:t,...e});return(0,s.jsx)(`img`,{ref:n,...i})}),S=(0,o.forwardRef)(({skeleton:e=!0,layout:t=`stretch`,fallbackSrc:i,className:o,emptyNode:c,emptyNodeClassName:l,skeletonClassName:u,...d},f)=>{let{ref:p,isLoad:m,isError:h,imageProps:g}=r.r({ref:f,fallbackSrc:i,forceLoad:!e,...d}),_=!d.fill&&t===`intrinsic`?{width:`${d.width}px`,height:`${d.height}px`}:void 0,v=(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:relative komc:min-h-0`,!d.fill&&t===`stretch`&&`komc:w-full komc:h-full`);return!i&&h&&c?d.fill?(0,s.jsx)(C,{className:l,children:c}):(0,s.jsx)(`div`,{"data-komc":!0,style:_,className:v,children:(0,s.jsx)(C,{className:l,children:c})}):d.fill?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`img`,{ref:p,...g,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:invisible`:`komc:visible`,o)}),(0,s.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,s.jsx)(n.t,{size:`full`,className:u})})]}):(0,s.jsxs)(`div`,{"data-komc":!0,style:_,className:v,children:[(0,s.jsx)(`img`,{ref:p,...g,className:(0,a.default)(b({fill:d.fill,className:o}),e&&!m?`komc:invisible`:`komc:visible`)}),(0,s.jsx)(`div`,{className:(0,a.default)(`komc:w-full komc:h-full komc:absolute komc:inset-0`,e&&!m?`komc:block`:`komc:hidden`),children:(0,s.jsx)(n.t,{size:`full`,className:u})})]})}),C=({children:e,className:t})=>(0,s.jsx)(`div`,{"data-komc":!0,role:`alert`,className:(0,a.default)(`komc:flex komc:justify-center komc:items-center komc:w-full komc:h-full komc:bg-gray-100 komc:absolute komc:inset-0 komc:p-1`,t),children:e});var w=S;const T=(0,c.cva)((0,a.default)(`komc:absolute komc:bg-white komc:flex komc:flex-col komc:shadow-2xl`,`komc:transition-transform komc:duration-300 komc:ease-in-out`),{variants:{direction:{top:`komc:top-0 komc:left-0 komc:right-0 komc:-translate-y-full komc:data-[state=open]:translate-y-0`,bottom:`komc:bottom-0 komc:left-0 komc:right-0 komc:translate-y-full komc:data-[state=open]:translate-y-0`,left:`komc:top-0 komc:bottom-0 komc:left-0 komc:-translate-x-full komc:data-[state=open]:translate-x-0`,right:`komc:top-0 komc:bottom-0 komc:right-0 komc:translate-x-full komc:data-[state=open]:translate-x-0`}}}),E=(0,c.cva)(``,{variants:{size:{full:``,half:``,auto:``},direction:{top:``,bottom:``,left:``,right:``}},compoundVariants:[{size:`full`,direction:`top`,className:`komc:h-full`},{size:`full`,direction:`bottom`,className:`komc:h-full`},{size:`full`,direction:`left`,className:`komc:w-full`},{size:`full`,direction:`right`,className:`komc:w-full`},{size:`half`,direction:`top`,className:`komc:h-[50dvh]`},{size:`half`,direction:`bottom`,className:`komc:h-[50dvh]`},{size:`half`,direction:`left`,className:`komc:w-[50dvw]`},{size:`half`,direction:`right`,className:`komc:w-[50dvw]`},{size:`auto`,direction:`top`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`bottom`,className:`komc:h-auto komc:max-h-[90dvh]`},{size:`auto`,direction:`left`,className:`komc:w-auto komc:max-w-[90dvw]`},{size:`auto`,direction:`right`,className:`komc:w-auto komc:max-w-[90dvw]`}]});function D({isOpen:e,onClose:t,direction:n=`bottom`,size:i=`full`,children:c,className:l,closeOnBackdropClick:u=!0,zIndex:d=1001}){let f=r.c(e,300),[p,m]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(e&&f){let e=setTimeout(()=>m(!0),10);return()=>clearTimeout(e)}else e||m(!1)},[e,f]);let h=(0,o.useCallback)(e=>{e.key===`Escape`&&t()},[t]),g=(0,o.useCallback)(()=>{u&&t()},[u,t]);return(0,o.useEffect)(()=>(e?(document.addEventListener(`keydown`,h),document.body.style.overflow=`hidden`):document.body.style.overflow=`unset`,()=>{document.removeEventListener(`keydown`,h),document.body.style.overflow=`unset`}),[e,h]),f?(0,s.jsxs)(`div`,{className:`komc:fixed komc:inset-0 komc:flex komc:justify-center komc:items-center`,style:{zIndex:d},children:[(0,s.jsx)(`button`,{type:`button`,"data-state":p?`open`:`closed`,className:(0,a.default)(`komc:absolute komc:inset-0 komc:w-full komc:h-full komc:bg-black/40 komc:cursor-default`,`komc:transition-opacity komc:duration-300 komc:ease-in-out`,`komc:opacity-0 komc:data-[state=open]:opacity-100`),onClick:g,"aria-label":`close sheet`}),(0,s.jsx)(`div`,{"data-state":p?`open`:`closed`,className:(0,a.default)(T({direction:n,className:l}),E({direction:n,size:i})),role:`dialog`,"aria-modal":`true`,children:c})]}):null}function O({children:e,setOpen:t}){return(0,s.jsx)(`div`,{"data-komc":!0,className:(0,a.default)(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const k=(0,c.cva)(t.y(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`}],defaultVariants:{placement:`top`,portal:!1}}),A=(0,o.forwardRef)(({portal:e,children:t,className:n,placement:r,...i},a)=>(0,s.jsx)(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:k({portal:e,placement:r,className:n}),...i,children:t}));var j=A;const M=(0,c.cva)(t.y(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:t.y(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:t.y(`komc:bottom-full komc:-mb-1 komc:left-1/2`),"top-start":t.y(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":t.y(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":t.y(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":t.y(`komc:bottom-full komc:-mb-1 komc:right-5`)}},defaultVariants:{placement:`top`}}),N=({placement:e,className:t,offset:n,style:r,...i})=>{let a=(0,o.useMemo)(()=>{switch(e){case`top`:case`top-start`:case`top-end`:return`rotate(45deg)`;case`bottom`:case`bottom-start`:case`bottom-end`:return`rotate(225deg)`;default:return`rotate(45deg)`}},[e]);return(0,s.jsx)(`div`,{className:M({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};var P=N;const F=24,I=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function L({placement:e,className:t,content:n,open:r,hiddenRef:c,containerRef:l}){let[d,f]=(0,o.useState)(!1),p=(0,o.useRef)(null),[m,h]=(0,o.useState)(e),[g,_]=(0,o.useState)({top:0,left:0}),[v,y]=(0,o.useState)({x:0,y:0}),b=(0,o.useCallback)((0,i.debounce)(()=>{let e=l?.current,t=c.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.scrollY||document.documentElement.scrollTop,a=window.scrollX||document.documentElement.scrollLeft,[o,s]=m.split(`-`),u=i+n.top,d=a+n.left+n.width/2-r.width/2;switch(o){case`top`:u-=r.height;break;case`bottom`:u+=n.height;break}switch(s){case`start`:d+=r.width/2-24;break;case`end`:d-=r.width/2-24;break}let f=d,p=window.innerWidth;f+r.width>p-4&&(f=p-r.width-4),f<4&&(f=4),_({top:u,left:f}),y({x:d-f,y:0})},50),[m]),x=(0,o.useCallback)((0,i.debounce)(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();h(r=>{let i=e;return t+n>=window.innerHeight?i=I(r,`top`):t<0&&(i=I(r,`bottom`)),i})},50),[e]);return(0,o.useEffect)(()=>(f(!0),x(),window.addEventListener(`scroll`,b,{passive:!0}),window.addEventListener(`resize`,b),window.addEventListener(`scroll`,x,{passive:!0}),window.addEventListener(`resize`,x),()=>{window.removeEventListener(`scroll`,b),window.removeEventListener(`resize`,b),window.removeEventListener(`scroll`,x),window.removeEventListener(`resize`,x)}),[b,x]),(0,o.useEffect)(()=>{d&&b()},[d,b]),d?(0,u.createPortal)((0,s.jsxs)(j,{ref:p,portal:!0,"data-komc":!0,placement:m,className:(0,a.default)(t,r?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...g},children:[(0,s.jsx)(`span`,{children:n}),(0,s.jsx)(P,{placement:m,offset:v})]}),document.body):null}const R=(0,o.forwardRef)(({children:e,content:t,defaultOpen:n=!1,className:i,placement:c=`top`},l)=>{let[u,d]=(0,o.useState)(n),f=(0,o.useRef)(null),p=(0,o.useRef)(null);return r.o({ref:f,setOpen:d}),(0,s.jsxs)(`div`,{ref:f,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[(0,s.jsx)(O,{setOpen:d,children:e}),(0,s.jsx)(L,{placement:c,className:i,open:u,content:t,hiddenRef:p,containerRef:f}),(0,s.jsx)(j,{ref:p,role:`presentation`,"aria-hidden":`true`,placement:c,className:(0,a.default)(`komc:opacity-0 komc:invisible`,i),children:(0,s.jsx)(`span`,{children:t})})]})});var z=R;exports.BaseImage=x,exports.Carousel=p,exports.CarouselItem=h,exports.CarouselNext=_,exports.CarouselPrevious=g,exports.CarouselWrapper=m,exports.Dialog=y,exports.EmptyNode=C,exports.Image=w,exports.Sheet=D,exports.Tooltip=z;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { a as UseSubsetImageProps, n as BaseProps
|
|
2
|
-
import
|
|
3
|
-
import * as react14 from "react";
|
|
1
|
+
import { a as UseSubsetImageProps, n as BaseProps } from "../index-ComhjQ-q.cjs";
|
|
2
|
+
import * as react3 from "react";
|
|
4
3
|
import React$1, { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
5
|
-
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
4
|
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
7
|
-
import
|
|
5
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
6
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
8
7
|
import { VariantProps } from "class-variance-authority";
|
|
9
8
|
|
|
10
9
|
//#region src/ui-client/carousel/carousel-context.d.ts
|
|
@@ -74,7 +73,7 @@ declare function CarouselNext({
|
|
|
74
73
|
declare const classes: (props?: ({
|
|
75
74
|
padding?: "none" | "sm" | "md" | "lg" | null | undefined;
|
|
76
75
|
maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
77
|
-
} &
|
|
76
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
78
77
|
interface DialogProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
|
|
79
78
|
closeOnBackdropClick?: boolean;
|
|
80
79
|
isOpen: boolean;
|
|
@@ -103,37 +102,28 @@ type ImageSubsetProps = {
|
|
|
103
102
|
skeletonClassName?: string;
|
|
104
103
|
};
|
|
105
104
|
type ImageProps = UseSubsetImageProps & ImageSubsetProps;
|
|
106
|
-
|
|
107
|
-
declare const BaseImage: react14.ForwardRefExoticComponent<(Omit<Omit<BaseProps, "apiClient"> & {
|
|
105
|
+
declare const BaseImage: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
108
106
|
fill: true;
|
|
109
107
|
sizes: string;
|
|
110
108
|
width?: never;
|
|
111
109
|
height?: never;
|
|
112
|
-
} & {
|
|
113
|
-
apiClient: ApiClient;
|
|
114
|
-
}, "ref"> | Omit<Omit<BaseProps, "apiClient"> & {
|
|
110
|
+
}, "ref"> | Omit<BaseProps & {
|
|
115
111
|
fill?: false;
|
|
116
112
|
sizes?: never;
|
|
117
113
|
width: number;
|
|
118
114
|
height: number;
|
|
119
|
-
} &
|
|
120
|
-
|
|
121
|
-
}, "ref">) & react14.RefAttributes<HTMLImageElement>>;
|
|
122
|
-
declare const Image: react14.ForwardRefExoticComponent<(Omit<Omit<BaseProps, "apiClient"> & {
|
|
115
|
+
}, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
116
|
+
declare const Image: react3.ForwardRefExoticComponent<(Omit<BaseProps & {
|
|
123
117
|
fill: true;
|
|
124
118
|
sizes: string;
|
|
125
119
|
width?: never;
|
|
126
120
|
height?: never;
|
|
127
|
-
} & {
|
|
128
|
-
apiClient: ApiClient;
|
|
129
|
-
} & ImageSubsetProps, "ref"> | Omit<Omit<BaseProps, "apiClient"> & {
|
|
121
|
+
} & ImageSubsetProps, "ref"> | Omit<BaseProps & {
|
|
130
122
|
fill?: false;
|
|
131
123
|
sizes?: never;
|
|
132
124
|
width: number;
|
|
133
125
|
height: number;
|
|
134
|
-
} &
|
|
135
|
-
apiClient: ApiClient;
|
|
136
|
-
} & ImageSubsetProps, "ref">) & react14.RefAttributes<HTMLImageElement>>;
|
|
126
|
+
} & ImageSubsetProps, "ref">) & react3.RefAttributes<HTMLImageElement>>;
|
|
137
127
|
interface EmptyNodeProps {
|
|
138
128
|
children: React.ReactNode;
|
|
139
129
|
className?: string;
|
|
@@ -143,6 +133,30 @@ declare const EmptyNode: ({
|
|
|
143
133
|
className
|
|
144
134
|
}: EmptyNodeProps) => react_jsx_runtime3.JSX.Element;
|
|
145
135
|
//#endregion
|
|
136
|
+
//#region src/ui-client/sheet/sheet.d.ts
|
|
137
|
+
type Direction = 'top' | 'bottom' | 'left' | 'right';
|
|
138
|
+
type Size = 'full' | 'half' | 'auto';
|
|
139
|
+
interface SheetProps {
|
|
140
|
+
isOpen: boolean;
|
|
141
|
+
onClose: () => void;
|
|
142
|
+
direction?: Direction;
|
|
143
|
+
size?: Size;
|
|
144
|
+
children: React$1.ReactNode;
|
|
145
|
+
className?: string;
|
|
146
|
+
closeOnBackdropClick?: boolean;
|
|
147
|
+
zIndex?: number;
|
|
148
|
+
}
|
|
149
|
+
declare function Sheet({
|
|
150
|
+
isOpen,
|
|
151
|
+
onClose,
|
|
152
|
+
direction,
|
|
153
|
+
size,
|
|
154
|
+
children,
|
|
155
|
+
className,
|
|
156
|
+
closeOnBackdropClick,
|
|
157
|
+
zIndex
|
|
158
|
+
}: SheetProps): react_jsx_runtime3.JSX.Element | null;
|
|
159
|
+
//#endregion
|
|
146
160
|
//#region src/ui-client/tooltip/tooltip-container.d.ts
|
|
147
161
|
type SubPlacement = 'start' | 'end';
|
|
148
162
|
type MainPlacement = 'top' | 'bottom';
|
|
@@ -153,6 +167,6 @@ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
153
167
|
placement?: TooltipPlacement;
|
|
154
168
|
defaultOpen?: boolean;
|
|
155
169
|
}
|
|
156
|
-
declare const TooltipContainer:
|
|
170
|
+
declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
|
|
157
171
|
//#endregion
|
|
158
|
-
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type
|
|
172
|
+
export { BaseImage, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, Dialog, type DialogProps, EmptyNode, type EmptyNodeProps, Image, type ImageProps, type ImageSubsetProps, Sheet, type SheetProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
|