@platned/ui 0.8.0 → 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 +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
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
|
-
//
|
|
5483
|
-
"fixed inset-0 z-modal flex items-end justify-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,11 +6453,13 @@ 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",
|
|
6449
6460
|
isConfirming = false,
|
|
6450
6461
|
confirmingLabel = "Working\u2026",
|
|
6462
|
+
confirmDisabled = false,
|
|
6451
6463
|
children,
|
|
6452
6464
|
className,
|
|
6453
6465
|
onConfirm,
|
|
@@ -6469,6 +6481,7 @@ function ConfirmDialog({
|
|
|
6469
6481
|
onOpenChange: requestOpenChange,
|
|
6470
6482
|
role: "alertdialog",
|
|
6471
6483
|
size: size2,
|
|
6484
|
+
align,
|
|
6472
6485
|
className,
|
|
6473
6486
|
initialFocus: cancelRef,
|
|
6474
6487
|
children: [
|
|
@@ -6496,6 +6509,7 @@ function ConfirmDialog({
|
|
|
6496
6509
|
size: "md",
|
|
6497
6510
|
loading: isConfirming,
|
|
6498
6511
|
loadingLabel: confirmingLabel,
|
|
6512
|
+
disabled: confirmDisabled,
|
|
6499
6513
|
onClick: onConfirm,
|
|
6500
6514
|
children: isConfirming ? confirmingLabel : confirmLabel
|
|
6501
6515
|
}
|
|
@@ -6519,6 +6533,7 @@ function NoteConfirmModalShell({
|
|
|
6519
6533
|
subtitle,
|
|
6520
6534
|
tone = "default",
|
|
6521
6535
|
size: size2 = "md",
|
|
6536
|
+
align,
|
|
6522
6537
|
confirmLabel,
|
|
6523
6538
|
cancelLabel = "Cancel",
|
|
6524
6539
|
confirmVariant = "primary",
|
|
@@ -6553,6 +6568,7 @@ function NoteConfirmModalShell({
|
|
|
6553
6568
|
open: true,
|
|
6554
6569
|
onOpenChange: requestOpenChange,
|
|
6555
6570
|
size: size2,
|
|
6571
|
+
align,
|
|
6556
6572
|
className,
|
|
6557
6573
|
onEscapeKeyDown: guardDiscard,
|
|
6558
6574
|
onInteractOutside: guardDiscard,
|