@versini/ui-panel 2.0.5 → 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,68 +1,68 @@
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";
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
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 = ({
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
7
  type: e,
8
8
  size: t,
9
9
  labelRight: r,
10
10
  labelLeft: a,
11
- align: i,
12
- animated: o
11
+ align: o,
12
+ animated: i
13
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";
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
15
  switch (e) {
16
- case J:
17
- case O:
16
+ case ee:
17
+ case $:
18
18
  return n({
19
- [l]: t === "small",
20
- [d]: t === "medium",
19
+ [c]: t === "small",
20
+ [u]: t === "medium",
21
21
  [s]: t === "large"
22
22
  });
23
- case P:
23
+ case F:
24
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)
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
40
  });
41
41
  }
42
- }, ye = ({
42
+ }, we = ({
43
43
  type: e,
44
44
  size: t,
45
45
  labelRight: r,
46
46
  labelLeft: a
47
47
  }) => {
48
- const i = "text-sm font-medium", o = "text-base font-medium", l = "text-lg font-medium";
48
+ const o = "text-sm font-medium", i = "text-base font-medium", c = "text-lg font-medium";
49
49
  switch (e) {
50
- case J:
51
- case O:
50
+ case ee:
51
+ case $:
52
52
  return n({
53
- "text-center": e === O,
54
- [i]: t === "small",
55
- [o]: t === "medium",
56
- [l]: t === "large"
53
+ "text-center": e === $,
54
+ [o]: t === "small",
55
+ [i]: t === "medium",
56
+ [c]: t === "large"
57
57
  });
58
- case P:
58
+ case F:
59
59
  return n({
60
- [i]: t === "small" && (r || a),
61
- [o]: t === "medium" && (r || a),
62
- [l]: t === "large" && (r || a)
60
+ [o]: t === "small" && (r || a),
61
+ [i]: t === "medium" && (r || a),
62
+ [c]: t === "large" && (r || a)
63
63
  });
64
64
  }
65
- }, pe = ({
65
+ }, Ie = ({
66
66
  mode: e,
67
67
  noBackground: t,
68
68
  truncate: r,
@@ -98,7 +98,7 @@ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "but
98
98
  return n("not-prose text-copy-lighter", {
99
99
  truncate: r
100
100
  });
101
- }, ke = ({
101
+ }, _e = ({
102
102
  mode: e,
103
103
  noBackground: t,
104
104
  variant: r
@@ -128,13 +128,13 @@ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "but
128
128
  if (r === "selected")
129
129
  return "bg-action-selected-dark";
130
130
  }
131
- }, xe = ({
131
+ }, Ne = ({
132
132
  radius: e
133
133
  }) => n({
134
134
  "rounded-full": e === "large",
135
135
  "rounded-md": e === "medium",
136
136
  "rounded-xs": e === "small"
137
- }), we = ({
137
+ }), Ee = ({
138
138
  mode: e,
139
139
  disabled: t,
140
140
  variant: r
@@ -164,7 +164,7 @@ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "but
164
164
  });
165
165
  if (r === "selected")
166
166
  return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
167
- }, _e = ({
167
+ }, Ce = ({
168
168
  mode: e,
169
169
  disabled: t,
170
170
  variant: r
@@ -194,7 +194,7 @@ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "but
194
194
  });
195
195
  if (r === "selected")
196
196
  return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
197
- }, Ie = ({
197
+ }, Be = ({
198
198
  mode: e,
199
199
  noBorder: t,
200
200
  variant: r
@@ -224,14 +224,14 @@ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "but
224
224
  });
225
225
  if (r === "selected")
226
226
  return "border border-border-selected-dark";
227
- }, Ne = ({
227
+ }, Se = ({
228
228
  focusMode: e
229
229
  }) => n("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
230
230
  "focus:outline-focus-dark": e === "dark",
231
231
  "focus:outline-focus-light": e === "light",
232
232
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
233
233
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
234
- }), Ee = ({
234
+ }), Re = ({
235
235
  mode: e,
236
236
  raw: t,
237
237
  iconClassName: r
@@ -243,91 +243,91 @@ const U = "av-messagebox", j = "av-panel", Y = "av-button", P = "icon", J = "but
243
243
  "dark:text-copy-accent-dark": e === "system"
244
244
  },
245
245
  r
246
- ), Ce = ({
246
+ ), Me = ({
247
247
  animated: e
248
248
  }) => n({
249
- "transition-opacity duration-300 ease-in": e
250
- }), Se = ({
249
+ "transition-opacity duration-300 ease-in-out": e
250
+ }), Te = ({
251
251
  type: e,
252
252
  className: t,
253
253
  raw: r,
254
254
  mode: a,
255
- focusMode: i,
256
- disabled: o,
257
- fullWidth: l,
258
- size: d,
255
+ focusMode: o,
256
+ disabled: i,
257
+ fullWidth: c,
258
+ size: u,
259
259
  noBorder: s,
260
- labelRight: m,
261
- labelLeft: f,
262
- noBackground: g,
263
- variant: u,
260
+ labelRight: g,
261
+ labelLeft: b,
262
+ noBackground: m,
263
+ variant: d,
264
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({
265
+ align: x,
266
+ radius: E,
267
+ animated: w
268
+ }) => (d || (d = "primary"), r ? n(W, t) : n(
269
+ W,
270
+ Ie({
271
271
  mode: a,
272
- variant: u,
273
- noBackground: g,
272
+ variant: d,
273
+ noBackground: m,
274
274
  truncate: h
275
275
  }),
276
- ke({ mode: a, noBackground: g, variant: u }),
277
- xe({ radius: I }),
278
- ve({
276
+ _e({ mode: a, noBackground: m, variant: d }),
277
+ Ne({ radius: E }),
278
+ xe({
279
279
  type: e,
280
- size: d,
281
- labelRight: m,
282
- labelLeft: f,
283
- align: v,
284
- animated: y
280
+ size: u,
281
+ labelRight: g,
282
+ labelLeft: b,
283
+ align: x,
284
+ animated: w
285
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 }),
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
291
  {
292
- "w-full": l,
293
- "disabled:cursor-not-allowed disabled:opacity-50": o
292
+ "w-full": c,
293
+ "disabled:cursor-not-allowed disabled:opacity-50": i
294
294
  },
295
295
  n({
296
- "transition-[width] duration-300 ease-in-out": y
296
+ "transition-[width] duration-300 ease-in": w
297
297
  }),
298
298
  t
299
- )), Be = (e, t, r) => {
299
+ )), Le = (e, t, r) => {
300
300
  var a;
301
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(
302
+ }, re = z.forwardRef((e, t) => {
303
+ const { onClick: r, noInternalClick: a = !1, ...o } = e;
304
+ return /* @__PURE__ */ l(
305
305
  "button",
306
306
  {
307
307
  ref: t,
308
- onClick: (o) => {
309
- Be(o, a, r);
308
+ onClick: (i) => {
309
+ Le(i, a, r);
310
310
  },
311
- ...i
311
+ ...o
312
312
  }
313
313
  );
314
314
  });
315
- K.displayName = "BaseButton";
316
- function Re() {
317
- const e = _(!1);
315
+ re.displayName = "BaseButton";
316
+ function Oe() {
317
+ const e = I(!1);
318
318
  return B(() => (e.current = !0, () => {
319
319
  e.current = !1;
320
- }), []), le(() => e.current, []);
320
+ }), []), ue(() => e.current, []);
321
321
  }
322
- function Me(e) {
323
- return Z(() => e.every((t) => t == null) ? () => {
322
+ function Ae(e) {
323
+ return Q(() => e.every((t) => t == null) ? () => {
324
324
  } : (t) => {
325
325
  e.forEach((r) => {
326
326
  typeof r == "function" ? r(t) : r != null && (r.current = t);
327
327
  });
328
328
  }, e);
329
329
  }
330
- const Le = {
330
+ const Pe = {
331
331
  x: 0,
332
332
  y: 0,
333
333
  width: 0,
@@ -337,148 +337,166 @@ const Le = {
337
337
  bottom: 0,
338
338
  right: 0
339
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];
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
343
  s && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
344
- a.current && t() && o(s.contentRect);
344
+ a.current && t() && i(s.contentRect);
345
345
  }));
346
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];
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
350
  }
351
- const Te = {
351
+ const R = {
352
352
  small: 24,
353
353
  // w-6
354
354
  medium: 32,
355
355
  // w-8
356
356
  large: 48
357
357
  // w-12
358
- }, Ae = {
358
+ }, De = {
359
359
  small: 8 * 2,
360
360
  // px-2 x 2
361
361
  medium: 12 * 2,
362
362
  // px-3 x 2
363
363
  large: 16 * 2
364
364
  // px-4 x 2
365
- }, Oe = 2, $ = z.forwardRef(
365
+ }, $e = 2, ze = 300, V = z.forwardRef(
366
366
  ({
367
367
  children: e,
368
368
  disabled: t = !1,
369
369
  mode: r = "system",
370
370
  focusMode: a = "system",
371
- fullWidth: i = !1,
372
- className: o,
373
- type: l = "button",
374
- raw: d = !1,
371
+ fullWidth: o = !1,
372
+ className: i,
373
+ type: c = "button",
374
+ raw: u = !1,
375
375
  noBorder: s = !1,
376
- "aria-label": m,
377
- label: f,
378
- size: g = "medium",
379
- labelRight: u,
376
+ "aria-label": g,
377
+ label: b,
378
+ size: m = "medium",
379
+ labelRight: d,
380
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,
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
391
  mode: r,
392
392
  focusMode: a,
393
- fullWidth: i,
393
+ fullWidth: o,
394
394
  disabled: t,
395
- raw: d,
396
- className: o,
395
+ raw: u,
396
+ className: i,
397
397
  noBorder: s,
398
- size: g,
399
- labelRight: u,
398
+ size: m,
399
+ labelRight: d,
400
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`));
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
+ }
411
416
  }, [
412
- M,
413
- u,
414
- p,
415
- L,
417
+ O,
418
+ d,
419
+ v,
420
+ A,
416
421
  h,
417
- x,
418
- g,
419
- k
420
- ]), /* @__PURE__ */ S(
421
- K,
422
+ y,
423
+ m,
424
+ p
425
+ ]), B(() => () => {
426
+ _.current && clearTimeout(_.current);
427
+ }, []), /* @__PURE__ */ l(
428
+ re,
422
429
  {
423
- ref: ne,
424
- className: oe,
430
+ ref: de,
431
+ className: le,
425
432
  disabled: t,
426
- type: l,
427
- "aria-label": m || f,
428
- ...te,
429
- children: [
430
- /* @__PURE__ */ c(
431
- G,
433
+ type: c,
434
+ "aria-label": g || b,
435
+ ...oe,
436
+ children: /* @__PURE__ */ T("div", { className: se, children: [
437
+ /* @__PURE__ */ l(
438
+ q,
432
439
  {
433
440
  label: h,
434
- labelRef: x,
435
- labelClass: D,
436
- labelInnerClass: "pr-2"
441
+ labelRef: y,
442
+ labelClass: U,
443
+ labelInnerClass: "pr-2",
444
+ initiallyHidden: p
437
445
  }
438
446
  ),
439
- /* @__PURE__ */ c("span", { ref: E, className: ie, children: e }),
440
- /* @__PURE__ */ c(
441
- G,
447
+ /* @__PURE__ */ l("span", { ref: S, className: ce, children: e }),
448
+ /* @__PURE__ */ l(
449
+ q,
442
450
  {
443
- label: u,
444
- labelRef: p,
445
- labelClass: D,
446
- labelInnerClass: "pl-2"
451
+ label: d,
452
+ labelRef: v,
453
+ labelClass: U,
454
+ labelInnerClass: "pl-2",
455
+ initiallyHidden: p
447
456
  }
448
457
  )
449
- ]
458
+ ] })
450
459
  }
451
460
  );
452
461
  }
453
- ), G = ({
462
+ ), q = ({
454
463
  labelRef: e,
455
464
  labelClass: t,
456
465
  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";
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";
460
478
  /*!
461
- @versini/ui-button v6.0.5
479
+ @versini/ui-button v6.0.6
462
480
  © 2025 gizmette.com
463
481
  */
464
482
  try {
465
483
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
466
- version: "6.0.5",
467
- buildTime: "04/12/2025 09:18 AM EDT",
484
+ version: "6.0.6",
485
+ buildTime: "05/26/2025 03:48 PM EDT",
468
486
  homepage: "https://github.com/aversini/ui-components",
469
487
  license: "MIT"
470
488
  });
471
489
  } catch {
472
490
  }
473
- const ze = z.forwardRef(
491
+ const Fe = z.forwardRef(
474
492
  ({
475
493
  children: e,
476
494
  mode: t = "system",
477
495
  className: r,
478
496
  active: a = !1,
479
- ...i
480
- }, o) => {
481
- const l = a ? n(
497
+ ...o
498
+ }, i) => {
499
+ const c = a ? n(
482
500
  "relative",
483
501
  "focus-within:static",
484
502
  "focus-within:after:border-transparent",
@@ -495,45 +513,45 @@ const ze = z.forwardRef(
495
513
  "after:border-table-light dark:after:border-table-dark": t === "alt-system"
496
514
  }
497
515
  ) : "";
498
- return /* @__PURE__ */ c("div", { className: l, children: /* @__PURE__ */ c(
499
- $,
516
+ return /* @__PURE__ */ l("div", { className: c, children: /* @__PURE__ */ l(
517
+ V,
500
518
  {
501
519
  className: n("justify-center", r),
502
- ref: o,
520
+ ref: i,
503
521
  mode: t,
504
522
  radius: "small",
505
- ...i,
523
+ ...o,
506
524
  children: e
507
525
  }
508
526
  ) });
509
527
  }
510
528
  );
511
- ze.displayName = "ButtonSort";
512
- const Pe = ({
529
+ Fe.displayName = "ButtonSort";
530
+ const Ve = ({
513
531
  children: e,
514
532
  fill: t,
515
533
  viewBox: r,
516
534
  className: a,
517
- defaultViewBox: i,
518
- size: o,
519
- title: l,
520
- semantic: d = !1,
535
+ defaultViewBox: o,
536
+ size: i,
537
+ title: c,
538
+ semantic: u = !1,
521
539
  ...s
522
540
  }) => {
523
- const m = n(o, a);
524
- return /* @__PURE__ */ c(X, { children: /* @__PURE__ */ S(
541
+ const g = n(i, a);
542
+ return /* @__PURE__ */ l(J, { children: /* @__PURE__ */ T(
525
543
  "svg",
526
544
  {
527
545
  xmlns: "http://www.w3.org/2000/svg",
528
- className: m,
529
- viewBox: r || i,
546
+ className: g,
547
+ viewBox: r || o,
530
548
  fill: t || "currentColor",
531
549
  role: "img",
532
- "aria-hidden": !d,
550
+ "aria-hidden": !u,
533
551
  focusable: !1,
534
552
  ...s,
535
553
  children: [
536
- l && d && /* @__PURE__ */ c("title", { children: l }),
554
+ c && u && /* @__PURE__ */ l("title", { children: c }),
537
555
  e
538
556
  ]
539
557
  }
@@ -546,28 +564,28 @@ const Pe = ({
546
564
  try {
547
565
  window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
548
566
  version: "4.2.0",
549
- buildTime: "04/05/2025 07:49 PM EDT",
567
+ buildTime: "05/17/2025 06:18 PM EDT",
550
568
  homepage: "https://github.com/aversini/ui-components",
551
569
  license: "MIT"
552
570
  });
553
571
  } catch {
554
572
  }
555
- const $e = ({
573
+ const Ue = ({
556
574
  className: e,
557
575
  viewBox: t,
558
576
  title: r,
559
577
  monotone: a,
560
- ...i
561
- }) => /* @__PURE__ */ c(
562
- Pe,
578
+ ...o
579
+ }) => /* @__PURE__ */ l(
580
+ Ve,
563
581
  {
564
582
  defaultViewBox: "0 0 384 512",
565
583
  size: "size-5",
566
584
  viewBox: t,
567
585
  className: e,
568
586
  title: r || "Close",
569
- ...i,
570
- children: /* @__PURE__ */ c(
587
+ ...o,
588
+ children: /* @__PURE__ */ l(
571
589
  "path",
572
590
  {
573
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",
@@ -577,106 +595,106 @@ const $e = ({
577
595
  }
578
596
  );
579
597
  /*!
580
- @versini/ui-icons v4.9.0
598
+ @versini/ui-icons v4.10.0
581
599
  © 2025 gizmette.com
582
600
  */
583
601
  try {
584
602
  window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
585
- version: "4.9.0",
586
- buildTime: "04/05/2025 07:49 PM EDT",
603
+ version: "4.10.0",
604
+ buildTime: "05/17/2025 06:18 PM EDT",
587
605
  homepage: "https://github.com/aversini/ui-components",
588
606
  license: "MIT"
589
607
  });
590
608
  } catch {
591
609
  }
592
- const Q = b.createContext(null);
593
- function De({
610
+ const te = f.createContext(null);
611
+ function je({
594
612
  initialOpen: e = !1,
595
613
  open: t,
596
614
  onOpenChange: r
597
615
  } = {}) {
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, {
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, {
602
620
  enabled: t == null
603
- }), v = de(u, {
621
+ }), x = he(d, {
604
622
  outsidePress: !1,
605
623
  outsidePressEvent: "mousedown"
606
- }), I = ue(u), y = me([h, v, I]);
607
- return b.useMemo(
624
+ }), E = fe(d), w = be([h, x, E]);
625
+ return f.useMemo(
608
626
  () => ({
609
- open: m,
610
- setOpen: f,
611
- ...y,
612
- ...g,
613
- labelId: o,
614
- descriptionId: d,
615
- setLabelId: l,
627
+ open: g,
628
+ setOpen: b,
629
+ ...w,
630
+ ...m,
631
+ labelId: i,
632
+ descriptionId: u,
633
+ setLabelId: c,
616
634
  setDescriptionId: s
617
635
  }),
618
- [m, f, y, g, o, d]
636
+ [g, b, w, m, i, u]
619
637
  );
620
638
  }
621
- const R = () => {
622
- const e = b.useContext(Q);
639
+ const L = () => {
640
+ const e = f.useContext(te);
623
641
  if (e == null)
624
642
  throw new Error("Modal components must be wrapped in <Modal />");
625
643
  return e;
626
644
  };
627
- function Ve({
645
+ function Ge({
628
646
  children: e,
629
647
  ...t
630
648
  }) {
631
- const r = De(t);
632
- return /* @__PURE__ */ c(Q.Provider, { value: r, children: e });
649
+ const r = je(t);
650
+ return /* @__PURE__ */ l(te.Provider, { value: r, children: e });
633
651
  }
634
- const Fe = b.forwardRef(function(e, t) {
635
- const { context: r, ...a } = R(), i = ge([a.refs.setFloating, t]);
652
+ const Ye = f.forwardRef(function(e, t) {
653
+ const { context: r, ...a } = L(), o = ve([a.refs.setFloating, t]);
636
654
  if (!r.open)
637
655
  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
656
+ const { overlayBackground: i, ...c } = e, u = n("grid place-items-center", {
657
+ [`${i}`]: i,
658
+ "bg-black sm:bg-black/[.8]": !i
641
659
  });
642
- return /* @__PURE__ */ c(he, { children: /* @__PURE__ */ c(be, { className: d, lockScroll: !0, children: /* @__PURE__ */ c(fe, { context: r, children: /* @__PURE__ */ c(
660
+ return /* @__PURE__ */ l(ye, { children: /* @__PURE__ */ l(pe, { className: u, lockScroll: !0, children: /* @__PURE__ */ l(ke, { context: r, children: /* @__PURE__ */ l(
643
661
  "div",
644
662
  {
645
- ref: i,
663
+ ref: o,
646
664
  "aria-labelledby": a.labelId,
647
665
  "aria-describedby": a.descriptionId,
648
- ...a.getFloatingProps(l),
649
- children: l.children
666
+ ...a.getFloatingProps(c),
667
+ children: c.children
650
668
  }
651
669
  ) }) }) });
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, {
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, {
661
679
  ref: t,
662
- onClick: l,
663
- ...o
680
+ onClick: c,
681
+ ...i
664
682
  }) });
665
683
  });
666
684
  /*!
667
- @versini/ui-modal v2.0.2
685
+ @versini/ui-modal v2.0.3
668
686
  © 2025 gizmette.com
669
687
  */
670
688
  try {
671
689
  window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
672
- version: "2.0.2",
673
- buildTime: "04/12/2025 09:18 AM EDT",
690
+ version: "2.0.3",
691
+ buildTime: "05/26/2025 03:48 PM EDT",
674
692
  homepage: "https://github.com/aversini/ui-components",
675
693
  license: "MIT"
676
694
  });
677
695
  } catch {
678
696
  }
679
- const N = "panel", C = "messagebox", Ge = ({
697
+ const C = "panel", M = "messagebox", Xe = ({
680
698
  className: e,
681
699
  kind: t,
682
700
  borderMode: r,
@@ -684,86 +702,86 @@ const N = "panel", C = "messagebox", Ge = ({
684
702
  }) => ({
685
703
  main: n("prose prose-lighter flex flex-col bg-surface-medium", {
686
704
  "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,
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,
691
709
  [`${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
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
696
714
  }),
697
715
  content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
698
716
  footer: "flex grow flex-col sm:p-4 p-2",
699
717
  header: "sm:p-4 mb-0 p-2",
700
718
  close: "sm:p-4 p-2"
701
- }), We = "slide", W = "fade", Je = ({
719
+ }), Je = "slide", X = "fade", rr = ({
702
720
  open: e,
703
721
  onOpenChange: t,
704
722
  title: r,
705
723
  children: a,
706
- footer: i,
707
- borderMode: o = "light",
708
- kind: l = N,
709
- className: d,
724
+ footer: o,
725
+ borderMode: i = "light",
726
+ kind: c = C,
727
+ className: u,
710
728
  animation: s = !1,
711
- animationType: m = We
729
+ animationType: g = Je
712
730
  }) => {
713
- const f = _(""), [g, u] = q(
714
- s ? m === W ? { opacity: 0 } : {
731
+ const b = I(""), [m, d] = K(
732
+ s ? g === X ? { opacity: 0 } : {
715
733
  transform: "translateY(-100vh)"
716
734
  } : {}
717
- ), h = Ge({
718
- className: d,
719
- kind: l,
720
- borderMode: o,
735
+ ), h = Xe({
736
+ className: u,
737
+ kind: c,
738
+ borderMode: i,
721
739
  animation: s
722
740
  });
723
- return B(() => (e && (f.current = document.title, document.title = `${r} | ${f.current}`), () => {
724
- e && (document.title = f.current);
741
+ return B(() => (e && (b.current = document.title, document.title = `${r} | ${b.current}`), () => {
742
+ e && (document.title = b.current);
725
743
  }), [r, e]), B(() => {
726
744
  if (s && e) {
727
- u(
728
- s ? m === W ? { opacity: 0 } : {
745
+ d(
746
+ s ? g === X ? { opacity: 0 } : {
729
747
  transform: "translateY(-666vh)"
730
748
  } : {}
731
749
  );
732
- const v = setTimeout(() => {
733
- u(
734
- s ? m === "fade" ? { opacity: 1 } : {
750
+ const x = setTimeout(() => {
751
+ d(
752
+ s ? g === "fade" ? { opacity: 1 } : {
735
753
  transform: "translateY(0)"
736
754
  } : {}
737
755
  );
738
756
  }, 100);
739
- return () => clearTimeout(v);
757
+ return () => clearTimeout(x);
740
758
  }
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,
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,
745
763
  {
746
764
  className: h.close,
747
- trigger: /* @__PURE__ */ c(
748
- $,
765
+ trigger: /* @__PURE__ */ l(
766
+ V,
749
767
  {
750
768
  mode: "dark",
751
769
  focusMode: "light",
752
770
  noBorder: !0,
753
771
  label: "Close",
754
- children: /* @__PURE__ */ c($e, {})
772
+ children: /* @__PURE__ */ l(Ue, {})
755
773
  }
756
774
  )
757
775
  }
758
776
  ),
759
- /* @__PURE__ */ c(Ue, { className: h.header, children: r })
777
+ /* @__PURE__ */ l(He, { className: h.header, children: r })
760
778
  ] }),
761
- /* @__PURE__ */ c(je, { className: h.content, children: a }),
762
- i && /* @__PURE__ */ c("div", { className: h.footer, children: i })
779
+ /* @__PURE__ */ l(We, { className: h.content, children: a }),
780
+ o && /* @__PURE__ */ l("div", { className: h.footer, children: o })
763
781
  ] }) }) });
764
782
  };
765
783
  export {
766
- U as MESSAGEBOX_CLASSNAME,
767
- j as PANEL_CLASSNAME,
768
- Je as Panel
784
+ Y as MESSAGEBOX_CLASSNAME,
785
+ H as PANEL_CLASSNAME,
786
+ rr as Panel
769
787
  };
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.0.5
3
+ @versini/ui-panel v2.0.6
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
8
- version: "2.0.5",
9
- buildTime: "04/12/2025 09:18 AM EDT",
8
+ version: "2.0.6",
9
+ buildTime: "05/26/2025 03:48 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.0.5",
3
+ "version": "2.0.6",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -40,14 +40,14 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@tailwindcss/typography": "0.5.16",
43
- "@versini/ui-button": "6.0.5",
44
- "@versini/ui-icons": "4.9.0",
45
- "@versini/ui-modal": "2.0.2",
43
+ "@versini/ui-button": "6.0.6",
44
+ "@versini/ui-icons": "4.10.0",
45
+ "@versini/ui-modal": "2.0.3",
46
46
  "clsx": "2.1.1",
47
- "tailwindcss": "4.1.3"
47
+ "tailwindcss": "4.1.7"
48
48
  },
49
49
  "sideEffects": [
50
50
  "**/*.css"
51
51
  ],
52
- "gitHead": "1bc09c4f0904bd8c01a22b1a32299fdd7598ae32"
52
+ "gitHead": "863a399128080a19f2668e458d495110aa0f68f8"
53
53
  }