@gentleduck/docs 0.0.1

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 (462) hide show
  1. package/LICENSE +21 -0
  2. package/dist/callout-CFw8zUIz.js +2 -0
  3. package/dist/callout-CFw8zUIz.js.map +1 -0
  4. package/dist/callout-VcT2d48I.d.ts +17 -0
  5. package/dist/callout-VcT2d48I.d.ts.map +1 -0
  6. package/dist/charts-DX0UohRi.js +2 -0
  7. package/dist/charts-DX0UohRi.js.map +1 -0
  8. package/dist/charts-hfCEZEQp.d.ts +6 -0
  9. package/dist/charts-hfCEZEQp.d.ts.map +1 -0
  10. package/dist/client.d.ts +54 -0
  11. package/dist/client.js +1 -0
  12. package/dist/code-Cz75Womb.js +0 -0
  13. package/dist/code-block-CR2loi-i.d.ts +14 -0
  14. package/dist/code-block-CR2loi-i.d.ts.map +1 -0
  15. package/dist/code-block-DqFdGhI-.js +2 -0
  16. package/dist/code-block-DqFdGhI-.js.map +1 -0
  17. package/dist/code-block-wrapper-C8I0XMsN.d.ts +12 -0
  18. package/dist/code-block-wrapper-C8I0XMsN.d.ts.map +1 -0
  19. package/dist/code-block-wrapper-CCAw9mie.js +2 -0
  20. package/dist/code-block-wrapper-CCAw9mie.js.map +1 -0
  21. package/dist/code-preview-CeNXQxYN.d.ts +20 -0
  22. package/dist/code-preview-CeNXQxYN.d.ts.map +1 -0
  23. package/dist/code-preview-cIvw8qyg.js +2 -0
  24. package/dist/code-preview-cIvw8qyg.js.map +1 -0
  25. package/dist/colors-Ba_cRR6y.js +2 -0
  26. package/dist/colors-Ba_cRR6y.js.map +1 -0
  27. package/dist/colors-CpJMSMtf.d.ts +47 -0
  28. package/dist/colors-CpJMSMtf.d.ts.map +1 -0
  29. package/dist/command-menu-7HTBKVxd.js +0 -0
  30. package/dist/command-menu-BVebU1JI.js +2 -0
  31. package/dist/command-menu-BVebU1JI.js.map +1 -0
  32. package/dist/command-menu-C8RLyuBe.d.ts +7 -0
  33. package/dist/command-menu-C8RLyuBe.d.ts.map +1 -0
  34. package/dist/component-preview-CL6guE-v.js +2 -0
  35. package/dist/component-preview-CL6guE-v.js.map +1 -0
  36. package/dist/component-preview-DknaF8TG.d.ts +33 -0
  37. package/dist/component-preview-DknaF8TG.d.ts.map +1 -0
  38. package/dist/component-source-BCBDjfEb.js +5 -0
  39. package/dist/component-source-BCBDjfEb.js.map +1 -0
  40. package/dist/component-source-IrGlRkUy.d.ts +17 -0
  41. package/dist/component-source-IrGlRkUy.d.ts.map +1 -0
  42. package/dist/components/copy-button/copy-button.d.ts +4 -0
  43. package/dist/components/copy-button/copy-button.js +1 -0
  44. package/dist/components/copy-button/copy-button.types.d.ts +3 -0
  45. package/dist/components/copy-button/copy-button.types.js +0 -0
  46. package/dist/components/copy-button/index.d.ts +5 -0
  47. package/dist/components/copy-button/index.js +1 -0
  48. package/dist/components/docs/docs-copy-page.d.ts +2 -0
  49. package/dist/components/docs/docs-copy-page.js +1 -0
  50. package/dist/components/docs/docs-pager.d.ts +4 -0
  51. package/dist/components/docs/docs-pager.js +1 -0
  52. package/dist/components/docs/docs-sidebar.d.ts +4 -0
  53. package/dist/components/docs/docs-sidebar.js +1 -0
  54. package/dist/components/docs/docs-toc.d.ts +4 -0
  55. package/dist/components/docs/docs-toc.js +1 -0
  56. package/dist/components/docs/index.d.ts +8 -0
  57. package/dist/components/docs/index.js +1 -0
  58. package/dist/components/icons.d.ts +2 -0
  59. package/dist/components/icons.js +1 -0
  60. package/dist/components/index.d.ts +44 -0
  61. package/dist/components/index.js +1 -0
  62. package/dist/components/layouts/command-menu/command-menu.d.ts +2 -0
  63. package/dist/components/layouts/command-menu/command-menu.js +1 -0
  64. package/dist/components/layouts/command-menu/index.d.ts +3 -0
  65. package/dist/components/layouts/command-menu/index.js +1 -0
  66. package/dist/components/layouts/index.d.ts +8 -0
  67. package/dist/components/layouts/index.js +1 -0
  68. package/dist/components/layouts/site-footer/index.d.ts +2 -0
  69. package/dist/components/layouts/site-footer/index.js +1 -0
  70. package/dist/components/layouts/site-header/header-shell.d.ts +2 -0
  71. package/dist/components/layouts/site-header/header-shell.js +1 -0
  72. package/dist/components/layouts/site-header/index.d.ts +3 -0
  73. package/dist/components/layouts/site-header/index.js +1 -0
  74. package/dist/components/layouts/tailwind-indicator/index.d.ts +2 -0
  75. package/dist/components/layouts/tailwind-indicator/index.js +1 -0
  76. package/dist/components/main-nav.d.ts +2 -0
  77. package/dist/components/main-nav.js +1 -0
  78. package/dist/components/mdx/mdx-components/callout.d.ts +2 -0
  79. package/dist/components/mdx/mdx-components/callout.js +1 -0
  80. package/dist/components/mdx/mdx-components/code/code-block-wrapper.d.ts +2 -0
  81. package/dist/components/mdx/mdx-components/code/code-block-wrapper.js +1 -0
  82. package/dist/components/mdx/mdx-components/code/code-block.d.ts +2 -0
  83. package/dist/components/mdx/mdx-components/code/code-block.js +1 -0
  84. package/dist/components/mdx/mdx-components/code/code-preview.d.ts +2 -0
  85. package/dist/components/mdx/mdx-components/code/code-preview.js +1 -0
  86. package/dist/components/mdx/mdx-components/code/component-preview.d.ts +2 -0
  87. package/dist/components/mdx/mdx-components/code/component-preview.js +1 -0
  88. package/dist/components/mdx/mdx-components/code/component-source.d.ts +2 -0
  89. package/dist/components/mdx/mdx-components/code/component-source.js +1 -0
  90. package/dist/components/mdx/mdx-components/code/figcaption-block.d.ts +2 -0
  91. package/dist/components/mdx/mdx-components/code/figcaption-block.js +1 -0
  92. package/dist/components/mdx/mdx-components/code/index.d.ts +11 -0
  93. package/dist/components/mdx/mdx-components/code/index.js +1 -0
  94. package/dist/components/mdx/mdx-components/code/pre-block.d.ts +4 -0
  95. package/dist/components/mdx/mdx-components/code/pre-block.js +1 -0
  96. package/dist/components/mdx/mdx-components/code/span-block.d.ts +11 -0
  97. package/dist/components/mdx/mdx-components/code/span-block.d.ts.map +1 -0
  98. package/dist/components/mdx/mdx-components/code/span-block.js +2 -0
  99. package/dist/components/mdx/mdx-components/code/span-block.js.map +1 -0
  100. package/dist/components/mdx/mdx-components/components-list.d.ts +4 -0
  101. package/dist/components/mdx/mdx-components/components-list.js +1 -0
  102. package/dist/components/mdx/mdx-components/exalidraw.d.ts +7 -0
  103. package/dist/components/mdx/mdx-components/exalidraw.d.ts.map +1 -0
  104. package/dist/components/mdx/mdx-components/exalidraw.js +2 -0
  105. package/dist/components/mdx/mdx-components/exalidraw.js.map +1 -0
  106. package/dist/components/mdx/mdx-components/framework-docs.d.ts +2 -0
  107. package/dist/components/mdx/mdx-components/framework-docs.js +1 -0
  108. package/dist/components/mdx/mdx-components/index.d.ts +20 -0
  109. package/dist/components/mdx/mdx-components/index.js +1 -0
  110. package/dist/components/mdx/mdx-components/table.d.ts +2 -0
  111. package/dist/components/mdx/mdx-components/table.js +1 -0
  112. package/dist/components/mdx/mdx-components/tabs.d.ts +2 -0
  113. package/dist/components/mdx/mdx-components/tabs.js +1 -0
  114. package/dist/components/mdx/mdx-components/typepography.d.ts +2 -0
  115. package/dist/components/mdx/mdx-components/typepography.js +1 -0
  116. package/dist/components/mdx/mdx.d.ts +2 -0
  117. package/dist/components/mdx/mdx.js +1 -0
  118. package/dist/components/mobile-nav.d.ts +2 -0
  119. package/dist/components/mobile-nav.js +1 -0
  120. package/dist/components/mode-toggle.d.ts +2 -0
  121. package/dist/components/mode-toggle.js +1 -0
  122. package/dist/components/page-header.d.ts +2 -0
  123. package/dist/components/page-header.js +1 -0
  124. package/dist/components/providers.d.ts +2 -0
  125. package/dist/components/providers.js +1 -0
  126. package/dist/components/themes/index.d.ts +3 -0
  127. package/dist/components/themes/index.js +1 -0
  128. package/dist/components/themes/style-switcher.d.ts +2 -0
  129. package/dist/components/themes/style-switcher.js +1 -0
  130. package/dist/components-list-BCV3yN6H.js +2 -0
  131. package/dist/components-list-BCV3yN6H.js.map +1 -0
  132. package/dist/components-list-ZLlUD-Nr.d.ts +12 -0
  133. package/dist/components-list-ZLlUD-Nr.d.ts.map +1 -0
  134. package/dist/context/context.d.ts +2 -0
  135. package/dist/context/context.js +1 -0
  136. package/dist/context/context.types.d.ts +2 -0
  137. package/dist/context/context.types.js +0 -0
  138. package/dist/context/index.d.ts +4 -0
  139. package/dist/context/index.js +1 -0
  140. package/dist/context-Bd4Sf8r8.js +2 -0
  141. package/dist/context-Bd4Sf8r8.js.map +1 -0
  142. package/dist/context-BoqMzqgD.js +0 -0
  143. package/dist/context-tLL-jUw_.d.ts +26 -0
  144. package/dist/context-tLL-jUw_.d.ts.map +1 -0
  145. package/dist/context.types-8c0sgn5Q.js +0 -0
  146. package/dist/context.types-DgaGu8Ly.d.ts +57 -0
  147. package/dist/context.types-DgaGu8Ly.d.ts.map +1 -0
  148. package/dist/copy-button-Bh7DmVLN.d.ts +22 -0
  149. package/dist/copy-button-Bh7DmVLN.d.ts.map +1 -0
  150. package/dist/copy-button-D50DXq56.js +2 -0
  151. package/dist/copy-button-D50DXq56.js.map +1 -0
  152. package/dist/copy-button-DpLK4Hc9.js +0 -0
  153. package/dist/copy-button.types-D6D1XKDN.d.ts +19 -0
  154. package/dist/copy-button.types-D6D1XKDN.d.ts.map +1 -0
  155. package/dist/copy-button.types-ZXpoKEH1.js +0 -0
  156. package/dist/docs-B9qhW8T2.js +0 -0
  157. package/dist/docs-copy-page-B1HSXqlm.js +3 -0
  158. package/dist/docs-copy-page-B1HSXqlm.js.map +1 -0
  159. package/dist/docs-copy-page-rZ3GkUUQ.d.ts +13 -0
  160. package/dist/docs-copy-page-rZ3GkUUQ.d.ts.map +1 -0
  161. package/dist/docs-pager-2p2cKZcg.js +2 -0
  162. package/dist/docs-pager-2p2cKZcg.js.map +1 -0
  163. package/dist/docs-pager-CLERxm13.d.ts +25 -0
  164. package/dist/docs-pager-CLERxm13.d.ts.map +1 -0
  165. package/dist/docs-sidebar-C4HMPDIN.d.ts +30 -0
  166. package/dist/docs-sidebar-C4HMPDIN.d.ts.map +1 -0
  167. package/dist/docs-sidebar-Cq7haHti.js +2 -0
  168. package/dist/docs-sidebar-Cq7haHti.js.map +1 -0
  169. package/dist/docs-toc-B4_Znnrj.d.ts +13 -0
  170. package/dist/docs-toc-B4_Znnrj.d.ts.map +1 -0
  171. package/dist/docs-toc-DfQz3sNZ.js +2 -0
  172. package/dist/docs-toc-DfQz3sNZ.js.map +1 -0
  173. package/dist/events-BKAEw9TQ.d.ts +25 -0
  174. package/dist/events-BKAEw9TQ.d.ts.map +1 -0
  175. package/dist/events-D55YvIRi.js +2 -0
  176. package/dist/events-D55YvIRi.js.map +1 -0
  177. package/dist/figcaption-block-B7CmTI6d.d.ts +11 -0
  178. package/dist/figcaption-block-B7CmTI6d.d.ts.map +1 -0
  179. package/dist/figcaption-block-DWZhs-6i.js +2 -0
  180. package/dist/figcaption-block-DWZhs-6i.js.map +1 -0
  181. package/dist/framework-docs-ZYLz3BBy.js +2 -0
  182. package/dist/framework-docs-ZYLz3BBy.js.map +1 -0
  183. package/dist/framework-docs-tYKaeYsi.d.ts +13 -0
  184. package/dist/framework-docs-tYKaeYsi.d.ts.map +1 -0
  185. package/dist/header-shell-BusaKA4C.d.ts +39 -0
  186. package/dist/header-shell-BusaKA4C.d.ts.map +1 -0
  187. package/dist/header-shell-CWHnv2ot.js +2 -0
  188. package/dist/header-shell-CWHnv2ot.js.map +1 -0
  189. package/dist/hooks/index.d.ts +8 -0
  190. package/dist/hooks/index.js +1 -0
  191. package/dist/hooks/use-colors.d.ts +3 -0
  192. package/dist/hooks/use-colors.js +1 -0
  193. package/dist/hooks/use-config.d.ts +2 -0
  194. package/dist/hooks/use-config.js +1 -0
  195. package/dist/hooks/use-lift-mode.d.ts +2 -0
  196. package/dist/hooks/use-lift-mode.js +1 -0
  197. package/dist/hooks/use-meta-colors.d.ts +2 -0
  198. package/dist/hooks/use-meta-colors.js +1 -0
  199. package/dist/hooks/use-mounted.d.ts +2 -0
  200. package/dist/hooks/use-mounted.js +1 -0
  201. package/dist/hooks/use-themes-config.d.ts +2 -0
  202. package/dist/hooks/use-themes-config.js +1 -0
  203. package/dist/icons-BqnlXRgx.d.ts +30 -0
  204. package/dist/icons-BqnlXRgx.d.ts.map +1 -0
  205. package/dist/icons-bFf026bR.js +2 -0
  206. package/dist/icons-bFf026bR.js.map +1 -0
  207. package/dist/index-2mWOLEIP.d.ts +7 -0
  208. package/dist/index-2mWOLEIP.d.ts.map +1 -0
  209. package/dist/index-BZ1Usw1L.d.ts +8 -0
  210. package/dist/index-BZ1Usw1L.d.ts.map +1 -0
  211. package/dist/index-Bunxo_8h.d.ts +8 -0
  212. package/dist/index-Bunxo_8h.d.ts.map +1 -0
  213. package/dist/index-BwEOYyLd.d.ts +1 -0
  214. package/dist/index-CJOkJMYm.d.ts +1 -0
  215. package/dist/index-Cp46Zvz-.d.ts +1 -0
  216. package/dist/index-CsVdkYso.d.ts +1 -0
  217. package/dist/index-DIk3-d3u.d.ts +1 -0
  218. package/dist/index-LAzYY5Wa.d.ts +1 -0
  219. package/dist/index-k586z2Y3.d.ts +1 -0
  220. package/dist/index-mj9Ys67i.d.ts +1 -0
  221. package/dist/index-otwxHF3U.d.ts +1 -0
  222. package/dist/index.d.ts +11 -0
  223. package/dist/index.js +1 -0
  224. package/dist/layouts-hVp-aKom.js +0 -0
  225. package/dist/lib/charts.d.ts +2 -0
  226. package/dist/lib/charts.js +1 -0
  227. package/dist/lib/colors.d.ts +2 -0
  228. package/dist/lib/colors.js +1 -0
  229. package/dist/lib/events.d.ts +2 -0
  230. package/dist/lib/events.js +1 -0
  231. package/dist/lib/index.d.ts +6 -0
  232. package/dist/lib/index.js +1 -0
  233. package/dist/lib/registry-colors-data.d.ts +229 -0
  234. package/dist/lib/registry-colors-data.d.ts.map +1 -0
  235. package/dist/lib/registry-colors-data.js +1 -0
  236. package/dist/lib/registry-styles.d.ts +2 -0
  237. package/dist/lib/registry-styles.js +1 -0
  238. package/dist/lib/themes.d.ts +2 -0
  239. package/dist/lib/themes.js +1 -0
  240. package/dist/lib/utils.d.ts +2 -0
  241. package/dist/lib/utils.js +1 -0
  242. package/dist/main-nav-Df2pgQUs.js +2 -0
  243. package/dist/main-nav-Df2pgQUs.js.map +1 -0
  244. package/dist/main-nav-SathVgSN.d.ts +7 -0
  245. package/dist/main-nav-SathVgSN.d.ts.map +1 -0
  246. package/dist/mdx-CBnfwESR.d.ts +12 -0
  247. package/dist/mdx-CBnfwESR.d.ts.map +1 -0
  248. package/dist/mdx-components-BoD1jTr7.js +0 -0
  249. package/dist/mdx-cqn1ggXI.js +2 -0
  250. package/dist/mdx-cqn1ggXI.js.map +1 -0
  251. package/dist/metadata-plugin-Ag61IUUu.d.ts +7 -0
  252. package/dist/metadata-plugin-Ag61IUUu.d.ts.map +1 -0
  253. package/dist/metadata-plugin-Mc8lCfYT.js +2 -0
  254. package/dist/metadata-plugin-Mc8lCfYT.js.map +1 -0
  255. package/dist/mobile-nav-DRQtHK-O.js +2 -0
  256. package/dist/mobile-nav-DRQtHK-O.js.map +1 -0
  257. package/dist/mobile-nav-hEfoD2ld.d.ts +7 -0
  258. package/dist/mobile-nav-hEfoD2ld.d.ts.map +1 -0
  259. package/dist/mode-toggle-BcPx4Vfk.d.ts +7 -0
  260. package/dist/mode-toggle-BcPx4Vfk.d.ts.map +1 -0
  261. package/dist/mode-toggle-CGGAaMUK.js +2 -0
  262. package/dist/mode-toggle-CGGAaMUK.js.map +1 -0
  263. package/dist/nav-0JAtUIst.d.ts +18 -0
  264. package/dist/nav-0JAtUIst.d.ts.map +1 -0
  265. package/dist/nav-6wUjcK0K.js +0 -0
  266. package/dist/page-header-BGKsl1LK.js +2 -0
  267. package/dist/page-header-BGKsl1LK.js.map +1 -0
  268. package/dist/page-header-Brw3423H.d.ts +23 -0
  269. package/dist/page-header-Brw3423H.d.ts.map +1 -0
  270. package/dist/pre-block-BThyCz1h.js +2 -0
  271. package/dist/pre-block-BThyCz1h.js.map +1 -0
  272. package/dist/pre-block-CTP3z9eq.d.ts +33 -0
  273. package/dist/pre-block-CTP3z9eq.d.ts.map +1 -0
  274. package/dist/providers-BU3xm7I4.d.ts +11 -0
  275. package/dist/providers-BU3xm7I4.d.ts.map +1 -0
  276. package/dist/providers-fDpVqSs8.js +2 -0
  277. package/dist/providers-fDpVqSs8.js.map +1 -0
  278. package/dist/registry-colors-data-FyxAihEQ.js +2 -0
  279. package/dist/registry-colors-data-FyxAihEQ.js.map +1 -0
  280. package/dist/registry-styles-Cm1HpC4C.js +2 -0
  281. package/dist/registry-styles-Cm1HpC4C.js.map +1 -0
  282. package/dist/registry-styles-WvCGd0xY.d.ts +9 -0
  283. package/dist/registry-styles-WvCGd0xY.d.ts.map +1 -0
  284. package/dist/rehype-pre-block-source-Bz3-G4tr.js +2 -0
  285. package/dist/rehype-pre-block-source-Bz3-G4tr.js.map +1 -0
  286. package/dist/rehype-pre-block-source-Le9z9RN8.d.ts +7 -0
  287. package/dist/rehype-pre-block-source-Le9z9RN8.d.ts.map +1 -0
  288. package/dist/rehype-title-C1q6PbyG.js +2 -0
  289. package/dist/rehype-title-C1q6PbyG.js.map +1 -0
  290. package/dist/rehype-title-Dwt_OKnR.d.ts +7 -0
  291. package/dist/rehype-title-Dwt_OKnR.d.ts.map +1 -0
  292. package/dist/site-footer-CsUC-l-l.js +2 -0
  293. package/dist/site-footer-CsUC-l-l.js.map +1 -0
  294. package/dist/site-header-Bi3-9Kl3.js +2 -0
  295. package/dist/site-header-Bi3-9Kl3.js.map +1 -0
  296. package/dist/style-switcher-BXEGTMW2.d.ts +12 -0
  297. package/dist/style-switcher-BXEGTMW2.d.ts.map +1 -0
  298. package/dist/style-switcher-CpcMcuwL.js +2 -0
  299. package/dist/style-switcher-CpcMcuwL.js.map +1 -0
  300. package/dist/styles/base.css +156 -0
  301. package/dist/styles/docs.css +186 -0
  302. package/dist/styles/mdx.css +205 -0
  303. package/dist/table-B1hJe5kw.d.ts +10 -0
  304. package/dist/table-B1hJe5kw.d.ts.map +1 -0
  305. package/dist/table-Sc60jiil.js +2 -0
  306. package/dist/table-Sc60jiil.js.map +1 -0
  307. package/dist/tabs-DWxNPhgN.d.ts +23 -0
  308. package/dist/tabs-DWxNPhgN.d.ts.map +1 -0
  309. package/dist/tabs-KvYm5au9.js +2 -0
  310. package/dist/tabs-KvYm5au9.js.map +1 -0
  311. package/dist/tailwind-indicator-CV2jUfip.js +2 -0
  312. package/dist/tailwind-indicator-CV2jUfip.js.map +1 -0
  313. package/dist/themes-Dg5GgDgK.js +0 -0
  314. package/dist/themes-DsvojWlq.js +2 -0
  315. package/dist/themes-DsvojWlq.js.map +1 -0
  316. package/dist/themes-dv8YVpXg.d.ts +495 -0
  317. package/dist/themes-dv8YVpXg.d.ts.map +1 -0
  318. package/dist/typepography-B_jjjv9F.d.ts +54 -0
  319. package/dist/typepography-B_jjjv9F.d.ts.map +1 -0
  320. package/dist/typepography-Btk-lJ3O.js +2 -0
  321. package/dist/typepography-Btk-lJ3O.js.map +1 -0
  322. package/dist/types/index.d.ts +4 -0
  323. package/dist/types/index.js +0 -0
  324. package/dist/types/nav.d.ts +2 -0
  325. package/dist/types/nav.js +0 -0
  326. package/dist/types/unist.d.ts +2 -0
  327. package/dist/types/unist.js +0 -0
  328. package/dist/unist-Bs-H_R8g.d.ts +40 -0
  329. package/dist/unist-Bs-H_R8g.d.ts.map +1 -0
  330. package/dist/unist-DpNAVhDX.js +0 -0
  331. package/dist/use-colors-CeiLGCjZ.d.ts +13 -0
  332. package/dist/use-colors-CeiLGCjZ.d.ts.map +1 -0
  333. package/dist/use-colors-JhoQAYK2.js +2 -0
  334. package/dist/use-colors-JhoQAYK2.js.map +1 -0
  335. package/dist/use-config-CFygUPAg.d.ts +13 -0
  336. package/dist/use-config-CFygUPAg.d.ts.map +1 -0
  337. package/dist/use-config-D1zkiIbf.js +2 -0
  338. package/dist/use-config-D1zkiIbf.js.map +1 -0
  339. package/dist/use-lift-mode-Dya2HcpU.js +2 -0
  340. package/dist/use-lift-mode-Dya2HcpU.js.map +1 -0
  341. package/dist/use-lift-mode-IpZRia0D.d.ts +8 -0
  342. package/dist/use-lift-mode-IpZRia0D.d.ts.map +1 -0
  343. package/dist/use-meta-colors-BhIhFzvx.js +2 -0
  344. package/dist/use-meta-colors-BhIhFzvx.js.map +1 -0
  345. package/dist/use-meta-colors-C8OegAZO.d.ts +8 -0
  346. package/dist/use-meta-colors-C8OegAZO.d.ts.map +1 -0
  347. package/dist/use-mounted-D25Cx8rc.d.ts +5 -0
  348. package/dist/use-mounted-D25Cx8rc.d.ts.map +1 -0
  349. package/dist/use-mounted-SpB3P6Vt.js +2 -0
  350. package/dist/use-mounted-SpB3P6Vt.js.map +1 -0
  351. package/dist/use-themes-config-Bo-JZDNU.js +2 -0
  352. package/dist/use-themes-config-Bo-JZDNU.js.map +1 -0
  353. package/dist/use-themes-config-DfQCuhPn.d.ts +14 -0
  354. package/dist/use-themes-config-DfQCuhPn.d.ts.map +1 -0
  355. package/dist/utils-CMPpWmbv.d.ts +9 -0
  356. package/dist/utils-CMPpWmbv.d.ts.map +1 -0
  357. package/dist/utils-NjSy-iOL.js +2 -0
  358. package/dist/utils-NjSy-iOL.js.map +1 -0
  359. package/dist/velite/browser.d.ts +11 -0
  360. package/dist/velite/browser.d.ts.map +1 -0
  361. package/dist/velite/browser.js +2 -0
  362. package/dist/velite/browser.js.map +1 -0
  363. package/dist/velite/config.d.ts +21 -0
  364. package/dist/velite/config.d.ts.map +1 -0
  365. package/dist/velite/config.js +2 -0
  366. package/dist/velite/config.js.map +1 -0
  367. package/dist/velite/index.d.ts +10 -0
  368. package/dist/velite/index.js +1 -0
  369. package/dist/velite/plugins/index.d.ts +6 -0
  370. package/dist/velite/plugins/index.js +1 -0
  371. package/dist/velite/plugins/metadata-plugin.d.ts +4 -0
  372. package/dist/velite/plugins/metadata-plugin.js +1 -0
  373. package/dist/velite/plugins/rehype-pre-block-source.d.ts +4 -0
  374. package/dist/velite/plugins/rehype-pre-block-source.js +1 -0
  375. package/dist/velite/plugins/rehype-title.d.ts +4 -0
  376. package/dist/velite/plugins/rehype-title.js +1 -0
  377. package/dist/velite/rehype-npm-command.d.ts +8 -0
  378. package/dist/velite/rehype-npm-command.d.ts.map +1 -0
  379. package/dist/velite/rehype-npm-command.js +2 -0
  380. package/dist/velite/rehype-npm-command.js.map +1 -0
  381. package/dist/velite/utils.d.ts +5 -0
  382. package/dist/velite/utils.d.ts.map +1 -0
  383. package/dist/velite/utils.js +2 -0
  384. package/dist/velite/utils.js.map +1 -0
  385. package/package.json +174 -0
  386. package/src/client.ts +5 -0
  387. package/src/components/copy-button/copy-button.tsx +88 -0
  388. package/src/components/copy-button/copy-button.types.ts +17 -0
  389. package/src/components/copy-button/index.ts +2 -0
  390. package/src/components/docs/docs-copy-page.tsx +106 -0
  391. package/src/components/docs/docs-pager.tsx +114 -0
  392. package/src/components/docs/docs-sidebar.tsx +104 -0
  393. package/src/components/docs/docs-toc.tsx +104 -0
  394. package/src/components/docs/index.ts +4 -0
  395. package/src/components/icons.tsx +194 -0
  396. package/src/components/index.ts +13 -0
  397. package/src/components/layouts/command-menu/command-menu.tsx +166 -0
  398. package/src/components/layouts/command-menu/index.ts +1 -0
  399. package/src/components/layouts/index.ts +4 -0
  400. package/src/components/layouts/site-footer/index.tsx +70 -0
  401. package/src/components/layouts/site-header/header-shell.tsx +75 -0
  402. package/src/components/layouts/site-header/index.tsx +121 -0
  403. package/src/components/layouts/tailwind-indicator/index.tsx +16 -0
  404. package/src/components/main-nav.tsx +33 -0
  405. package/src/components/mdx/mdx-components/callout.tsx +17 -0
  406. package/src/components/mdx/mdx-components/code/code-block-wrapper.tsx +12 -0
  407. package/src/components/mdx/mdx-components/code/code-block.tsx +30 -0
  408. package/src/components/mdx/mdx-components/code/code-preview.tsx +80 -0
  409. package/src/components/mdx/mdx-components/code/component-preview.tsx +161 -0
  410. package/src/components/mdx/mdx-components/code/component-source.tsx +54 -0
  411. package/src/components/mdx/mdx-components/code/figcaption-block.tsx +25 -0
  412. package/src/components/mdx/mdx-components/code/index.ts +7 -0
  413. package/src/components/mdx/mdx-components/code/pre-block.tsx +103 -0
  414. package/src/components/mdx/mdx-components/code/span-block.tsx +13 -0
  415. package/src/components/mdx/mdx-components/components-list.tsx +23 -0
  416. package/src/components/mdx/mdx-components/exalidraw.tsx +12 -0
  417. package/src/components/mdx/mdx-components/framework-docs.tsx +20 -0
  418. package/src/components/mdx/mdx-components/index.ts +7 -0
  419. package/src/components/mdx/mdx-components/table.tsx +35 -0
  420. package/src/components/mdx/mdx-components/tabs.tsx +32 -0
  421. package/src/components/mdx/mdx-components/typepography.tsx +70 -0
  422. package/src/components/mdx/mdx.tsx +103 -0
  423. package/src/components/mobile-nav.tsx +91 -0
  424. package/src/components/mode-toggle.tsx +41 -0
  425. package/src/components/page-header.tsx +42 -0
  426. package/src/components/providers.tsx +14 -0
  427. package/src/components/themes/index.ts +1 -0
  428. package/src/components/themes/style-switcher.tsx +35 -0
  429. package/src/context/context.tsx +66 -0
  430. package/src/context/context.types.ts +55 -0
  431. package/src/context/index.ts +2 -0
  432. package/src/hooks/index.ts +6 -0
  433. package/src/hooks/use-colors.ts +27 -0
  434. package/src/hooks/use-config.ts +19 -0
  435. package/src/hooks/use-lift-mode.ts +19 -0
  436. package/src/hooks/use-meta-colors.ts +27 -0
  437. package/src/hooks/use-mounted.ts +11 -0
  438. package/src/hooks/use-themes-config.ts +17 -0
  439. package/src/index.ts +10 -0
  440. package/src/lib/charts.ts +23 -0
  441. package/src/lib/colors.ts +86 -0
  442. package/src/lib/events.ts +30 -0
  443. package/src/lib/index.ts +5 -0
  444. package/src/lib/registry-colors-data.ts +1810 -0
  445. package/src/lib/registry-styles.ts +8 -0
  446. package/src/lib/themes.ts +482 -0
  447. package/src/lib/utils.ts +42 -0
  448. package/src/styles/base.css +156 -0
  449. package/src/styles/docs.css +186 -0
  450. package/src/styles/mdx.css +205 -0
  451. package/src/types/index.ts +2 -0
  452. package/src/types/nav.ts +17 -0
  453. package/src/types/unist.ts +39 -0
  454. package/src/velite/browser.ts +11 -0
  455. package/src/velite/config.ts +118 -0
  456. package/src/velite/index.ts +5 -0
  457. package/src/velite/plugins/index.ts +3 -0
  458. package/src/velite/plugins/metadata-plugin.ts +26 -0
  459. package/src/velite/plugins/rehype-pre-block-source.ts +25 -0
  460. package/src/velite/plugins/rehype-title.ts +24 -0
  461. package/src/velite/rehype-npm-command.ts +42 -0
  462. package/src/velite/utils.ts +9 -0
@@ -0,0 +1,186 @@
1
+ @import "./base.css";
2
+ @import "./mdx.css";
3
+ @import "tw-animate-css";
4
+
5
+ @custom-variant dark (&:is(.dark *));
6
+
7
+ @font-face {
8
+ font-family: "Adjusted Lucida Sans Typewriter Fallback";
9
+ src: local("Lucida Sans Typewriter");
10
+ size-adjust: 119%;
11
+ ascent-override: 86%;
12
+ descent-override: 16%;
13
+ line-gap-override: 30%;
14
+ }
15
+
16
+ @font-face {
17
+ font-family: "Adjusted Arial Fallback";
18
+ src: local("Arial");
19
+ size-adjust: 99%;
20
+ ascent-override: 101%;
21
+ descent-override: 26%;
22
+ line-gap-override: 0%;
23
+ }
24
+
25
+ @font-face {
26
+ font-family: "Geist";
27
+ font-weight: 100 900;
28
+ font-display: swap;
29
+ src: url(/fonts/Geist-VF.woff2) format("woff2");
30
+ }
31
+
32
+ @font-face {
33
+ font-family: "Geist Mono";
34
+ font-weight: 100 900;
35
+ font-display: swap;
36
+ src: url(/fonts/GeistMono-VF.woff2) format("woff2");
37
+ }
38
+
39
+ @theme {
40
+ --animate-shine: shine 8s ease-in-out infinite;
41
+
42
+ @keyframes shine {
43
+ from {
44
+ background-position: 200% 0;
45
+ }
46
+
47
+ to {
48
+ background-position: -200% 0;
49
+ }
50
+ }
51
+ }
52
+
53
+ @layer base {
54
+ * {
55
+ @apply border-border font-medium;
56
+ -webkit-font-smoothing: antialiased;
57
+ -moz-osx-font-smoothing: grayscale;
58
+ scroll-behavior: smooth;
59
+ }
60
+
61
+ html {
62
+ @apply scroll-smooth;
63
+ }
64
+
65
+ .font-sans {
66
+ font-family: var(--font-sans-geist) !important;
67
+ }
68
+
69
+ .font-mono {
70
+ font-family: var(--font-mono-geist) !important;
71
+ }
72
+
73
+ ::-webkit-scrollbar {
74
+ width: 6px;
75
+ height: 6px;
76
+ }
77
+
78
+ ::-webkit-scrollbar-track {
79
+ background: transparent;
80
+ }
81
+
82
+ ::-webkit-scrollbar-corner {
83
+ background: transparent;
84
+ }
85
+
86
+ ::-webkit-scrollbar-thumb {
87
+ background: var(--border);
88
+ border-radius: 5px;
89
+ }
90
+
91
+ ::selection {
92
+ color: var(--selection-foreground);
93
+ background-color: var(--selection);
94
+ }
95
+
96
+ body {
97
+ @apply bg-background text-foreground;
98
+ font-feature-settings:
99
+ "rlig" 1,
100
+ "calt" 1;
101
+ font-synthesis-weight: none;
102
+ text-rendering: optimizeLegibility;
103
+ }
104
+
105
+ @supports (font: -apple-system-body) and (-webkit-appearance: none) {
106
+ [data-wrapper] {
107
+ @apply min-[1800px]:border-t;
108
+ }
109
+ }
110
+
111
+ image {
112
+ user-select: none;
113
+ }
114
+
115
+ a:active,
116
+ button:active {
117
+ @apply opacity-60 md:opacity-100;
118
+ }
119
+ }
120
+
121
+ @utility duck-truncate {
122
+ display: -webkit-box;
123
+ -webkit-box-orient: vertical;
124
+ -webkit-line-clamp: 1;
125
+ }
126
+
127
+ @layer utilities {
128
+ .step {
129
+ counter-increment: step;
130
+ }
131
+
132
+ .step::before {
133
+ content: counter(step);
134
+ @apply absolute w-9 h-9 bg-muted rounded-full font-mono font-medium text-center text-base inline-flex items-center justify-center -indent-px border-4 border-background;
135
+ @apply ml-[-50px] mt-[-4px];
136
+ }
137
+
138
+ .chunk-container {
139
+ @apply shadow-none;
140
+ }
141
+
142
+ .chunk-container::after {
143
+ content: "";
144
+ @apply absolute -inset-4 shadow-xl rounded-xl border;
145
+ }
146
+
147
+ .border-grid {
148
+ @apply border-border/30 dark:border-border border-dashed;
149
+ }
150
+
151
+ .container {
152
+ @apply 3xl:max-w-screen-2xl mx-auto max-w-[1400px] px-4 lg:px-8;
153
+ }
154
+ }
155
+
156
+ @media (max-width: 640px) {
157
+ .container {
158
+ @apply px-4;
159
+ }
160
+
161
+ [duck-abc] {
162
+ @apply w-600;
163
+ }
164
+ }
165
+
166
+ @layer utilities {
167
+ .ellipsis {
168
+ display: grid;
169
+ -webkit-box-orient: vertical;
170
+ grid-template-columns: 1fr 1fr;
171
+ overflow: hidden;
172
+ text-overflow: ellipsis;
173
+ -webkit-line-clamp: 1;
174
+ font-weight: 500;
175
+ white-space: nowrap;
176
+ }
177
+ }
178
+
179
+ @utility no-scrollbar {
180
+ -ms-overflow-style: none;
181
+ scrollbar-width: none;
182
+
183
+ &::-webkit-scrollbar {
184
+ display: none;
185
+ }
186
+ }
@@ -0,0 +1,205 @@
1
+ @font-face {
2
+ font-family: "JetBrains Mono";
3
+ font-weight: 100 900;
4
+ font-display: swap;
5
+ src: url(/fonts/JetBrainsMono-VF.woff2) format("woff2");
6
+ }
7
+
8
+ @layer components {
9
+ code,
10
+ code > * > *,
11
+ kbd,
12
+ samp,
13
+ pre {
14
+ font-family: var(--font-mono);
15
+ font-style: normal;
16
+ font-weight: 600;
17
+ font-optical-sizing: auto;
18
+ }
19
+
20
+ [data-theme="light"] {
21
+ display: block;
22
+ }
23
+
24
+ [data-theme="dark"] {
25
+ display: none;
26
+ }
27
+
28
+ .dark [data-theme="light"] {
29
+ display: none;
30
+ }
31
+
32
+ .dark [data-theme="dark"] {
33
+ display: block;
34
+ }
35
+
36
+ [data-rehype-pretty-code-fragment] {
37
+ @apply relative bg-muted/40 dark:bg-muted/40 rounded-lg border-border border mb-4 mt-6;
38
+ }
39
+
40
+ div[data-value]:not([data-value="cli"])[duck-tabs-content] > [data-rehype-pretty-code-fragment] {
41
+ @apply bg-transparent m-0 static rounded-none border-0;
42
+ }
43
+
44
+ [data-rehype-pretty-code-fragment] code {
45
+ counter-reset: line;
46
+ box-decoration-break: clone;
47
+ }
48
+
49
+ [data-rehype-pretty-code-fragment] .line {
50
+ @apply px-4 min-h-[1rem] py-0.5 w-full inline-block;
51
+ }
52
+
53
+ [data-rehype-pretty-code-fragment] [data-line-numbers] .line {
54
+ @apply px-2;
55
+ }
56
+
57
+ [data-rehype-pretty-code-fragment] [data-line-numbers] > .line::before {
58
+ display: inline-block;
59
+ width: 1.8rem;
60
+ margin-right: 1.4rem;
61
+ text-align: right;
62
+ content: counter(line);
63
+ counter-increment: line;
64
+ @apply text-zinc-50/40 text-xs;
65
+ }
66
+
67
+ [data-rehype-pretty-code-fragment] .line--highlighted,
68
+ [data-rehype-pretty-code-fragment] .word--highlighted {
69
+ @apply bg-foreground/4 dark:bg-foreground/5;
70
+ }
71
+
72
+ [data-rehype-pretty-code-fragment] .line-highlighted span {
73
+ @apply relative;
74
+ }
75
+
76
+ [data-rehype-pretty-code-fragment] .word--highlighted {
77
+ @apply rounded-md p-1;
78
+ }
79
+
80
+ strong {
81
+ @apply font-semibold;
82
+ }
83
+
84
+ strong > code {
85
+ @apply font-bold;
86
+ }
87
+
88
+ .steps {
89
+ &:first-child {
90
+ @apply !mt-6;
91
+ }
92
+
93
+ &:first-child > h3:first-child {
94
+ @apply !mt-6;
95
+ }
96
+
97
+ > h3 {
98
+ @apply mt-8 mb-4 text-base font-semibold;
99
+ }
100
+
101
+ > h3 + p {
102
+ @apply !mt-2;
103
+ }
104
+ }
105
+
106
+ [data-rehype-pretty-code-figure] {
107
+ position: relative;
108
+ margin-top: calc(var(--spacing) * 6);
109
+ overflow: hidden;
110
+ font-size: var(--text-base);
111
+ color: var(--color-code-foreground);
112
+ outline: none;
113
+ background-color: var(--color-code);
114
+ border-color: var(--border);
115
+ border-width: 0px;
116
+ border-radius: var(--radius-lg);
117
+ @apply -mx-1 md:-mx-1;
118
+
119
+ &:has([data-rehype-pretty-code-title]) [data-slot="copy-button"] {
120
+ top: calc(var(--spacing) * 1.5) !important;
121
+ }
122
+ }
123
+
124
+ [data-rehype-pretty-code-title] {
125
+ padding-block: calc(var(--spacing) * 2.5);
126
+ padding-inline: calc(var(--spacing) * 4);
127
+ font-family: var(--font-mono);
128
+ font-size: var(--text-base);
129
+ color: var(--color-code-foreground);
130
+ border-bottom: color-mix(in oklab, var(--border) 30%, transparent);
131
+ border-bottom-style: solid;
132
+ border-bottom-width: 1px;
133
+ }
134
+
135
+ [data-line-numbers] {
136
+ display: grid;
137
+ min-width: 100%;
138
+ white-space: pre;
139
+ border: 0;
140
+ background: transparent;
141
+ padding: 0;
142
+ counter-reset: line;
143
+ box-decoration-break: clone;
144
+ }
145
+
146
+ [data-line-numbers] [data-line]::before {
147
+ position: sticky;
148
+ left: 0;
149
+ display: inline-block;
150
+ width: calc(var(--spacing) * 16);
151
+ padding-right: calc(var(--spacing) * 6);
152
+ font-size: var(--text-base);
153
+ color: var(--color-code-number);
154
+ text-align: right;
155
+ content: counter(line);
156
+ counter-increment: line;
157
+ background-color: var(--color-code);
158
+ }
159
+
160
+ [data-line-numbers] [data-highlighted-line][data-line]::before {
161
+ background-color: var(--color-code-highlight);
162
+ }
163
+
164
+ [data-line] {
165
+ display: inline-block;
166
+ width: 100%;
167
+ min-height: calc(var(--spacing) * 1);
168
+ padding-top: calc(var(--spacing) * 0.5);
169
+ padding-bottom: calc(var(--spacing) * 0.5);
170
+ }
171
+
172
+ [data-line] span {
173
+ color: var(--shiki-light);
174
+
175
+ @variant dark {
176
+ color: var(--shiki-dark) !important;
177
+ }
178
+ }
179
+
180
+ [data-highlighted-line],
181
+ [data-highlighted-chars] {
182
+ position: relative;
183
+ background-color: var(--color-code-highlight);
184
+ }
185
+
186
+ [data-highlighted-line] {
187
+ &:after {
188
+ position: absolute;
189
+ top: 0;
190
+ left: 0;
191
+ width: 2px;
192
+ height: 100%;
193
+ content: "";
194
+ background-color: color-mix(in oklab, var(--muted-foreground) 50%, transparent);
195
+ }
196
+ }
197
+
198
+ [data-highlighted-chars] {
199
+ padding-block: 0.1rem;
200
+ padding-inline: 0.3rem;
201
+ font-family: var(--font-mono);
202
+ font-size: 0.8rem;
203
+ border-radius: var(--radius-md);
204
+ }
205
+ }
@@ -0,0 +1,2 @@
1
+ export * from './nav'
2
+ export * from './unist'
@@ -0,0 +1,17 @@
1
+ export interface NavItem {
2
+ title: string
3
+ href?: string
4
+ disabled?: boolean
5
+ external?: boolean
6
+ icon?: string
7
+ label?: string
8
+ collapsible?: boolean
9
+ }
10
+
11
+ export interface NavItemWithChildren extends NavItem {
12
+ items?: NavItemWithChildren[]
13
+ }
14
+
15
+ export interface MainNavItem extends NavItem {}
16
+
17
+ export interface SidebarNavItem extends NavItemWithChildren {}
@@ -0,0 +1,39 @@
1
+ import type { Node } from 'unist'
2
+
3
+ declare module 'unist' {
4
+ interface Data {
5
+ meta?: string
6
+ }
7
+ }
8
+
9
+ export interface UnistNode extends Node {
10
+ type: string
11
+ name?: string
12
+ tagName?: string
13
+ value?: string
14
+ properties?: {
15
+ __rawString__?: string
16
+ __className__?: string
17
+ __title__?: string
18
+ __marks__?: string[]
19
+ __event__?: string
20
+ [key: string]: unknown
21
+ } & NpmCommands
22
+ attributes?: {
23
+ name: string
24
+ value: unknown
25
+ type?: string
26
+ }[]
27
+ children?: UnistNode[]
28
+ }
29
+
30
+ export interface UnistTree extends Node {
31
+ children: UnistNode[]
32
+ }
33
+
34
+ export interface NpmCommands {
35
+ __npmCommand__?: string
36
+ __yarnCommand__?: string
37
+ __pnpmCommand__?: string
38
+ __bunCommand__?: string
39
+ }
@@ -0,0 +1,11 @@
1
+ const serverOnly = () => {
2
+ throw new Error('@gentleduck/docs/velite is server-only.')
3
+ }
4
+
5
+ export const docsVeliteConfig = {} as never
6
+ export const createDocsVeliteConfig = serverOnly as unknown as () => never
7
+ export const rehypeNpmCommand = serverOnly as unknown as () => never
8
+ export const cleanTocItems = serverOnly as unknown as () => never
9
+ export const rehypePreBlockSource = serverOnly as unknown as () => never
10
+ export const rehypeTitle = serverOnly as unknown as () => never
11
+ export const rhypeMetadataPlugin = serverOnly as unknown as () => never
@@ -0,0 +1,118 @@
1
+ import type { UnistNode } from '@duck-docs/types'
2
+ import { getHighlighter } from '@shikijs/compat'
3
+ import rehypeAutolinkHeadings from 'rehype-autolink-headings'
4
+ // @ts-ignore
5
+ import rehypePrettyCode from 'rehype-pretty-code'
6
+ import rehypeSlug from 'rehype-slug'
7
+ import { codeImport } from 'remark-code-import'
8
+ import remarkGfm from 'remark-gfm'
9
+ import type { Pluggable } from 'unified'
10
+ import { defineConfig, s, type ZodMeta } from 'velite'
11
+ import { rehypePreBlockSource, rehypeTitle, rhypeMetadataPlugin } from './plugins'
12
+ import { rehypeNpmCommand } from './rehype-npm-command'
13
+ import { cleanTocItems } from './utils'
14
+
15
+ export type DocsVeliteConfigOptions = {
16
+ docsPattern?: string
17
+ rehypePlugins?: Pluggable[]
18
+ rehypePluginsBefore?: Pluggable[]
19
+ remarkPlugins?: Pluggable[]
20
+ remarkPluginsBefore?: Pluggable[]
21
+ }
22
+
23
+ export function createDocsVeliteConfig({
24
+ docsPattern = 'docs/**/*.mdx',
25
+ rehypePlugins = [],
26
+ rehypePluginsBefore = [],
27
+ remarkPlugins = [],
28
+ remarkPluginsBefore = [],
29
+ }: DocsVeliteConfigOptions = {}) {
30
+ return defineConfig({
31
+ collections: {
32
+ docs: {
33
+ name: 'Docs',
34
+ pattern: docsPattern,
35
+ schema: s
36
+ .object({
37
+ body: s.mdx(),
38
+ component: s.boolean().default(false),
39
+ content: s.markdown(),
40
+ description: s.string(),
41
+ excerpt: s.excerpt(),
42
+ links: s.object({ api: s.string().optional(), doc: s.string().optional() }).optional(),
43
+ metadata: s.metadata(),
44
+ title: s.string().max(99),
45
+ toc: s.toc(),
46
+ })
47
+ .transform((data, { path, meta }) => {
48
+ const _meta = meta as ZodMeta & { path: string }
49
+ return {
50
+ ...data,
51
+ contentType: _meta.path.split('.').pop(),
52
+ flattenedPath: _meta.path
53
+ .split('/')
54
+ .slice(-2, -1)
55
+ .join('/')
56
+ .replace(/\.mdx$/, ''),
57
+ permalink: _meta.path.replace(/^.*docs\//, '').replace(/\.mdx$/, ''),
58
+ slug: _meta.path
59
+ .split('docs/')
60
+ .pop()
61
+ ?.replace(/\.mdx$/, '')
62
+ .replace(/^\/+/, '')
63
+ ? `docs/${_meta.path
64
+ .split('docs/')
65
+ .pop()
66
+ ?.replace(/\.mdx$/, '')
67
+ .replace(/^\/+/, '')}`
68
+ : 'docs',
69
+ sourceFileDir: _meta.path.split('/').slice(-3, -1).join('/'),
70
+ sourceFileName: _meta.path.split('/').pop(),
71
+ sourceFilePath: path,
72
+ toc: cleanTocItems(data.toc),
73
+ }
74
+ }),
75
+ },
76
+ },
77
+ mdx: {
78
+ rehypePlugins: [
79
+ ...rehypePluginsBefore,
80
+ // @ts-ignore
81
+ rehypeSlug,
82
+ rhypeMetadataPlugin,
83
+ [
84
+ rehypePrettyCode,
85
+ {
86
+ getHighlighter,
87
+ onVisitHighlightedLine(node: UnistNode) {
88
+ // @ts-ignore
89
+ node.properties.className.push('line--highlighted')
90
+ },
91
+ onVisitHighlightedWord(node: UnistNode) {
92
+ // @ts-ignore
93
+ node.properties.className = ['word--highlighted']
94
+ },
95
+ onVisitLine(node: UnistNode) {
96
+ if (node.children?.length === 0) {
97
+ node.children = [{ type: 'text', value: ' ' }]
98
+ }
99
+ },
100
+ theme: {
101
+ dark: 'catppuccin-mocha',
102
+ light: 'github-light',
103
+ },
104
+ },
105
+ ],
106
+ rehypeTitle,
107
+ rehypePreBlockSource,
108
+ rehypeNpmCommand,
109
+ // @ts-ignore
110
+ [rehypeAutolinkHeadings, { properties: { ariaLabel: 'Link to section', className: ['subheading-anchor'] } }],
111
+ ...rehypePlugins,
112
+ ],
113
+ remarkPlugins: [...remarkPluginsBefore, remarkGfm, codeImport, ...remarkPlugins],
114
+ },
115
+ }) as any
116
+ }
117
+
118
+ export const docsVeliteConfig = createDocsVeliteConfig()
@@ -0,0 +1,5 @@
1
+ export type { DocsVeliteConfigOptions } from './config'
2
+ export { createDocsVeliteConfig, docsVeliteConfig } from './config'
3
+ export * from './plugins'
4
+ export { rehypeNpmCommand } from './rehype-npm-command'
5
+ export { cleanTocItems } from './utils'
@@ -0,0 +1,3 @@
1
+ export * from './metadata-plugin'
2
+ export * from './rehype-pre-block-source'
3
+ export * from './rehype-title'
@@ -0,0 +1,26 @@
1
+ import type { UnistNode, UnistTree } from '@duck-docs/types'
2
+ import { visit } from 'unist-util-visit'
3
+
4
+ export function rhypeMetadataPlugin() {
5
+ return (tree: UnistTree): UnistTree => {
6
+ visit(tree, 'element', (node: UnistNode) => {
7
+ if (node.tagName === 'code' && node.children) {
8
+ let match = {} as any
9
+
10
+ if (node.data?.meta) {
11
+ const meta = node.data?.meta as string
12
+ match.__title__ = (meta?.match(/title="([^"]*)"/) ?? [])[1]
13
+ match.__marks__ = [...meta?.matchAll(/\/([^/]+)\//g)].map((m) => m[1])
14
+ }
15
+
16
+ node.properties = {
17
+ ...node.properties,
18
+ __rawString__: node.children?.[0]?.value,
19
+ ...match,
20
+ }
21
+ }
22
+ })
23
+
24
+ return tree
25
+ }
26
+ }
@@ -0,0 +1,25 @@
1
+ import type { UnistNode, UnistTree } from '@duck-docs/types'
2
+ import type { Nodes } from 'hast'
3
+ import { toString } from 'hast-util-to-string'
4
+ import { visit } from 'unist-util-visit'
5
+
6
+ export function rehypePreBlockSource() {
7
+ return (tree: UnistTree) => {
8
+ visit(tree, (node: UnistNode) => {
9
+ if (node?.type === 'element' && node?.tagName === 'div' && node?.properties) {
10
+ if (!('data-rehype-pretty-code-fragment' in node.properties)) {
11
+ return
12
+ }
13
+
14
+ node.children?.forEach((child: UnistNode) => {
15
+ if (child?.type === 'element' && child?.tagName === 'pre') {
16
+ child.properties = {
17
+ ...child?.properties,
18
+ __rawString__: toString(child as Nodes),
19
+ }
20
+ }
21
+ })
22
+ }
23
+ })
24
+ }
25
+ }
@@ -0,0 +1,24 @@
1
+ import type { UnistNode, UnistTree } from '@duck-docs/types'
2
+ import { visit } from 'unist-util-visit'
3
+
4
+ export function rehypeTitle() {
5
+ return (tree: UnistTree) => {
6
+ visit(tree, (node: UnistNode) => {
7
+ if (node?.type === 'element' && node?.tagName === 'div' && node?.properties) {
8
+ if (!('data-rehype-pretty-code-fragment' in node.properties)) {
9
+ return
10
+ }
11
+
12
+ node.children?.forEach((child: UnistNode) => {
13
+ if (
14
+ child.type === 'element' &&
15
+ child.tagName === 'div' &&
16
+ Object.keys(child.properties ?? {}).includes('data-rehype-pretty-code-title')
17
+ ) {
18
+ child.tagName = 'figcaption'
19
+ }
20
+ })
21
+ }
22
+ })
23
+ }
24
+ }