@vx-oss/docs-react 1.0.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.
Files changed (262) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -0
  3. package/css/aspen.css +39 -0
  4. package/css/black.css +39 -0
  5. package/css/catppuccin.css +49 -0
  6. package/css/dusk.css +47 -0
  7. package/css/emerald.css +39 -0
  8. package/css/generated/docs.css +1 -0
  9. package/css/generated/flux.css +1 -0
  10. package/css/generated/glass.css +1 -0
  11. package/css/generated/home.css +1 -0
  12. package/css/generated/notebook.css +1 -0
  13. package/css/generated/shared.css +1 -0
  14. package/css/lib/base.css +296 -0
  15. package/css/lib/default-colors.css +51 -0
  16. package/css/lib/shiki.css +108 -0
  17. package/css/neutral.css +7 -0
  18. package/css/ocean.css +44 -0
  19. package/css/preset-legacy.css +43 -0
  20. package/css/preset.css +11 -0
  21. package/css/purple.css +39 -0
  22. package/css/ruby.css +39 -0
  23. package/css/shadcn.css +36 -0
  24. package/css/solar.css +65 -0
  25. package/css/style.css +9 -0
  26. package/css/vitepress.css +72 -0
  27. package/dist/.translations/index.d.ts +55 -0
  28. package/dist/.translations/keys.js +55 -0
  29. package/dist/_virtual/_rolldown/runtime.js +13 -0
  30. package/dist/components/accordion.d.ts +10 -0
  31. package/dist/components/accordion.js +68 -0
  32. package/dist/components/banner.d.ts +25 -0
  33. package/dist/components/banner.js +85 -0
  34. package/dist/components/callout.d.ts +21 -0
  35. package/dist/components/callout.js +60 -0
  36. package/dist/components/card.d.ts +13 -0
  37. package/dist/components/card.js +39 -0
  38. package/dist/components/codeblock.d.ts +45 -0
  39. package/dist/components/codeblock.js +126 -0
  40. package/dist/components/codeblock.rsc.d.ts +15 -0
  41. package/dist/components/codeblock.rsc.js +22 -0
  42. package/dist/components/dialog/search-algolia.d.ts +27 -0
  43. package/dist/components/dialog/search-algolia.js +64 -0
  44. package/dist/components/dialog/search-default.d.ts +29 -0
  45. package/dist/components/dialog/search-default.js +66 -0
  46. package/dist/components/dialog/search-orama.d.ts +32 -0
  47. package/dist/components/dialog/search-orama.js +69 -0
  48. package/dist/components/dialog/search.d.ts +76 -0
  49. package/dist/components/dialog/search.js +351 -0
  50. package/dist/components/dynamic-codeblock.core.d.ts +26 -0
  51. package/dist/components/dynamic-codeblock.core.js +51 -0
  52. package/dist/components/dynamic-codeblock.d.ts +8 -0
  53. package/dist/components/dynamic-codeblock.js +17 -0
  54. package/dist/components/files.d.ts +21 -0
  55. package/dist/components/files.js +40 -0
  56. package/dist/components/github-info.d.ts +20 -0
  57. package/dist/components/github-info.js +75 -0
  58. package/dist/components/heading.d.ts +9 -0
  59. package/dist/components/heading.js +38 -0
  60. package/dist/components/image-zoom.d.ts +18 -0
  61. package/dist/components/image-zoom.js +32 -0
  62. package/dist/components/image-zoom2.css +71 -0
  63. package/dist/components/inline-toc.d.ts +10 -0
  64. package/dist/components/inline-toc.js +28 -0
  65. package/dist/components/sidebar/base.d.ts +85 -0
  66. package/dist/components/sidebar/base.js +277 -0
  67. package/dist/components/sidebar/link-item.d.ts +12 -0
  68. package/dist/components/sidebar/link-item.js +37 -0
  69. package/dist/components/sidebar/page-tree.d.ts +20 -0
  70. package/dist/components/sidebar/page-tree.js +69 -0
  71. package/dist/components/sidebar/tabs/dropdown.d.ts +15 -0
  72. package/dist/components/sidebar/tabs/dropdown.js +83 -0
  73. package/dist/components/sidebar/tabs/index.d.ts +8 -0
  74. package/dist/components/sidebar/tabs/index.js +46 -0
  75. package/dist/components/steps.d.ts +10 -0
  76. package/dist/components/steps.js +16 -0
  77. package/dist/components/tabs.d.ts +33 -0
  78. package/dist/components/tabs.js +95 -0
  79. package/dist/components/toc/clerk.d.ts +11 -0
  80. package/dist/components/toc/clerk.js +227 -0
  81. package/dist/components/toc/default.d.ts +13 -0
  82. package/dist/components/toc/default.js +260 -0
  83. package/dist/components/toc/index.d.ts +10 -0
  84. package/dist/components/toc/index.js +45 -0
  85. package/dist/components/type-table.d.ts +37 -0
  86. package/dist/components/type-table.js +117 -0
  87. package/dist/components/ui/accordion.d.ts +10 -0
  88. package/dist/components/ui/accordion.js +42 -0
  89. package/dist/components/ui/button.d.ts +10 -0
  90. package/dist/components/ui/button.js +20 -0
  91. package/dist/components/ui/collapsible.d.ts +11 -0
  92. package/dist/components/ui/collapsible.js +21 -0
  93. package/dist/components/ui/navigation-menu.d.ts +14 -0
  94. package/dist/components/ui/navigation-menu.js +41 -0
  95. package/dist/components/ui/popover.d.ts +9 -0
  96. package/dist/components/ui/popover.js +20 -0
  97. package/dist/components/ui/scroll-area.d.ts +9 -0
  98. package/dist/components/ui/scroll-area.js +34 -0
  99. package/dist/components/ui/tabs.d.ts +23 -0
  100. package/dist/components/ui/tabs.js +102 -0
  101. package/dist/contexts/i18n.d.ts +34 -0
  102. package/dist/contexts/i18n.js +37 -0
  103. package/dist/contexts/search.d.ts +64 -0
  104. package/dist/contexts/search.js +68 -0
  105. package/dist/contexts/tree.d.ts +29 -0
  106. package/dist/contexts/tree.js +91 -0
  107. package/dist/i18n.d.ts +15 -0
  108. package/dist/i18n.js +38 -0
  109. package/dist/layouts/docs/client.d.ts +33 -0
  110. package/dist/layouts/docs/client.js +94 -0
  111. package/dist/layouts/docs/index.d.ts +32 -0
  112. package/dist/layouts/docs/index.js +23 -0
  113. package/dist/layouts/docs/page/index.d.ts +76 -0
  114. package/dist/layouts/docs/page/index.js +124 -0
  115. package/dist/layouts/docs/page/slots/breadcrumb.d.ts +7 -0
  116. package/dist/layouts/docs/page/slots/breadcrumb.js +44 -0
  117. package/dist/layouts/docs/page/slots/container.d.ts +5 -0
  118. package/dist/layouts/docs/page/slots/container.js +22 -0
  119. package/dist/layouts/docs/page/slots/footer.d.ts +16 -0
  120. package/dist/layouts/docs/page/slots/footer.js +56 -0
  121. package/dist/layouts/docs/page/slots/toc.d.ts +47 -0
  122. package/dist/layouts/docs/page/slots/toc.js +182 -0
  123. package/dist/layouts/docs/slots/container.d.ts +5 -0
  124. package/dist/layouts/docs/slots/container.js +36 -0
  125. package/dist/layouts/docs/slots/header.d.ts +5 -0
  126. package/dist/layouts/docs/slots/header.js +38 -0
  127. package/dist/layouts/docs/slots/sidebar.d.ts +22 -0
  128. package/dist/layouts/docs/slots/sidebar.js +268 -0
  129. package/dist/layouts/flux/index.d.ts +61 -0
  130. package/dist/layouts/flux/index.js +146 -0
  131. package/dist/layouts/flux/page/index.d.ts +67 -0
  132. package/dist/layouts/flux/page/index.js +104 -0
  133. package/dist/layouts/flux/page/slots/breadcrumb.d.ts +7 -0
  134. package/dist/layouts/flux/page/slots/breadcrumb.js +44 -0
  135. package/dist/layouts/flux/page/slots/container.d.ts +5 -0
  136. package/dist/layouts/flux/page/slots/container.js +22 -0
  137. package/dist/layouts/flux/page/slots/footer.d.ts +16 -0
  138. package/dist/layouts/flux/page/slots/footer.js +56 -0
  139. package/dist/layouts/flux/page/slots/toc.d.ts +29 -0
  140. package/dist/layouts/flux/page/slots/toc.js +181 -0
  141. package/dist/layouts/flux/slots/container.d.ts +5 -0
  142. package/dist/layouts/flux/slots/container.js +13 -0
  143. package/dist/layouts/flux/slots/sidebar.d.ts +16 -0
  144. package/dist/layouts/flux/slots/sidebar.js +243 -0
  145. package/dist/layouts/flux/slots/tab-dropdown.d.ts +10 -0
  146. package/dist/layouts/flux/slots/tab-dropdown.js +88 -0
  147. package/dist/layouts/glass/index.d.ts +39 -0
  148. package/dist/layouts/glass/index.js +70 -0
  149. package/dist/layouts/glass/layout-tabs.js +54 -0
  150. package/dist/layouts/glass/page/index.d.ts +31 -0
  151. package/dist/layouts/glass/page/index.js +92 -0
  152. package/dist/layouts/glass/page/slots/breadcrumb.d.ts +7 -0
  153. package/dist/layouts/glass/page/slots/breadcrumb.js +44 -0
  154. package/dist/layouts/glass/page/slots/footer.d.ts +16 -0
  155. package/dist/layouts/glass/page/slots/footer.js +56 -0
  156. package/dist/layouts/glass/page/slots/toc.d.ts +19 -0
  157. package/dist/layouts/glass/page/slots/toc.js +108 -0
  158. package/dist/layouts/glass/slots/header.d.ts +6 -0
  159. package/dist/layouts/glass/slots/header.js +68 -0
  160. package/dist/layouts/glass/slots/sidebar.d.ts +21 -0
  161. package/dist/layouts/glass/slots/sidebar.js +267 -0
  162. package/dist/layouts/home/index.d.ts +27 -0
  163. package/dist/layouts/home/index.js +40 -0
  164. package/dist/layouts/home/navbar.d.ts +9 -0
  165. package/dist/layouts/home/navbar.js +34 -0
  166. package/dist/layouts/home/not-found.d.ts +7 -0
  167. package/dist/layouts/home/not-found.js +41 -0
  168. package/dist/layouts/home/slots/container.d.ts +5 -0
  169. package/dist/layouts/home/slots/container.js +13 -0
  170. package/dist/layouts/home/slots/header.d.ts +8 -0
  171. package/dist/layouts/home/slots/header.js +239 -0
  172. package/dist/layouts/notebook/client.d.ts +35 -0
  173. package/dist/layouts/notebook/client.js +69 -0
  174. package/dist/layouts/notebook/index.d.ts +26 -0
  175. package/dist/layouts/notebook/index.js +23 -0
  176. package/dist/layouts/notebook/page/index.d.ts +76 -0
  177. package/dist/layouts/notebook/page/index.js +124 -0
  178. package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +7 -0
  179. package/dist/layouts/notebook/page/slots/breadcrumb.js +44 -0
  180. package/dist/layouts/notebook/page/slots/container.d.ts +5 -0
  181. package/dist/layouts/notebook/page/slots/container.js +22 -0
  182. package/dist/layouts/notebook/page/slots/footer.d.ts +16 -0
  183. package/dist/layouts/notebook/page/slots/footer.js +56 -0
  184. package/dist/layouts/notebook/page/slots/toc.d.ts +47 -0
  185. package/dist/layouts/notebook/page/slots/toc.js +181 -0
  186. package/dist/layouts/notebook/slots/container.d.ts +5 -0
  187. package/dist/layouts/notebook/slots/container.js +38 -0
  188. package/dist/layouts/notebook/slots/header.d.ts +5 -0
  189. package/dist/layouts/notebook/slots/header.js +204 -0
  190. package/dist/layouts/notebook/slots/sidebar.d.ts +23 -0
  191. package/dist/layouts/notebook/slots/sidebar.js +240 -0
  192. package/dist/layouts/shared/client.d.ts +37 -0
  193. package/dist/layouts/shared/client.js +85 -0
  194. package/dist/layouts/shared/index.d.ts +169 -0
  195. package/dist/layouts/shared/index.js +98 -0
  196. package/dist/layouts/shared/page-actions.d.ts +27 -0
  197. package/dist/layouts/shared/page-actions.js +199 -0
  198. package/dist/layouts/shared/slots/language-select.d.ts +12 -0
  199. package/dist/layouts/shared/slots/language-select.js +43 -0
  200. package/dist/layouts/shared/slots/search-trigger.d.ts +13 -0
  201. package/dist/layouts/shared/slots/search-trigger.js +53 -0
  202. package/dist/layouts/shared/slots/theme-switch.d.ts +8 -0
  203. package/dist/layouts/shared/slots/theme-switch.js +70 -0
  204. package/dist/legacy/layout.d.ts +29 -0
  205. package/dist/legacy/layout.js +44 -0
  206. package/dist/legacy/sidebar.d.ts +14 -0
  207. package/dist/legacy/sidebar.js +34 -0
  208. package/dist/mdx.d.ts +44 -0
  209. package/dist/mdx.js +70 -0
  210. package/dist/mdx.server.d.ts +14 -0
  211. package/dist/mdx.server.js +20 -0
  212. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.d.ts +30 -0
  213. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.js +461 -0
  214. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/index.d.ts +3 -0
  215. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +6 -0
  216. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.js +17 -0
  217. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +53 -0
  218. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +25 -0
  219. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +12 -0
  220. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +45 -0
  221. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +10 -0
  222. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +57 -0
  223. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +21 -0
  224. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +14 -0
  225. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +22 -0
  226. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +27 -0
  227. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +31 -0
  228. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +75 -0
  229. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +4 -0
  230. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +7 -0
  231. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +5 -0
  232. package/dist/og/takumi.d.ts +15 -0
  233. package/dist/og/takumi.js +91 -0
  234. package/dist/og.d.ts +16 -0
  235. package/dist/og.js +91 -0
  236. package/dist/page.d.ts +29 -0
  237. package/dist/page.js +33 -0
  238. package/dist/provider/astro.d.ts +29 -0
  239. package/dist/provider/astro.js +20 -0
  240. package/dist/provider/base.d.ts +48 -0
  241. package/dist/provider/base.js +73 -0
  242. package/dist/provider/next.d.ts +16 -0
  243. package/dist/provider/next.js +17 -0
  244. package/dist/provider/react-router.d.ts +16 -0
  245. package/dist/provider/react-router.js +17 -0
  246. package/dist/provider/tanstack.d.ts +16 -0
  247. package/dist/provider/tanstack.js +17 -0
  248. package/dist/provider/waku.d.ts +16 -0
  249. package/dist/provider/waku.js +17 -0
  250. package/dist/style.css +3640 -0
  251. package/dist/tailwind/typography.d.ts +2 -0
  252. package/dist/tailwind/typography.js +2 -0
  253. package/dist/utils/cn.js +2 -0
  254. package/dist/utils/merge-refs.js +11 -0
  255. package/dist/utils/urls.js +15 -0
  256. package/dist/utils/use-copy-button.d.ts +5 -0
  257. package/dist/utils/use-copy-button.js +26 -0
  258. package/dist/utils/use-footer-items.d.ts +8 -0
  259. package/dist/utils/use-footer-items.js +24 -0
  260. package/dist/utils/use-is-scroll-top.d.ts +6 -0
  261. package/dist/utils/use-is-scroll-top.js +20 -0
  262. package/package.json +212 -0
@@ -0,0 +1,239 @@
1
+ "use client";
2
+ import { cn } from "../../../utils/cn.js";
3
+ import { buttonVariants } from "../../../components/ui/button.js";
4
+ import { LinkItem } from "../../shared/client.js";
5
+ import "../../shared/index.js";
6
+ import { useIsScrollTop } from "../../../utils/use-is-scroll-top.js";
7
+ import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from "../../../components/ui/navigation-menu.js";
8
+ import { useHomeLayout } from "../index.js";
9
+ import Link from "@vx-oss/docs-core/link";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { ChevronDown, Languages } from "lucide-react";
12
+ import { cva } from "class-variance-authority";
13
+ import { Fragment as Fragment$1, useState } from "react";
14
+ import { useTranslations } from "@fuma-translate/react";
15
+ //#region src/layouts/home/slots/header.tsx
16
+ const navItemVariants = cva("[&_svg]:size-4", {
17
+ variants: { variant: {
18
+ main: "inline-flex items-center gap-1 p-2 text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary",
19
+ button: buttonVariants({
20
+ color: "secondary",
21
+ className: "gap-1.5"
22
+ }),
23
+ icon: buttonVariants({
24
+ color: "ghost",
25
+ size: "icon"
26
+ })
27
+ } },
28
+ defaultVariants: { variant: "main" }
29
+ });
30
+ function Header(props) {
31
+ const { navItems, menuItems, slots, props: { nav } } = useHomeLayout();
32
+ const t = useTranslations({ note: "mobile menu" });
33
+ if (nav?.component) return nav.component;
34
+ return /* @__PURE__ */ jsxs(HeaderNavigationMenu, {
35
+ transparentMode: nav?.transparentMode,
36
+ ...props,
37
+ children: [
38
+ slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: "inline-flex items-center gap-2.5 font-semibold" }),
39
+ nav?.children,
40
+ /* @__PURE__ */ jsx("ul", {
41
+ className: "flex flex-row items-center gap-2 px-6 max-sm:hidden",
42
+ children: navItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(NavigationMenuLinkItem, {
43
+ item,
44
+ className: "text-sm"
45
+ }, i))
46
+ }),
47
+ /* @__PURE__ */ jsxs("div", {
48
+ className: "flex flex-row items-center justify-end gap-1.5 flex-1 max-lg:hidden",
49
+ children: [
50
+ slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.full, {
51
+ hideIfDisabled: true,
52
+ className: "w-full rounded-full ps-2.5 max-w-[240px]"
53
+ }),
54
+ slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {}),
55
+ slots.languageSelect && /* @__PURE__ */ jsx(slots.languageSelect.root, { children: /* @__PURE__ */ jsx(Languages, { className: "size-5" }) }),
56
+ /* @__PURE__ */ jsx("ul", {
57
+ className: "flex flex-row gap-2 items-center empty:hidden",
58
+ children: navItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(NavigationMenuLinkItem, {
59
+ className: cn(item.type === "icon" && "-mx-1 first:ms-0 last:me-0"),
60
+ item
61
+ }, i))
62
+ })
63
+ ]
64
+ }),
65
+ /* @__PURE__ */ jsxs("div", {
66
+ className: "flex flex-row items-center ms-auto -me-1.5 lg:hidden",
67
+ children: [slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.sm, {
68
+ hideIfDisabled: true,
69
+ className: "p-2"
70
+ }), /* @__PURE__ */ jsx(NavigationMenuItem, {
71
+ asChild: true,
72
+ children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
73
+ "aria-label": t("Toggle Menu", { note: "aria-label" }),
74
+ className: cn(buttonVariants({
75
+ size: "icon",
76
+ color: "ghost",
77
+ className: "group [&_svg]:size-5.5"
78
+ })),
79
+ onPointerMove: nav?.enableHoverToOpen ? void 0 : (e) => e.preventDefault(),
80
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" })
81
+ }), /* @__PURE__ */ jsxs(NavigationMenuContent, {
82
+ className: "flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end",
83
+ children: [menuItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
84
+ item,
85
+ className: "sm:hidden"
86
+ }, i)), /* @__PURE__ */ jsxs("div", {
87
+ className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",
88
+ children: [
89
+ menuItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
90
+ item,
91
+ className: cn(item.type === "icon" && "-mx-1 first:ms-0")
92
+ }, i)),
93
+ /* @__PURE__ */ jsx("div", {
94
+ role: "separator",
95
+ className: "flex-1"
96
+ }),
97
+ slots.languageSelect && /* @__PURE__ */ jsxs(slots.languageSelect.root, { children: [
98
+ /* @__PURE__ */ jsx(Languages, { className: "size-5" }),
99
+ slots.languageSelect.text && /* @__PURE__ */ jsx(slots.languageSelect.text, {}),
100
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })
101
+ ] }),
102
+ slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {})
103
+ ]
104
+ })]
105
+ })] })
106
+ })]
107
+ })
108
+ ]
109
+ });
110
+ }
111
+ function isSecondary(item) {
112
+ if ("secondary" in item && item.secondary != null) return item.secondary;
113
+ return item.type === "icon";
114
+ }
115
+ function HeaderNavigationMenu({ transparentMode = "none", ...props }) {
116
+ const [value, setValue] = useState("");
117
+ const isTop = useIsScrollTop({ enabled: transparentMode === "top" }) ?? true;
118
+ const isTransparent = transparentMode === "top" ? isTop : transparentMode === "always";
119
+ return /* @__PURE__ */ jsx(NavigationMenu, {
120
+ value,
121
+ onValueChange: setValue,
122
+ asChild: true,
123
+ children: /* @__PURE__ */ jsx("header", {
124
+ id: "nd-nav",
125
+ ...props,
126
+ className: cn("sticky h-14 top-0 z-40", props.className),
127
+ children: /* @__PURE__ */ jsxs("div", {
128
+ className: cn("backdrop-blur-lg border-b transition-colors *:mx-auto *:max-w-(--fd-layout-width)", value.length > 0 && "max-lg:shadow-lg max-lg:rounded-b-2xl", (!isTransparent || value.length > 0) && "bg-fd-background/80"),
129
+ children: [/* @__PURE__ */ jsx(NavigationMenuList, {
130
+ className: "flex h-14 w-full items-center px-4",
131
+ asChild: true,
132
+ children: /* @__PURE__ */ jsx("nav", { children: props.children })
133
+ }), /* @__PURE__ */ jsx(NavigationMenuViewport, {})]
134
+ })
135
+ })
136
+ });
137
+ }
138
+ function NavigationMenuLinkItem({ item, ...props }) {
139
+ if (item.type === "custom") return item.children;
140
+ if (item.type === "menu") {
141
+ const children = item.items.map((child, j) => {
142
+ if (child.type === "custom") return /* @__PURE__ */ jsx(Fragment$1, { children: child.children }, j);
143
+ const { banner = child.icon ? /* @__PURE__ */ jsx("div", {
144
+ className: "w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4",
145
+ children: child.icon
146
+ }) : null, ...rest } = child.menu ?? {};
147
+ return /* @__PURE__ */ jsx(NavigationMenuLink, {
148
+ asChild: true,
149
+ children: /* @__PURE__ */ jsx(Link, {
150
+ href: child.url,
151
+ external: child.external,
152
+ ...rest,
153
+ className: cn("flex flex-col gap-2 rounded-lg border bg-fd-card p-3 transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground", rest.className),
154
+ children: rest.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
155
+ banner,
156
+ /* @__PURE__ */ jsx("p", {
157
+ className: "text-base font-medium",
158
+ children: child.text
159
+ }),
160
+ /* @__PURE__ */ jsx("p", {
161
+ className: "text-sm text-fd-muted-foreground empty:hidden",
162
+ children: child.description
163
+ })
164
+ ] })
165
+ })
166
+ }, `${j}-${child.url}`);
167
+ });
168
+ return /* @__PURE__ */ jsxs(NavigationMenuItem, {
169
+ ...props,
170
+ children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
171
+ className: cn(navItemVariants(), "rounded-md"),
172
+ children: item.url ? /* @__PURE__ */ jsx(Link, {
173
+ href: item.url,
174
+ external: item.external,
175
+ children: item.text
176
+ }) : item.text
177
+ }), /* @__PURE__ */ jsx(NavigationMenuContent, {
178
+ className: "grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3",
179
+ children
180
+ })]
181
+ });
182
+ }
183
+ return /* @__PURE__ */ jsx(NavigationMenuItem, {
184
+ ...props,
185
+ children: /* @__PURE__ */ jsx(NavigationMenuLink, {
186
+ asChild: true,
187
+ children: /* @__PURE__ */ jsx(LinkItem, {
188
+ item,
189
+ "aria-label": item.type === "icon" ? item.label : void 0,
190
+ className: cn(navItemVariants({ variant: item.type })),
191
+ children: item.type === "icon" ? item.icon : item.text
192
+ })
193
+ })
194
+ });
195
+ }
196
+ function MobileNavigationMenuLinkItem({ item, ...props }) {
197
+ if (item.type === "custom") return /* @__PURE__ */ jsx("div", {
198
+ className: cn("grid", props.className),
199
+ children: item.children
200
+ });
201
+ if (item.type === "menu") {
202
+ const header = /* @__PURE__ */ jsxs(Fragment, { children: [item.icon, item.text] });
203
+ return /* @__PURE__ */ jsxs("div", {
204
+ className: cn("mb-4 flex flex-col", props.className),
205
+ children: [/* @__PURE__ */ jsx("p", {
206
+ className: "mb-1 text-sm text-fd-muted-foreground",
207
+ children: item.url ? /* @__PURE__ */ jsx(NavigationMenuLink, {
208
+ asChild: true,
209
+ children: /* @__PURE__ */ jsx(Link, {
210
+ href: item.url,
211
+ external: item.external,
212
+ children: header
213
+ })
214
+ }) : header
215
+ }), item.items.map((child, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, { item: child }, i))]
216
+ });
217
+ }
218
+ return /* @__PURE__ */ jsx(NavigationMenuLink, {
219
+ asChild: true,
220
+ children: /* @__PURE__ */ jsxs(LinkItem, {
221
+ item,
222
+ className: cn({
223
+ main: "inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4",
224
+ icon: buttonVariants({
225
+ size: "icon",
226
+ color: "ghost"
227
+ }),
228
+ button: buttonVariants({
229
+ color: "secondary",
230
+ className: "gap-1.5 [&_svg]:size-4"
231
+ })
232
+ }[item.type ?? "main"], props.className),
233
+ "aria-label": item.type === "icon" ? item.label : void 0,
234
+ children: [item.icon, item.type === "icon" ? void 0 : item.text]
235
+ })
236
+ });
237
+ }
238
+ //#endregion
239
+ export { Header, navItemVariants };
@@ -0,0 +1,35 @@
1
+ import { BaseSlots, BaseSlotsProps } from "../shared/client.js";
2
+ import { LayoutTab, LinkItemType } from "../shared/index.js";
3
+ import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
4
+ import { DocsLayoutProps } from "./index.js";
5
+ import { ComponentProps, FC } from "react";
6
+ //#region src/layouts/notebook/client.d.ts
7
+ interface DocsSlots extends BaseSlots {
8
+ container: FC<ComponentProps<'div'>>;
9
+ header: FC<ComponentProps<'header'>>;
10
+ sidebar: {
11
+ provider: FC<SidebarProviderProps>;
12
+ root: FC<SidebarProps>;
13
+ trigger: FC<ComponentProps<'button'>>;
14
+ collapseTrigger: FC<ComponentProps<'button'>>;
15
+ useSidebar: () => {
16
+ collapsed: boolean;
17
+ open: boolean;
18
+ setOpen: (V: boolean) => void;
19
+ };
20
+ };
21
+ }
22
+ interface SlotsProps extends BaseSlotsProps<DocsLayoutProps> {
23
+ sidebar: SidebarProps;
24
+ tabMode: NonNullable<DocsLayoutProps['tabMode']>;
25
+ tabs: LayoutTab[];
26
+ }
27
+ declare function useNotebookLayout(): {
28
+ props: SlotsProps;
29
+ isNavTransparent: boolean;
30
+ navItems: LinkItemType[];
31
+ menuItems: LinkItemType[];
32
+ slots: DocsSlots;
33
+ };
34
+ //#endregion
35
+ export { DocsSlots, useNotebookLayout };
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { TreeContextProvider } from "../../contexts/tree.js";
3
+ import { baseSlots } from "../shared/client.js";
4
+ import { useLinkItems } from "../shared/index.js";
5
+ import { useIsScrollTop } from "../../utils/use-is-scroll-top.js";
6
+ import { Container } from "./slots/container.js";
7
+ import { Sidebar, SidebarCollapseTrigger, SidebarProvider, SidebarTrigger, useSidebar } from "./slots/sidebar.js";
8
+ import { Header } from "./slots/header.js";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { createContext, use } from "react";
11
+ //#region src/layouts/notebook/client.tsx
12
+ const { useBaseSlots } = baseSlots({ useProps() {
13
+ return useNotebookLayout().props;
14
+ } });
15
+ const LayoutContext = createContext(null);
16
+ function useNotebookLayout() {
17
+ const context = use(LayoutContext);
18
+ if (!context) throw new Error("Please use <DocsPage /> (`@vx-oss/docs-react/layouts/notebook/page`) under <DocsLayout /> (`@vx-oss/docs-react/layouts/notebook`).");
19
+ return context;
20
+ }
21
+ function LayoutBody(props) {
22
+ const { nav: { enabled: navEnabled = true, transparentMode: navTransparentMode = "none" } = {}, sidebar: { defaultOpenLevel, prefetch, ...sidebarProps } = {}, slots: defaultSlots, tabMode = "sidebar", tabs, tree, containerProps, children } = props;
23
+ const isTop = useIsScrollTop({ enabled: navTransparentMode === "top" }) ?? true;
24
+ const isNavTransparent = navTransparentMode === "top" ? isTop : navTransparentMode === "always";
25
+ const { baseSlots, baseProps } = useBaseSlots(props);
26
+ const linkItems = useLinkItems(props);
27
+ const slots = {
28
+ ...baseSlots,
29
+ header: defaultSlots?.header ?? Header,
30
+ container: defaultSlots?.container ?? Container,
31
+ sidebar: defaultSlots?.sidebar ?? {
32
+ provider: SidebarProvider,
33
+ root: Sidebar,
34
+ trigger: SidebarTrigger,
35
+ collapseTrigger: SidebarCollapseTrigger,
36
+ useSidebar
37
+ }
38
+ };
39
+ return /* @__PURE__ */ jsx(TreeContextProvider, {
40
+ tree,
41
+ children: /* @__PURE__ */ jsx(LayoutContext, {
42
+ value: {
43
+ props: {
44
+ tabs,
45
+ tabMode,
46
+ sidebar: sidebarProps,
47
+ ...baseProps
48
+ },
49
+ isNavTransparent,
50
+ slots,
51
+ ...linkItems
52
+ },
53
+ children: /* @__PURE__ */ jsx(slots.sidebar.provider, {
54
+ defaultOpenLevel,
55
+ prefetch,
56
+ children: /* @__PURE__ */ jsxs(slots.container, {
57
+ ...containerProps,
58
+ children: [
59
+ navEnabled && /* @__PURE__ */ jsx(slots.header, {}),
60
+ /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }),
61
+ children
62
+ ]
63
+ })
64
+ })
65
+ })
66
+ });
67
+ }
68
+ //#endregion
69
+ export { LayoutBody, useNotebookLayout };
@@ -0,0 +1,26 @@
1
+ import { BaseLayoutProps, GetLayoutTabsOptions, LayoutTab, NavOptions } from "../shared/index.js";
2
+ import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
3
+ import { DocsSlots, useNotebookLayout } from "./client.js";
4
+ import { HTMLAttributes } from "react";
5
+ import * as PageTree from "@vx-oss/docs-core/page-tree";
6
+ //#region src/layouts/notebook/index.d.ts
7
+ interface DocsLayoutProps extends Omit<BaseLayoutProps, 'nav'> {
8
+ tree: PageTree.Root;
9
+ tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
10
+ tabMode?: 'sidebar' | 'navbar';
11
+ sidebar?: SidebarOptions;
12
+ nav?: NavOptions & {
13
+ mode?: 'top' | 'auto';
14
+ };
15
+ containerProps?: HTMLAttributes<HTMLDivElement>;
16
+ slots?: Partial<DocsSlots>;
17
+ }
18
+ interface SidebarOptions extends SidebarProps, SidebarProviderProps {
19
+ /**
20
+ * @deprecated use layout-level `tabs` option instead.
21
+ */
22
+ tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
23
+ }
24
+ declare function DocsLayout({ tree, tabMode, sidebar: { tabs: defaultTabs, ...sidebarProps }, children, tabs, ...props }: DocsLayoutProps): import("react").JSX.Element;
25
+ //#endregion
26
+ export { DocsLayout, DocsLayoutProps, type DocsSlots, SidebarOptions, useNotebookLayout };
@@ -0,0 +1,23 @@
1
+ import { getLayoutTabs } from "../shared/index.js";
2
+ import { LayoutBody, useNotebookLayout } from "./client.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { useMemo } from "react";
5
+ //#region src/layouts/notebook/index.tsx
6
+ function DocsLayout({ tree, tabMode = "sidebar", sidebar: { tabs: defaultTabs, ...sidebarProps } = {}, children, tabs = defaultTabs, ...props }) {
7
+ const resolvedTabs = useMemo(() => {
8
+ if (Array.isArray(tabs)) return tabs;
9
+ if (typeof tabs === "object") return getLayoutTabs(tree, tabs);
10
+ if (tabs !== false) return getLayoutTabs(tree);
11
+ return [];
12
+ }, [tabs, tree]);
13
+ return /* @__PURE__ */ jsx(LayoutBody, {
14
+ tree,
15
+ tabs: resolvedTabs,
16
+ tabMode,
17
+ sidebar: sidebarProps,
18
+ ...props,
19
+ children
20
+ });
21
+ }
22
+ //#endregion
23
+ export { DocsLayout, useNotebookLayout };
@@ -0,0 +1,76 @@
1
+ import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
2
+ import { TOCPopoverProps, TOCProps, TOCProviderProps } from "./slots/toc.js";
3
+ import { Footer, FooterProps } from "./slots/footer.js";
4
+ import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
5
+ import { ComponentProps, FC, ReactNode } from "react";
6
+ import { TOCItemType } from "@vx-oss/docs-core/toc";
7
+ //#region src/layouts/notebook/page/index.d.ts
8
+ interface DocsPageProps extends ComponentProps<'article'> {
9
+ toc?: TOCItemType[];
10
+ /**
11
+ * Extend the page to fill all available space
12
+ *
13
+ * @defaultValue false
14
+ */
15
+ full?: boolean | undefined;
16
+ slots?: Partial<DocsPageSlots>;
17
+ footer?: FooterOptions;
18
+ breadcrumb?: BreadcrumbOptions;
19
+ tableOfContent?: TableOfContentOptions;
20
+ tableOfContentPopover?: TableOfContentPopoverOptions;
21
+ }
22
+ interface BreadcrumbOptions extends BreadcrumbProps {
23
+ enabled?: boolean;
24
+ /**
25
+ * @deprecated use `slots.breadcrumb` instead.
26
+ */
27
+ component?: ReactNode;
28
+ }
29
+ interface FooterOptions extends FooterProps {
30
+ enabled?: boolean;
31
+ /**
32
+ * @deprecated use `slots.footer` instead.
33
+ */
34
+ component?: ReactNode;
35
+ }
36
+ type TableOfContentOptions = Pick<TOCProviderProps, 'single'> & TOCProps & {
37
+ enabled?: boolean;
38
+ /**
39
+ * @deprecated use `slots.toc` instead.
40
+ */
41
+ component?: ReactNode;
42
+ };
43
+ type TableOfContentPopoverOptions = TOCPopoverProps & {
44
+ enabled?: boolean;
45
+ /**
46
+ * @deprecated use `slots.tocPopover` instead.
47
+ */
48
+ component?: ReactNode;
49
+ };
50
+ interface DocsPageSlots {
51
+ toc: {
52
+ provider: FC<TOCProviderProps>;
53
+ main: FC<TOCProps>;
54
+ popover: FC<TOCPopoverProps>;
55
+ };
56
+ container: FC<ComponentProps<'article'>>;
57
+ footer: FC<FooterProps>;
58
+ breadcrumb: FC<BreadcrumbProps>;
59
+ }
60
+ declare function useDocsPage(): {
61
+ full: NonNullable<DocsPageProps["full"]>;
62
+ slots: DocsPageSlots;
63
+ };
64
+ declare function DocsPage({ full, tableOfContent: { enabled: tocEnabled, single, ...tocProps }, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps }, breadcrumb: { enabled: breadcrumbEnabled, ...breadcrumb }, footer: { enabled: footerEnabled, ...footer }, toc, slots: defaultSlots, children, ...containerProps }: DocsPageProps): import("react").JSX.Element;
65
+ declare function EditOnGitHub(props: ComponentProps<'a'>): import("react").JSX.Element;
66
+ /**
67
+ * Add typography styles
68
+ */
69
+ declare function DocsBody({ children, className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
70
+ declare function DocsDescription({ children, className, ...props }: ComponentProps<'p'>): import("react").JSX.Element | null;
71
+ declare function DocsTitle({ children, className, ...props }: ComponentProps<'h1'>): import("react").JSX.Element;
72
+ declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
73
+ date: Date;
74
+ }): import("react").JSX.Element;
75
+ //#endregion
76
+ export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
3
+ import { cn } from "../../../utils/cn.js";
4
+ import { buttonVariants } from "../../../components/ui/button.js";
5
+ import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
6
+ import { TOC, TOCPopover, TOCProvider } from "./slots/toc.js";
7
+ import { Footer } from "./slots/footer.js";
8
+ import { Breadcrumb } from "./slots/breadcrumb.js";
9
+ import { Container } from "./slots/container.js";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { Edit } from "lucide-react";
12
+ import { createContext, use, useEffect, useState } from "react";
13
+ import { useTranslations } from "@fuma-translate/react";
14
+ //#region src/layouts/notebook/page/index.tsx
15
+ var page_exports = /* @__PURE__ */ __exportAll({
16
+ DocsBody: () => DocsBody,
17
+ DocsDescription: () => DocsDescription,
18
+ DocsPage: () => DocsPage,
19
+ DocsTitle: () => DocsTitle,
20
+ EditOnGitHub: () => EditOnGitHub,
21
+ MarkdownCopyButton: () => MarkdownCopyButton,
22
+ PageBreadcrumb: () => Breadcrumb,
23
+ PageFooter: () => Footer,
24
+ PageLastUpdate: () => PageLastUpdate,
25
+ ViewOptionsPopover: () => ViewOptionsPopover,
26
+ useDocsPage: () => useDocsPage
27
+ });
28
+ const PageContext = createContext(null);
29
+ function useDocsPage() {
30
+ const context = use(PageContext);
31
+ if (!context) throw new Error("Please use page components under <DocsPage /> (`@vx-oss/docs-react/layouts/notebook/page`).");
32
+ return context;
33
+ }
34
+ function DocsPage({ full = false, tableOfContent: { enabled: tocEnabled = !full, single, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
35
+ tocPopoverEnabled ??= Boolean(toc.length > 0 || tocPopoverProps.header || tocPopoverProps.footer);
36
+ const slots = {
37
+ breadcrumb: defaultSlots.breadcrumb ?? Breadcrumb,
38
+ footer: defaultSlots.footer ?? Footer,
39
+ toc: defaultSlots.toc ?? {
40
+ provider: TOCProvider,
41
+ main: TOC,
42
+ popover: TOCPopover
43
+ },
44
+ container: defaultSlots.container ?? Container
45
+ };
46
+ return /* @__PURE__ */ jsx(PageContext, {
47
+ value: {
48
+ full,
49
+ slots
50
+ },
51
+ children: /* @__PURE__ */ jsxs(slots.toc.provider, {
52
+ single,
53
+ toc: tocEnabled || tocPopoverEnabled ? toc : [],
54
+ children: [
55
+ tocPopoverEnabled && (tocPopoverProps.component ?? /* @__PURE__ */ jsx(slots.toc.popover, { ...tocPopoverProps })),
56
+ /* @__PURE__ */ jsxs(slots.container, {
57
+ ...containerProps,
58
+ children: [
59
+ breadcrumbEnabled && (breadcrumb.component ?? /* @__PURE__ */ jsx(slots.breadcrumb, { ...breadcrumb })),
60
+ children,
61
+ footerEnabled && (footer.component ?? /* @__PURE__ */ jsx(slots.footer, { ...footer }))
62
+ ]
63
+ }),
64
+ tocEnabled && (tocProps.component ?? /* @__PURE__ */ jsx(slots.toc.main, { ...tocProps }))
65
+ ]
66
+ })
67
+ });
68
+ }
69
+ function EditOnGitHub(props) {
70
+ const t = useTranslations({ note: "edit page" });
71
+ return /* @__PURE__ */ jsx("a", {
72
+ target: "_blank",
73
+ rel: "noreferrer noopener",
74
+ ...props,
75
+ className: cn(buttonVariants({
76
+ color: "secondary",
77
+ size: "sm"
78
+ }), "gap-1.5 not-prose", props.className),
79
+ children: props.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Edit, { className: "size-3.5" }), t("Edit on GitHub")] })
80
+ });
81
+ }
82
+ /**
83
+ * Add typography styles
84
+ */
85
+ function DocsBody({ children, className, ...props }) {
86
+ return /* @__PURE__ */ jsx("div", {
87
+ ...props,
88
+ className: cn("prose flex-1", className),
89
+ children
90
+ });
91
+ }
92
+ function DocsDescription({ children, className, ...props }) {
93
+ if (children === void 0) return null;
94
+ return /* @__PURE__ */ jsx("p", {
95
+ ...props,
96
+ className: cn("mb-8 text-lg text-fd-muted-foreground", className),
97
+ children
98
+ });
99
+ }
100
+ function DocsTitle({ children, className, ...props }) {
101
+ return /* @__PURE__ */ jsx("h1", {
102
+ ...props,
103
+ className: cn("text-[1.75em] font-semibold", className),
104
+ children
105
+ });
106
+ }
107
+ function PageLastUpdate({ date: value, ...props }) {
108
+ const t = useTranslations({ note: "page footer" });
109
+ const [date, setDate] = useState("");
110
+ useEffect(() => {
111
+ setDate(value.toLocaleDateString());
112
+ }, [value]);
113
+ return /* @__PURE__ */ jsxs("p", {
114
+ ...props,
115
+ className: cn("text-sm text-fd-muted-foreground", props.className),
116
+ children: [
117
+ t("Last updated on"),
118
+ " ",
119
+ date
120
+ ]
121
+ });
122
+ }
123
+ //#endregion
124
+ export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, page_exports, useDocsPage };
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ import { BreadcrumbOptions } from "@vx-oss/docs-core/breadcrumb";
3
+ //#region src/layouts/notebook/page/slots/breadcrumb.d.ts
4
+ type BreadcrumbProps = BreadcrumbOptions & ComponentProps<'div'>;
5
+ declare function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }: BreadcrumbProps): import("react").JSX.Element | null;
6
+ //#endregion
7
+ export { Breadcrumb, BreadcrumbProps };
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { cn } from "../../../../utils/cn.js";
3
+ import { useTreeContext, useTreePath } from "../../../../contexts/tree.js";
4
+ import Link from "@vx-oss/docs-core/link";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { ChevronRight } from "lucide-react";
7
+ import { Fragment as Fragment$1, useMemo } from "react";
8
+ import { getBreadcrumbItemsFromPath } from "@vx-oss/docs-core/breadcrumb";
9
+ //#region src/layouts/notebook/page/slots/breadcrumb.tsx
10
+ function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }) {
11
+ const path = useTreePath();
12
+ const { root } = useTreeContext();
13
+ const items = useMemo(() => {
14
+ return getBreadcrumbItemsFromPath(root, path, {
15
+ includePage,
16
+ includeSeparator,
17
+ includeRoot
18
+ });
19
+ }, [
20
+ includePage,
21
+ includeRoot,
22
+ includeSeparator,
23
+ path,
24
+ root
25
+ ]);
26
+ if (items.length === 0) return null;
27
+ return /* @__PURE__ */ jsx("div", {
28
+ ...props,
29
+ className: cn("flex items-center gap-1.5 text-sm text-fd-muted-foreground", props.className),
30
+ children: items.map((item, i) => {
31
+ const className = cn("truncate", i === items.length - 1 && "text-fd-primary font-medium");
32
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [i !== 0 && /* @__PURE__ */ jsx(ChevronRight, { className: "size-3.5 shrink-0" }), item.url ? /* @__PURE__ */ jsx(Link, {
33
+ href: item.url,
34
+ className: cn(className, "transition-opacity hover:opacity-80"),
35
+ children: item.name
36
+ }) : /* @__PURE__ */ jsx("span", {
37
+ className,
38
+ children: item.name
39
+ })] }, i);
40
+ })
41
+ });
42
+ }
43
+ //#endregion
44
+ export { Breadcrumb };
@@ -0,0 +1,5 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/layouts/notebook/page/slots/container.d.ts
3
+ declare function Container(props: ComponentProps<'article'>): import("react").JSX.Element;
4
+ //#endregion
5
+ export { Container };