@versini/ui-panel 2.0.3 → 2.0.5

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,769 @@
1
- import "react/jsx-runtime";
2
- import { Panel as t } from "../../index.js";
3
- import "react";
1
+ import { jsx as c, jsxs as S, Fragment as X } from "react/jsx-runtime";
2
+ import * as b from "react";
3
+ import z, { useRef as _, useLayoutEffect as F, useState as q, useMemo as Z, useEffect as B, useCallback as le, useId as H } from "react";
4
+ import n from "clsx";
5
+ import { useFloating as ce, useClick as se, useDismiss as de, useRole as ue, useInteractions as me, useMergeRefs as ge, FloatingPortal as he, FloatingOverlay as be, FloatingFocusManager as fe } from "@floating-ui/react";
6
+ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "button", O = "link", ve = ({
7
+ type: e,
8
+ size: t,
9
+ labelRight: r,
10
+ labelLeft: a,
11
+ align: i,
12
+ animated: o
13
+ }) => {
14
+ const l = "max-h-8 py-0 px-2", d = "max-h-9 h-8 px-3", s = "max-h-12 py-2 px-4";
15
+ switch (e) {
16
+ case J:
17
+ case O:
18
+ return n({
19
+ [l]: t === "small",
20
+ [d]: t === "medium",
21
+ [s]: t === "large"
22
+ });
23
+ case P:
24
+ return n("flex items-center", {
25
+ "justify-center": i === "center",
26
+ "justify-start": i === "left",
27
+ "justify-end": i === "right",
28
+ "h-6 w-6 p-0": t === "small" && !o && !(r || a),
29
+ "h-6 px-2": t === "small" && !o && (r || a),
30
+ "h-8 w-8 p-1": t === "medium" && !o && !(r || a),
31
+ "h-8 px-3": t === "medium" && !o && (r || a),
32
+ "h-12 w-12 p-2": t === "large" && !o && !(r || a),
33
+ "h-12 px-4": t === "large" && !o && (r || a),
34
+ "h-6 py-0": t === "small" && o && !(r || a),
35
+ "h-6": t === "small" && o && (r || a),
36
+ "h-8 py-1": t === "medium" && o && !(r || a),
37
+ "h-8": t === "medium" && o && (r || a),
38
+ "h-12 py-2": t === "large" && o && !(r || a),
39
+ "h-12": t === "large" && o && (r || a)
40
+ });
41
+ }
42
+ }, ye = ({
43
+ type: e,
44
+ size: t,
45
+ labelRight: r,
46
+ labelLeft: a
47
+ }) => {
48
+ const i = "text-sm font-medium", o = "text-base font-medium", l = "text-lg font-medium";
49
+ switch (e) {
50
+ case J:
51
+ case O:
52
+ return n({
53
+ "text-center": e === O,
54
+ [i]: t === "small",
55
+ [o]: t === "medium",
56
+ [l]: t === "large"
57
+ });
58
+ case P:
59
+ return n({
60
+ [i]: t === "small" && (r || a),
61
+ [o]: t === "medium" && (r || a),
62
+ [l]: t === "large" && (r || a)
63
+ });
64
+ }
65
+ }, pe = ({
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
+ }, ke = ({
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
+ }, xe = ({
132
+ radius: e
133
+ }) => n({
134
+ "rounded-full": e === "large",
135
+ "rounded-md": e === "medium",
136
+ "rounded-xs": e === "small"
137
+ }), we = ({
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
+ }, _e = ({
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
+ }, Ie = ({
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
+ }, Ne = ({
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
+ }), Ee = ({
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
+ ), Ce = ({
247
+ animated: e
248
+ }) => n({
249
+ "transition-opacity duration-300 ease-in": e
250
+ }), Se = ({
251
+ type: e,
252
+ className: t,
253
+ raw: r,
254
+ mode: a,
255
+ focusMode: i,
256
+ disabled: o,
257
+ fullWidth: l,
258
+ size: d,
259
+ noBorder: s,
260
+ labelRight: m,
261
+ labelLeft: f,
262
+ noBackground: g,
263
+ variant: u,
264
+ truncate: h,
265
+ align: v,
266
+ radius: I,
267
+ animated: y
268
+ }) => (u || (u = "primary"), r ? n(Y, t) : n(
269
+ Y,
270
+ pe({
271
+ mode: a,
272
+ variant: u,
273
+ noBackground: g,
274
+ truncate: h
275
+ }),
276
+ ke({ mode: a, noBackground: g, variant: u }),
277
+ xe({ radius: I }),
278
+ ve({
279
+ type: e,
280
+ size: d,
281
+ labelRight: m,
282
+ labelLeft: f,
283
+ align: v,
284
+ animated: y
285
+ }),
286
+ ye({ type: e, size: d, labelRight: m, labelLeft: f }),
287
+ Ie({ mode: a, variant: u, noBorder: s }),
288
+ Ne({ focusMode: i }),
289
+ we({ mode: a, variant: u, disabled: o }),
290
+ _e({ mode: a, variant: u, disabled: o }),
291
+ {
292
+ "w-full": l,
293
+ "disabled:cursor-not-allowed disabled:opacity-50": o
294
+ },
295
+ n({
296
+ "transition-[width] duration-300 ease-in-out": y
297
+ }),
298
+ t
299
+ )), Be = (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
+ }, K = z.forwardRef((e, t) => {
303
+ const { onClick: r, noInternalClick: a = !1, ...i } = e;
304
+ return /* @__PURE__ */ c(
305
+ "button",
306
+ {
307
+ ref: t,
308
+ onClick: (o) => {
309
+ Be(o, a, r);
310
+ },
311
+ ...i
312
+ }
313
+ );
314
+ });
315
+ K.displayName = "BaseButton";
316
+ function Re() {
317
+ const e = _(!1);
318
+ return B(() => (e.current = !0, () => {
319
+ e.current = !1;
320
+ }), []), le(() => e.current, []);
321
+ }
322
+ function Me(e) {
323
+ return Z(() => 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 Le = {
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 A(e) {
341
+ const t = Re(), r = _(0), a = _(null), [i, o] = q(Le), l = Z(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
342
+ const s = d[0];
343
+ s && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
344
+ a.current && t() && o(s.contentRect);
345
+ }));
346
+ }), [t]);
347
+ return B(() => (a.current && (l == null || l.observe(a.current, e)), () => {
348
+ l == null || l.disconnect(), r.current && cancelAnimationFrame(r.current);
349
+ }), [l, e]), [a, i];
350
+ }
351
+ const Te = {
352
+ small: 24,
353
+ // w-6
354
+ medium: 32,
355
+ // w-8
356
+ large: 48
357
+ // w-12
358
+ }, Ae = {
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
+ }, Oe = 2, $ = z.forwardRef(
366
+ ({
367
+ children: e,
368
+ disabled: t = !1,
369
+ mode: r = "system",
370
+ focusMode: a = "system",
371
+ fullWidth: i = !1,
372
+ className: o,
373
+ type: l = "button",
374
+ raw: d = !1,
375
+ noBorder: s = !1,
376
+ "aria-label": m,
377
+ label: f,
378
+ size: g = "medium",
379
+ labelRight: u,
380
+ labelLeft: h,
381
+ noBackground: v = !1,
382
+ align: I = "center",
383
+ radius: y = "large",
384
+ variant: ee = "primary",
385
+ iconClassName: re,
386
+ animated: k = !1,
387
+ ...te
388
+ }, ae) => {
389
+ const oe = Se({
390
+ type: P,
391
+ mode: r,
392
+ focusMode: a,
393
+ fullWidth: i,
394
+ disabled: t,
395
+ raw: d,
396
+ className: o,
397
+ noBorder: s,
398
+ size: g,
399
+ labelRight: u,
400
+ labelLeft: h,
401
+ noBackground: v,
402
+ align: I,
403
+ radius: y,
404
+ variant: ee,
405
+ animated: k
406
+ }), ie = Ee({ mode: r, raw: d, iconClassName: re }), D = Ce({ animated: k }), [p, M] = A(), [x, L] = A(), [E, V] = A(), T = _(0), w = _(null), ne = Me([ae, w]);
407
+ return F(() => {
408
+ E && E.current && k && (T.current = V.width + Ae[g] + (s ? 0 : Oe));
409
+ }, [V, E, g, s, k]), F(() => {
410
+ w && w.current && k && (u && p && M.width > 0 ? (p.current && (p.current.style.opacity = "100"), w.current.style.width = `${M.width + T.current}px`) : h && L.width > 0 ? (x.current && (x.current.style.opacity = "100"), w.current.style.width = `${L.width + T.current}px`) : (p.current && (p.current.style.opacity = "0"), x.current && (x.current.style.opacity = "0"), w.current.style.width = `${Te[g]}px`));
411
+ }, [
412
+ M,
413
+ u,
414
+ p,
415
+ L,
416
+ h,
417
+ x,
418
+ g,
419
+ k
420
+ ]), /* @__PURE__ */ S(
421
+ K,
422
+ {
423
+ ref: ne,
424
+ className: oe,
425
+ disabled: t,
426
+ type: l,
427
+ "aria-label": m || f,
428
+ ...te,
429
+ children: [
430
+ /* @__PURE__ */ c(
431
+ G,
432
+ {
433
+ label: h,
434
+ labelRef: x,
435
+ labelClass: D,
436
+ labelInnerClass: "pr-2"
437
+ }
438
+ ),
439
+ /* @__PURE__ */ c("span", { ref: E, className: ie, children: e }),
440
+ /* @__PURE__ */ c(
441
+ G,
442
+ {
443
+ label: u,
444
+ labelRef: p,
445
+ labelClass: D,
446
+ labelInnerClass: "pl-2"
447
+ }
448
+ )
449
+ ]
450
+ }
451
+ );
452
+ }
453
+ ), G = ({
454
+ labelRef: e,
455
+ labelClass: t,
456
+ label: r,
457
+ labelInnerClass: a
458
+ }) => /* @__PURE__ */ c("span", { ref: e, className: t, children: r && /* @__PURE__ */ c("span", { className: a, children: r }) });
459
+ $.displayName = "ButtonIcon";
460
+ /*!
461
+ @versini/ui-button v6.0.5
462
+ © 2025 gizmette.com
463
+ */
464
+ try {
465
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
466
+ version: "6.0.5",
467
+ buildTime: "04/12/2025 09:18 AM EDT",
468
+ homepage: "https://github.com/aversini/ui-components",
469
+ license: "MIT"
470
+ });
471
+ } catch {
472
+ }
473
+ const ze = z.forwardRef(
474
+ ({
475
+ children: e,
476
+ mode: t = "system",
477
+ className: r,
478
+ active: a = !1,
479
+ ...i
480
+ }, o) => {
481
+ const l = a ? n(
482
+ "relative",
483
+ "focus-within:static",
484
+ "focus-within:after:border-transparent",
485
+ "after:absolute",
486
+ "after:content-['']",
487
+ "after:border-b-2",
488
+ "after:bottom-[-4px]",
489
+ "after:left-0",
490
+ "after:right-0",
491
+ {
492
+ "after:border-table-dark": t === "dark",
493
+ "after:border-table-light": t === "light",
494
+ "after:border-table-dark dark:after:border-table-light": t === "system",
495
+ "after:border-table-light dark:after:border-table-dark": t === "alt-system"
496
+ }
497
+ ) : "";
498
+ return /* @__PURE__ */ c("div", { className: l, children: /* @__PURE__ */ c(
499
+ $,
500
+ {
501
+ className: n("justify-center", r),
502
+ ref: o,
503
+ mode: t,
504
+ radius: "small",
505
+ ...i,
506
+ children: e
507
+ }
508
+ ) });
509
+ }
510
+ );
511
+ ze.displayName = "ButtonSort";
512
+ const Pe = ({
513
+ children: e,
514
+ fill: t,
515
+ viewBox: r,
516
+ className: a,
517
+ defaultViewBox: i,
518
+ size: o,
519
+ title: l,
520
+ semantic: d = !1,
521
+ ...s
522
+ }) => {
523
+ const m = n(o, a);
524
+ return /* @__PURE__ */ c(X, { children: /* @__PURE__ */ S(
525
+ "svg",
526
+ {
527
+ xmlns: "http://www.w3.org/2000/svg",
528
+ className: m,
529
+ viewBox: r || i,
530
+ fill: t || "currentColor",
531
+ role: "img",
532
+ "aria-hidden": !d,
533
+ focusable: !1,
534
+ ...s,
535
+ children: [
536
+ l && d && /* @__PURE__ */ c("title", { children: l }),
537
+ e
538
+ ]
539
+ }
540
+ ) });
541
+ };
542
+ /*!
543
+ @versini/ui-svgicon v4.2.0
544
+ © 2025 gizmette.com
545
+ */
546
+ try {
547
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
548
+ version: "4.2.0",
549
+ buildTime: "04/05/2025 07:49 PM EDT",
550
+ homepage: "https://github.com/aversini/ui-components",
551
+ license: "MIT"
552
+ });
553
+ } catch {
554
+ }
555
+ const $e = ({
556
+ className: e,
557
+ viewBox: t,
558
+ title: r,
559
+ monotone: a,
560
+ ...i
561
+ }) => /* @__PURE__ */ c(
562
+ Pe,
563
+ {
564
+ defaultViewBox: "0 0 384 512",
565
+ size: "size-5",
566
+ viewBox: t,
567
+ className: e,
568
+ title: r || "Close",
569
+ ...i,
570
+ children: /* @__PURE__ */ c(
571
+ "path",
572
+ {
573
+ 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",
574
+ opacity: a ? "1" : "0.4"
575
+ }
576
+ )
577
+ }
578
+ );
579
+ /*!
580
+ @versini/ui-icons v4.9.0
581
+ © 2025 gizmette.com
582
+ */
583
+ try {
584
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
585
+ version: "4.9.0",
586
+ buildTime: "04/05/2025 07:49 PM EDT",
587
+ homepage: "https://github.com/aversini/ui-components",
588
+ license: "MIT"
589
+ });
590
+ } catch {
591
+ }
592
+ const Q = b.createContext(null);
593
+ function De({
594
+ initialOpen: e = !1,
595
+ open: t,
596
+ onOpenChange: r
597
+ } = {}) {
598
+ const [a, i] = b.useState(e), [o, l] = b.useState(), [d, s] = b.useState(), m = t ?? a, f = r ?? i, g = ce({
599
+ open: m,
600
+ onOpenChange: f
601
+ }), u = g.context, h = se(u, {
602
+ enabled: t == null
603
+ }), v = de(u, {
604
+ outsidePress: !1,
605
+ outsidePressEvent: "mousedown"
606
+ }), I = ue(u), y = me([h, v, I]);
607
+ return b.useMemo(
608
+ () => ({
609
+ open: m,
610
+ setOpen: f,
611
+ ...y,
612
+ ...g,
613
+ labelId: o,
614
+ descriptionId: d,
615
+ setLabelId: l,
616
+ setDescriptionId: s
617
+ }),
618
+ [m, f, y, g, o, d]
619
+ );
620
+ }
621
+ const R = () => {
622
+ const e = b.useContext(Q);
623
+ if (e == null)
624
+ throw new Error("Modal components must be wrapped in <Modal />");
625
+ return e;
626
+ };
627
+ function Ve({
628
+ children: e,
629
+ ...t
630
+ }) {
631
+ const r = De(t);
632
+ return /* @__PURE__ */ c(Q.Provider, { value: r, children: e });
633
+ }
634
+ const Fe = b.forwardRef(function(e, t) {
635
+ const { context: r, ...a } = R(), i = ge([a.refs.setFloating, t]);
636
+ if (!r.open)
637
+ return null;
638
+ const { overlayBackground: o, ...l } = e, d = n("grid place-items-center", {
639
+ [`${o}`]: o,
640
+ "bg-black sm:bg-black/[.8]": !o
641
+ });
642
+ return /* @__PURE__ */ c(he, { children: /* @__PURE__ */ c(be, { className: d, lockScroll: !0, children: /* @__PURE__ */ c(fe, { context: r, children: /* @__PURE__ */ c(
643
+ "div",
644
+ {
645
+ ref: i,
646
+ "aria-labelledby": a.labelId,
647
+ "aria-describedby": a.descriptionId,
648
+ ...a.getFloatingProps(l),
649
+ children: l.children
650
+ }
651
+ ) }) }) });
652
+ }), Ue = b.forwardRef(function({ children: e, ...t }, r) {
653
+ const { setLabelId: a } = R(), i = H();
654
+ return b.useLayoutEffect(() => (a(i), () => a(void 0)), [i, a]), /* @__PURE__ */ c("h1", { ...t, ref: r, id: i, children: e });
655
+ }), je = b.forwardRef(function({ children: e, ...t }, r) {
656
+ const { setDescriptionId: a } = R(), i = H();
657
+ return b.useLayoutEffect(() => (a(i), () => a(void 0)), [i, a]), /* @__PURE__ */ c("div", { ...t, ref: r, id: i, children: e });
658
+ }), Ye = b.forwardRef(function(e, t) {
659
+ const { setOpen: r } = R(), { trigger: a, className: i, ...o } = e, l = b.useCallback(() => r(!1), [r]);
660
+ return /* @__PURE__ */ c("div", { className: i, children: b.cloneElement(a, {
661
+ ref: t,
662
+ onClick: l,
663
+ ...o
664
+ }) });
665
+ });
666
+ /*!
667
+ @versini/ui-modal v2.0.2
668
+ © 2025 gizmette.com
669
+ */
670
+ try {
671
+ window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
672
+ version: "2.0.2",
673
+ buildTime: "04/12/2025 09:18 AM EDT",
674
+ homepage: "https://github.com/aversini/ui-components",
675
+ license: "MIT"
676
+ });
677
+ } catch {
678
+ }
679
+ const N = "panel", C = "messagebox", Ge = ({
680
+ className: e,
681
+ kind: t,
682
+ borderMode: r,
683
+ animation: a
684
+ }) => ({
685
+ main: n("prose prose-lighter flex flex-col bg-surface-medium", {
686
+ "duration-200 ease-out": a,
687
+ [`${j} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === N,
688
+ [`${j} w-full sm:w-[95%] md:max-w-2xl`]: t === N && !e,
689
+ [`${U} rounded-lg border-2`]: t === C,
690
+ [`${U} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === C && !e,
691
+ [`${e}`]: !!e,
692
+ "sm:border-border-dark": r === "dark" && t === N,
693
+ "sm:border-border-accent": r === "light" && t === N,
694
+ "border-border-dark": r === "dark" && t === C,
695
+ "border-border-accent": r === "light" && t === C
696
+ }),
697
+ content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
698
+ footer: "flex grow flex-col sm:p-4 p-2",
699
+ header: "sm:p-4 mb-0 p-2",
700
+ close: "sm:p-4 p-2"
701
+ }), We = "slide", W = "fade", Je = ({
702
+ open: e,
703
+ onOpenChange: t,
704
+ title: r,
705
+ children: a,
706
+ footer: i,
707
+ borderMode: o = "light",
708
+ kind: l = N,
709
+ className: d,
710
+ animation: s = !1,
711
+ animationType: m = We
712
+ }) => {
713
+ const f = _(""), [g, u] = q(
714
+ s ? m === W ? { opacity: 0 } : {
715
+ transform: "translateY(-100vh)"
716
+ } : {}
717
+ ), h = Ge({
718
+ className: d,
719
+ kind: l,
720
+ borderMode: o,
721
+ animation: s
722
+ });
723
+ return B(() => (e && (f.current = document.title, document.title = `${r} | ${f.current}`), () => {
724
+ e && (document.title = f.current);
725
+ }), [r, e]), B(() => {
726
+ if (s && e) {
727
+ u(
728
+ s ? m === W ? { opacity: 0 } : {
729
+ transform: "translateY(-666vh)"
730
+ } : {}
731
+ );
732
+ const v = setTimeout(() => {
733
+ u(
734
+ s ? m === "fade" ? { opacity: 1 } : {
735
+ transform: "translateY(0)"
736
+ } : {}
737
+ );
738
+ }, 100);
739
+ return () => clearTimeout(v);
740
+ }
741
+ }, [e, s, m]), /* @__PURE__ */ c(X, { children: e && /* @__PURE__ */ c(Ve, { open: e, onOpenChange: t, children: /* @__PURE__ */ S(Fe, { className: h.main, style: g, children: [
742
+ /* @__PURE__ */ S("div", { className: "flex flex-row-reverse items-center justify-between", children: [
743
+ /* @__PURE__ */ c(
744
+ Ye,
745
+ {
746
+ className: h.close,
747
+ trigger: /* @__PURE__ */ c(
748
+ $,
749
+ {
750
+ mode: "dark",
751
+ focusMode: "light",
752
+ noBorder: !0,
753
+ label: "Close",
754
+ children: /* @__PURE__ */ c($e, {})
755
+ }
756
+ )
757
+ }
758
+ ),
759
+ /* @__PURE__ */ c(Ue, { className: h.header, children: r })
760
+ ] }),
761
+ /* @__PURE__ */ c(je, { className: h.content, children: a }),
762
+ i && /* @__PURE__ */ c("div", { className: h.footer, children: i })
763
+ ] }) }) });
764
+ };
4
765
  export {
5
- t as Panel
766
+ U as MESSAGEBOX_CLASSNAME,
767
+ j as PANEL_CLASSNAME,
768
+ Je as Panel
6
769
  };