@platned/ui 0.8.1 → 0.8.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/index.cjs CHANGED
@@ -5426,6 +5426,12 @@ function isInsideToaster(target) {
5426
5426
 
5427
5427
  // src/components/overlays/modal.tsx
5428
5428
  var import_jsx_runtime50 = require("react/jsx-runtime");
5429
+ var OVERLAY_ALIGN = {
5430
+ center: "sm:items-center",
5431
+ // A fixed offset rather than centring, so a change in content height grows the panel
5432
+ // downward instead of moving its top edge. 6dvh + the 88dvh cap leaves a gap below.
5433
+ top: "sm:items-start sm:pt-[6dvh]"
5434
+ };
5429
5435
  var SIZE8 = {
5430
5436
  sm: "sm:max-w-[420px]",
5431
5437
  md: "sm:max-w-[540px]",
@@ -5463,6 +5469,7 @@ var ModalShell = (0, import_react36.forwardRef)(
5463
5469
  size: size2 = "md",
5464
5470
  role = "dialog",
5465
5471
  showClose = true,
5472
+ align = "center",
5466
5473
  className,
5467
5474
  onEscapeKeyDown,
5468
5475
  onInteractOutside,
@@ -5477,10 +5484,12 @@ var ModalShell = (0, import_react36.forwardRef)(
5477
5484
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5478
5485
  import_radix_ui2.Dialog.Overlay,
5479
5486
  {
5487
+ "data-align": align,
5480
5488
  className: cn(
5481
5489
  // The overlay wraps the content (a Radix-supported layout), so it also does the
5482
- // centring: bottom sheet below `sm`, centred card above it.
5483
- "fixed inset-0 z-modal flex items-end justify-center sm:items-center",
5490
+ // positioning: bottom sheet below `sm`, a card centred or top-anchored above it.
5491
+ "fixed inset-0 z-modal flex items-end justify-center",
5492
+ OVERLAY_ALIGN[align],
5484
5493
  OVERLAY_SCRIM
5485
5494
  ),
5486
5495
  children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
@@ -5516,6 +5525,7 @@ var ModalShell = (0, import_react36.forwardRef)(
5516
5525
  },
5517
5526
  className: cn(
5518
5527
  "relative max-h-[92dvh] w-full overflow-y-auto bg-default shadow-400 focus:outline-none",
5528
+ align === "top" && "sm:max-h-[88dvh]",
5519
5529
  // Not a `ScrollArea`: the panel is the dialog, so the scroll container has to stay
5520
5530
  // the element carrying `role`, `aria-modal` and the trap boundary. It is already
5521
5531
  // keyboard-scrollable because the trap focuses it on open.
@@ -6443,6 +6453,7 @@ function ConfirmDialog({
6443
6453
  subtitle,
6444
6454
  tone = "default",
6445
6455
  size: size2 = "md",
6456
+ align,
6446
6457
  confirmLabel = "Confirm",
6447
6458
  cancelLabel = "Cancel",
6448
6459
  confirmVariant = "primary",
@@ -6470,6 +6481,7 @@ function ConfirmDialog({
6470
6481
  onOpenChange: requestOpenChange,
6471
6482
  role: "alertdialog",
6472
6483
  size: size2,
6484
+ align,
6473
6485
  className,
6474
6486
  initialFocus: cancelRef,
6475
6487
  children: [
@@ -6521,6 +6533,7 @@ function NoteConfirmModalShell({
6521
6533
  subtitle,
6522
6534
  tone = "default",
6523
6535
  size: size2 = "md",
6536
+ align,
6524
6537
  confirmLabel,
6525
6538
  cancelLabel = "Cancel",
6526
6539
  confirmVariant = "primary",
@@ -6555,6 +6568,7 @@ function NoteConfirmModalShell({
6555
6568
  open: true,
6556
6569
  onOpenChange: requestOpenChange,
6557
6570
  size: size2,
6571
+ align,
6558
6572
  className,
6559
6573
  onEscapeKeyDown: guardDiscard,
6560
6574
  onInteractOutside: guardDiscard,