@dimasbaguspm/versaur 0.0.17 → 0.0.19

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.
Files changed (62) hide show
  1. package/dist/{js → assets}/styles.css +37 -0
  2. package/dist/js/{bottom-sheet-CHRSxXRE.js → bottom-sheet-BRv-oJL-.js} +285 -140
  3. package/dist/js/feedbacks/index.js +1 -1
  4. package/dist/js/{form-layout-Dhlv-FZL.js → form-layout-4ASWdXn8.js} +1 -1
  5. package/dist/js/forms/index.js +15 -16
  6. package/dist/js/{tile-B9bt2AY6.js → image-rectangle-CLU-GVtw.js} +855 -658
  7. package/dist/js/{index-C1uJQB34.js → index-DOdDlCoL.js} +2 -2
  8. package/dist/js/index.js +54 -47
  9. package/dist/js/layouts/index.js +1 -1
  10. package/dist/js/navigation/index.js +1 -1
  11. package/dist/js/overlays/index.js +4 -5
  12. package/dist/js/primitive/index.js +22 -16
  13. package/dist/js/providers/index.js +5 -0
  14. package/dist/js/selectable-multiple-input-CJXfqy1Z.js +1901 -0
  15. package/dist/js/{skeleton-QEyPZAuF.js → skeleton-BNZyaRjo.js} +1 -1
  16. package/dist/js/snackbar-DH8jCh2V.js +50 -0
  17. package/dist/js/{tabs-DYcTvVao.js → tabs-BbOkYchB.js} +1 -1
  18. package/dist/js/use-snackbars-oPoF7J5t.js +94 -0
  19. package/dist/types/feedbacks/loading-indicator/index.d.ts +2 -1
  20. package/dist/types/forms/chip-single-input/index.d.ts +2 -1
  21. package/dist/types/forms/index.d.ts +2 -1
  22. package/dist/types/forms/price-input/index.d.ts +1 -1
  23. package/dist/types/forms/selectable-multiple-input/index.d.ts +2 -0
  24. package/dist/types/forms/selectable-multiple-input/selectable-multiple-input.d.ts +6 -0
  25. package/dist/types/forms/selectable-multiple-input/types.d.ts +18 -0
  26. package/dist/types/forms/selectable-single-input/index.d.ts +2 -0
  27. package/dist/types/forms/selectable-single-input/selectable-single-input.d.ts +6 -0
  28. package/dist/types/forms/selectable-single-input/types.d.ts +18 -0
  29. package/dist/types/forms/switch-input/index.d.ts +2 -3
  30. package/dist/types/forms/time-picker-input/time-picker-input.d.ts +4 -4
  31. package/dist/types/forms/time-picker-input/types.d.ts +2 -38
  32. package/dist/types/index.d.ts +1 -0
  33. package/dist/types/layouts/page-layout/index.d.ts +2 -1
  34. package/dist/types/overlays/menu/index.d.ts +2 -2
  35. package/dist/types/primitive/description-list/description-list.atoms.d.ts +13 -0
  36. package/dist/types/primitive/description-list/description-list.d.ts +6 -0
  37. package/dist/types/primitive/description-list/index.d.ts +2 -0
  38. package/dist/types/primitive/description-list/types.d.ts +46 -0
  39. package/dist/types/primitive/image/base-image.atoms.d.ts +6 -0
  40. package/dist/types/primitive/image/base-image.d.ts +6 -0
  41. package/dist/types/primitive/image/image-circle.d.ts +6 -0
  42. package/dist/types/primitive/image/image-rectangle.d.ts +6 -0
  43. package/dist/types/primitive/image/image-square.d.ts +6 -0
  44. package/dist/types/primitive/image/index.d.ts +5 -0
  45. package/dist/types/primitive/image/types.d.ts +48 -0
  46. package/dist/types/primitive/image/use-image.d.ts +13 -0
  47. package/dist/types/primitive/index.d.ts +2 -0
  48. package/dist/types/providers/index.d.ts +1 -0
  49. package/dist/types/providers/snackbars-provider/index.d.ts +3 -0
  50. package/dist/types/providers/snackbars-provider/provider.d.ts +7 -0
  51. package/dist/types/providers/snackbars-provider/types.d.ts +28 -0
  52. package/dist/types/providers/snackbars-provider/use-snackbars-queue.d.ts +9 -0
  53. package/dist/types/providers/snackbars-provider/use-snackbars.d.ts +4 -0
  54. package/dist/{js → utils}/enforce-subpath-import.js +67 -54
  55. package/package.json +8 -4
  56. package/dist/js/email-input-CVyrFzqL.js +0 -1820
  57. package/dist/js/modal-FqewbVts.js +0 -150
  58. package/dist/types/forms/calculator-input/calculator-input.atoms.d.ts +0 -11
  59. package/dist/types/forms/calculator-input/calculator-input.d.ts +0 -8
  60. package/dist/types/forms/calculator-input/index.d.ts +0 -1
  61. package/dist/types/forms/calculator-input/types.d.ts +0 -51
  62. package/dist/types/forms/time-picker-input/time-picker-input.atoms.d.ts +0 -15
@@ -1,15 +1,15 @@
1
- import { a as d, j as s, c as u } from "./index-C1uJQB34.js";
2
- import p, { createContext as y, useContext as k, forwardRef as m, useCallback as D, useEffect as v, useId as E, useRef as h } from "react";
3
- const j = y(null);
4
- function w() {
5
- const t = k(j);
1
+ import { c as d, j as s, a as u } from "./index-DOdDlCoL.js";
2
+ import y, { createContext as E, useContext as D, forwardRef as f, useCallback as M, useEffect as b, useId as z, useRef as w, useState as V } from "react";
3
+ const N = E(null);
4
+ function g() {
5
+ const t = D(N);
6
6
  if (!t)
7
7
  throw new Error(
8
8
  "Drawer components must be used within a DrawerRoot component"
9
9
  );
10
10
  return t;
11
11
  }
12
- const N = d(
12
+ const R = d(
13
13
  "fixed inset-0 z-50 transition-opacity duration-300 bg-foreground/30 backdrop-blur-md",
14
14
  {
15
15
  variants: {
@@ -22,7 +22,7 @@ const N = d(
22
22
  state: "closed"
23
23
  }
24
24
  }
25
- ), z = d("fixed z-50 shadow-xl flex flex-col", {
25
+ ), S = d("fixed z-50 shadow-xl flex flex-col", {
26
26
  variants: {
27
27
  position: {
28
28
  left: "left-0 top-0 bottom-0 border-r",
@@ -66,7 +66,7 @@ const N = d(
66
66
  variant: "default",
67
67
  tab: !1
68
68
  }
69
- }), S = d("flex-1 overflow-y-auto px-6 py-4", {
69
+ }), F = d("flex-1 overflow-y-auto px-6 py-4", {
70
70
  variants: {
71
71
  variant: {
72
72
  default: "bg-white",
@@ -76,7 +76,7 @@ const N = d(
76
76
  defaultVariants: {
77
77
  variant: "default"
78
78
  }
79
- }), M = d("flex-shrink-0 px-6 py-4 border-t", {
79
+ }), I = d("flex-shrink-0 px-6 py-4 border-t", {
80
80
  variants: {
81
81
  variant: {
82
82
  default: "bg-white border-border",
@@ -91,100 +91,100 @@ const N = d(
91
91
  variant: "default",
92
92
  responsiveFlex: !0
93
93
  }
94
- }), R = p.forwardRef(({ className: t, ...e }, r) => {
95
- const { isOpen: n, onClose: o } = w(), a = () => {
94
+ }), T = y.forwardRef(({ className: t, ...e }, n) => {
95
+ const { isOpen: r, onClose: o } = g(), a = () => {
96
96
  o();
97
97
  };
98
98
  return /* @__PURE__ */ s.jsx(
99
99
  "div",
100
100
  {
101
- ref: r,
101
+ ref: n,
102
102
  onClick: a,
103
103
  className: u(
104
- N({
105
- state: n ? "open" : "closed"
104
+ R({
105
+ state: r ? "open" : "closed"
106
106
  }),
107
107
  t
108
108
  ),
109
109
  ...e
110
110
  }
111
111
  );
112
- }), F = p.forwardRef(
113
- ({ children: t, className: e, hasTab: r, ...n }, o) => {
114
- const { variant: a } = w();
112
+ }), L = y.forwardRef(
113
+ ({ children: t, className: e, hasTab: n, ...r }, o) => {
114
+ const { variant: a } = g();
115
115
  return /* @__PURE__ */ s.jsx(
116
116
  "div",
117
117
  {
118
118
  ref: o,
119
119
  className: u(
120
- C({ variant: a, tab: !!r }),
120
+ C({ variant: a, tab: !!n }),
121
121
  e
122
122
  ),
123
- ...n,
123
+ ...r,
124
124
  children: t
125
125
  }
126
126
  );
127
127
  }
128
- ), I = m(
129
- ({ children: t, className: e, ...r }, n) => /* @__PURE__ */ s.jsx("div", { ref: n, className: u("[&>div]:px-6", e), ...r, children: t })
130
- ), L = p.forwardRef(
131
- ({ children: t, className: e, ...r }, n) => {
132
- const { variant: o } = w();
128
+ ), A = f(
129
+ ({ children: t, className: e, ...n }, r) => /* @__PURE__ */ s.jsx("div", { ref: r, className: u("[&>div]:px-6", e), ...n, children: t })
130
+ ), H = y.forwardRef(
131
+ ({ children: t, className: e, ...n }, r) => {
132
+ const { variant: o } = g();
133
133
  return /* @__PURE__ */ s.jsx(
134
134
  "div",
135
135
  {
136
- ref: n,
137
- className: u(S({ variant: o }), e),
138
- ...r,
136
+ ref: r,
137
+ className: u(F({ variant: o }), e),
138
+ ...n,
139
139
  children: t
140
140
  }
141
141
  );
142
142
  }
143
- ), H = p.forwardRef(
144
- ({ children: t, className: e, responsiveFlex: r = !0, ...n }, o) => {
145
- const { variant: a } = w();
143
+ ), q = y.forwardRef(
144
+ ({ children: t, className: e, responsiveFlex: n = !0, ...r }, o) => {
145
+ const { variant: a } = g();
146
146
  return /* @__PURE__ */ s.jsx(
147
147
  "div",
148
148
  {
149
149
  ref: o,
150
150
  className: u(
151
- M({ variant: a, responsiveFlex: r }),
151
+ I({ variant: a, responsiveFlex: n }),
152
152
  e
153
153
  ),
154
- ...n,
154
+ ...r,
155
155
  children: t
156
156
  }
157
157
  );
158
158
  }
159
- ), T = ({
159
+ ), K = ({
160
160
  children: t,
161
161
  isOpen: e,
162
- onClose: r,
163
- position: n = "right",
162
+ onClose: n,
163
+ position: r = "right",
164
164
  size: o = "md",
165
165
  variant: a = "default",
166
166
  transitionType: i = "slide",
167
167
  className: l,
168
- ...b
168
+ ...x
169
169
  }) => {
170
- const c = D(() => {
171
- r(!1);
172
- }, [r]), x = {
170
+ const c = M(() => {
171
+ n(!1);
172
+ }, [n]), v = {
173
173
  isOpen: e,
174
174
  onClose: c,
175
- position: n,
175
+ position: r,
176
176
  size: o,
177
177
  variant: a,
178
178
  transitionType: i
179
179
  };
180
- return v(() => {
181
- const f = (B) => {
182
- B.key === "Escape" && e && c();
180
+ return b(() => {
181
+ const m = (p) => {
182
+ p.key === "Escape" && e && c();
183
183
  };
184
- return e && (document.addEventListener("keydown", f), document.body.style.overflow = "hidden"), () => {
185
- document.removeEventListener("keydown", f), document.body.style.overflow = "unset";
184
+ return e && (document.addEventListener("keydown", m), document.body.style.overflow = "hidden"), () => {
185
+ document.removeEventListener("keydown", m), document.body.style.overflow = "unset";
186
186
  };
187
- }, [e, c]), /* @__PURE__ */ s.jsx(j.Provider, { value: x, children: /* @__PURE__ */ s.jsxs(
187
+ }, [e, c]), /* @__PURE__ */ s.jsx(N.Provider, { value: v, children: /* @__PURE__ */ s.jsxs(
188
188
  "div",
189
189
  {
190
190
  className: u(
@@ -192,46 +192,46 @@ const N = d(
192
192
  e && "pointer-events-auto"
193
193
  ),
194
194
  children: [
195
- /* @__PURE__ */ s.jsx(R, {}),
195
+ /* @__PURE__ */ s.jsx(T, {}),
196
196
  /* @__PURE__ */ s.jsx(
197
197
  "div",
198
198
  {
199
199
  role: e ? "dialog" : void 0,
200
200
  "aria-modal": e ? "true" : void 0,
201
201
  className: u(
202
- z({
203
- position: n,
202
+ S({
203
+ position: r,
204
204
  size: o,
205
205
  variant: a,
206
206
  transitionType: i
207
207
  }),
208
208
  i === "slide" ? [
209
- !e && n === "left" && "-translate-x-full",
210
- !e && n === "right" && "translate-x-full"
209
+ !e && r === "left" && "-translate-x-full",
210
+ !e && r === "right" && "translate-x-full"
211
211
  ] : [
212
212
  "left-0 right-0 top-0 bottom-0",
213
213
  e ? "opacity-100" : "opacity-0 pointer-events-none"
214
214
  ],
215
215
  l
216
216
  ),
217
- ...b,
217
+ ...x,
218
218
  children: e && t
219
219
  }
220
220
  )
221
221
  ]
222
222
  }
223
223
  ) });
224
- }, se = Object.assign(T, {
225
- Header: F,
226
- Tab: I,
227
- Body: L,
228
- Footer: H
229
- }), V = y(null), g = () => {
230
- const t = k(V);
224
+ }, ye = Object.assign(K, {
225
+ Header: L,
226
+ Tab: A,
227
+ Body: H,
228
+ Footer: q
229
+ }), B = E(null), k = () => {
230
+ const t = D(B);
231
231
  if (!t)
232
232
  throw new Error("useMenuContext must be used within a Menu component");
233
233
  return t;
234
- }, A = d(
234
+ }, _ = d(
235
235
  "z-30 min-w-40 bg-background text-black rounded-lg border border-border",
236
236
  {
237
237
  variants: {
@@ -249,7 +249,7 @@ const N = d(
249
249
  size: "md"
250
250
  }
251
251
  }
252
- ), q = d(
252
+ ), $ = d(
253
253
  "w-full text-left px-4 rounded-sm cursor-pointer transition-colors duration-150 select-none hover:bg-background-light outline-none border border-transparent focus-visible:border-primary-light disabled:opacity-50 disabled:cursor-not-allowed",
254
254
  {
255
255
  variants: {
@@ -262,43 +262,43 @@ const N = d(
262
262
  size: "md"
263
263
  }
264
264
  }
265
- ), K = m(
266
- ({ children: t, ...e }, r) => {
267
- const { open: n, triggerRef: o } = g();
265
+ ), P = f(
266
+ ({ children: t, ...e }, n) => {
267
+ const { open: r, triggerRef: o } = k();
268
268
  return /* @__PURE__ */ s.jsx(
269
269
  "span",
270
270
  {
271
271
  ref: (a) => {
272
- o.current = a, typeof r == "function" ? r(a) : r && (r.current = a);
272
+ o.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
273
273
  },
274
274
  "aria-haspopup": "menu",
275
- "aria-expanded": n,
275
+ "aria-expanded": r,
276
276
  "aria-controls": "menu-content",
277
277
  ...e,
278
278
  children: t
279
279
  }
280
280
  );
281
281
  }
282
- ), P = m(
283
- ({ children: t, className: e, ...r }, n) => {
284
- const { open: o, contentRef: a, triggerRef: i, size: l } = g(), b = E();
285
- let c = 0, x = 0;
282
+ ), U = f(
283
+ ({ children: t, className: e, ...n }, r) => {
284
+ const { open: o, contentRef: a, triggerRef: i, size: l } = k(), x = z();
285
+ let c = 0, v = 0;
286
286
  if (i.current) {
287
- const f = i.current.getBoundingClientRect();
288
- c = f.bottom + window.scrollY + 4, x = f.left + window.scrollX;
287
+ const m = i.current.getBoundingClientRect();
288
+ c = m.bottom + window.scrollY + 4, v = m.left + window.scrollX;
289
289
  }
290
290
  return /* @__PURE__ */ s.jsx(
291
291
  "div",
292
292
  {
293
- ref: (f) => {
294
- a.current = f, typeof n == "function" ? n(f) : n && (n.current = f);
293
+ ref: (m) => {
294
+ a.current = m, typeof r == "function" ? r(m) : r && (r.current = m);
295
295
  },
296
- id: `menu-content-${b}`,
296
+ id: `menu-content-${x}`,
297
297
  role: "menu",
298
298
  tabIndex: -1,
299
299
  "aria-hidden": !o,
300
300
  className: u(
301
- A({
301
+ _({
302
302
  size: l
303
303
  }),
304
304
  "absolute z-50 transition-opacity duration-150 ease-out",
@@ -308,16 +308,16 @@ const N = d(
308
308
  style: {
309
309
  minWidth: i.current?.offsetWidth,
310
310
  top: c,
311
- left: x
311
+ left: v
312
312
  },
313
- ...r,
313
+ ...n,
314
314
  children: o && t
315
315
  }
316
316
  );
317
317
  }
318
- ), W = m(
319
- ({ children: t, disabled: e, className: r, ...n }, o) => {
320
- const { size: a } = g();
318
+ ), W = f(
319
+ ({ children: t, disabled: e, className: n, ...r }, o) => {
320
+ const { size: a } = k();
321
321
  return /* @__PURE__ */ s.jsx(
322
322
  "button",
323
323
  {
@@ -327,66 +327,210 @@ const N = d(
327
327
  disabled: e,
328
328
  "aria-disabled": e,
329
329
  className: u(
330
- q({
330
+ $({
331
331
  size: a
332
332
  }),
333
- r
333
+ n
334
334
  ),
335
- ...n,
335
+ ...r,
336
336
  children: t
337
337
  }
338
338
  );
339
339
  }
340
340
  );
341
- function _(t, e, r, n) {
342
- v(() => {
341
+ function X(t, e, n, r) {
342
+ b(() => {
343
343
  if (!t) return;
344
344
  function o(a) {
345
- !e.current?.contains(a.target) && !r.current?.contains(a.target) && n();
345
+ !e.current?.contains(a.target) && !n.current?.contains(a.target) && r();
346
346
  }
347
347
  return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
348
- }, [t, n, e, r]);
348
+ }, [t, r, e, n]);
349
349
  }
350
- function U(t, e) {
351
- v(() => {
350
+ function Y(t, e) {
351
+ b(() => {
352
352
  if (t && e.current) {
353
- const r = e.current.querySelectorAll('[role="menuitem"]');
354
- r.length && r[0].focus();
353
+ const n = e.current.querySelectorAll('[role="menuitem"]');
354
+ n.length && n[0].focus();
355
355
  }
356
356
  }, [t, e]);
357
357
  }
358
- function X(t, e, r, n) {
359
- v(() => {
358
+ function G(t, e, n, r) {
359
+ b(() => {
360
360
  if (!t || !e.current) return;
361
361
  const o = e.current;
362
362
  function a(i) {
363
363
  const l = Array.from(
364
364
  o.querySelectorAll('[role="menuitem"]')
365
- ), b = document.activeElement, c = l.indexOf(b);
366
- i.key === "ArrowDown" ? (i.preventDefault(), l.length && l[(c + 1) % l.length].focus()) : i.key === "ArrowUp" ? (i.preventDefault(), l.length && l[(c - 1 + l.length) % l.length].focus()) : i.key === "Home" ? (i.preventDefault(), l.length && l[0].focus()) : i.key === "End" ? (i.preventDefault(), l.length && l[l.length - 1].focus()) : i.key === "Escape" && (i.preventDefault(), n(), r.current?.focus());
365
+ ), x = document.activeElement, c = l.indexOf(x);
366
+ i.key === "ArrowDown" ? (i.preventDefault(), l.length && l[(c + 1) % l.length].focus()) : i.key === "ArrowUp" ? (i.preventDefault(), l.length && l[(c - 1 + l.length) % l.length].focus()) : i.key === "Home" ? (i.preventDefault(), l.length && l[0].focus()) : i.key === "End" ? (i.preventDefault(), l.length && l[l.length - 1].focus()) : i.key === "Escape" && (i.preventDefault(), r(), n.current?.focus());
367
367
  }
368
368
  return o.addEventListener("keydown", a), () => o.removeEventListener("keydown", a);
369
- }, [t, n, e, r]);
369
+ }, [t, r, e, n]);
370
370
  }
371
- const Y = ({
371
+ const J = ({
372
372
  children: t,
373
373
  isOpen: e,
374
- onOutsideClick: r,
375
- size: n = "md"
374
+ onOutsideClick: n,
375
+ size: r = "md"
376
376
  }) => {
377
- const o = h(null), a = h(null);
378
- return _(e, a, o, r), U(e, a), X(e, a, o, r), /* @__PURE__ */ s.jsx(
379
- V.Provider,
377
+ const o = w(null), a = w(null);
378
+ return X(e, a, o, n), Y(e, a), G(e, a, o, n), /* @__PURE__ */ s.jsx(
379
+ B.Provider,
380
380
  {
381
- value: { open: e, triggerRef: o, contentRef: a, size: n },
381
+ value: { open: e, triggerRef: o, contentRef: a, size: r },
382
382
  children: t
383
383
  }
384
384
  );
385
- }, ie = Object.assign(Y, {
386
- Trigger: K,
387
- Content: P,
385
+ }, ge = Object.assign(J, {
386
+ Trigger: P,
387
+ Content: U,
388
388
  Item: W
389
- }), $ = d(
389
+ }), Q = f(
390
+ ({ className: t, ...e }, n) => /* @__PURE__ */ s.jsx(
391
+ "div",
392
+ {
393
+ ref: n,
394
+ className: u("px-6 pt-6 pb-2 text-lg font-semibold", t),
395
+ ...e
396
+ }
397
+ )
398
+ ), Z = f(
399
+ ({ className: t, ...e }, n) => /* @__PURE__ */ s.jsx(
400
+ "div",
401
+ {
402
+ ref: n,
403
+ className: u("px-6 py-4 flex justify-end gap-2", t),
404
+ ...e
405
+ }
406
+ )
407
+ ), O = f(
408
+ ({ className: t, ...e }, n) => /* @__PURE__ */ s.jsx("div", { ref: n, className: u("px-6 py-2", t), ...e })
409
+ ), ee = f(
410
+ ({ onOverlayClick: t, ...e }, n) => /* @__PURE__ */ s.jsx(
411
+ "div",
412
+ {
413
+ ref: n,
414
+ role: "presentation",
415
+ tabIndex: -1,
416
+ "aria-modal": "true",
417
+ onClick: t,
418
+ ...e
419
+ }
420
+ )
421
+ ), te = d(
422
+ "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",
423
+ {
424
+ variants: {
425
+ placement: {
426
+ top: "items-start",
427
+ center: "items-center"
428
+ }
429
+ },
430
+ defaultVariants: {
431
+ placement: "center"
432
+ }
433
+ }
434
+ ), ne = d(
435
+ [
436
+ "bg-white rounded-lg shadow-xl relative",
437
+ "flex flex-col",
438
+ "outline-none",
439
+ "mx-4",
440
+ "transition-all duration-200 ease-in-out "
441
+ ],
442
+ {
443
+ variants: {
444
+ size: {
445
+ sm: "w-[20rem] max-w-sm",
446
+ // 20rem, 320px
447
+ md: "w-[28rem] max-w-md",
448
+ // 28rem, 448px
449
+ lg: "w-[36rem] max-w-lg",
450
+ // 36rem, 576px
451
+ "fit-content": "w-fit max-w-full"
452
+ // Fit content, no max width
453
+ },
454
+ placement: {
455
+ top: "mt-4",
456
+ center: ""
457
+ }
458
+ },
459
+ defaultVariants: {
460
+ size: "md",
461
+ placement: "center"
462
+ }
463
+ }
464
+ );
465
+ function re(t, e) {
466
+ b(() => {
467
+ if (e && t.current) {
468
+ const n = t.current.querySelectorAll(
469
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
470
+ );
471
+ n.length && n[0].focus();
472
+ }
473
+ }, [e, t]);
474
+ }
475
+ function oe(t, e) {
476
+ b(() => {
477
+ if (!t) return;
478
+ const n = (r) => {
479
+ r.key === "Escape" && e();
480
+ };
481
+ return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
482
+ }, [t, e]);
483
+ }
484
+ const ae = 200, se = ({
485
+ isOpen: t,
486
+ onOpenChange: e,
487
+ size: n = "md",
488
+ placement: r = "center",
489
+ children: o,
490
+ disableOverlayClose: a,
491
+ disableEscClose: i,
492
+ ...l
493
+ }) => {
494
+ const x = w(null), c = w(null), [v, m] = V(t), [p, h] = V(!1);
495
+ return b(() => {
496
+ if (t)
497
+ m(!0), h(!1), x.current = document.activeElement;
498
+ else if (v) {
499
+ h(!0);
500
+ const j = setTimeout(() => {
501
+ m(!1), h(!1), x.current && x.current.focus();
502
+ }, ae);
503
+ return () => clearTimeout(j);
504
+ }
505
+ }, [t]), oe(t && !i, () => {
506
+ e && e(!1);
507
+ }), re(c, t), /* @__PURE__ */ s.jsx(
508
+ ee,
509
+ {
510
+ ref: c,
511
+ className: `${te({ placement: r })} transition-opacity duration-200 ease-in-out ` + (t && !p ? "opacity-100" : "opacity-0 pointer-events-none"),
512
+ onOverlayClick: (j) => {
513
+ j.target === c.current && !a && e && e(!1);
514
+ },
515
+ placement: r,
516
+ children: /* @__PURE__ */ s.jsx(
517
+ "div",
518
+ {
519
+ className: `${ne({ size: n, placement: r })} transition-all duration-200 ease-in-out ` + (t && !p ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"),
520
+ role: "dialog",
521
+ ...l,
522
+ tabIndex: 0,
523
+ "aria-hidden": !t,
524
+ children: o
525
+ }
526
+ )
527
+ }
528
+ );
529
+ }, he = Object.assign(se, {
530
+ Header: Q,
531
+ Body: O,
532
+ Footer: Z
533
+ }), ie = d(
390
534
  [
391
535
  "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",
392
536
  "transition-transform duration-300 ease-in-out will-change-transform"
@@ -402,7 +546,7 @@ const Y = ({
402
546
  open: !1
403
547
  }
404
548
  }
405
- ), G = d(
549
+ ), le = d(
406
550
  ["fixed inset-0 z-40 duration-300"],
407
551
  {
408
552
  variants: {
@@ -415,56 +559,56 @@ const Y = ({
415
559
  open: !1
416
560
  }
417
561
  }
418
- ), J = d("px-4 pt-4 pb-2"), Q = d("px-4 py-2"), Z = d("px-4 pt-2 pb-4"), O = m(function({ className: e, ...r }, n) {
562
+ ), de = d("px-4 pt-4 pb-2"), ce = d("px-4 py-2"), ue = d("px-4 pt-2 pb-4"), fe = f(function({ className: e, ...n }, r) {
419
563
  return /* @__PURE__ */ s.jsx(
420
564
  "h2",
421
565
  {
422
- ref: n,
566
+ ref: r,
423
567
  className: ["text-lg font-semibold text-foreground", e].filter(Boolean).join(" "),
424
- ...r
568
+ ...n
425
569
  }
426
570
  );
427
- }), ee = m(({ className: t, ...e }, r) => /* @__PURE__ */ s.jsx(
571
+ }), me = f(({ className: t, ...e }, n) => /* @__PURE__ */ s.jsx(
428
572
  "div",
429
573
  {
430
- ref: r,
431
- className: J({ className: t }),
574
+ ref: n,
575
+ className: de({ className: t }),
432
576
  ...e
433
577
  }
434
- )), te = m(
435
- ({ className: t, ...e }, r) => /* @__PURE__ */ s.jsx(
578
+ )), xe = f(
579
+ ({ className: t, ...e }, n) => /* @__PURE__ */ s.jsx(
436
580
  "div",
437
581
  {
438
- ref: r,
439
- className: Q({ className: t }),
582
+ ref: n,
583
+ className: ce({ className: t }),
440
584
  ...e
441
585
  }
442
586
  )
443
- ), re = m(({ className: t, ...e }, r) => /* @__PURE__ */ s.jsx(
587
+ ), be = f(({ className: t, ...e }, n) => /* @__PURE__ */ s.jsx(
444
588
  "div",
445
589
  {
446
- ref: r,
447
- className: Z({ className: t }),
590
+ ref: n,
591
+ className: ue({ className: t }),
448
592
  ...e
449
593
  }
450
- )), ne = m(
451
- ({ isOpen: t, children: e, className: r, onClose: n, ...o }, a) => {
452
- v(() => {
453
- const l = (b) => {
454
- b.key === "Escape" && t && n();
594
+ )), ve = f(
595
+ ({ isOpen: t, children: e, className: n, onClose: r, ...o }, a) => {
596
+ b(() => {
597
+ const l = (x) => {
598
+ x.key === "Escape" && t && r();
455
599
  };
456
600
  return t && (document.addEventListener("keydown", l), document.body.style.overflow = "hidden"), () => {
457
601
  document.removeEventListener("keydown", l), document.body.style.overflow = "unset";
458
602
  };
459
- }, [t, n]);
603
+ }, [t, r]);
460
604
  const i = () => {
461
- n?.();
605
+ r?.();
462
606
  };
463
607
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
464
608
  /* @__PURE__ */ s.jsx(
465
609
  "div",
466
610
  {
467
- className: G({ open: t }),
611
+ className: le({ open: t }),
468
612
  "aria-hidden": "true",
469
613
  onClick: i
470
614
  }
@@ -474,10 +618,10 @@ const Y = ({
474
618
  {
475
619
  ref: a,
476
620
  className: u(
477
- $({
621
+ ie({
478
622
  open: t
479
623
  }),
480
- r
624
+ n
481
625
  ),
482
626
  role: "dialog",
483
627
  "aria-modal": "true",
@@ -488,14 +632,15 @@ const Y = ({
488
632
  )
489
633
  ] });
490
634
  }
491
- ), le = Object.assign(ne, {
492
- Header: ee,
493
- Title: O,
494
- Body: te,
495
- Footer: re
635
+ ), je = Object.assign(ve, {
636
+ Header: me,
637
+ Title: fe,
638
+ Body: xe,
639
+ Footer: be
496
640
  });
497
641
  export {
498
- le as B,
499
- se as D,
500
- ie as M
642
+ je as B,
643
+ ye as D,
644
+ ge as M,
645
+ he as a
501
646
  };