@jsenv/navi 0.21.3 → 0.21.5

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.
@@ -18830,10 +18830,6 @@ const css$3 = /* css */`
18830
18830
  .navi_text {
18831
18831
  position: relative;
18832
18832
 
18833
- &[data-has-absolute-child] {
18834
- display: inline-block;
18835
- }
18836
-
18837
18833
  /* There is a chrome specific bug that prevents text-transform: capitalize to be applied in nested DOM structure */
18838
18834
  /* The CSS below ensure capitalize is propagated to the bold clones */
18839
18835
  &[data-capitalize] {
@@ -18865,6 +18861,7 @@ const css$3 = /* css */`
18865
18861
  }
18866
18862
 
18867
18863
  &[data-text-overflow] {
18864
+ min-width: 0;
18868
18865
  flex-wrap: wrap;
18869
18866
  text-overflow: ellipsis;
18870
18867
  overflow: hidden;
@@ -18882,9 +18879,68 @@ const css$3 = /* css */`
18882
18879
  }
18883
18880
  }
18884
18881
  }
18882
+
18883
+ /* When skeleton + overflow ellipsis: skeleton fills available space,
18884
+ no text to clip so disable overflow machinery. */
18885
+ &[data-text-overflow][data-skeleton] {
18886
+ flex-wrap: nowrap;
18887
+ text-overflow: clip;
18888
+ /* overflow:hidden on [data-text-overflow] would clip the absolutely
18889
+ positioned skeleton span — keep it visible */
18890
+ overflow: visible;
18891
+
18892
+ .navi_text_overflow_wrapper {
18893
+ display: contents;
18894
+ .navi_text_overflow_text {
18895
+ display: contents;
18896
+
18897
+ max-width: none;
18898
+ text-overflow: clip;
18899
+ overflow: visible;
18900
+ }
18901
+ }
18902
+ }
18903
+
18904
+ &[data-skeleton] {
18905
+ /* Keep layout space — children are hidden, skeleton overlays absolutely */
18906
+ visibility: hidden;
18907
+
18908
+ .navi_text_skeleton {
18909
+ position: absolute;
18910
+ inset: 0;
18911
+ /* top/bottom inset may not perfectly align with text bounds — acceptable */
18912
+ background: linear-gradient(
18913
+ 90deg,
18914
+ #e0e0e0 25%,
18915
+ #f0f0f0 50%,
18916
+ #e0e0e0 75%
18917
+ );
18918
+ background-size: 200% 100%;
18919
+ border-radius: 4px;
18920
+ visibility: visible;
18921
+ }
18922
+
18923
+ &[data-empty] {
18924
+ .navi_text_skeleton {
18925
+ height: 1em;
18926
+ }
18927
+ }
18928
+
18929
+ &[data-loading] {
18930
+ .navi_text_skeleton {
18931
+ animation: navi_text_skeleton_shimmer 1.5s infinite;
18932
+ }
18933
+ }
18934
+ }
18885
18935
  }
18886
18936
 
18887
- .navi_custom_space {
18937
+ @keyframes navi_text_skeleton_shimmer {
18938
+ 0% {
18939
+ background-position: 200% 0;
18940
+ }
18941
+ 100% {
18942
+ background-position: -200% 0;
18943
+ }
18888
18944
  }
18889
18945
 
18890
18946
  .navi_text_bold_wrapper {
@@ -19041,13 +19097,14 @@ const shouldInjectSpacingBetween = (left, right) => {
19041
19097
  const OverflowPinnedElementContext = createContext(null);
19042
19098
  const Text = props => {
19043
19099
  import.meta.css = [css$3, "@jsenv/navi/src/text/text.jsx"];
19044
- const {
19045
- overflowEllipsis,
19046
- ...rest
19047
- } = props;
19048
- if (overflowEllipsis) {
19100
+ if (props.loading || props.skeleton) {
19101
+ return jsx(TextSkeleton, {
19102
+ ...props
19103
+ });
19104
+ }
19105
+ if (props.overflowEllipsis) {
19049
19106
  return jsx(TextOverflow, {
19050
- ...rest
19107
+ ...props
19051
19108
  });
19052
19109
  }
19053
19110
  if (props.overflowPinned) {
@@ -19064,6 +19121,33 @@ const Text = props => {
19064
19121
  ...props
19065
19122
  });
19066
19123
  };
19124
+ const TextSkeleton = ({
19125
+ loading,
19126
+ children,
19127
+ ...props
19128
+ }) => {
19129
+ const skeletonSpan = jsx("span", {
19130
+ className: "navi_text_skeleton",
19131
+ "aria-hidden": "true"
19132
+ });
19133
+ // When there are no children we inject an invisible "W" so the element takes
19134
+ // its natural text height (matching current font-size) instead of relying on
19135
+ // min-height which can be off. The W is hidden via CSS visibility:hidden.
19136
+ const hasChildren = children !== null && children !== undefined && children !== false;
19137
+ const innerChildren = hasChildren ? children : jsx("span", {
19138
+ "aria-hidden": "true",
19139
+ children: "W"
19140
+ });
19141
+ return jsx(Text, {
19142
+ "data-skeleton": "",
19143
+ "data-loading": loading ? "" : undefined,
19144
+ "data-empty": !hasChildren ? "" : undefined,
19145
+ ...props,
19146
+ skeleton: undefined,
19147
+ childrenOutsideFlow: skeletonSpan,
19148
+ children: innerChildren
19149
+ });
19150
+ };
19067
19151
  const TextOverflow = ({
19068
19152
  noWrap,
19069
19153
  spacing,
@@ -19082,7 +19166,8 @@ const TextOverflow = ({
19082
19166
 
19083
19167
  preLine: rest.as === "p",
19084
19168
  ...rest,
19085
- "data-text-overflow": true,
19169
+ overflowEllipsis: undefined,
19170
+ "data-text-overflow": "",
19086
19171
  spacing: "pre",
19087
19172
  children: jsxs("span", {
19088
19173
  className: "navi_text_overflow_wrapper",
@@ -19160,7 +19245,6 @@ const TextBasic = ({
19160
19245
  ...boxProps,
19161
19246
  bold: undefined,
19162
19247
  "data-bold": bold ? "" : undefined,
19163
- "data-has-absolute-child": "",
19164
19248
  children: [jsx("span", {
19165
19249
  className: "navi_text_bold_background",
19166
19250
  "aria-hidden": "true",
@@ -31378,39 +31462,6 @@ const Paragraph = props => {
31378
31462
  });
31379
31463
  };
31380
31464
 
31381
- installImportMetaCssBuild(import.meta);import.meta.css = [/* css */`
31382
- .navi_text_placeholder {
31383
- display: inline-block;
31384
- width: 100%;
31385
- height: 1em;
31386
- background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
31387
- background-size: 200% 100%;
31388
- border-radius: 4px;
31389
-
31390
- &[data-loading] {
31391
- animation: shimmer 1.2s infinite;
31392
- }
31393
- }
31394
- @keyframes shimmer {
31395
- 0% {
31396
- background-position: 200% 0;
31397
- }
31398
- 100% {
31399
- background-position: -200% 0;
31400
- }
31401
- }
31402
- `, "@jsenv/navi/src/text/text_placeholder.jsx"];
31403
- const TextPlaceholder = ({
31404
- loading,
31405
- ...props
31406
- }) => {
31407
- return jsx(Box, {
31408
- ...props,
31409
- baseClassName: "navi_text_placeholder",
31410
- "data-loading": loading ? "" : undefined
31411
- });
31412
- };
31413
-
31414
31465
  const Image = props => {
31415
31466
  return jsx(Box, {
31416
31467
  ...props,
@@ -32054,5 +32105,5 @@ const UserSvg = () => jsx("svg", {
32054
32105
  })
32055
32106
  });
32056
32107
 
32057
- export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, Loading, MessageBox, Meter, Nav, Paragraph, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, TextPlaceholder, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDarkBackgroundAttribute, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
32108
+ export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, Loading, MessageBox, Meter, Nav, Paragraph, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDarkBackgroundAttribute, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
32058
32109
  //# sourceMappingURL=jsenv_navi.js.map