@versini/ui-panel 8.0.1 → 8.0.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.
Files changed (2) hide show
  1. package/dist/index.js +19 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- @versini/ui-panel v8.0.1
2
+ @versini/ui-panel v8.0.3
3
3
  © 2025 gizmette.com
4
4
  */
5
5
  try {
6
6
  if (!window.__VERSINI_UI_PANEL__) {
7
7
  window.__VERSINI_UI_PANEL__ = {
8
- version: "8.0.1",
9
- buildTime: "12/17/2025 07:04 PM EST",
8
+ version: "8.0.3",
9
+ buildTime: "12/18/2025 01:20 PM EST",
10
10
  homepage: "https://www.npmjs.com/package/@versini/ui-panel",
11
11
  license: "MIT",
12
12
  };
@@ -152,6 +152,7 @@ const NONE = "none";
152
152
 
153
153
 
154
154
 
155
+
155
156
  /**
156
157
  * Selector for all focusable elements within a container. Based on W3C WAI-ARIA
157
158
  * practices for dialog focus management.
@@ -178,7 +179,7 @@ const NONE = "none";
178
179
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
179
180
  * @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
180
181
  *
181
- */ function PanelPortal({ open, onClose, children, className, style, title, initialFocus = 0 }) {
182
+ */ function PanelPortal({ open, onClose, children, className, style, title, initialFocus = 0, kind = /* inlined export .TYPE_PANEL */ ("panel") }) {
182
183
  const labelId = useId();
183
184
  const descriptionId = useId();
184
185
  const dialogRef = useRef(null);
@@ -404,12 +405,20 @@ const NONE = "none";
404
405
  /* c8 ignore next 3 - early return when panel is closed */ if (!open) {
405
406
  return null;
406
407
  }
408
+ const isMessageBox = kind === TYPE_MESSAGEBOX;
407
409
  const dialogClass = clsx(/**
408
410
  * Center the dialog on screen with fixed positioning. Native dialog uses
409
- * position: fixed by default. On mobile: inset-0 + no margin for full screen.
410
- * On desktop: inset-x-0 + top/bottom auto for vertical centering with
411
- * shrink-to-fit.
412
- */ "fixed inset-0 m-0 sm:inset-auto sm:inset-x-0 sm:top-1/2 sm:-translate-y-1/2 sm:mx-auto max-h-none max-w-none p-0", /**
411
+ * position: fixed by default.
412
+ * - Panel on mobile: inset-0 + no margin for full screen.
413
+ * - Panel on desktop: inset-x-0 + top/bottom auto for vertical centering.
414
+ * - MessageBox: Always centered (both mobile and desktop) since it doesn't
415
+ * take full screen.
416
+ */ "fixed max-h-none max-w-none p-0", {
417
+ // Panel: full screen on mobile, centered on desktop
418
+ "inset-0 m-0 sm:inset-auto sm:inset-x-0 sm:top-1/2 sm:-translate-y-1/2 sm:mx-auto": !isMessageBox,
419
+ // MessageBox: always centered at all breakpoints
420
+ "inset-auto inset-x-0 top-1/2 -translate-y-1/2 mx-auto": isMessageBox
421
+ }, /**
413
422
  * Backdrop styling via Tailwind's backdrop: variant for ::backdrop
414
423
  * pseudo-element. Full black on mobile, 80% opacity on desktop (matches
415
424
  * original overlay).
@@ -517,7 +526,7 @@ const getPanelClassName = ({ className, kind, borderMode, animation, maxWidth =
517
526
  "border-border-accent": borderMode === "light" && kind === TYPE_MESSAGEBOX,
518
527
  [`${className}`]: !!className
519
528
  }),
520
- innerWrapper: "content flex flex-col rounded-[inherit] relative min-h-full",
529
+ innerWrapper: "content flex flex-col rounded-[inherit] relative min-h-full isolate",
521
530
  scrollableContent: clsx("flex-1 overflow-y-auto overflow-x-hidden", "pt-12", {
522
531
  "pb-12": hasFooter
523
532
  }),
@@ -625,6 +634,7 @@ const Panel = ({ open, onOpenChange, title, children, footer, borderMode = "ligh
625
634
  style: animationStyles,
626
635
  title: title,
627
636
  initialFocus: initialFocus,
637
+ kind: kind,
628
638
  children: /*#__PURE__*/ jsxs("div", {
629
639
  className: panelClassName.innerWrapper,
630
640
  children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -52,5 +52,5 @@
52
52
  "sideEffects": [
53
53
  "**/*.css"
54
54
  ],
55
- "gitHead": "9fa7c53e84b8f40adefbe63becd4841af772753a"
55
+ "gitHead": "85dddca8a2963c870561074ab749741649d1d989"
56
56
  }