@versini/ui-panel 3.1.0 → 3.1.2
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 +53 -53
- package/dist/index.js +3 -3
- package/package.json +8 -12
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ButtonIcon as
|
|
1
|
+
import { jsxs as v, jsx as l, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonIcon as A } from "@versini/ui-button";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { useId as
|
|
5
|
-
import
|
|
6
|
-
import { useFloating as
|
|
7
|
-
const
|
|
4
|
+
import { useId as M, useRef as L, useState as O, useEffect as N } from "react";
|
|
5
|
+
import E from "clsx";
|
|
6
|
+
import { useFloating as P, useClick as R, useDismiss as T, useRole as D, useInteractions as B, useMergeRefs as $, FloatingPortal as V, FloatingOverlay as F, FloatingFocusManager as U } from "@floating-ui/react";
|
|
7
|
+
const Y = "av-messagebox", z = "av-panel", G = ({
|
|
8
8
|
children: t,
|
|
9
9
|
fill: e,
|
|
10
10
|
viewBox: r,
|
|
@@ -15,8 +15,8 @@ const M = "av-messagebox", _ = "av-panel", G = ({
|
|
|
15
15
|
semantic: d = !1,
|
|
16
16
|
...m
|
|
17
17
|
}) => {
|
|
18
|
-
const u =
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
const u = E(a, s);
|
|
19
|
+
return /* @__PURE__ */ v(
|
|
20
20
|
"svg",
|
|
21
21
|
{
|
|
22
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -35,13 +35,13 @@ const M = "av-messagebox", _ = "av-panel", G = ({
|
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
37
|
/*!
|
|
38
|
-
@versini/ui-svgicon v4.2.
|
|
38
|
+
@versini/ui-svgicon v4.2.2
|
|
39
39
|
© 2025 gizmette.com
|
|
40
40
|
*/
|
|
41
41
|
try {
|
|
42
42
|
window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
|
|
43
|
-
version: "4.2.
|
|
44
|
-
buildTime: "
|
|
43
|
+
version: "4.2.2",
|
|
44
|
+
buildTime: "10/17/2025 12:12 PM EDT",
|
|
45
45
|
homepage: "https://github.com/aversini/ui-components",
|
|
46
46
|
license: "MIT"
|
|
47
47
|
});
|
|
@@ -72,33 +72,33 @@ const j = ({
|
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
/*!
|
|
75
|
-
@versini/ui-icons v4.
|
|
75
|
+
@versini/ui-icons v4.12.3
|
|
76
76
|
© 2025 gizmette.com
|
|
77
77
|
*/
|
|
78
78
|
try {
|
|
79
79
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
80
|
-
version: "4.
|
|
81
|
-
buildTime: "
|
|
80
|
+
version: "4.12.3",
|
|
81
|
+
buildTime: "10/17/2025 12:12 PM EDT",
|
|
82
82
|
homepage: "https://github.com/aversini/ui-components",
|
|
83
83
|
license: "MIT"
|
|
84
84
|
});
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const C = c.createContext(null);
|
|
88
88
|
function X({
|
|
89
89
|
initialOpen: t = !1,
|
|
90
90
|
open: e,
|
|
91
91
|
onOpenChange: r
|
|
92
92
|
} = {}) {
|
|
93
|
-
const [s, o] = c.useState(t), [a, n] = c.useState(), [d, m] = c.useState(), u = e ?? s, w = r ?? o, p =
|
|
93
|
+
const [s, o] = c.useState(t), [a, n] = c.useState(), [d, m] = c.useState(), u = e ?? s, w = r ?? o, p = P({
|
|
94
94
|
open: u,
|
|
95
95
|
onOpenChange: w
|
|
96
|
-
}), f = p.context,
|
|
96
|
+
}), f = p.context, b = R(f, {
|
|
97
97
|
enabled: e == null
|
|
98
|
-
}), x =
|
|
98
|
+
}), x = T(f, {
|
|
99
99
|
outsidePress: !1,
|
|
100
100
|
outsidePressEvent: "mousedown"
|
|
101
|
-
}), h =
|
|
101
|
+
}), h = D(f), I = B([b, x, h]);
|
|
102
102
|
return c.useMemo(
|
|
103
103
|
() => ({
|
|
104
104
|
open: u,
|
|
@@ -113,8 +113,8 @@ function X({
|
|
|
113
113
|
[u, w, I, p, a, d]
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
const t = c.useContext(
|
|
116
|
+
const _ = () => {
|
|
117
|
+
const t = c.useContext(C);
|
|
118
118
|
if (t == null)
|
|
119
119
|
throw new Error("Modal components must be wrapped in <Modal />");
|
|
120
120
|
return t;
|
|
@@ -124,17 +124,17 @@ function H({
|
|
|
124
124
|
...e
|
|
125
125
|
}) {
|
|
126
126
|
const r = X(e);
|
|
127
|
-
return /* @__PURE__ */ l(
|
|
127
|
+
return /* @__PURE__ */ l(C.Provider, { value: r, children: t });
|
|
128
128
|
}
|
|
129
129
|
const q = c.forwardRef(function(t, e) {
|
|
130
|
-
const { context: r, ...s } =
|
|
130
|
+
const { context: r, ...s } = _(), o = $([s.refs.setFloating, e]);
|
|
131
131
|
if (!r.open)
|
|
132
132
|
return null;
|
|
133
|
-
const { overlayBackground: a, ...n } = t, d =
|
|
133
|
+
const { overlayBackground: a, ...n } = t, d = E("grid place-items-center", {
|
|
134
134
|
[`${a}`]: a,
|
|
135
135
|
"bg-black sm:bg-black/[.8]": !a
|
|
136
136
|
});
|
|
137
|
-
return /* @__PURE__ */ l(
|
|
137
|
+
return /* @__PURE__ */ l(V, { children: /* @__PURE__ */ l(F, { className: d, lockScroll: !0, children: /* @__PURE__ */ l(U, { context: r, children: /* @__PURE__ */ l(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
140
|
ref: o,
|
|
@@ -145,13 +145,13 @@ const q = c.forwardRef(function(t, e) {
|
|
|
145
145
|
}
|
|
146
146
|
) }) }) });
|
|
147
147
|
}), J = c.forwardRef(function({ children: t, ...e }, r) {
|
|
148
|
-
const { setLabelId: s } =
|
|
148
|
+
const { setLabelId: s } = _(), o = M();
|
|
149
149
|
return c.useLayoutEffect(() => (s(o), () => s(void 0)), [o, s]), /* @__PURE__ */ l("h1", { ...e, ref: r, id: o, children: t });
|
|
150
150
|
}), K = c.forwardRef(function({ children: t, ...e }, r) {
|
|
151
|
-
const { setDescriptionId: s } =
|
|
151
|
+
const { setDescriptionId: s } = _(), o = M();
|
|
152
152
|
return c.useLayoutEffect(() => (s(o), () => s(void 0)), [o, s]), /* @__PURE__ */ l("div", { ...e, ref: r, id: o, children: t });
|
|
153
153
|
}), Q = c.forwardRef(function(t, e) {
|
|
154
|
-
const { setOpen: r } =
|
|
154
|
+
const { setOpen: r } = _(), { trigger: s, className: o, ...a } = t, n = c.useCallback(() => r(!1), [r]);
|
|
155
155
|
return /* @__PURE__ */ l("div", { className: o, children: c.cloneElement(s, {
|
|
156
156
|
ref: e,
|
|
157
157
|
onClick: n,
|
|
@@ -159,13 +159,13 @@ const q = c.forwardRef(function(t, e) {
|
|
|
159
159
|
}) });
|
|
160
160
|
});
|
|
161
161
|
/*!
|
|
162
|
-
@versini/ui-modal v3.0.
|
|
162
|
+
@versini/ui-modal v3.0.2
|
|
163
163
|
© 2025 gizmette.com
|
|
164
164
|
*/
|
|
165
165
|
try {
|
|
166
166
|
window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
|
|
167
|
-
version: "3.0.
|
|
168
|
-
buildTime: "10/
|
|
167
|
+
version: "3.0.2",
|
|
168
|
+
buildTime: "10/17/2025 12:52 PM EDT",
|
|
169
169
|
homepage: "https://github.com/aversini/ui-components",
|
|
170
170
|
license: "MIT"
|
|
171
171
|
});
|
|
@@ -181,27 +181,27 @@ const i = "panel", g = "messagebox", Z = ({
|
|
|
181
181
|
}) => {
|
|
182
182
|
const n = a ?? (e === i ? "large" : void 0);
|
|
183
183
|
return {
|
|
184
|
-
main:
|
|
184
|
+
main: E("prose prose-lighter flex flex-col bg-surface-dark", {
|
|
185
185
|
"duration-200 ease-out": s,
|
|
186
186
|
/**
|
|
187
187
|
* Panel styles
|
|
188
188
|
*/
|
|
189
|
-
[`${
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
"max-h-full sm:max-h-[
|
|
194
|
-
"max-h-full sm:max-h-[
|
|
189
|
+
[`${z} min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: e === i,
|
|
190
|
+
"w-full sm:w-[95%] md:max-w-2xl": e === i && !t && o === "small",
|
|
191
|
+
"w-full sm:w-[95%] md:max-w-3xl": e === i && !t && o === "medium",
|
|
192
|
+
"w-full sm:w-[95%] md:max-w-4xl": e === i && !t && o === "large",
|
|
193
|
+
"max-h-full sm:max-h-[40%]": e === i && n === "small",
|
|
194
|
+
"max-h-full sm:max-h-[60%]": e === i && n === "medium",
|
|
195
195
|
"max-h-full sm:max-h-[95%]": e === i && n === "large",
|
|
196
196
|
"sm:border-border-dark": r === "dark" && e === i,
|
|
197
197
|
"sm:border-border-accent": r === "light" && e === i,
|
|
198
198
|
/**
|
|
199
199
|
* Messagebox styles
|
|
200
200
|
*/
|
|
201
|
-
[`${
|
|
202
|
-
|
|
203
|
-
"max-h-[
|
|
204
|
-
"max-h-[
|
|
201
|
+
[`${Y} rounded-lg border-2`]: e === g,
|
|
202
|
+
"w-[95%] sm:w-[50%] md:max-w-2xl": e === g && !t,
|
|
203
|
+
"max-h-[20%]": e === g && n === "small",
|
|
204
|
+
"max-h-[50%]": e === g && n === "medium",
|
|
205
205
|
"max-h-[95%]": e === g && n === "large",
|
|
206
206
|
"border-border-dark": r === "dark" && e === g,
|
|
207
207
|
"border-border-accent": r === "light" && e === g,
|
|
@@ -212,7 +212,7 @@ const i = "panel", g = "messagebox", Z = ({
|
|
|
212
212
|
header: "sm:p-4 mb-0 p-2",
|
|
213
213
|
close: "sm:p-4 p-2"
|
|
214
214
|
};
|
|
215
|
-
}, W = "slide",
|
|
215
|
+
}, W = "slide", S = "fade", oe = ({
|
|
216
216
|
open: t,
|
|
217
217
|
onOpenChange: e,
|
|
218
218
|
title: r,
|
|
@@ -226,8 +226,8 @@ const i = "panel", g = "messagebox", Z = ({
|
|
|
226
226
|
maxWidth: w = "medium",
|
|
227
227
|
maxHeight: p
|
|
228
228
|
}) => {
|
|
229
|
-
const f =
|
|
230
|
-
m ? u ===
|
|
229
|
+
const f = L(""), [b, x] = O(
|
|
230
|
+
m ? u === S ? { opacity: 0 } : {
|
|
231
231
|
transform: "translateY(-100vh)"
|
|
232
232
|
} : {}
|
|
233
233
|
), h = Z({
|
|
@@ -238,12 +238,12 @@ const i = "panel", g = "messagebox", Z = ({
|
|
|
238
238
|
maxWidth: w,
|
|
239
239
|
maxHeight: p
|
|
240
240
|
});
|
|
241
|
-
return
|
|
241
|
+
return N(() => (t && (f.current = document.title, document.title = `${r} | ${f.current}`), () => {
|
|
242
242
|
t && (document.title = f.current);
|
|
243
|
-
}), [r, t]),
|
|
243
|
+
}), [r, t]), N(() => {
|
|
244
244
|
if (m && t) {
|
|
245
245
|
x(
|
|
246
|
-
m ? u ===
|
|
246
|
+
m ? u === S ? { opacity: 0 } : {
|
|
247
247
|
transform: "translateY(-666vh)"
|
|
248
248
|
} : {}
|
|
249
249
|
);
|
|
@@ -256,14 +256,14 @@ const i = "panel", g = "messagebox", Z = ({
|
|
|
256
256
|
}, 100);
|
|
257
257
|
return () => clearTimeout(I);
|
|
258
258
|
}
|
|
259
|
-
}, [t, m, u]), /* @__PURE__ */ l(
|
|
260
|
-
/* @__PURE__ */
|
|
259
|
+
}, [t, m, u]), /* @__PURE__ */ l(y, { children: t && /* @__PURE__ */ l(H, { open: t, onOpenChange: e, children: /* @__PURE__ */ v(q, { className: h.main, style: b, children: [
|
|
260
|
+
/* @__PURE__ */ v("div", { className: "flex flex-row-reverse items-center justify-between", children: [
|
|
261
261
|
/* @__PURE__ */ l(
|
|
262
262
|
Q,
|
|
263
263
|
{
|
|
264
264
|
className: h.close,
|
|
265
265
|
trigger: /* @__PURE__ */ l(
|
|
266
|
-
|
|
266
|
+
A,
|
|
267
267
|
{
|
|
268
268
|
mode: "dark",
|
|
269
269
|
focusMode: "light",
|
|
@@ -281,7 +281,7 @@ const i = "panel", g = "messagebox", Z = ({
|
|
|
281
281
|
] }) }) });
|
|
282
282
|
};
|
|
283
283
|
export {
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
Y as MESSAGEBOX_CLASSNAME,
|
|
285
|
+
z as PANEL_CLASSNAME,
|
|
286
286
|
oe as Panel
|
|
287
287
|
};
|
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 v3.1.
|
|
3
|
+
@versini/ui-panel v3.1.2
|
|
4
4
|
© 2025 gizmette.com
|
|
5
5
|
*/
|
|
6
6
|
try {
|
|
7
7
|
window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
|
|
8
|
-
version: "3.1.
|
|
9
|
-
buildTime: "10/
|
|
8
|
+
version: "3.1.2",
|
|
9
|
+
buildTime: "10/17/2025 12:53 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": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,23 +36,19 @@
|
|
|
36
36
|
"test:watch": "vitest",
|
|
37
37
|
"test": "vitest run"
|
|
38
38
|
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"react": "^19.1.0",
|
|
41
|
-
"react-dom": "^19.1.0"
|
|
42
|
-
},
|
|
43
39
|
"devDependencies": {
|
|
44
|
-
"@testing-library/jest-dom": "6.
|
|
40
|
+
"@testing-library/jest-dom": "6.9.1"
|
|
45
41
|
},
|
|
46
42
|
"dependencies": {
|
|
47
|
-
"@tailwindcss/typography": "0.5.
|
|
48
|
-
"@versini/ui-button": "8.0.
|
|
49
|
-
"@versini/ui-icons": "4.
|
|
50
|
-
"@versini/ui-modal": "3.0.
|
|
43
|
+
"@tailwindcss/typography": "0.5.19",
|
|
44
|
+
"@versini/ui-button": "8.0.2",
|
|
45
|
+
"@versini/ui-icons": "4.12.3",
|
|
46
|
+
"@versini/ui-modal": "3.0.2",
|
|
51
47
|
"clsx": "2.1.1",
|
|
52
|
-
"tailwindcss": "4.1.
|
|
48
|
+
"tailwindcss": "4.1.14"
|
|
53
49
|
},
|
|
54
50
|
"sideEffects": [
|
|
55
51
|
"**/*.css"
|
|
56
52
|
],
|
|
57
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "67e049c9b2e46e8f52509bf6198ca0cdaf5d970a"
|
|
58
54
|
}
|