@hanzo/docs-base-ui 16.5.3 → 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 (371) hide show
  1. package/css/generated/docs.css +68 -33
  2. package/css/generated/flux.css +44 -34
  3. package/css/generated/home.css +88 -4
  4. package/css/generated/notebook.css +65 -31
  5. package/css/generated/shared.css +199 -59
  6. package/css/lib/base.css +1 -4
  7. package/css/lib/shiki.css +49 -41
  8. package/css/preset.css +3 -0
  9. package/dist/_virtual/_rolldown/runtime.js +6 -11
  10. package/dist/components/accordion.d.ts +1 -2
  11. package/dist/components/accordion.js +3 -7
  12. package/dist/components/banner.d.ts +1 -2
  13. package/dist/components/banner.js +1 -5
  14. package/dist/components/callout.d.ts +1 -2
  15. package/dist/components/callout.js +0 -3
  16. package/dist/components/card.d.ts +1 -2
  17. package/dist/components/card.js +0 -3
  18. package/dist/components/codeblock.d.ts +1 -2
  19. package/dist/components/codeblock.js +2 -6
  20. package/dist/components/codeblock.rsc.d.ts +21 -0
  21. package/dist/components/codeblock.rsc.js +22 -0
  22. package/dist/components/dialog/search-algolia.d.ts +1 -3
  23. package/dist/components/dialog/search-algolia.js +1 -5
  24. package/dist/components/dialog/search-default.d.ts +1 -3
  25. package/dist/components/dialog/search-default.js +1 -5
  26. package/dist/components/dialog/search-orama.d.ts +1 -3
  27. package/dist/components/dialog/search-orama.js +1 -5
  28. package/dist/components/dialog/search.d.ts +5 -5
  29. package/dist/components/dialog/search.js +124 -47
  30. package/dist/components/dynamic-codeblock.core.d.ts +7 -5
  31. package/dist/components/dynamic-codeblock.core.js +17 -32
  32. package/dist/components/dynamic-codeblock.d.ts +5 -3
  33. package/dist/components/dynamic-codeblock.js +8 -13
  34. package/dist/components/files.d.ts +1 -2
  35. package/dist/components/files.js +4 -8
  36. package/dist/components/github-info.d.ts +22 -9
  37. package/dist/components/github-info.js +33 -28
  38. package/dist/components/heading.d.ts +1 -2
  39. package/dist/components/heading.js +2 -5
  40. package/dist/components/image-zoom.d.ts +1 -2
  41. package/dist/components/image-zoom.js +2 -5
  42. package/dist/components/inline-toc.d.ts +1 -2
  43. package/dist/components/inline-toc.js +1 -5
  44. package/dist/components/sidebar/base.d.ts +7 -3
  45. package/dist/components/sidebar/base.js +6 -16
  46. package/dist/components/sidebar/link-item.d.ts +2 -3
  47. package/dist/components/sidebar/link-item.js +6 -3
  48. package/dist/components/sidebar/page-tree.d.ts +1 -2
  49. package/dist/components/sidebar/page-tree.js +54 -43
  50. package/dist/components/sidebar/tabs/dropdown.d.ts +4 -7
  51. package/dist/components/sidebar/tabs/dropdown.js +4 -11
  52. package/dist/components/sidebar/tabs/index.d.ts +3 -17
  53. package/dist/components/sidebar/tabs/index.js +0 -3
  54. package/dist/components/steps.d.ts +1 -2
  55. package/dist/components/steps.js +0 -3
  56. package/dist/components/tabs.d.ts +11 -7
  57. package/dist/components/tabs.js +13 -18
  58. package/dist/components/toc/clerk.d.ts +9 -2
  59. package/dist/components/toc/clerk.js +117 -62
  60. package/dist/components/toc/default.d.ts +9 -2
  61. package/dist/components/toc/default.js +28 -21
  62. package/dist/components/toc/index.d.ts +8 -5
  63. package/dist/components/toc/index.js +50 -25
  64. package/dist/components/type-table.d.ts +10 -5
  65. package/dist/components/type-table.js +22 -17
  66. package/dist/components/ui/accordion.d.ts +1 -2
  67. package/dist/components/ui/accordion.js +1 -5
  68. package/dist/components/ui/button.d.ts +2 -3
  69. package/dist/components/ui/button.js +0 -3
  70. package/dist/components/ui/collapsible.d.ts +1 -2
  71. package/dist/components/ui/collapsible.js +2 -6
  72. package/dist/components/ui/navigation-menu.d.ts +26 -12
  73. package/dist/components/ui/navigation-menu.js +52 -30
  74. package/dist/components/ui/popover.d.ts +10 -5
  75. package/dist/components/ui/popover.js +14 -18
  76. package/dist/components/ui/scroll-area.d.ts +17 -7
  77. package/dist/components/ui/scroll-area.js +26 -30
  78. package/dist/components/ui/tabs.d.ts +1 -2
  79. package/dist/components/ui/tabs.js +1 -5
  80. package/dist/contexts/i18n.d.ts +7 -5
  81. package/dist/contexts/i18n.js +3 -8
  82. package/dist/contexts/search.d.ts +2 -2
  83. package/dist/contexts/search.js +4 -6
  84. package/dist/contexts/tree.d.ts +1 -2
  85. package/dist/contexts/tree.js +1 -5
  86. package/dist/i18n.d.ts +16 -9
  87. package/dist/i18n.js +14 -14
  88. package/dist/layouts/docs/client.d.ts +30 -29
  89. package/dist/layouts/docs/client.js +72 -48
  90. package/dist/layouts/docs/index.d.ts +19 -33
  91. package/dist/layouts/docs/index.js +16 -172
  92. package/dist/layouts/docs/page/index.d.ts +67 -55
  93. package/dist/layouts/docs/page/index.js +74 -54
  94. package/dist/layouts/docs/page/slots/breadcrumb.d.ts +14 -0
  95. package/dist/layouts/docs/page/slots/breadcrumb.js +44 -0
  96. package/dist/layouts/docs/page/slots/container.d.ts +7 -0
  97. package/dist/layouts/docs/page/slots/container.js +17 -0
  98. package/dist/layouts/docs/page/slots/footer.d.ts +23 -0
  99. package/dist/layouts/docs/page/slots/footer.js +56 -0
  100. package/dist/layouts/docs/page/slots/toc.d.ts +55 -0
  101. package/dist/layouts/docs/page/slots/toc.js +166 -0
  102. package/dist/layouts/docs/slots/container.d.ts +7 -0
  103. package/dist/layouts/docs/slots/container.js +29 -0
  104. package/dist/layouts/docs/slots/header.d.ts +8 -0
  105. package/dist/layouts/docs/slots/header.js +38 -0
  106. package/dist/layouts/docs/slots/sidebar.d.ts +30 -0
  107. package/dist/layouts/docs/slots/sidebar.js +319 -0
  108. package/dist/layouts/flux/index.d.ts +34 -39
  109. package/dist/layouts/flux/index.js +77 -99
  110. package/dist/layouts/flux/page/index.d.ts +56 -49
  111. package/dist/layouts/flux/page/index.js +63 -35
  112. package/dist/layouts/flux/page/slots/breadcrumb.d.ts +14 -0
  113. package/dist/layouts/flux/page/slots/breadcrumb.js +44 -0
  114. package/dist/layouts/flux/page/slots/container.d.ts +7 -0
  115. package/dist/layouts/flux/page/slots/container.js +17 -0
  116. package/dist/layouts/flux/page/slots/footer.d.ts +23 -0
  117. package/dist/layouts/flux/page/slots/footer.js +56 -0
  118. package/dist/layouts/flux/page/slots/toc.d.ts +34 -0
  119. package/dist/layouts/flux/page/slots/toc.js +172 -0
  120. package/dist/layouts/flux/slots/container.d.ts +7 -0
  121. package/dist/layouts/flux/slots/container.js +13 -0
  122. package/dist/layouts/flux/slots/sidebar.d.ts +23 -0
  123. package/dist/layouts/flux/{sidebar.js → slots/sidebar.js} +74 -34
  124. package/dist/layouts/flux/slots/tab-dropdown.d.ts +17 -0
  125. package/dist/layouts/flux/{tab-dropdown.js → slots/tab-dropdown.js} +13 -24
  126. package/dist/layouts/home/index.d.ts +24 -7
  127. package/dist/layouts/home/index.js +39 -19
  128. package/dist/layouts/home/navbar.d.ts +5 -14
  129. package/dist/layouts/home/navbar.js +10 -12
  130. package/dist/layouts/home/not-found.d.ts +9 -0
  131. package/dist/layouts/home/not-found.js +38 -0
  132. package/dist/layouts/home/slots/container.d.ts +7 -0
  133. package/dist/layouts/home/slots/container.js +13 -0
  134. package/dist/layouts/home/slots/header.d.ts +11 -0
  135. package/dist/layouts/home/slots/header.js +242 -0
  136. package/dist/layouts/notebook/client.d.ts +32 -44
  137. package/dist/layouts/notebook/client.js +57 -147
  138. package/dist/layouts/notebook/index.d.ts +25 -24
  139. package/dist/layouts/notebook/index.js +16 -212
  140. package/dist/layouts/notebook/page/index.d.ts +67 -55
  141. package/dist/layouts/notebook/page/index.js +74 -54
  142. package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +14 -0
  143. package/dist/layouts/notebook/page/slots/breadcrumb.js +44 -0
  144. package/dist/layouts/notebook/page/slots/container.d.ts +7 -0
  145. package/dist/layouts/notebook/page/slots/container.js +17 -0
  146. package/dist/layouts/notebook/page/slots/footer.d.ts +23 -0
  147. package/dist/layouts/notebook/page/slots/footer.js +56 -0
  148. package/dist/layouts/notebook/page/slots/toc.d.ts +55 -0
  149. package/dist/layouts/notebook/page/slots/toc.js +165 -0
  150. package/dist/layouts/notebook/slots/container.d.ts +7 -0
  151. package/dist/layouts/notebook/slots/container.js +31 -0
  152. package/dist/layouts/notebook/slots/header.d.ts +8 -0
  153. package/dist/layouts/notebook/slots/header.js +194 -0
  154. package/dist/layouts/notebook/slots/sidebar.d.ts +40 -0
  155. package/dist/layouts/notebook/slots/sidebar.js +297 -0
  156. package/dist/layouts/shared/client.d.ts +45 -0
  157. package/dist/layouts/shared/client.js +84 -0
  158. package/dist/layouts/shared/index.d.ts +136 -34
  159. package/dist/layouts/shared/index.js +49 -17
  160. package/dist/layouts/shared/page-actions.d.ts +36 -0
  161. package/dist/layouts/shared/page-actions.js +190 -0
  162. package/dist/layouts/shared/slots/language-select.d.ts +10 -0
  163. package/dist/layouts/shared/{language-toggle.js → slots/language-select.js} +11 -15
  164. package/dist/layouts/shared/slots/search-trigger.d.ts +23 -0
  165. package/dist/layouts/shared/{search-toggle.js → slots/search-trigger.js} +9 -13
  166. package/dist/layouts/shared/slots/theme-switch.d.ts +14 -0
  167. package/dist/layouts/shared/{theme-toggle.js → slots/theme-switch.js} +5 -9
  168. package/dist/mdx.d.ts +13 -3
  169. package/dist/mdx.js +0 -4
  170. package/dist/mdx.server.d.ts +1 -2
  171. package/dist/mdx.server.js +0 -3
  172. package/dist/og/takumi.d.ts +21 -0
  173. package/dist/og/takumi.js +70 -0
  174. package/dist/og.d.ts +1 -2
  175. package/dist/og.js +6 -6
  176. package/dist/page.d.ts +3 -4
  177. package/dist/page.js +6 -11
  178. package/dist/provider/base.d.ts +1 -2
  179. package/dist/provider/base.js +2 -6
  180. package/dist/provider/next.d.ts +1 -2
  181. package/dist/provider/next.js +1 -5
  182. package/dist/provider/react-router.d.ts +1 -2
  183. package/dist/provider/react-router.js +1 -5
  184. package/dist/provider/tanstack.d.ts +1 -2
  185. package/dist/provider/tanstack.js +1 -5
  186. package/dist/provider/waku.d.ts +1 -2
  187. package/dist/provider/waku.js +1 -5
  188. package/dist/style.css +433 -166
  189. package/dist/tailwind/typography.d.ts +2 -0
  190. package/dist/tailwind/typography.js +2 -0
  191. package/dist/utils/cn.js +1 -2
  192. package/dist/utils/merge-refs.js +0 -2
  193. package/dist/utils/urls.js +1 -3
  194. package/dist/utils/use-copy-button.d.ts +1 -2
  195. package/dist/utils/use-copy-button.js +1 -5
  196. package/dist/utils/use-footer-items.d.ts +1 -2
  197. package/dist/utils/use-footer-items.js +4 -8
  198. package/dist/utils/use-is-scroll-top.d.ts +1 -2
  199. package/dist/utils/use-is-scroll-top.js +1 -5
  200. package/package.json +139 -103
  201. package/LICENSE +0 -21
  202. package/dist/components/accordion.d.ts.map +0 -1
  203. package/dist/components/accordion.js.map +0 -1
  204. package/dist/components/banner.d.ts.map +0 -1
  205. package/dist/components/banner.js.map +0 -1
  206. package/dist/components/callout.d.ts.map +0 -1
  207. package/dist/components/callout.js.map +0 -1
  208. package/dist/components/card.d.ts.map +0 -1
  209. package/dist/components/card.js.map +0 -1
  210. package/dist/components/codeblock.d.ts.map +0 -1
  211. package/dist/components/codeblock.js.map +0 -1
  212. package/dist/components/dialog/search-algolia.d.ts.map +0 -1
  213. package/dist/components/dialog/search-algolia.js.map +0 -1
  214. package/dist/components/dialog/search-default.d.ts.map +0 -1
  215. package/dist/components/dialog/search-default.js.map +0 -1
  216. package/dist/components/dialog/search-orama.d.ts.map +0 -1
  217. package/dist/components/dialog/search-orama.js.map +0 -1
  218. package/dist/components/dialog/search.d.ts.map +0 -1
  219. package/dist/components/dialog/search.js.map +0 -1
  220. package/dist/components/dynamic-codeblock.core.d.ts.map +0 -1
  221. package/dist/components/dynamic-codeblock.core.js.map +0 -1
  222. package/dist/components/dynamic-codeblock.d.ts.map +0 -1
  223. package/dist/components/dynamic-codeblock.js.map +0 -1
  224. package/dist/components/files.d.ts.map +0 -1
  225. package/dist/components/files.js.map +0 -1
  226. package/dist/components/github-info.d.ts.map +0 -1
  227. package/dist/components/github-info.js.map +0 -1
  228. package/dist/components/heading.d.ts.map +0 -1
  229. package/dist/components/heading.js.map +0 -1
  230. package/dist/components/image-zoom-DGvp66QF.css +0 -80
  231. package/dist/components/image-zoom-DGvp66QF.css.map +0 -1
  232. package/dist/components/image-zoom.d.ts.map +0 -1
  233. package/dist/components/image-zoom.js.map +0 -1
  234. package/dist/components/image-zoom2.js +0 -1
  235. package/dist/components/inline-toc.d.ts.map +0 -1
  236. package/dist/components/inline-toc.js.map +0 -1
  237. package/dist/components/sidebar/base.d.ts.map +0 -1
  238. package/dist/components/sidebar/base.js.map +0 -1
  239. package/dist/components/sidebar/link-item.d.ts.map +0 -1
  240. package/dist/components/sidebar/link-item.js.map +0 -1
  241. package/dist/components/sidebar/page-tree.d.ts.map +0 -1
  242. package/dist/components/sidebar/page-tree.js.map +0 -1
  243. package/dist/components/sidebar/tabs/dropdown.d.ts.map +0 -1
  244. package/dist/components/sidebar/tabs/dropdown.js.map +0 -1
  245. package/dist/components/sidebar/tabs/index.d.ts.map +0 -1
  246. package/dist/components/sidebar/tabs/index.js.map +0 -1
  247. package/dist/components/steps.d.ts.map +0 -1
  248. package/dist/components/steps.js.map +0 -1
  249. package/dist/components/tabs.d.ts.map +0 -1
  250. package/dist/components/tabs.js.map +0 -1
  251. package/dist/components/toc/clerk.d.ts.map +0 -1
  252. package/dist/components/toc/clerk.js.map +0 -1
  253. package/dist/components/toc/default.d.ts.map +0 -1
  254. package/dist/components/toc/default.js.map +0 -1
  255. package/dist/components/toc/index.d.ts.map +0 -1
  256. package/dist/components/toc/index.js.map +0 -1
  257. package/dist/components/type-table.d.ts.map +0 -1
  258. package/dist/components/type-table.js.map +0 -1
  259. package/dist/components/ui/accordion.d.ts.map +0 -1
  260. package/dist/components/ui/accordion.js.map +0 -1
  261. package/dist/components/ui/button.d.ts.map +0 -1
  262. package/dist/components/ui/button.js.map +0 -1
  263. package/dist/components/ui/collapsible.d.ts.map +0 -1
  264. package/dist/components/ui/collapsible.js.map +0 -1
  265. package/dist/components/ui/navigation-menu.d.ts.map +0 -1
  266. package/dist/components/ui/navigation-menu.js.map +0 -1
  267. package/dist/components/ui/popover.d.ts.map +0 -1
  268. package/dist/components/ui/popover.js.map +0 -1
  269. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  270. package/dist/components/ui/scroll-area.js.map +0 -1
  271. package/dist/components/ui/tabs.d.ts.map +0 -1
  272. package/dist/components/ui/tabs.js.map +0 -1
  273. package/dist/contexts/i18n.d.ts.map +0 -1
  274. package/dist/contexts/i18n.js.map +0 -1
  275. package/dist/contexts/search.d.ts.map +0 -1
  276. package/dist/contexts/search.js.map +0 -1
  277. package/dist/contexts/tree.d.ts.map +0 -1
  278. package/dist/contexts/tree.js.map +0 -1
  279. package/dist/i18n.d.ts.map +0 -1
  280. package/dist/i18n.js.map +0 -1
  281. package/dist/layouts/docs/client.d.ts.map +0 -1
  282. package/dist/layouts/docs/client.js.map +0 -1
  283. package/dist/layouts/docs/index.d.ts.map +0 -1
  284. package/dist/layouts/docs/index.js.map +0 -1
  285. package/dist/layouts/docs/page/client.d.ts +0 -48
  286. package/dist/layouts/docs/page/client.d.ts.map +0 -1
  287. package/dist/layouts/docs/page/client.js +0 -227
  288. package/dist/layouts/docs/page/client.js.map +0 -1
  289. package/dist/layouts/docs/page/index.d.ts.map +0 -1
  290. package/dist/layouts/docs/page/index.js.map +0 -1
  291. package/dist/layouts/docs/sidebar.d.ts +0 -64
  292. package/dist/layouts/docs/sidebar.d.ts.map +0 -1
  293. package/dist/layouts/docs/sidebar.js +0 -162
  294. package/dist/layouts/docs/sidebar.js.map +0 -1
  295. package/dist/layouts/flux/index.d.ts.map +0 -1
  296. package/dist/layouts/flux/index.js.map +0 -1
  297. package/dist/layouts/flux/page/client.d.ts +0 -45
  298. package/dist/layouts/flux/page/client.d.ts.map +0 -1
  299. package/dist/layouts/flux/page/client.js +0 -255
  300. package/dist/layouts/flux/page/client.js.map +0 -1
  301. package/dist/layouts/flux/page/index.d.ts.map +0 -1
  302. package/dist/layouts/flux/page/index.js.map +0 -1
  303. package/dist/layouts/flux/sidebar.d.ts +0 -59
  304. package/dist/layouts/flux/sidebar.d.ts.map +0 -1
  305. package/dist/layouts/flux/sidebar.js.map +0 -1
  306. package/dist/layouts/flux/tab-dropdown.d.ts +0 -21
  307. package/dist/layouts/flux/tab-dropdown.d.ts.map +0 -1
  308. package/dist/layouts/flux/tab-dropdown.js.map +0 -1
  309. package/dist/layouts/home/client.d.ts +0 -19
  310. package/dist/layouts/home/client.d.ts.map +0 -1
  311. package/dist/layouts/home/client.js +0 -267
  312. package/dist/layouts/home/client.js.map +0 -1
  313. package/dist/layouts/home/index.d.ts.map +0 -1
  314. package/dist/layouts/home/index.js.map +0 -1
  315. package/dist/layouts/home/navbar.d.ts.map +0 -1
  316. package/dist/layouts/home/navbar.js.map +0 -1
  317. package/dist/layouts/notebook/client.d.ts.map +0 -1
  318. package/dist/layouts/notebook/client.js.map +0 -1
  319. package/dist/layouts/notebook/index.d.ts.map +0 -1
  320. package/dist/layouts/notebook/index.js.map +0 -1
  321. package/dist/layouts/notebook/page/client.d.ts +0 -48
  322. package/dist/layouts/notebook/page/client.d.ts.map +0 -1
  323. package/dist/layouts/notebook/page/client.js +0 -227
  324. package/dist/layouts/notebook/page/client.js.map +0 -1
  325. package/dist/layouts/notebook/page/index.d.ts.map +0 -1
  326. package/dist/layouts/notebook/page/index.js.map +0 -1
  327. package/dist/layouts/notebook/sidebar.d.ts +0 -60
  328. package/dist/layouts/notebook/sidebar.d.ts.map +0 -1
  329. package/dist/layouts/notebook/sidebar.js +0 -133
  330. package/dist/layouts/notebook/sidebar.js.map +0 -1
  331. package/dist/layouts/shared/index.d.ts.map +0 -1
  332. package/dist/layouts/shared/index.js.map +0 -1
  333. package/dist/layouts/shared/language-toggle.d.ts +0 -10
  334. package/dist/layouts/shared/language-toggle.d.ts.map +0 -1
  335. package/dist/layouts/shared/language-toggle.js.map +0 -1
  336. package/dist/layouts/shared/search-toggle.d.ts +0 -23
  337. package/dist/layouts/shared/search-toggle.d.ts.map +0 -1
  338. package/dist/layouts/shared/search-toggle.js.map +0 -1
  339. package/dist/layouts/shared/theme-toggle.d.ts +0 -14
  340. package/dist/layouts/shared/theme-toggle.d.ts.map +0 -1
  341. package/dist/layouts/shared/theme-toggle.js.map +0 -1
  342. package/dist/mdx.d.ts.map +0 -1
  343. package/dist/mdx.js.map +0 -1
  344. package/dist/mdx.server.d.ts.map +0 -1
  345. package/dist/mdx.server.js.map +0 -1
  346. package/dist/og.d.ts.map +0 -1
  347. package/dist/og.js.map +0 -1
  348. package/dist/page.d.ts.map +0 -1
  349. package/dist/page.js.map +0 -1
  350. package/dist/provider/base.d.ts.map +0 -1
  351. package/dist/provider/base.js.map +0 -1
  352. package/dist/provider/next.d.ts.map +0 -1
  353. package/dist/provider/next.js.map +0 -1
  354. package/dist/provider/react-router.d.ts.map +0 -1
  355. package/dist/provider/react-router.js.map +0 -1
  356. package/dist/provider/tanstack.d.ts.map +0 -1
  357. package/dist/provider/tanstack.js.map +0 -1
  358. package/dist/provider/waku.d.ts.map +0 -1
  359. package/dist/provider/waku.js.map +0 -1
  360. package/dist/utils/link-item.d.ts +0 -86
  361. package/dist/utils/link-item.d.ts.map +0 -1
  362. package/dist/utils/link-item.js +0 -25
  363. package/dist/utils/link-item.js.map +0 -1
  364. package/dist/utils/merge-refs.js.map +0 -1
  365. package/dist/utils/urls.js.map +0 -1
  366. package/dist/utils/use-copy-button.d.ts.map +0 -1
  367. package/dist/utils/use-copy-button.js.map +0 -1
  368. package/dist/utils/use-footer-items.d.ts.map +0 -1
  369. package/dist/utils/use-footer-items.js.map +0 -1
  370. package/dist/utils/use-is-scroll-top.d.ts.map +0 -1
  371. package/dist/utils/use-is-scroll-top.js.map +0 -1
@@ -1,101 +1,158 @@
1
- 'use client';
2
-
1
+ "use client";
2
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { useI18n } from "../../contexts/i18n.js";
4
4
  import { cn } from "../../utils/cn.js";
5
5
  import { mergeRefs } from "../../utils/merge-refs.js";
6
6
  import { TocThumb, useTOCItems } from "./index.js";
7
- import { useEffect, useRef, useState } from "react";
7
+ import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  import * as Primitive from "@hanzo/docs-core/toc";
10
-
11
10
  //#region src/components/toc/clerk.tsx
11
+ var clerk_exports = /* @__PURE__ */ __exportAll({
12
+ TOCEmpty: () => TOCEmpty,
13
+ TOCItem: () => TOCItem,
14
+ TOCItems: () => TOCItems
15
+ });
12
16
  function TOCItems({ ref, className, ...props }) {
13
17
  const containerRef = useRef(null);
14
18
  const items = useTOCItems();
15
- const { text } = useI18n();
16
19
  const [svg, setSvg] = useState();
17
- useEffect(() => {
18
- if (!containerRef.current) return;
20
+ const onResize = useEffectEvent(() => {
19
21
  const container = containerRef.current;
20
- function onResize() {
21
- if (container.clientHeight === 0) return;
22
- let w = 0, h = 0;
23
- const d = [];
24
- for (let i = 0; i < items.length; i++) {
25
- const element = container.querySelector(`a[href="#${items[i].url.slice(1)}"]`);
26
- if (!element) continue;
27
- const styles = getComputedStyle(element);
28
- const offset = getLineOffset(items[i].depth) + 1, top = element.offsetTop + parseFloat(styles.paddingTop), bottom = element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom);
29
- w = Math.max(offset, w);
30
- h = Math.max(h, bottom);
31
- d.push(`${i === 0 ? "M" : "L"}${offset} ${top}`);
32
- d.push(`L${offset} ${bottom}`);
22
+ if (!container || container.clientHeight === 0) return;
23
+ let w = 0;
24
+ let h = 0;
25
+ let b0 = 0;
26
+ let d = "";
27
+ for (let i = 0; i < items.length; i++) {
28
+ const element = container.querySelector(`a[href="#${items[i].url.slice(1)}"]`);
29
+ if (!element) continue;
30
+ const styles = getComputedStyle(element);
31
+ const offset = getLineOffset(items[i].depth) + 1, top = element.offsetTop + parseFloat(styles.paddingTop), bottom = element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom);
32
+ w = Math.max(offset, w);
33
+ h = Math.max(h, bottom);
34
+ if (i === 0) d += ` M${offset} ${top} L${offset} ${bottom}`;
35
+ else {
36
+ const pOffset = getLineOffset(items[i - 1].depth) + 1;
37
+ d += ` C ${pOffset} ${top - 4} ${offset} ${b0 + 4} ${offset} ${top} L${offset} ${bottom}`;
33
38
  }
34
- setSvg({
35
- path: d.join(" "),
36
- width: w + 1,
37
- height: h
38
- });
39
+ b0 = bottom;
39
40
  }
41
+ setSvg({
42
+ d,
43
+ width: w + 1,
44
+ height: h
45
+ });
46
+ });
47
+ useEffect(() => {
48
+ if (!containerRef.current) return;
40
49
  const observer = new ResizeObserver(onResize);
41
50
  onResize();
42
- observer.observe(container);
51
+ observer.observe(containerRef.current);
43
52
  return () => {
44
53
  observer.disconnect();
45
54
  };
46
- }, [items]);
47
- if (items.length === 0) return /* @__PURE__ */ jsx("div", {
48
- className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",
49
- children: text.tocNoHeadings
50
- });
51
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [svg && /* @__PURE__ */ jsx("div", {
52
- className: "absolute start-0 top-0 rtl:-scale-x-100",
55
+ }, []);
56
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [svg && /* @__PURE__ */ jsxs(TocThumb, {
57
+ containerRef,
58
+ className: "absolute top-0 inset-s-0",
53
59
  style: {
54
60
  width: svg.width,
55
- height: svg.height,
56
- maskImage: `url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${svg.width} ${svg.height}"><path d="${svg.path}" stroke="black" stroke-width="1" fill="none" /></svg>`)}")`
61
+ height: svg.height
57
62
  },
58
- children: /* @__PURE__ */ jsx(TocThumb, {
59
- containerRef,
60
- className: "absolute w-full top-(--fd-top) h-(--fd-height) bg-fd-primary transition-[top,height]"
61
- })
63
+ children: [/* @__PURE__ */ jsx("svg", {
64
+ xmlns: "http://www.w3.org/2000/svg",
65
+ viewBox: `0 0 ${svg.width} ${svg.height}`,
66
+ className: "absolute transition-[clip-path]",
67
+ style: {
68
+ width: svg.width,
69
+ height: svg.height,
70
+ clipPath: `polygon(0 var(--fd-top), 100% var(--fd-top), 100% calc(var(--fd-top) + var(--fd-height)), 0 calc(var(--fd-top) + var(--fd-height)))`
71
+ },
72
+ children: /* @__PURE__ */ jsx("path", {
73
+ d: svg.d,
74
+ className: "stroke-fd-primary",
75
+ strokeWidth: "1",
76
+ fill: "none"
77
+ })
78
+ }), /* @__PURE__ */ jsx(ThumbBox, {})]
62
79
  }), /* @__PURE__ */ jsx("div", {
63
80
  ref: mergeRefs(containerRef, ref),
64
81
  className: cn("flex flex-col", className),
65
- ...props,
66
- children: items.map((item, i) => /* @__PURE__ */ jsx(TOCItem, {
67
- item,
68
- upper: items[i - 1]?.depth,
69
- lower: items[i + 1]?.depth
70
- }, item.url))
82
+ ...props
71
83
  })] });
72
84
  }
85
+ function TOCEmpty() {
86
+ const { text } = useI18n();
87
+ return /* @__PURE__ */ jsx("div", {
88
+ className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",
89
+ children: text.tocNoHeadings
90
+ });
91
+ }
92
+ function ThumbBox() {
93
+ const items = Primitive.useItems();
94
+ let startIdx = -1;
95
+ let endIdx = -1;
96
+ let lastInactiveIdx = -1;
97
+ for (let i = 0; i < items.length; i++) {
98
+ const item = items[i];
99
+ if (item.active) {
100
+ if (startIdx === -1) startIdx = i;
101
+ endIdx = i;
102
+ } else if (lastInactiveIdx === -1 || items[lastInactiveIdx].t < item.t) lastInactiveIdx = i;
103
+ }
104
+ if (startIdx === -1) return;
105
+ const isStart = endIdx < lastInactiveIdx;
106
+ return /* @__PURE__ */ jsx("div", {
107
+ className: "absolute size-1 bg-fd-primary rounded-full transition-transform",
108
+ style: { translate: `calc(${getLineOffset(items[isStart ? startIdx : endIdx].original.depth)}px - 1.25px) ${isStart ? "var(--fd-top)" : "calc(var(--fd-top) + var(--fd-height))"}` }
109
+ });
110
+ }
73
111
  function getItemOffset(depth) {
74
112
  if (depth <= 2) return 14;
75
113
  if (depth === 3) return 26;
76
114
  return 36;
77
115
  }
78
116
  function getLineOffset(depth) {
79
- return depth >= 3 ? 10 : 0;
117
+ if (depth <= 2) return 2;
118
+ if (depth === 3) return 10;
119
+ return 20;
80
120
  }
81
- function TOCItem({ item, upper = item.depth, lower = item.depth }) {
82
- const offset = getLineOffset(item.depth), upperOffset = getLineOffset(upper), lowerOffset = getLineOffset(lower);
121
+ function TOCItem({ item, ...props }) {
122
+ const items = useTOCItems();
123
+ const { lowerOffset, offset, upperOffset } = useMemo(() => {
124
+ const index = items.indexOf(item);
125
+ const offset = getLineOffset(item.depth);
126
+ return {
127
+ offset,
128
+ upperOffset: index > 0 ? getLineOffset(items[index - 1].depth) : offset,
129
+ lowerOffset: index + 1 < items.length ? getLineOffset(items[index + 1].depth) : offset
130
+ };
131
+ }, [items, item]);
83
132
  return /* @__PURE__ */ jsxs(Primitive.TOCItem, {
84
133
  href: item.url,
85
- style: { paddingInlineStart: getItemOffset(item.depth) },
86
- className: "prose relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary",
134
+ ...props,
135
+ className: cn("prose relative py-1.5 text-sm scroll-m-4 text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary", props.className),
136
+ style: {
137
+ paddingInlineStart: getItemOffset(item.depth),
138
+ ...props.style
139
+ },
87
140
  children: [
88
141
  offset !== upperOffset && /* @__PURE__ */ jsx("svg", {
89
142
  xmlns: "http://www.w3.org/2000/svg",
90
- viewBox: "0 0 16 16",
91
- className: "absolute -top-1.5 start-0 size-4 rtl:-scale-x-100",
92
- children: /* @__PURE__ */ jsx("line", {
93
- x1: upperOffset,
94
- y1: "0",
95
- x2: offset,
96
- y2: "12",
97
- className: "stroke-fd-foreground/10",
98
- strokeWidth: "1"
143
+ viewBox: `${Math.min(offset, upperOffset)} 0 ${Math.abs(upperOffset - offset)} 12`,
144
+ className: "absolute -top-1.5",
145
+ style: {
146
+ width: Math.abs(upperOffset - offset) + 1,
147
+ height: 12,
148
+ insetInlineStart: Math.min(offset, upperOffset)
149
+ },
150
+ children: /* @__PURE__ */ jsx("path", {
151
+ d: `M ${upperOffset} 0 C ${upperOffset} 8 ${offset} 4 ${offset} 12`,
152
+ stroke: "black",
153
+ strokeWidth: "1",
154
+ fill: "none",
155
+ className: "stroke-fd-foreground/10"
99
156
  })
100
157
  }),
101
158
  /* @__PURE__ */ jsx("div", {
@@ -106,7 +163,5 @@ function TOCItem({ item, upper = item.depth, lower = item.depth }) {
106
163
  ]
107
164
  });
108
165
  }
109
-
110
166
  //#endregion
111
- export { TOCItems };
112
- //# sourceMappingURL=clerk.js.map
167
+ export { TOCEmpty, TOCItem, TOCItems, clerk_exports };
@@ -1,5 +1,6 @@
1
1
  import { ComponentProps } from "react";
2
2
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as Primitive from "@hanzo/docs-core/toc";
3
4
 
4
5
  //#region src/components/toc/default.d.ts
5
6
  declare function TOCItems({
@@ -7,6 +8,12 @@ declare function TOCItems({
7
8
  className,
8
9
  ...props
9
10
  }: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
11
+ declare function TOCEmpty(): react_jsx_runtime0.JSX.Element;
12
+ declare function TOCItem({
13
+ item,
14
+ ...props
15
+ }: Primitive.TOCItemProps & {
16
+ item: Primitive.TOCItemType;
17
+ }): react_jsx_runtime0.JSX.Element;
10
18
  //#endregion
11
- export { TOCItems };
12
- //# sourceMappingURL=default.d.ts.map
19
+ export { TOCEmpty, TOCItem, TOCItems };
@@ -1,40 +1,47 @@
1
- 'use client';
2
-
1
+ "use client";
2
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { useI18n } from "../../contexts/i18n.js";
4
4
  import { cn } from "../../utils/cn.js";
5
5
  import { mergeRefs } from "../../utils/merge-refs.js";
6
- import { TocThumb, useTOCItems } from "./index.js";
6
+ import { TocThumb } from "./index.js";
7
7
  import { useRef } from "react";
8
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import * as Primitive from "@hanzo/docs-core/toc";
10
-
11
10
  //#region src/components/toc/default.tsx
11
+ var default_exports = /* @__PURE__ */ __exportAll({
12
+ TOCEmpty: () => TOCEmpty,
13
+ TOCItem: () => TOCItem,
14
+ TOCItems: () => TOCItems
15
+ });
12
16
  function TOCItems({ ref, className, ...props }) {
13
17
  const containerRef = useRef(null);
14
- const items = useTOCItems();
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: "relative",
20
+ children: [/* @__PURE__ */ jsx(TocThumb, {
21
+ containerRef,
22
+ className: "absolute inset-y-0 inset-s-0 bg-fd-primary w-px transition-[clip-path]",
23
+ style: { clipPath: "polygon(0 var(--fd-top), 100% var(--fd-top), 100% calc(var(--fd-top) + var(--fd-height)), 0 calc(var(--fd-top) + var(--fd-height)))" }
24
+ }), /* @__PURE__ */ jsx("div", {
25
+ ref: mergeRefs(ref, containerRef),
26
+ className: cn("flex flex-col border-s border-fd-foreground/10", className),
27
+ ...props
28
+ })]
29
+ });
30
+ }
31
+ function TOCEmpty() {
15
32
  const { text } = useI18n();
16
- if (items.length === 0) return /* @__PURE__ */ jsx("div", {
33
+ return /* @__PURE__ */ jsx("div", {
17
34
  className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",
18
35
  children: text.tocNoHeadings
19
36
  });
20
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TocThumb, {
21
- containerRef,
22
- className: "absolute top-(--fd-top) h-(--fd-height) w-0.5 rounded-e-sm bg-fd-primary transition-[top,height] ease-linear"
23
- }), /* @__PURE__ */ jsx("div", {
24
- ref: mergeRefs(ref, containerRef),
25
- className: cn("flex flex-col border-s border-fd-foreground/10", className),
26
- ...props,
27
- children: items.map((item) => /* @__PURE__ */ jsx(TOCItem, { item }, item.url))
28
- })] });
29
37
  }
30
- function TOCItem({ item }) {
38
+ function TOCItem({ item, ...props }) {
31
39
  return /* @__PURE__ */ jsx(Primitive.TOCItem, {
32
40
  href: item.url,
33
- className: cn("prose py-1.5 text-sm text-fd-muted-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary", item.depth <= 2 && "ps-3", item.depth === 3 && "ps-6", item.depth >= 4 && "ps-8"),
41
+ ...props,
42
+ className: cn("prose py-1.5 text-sm text-fd-muted-foreground scroll-m-4 transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary hover:text-fd-accent-foreground", item.depth <= 2 && "ps-3", item.depth === 3 && "ps-6", item.depth >= 4 && "ps-8", props.className),
34
43
  children: item.title
35
44
  });
36
45
  }
37
-
38
46
  //#endregion
39
- export { TOCItems };
40
- //# sourceMappingURL=default.js.map
47
+ export { TOCEmpty, TOCItem, TOCItems, default_exports };
@@ -4,23 +4,26 @@ import * as Primitive from "@hanzo/docs-core/toc";
4
4
 
5
5
  //#region src/components/toc/index.d.ts
6
6
  declare function useTOCItems(): Primitive.TOCItemType[];
7
+ type TOCProviderProps = Primitive.AnchorProviderProps;
8
+ declare const useActiveAnchor: typeof Primitive.useActiveAnchor, useActiveAnchors: typeof Primitive.useActiveAnchors, useItems: typeof Primitive.useItems;
7
9
  declare function TOCProvider({
8
10
  toc,
9
11
  children,
10
12
  ...props
11
- }: ComponentProps<typeof Primitive.AnchorProvider>): react_jsx_runtime0.JSX.Element;
13
+ }: TOCProviderProps): react_jsx_runtime0.JSX.Element;
12
14
  declare function TOCScrollArea({
13
15
  ref,
14
16
  className,
15
17
  ...props
16
18
  }: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
17
- interface RefProps {
19
+ interface TocThumbProps extends ComponentProps<'div'> {
18
20
  containerRef: RefObject<HTMLElement | null>;
21
+ align?: 'center' | 'end';
19
22
  }
20
23
  declare function TocThumb({
21
24
  containerRef,
25
+ align,
22
26
  ...props
23
- }: ComponentProps<'div'> & RefProps): react_jsx_runtime0.JSX.Element;
27
+ }: TocThumbProps): react_jsx_runtime0.JSX.Element;
24
28
  //#endregion
25
- export { TOCProvider, TOCScrollArea, TocThumb, useTOCItems };
26
- //# sourceMappingURL=index.d.ts.map
29
+ export { TOCProvider, TOCProviderProps, TOCScrollArea, TocThumb, useActiveAnchor, useActiveAnchors, useItems, useTOCItems };
@@ -1,17 +1,26 @@
1
- 'use client';
2
-
1
+ "use client";
2
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
3
3
  import { cn } from "../../utils/cn.js";
4
4
  import { mergeRefs } from "../../utils/merge-refs.js";
5
5
  import { createContext, use, useEffect, useEffectEvent, useRef } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import * as Primitive from "@hanzo/docs-core/toc";
8
8
  import { useOnChange } from "@hanzo/docs-core/utils/use-on-change";
9
-
10
9
  //#region src/components/toc/index.tsx
10
+ var toc_exports = /* @__PURE__ */ __exportAll({
11
+ TOCProvider: () => TOCProvider,
12
+ TOCScrollArea: () => TOCScrollArea,
13
+ TocThumb: () => TocThumb,
14
+ useActiveAnchor: () => useActiveAnchor,
15
+ useActiveAnchors: () => useActiveAnchors,
16
+ useItems: () => useItems,
17
+ useTOCItems: () => useTOCItems
18
+ });
11
19
  const TOCContext = createContext([]);
12
20
  function useTOCItems() {
13
21
  return use(TOCContext);
14
22
  }
23
+ const { useActiveAnchor, useActiveAnchors, useItems } = Primitive;
15
24
  function TOCProvider({ toc, children, ...props }) {
16
25
  return /* @__PURE__ */ jsx(TOCContext, {
17
26
  value: toc,
@@ -34,17 +43,46 @@ function TOCScrollArea({ ref, className, ...props }) {
34
43
  })
35
44
  });
36
45
  }
37
- function TocThumb({ containerRef, ...props }) {
46
+ function TocThumb({ containerRef, align = "end", ...props }) {
38
47
  const thumbRef = useRef(null);
39
- const active = Primitive.useActiveAnchors();
48
+ const active = useActiveAnchors();
40
49
  function update(info) {
41
50
  const element = thumbRef.current;
42
- if (!element) return;
43
- element.style.setProperty("--fd-top", `${info[0]}px`);
44
- element.style.setProperty("--fd-height", `${info[1]}px`);
51
+ const container = containerRef.current;
52
+ if (!element || !container) return;
53
+ element.style.setProperty("--fd-top", `${info.top}px`);
54
+ element.style.setProperty("--fd-height", `${info.height}px`);
55
+ }
56
+ function calc(active) {
57
+ const container = containerRef.current;
58
+ if (!container || container.clientHeight === 0) return null;
59
+ if (active.length === 0) return {
60
+ height: 0,
61
+ top: 0
62
+ };
63
+ let upper = Number.MAX_VALUE;
64
+ let lower = 0;
65
+ for (const item of active) {
66
+ const element = container.querySelector(`a[href="#${item}"]`);
67
+ if (!element) continue;
68
+ if (align === "center") {
69
+ const y = element.offsetTop + element.clientHeight / 2;
70
+ upper = Math.min(upper, y);
71
+ lower = Math.max(lower, y);
72
+ } else {
73
+ const styles = getComputedStyle(element);
74
+ upper = Math.min(upper, element.offsetTop + parseFloat(styles.paddingTop));
75
+ lower = Math.max(lower, element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom));
76
+ }
77
+ }
78
+ return {
79
+ top: upper,
80
+ height: lower - upper
81
+ };
45
82
  }
46
83
  const onPrint = useEffectEvent(() => {
47
- if (containerRef.current) update(calc(containerRef.current, active));
84
+ const result = calc(active);
85
+ if (result) update(result);
48
86
  });
49
87
  useEffect(() => {
50
88
  if (!containerRef.current) return;
@@ -56,7 +94,8 @@ function TocThumb({ containerRef, ...props }) {
56
94
  };
57
95
  }, [containerRef]);
58
96
  useOnChange(active, () => {
59
- if (containerRef.current) update(calc(containerRef.current, active));
97
+ const result = calc(active);
98
+ if (result) update(result);
60
99
  });
61
100
  return /* @__PURE__ */ jsx("div", {
62
101
  ref: thumbRef,
@@ -64,19 +103,5 @@ function TocThumb({ containerRef, ...props }) {
64
103
  ...props
65
104
  });
66
105
  }
67
- function calc(container, active) {
68
- if (active.length === 0 || container.clientHeight === 0) return [0, 0];
69
- let upper = Number.MAX_VALUE, lower = 0;
70
- for (const item of active) {
71
- const element = container.querySelector(`a[href="#${item}"]`);
72
- if (!element) continue;
73
- const styles = getComputedStyle(element);
74
- upper = Math.min(upper, element.offsetTop + parseFloat(styles.paddingTop));
75
- lower = Math.max(lower, element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom));
76
- }
77
- return [upper, lower - upper];
78
- }
79
-
80
106
  //#endregion
81
- export { TOCProvider, TOCScrollArea, TocThumb, useTOCItems };
82
- //# sourceMappingURL=index.js.map
107
+ export { TOCProvider, TOCScrollArea, TocThumb, toc_exports, useActiveAnchor, useActiveAnchors, useItems, useTOCItems };
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ComponentProps, ReactNode } from "react";
2
2
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/type-table.d.ts
@@ -26,14 +26,19 @@ interface TypeNode {
26
26
  default?: ReactNode;
27
27
  required?: boolean;
28
28
  deprecated?: boolean;
29
+ /**
30
+ * a list of parameters info if the type is a function.
31
+ */
29
32
  parameters?: ParameterNode[];
30
33
  returns?: ReactNode;
31
34
  }
32
35
  declare function TypeTable({
33
- type
36
+ id,
37
+ type,
38
+ className,
39
+ ...props
34
40
  }: {
35
41
  type: Record<string, TypeNode>;
36
- }): react_jsx_runtime0.JSX.Element;
42
+ } & ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
37
43
  //#endregion
38
- export { ParameterNode, TypeNode, TypeTable };
39
- //# sourceMappingURL=type-table.d.ts.map
44
+ export { ParameterNode, TypeNode, TypeTable };
@@ -1,48 +1,55 @@
1
- 'use client';
2
-
1
+ "use client";
3
2
  import { cn } from "../utils/cn.js";
4
3
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
5
- import { useState } from "react";
4
+ import { useEffect, useState } from "react";
6
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
6
  import Link from "@hanzo/docs-core/link";
8
7
  import { ChevronDown } from "lucide-react";
9
8
  import { cva } from "class-variance-authority";
10
-
11
9
  //#region src/components/type-table.tsx
12
- const keyVariants = cva("text-fd-primary", { variants: { deprecated: { true: "line-through text-fd-primary/50" } } });
13
10
  const fieldVariants = cva("text-fd-muted-foreground not-prose pe-2");
14
- function TypeTable({ type }) {
11
+ function TypeTable({ id, type, className, ...props }) {
15
12
  return /* @__PURE__ */ jsxs("div", {
16
- className: "@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden",
13
+ id,
14
+ className: cn("@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden", className),
15
+ ...props,
17
16
  children: [/* @__PURE__ */ jsxs("div", {
18
17
  className: "flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground",
19
18
  children: [/* @__PURE__ */ jsx("p", {
20
- className: "w-[25%]",
19
+ className: "w-1/4",
21
20
  children: "Prop"
22
21
  }), /* @__PURE__ */ jsx("p", {
23
22
  className: "@max-xl:hidden",
24
23
  children: "Type"
25
24
  })]
26
25
  }), Object.entries(type).map(([key, value]) => /* @__PURE__ */ jsx(Item, {
26
+ parentId: id,
27
27
  name: key,
28
28
  item: value
29
29
  }, key))]
30
30
  });
31
31
  }
32
- function Item({ name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
32
+ function Item({ parentId, name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
33
33
  const [open, setOpen] = useState(false);
34
+ const id = parentId ? `${parentId}-${name}` : void 0;
35
+ useEffect(() => {
36
+ const hash = window.location.hash;
37
+ if (!id || !hash) return;
38
+ if (`#${id}` === hash) setOpen(true);
39
+ }, [id]);
34
40
  return /* @__PURE__ */ jsxs(Collapsible, {
41
+ id,
35
42
  open,
36
- onOpenChange: setOpen,
37
- className: cn("rounded-xl border overflow-hidden transition-all", open ? "shadow-sm bg-fd-background not-last:mb-2" : "border-transparent"),
43
+ onOpenChange: (v) => {
44
+ if (v && id) window.history.replaceState(null, "", `#${id}`);
45
+ setOpen(v);
46
+ },
47
+ className: cn("rounded-xl border overflow-hidden scroll-m-20 transition-all", open ? "shadow-sm bg-fd-background not-last:mb-2" : "border-transparent"),
38
48
  children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
39
49
  className: "relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent",
40
50
  children: [
41
51
  /* @__PURE__ */ jsxs("code", {
42
- className: cn(keyVariants({
43
- deprecated,
44
- className: "min-w-fit w-[25%] font-medium pe-2"
45
- })),
52
+ className: cn("text-fd-primary min-w-fit w-1/4 font-mono font-medium pe-2", deprecated && "line-through text-fd-primary/50"),
46
53
  children: [name, !required && "?"]
47
54
  }),
48
55
  typeDescriptionLink ? /* @__PURE__ */ jsx(Link, {
@@ -103,7 +110,5 @@ function Item({ name, item: { parameters = [], description, required = false, de
103
110
  }) })]
104
111
  });
105
112
  }
106
-
107
113
  //#endregion
108
114
  export { TypeTable };
109
- //# sourceMappingURL=type-table.js.map
@@ -27,5 +27,4 @@ declare function AccordionContent({
27
27
  ...props
28
28
  }: ComponentProps<typeof Accordion$1.Panel>): react_jsx_runtime0.JSX.Element;
29
29
  //#endregion
30
- export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger };
31
- //# sourceMappingURL=accordion.d.ts.map
30
+ export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger };
@@ -1,10 +1,8 @@
1
- 'use client';
2
-
1
+ "use client";
3
2
  import { cn } from "../../utils/cn.js";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { ChevronRight } from "lucide-react";
6
5
  import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
7
-
8
6
  //#region src/components/ui/accordion.tsx
9
7
  function Accordion({ className, ...props }) {
10
8
  return /* @__PURE__ */ jsx(Accordion$1.Root, {
@@ -39,7 +37,5 @@ function AccordionContent({ className, children, ...props }) {
39
37
  children
40
38
  });
41
39
  }
42
-
43
40
  //#endregion
44
41
  export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger };
45
- //# sourceMappingURL=accordion.js.map
@@ -5,9 +5,8 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
5
5
  declare const buttonVariants: (props?: ({
6
6
  variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
7
7
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
8
- size?: "sm" | "icon" | "icon-sm" | "icon-xs" | null | undefined;
8
+ size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
9
9
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  type ButtonProps = VariantProps<typeof buttonVariants>;
11
11
  //#endregion
12
- export { ButtonProps, buttonVariants };
13
- //# sourceMappingURL=button.d.ts.map
12
+ export { ButtonProps, buttonVariants };
@@ -1,5 +1,4 @@
1
1
  import { cva } from "class-variance-authority";
2
-
3
2
  //#region src/components/ui/button.tsx
4
3
  const variants = {
5
4
  primary: "bg-fd-primary text-fd-primary-foreground hover:bg-fd-primary/80",
@@ -17,7 +16,5 @@ const buttonVariants = cva("inline-flex items-center justify-center rounded-md p
17
16
  "icon-xs": "p-1 [&_svg]:size-4"
18
17
  }
19
18
  } });
20
-
21
19
  //#endregion
22
20
  export { buttonVariants };
23
- //# sourceMappingURL=button.js.map
@@ -16,5 +16,4 @@ type CollapsibleProps = Collapsible$1.Root.Props;
16
16
  type CollapsibleContentProps = Collapsible$1.Panel.Props;
17
17
  type CollapsibleTriggerProps = Collapsible$1.Trigger.Props;
18
18
  //#endregion
19
- export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
20
- //# sourceMappingURL=collapsible.d.ts.map
19
+ export { Collapsible, CollapsibleContent, CollapsibleContentProps, CollapsibleProps, CollapsibleTrigger, CollapsibleTriggerProps };
@@ -1,20 +1,16 @@
1
- 'use client';
2
-
1
+ "use client";
3
2
  import { cn } from "../../utils/cn.js";
4
3
  import { jsx } from "react/jsx-runtime";
5
4
  import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
6
-
7
5
  //#region src/components/ui/collapsible.tsx
8
6
  const Collapsible = Collapsible$1.Root;
9
7
  const CollapsibleTrigger = Collapsible$1.Trigger;
10
8
  function CollapsibleContent({ children, className, ...props }) {
11
9
  return /* @__PURE__ */ jsx(Collapsible$1.Panel, {
12
10
  ...props,
13
- className: (s) => cn("overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height] data-[starting-style]:h-0 data-[ending-style]:h-0", typeof className === "function" ? className(s) : className),
11
+ className: (s) => cn("overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height,opacity] data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0 data-ending-style:opacity-0", typeof className === "function" ? className(s) : className),
14
12
  children
15
13
  });
16
14
  }
17
-
18
15
  //#endregion
19
16
  export { Collapsible, CollapsibleContent, CollapsibleTrigger };
20
- //# sourceMappingURL=collapsible.js.map