@versini/ui-panel 2.1.0 → 2.2.0

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,64 +1,64 @@
1
- import { jsx as l, jsxs as T, Fragment as J } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import $, { useRef as I, useLayoutEffect as G, useEffect as B, useState as K, useMemo as Q, useCallback as ue, useId as Z } from "react";
1
+ import { jsx as l, jsxs as L, Fragment as J } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import F, { useRef as N, useLayoutEffect as Y, useEffect as B, useState as K, useMemo as Q, useCallback as ue, useId as Z } from "react";
4
4
  import n from "clsx";
5
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", z = "link", xe = ({
6
+ const H = "av-messagebox", R = "av-panel", q = "av-button", V = "icon", ee = "button", z = "link", we = ({
7
7
  type: e,
8
8
  size: t,
9
9
  labelRight: r,
10
10
  labelLeft: a,
11
- align: o,
12
- animated: i
11
+ align: i,
12
+ animated: o
13
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";
14
+ const c = "max-h-8 py-0 px-2", d = "max-h-9 h-8 px-3", s = "max-h-12 py-2 px-4";
15
15
  switch (e) {
16
16
  case ee:
17
17
  case z:
18
18
  return n({
19
19
  [c]: t === "small",
20
- [u]: t === "medium",
20
+ [d]: t === "medium",
21
21
  [s]: t === "large"
22
22
  });
23
- case F:
23
+ case V:
24
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)
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
40
  });
41
41
  }
42
- }, we = ({
42
+ }, xe = ({
43
43
  type: e,
44
44
  size: t,
45
45
  labelRight: r,
46
46
  labelLeft: a
47
47
  }) => {
48
- const o = "text-sm font-medium", i = "text-base font-medium", c = "text-lg font-medium";
48
+ const i = "text-sm font-medium", o = "text-base font-medium", c = "text-lg font-medium";
49
49
  switch (e) {
50
50
  case ee:
51
51
  case z:
52
52
  return n({
53
53
  "text-center": e === z,
54
- [o]: t === "small",
55
- [i]: t === "medium",
54
+ [i]: t === "small",
55
+ [o]: t === "medium",
56
56
  [c]: t === "large"
57
57
  });
58
- case F:
58
+ case V:
59
59
  return n({
60
- [o]: t === "small" && (r || a),
61
- [i]: t === "medium" && (r || a),
60
+ [i]: t === "small" && (r || a),
61
+ [o]: t === "medium" && (r || a),
62
62
  [c]: t === "large" && (r || a)
63
63
  });
64
64
  }
@@ -252,73 +252,73 @@ const Y = "av-messagebox", H = "av-panel", W = "av-button", F = "icon", ee = "bu
252
252
  className: t,
253
253
  raw: r,
254
254
  mode: a,
255
- focusMode: o,
256
- disabled: i,
255
+ focusMode: i,
256
+ disabled: o,
257
257
  fullWidth: c,
258
- size: u,
258
+ size: d,
259
259
  noBorder: s,
260
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,
261
+ labelLeft: v,
262
+ noBackground: u,
263
+ variant: m,
264
+ truncate: f,
265
+ align: b,
266
+ radius: x,
267
+ animated: I
268
+ }) => (m || (m = "primary"), r ? n(q, t) : n(
269
+ q,
270
270
  Ie({
271
271
  mode: a,
272
- variant: d,
273
- noBackground: m,
274
- truncate: h
272
+ variant: m,
273
+ noBackground: u,
274
+ truncate: f
275
275
  }),
276
- _e({ mode: a, noBackground: m, variant: d }),
277
- Ne({ radius: E }),
278
- xe({
276
+ _e({ mode: a, noBackground: u, variant: m }),
277
+ Ne({ radius: x }),
278
+ we({
279
279
  type: e,
280
- size: u,
280
+ size: d,
281
281
  labelRight: g,
282
- labelLeft: b,
283
- align: x,
284
- animated: w
282
+ labelLeft: v,
283
+ align: b,
284
+ animated: I
285
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 }),
286
+ xe({ type: e, size: d, labelRight: g, labelLeft: v }),
287
+ Be({ mode: a, variant: m, noBorder: s }),
288
+ Se({ focusMode: i }),
289
+ Ee({ mode: a, variant: m, disabled: o }),
290
+ Ce({ mode: a, variant: m, disabled: o }),
291
291
  {
292
292
  "w-full": c,
293
- "disabled:cursor-not-allowed disabled:opacity-50": i
293
+ "disabled:cursor-not-allowed disabled:opacity-50": o
294
294
  },
295
295
  n({
296
- "transition-[width] duration-300 ease-in": w
296
+ "transition-[width] duration-300 ease-in": I
297
297
  }),
298
298
  t
299
299
  )), Le = (e, t, r) => {
300
300
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof e?.currentTarget?.focus == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
301
- }, re = $.forwardRef((e, t) => {
302
- const { onClick: r, noInternalClick: a = !1, ...o } = e;
301
+ }, re = F.forwardRef((e, t) => {
302
+ const { onClick: r, noInternalClick: a = !1, ...i } = e;
303
303
  return /* @__PURE__ */ l(
304
304
  "button",
305
305
  {
306
306
  ref: t,
307
- onClick: (i) => {
308
- Le(i, a, r);
307
+ onClick: (o) => {
308
+ Le(o, a, r);
309
309
  },
310
- ...o
310
+ ...i
311
311
  }
312
312
  );
313
313
  });
314
314
  re.displayName = "BaseButton";
315
- function Ae() {
316
- const e = I(!1);
315
+ function Oe() {
316
+ const e = N(!1);
317
317
  return B(() => (e.current = !0, () => {
318
318
  e.current = !1;
319
319
  }), []), ue(() => e.current, []);
320
320
  }
321
- function Oe(e) {
321
+ function Ae(e) {
322
322
  return Q(() => e.every((t) => t == null) ? () => {
323
323
  } : (t) => {
324
324
  e.forEach((r) => {
@@ -326,7 +326,7 @@ function Oe(e) {
326
326
  });
327
327
  }, [...e]);
328
328
  }
329
- const De = {
329
+ const Pe = {
330
330
  x: 0,
331
331
  y: 0,
332
332
  width: 0,
@@ -336,93 +336,93 @@ const De = {
336
336
  bottom: 0,
337
337
  right: 0
338
338
  };
339
- function P(e) {
340
- const t = Ae(), r = I(0), a = I(null), [o, i] = K(De), c = Q(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((u) => {
341
- const s = u[0];
339
+ function D(e) {
340
+ const t = Oe(), r = N(0), a = N(null), [i, o] = K(Pe), c = Q(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
341
+ const s = d[0];
342
342
  s && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
343
- a.current && t() && i(s.contentRect);
343
+ a.current && t() && o(s.contentRect);
344
344
  }));
345
345
  }), [t]);
346
346
  return B(() => (a.current && c?.observe(a.current, e), () => {
347
347
  c?.disconnect(), r.current && cancelAnimationFrame(r.current);
348
- }), [c, e]), [a, o];
348
+ }), [c, e]), [a, i];
349
349
  }
350
- const R = {
350
+ const M = {
351
351
  small: 24,
352
352
  // w-6
353
353
  medium: 32,
354
354
  // w-8
355
355
  large: 48
356
356
  // w-12
357
- }, Pe = {
357
+ }, $e = {
358
358
  small: 16,
359
359
  // px-2 x 2
360
360
  medium: 24,
361
361
  // px-3 x 2
362
362
  large: 32
363
363
  // px-4 x 2
364
- }, ze = 2, $e = 300, V = $.forwardRef(
364
+ }, De = 2, ze = 300, U = F.forwardRef(
365
365
  ({
366
366
  children: e,
367
367
  disabled: t = !1,
368
368
  mode: r = "system",
369
369
  focusMode: a = "system",
370
- fullWidth: o = !1,
371
- className: i,
370
+ fullWidth: i = !1,
371
+ className: o,
372
372
  type: c = "button",
373
- raw: u = !1,
373
+ raw: d = !1,
374
374
  noBorder: s = !1,
375
375
  "aria-label": g,
376
- label: b,
377
- size: m = "medium",
378
- labelRight: d,
379
- labelLeft: h,
380
- noBackground: x = !1,
381
- align: E = "center",
382
- radius: w = "large",
376
+ label: v,
377
+ size: u = "medium",
378
+ labelRight: m,
379
+ labelLeft: f,
380
+ noBackground: b = !1,
381
+ align: x = "center",
382
+ radius: I = "large",
383
383
  variant: ae = "primary",
384
384
  iconClassName: ie,
385
- animated: p = !1,
385
+ animated: k = !1,
386
386
  ...oe
387
387
  }, ne) => {
388
388
  const le = Te({
389
- type: F,
389
+ type: V,
390
390
  mode: r,
391
391
  focusMode: a,
392
- fullWidth: o,
392
+ fullWidth: i,
393
393
  disabled: t,
394
- raw: u,
395
- className: i,
394
+ raw: d,
395
+ className: o,
396
396
  noBorder: s,
397
- size: m,
398
- labelRight: d,
399
- labelLeft: h,
400
- noBackground: x,
401
- align: E,
402
- radius: w,
397
+ size: u,
398
+ labelRight: m,
399
+ labelLeft: f,
400
+ noBackground: b,
401
+ align: x,
402
+ radius: I,
403
403
  variant: ae,
404
- animated: p
405
- }), 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, A] = P(), [y, O] = P(), [S, j] = P(), D = I(0), k = I(null), _ = I(null), de = Oe([ne, k]);
406
- return G(() => {
407
- S && S.current && p && (D.current = j.width + Pe[m] + (s ? 0 : ze), k.current && !k.current.style.width && (k.current.style.width = `${R[m]}px`));
408
- }, [j, S, m, s, p]), G(() => {
409
- if (k && k.current && p) {
410
- let N = R[m];
411
- d && v && A.width > 0 ? N = A.width + D.current : h && y && O.width > 0 && (N = O.width + D.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(() => {
412
- v.current && d && (v.current.style.opacity = "1"), y.current && h && (y.current.style.opacity = "1"), _.current = null;
413
- }, $e * 0.8))), N === R[m] && (v.current && (v.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"));
404
+ animated: k
405
+ }), ce = Re({ mode: r, raw: d, iconClassName: ie }), j = Me({ animated: k }), se = "flex items-center justify-center relative w-full h-full overflow-hidden", [y, A] = D(), [p, P] = D(), [S, G] = D(), $ = N(0), w = N(null), E = N(null), de = Ae([ne, w]);
406
+ return Y(() => {
407
+ S && S.current && k && ($.current = G.width + $e[u] + (s ? 0 : De), w.current && !w.current.style.width && (w.current.style.width = `${M[u]}px`));
408
+ }, [G, S, u, s, k]), Y(() => {
409
+ if (w && w.current && k) {
410
+ let C = M[u];
411
+ m && y && A.width > 0 ? C = A.width + $.current : f && p && P.width > 0 && (C = P.width + $.current), E.current && clearTimeout(E.current), C !== parseInt(w.current.style.width || "0", 10) && (y.current && (y.current.style.opacity = "0"), p.current && (p.current.style.opacity = "0"), w.current.style.width = `${C}px`, C > M[u] && (E.current = setTimeout(() => {
412
+ y.current && m && (y.current.style.opacity = "1"), p.current && f && (p.current.style.opacity = "1"), E.current = null;
413
+ }, ze * 0.8))), C === M[u] && (y.current && (y.current.style.opacity = "0"), p.current && (p.current.style.opacity = "0"));
414
414
  }
415
415
  }, [
416
416
  A,
417
- d,
418
- v,
419
- O,
420
- h,
421
- y,
422
417
  m,
423
- p
418
+ y,
419
+ P,
420
+ f,
421
+ p,
422
+ u,
423
+ k
424
424
  ]), B(() => () => {
425
- _.current && clearTimeout(_.current);
425
+ E.current && clearTimeout(E.current);
426
426
  }, []), /* @__PURE__ */ l(
427
427
  re,
428
428
  {
@@ -430,50 +430,50 @@ const R = {
430
430
  className: le,
431
431
  disabled: t,
432
432
  type: c,
433
- "aria-label": g || b,
433
+ "aria-label": g || v,
434
434
  ...oe,
435
- children: /* @__PURE__ */ T("div", { className: se, children: [
435
+ children: /* @__PURE__ */ L("div", { className: se, children: [
436
436
  /* @__PURE__ */ l(
437
- q,
437
+ X,
438
438
  {
439
- label: h,
440
- labelRef: y,
441
- labelClass: U,
439
+ label: f,
440
+ labelRef: p,
441
+ labelClass: j,
442
442
  labelInnerClass: "pr-2",
443
- initiallyHidden: p
443
+ initiallyHidden: k
444
444
  }
445
445
  ),
446
446
  /* @__PURE__ */ l("span", { ref: S, className: ce, children: e }),
447
447
  /* @__PURE__ */ l(
448
- q,
448
+ X,
449
449
  {
450
- label: d,
451
- labelRef: v,
452
- labelClass: U,
450
+ label: m,
451
+ labelRef: y,
452
+ labelClass: j,
453
453
  labelInnerClass: "pl-2",
454
- initiallyHidden: p
454
+ initiallyHidden: k
455
455
  }
456
456
  )
457
457
  ] })
458
458
  }
459
459
  );
460
460
  }
461
- ), q = ({
461
+ ), X = ({
462
462
  labelRef: e,
463
463
  labelClass: t,
464
464
  label: r,
465
465
  labelInnerClass: a,
466
- initiallyHidden: o = !1
466
+ initiallyHidden: i = !1
467
467
  }) => /* @__PURE__ */ l(
468
468
  "span",
469
469
  {
470
470
  ref: e,
471
471
  className: t,
472
- style: o ? { opacity: 0 } : void 0,
472
+ style: i ? { opacity: 0 } : void 0,
473
473
  children: r && /* @__PURE__ */ l("span", { className: a, children: r })
474
474
  }
475
475
  );
476
- V.displayName = "ButtonIcon";
476
+ U.displayName = "ButtonIcon";
477
477
  /*!
478
478
  @versini/ui-button v6.0.9
479
479
  © 2025 gizmette.com
@@ -481,20 +481,20 @@ V.displayName = "ButtonIcon";
481
481
  try {
482
482
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
483
483
  version: "6.0.9",
484
- buildTime: "08/04/2025 04:16 AM EDT",
484
+ buildTime: "08/04/2025 12:23 PM EDT",
485
485
  homepage: "https://github.com/aversini/ui-components",
486
486
  license: "MIT"
487
487
  });
488
488
  } catch {
489
489
  }
490
- const Fe = $.forwardRef(
490
+ const Fe = F.forwardRef(
491
491
  ({
492
492
  children: e,
493
493
  mode: t = "system",
494
494
  className: r,
495
495
  active: a = !1,
496
- ...o
497
- }, i) => {
496
+ ...i
497
+ }, o) => {
498
498
  const c = a ? n(
499
499
  "relative",
500
500
  "focus-within:static",
@@ -513,13 +513,13 @@ const Fe = $.forwardRef(
513
513
  }
514
514
  ) : "";
515
515
  return /* @__PURE__ */ l("div", { className: c, children: /* @__PURE__ */ l(
516
- V,
516
+ U,
517
517
  {
518
518
  className: n("justify-center", r),
519
- ref: i,
519
+ ref: o,
520
520
  mode: t,
521
521
  radius: "small",
522
- ...o,
522
+ ...i,
523
523
  children: e
524
524
  }
525
525
  ) });
@@ -531,26 +531,26 @@ const Ve = ({
531
531
  fill: t,
532
532
  viewBox: r,
533
533
  className: a,
534
- defaultViewBox: o,
535
- size: i,
534
+ defaultViewBox: i,
535
+ size: o,
536
536
  title: c,
537
- semantic: u = !1,
537
+ semantic: d = !1,
538
538
  ...s
539
539
  }) => {
540
- const g = n(i, a);
541
- return /* @__PURE__ */ l(J, { children: /* @__PURE__ */ T(
540
+ const g = n(o, a);
541
+ return /* @__PURE__ */ l(J, { children: /* @__PURE__ */ L(
542
542
  "svg",
543
543
  {
544
544
  xmlns: "http://www.w3.org/2000/svg",
545
545
  className: g,
546
- viewBox: r || o,
546
+ viewBox: r || i,
547
547
  fill: t || "currentColor",
548
548
  role: "img",
549
- "aria-hidden": !u,
549
+ "aria-hidden": !d,
550
550
  focusable: !1,
551
551
  ...s,
552
552
  children: [
553
- c && u && /* @__PURE__ */ l("title", { children: c }),
553
+ c && d && /* @__PURE__ */ l("title", { children: c }),
554
554
  e
555
555
  ]
556
556
  }
@@ -574,7 +574,7 @@ const Ue = ({
574
574
  viewBox: t,
575
575
  title: r,
576
576
  monotone: a,
577
- ...o
577
+ ...i
578
578
  }) => /* @__PURE__ */ l(
579
579
  Ve,
580
580
  {
@@ -583,7 +583,7 @@ const Ue = ({
583
583
  viewBox: t,
584
584
  className: e,
585
585
  title: r || "Close",
586
- ...o,
586
+ ...i,
587
587
  children: /* @__PURE__ */ l(
588
588
  "path",
589
589
  {
@@ -606,37 +606,37 @@ try {
606
606
  });
607
607
  } catch {
608
608
  }
609
- const te = f.createContext(null);
609
+ const te = h.createContext(null);
610
610
  function je({
611
611
  initialOpen: e = !1,
612
612
  open: t,
613
613
  onOpenChange: r
614
614
  } = {}) {
615
- const [a, o] = f.useState(e), [i, c] = f.useState(), [u, s] = f.useState(), g = t ?? a, b = r ?? o, m = me({
615
+ const [a, i] = h.useState(e), [o, c] = h.useState(), [d, s] = h.useState(), g = t ?? a, v = r ?? i, u = me({
616
616
  open: g,
617
- onOpenChange: b
618
- }), d = m.context, h = ge(d, {
617
+ onOpenChange: v
618
+ }), m = u.context, f = ge(m, {
619
619
  enabled: t == null
620
- }), x = he(d, {
620
+ }), b = he(m, {
621
621
  outsidePress: !1,
622
622
  outsidePressEvent: "mousedown"
623
- }), E = fe(d), w = be([h, x, E]);
624
- return f.useMemo(
623
+ }), x = fe(m), I = be([f, b, x]);
624
+ return h.useMemo(
625
625
  () => ({
626
626
  open: g,
627
- setOpen: b,
628
- ...w,
629
- ...m,
630
- labelId: i,
631
- descriptionId: u,
627
+ setOpen: v,
628
+ ...I,
629
+ ...u,
630
+ labelId: o,
631
+ descriptionId: d,
632
632
  setLabelId: c,
633
633
  setDescriptionId: s
634
634
  }),
635
- [g, b, w, m, i, u]
635
+ [g, v, I, u, o, d]
636
636
  );
637
637
  }
638
- const L = () => {
639
- const e = f.useContext(te);
638
+ const O = () => {
639
+ const e = h.useContext(te);
640
640
  if (e == null)
641
641
  throw new Error("Modal components must be wrapped in <Modal />");
642
642
  return e;
@@ -648,36 +648,36 @@ function Ge({
648
648
  const r = je(t);
649
649
  return /* @__PURE__ */ l(te.Provider, { value: r, children: e });
650
650
  }
651
- const Ye = f.forwardRef(function(e, t) {
652
- const { context: r, ...a } = L(), o = ve([a.refs.setFloating, t]);
651
+ const Ye = h.forwardRef(function(e, t) {
652
+ const { context: r, ...a } = O(), i = ve([a.refs.setFloating, t]);
653
653
  if (!r.open)
654
654
  return null;
655
- const { overlayBackground: i, ...c } = e, u = n("grid place-items-center", {
656
- [`${i}`]: i,
657
- "bg-black sm:bg-black/[.8]": !i
655
+ const { overlayBackground: o, ...c } = e, d = n("grid place-items-center", {
656
+ [`${o}`]: o,
657
+ "bg-black sm:bg-black/[.8]": !o
658
658
  });
659
- return /* @__PURE__ */ l(ye, { children: /* @__PURE__ */ l(pe, { className: u, lockScroll: !0, children: /* @__PURE__ */ l(ke, { context: r, children: /* @__PURE__ */ l(
659
+ return /* @__PURE__ */ l(ye, { children: /* @__PURE__ */ l(pe, { className: d, lockScroll: !0, children: /* @__PURE__ */ l(ke, { context: r, children: /* @__PURE__ */ l(
660
660
  "div",
661
661
  {
662
- ref: o,
662
+ ref: i,
663
663
  "aria-labelledby": a.labelId,
664
664
  "aria-describedby": a.descriptionId,
665
665
  ...a.getFloatingProps(c),
666
666
  children: c.children
667
667
  }
668
668
  ) }) }) });
669
- }), He = f.forwardRef(function({ children: e, ...t }, r) {
670
- const { setLabelId: a } = L(), o = Z();
671
- return f.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ l("h1", { ...t, ref: r, id: o, children: e });
672
- }), We = f.forwardRef(function({ children: e, ...t }, r) {
673
- const { setDescriptionId: a } = L(), o = Z();
674
- return f.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ l("div", { ...t, ref: r, id: o, children: e });
675
- }), qe = f.forwardRef(function(e, t) {
676
- const { setOpen: r } = L(), { trigger: a, className: o, ...i } = e, c = f.useCallback(() => r(!1), [r]);
677
- return /* @__PURE__ */ l("div", { className: o, children: f.cloneElement(a, {
669
+ }), He = h.forwardRef(function({ children: e, ...t }, r) {
670
+ const { setLabelId: a } = O(), i = Z();
671
+ return h.useLayoutEffect(() => (a(i), () => a(void 0)), [i, a]), /* @__PURE__ */ l("h1", { ...t, ref: r, id: i, children: e });
672
+ }), qe = h.forwardRef(function({ children: e, ...t }, r) {
673
+ const { setDescriptionId: a } = O(), i = Z();
674
+ return h.useLayoutEffect(() => (a(i), () => a(void 0)), [i, a]), /* @__PURE__ */ l("div", { ...t, ref: r, id: i, children: e });
675
+ }), Xe = h.forwardRef(function(e, t) {
676
+ const { setOpen: r } = O(), { trigger: a, className: i, ...o } = e, c = h.useCallback(() => r(!1), [r]);
677
+ return /* @__PURE__ */ l("div", { className: i, children: h.cloneElement(a, {
678
678
  ref: t,
679
679
  onClick: c,
680
- ...i
680
+ ...o
681
681
  }) });
682
682
  });
683
683
  /*!
@@ -687,67 +687,72 @@ const Ye = f.forwardRef(function(e, t) {
687
687
  try {
688
688
  window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
689
689
  version: "2.0.5",
690
- buildTime: "08/04/2025 04:16 AM EDT",
690
+ buildTime: "08/04/2025 12:23 PM EDT",
691
691
  homepage: "https://github.com/aversini/ui-components",
692
692
  license: "MIT"
693
693
  });
694
694
  } catch {
695
695
  }
696
- const C = "panel", M = "messagebox", Xe = ({
696
+ const _ = "panel", T = "messagebox", We = ({
697
697
  className: e,
698
698
  kind: t,
699
699
  borderMode: r,
700
- animation: a
700
+ animation: a,
701
+ maxWidth: i = "medium"
701
702
  }) => ({
702
703
  main: n("prose prose-lighter flex flex-col bg-surface-medium", {
703
704
  "duration-200 ease-out": a,
704
- [`${H} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === C,
705
- [`${H} w-full sm:w-[95%] md:max-w-4xl`]: t === C && !e,
706
- [`${Y} rounded-lg border-2`]: t === M,
707
- [`${Y} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === M && !e,
705
+ [`${R} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === _,
706
+ [`${R} w-full sm:w-[95%] md:max-w-2xl`]: t === _ && !e && i === "small",
707
+ [`${R} w-full sm:w-[95%] md:max-w-3xl`]: t === _ && !e && i === "medium",
708
+ [`${R} w-full sm:w-[95%] md:max-w-4xl`]: t === _ && !e && i === "large",
709
+ [`${H} rounded-lg border-2`]: t === T,
710
+ [`${H} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === T && !e,
708
711
  [`${e}`]: !!e,
709
- "sm:border-border-dark": r === "dark" && t === C,
710
- "sm:border-border-accent": r === "light" && t === C,
711
- "border-border-dark": r === "dark" && t === M,
712
- "border-border-accent": r === "light" && t === M
712
+ "sm:border-border-dark": r === "dark" && t === _,
713
+ "sm:border-border-accent": r === "light" && t === _,
714
+ "border-border-dark": r === "dark" && t === T,
715
+ "border-border-accent": r === "light" && t === T
713
716
  }),
714
717
  content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
715
718
  footer: "flex grow flex-col sm:p-4 p-2",
716
719
  header: "sm:p-4 mb-0 p-2",
717
720
  close: "sm:p-4 p-2"
718
- }), Je = "slide", X = "fade", rr = ({
721
+ }), Je = "slide", W = "fade", rr = ({
719
722
  open: e,
720
723
  onOpenChange: t,
721
724
  title: r,
722
725
  children: a,
723
- footer: o,
724
- borderMode: i = "light",
725
- kind: c = C,
726
- className: u,
726
+ footer: i,
727
+ borderMode: o = "light",
728
+ kind: c = _,
729
+ className: d,
727
730
  animation: s = !1,
728
- animationType: g = Je
731
+ animationType: g = Je,
732
+ maxWidth: v = "medium"
729
733
  }) => {
730
- const b = I(""), [m, d] = K(
731
- s ? g === X ? { opacity: 0 } : {
734
+ const u = N(""), [m, f] = K(
735
+ s ? g === W ? { opacity: 0 } : {
732
736
  transform: "translateY(-100vh)"
733
737
  } : {}
734
- ), h = Xe({
735
- className: u,
738
+ ), b = We({
739
+ className: d,
736
740
  kind: c,
737
- borderMode: i,
738
- animation: s
741
+ borderMode: o,
742
+ animation: s,
743
+ maxWidth: v
739
744
  });
740
- return B(() => (e && (b.current = document.title, document.title = `${r} | ${b.current}`), () => {
741
- e && (document.title = b.current);
745
+ return B(() => (e && (u.current = document.title, document.title = `${r} | ${u.current}`), () => {
746
+ e && (document.title = u.current);
742
747
  }), [r, e]), B(() => {
743
748
  if (s && e) {
744
- d(
745
- s ? g === X ? { opacity: 0 } : {
749
+ f(
750
+ s ? g === W ? { opacity: 0 } : {
746
751
  transform: "translateY(-666vh)"
747
752
  } : {}
748
753
  );
749
754
  const x = setTimeout(() => {
750
- d(
755
+ f(
751
756
  s ? g === "fade" ? { opacity: 1 } : {
752
757
  transform: "translateY(0)"
753
758
  } : {}
@@ -755,14 +760,14 @@ const C = "panel", M = "messagebox", Xe = ({
755
760
  }, 100);
756
761
  return () => clearTimeout(x);
757
762
  }
758
- }, [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: [
759
- /* @__PURE__ */ T("div", { className: "flex flex-row-reverse items-center justify-between", children: [
763
+ }, [e, s, g]), /* @__PURE__ */ l(J, { children: e && /* @__PURE__ */ l(Ge, { open: e, onOpenChange: t, children: /* @__PURE__ */ L(Ye, { className: b.main, style: m, children: [
764
+ /* @__PURE__ */ L("div", { className: "flex flex-row-reverse items-center justify-between", children: [
760
765
  /* @__PURE__ */ l(
761
- qe,
766
+ Xe,
762
767
  {
763
- className: h.close,
768
+ className: b.close,
764
769
  trigger: /* @__PURE__ */ l(
765
- V,
770
+ U,
766
771
  {
767
772
  mode: "dark",
768
773
  focusMode: "light",
@@ -773,14 +778,14 @@ const C = "panel", M = "messagebox", Xe = ({
773
778
  )
774
779
  }
775
780
  ),
776
- /* @__PURE__ */ l(He, { className: h.header, children: r })
781
+ /* @__PURE__ */ l(He, { className: b.header, children: r })
777
782
  ] }),
778
- /* @__PURE__ */ l(We, { className: h.content, children: a }),
779
- o && /* @__PURE__ */ l("div", { className: h.footer, children: o })
783
+ /* @__PURE__ */ l(qe, { className: b.content, children: a }),
784
+ i && /* @__PURE__ */ l("div", { className: b.footer, children: i })
780
785
  ] }) }) });
781
786
  };
782
787
  export {
783
- Y as MESSAGEBOX_CLASSNAME,
784
- H as PANEL_CLASSNAME,
788
+ H as MESSAGEBOX_CLASSNAME,
789
+ R as PANEL_CLASSNAME,
785
790
  rr as Panel
786
791
  };
package/dist/index.d.ts CHANGED
@@ -48,8 +48,16 @@ type PanelProps = {
48
48
  * @default "slide"
49
49
  */
50
50
  animationType?: "slide" | "fade";
51
+ /**
52
+ * The maximum width of the Panel when kind is "panel".
53
+ * NOTE: This only applies to panels, not messageboxes.
54
+ * NOTE: The max-width only takes effect at the medium breakpoint and above (768px+).
55
+ * At smaller viewports, the panel will take the full screen width.
56
+ * @default "medium"
57
+ */
58
+ maxWidth?: "small" | "medium" | "large";
51
59
  };
52
60
 
53
- declare const Panel: ({ open, onOpenChange, title, children, footer, borderMode, kind, className, animation, animationType, }: PanelProps) => react_jsx_runtime.JSX.Element;
61
+ declare const Panel: ({ open, onOpenChange, title, children, footer, borderMode, kind, className, animation, animationType, maxWidth, }: PanelProps) => react_jsx_runtime.JSX.Element;
54
62
 
55
63
  export { MESSAGEBOX_CLASSNAME, PANEL_CLASSNAME, Panel };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { MESSAGEBOX_CLASSNAME as o, PANEL_CLASSNAME as E, Panel as A } from "./components/Panel/Panel.js";
1
+ import { MESSAGEBOX_CLASSNAME as o, PANEL_CLASSNAME as E, Panel as n } from "./components/Panel/Panel.js";
2
2
  /*!
3
- @versini/ui-panel v2.1.0
3
+ @versini/ui-panel v2.2.0
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
8
- version: "2.1.0",
9
- buildTime: "08/04/2025 04:16 AM EDT",
8
+ version: "2.2.0",
9
+ buildTime: "08/04/2025 12:23 PM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
@@ -15,5 +15,5 @@ try {
15
15
  export {
16
16
  o as MESSAGEBOX_CLASSNAME,
17
17
  E as PANEL_CLASSNAME,
18
- A as Panel
18
+ n as Panel
19
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -53,5 +53,5 @@
53
53
  "sideEffects": [
54
54
  "**/*.css"
55
55
  ],
56
- "gitHead": "01e4f01a0a5bc280c14a3dfa5728db1012792c6f"
56
+ "gitHead": "14d53d66c2f014604b12f5e3ef0bb8708c996c21"
57
57
  }