@versini/ui-panel 2.2.10 → 3.0.1

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,102 +1,269 @@
1
- import { jsx as l, Fragment as M, jsxs as x } from "react/jsx-runtime";
2
- import { ButtonIcon as $ } from "@versini/ui-button";
3
- import { IconClose as v } from "@versini/ui-icons";
4
- import { Modal as C, ModalContent as y, ModalClose as I, ModalHeading as P, ModalDescription as _ } from "@versini/ui-modal";
5
- import { useRef as L, useState as Y, useEffect as g } from "react";
6
- import B from "clsx";
7
- const h = "av-messagebox", n = "av-panel", o = "panel", f = "messagebox", O = ({
1
+ import { jsxs as v, jsx as n, Fragment as L } from "react/jsx-runtime";
2
+ import { ButtonIcon as O } from "@versini/ui-button";
3
+ import * as l from "react";
4
+ import { useId as A, useRef as $, useState as R, useEffect as S } from "react";
5
+ import E from "clsx";
6
+ import { useFloating as T, useClick as D, useDismiss as P, useRole as B, useInteractions as V, useMergeRefs as F, FloatingPortal as U, FloatingOverlay as Y, FloatingFocusManager as k } from "@floating-ui/react";
7
+ const C = "av-messagebox", I = "av-panel", z = ({
8
+ children: e,
9
+ fill: t,
10
+ viewBox: r,
11
+ className: o,
12
+ defaultViewBox: s,
13
+ size: c,
14
+ title: i,
15
+ semantic: u = !1,
16
+ ...a
17
+ }) => {
18
+ const d = E(c, o);
19
+ return /* @__PURE__ */ v(
20
+ "svg",
21
+ {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ className: d,
24
+ viewBox: r || s,
25
+ fill: t || "currentColor",
26
+ role: "img",
27
+ "aria-hidden": !u,
28
+ focusable: !1,
29
+ ...a,
30
+ children: [
31
+ i && u && /* @__PURE__ */ n("title", { children: i }),
32
+ e
33
+ ]
34
+ }
35
+ );
36
+ };
37
+ /*!
38
+ @versini/ui-svgicon v4.2.1
39
+ © 2025 gizmette.com
40
+ */
41
+ try {
42
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
43
+ version: "4.2.1",
44
+ buildTime: "08/27/2025 08:27 AM EDT",
45
+ homepage: "https://github.com/aversini/ui-components",
46
+ license: "MIT"
47
+ });
48
+ } catch {
49
+ }
50
+ const G = ({
51
+ className: e,
52
+ viewBox: t,
53
+ title: r,
54
+ monotone: o,
55
+ ...s
56
+ }) => /* @__PURE__ */ n(
57
+ z,
58
+ {
59
+ defaultViewBox: "0 0 384 512",
60
+ size: "size-5",
61
+ viewBox: t,
62
+ className: e,
63
+ title: r || "Close",
64
+ ...s,
65
+ children: /* @__PURE__ */ n(
66
+ "path",
67
+ {
68
+ 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",
69
+ opacity: o ? "1" : "0.4"
70
+ }
71
+ )
72
+ }
73
+ );
74
+ /*!
75
+ @versini/ui-icons v4.11.0
76
+ © 2025 gizmette.com
77
+ */
78
+ try {
79
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
80
+ version: "4.11.0",
81
+ buildTime: "08/27/2025 08:28 AM EDT",
82
+ homepage: "https://github.com/aversini/ui-components",
83
+ license: "MIT"
84
+ });
85
+ } catch {
86
+ }
87
+ const y = l.createContext(null);
88
+ function j({
89
+ initialOpen: e = !1,
90
+ open: t,
91
+ onOpenChange: r
92
+ } = {}) {
93
+ const [o, s] = l.useState(e), [c, i] = l.useState(), [u, a] = l.useState(), d = t ?? o, w = r ?? s, m = T({
94
+ open: d,
95
+ onOpenChange: w
96
+ }), p = m.context, g = D(p, {
97
+ enabled: t == null
98
+ }), f = P(p, {
99
+ outsidePress: !1,
100
+ outsidePressEvent: "mousedown"
101
+ }), b = B(p), N = V([g, f, b]);
102
+ return l.useMemo(
103
+ () => ({
104
+ open: d,
105
+ setOpen: w,
106
+ ...N,
107
+ ...m,
108
+ labelId: c,
109
+ descriptionId: u,
110
+ setLabelId: i,
111
+ setDescriptionId: a
112
+ }),
113
+ [d, w, N, m, c, u]
114
+ );
115
+ }
116
+ const x = () => {
117
+ const e = l.useContext(y);
118
+ if (e == null)
119
+ throw new Error("Modal components must be wrapped in <Modal />");
120
+ return e;
121
+ };
122
+ function X({
123
+ children: e,
124
+ ...t
125
+ }) {
126
+ const r = j(t);
127
+ return /* @__PURE__ */ n(y.Provider, { value: r, children: e });
128
+ }
129
+ const q = l.forwardRef(function(e, t) {
130
+ const { context: r, ...o } = x(), s = F([o.refs.setFloating, t]);
131
+ if (!r.open)
132
+ return null;
133
+ const { overlayBackground: c, ...i } = e, u = E("grid place-items-center", {
134
+ [`${c}`]: c,
135
+ "bg-black sm:bg-black/[.8]": !c
136
+ });
137
+ return /* @__PURE__ */ n(U, { children: /* @__PURE__ */ n(Y, { className: u, lockScroll: !0, children: /* @__PURE__ */ n(k, { context: r, children: /* @__PURE__ */ n(
138
+ "div",
139
+ {
140
+ ref: s,
141
+ "aria-labelledby": o.labelId,
142
+ "aria-describedby": o.descriptionId,
143
+ ...o.getFloatingProps(i),
144
+ children: i.children
145
+ }
146
+ ) }) }) });
147
+ }), H = l.forwardRef(function({ children: e, ...t }, r) {
148
+ const { setLabelId: o } = x(), s = A();
149
+ return l.useLayoutEffect(() => (o(s), () => o(void 0)), [s, o]), /* @__PURE__ */ n("h1", { ...t, ref: r, id: s, children: e });
150
+ }), J = l.forwardRef(function({ children: e, ...t }, r) {
151
+ const { setDescriptionId: o } = x(), s = A();
152
+ return l.useLayoutEffect(() => (o(s), () => o(void 0)), [s, o]), /* @__PURE__ */ n("div", { ...t, ref: r, id: s, children: e });
153
+ }), K = l.forwardRef(function(e, t) {
154
+ const { setOpen: r } = x(), { trigger: o, className: s, ...c } = e, i = l.useCallback(() => r(!1), [r]);
155
+ return /* @__PURE__ */ n("div", { className: s, children: l.cloneElement(o, {
156
+ ref: t,
157
+ onClick: i,
158
+ ...c
159
+ }) });
160
+ });
161
+ /*!
162
+ @versini/ui-modal v3.0.1
163
+ © 2025 gizmette.com
164
+ */
165
+ try {
166
+ window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
167
+ version: "3.0.1",
168
+ buildTime: "09/01/2025 04:01 PM EDT",
169
+ homepage: "https://github.com/aversini/ui-components",
170
+ license: "MIT"
171
+ });
172
+ } catch {
173
+ }
174
+ const h = "panel", _ = "messagebox", Q = ({
8
175
  className: e,
9
- kind: r,
10
- borderMode: t,
11
- animation: d,
176
+ kind: t,
177
+ borderMode: r,
178
+ animation: o,
12
179
  maxWidth: s = "medium"
13
180
  }) => ({
14
- main: B("prose prose-lighter flex flex-col bg-surface-dark", {
15
- "duration-200 ease-out": d,
16
- [`${n} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: r === o,
17
- [`${n} w-full sm:w-[95%] md:max-w-2xl`]: r === o && !e && s === "small",
18
- [`${n} w-full sm:w-[95%] md:max-w-3xl`]: r === o && !e && s === "medium",
19
- [`${n} w-full sm:w-[95%] md:max-w-4xl`]: r === o && !e && s === "large",
20
- [`${h} rounded-lg border-2`]: r === f,
21
- [`${h} w-[95%] sm:w-[50%] md:max-w-2xl`]: r === f && !e,
181
+ main: E("prose prose-lighter flex flex-col bg-surface-dark", {
182
+ "duration-200 ease-out": o,
183
+ [`${I} max-h-full sm:max-h-[95%] min-h-full sm:min-h-[10rem] sm:rounded-lg sm:border-2`]: t === h,
184
+ [`${I} w-full sm:w-[95%] md:max-w-2xl`]: t === h && !e && s === "small",
185
+ [`${I} w-full sm:w-[95%] md:max-w-3xl`]: t === h && !e && s === "medium",
186
+ [`${I} w-full sm:w-[95%] md:max-w-4xl`]: t === h && !e && s === "large",
187
+ [`${C} rounded-lg border-2`]: t === _,
188
+ [`${C} w-[95%] sm:w-[50%] md:max-w-2xl`]: t === _ && !e,
22
189
  [`${e}`]: !!e,
23
- "sm:border-border-dark": t === "dark" && r === o,
24
- "sm:border-border-accent": t === "light" && r === o,
25
- "border-border-dark": t === "dark" && r === f,
26
- "border-border-accent": t === "light" && r === f
190
+ "sm:border-border-dark": r === "dark" && t === h,
191
+ "sm:border-border-accent": r === "light" && t === h,
192
+ "border-border-dark": r === "dark" && t === _,
193
+ "border-border-accent": r === "light" && t === _
27
194
  }),
28
195
  content: "flex flex-col py-2 sm:py-4 sm:px-4 px-2 overflow-y-auto",
29
196
  footer: "flex grow flex-col sm:p-4 p-2",
30
197
  header: "sm:p-4 mb-0 p-2",
31
198
  close: "sm:p-4 p-2"
32
- }), T = "slide", p = "fade", H = ({
199
+ }), Z = "slide", M = "fade", se = ({
33
200
  open: e,
34
- onOpenChange: r,
35
- title: t,
36
- children: d,
201
+ onOpenChange: t,
202
+ title: r,
203
+ children: o,
37
204
  footer: s,
38
- borderMode: w = "light",
39
- kind: A = o,
40
- className: b,
41
- animation: m = !1,
42
- animationType: c = T,
43
- maxWidth: E = "medium"
205
+ borderMode: c = "light",
206
+ kind: i = h,
207
+ className: u,
208
+ animation: a = !1,
209
+ animationType: d = Z,
210
+ maxWidth: w = "medium"
44
211
  }) => {
45
- const u = L(""), [S, i] = Y(
46
- m ? c === p ? { opacity: 0 } : {
212
+ const m = $(""), [p, g] = R(
213
+ a ? d === M ? { opacity: 0 } : {
47
214
  transform: "translateY(-100vh)"
48
215
  } : {}
49
- ), a = O({
50
- className: b,
51
- kind: A,
52
- borderMode: w,
53
- animation: m,
54
- maxWidth: E
216
+ ), f = Q({
217
+ className: u,
218
+ kind: i,
219
+ borderMode: c,
220
+ animation: a,
221
+ maxWidth: w
55
222
  });
56
- return g(() => (e && (u.current = document.title, document.title = `${t} | ${u.current}`), () => {
57
- e && (document.title = u.current);
58
- }), [t, e]), g(() => {
59
- if (m && e) {
60
- i(
61
- m ? c === p ? { opacity: 0 } : {
223
+ return S(() => (e && (m.current = document.title, document.title = `${r} | ${m.current}`), () => {
224
+ e && (document.title = m.current);
225
+ }), [r, e]), S(() => {
226
+ if (a && e) {
227
+ g(
228
+ a ? d === M ? { opacity: 0 } : {
62
229
  transform: "translateY(-666vh)"
63
230
  } : {}
64
231
  );
65
- const N = setTimeout(() => {
66
- i(
67
- m ? c === "fade" ? { opacity: 1 } : {
232
+ const b = setTimeout(() => {
233
+ g(
234
+ a ? d === "fade" ? { opacity: 1 } : {
68
235
  transform: "translateY(0)"
69
236
  } : {}
70
237
  );
71
238
  }, 100);
72
- return () => clearTimeout(N);
239
+ return () => clearTimeout(b);
73
240
  }
74
- }, [e, m, c]), /* @__PURE__ */ l(M, { children: e && /* @__PURE__ */ l(C, { open: e, onOpenChange: r, children: /* @__PURE__ */ x(y, { className: a.main, style: S, children: [
75
- /* @__PURE__ */ x("div", { className: "flex flex-row-reverse items-center justify-between", children: [
76
- /* @__PURE__ */ l(
77
- I,
241
+ }, [e, a, d]), /* @__PURE__ */ n(L, { children: e && /* @__PURE__ */ n(X, { open: e, onOpenChange: t, children: /* @__PURE__ */ v(q, { className: f.main, style: p, children: [
242
+ /* @__PURE__ */ v("div", { className: "flex flex-row-reverse items-center justify-between", children: [
243
+ /* @__PURE__ */ n(
244
+ K,
78
245
  {
79
- className: a.close,
80
- trigger: /* @__PURE__ */ l(
81
- $,
246
+ className: f.close,
247
+ trigger: /* @__PURE__ */ n(
248
+ O,
82
249
  {
83
250
  mode: "dark",
84
251
  focusMode: "light",
85
252
  noBorder: !0,
86
253
  label: "Close",
87
- children: /* @__PURE__ */ l(v, { monotone: !0 })
254
+ children: /* @__PURE__ */ n(G, { monotone: !0 })
88
255
  }
89
256
  )
90
257
  }
91
258
  ),
92
- /* @__PURE__ */ l(P, { className: a.header, children: t })
259
+ /* @__PURE__ */ n(H, { className: f.header, children: r })
93
260
  ] }),
94
- /* @__PURE__ */ l(_, { className: a.content, children: d }),
95
- s && /* @__PURE__ */ l("div", { className: a.footer, children: s })
261
+ /* @__PURE__ */ n(J, { className: f.content, children: o }),
262
+ s && /* @__PURE__ */ n("div", { className: f.footer, children: s })
96
263
  ] }) }) });
97
264
  };
98
265
  export {
99
- h as MESSAGEBOX_CLASSNAME,
100
- n as PANEL_CLASSNAME,
101
- H as Panel
266
+ C as MESSAGEBOX_CLASSNAME,
267
+ I as PANEL_CLASSNAME,
268
+ se as Panel
102
269
  };
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.10
3
+ @versini/ui-panel v3.0.1
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
8
- version: "2.2.10",
9
- buildTime: "09/01/2025 02:19 PM EDT",
8
+ version: "3.0.1",
9
+ buildTime: "09/01/2025 04:01 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.10",
3
+ "version": "3.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -37,22 +37,22 @@
37
37
  "test": "vitest run"
38
38
  },
39
39
  "peerDependencies": {
40
- "react": "^18.3.1 || ^19.0.0",
41
- "react-dom": "^18.3.1 || ^19.0.0"
40
+ "react": "^19.1.0",
41
+ "react-dom": "^19.1.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/jest-dom": "6.8.0"
45
45
  },
46
46
  "dependencies": {
47
47
  "@tailwindcss/typography": "0.5.16",
48
- "@versini/ui-button": "7.1.6",
49
- "@versini/ui-icons": "4.10.0",
50
- "@versini/ui-modal": "2.0.10",
48
+ "@versini/ui-button": "8.0.1",
49
+ "@versini/ui-icons": "4.11.0",
50
+ "@versini/ui-modal": "3.0.1",
51
51
  "clsx": "2.1.1",
52
52
  "tailwindcss": "4.1.12"
53
53
  },
54
54
  "sideEffects": [
55
55
  "**/*.css"
56
56
  ],
57
- "gitHead": "c577149643ec36cad454587166e62410a77aed38"
57
+ "gitHead": "dcc216644c8c3e7d43a49ea655a22aed21fa4b83"
58
58
  }