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