@dimasbaguspm/versaur 0.0.32 → 0.0.33
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/{bottom-sheet-DJgcgmgw.js → bottom-sheet-B3Rt2JC5.js} +160 -146
- package/dist/js/{bottom-sheet-input-lRqhqp7I.js → bottom-sheet-input-DRcyjeGh.js} +2 -2
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-BS6j3xEC.js → image-rectangle-oPc5hFMM.js} +153 -83
- package/dist/js/index.js +6 -6
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +3 -3
- package/dist/js/primitive/index.js +1 -1
- package/dist/js/{tabs-80jJFJ7W.js → tabs-CKLbsCWq.js} +1 -1
- package/dist/js/{tooltip-J7r2xoUk.js → tooltip-DNKTNCQm.js} +1 -1
- package/dist/js/{top-bar-DJNgsR7X.js → top-bar-Bg-zMaFY.js} +1 -1
- package/dist/types/overlays/menu/types.d.ts +5 -0
- package/dist/types/overlays/menu/use-menu.d.ts +15 -0
- package/dist/types/primitive/button-menu-icon/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { c as u, j as
|
|
2
|
-
import j, { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { c as u, j as n, a as l } from "./index-DOdDlCoL.js";
|
|
2
|
+
import j, { useState as v, useEffect as x, createContext as S, useContext as T, forwardRef as f, useRef as M, useMemo as z } from "react";
|
|
3
|
+
import { XIcon as E } from "lucide-react";
|
|
4
|
+
import { k as H, i as D } from "./image-rectangle-oPc5hFMM.js";
|
|
5
5
|
import "./snackbar-DH8jCh2V.js";
|
|
6
6
|
import I from "react-dom";
|
|
7
7
|
function P() {
|
|
8
8
|
if (typeof window > "u") return !1;
|
|
9
9
|
const e = window.navigator.userAgent, o = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
10
10
|
e
|
|
11
|
-
), t = /iPad|Android(?=.*Mobile)|Tablet/i.test(e),
|
|
12
|
-
return o || t ||
|
|
11
|
+
), t = /iPad|Android(?=.*Mobile)|Tablet/i.test(e), r = "ontouchstart" in window || navigator.maxTouchPoints > 0, a = window.innerWidth <= 1024;
|
|
12
|
+
return o || t || r && a;
|
|
13
13
|
}
|
|
14
14
|
function k() {
|
|
15
15
|
return typeof window < "u" && "navigator" in window && "virtualKeyboard" in navigator;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const [e, o] =
|
|
19
|
-
return
|
|
17
|
+
function F() {
|
|
18
|
+
const [e, o] = v(!1), [t, r] = v(0), [a, s] = v(0), [i, w] = v(!1), [b, h] = v(!1);
|
|
19
|
+
return x(() => {
|
|
20
20
|
if (!P()) {
|
|
21
21
|
w(!1);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
w(!0),
|
|
25
|
-
}, []),
|
|
24
|
+
w(!0), h(k());
|
|
25
|
+
}, []), x(() => {
|
|
26
26
|
if (!i || !k())
|
|
27
27
|
return;
|
|
28
28
|
const d = navigator.virtualKeyboard, c = () => {
|
|
29
|
-
const { boundingRect: m } = d,
|
|
30
|
-
o(
|
|
29
|
+
const { boundingRect: m } = d, p = m?.height || 0, y = m?.width || 0;
|
|
30
|
+
o(p > 0), r(p), s(y);
|
|
31
31
|
};
|
|
32
32
|
return c(), d.addEventListener("geometrychange", c), () => {
|
|
33
33
|
d.removeEventListener(
|
|
@@ -35,15 +35,15 @@ function E() {
|
|
|
35
35
|
c
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
|
-
}, [i]),
|
|
38
|
+
}, [i]), x(() => {
|
|
39
39
|
if (!i || k())
|
|
40
40
|
return;
|
|
41
41
|
const d = window.innerHeight;
|
|
42
42
|
let c;
|
|
43
43
|
const m = () => {
|
|
44
44
|
clearTimeout(c), c = setTimeout(() => {
|
|
45
|
-
const
|
|
46
|
-
o(V),
|
|
45
|
+
const p = window.visualViewport?.height ?? window.innerHeight, y = d - p, V = y > 150;
|
|
46
|
+
o(V), r(V ? y : 0), s(V ? window.innerWidth : 0);
|
|
47
47
|
}, 100);
|
|
48
48
|
};
|
|
49
49
|
return "visualViewport" in window && window.visualViewport ? (window.visualViewport.addEventListener("resize", m), () => {
|
|
@@ -54,18 +54,18 @@ function E() {
|
|
|
54
54
|
}) : (window.addEventListener("resize", m), () => {
|
|
55
55
|
clearTimeout(c), window.removeEventListener("resize", m);
|
|
56
56
|
});
|
|
57
|
-
}, [i]),
|
|
58
|
-
i || (o(!1),
|
|
57
|
+
}, [i]), x(() => {
|
|
58
|
+
i || (o(!1), r(0), s(0));
|
|
59
59
|
}, [i]), {
|
|
60
60
|
isOpen: e,
|
|
61
61
|
height: t,
|
|
62
|
-
width:
|
|
62
|
+
width: a,
|
|
63
63
|
isSupported: i,
|
|
64
64
|
usingNativeAPI: b
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
const N = S(null);
|
|
68
|
-
function
|
|
68
|
+
function L() {
|
|
69
69
|
const e = T(N);
|
|
70
70
|
if (!e)
|
|
71
71
|
throw new Error(
|
|
@@ -73,7 +73,7 @@ function F() {
|
|
|
73
73
|
);
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const A = u(
|
|
77
77
|
"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",
|
|
78
78
|
{
|
|
79
79
|
variants: {
|
|
@@ -86,7 +86,7 @@ const O = u(
|
|
|
86
86
|
placement: "center"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
),
|
|
89
|
+
), O = u(
|
|
90
90
|
[
|
|
91
91
|
"absolute z-61 bg-white rounded-lg shadow-xl",
|
|
92
92
|
"flex flex-col",
|
|
@@ -120,8 +120,8 @@ const O = u(
|
|
|
120
120
|
isOpen: !1
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
),
|
|
124
|
-
({ className: e, ...o }, t) => /* @__PURE__ */
|
|
123
|
+
), W = f(
|
|
124
|
+
({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
|
|
125
125
|
"div",
|
|
126
126
|
{
|
|
127
127
|
ref: t,
|
|
@@ -129,8 +129,8 @@ const O = u(
|
|
|
129
129
|
...o
|
|
130
130
|
}
|
|
131
131
|
)
|
|
132
|
-
),
|
|
133
|
-
({ className: e, ...o }, t) => /* @__PURE__ */
|
|
132
|
+
), K = f(
|
|
133
|
+
({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
136
|
ref: t,
|
|
@@ -138,14 +138,14 @@ const O = u(
|
|
|
138
138
|
...o
|
|
139
139
|
}
|
|
140
140
|
)
|
|
141
|
-
), K = f(
|
|
142
|
-
({ className: e, ...o }, t) => /* @__PURE__ */ r.jsx("div", { ref: t, className: l("px-6 py-2", e), ...o })
|
|
143
141
|
), _ = f(
|
|
142
|
+
({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx("div", { ref: t, className: l("px-6 py-2", e), ...o })
|
|
143
|
+
), $ = f(
|
|
144
144
|
(e, o) => {
|
|
145
|
-
const { isOpen: t, placement:
|
|
146
|
-
s ||
|
|
145
|
+
const { isOpen: t, placement: r, onClose: a, disableOverlayClickToClose: s } = L(), i = () => {
|
|
146
|
+
s || a();
|
|
147
147
|
};
|
|
148
|
-
return /* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ n.jsx(
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
151
|
ref: o,
|
|
@@ -154,41 +154,55 @@ const O = u(
|
|
|
154
154
|
"aria-modal": "true",
|
|
155
155
|
onClick: i,
|
|
156
156
|
className: l(
|
|
157
|
-
|
|
157
|
+
A({ placement: r }),
|
|
158
158
|
t ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
159
159
|
),
|
|
160
160
|
...e
|
|
161
161
|
}
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
|
-
)
|
|
164
|
+
);
|
|
165
|
+
function B(e, o, t) {
|
|
166
|
+
const r = M(null);
|
|
167
|
+
return x(() => {
|
|
168
|
+
r.current && r.current.focus();
|
|
169
|
+
}, []), x(() => {
|
|
170
|
+
const a = (s) => {
|
|
171
|
+
s.key === "Escape" && e && r.current && r.current.contains(document.activeElement) && !t && o();
|
|
172
|
+
};
|
|
173
|
+
return e && (document.addEventListener("keydown", a), document.body.style.overflow = "hidden"), () => {
|
|
174
|
+
document.removeEventListener("keydown", a), document.body.style.overflow = "unset";
|
|
175
|
+
};
|
|
176
|
+
}, [e, o, t, r]), r;
|
|
177
|
+
}
|
|
178
|
+
const C = ({
|
|
165
179
|
container: e,
|
|
166
180
|
children: o
|
|
167
181
|
}) => {
|
|
168
182
|
if (typeof window > "u" || typeof document > "u")
|
|
169
|
-
return /* @__PURE__ */
|
|
183
|
+
return /* @__PURE__ */ n.jsx(n.Fragment, { children: o });
|
|
170
184
|
const t = e ?? document.body;
|
|
171
|
-
return t ? I.createPortal(o, t) : /* @__PURE__ */
|
|
172
|
-
},
|
|
185
|
+
return t ? I.createPortal(o, t) : /* @__PURE__ */ n.jsx(n.Fragment, { children: o });
|
|
186
|
+
}, G = ({
|
|
173
187
|
isOpen: e,
|
|
174
188
|
onClose: o,
|
|
175
189
|
size: t = "md",
|
|
176
|
-
placement:
|
|
177
|
-
disableOverlayClickToClose:
|
|
190
|
+
placement: r = "center",
|
|
191
|
+
disableOverlayClickToClose: a = !1,
|
|
178
192
|
disableEscapeKeyDown: s = !1,
|
|
179
193
|
children: i,
|
|
180
194
|
container: w,
|
|
181
195
|
...b
|
|
182
196
|
}) => {
|
|
183
|
-
const
|
|
197
|
+
const h = {
|
|
184
198
|
isOpen: e,
|
|
185
199
|
onClose: o,
|
|
186
200
|
size: t,
|
|
187
|
-
placement:
|
|
188
|
-
disableOverlayClickToClose:
|
|
201
|
+
placement: r,
|
|
202
|
+
disableOverlayClickToClose: a,
|
|
189
203
|
disableEscapeKeyDown: s
|
|
190
|
-
}, d =
|
|
191
|
-
return /* @__PURE__ */
|
|
204
|
+
}, d = B(e, o, s);
|
|
205
|
+
return /* @__PURE__ */ n.jsx(C, { container: w, children: /* @__PURE__ */ n.jsx(N.Provider, { value: h, children: /* @__PURE__ */ n.jsxs(
|
|
192
206
|
"div",
|
|
193
207
|
{
|
|
194
208
|
className: l(
|
|
@@ -196,12 +210,12 @@ const O = u(
|
|
|
196
210
|
e && "pointer-events-auto"
|
|
197
211
|
),
|
|
198
212
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ n.jsx($, {}),
|
|
214
|
+
/* @__PURE__ */ n.jsx(
|
|
201
215
|
"div",
|
|
202
216
|
{
|
|
203
217
|
ref: d,
|
|
204
|
-
className: l(
|
|
218
|
+
className: l(O({ size: t, placement: r, isOpen: e })),
|
|
205
219
|
role: "dialog",
|
|
206
220
|
tabIndex: -1,
|
|
207
221
|
"aria-hidden": !e,
|
|
@@ -212,12 +226,12 @@ const O = u(
|
|
|
212
226
|
]
|
|
213
227
|
}
|
|
214
228
|
) }) });
|
|
215
|
-
},
|
|
216
|
-
Header:
|
|
217
|
-
Body:
|
|
218
|
-
Footer:
|
|
229
|
+
}, ke = Object.assign(G, {
|
|
230
|
+
Header: W,
|
|
231
|
+
Body: _,
|
|
232
|
+
Footer: K
|
|
219
233
|
}), R = S(null);
|
|
220
|
-
function
|
|
234
|
+
function g() {
|
|
221
235
|
const e = T(R);
|
|
222
236
|
if (!e)
|
|
223
237
|
throw new Error(
|
|
@@ -225,7 +239,7 @@ function v() {
|
|
|
225
239
|
);
|
|
226
240
|
return e;
|
|
227
241
|
}
|
|
228
|
-
const
|
|
242
|
+
const U = u(
|
|
229
243
|
"fixed inset-0 z-50 transition-opacity duration-300 bg-foreground/30 backdrop-blur-md",
|
|
230
244
|
{
|
|
231
245
|
variants: {
|
|
@@ -238,7 +252,7 @@ const G = u(
|
|
|
238
252
|
state: "closed"
|
|
239
253
|
}
|
|
240
254
|
}
|
|
241
|
-
),
|
|
255
|
+
), X = u(
|
|
242
256
|
"fixed z-50 shadow-xl flex flex-col max-w-full",
|
|
243
257
|
{
|
|
244
258
|
variants: {
|
|
@@ -270,7 +284,7 @@ const G = u(
|
|
|
270
284
|
transitionType: "slide"
|
|
271
285
|
}
|
|
272
286
|
}
|
|
273
|
-
),
|
|
287
|
+
), q = u(
|
|
274
288
|
"flex justify-between items-center px-6",
|
|
275
289
|
{
|
|
276
290
|
variants: {
|
|
@@ -288,7 +302,7 @@ const G = u(
|
|
|
288
302
|
tab: !1
|
|
289
303
|
}
|
|
290
304
|
}
|
|
291
|
-
),
|
|
305
|
+
), J = u("flex-1 overflow-y-auto px-6 py-4", {
|
|
292
306
|
variants: {
|
|
293
307
|
variant: {
|
|
294
308
|
default: "bg-white",
|
|
@@ -298,7 +312,7 @@ const G = u(
|
|
|
298
312
|
defaultVariants: {
|
|
299
313
|
variant: "default"
|
|
300
314
|
}
|
|
301
|
-
}),
|
|
315
|
+
}), Q = u("px-6 py-4 border-t", {
|
|
302
316
|
variants: {
|
|
303
317
|
variant: {
|
|
304
318
|
default: "bg-white border-border",
|
|
@@ -308,79 +322,79 @@ const G = u(
|
|
|
308
322
|
defaultVariants: {
|
|
309
323
|
variant: "default"
|
|
310
324
|
}
|
|
311
|
-
}),
|
|
312
|
-
const { isOpen:
|
|
313
|
-
|
|
325
|
+
}), Y = j.forwardRef(({ className: e, ...o }, t) => {
|
|
326
|
+
const { isOpen: r, disableOverlayClickToClose: a, onClose: s } = g(), i = () => {
|
|
327
|
+
a || s();
|
|
314
328
|
};
|
|
315
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ n.jsx(
|
|
316
330
|
"div",
|
|
317
331
|
{
|
|
318
332
|
ref: t,
|
|
319
333
|
onClick: i,
|
|
320
334
|
className: l(
|
|
321
|
-
|
|
322
|
-
state:
|
|
335
|
+
U({
|
|
336
|
+
state: r ? "open" : "closed"
|
|
323
337
|
}),
|
|
324
338
|
e
|
|
325
339
|
),
|
|
326
340
|
...o
|
|
327
341
|
}
|
|
328
342
|
);
|
|
329
|
-
}),
|
|
330
|
-
({ children: e, className: o, hasTab: t, ...
|
|
331
|
-
const { variant: s } =
|
|
332
|
-
return /* @__PURE__ */
|
|
343
|
+
}), Z = j.forwardRef(
|
|
344
|
+
({ children: e, className: o, hasTab: t, ...r }, a) => {
|
|
345
|
+
const { variant: s } = g();
|
|
346
|
+
return /* @__PURE__ */ n.jsx(
|
|
333
347
|
"div",
|
|
334
348
|
{
|
|
335
|
-
ref:
|
|
349
|
+
ref: a,
|
|
336
350
|
className: l(
|
|
337
|
-
|
|
351
|
+
q({ variant: s, tab: !!t }),
|
|
338
352
|
o
|
|
339
353
|
),
|
|
340
|
-
...
|
|
354
|
+
...r,
|
|
341
355
|
children: e
|
|
342
356
|
}
|
|
343
357
|
);
|
|
344
358
|
}
|
|
345
|
-
),
|
|
346
|
-
const { onClose:
|
|
347
|
-
|
|
359
|
+
), ee = f((e, o) => /* @__PURE__ */ n.jsx(H, { ...e, ref: o, as: "h3", fontSize: "lg" })), te = f(({ onClick: e, ...o }, t) => {
|
|
360
|
+
const { onClose: r } = g(), a = (s) => {
|
|
361
|
+
r(), e?.(s);
|
|
348
362
|
};
|
|
349
|
-
return /* @__PURE__ */
|
|
350
|
-
|
|
363
|
+
return /* @__PURE__ */ n.jsx(
|
|
364
|
+
D,
|
|
351
365
|
{
|
|
352
366
|
"aria-label": "Close drawer",
|
|
353
367
|
...o,
|
|
354
|
-
onClick:
|
|
368
|
+
onClick: a,
|
|
355
369
|
variant: "ghost",
|
|
356
370
|
size: "sm",
|
|
357
|
-
as:
|
|
371
|
+
as: E,
|
|
358
372
|
ref: t
|
|
359
373
|
}
|
|
360
374
|
);
|
|
361
|
-
}),
|
|
362
|
-
({ children: e, className: o, ...t },
|
|
363
|
-
),
|
|
364
|
-
({ children: e, className: o, ...t },
|
|
365
|
-
const { variant:
|
|
366
|
-
return /* @__PURE__ */
|
|
375
|
+
}), oe = f(
|
|
376
|
+
({ children: e, className: o, ...t }, r) => /* @__PURE__ */ n.jsx("div", { ref: r, className: l("[&>div]:px-6", o), ...t, children: e })
|
|
377
|
+
), re = j.forwardRef(
|
|
378
|
+
({ children: e, className: o, ...t }, r) => {
|
|
379
|
+
const { variant: a } = g();
|
|
380
|
+
return /* @__PURE__ */ n.jsx(
|
|
367
381
|
"div",
|
|
368
382
|
{
|
|
369
|
-
ref:
|
|
370
|
-
className: l(
|
|
383
|
+
ref: r,
|
|
384
|
+
className: l(J({ variant: a }), o),
|
|
371
385
|
...t,
|
|
372
386
|
children: e
|
|
373
387
|
}
|
|
374
388
|
);
|
|
375
389
|
}
|
|
376
|
-
),
|
|
377
|
-
({ children: e, className: o, ...t },
|
|
378
|
-
const { variant:
|
|
379
|
-
return /* @__PURE__ */
|
|
390
|
+
), ne = j.forwardRef(
|
|
391
|
+
({ children: e, className: o, ...t }, r) => {
|
|
392
|
+
const { variant: a } = g();
|
|
393
|
+
return /* @__PURE__ */ n.jsx(
|
|
380
394
|
"div",
|
|
381
395
|
{
|
|
382
|
-
ref:
|
|
383
|
-
className: l(
|
|
396
|
+
ref: r,
|
|
397
|
+
className: l(Q({ variant: a }), o),
|
|
384
398
|
...t,
|
|
385
399
|
children: e
|
|
386
400
|
}
|
|
@@ -390,27 +404,27 @@ const G = u(
|
|
|
390
404
|
container: e,
|
|
391
405
|
children: o,
|
|
392
406
|
isOpen: t,
|
|
393
|
-
onClose:
|
|
394
|
-
position:
|
|
407
|
+
onClose: r,
|
|
408
|
+
position: a = "right",
|
|
395
409
|
size: s = "md",
|
|
396
410
|
variant: i = "default",
|
|
397
411
|
transitionType: w = "slide",
|
|
398
412
|
disableOverlayClickToClose: b = !1,
|
|
399
|
-
disableEscapeKeyDown:
|
|
413
|
+
disableEscapeKeyDown: h = !1,
|
|
400
414
|
className: d,
|
|
401
415
|
...c
|
|
402
416
|
}) => {
|
|
403
417
|
const m = {
|
|
404
418
|
isOpen: t,
|
|
405
|
-
onClose:
|
|
406
|
-
position:
|
|
419
|
+
onClose: r,
|
|
420
|
+
position: a,
|
|
407
421
|
size: s,
|
|
408
422
|
variant: i,
|
|
409
423
|
transitionType: w,
|
|
410
424
|
disableOverlayClickToClose: b,
|
|
411
|
-
disableEscapeKeyDown:
|
|
412
|
-
},
|
|
413
|
-
return /* @__PURE__ */
|
|
425
|
+
disableEscapeKeyDown: h
|
|
426
|
+
}, p = B(t, r, h);
|
|
427
|
+
return /* @__PURE__ */ n.jsx(C, { container: e, children: /* @__PURE__ */ n.jsx(R.Provider, { value: m, children: /* @__PURE__ */ n.jsxs(
|
|
414
428
|
"div",
|
|
415
429
|
{
|
|
416
430
|
className: l(
|
|
@@ -418,24 +432,24 @@ const G = u(
|
|
|
418
432
|
t && "pointer-events-auto"
|
|
419
433
|
),
|
|
420
434
|
children: [
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ n.jsx(Y, {}),
|
|
436
|
+
/* @__PURE__ */ n.jsx(
|
|
423
437
|
"div",
|
|
424
438
|
{
|
|
425
|
-
ref:
|
|
439
|
+
ref: p,
|
|
426
440
|
tabIndex: -1,
|
|
427
441
|
role: t ? "dialog" : void 0,
|
|
428
442
|
"aria-modal": t ? "true" : void 0,
|
|
429
443
|
className: l(
|
|
430
|
-
|
|
431
|
-
position:
|
|
444
|
+
X({
|
|
445
|
+
position: a,
|
|
432
446
|
size: s,
|
|
433
447
|
variant: i,
|
|
434
448
|
transitionType: w
|
|
435
449
|
}),
|
|
436
450
|
w === "slide" ? [
|
|
437
|
-
!t &&
|
|
438
|
-
!t &&
|
|
451
|
+
!t && a === "left" && "-translate-x-full",
|
|
452
|
+
!t && a === "right" && "translate-x-full"
|
|
439
453
|
] : [
|
|
440
454
|
"left-0 right-0 top-0 bottom-0",
|
|
441
455
|
t ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
@@ -449,14 +463,14 @@ const G = u(
|
|
|
449
463
|
]
|
|
450
464
|
}
|
|
451
465
|
) }) });
|
|
452
|
-
},
|
|
453
|
-
Header:
|
|
454
|
-
Title:
|
|
455
|
-
CloseButton:
|
|
456
|
-
Tab:
|
|
457
|
-
Body:
|
|
458
|
-
Footer:
|
|
459
|
-
}),
|
|
466
|
+
}, Be = Object.assign(ae, {
|
|
467
|
+
Header: Z,
|
|
468
|
+
Title: ee,
|
|
469
|
+
CloseButton: te,
|
|
470
|
+
Tab: oe,
|
|
471
|
+
Body: re,
|
|
472
|
+
Footer: ne
|
|
473
|
+
}), se = u(
|
|
460
474
|
[
|
|
461
475
|
"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",
|
|
462
476
|
"transition-transform duration-300 ease-in-out will-change-transform",
|
|
@@ -474,7 +488,7 @@ const G = u(
|
|
|
474
488
|
open: !1
|
|
475
489
|
}
|
|
476
490
|
}
|
|
477
|
-
),
|
|
491
|
+
), ie = u(
|
|
478
492
|
["fixed inset-0 z-40 duration-300"],
|
|
479
493
|
{
|
|
480
494
|
variants: {
|
|
@@ -487,42 +501,42 @@ const G = u(
|
|
|
487
501
|
open: !1
|
|
488
502
|
}
|
|
489
503
|
}
|
|
490
|
-
),
|
|
504
|
+
), le = u("px-4 pt-4 pb-2 flex-shrink-0"), de = u([
|
|
491
505
|
"px-4 py-2 flex-1 overflow-y-auto",
|
|
492
506
|
"scrollbar-thin scrollbar-track-transparent scrollbar-thumb-border"
|
|
493
|
-
]),
|
|
494
|
-
return /* @__PURE__ */
|
|
507
|
+
]), ce = u("px-4 pt-2 pb-4 flex-shrink-0"), ue = f(function({ className: o, ...t }, r) {
|
|
508
|
+
return /* @__PURE__ */ n.jsx(
|
|
495
509
|
"h2",
|
|
496
510
|
{
|
|
497
|
-
ref:
|
|
511
|
+
ref: r,
|
|
498
512
|
className: ["text-lg font-semibold text-foreground", o].filter(Boolean).join(" "),
|
|
499
513
|
...t
|
|
500
514
|
}
|
|
501
515
|
);
|
|
502
|
-
}),
|
|
516
|
+
}), fe = f(({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
|
|
503
517
|
"div",
|
|
504
518
|
{
|
|
505
519
|
ref: t,
|
|
506
|
-
className:
|
|
520
|
+
className: le({ className: e }),
|
|
507
521
|
...o
|
|
508
522
|
}
|
|
509
|
-
)),
|
|
510
|
-
({ className: e, ...o }, t) => /* @__PURE__ */
|
|
523
|
+
)), me = f(
|
|
524
|
+
({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
|
|
511
525
|
"div",
|
|
512
526
|
{
|
|
513
527
|
ref: t,
|
|
514
|
-
className:
|
|
528
|
+
className: de({ className: e }),
|
|
515
529
|
...o
|
|
516
530
|
}
|
|
517
531
|
)
|
|
518
|
-
),
|
|
532
|
+
), we = f(({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
|
|
519
533
|
"div",
|
|
520
534
|
{
|
|
521
535
|
ref: t,
|
|
522
|
-
className:
|
|
536
|
+
className: ce({ className: e }),
|
|
523
537
|
...o
|
|
524
538
|
}
|
|
525
|
-
)),
|
|
539
|
+
)), he = (...e) => (o) => {
|
|
526
540
|
e.forEach((t) => {
|
|
527
541
|
typeof t == "function" ? t(o) : t && "current" in t && (t.current = o);
|
|
528
542
|
});
|
|
@@ -531,40 +545,40 @@ const G = u(
|
|
|
531
545
|
isOpen: e,
|
|
532
546
|
children: o,
|
|
533
547
|
className: t,
|
|
534
|
-
onClose:
|
|
535
|
-
container:
|
|
548
|
+
onClose: r,
|
|
549
|
+
container: a,
|
|
536
550
|
disableOverlayClickToClose: s = !1,
|
|
537
551
|
...i
|
|
538
552
|
}, w) => {
|
|
539
|
-
const b =
|
|
540
|
-
isOpen:
|
|
553
|
+
const b = B(e, r), {
|
|
554
|
+
isOpen: h,
|
|
541
555
|
height: d,
|
|
542
556
|
isSupported: c
|
|
543
|
-
} =
|
|
557
|
+
} = F(), m = z(() => !e || !c || !h ? {} : {
|
|
544
558
|
// Adjust bottom position to sit above the virtual keyboard
|
|
545
559
|
bottom: `${d}px`,
|
|
546
560
|
// Reduce max height to account for keyboard
|
|
547
561
|
maxHeight: `calc(90dvh - ${d}px)`,
|
|
548
562
|
// Ensure smooth transition
|
|
549
563
|
transition: "bottom 0.2s ease-in-out, max-height 0.2s ease-in-out"
|
|
550
|
-
}, [e, c,
|
|
551
|
-
s ||
|
|
564
|
+
}, [e, c, h, d]), p = () => {
|
|
565
|
+
s || r?.();
|
|
552
566
|
};
|
|
553
|
-
return /* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ n.jsxs(C, { container: a, children: [
|
|
568
|
+
/* @__PURE__ */ n.jsx(
|
|
555
569
|
"div",
|
|
556
570
|
{
|
|
557
|
-
className:
|
|
571
|
+
className: ie({ open: e }),
|
|
558
572
|
"aria-hidden": "true",
|
|
559
|
-
onClick:
|
|
573
|
+
onClick: p
|
|
560
574
|
}
|
|
561
575
|
),
|
|
562
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ n.jsx(
|
|
563
577
|
"div",
|
|
564
578
|
{
|
|
565
|
-
ref:
|
|
579
|
+
ref: he(w, b),
|
|
566
580
|
className: l(
|
|
567
|
-
|
|
581
|
+
se({
|
|
568
582
|
open: e
|
|
569
583
|
}),
|
|
570
584
|
"flex flex-col",
|
|
@@ -582,13 +596,13 @@ const G = u(
|
|
|
582
596
|
] });
|
|
583
597
|
}
|
|
584
598
|
), Ce = Object.assign(pe, {
|
|
585
|
-
Header:
|
|
586
|
-
Title:
|
|
587
|
-
Body:
|
|
588
|
-
Footer:
|
|
599
|
+
Header: fe,
|
|
600
|
+
Title: ue,
|
|
601
|
+
Body: me,
|
|
602
|
+
Footer: we
|
|
589
603
|
});
|
|
590
604
|
export {
|
|
591
605
|
Ce as B,
|
|
592
|
-
|
|
593
|
-
|
|
606
|
+
Be as D,
|
|
607
|
+
ke as M
|
|
594
608
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as w, j as e, a as m } from "./index-DOdDlCoL.js";
|
|
2
2
|
import x, { createContext as N, useContext as S, useId as E, forwardRef as j, useRef as D, useState as O, useEffect as Q, useMemo as F } from "react";
|
|
3
|
-
import { I as C } from "./image-rectangle-
|
|
3
|
+
import { I as C } from "./image-rectangle-oPc5hFMM.js";
|
|
4
4
|
import { Calendar as U, SearchIcon as X, Clock as Y, Banknote as Z, MailIcon as ee, Check as P } from "lucide-react";
|
|
5
5
|
import "./snackbar-DH8jCh2V.js";
|
|
6
|
-
import { M as R, D as M, B as V } from "./bottom-sheet-
|
|
6
|
+
import { M as R, D as M, B as V } from "./bottom-sheet-B3Rt2JC5.js";
|
|
7
7
|
const re = w("space-y-2", {
|
|
8
8
|
variants: {
|
|
9
9
|
direction: {
|
package/dist/js/forms/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as a, C as n, b as p, a as u, D as s, k as I, E as i, M as l, P as S, R as c, d as r, c as g, S as h, e as o, j as m, i as M, h as b, f as k, T as x, g as C } from "../bottom-sheet-input-
|
|
1
|
+
import { B as a, C as n, b as p, a as u, D as s, k as I, E as i, M as l, P as S, R as c, d as r, c as g, S as h, e as o, j as m, i as M, h as b, f as k, T as x, g as C } from "../bottom-sheet-input-DRcyjeGh.js";
|
|
2
2
|
export {
|
|
3
3
|
a as BottomSheetInput,
|
|
4
4
|
n as CheckboxInput,
|
|
@@ -322,11 +322,11 @@ const alertVariants = cva(
|
|
|
322
322
|
ellipsis: n = !1,
|
|
323
323
|
fontSize: l,
|
|
324
324
|
fontWeight: c,
|
|
325
|
-
className:
|
|
326
|
-
children:
|
|
327
|
-
...
|
|
328
|
-
},
|
|
329
|
-
const
|
|
325
|
+
className: u,
|
|
326
|
+
children: g,
|
|
327
|
+
...d
|
|
328
|
+
}, m) => {
|
|
329
|
+
const w = [
|
|
330
330
|
"h1",
|
|
331
331
|
"h2",
|
|
332
332
|
"h3",
|
|
@@ -336,11 +336,11 @@ const alertVariants = cva(
|
|
|
336
336
|
"p",
|
|
337
337
|
"span",
|
|
338
338
|
"label"
|
|
339
|
-
].includes(e) ? e : "span",
|
|
339
|
+
].includes(e) ? e : "span", p = l ? `text-${l}` : "", v = c ? `font-${c}` : "";
|
|
340
340
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
341
341
|
e,
|
|
342
342
|
{
|
|
343
|
-
ref:
|
|
343
|
+
ref: m,
|
|
344
344
|
className: cn(
|
|
345
345
|
textVariants({
|
|
346
346
|
color: t,
|
|
@@ -351,14 +351,14 @@ const alertVariants = cva(
|
|
|
351
351
|
clamp: a,
|
|
352
352
|
ellipsis: n,
|
|
353
353
|
// @ts-expect-error - `as` is not a valid variant
|
|
354
|
-
as:
|
|
354
|
+
as: w
|
|
355
355
|
}),
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
356
|
+
p,
|
|
357
|
+
v,
|
|
358
|
+
u
|
|
359
359
|
),
|
|
360
|
-
...
|
|
361
|
-
children:
|
|
360
|
+
...d,
|
|
361
|
+
children: g
|
|
362
362
|
}
|
|
363
363
|
);
|
|
364
364
|
}
|
|
@@ -707,7 +707,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
707
707
|
children: n,
|
|
708
708
|
...l
|
|
709
709
|
}, c) => {
|
|
710
|
-
const
|
|
710
|
+
const d = !(n != null && n !== "") && !!(i || o);
|
|
711
711
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
712
712
|
"span",
|
|
713
713
|
{
|
|
@@ -718,12 +718,12 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
718
718
|
color: r,
|
|
719
719
|
shape: t,
|
|
720
720
|
size: s,
|
|
721
|
-
iconOnly:
|
|
721
|
+
iconOnly: d
|
|
722
722
|
}),
|
|
723
723
|
a
|
|
724
724
|
),
|
|
725
725
|
...l,
|
|
726
|
-
children:
|
|
726
|
+
children: d ? (
|
|
727
727
|
// Icon-only mode: display only the icon
|
|
728
728
|
i || o
|
|
729
729
|
) : (
|
|
@@ -851,7 +851,7 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
851
851
|
);
|
|
852
852
|
}
|
|
853
853
|
), menuVariants = cva(
|
|
854
|
-
"absolute z-70 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform",
|
|
854
|
+
"absolute z-70 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform shadow-lg",
|
|
855
855
|
{
|
|
856
856
|
variants: {
|
|
857
857
|
size: {
|
|
@@ -859,8 +859,8 @@ const AttributeListItem = forwardRef(function({ children: t, className: r, span:
|
|
|
859
859
|
md: "py-2 px-1"
|
|
860
860
|
},
|
|
861
861
|
open: {
|
|
862
|
-
true: "opacity-100
|
|
863
|
-
false: "opacity-0 pointer-events-none
|
|
862
|
+
true: "opacity-100 scale-100",
|
|
863
|
+
false: "opacity-0 pointer-events-none scale-95"
|
|
864
864
|
}
|
|
865
865
|
},
|
|
866
866
|
defaultVariants: {
|
|
@@ -878,18 +878,74 @@ function useMenuOutsideClick(e, t, r, s) {
|
|
|
878
878
|
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
879
879
|
}, [e, s, t, r]);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
const i = (o) => {
|
|
887
|
-
o.key === "Escape" && e && s.current && s.current.contains(document.activeElement) && !r && t();
|
|
888
|
-
};
|
|
889
|
-
return e && (document.addEventListener("keydown", i), document.body.style.overflow = "hidden"), () => {
|
|
890
|
-
document.removeEventListener("keydown", i), document.body.style.overflow = "unset";
|
|
881
|
+
function useMenuEscapeClose(e, t) {
|
|
882
|
+
useEffect(() => {
|
|
883
|
+
if (!e) return;
|
|
884
|
+
const r = (s) => {
|
|
885
|
+
s.key === "Escape" && t();
|
|
891
886
|
};
|
|
892
|
-
|
|
887
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
888
|
+
}, [e, t]);
|
|
889
|
+
}
|
|
890
|
+
function useMenuPosition(e, t, r, s = "bottom-start", i) {
|
|
891
|
+
const [o, a] = useState({});
|
|
892
|
+
return useEffect(() => {
|
|
893
|
+
if (!e || !t.current || !r.current) {
|
|
894
|
+
a({});
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
const n = t.current, l = r.current, c = i || document.documentElement, u = n.getBoundingClientRect(), g = c.getBoundingClientRect(), d = l.style.visibility, m = l.style.position;
|
|
898
|
+
l.style.visibility = "hidden", l.style.position = "absolute";
|
|
899
|
+
const h = l.getBoundingClientRect();
|
|
900
|
+
l.style.visibility = d, l.style.position = m;
|
|
901
|
+
const w = g.bottom - u.bottom - 8, p = u.top - g.top - 8, v = g.right - u.left - 8, y = u.right - g.left - 8;
|
|
902
|
+
let b = s;
|
|
903
|
+
s === "auto" && (w >= h.height && v >= h.width ? b = "bottom-start" : w >= h.height && y >= h.width ? b = "bottom-end" : p >= h.height && v >= h.width ? b = "top-start" : p >= h.height && y >= h.width ? b = "top-end" : b = w >= p ? "bottom-start" : "top-start");
|
|
904
|
+
const f = {};
|
|
905
|
+
switch (b) {
|
|
906
|
+
case "bottom-start":
|
|
907
|
+
f.top = u.height + 4, f.left = 0;
|
|
908
|
+
break;
|
|
909
|
+
case "bottom-end":
|
|
910
|
+
f.top = u.height + 4, f.right = 0;
|
|
911
|
+
break;
|
|
912
|
+
case "top-start":
|
|
913
|
+
f.bottom = u.height + 4, f.left = 0;
|
|
914
|
+
break;
|
|
915
|
+
case "top-end":
|
|
916
|
+
f.bottom = u.height + 4, f.right = 0;
|
|
917
|
+
break;
|
|
918
|
+
}
|
|
919
|
+
if (i) {
|
|
920
|
+
const R = {
|
|
921
|
+
top: b.startsWith("bottom") ? u.bottom + 4 : u.top - h.height - 4,
|
|
922
|
+
left: b.endsWith("start") ? u.left : u.right - h.width,
|
|
923
|
+
width: h.width,
|
|
924
|
+
height: h.height
|
|
925
|
+
};
|
|
926
|
+
if (R.left < g.left + 8) {
|
|
927
|
+
const x = g.left + 8 - R.left;
|
|
928
|
+
b.endsWith("start") ? f.left = (f.left || 0) + x : f.right = (f.right || 0) - x;
|
|
929
|
+
} else if (R.left + R.width > g.right - 8) {
|
|
930
|
+
const x = R.left + R.width - (g.right - 8);
|
|
931
|
+
b.endsWith("start") ? f.left = (f.left || 0) - x : f.right = (f.right || 0) + x;
|
|
932
|
+
}
|
|
933
|
+
if (b.startsWith("bottom")) {
|
|
934
|
+
const x = Math.max(
|
|
935
|
+
50,
|
|
936
|
+
g.bottom - u.bottom - 16
|
|
937
|
+
);
|
|
938
|
+
h.height > x && (f.maxHeight = x);
|
|
939
|
+
} else {
|
|
940
|
+
const x = Math.max(
|
|
941
|
+
50,
|
|
942
|
+
u.top - g.top - 16
|
|
943
|
+
);
|
|
944
|
+
h.height > x && (f.maxHeight = x);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
a(f);
|
|
948
|
+
}, [e, s, i, t, r]), o;
|
|
893
949
|
}
|
|
894
950
|
const MenuContent = forwardRef(
|
|
895
951
|
({ children: e }, t) => /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { ref: t, className: "flex flex-col gap-1", children: e })
|
|
@@ -908,23 +964,38 @@ const MenuContent = forwardRef(
|
|
|
908
964
|
onOutsideClick: t,
|
|
909
965
|
size: r = "md",
|
|
910
966
|
content: s,
|
|
911
|
-
children: i
|
|
967
|
+
children: i,
|
|
968
|
+
placement: o = "bottom-start",
|
|
969
|
+
container: a
|
|
912
970
|
}) => {
|
|
913
|
-
const
|
|
914
|
-
|
|
971
|
+
const n = useRef(null), l = useRef(null), c = useId();
|
|
972
|
+
useMenuOutsideClick(e, l, n, t), useMenuEscapeClose(e, t);
|
|
973
|
+
const u = useMenuPosition(
|
|
974
|
+
e,
|
|
975
|
+
n,
|
|
976
|
+
l,
|
|
977
|
+
o,
|
|
978
|
+
a
|
|
979
|
+
), g = {
|
|
980
|
+
...u,
|
|
981
|
+
overflowY: u.maxHeight ? "auto" : void 0,
|
|
982
|
+
overflowX: u.maxWidth ? "auto" : void 0
|
|
983
|
+
};
|
|
984
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
|
|
915
985
|
cloneElement(i, {
|
|
916
986
|
// @ts-expect-error: ref is valid for button or forwardRef components
|
|
917
|
-
ref:
|
|
987
|
+
ref: n,
|
|
918
988
|
"aria-haspopup": "menu",
|
|
919
989
|
"aria-expanded": e,
|
|
920
|
-
"aria-controls":
|
|
990
|
+
"aria-controls": c
|
|
921
991
|
}),
|
|
922
992
|
e && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
923
993
|
"div",
|
|
924
994
|
{
|
|
925
|
-
id:
|
|
926
|
-
ref:
|
|
995
|
+
id: c,
|
|
996
|
+
ref: l,
|
|
927
997
|
className: cn(menuVariants({ size: r, open: e })),
|
|
998
|
+
style: g,
|
|
928
999
|
role: "menu",
|
|
929
1000
|
"aria-hidden": !e,
|
|
930
1001
|
children: s
|
|
@@ -1105,7 +1176,7 @@ const buttonIconVariants = cva(
|
|
|
1105
1176
|
(e, t) => {
|
|
1106
1177
|
const {
|
|
1107
1178
|
as: r = EllipsisVerticalIcon,
|
|
1108
|
-
|
|
1179
|
+
children: s,
|
|
1109
1180
|
onOpenChange: i,
|
|
1110
1181
|
onClick: o,
|
|
1111
1182
|
...a
|
|
@@ -1115,8 +1186,8 @@ const buttonIconVariants = cva(
|
|
|
1115
1186
|
}, [n, i]);
|
|
1116
1187
|
const c = () => {
|
|
1117
1188
|
l(!1);
|
|
1118
|
-
},
|
|
1119
|
-
l((
|
|
1189
|
+
}, u = (g) => {
|
|
1190
|
+
l((d) => !d), o?.(g);
|
|
1120
1191
|
};
|
|
1121
1192
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1122
1193
|
Menu,
|
|
@@ -1125,7 +1196,7 @@ const buttonIconVariants = cva(
|
|
|
1125
1196
|
onOutsideClick: c,
|
|
1126
1197
|
size: "md",
|
|
1127
1198
|
content: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { children: s }),
|
|
1128
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick:
|
|
1199
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { ref: t, as: r, onClick: u, ...a })
|
|
1129
1200
|
}
|
|
1130
1201
|
);
|
|
1131
1202
|
}
|
|
@@ -1202,18 +1273,18 @@ function useFloatingPosition(e, t = "1rem") {
|
|
|
1202
1273
|
const r = useRef(null), [s, i] = useState({}), [o, a] = useState("fixed bottom-4 right-4"), n = useCallback(() => {
|
|
1203
1274
|
const c = r.current;
|
|
1204
1275
|
if (!c) return;
|
|
1205
|
-
const
|
|
1206
|
-
let
|
|
1207
|
-
|
|
1276
|
+
const g = c.getBoundingClientRect().height > window.innerHeight;
|
|
1277
|
+
let d = {}, m = "";
|
|
1278
|
+
g ? (d = {
|
|
1208
1279
|
position: "fixed",
|
|
1209
1280
|
bottom: t,
|
|
1210
1281
|
zIndex: 50,
|
|
1211
1282
|
transform: `translateY(${c.scrollTop}px)`
|
|
1212
|
-
},
|
|
1283
|
+
}, m = `fixed bottom-4 ${e}-4`) : (d = {
|
|
1213
1284
|
position: "fixed",
|
|
1214
1285
|
bottom: t,
|
|
1215
1286
|
zIndex: 50
|
|
1216
|
-
},
|
|
1287
|
+
}, m = `fixed bottom-4 ${e}-4`), i(d), a(m);
|
|
1217
1288
|
}, [e, t]);
|
|
1218
1289
|
return useEffect(() => {
|
|
1219
1290
|
n();
|
|
@@ -1239,12 +1310,12 @@ const ButtonFloat = forwardRef(
|
|
|
1239
1310
|
offset: o = "1rem",
|
|
1240
1311
|
...a
|
|
1241
1312
|
}, n) {
|
|
1242
|
-
const [l, c,
|
|
1313
|
+
const [l, c, u] = useFloatingPosition(
|
|
1243
1314
|
i,
|
|
1244
1315
|
o
|
|
1245
|
-
), [
|
|
1316
|
+
), [g, d] = useState(!1);
|
|
1246
1317
|
return useEffect(() => {
|
|
1247
|
-
|
|
1318
|
+
d(!0);
|
|
1248
1319
|
}, []), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: l, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1249
1320
|
"button",
|
|
1250
1321
|
{
|
|
@@ -1252,8 +1323,8 @@ const ButtonFloat = forwardRef(
|
|
|
1252
1323
|
type: a.type || "button",
|
|
1253
1324
|
className: cn(
|
|
1254
1325
|
buttonFloatVariants({ variant: r, size: s }),
|
|
1255
|
-
|
|
1256
|
-
|
|
1326
|
+
u,
|
|
1327
|
+
g && "animate-fab-in",
|
|
1257
1328
|
t
|
|
1258
1329
|
),
|
|
1259
1330
|
style: c,
|
|
@@ -1404,7 +1475,7 @@ const BUTTONS = [
|
|
|
1404
1475
|
"aria-label": "Calculator input"
|
|
1405
1476
|
}
|
|
1406
1477
|
),
|
|
1407
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((
|
|
1478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 mb-3", children: BUTTONS.map((u, g) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: u.map((d) => d === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1408
1479
|
ButtonIcon,
|
|
1409
1480
|
{
|
|
1410
1481
|
as: X,
|
|
@@ -1418,14 +1489,14 @@ const BUTTONS = [
|
|
|
1418
1489
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1419
1490
|
CalculatorButton,
|
|
1420
1491
|
{
|
|
1421
|
-
variant:
|
|
1422
|
-
onClick: () => l(
|
|
1492
|
+
variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
|
|
1493
|
+
onClick: () => l(d),
|
|
1423
1494
|
disabled: r,
|
|
1424
|
-
"aria-label":
|
|
1425
|
-
children:
|
|
1495
|
+
"aria-label": d,
|
|
1496
|
+
children: d
|
|
1426
1497
|
},
|
|
1427
|
-
|
|
1428
|
-
)) },
|
|
1498
|
+
d
|
|
1499
|
+
)) }, g)) })
|
|
1429
1500
|
]
|
|
1430
1501
|
}
|
|
1431
1502
|
);
|
|
@@ -1481,17 +1552,17 @@ const cardVariants = cva(
|
|
|
1481
1552
|
bordered: n = !1,
|
|
1482
1553
|
className: l,
|
|
1483
1554
|
...c
|
|
1484
|
-
},
|
|
1555
|
+
}, u) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1485
1556
|
"button",
|
|
1486
1557
|
{
|
|
1487
|
-
ref:
|
|
1558
|
+
ref: u,
|
|
1488
1559
|
className: cn(cardVariants({ size: e, shape: t, bordered: n }), l),
|
|
1489
1560
|
...c,
|
|
1490
1561
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-4", children: [
|
|
1491
1562
|
r && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: r }),
|
|
1492
1563
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full", children: [
|
|
1493
1564
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2", children: [
|
|
1494
|
-
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "
|
|
1565
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "h3", fontSize: "base", fontWeight: "semibold", children: s }),
|
|
1495
1566
|
i && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "p", fontSize: "sm", color: "gray", children: i })
|
|
1496
1567
|
] }),
|
|
1497
1568
|
(o || a) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
@@ -1995,35 +2066,35 @@ const BaseImage = forwardRef(
|
|
|
1995
2066
|
position: n = "cover",
|
|
1996
2067
|
size: l = "auto",
|
|
1997
2068
|
shape: c,
|
|
1998
|
-
className:
|
|
1999
|
-
...
|
|
2000
|
-
},
|
|
2001
|
-
const { loaded:
|
|
2069
|
+
className: u,
|
|
2070
|
+
...g
|
|
2071
|
+
}, d) => {
|
|
2072
|
+
const { loaded: m, errored: h, handleLoad: w, handleError: p } = useImage({
|
|
2002
2073
|
src: e
|
|
2003
|
-
}),
|
|
2004
|
-
return !
|
|
2074
|
+
}), v = typeof i == "number" ? i : Number(i), y = typeof o == "number" ? o : Number(o);
|
|
2075
|
+
return !m && !h ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2005
2076
|
BaseImageSkeleton,
|
|
2006
2077
|
{
|
|
2007
2078
|
shape: c,
|
|
2008
|
-
width:
|
|
2009
|
-
height:
|
|
2079
|
+
width: v,
|
|
2080
|
+
height: y
|
|
2010
2081
|
}
|
|
2011
|
-
) :
|
|
2082
|
+
) : h ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2012
2083
|
BaseImageFallback,
|
|
2013
2084
|
{
|
|
2014
2085
|
shape: c,
|
|
2015
2086
|
alt: t,
|
|
2016
|
-
width:
|
|
2017
|
-
height:
|
|
2087
|
+
width: v,
|
|
2088
|
+
height: y
|
|
2018
2089
|
}
|
|
2019
2090
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2020
2091
|
"img",
|
|
2021
2092
|
{
|
|
2022
|
-
ref:
|
|
2093
|
+
ref: d,
|
|
2023
2094
|
src: e,
|
|
2024
2095
|
alt: t,
|
|
2025
|
-
width:
|
|
2026
|
-
height:
|
|
2096
|
+
width: v,
|
|
2097
|
+
height: y,
|
|
2027
2098
|
loading: a,
|
|
2028
2099
|
className: cn(
|
|
2029
2100
|
imageVariants({
|
|
@@ -2031,15 +2102,15 @@ const BaseImage = forwardRef(
|
|
|
2031
2102
|
size: l,
|
|
2032
2103
|
shape: c
|
|
2033
2104
|
}),
|
|
2034
|
-
|
|
2105
|
+
u
|
|
2035
2106
|
),
|
|
2036
|
-
onLoad: (
|
|
2037
|
-
|
|
2107
|
+
onLoad: (b) => {
|
|
2108
|
+
w(), r?.(b);
|
|
2038
2109
|
},
|
|
2039
|
-
onError: (
|
|
2040
|
-
|
|
2110
|
+
onError: (b) => {
|
|
2111
|
+
p(), s?.(b);
|
|
2041
2112
|
},
|
|
2042
|
-
...
|
|
2113
|
+
...g
|
|
2043
2114
|
}
|
|
2044
2115
|
);
|
|
2045
2116
|
}
|
|
@@ -2068,6 +2139,5 @@ export {
|
|
|
2068
2139
|
ImageCircle as m,
|
|
2069
2140
|
ImageSquare as n,
|
|
2070
2141
|
ImageRectangle as o,
|
|
2071
|
-
BaseImage as p
|
|
2072
|
-
useEscapeClose as u
|
|
2142
|
+
BaseImage as p
|
|
2073
2143
|
};
|
package/dist/js/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { L as e, P as s, S as r } from "./skeleton-BNZyaRjo.js";
|
|
2
|
-
import { A as n, a as p, B as u, b as i, F as l, e as I, P as c, c as S, d as m, S as B, T as g } from "./top-bar-
|
|
3
|
-
import { B as b, C as T, b as x, a as h, D as f, k as C, E as P, M, P as k, R as A, d as F, c as D, S as L, e as R, j as w, i as G, h as j, f as v, T as y, g as E } from "./bottom-sheet-input-
|
|
4
|
-
import { B as q, D as H, M as z } from "./bottom-sheet-
|
|
5
|
-
import { A as K, a as O, b as Q, c as U, d as V, B as W, p as X, e as Y, f as Z, h as _, i as $, g as aa, C as ta, j as ea, F as sa, I as ra, m as oa, o as na, n as pa, M as ua, N as ia, T as la, k as Ia, l as ca } from "./image-rectangle-
|
|
6
|
-
import { T as ma } from "./tooltip-
|
|
2
|
+
import { A as n, a as p, B as u, b as i, F as l, e as I, P as c, c as S, d as m, S as B, T as g } from "./top-bar-Bg-zMaFY.js";
|
|
3
|
+
import { B as b, C as T, b as x, a as h, D as f, k as C, E as P, M, P as k, R as A, d as F, c as D, S as L, e as R, j as w, i as G, h as j, f as v, T as y, g as E } from "./bottom-sheet-input-DRcyjeGh.js";
|
|
4
|
+
import { B as q, D as H, M as z } from "./bottom-sheet-B3Rt2JC5.js";
|
|
5
|
+
import { A as K, a as O, b as Q, c as U, d as V, B as W, p as X, e as Y, f as Z, h as _, i as $, g as aa, C as ta, j as ea, F as sa, I as ra, m as oa, o as na, n as pa, M as ua, N as ia, T as la, k as Ia, l as ca } from "./image-rectangle-oPc5hFMM.js";
|
|
6
|
+
import { T as ma } from "./tooltip-DNKTNCQm.js";
|
|
7
7
|
import { S as ga } from "./snackbar-DH8jCh2V.js";
|
|
8
|
-
import { B as ba, T as Ta } from "./tabs-
|
|
8
|
+
import { B as ba, T as Ta } from "./tabs-CKLbsCWq.js";
|
|
9
9
|
import { S as ha, u as fa } from "./use-snackbars-B0MaRlg1.js";
|
|
10
10
|
export {
|
|
11
11
|
K as Alert,
|
package/dist/js/layouts/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as r, a as e, B as s, b as t, F as p, e as B, P as u, c as d, d as g, S as P, T as i } from "../top-bar-
|
|
1
|
+
import { A as r, a as e, B as s, b as t, F as p, e as B, P as u, c as d, d as g, S as P, T as i } from "../top-bar-Bg-zMaFY.js";
|
|
2
2
|
export {
|
|
3
3
|
r as AppBar,
|
|
4
4
|
e as BadgeGroup,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as a, D as e, M as t } from "../bottom-sheet-
|
|
2
|
-
import { M as m } from "../image-rectangle-
|
|
3
|
-
import { T as M } from "../tooltip-
|
|
1
|
+
import { B as a, D as e, M as t } from "../bottom-sheet-B3Rt2JC5.js";
|
|
2
|
+
import { M as m } from "../image-rectangle-oPc5hFMM.js";
|
|
3
|
+
import { T as M } from "../tooltip-DNKTNCQm.js";
|
|
4
4
|
export {
|
|
5
5
|
a as BottomSheet,
|
|
6
6
|
e as Drawer,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as t, a as e, b as o, c as r, d as n, B as l, p as u, e as c, f as i, h as B, i as I, g, C as m, j as A, F as b, I as C, m as d, o as p, n as T, N as f, T as h, k as x, l as F } from "../image-rectangle-
|
|
1
|
+
import { A as t, a as e, b as o, c as r, d as n, B as l, p as u, e as c, f as i, h as B, i as I, g, C as m, j as A, F as b, I as C, m as d, o as p, n as T, N as f, T as h, k as x, l as F } from "../image-rectangle-oPc5hFMM.js";
|
|
2
2
|
import { S as k } from "../snackbar-DH8jCh2V.js";
|
|
3
3
|
export {
|
|
4
4
|
t as Alert,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as d, j as s, a as u } from "./index-DOdDlCoL.js";
|
|
2
2
|
import { forwardRef as f, createContext as x, useContext as g, useState as p, useLayoutEffect as y, useRef as h } from "react";
|
|
3
|
-
import { I as w } from "./image-rectangle-
|
|
3
|
+
import { I as w } from "./image-rectangle-oPc5hFMM.js";
|
|
4
4
|
import "./snackbar-DH8jCh2V.js";
|
|
5
5
|
import { ChevronRight as T } from "lucide-react";
|
|
6
6
|
const j = d(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as v, j as c, a as w } from "./index-DOdDlCoL.js";
|
|
2
2
|
import { useRef as m, useState as d, useEffect as h, useId as T, cloneElement as j } from "react";
|
|
3
|
-
import { k as y } from "./image-rectangle-
|
|
3
|
+
import { k as y } from "./image-rectangle-oPc5hFMM.js";
|
|
4
4
|
function P(e = "auto") {
|
|
5
5
|
const n = m(null), [a, t] = d("bottom");
|
|
6
6
|
return h(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as i, j as s, a as l } from "./index-DOdDlCoL.js";
|
|
2
2
|
import * as b from "react";
|
|
3
3
|
import { forwardRef as o } from "react";
|
|
4
|
-
import { k as u } from "./image-rectangle-
|
|
4
|
+
import { k as u } from "./image-rectangle-oPc5hFMM.js";
|
|
5
5
|
import "./snackbar-DH8jCh2V.js";
|
|
6
6
|
const j = i(
|
|
7
7
|
"w-full flex flex-wrap items-center pt-3 mb-3 gap-2 bg-white [&>[data-versaur-appbar-bottom]]:basis-full [&>[data-versaur-appbar-bottom]]:w-full [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-leading]]:pl-4 [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-trailing]]:pr-4 [&:not(:has([data-versaur-appbar-bottom]))]:px-4",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type MenuSize = 'sm' | 'md';
|
|
3
|
+
export type MenuPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'auto';
|
|
3
4
|
/**
|
|
4
5
|
* Props for Menu
|
|
5
6
|
*/
|
|
@@ -14,6 +15,10 @@ export interface MenuProps {
|
|
|
14
15
|
content: ReactNode;
|
|
15
16
|
/** Trigger element */
|
|
16
17
|
children: ReactNode;
|
|
18
|
+
/** Preferred placement of the menu relative to trigger */
|
|
19
|
+
placement?: MenuPlacement;
|
|
20
|
+
/** Container element to respect boundaries (defaults to viewport) */
|
|
21
|
+
container?: HTMLElement | null;
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
19
24
|
* Props for MenuContent
|
|
@@ -1 +1,16 @@
|
|
|
1
|
+
import { MenuPlacement } from './types';
|
|
1
2
|
export declare function useMenuOutsideClick(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>, triggerRef: React.RefObject<HTMLButtonElement | null>, onOutsideClick: () => void): void;
|
|
3
|
+
/**
|
|
4
|
+
* Menu-specific escape close hook that doesn't disable body scrolling
|
|
5
|
+
*/
|
|
6
|
+
export declare function useMenuEscapeClose(isOpen: boolean, onClose: () => void): void;
|
|
7
|
+
interface MenuPosition {
|
|
8
|
+
top?: number;
|
|
9
|
+
bottom?: number;
|
|
10
|
+
left?: number;
|
|
11
|
+
right?: number;
|
|
12
|
+
maxHeight?: number;
|
|
13
|
+
maxWidth?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function useMenuPosition(isOpen: boolean, triggerRef: React.RefObject<HTMLElement | null>, contentRef: React.RefObject<HTMLDivElement | null>, placement?: MenuPlacement, container?: HTMLElement | null): MenuPosition;
|
|
16
|
+
export {};
|