@jsenv/navi 0.29.177 → 0.29.179

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.
@@ -59430,6 +59430,18 @@ const css$D = /* css */`
59430
59430
  to filter). An entrance animation moves the popover through scale and
59431
59431
  transform instead, which compose under it: see popup_css.js. */
59432
59432
 
59433
+ /* The clamped max, not --popover-maxmax-*: that one ignores what the
59434
+ placement left available, which reaches here through
59435
+ --container-position-remaining-* (see applyNewPosition) — the min()
59436
+ in --x-popover-max-* accounts for both. Mirrors Dialog's own
59437
+ data-expand-x/y rules. */
59438
+ &[data-expand-x] {
59439
+ width: var(--x-popover-max-width);
59440
+ }
59441
+ &[data-expand-y] {
59442
+ height: var(--x-popover-max-height);
59443
+ }
59444
+
59433
59445
  /* The via-attribute renderer starts hidden for free (native UA default
59434
59446
  for any [popover] element, same as <dialog> without [open]) — the
59435
59447
  custom renderer is a plain div with no such native default, so
@@ -59674,6 +59686,14 @@ const css$D = /* css */`
59674
59686
  * @param {string} [props.minHeight] - Maps to `--popover-min-height`, same
59675
59687
  * clamping as `minWidth`.
59676
59688
  * @param {string} [props.maxHeight] - Maps to `--popover-max-height`.
59689
+ * @param {boolean} [props.expand] - Shorthand for both `expandX`/`expandY`
59690
+ * below.
59691
+ * @param {boolean} [props.expandX] - Stretches the popover to
59692
+ * `--x-popover-max-width` (`data-expand-x`) — the full width its own
59693
+ * ceiling and the placement leave available — instead of its content
59694
+ * width. Same meaning as `Dialog`'s own `expandX`.
59695
+ * @param {boolean} [props.expandY] - Same, vertically
59696
+ * (`--x-popover-max-height`, `data-expand-y`).
59677
59697
  * @param {"auto"|"frozen"} [props.sizing="auto"] - `"auto"`: the popover
59678
59698
  * follows its content for as long as it stays open. `"frozen"`: it is
59679
59699
  * measured once and held at that size until it closes — what no longer fits
@@ -59954,6 +59974,13 @@ const usePopoverProps = props => {
59954
59974
  // "auto" (default) → the popover follows its content. "frozen" → measured
59955
59975
  // once, held at that size while open. See this prop's own JSDoc above.
59956
59976
  sizing = "auto",
59977
+ // Destructured (not left in ...rest) so they reach the DOM as the
59978
+ // data-expand-x/y attributes the CSS above reads, never as Box's own
59979
+ // expandX/expandY style props — a popover's fill is its clamped max
59980
+ // (--x-popover-max-*), not a percentage of whatever holds it.
59981
+ expand,
59982
+ expandX,
59983
+ expandY,
59957
59984
  animation,
59958
59985
  anchor,
59959
59986
  anchorCustomEventDetail = "override",
@@ -60683,6 +60710,8 @@ const usePopoverProps = props => {
60683
60710
  id,
60684
60711
  tabIndex,
60685
60712
  "data-layer": layer,
60713
+ "data-expand-x": expand || expandX ? "" : undefined,
60714
+ "data-expand-y": expand || expandY ? "" : undefined,
60686
60715
  "navi-animation": isAutoAnimation ? undefined : animation,
60687
60716
  // See backdropProps' own identical prop above for the full reasoning
60688
60717
  // (kept once, not repeated here).
@@ -60906,12 +60935,13 @@ const css$C = /* css */`@layer navi {
60906
60935
  * understand it identically: `"frozen"` holds the surface at the size it was
60907
60936
  * measured at while it stays open, so acting on what it contains moves the
60908
60937
  * content and not the surface. See either component's own doc.
60909
- * @param {boolean} [props.expand] - Dialog-mode only: shorthand for both
60910
- * `expandX`/`expandY` below. No effect in popover mode.
60911
- * @param {boolean} [props.expandX] - Dialog-mode only: stretches the dialog
60912
- * to `--dialog-maxmax-width` (`data-expand-x`).
60913
- * @param {boolean} [props.expandY] - Dialog-mode only: stretches the dialog
60914
- * to `--dialog-maxmax-height` (`data-expand-y`).
60938
+ * @param {boolean} [props.expand] - Shorthand for both `expandX`/`expandY`
60939
+ * below.
60940
+ * @param {boolean} [props.expandX] - Stretches the popup to the full width
60941
+ * its renderer allows (`data-expand-x`: `--x-dialog-max-width` /
60942
+ * `--x-popover-max-width`) instead of its content width — same meaning
60943
+ * whichever mode the screen-size resolution picks.
60944
+ * @param {boolean} [props.expandY] - Same, vertically (`data-expand-y`).
60915
60945
  * @param {boolean} [props.scrollCapture] - Forwarded as-is.
60916
60946
  * @param {boolean} [props.open] - Forwarded as-is (controlled).
60917
60947
  * @param {import("@preact/signals").Signal<boolean>} [props.signal] -
@@ -60994,6 +61024,9 @@ const Popup = props => {
60994
61024
  scrollCapture: scrollCapture === "popover" || scrollCapture,
60995
61025
  positionAreaFixed: positionAreaFixed,
60996
61026
  className: withPropsClassName("navi_popup", className),
61027
+ expand: expand,
61028
+ expandX: expandX,
61029
+ expandY: expandY,
60997
61030
  children: childrenWithMode
60998
61031
  });
60999
61032
  };
@@ -69692,6 +69725,9 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`@layer navi {
69692
69725
  }
69693
69726
 
69694
69727
  & .navi_picker_right_slot {
69728
+ --x-picker-slot-hit-y-top: var(--x-picker-padding-top);
69729
+ --x-picker-slot-hit-y-bottom: var(--x-picker-padding-bottom);
69730
+ --x-picker-slot-hit-x: var(--picker-slot-spacing, calc(var(--x-picker-padding-right) * .5));
69695
69731
  height: 1lh;
69696
69732
  margin-right: var(--picker-slot-spacing, calc(var(--x-picker-padding-right) * .5));
69697
69733
  color: var(--x-picker-icon-color);
@@ -69712,12 +69748,10 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`@layer navi {
69712
69748
 
69713
69749
  & .navi_button, & .navi_picker .navi_picker_box {
69714
69750
  &:before {
69715
- top: calc(-1 * var(--x-picker-padding-top));
69716
- right: calc(-1 *
69717
- var(--picker-slot-spacing, calc(var(--x-picker-padding-right) * .5)));
69718
- bottom: calc(-1 * var(--x-picker-padding-bottom));
69719
- left: calc(-1 *
69720
- var(--picker-slot-spacing, calc(var(--x-picker-padding-right) * .5)));
69751
+ top: calc(-1 * var(--x-picker-slot-hit-y-top));
69752
+ right: calc(-1 * var(--x-picker-slot-hit-x));
69753
+ bottom: calc(-1 * var(--x-picker-slot-hit-y-bottom));
69754
+ left: calc(-1 * var(--x-picker-slot-hit-x));
69721
69755
  content: "";
69722
69756
  position: absolute;
69723
69757
  }
@@ -69811,9 +69845,6 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`@layer navi {
69811
69845
  }
69812
69846
 
69813
69847
  &[data-variant="icon"] {
69814
- --picker-padding-x-default: 0;
69815
- --picker-padding-y-default: 0;
69816
- --picker-align-x-default: center;
69817
69848
  --picker-border-width: 0px;
69818
69849
  --picker-border-color: transparent;
69819
69850
  --picker-border-color-hover: var(--picker-border-color);
@@ -69824,10 +69855,6 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`@layer navi {
69824
69855
  --picker-background-color-readonly: var(--picker-background-color);
69825
69856
  --picker-background-color-disabled: var(--picker-background-color);
69826
69857
  --picker-icon-color: currentColor;
69827
-
69828
- & .navi_picker_value {
69829
- flex-grow: 0;
69830
- }
69831
69858
  }
69832
69859
 
69833
69860
  &[data-variant="discrete"] {
@@ -69927,6 +69954,20 @@ installImportMetaCssBuild(import.meta);const css$t = /* css */`@layer navi {
69927
69954
  text-decoration-style: solid;
69928
69955
  }
69929
69956
  }
69957
+
69958
+ &[data-icon] {
69959
+ --picker-padding-x-default: 0;
69960
+ --picker-padding-y-default: 0;
69961
+ --picker-align-x-default: center;
69962
+
69963
+ & .navi_picker_box {
69964
+ min-height: 0;
69965
+ }
69966
+
69967
+ & .navi_picker_value {
69968
+ flex-grow: 0;
69969
+ }
69970
+ }
69930
69971
  }
69931
69972
  `;
69932
69973
  const PickerButton = props => {
@@ -69937,6 +69978,9 @@ const PickerButton = props => {
69937
69978
  const {
69938
69979
  ref,
69939
69980
  variant,
69981
+ // The trigger is one icon — its box is that icon's, the way <Button icon>
69982
+ // means it. A shape, so it composes with the variant painting around it.
69983
+ icon,
69940
69984
  rightSlotIcon,
69941
69985
  rightSlotIconSize = "inherit",
69942
69986
  // What goes in the right slot as-is — no <Icon> around it, so a caller can
@@ -69988,19 +70032,26 @@ const PickerButton = props => {
69988
70032
  const isSingleLine = maxLines === 1;
69989
70033
  // Same rule as the root: phrasing content inside a sentence.
69990
70034
  const ContentTag = variant === "text" ? "span" : "div";
70035
+ // One icon and nothing else: the trigger IS the drawing, so it has no slot
70036
+ // beside it and no line of text to be as tall as. `variant="icon"` says that
70037
+ // shape and "no surface either" in one word.
70038
+ const isIcon = Boolean(icon) || variant === "icon";
69991
70039
  // Who gets the right slot — the chevron saying "this opens", and the cross
69992
70040
  // replacing it once there is something to clear. Both are about a value, so
69993
70041
  // the slot follows the value and not the drawing: `picksNothing` has none to
69994
70042
  // announce and none to take back, whatever variant it is drawn in.
69995
- // Then the variants that draw no value beside it: an icon picker IS its icon,
69996
- // a headless one draws nothing, a button says what it opens with its label, a
69997
- // word in a sentence has no room for furniture. Nor a picker rendering the
69998
- // browser's own control ("default").
70043
+ // `rightSlot={null}` is the caller asking for no slot at all: the slot is a
70044
+ // box with a gutter of its own, so an empty one is a few pixels of nothing at
70045
+ // the end of the trigger, and the trigger's center is no longer its drawing's.
70046
+ // Then the drawings that hold no value beside them: an icon trigger IS its
70047
+ // icon, a headless one draws nothing, a button says what it opens with its
70048
+ // label, a word in a sentence has no room for furniture. Nor a picker
70049
+ // rendering the browser's own control ("default").
69999
70050
  // Nor a bare one: the picker is that drawing's box to the pixel, so anything
70000
70051
  // navi adds beside it either grows the box or covers what the caller drew.
70001
70052
  // The pieces are the caller's to place there instead — a <Picker.Clear /> in
70002
70053
  // their own layout (see warnOnClearableWithoutSlot).
70003
- const hasRightSlot = !picksNothing && variant !== "icon" && variant !== "headless" && variant !== "button" && variant !== "text" && variant !== "bare" && ui !== "default";
70054
+ const hasRightSlot = !picksNothing && rightSlot !== null && !isIcon && variant !== "headless" && variant !== "button" && variant !== "text" && variant !== "bare" && ui !== "default";
70004
70055
  const inputRef = useRef(null);
70005
70056
  const [pickerRemainingProps, inputProps, facadeChildrenProps] = useControlFacadeProps({
70006
70057
  ...props,
@@ -70081,6 +70132,7 @@ const PickerButton = props => {
70081
70132
  baseClassName: "navi_picker",
70082
70133
  pseudoClasses: PICKER_BUTTON_PSEUDO_CLASSES,
70083
70134
  "data-variant": variant,
70135
+ "data-icon": isIcon ? "" : undefined,
70084
70136
  "navi-picker": "",
70085
70137
  "navi-single-line": isSingleLine ? "" : undefined,
70086
70138
  "navi-ui-custom": ui === "default" ? undefined : "",
@@ -70090,6 +70142,7 @@ const PickerButton = props => {
70090
70142
  basePseudoState: basePseudoState,
70091
70143
  styleCSSVars: PickerStyleCSSVars,
70092
70144
  variant: undefined,
70145
+ icon: undefined,
70093
70146
  role: undefined,
70094
70147
  rightSlotIcon: undefined,
70095
70148
  rightSlotIconSize: undefined,
@@ -70240,7 +70293,7 @@ const PickerButton = props => {
70240
70293
  children: jsx(PickerOwnContent, {
70241
70294
  children: jsx(MaxLinesContext.Provider, {
70242
70295
  value: maxLines,
70243
- children: ui === undefined ? variant === "icon" ?
70296
+ children: ui === undefined ? isIcon ?
70244
70297
  // An icon picker draws no value, so there is no slot
70245
70298
  // beside it either — the icon that would have sat in
70246
70299
  // that slot IS the trigger, and a caller's own `ui`
@@ -82251,18 +82304,18 @@ const css = /* css */`.navi_side_panel {
82251
82304
  height: var(--navi-side-panel-height, auto);
82252
82305
 
82253
82306
  &[data-layer="top"] {
82254
- --popover-max-height: var(--navi-vvh);
82255
- --popover-maxmax-height: var(--navi-vvh);
82256
- --popover-maxmax-width: var(--navi-vvw);
82257
- --dialog-maxmax-height: var(--navi-vvh);
82258
- --dialog-maxmax-width: var(--navi-vvw);
82307
+ --popover-max-height: var(--navi-app-height);
82308
+ --popover-maxmax-height: var(--navi-app-height);
82309
+ --popover-maxmax-width: var(--navi-app-width);
82310
+ --dialog-maxmax-height: var(--navi-app-height);
82311
+ --dialog-maxmax-width: var(--navi-app-width);
82259
82312
 
82260
82313
  &[navi-side="left"], &[navi-side="right"] {
82261
- height: var(--navi-side-panel-height, var(--navi-vvh));
82314
+ height: var(--navi-side-panel-height, var(--navi-app-height));
82262
82315
  }
82263
82316
 
82264
82317
  &[navi-side="top"], &[navi-side="bottom"] {
82265
- width: var(--navi-side-panel-width, var(--navi-vvw));
82318
+ width: var(--navi-side-panel-width, var(--navi-app-width));
82266
82319
  }
82267
82320
 
82268
82321
  &[navi-side="left"] {
@@ -82391,9 +82444,20 @@ const css = /* css */`.navi_side_panel {
82391
82444
  * own `minWidth`.
82392
82445
  * @param {string|number} [props.minHeight] - Forwarded as-is to `Popup`'s
82393
82446
  * own `minHeight`.
82447
+ * @param {boolean} [props.expandX] - Forwarded as-is to `Popup`: the panel
82448
+ * fills its width ceiling instead of sizing to its content. Meaningful
82449
+ * for a `left`/`right` panel (its docked axis — the perpendicular one
82450
+ * already fills); whichever renderer `Popup` picks, this is the same
82451
+ * fill the `width` prop would give with the ceiling as its value.
82452
+ * @param {boolean} [props.expandY] - Same, vertically — the docked axis of
82453
+ * a `top`/`bottom` panel. Give a panel whose content may grow past the
82454
+ * screen this (or an explicit `height`): a definite height is what lets
82455
+ * a scroller inside it engage instead of the whole panel overflowing.
82394
82456
  * @param {"top"|"local"} [props.layer="top"] - `"top"` (default): docks
82395
- * against the viewport (real top-layer rendering, matches a fixed,
82396
- * always-on-screen drawer). `"local"`: docks against the panel's own
82457
+ * against the app's own screen — the viewport, narrowed to the app's
82458
+ * rectangle when it declares `--navi-app-max-width` (real top-layer
82459
+ * rendering, matches a fixed, always-on-screen drawer). `"local"`: docks
82460
+ * against the panel's own
82397
82461
  * positioned DOM ancestor instead, confined to (and clipped by) it — for
82398
82462
  * a drawer that only takes over part of the page rather than the whole
82399
82463
  * viewport.