@jsenv/navi 0.20.1 → 0.20.3
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 +53 -45
- package/dist/jsenv_navi.js.map +13 -11
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -6288,6 +6288,7 @@ const DIMENSION_PROPS = {
|
|
|
6288
6288
|
borderRadius: "100%",
|
|
6289
6289
|
};
|
|
6290
6290
|
},
|
|
6291
|
+
aspectRatio: PASS_THROUGH,
|
|
6291
6292
|
expand: applyOnTwoProps("expandX", "expandY"),
|
|
6292
6293
|
shrink: applyOnTwoProps("shrinkX", "shrinkY"),
|
|
6293
6294
|
// apply after width/height to override if both are set
|
|
@@ -19141,7 +19142,7 @@ const TextOverflow = ({
|
|
|
19141
19142
|
}) => {
|
|
19142
19143
|
const [OverflowPinnedElement, setOverflowPinnedElement] = useState(null);
|
|
19143
19144
|
return jsx(Text, {
|
|
19144
|
-
|
|
19145
|
+
flex: true,
|
|
19145
19146
|
as: "div",
|
|
19146
19147
|
nowWrap: noWrap,
|
|
19147
19148
|
pre: !noWrap
|
|
@@ -19213,7 +19214,7 @@ const TextBasic = ({
|
|
|
19213
19214
|
...rest,
|
|
19214
19215
|
"baseClassName": withPropsClassName("navi_text", rest.baseClassName)
|
|
19215
19216
|
};
|
|
19216
|
-
const shouldPreserveSpacing = rest.as === "pre" || rest.
|
|
19217
|
+
const shouldPreserveSpacing = rest.as === "pre" || rest.flex || rest.grid;
|
|
19217
19218
|
if (shouldPreserveSpacing) {
|
|
19218
19219
|
boxProps.spacing = spacing;
|
|
19219
19220
|
} else {
|
|
@@ -19278,11 +19279,19 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
19278
19279
|
}
|
|
19279
19280
|
&[data-icon-char] {
|
|
19280
19281
|
flex-grow: 0 !important;
|
|
19281
|
-
}
|
|
19282
|
-
}
|
|
19283
19282
|
|
|
19284
|
-
|
|
19285
|
-
|
|
19283
|
+
svg,
|
|
19284
|
+
img {
|
|
19285
|
+
width: 100%;
|
|
19286
|
+
height: 100%;
|
|
19287
|
+
}
|
|
19288
|
+
svg {
|
|
19289
|
+
overflow: visible;
|
|
19290
|
+
}
|
|
19291
|
+
}
|
|
19292
|
+
&[data-interactive] {
|
|
19293
|
+
cursor: pointer;
|
|
19294
|
+
}
|
|
19286
19295
|
}
|
|
19287
19296
|
|
|
19288
19297
|
.navi_icon_char_slot {
|
|
@@ -19294,15 +19303,16 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
19294
19303
|
position: absolute;
|
|
19295
19304
|
inset: 0;
|
|
19296
19305
|
display: inline-flex;
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
+
|
|
19307
|
+
& > .navi_text {
|
|
19308
|
+
display: flex;
|
|
19309
|
+
aspect-ratio: 1 / 1;
|
|
19310
|
+
min-width: 0;
|
|
19311
|
+
height: 100%;
|
|
19312
|
+
max-height: 1em;
|
|
19313
|
+
align-items: center;
|
|
19314
|
+
justify-content: center;
|
|
19315
|
+
}
|
|
19306
19316
|
}
|
|
19307
19317
|
|
|
19308
19318
|
.navi_icon > svg,
|
|
@@ -19311,30 +19321,21 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
19311
19321
|
height: 100%;
|
|
19312
19322
|
backface-visibility: hidden;
|
|
19313
19323
|
}
|
|
19314
|
-
.navi_icon[data-
|
|
19315
|
-
.navi_icon[data-
|
|
19324
|
+
.navi_icon[data-width-fixed] > svg,
|
|
19325
|
+
.navi_icon[data-width-fixed] > img {
|
|
19316
19326
|
width: 100%;
|
|
19317
19327
|
height: auto;
|
|
19318
19328
|
}
|
|
19319
|
-
.navi_icon[data-
|
|
19320
|
-
.navi_icon[data-
|
|
19329
|
+
.navi_icon[data-height-fixed] > svg,
|
|
19330
|
+
.navi_icon[data-height-fixed] > img {
|
|
19321
19331
|
width: auto;
|
|
19322
19332
|
height: 100%;
|
|
19323
19333
|
}
|
|
19324
|
-
.navi_icon[data-
|
|
19325
|
-
.navi_icon[data-
|
|
19326
|
-
width: 100%;
|
|
19327
|
-
height: 100%;
|
|
19328
|
-
}
|
|
19329
|
-
|
|
19330
|
-
.navi_icon[data-icon-char] svg,
|
|
19331
|
-
.navi_icon[data-icon-char] img {
|
|
19334
|
+
.navi_icon[data-width-fixed][data-height-fixed] > svg,
|
|
19335
|
+
.navi_icon[data-width-fixed][data-height-fixed] > img {
|
|
19332
19336
|
width: 100%;
|
|
19333
19337
|
height: 100%;
|
|
19334
19338
|
}
|
|
19335
|
-
.navi_icon[data-icon-char] svg {
|
|
19336
|
-
overflow: visible;
|
|
19337
|
-
}
|
|
19338
19339
|
`;
|
|
19339
19340
|
const Icon = ({
|
|
19340
19341
|
href,
|
|
@@ -19356,24 +19357,31 @@ const Icon = ({
|
|
|
19356
19357
|
})
|
|
19357
19358
|
}) : children;
|
|
19358
19359
|
let {
|
|
19359
|
-
|
|
19360
|
+
flex,
|
|
19361
|
+
grid,
|
|
19360
19362
|
width,
|
|
19361
19363
|
height
|
|
19362
19364
|
} = props;
|
|
19363
|
-
if (width === "auto")
|
|
19364
|
-
|
|
19365
|
+
if (width === "auto") {
|
|
19366
|
+
width = undefined;
|
|
19367
|
+
}
|
|
19368
|
+
if (height === "auto") {
|
|
19369
|
+
height = undefined;
|
|
19370
|
+
}
|
|
19365
19371
|
const hasExplicitWidth = width !== undefined;
|
|
19366
19372
|
const hasExplicitHeight = height !== undefined;
|
|
19367
|
-
if (
|
|
19368
|
-
if (
|
|
19369
|
-
|
|
19373
|
+
if (hasExplicitWidth || hasExplicitHeight) {
|
|
19374
|
+
if (flex === undefined) {
|
|
19375
|
+
flex = "x";
|
|
19370
19376
|
}
|
|
19371
|
-
} else {
|
|
19372
|
-
|
|
19377
|
+
} else if (decorative === undefined && !onClick) {
|
|
19378
|
+
decorative = true;
|
|
19373
19379
|
}
|
|
19374
19380
|
const ariaProps = decorative ? {
|
|
19375
19381
|
"aria-hidden": "true"
|
|
19376
19382
|
} : {};
|
|
19383
|
+
const widthConstrained = hasExplicitWidth || hasExplicitHeight && (props.square || props.circle || props.aspectRatio);
|
|
19384
|
+
const heightConstrained = hasExplicitHeight || hasExplicitWidth && (props.square || props.circle || props.aspectRatio);
|
|
19377
19385
|
if (typeof children === "string") {
|
|
19378
19386
|
return jsx(Text, {
|
|
19379
19387
|
...props,
|
|
@@ -19382,15 +19390,15 @@ const Icon = ({
|
|
|
19382
19390
|
children: children
|
|
19383
19391
|
});
|
|
19384
19392
|
}
|
|
19385
|
-
if (
|
|
19393
|
+
if (flex || grid) {
|
|
19386
19394
|
return jsx(Box, {
|
|
19387
19395
|
square: true,
|
|
19388
19396
|
...props,
|
|
19389
19397
|
...ariaProps,
|
|
19390
|
-
|
|
19398
|
+
flex: flex,
|
|
19391
19399
|
baseClassName: "navi_icon",
|
|
19392
|
-
"data-
|
|
19393
|
-
"data-
|
|
19400
|
+
"data-width-fixed": widthConstrained ? "" : undefined,
|
|
19401
|
+
"data-height-fixed": heightConstrained ? "" : undefined,
|
|
19394
19402
|
"data-interactive": onClick ? "" : undefined,
|
|
19395
19403
|
onClick: onClick,
|
|
19396
19404
|
children: innerChildren
|
|
@@ -19403,8 +19411,8 @@ const Icon = ({
|
|
|
19403
19411
|
className: withPropsClassName("navi_icon", props.className),
|
|
19404
19412
|
spacing: "pre",
|
|
19405
19413
|
"data-icon-char": "",
|
|
19406
|
-
"data-
|
|
19407
|
-
"data-
|
|
19414
|
+
"data-width-fixed": widthConstrained ? "" : undefined,
|
|
19415
|
+
"data-height-fixed": heightConstrained ? "" : undefined,
|
|
19408
19416
|
"data-interactive": onClick ? "" : undefined,
|
|
19409
19417
|
onClick: onClick,
|
|
19410
19418
|
children: [jsx("span", {
|
|
@@ -31570,7 +31578,7 @@ const DialogLayout = ({
|
|
|
31570
31578
|
visualSelector: ".navi_dialog_content",
|
|
31571
31579
|
...props,
|
|
31572
31580
|
children: jsx(Box, {
|
|
31573
|
-
|
|
31581
|
+
flex: "y",
|
|
31574
31582
|
className: "navi_dialog_content",
|
|
31575
31583
|
alignX: alignX,
|
|
31576
31584
|
alignY: alignY,
|