@jsenv/navi 0.22.1 → 0.22.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/jsenv_navi.js +176 -186
- package/dist/jsenv_navi.js.map +39 -49
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -2107,7 +2107,7 @@ const createActionProxyFromSignal = (
|
|
|
2107
2107
|
};
|
|
2108
2108
|
};
|
|
2109
2109
|
|
|
2110
|
-
const nameSignal = signal();
|
|
2110
|
+
const nameSignal = signal(action.name);
|
|
2111
2111
|
const callSourceSignal = signal();
|
|
2112
2112
|
let actionProxy;
|
|
2113
2113
|
{
|
|
@@ -20008,123 +20008,6 @@ const isSameKey = (browserEventKey, key) => {
|
|
|
20008
20008
|
return false;
|
|
20009
20009
|
};
|
|
20010
20010
|
|
|
20011
|
-
installImportMetaCssBuild(import.meta);const css$7 = /* css */`
|
|
20012
|
-
.navi_text_aligner_anchor {
|
|
20013
|
-
vertical-align: baseline;
|
|
20014
|
-
user-select: none;
|
|
20015
|
-
overflow: hidden;
|
|
20016
|
-
}
|
|
20017
|
-
`;
|
|
20018
|
-
|
|
20019
|
-
/**
|
|
20020
|
-
* Positions children vertically relative to the surrounding text, correcting for font-size differences.
|
|
20021
|
-
*
|
|
20022
|
-
* Place this component around any inline element whose font-size differs from the surrounding text.
|
|
20023
|
-
* It renders an invisible anchor that inherits the surrounding text's font metrics, then shifts
|
|
20024
|
-
* the child so that its visual position matches the requested `align` value — regardless of
|
|
20025
|
-
* font-size, display type (inline, inline-block, inline-flex…), or the active `vertical-align`.
|
|
20026
|
-
*
|
|
20027
|
-
* @param {"center"|"baseline"|"start"|"end"} [align="baseline"]
|
|
20028
|
-
* - `"center"` — child is vertically centered on the surrounding text's ink bounds
|
|
20029
|
-
* - `"baseline"` — no correction applied; child sits wherever the browser places it (default)
|
|
20030
|
-
* - `"start"` — child top aligns with the surrounding text's ink top
|
|
20031
|
-
* - `"end"` — child bottom aligns with the surrounding text's ink bottom
|
|
20032
|
-
* @param {import("ignore:preact").RefObject} childRef — ref on the child element to reposition
|
|
20033
|
-
*/
|
|
20034
|
-
const SurroundingTextAligner = ({
|
|
20035
|
-
children,
|
|
20036
|
-
align = "baseline",
|
|
20037
|
-
childRef,
|
|
20038
|
-
textSize,
|
|
20039
|
-
size
|
|
20040
|
-
}) => {
|
|
20041
|
-
import.meta.css = [css$7, "@jsenv/navi/src/text/surrounding_text_aligner.jsx"];
|
|
20042
|
-
const anchorRef = useRef();
|
|
20043
|
-
useLayoutEffect(() => {
|
|
20044
|
-
const anchorEl = anchorRef.current;
|
|
20045
|
-
const childEl = childRef.current;
|
|
20046
|
-
if (!anchorEl || !childEl) {
|
|
20047
|
-
return;
|
|
20048
|
-
}
|
|
20049
|
-
const topOffset = computeTopOffset({
|
|
20050
|
-
anchorEl,
|
|
20051
|
-
childEl,
|
|
20052
|
-
align
|
|
20053
|
-
});
|
|
20054
|
-
if (topOffset) {
|
|
20055
|
-
childEl.style.position = "relative";
|
|
20056
|
-
childEl.style.top = `${topOffset}px`;
|
|
20057
|
-
} else {
|
|
20058
|
-
childEl.style.position = "";
|
|
20059
|
-
childEl.style.top = "";
|
|
20060
|
-
}
|
|
20061
|
-
}, [size, textSize]);
|
|
20062
|
-
return jsxs(Fragment, {
|
|
20063
|
-
children: [children, jsx("span", {
|
|
20064
|
-
ref: anchorRef,
|
|
20065
|
-
className: "navi_text_aligner_anchor",
|
|
20066
|
-
children: "\u200B"
|
|
20067
|
-
})]
|
|
20068
|
-
});
|
|
20069
|
-
};
|
|
20070
|
-
const computeTopOffset = ({
|
|
20071
|
-
anchorEl,
|
|
20072
|
-
childEl,
|
|
20073
|
-
align
|
|
20074
|
-
}) => {
|
|
20075
|
-
if (align === "baseline") {
|
|
20076
|
-
return 0;
|
|
20077
|
-
}
|
|
20078
|
-
// Only correct when the anchor lives in an inline formatting context.
|
|
20079
|
-
// If the parent is a flex/grid container, inline layout rules don't apply
|
|
20080
|
-
// and our font-metrics model is invalid.
|
|
20081
|
-
const parentDisplay = getComputedStyle(anchorEl.parentElement).display;
|
|
20082
|
-
if (parentDisplay !== "inline" && parentDisplay !== "inline-block" && parentDisplay !== "block") {
|
|
20083
|
-
return 0;
|
|
20084
|
-
}
|
|
20085
|
-
const anchorStyle = getComputedStyle(anchorEl);
|
|
20086
|
-
const anchorMetrics = measureFontAscDesc("M", anchorStyle);
|
|
20087
|
-
const [anchorABA, anchorABD] = anchorMetrics.actual;
|
|
20088
|
-
const anchorActH = anchorABA + anchorABD;
|
|
20089
|
-
const [, anchorFBBD] = anchorMetrics.font;
|
|
20090
|
-
|
|
20091
|
-
// Estimate the baseline Y from the anchor's bounding rect.
|
|
20092
|
-
// For an inline span, the font cell bottom is always at the element's bottom edge
|
|
20093
|
-
// (regardless of vertical-align), so baseline = rect.bottom - fontBoundingBoxDescent.
|
|
20094
|
-
const anchorRect = anchorEl.getBoundingClientRect();
|
|
20095
|
-
const baselineY = anchorRect.bottom - anchorFBBD;
|
|
20096
|
-
const anchorInkTopY = baselineY - anchorABA;
|
|
20097
|
-
|
|
20098
|
-
// Measure the child's current rect, then subtract any previously applied top correction
|
|
20099
|
-
// to recover its natural position — avoiding a style reset + reflow.
|
|
20100
|
-
const childRect = childEl.getBoundingClientRect();
|
|
20101
|
-
const childH = childRect.height;
|
|
20102
|
-
const previousTop = parseFloat(childEl.style.top) || 0;
|
|
20103
|
-
const childNaturalTop = childRect.top - previousTop;
|
|
20104
|
-
|
|
20105
|
-
// Compute desired child top Y based on align intention.
|
|
20106
|
-
let desiredChildTopY = 0;
|
|
20107
|
-
if (align === "center") {
|
|
20108
|
-
const anchorInkCenterY = anchorInkTopY + anchorActH / 2;
|
|
20109
|
-
desiredChildTopY = anchorInkCenterY - childH / 2;
|
|
20110
|
-
} else if (align === "start") {
|
|
20111
|
-
desiredChildTopY = anchorInkTopY;
|
|
20112
|
-
} else if (align === "end") {
|
|
20113
|
-
desiredChildTopY = anchorInkTopY + anchorActH - childH;
|
|
20114
|
-
}
|
|
20115
|
-
return desiredChildTopY - childNaturalTop;
|
|
20116
|
-
};
|
|
20117
|
-
const canvas = document.createElement("canvas");
|
|
20118
|
-
const measureFontAscDesc = (text, computedStyle) => {
|
|
20119
|
-
const ctx = canvas.getContext("2d");
|
|
20120
|
-
ctx.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`;
|
|
20121
|
-
const metrics = ctx.measureText(text);
|
|
20122
|
-
return {
|
|
20123
|
-
actual: [metrics.actualBoundingBoxAscent, metrics.actualBoundingBoxDescent],
|
|
20124
|
-
font: [metrics.fontBoundingBoxAscent, metrics.fontBoundingBoxDescent]
|
|
20125
|
-
};
|
|
20126
|
-
};
|
|
20127
|
-
|
|
20128
20011
|
const useInitialTextSelection = (ref, textSelection) => {
|
|
20129
20012
|
const deps = [];
|
|
20130
20013
|
if (Array.isArray(textSelection)) {
|
|
@@ -20225,7 +20108,7 @@ const selectByTextStrings = (element, range, startText, endText) => {
|
|
|
20225
20108
|
};
|
|
20226
20109
|
|
|
20227
20110
|
installImportMetaCssBuild(import.meta);/* eslint-disable jsenv/no-unknown-params */
|
|
20228
|
-
const css$
|
|
20111
|
+
const css$8 = /* css */`
|
|
20229
20112
|
@layer navi {
|
|
20230
20113
|
.navi_text {
|
|
20231
20114
|
&[data-skeleton] {
|
|
@@ -20534,7 +20417,7 @@ const shouldInjectSpacingBetween = (left, right) => {
|
|
|
20534
20417
|
};
|
|
20535
20418
|
const OverflowPinnedElementContext = createContext(null);
|
|
20536
20419
|
const Text = props => {
|
|
20537
|
-
import.meta.css = [css$
|
|
20420
|
+
import.meta.css = [css$8, "@jsenv/navi/src/text/text.jsx"];
|
|
20538
20421
|
if (props.loading || props.skeleton) {
|
|
20539
20422
|
return jsx(TextSkeleton, {
|
|
20540
20423
|
...props
|
|
@@ -20730,11 +20613,140 @@ const TextBasic = ({
|
|
|
20730
20613
|
});
|
|
20731
20614
|
};
|
|
20732
20615
|
|
|
20733
|
-
installImportMetaCssBuild(import.meta);const css$
|
|
20616
|
+
installImportMetaCssBuild(import.meta);const css$7 = /* css */`
|
|
20617
|
+
.navi_text_anchor {
|
|
20618
|
+
vertical-align: baseline;
|
|
20619
|
+
user-select: none;
|
|
20620
|
+
overflow: hidden;
|
|
20621
|
+
}
|
|
20622
|
+
`;
|
|
20623
|
+
|
|
20624
|
+
/**
|
|
20625
|
+
* Positions children vertically relative to the surrounding text, correcting for font-size differences.
|
|
20626
|
+
*
|
|
20627
|
+
* Place this component around any inline element whose font-size differs from the surrounding text.
|
|
20628
|
+
* It renders an invisible anchor that inherits the surrounding text's font metrics, then shifts
|
|
20629
|
+
* the child so that its visual position matches the requested `textAnchor` value — regardless of
|
|
20630
|
+
* font-size, display type (inline, inline-block, inline-flex…), or the active `vertical-align`.
|
|
20631
|
+
*
|
|
20632
|
+
* @param {"line-top"|"char-top"|"center"|"char-bottom"|"line-bottom"} [textAnchor="char-bottom"]
|
|
20633
|
+
* - `"line-top"` — child top aligns with the top of the surrounding line box
|
|
20634
|
+
* - `"char-top"` — child top aligns with the top of visible characters (ink ascent)
|
|
20635
|
+
* - `"center"` — child is vertically centered on the surrounding line box
|
|
20636
|
+
* - `"char-bottom"` — child bottom aligns to the text baseline (no correction, browser default)
|
|
20637
|
+
* - `"line-bottom"` — child bottom aligns with the bottom of the surrounding line box
|
|
20638
|
+
* @param {{ size?: number, verticalAlign?: string }} [lineLayout]
|
|
20639
|
+
* Describes the surrounding line context. Used as layout-effect dependencies so the correction
|
|
20640
|
+
* reruns when the surrounding text's font-size or vertical-align changes.
|
|
20641
|
+
* @param {import("ignore:preact").RefObject} childRef — ref on the child element to reposition
|
|
20642
|
+
*/
|
|
20643
|
+
const TextAnchor = ({
|
|
20644
|
+
children,
|
|
20645
|
+
textAnchor = "char-bottom",
|
|
20646
|
+
childRef,
|
|
20647
|
+
lineLayout,
|
|
20648
|
+
size
|
|
20649
|
+
}) => {
|
|
20650
|
+
import.meta.css = [css$7, "@jsenv/navi/src/text/text_anchor.jsx"];
|
|
20651
|
+
const anchorRef = useRef();
|
|
20652
|
+
useLayoutEffect(() => {
|
|
20653
|
+
const anchorEl = anchorRef.current;
|
|
20654
|
+
const childEl = childRef.current;
|
|
20655
|
+
if (!anchorEl || !childEl) {
|
|
20656
|
+
return;
|
|
20657
|
+
}
|
|
20658
|
+
const topOffset = computeTopOffset({
|
|
20659
|
+
anchorEl,
|
|
20660
|
+
childEl,
|
|
20661
|
+
textAnchor
|
|
20662
|
+
});
|
|
20663
|
+
if (topOffset) {
|
|
20664
|
+
// position:relative + top shifts the element visually.
|
|
20665
|
+
// marginTop: -topOffset makes the layout box follow the visual position, so any container
|
|
20666
|
+
// (button, link, box…) computes its own padding/border/height based on the real final position
|
|
20667
|
+
// rather than the original unshifted one. This means a badge inside a button will symmetrically
|
|
20668
|
+
// expand the button height instead of overflowing or being clipped.
|
|
20669
|
+
// marginBottom: topOffset compensates the marginTop so the line height stays unchanged —
|
|
20670
|
+
// the shift is purely a repositioning, not an inflation of the line.
|
|
20671
|
+
childEl.style.position = "relative";
|
|
20672
|
+
childEl.style.top = `${topOffset}px`;
|
|
20673
|
+
childEl.style.marginTop = `${-topOffset}px`;
|
|
20674
|
+
childEl.style.marginBottom = `${topOffset}px`;
|
|
20675
|
+
} else {
|
|
20676
|
+
childEl.style.position = "";
|
|
20677
|
+
childEl.style.top = "";
|
|
20678
|
+
childEl.style.marginTop = "";
|
|
20679
|
+
childEl.style.marginBottom = "";
|
|
20680
|
+
}
|
|
20681
|
+
}, [size, textAnchor, lineLayout?.size, lineLayout?.verticalAlign]);
|
|
20682
|
+
return jsxs(Fragment, {
|
|
20683
|
+
children: [children, jsx("span", {
|
|
20684
|
+
ref: anchorRef,
|
|
20685
|
+
className: "navi_text_anchor",
|
|
20686
|
+
children: "\u200B"
|
|
20687
|
+
})]
|
|
20688
|
+
});
|
|
20689
|
+
};
|
|
20690
|
+
const computeTopOffset = ({
|
|
20691
|
+
anchorEl,
|
|
20692
|
+
childEl,
|
|
20693
|
+
textAnchor
|
|
20694
|
+
}) => {
|
|
20695
|
+
if (textAnchor === "char-bottom") {
|
|
20696
|
+
// Align child's bottom with the char's bottom = the baseline.
|
|
20697
|
+
// The CSS spec says an inline-block with no text content has its baseline at its bottom margin edge.
|
|
20698
|
+
// So the browser's default placement already puts the child's bottom at the line's baseline.
|
|
20699
|
+
// No correction needed.
|
|
20700
|
+
return 0;
|
|
20701
|
+
}
|
|
20702
|
+
// Only correct when the anchor lives in an inline formatting context.
|
|
20703
|
+
// If the parent is a flex/grid container, inline layout rules don't apply
|
|
20704
|
+
// and our font-metrics model is invalid.
|
|
20705
|
+
const parentDisplay = getComputedStyle(anchorEl.parentElement).display;
|
|
20706
|
+
if (parentDisplay !== "inline" && parentDisplay !== "inline-block" && parentDisplay !== "block") {
|
|
20707
|
+
return 0;
|
|
20708
|
+
}
|
|
20709
|
+
|
|
20710
|
+
// The anchor's rendered rect corresponds to the surrounding text's line box:
|
|
20711
|
+
// top and bottom are the visual bounds of the line (including line-height).
|
|
20712
|
+
const anchorRect = anchorEl.getBoundingClientRect();
|
|
20713
|
+
|
|
20714
|
+
// Measure the child's current rect, then subtract any previously applied top correction
|
|
20715
|
+
// to recover its natural position — avoiding a style reset + reflow.
|
|
20716
|
+
const childRect = childEl.getBoundingClientRect();
|
|
20717
|
+
const childH = childRect.height;
|
|
20718
|
+
const previousTop = parseFloat(childEl.style.top) || 0;
|
|
20719
|
+
const childNaturalTop = childRect.top - previousTop;
|
|
20720
|
+
|
|
20721
|
+
// Compute desired child top Y based on textAnchor intention.
|
|
20722
|
+
let desiredChildTopY = 0;
|
|
20723
|
+
if (textAnchor === "line-top") {
|
|
20724
|
+
desiredChildTopY = anchorRect.top;
|
|
20725
|
+
} else if (textAnchor === "char-top") {
|
|
20726
|
+
const anchorStyle = getComputedStyle(anchorEl);
|
|
20727
|
+
const ctx = charTopCanvas.getContext("2d");
|
|
20728
|
+
ctx.font = `${anchorStyle.fontWeight} ${anchorStyle.fontSize} ${anchorStyle.fontFamily}`;
|
|
20729
|
+
const m = ctx.measureText("M");
|
|
20730
|
+
const baselineY = anchorRect.bottom - m.fontBoundingBoxDescent;
|
|
20731
|
+
desiredChildTopY = baselineY - m.actualBoundingBoxAscent;
|
|
20732
|
+
} else if (textAnchor === "center") {
|
|
20733
|
+
const anchorCenterY = (anchorRect.top + anchorRect.bottom) / 2;
|
|
20734
|
+
desiredChildTopY = anchorCenterY - childH / 2;
|
|
20735
|
+
} else if (textAnchor === "char-bottom") {
|
|
20736
|
+
// Already handled above (early return 0), but guard here for completeness.
|
|
20737
|
+
return 0;
|
|
20738
|
+
} else if (textAnchor === "line-bottom") {
|
|
20739
|
+
desiredChildTopY = anchorRect.bottom - childH;
|
|
20740
|
+
}
|
|
20741
|
+
return desiredChildTopY - childNaturalTop;
|
|
20742
|
+
};
|
|
20743
|
+
const charTopCanvas = document.createElement("canvas");
|
|
20744
|
+
|
|
20745
|
+
installImportMetaCssBuild(import.meta);const css$6 = /* css */`
|
|
20734
20746
|
@layer navi {
|
|
20735
20747
|
/* Ensure data attributes from box.jsx can win to update display */
|
|
20736
20748
|
.navi_icon {
|
|
20737
|
-
display: inline-
|
|
20749
|
+
display: inline-flex;
|
|
20738
20750
|
box-sizing: border-box;
|
|
20739
20751
|
max-width: 100%;
|
|
20740
20752
|
max-height: 100%;
|
|
@@ -20745,12 +20757,14 @@ installImportMetaCssBuild(import.meta);const css$5 = /* css */`
|
|
|
20745
20757
|
white-space: nowrap;
|
|
20746
20758
|
vertical-align: inherit;
|
|
20747
20759
|
|
|
20748
|
-
&[data-flow-inline] {
|
|
20749
|
-
width: 1em;
|
|
20750
|
-
height: 1em;
|
|
20751
|
-
}
|
|
20752
20760
|
&[data-icon-char] {
|
|
20761
|
+
aspect-ratio: 1/1;
|
|
20762
|
+
min-width: 0;
|
|
20763
|
+
height: 1em;
|
|
20764
|
+
max-height: 1em;
|
|
20753
20765
|
flex-grow: 0 !important;
|
|
20766
|
+
align-items: center;
|
|
20767
|
+
justify-content: center;
|
|
20754
20768
|
|
|
20755
20769
|
svg,
|
|
20756
20770
|
img {
|
|
@@ -20761,32 +20775,15 @@ installImportMetaCssBuild(import.meta);const css$5 = /* css */`
|
|
|
20761
20775
|
overflow: visible;
|
|
20762
20776
|
}
|
|
20763
20777
|
}
|
|
20778
|
+
&[data-flow-inline] {
|
|
20779
|
+
width: 1em;
|
|
20780
|
+
height: 1em;
|
|
20781
|
+
}
|
|
20764
20782
|
&[data-interactive] {
|
|
20765
20783
|
cursor: pointer;
|
|
20766
20784
|
}
|
|
20767
20785
|
}
|
|
20768
20786
|
|
|
20769
|
-
.navi_icon_char_slot {
|
|
20770
|
-
opacity: 0;
|
|
20771
|
-
cursor: default;
|
|
20772
|
-
user-select: none;
|
|
20773
|
-
}
|
|
20774
|
-
.navi_text.navi_icon_foreground {
|
|
20775
|
-
position: absolute;
|
|
20776
|
-
inset: 0;
|
|
20777
|
-
display: inline-flex;
|
|
20778
|
-
|
|
20779
|
-
& > .navi_text {
|
|
20780
|
-
display: flex;
|
|
20781
|
-
aspect-ratio: 1 / 1;
|
|
20782
|
-
min-width: 0;
|
|
20783
|
-
height: 100%;
|
|
20784
|
-
max-height: 1em;
|
|
20785
|
-
align-items: center;
|
|
20786
|
-
justify-content: center;
|
|
20787
|
-
}
|
|
20788
|
-
}
|
|
20789
|
-
|
|
20790
20787
|
.navi_icon > svg,
|
|
20791
20788
|
.navi_icon > img {
|
|
20792
20789
|
width: 100%;
|
|
@@ -20812,16 +20809,13 @@ installImportMetaCssBuild(import.meta);const css$5 = /* css */`
|
|
|
20812
20809
|
const Icon = ({
|
|
20813
20810
|
href,
|
|
20814
20811
|
children,
|
|
20815
|
-
charWidth = 1,
|
|
20816
|
-
// 0 (zéro) is the real char width
|
|
20817
|
-
// but 2 zéros gives too big icons
|
|
20818
|
-
// while 1 "W" gives a nice result
|
|
20819
|
-
baseChar = "W",
|
|
20820
20812
|
decorative,
|
|
20821
20813
|
onClick,
|
|
20814
|
+
textAnchor = "center",
|
|
20815
|
+
lineLayout,
|
|
20822
20816
|
...props
|
|
20823
20817
|
}) => {
|
|
20824
|
-
import.meta.css = [css$
|
|
20818
|
+
import.meta.css = [css$6, "@jsenv/navi/src/text/icon.jsx"];
|
|
20825
20819
|
const innerChildren = href ? jsx("svg", {
|
|
20826
20820
|
width: "100%",
|
|
20827
20821
|
height: "100%",
|
|
@@ -20878,12 +20872,11 @@ const Icon = ({
|
|
|
20878
20872
|
children: innerChildren
|
|
20879
20873
|
});
|
|
20880
20874
|
}
|
|
20881
|
-
|
|
20882
|
-
|
|
20883
|
-
|
|
20875
|
+
return jsx(TextAnchor, {
|
|
20876
|
+
textAnchor: textAnchor,
|
|
20877
|
+
lineLayout: lineLayout,
|
|
20884
20878
|
childRef: textRef,
|
|
20885
20879
|
size: props.size,
|
|
20886
|
-
textSize: props.textSize,
|
|
20887
20880
|
children: jsxs(Text, {
|
|
20888
20881
|
...props,
|
|
20889
20882
|
...ariaProps,
|
|
@@ -20896,14 +20889,9 @@ const Icon = ({
|
|
|
20896
20889
|
onClick: onClick,
|
|
20897
20890
|
ref: textRef,
|
|
20898
20891
|
children: [jsx("span", {
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
|
|
20902
|
-
}), jsx(Text, {
|
|
20903
|
-
className: "navi_icon_foreground",
|
|
20904
|
-
spacing: "pre",
|
|
20905
|
-
children: innerChildren
|
|
20906
|
-
})]
|
|
20892
|
+
style: "user-select:none",
|
|
20893
|
+
children: "\u200B"
|
|
20894
|
+
}), innerChildren]
|
|
20907
20895
|
})
|
|
20908
20896
|
});
|
|
20909
20897
|
};
|
|
@@ -21429,7 +21417,7 @@ const useUIState = (uiStateController) => {
|
|
|
21429
21417
|
return trackedUIState;
|
|
21430
21418
|
};
|
|
21431
21419
|
|
|
21432
|
-
installImportMetaCssBuild(import.meta);const css$
|
|
21420
|
+
installImportMetaCssBuild(import.meta);const css$5 = /* css */`
|
|
21433
21421
|
@layer navi {
|
|
21434
21422
|
.navi_button {
|
|
21435
21423
|
--button-outline-width: 1px;
|
|
@@ -21506,7 +21494,6 @@ installImportMetaCssBuild(import.meta);const css$4 = /* css */`
|
|
|
21506
21494
|
box-sizing: border-box;
|
|
21507
21495
|
aspect-ratio: inherit;
|
|
21508
21496
|
padding: 0;
|
|
21509
|
-
vertical-align: middle;
|
|
21510
21497
|
background: none;
|
|
21511
21498
|
border: none;
|
|
21512
21499
|
border-radius: var(--x-button-border-radius);
|
|
@@ -21681,7 +21668,7 @@ installImportMetaCssBuild(import.meta);const css$4 = /* css */`
|
|
|
21681
21668
|
}
|
|
21682
21669
|
`;
|
|
21683
21670
|
const Button = props => {
|
|
21684
|
-
import.meta.css = [css$
|
|
21671
|
+
import.meta.css = [css$5, "@jsenv/navi/src/field/button.jsx"];
|
|
21685
21672
|
return renderActionableComponent(props, {
|
|
21686
21673
|
Basic: ButtonBasic,
|
|
21687
21674
|
WithAction: ButtonWithAction,
|
|
@@ -22246,7 +22233,7 @@ const useDimColorWhen = (elementRef, shouldDim) => {
|
|
|
22246
22233
|
};
|
|
22247
22234
|
|
|
22248
22235
|
installImportMetaCssBuild(import.meta);/* eslint-disable jsenv/no-unknown-params */
|
|
22249
|
-
const css$
|
|
22236
|
+
const css$4 = /* css */`
|
|
22250
22237
|
@layer navi {
|
|
22251
22238
|
.navi_link {
|
|
22252
22239
|
--link-border-radius: unset;
|
|
@@ -22567,7 +22554,7 @@ Object.assign(PSEUDO_CLASSES, {
|
|
|
22567
22554
|
}
|
|
22568
22555
|
});
|
|
22569
22556
|
const Link = props => {
|
|
22570
|
-
import.meta.css = [css$
|
|
22557
|
+
import.meta.css = [css$4, "@jsenv/navi/src/nav/link/link.jsx"];
|
|
22571
22558
|
return renderActionableComponent(props, {
|
|
22572
22559
|
Basic: LinkBasic,
|
|
22573
22560
|
WithAction: LinkWithAction
|
|
@@ -22829,7 +22816,7 @@ installImportMetaCssBuild(import.meta);/**
|
|
|
22829
22816
|
* TabList component with support for horizontal and vertical layouts
|
|
22830
22817
|
* https://dribbble.com/search/tabs
|
|
22831
22818
|
*/
|
|
22832
|
-
const css$
|
|
22819
|
+
const css$3 = /* css */`
|
|
22833
22820
|
@layer navi {
|
|
22834
22821
|
.navi_nav {
|
|
22835
22822
|
--nav-border: none;
|
|
@@ -22866,6 +22853,8 @@ const css$2 = /* css */`
|
|
|
22866
22853
|
/* overflow-y: hidden; */
|
|
22867
22854
|
|
|
22868
22855
|
.navi_link {
|
|
22856
|
+
user-select: none;
|
|
22857
|
+
|
|
22869
22858
|
--x-nav-child-border-radius: calc(
|
|
22870
22859
|
var(--nav-border-radius) - var(--nav-padding)
|
|
22871
22860
|
);
|
|
@@ -22963,7 +22952,7 @@ const Nav = ({
|
|
|
22963
22952
|
panelBorderConnection,
|
|
22964
22953
|
...props
|
|
22965
22954
|
}) => {
|
|
22966
|
-
import.meta.css = [css$
|
|
22955
|
+
import.meta.css = [css$3, "@jsenv/navi/src/nav/link/nav.jsx"];
|
|
22967
22956
|
children = toChildArray(children);
|
|
22968
22957
|
return jsx(Box, {
|
|
22969
22958
|
as: "nav",
|
|
@@ -24852,7 +24841,7 @@ const InputRadioWithAction = () => {
|
|
|
24852
24841
|
throw new Error(`<Input type="radio" /> with an action make no sense. Use <RadioList action={something} /> instead`);
|
|
24853
24842
|
};
|
|
24854
24843
|
|
|
24855
|
-
installImportMetaCssBuild(import.meta);
|
|
24844
|
+
installImportMetaCssBuild(import.meta);const css$2 = /* css */`
|
|
24856
24845
|
@layer navi {
|
|
24857
24846
|
.navi_input_range {
|
|
24858
24847
|
--border-radius: 6px;
|
|
@@ -25059,8 +25048,9 @@ installImportMetaCssBuild(import.meta);import.meta.css = [/* css */`
|
|
|
25059
25048
|
.navi_input_range[data-callout] {
|
|
25060
25049
|
/* What can we do? */
|
|
25061
25050
|
}
|
|
25062
|
-
|
|
25051
|
+
`;
|
|
25063
25052
|
const InputRange = props => {
|
|
25053
|
+
import.meta.css = [css$2, "@jsenv/navi/src/field/input_range.jsx"];
|
|
25064
25054
|
const uiStateController = useUIStateController(props, "input");
|
|
25065
25055
|
const uiState = useUIState(uiStateController);
|
|
25066
25056
|
const input = renderActionableComponent(props, {
|
|
@@ -26549,10 +26539,10 @@ const RadioListBasic = props => {
|
|
|
26549
26539
|
const innerDisabled = disabled || contextDisabled;
|
|
26550
26540
|
return jsx(Box, {
|
|
26551
26541
|
"data-action": rest["data-action"],
|
|
26552
|
-
|
|
26542
|
+
flex: "y",
|
|
26553
26543
|
...rest,
|
|
26554
26544
|
baseClassName: "navi_radio_list",
|
|
26555
|
-
"data-radio-list":
|
|
26545
|
+
"data-radio-list": "",
|
|
26556
26546
|
onresetuistate: e => {
|
|
26557
26547
|
uiStateController.resetUIState(e);
|
|
26558
26548
|
},
|
|
@@ -30664,10 +30654,11 @@ const BadgeCount = ({
|
|
|
30664
30654
|
// so that visually the interface do not suddently switch from circle to ellipse depending on the count
|
|
30665
30655
|
circle,
|
|
30666
30656
|
max = circle ? MAX_FOR_CIRCLE : Infinity,
|
|
30667
|
-
textSize,
|
|
30668
30657
|
integer,
|
|
30669
30658
|
lang,
|
|
30670
30659
|
loading,
|
|
30660
|
+
textAnchor = "center",
|
|
30661
|
+
lineLayout,
|
|
30671
30662
|
...props
|
|
30672
30663
|
}) => {
|
|
30673
30664
|
import.meta.css = [css, "@jsenv/navi/src/text/badge_count.jsx"];
|
|
@@ -30690,11 +30681,11 @@ const BadgeCount = ({
|
|
|
30690
30681
|
circle = false;
|
|
30691
30682
|
}
|
|
30692
30683
|
if (circle) {
|
|
30693
|
-
return jsx(
|
|
30694
|
-
|
|
30684
|
+
return jsx(TextAnchor, {
|
|
30685
|
+
textAnchor: textAnchor,
|
|
30686
|
+
lineLayout: lineLayout,
|
|
30695
30687
|
childRef: ref,
|
|
30696
30688
|
size: props.size,
|
|
30697
|
-
textSize: textSize,
|
|
30698
30689
|
children: jsxs(BadgeCountCircle, {
|
|
30699
30690
|
...props,
|
|
30700
30691
|
loading: loading,
|
|
@@ -30708,11 +30699,11 @@ const BadgeCount = ({
|
|
|
30708
30699
|
const valueFormatted = typeof valueDisplayed === "number" ? formatNumber(valueDisplayed, {
|
|
30709
30700
|
lang
|
|
30710
30701
|
}) : valueDisplayed;
|
|
30711
|
-
return jsx(
|
|
30712
|
-
|
|
30702
|
+
return jsx(TextAnchor, {
|
|
30703
|
+
textAnchor: textAnchor,
|
|
30704
|
+
lineLayout: lineLayout,
|
|
30713
30705
|
childRef: ref,
|
|
30714
30706
|
size: props.size,
|
|
30715
|
-
textSize: textSize,
|
|
30716
30707
|
children: jsxs(BadgeCountEllipse, {
|
|
30717
30708
|
...props,
|
|
30718
30709
|
loading: loading,
|
|
@@ -31651,10 +31642,9 @@ const getMeterLevel = (value, min, max, low, high, optimum) => {
|
|
|
31651
31642
|
|
|
31652
31643
|
const Paragraph = props => {
|
|
31653
31644
|
return jsx(Text, {
|
|
31654
|
-
marginTop: "
|
|
31645
|
+
marginTop: "m",
|
|
31655
31646
|
...props,
|
|
31656
|
-
as: "p"
|
|
31657
|
-
...props
|
|
31647
|
+
as: "p"
|
|
31658
31648
|
});
|
|
31659
31649
|
};
|
|
31660
31650
|
|