@jsenv/navi 0.27.63 → 0.27.65
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 +48 -15
- package/dist/jsenv_navi.js.map +8 -7
- package/package.json +3 -3
package/dist/jsenv_navi.js
CHANGED
|
@@ -6369,6 +6369,16 @@ const applyOnTwoCSSProps = (cssStyleA, cssStyleB) => {
|
|
|
6369
6369
|
};
|
|
6370
6370
|
};
|
|
6371
6371
|
};
|
|
6372
|
+
const applyOnFourCSSProps = (cssStyleA, cssStyleB, cssStyleC, cssStyleD) => {
|
|
6373
|
+
return (value) => {
|
|
6374
|
+
return {
|
|
6375
|
+
[cssStyleA]: value,
|
|
6376
|
+
[cssStyleB]: value,
|
|
6377
|
+
[cssStyleC]: value,
|
|
6378
|
+
[cssStyleD]: value,
|
|
6379
|
+
};
|
|
6380
|
+
};
|
|
6381
|
+
};
|
|
6372
6382
|
const applyToCssPropWhenTruthy = (
|
|
6373
6383
|
cssProp,
|
|
6374
6384
|
cssPropValue,
|
|
@@ -6420,7 +6430,16 @@ const LAYOUT_PROPS = {
|
|
|
6420
6430
|
column: () => {},
|
|
6421
6431
|
};
|
|
6422
6432
|
const OUTER_PROPS = {
|
|
6423
|
-
margin
|
|
6433
|
+
// expanded into longhands (not PASS_THROUGH) so the shorthand "margin" CSS
|
|
6434
|
+
// property is never written to the DOM: setting element.style.margin resets
|
|
6435
|
+
// all four margin-* longhands, which would silently wipe out an explicit
|
|
6436
|
+
// marginLeft/marginRight/marginTop/marginBottom applied alongside it.
|
|
6437
|
+
margin: applyOnFourCSSProps(
|
|
6438
|
+
"marginTop",
|
|
6439
|
+
"marginRight",
|
|
6440
|
+
"marginBottom",
|
|
6441
|
+
"marginLeft",
|
|
6442
|
+
),
|
|
6424
6443
|
marginLeft: PASS_THROUGH,
|
|
6425
6444
|
marginRight: PASS_THROUGH,
|
|
6426
6445
|
marginTop: PASS_THROUGH,
|
|
@@ -6433,7 +6452,15 @@ const OUTER_PROPS = {
|
|
|
6433
6452
|
viewTransitionName: PASS_THROUGH,
|
|
6434
6453
|
};
|
|
6435
6454
|
const INNER_PROPS = {
|
|
6436
|
-
|
|
6455
|
+
// expanded into longhands for the same reason as "margin" above: the
|
|
6456
|
+
// shorthand would otherwise reset paddingLeft/Right/Top/Bottom when both
|
|
6457
|
+
// are applied on the same element (e.g. padding="xs" paddingLeft="m").
|
|
6458
|
+
padding: applyOnFourCSSProps(
|
|
6459
|
+
"paddingTop",
|
|
6460
|
+
"paddingRight",
|
|
6461
|
+
"paddingBottom",
|
|
6462
|
+
"paddingLeft",
|
|
6463
|
+
),
|
|
6437
6464
|
paddingLeft: PASS_THROUGH,
|
|
6438
6465
|
paddingRight: PASS_THROUGH,
|
|
6439
6466
|
paddingTop: PASS_THROUGH,
|
|
@@ -6494,8 +6521,6 @@ const DIMENSION_PROPS = {
|
|
|
6494
6521
|
if (parentBoxFlow === "flex-y" || parentBoxFlow === "inline-flex-y") {
|
|
6495
6522
|
return {
|
|
6496
6523
|
alignSelf: "stretch",
|
|
6497
|
-
// ensure we override any with: 'fit-content' for instance
|
|
6498
|
-
// also useful for ".navi_text_sizer" to inherit the full size
|
|
6499
6524
|
width: "100%",
|
|
6500
6525
|
};
|
|
6501
6526
|
}
|
|
@@ -6515,9 +6540,6 @@ const DIMENSION_PROPS = {
|
|
|
6515
6540
|
if (parentBoxFlow === "flex-x" || parentBoxFlow === "inline-flex-x") {
|
|
6516
6541
|
return {
|
|
6517
6542
|
alignSelf: "stretch",
|
|
6518
|
-
// ensure we override any with: 'fit-content' for instance
|
|
6519
|
-
// also useful for ".navi_text_sizer" to inherit the full size
|
|
6520
|
-
height: "100%",
|
|
6521
6543
|
};
|
|
6522
6544
|
}
|
|
6523
6545
|
// Can't use flexGrow — parent is not flex-y
|
|
@@ -28315,6 +28337,7 @@ installImportMetaCssBuild(import.meta);const css$J = /* css */`
|
|
|
28315
28337
|
--button-color-disabled: var(--button-color-readonly);
|
|
28316
28338
|
|
|
28317
28339
|
/* Here to be easy to override */
|
|
28340
|
+
display: inline-block; /* So box css can override when wanting to put button inline flex */
|
|
28318
28341
|
font-size: var(--button-font-size);
|
|
28319
28342
|
font-family: var(--button-font-family);
|
|
28320
28343
|
}
|
|
@@ -28347,7 +28370,6 @@ installImportMetaCssBuild(import.meta);const css$J = /* css */`
|
|
|
28347
28370
|
touch-action: manipulation;
|
|
28348
28371
|
user-select: none;
|
|
28349
28372
|
-webkit-tap-highlight-color: var(--navi-control-tap-highlight-color);
|
|
28350
|
-
display: inline-flex;
|
|
28351
28373
|
|
|
28352
28374
|
.navi_button_content {
|
|
28353
28375
|
position: relative;
|
|
@@ -28535,6 +28557,7 @@ installImportMetaCssBuild(import.meta);const css$J = /* css */`
|
|
|
28535
28557
|
}
|
|
28536
28558
|
&[data-icon] {
|
|
28537
28559
|
--button-padding: 0;
|
|
28560
|
+
display: inline-flex;
|
|
28538
28561
|
}
|
|
28539
28562
|
/* cta: call-to-action — special background, border matches background */
|
|
28540
28563
|
&[data-cta] {
|
|
@@ -28623,7 +28646,7 @@ const ButtonUI = props => {
|
|
|
28623
28646
|
});
|
|
28624
28647
|
return jsxs(Box, {
|
|
28625
28648
|
inline: true,
|
|
28626
|
-
|
|
28649
|
+
block: true,
|
|
28627
28650
|
...buttonControlRootProps,
|
|
28628
28651
|
...buttonControlHostProps,
|
|
28629
28652
|
// eslint-disable-next-line react/no-children-prop
|
|
@@ -28708,7 +28731,6 @@ const ButtonStyleCSSVars = {
|
|
|
28708
28731
|
"borderWidth": "--button-border-width",
|
|
28709
28732
|
"borderRadius": "--button-border-radius",
|
|
28710
28733
|
"border": "--button-border",
|
|
28711
|
-
"padding": "--button-padding",
|
|
28712
28734
|
"paddingX": "--button-padding-x",
|
|
28713
28735
|
"paddingY": "--button-padding-y",
|
|
28714
28736
|
"paddingTop": "--button-padding-top",
|
|
@@ -36115,6 +36137,11 @@ const PickerCustom = props => {
|
|
|
36115
36137
|
ref,
|
|
36116
36138
|
mode: modeProp
|
|
36117
36139
|
} = props;
|
|
36140
|
+
// Resolve the id the same way useControlProps does (own id > Field's id > generated id)
|
|
36141
|
+
// before computing popupId below, so two Pickers without an explicit id never collide.
|
|
36142
|
+
const idDefault = useId();
|
|
36143
|
+
const controlId = useContext(ControlIdContext);
|
|
36144
|
+
props.id = props.id || controlId || idDefault;
|
|
36118
36145
|
// Freeze the mode for the lifetime of an opening: compute it when closed,
|
|
36119
36146
|
// keep it stable while open so a screen resize mid-session doesn't switch
|
|
36120
36147
|
// between Popover and Dialog.
|
|
@@ -39962,7 +39989,7 @@ installImportMetaCssBuild(import.meta);const css$l = /* css */`
|
|
|
39962
39989
|
--x-color: var(--color, white);
|
|
39963
39990
|
|
|
39964
39991
|
position: relative;
|
|
39965
|
-
display: inline
|
|
39992
|
+
display: inline;
|
|
39966
39993
|
max-width: 200px;
|
|
39967
39994
|
padding-top: var(--padding-y);
|
|
39968
39995
|
padding-right: var(--padding-x);
|
|
@@ -39971,7 +39998,6 @@ installImportMetaCssBuild(import.meta);const css$l = /* css */`
|
|
|
39971
39998
|
align-items: stretch;
|
|
39972
39999
|
color: var(--x-color);
|
|
39973
40000
|
font-size: var(--font-size);
|
|
39974
|
-
line-height: normal;
|
|
39975
40001
|
background: var(--x-background);
|
|
39976
40002
|
background-color: var(--x-background-color);
|
|
39977
40003
|
border-radius: 1em;
|
|
@@ -39982,7 +40008,7 @@ installImportMetaCssBuild(import.meta);const css$l = /* css */`
|
|
|
39982
40008
|
}
|
|
39983
40009
|
|
|
39984
40010
|
&[data-text-overflow] {
|
|
39985
|
-
display:
|
|
40011
|
+
display: inline;
|
|
39986
40012
|
|
|
39987
40013
|
.navi_text_overflow_wrapper {
|
|
39988
40014
|
/* Keep badge text and button together */
|
|
@@ -39994,10 +40020,13 @@ installImportMetaCssBuild(import.meta);const css$l = /* css */`
|
|
|
39994
40020
|
display: inline-flex;
|
|
39995
40021
|
margin-top: calc(-1 * var(--padding-y));
|
|
39996
40022
|
margin-bottom: calc(-1 * var(--padding-y));
|
|
40023
|
+
padding-top: var(--padding-y);
|
|
39997
40024
|
padding-right: calc(var(--padding-x) / 2);
|
|
40025
|
+
padding-bottom: var(--padding-y);
|
|
39998
40026
|
padding-left: calc(var(--padding-x) / 2);
|
|
39999
40027
|
align-items: center;
|
|
40000
40028
|
cursor: pointer;
|
|
40029
|
+
pointer-events: auto;
|
|
40001
40030
|
user-select: none;
|
|
40002
40031
|
|
|
40003
40032
|
&:first-child {
|
|
@@ -40109,6 +40138,11 @@ const BadgeList = ({
|
|
|
40109
40138
|
const measure = () => {
|
|
40110
40139
|
visibleEl.style.width = "";
|
|
40111
40140
|
if (shrinkWrap) {
|
|
40141
|
+
// Clone the already-rendered DOM nodes instead of letting React/Preact
|
|
40142
|
+
// render the children a second time into the ghost: re-rendering would
|
|
40143
|
+
// instantiate Badge/Badge.Button a second time, double-registering
|
|
40144
|
+
// their controllers (and any other mount side effect) under the same id.
|
|
40145
|
+
measureEl.replaceChildren(...Array.from(visibleEl.children, child => child.cloneNode(true)));
|
|
40112
40146
|
const optimalWidth = measureWidestChildRow(measureEl);
|
|
40113
40147
|
if (optimalWidth !== null) {
|
|
40114
40148
|
visibleEl.style.width = `${Math.ceil(optimalWidth)}px`;
|
|
@@ -40150,8 +40184,7 @@ const BadgeList = ({
|
|
|
40150
40184
|
...sharedProps,
|
|
40151
40185
|
ref: measureRef,
|
|
40152
40186
|
"aria-hidden": "true",
|
|
40153
|
-
"navi-badge-list-clone": ""
|
|
40154
|
-
children: childArray
|
|
40187
|
+
"navi-badge-list-clone": ""
|
|
40155
40188
|
}), jsxs(Box, {
|
|
40156
40189
|
baseClassName: "navi_badge_list",
|
|
40157
40190
|
...sharedProps,
|