@hanzo/docs-base-ui 16.5.0 → 16.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/README.md +3 -3
  2. package/css/aspen.css +39 -0
  3. package/css/black.css +39 -1
  4. package/css/catppuccin.css +49 -1
  5. package/css/dusk.css +47 -1
  6. package/css/emerald.css +39 -0
  7. package/css/generated/docs.css +490 -0
  8. package/css/generated/flux.css +429 -0
  9. package/css/generated/home.css +285 -0
  10. package/css/generated/notebook.css +526 -0
  11. package/css/generated/shared.css +1173 -0
  12. package/css/lib/base.css +214 -0
  13. package/css/lib/default-colors.css +51 -0
  14. package/css/lib/shiki.css +98 -0
  15. package/css/neutral.css +7 -1
  16. package/css/ocean.css +44 -1
  17. package/css/preset.css +9 -7
  18. package/css/purple.css +39 -1
  19. package/css/ruby.css +39 -0
  20. package/css/shadcn.css +36 -1
  21. package/css/solar.css +75 -1
  22. package/css/vitepress.css +65 -1
  23. package/dist/_virtual/_rolldown/runtime.js +13 -0
  24. package/dist/components/accordion.d.ts +2 -3
  25. package/dist/components/accordion.js +9 -13
  26. package/dist/components/banner.d.ts +3 -4
  27. package/dist/components/banner.js +5 -9
  28. package/dist/components/callout.d.ts +6 -7
  29. package/dist/components/callout.js +1 -4
  30. package/dist/components/card.d.ts +4 -5
  31. package/dist/components/card.js +2 -5
  32. package/dist/components/codeblock.d.ts +8 -9
  33. package/dist/components/codeblock.js +9 -13
  34. package/dist/components/codeblock.rsc.d.ts +21 -0
  35. package/dist/components/codeblock.rsc.js +22 -0
  36. package/dist/components/dialog/search-algolia.d.ts +7 -9
  37. package/dist/components/dialog/search-algolia.js +8 -12
  38. package/dist/components/dialog/search-default.d.ts +7 -9
  39. package/dist/components/dialog/search-default.js +8 -12
  40. package/dist/components/dialog/search-orama.d.ts +7 -9
  41. package/dist/components/dialog/search-orama.js +8 -12
  42. package/dist/components/dialog/search.d.ts +21 -21
  43. package/dist/components/dialog/search.js +137 -60
  44. package/dist/components/dynamic-codeblock.core.d.ts +35 -0
  45. package/dist/components/dynamic-codeblock.core.js +51 -0
  46. package/dist/components/dynamic-codeblock.d.ts +7 -29
  47. package/dist/components/dynamic-codeblock.js +11 -60
  48. package/dist/components/files.d.ts +1 -2
  49. package/dist/components/files.js +6 -10
  50. package/dist/components/github-info.d.ts +23 -10
  51. package/dist/components/github-info.js +34 -29
  52. package/dist/components/heading.d.ts +1 -2
  53. package/dist/components/heading.js +3 -6
  54. package/dist/components/image-zoom.d.ts +4 -5
  55. package/dist/components/image-zoom.js +2 -5
  56. package/dist/components/inline-toc.d.ts +3 -4
  57. package/dist/components/inline-toc.js +2 -6
  58. package/dist/components/sidebar/base.d.ts +29 -23
  59. package/dist/components/sidebar/base.js +16 -22
  60. package/dist/components/sidebar/link-item.d.ts +3 -4
  61. package/dist/components/sidebar/link-item.js +6 -3
  62. package/dist/components/sidebar/page-tree.d.ts +3 -4
  63. package/dist/components/sidebar/page-tree.js +56 -45
  64. package/dist/components/sidebar/tabs/dropdown.d.ts +6 -9
  65. package/dist/components/sidebar/tabs/dropdown.js +22 -29
  66. package/dist/components/sidebar/tabs/index.d.ts +3 -17
  67. package/dist/components/sidebar/tabs/index.js +0 -3
  68. package/dist/components/steps.d.ts +4 -5
  69. package/dist/components/steps.js +0 -3
  70. package/dist/components/tabs.d.ts +15 -11
  71. package/dist/components/tabs.js +15 -20
  72. package/dist/components/toc/clerk.d.ts +19 -1
  73. package/dist/components/toc/clerk.js +165 -10
  74. package/dist/components/toc/default.d.ts +19 -1
  75. package/dist/components/toc/default.js +45 -10
  76. package/dist/components/toc/index.d.ts +29 -1
  77. package/dist/components/toc/index.js +105 -10
  78. package/dist/components/type-table.d.ts +11 -6
  79. package/dist/components/type-table.js +28 -23
  80. package/dist/components/ui/accordion.d.ts +7 -8
  81. package/dist/components/ui/accordion.js +2 -6
  82. package/dist/components/ui/button.d.ts +1 -2
  83. package/dist/components/ui/button.js +0 -3
  84. package/dist/components/ui/collapsible.d.ts +6 -7
  85. package/dist/components/ui/collapsible.js +3 -7
  86. package/dist/components/ui/navigation-menu.d.ts +27 -13
  87. package/dist/components/ui/navigation-menu.js +53 -31
  88. package/dist/components/ui/popover.d.ts +11 -6
  89. package/dist/components/ui/popover.js +15 -19
  90. package/dist/components/ui/scroll-area.d.ts +17 -7
  91. package/dist/components/ui/scroll-area.js +27 -31
  92. package/dist/components/ui/tabs.d.ts +8 -9
  93. package/dist/components/ui/tabs.js +5 -9
  94. package/dist/contexts/i18n.d.ts +62 -1
  95. package/dist/contexts/i18n.js +53 -10
  96. package/dist/contexts/search.d.ts +71 -5
  97. package/dist/contexts/search.js +64 -10
  98. package/dist/contexts/tree.d.ts +21 -1
  99. package/dist/contexts/tree.js +36 -10
  100. package/dist/i18n.d.ts +21 -1
  101. package/dist/i18n.js +20 -3
  102. package/dist/layouts/docs/client.d.ts +30 -29
  103. package/dist/layouts/docs/client.js +76 -52
  104. package/dist/layouts/docs/index.d.ts +21 -35
  105. package/dist/layouts/docs/index.js +16 -172
  106. package/dist/layouts/docs/page/index.d.ts +75 -52
  107. package/dist/layouts/docs/page/index.js +76 -56
  108. package/dist/layouts/docs/page/slots/breadcrumb.d.ts +14 -0
  109. package/dist/layouts/docs/page/slots/breadcrumb.js +44 -0
  110. package/dist/layouts/docs/page/slots/container.d.ts +7 -0
  111. package/dist/layouts/docs/page/slots/container.js +17 -0
  112. package/dist/layouts/docs/page/slots/footer.d.ts +23 -0
  113. package/dist/layouts/docs/page/slots/footer.js +56 -0
  114. package/dist/layouts/docs/page/slots/toc.d.ts +55 -0
  115. package/dist/layouts/docs/page/slots/toc.js +166 -0
  116. package/dist/layouts/docs/slots/container.d.ts +7 -0
  117. package/dist/layouts/docs/slots/container.js +29 -0
  118. package/dist/layouts/docs/slots/header.d.ts +8 -0
  119. package/dist/layouts/docs/slots/header.js +38 -0
  120. package/dist/layouts/docs/slots/sidebar.d.ts +30 -0
  121. package/dist/layouts/docs/slots/sidebar.js +319 -0
  122. package/dist/layouts/flux/index.d.ts +74 -0
  123. package/dist/layouts/flux/index.js +146 -0
  124. package/dist/layouts/flux/page/index.d.ts +105 -0
  125. package/dist/layouts/flux/page/index.js +104 -0
  126. package/dist/layouts/flux/page/slots/breadcrumb.d.ts +14 -0
  127. package/dist/layouts/flux/page/slots/breadcrumb.js +44 -0
  128. package/dist/layouts/flux/page/slots/container.d.ts +7 -0
  129. package/dist/layouts/flux/page/slots/container.js +17 -0
  130. package/dist/layouts/flux/page/slots/footer.d.ts +23 -0
  131. package/dist/layouts/flux/page/slots/footer.js +56 -0
  132. package/dist/layouts/flux/page/slots/toc.d.ts +34 -0
  133. package/dist/layouts/flux/page/slots/toc.js +172 -0
  134. package/dist/layouts/flux/slots/container.d.ts +7 -0
  135. package/dist/layouts/flux/slots/container.js +13 -0
  136. package/dist/layouts/flux/slots/sidebar.d.ts +23 -0
  137. package/dist/layouts/flux/slots/sidebar.js +237 -0
  138. package/dist/layouts/flux/slots/tab-dropdown.d.ts +17 -0
  139. package/dist/layouts/flux/slots/tab-dropdown.js +85 -0
  140. package/dist/layouts/home/index.d.ts +25 -8
  141. package/dist/layouts/home/index.js +39 -19
  142. package/dist/layouts/home/navbar.d.ts +7 -16
  143. package/dist/layouts/home/navbar.js +12 -14
  144. package/dist/layouts/home/not-found.d.ts +9 -0
  145. package/dist/layouts/home/not-found.js +38 -0
  146. package/dist/layouts/home/slots/container.d.ts +7 -0
  147. package/dist/layouts/home/slots/container.js +13 -0
  148. package/dist/layouts/home/slots/header.d.ts +11 -0
  149. package/dist/layouts/home/slots/header.js +242 -0
  150. package/dist/layouts/notebook/client.d.ts +32 -44
  151. package/dist/layouts/notebook/client.js +58 -148
  152. package/dist/layouts/notebook/index.d.ts +26 -25
  153. package/dist/layouts/notebook/index.js +16 -213
  154. package/dist/layouts/notebook/page/index.d.ts +75 -52
  155. package/dist/layouts/notebook/page/index.js +76 -56
  156. package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +14 -0
  157. package/dist/layouts/notebook/page/slots/breadcrumb.js +44 -0
  158. package/dist/layouts/notebook/page/slots/container.d.ts +7 -0
  159. package/dist/layouts/notebook/page/slots/container.js +17 -0
  160. package/dist/layouts/notebook/page/slots/footer.d.ts +23 -0
  161. package/dist/layouts/notebook/page/slots/footer.js +56 -0
  162. package/dist/layouts/notebook/page/slots/toc.d.ts +55 -0
  163. package/dist/layouts/notebook/page/slots/toc.js +165 -0
  164. package/dist/layouts/notebook/slots/container.d.ts +7 -0
  165. package/dist/layouts/notebook/slots/container.js +31 -0
  166. package/dist/layouts/notebook/slots/header.d.ts +8 -0
  167. package/dist/layouts/notebook/slots/header.js +194 -0
  168. package/dist/layouts/notebook/slots/sidebar.d.ts +40 -0
  169. package/dist/layouts/notebook/slots/sidebar.js +297 -0
  170. package/dist/layouts/shared/client.d.ts +45 -0
  171. package/dist/layouts/shared/client.js +84 -0
  172. package/dist/layouts/shared/index.d.ts +144 -35
  173. package/dist/layouts/shared/index.js +74 -15
  174. package/dist/layouts/shared/page-actions.d.ts +36 -0
  175. package/dist/layouts/shared/page-actions.js +190 -0
  176. package/dist/layouts/shared/slots/language-select.d.ts +10 -0
  177. package/dist/layouts/shared/{language-toggle.js → slots/language-select.js} +12 -16
  178. package/dist/layouts/shared/slots/search-trigger.d.ts +23 -0
  179. package/dist/layouts/shared/{search-toggle.js → slots/search-trigger.js} +12 -16
  180. package/dist/layouts/shared/slots/theme-switch.d.ts +14 -0
  181. package/dist/layouts/shared/{theme-toggle.js → slots/theme-switch.js} +11 -15
  182. package/dist/mdx.d.ts +23 -13
  183. package/dist/mdx.js +2 -6
  184. package/dist/mdx.server.d.ts +1 -3
  185. package/dist/mdx.server.js +0 -3
  186. package/dist/og/takumi.d.ts +21 -0
  187. package/dist/og/takumi.js +70 -0
  188. package/dist/og.d.ts +22 -1
  189. package/dist/og.js +70 -3
  190. package/dist/page.d.ts +6 -7
  191. package/dist/page.js +9 -14
  192. package/dist/provider/base.d.ts +5 -6
  193. package/dist/provider/base.js +5 -9
  194. package/dist/provider/next.d.ts +4 -5
  195. package/dist/provider/next.js +1 -5
  196. package/dist/provider/react-router.d.ts +4 -5
  197. package/dist/provider/react-router.js +1 -5
  198. package/dist/provider/tanstack.d.ts +4 -5
  199. package/dist/provider/tanstack.js +1 -5
  200. package/dist/provider/waku.d.ts +4 -5
  201. package/dist/provider/waku.js +1 -5
  202. package/dist/style.css +594 -192
  203. package/dist/tailwind/typography.d.ts +2 -0
  204. package/dist/tailwind/typography.js +2 -0
  205. package/dist/utils/cn.js +2 -0
  206. package/dist/utils/merge-refs.js +11 -0
  207. package/dist/utils/urls.js +15 -0
  208. package/dist/utils/use-copy-button.d.ts +6 -1
  209. package/dist/utils/use-copy-button.js +26 -3
  210. package/dist/utils/use-footer-items.d.ts +9 -1
  211. package/dist/utils/use-footer-items.js +24 -3
  212. package/dist/utils/use-is-scroll-top.d.ts +8 -1
  213. package/dist/utils/use-is-scroll-top.js +20 -3
  214. package/package.json +133 -81
  215. package/css/layouts/docs.css +0 -1
  216. package/css/layouts/home.css +0 -1
  217. package/css/layouts/notebook.css +0 -1
  218. package/dist/_virtual/rolldown_runtime.js +0 -36
  219. package/dist/components/accordion.d.ts.map +0 -1
  220. package/dist/components/accordion.js.map +0 -1
  221. package/dist/components/banner.d.ts.map +0 -1
  222. package/dist/components/banner.js.map +0 -1
  223. package/dist/components/callout.d.ts.map +0 -1
  224. package/dist/components/callout.js.map +0 -1
  225. package/dist/components/card.d.ts.map +0 -1
  226. package/dist/components/card.js.map +0 -1
  227. package/dist/components/codeblock.d.ts.map +0 -1
  228. package/dist/components/codeblock.js.map +0 -1
  229. package/dist/components/dialog/search-algolia.d.ts.map +0 -1
  230. package/dist/components/dialog/search-algolia.js.map +0 -1
  231. package/dist/components/dialog/search-default.d.ts.map +0 -1
  232. package/dist/components/dialog/search-default.js.map +0 -1
  233. package/dist/components/dialog/search-orama.d.ts.map +0 -1
  234. package/dist/components/dialog/search-orama.js.map +0 -1
  235. package/dist/components/dialog/search.d.ts.map +0 -1
  236. package/dist/components/dialog/search.js.map +0 -1
  237. package/dist/components/dynamic-codeblock.d.ts.map +0 -1
  238. package/dist/components/dynamic-codeblock.js.map +0 -1
  239. package/dist/components/files.d.ts.map +0 -1
  240. package/dist/components/files.js.map +0 -1
  241. package/dist/components/github-info.d.ts.map +0 -1
  242. package/dist/components/github-info.js.map +0 -1
  243. package/dist/components/heading.d.ts.map +0 -1
  244. package/dist/components/heading.js.map +0 -1
  245. package/dist/components/image-zoom-CtfZieBH.css +0 -80
  246. package/dist/components/image-zoom-CtfZieBH.css.map +0 -1
  247. package/dist/components/image-zoom.d.ts.map +0 -1
  248. package/dist/components/image-zoom.js.map +0 -1
  249. package/dist/components/image-zoom2.js +0 -1
  250. package/dist/components/inline-toc.d.ts.map +0 -1
  251. package/dist/components/inline-toc.js.map +0 -1
  252. package/dist/components/sidebar/base.d.ts.map +0 -1
  253. package/dist/components/sidebar/base.js.map +0 -1
  254. package/dist/components/sidebar/link-item.d.ts.map +0 -1
  255. package/dist/components/sidebar/link-item.js.map +0 -1
  256. package/dist/components/sidebar/page-tree.d.ts.map +0 -1
  257. package/dist/components/sidebar/page-tree.js.map +0 -1
  258. package/dist/components/sidebar/tabs/dropdown.d.ts.map +0 -1
  259. package/dist/components/sidebar/tabs/dropdown.js.map +0 -1
  260. package/dist/components/sidebar/tabs/index.d.ts.map +0 -1
  261. package/dist/components/sidebar/tabs/index.js.map +0 -1
  262. package/dist/components/steps.d.ts.map +0 -1
  263. package/dist/components/steps.js.map +0 -1
  264. package/dist/components/tabs.d.ts.map +0 -1
  265. package/dist/components/tabs.js.map +0 -1
  266. package/dist/components/toc/clerk.js.map +0 -1
  267. package/dist/components/toc/default.js.map +0 -1
  268. package/dist/components/toc/index.js.map +0 -1
  269. package/dist/components/type-table.d.ts.map +0 -1
  270. package/dist/components/type-table.js.map +0 -1
  271. package/dist/components/ui/accordion.d.ts.map +0 -1
  272. package/dist/components/ui/accordion.js.map +0 -1
  273. package/dist/components/ui/button.d.ts.map +0 -1
  274. package/dist/components/ui/button.js.map +0 -1
  275. package/dist/components/ui/collapsible.d.ts.map +0 -1
  276. package/dist/components/ui/collapsible.js.map +0 -1
  277. package/dist/components/ui/navigation-menu.d.ts.map +0 -1
  278. package/dist/components/ui/navigation-menu.js.map +0 -1
  279. package/dist/components/ui/popover.d.ts.map +0 -1
  280. package/dist/components/ui/popover.js.map +0 -1
  281. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  282. package/dist/components/ui/scroll-area.js.map +0 -1
  283. package/dist/components/ui/tabs.d.ts.map +0 -1
  284. package/dist/components/ui/tabs.js.map +0 -1
  285. package/dist/contexts/i18n.js.map +0 -1
  286. package/dist/contexts/search.d.ts.map +0 -1
  287. package/dist/contexts/search.js.map +0 -1
  288. package/dist/contexts/tree.js.map +0 -1
  289. package/dist/layouts/docs/client.d.ts.map +0 -1
  290. package/dist/layouts/docs/client.js.map +0 -1
  291. package/dist/layouts/docs/index.d.ts.map +0 -1
  292. package/dist/layouts/docs/index.js.map +0 -1
  293. package/dist/layouts/docs/page/client.d.ts +0 -46
  294. package/dist/layouts/docs/page/client.d.ts.map +0 -1
  295. package/dist/layouts/docs/page/client.js +0 -227
  296. package/dist/layouts/docs/page/client.js.map +0 -1
  297. package/dist/layouts/docs/page/index.d.ts.map +0 -1
  298. package/dist/layouts/docs/page/index.js.map +0 -1
  299. package/dist/layouts/docs/sidebar.d.ts +0 -63
  300. package/dist/layouts/docs/sidebar.d.ts.map +0 -1
  301. package/dist/layouts/docs/sidebar.js +0 -162
  302. package/dist/layouts/docs/sidebar.js.map +0 -1
  303. package/dist/layouts/home/client.d.ts +0 -19
  304. package/dist/layouts/home/client.d.ts.map +0 -1
  305. package/dist/layouts/home/client.js +0 -285
  306. package/dist/layouts/home/client.js.map +0 -1
  307. package/dist/layouts/home/index.d.ts.map +0 -1
  308. package/dist/layouts/home/index.js.map +0 -1
  309. package/dist/layouts/home/navbar.d.ts.map +0 -1
  310. package/dist/layouts/home/navbar.js.map +0 -1
  311. package/dist/layouts/notebook/client.d.ts.map +0 -1
  312. package/dist/layouts/notebook/client.js.map +0 -1
  313. package/dist/layouts/notebook/index.d.ts.map +0 -1
  314. package/dist/layouts/notebook/index.js.map +0 -1
  315. package/dist/layouts/notebook/page/client.d.ts +0 -46
  316. package/dist/layouts/notebook/page/client.d.ts.map +0 -1
  317. package/dist/layouts/notebook/page/client.js +0 -227
  318. package/dist/layouts/notebook/page/client.js.map +0 -1
  319. package/dist/layouts/notebook/page/index.d.ts.map +0 -1
  320. package/dist/layouts/notebook/page/index.js.map +0 -1
  321. package/dist/layouts/notebook/sidebar.d.ts +0 -59
  322. package/dist/layouts/notebook/sidebar.d.ts.map +0 -1
  323. package/dist/layouts/notebook/sidebar.js +0 -133
  324. package/dist/layouts/notebook/sidebar.js.map +0 -1
  325. package/dist/layouts/shared/index.d.ts.map +0 -1
  326. package/dist/layouts/shared/index.js.map +0 -1
  327. package/dist/layouts/shared/language-toggle.d.ts +0 -10
  328. package/dist/layouts/shared/language-toggle.d.ts.map +0 -1
  329. package/dist/layouts/shared/language-toggle.js.map +0 -1
  330. package/dist/layouts/shared/search-toggle.d.ts +0 -23
  331. package/dist/layouts/shared/search-toggle.d.ts.map +0 -1
  332. package/dist/layouts/shared/search-toggle.js.map +0 -1
  333. package/dist/layouts/shared/theme-toggle.d.ts +0 -14
  334. package/dist/layouts/shared/theme-toggle.d.ts.map +0 -1
  335. package/dist/layouts/shared/theme-toggle.js.map +0 -1
  336. package/dist/mdx.d.ts.map +0 -1
  337. package/dist/mdx.js.map +0 -1
  338. package/dist/mdx.server.d.ts.map +0 -1
  339. package/dist/mdx.server.js.map +0 -1
  340. package/dist/page.d.ts.map +0 -1
  341. package/dist/page.js.map +0 -1
  342. package/dist/provider/base.d.ts.map +0 -1
  343. package/dist/provider/base.js.map +0 -1
  344. package/dist/provider/next.d.ts.map +0 -1
  345. package/dist/provider/next.js.map +0 -1
  346. package/dist/provider/react-router.d.ts.map +0 -1
  347. package/dist/provider/react-router.js.map +0 -1
  348. package/dist/provider/tanstack.d.ts.map +0 -1
  349. package/dist/provider/tanstack.js.map +0 -1
  350. package/dist/provider/waku.d.ts.map +0 -1
  351. package/dist/provider/waku.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ import { ComponentProps } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as PageTree from "@hanzo/docs-core/page-tree";
4
+
5
+ //#region src/layouts/notebook/page/slots/footer.d.ts
6
+ type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
7
+ interface FooterProps extends ComponentProps<'div'> {
8
+ /**
9
+ * Items including information for the next and previous page
10
+ */
11
+ items?: {
12
+ previous?: Item;
13
+ next?: Item;
14
+ };
15
+ }
16
+ declare function Footer({
17
+ items,
18
+ children,
19
+ className,
20
+ ...props
21
+ }: FooterProps): react_jsx_runtime0.JSX.Element;
22
+ //#endregion
23
+ export { Footer, FooterProps };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { useI18n } from "../../../../contexts/i18n.js";
3
+ import { cn } from "../../../../utils/cn.js";
4
+ import { isActive } from "../../../../utils/urls.js";
5
+ import { useFooterItems } from "../../../../utils/use-footer-items.js";
6
+ import { useMemo } from "react";
7
+ import { usePathname } from "@hanzo/docs-core/framework";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import Link from "@hanzo/docs-core/link";
10
+ import { ChevronLeft, ChevronRight } from "lucide-react";
11
+ //#region src/layouts/notebook/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$1, { 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 { text } = useI18n();
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 ? text.previousPage : text.nextPage)
52
+ })]
53
+ });
54
+ }
55
+ //#endregion
56
+ export { Footer };
@@ -0,0 +1,55 @@
1
+ import { TOCProviderProps as TOCProviderProps$1 } from "../../../../components/toc/index.js";
2
+ import { ComponentProps, ReactNode } from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/layouts/notebook/page/slots/toc.d.ts
6
+ type TOCProviderProps = TOCProviderProps$1;
7
+ declare function TOCProvider(props: TOCProviderProps): react_jsx_runtime0.JSX.Element;
8
+ interface 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
+ * @defaultValue 'normal'
20
+ */
21
+ style?: 'normal' | 'clerk';
22
+ }
23
+ declare function TOC({
24
+ container,
25
+ header,
26
+ footer,
27
+ style
28
+ }: TOCProps): react_jsx_runtime0.JSX.Element;
29
+ interface TOCPopoverProps {
30
+ container?: ComponentProps<'div'>;
31
+ trigger?: ComponentProps<'button'>;
32
+ content?: ComponentProps<'div'>;
33
+ /**
34
+ * Custom content in TOC container, before the main TOC
35
+ */
36
+ header?: ReactNode;
37
+ /**
38
+ * Custom content in TOC container, after the main TOC
39
+ */
40
+ footer?: ReactNode;
41
+ /**
42
+ * @defaultValue 'normal'
43
+ */
44
+ style?: 'normal' | 'clerk';
45
+ }
46
+ declare function TOCPopover({
47
+ container,
48
+ trigger,
49
+ content,
50
+ header,
51
+ footer,
52
+ style
53
+ }: TOCPopoverProps): react_jsx_runtime0.JSX.Element;
54
+ //#endregion
55
+ export { TOC, TOCPopover, TOCPopoverProps, TOCProps, TOCProvider, TOCProviderProps };
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ import { I18nLabel, useI18n } from "../../../../contexts/i18n.js";
3
+ import { cn } from "../../../../utils/cn.js";
4
+ import { TOCProvider as TOCProvider$1, TOCScrollArea, useItems, useTOCItems } from "../../../../components/toc/index.js";
5
+ import { default_exports } from "../../../../components/toc/default.js";
6
+ import { clerk_exports } from "../../../../components/toc/clerk.js";
7
+ import { useTreePath } from "../../../../contexts/tree.js";
8
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../../components/ui/collapsible.js";
9
+ import { useNotebookLayout } from "../../client.js";
10
+ import { createContext, use, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { ChevronDown, Text } from "lucide-react";
13
+ //#region src/layouts/notebook/page/slots/toc.tsx
14
+ function TOCProvider(props) {
15
+ return /* @__PURE__ */ jsx(TOCProvider$1, { ...props });
16
+ }
17
+ function TOC({ container, header, footer, style = "normal" }) {
18
+ const items = useTOCItems();
19
+ const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
20
+ return /* @__PURE__ */ jsxs("div", {
21
+ id: "nd-toc",
22
+ ...container,
23
+ className: cn("sticky top-(--fd-docs-row-3) [grid-area:toc] h-[calc(var(--fd-docs-height)-var(--fd-docs-row-3))] flex flex-col w-(--fd-toc-width) pt-12 pe-4 pb-2 xl:layout:[--fd-toc-width:268px] max-xl:hidden", container?.className),
24
+ children: [
25
+ header,
26
+ /* @__PURE__ */ jsxs("h3", {
27
+ id: "toc-title",
28
+ className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",
29
+ children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }), /* @__PURE__ */ jsx(I18nLabel, { label: "toc" })]
30
+ }),
31
+ /* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, { children: [items.length === 0 && /* @__PURE__ */ jsx(TOCEmpty, {}), items.map((item) => /* @__PURE__ */ jsx(TOCItem, { item }, item.url))] }) }),
32
+ footer
33
+ ]
34
+ });
35
+ }
36
+ const TocPopoverContext = createContext(null);
37
+ function TOCPopover({ container, trigger, content, header, footer, style = "normal" }) {
38
+ const items = useTOCItems();
39
+ const ref = useRef(null);
40
+ const [open, setOpen] = useState(false);
41
+ const { isNavTransparent } = useNotebookLayout();
42
+ const { TOCItems, TOCItem, TOCEmpty } = style === "clerk" ? clerk_exports : default_exports;
43
+ const onClickOutside = useEffectEvent((e) => {
44
+ if (!open || !(e.target instanceof HTMLElement)) return;
45
+ if (ref.current && !ref.current.contains(e.target)) setOpen(false);
46
+ });
47
+ const onClickItem = () => {
48
+ setOpen(false);
49
+ };
50
+ useEffect(() => {
51
+ window.addEventListener("click", onClickOutside);
52
+ return () => {
53
+ window.removeEventListener("click", onClickOutside);
54
+ };
55
+ }, []);
56
+ return /* @__PURE__ */ jsx(TocPopoverContext, {
57
+ value: useMemo(() => ({
58
+ open,
59
+ setOpen
60
+ }), [setOpen, open]),
61
+ children: /* @__PURE__ */ jsx(Collapsible, {
62
+ open,
63
+ onOpenChange: setOpen,
64
+ "data-toc-popover": "",
65
+ ...container,
66
+ 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),
67
+ children: /* @__PURE__ */ jsxs("header", {
68
+ ref,
69
+ className: cn("border-b backdrop-blur-sm transition-colors", (!isNavTransparent || open) && "bg-fd-background/80", open && "shadow-lg"),
70
+ children: [/* @__PURE__ */ jsx(PageTOCPopoverTrigger, { ...trigger }), /* @__PURE__ */ jsxs(PageTOCPopoverContent, {
71
+ ...content,
72
+ children: [
73
+ header,
74
+ /* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, { children: [items.length === 0 && /* @__PURE__ */ jsx(TOCEmpty, {}), items.map((item) => /* @__PURE__ */ jsx(TOCItem, {
75
+ item,
76
+ onClick: onClickItem
77
+ }, item.url))] }) }),
78
+ footer
79
+ ]
80
+ })]
81
+ })
82
+ })
83
+ });
84
+ }
85
+ function PageTOCPopoverTrigger({ className, ...props }) {
86
+ const { text } = useI18n();
87
+ const { open } = use(TocPopoverContext);
88
+ const items = useItems();
89
+ const selectedIdx = items.findIndex((item) => item.active);
90
+ const path = useTreePath().at(-1);
91
+ const showItem = selectedIdx !== -1 && !open;
92
+ return /* @__PURE__ */ jsxs(CollapsibleTrigger, {
93
+ 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),
94
+ "data-toc-popover-trigger": "",
95
+ ...props,
96
+ children: [
97
+ /* @__PURE__ */ jsx(ProgressCircle, {
98
+ value: (selectedIdx + 1) / Math.max(1, items.length),
99
+ max: 1,
100
+ className: cn("shrink-0", open && "text-fd-primary")
101
+ }),
102
+ /* @__PURE__ */ jsxs("span", {
103
+ className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1",
104
+ children: [/* @__PURE__ */ jsx("span", {
105
+ className: cn("truncate transition-[opacity,translate,color]", open && "text-fd-foreground", showItem && "opacity-0 -translate-y-full pointer-events-none"),
106
+ children: path?.name ?? text.toc
107
+ }), /* @__PURE__ */ jsx("span", {
108
+ className: cn("truncate transition-[opacity,translate]", !showItem && "opacity-0 translate-y-full pointer-events-none"),
109
+ children: items[selectedIdx]?.original.title
110
+ })]
111
+ }),
112
+ /* @__PURE__ */ jsx(ChevronDown, { className: cn("shrink-0 transition-transform mx-0.5", open && "rotate-180") })
113
+ ]
114
+ });
115
+ }
116
+ function clamp(input, min, max) {
117
+ if (input < min) return min;
118
+ if (input > max) return max;
119
+ return input;
120
+ }
121
+ function ProgressCircle({ value, strokeWidth = 2, size = 24, min = 0, max = 100, ...restSvgProps }) {
122
+ const normalizedValue = clamp(value, min, max);
123
+ const radius = (size - strokeWidth) / 2;
124
+ const circumference = 2 * Math.PI * radius;
125
+ const progress = normalizedValue / max * circumference;
126
+ const circleProps = {
127
+ cx: size / 2,
128
+ cy: size / 2,
129
+ r: radius,
130
+ fill: "none",
131
+ strokeWidth
132
+ };
133
+ return /* @__PURE__ */ jsxs("svg", {
134
+ role: "progressbar",
135
+ viewBox: `0 0 ${size} ${size}`,
136
+ "aria-valuenow": normalizedValue,
137
+ "aria-valuemin": min,
138
+ "aria-valuemax": max,
139
+ ...restSvgProps,
140
+ children: [/* @__PURE__ */ jsx("circle", {
141
+ ...circleProps,
142
+ className: "stroke-current/25"
143
+ }), /* @__PURE__ */ jsx("circle", {
144
+ ...circleProps,
145
+ stroke: "currentColor",
146
+ strokeDasharray: circumference,
147
+ strokeDashoffset: circumference - progress,
148
+ strokeLinecap: "round",
149
+ transform: `rotate(-90 ${size / 2} ${size / 2})`,
150
+ className: "transition-all"
151
+ })]
152
+ });
153
+ }
154
+ function PageTOCPopoverContent(props) {
155
+ return /* @__PURE__ */ jsx(CollapsibleContent, {
156
+ "data-toc-popover-content": "",
157
+ ...props,
158
+ children: /* @__PURE__ */ jsx("div", {
159
+ className: "flex flex-col px-4 max-h-[50vh] md:px-6",
160
+ children: props.children
161
+ })
162
+ });
163
+ }
164
+ //#endregion
165
+ export { TOC, TOCPopover, TOCProvider };
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from "react";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/layouts/notebook/slots/container.d.ts
5
+ declare function Container(props: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
6
+ //#endregion
7
+ export { Container };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { cn } from "../../../utils/cn.js";
3
+ import { useNotebookLayout } from "../client.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/layouts/notebook/slots/container.tsx
6
+ function Container(props) {
7
+ const { props: { nav }, slots } = useNotebookLayout();
8
+ const pageCol = "calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-col) - var(--fd-toc-width))";
9
+ const { collapsed } = slots.sidebar?.useSidebar?.() ?? {};
10
+ return /* @__PURE__ */ jsx("div", {
11
+ id: "nd-notebook-layout",
12
+ "data-sidebar-collapsed": collapsed,
13
+ ...props,
14
+ style: {
15
+ gridTemplate: nav?.mode === "top" ? `". header header header ."
16
+ "sidebar sidebar toc-popover toc-popover ."
17
+ "sidebar sidebar main toc ." 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)` : `"sidebar sidebar header header ."
18
+ "sidebar sidebar toc-popover toc-popover ."
19
+ "sidebar sidebar main toc ." 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)`,
20
+ "--fd-docs-row-1": "var(--fd-banner-height, 0px)",
21
+ "--fd-docs-row-2": "calc(var(--fd-docs-row-1) + var(--fd-header-height))",
22
+ "--fd-docs-row-3": "calc(var(--fd-docs-row-2) + var(--fd-toc-popover-height))",
23
+ "--fd-sidebar-col": collapsed ? "0px" : "var(--fd-sidebar-width)",
24
+ ...props.style
25
+ },
26
+ className: cn("grid overflow-x-clip min-h-(--fd-docs-height) transition-[grid-template-columns] auto-cols-auto auto-rows-auto [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]", props.className),
27
+ children: props.children
28
+ });
29
+ }
30
+ //#endregion
31
+ export { Container };
@@ -0,0 +1,8 @@
1
+ import * as react from "react";
2
+ import { ComponentProps } from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/layouts/notebook/slots/header.d.ts
6
+ declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | react_jsx_runtime0.JSX.Element | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined>;
7
+ //#endregion
8
+ export { Header };
@@ -0,0 +1,194 @@
1
+ "use client";
2
+ import { cn } from "../../../utils/cn.js";
3
+ import { buttonVariants } from "../../../components/ui/button.js";
4
+ import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.js";
5
+ import { LinkItem } from "../../shared/client.js";
6
+ import { isLayoutTabActive } from "../../shared/index.js";
7
+ import { useNotebookLayout } from "../client.js";
8
+ import { Fragment, useMemo, useRef, useState } from "react";
9
+ import { usePathname } from "@hanzo/docs-core/framework";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import Link from "@hanzo/docs-core/link";
12
+ import { ChevronDown, Languages, Sidebar } from "lucide-react";
13
+ //#region src/layouts/notebook/slots/header.tsx
14
+ function Header(props) {
15
+ const { slots, navItems, isNavTransparent, props: { tabMode, nav, tabs, sidebar } } = useNotebookLayout();
16
+ const { open } = slots.sidebar?.useSidebar?.() ?? {};
17
+ const navMode = nav?.mode ?? "auto";
18
+ const sidebarCollapsible = sidebar.collapsible ?? true;
19
+ const showLayoutTabs = tabMode === "navbar" && tabs.length > 0;
20
+ if (nav?.component) return nav.component;
21
+ return /* @__PURE__ */ jsxs("header", {
22
+ id: "nd-subnav",
23
+ "data-transparent": isNavTransparent && !open,
24
+ ...props,
25
+ className: cn("sticky [grid-area:header] flex flex-col top-(--fd-docs-row-1) z-10 backdrop-blur-sm transition-colors data-[transparent=false]:bg-fd-background/80 layout:[--fd-header-height:--spacing(14)]", showLayoutTabs && "lg:layout:[--fd-header-height:--spacing(24)]", props.className),
26
+ children: [/* @__PURE__ */ jsxs("div", {
27
+ "data-header-body": "",
28
+ className: "flex border-b px-4 gap-2 h-14 md:px-6",
29
+ children: [
30
+ /* @__PURE__ */ jsxs("div", {
31
+ className: cn("items-center", navMode === "top" && "flex flex-1", navMode === "auto" && "hidden has-data-[collapsed=true]:md:flex max-md:flex"),
32
+ children: [
33
+ sidebarCollapsible && slots.sidebar && navMode === "auto" && /* @__PURE__ */ jsx(slots.sidebar.collapseTrigger, {
34
+ className: cn(buttonVariants({
35
+ color: "ghost",
36
+ size: "icon-sm"
37
+ }), "text-fd-muted-foreground data-[collapsed=false]:hidden max-md:hidden"),
38
+ children: /* @__PURE__ */ jsx(Sidebar, {})
39
+ }),
40
+ slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: cn("inline-flex items-center gap-2.5 font-semibold", navMode === "auto" && "md:hidden") }),
41
+ nav?.children
42
+ ]
43
+ }),
44
+ slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.full, {
45
+ hideIfDisabled: true,
46
+ className: cn("w-full my-auto max-md:hidden", navMode === "top" ? "ps-2.5 rounded-xl max-w-sm" : "max-w-[240px]")
47
+ }),
48
+ /* @__PURE__ */ jsxs("div", {
49
+ className: "flex flex-1 items-center justify-end md:gap-2",
50
+ children: [
51
+ /* @__PURE__ */ jsx("div", {
52
+ className: "flex items-center gap-6 empty:hidden max-lg:hidden",
53
+ children: navItems.filter((item) => item.type !== "icon").map((item, i) => /* @__PURE__ */ jsx(NavbarLinkItem, { item }, i))
54
+ }),
55
+ navItems.filter((item) => item.type === "icon").map((item, i) => /* @__PURE__ */ jsx(LinkItem, {
56
+ item,
57
+ className: cn(buttonVariants({
58
+ size: "icon-sm",
59
+ color: "ghost"
60
+ }), "text-fd-muted-foreground max-lg:hidden"),
61
+ "aria-label": item.label,
62
+ children: item.icon
63
+ }, i)),
64
+ /* @__PURE__ */ jsxs("div", {
65
+ className: "flex items-center md:hidden",
66
+ children: [slots.searchTrigger && /* @__PURE__ */ jsx(slots.searchTrigger.sm, {
67
+ hideIfDisabled: true,
68
+ className: "p-2"
69
+ }), slots.sidebar && /* @__PURE__ */ jsx(slots.sidebar.trigger, {
70
+ className: cn(buttonVariants({
71
+ color: "ghost",
72
+ size: "icon-sm",
73
+ className: "p-2 -me-1.5"
74
+ })),
75
+ children: /* @__PURE__ */ jsx(Sidebar, {})
76
+ })]
77
+ }),
78
+ /* @__PURE__ */ jsxs("div", {
79
+ className: "flex items-center gap-2 max-md:hidden",
80
+ children: [
81
+ slots.languageSelect && /* @__PURE__ */ jsx(slots.languageSelect.root, { children: /* @__PURE__ */ jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) }),
82
+ slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {}),
83
+ sidebarCollapsible && slots.sidebar && navMode === "top" && /* @__PURE__ */ jsx(slots.sidebar.collapseTrigger, {
84
+ className: cn(buttonVariants({
85
+ color: "secondary",
86
+ size: "icon-sm"
87
+ }), "text-fd-muted-foreground rounded-full -me-1.5"),
88
+ children: /* @__PURE__ */ jsx(Sidebar, {})
89
+ })
90
+ ]
91
+ })
92
+ ]
93
+ })
94
+ ]
95
+ }), showLayoutTabs && /* @__PURE__ */ jsx(LayoutHeaderTabs, {
96
+ "data-header-tabs": "",
97
+ className: "overflow-x-auto border-b px-6 h-10 max-lg:hidden",
98
+ tabs
99
+ })]
100
+ });
101
+ }
102
+ function LayoutHeaderTabs({ tabs, className, ...props }) {
103
+ const pathname = usePathname();
104
+ const selectedIdx = useMemo(() => {
105
+ return tabs.findLastIndex((option) => isLayoutTabActive(option, pathname));
106
+ }, [tabs, pathname]);
107
+ return /* @__PURE__ */ jsx("div", {
108
+ className: cn("flex flex-row items-end gap-6", className),
109
+ ...props,
110
+ children: tabs.map((option, i) => {
111
+ const { title, url, unlisted, props: { className, ...rest } = {} } = option;
112
+ const isSelected = selectedIdx === i;
113
+ return /* @__PURE__ */ jsx(Link, {
114
+ href: url,
115
+ className: cn("inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground", unlisted && !isSelected && "hidden", isSelected && "border-fd-primary text-fd-primary", className),
116
+ ...rest,
117
+ children: title
118
+ }, i);
119
+ })
120
+ });
121
+ }
122
+ function NavbarLinkItem({ item, className, ...props }) {
123
+ if (item.type === "custom") return item.children;
124
+ if (item.type === "menu") return /* @__PURE__ */ jsx(NavbarLinkItemMenu, {
125
+ item,
126
+ className,
127
+ ...props
128
+ });
129
+ return /* @__PURE__ */ jsx(LinkItem, {
130
+ item,
131
+ className: cn("text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary", className),
132
+ ...props,
133
+ children: item.text
134
+ });
135
+ }
136
+ function NavbarLinkItemMenu({ item, hoverDelay = 50, className, ...props }) {
137
+ const [open, setOpen] = useState(false);
138
+ const timeoutRef = useRef(null);
139
+ const freezeUntil = useRef(null);
140
+ const delaySetOpen = (value) => {
141
+ if (timeoutRef.current) {
142
+ clearTimeout(timeoutRef.current);
143
+ timeoutRef.current = null;
144
+ }
145
+ timeoutRef.current = window.setTimeout(() => {
146
+ setOpen(value);
147
+ freezeUntil.current = Date.now() + 300;
148
+ }, hoverDelay);
149
+ };
150
+ const onPointerEnter = (e) => {
151
+ if (e.pointerType === "touch") return;
152
+ delaySetOpen(true);
153
+ };
154
+ const onPointerLeave = (e) => {
155
+ if (e.pointerType === "touch") return;
156
+ delaySetOpen(false);
157
+ };
158
+ function isTouchDevice() {
159
+ return "ontouchstart" in window || navigator.maxTouchPoints > 0;
160
+ }
161
+ return /* @__PURE__ */ jsxs(Popover, {
162
+ open,
163
+ onOpenChange: (value) => {
164
+ if (freezeUntil.current === null || Date.now() >= freezeUntil.current) setOpen(value);
165
+ },
166
+ children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
167
+ className: cn("inline-flex items-center gap-1.5 p-1 text-sm text-fd-muted-foreground transition-colors has-data-[active=true]:text-fd-primary data-[state=open]:text-fd-accent-foreground focus-visible:outline-none", className),
168
+ onPointerEnter,
169
+ onPointerLeave,
170
+ ...props,
171
+ children: [item.url ? /* @__PURE__ */ jsx(LinkItem, {
172
+ item,
173
+ children: item.text
174
+ }) : item.text, /* @__PURE__ */ jsx(ChevronDown, { className: "size-3" })]
175
+ }), /* @__PURE__ */ jsx(PopoverContent, {
176
+ className: "flex flex-col p-1 text-fd-muted-foreground text-start",
177
+ onPointerEnter,
178
+ onPointerLeave,
179
+ children: item.items.map((child, i) => {
180
+ if (child.type === "custom") return /* @__PURE__ */ jsx(Fragment, { children: child.children }, i);
181
+ return /* @__PURE__ */ jsxs(LinkItem, {
182
+ item: child,
183
+ className: "inline-flex items-center gap-2 rounded-md p-2 transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground data-[active=true]:text-fd-primary [&_svg]:size-4",
184
+ onClick: () => {
185
+ if (isTouchDevice()) setOpen(false);
186
+ },
187
+ children: [child.icon, child.text]
188
+ }, i);
189
+ })
190
+ })]
191
+ });
192
+ }
193
+ //#endregion
194
+ export { Header };
@@ -0,0 +1,40 @@
1
+ import { SidebarProviderProps as SidebarProviderProps$1, useSidebar as useSidebar$1 } from "../../../components/sidebar/base.js";
2
+ import { LayoutTab } from "../../shared/index.js";
3
+ import { SidebarPageTreeComponents } from "../../../components/sidebar/page-tree.js";
4
+ import { ComponentProps, FC, ReactNode } from "react";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+
7
+ //#region src/layouts/notebook/slots/sidebar.d.ts
8
+ interface SidebarProps extends ComponentProps<'aside'> {
9
+ components?: Partial<SidebarPageTreeComponents>;
10
+ banner?: ReactNode | FC<ComponentProps<'div'>>;
11
+ footer?: ReactNode | FC<ComponentProps<'div'>>;
12
+ /**
13
+ * Support collapsing the sidebar on desktop mode
14
+ *
15
+ * @defaultValue true
16
+ */
17
+ collapsible?: boolean;
18
+ }
19
+ type SidebarProviderProps = SidebarProviderProps$1;
20
+ declare const useSidebar: typeof useSidebar$1;
21
+ declare function SidebarProvider(props: SidebarProviderProps): react_jsx_runtime0.JSX.Element;
22
+ declare function SidebarTrigger(props: ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
23
+ declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
24
+ declare function Sidebar({
25
+ banner,
26
+ footer,
27
+ components,
28
+ collapsible,
29
+ ...rest
30
+ }: SidebarProps): react_jsx_runtime0.JSX.Element;
31
+ declare function SidebarTabsDropdown({
32
+ options,
33
+ placeholder,
34
+ ...props
35
+ }: {
36
+ placeholder?: ReactNode;
37
+ options: LayoutTab[];
38
+ } & ComponentProps<'button'>): react_jsx_runtime0.JSX.Element;
39
+ //#endregion
40
+ export { Sidebar, SidebarCollapseTrigger, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarTabsDropdown, SidebarTrigger, useSidebar };