@versini/ui-panel 2.0.4 → 2.0.6

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,6 +1,787 @@
1
- import "react/jsx-runtime";
2
- import { Panel as t } from "../../index.js";
3
- import "react";
1
+ import { jsx as l, jsxs as T, Fragment as J } from "react/jsx-runtime";
2
+ import * as f from "react";
3
+ import z, { useRef as I, useLayoutEffect as G, useEffect as B, useState as K, useMemo as Q, useCallback as ue, useId as Z } from "react";
4
+ import n from "clsx";
5
+ import { useFloating as me, useClick as ge, useDismiss as he, useRole as fe, useInteractions as be, useMergeRefs as ve, FloatingPortal as ye, FloatingOverlay as pe, FloatingFocusManager as ke } from "@floating-ui/react";
6
+ const Y = "av-messagebox", H = "av-panel", W = "av-button", F = "icon", ee = "button", $ = "link", xe = ({
7
+ type: e,
8
+ size: t,
9
+ labelRight: r,
10
+ labelLeft: a,
11
+ align: o,
12
+ animated: i
13
+ }) => {
14
+ const c = "max-h-8 py-0 px-2", u = "max-h-9 h-8 px-3", s = "max-h-12 py-2 px-4";
15
+ switch (e) {
16
+ case ee:
17
+ case $:
18
+ return n({
19
+ [c]: t === "small",
20
+ [u]: t === "medium",
21
+ [s]: t === "large"
22
+ });
23
+ case F:
24
+ return n("flex items-center", {
25
+ "justify-center": o === "center",
26
+ "justify-start": o === "left",
27
+ "justify-end": o === "right",
28
+ "h-6 w-6 p-0": t === "small" && !i && !(r || a),
29
+ "h-6 px-2": t === "small" && !i && (r || a),
30
+ "h-8 w-8 p-1": t === "medium" && !i && !(r || a),
31
+ "h-8 px-3": t === "medium" && !i && (r || a),
32
+ "h-12 w-12 p-2": t === "large" && !i && !(r || a),
33
+ "h-12 px-4": t === "large" && !i && (r || a),
34
+ "h-6 py-0": t === "small" && i && !(r || a),
35
+ "h-6": t === "small" && i && (r || a),
36
+ "h-8 py-1": t === "medium" && i && !(r || a),
37
+ "h-8": t === "medium" && i && (r || a),
38
+ "h-12 py-2": t === "large" && i && !(r || a),
39
+ "h-12": t === "large" && i && (r || a)
40
+ });
41
+ }
42
+ }, we = ({
43
+ type: e,
44
+ size: t,
45
+ labelRight: r,
46
+ labelLeft: a
47
+ }) => {
48
+ const o = "text-sm font-medium", i = "text-base font-medium", c = "text-lg font-medium";
49
+ switch (e) {
50
+ case ee:
51
+ case $:
52
+ return n({
53
+ "text-center": e === $,
54
+ [o]: t === "small",
55
+ [i]: t === "medium",
56
+ [c]: t === "large"
57
+ });
58
+ case F:
59
+ return n({
60
+ [o]: t === "small" && (r || a),
61
+ [i]: t === "medium" && (r || a),
62
+ [c]: t === "large" && (r || a)
63
+ });
64
+ }
65
+ }, Ie = ({
66
+ mode: e,
67
+ noBackground: t,
68
+ truncate: r,
69
+ variant: a
70
+ }) => {
71
+ if (t)
72
+ return "not-prose";
73
+ if (a === "primary")
74
+ return n("not-prose", {
75
+ truncate: r,
76
+ "text-copy-light": e === "dark" || e === "system",
77
+ "text-copy-lighter": e === "light" || e === "alt-system",
78
+ "dark:text-copy-lighter": e === "system",
79
+ "dark:text-copy-light": e === "alt-system"
80
+ });
81
+ if (a === "secondary")
82
+ return n("not-prose", {
83
+ truncate: r,
84
+ "text-copy-light": e === "light" || e === "system",
85
+ "text-copy-lighter": e === "dark" || e === "alt-system",
86
+ "dark:text-copy-lighter": e === "alt-system",
87
+ "dark:text-copy-light": e === "system"
88
+ });
89
+ if (a === "danger")
90
+ return n("not-prose", {
91
+ truncate: r,
92
+ "text-copy-light": e === "dark" || e === "system",
93
+ "text-copy-lighter": e === "light" || e === "alt-system",
94
+ "dark:text-copy-lighter": e === "system",
95
+ "dark:text-copy-light": e === "alt-system"
96
+ });
97
+ if (a === "selected")
98
+ return n("not-prose text-copy-lighter", {
99
+ truncate: r
100
+ });
101
+ }, _e = ({
102
+ mode: e,
103
+ noBackground: t,
104
+ variant: r
105
+ }) => {
106
+ if (!t) {
107
+ if (r === "primary")
108
+ return n({
109
+ "bg-action-dark": e === "dark",
110
+ "bg-action-light": e === "light",
111
+ "bg-action-dark dark:bg-action-light": e === "system",
112
+ "bg-action-light dark:bg-action-dark": e === "alt-system"
113
+ });
114
+ if (r === "secondary")
115
+ return n({
116
+ "bg-action-dark": e === "light",
117
+ "bg-action-light": e === "dark",
118
+ "bg-action-dark dark:bg-action-light": e === "alt-system",
119
+ "bg-action-light dark:bg-action-dark": e === "system"
120
+ });
121
+ if (r === "danger")
122
+ return n({
123
+ "bg-action-danger-dark": e === "dark",
124
+ "bg-action-danger-light": e === "light",
125
+ "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
126
+ "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
127
+ });
128
+ if (r === "selected")
129
+ return "bg-action-selected-dark";
130
+ }
131
+ }, Ne = ({
132
+ radius: e
133
+ }) => n({
134
+ "rounded-full": e === "large",
135
+ "rounded-md": e === "medium",
136
+ "rounded-xs": e === "small"
137
+ }), Ee = ({
138
+ mode: e,
139
+ disabled: t,
140
+ variant: r
141
+ }) => {
142
+ if (t)
143
+ return "";
144
+ if (r === "primary")
145
+ return n("hover:text-copy-light-hover", {
146
+ "hover:bg-action-dark-hover": e === "dark",
147
+ "hover:bg-action-light-hover": e === "light",
148
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
149
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
150
+ });
151
+ if (r === "secondary")
152
+ return n("hover:text-copy-light-hover", {
153
+ "hover:bg-action-dark-hover": e === "light",
154
+ "hover:bg-action-light-hover": e === "dark",
155
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
156
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
157
+ });
158
+ if (r === "danger")
159
+ return n("hover:text-copy-light-hover", {
160
+ "hover:bg-action-danger-dark-hover": e === "dark",
161
+ "hover:bg-action-danger-light-hover": e === "light",
162
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
163
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
164
+ });
165
+ if (r === "selected")
166
+ return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
167
+ }, Ce = ({
168
+ mode: e,
169
+ disabled: t,
170
+ variant: r
171
+ }) => {
172
+ if (t)
173
+ return "";
174
+ if (r === "primary")
175
+ return n("active:text-copy-light-active", {
176
+ "active:bg-action-dark-active": e === "dark",
177
+ "active:bg-action-light-active": e === "light",
178
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
179
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
180
+ });
181
+ if (r === "secondary")
182
+ return n("active:text-copy-light-active", {
183
+ "active:bg-action-dark-active": e === "light",
184
+ "active:bg-action-light-active": e === "dark",
185
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
186
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
187
+ });
188
+ if (r === "danger")
189
+ return n("active:text-copy-lighter-active", {
190
+ "active:bg-action-danger-dark-active": e === "dark",
191
+ "active:bg-action-danger-light-active": e === "light",
192
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
193
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
194
+ });
195
+ if (r === "selected")
196
+ return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
197
+ }, Be = ({
198
+ mode: e,
199
+ noBorder: t,
200
+ variant: r
201
+ }) => {
202
+ if (t)
203
+ return "border border-transparent";
204
+ if (r === "primary")
205
+ return n("border", {
206
+ "border-border-dark": e === "dark",
207
+ "border-border-accent": e === "light",
208
+ "border-border-dark dark:border-border-accent": e === "system",
209
+ "border-border-accent dark:border-border-dark": e === "alt-system"
210
+ });
211
+ if (r === "secondary")
212
+ return n("border", {
213
+ "border-border-dark": e === "light",
214
+ "border-border-accent": e === "dark",
215
+ "border-border-dark dark:border-border-accent": e === "alt-system",
216
+ "border-border-accent dark:border-border-dark": e === "system"
217
+ });
218
+ if (r === "danger")
219
+ return n("border", {
220
+ "border-border-danger-dark": e === "dark",
221
+ "border-border-danger-medium": e === "light",
222
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
223
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
224
+ });
225
+ if (r === "selected")
226
+ return "border border-border-selected-dark";
227
+ }, Se = ({
228
+ focusMode: e
229
+ }) => n("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
230
+ "focus:outline-focus-dark": e === "dark",
231
+ "focus:outline-focus-light": e === "light",
232
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
233
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
234
+ }), Re = ({
235
+ mode: e,
236
+ raw: t,
237
+ iconClassName: r
238
+ }) => t ? "" : n(
239
+ {
240
+ "text-copy-accent-dark": e === "light" || e === "alt-system",
241
+ "text-copy-light": e === "dark" || e === "system",
242
+ "dark:text-copy-light": e === "alt-system",
243
+ "dark:text-copy-accent-dark": e === "system"
244
+ },
245
+ r
246
+ ), Me = ({
247
+ animated: e
248
+ }) => n({
249
+ "transition-opacity duration-300 ease-in-out": e
250
+ }), Te = ({
251
+ type: e,
252
+ className: t,
253
+ raw: r,
254
+ mode: a,
255
+ focusMode: o,
256
+ disabled: i,
257
+ fullWidth: c,
258
+ size: u,
259
+ noBorder: s,
260
+ labelRight: g,
261
+ labelLeft: b,
262
+ noBackground: m,
263
+ variant: d,
264
+ truncate: h,
265
+ align: x,
266
+ radius: E,
267
+ animated: w
268
+ }) => (d || (d = "primary"), r ? n(W, t) : n(
269
+ W,
270
+ Ie({
271
+ mode: a,
272
+ variant: d,
273
+ noBackground: m,
274
+ truncate: h
275
+ }),
276
+ _e({ mode: a, noBackground: m, variant: d }),
277
+ Ne({ radius: E }),
278
+ xe({
279
+ type: e,
280
+ size: u,
281
+ labelRight: g,
282
+ labelLeft: b,
283
+ align: x,
284
+ animated: w
285
+ }),
286
+ we({ type: e, size: u, labelRight: g, labelLeft: b }),
287
+ Be({ mode: a, variant: d, noBorder: s }),
288
+ Se({ focusMode: o }),
289
+ Ee({ mode: a, variant: d, disabled: i }),
290
+ Ce({ mode: a, variant: d, disabled: i }),
291
+ {
292
+ "w-full": c,
293
+ "disabled:cursor-not-allowed disabled:opacity-50": i
294
+ },
295
+ n({
296
+ "transition-[width] duration-300 ease-in": w
297
+ }),
298
+ t
299
+ )), Le = (e, t, r) => {
300
+ var a;
301
+ !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
302
+ }, re = z.forwardRef((e, t) => {
303
+ const { onClick: r, noInternalClick: a = !1, ...o } = e;
304
+ return /* @__PURE__ */ l(
305
+ "button",
306
+ {
307
+ ref: t,
308
+ onClick: (i) => {
309
+ Le(i, a, r);
310
+ },
311
+ ...o
312
+ }
313
+ );
314
+ });
315
+ re.displayName = "BaseButton";
316
+ function Oe() {
317
+ const e = I(!1);
318
+ return B(() => (e.current = !0, () => {
319
+ e.current = !1;
320
+ }), []), ue(() => e.current, []);
321
+ }
322
+ function Ae(e) {
323
+ return Q(() => e.every((t) => t == null) ? () => {
324
+ } : (t) => {
325
+ e.forEach((r) => {
326
+ typeof r == "function" ? r(t) : r != null && (r.current = t);
327
+ });
328
+ }, e);
329
+ }
330
+ const Pe = {
331
+ x: 0,
332
+ y: 0,
333
+ width: 0,
334
+ height: 0,
335
+ top: 0,
336
+ left: 0,
337
+ bottom: 0,
338
+ right: 0
339
+ };
340
+ function D(e) {
341
+ const t = Oe(), r = I(0), a = I(null), [o, i] = K(Pe), c = Q(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((u) => {
342
+ const s = u[0];
343
+ s && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
344
+ a.current && t() && i(s.contentRect);
345
+ }));
346
+ }), [t]);
347
+ return B(() => (a.current && (c == null || c.observe(a.current, e)), () => {
348
+ c == null || c.disconnect(), r.current && cancelAnimationFrame(r.current);
349
+ }), [c, e]), [a, o];
350
+ }
351
+ const R = {
352
+ small: 24,
353
+ // w-6
354
+ medium: 32,
355
+ // w-8
356
+ large: 48
357
+ // w-12
358
+ }, De = {
359
+ small: 8 * 2,
360
+ // px-2 x 2
361
+ medium: 12 * 2,
362
+ // px-3 x 2
363
+ large: 16 * 2
364
+ // px-4 x 2
365
+ }, $e = 2, ze = 300, V = z.forwardRef(
366
+ ({
367
+ children: e,
368
+ disabled: t = !1,
369
+ mode: r = "system",
370
+ focusMode: a = "system",
371
+ fullWidth: o = !1,
372
+ className: i,
373
+ type: c = "button",
374
+ raw: u = !1,
375
+ noBorder: s = !1,
376
+ "aria-label": g,
377
+ label: b,
378
+ size: m = "medium",
379
+ labelRight: d,
380
+ labelLeft: h,
381
+ noBackground: x = !1,
382
+ align: E = "center",
383
+ radius: w = "large",
384
+ variant: ae = "primary",
385
+ iconClassName: ie,
386
+ animated: p = !1,
387
+ ...oe
388
+ }, ne) => {
389
+ const le = Te({
390
+ type: F,
391
+ mode: r,
392
+ focusMode: a,
393
+ fullWidth: o,
394
+ disabled: t,
395
+ raw: u,
396
+ className: i,
397
+ noBorder: s,
398
+ size: m,
399
+ labelRight: d,
400
+ labelLeft: h,
401
+ noBackground: x,
402
+ align: E,
403
+ radius: w,
404
+ variant: ae,
405
+ animated: p
406
+ }), ce = Re({ mode: r, raw: u, iconClassName: ie }), U = Me({ animated: p }), se = "flex items-center justify-center relative w-full h-full overflow-hidden", [v, O] = D(), [y, A] = D(), [S, j] = D(), P = I(0), k = I(null), _ = I(null), de = Ae([ne, k]);
407
+ return G(() => {
408
+ S && S.current && p && (P.current = j.width + De[m] + (s ? 0 : $e), k.current && !k.current.style.width && (k.current.style.width = `${R[m]}px`));
409
+ }, [j, S, m, s, p]), G(() => {
410
+ if (k && k.current && p) {
411
+ let N = R[m];
412
+ d && v && O.width > 0 ? N = O.width + P.current : h && y && A.width > 0 && (N = A.width + P.current), _.current && clearTimeout(_.current), N !== parseInt(k.current.style.width || "0", 10) && (v.current && (v.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"), k.current.style.width = `${N}px`, N > R[m] && (_.current = setTimeout(() => {
413
+ v.current && d && (v.current.style.opacity = "1"), y.current && h && (y.current.style.opacity = "1"), _.current = null;
414
+ }, ze * 0.8))), N === R[m] && (v.current && (v.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"));
415
+ }
416
+ }, [
417
+ O,
418
+ d,
419
+ v,
420
+ A,
421
+ h,
422
+ y,
423
+ m,
424
+ p
425
+ ]), B(() => () => {
426
+ _.current && clearTimeout(_.current);
427
+ }, []), /* @__PURE__ */ l(
428
+ re,
429
+ {
430
+ ref: de,
431
+ className: le,
432
+ disabled: t,
433
+ type: c,
434
+ "aria-label": g || b,
435
+ ...oe,
436
+ children: /* @__PURE__ */ T("div", { className: se, children: [
437
+ /* @__PURE__ */ l(
438
+ q,
439
+ {
440
+ label: h,
441
+ labelRef: y,
442
+ labelClass: U,
443
+ labelInnerClass: "pr-2",
444
+ initiallyHidden: p
445
+ }
446
+ ),
447
+ /* @__PURE__ */ l("span", { ref: S, className: ce, children: e }),
448
+ /* @__PURE__ */ l(
449
+ q,
450
+ {
451
+ label: d,
452
+ labelRef: v,
453
+ labelClass: U,
454
+ labelInnerClass: "pl-2",
455
+ initiallyHidden: p
456
+ }
457
+ )
458
+ ] })
459
+ }
460
+ );
461
+ }
462
+ ), q = ({
463
+ labelRef: e,
464
+ labelClass: t,
465
+ label: r,
466
+ labelInnerClass: a,
467
+ initiallyHidden: o = !1
468
+ }) => /* @__PURE__ */ l(
469
+ "span",
470
+ {
471
+ ref: e,
472
+ className: t,
473
+ style: o ? { opacity: 0 } : void 0,
474
+ children: r && /* @__PURE__ */ l("span", { className: a, children: r })
475
+ }
476
+ );
477
+ V.displayName = "ButtonIcon";
478
+ /*!
479
+ @versini/ui-button v6.0.6
480
+ © 2025 gizmette.com
481
+ */
482
+ try {
483
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
484
+ version: "6.0.6",
485
+ buildTime: "05/26/2025 03:48 PM EDT",
486
+ homepage: "https://github.com/aversini/ui-components",
487
+ license: "MIT"
488
+ });
489
+ } catch {
490
+ }
491
+ const Fe = z.forwardRef(
492
+ ({
493
+ children: e,
494
+ mode: t = "system",
495
+ className: r,
496
+ active: a = !1,
497
+ ...o
498
+ }, i) => {
499
+ const c = a ? n(
500
+ "relative",
501
+ "focus-within:static",
502
+ "focus-within:after:border-transparent",
503
+ "after:absolute",
504
+ "after:content-['']",
505
+ "after:border-b-2",
506
+ "after:bottom-[-4px]",
507
+ "after:left-0",
508
+ "after:right-0",
509
+ {
510
+ "after:border-table-dark": t === "dark",
511
+ "after:border-table-light": t === "light",
512
+ "after:border-table-dark dark:after:border-table-light": t === "system",
513
+ "after:border-table-light dark:after:border-table-dark": t === "alt-system"
514
+ }
515
+ ) : "";
516
+ return /* @__PURE__ */ l("div", { className: c, children: /* @__PURE__ */ l(
517
+ V,
518
+ {
519
+ className: n("justify-center", r),
520
+ ref: i,
521
+ mode: t,
522
+ radius: "small",
523
+ ...o,
524
+ children: e
525
+ }
526
+ ) });
527
+ }
528
+ );
529
+ Fe.displayName = "ButtonSort";
530
+ const Ve = ({
531
+ children: e,
532
+ fill: t,
533
+ viewBox: r,
534
+ className: a,
535
+ defaultViewBox: o,
536
+ size: i,
537
+ title: c,
538
+ semantic: u = !1,
539
+ ...s
540
+ }) => {
541
+ const g = n(i, a);
542
+ return /* @__PURE__ */ l(J, { children: /* @__PURE__ */ T(
543
+ "svg",
544
+ {
545
+ xmlns: "http://www.w3.org/2000/svg",
546
+ className: g,
547
+ viewBox: r || o,
548
+ fill: t || "currentColor",
549
+ role: "img",
550
+ "aria-hidden": !u,
551
+ focusable: !1,
552
+ ...s,
553
+ children: [
554
+ c && u && /* @__PURE__ */ l("title", { children: c }),
555
+ e
556
+ ]
557
+ }
558
+ ) });
559
+ };
560
+ /*!
561
+ @versini/ui-svgicon v4.2.0
562
+ © 2025 gizmette.com
563
+ */
564
+ try {
565
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
566
+ version: "4.2.0",
567
+ buildTime: "05/17/2025 06:18 PM EDT",
568
+ homepage: "https://github.com/aversini/ui-components",
569
+ license: "MIT"
570
+ });
571
+ } catch {
572
+ }
573
+ const Ue = ({
574
+ className: e,
575
+ viewBox: t,
576
+ title: r,
577
+ monotone: a,
578
+ ...o
579
+ }) => /* @__PURE__ */ l(
580
+ Ve,
581
+ {
582
+ defaultViewBox: "0 0 384 512",
583
+ size: "size-5",
584
+ viewBox: t,
585
+ className: e,
586
+ title: r || "Close",
587
+ ...o,
588
+ children: /* @__PURE__ */ l(
589
+ "path",
590
+ {
591
+ d: "M297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3z",
592
+ opacity: a ? "1" : "0.4"
593
+ }
594
+ )
595
+ }
596
+ );
597
+ /*!
598
+ @versini/ui-icons v4.10.0
599
+ © 2025 gizmette.com
600
+ */
601
+ try {
602
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
603
+ version: "4.10.0",
604
+ buildTime: "05/17/2025 06:18 PM EDT",
605
+ homepage: "https://github.com/aversini/ui-components",
606
+ license: "MIT"
607
+ });
608
+ } catch {
609
+ }
610
+ const te = f.createContext(null);
611
+ function je({
612
+ initialOpen: e = !1,
613
+ open: t,
614
+ onOpenChange: r
615
+ } = {}) {
616
+ const [a, o] = f.useState(e), [i, c] = f.useState(), [u, s] = f.useState(), g = t ?? a, b = r ?? o, m = me({
617
+ open: g,
618
+ onOpenChange: b
619
+ }), d = m.context, h = ge(d, {
620
+ enabled: t == null
621
+ }), x = he(d, {
622
+ outsidePress: !1,
623
+ outsidePressEvent: "mousedown"
624
+ }), E = fe(d), w = be([h, x, E]);
625
+ return f.useMemo(
626
+ () => ({
627
+ open: g,
628
+ setOpen: b,
629
+ ...w,
630
+ ...m,
631
+ labelId: i,
632
+ descriptionId: u,
633
+ setLabelId: c,
634
+ setDescriptionId: s
635
+ }),
636
+ [g, b, w, m, i, u]
637
+ );
638
+ }
639
+ const L = () => {
640
+ const e = f.useContext(te);
641
+ if (e == null)
642
+ throw new Error("Modal components must be wrapped in <Modal />");
643
+ return e;
644
+ };
645
+ function Ge({
646
+ children: e,
647
+ ...t
648
+ }) {
649
+ const r = je(t);
650
+ return /* @__PURE__ */ l(te.Provider, { value: r, children: e });
651
+ }
652
+ const Ye = f.forwardRef(function(e, t) {
653
+ const { context: r, ...a } = L(), o = ve([a.refs.setFloating, t]);
654
+ if (!r.open)
655
+ return null;
656
+ const { overlayBackground: i, ...c } = e, u = n("grid place-items-center", {
657
+ [`${i}`]: i,
658
+ "bg-black sm:bg-black/[.8]": !i
659
+ });
660
+ return /* @__PURE__ */ l(ye, { children: /* @__PURE__ */ l(pe, { className: u, lockScroll: !0, children: /* @__PURE__ */ l(ke, { context: r, children: /* @__PURE__ */ l(
661
+ "div",
662
+ {
663
+ ref: o,
664
+ "aria-labelledby": a.labelId,
665
+ "aria-describedby": a.descriptionId,
666
+ ...a.getFloatingProps(c),
667
+ children: c.children
668
+ }
669
+ ) }) }) });
670
+ }), He = f.forwardRef(function({ children: e, ...t }, r) {
671
+ const { setLabelId: a } = L(), o = Z();
672
+ return f.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ l("h1", { ...t, ref: r, id: o, children: e });
673
+ }), We = f.forwardRef(function({ children: e, ...t }, r) {
674
+ const { setDescriptionId: a } = L(), o = Z();
675
+ return f.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ l("div", { ...t, ref: r, id: o, children: e });
676
+ }), qe = f.forwardRef(function(e, t) {
677
+ const { setOpen: r } = L(), { trigger: a, className: o, ...i } = e, c = f.useCallback(() => r(!1), [r]);
678
+ return /* @__PURE__ */ l("div", { className: o, children: f.cloneElement(a, {
679
+ ref: t,
680
+ onClick: c,
681
+ ...i
682
+ }) });
683
+ });
684
+ /*!
685
+ @versini/ui-modal v2.0.3
686
+ © 2025 gizmette.com
687
+ */
688
+ try {
689
+ window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
690
+ version: "2.0.3",
691
+ buildTime: "05/26/2025 03:48 PM EDT",
692
+ homepage: "https://github.com/aversini/ui-components",
693
+ license: "MIT"
694
+ });
695
+ } catch {
696
+ }
697
+ const C = "panel", M = "messagebox", Xe = ({
698
+ className: e,
699
+ kind: t,
700
+ borderMode: r,
701
+ animation: a
702
+ }) => ({
703
+ main: n("prose prose-lighter flex flex-col bg-surface-medium", {
704
+ "duration-200 ease-out": a,
705
+ [`${H} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === C,
706
+ [`${H} w-full sm:w-[95%] md:max-w-2xl`]: t === C && !e,
707
+ [`${Y} rounded-lg border-2`]: t === M,
708
+ [`${Y} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === M && !e,
709
+ [`${e}`]: !!e,
710
+ "sm:border-border-dark": r === "dark" && t === C,
711
+ "sm:border-border-accent": r === "light" && t === C,
712
+ "border-border-dark": r === "dark" && t === M,
713
+ "border-border-accent": r === "light" && t === M
714
+ }),
715
+ content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
716
+ footer: "flex grow flex-col sm:p-4 p-2",
717
+ header: "sm:p-4 mb-0 p-2",
718
+ close: "sm:p-4 p-2"
719
+ }), Je = "slide", X = "fade", rr = ({
720
+ open: e,
721
+ onOpenChange: t,
722
+ title: r,
723
+ children: a,
724
+ footer: o,
725
+ borderMode: i = "light",
726
+ kind: c = C,
727
+ className: u,
728
+ animation: s = !1,
729
+ animationType: g = Je
730
+ }) => {
731
+ const b = I(""), [m, d] = K(
732
+ s ? g === X ? { opacity: 0 } : {
733
+ transform: "translateY(-100vh)"
734
+ } : {}
735
+ ), h = Xe({
736
+ className: u,
737
+ kind: c,
738
+ borderMode: i,
739
+ animation: s
740
+ });
741
+ return B(() => (e && (b.current = document.title, document.title = `${r} | ${b.current}`), () => {
742
+ e && (document.title = b.current);
743
+ }), [r, e]), B(() => {
744
+ if (s && e) {
745
+ d(
746
+ s ? g === X ? { opacity: 0 } : {
747
+ transform: "translateY(-666vh)"
748
+ } : {}
749
+ );
750
+ const x = setTimeout(() => {
751
+ d(
752
+ s ? g === "fade" ? { opacity: 1 } : {
753
+ transform: "translateY(0)"
754
+ } : {}
755
+ );
756
+ }, 100);
757
+ return () => clearTimeout(x);
758
+ }
759
+ }, [e, s, g]), /* @__PURE__ */ l(J, { children: e && /* @__PURE__ */ l(Ge, { open: e, onOpenChange: t, children: /* @__PURE__ */ T(Ye, { className: h.main, style: m, children: [
760
+ /* @__PURE__ */ T("div", { className: "flex flex-row-reverse items-center justify-between", children: [
761
+ /* @__PURE__ */ l(
762
+ qe,
763
+ {
764
+ className: h.close,
765
+ trigger: /* @__PURE__ */ l(
766
+ V,
767
+ {
768
+ mode: "dark",
769
+ focusMode: "light",
770
+ noBorder: !0,
771
+ label: "Close",
772
+ children: /* @__PURE__ */ l(Ue, {})
773
+ }
774
+ )
775
+ }
776
+ ),
777
+ /* @__PURE__ */ l(He, { className: h.header, children: r })
778
+ ] }),
779
+ /* @__PURE__ */ l(We, { className: h.content, children: a }),
780
+ o && /* @__PURE__ */ l("div", { className: h.footer, children: o })
781
+ ] }) }) });
782
+ };
4
783
  export {
5
- t as Panel
784
+ Y as MESSAGEBOX_CLASSNAME,
785
+ H as PANEL_CLASSNAME,
786
+ rr as Panel
6
787
  };