@jsenv/navi 0.29.73 → 0.29.74

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.
@@ -29852,10 +29852,13 @@ installImportMetaCssBuild(import.meta);/**
29852
29852
  * `positionArea` accepts the same grammar Popover does (see
29853
29853
  * popup_shared.js), even though several combinations land identically here
29854
29854
  * since Dialog is never really anchored — kept distinct anyway because
29855
- * `positionArea` still picks which animation direction plays. `anchor` only
29856
- * ever affects the `--anchor-width`/`--anchor-height` CSS vars (sizing the
29857
- * dialog relative to whatever opened it) Dialog's own positioning is never
29858
- * relative to it, unlike Popover.
29855
+ * `positionArea` still picks which animation direction plays. `anchor` is
29856
+ * inert here unless `sizeFromAnchor` asks for it: a dialog is a surface of
29857
+ * its own, sized by its content, not a panel grown out of the control that
29858
+ * opened it that is Popover's job. With `sizeFromAnchor`, the anchor's box
29859
+ * reaches the `--anchor-width`/`--anchor-height` CSS vars and becomes a
29860
+ * min-width/min-height floor. Either way Dialog's own positioning is never
29861
+ * relative to the anchor, unlike Popover.
29859
29862
  *
29860
29863
  * Two rendering strategies, picked via `layer`: `DialogAsModal` (a real
29861
29864
  * `<dialog>`, `showModal()`, top layer — native focus trap,
@@ -30340,17 +30343,24 @@ const css$X = /* css */`
30340
30343
  * value is used as-is.
30341
30344
  * @param {string} [props.animationDuration] - Maps to
30342
30345
  * `--popup-animation-duration`.
30343
- * @param {Element|{current: Element}|string} [props.anchor] - Only ever sizes
30344
- * the dialog via the `--anchor-width`/`--anchor-height` CSS vars never
30345
- * used for positioning (see this file's top comment). Defaults to whatever
30346
+ * @param {Element|{current: Element}|string} [props.anchor] - Never used for
30347
+ * positioning (see this file's top comment), and ignored entirely unless
30348
+ * `sizeFromAnchor` is set then it sizes the dialog via the
30349
+ * `--anchor-width`/`--anchor-height` CSS vars. Defaults to whatever
30346
30350
  * triggered the open (`e.detail.anchor`), if any. A string is resolved via
30347
30351
  * `document.getElementById` when the dialog opens — see popover.jsx's own
30348
30352
  * `anchor` doc for why (mainly `defaultOpen`).
30353
+ * @param {boolean} [props.sizeFromAnchor=false] - Whether the dialog takes the
30354
+ * anchor's width/height as a min-width/min-height floor
30355
+ * (`--anchor-width`/`--anchor-height`). Off by default: unlike a popover,
30356
+ * a dialog is not attached to what opened it, so following that element's
30357
+ * box is a deliberate choice (a picker-style surface meant to read as the
30358
+ * trigger's own continuation), not the norm.
30349
30359
  * @param {"override"|"ignore"} [props.anchorCustomEventDetail="override"] -
30350
30360
  * Whether an explicit `anchor` prop takes precedence over (`"override"`,
30351
30361
  * default) or is ignored in favor of (`"ignore"`) whatever anchor the
30352
30362
  * triggering event carried. Same prop as Popover's, applied to the only
30353
- * thing an anchor does here: sizing (`--anchor-width`/`--anchor-height`).
30363
+ * thing an anchor can do here: sizing, and only under `sizeFromAnchor`.
30354
30364
  * @param {string} [props.minWidth] - Maps to `--dialog-min-width`; clamped
30355
30365
  * so it can never push the dialog past `--dialog-maxmax-width` (the
30356
30366
  * viewport/container-spacing ceiling) regardless of how large a value is
@@ -30609,12 +30619,15 @@ const useDialogProps = props => {
30609
30619
  // once, held at that size while open. See this prop's own JSDoc above.
30610
30620
  sizing = "auto",
30611
30621
  animation,
30612
- // Only ever affects --anchor-width/--anchor-height (see this file's top
30613
- // comment) — Dialog's own positioning is never relative to it.
30622
+ // Inert unless sizeFromAnchor below (see this file's top comment) —
30623
+ // Dialog's own positioning is never relative to it.
30614
30624
  anchor,
30625
+ // Opt-in: --anchor-width/--anchor-height are only set when this is true.
30626
+ // See this prop's own JSDoc above for why a dialog does not follow its
30627
+ // trigger's box by default.
30628
+ sizeFromAnchor = false,
30615
30629
  // Same meaning as Popover's own prop, applied to the only thing an anchor
30616
- // does here: sizing. "ignore" is how a dialog that must not inherit its
30617
- // trigger's width says so (SidePanel does exactly that).
30630
+ // can do here: sizing under sizeFromAnchor.
30618
30631
  anchorCustomEventDetail = "override",
30619
30632
  // Makes the dialog itself a valid focus target so
30620
30633
  // autoFocus="last-resort" below has somewhere to land when it contains
@@ -30809,7 +30822,7 @@ const useDialogProps = props => {
30809
30822
  // see openLocalDialogCount's own comment
30810
30823
  dialogEl.style.setProperty("--dialog-stack-order", openLocalDialogCount++);
30811
30824
  }
30812
- if (anchorElement) {
30825
+ if (sizeFromAnchor && anchorElement) {
30813
30826
  const {
30814
30827
  width,
30815
30828
  height
@@ -54442,9 +54455,9 @@ installImportMetaCssBuild(import.meta);/**
54442
54455
  *
54443
54456
  * `layer` (shared by both — picks the top-layer vs. local-container rendering
54444
54457
  * strategy either way) and `anchorCustomEventDetail` (shared too: Popover
54445
- * resolves an anchor to position against, Dialog to size itself from) pass
54446
- * through untouched via `...rest` to whichever of Popover/Dialog actually
54447
- * renders.
54458
+ * resolves an anchor to position against, Dialog only to size itself from,
54459
+ * and only under its own `sizeFromAnchor`) pass through untouched via
54460
+ * `...rest` to whichever of Popover/Dialog actually renders.
54448
54461
  */
54449
54462
  const css$A = /* css */`
54450
54463
  @layer navi {
@@ -54482,13 +54495,12 @@ const css$A = /* css */`
54482
54495
  * @param {"top"|"local"} [props.layer] - Forwarded as-is to whichever of
54483
54496
  * `Dialog`/`Popover` renders — see either component's own doc.
54484
54497
  * @param {Element|{current: Element}} [props.anchor] - Forwarded as-is —
54485
- * sizing-only for `Dialog`, positioning for `Popover` (see each
54486
- * component's own doc for what it actually does there).
54498
+ * positioning for `Popover`, and for `Dialog` sizing only, and only when
54499
+ * `sizeFromAnchor` is also passed (see each component's own doc).
54487
54500
  * @param {"override"|"ignore"} [props.anchorCustomEventDetail] - Forwarded
54488
54501
  * as-is to both — what it governs differs (positioning for `Popover`,
54489
- * sizing for `Dialog`), but "ignore whatever anchor the triggering event
54490
- * carried" has to mean the same thing in either mode, or the same
54491
- * `<Popup>` usage silently picks up its trigger's width on small screens.
54502
+ * `sizeFromAnchor` sizing for `Dialog`), but "ignore whatever anchor the
54503
+ * triggering event carried" has to mean the same thing in either mode.
54492
54504
  * @param {string} [props.marginWithAnchor] - **Popover-only**, destructured
54493
54505
  * out so it can't leak onto the real `<dialog>` element as a stray DOM
54494
54506
  * attribute when `mode="dialog"` is picked.
@@ -54691,12 +54703,17 @@ installImportMetaCssBuild(import.meta);const css$z = /* css */`
54691
54703
 
54692
54704
  /* No fallback on purpose (same as --popover-max-height above): unset
54693
54705
  picker props leave these declarations invalid at computed-value
54694
- time, so the dialog keeps its own ceilings. */
54706
+ time, so the dialog keeps its own floors/ceilings. */
54707
+ --dialog-min-width: var(--picker-dialog-min-width);
54708
+ --dialog-min-height: var(--picker-dialog-min-height);
54695
54709
  --dialog-max-width: var(--picker-dialog-max-width);
54696
54710
  --dialog-max-height: var(--picker-dialog-max-height);
54697
54711
 
54698
- /* Dialog itself already sizes min-width off --anchor-width only
54699
- the cursor reset below is picker-specific here. */
54712
+ /* Nothing bridges the trigger's width in here: a dialog does not
54713
+ follow its anchor's box (dialog.jsx, sizeFromAnchor) it is not
54714
+ visually attached to the trigger, so it is sized by its content,
54715
+ and dialogMinWidth/dialogMinHeight are how a caller says otherwise.
54716
+ Only the cursor reset below is picker-specific here. */
54700
54717
  cursor: default; /* Reset pointer cursor within the select */
54701
54718
 
54702
54719
  /* Dialog already applies display: flex to [open] itself, but
@@ -54718,24 +54735,10 @@ installImportMetaCssBuild(import.meta);const css$z = /* css */`
54718
54735
  }
54719
54736
 
54720
54737
  /* popupWidthFitContent (picker.jsx): drop the trigger-width floor so the
54721
- popup shrinks to its content. Inherits down to the popover. */
54738
+ popup shrinks to its content. Popover-only the dialog has no such
54739
+ floor to drop (see the dialog block above). */
54722
54740
  &[data-popup-width-fit-content] {
54723
54741
  --picker-popover-min-width: 0px;
54724
-
54725
- /* The popover var above only reaches the popover — the dialog reads
54726
- --anchor-width directly for its own min-width floor (dialog.jsx). A
54727
- modal dialog isn't visually attached to the trigger, so with
54728
- fit-content we drop that floor here too, letting the content size the
54729
- dialog like the popover. (More specific than dialog.jsx's own
54730
- .navi_dialog rule; both are unlayered, so this wins.) */
54731
- &[aria-haspopup="dialog"] {
54732
- .navi_dialog {
54733
- min-width: min(
54734
- var(--dialog-min-width, 0px),
54735
- var(--x-dialog-max-width)
54736
- );
54737
- }
54738
- }
54739
54742
  }
54740
54743
  }
54741
54744
  `;
@@ -62691,6 +62694,8 @@ const PickerStyleCSSVars = {
62691
62694
  "borderWidth": "--picker-border-width",
62692
62695
  "borderRadius": "--picker-border-radius",
62693
62696
  "popoverMaxHeight": "--picker-popover-max-height",
62697
+ "dialogMinWidth": "--picker-dialog-min-width",
62698
+ "dialogMinHeight": "--picker-dialog-min-height",
62694
62699
  "dialogMaxWidth": "--picker-dialog-max-width",
62695
62700
  "dialogMaxHeight": "--picker-dialog-max-height",
62696
62701
  "popupBackgroundColor": "--picker-popup-background-color",
@@ -74034,10 +74039,11 @@ installImportMetaCssBuild(import.meta);/**
74034
74039
  * `navi-side`/`data-layer` attributes) rather than computed in JS — read
74035
74040
  * the CSS block below instead of expecting a JS equivalent of it here.
74036
74041
  *
74037
- * `anchorCustomEventDetail="ignore"` is required, not cosmetic, and in both
74038
- * modes: without it Popover docks next to whatever triggered the open instead
74039
- * of flush against the edge, and Dialog takes that trigger's width as its own
74040
- * `min-width` floor (`--anchor-width`), overriding the `width` prop.
74042
+ * `anchorCustomEventDetail="ignore"` is required, not cosmetic: without it
74043
+ * Popover docks next to whatever triggered the open instead of flush against
74044
+ * the edge. Dialog needs nothing here it never sizes itself from an anchor
74045
+ * unless asked to (`sizeFromAnchor`, see dialog.jsx), which a side panel
74046
+ * never does: its `width`/`height` props are what size it.
74041
74047
  */
74042
74048
  const css = /* css */`
74043
74049
  .navi_side_panel {