@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,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 { TOC, TOCPopover, TOCProvider } from "./slots/toc.js";
6
+ import { Footer } from "./slots/footer.js";
7
+ import { Breadcrumb } from "./slots/breadcrumb.js";
8
+ import { Container } from "./slots/container.js";
9
+ import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.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/docs/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/docs/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/docs/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/docs/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/docs/page/slots/container.d.ts
3
+ declare function Container(props: ComponentProps<'article'>): import("react").JSX.Element;
4
+ //#endregion
5
+ export { Container };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { cn } from "../../../../utils/cn.js";
3
+ import { useDocsPage } from "../index.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/layouts/docs/page/slots/container.tsx
6
+ function Container(props) {
7
+ const { full } = useDocsPage();
8
+ return /* @__PURE__ */ jsx("main", {
9
+ className: "grid [grid-area:main] justify-items-center",
10
+ "data-layout-main": "",
11
+ children: /* @__PURE__ */ jsx("article", {
12
+ id: "nd-page",
13
+ "data-layout-content": "",
14
+ "data-full": full,
15
+ ...props,
16
+ className: cn("flex flex-col min-w-0 w-full max-w-[900px] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14", full && "max-w-[1168px]", props.className),
17
+ children: props.children
18
+ })
19
+ });
20
+ }
21
+ //#endregion
22
+ export { Container };
@@ -0,0 +1,16 @@
1
+ import { ComponentProps } from "react";
2
+ import * as PageTree from "@vx-oss/docs-core/page-tree";
3
+ //#region src/layouts/docs/page/slots/footer.d.ts
4
+ type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
5
+ interface FooterProps extends ComponentProps<'div'> {
6
+ /**
7
+ * Items including information for the next and previous page
8
+ */
9
+ items?: {
10
+ previous?: Item;
11
+ next?: Item;
12
+ };
13
+ }
14
+ declare function Footer({ items, children, className, ...props }: FooterProps): import("react").JSX.Element;
15
+ //#endregion
16
+ export { Footer, FooterProps };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { cn } from "../../../../utils/cn.js";
3
+ import { isActive } from "../../../../utils/urls.js";
4
+ import { useFooterItems } from "../../../../utils/use-footer-items.js";
5
+ import Link from "@vx-oss/docs-core/link";
6
+ import { usePathname } from "@vx-oss/docs-core/framework";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { ChevronLeft, ChevronRight } from "lucide-react";
9
+ import { useMemo } from "react";
10
+ import { useTranslations } from "@fuma-translate/react";
11
+ //#region src/layouts/docs/page/slots/footer.tsx
12
+ function Footer({ items, children, className, ...props }) {
13
+ const footerList = useFooterItems();
14
+ const pathname = usePathname();
15
+ const { previous, next } = useMemo(() => {
16
+ if (items) return items;
17
+ const idx = footerList.findIndex((item) => isActive(item.url, pathname));
18
+ if (idx === -1) return {};
19
+ return {
20
+ previous: footerList[idx - 1],
21
+ next: footerList[idx + 1]
22
+ };
23
+ }, [
24
+ footerList,
25
+ items,
26
+ pathname
27
+ ]);
28
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
29
+ className: cn("@container grid gap-4", previous && next ? "grid-cols-2" : "grid-cols-1", className),
30
+ ...props,
31
+ children: [previous && /* @__PURE__ */ jsx(FooterItem, {
32
+ item: previous,
33
+ index: 0
34
+ }), next && /* @__PURE__ */ jsx(FooterItem, {
35
+ item: next,
36
+ index: 1
37
+ })]
38
+ }), children] });
39
+ }
40
+ function FooterItem({ item, index }) {
41
+ const t = useTranslations({ note: "pagination" });
42
+ const Icon = index === 0 ? ChevronLeft : ChevronRight;
43
+ return /* @__PURE__ */ jsxs(Link, {
44
+ href: item.url,
45
+ className: cn("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full", index === 1 && "text-end"),
46
+ children: [/* @__PURE__ */ jsxs("div", {
47
+ className: cn("inline-flex items-center gap-1.5 font-medium", index === 1 && "flex-row-reverse"),
48
+ children: [/* @__PURE__ */ jsx(Icon, { className: "-mx-1 size-4 shrink-0 rtl:rotate-180" }), /* @__PURE__ */ jsx("p", { children: item.name })]
49
+ }), /* @__PURE__ */ jsx("p", {
50
+ className: "text-fd-muted-foreground truncate",
51
+ children: item.description ?? (index === 0 ? t("Previous Page") : t("Next Page"))
52
+ })]
53
+ });
54
+ }
55
+ //#endregion
56
+ export { Footer };
@@ -0,0 +1,47 @@
1
+ import { TOCItemsProps } from "../../../../components/toc/clerk.js";
2
+ import { TOCItemsProps as TOCItemsProps$1 } from "../../../../components/toc/default.js";
3
+ import { TOCProviderProps as TOCProviderProps$1 } from "../../../../components/toc/index.js";
4
+ import { ComponentProps, ReactNode } from "react";
5
+ //#region src/layouts/docs/page/slots/toc.d.ts
6
+ type TOCProviderProps = TOCProviderProps$1;
7
+ declare function TOCProvider(props: TOCProviderProps): import("react").JSX.Element;
8
+ type TOCProps = {
9
+ container?: ComponentProps<'div'>;
10
+ /**
11
+ * Custom content in TOC container, before the main TOC
12
+ */
13
+ header?: ReactNode;
14
+ /**
15
+ * Custom content in TOC container, after the main TOC
16
+ */
17
+ footer?: ReactNode;
18
+ } & ({
19
+ style?: 'normal';
20
+ list?: TOCItemsProps$1;
21
+ } | {
22
+ style: 'clerk';
23
+ list?: TOCItemsProps;
24
+ });
25
+ declare function TOC({ container, header, footer, style, list }: TOCProps): import("react").JSX.Element;
26
+ type TOCPopoverProps = {
27
+ container?: ComponentProps<'div'>;
28
+ trigger?: ComponentProps<'button'>;
29
+ content?: ComponentProps<'div'>;
30
+ /**
31
+ * Custom content in TOC container, before the main TOC
32
+ */
33
+ header?: ReactNode;
34
+ /**
35
+ * Custom content in TOC container, after the main TOC
36
+ */
37
+ footer?: ReactNode;
38
+ } & ({
39
+ style?: 'normal';
40
+ list?: TOCItemsProps$1;
41
+ } | {
42
+ style: 'clerk';
43
+ list?: TOCItemsProps;
44
+ });
45
+ declare function TOCPopover({ container, trigger, content, header, footer, style, list }: TOCPopoverProps): import("react").JSX.Element;
46
+ //#endregion
47
+ export { TOC, TOCPopover, TOCPopoverProps, TOCProps, TOCProvider, TOCProviderProps };
@@ -0,0 +1,182 @@
1
+ "use client";
2
+ import { cn } from "../../../../utils/cn.js";
3
+ import { TOCProvider as TOCProvider$1, TOCScrollArea, useItems, useTOCItems } from "../../../../components/toc/index.js";
4
+ import { default_exports } from "../../../../components/toc/default.js";
5
+ import { clerk_exports } from "../../../../components/toc/clerk.js";
6
+ import { useTreePath } from "../../../../contexts/tree.js";
7
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../../components/ui/collapsible.js";
8
+ import { useDocsLayout } from "../../client.js";
9
+ import "../../index.js";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { ChevronDown, Text } from "lucide-react";
12
+ import { createContext, use, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
13
+ import { useTranslations } from "@fuma-translate/react";
14
+ //#region src/layouts/docs/page/slots/toc.tsx
15
+ function TOCProvider(props) {
16
+ return /* @__PURE__ */ jsx(TOCProvider$1, { ...props });
17
+ }
18
+ function TOC({ container, header, footer, style = "normal", list }) {
19
+ const items = useTOCItems();
20
+ const t = useTranslations({ note: "table of contents" });
21
+ const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
22
+ if (items.length === 0 && !header && !footer) return /* @__PURE__ */ jsx("div", {
23
+ id: "nd-toc-placeholder",
24
+ className: "hidden xl:layout:[--fd-toc-width:268px]"
25
+ });
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ id: "nd-toc",
28
+ ...container,
29
+ className: cn("sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 xl:layout:[--fd-toc-width:268px] max-xl:hidden", container?.className),
30
+ children: [
31
+ header,
32
+ /* @__PURE__ */ jsxs("h3", {
33
+ id: "toc-title",
34
+ className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",
35
+ children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }), t("On this page")]
36
+ }),
37
+ /* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, {
38
+ ...list,
39
+ children: [items.length === 0 && /* @__PURE__ */ jsx(TOCEmpty, {}), items.map((item) => /* @__PURE__ */ jsx(TOCItem, { item }, item.url))]
40
+ }) }),
41
+ footer
42
+ ]
43
+ });
44
+ }
45
+ const TocPopoverContext = createContext(null);
46
+ function TOCPopover({ container, trigger, content, header, footer, style = "normal", list }) {
47
+ const items = useTOCItems();
48
+ const ref = useRef(null);
49
+ const [open, setOpen] = useState(false);
50
+ const { isNavTransparent } = useDocsLayout();
51
+ const { TOCItems, TOCItem, TOCEmpty } = style === "clerk" ? clerk_exports : default_exports;
52
+ const onClickOutside = useEffectEvent((e) => {
53
+ if (!open || !(e.target instanceof HTMLElement)) return;
54
+ if (ref.current && !ref.current.contains(e.target)) setOpen(false);
55
+ });
56
+ const onClickItem = () => {
57
+ setOpen(false);
58
+ };
59
+ useEffect(() => {
60
+ window.addEventListener("click", onClickOutside);
61
+ return () => {
62
+ window.removeEventListener("click", onClickOutside);
63
+ };
64
+ }, []);
65
+ return /* @__PURE__ */ jsx(TocPopoverContext, {
66
+ value: useMemo(() => ({
67
+ open,
68
+ setOpen
69
+ }), [setOpen, open]),
70
+ children: /* @__PURE__ */ jsx(Collapsible, {
71
+ open,
72
+ onOpenChange: setOpen,
73
+ "data-toc-popover": "",
74
+ ...container,
75
+ className: cn("sticky top-(--fd-docs-row-2) z-10 [grid-area:toc-popover] h-(--fd-toc-popover-height) xl:hidden max-xl:layout:[--fd-toc-popover-height:--spacing(10)]", container?.className),
76
+ children: /* @__PURE__ */ jsxs("header", {
77
+ ref,
78
+ className: cn("border-b backdrop-blur-sm transition-colors", (!isNavTransparent || open) && "bg-fd-background/80", open && "shadow-lg"),
79
+ children: [/* @__PURE__ */ jsx(PageTOCPopoverTrigger, { ...trigger }), /* @__PURE__ */ jsxs(PageTOCPopoverContent, {
80
+ ...content,
81
+ children: [
82
+ header,
83
+ /* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, {
84
+ ...list,
85
+ children: [items.length === 0 && /* @__PURE__ */ jsx(TOCEmpty, {}), items.map((item) => /* @__PURE__ */ jsx(TOCItem, {
86
+ item,
87
+ onClick: onClickItem
88
+ }, item.url))]
89
+ }) }),
90
+ footer
91
+ ]
92
+ })]
93
+ })
94
+ })
95
+ });
96
+ }
97
+ function PageTOCPopoverTrigger({ className, ...props }) {
98
+ const t = useTranslations({ note: "table of contents" });
99
+ const { open } = use(TocPopoverContext);
100
+ const items = useItems();
101
+ const selectedIdx = items.findIndex((item) => item.active);
102
+ const path = useTreePath().at(-1);
103
+ const showItem = selectedIdx !== -1 && !open;
104
+ return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
105
+ className: cn("flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6", className),
106
+ "data-toc-popover-trigger": "",
107
+ ...props,
108
+ children: [
109
+ /* @__PURE__ */ jsx(ProgressCircle, {
110
+ value: (items.findLastIndex((item) => item.active) + 1) / Math.max(1, items.length),
111
+ max: 1,
112
+ className: cn("shrink-0", open && "text-fd-primary")
113
+ }),
114
+ /* @__PURE__ */ jsxs("span", {
115
+ className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1",
116
+ children: [/* @__PURE__ */ jsx("span", {
117
+ className: cn("truncate transition-[opacity,translate,color]", open && "text-fd-foreground", showItem && "opacity-0 -translate-y-full pointer-events-none"),
118
+ children: path?.name ?? t("On this page")
119
+ }), /* @__PURE__ */ jsx("span", {
120
+ className: cn("truncate transition-[opacity,translate]", !showItem && "opacity-0 translate-y-full pointer-events-none"),
121
+ children: items[selectedIdx]?.original.title
122
+ })]
123
+ }),
124
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn("shrink-0 transition-transform mx-0.5", open && "rotate-180") })
125
+ ]
126
+ });
127
+ }
128
+ function clamp(input, min, max) {
129
+ if (input < min) return min;
130
+ if (input > max) return max;
131
+ return input;
132
+ }
133
+ function ProgressCircle({ value, strokeWidth = 1.5, size = 18, min = 0, max = 100, style, ...restSvgProps }) {
134
+ const normalizedValue = clamp(value, min, max);
135
+ const radius = size / 2 - strokeWidth;
136
+ const circumference = 2 * Math.PI * radius;
137
+ const progress = normalizedValue / max * circumference;
138
+ const circleProps = {
139
+ cx: size / 2,
140
+ cy: size / 2,
141
+ r: radius,
142
+ fill: "none",
143
+ strokeWidth
144
+ };
145
+ return /* @__PURE__ */ jsxs("svg", {
146
+ role: "progressbar",
147
+ viewBox: `0 0 ${size} ${size}`,
148
+ "aria-valuenow": normalizedValue,
149
+ "aria-valuemin": min,
150
+ "aria-valuemax": max,
151
+ style: {
152
+ width: size,
153
+ height: size,
154
+ ...style
155
+ },
156
+ ...restSvgProps,
157
+ children: [/* @__PURE__ */ jsx("circle", {
158
+ ...circleProps,
159
+ className: "stroke-current/25"
160
+ }), /* @__PURE__ */ jsx("circle", {
161
+ ...circleProps,
162
+ stroke: "currentColor",
163
+ strokeDasharray: circumference,
164
+ strokeDashoffset: circumference - progress,
165
+ strokeLinecap: "round",
166
+ transform: `rotate(-90 ${size / 2} ${size / 2})`,
167
+ className: "transition-all"
168
+ })]
169
+ });
170
+ }
171
+ function PageTOCPopoverContent(props) {
172
+ return /* @__PURE__ */ jsx(CollapsibleContent, {
173
+ "data-toc-popover-content": "",
174
+ ...props,
175
+ children: /* @__PURE__ */ jsx("div", {
176
+ className: "flex flex-col px-4 max-h-[50vh] md:px-6",
177
+ children: props.children
178
+ })
179
+ });
180
+ }
181
+ //#endregion
182
+ export { TOC, TOCPopover, TOCProvider };
@@ -0,0 +1,5 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/layouts/docs/slots/container.d.ts
3
+ declare function Container(props: ComponentProps<'div'>): import("react").JSX.Element;
4
+ //#endregion
5
+ export { Container };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { cn } from "../../../utils/cn.js";
3
+ import { useDocsLayout } from "../client.js";
4
+ import "../index.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { useEffect, useState } from "react";
7
+ //#region src/layouts/docs/slots/container.tsx
8
+ function Container(props) {
9
+ const { slots } = useDocsLayout();
10
+ const { collapsed } = slots.sidebar.useSidebar();
11
+ const [previousCollapsed, setPreviousCollapsed] = useState(collapsed);
12
+ const isCollapseChanged = previousCollapsed !== collapsed;
13
+ useEffect(() => {
14
+ if (isCollapseChanged) setPreviousCollapsed(collapsed);
15
+ }, [collapsed, isCollapseChanged]);
16
+ return /* @__PURE__ */ jsx("div", {
17
+ id: "nd-docs-layout",
18
+ "data-sidebar-collapsed": collapsed,
19
+ "data-column-changed": isCollapseChanged,
20
+ ...props,
21
+ style: {
22
+ gridTemplate: `"sidebar sidebar header toc toc"
23
+ "sidebar sidebar toc-popover toc toc"
24
+ "sidebar sidebar main toc toc" 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-width) - var(--fd-toc-width))) var(--fd-toc-width) minmax(min-content, 1fr)`,
25
+ "--fd-docs-row-1": "var(--fd-banner-height, 0px)",
26
+ "--fd-docs-row-2": "calc(var(--fd-docs-row-1) + var(--fd-header-height))",
27
+ "--fd-docs-row-3": "calc(var(--fd-docs-row-2) + var(--fd-toc-popover-height))",
28
+ "--fd-sidebar-col": collapsed ? "0px" : "var(--fd-sidebar-width)",
29
+ ...props.style
30
+ },
31
+ className: cn("grid overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px] data-[column-changed=true]:transition-[grid-template-columns]", props.className),
32
+ children: props.children
33
+ });
34
+ }
35
+ //#endregion
36
+ export { Container };
@@ -0,0 +1,5 @@
1
+ import { ComponentProps } from "react";
2
+ //#region src/layouts/docs/slots/header.d.ts
3
+ declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
4
+ //#endregion
5
+ export { Header };
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { cn } from "../../../utils/cn.js";
3
+ import { buttonVariants } from "../../../components/ui/button.js";
4
+ import { useDocsLayout } from "../client.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { SidebarIcon } from "lucide-react";
7
+ //#region src/layouts/docs/slots/header.tsx
8
+ function Header(props) {
9
+ const { isNavTransparent, slots, props: { nav } } = useDocsLayout();
10
+ if (nav?.component) return nav.component;
11
+ return /* @__PURE__ */ jsxs("header", {
12
+ id: "nd-subnav",
13
+ "data-transparent": isNavTransparent,
14
+ ...props,
15
+ className: cn("[grid-area:header] sticky top-(--fd-docs-row-1) z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm h-(--fd-header-height) md:hidden max-md:layout:[--fd-header-height:--spacing(14)] data-[transparent=false]:bg-fd-background/80", props.className),
16
+ children: [
17
+ slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: "inline-flex items-center gap-2.5 font-semibold" }),
18
+ /* @__PURE__ */ jsx("div", {
19
+ className: "flex-1",
20
+ children: nav?.children
21
+ }),
22
+ slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.sm, {
23
+ hideIfDisabled: true,
24
+ className: "p-2"
25
+ }),
26
+ slots.sidebar && /* @__PURE__ */ jsx(slots.sidebar.trigger, {
27
+ className: cn(buttonVariants({
28
+ color: "ghost",
29
+ size: "icon-sm",
30
+ className: "p-2"
31
+ })),
32
+ children: /* @__PURE__ */ jsx(SidebarIcon, {})
33
+ })
34
+ ]
35
+ });
36
+ }
37
+ //#endregion
38
+ export { Header };
@@ -0,0 +1,22 @@
1
+ import { SidebarProviderProps as SidebarProviderProps$1, useSidebar as useSidebar$1 } from "../../../components/sidebar/base.js";
2
+ import { SidebarPageTreeComponents } from "../../../components/sidebar/page-tree.js";
3
+ import { ComponentProps, ReactNode } from "react";
4
+ //#region src/layouts/docs/slots/sidebar.d.ts
5
+ interface SidebarProps extends ComponentProps<'aside'> {
6
+ components?: Partial<SidebarPageTreeComponents>;
7
+ banner?: ReactNode;
8
+ footer?: ReactNode;
9
+ /**
10
+ * Support collapsing the sidebar on desktop mode
11
+ *
12
+ * @defaultValue true
13
+ */
14
+ collapsible?: boolean;
15
+ }
16
+ type SidebarProviderProps = SidebarProviderProps$1;
17
+ declare const useSidebar: typeof useSidebar$1;
18
+ declare function SidebarProvider(props: SidebarProviderProps): import("react").JSX.Element;
19
+ declare function Sidebar({ footer, banner, collapsible, components, ...rest }: SidebarProps): import("react").JSX.Element;
20
+ declare function SidebarTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
21
+ //#endregion
22
+ export { Sidebar, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarTrigger, useSidebar };