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