@versini/ui-panel 2.2.2 → 2.2.3
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/components/Panel/Panel.js +39 -39
- package/dist/index.js +3 -3
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as s, jsxs as L, Fragment as K } from "react/jsx-runtime";
|
|
2
2
|
import * as h from "react";
|
|
3
|
-
import F, { useRef as N, useLayoutEffect as H, useEffect as B, useState as Q, useMemo as Z, useCallback as
|
|
3
|
+
import F, { useRef as N, useLayoutEffect as H, useEffect as B, useState as Q, useMemo as Z, useCallback as ue, useId as ee } from "react";
|
|
4
4
|
import n from "clsx";
|
|
5
|
-
import { useFloating as
|
|
5
|
+
import { useFloating as me, useClick as ge, useDismiss as he, useRole as fe, useInteractions as be, useMergeRefs as ye, FloatingPortal as ve, FloatingOverlay as pe, FloatingFocusManager as ke } from "@floating-ui/react";
|
|
6
6
|
const q = "av-messagebox", R = "av-panel", X = "av-button", V = "icon", te = "button", D = "link", xe = ({
|
|
7
7
|
type: e,
|
|
8
8
|
size: r,
|
|
@@ -290,21 +290,21 @@ const q = "av-messagebox", R = "av-panel", X = "av-button", V = "icon", te = "bu
|
|
|
290
290
|
noBorder: c,
|
|
291
291
|
labelRight: g,
|
|
292
292
|
labelLeft: y,
|
|
293
|
-
noBackground:
|
|
294
|
-
variant:
|
|
293
|
+
noBackground: u,
|
|
294
|
+
variant: m,
|
|
295
295
|
truncate: f,
|
|
296
296
|
align: b,
|
|
297
297
|
radius: w,
|
|
298
298
|
animated: I
|
|
299
|
-
}) => (
|
|
299
|
+
}) => (m || (m = "primary"), t ? n(X, r) : n(
|
|
300
300
|
X,
|
|
301
301
|
Ie({
|
|
302
302
|
mode: a,
|
|
303
|
-
variant:
|
|
304
|
-
noBackground:
|
|
303
|
+
variant: m,
|
|
304
|
+
noBackground: u,
|
|
305
305
|
truncate: f
|
|
306
306
|
}),
|
|
307
|
-
_e({ mode: a, noBackground:
|
|
307
|
+
_e({ mode: a, noBackground: u, variant: m }),
|
|
308
308
|
Ne({ radius: w }),
|
|
309
309
|
xe({
|
|
310
310
|
type: e,
|
|
@@ -315,10 +315,10 @@ const q = "av-messagebox", R = "av-panel", X = "av-button", V = "icon", te = "bu
|
|
|
315
315
|
animated: I
|
|
316
316
|
}),
|
|
317
317
|
we({ type: e, size: d, labelRight: g, labelLeft: y }),
|
|
318
|
-
Be({ mode: a, variant:
|
|
318
|
+
Be({ mode: a, variant: m, noBorder: c }),
|
|
319
319
|
Se({ focusMode: i }),
|
|
320
|
-
Ee({ mode: a, variant:
|
|
321
|
-
Ce({ mode: a, variant:
|
|
320
|
+
Ee({ mode: a, variant: m, disabled: o }),
|
|
321
|
+
Ce({ mode: a, variant: m, disabled: o }),
|
|
322
322
|
{
|
|
323
323
|
"w-full": l,
|
|
324
324
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
@@ -347,7 +347,7 @@ function $e() {
|
|
|
347
347
|
const e = N(!1);
|
|
348
348
|
return B(() => (e.current = !0, () => {
|
|
349
349
|
e.current = !1;
|
|
350
|
-
}), []),
|
|
350
|
+
}), []), ue(() => e.current, []);
|
|
351
351
|
}
|
|
352
352
|
function Oe(e) {
|
|
353
353
|
return Z(() => e.every((r) => r == null) ? () => {
|
|
@@ -405,8 +405,8 @@ const M = {
|
|
|
405
405
|
noBorder: c = !1,
|
|
406
406
|
"aria-label": g,
|
|
407
407
|
label: y,
|
|
408
|
-
size:
|
|
409
|
-
labelRight:
|
|
408
|
+
size: u = "medium",
|
|
409
|
+
labelRight: m,
|
|
410
410
|
labelLeft: f,
|
|
411
411
|
noBackground: b = !1,
|
|
412
412
|
align: w = "center",
|
|
@@ -425,8 +425,8 @@ const M = {
|
|
|
425
425
|
raw: d,
|
|
426
426
|
className: o,
|
|
427
427
|
noBorder: c,
|
|
428
|
-
size:
|
|
429
|
-
labelRight:
|
|
428
|
+
size: u,
|
|
429
|
+
labelRight: m,
|
|
430
430
|
labelLeft: f,
|
|
431
431
|
noBackground: b,
|
|
432
432
|
align: w,
|
|
@@ -435,22 +435,22 @@ const M = {
|
|
|
435
435
|
animated: k
|
|
436
436
|
}), le = Re({ mode: t, raw: d, iconClassName: ie, variant: j }), G = Me({ animated: k }), ce = "flex items-center justify-center relative w-full h-full overflow-hidden", [v, O] = z(), [p, A] = z(), [S, Y] = z(), P = N(0), x = N(null), E = N(null), de = Oe([ne, x]);
|
|
437
437
|
return H(() => {
|
|
438
|
-
S && S.current && k && (P.current = Y.width + Pe[
|
|
439
|
-
}, [Y, S,
|
|
438
|
+
S && S.current && k && (P.current = Y.width + Pe[u] + (c ? 0 : ze), x.current && !x.current.style.width && (x.current.style.width = `${M[u]}px`));
|
|
439
|
+
}, [Y, S, u, c, k]), H(() => {
|
|
440
440
|
if (x && x.current && k) {
|
|
441
|
-
let C = M[
|
|
442
|
-
|
|
443
|
-
v.current &&
|
|
444
|
-
}, De * 0.8))), C === M[
|
|
441
|
+
let C = M[u];
|
|
442
|
+
m && v && O.width > 0 ? C = O.width + P.current : f && p && A.width > 0 && (C = A.width + P.current), E.current && clearTimeout(E.current), C !== parseInt(x.current.style.width || "0", 10) && (v.current && (v.current.style.opacity = "0"), p.current && (p.current.style.opacity = "0"), x.current.style.width = `${C}px`, C > M[u] && (E.current = setTimeout(() => {
|
|
443
|
+
v.current && m && (v.current.style.opacity = "1"), p.current && f && (p.current.style.opacity = "1"), E.current = null;
|
|
444
|
+
}, De * 0.8))), C === M[u] && (v.current && (v.current.style.opacity = "0"), p.current && (p.current.style.opacity = "0"));
|
|
445
445
|
}
|
|
446
446
|
}, [
|
|
447
447
|
O,
|
|
448
|
-
|
|
448
|
+
m,
|
|
449
449
|
v,
|
|
450
450
|
A,
|
|
451
451
|
f,
|
|
452
452
|
p,
|
|
453
|
-
|
|
453
|
+
u,
|
|
454
454
|
k
|
|
455
455
|
]), B(() => () => {
|
|
456
456
|
E.current && clearTimeout(E.current);
|
|
@@ -478,7 +478,7 @@ const M = {
|
|
|
478
478
|
/* @__PURE__ */ s(
|
|
479
479
|
W,
|
|
480
480
|
{
|
|
481
|
-
label:
|
|
481
|
+
label: m,
|
|
482
482
|
labelRef: v,
|
|
483
483
|
labelClass: G,
|
|
484
484
|
labelInnerClass: "pl-2",
|
|
@@ -512,7 +512,7 @@ U.displayName = "ButtonIcon";
|
|
|
512
512
|
try {
|
|
513
513
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
514
514
|
version: "7.0.0",
|
|
515
|
-
buildTime: "08/07/2025
|
|
515
|
+
buildTime: "08/07/2025 07:27 PM EDT",
|
|
516
516
|
homepage: "https://github.com/aversini/ui-components",
|
|
517
517
|
license: "MIT"
|
|
518
518
|
});
|
|
@@ -643,27 +643,27 @@ function je({
|
|
|
643
643
|
open: r,
|
|
644
644
|
onOpenChange: t
|
|
645
645
|
} = {}) {
|
|
646
|
-
const [a, i] = h.useState(e), [o, l] = h.useState(), [d, c] = h.useState(), g = r ?? a, y = t ?? i,
|
|
646
|
+
const [a, i] = h.useState(e), [o, l] = h.useState(), [d, c] = h.useState(), g = r ?? a, y = t ?? i, u = me({
|
|
647
647
|
open: g,
|
|
648
648
|
onOpenChange: y
|
|
649
|
-
}),
|
|
649
|
+
}), m = u.context, f = ge(m, {
|
|
650
650
|
enabled: r == null
|
|
651
|
-
}), b = he(
|
|
651
|
+
}), b = he(m, {
|
|
652
652
|
outsidePress: !1,
|
|
653
653
|
outsidePressEvent: "mousedown"
|
|
654
|
-
}), w = fe(
|
|
654
|
+
}), w = fe(m), I = be([f, b, w]);
|
|
655
655
|
return h.useMemo(
|
|
656
656
|
() => ({
|
|
657
657
|
open: g,
|
|
658
658
|
setOpen: y,
|
|
659
659
|
...I,
|
|
660
|
-
...
|
|
660
|
+
...u,
|
|
661
661
|
labelId: o,
|
|
662
662
|
descriptionId: d,
|
|
663
663
|
setLabelId: l,
|
|
664
664
|
setDescriptionId: c
|
|
665
665
|
}),
|
|
666
|
-
[g, y, I,
|
|
666
|
+
[g, y, I, u, o, d]
|
|
667
667
|
);
|
|
668
668
|
}
|
|
669
669
|
const $ = () => {
|
|
@@ -718,7 +718,7 @@ const Ye = h.forwardRef(function(e, r) {
|
|
|
718
718
|
try {
|
|
719
719
|
window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
|
|
720
720
|
version: "2.0.6",
|
|
721
|
-
buildTime: "08/07/2025
|
|
721
|
+
buildTime: "08/07/2025 07:27 PM EDT",
|
|
722
722
|
homepage: "https://github.com/aversini/ui-components",
|
|
723
723
|
license: "MIT"
|
|
724
724
|
});
|
|
@@ -731,7 +731,7 @@ const _ = "panel", T = "messagebox", We = ({
|
|
|
731
731
|
animation: a,
|
|
732
732
|
maxWidth: i = "medium"
|
|
733
733
|
}) => ({
|
|
734
|
-
main: n("prose prose-lighter flex flex-col bg-surface-
|
|
734
|
+
main: n("prose prose-lighter flex flex-col bg-surface-dark", {
|
|
735
735
|
"duration-200 ease-out": a,
|
|
736
736
|
[`${R} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: r === _,
|
|
737
737
|
[`${R} w-full sm:w-[95%] md:max-w-2xl`]: r === _ && !e && i === "small",
|
|
@@ -762,7 +762,7 @@ const _ = "panel", T = "messagebox", We = ({
|
|
|
762
762
|
animationType: g = Je,
|
|
763
763
|
maxWidth: y = "medium"
|
|
764
764
|
}) => {
|
|
765
|
-
const
|
|
765
|
+
const u = N(""), [m, f] = Q(
|
|
766
766
|
c ? g === J ? { opacity: 0 } : {
|
|
767
767
|
transform: "translateY(-100vh)"
|
|
768
768
|
} : {}
|
|
@@ -773,8 +773,8 @@ const _ = "panel", T = "messagebox", We = ({
|
|
|
773
773
|
animation: c,
|
|
774
774
|
maxWidth: y
|
|
775
775
|
});
|
|
776
|
-
return B(() => (e && (
|
|
777
|
-
e && (document.title =
|
|
776
|
+
return B(() => (e && (u.current = document.title, document.title = `${t} | ${u.current}`), () => {
|
|
777
|
+
e && (document.title = u.current);
|
|
778
778
|
}), [t, e]), B(() => {
|
|
779
779
|
if (c && e) {
|
|
780
780
|
f(
|
|
@@ -791,7 +791,7 @@ const _ = "panel", T = "messagebox", We = ({
|
|
|
791
791
|
}, 100);
|
|
792
792
|
return () => clearTimeout(w);
|
|
793
793
|
}
|
|
794
|
-
}, [e, c, g]), /* @__PURE__ */ s(K, { children: e && /* @__PURE__ */ s(Ge, { open: e, onOpenChange: r, children: /* @__PURE__ */ L(Ye, { className: b.main, style:
|
|
794
|
+
}, [e, c, g]), /* @__PURE__ */ s(K, { children: e && /* @__PURE__ */ s(Ge, { open: e, onOpenChange: r, children: /* @__PURE__ */ L(Ye, { className: b.main, style: m, children: [
|
|
795
795
|
/* @__PURE__ */ L("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
|
796
796
|
/* @__PURE__ */ s(
|
|
797
797
|
Xe,
|
|
@@ -804,7 +804,7 @@ const _ = "panel", T = "messagebox", We = ({
|
|
|
804
804
|
focusMode: "light",
|
|
805
805
|
noBorder: !0,
|
|
806
806
|
label: "Close",
|
|
807
|
-
children: /* @__PURE__ */ s(Ue, {})
|
|
807
|
+
children: /* @__PURE__ */ s(Ue, { monotone: !0 })
|
|
808
808
|
}
|
|
809
809
|
)
|
|
810
810
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
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.2.
|
|
3
|
+
@versini/ui-panel v2.2.3
|
|
4
4
|
© 2025 gizmette.com
|
|
5
5
|
*/
|
|
6
6
|
try {
|
|
7
7
|
window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
|
|
8
|
-
version: "2.2.
|
|
9
|
-
buildTime: "08/07/2025
|
|
8
|
+
version: "2.2.3",
|
|
9
|
+
buildTime: "08/07/2025 07:27 PM EDT",
|
|
10
10
|
homepage: "https://github.com/aversini/ui-components",
|
|
11
11
|
license: "MIT"
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-panel",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
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": "
|
|
56
|
+
"gitHead": "d9a7003730703bed7eb3240a1db79b2d4e5dd7aa"
|
|
57
57
|
}
|