@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.
@@ -1,10 +1,10 @@
1
- import { jsxs as E, jsx as l, Fragment as L } from "react/jsx-runtime";
2
- import { ButtonIcon as O } from "@versini/ui-button";
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 A, useRef as $, useState as R, useEffect as S } from "react";
5
- import N 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 z } from "@floating-ui/react";
7
- const M = "av-messagebox", _ = "av-panel", G = ({
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 = N(a, s);
19
- return /* @__PURE__ */ E(
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.1
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.1",
44
- buildTime: "08/27/2025 08:27 AM EDT",
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.11.0
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.11.0",
81
- buildTime: "08/27/2025 08:28 AM EDT",
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 y = c.createContext(null);
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 = T({
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, v = D(f, {
96
+ }), f = p.context, b = R(f, {
97
97
  enabled: e == null
98
- }), x = P(f, {
98
+ }), x = T(f, {
99
99
  outsidePress: !1,
100
100
  outsidePressEvent: "mousedown"
101
- }), h = B(f), I = V([v, x, 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 b = () => {
117
- const t = c.useContext(y);
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(y.Provider, { value: r, children: t });
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 } = b(), o = F([s.refs.setFloating, e]);
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 = N("grid place-items-center", {
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(U, { children: /* @__PURE__ */ l(Y, { className: d, lockScroll: !0, children: /* @__PURE__ */ l(z, { context: r, children: /* @__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 } = b(), o = A();
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 } = b(), o = A();
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 } = b(), { trigger: s, className: o, ...a } = t, n = c.useCallback(() => r(!1), [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.1
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.1",
168
- buildTime: "10/11/2025 12:41 PM EDT",
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: N("prose prose-lighter flex flex-col bg-surface-dark", {
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
- [`${_} 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-[75%]": e === i && n === "small",
194
- "max-h-full sm:max-h-[85%]": e === i && n === "medium",
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
- [`${M} rounded-lg border-2`]: e === g,
202
- [`${M} w-[95%] sm:w-[50%] md:max-w-2xl`]: e === g && !t,
203
- "max-h-[75%]": e === g && n === "small",
204
- "max-h-[85%]": e === g && n === "medium",
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", C = "fade", oe = ({
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 = $(""), [v, x] = R(
230
- m ? u === C ? { opacity: 0 } : {
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 S(() => (t && (f.current = document.title, document.title = `${r} | ${f.current}`), () => {
241
+ return N(() => (t && (f.current = document.title, document.title = `${r} | ${f.current}`), () => {
242
242
  t && (document.title = f.current);
243
- }), [r, t]), S(() => {
243
+ }), [r, t]), N(() => {
244
244
  if (m && t) {
245
245
  x(
246
- m ? u === C ? { opacity: 0 } : {
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(L, { children: t && /* @__PURE__ */ l(H, { open: t, onOpenChange: e, children: /* @__PURE__ */ E(q, { className: h.main, style: v, children: [
260
- /* @__PURE__ */ E("div", { className: "flex flex-row-reverse items-center justify-between", children: [
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
- O,
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
- M as MESSAGEBOX_CLASSNAME,
285
- _ as PANEL_CLASSNAME,
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.0
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.0",
9
- buildTime: "10/11/2025 12:42 PM EDT",
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.0",
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.8.0"
40
+ "@testing-library/jest-dom": "6.9.1"
45
41
  },
46
42
  "dependencies": {
47
- "@tailwindcss/typography": "0.5.16",
48
- "@versini/ui-button": "8.0.1",
49
- "@versini/ui-icons": "4.11.0",
50
- "@versini/ui-modal": "3.0.1",
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.12"
48
+ "tailwindcss": "4.1.14"
53
49
  },
54
50
  "sideEffects": [
55
51
  "**/*.css"
56
52
  ],
57
- "gitHead": "731554d2c2fc2ae1c3c62ffbe09eba2b77308a70"
53
+ "gitHead": "67e049c9b2e46e8f52509bf6198ca0cdaf5d970a"
58
54
  }