@versini/ui-panel 1.3.10 → 1.3.11

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.
Files changed (2) hide show
  1. package/dist/index.js +92 -84
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- import { jsx as n, jsxs as x, Fragment as $ } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as x, Fragment as V } from "react/jsx-runtime";
2
2
  import i from "clsx";
3
3
  import * as m from "react";
4
- import M, { useId as P, useRef as D, useEffect as W } from "react";
5
- import { useFloating as G, useClick as X, useDismiss as Y, useRole as q, useInteractions as H, useMergeRefs as J, FloatingPortal as K, FloatingOverlay as Q, FloatingFocusManager as Z } from "@floating-ui/react";
4
+ import C, { useId as z, useRef as D, useEffect as W } from "react";
5
+ import { useFloating as G, useClick as Y, useDismiss as X, useRole as q, useInteractions as H, useMergeRefs as J, FloatingPortal as K, FloatingOverlay as Q, FloatingFocusManager as Z } from "@floating-ui/react";
6
6
  /*!
7
- @versini/ui-panel v1.3.10
7
+ @versini/ui-panel v1.3.11
8
8
  © 2025 gizmette.com
9
9
  */
10
10
  try {
11
11
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
12
- version: "1.3.10",
13
- buildTime: "01/14/2025 10:39 AM EST",
12
+ version: "1.3.11",
13
+ buildTime: "01/16/2025 07:57 PM EST",
14
14
  homepage: "https://github.com/aversini/ui-components",
15
15
  license: "MIT"
16
16
  });
17
17
  } catch {
18
18
  }
19
- const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "button", T = "link", ee = ({
19
+ const P = "av-messagebox", O = "av-panel", $ = "av-button", _ = "icon", U = "button", M = "link", ee = ({
20
20
  type: e,
21
21
  size: t,
22
22
  labelRight: r,
@@ -25,8 +25,8 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
25
25
  }) => {
26
26
  const l = "max-h-8 py-0 px-2", s = "max-h-9 h-8 px-3", d = "max-h-12 py-2 px-4";
27
27
  switch (e) {
28
- case V:
29
- case T:
28
+ case U:
29
+ case M:
30
30
  return i({
31
31
  [l]: t === "small",
32
32
  [s]: t === "medium",
@@ -53,10 +53,10 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
53
53
  }) => {
54
54
  const o = "text-sm font-medium", l = "text-base font-medium", s = "text-lg font-medium";
55
55
  switch (e) {
56
- case V:
57
- case T:
56
+ case U:
57
+ case M:
58
58
  return i({
59
- "text-center": e === T,
59
+ "text-center": e === M,
60
60
  [o]: t === "small",
61
61
  [l]: t === "medium",
62
62
  [s]: t === "large"
@@ -237,7 +237,19 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
237
237
  "focus:outline-focus-light": e === "light",
238
238
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
239
239
  "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
240
- }), z = ({
240
+ }), se = ({
241
+ mode: e,
242
+ raw: t,
243
+ iconClassName: r
244
+ }) => t ? "" : i(
245
+ {
246
+ "text-copy-accent-dark": e === "light" || e === "alt-system",
247
+ "text-copy-light": e === "dark" || e === "system",
248
+ "dark:text-copy-light": e === "alt-system",
249
+ "dark:text-copy-accent-dark": e === "system"
250
+ },
251
+ r
252
+ ), A = ({
241
253
  type: e,
242
254
  className: t,
243
255
  raw: r,
@@ -254,8 +266,8 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
254
266
  noTruncate: u,
255
267
  align: v,
256
268
  radius: p
257
- }) => (c || (c = "primary"), r ? i(O, t) : i(
258
- O,
269
+ }) => (c || (c = "primary"), r ? i($, t) : i(
270
+ $,
259
271
  te({
260
272
  mode: a,
261
273
  variant: c,
@@ -281,24 +293,24 @@ const C = "av-messagebox", A = "av-panel", O = "av-button", _ = "icon", V = "but
281
293
  "disabled:cursor-not-allowed disabled:opacity-50": l
282
294
  },
283
295
  t
284
- )), se = (e, t, r) => {
296
+ )), ce = (e, t, r) => {
285
297
  var a;
286
298
  !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);
287
- }, L = M.forwardRef((e, t) => {
299
+ }, L = C.forwardRef((e, t) => {
288
300
  const { onClick: r, noInternalClick: a = !1, ...o } = e;
289
301
  return /* @__PURE__ */ n(
290
302
  "button",
291
303
  {
292
304
  ref: t,
293
305
  onClick: (l) => {
294
- se(l, a, r);
306
+ ce(l, a, r);
295
307
  },
296
308
  ...o
297
309
  }
298
310
  );
299
311
  });
300
312
  L.displayName = "BaseButton";
301
- const U = M.forwardRef(
313
+ const F = C.forwardRef(
302
314
  ({
303
315
  children: e,
304
316
  disabled: t = !1,
@@ -318,9 +330,10 @@ const U = M.forwardRef(
318
330
  align: p = "center",
319
331
  radius: y = "large",
320
332
  variant: I = "primary",
321
- ...E
322
- }, B) => {
323
- const S = z({
333
+ iconClassName: E,
334
+ ...B
335
+ }, S) => {
336
+ const R = A({
324
337
  type: _,
325
338
  mode: r,
326
339
  focusMode: a,
@@ -336,45 +349,40 @@ const U = M.forwardRef(
336
349
  align: p,
337
350
  radius: y,
338
351
  variant: I
339
- }), R = i({
340
- "text-copy-accent-dark": (r === "light" || r === "alt-system") && !d,
341
- "text-copy-light": (r === "dark" || r === "system") && !d,
342
- "dark:text-copy-light": r === "alt-system" && !d,
343
- "dark:text-copy-accent-dark": r === "system" && !d
344
- });
352
+ }), T = se({ mode: r, raw: d, iconClassName: E });
345
353
  return /* @__PURE__ */ x(
346
354
  L,
347
355
  {
348
- ref: B,
349
- className: S,
356
+ ref: S,
357
+ className: R,
350
358
  disabled: t,
351
359
  type: s,
352
360
  "aria-label": g || b,
353
- ...E,
361
+ ...B,
354
362
  children: [
355
363
  u && /* @__PURE__ */ n("span", { className: "pr-2", children: u }),
356
- /* @__PURE__ */ n("div", { className: R, children: e }),
364
+ /* @__PURE__ */ n("div", { className: T, children: e }),
357
365
  c && /* @__PURE__ */ n("span", { className: "pl-2", children: c })
358
366
  ]
359
367
  }
360
368
  );
361
369
  }
362
370
  );
363
- U.displayName = "ButtonIcon";
371
+ F.displayName = "ButtonIcon";
364
372
  /*!
365
- @versini/ui-button v4.0.10
373
+ @versini/ui-button v4.1.0
366
374
  © 2025 gizmette.com
367
375
  */
368
376
  try {
369
377
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
370
- version: "4.0.10",
371
- buildTime: "01/14/2025 10:39 AM EST",
378
+ version: "4.1.0",
379
+ buildTime: "01/16/2025 07:57 PM EST",
372
380
  homepage: "https://github.com/aversini/ui-components",
373
381
  license: "MIT"
374
382
  });
375
383
  } catch {
376
384
  }
377
- const ce = M.forwardRef(
385
+ const ge = C.forwardRef(
378
386
  ({
379
387
  children: e,
380
388
  disabled: t = !1,
@@ -396,7 +404,7 @@ const ce = M.forwardRef(
396
404
  radius: I = "large",
397
405
  ...E
398
406
  }, B) => {
399
- const S = z({
407
+ const S = A({
400
408
  type: _,
401
409
  mode: r,
402
410
  focusMode: a,
@@ -416,7 +424,7 @@ const ce = M.forwardRef(
416
424
  "text-copy-light": r === "dark" && !d,
417
425
  "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
418
426
  "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
419
- }), j = y ? i(
427
+ }), T = y ? i(
420
428
  "relative",
421
429
  "focus-within:static",
422
430
  "focus-within:after:border-transparent",
@@ -433,7 +441,7 @@ const ce = M.forwardRef(
433
441
  "after:border-table-light dark:after:border-table-dark": r === "alt-system"
434
442
  }
435
443
  ) : "";
436
- return /* @__PURE__ */ n("div", { className: j, children: /* @__PURE__ */ x(
444
+ return /* @__PURE__ */ n("div", { className: T, children: /* @__PURE__ */ x(
437
445
  L,
438
446
  {
439
447
  ref: B,
@@ -451,8 +459,8 @@ const ce = M.forwardRef(
451
459
  ) });
452
460
  }
453
461
  );
454
- ce.displayName = "ButtonSort";
455
- const ge = ({
462
+ ge.displayName = "ButtonSort";
463
+ const me = ({
456
464
  children: e,
457
465
  fill: t,
458
466
  viewBox: r,
@@ -464,7 +472,7 @@ const ge = ({
464
472
  ...h
465
473
  }) => {
466
474
  const g = i(l, a);
467
- return /* @__PURE__ */ x($, { children: [
475
+ return /* @__PURE__ */ x(V, { children: [
468
476
  /* @__PURE__ */ n(
469
477
  "svg",
470
478
  {
@@ -483,26 +491,26 @@ const ge = ({
483
491
  ] });
484
492
  };
485
493
  /*!
486
- @versini/ui-svgicon v4.0.3
494
+ @versini/ui-svgicon v4.0.4
487
495
  © 2025 gizmette.com
488
496
  */
489
497
  try {
490
498
  window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
491
- version: "4.0.3",
492
- buildTime: "01/14/2025 10:39 AM EST",
499
+ version: "4.0.4",
500
+ buildTime: "01/16/2025 07:57 PM EST",
493
501
  homepage: "https://github.com/aversini/ui-components",
494
502
  license: "MIT"
495
503
  });
496
504
  } catch {
497
505
  }
498
- const me = ({
506
+ const he = ({
499
507
  className: e,
500
508
  viewBox: t,
501
509
  title: r,
502
510
  monotone: a,
503
511
  ...o
504
512
  }) => /* @__PURE__ */ n(
505
- ge,
513
+ me,
506
514
  {
507
515
  defaultViewBox: "0 0 384 512",
508
516
  size: "size-5",
@@ -514,20 +522,20 @@ const me = ({
514
522
  }
515
523
  );
516
524
  /*!
517
- @versini/ui-icons v4.4.2
525
+ @versini/ui-icons v4.4.3
518
526
  © 2025 gizmette.com
519
527
  */
520
528
  try {
521
529
  window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
522
- version: "4.4.2",
523
- buildTime: "01/14/2025 10:39 AM EST",
530
+ version: "4.4.3",
531
+ buildTime: "01/16/2025 07:57 PM EST",
524
532
  homepage: "https://github.com/aversini/ui-components",
525
533
  license: "MIT"
526
534
  });
527
535
  } catch {
528
536
  }
529
- const F = m.createContext(null);
530
- function he({
537
+ const j = m.createContext(null);
538
+ function ue({
531
539
  initialOpen: e = !1,
532
540
  open: t,
533
541
  onOpenChange: r
@@ -535,9 +543,9 @@ function he({
535
543
  const [a, o] = m.useState(e), [l, s] = m.useState(), [d, h] = m.useState(), g = t ?? a, b = r ?? o, f = G({
536
544
  open: g,
537
545
  onOpenChange: b
538
- }), c = f.context, u = X(c, {
546
+ }), c = f.context, u = Y(c, {
539
547
  enabled: t == null
540
- }), v = Y(c, {
548
+ }), v = X(c, {
541
549
  outsidePress: !1,
542
550
  outsidePressEvent: "mousedown"
543
551
  }), p = q(c), y = H([u, v, p]);
@@ -556,19 +564,19 @@ function he({
556
564
  );
557
565
  }
558
566
  const N = () => {
559
- const e = m.useContext(F);
567
+ const e = m.useContext(j);
560
568
  if (e == null)
561
569
  throw new Error("Modal components must be wrapped in <Modal />");
562
570
  return e;
563
571
  };
564
- function ue({
572
+ function be({
565
573
  children: e,
566
574
  ...t
567
575
  }) {
568
- const r = he(t);
569
- return /* @__PURE__ */ n(F.Provider, { value: r, children: e });
576
+ const r = ue(t);
577
+ return /* @__PURE__ */ n(j.Provider, { value: r, children: e });
570
578
  }
571
- const be = m.forwardRef(function(e, t) {
579
+ const fe = m.forwardRef(function(e, t) {
572
580
  const { context: r, ...a } = N(), o = J([a.refs.setFloating, t]);
573
581
  if (!r.open)
574
582
  return null;
@@ -586,13 +594,13 @@ const be = m.forwardRef(function(e, t) {
586
594
  children: s.children
587
595
  }
588
596
  ) }) }) });
589
- }), fe = m.forwardRef(function({ children: e, ...t }, r) {
590
- const { setLabelId: a } = N(), o = P();
591
- return m.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ n("h1", { ...t, ref: r, id: o, children: e });
592
597
  }), ve = m.forwardRef(function({ children: e, ...t }, r) {
593
- const { setDescriptionId: a } = N(), o = P();
598
+ const { setLabelId: a } = N(), o = z();
599
+ return m.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ n("h1", { ...t, ref: r, id: o, children: e });
600
+ }), pe = m.forwardRef(function({ children: e, ...t }, r) {
601
+ const { setDescriptionId: a } = N(), o = z();
594
602
  return m.useLayoutEffect(() => (a(o), () => a(void 0)), [o, a]), /* @__PURE__ */ n("div", { ...t, ref: r, id: o, children: e });
595
- }), pe = m.forwardRef(function(e, t) {
603
+ }), ye = m.forwardRef(function(e, t) {
596
604
  const { setOpen: r } = N(), { trigger: a, className: o, ...l } = e, s = m.useCallback(() => r(!1), [r]);
597
605
  return /* @__PURE__ */ n("div", { className: o, children: m.cloneElement(a, {
598
606
  ref: t,
@@ -601,28 +609,28 @@ const be = m.forwardRef(function(e, t) {
601
609
  }) });
602
610
  });
603
611
  /*!
604
- @versini/ui-modal v1.2.4
612
+ @versini/ui-modal v1.2.5
605
613
  © 2025 gizmette.com
606
614
  */
607
615
  try {
608
616
  window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
609
- version: "1.2.4",
610
- buildTime: "01/14/2025 10:39 AM EST",
617
+ version: "1.2.5",
618
+ buildTime: "01/16/2025 07:57 PM EST",
611
619
  homepage: "https://github.com/aversini/ui-components",
612
620
  license: "MIT"
613
621
  });
614
622
  } catch {
615
623
  }
616
- const k = "panel", w = "messagebox", ye = ({
624
+ const k = "panel", w = "messagebox", ke = ({
617
625
  className: e,
618
626
  kind: t,
619
627
  borderMode: r
620
628
  }) => ({
621
629
  main: i("prose prose-lighter flex flex-col bg-surface-medium", {
622
- [`${A} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === k,
623
- [`${A} w-full sm:w-[95%] md:max-w-2xl`]: t === k && !e,
624
- [`${C} rounded-lg border-2`]: t === w,
625
- [`${C} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === w && !e,
630
+ [`${O} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === k,
631
+ [`${O} w-full sm:w-[95%] md:max-w-2xl`]: t === k && !e,
632
+ [`${P} rounded-lg border-2`]: t === w,
633
+ [`${P} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === w && !e,
626
634
  [`${e}`]: !!e,
627
635
  "sm:border-border-dark": r === "dark" && t === k,
628
636
  "sm:border-border-accent": r === "light" && t === k,
@@ -633,7 +641,7 @@ const k = "panel", w = "messagebox", ye = ({
633
641
  footer: "flex flex-grow flex-col sm:p-4 p-2",
634
642
  header: "sm:p-4 mb-0 p-2",
635
643
  close: "sm:p-4 p-2"
636
- }), Ne = ({
644
+ }), Ie = ({
637
645
  open: e,
638
646
  onOpenChange: t,
639
647
  title: r,
@@ -643,35 +651,35 @@ const k = "panel", w = "messagebox", ye = ({
643
651
  kind: s = k,
644
652
  className: d
645
653
  }) => {
646
- const h = D(""), g = ye({ className: d, kind: s, borderMode: l });
654
+ const h = D(""), g = ke({ className: d, kind: s, borderMode: l });
647
655
  return W(() => (e && (h.current = document.title, document.title = `${r} | ${h.current}`), () => {
648
656
  e && (document.title = h.current);
649
- }), [r, e]), /* @__PURE__ */ n($, { children: e && /* @__PURE__ */ n(ue, { open: e, onOpenChange: t, children: /* @__PURE__ */ x(be, { className: g.main, children: [
657
+ }), [r, e]), /* @__PURE__ */ n(V, { children: e && /* @__PURE__ */ n(be, { open: e, onOpenChange: t, children: /* @__PURE__ */ x(fe, { className: g.main, children: [
650
658
  /* @__PURE__ */ x("div", { className: "flex flex-row-reverse items-center justify-between", children: [
651
659
  /* @__PURE__ */ n(
652
- pe,
660
+ ye,
653
661
  {
654
662
  className: g.close,
655
663
  trigger: /* @__PURE__ */ n(
656
- U,
664
+ F,
657
665
  {
658
666
  mode: "dark",
659
667
  focusMode: "light",
660
668
  noBorder: !0,
661
669
  label: "Close",
662
- children: /* @__PURE__ */ n(me, {})
670
+ children: /* @__PURE__ */ n(he, {})
663
671
  }
664
672
  )
665
673
  }
666
674
  ),
667
- /* @__PURE__ */ n(fe, { className: g.header, children: r })
675
+ /* @__PURE__ */ n(ve, { className: g.header, children: r })
668
676
  ] }),
669
- /* @__PURE__ */ n(ve, { className: g.content, children: a }),
677
+ /* @__PURE__ */ n(pe, { className: g.content, children: a }),
670
678
  o && /* @__PURE__ */ n("div", { className: g.footer, children: o })
671
679
  ] }) }) });
672
680
  };
673
681
  export {
674
- C as MESSAGEBOX_CLASSNAME,
675
- A as PANEL_CLASSNAME,
676
- Ne as Panel
682
+ P as MESSAGEBOX_CLASSNAME,
683
+ O as PANEL_CLASSNAME,
684
+ Ie as Panel
677
685
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -39,14 +39,14 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@tailwindcss/typography": "0.5.16",
42
- "@versini/ui-button": "4.0.10",
43
- "@versini/ui-icons": "4.4.2",
44
- "@versini/ui-modal": "1.2.4",
42
+ "@versini/ui-button": "4.1.0",
43
+ "@versini/ui-icons": "4.4.3",
44
+ "@versini/ui-modal": "1.2.5",
45
45
  "clsx": "2.1.1",
46
46
  "tailwindcss": "3.4.17"
47
47
  },
48
48
  "sideEffects": [
49
49
  "**/*.css"
50
50
  ],
51
- "gitHead": "4c958ec69e74cca8bba692d7988f47151f39f2b7"
51
+ "gitHead": "2be4fd5fe7dd74804533efdedcc6cfa4023a739a"
52
52
  }