@jsenv/navi 0.29.178 → 0.29.180
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/jsenv_navi.js +89 -25
- package/dist/jsenv_navi.js.map +5 -5
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -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] -
|
|
60910
|
-
*
|
|
60911
|
-
* @param {boolean} [props.expandX] -
|
|
60912
|
-
*
|
|
60913
|
-
*
|
|
60914
|
-
*
|
|
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-
|
|
69716
|
-
right: calc(-1 *
|
|
69717
|
-
|
|
69718
|
-
|
|
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,22 @@ 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
|
+
align-items: center;
|
|
69970
|
+
display: inline-flex;
|
|
69971
|
+
}
|
|
69972
|
+
}
|
|
69930
69973
|
}
|
|
69931
69974
|
`;
|
|
69932
69975
|
const PickerButton = props => {
|
|
@@ -69937,6 +69980,9 @@ const PickerButton = props => {
|
|
|
69937
69980
|
const {
|
|
69938
69981
|
ref,
|
|
69939
69982
|
variant,
|
|
69983
|
+
// The trigger is one icon — its box is that icon's, the way <Button icon>
|
|
69984
|
+
// means it. A shape, so it composes with the variant painting around it.
|
|
69985
|
+
icon,
|
|
69940
69986
|
rightSlotIcon,
|
|
69941
69987
|
rightSlotIconSize = "inherit",
|
|
69942
69988
|
// What goes in the right slot as-is — no <Icon> around it, so a caller can
|
|
@@ -69988,19 +70034,26 @@ const PickerButton = props => {
|
|
|
69988
70034
|
const isSingleLine = maxLines === 1;
|
|
69989
70035
|
// Same rule as the root: phrasing content inside a sentence.
|
|
69990
70036
|
const ContentTag = variant === "text" ? "span" : "div";
|
|
70037
|
+
// One icon and nothing else: the trigger IS the drawing, so it has no slot
|
|
70038
|
+
// beside it and no line of text to be as tall as. `variant="icon"` says that
|
|
70039
|
+
// shape and "no surface either" in one word.
|
|
70040
|
+
const isIcon = Boolean(icon) || variant === "icon";
|
|
69991
70041
|
// Who gets the right slot — the chevron saying "this opens", and the cross
|
|
69992
70042
|
// replacing it once there is something to clear. Both are about a value, so
|
|
69993
70043
|
// the slot follows the value and not the drawing: `picksNothing` has none to
|
|
69994
70044
|
// announce and none to take back, whatever variant it is drawn in.
|
|
69995
|
-
//
|
|
69996
|
-
// a
|
|
69997
|
-
//
|
|
69998
|
-
//
|
|
70045
|
+
// `rightSlot={null}` is the caller asking for no slot at all: the slot is a
|
|
70046
|
+
// box with a gutter of its own, so an empty one is a few pixels of nothing at
|
|
70047
|
+
// the end of the trigger, and the trigger's center is no longer its drawing's.
|
|
70048
|
+
// Then the drawings that hold no value beside them: an icon trigger IS its
|
|
70049
|
+
// icon, a headless one draws nothing, a button says what it opens with its
|
|
70050
|
+
// label, a word in a sentence has no room for furniture. Nor a picker
|
|
70051
|
+
// rendering the browser's own control ("default").
|
|
69999
70052
|
// Nor a bare one: the picker is that drawing's box to the pixel, so anything
|
|
70000
70053
|
// navi adds beside it either grows the box or covers what the caller drew.
|
|
70001
70054
|
// The pieces are the caller's to place there instead — a <Picker.Clear /> in
|
|
70002
70055
|
// their own layout (see warnOnClearableWithoutSlot).
|
|
70003
|
-
const hasRightSlot = !picksNothing &&
|
|
70056
|
+
const hasRightSlot = !picksNothing && rightSlot !== null && !isIcon && variant !== "headless" && variant !== "button" && variant !== "text" && variant !== "bare" && ui !== "default";
|
|
70004
70057
|
const inputRef = useRef(null);
|
|
70005
70058
|
const [pickerRemainingProps, inputProps, facadeChildrenProps] = useControlFacadeProps({
|
|
70006
70059
|
...props,
|
|
@@ -70081,6 +70134,7 @@ const PickerButton = props => {
|
|
|
70081
70134
|
baseClassName: "navi_picker",
|
|
70082
70135
|
pseudoClasses: PICKER_BUTTON_PSEUDO_CLASSES,
|
|
70083
70136
|
"data-variant": variant,
|
|
70137
|
+
"data-icon": isIcon ? "" : undefined,
|
|
70084
70138
|
"navi-picker": "",
|
|
70085
70139
|
"navi-single-line": isSingleLine ? "" : undefined,
|
|
70086
70140
|
"navi-ui-custom": ui === "default" ? undefined : "",
|
|
@@ -70090,6 +70144,7 @@ const PickerButton = props => {
|
|
|
70090
70144
|
basePseudoState: basePseudoState,
|
|
70091
70145
|
styleCSSVars: PickerStyleCSSVars,
|
|
70092
70146
|
variant: undefined,
|
|
70147
|
+
icon: undefined,
|
|
70093
70148
|
role: undefined,
|
|
70094
70149
|
rightSlotIcon: undefined,
|
|
70095
70150
|
rightSlotIconSize: undefined,
|
|
@@ -70240,7 +70295,7 @@ const PickerButton = props => {
|
|
|
70240
70295
|
children: jsx(PickerOwnContent, {
|
|
70241
70296
|
children: jsx(MaxLinesContext.Provider, {
|
|
70242
70297
|
value: maxLines,
|
|
70243
|
-
children: ui === undefined ?
|
|
70298
|
+
children: ui === undefined ? isIcon ?
|
|
70244
70299
|
// An icon picker draws no value, so there is no slot
|
|
70245
70300
|
// beside it either — the icon that would have sat in
|
|
70246
70301
|
// that slot IS the trigger, and a caller's own `ui`
|
|
@@ -82391,6 +82446,15 @@ const css = /* css */`.navi_side_panel {
|
|
|
82391
82446
|
* own `minWidth`.
|
|
82392
82447
|
* @param {string|number} [props.minHeight] - Forwarded as-is to `Popup`'s
|
|
82393
82448
|
* own `minHeight`.
|
|
82449
|
+
* @param {boolean} [props.expandX] - Forwarded as-is to `Popup`: the panel
|
|
82450
|
+
* fills its width ceiling instead of sizing to its content. Meaningful
|
|
82451
|
+
* for a `left`/`right` panel (its docked axis — the perpendicular one
|
|
82452
|
+
* already fills); whichever renderer `Popup` picks, this is the same
|
|
82453
|
+
* fill the `width` prop would give with the ceiling as its value.
|
|
82454
|
+
* @param {boolean} [props.expandY] - Same, vertically — the docked axis of
|
|
82455
|
+
* a `top`/`bottom` panel. Give a panel whose content may grow past the
|
|
82456
|
+
* screen this (or an explicit `height`): a definite height is what lets
|
|
82457
|
+
* a scroller inside it engage instead of the whole panel overflowing.
|
|
82394
82458
|
* @param {"top"|"local"} [props.layer="top"] - `"top"` (default): docks
|
|
82395
82459
|
* against the app's own screen — the viewport, narrowed to the app's
|
|
82396
82460
|
* rectangle when it declares `--navi-app-max-width` (real top-layer
|