@dimasbaguspm/versaur 0.0.60 → 0.0.62
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/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-CCvXv24a.js → image-rectangle-BwT5taeR.js} +694 -634
- package/dist/js/index.js +63 -61
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +2 -2
- package/dist/js/primitive/index.js +27 -25
- package/dist/js/{tabs-BQs53hHL.js → tabs-FDdFo4WV.js} +1 -1
- package/dist/js/{time-picker-input-Disd231b.js → time-picker-input-DMNSwm-p.js} +854 -642
- package/dist/js/tooltip-BGJUYNL0.js +625 -0
- package/dist/js/{top-bar-DMBbEIlR.js → top-bar-ChNgZEQx.js} +157 -187
- package/dist/types/forms/textarea-input/index.d.ts +1 -1
- package/dist/types/forms/textarea-input/textarea-input.atoms.d.ts +53 -0
- package/dist/types/forms/textarea-input/textarea-input.d.ts +1 -0
- package/dist/types/forms/textarea-input/types.d.ts +28 -0
- package/dist/types/forms/textarea-input/use-textarea-formatting.d.ts +21 -0
- package/dist/types/overlays/drawer/drawer.atoms.d.ts +2 -7
- package/dist/types/overlays/drawer/drawer.d.ts +1 -1
- package/dist/types/overlays/drawer/types.d.ts +1 -11
- package/dist/types/overlays/modal/modal.atoms.d.ts +1 -5
- package/dist/types/overlays/modal/types.d.ts +1 -2
- package/dist/types/primitive/formatted-text/formatted-text.d.ts +10 -0
- package/dist/types/primitive/formatted-text/index.d.ts +3 -0
- package/dist/types/primitive/formatted-text/types.d.ts +19 -0
- package/dist/types/primitive/heading/types.d.ts +9 -12
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/text/text.d.ts +6 -3
- package/dist/types/primitive/text/types.d.ts +10 -18
- package/dist/types/primitive/tile/tile.d.ts +7 -1
- package/dist/types/primitive/tile/types.d.ts +6 -1
- package/dist/utils/enforce-subpath-import.js +2 -0
- package/package.json +2 -1
- package/dist/js/tooltip-Dpx3TpR6.js +0 -693
|
@@ -1,693 +0,0 @@
|
|
|
1
|
-
import { j as r } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import g, { useState as y, useEffect as v, createContext as V, useContext as T, forwardRef as p, useRef as S, useId as k, useMemo as _, cloneElement as $ } from "react";
|
|
3
|
-
import { c as h, a as u } from "./index-BDtz_hQY.js";
|
|
4
|
-
import { XIcon as R } from "lucide-react";
|
|
5
|
-
import { n as D, l as H, H as G, t as U } from "./image-rectangle-CCvXv24a.js";
|
|
6
|
-
import "./snackbar-CTq4MLir.js";
|
|
7
|
-
import X from "react-dom";
|
|
8
|
-
function q() {
|
|
9
|
-
if (typeof window > "u") return !1;
|
|
10
|
-
const e = window.navigator.userAgent, t = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
11
|
-
e
|
|
12
|
-
), o = /iPad|Android(?=.*Mobile)|Tablet/i.test(e), n = "ontouchstart" in window || navigator.maxTouchPoints > 0, a = window.innerWidth <= 1024;
|
|
13
|
-
return t || o || n && a;
|
|
14
|
-
}
|
|
15
|
-
function B() {
|
|
16
|
-
return typeof window < "u" && "navigator" in window && "virtualKeyboard" in navigator;
|
|
17
|
-
}
|
|
18
|
-
function J() {
|
|
19
|
-
const [e, t] = y(!1), [o, n] = y(0), [a, s] = y(0), [i, c] = y(!1), [w, f] = y(!1);
|
|
20
|
-
return v(() => {
|
|
21
|
-
if (!q()) {
|
|
22
|
-
c(!1);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
c(!0), f(B());
|
|
26
|
-
}, []), v(() => {
|
|
27
|
-
if (!i || !B())
|
|
28
|
-
return;
|
|
29
|
-
const d = navigator.virtualKeyboard, l = () => {
|
|
30
|
-
const { boundingRect: m } = d, b = m?.height || 0, x = m?.width || 0;
|
|
31
|
-
t(b > 0), n(b), s(x);
|
|
32
|
-
};
|
|
33
|
-
return l(), d.addEventListener("geometrychange", l), () => {
|
|
34
|
-
d.removeEventListener(
|
|
35
|
-
"geometrychange",
|
|
36
|
-
l
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
}, [i]), v(() => {
|
|
40
|
-
if (!i || B())
|
|
41
|
-
return;
|
|
42
|
-
const d = window.innerHeight;
|
|
43
|
-
let l;
|
|
44
|
-
const m = () => {
|
|
45
|
-
clearTimeout(l), l = setTimeout(() => {
|
|
46
|
-
const b = window.visualViewport?.height ?? window.innerHeight, x = d - b, C = x > 150;
|
|
47
|
-
t(C), n(C ? x : 0), s(C ? window.innerWidth : 0);
|
|
48
|
-
}, 100);
|
|
49
|
-
};
|
|
50
|
-
return "visualViewport" in window && window.visualViewport ? (window.visualViewport.addEventListener("resize", m), () => {
|
|
51
|
-
clearTimeout(l), window.visualViewport?.removeEventListener(
|
|
52
|
-
"resize",
|
|
53
|
-
m
|
|
54
|
-
);
|
|
55
|
-
}) : (window.addEventListener("resize", m), () => {
|
|
56
|
-
clearTimeout(l), window.removeEventListener("resize", m);
|
|
57
|
-
});
|
|
58
|
-
}, [i]), v(() => {
|
|
59
|
-
i || (t(!1), n(0), s(0));
|
|
60
|
-
}, [i]), {
|
|
61
|
-
isOpen: e,
|
|
62
|
-
height: o,
|
|
63
|
-
width: a,
|
|
64
|
-
isSupported: i,
|
|
65
|
-
usingNativeAPI: w
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
const M = V(null);
|
|
69
|
-
function j() {
|
|
70
|
-
const e = T(M);
|
|
71
|
-
if (!e)
|
|
72
|
-
throw new Error(
|
|
73
|
-
"Drawer components must be used within a DrawerRoot component"
|
|
74
|
-
);
|
|
75
|
-
return e;
|
|
76
|
-
}
|
|
77
|
-
const Q = h(
|
|
78
|
-
"fixed inset-0 z-50 transition-opacity duration-300 bg-foreground/30 backdrop-blur-md",
|
|
79
|
-
{
|
|
80
|
-
variants: {
|
|
81
|
-
state: {
|
|
82
|
-
open: "opacity-100",
|
|
83
|
-
closed: "opacity-0 pointer-events-none"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
defaultVariants: {
|
|
87
|
-
state: "closed"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
), Y = h(
|
|
91
|
-
"fixed z-50 shadow-xl flex flex-col max-w-full bg-white",
|
|
92
|
-
{
|
|
93
|
-
variants: {
|
|
94
|
-
position: {
|
|
95
|
-
left: "left-0 top-0 bottom-0 border-r border-border",
|
|
96
|
-
right: "right-0 top-0 bottom-0 border-l border-border"
|
|
97
|
-
},
|
|
98
|
-
size: {
|
|
99
|
-
sm: "w-80",
|
|
100
|
-
md: "w-96",
|
|
101
|
-
lg: "w-[28rem]",
|
|
102
|
-
xl: "w-[32rem]",
|
|
103
|
-
"3/4": "w-[75vw]",
|
|
104
|
-
full: "w-full"
|
|
105
|
-
},
|
|
106
|
-
transitionType: {
|
|
107
|
-
slide: "transition-transform duration-300 ease-in-out",
|
|
108
|
-
fade: "transition-opacity duration-300 ease-in-out"
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
defaultVariants: {
|
|
112
|
-
position: "right",
|
|
113
|
-
size: "md",
|
|
114
|
-
transitionType: "slide"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
), Z = h(
|
|
118
|
-
"flex justify-between items-center px-6 bg-white",
|
|
119
|
-
{
|
|
120
|
-
variants: {
|
|
121
|
-
tab: {
|
|
122
|
-
true: "pt-4 pb-2",
|
|
123
|
-
false: "border-b border-border py-4"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
defaultVariants: {
|
|
127
|
-
tab: !1
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
), ee = h(
|
|
131
|
-
"flex-1 overflow-y-auto px-6 py-4 bg-white"
|
|
132
|
-
), te = h(
|
|
133
|
-
"px-6 py-4 border-t border-border bg-white"
|
|
134
|
-
), P = g.forwardRef(({ className: e, ...t }, o) => {
|
|
135
|
-
const { isOpen: n, disableOverlayClickToClose: a, onClose: s } = j(), i = () => {
|
|
136
|
-
a || s();
|
|
137
|
-
};
|
|
138
|
-
return /* @__PURE__ */ r.jsx(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
ref: o,
|
|
142
|
-
onClick: i,
|
|
143
|
-
"aria-hidden": "true",
|
|
144
|
-
className: u(
|
|
145
|
-
Q({
|
|
146
|
-
state: n ? "open" : "closed"
|
|
147
|
-
}),
|
|
148
|
-
e
|
|
149
|
-
),
|
|
150
|
-
...t
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
});
|
|
154
|
-
P.displayName = "DrawerOverlay";
|
|
155
|
-
const z = g.forwardRef(
|
|
156
|
-
({ children: e, className: t, hasTab: o, ...n }, a) => /* @__PURE__ */ r.jsx(
|
|
157
|
-
"header",
|
|
158
|
-
{
|
|
159
|
-
ref: a,
|
|
160
|
-
className: u(
|
|
161
|
-
Z({ tab: !!o }),
|
|
162
|
-
t
|
|
163
|
-
),
|
|
164
|
-
...n,
|
|
165
|
-
children: e
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
);
|
|
169
|
-
z.displayName = "DrawerHeader";
|
|
170
|
-
const E = p((e, t) => {
|
|
171
|
-
const { titleId: o } = j();
|
|
172
|
-
return /* @__PURE__ */ r.jsx(D, { ...e, ref: t, as: "h3", fontSize: "lg", id: o });
|
|
173
|
-
});
|
|
174
|
-
E.displayName = "DrawerTitle";
|
|
175
|
-
const F = p(({ onClick: e, ...t }, o) => {
|
|
176
|
-
const { onClose: n } = j(), a = (s) => {
|
|
177
|
-
n(), e?.(s);
|
|
178
|
-
};
|
|
179
|
-
return /* @__PURE__ */ r.jsx(
|
|
180
|
-
H,
|
|
181
|
-
{
|
|
182
|
-
"aria-label": "Close drawer",
|
|
183
|
-
...t,
|
|
184
|
-
onClick: a,
|
|
185
|
-
variant: "ghost",
|
|
186
|
-
size: "sm",
|
|
187
|
-
as: R,
|
|
188
|
-
ref: o
|
|
189
|
-
}
|
|
190
|
-
);
|
|
191
|
-
});
|
|
192
|
-
F.displayName = "DrawerCloseButton";
|
|
193
|
-
const O = p(
|
|
194
|
-
({ children: e, className: t, ...o }, n) => /* @__PURE__ */ r.jsx(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
ref: n,
|
|
198
|
-
className: u("[&>nav>div>ul]:px-6", t),
|
|
199
|
-
...o,
|
|
200
|
-
children: e
|
|
201
|
-
}
|
|
202
|
-
)
|
|
203
|
-
);
|
|
204
|
-
O.displayName = "DrawerTab";
|
|
205
|
-
const L = g.forwardRef(
|
|
206
|
-
({ children: e, className: t, ...o }, n) => {
|
|
207
|
-
const { descriptionId: a } = j();
|
|
208
|
-
return /* @__PURE__ */ r.jsx(
|
|
209
|
-
"main",
|
|
210
|
-
{
|
|
211
|
-
ref: n,
|
|
212
|
-
id: a,
|
|
213
|
-
className: u(ee(), t),
|
|
214
|
-
...o,
|
|
215
|
-
children: e
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
L.displayName = "DrawerBody";
|
|
221
|
-
const A = g.forwardRef(
|
|
222
|
-
({ children: e, className: t, ...o }, n) => /* @__PURE__ */ r.jsx(
|
|
223
|
-
"footer",
|
|
224
|
-
{
|
|
225
|
-
ref: n,
|
|
226
|
-
className: u(te(), t),
|
|
227
|
-
...o,
|
|
228
|
-
children: e
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
);
|
|
232
|
-
A.displayName = "DrawerFooter";
|
|
233
|
-
function N(e, t, o) {
|
|
234
|
-
const n = S(null);
|
|
235
|
-
return v(() => {
|
|
236
|
-
n.current && n.current.focus();
|
|
237
|
-
}, []), v(() => {
|
|
238
|
-
const a = (s) => {
|
|
239
|
-
s.key === "Escape" && e && n.current && n.current.contains(document.activeElement) && !o && t();
|
|
240
|
-
};
|
|
241
|
-
return e && (document.addEventListener("keydown", a), document.body.style.overflow = "hidden"), () => {
|
|
242
|
-
document.removeEventListener("keydown", a), document.body.style.overflow = "unset";
|
|
243
|
-
};
|
|
244
|
-
}, [e, t, o, n]), n;
|
|
245
|
-
}
|
|
246
|
-
const I = ({
|
|
247
|
-
container: e,
|
|
248
|
-
children: t
|
|
249
|
-
}) => {
|
|
250
|
-
if (typeof window > "u" || typeof document > "u")
|
|
251
|
-
return /* @__PURE__ */ r.jsx(r.Fragment, { children: t });
|
|
252
|
-
const o = e ?? document.body;
|
|
253
|
-
return o ? X.createPortal(t, o) : /* @__PURE__ */ r.jsx(r.Fragment, { children: t });
|
|
254
|
-
}, oe = ({
|
|
255
|
-
container: e,
|
|
256
|
-
children: t,
|
|
257
|
-
isOpen: o,
|
|
258
|
-
onClose: n,
|
|
259
|
-
position: a = "right",
|
|
260
|
-
size: s = "md",
|
|
261
|
-
transitionType: i = "slide",
|
|
262
|
-
disableOverlayClickToClose: c = !1,
|
|
263
|
-
disableEscapeKeyDown: w = !1,
|
|
264
|
-
className: f,
|
|
265
|
-
...d
|
|
266
|
-
}) => {
|
|
267
|
-
const l = k(), m = k(), b = {
|
|
268
|
-
isOpen: o,
|
|
269
|
-
onClose: n,
|
|
270
|
-
position: a,
|
|
271
|
-
size: s,
|
|
272
|
-
transitionType: i,
|
|
273
|
-
disableOverlayClickToClose: c,
|
|
274
|
-
disableEscapeKeyDown: w,
|
|
275
|
-
titleId: l,
|
|
276
|
-
descriptionId: m
|
|
277
|
-
}, x = N(o, n, w);
|
|
278
|
-
return /* @__PURE__ */ r.jsx(I, { container: e, children: /* @__PURE__ */ r.jsx(M.Provider, { value: b, children: /* @__PURE__ */ r.jsxs(
|
|
279
|
-
"div",
|
|
280
|
-
{
|
|
281
|
-
className: u(
|
|
282
|
-
"fixed z-50 inset-0 pointer-events-none",
|
|
283
|
-
o && "pointer-events-auto"
|
|
284
|
-
),
|
|
285
|
-
children: [
|
|
286
|
-
/* @__PURE__ */ r.jsx(P, {}),
|
|
287
|
-
/* @__PURE__ */ r.jsx(
|
|
288
|
-
"div",
|
|
289
|
-
{
|
|
290
|
-
ref: x,
|
|
291
|
-
role: "dialog",
|
|
292
|
-
tabIndex: -1,
|
|
293
|
-
"aria-modal": "true",
|
|
294
|
-
"aria-labelledby": l,
|
|
295
|
-
"aria-describedby": m,
|
|
296
|
-
"aria-hidden": !o,
|
|
297
|
-
className: u(
|
|
298
|
-
Y({
|
|
299
|
-
position: a,
|
|
300
|
-
size: s,
|
|
301
|
-
transitionType: i
|
|
302
|
-
}),
|
|
303
|
-
i === "slide" ? [
|
|
304
|
-
!o && a === "left" && "-translate-x-full",
|
|
305
|
-
!o && a === "right" && "translate-x-full"
|
|
306
|
-
] : [
|
|
307
|
-
"left-0 right-0 top-0 bottom-0",
|
|
308
|
-
o ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
309
|
-
],
|
|
310
|
-
f
|
|
311
|
-
),
|
|
312
|
-
...d,
|
|
313
|
-
children: o && t
|
|
314
|
-
}
|
|
315
|
-
)
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
) }) });
|
|
319
|
-
}, Me = Object.assign(oe, {
|
|
320
|
-
Header: z,
|
|
321
|
-
Title: E,
|
|
322
|
-
CloseButton: F,
|
|
323
|
-
Tab: O,
|
|
324
|
-
Body: L,
|
|
325
|
-
Footer: A
|
|
326
|
-
}), W = V(null);
|
|
327
|
-
function ne() {
|
|
328
|
-
const e = T(W);
|
|
329
|
-
if (!e)
|
|
330
|
-
throw new Error(
|
|
331
|
-
"Modal components must be used within a ModalRoot component"
|
|
332
|
-
);
|
|
333
|
-
return e;
|
|
334
|
-
}
|
|
335
|
-
const re = h(
|
|
336
|
-
"fixed inset-0 z-60 transition-opacity duration-300 bg-foreground/30 backdrop-blur-md flex items-center justify-center transition-opacity duration-200 ease-in-out",
|
|
337
|
-
{
|
|
338
|
-
variants: {
|
|
339
|
-
placement: {
|
|
340
|
-
top: "items-start",
|
|
341
|
-
center: "items-center"
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
defaultVariants: {
|
|
345
|
-
placement: "center"
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
), ae = h(
|
|
349
|
-
[
|
|
350
|
-
"absolute z-61 bg-white rounded-lg shadow-xl",
|
|
351
|
-
"flex flex-col",
|
|
352
|
-
"outline-none",
|
|
353
|
-
"transition-all duration-200 ease-in-out"
|
|
354
|
-
],
|
|
355
|
-
{
|
|
356
|
-
variants: {
|
|
357
|
-
size: {
|
|
358
|
-
sm: "w-[20rem] max-w-[90%]",
|
|
359
|
-
// 20rem, 320px
|
|
360
|
-
md: "w-[28rem] max-w-[90%]",
|
|
361
|
-
// 28rem, 448px
|
|
362
|
-
lg: "w-[36rem] max-w-[90%]",
|
|
363
|
-
// 36rem, 576px
|
|
364
|
-
"fit-content": "w-fit max-w-[90%]"
|
|
365
|
-
// Fit content, no max width
|
|
366
|
-
},
|
|
367
|
-
placement: {
|
|
368
|
-
top: "top-8 left-1/2 -translate-x-1/2",
|
|
369
|
-
center: "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
370
|
-
},
|
|
371
|
-
isOpen: {
|
|
372
|
-
true: "opacity-100 scale-100",
|
|
373
|
-
false: "opacity-0 scale-95 pointer-events-none"
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
defaultVariants: {
|
|
377
|
-
size: "md",
|
|
378
|
-
placement: "center",
|
|
379
|
-
isOpen: !1
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
), se = p(
|
|
383
|
-
({ className: e, ...t }, o) => /* @__PURE__ */ r.jsx(
|
|
384
|
-
"div",
|
|
385
|
-
{
|
|
386
|
-
ref: o,
|
|
387
|
-
className: u("px-6 pt-6 pb-2 text-lg font-semibold", e),
|
|
388
|
-
...t
|
|
389
|
-
}
|
|
390
|
-
)
|
|
391
|
-
), ie = p(
|
|
392
|
-
({ className: e, ...t }, o) => /* @__PURE__ */ r.jsx(
|
|
393
|
-
"div",
|
|
394
|
-
{
|
|
395
|
-
ref: o,
|
|
396
|
-
className: u("px-6 py-4 flex justify-end gap-2", e),
|
|
397
|
-
...t
|
|
398
|
-
}
|
|
399
|
-
)
|
|
400
|
-
), le = p(
|
|
401
|
-
({ className: e, ...t }, o) => /* @__PURE__ */ r.jsx("div", { ref: o, className: u("px-6 py-2", e), ...t })
|
|
402
|
-
), de = p(
|
|
403
|
-
(e, t) => {
|
|
404
|
-
const { isOpen: o, placement: n, onClose: a, disableOverlayClickToClose: s } = ne(), i = () => {
|
|
405
|
-
s || a();
|
|
406
|
-
};
|
|
407
|
-
return /* @__PURE__ */ r.jsx(
|
|
408
|
-
"div",
|
|
409
|
-
{
|
|
410
|
-
ref: t,
|
|
411
|
-
role: "presentation",
|
|
412
|
-
tabIndex: -1,
|
|
413
|
-
"aria-modal": "true",
|
|
414
|
-
onClick: i,
|
|
415
|
-
className: u(
|
|
416
|
-
re({ placement: n }),
|
|
417
|
-
o ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
418
|
-
),
|
|
419
|
-
...e
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
}
|
|
423
|
-
), ce = ({
|
|
424
|
-
isOpen: e,
|
|
425
|
-
onClose: t,
|
|
426
|
-
size: o = "md",
|
|
427
|
-
placement: n = "center",
|
|
428
|
-
disableOverlayClickToClose: a = !1,
|
|
429
|
-
disableEscapeKeyDown: s = !1,
|
|
430
|
-
children: i,
|
|
431
|
-
container: c,
|
|
432
|
-
...w
|
|
433
|
-
}) => {
|
|
434
|
-
const f = {
|
|
435
|
-
isOpen: e,
|
|
436
|
-
onClose: t,
|
|
437
|
-
size: o,
|
|
438
|
-
placement: n,
|
|
439
|
-
disableOverlayClickToClose: a,
|
|
440
|
-
disableEscapeKeyDown: s
|
|
441
|
-
}, d = N(e, t, s);
|
|
442
|
-
return /* @__PURE__ */ r.jsx(I, { container: c, children: /* @__PURE__ */ r.jsx(W.Provider, { value: f, children: /* @__PURE__ */ r.jsxs(
|
|
443
|
-
"div",
|
|
444
|
-
{
|
|
445
|
-
className: u(
|
|
446
|
-
"fixed z-50 inset-0 pointer-events-none",
|
|
447
|
-
e && "pointer-events-auto"
|
|
448
|
-
),
|
|
449
|
-
children: [
|
|
450
|
-
/* @__PURE__ */ r.jsx(de, {}),
|
|
451
|
-
/* @__PURE__ */ r.jsx(
|
|
452
|
-
"div",
|
|
453
|
-
{
|
|
454
|
-
ref: d,
|
|
455
|
-
className: u(ae({ size: o, placement: n, isOpen: e })),
|
|
456
|
-
role: "dialog",
|
|
457
|
-
tabIndex: -1,
|
|
458
|
-
"aria-hidden": !e,
|
|
459
|
-
...w,
|
|
460
|
-
children: i
|
|
461
|
-
}
|
|
462
|
-
)
|
|
463
|
-
]
|
|
464
|
-
}
|
|
465
|
-
) }) });
|
|
466
|
-
}, Pe = Object.assign(ce, {
|
|
467
|
-
Header: se,
|
|
468
|
-
Body: le,
|
|
469
|
-
Footer: ie
|
|
470
|
-
}), ue = h(
|
|
471
|
-
[
|
|
472
|
-
"fixed left-0 bottom-0 z-40 w-full max-h-[90dvh] bg-background rounded-t-xl shadow-lg border-t border-border rounded-lg",
|
|
473
|
-
"transition-transform duration-300 ease-in-out will-change-transform",
|
|
474
|
-
"overflow-hidden"
|
|
475
|
-
// Ensure content doesn't overflow when keyboard adjusts height
|
|
476
|
-
],
|
|
477
|
-
{
|
|
478
|
-
variants: {
|
|
479
|
-
open: {
|
|
480
|
-
true: "translate-y-0",
|
|
481
|
-
false: "translate-y-full"
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
defaultVariants: {
|
|
485
|
-
open: !1
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
), fe = h(
|
|
489
|
-
["fixed inset-0 z-40 duration-300"],
|
|
490
|
-
{
|
|
491
|
-
variants: {
|
|
492
|
-
open: {
|
|
493
|
-
true: "backdrop-blur-md bg-foreground/30",
|
|
494
|
-
false: "pointer-events-none"
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
defaultVariants: {
|
|
498
|
-
open: !1
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
), me = h(
|
|
502
|
-
"p-4 pb-2 flex justify-between w-full"
|
|
503
|
-
), pe = h([
|
|
504
|
-
"p-4 py-2 flex-1 overflow-y-auto",
|
|
505
|
-
"scrollbar-thin scrollbar-track-transparent scrollbar-thumb-border"
|
|
506
|
-
]), he = h("p-4 pt-2 flex-shrink-0"), K = V(null), we = K.Provider, be = () => {
|
|
507
|
-
const e = T(K);
|
|
508
|
-
if (!e)
|
|
509
|
-
throw new Error("useBottomSheet must be used within a BottomSheetProvider");
|
|
510
|
-
return e;
|
|
511
|
-
}, xe = p(function(t, o) {
|
|
512
|
-
return /* @__PURE__ */ r.jsx(G, { level: 3, ref: o, ...t });
|
|
513
|
-
}), ve = p(function(t, o) {
|
|
514
|
-
const { onClose: n } = be(), a = (s) => {
|
|
515
|
-
n(), t?.onClick?.(s);
|
|
516
|
-
};
|
|
517
|
-
return /* @__PURE__ */ r.jsx(
|
|
518
|
-
H,
|
|
519
|
-
{
|
|
520
|
-
ref: o,
|
|
521
|
-
variant: "ghost",
|
|
522
|
-
"aria-label": "Close",
|
|
523
|
-
as: R,
|
|
524
|
-
...t,
|
|
525
|
-
onClick: a
|
|
526
|
-
}
|
|
527
|
-
);
|
|
528
|
-
}), ye = p(({ className: e, ...t }, o) => /* @__PURE__ */ r.jsx(
|
|
529
|
-
"div",
|
|
530
|
-
{
|
|
531
|
-
ref: o,
|
|
532
|
-
className: me({ className: e }),
|
|
533
|
-
...t
|
|
534
|
-
}
|
|
535
|
-
)), ge = p(
|
|
536
|
-
({ className: e, ...t }, o) => /* @__PURE__ */ r.jsx(
|
|
537
|
-
"div",
|
|
538
|
-
{
|
|
539
|
-
ref: o,
|
|
540
|
-
className: pe({ className: e }),
|
|
541
|
-
...t
|
|
542
|
-
}
|
|
543
|
-
)
|
|
544
|
-
), je = p(({ className: e, ...t }, o) => /* @__PURE__ */ r.jsx(
|
|
545
|
-
"div",
|
|
546
|
-
{
|
|
547
|
-
ref: o,
|
|
548
|
-
className: he({ className: e }),
|
|
549
|
-
...t
|
|
550
|
-
}
|
|
551
|
-
)), Ce = p(
|
|
552
|
-
({
|
|
553
|
-
isOpen: e,
|
|
554
|
-
children: t,
|
|
555
|
-
className: o,
|
|
556
|
-
onClose: n,
|
|
557
|
-
container: a,
|
|
558
|
-
disableOverlayClickToClose: s = !1,
|
|
559
|
-
...i
|
|
560
|
-
}, c) => {
|
|
561
|
-
const w = N(e, n), {
|
|
562
|
-
isOpen: f,
|
|
563
|
-
height: d,
|
|
564
|
-
isSupported: l
|
|
565
|
-
} = J(), m = _(() => !e || !l || !f ? {} : {
|
|
566
|
-
// Adjust bottom position to sit above the virtual keyboard
|
|
567
|
-
bottom: `${d}px`,
|
|
568
|
-
// Reduce max height to account for keyboard
|
|
569
|
-
maxHeight: `calc(90dvh - ${d}px)`,
|
|
570
|
-
// Ensure smooth transition
|
|
571
|
-
transition: "bottom 0.2s ease-in-out, max-height 0.2s ease-in-out"
|
|
572
|
-
}, [e, l, f, d]), b = () => {
|
|
573
|
-
s || n?.();
|
|
574
|
-
};
|
|
575
|
-
return /* @__PURE__ */ r.jsx(I, { container: a, children: /* @__PURE__ */ r.jsxs(we, { value: { onClose: n }, children: [
|
|
576
|
-
/* @__PURE__ */ r.jsx(
|
|
577
|
-
"div",
|
|
578
|
-
{
|
|
579
|
-
className: fe({ open: e }),
|
|
580
|
-
"aria-hidden": "true",
|
|
581
|
-
onClick: b
|
|
582
|
-
}
|
|
583
|
-
),
|
|
584
|
-
/* @__PURE__ */ r.jsx(
|
|
585
|
-
"div",
|
|
586
|
-
{
|
|
587
|
-
ref: U(c, w),
|
|
588
|
-
className: u(
|
|
589
|
-
ue({
|
|
590
|
-
open: e
|
|
591
|
-
}),
|
|
592
|
-
"flex flex-col",
|
|
593
|
-
// Add flex layout for proper header/body/footer arrangement
|
|
594
|
-
o
|
|
595
|
-
),
|
|
596
|
-
style: m,
|
|
597
|
-
role: "dialog",
|
|
598
|
-
"aria-modal": "true",
|
|
599
|
-
tabIndex: -1,
|
|
600
|
-
...i,
|
|
601
|
-
children: t
|
|
602
|
-
}
|
|
603
|
-
)
|
|
604
|
-
] }) });
|
|
605
|
-
}
|
|
606
|
-
), ze = Object.assign(Ce, {
|
|
607
|
-
Header: ye,
|
|
608
|
-
Title: xe,
|
|
609
|
-
CloseIcon: ve,
|
|
610
|
-
Body: ge,
|
|
611
|
-
Footer: je
|
|
612
|
-
});
|
|
613
|
-
function Be(e = "auto") {
|
|
614
|
-
const t = S(null), [o, n] = y("bottom");
|
|
615
|
-
return v(() => {
|
|
616
|
-
if (!open || e !== "auto" || !t.current) {
|
|
617
|
-
n(e === "auto" ? "bottom" : e);
|
|
618
|
-
return;
|
|
619
|
-
}
|
|
620
|
-
const a = t.current.getBoundingClientRect(), s = window.innerWidth, i = window.innerHeight, c = {
|
|
621
|
-
top: a.top,
|
|
622
|
-
bottom: i - a.bottom,
|
|
623
|
-
left: a.left,
|
|
624
|
-
right: s - a.right
|
|
625
|
-
};
|
|
626
|
-
c.bottom > 64 ? n("bottom") : c.top > 64 ? n("top") : c.right > 128 ? n("right") : n("left");
|
|
627
|
-
}, [e, t]), { position: o, ref: t };
|
|
628
|
-
}
|
|
629
|
-
const ke = h(
|
|
630
|
-
"absolute z-50 px-2 py-1 rounded bg-neutral pointer-events-auto transition-opacity duration-150 min-w-[max-content] max-w-sm whitespace-pre-line",
|
|
631
|
-
{
|
|
632
|
-
variants: {
|
|
633
|
-
position: {
|
|
634
|
-
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
635
|
-
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
636
|
-
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
637
|
-
right: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
638
|
-
auto: "top-full left-1/2 -translate-x-1/2 mt-2"
|
|
639
|
-
}
|
|
640
|
-
},
|
|
641
|
-
defaultVariants: {
|
|
642
|
-
position: "auto"
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
), Ee = ({
|
|
646
|
-
children: e,
|
|
647
|
-
content: t,
|
|
648
|
-
position: o = "auto",
|
|
649
|
-
popoverClassName: n,
|
|
650
|
-
delay: a,
|
|
651
|
-
...s
|
|
652
|
-
}) => {
|
|
653
|
-
const i = k(), [c, w] = y(!1), f = S(null), d = () => {
|
|
654
|
-
a ? f.current = setTimeout(() => w(!0), a) : w(!0);
|
|
655
|
-
}, l = () => {
|
|
656
|
-
f.current && clearTimeout(f.current), w(!1);
|
|
657
|
-
};
|
|
658
|
-
v(() => () => {
|
|
659
|
-
f.current && clearTimeout(f.current);
|
|
660
|
-
}, []);
|
|
661
|
-
const m = {
|
|
662
|
-
tabIndex: 0,
|
|
663
|
-
"aria-describedby": i,
|
|
664
|
-
onMouseEnter: d,
|
|
665
|
-
onFocus: d,
|
|
666
|
-
onMouseLeave: l,
|
|
667
|
-
onBlur: l,
|
|
668
|
-
...s
|
|
669
|
-
}, { ref: b, position: x } = Be(o);
|
|
670
|
-
return /* @__PURE__ */ r.jsxs("div", { className: "relative w-fit", ref: b, children: [
|
|
671
|
-
$(e, m),
|
|
672
|
-
/* @__PURE__ */ r.jsx(
|
|
673
|
-
"div",
|
|
674
|
-
{
|
|
675
|
-
id: i,
|
|
676
|
-
className: u(
|
|
677
|
-
ke({ position: x }),
|
|
678
|
-
n,
|
|
679
|
-
!c && "opacity-0 pointer-events-none"
|
|
680
|
-
),
|
|
681
|
-
role: "tooltip",
|
|
682
|
-
"aria-hidden": !c,
|
|
683
|
-
children: /* @__PURE__ */ r.jsx(D, { as: "p", fontSize: "xs", fontWeight: "normal", color: "black", children: t })
|
|
684
|
-
}
|
|
685
|
-
)
|
|
686
|
-
] });
|
|
687
|
-
};
|
|
688
|
-
export {
|
|
689
|
-
ze as B,
|
|
690
|
-
Me as D,
|
|
691
|
-
Pe as M,
|
|
692
|
-
Ee as T
|
|
693
|
-
};
|