@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.
@@ -1,33 +1,33 @@
1
- import { c as u, j as r, a as l } from "./index-DOdDlCoL.js";
2
- import j, { useState as x, useEffect as y, createContext as S, useContext as T, forwardRef as f, useMemo as M } from "react";
3
- import { u as C, k as z, i as H } from "./image-rectangle-BS6j3xEC.js";
4
- import { XIcon as D } from "lucide-react";
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), a = "ontouchstart" in window || navigator.maxTouchPoints > 0, n = window.innerWidth <= 1024;
12
- return o || t || a && n;
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 E() {
18
- const [e, o] = x(!1), [t, a] = x(0), [n, s] = x(0), [i, w] = x(!1), [b, p] = x(!1);
19
- return y(() => {
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), p(k());
25
- }, []), y(() => {
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, h = m?.height || 0, g = m?.width || 0;
30
- o(h > 0), a(h), s(g);
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]), y(() => {
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 h = window.visualViewport?.height ?? window.innerHeight, g = d - h, V = g > 150;
46
- o(V), a(V ? g : 0), s(V ? window.innerWidth : 0);
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]), y(() => {
58
- i || (o(!1), a(0), s(0));
57
+ }, [i]), x(() => {
58
+ i || (o(!1), r(0), s(0));
59
59
  }, [i]), {
60
60
  isOpen: e,
61
61
  height: t,
62
- width: n,
62
+ width: a,
63
63
  isSupported: i,
64
64
  usingNativeAPI: b
65
65
  };
66
66
  }
67
67
  const N = S(null);
68
- function F() {
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 O = u(
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
- ), A = u(
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
- ), L = f(
124
- ({ className: e, ...o }, t) => /* @__PURE__ */ r.jsx(
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
- ), W = f(
133
- ({ className: e, ...o }, t) => /* @__PURE__ */ r.jsx(
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: a, onClose: n, disableOverlayClickToClose: s } = F(), i = () => {
146
- s || n();
145
+ const { isOpen: t, placement: r, onClose: a, disableOverlayClickToClose: s } = L(), i = () => {
146
+ s || a();
147
147
  };
148
- return /* @__PURE__ */ r.jsx(
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
- O({ placement: a }),
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
- ), B = ({
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__ */ r.jsx(r.Fragment, { children: o });
183
+ return /* @__PURE__ */ n.jsx(n.Fragment, { children: o });
170
184
  const t = e ?? document.body;
171
- return t ? I.createPortal(o, t) : /* @__PURE__ */ r.jsx(r.Fragment, { children: o });
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: a = "center",
177
- disableOverlayClickToClose: n = !1,
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 p = {
197
+ const h = {
184
198
  isOpen: e,
185
199
  onClose: o,
186
200
  size: t,
187
- placement: a,
188
- disableOverlayClickToClose: n,
201
+ placement: r,
202
+ disableOverlayClickToClose: a,
189
203
  disableEscapeKeyDown: s
190
- }, d = C(e, o, s);
191
- return /* @__PURE__ */ r.jsx(B, { container: w, children: /* @__PURE__ */ r.jsx(N.Provider, { value: p, children: /* @__PURE__ */ r.jsxs(
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__ */ r.jsx(_, {}),
200
- /* @__PURE__ */ r.jsx(
213
+ /* @__PURE__ */ n.jsx($, {}),
214
+ /* @__PURE__ */ n.jsx(
201
215
  "div",
202
216
  {
203
217
  ref: d,
204
- className: l(A({ size: t, placement: a, isOpen: e })),
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
- }, Ve = Object.assign($, {
216
- Header: L,
217
- Body: K,
218
- Footer: W
229
+ }, ke = Object.assign(G, {
230
+ Header: W,
231
+ Body: _,
232
+ Footer: K
219
233
  }), R = S(null);
220
- function v() {
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 G = u(
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
- ), U = u(
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
- ), X = u(
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
- ), q = u("flex-1 overflow-y-auto px-6 py-4", {
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
- }), J = u("px-6 py-4 border-t", {
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
- }), Q = j.forwardRef(({ className: e, ...o }, t) => {
312
- const { isOpen: a, disableOverlayClickToClose: n, onClose: s } = v(), i = () => {
313
- n || s();
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__ */ r.jsx(
329
+ return /* @__PURE__ */ n.jsx(
316
330
  "div",
317
331
  {
318
332
  ref: t,
319
333
  onClick: i,
320
334
  className: l(
321
- G({
322
- state: a ? "open" : "closed"
335
+ U({
336
+ state: r ? "open" : "closed"
323
337
  }),
324
338
  e
325
339
  ),
326
340
  ...o
327
341
  }
328
342
  );
329
- }), Y = j.forwardRef(
330
- ({ children: e, className: o, hasTab: t, ...a }, n) => {
331
- const { variant: s } = v();
332
- return /* @__PURE__ */ r.jsx(
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: n,
349
+ ref: a,
336
350
  className: l(
337
- X({ variant: s, tab: !!t }),
351
+ q({ variant: s, tab: !!t }),
338
352
  o
339
353
  ),
340
- ...a,
354
+ ...r,
341
355
  children: e
342
356
  }
343
357
  );
344
358
  }
345
- ), Z = f((e, o) => /* @__PURE__ */ r.jsx(z, { ...e, ref: o, as: "h3", fontSize: "lg" })), ee = f(({ onClick: e, ...o }, t) => {
346
- const { onClose: a } = v(), n = (s) => {
347
- a(), e?.(s);
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__ */ r.jsx(
350
- H,
363
+ return /* @__PURE__ */ n.jsx(
364
+ D,
351
365
  {
352
366
  "aria-label": "Close drawer",
353
367
  ...o,
354
- onClick: n,
368
+ onClick: a,
355
369
  variant: "ghost",
356
370
  size: "sm",
357
- as: D,
371
+ as: E,
358
372
  ref: t
359
373
  }
360
374
  );
361
- }), te = f(
362
- ({ children: e, className: o, ...t }, a) => /* @__PURE__ */ r.jsx("div", { ref: a, className: l("[&>div]:px-6", o), ...t, children: e })
363
- ), oe = j.forwardRef(
364
- ({ children: e, className: o, ...t }, a) => {
365
- const { variant: n } = v();
366
- return /* @__PURE__ */ r.jsx(
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: a,
370
- className: l(q({ variant: n }), o),
383
+ ref: r,
384
+ className: l(J({ variant: a }), o),
371
385
  ...t,
372
386
  children: e
373
387
  }
374
388
  );
375
389
  }
376
- ), re = j.forwardRef(
377
- ({ children: e, className: o, ...t }, a) => {
378
- const { variant: n } = v();
379
- return /* @__PURE__ */ r.jsx(
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: a,
383
- className: l(J({ variant: n }), o),
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: a,
394
- position: n = "right",
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: p = !1,
413
+ disableEscapeKeyDown: h = !1,
400
414
  className: d,
401
415
  ...c
402
416
  }) => {
403
417
  const m = {
404
418
  isOpen: t,
405
- onClose: a,
406
- position: n,
419
+ onClose: r,
420
+ position: a,
407
421
  size: s,
408
422
  variant: i,
409
423
  transitionType: w,
410
424
  disableOverlayClickToClose: b,
411
- disableEscapeKeyDown: p
412
- }, h = C(t, a, p);
413
- return /* @__PURE__ */ r.jsx(B, { container: e, children: /* @__PURE__ */ r.jsx(R.Provider, { value: m, children: /* @__PURE__ */ r.jsxs(
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__ */ r.jsx(Q, {}),
422
- /* @__PURE__ */ r.jsx(
435
+ /* @__PURE__ */ n.jsx(Y, {}),
436
+ /* @__PURE__ */ n.jsx(
423
437
  "div",
424
438
  {
425
- ref: h,
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
- U({
431
- position: n,
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 && n === "left" && "-translate-x-full",
438
- !t && n === "right" && "translate-x-full"
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
- }, ke = Object.assign(ae, {
453
- Header: Y,
454
- Title: Z,
455
- CloseButton: ee,
456
- Tab: te,
457
- Body: oe,
458
- Footer: re
459
- }), ne = u(
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
- ), se = u(
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
- ), ie = u("px-4 pt-4 pb-2 flex-shrink-0"), le = u([
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
- ]), de = u("px-4 pt-2 pb-4 flex-shrink-0"), ce = f(function({ className: o, ...t }, a) {
494
- return /* @__PURE__ */ r.jsx(
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: a,
511
+ ref: r,
498
512
  className: ["text-lg font-semibold text-foreground", o].filter(Boolean).join(" "),
499
513
  ...t
500
514
  }
501
515
  );
502
- }), ue = f(({ className: e, ...o }, t) => /* @__PURE__ */ r.jsx(
516
+ }), fe = f(({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
503
517
  "div",
504
518
  {
505
519
  ref: t,
506
- className: ie({ className: e }),
520
+ className: le({ className: e }),
507
521
  ...o
508
522
  }
509
- )), fe = f(
510
- ({ className: e, ...o }, t) => /* @__PURE__ */ r.jsx(
523
+ )), me = f(
524
+ ({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
511
525
  "div",
512
526
  {
513
527
  ref: t,
514
- className: le({ className: e }),
528
+ className: de({ className: e }),
515
529
  ...o
516
530
  }
517
531
  )
518
- ), me = f(({ className: e, ...o }, t) => /* @__PURE__ */ r.jsx(
532
+ ), we = f(({ className: e, ...o }, t) => /* @__PURE__ */ n.jsx(
519
533
  "div",
520
534
  {
521
535
  ref: t,
522
- className: de({ className: e }),
536
+ className: ce({ className: e }),
523
537
  ...o
524
538
  }
525
- )), we = (...e) => (o) => {
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: a,
535
- container: n,
548
+ onClose: r,
549
+ container: a,
536
550
  disableOverlayClickToClose: s = !1,
537
551
  ...i
538
552
  }, w) => {
539
- const b = C(e, a), {
540
- isOpen: p,
553
+ const b = B(e, r), {
554
+ isOpen: h,
541
555
  height: d,
542
556
  isSupported: c
543
- } = E(), m = M(() => !e || !c || !p ? {} : {
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, p, d]), h = () => {
551
- s || a?.();
564
+ }, [e, c, h, d]), p = () => {
565
+ s || r?.();
552
566
  };
553
- return /* @__PURE__ */ r.jsxs(B, { container: n, children: [
554
- /* @__PURE__ */ r.jsx(
567
+ return /* @__PURE__ */ n.jsxs(C, { container: a, children: [
568
+ /* @__PURE__ */ n.jsx(
555
569
  "div",
556
570
  {
557
- className: se({ open: e }),
571
+ className: ie({ open: e }),
558
572
  "aria-hidden": "true",
559
- onClick: h
573
+ onClick: p
560
574
  }
561
575
  ),
562
- /* @__PURE__ */ r.jsx(
576
+ /* @__PURE__ */ n.jsx(
563
577
  "div",
564
578
  {
565
- ref: we(w, b),
579
+ ref: he(w, b),
566
580
  className: l(
567
- ne({
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: ue,
586
- Title: ce,
587
- Body: fe,
588
- Footer: me
599
+ Header: fe,
600
+ Title: ue,
601
+ Body: me,
602
+ Footer: we
589
603
  });
590
604
  export {
591
605
  Ce as B,
592
- ke as D,
593
- Ve as M
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-BS6j3xEC.js";
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-DJgcgmgw.js";
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: {
@@ -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-lRqhqp7I.js";
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: g,
326
- children: d,
327
- ...u
328
- }, f) => {
329
- const x = [
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", m = l ? `text-${l}` : "", h = c ? `font-${c}` : "";
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: f,
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: x
354
+ as: w
355
355
  }),
356
- m,
357
- h,
358
- g
356
+ p,
357
+ v,
358
+ u
359
359
  ),
360
- ...u,
361
- children: d
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 u = !(n != null && n !== "") && !!(i || o);
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: u
721
+ iconOnly: d
722
722
  }),
723
723
  a
724
724
  ),
725
725
  ...l,
726
- children: u ? (
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 translate-y-1",
863
- false: "opacity-0 pointer-events-none translate-y-3"
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 useEscapeClose(e, t, r) {
882
- const s = useRef(null);
883
- return useEffect(() => {
884
- s.current && s.current.focus();
885
- }, []), useEffect(() => {
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
- }, [e, t, r, s]), s;
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 o = useRef(null), a = useRef(null), n = useId();
914
- return useMenuOutsideClick(e, a, o, t), useEscapeClose(e, t), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-fit", children: [
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: o,
987
+ ref: n,
918
988
  "aria-haspopup": "menu",
919
989
  "aria-expanded": e,
920
- "aria-controls": n
990
+ "aria-controls": c
921
991
  }),
922
992
  e && /* @__PURE__ */ jsxRuntimeExports.jsx(
923
993
  "div",
924
994
  {
925
- id: n,
926
- ref: a,
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
- content: s,
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
- }, g = (d) => {
1119
- l((u) => !u), o?.(d);
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: g, ...a })
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 d = c.getBoundingClientRect().height > window.innerHeight;
1206
- let u = {}, f = "";
1207
- d ? (u = {
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
- }, f = `fixed bottom-4 ${e}-4`) : (u = {
1283
+ }, m = `fixed bottom-4 ${e}-4`) : (d = {
1213
1284
  position: "fixed",
1214
1285
  bottom: t,
1215
1286
  zIndex: 50
1216
- }, f = `fixed bottom-4 ${e}-4`), i(u), a(f);
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, g] = useFloatingPosition(
1313
+ const [l, c, u] = useFloatingPosition(
1243
1314
  i,
1244
1315
  o
1245
- ), [d, u] = useState(!1);
1316
+ ), [g, d] = useState(!1);
1246
1317
  return useEffect(() => {
1247
- u(!0);
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
- g,
1256
- d && "animate-fab-in",
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((g, d) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex w-full", children: g.map((u) => u === "⌫" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
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: u === "=" ? "action" : u === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(u) ? "operator" : "default",
1422
- onClick: () => l(u),
1492
+ variant: d === "=" ? "action" : d === "C" ? "danger" : ["/", "*", "-", "+", "/"].includes(d) ? "operator" : "default",
1493
+ onClick: () => l(d),
1423
1494
  disabled: r,
1424
- "aria-label": u,
1425
- children: u
1495
+ "aria-label": d,
1496
+ children: d
1426
1497
  },
1427
- u
1428
- )) }, d)) })
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
- }, g) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1555
+ }, u) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1485
1556
  "button",
1486
1557
  {
1487
- ref: g,
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: "lg", fontWeight: "semibold", children: s }),
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: g,
1999
- ...d
2000
- }, u) => {
2001
- const { loaded: f, errored: b, handleLoad: x, handleError: m } = useImage({
2069
+ className: u,
2070
+ ...g
2071
+ }, d) => {
2072
+ const { loaded: m, errored: h, handleLoad: w, handleError: p } = useImage({
2002
2073
  src: e
2003
- }), h = typeof i == "number" ? i : Number(i), v = typeof o == "number" ? o : Number(o);
2004
- return !f && !b ? /* @__PURE__ */ jsxRuntimeExports.jsx(
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: h,
2009
- height: v
2079
+ width: v,
2080
+ height: y
2010
2081
  }
2011
- ) : b ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2082
+ ) : h ? /* @__PURE__ */ jsxRuntimeExports.jsx(
2012
2083
  BaseImageFallback,
2013
2084
  {
2014
2085
  shape: c,
2015
2086
  alt: t,
2016
- width: h,
2017
- height: v
2087
+ width: v,
2088
+ height: y
2018
2089
  }
2019
2090
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
2020
2091
  "img",
2021
2092
  {
2022
- ref: u,
2093
+ ref: d,
2023
2094
  src: e,
2024
2095
  alt: t,
2025
- width: h,
2026
- height: v,
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
- g
2105
+ u
2035
2106
  ),
2036
- onLoad: (w) => {
2037
- x(), r?.(w);
2107
+ onLoad: (b) => {
2108
+ w(), r?.(b);
2038
2109
  },
2039
- onError: (w) => {
2040
- m(), s?.(w);
2110
+ onError: (b) => {
2111
+ p(), s?.(b);
2041
2112
  },
2042
- ...d
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-DJNgsR7X.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-lRqhqp7I.js";
4
- import { B as q, D as H, M as z } from "./bottom-sheet-DJgcgmgw.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-BS6j3xEC.js";
6
- import { T as ma } from "./tooltip-J7r2xoUk.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-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-80jJFJ7W.js";
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,
@@ -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-DJNgsR7X.js";
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,4 +1,4 @@
1
- import { B as s, T as b } from "../tabs-80jJFJ7W.js";
1
+ import { B as s, T as b } from "../tabs-CKLbsCWq.js";
2
2
  export {
3
3
  s as Breadcrumbs,
4
4
  b as Tabs
@@ -1,6 +1,6 @@
1
- import { B as a, D as e, M as t } from "../bottom-sheet-DJgcgmgw.js";
2
- import { M as m } from "../image-rectangle-BS6j3xEC.js";
3
- import { T as M } from "../tooltip-J7r2xoUk.js";
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-BS6j3xEC.js";
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-BS6j3xEC.js";
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-BS6j3xEC.js";
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-BS6j3xEC.js";
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 {};
@@ -9,5 +9,5 @@ export interface ButtonMenuIconProps extends Omit<ButtonIconProps, 'content'>, P
9
9
  /**
10
10
  * The content to be displayed inside the menu.
11
11
  */
12
- content: ReactNode;
12
+ children: ReactNode;
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "React UI library with Tailwind CSS",
5
5
  "author": "Dimas Bagus Prayogo Mukti<dimas.bagus.pm@gmail.com>",
6
6
  "license": "MIT",