@jsenv/navi 0.12.22 → 0.12.24

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.
@@ -13829,6 +13829,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
13829
13829
  .navi_icon {
13830
13830
  display: inline-block;
13831
13831
  box-sizing: border-box;
13832
+ max-width: 100%;
13833
+ max-height: 100%;
13832
13834
  }
13833
13835
 
13834
13836
  .navi_icon[data-interactive] {
@@ -13983,6 +13985,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
13983
13985
  text-decoration: var(--x-link-text-decoration);
13984
13986
  vertical-align: middle;
13985
13987
  border-radius: var(--link-border-radius);
13988
+ outline-width: 0;
13989
+ outline-style: solid;
13986
13990
  outline-color: var(--link-outline-color);
13987
13991
  cursor: var(--x-link-cursor);
13988
13992
  }
@@ -13998,7 +14002,6 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
13998
14002
  }
13999
14003
  .navi_link[data-focus-visible] {
14000
14004
  outline-width: 2px;
14001
- outline-style: solid;
14002
14005
  }
14003
14006
  /* Visited */
14004
14007
  .navi_link[data-visited] {
@@ -14046,20 +14049,20 @@ const LinkStyleCSSVars = {
14046
14049
  color: "--link-color-active"
14047
14050
  }
14048
14051
  };
14049
- const LinkPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":visited", ":-navi-loading", ":-navi-internal-link", ":-navi-external-link", ":-navi-anchor-link", ":-navi-current-link"];
14052
+ const LinkPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":visited", ":-navi-loading", ":-navi-link-internal", ":-navi-link-external", ":-navi-link-anchor", ":-navi-link-current"];
14050
14053
  const LinkPseudoElements = ["::-navi-loader"];
14051
14054
  Object.assign(PSEUDO_CLASSES, {
14052
- ":-navi-internal-link": {
14053
- attribute: "data-internal-link"
14055
+ ":-navi-link-internal": {
14056
+ attribute: "data-link-internal"
14054
14057
  },
14055
- ":-navi-external-link": {
14056
- attribute: "data-external-link"
14058
+ ":-navi-link-external": {
14059
+ attribute: "data-link-external"
14057
14060
  },
14058
- ":-navi-anchor-link": {
14059
- attribute: "data-anchor-link"
14061
+ ":-navi-link-anchor": {
14062
+ attribute: "data-link-anchor"
14060
14063
  },
14061
- ":-navi-current-link": {
14062
- attribute: "data-current-link"
14064
+ ":-navi-link-current": {
14065
+ attribute: "data-link-current"
14063
14066
  }
14064
14067
  });
14065
14068
  const Link = props => {
@@ -14162,10 +14165,10 @@ const LinkPlain = props => {
14162
14165
  ":disabled": disabled,
14163
14166
  ":visited": visited,
14164
14167
  ":-navi-loading": loading,
14165
- ":-navi-internal-link": targetIsSameSite,
14166
- ":-navi-external-link": !targetIsSameSite,
14167
- ":-navi-anchor-link": targetIsAnchor,
14168
- ":-navi-current-link": targetIsCurrent
14168
+ ":-navi-link-internal": targetIsSameSite,
14169
+ ":-navi-link-external": !targetIsSameSite,
14170
+ ":-navi-link-anchor": targetIsAnchor,
14171
+ ":-navi-link-current": targetIsCurrent
14169
14172
  },
14170
14173
  onClick: e => {
14171
14174
  if (preventDefault) {
@@ -14191,7 +14194,7 @@ const LinkPlain = props => {
14191
14194
  loading: loading,
14192
14195
  color: "var(--link-loader-color)"
14193
14196
  }), applySpacingOnTextChildren(children, spacing), innerIcon && jsx(Icon, {
14194
- marginLeft: "xxs",
14197
+ marginLeft: children ? "xxs" : undefined,
14195
14198
  children: innerIcon
14196
14199
  })]
14197
14200
  });
@@ -14361,7 +14364,7 @@ const RouteLink = ({
14361
14364
  ...rest,
14362
14365
  href: url,
14363
14366
  pseudoState: {
14364
- ":-navi-current-link": routeIsActive
14367
+ ":-navi-link-current": routeIsActive
14365
14368
  },
14366
14369
  children: children
14367
14370
  });
@@ -21826,7 +21829,6 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
21826
21829
  }
21827
21830
 
21828
21831
  .navi_caption {
21829
- display: inline;
21830
21832
  color: var(--color);
21831
21833
  }
21832
21834
  `;
@@ -21838,12 +21840,9 @@ const Caption = ({
21838
21840
  ...rest
21839
21841
  }) => {
21840
21842
  return jsx(Text, {
21841
- as: "div",
21842
- inline: true,
21843
+ as: "small",
21843
21844
  size: "0.8em" // We use em to be relative to the parent (we want to be smaller than the surrounding text)
21844
21845
  ,
21845
- marginTop: "sm",
21846
- marginBottom: "sm",
21847
21846
  className: withPropsClassName("navi_caption", className),
21848
21847
  ...rest,
21849
21848
  styleCSSVars: CaptionStyleCSSVars
@@ -22063,25 +22062,81 @@ const MessageBox = ({
22063
22062
  });
22064
22063
  };
22065
22064
 
22066
- const Paragraph = props => {
22067
- return jsx(Text, {
22068
- marginTop: "md",
22069
- ...props,
22070
- as: "p",
22071
- ...props
22072
- });
22073
- };
22074
-
22065
+ const TitleLevelContext = createContext();
22066
+ const TitlePseudoClasses = [":hover"];
22075
22067
  const Title = props => {
22076
22068
  const messageBoxLevel = useContext(MessageBoxLevelContext);
22069
+ const innerAs = props.as || (messageBoxLevel ? "h4" : "h1");
22070
+ const titleLevel = parseInt(innerAs.slice(1));
22077
22071
  const reportTitleToMessageBox = useContext(MessageBoxReportTitleChildContext);
22078
22072
  reportTitleToMessageBox?.(true);
22073
+ return jsx(TitleLevelContext.Provider, {
22074
+ value: titleLevel,
22075
+ children: jsx(Text, {
22076
+ bold: true,
22077
+ className: withPropsClassName("navi_title"),
22078
+ as: messageBoxLevel ? "h4" : "h1",
22079
+ marginTop: messageBoxLevel ? "0" : undefined,
22080
+ marginBottom: messageBoxLevel ? "sm" : undefined,
22081
+ color: messageBoxLevel ? `var(--x-color)` : undefined,
22082
+ ...props,
22083
+ pseudoClasses: TitlePseudoClasses,
22084
+ children: props.children
22085
+ })
22086
+ });
22087
+ };
22088
+
22089
+ installImportMetaCss(import.meta);import.meta.css = /* css */`
22090
+ .navi_link_anchor[data-discrete] {
22091
+ position: absolute !important;
22092
+ top: 1em;
22093
+ left: -1em;
22094
+ width: 1em;
22095
+ height: 1em;
22096
+ font-size: 1em;
22097
+ opacity: 0;
22098
+ transform: translateY(-25%);
22099
+ }
22100
+
22101
+ .navi_title .navi_link_anchor {
22102
+ font-size: 0.7em;
22103
+ }
22104
+
22105
+ .navi_link.navi_link_anchor[data-visited] {
22106
+ /* We don't want to change the color of those links when they are visited */
22107
+ /* Here it makes no sense */
22108
+ --x-link-color: var(--link-color);
22109
+ }
22110
+
22111
+ .navi_link_anchor[data-discrete]:focus,
22112
+ .navi_link_anchor[data-discrete]:focus-visible,
22113
+ *:hover > .navi_link_anchor {
22114
+ opacity: 1;
22115
+ }
22116
+ /* The anchor link is displayed only on :hover */
22117
+ /* So we "need" a visual indicator when it's shown by focus */
22118
+ /* (even if it's focused by mouse aka not :focus-visible) */
22119
+ /* otherwise we might wonder why we see this UI element */
22120
+ .navi_link_anchor[data-discrete][data-focus] {
22121
+ outline-width: 2px;
22122
+ }
22123
+ `;
22124
+ const LinkAnchor = props => {
22125
+ const titleLevel = useContext(TitleLevelContext);
22126
+ return jsx(Link, {
22127
+ className: "navi_link_anchor",
22128
+ color: "inherit",
22129
+ id: props.href.slice(1),
22130
+ "data-discrete": props.discrete || titleLevel ? "" : undefined,
22131
+ ...props
22132
+ });
22133
+ };
22134
+
22135
+ const Paragraph = props => {
22079
22136
  return jsx(Text, {
22080
- bold: true,
22081
- as: messageBoxLevel ? "h4" : "h1",
22082
- marginTop: messageBoxLevel ? "0" : undefined,
22083
- marginBottom: messageBoxLevel ? "sm" : undefined,
22084
- color: messageBoxLevel ? `var(--x-color)` : undefined,
22137
+ marginTop: "md",
22138
+ ...props,
22139
+ as: "p",
22085
22140
  ...props
22086
22141
  });
22087
22142
  };
@@ -22403,5 +22458,5 @@ const UserSvg = () => jsx("svg", {
22403
22458
  })
22404
22459
  });
22405
22460
 
22406
- export { ActionRenderer, ActiveKeyboardShortcuts, BadgeCount, Box, Button, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, FontSizedSvg, Form, HeartSvg, HomeSvg, Icon, IconAndText, Image, Input, Label, Layout, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkWithIcon, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, createAction, createSelectionKeyboardShortcuts, createUniqueValueConstraint, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, goBack, goForward, goTo, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, openCallout, rawUrlPart, reload, removeCustomMessage, rerunActions, resource, setBaseUrl, setupRoutes, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus, useActiveRouteInfo, useCellsAndColumns, useDependenciesDiff, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSignalSync, useStateArray, useUrlSearchParam, valueInLocalStorage };
22461
+ export { ActionRenderer, ActiveKeyboardShortcuts, BadgeCount, Box, Button, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, FontSizedSvg, Form, HeartSvg, HomeSvg, Icon, IconAndText, Image, Input, Label, Layout, Link, LinkAnchor, LinkAnchorSvg, LinkBlankTargetSvg, LinkWithIcon, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, createAction, createSelectionKeyboardShortcuts, createUniqueValueConstraint, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, goBack, goForward, goTo, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, openCallout, rawUrlPart, reload, removeCustomMessage, rerunActions, resource, setBaseUrl, setupRoutes, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus, useActiveRouteInfo, useCellsAndColumns, useDependenciesDiff, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSignalSync, useStateArray, useUrlSearchParam, valueInLocalStorage };
22407
22462
  //# sourceMappingURL=jsenv_navi.js.map