@nswds/app 1.72.3 → 1.72.4

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/globals.css CHANGED
@@ -2524,6 +2524,12 @@
2524
2524
  .bg-black {
2525
2525
  background-color: var(--color-black);
2526
2526
  }
2527
+ .bg-black\/10 {
2528
+ background-color: color-mix(in srgb, #000 10%, transparent);
2529
+ @supports (color: color-mix(in lab, red, red)) {
2530
+ background-color: color-mix(in oklab, var(--color-black) 10%, transparent);
2531
+ }
2532
+ }
2527
2533
  .bg-black\/50 {
2528
2534
  background-color: color-mix(in srgb, #000 50%, transparent);
2529
2535
  @supports (color: color-mix(in lab, red, red)) {
package/dist/index.cjs CHANGED
@@ -7406,7 +7406,7 @@ function Breadcrumbs({
7406
7406
  return "";
7407
7407
  }
7408
7408
  if (transformLabel) {
7409
- return segment.replace(/-/g, " ").replace(/_/g, " ").split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
7409
+ return segment.replace(/[-_]/g, " ").toLowerCase().replace(/^\w/, (c) => c.toUpperCase());
7410
7410
  }
7411
7411
  return segment;
7412
7412
  };
@@ -17465,7 +17465,7 @@ function FormatToggle({ format, setFormat }) {
17465
17465
 
17466
17466
  // package.json
17467
17467
  var package_default = {
17468
- version: "1.70.0"};
17468
+ version: "1.72.2"};
17469
17469
  function Heading({
17470
17470
  className,
17471
17471
  trim = "normal",
@@ -29909,12 +29909,24 @@ function useActiveSectionObserver(tableOfContents) {
29909
29909
  return currentSection;
29910
29910
  }
29911
29911
  function TableOfContents({ tableOfContents }) {
29912
- const currentSection = useActiveSectionObserver(tableOfContents);
29913
- function isActive(section) {
29914
- if (section.id === currentSection) return true;
29915
- return section.children?.some(isActive) ?? false;
29916
- }
29917
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-labelledby": "on-this-page-title", className: "w-56", children: tableOfContents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
29912
+ const [mounted, setMounted] = React5.useState(false);
29913
+ React5.useEffect(() => setMounted(true), []);
29914
+ const currentSection = useActiveSectionObserver(mounted ? tableOfContents : []);
29915
+ const isActive = React5.useMemo(() => {
29916
+ const check = (section) => {
29917
+ if (section.id === currentSection) return true;
29918
+ return section.children?.some(check) ?? false;
29919
+ };
29920
+ return check;
29921
+ }, [currentSection]);
29922
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-labelledby": "on-this-page-title", className: "w-56", suppressHydrationWarning: true, children: !mounted ? (
29923
+ // lightweight placeholder to avoid layout shift (optional)
29924
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-hidden": true, className: "mt-3 space-y-2", children: [
29925
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-40 animate-pulse rounded bg-black/10 dark:bg-white/10" }),
29926
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-3 w-32 animate-pulse rounded bg-black/10 dark:bg-white/10" }),
29927
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-3 w-48 animate-pulse rounded bg-black/10 dark:bg-white/10" })
29928
+ ] })
29929
+ ) : tableOfContents.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
29918
29930
  /* @__PURE__ */ jsxRuntime.jsx(
29919
29931
  "h2",
29920
29932
  {
@@ -29937,6 +29949,7 @@ function TableOfContents({ tableOfContents }) {
29937
29949
  Link12__default.default,
29938
29950
  {
29939
29951
  href: `#${section.id}`,
29952
+ prefetch: false,
29940
29953
  className: clsx12__default.default(
29941
29954
  "-ml-px inline-block border-l pl-4",
29942
29955
  "hover:border-primary-800 dark:hover:border-white",
@@ -29949,6 +29962,7 @@ function TableOfContents({ tableOfContents }) {
29949
29962
  Link12__default.default,
29950
29963
  {
29951
29964
  href: `#${subSection.id}`,
29965
+ prefetch: false,
29952
29966
  className: clsx12__default.default(
29953
29967
  "-ml-px inline-block border-l pl-8",
29954
29968
  "hover:border-primary-800 dark:hover:border-white",
@@ -29960,7 +29974,7 @@ function TableOfContents({ tableOfContents }) {
29960
29974
  ] }, section.id))
29961
29975
  }
29962
29976
  )
29963
- ] }) });
29977
+ ] }) : null });
29964
29978
  }
29965
29979
  function getSubtree(options, content) {
29966
29980
  const { asChild, children } = options;