@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.
- package/LICENSE +21 -0
- package/dist/callout-CFw8zUIz.js +2 -0
- package/dist/callout-CFw8zUIz.js.map +1 -0
- package/dist/callout-VcT2d48I.d.ts +17 -0
- package/dist/callout-VcT2d48I.d.ts.map +1 -0
- package/dist/charts-DX0UohRi.js +2 -0
- package/dist/charts-DX0UohRi.js.map +1 -0
- package/dist/charts-hfCEZEQp.d.ts +6 -0
- package/dist/charts-hfCEZEQp.d.ts.map +1 -0
- package/dist/client.d.ts +54 -0
- package/dist/client.js +1 -0
- package/dist/code-Cz75Womb.js +0 -0
- package/dist/code-block-CR2loi-i.d.ts +14 -0
- package/dist/code-block-CR2loi-i.d.ts.map +1 -0
- package/dist/code-block-DqFdGhI-.js +2 -0
- package/dist/code-block-DqFdGhI-.js.map +1 -0
- package/dist/code-block-wrapper-C8I0XMsN.d.ts +12 -0
- package/dist/code-block-wrapper-C8I0XMsN.d.ts.map +1 -0
- package/dist/code-block-wrapper-CCAw9mie.js +2 -0
- package/dist/code-block-wrapper-CCAw9mie.js.map +1 -0
- package/dist/code-preview-CeNXQxYN.d.ts +20 -0
- package/dist/code-preview-CeNXQxYN.d.ts.map +1 -0
- package/dist/code-preview-cIvw8qyg.js +2 -0
- package/dist/code-preview-cIvw8qyg.js.map +1 -0
- package/dist/colors-Ba_cRR6y.js +2 -0
- package/dist/colors-Ba_cRR6y.js.map +1 -0
- package/dist/colors-CpJMSMtf.d.ts +47 -0
- package/dist/colors-CpJMSMtf.d.ts.map +1 -0
- package/dist/command-menu-7HTBKVxd.js +0 -0
- package/dist/command-menu-BVebU1JI.js +2 -0
- package/dist/command-menu-BVebU1JI.js.map +1 -0
- package/dist/command-menu-C8RLyuBe.d.ts +7 -0
- package/dist/command-menu-C8RLyuBe.d.ts.map +1 -0
- package/dist/component-preview-CL6guE-v.js +2 -0
- package/dist/component-preview-CL6guE-v.js.map +1 -0
- package/dist/component-preview-DknaF8TG.d.ts +33 -0
- package/dist/component-preview-DknaF8TG.d.ts.map +1 -0
- package/dist/component-source-BCBDjfEb.js +5 -0
- package/dist/component-source-BCBDjfEb.js.map +1 -0
- package/dist/component-source-IrGlRkUy.d.ts +17 -0
- package/dist/component-source-IrGlRkUy.d.ts.map +1 -0
- package/dist/components/copy-button/copy-button.d.ts +4 -0
- package/dist/components/copy-button/copy-button.js +1 -0
- package/dist/components/copy-button/copy-button.types.d.ts +3 -0
- package/dist/components/copy-button/copy-button.types.js +0 -0
- package/dist/components/copy-button/index.d.ts +5 -0
- package/dist/components/copy-button/index.js +1 -0
- package/dist/components/docs/docs-copy-page.d.ts +2 -0
- package/dist/components/docs/docs-copy-page.js +1 -0
- package/dist/components/docs/docs-pager.d.ts +4 -0
- package/dist/components/docs/docs-pager.js +1 -0
- package/dist/components/docs/docs-sidebar.d.ts +4 -0
- package/dist/components/docs/docs-sidebar.js +1 -0
- package/dist/components/docs/docs-toc.d.ts +4 -0
- package/dist/components/docs/docs-toc.js +1 -0
- package/dist/components/docs/index.d.ts +8 -0
- package/dist/components/docs/index.js +1 -0
- package/dist/components/icons.d.ts +2 -0
- package/dist/components/icons.js +1 -0
- package/dist/components/index.d.ts +44 -0
- package/dist/components/index.js +1 -0
- package/dist/components/layouts/command-menu/command-menu.d.ts +2 -0
- package/dist/components/layouts/command-menu/command-menu.js +1 -0
- package/dist/components/layouts/command-menu/index.d.ts +3 -0
- package/dist/components/layouts/command-menu/index.js +1 -0
- package/dist/components/layouts/index.d.ts +8 -0
- package/dist/components/layouts/index.js +1 -0
- package/dist/components/layouts/site-footer/index.d.ts +2 -0
- package/dist/components/layouts/site-footer/index.js +1 -0
- package/dist/components/layouts/site-header/header-shell.d.ts +2 -0
- package/dist/components/layouts/site-header/header-shell.js +1 -0
- package/dist/components/layouts/site-header/index.d.ts +3 -0
- package/dist/components/layouts/site-header/index.js +1 -0
- package/dist/components/layouts/tailwind-indicator/index.d.ts +2 -0
- package/dist/components/layouts/tailwind-indicator/index.js +1 -0
- package/dist/components/main-nav.d.ts +2 -0
- package/dist/components/main-nav.js +1 -0
- package/dist/components/mdx/mdx-components/callout.d.ts +2 -0
- package/dist/components/mdx/mdx-components/callout.js +1 -0
- package/dist/components/mdx/mdx-components/code/code-block-wrapper.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/code-block-wrapper.js +1 -0
- package/dist/components/mdx/mdx-components/code/code-block.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/code-block.js +1 -0
- package/dist/components/mdx/mdx-components/code/code-preview.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/code-preview.js +1 -0
- package/dist/components/mdx/mdx-components/code/component-preview.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/component-preview.js +1 -0
- package/dist/components/mdx/mdx-components/code/component-source.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/component-source.js +1 -0
- package/dist/components/mdx/mdx-components/code/figcaption-block.d.ts +2 -0
- package/dist/components/mdx/mdx-components/code/figcaption-block.js +1 -0
- package/dist/components/mdx/mdx-components/code/index.d.ts +11 -0
- package/dist/components/mdx/mdx-components/code/index.js +1 -0
- package/dist/components/mdx/mdx-components/code/pre-block.d.ts +4 -0
- package/dist/components/mdx/mdx-components/code/pre-block.js +1 -0
- package/dist/components/mdx/mdx-components/code/span-block.d.ts +11 -0
- package/dist/components/mdx/mdx-components/code/span-block.d.ts.map +1 -0
- package/dist/components/mdx/mdx-components/code/span-block.js +2 -0
- package/dist/components/mdx/mdx-components/code/span-block.js.map +1 -0
- package/dist/components/mdx/mdx-components/components-list.d.ts +4 -0
- package/dist/components/mdx/mdx-components/components-list.js +1 -0
- package/dist/components/mdx/mdx-components/exalidraw.d.ts +7 -0
- package/dist/components/mdx/mdx-components/exalidraw.d.ts.map +1 -0
- package/dist/components/mdx/mdx-components/exalidraw.js +2 -0
- package/dist/components/mdx/mdx-components/exalidraw.js.map +1 -0
- package/dist/components/mdx/mdx-components/framework-docs.d.ts +2 -0
- package/dist/components/mdx/mdx-components/framework-docs.js +1 -0
- package/dist/components/mdx/mdx-components/index.d.ts +20 -0
- package/dist/components/mdx/mdx-components/index.js +1 -0
- package/dist/components/mdx/mdx-components/table.d.ts +2 -0
- package/dist/components/mdx/mdx-components/table.js +1 -0
- package/dist/components/mdx/mdx-components/tabs.d.ts +2 -0
- package/dist/components/mdx/mdx-components/tabs.js +1 -0
- package/dist/components/mdx/mdx-components/typepography.d.ts +2 -0
- package/dist/components/mdx/mdx-components/typepography.js +1 -0
- package/dist/components/mdx/mdx.d.ts +2 -0
- package/dist/components/mdx/mdx.js +1 -0
- package/dist/components/mobile-nav.d.ts +2 -0
- package/dist/components/mobile-nav.js +1 -0
- package/dist/components/mode-toggle.d.ts +2 -0
- package/dist/components/mode-toggle.js +1 -0
- package/dist/components/page-header.d.ts +2 -0
- package/dist/components/page-header.js +1 -0
- package/dist/components/providers.d.ts +2 -0
- package/dist/components/providers.js +1 -0
- package/dist/components/themes/index.d.ts +3 -0
- package/dist/components/themes/index.js +1 -0
- package/dist/components/themes/style-switcher.d.ts +2 -0
- package/dist/components/themes/style-switcher.js +1 -0
- package/dist/components-list-BCV3yN6H.js +2 -0
- package/dist/components-list-BCV3yN6H.js.map +1 -0
- package/dist/components-list-ZLlUD-Nr.d.ts +12 -0
- package/dist/components-list-ZLlUD-Nr.d.ts.map +1 -0
- package/dist/context/context.d.ts +2 -0
- package/dist/context/context.js +1 -0
- package/dist/context/context.types.d.ts +2 -0
- package/dist/context/context.types.js +0 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.js +1 -0
- package/dist/context-Bd4Sf8r8.js +2 -0
- package/dist/context-Bd4Sf8r8.js.map +1 -0
- package/dist/context-BoqMzqgD.js +0 -0
- package/dist/context-tLL-jUw_.d.ts +26 -0
- package/dist/context-tLL-jUw_.d.ts.map +1 -0
- package/dist/context.types-8c0sgn5Q.js +0 -0
- package/dist/context.types-DgaGu8Ly.d.ts +57 -0
- package/dist/context.types-DgaGu8Ly.d.ts.map +1 -0
- package/dist/copy-button-Bh7DmVLN.d.ts +22 -0
- package/dist/copy-button-Bh7DmVLN.d.ts.map +1 -0
- package/dist/copy-button-D50DXq56.js +2 -0
- package/dist/copy-button-D50DXq56.js.map +1 -0
- package/dist/copy-button-DpLK4Hc9.js +0 -0
- package/dist/copy-button.types-D6D1XKDN.d.ts +19 -0
- package/dist/copy-button.types-D6D1XKDN.d.ts.map +1 -0
- package/dist/copy-button.types-ZXpoKEH1.js +0 -0
- package/dist/docs-B9qhW8T2.js +0 -0
- package/dist/docs-copy-page-B1HSXqlm.js +3 -0
- package/dist/docs-copy-page-B1HSXqlm.js.map +1 -0
- package/dist/docs-copy-page-rZ3GkUUQ.d.ts +13 -0
- package/dist/docs-copy-page-rZ3GkUUQ.d.ts.map +1 -0
- package/dist/docs-pager-2p2cKZcg.js +2 -0
- package/dist/docs-pager-2p2cKZcg.js.map +1 -0
- package/dist/docs-pager-CLERxm13.d.ts +25 -0
- package/dist/docs-pager-CLERxm13.d.ts.map +1 -0
- package/dist/docs-sidebar-C4HMPDIN.d.ts +30 -0
- package/dist/docs-sidebar-C4HMPDIN.d.ts.map +1 -0
- package/dist/docs-sidebar-Cq7haHti.js +2 -0
- package/dist/docs-sidebar-Cq7haHti.js.map +1 -0
- package/dist/docs-toc-B4_Znnrj.d.ts +13 -0
- package/dist/docs-toc-B4_Znnrj.d.ts.map +1 -0
- package/dist/docs-toc-DfQz3sNZ.js +2 -0
- package/dist/docs-toc-DfQz3sNZ.js.map +1 -0
- package/dist/events-BKAEw9TQ.d.ts +25 -0
- package/dist/events-BKAEw9TQ.d.ts.map +1 -0
- package/dist/events-D55YvIRi.js +2 -0
- package/dist/events-D55YvIRi.js.map +1 -0
- package/dist/figcaption-block-B7CmTI6d.d.ts +11 -0
- package/dist/figcaption-block-B7CmTI6d.d.ts.map +1 -0
- package/dist/figcaption-block-DWZhs-6i.js +2 -0
- package/dist/figcaption-block-DWZhs-6i.js.map +1 -0
- package/dist/framework-docs-ZYLz3BBy.js +2 -0
- package/dist/framework-docs-ZYLz3BBy.js.map +1 -0
- package/dist/framework-docs-tYKaeYsi.d.ts +13 -0
- package/dist/framework-docs-tYKaeYsi.d.ts.map +1 -0
- package/dist/header-shell-BusaKA4C.d.ts +39 -0
- package/dist/header-shell-BusaKA4C.d.ts.map +1 -0
- package/dist/header-shell-CWHnv2ot.js +2 -0
- package/dist/header-shell-CWHnv2ot.js.map +1 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-colors.d.ts +3 -0
- package/dist/hooks/use-colors.js +1 -0
- package/dist/hooks/use-config.d.ts +2 -0
- package/dist/hooks/use-config.js +1 -0
- package/dist/hooks/use-lift-mode.d.ts +2 -0
- package/dist/hooks/use-lift-mode.js +1 -0
- package/dist/hooks/use-meta-colors.d.ts +2 -0
- package/dist/hooks/use-meta-colors.js +1 -0
- package/dist/hooks/use-mounted.d.ts +2 -0
- package/dist/hooks/use-mounted.js +1 -0
- package/dist/hooks/use-themes-config.d.ts +2 -0
- package/dist/hooks/use-themes-config.js +1 -0
- package/dist/icons-BqnlXRgx.d.ts +30 -0
- package/dist/icons-BqnlXRgx.d.ts.map +1 -0
- package/dist/icons-bFf026bR.js +2 -0
- package/dist/icons-bFf026bR.js.map +1 -0
- package/dist/index-2mWOLEIP.d.ts +7 -0
- package/dist/index-2mWOLEIP.d.ts.map +1 -0
- package/dist/index-BZ1Usw1L.d.ts +8 -0
- package/dist/index-BZ1Usw1L.d.ts.map +1 -0
- package/dist/index-Bunxo_8h.d.ts +8 -0
- package/dist/index-Bunxo_8h.d.ts.map +1 -0
- package/dist/index-BwEOYyLd.d.ts +1 -0
- package/dist/index-CJOkJMYm.d.ts +1 -0
- package/dist/index-Cp46Zvz-.d.ts +1 -0
- package/dist/index-CsVdkYso.d.ts +1 -0
- package/dist/index-DIk3-d3u.d.ts +1 -0
- package/dist/index-LAzYY5Wa.d.ts +1 -0
- package/dist/index-k586z2Y3.d.ts +1 -0
- package/dist/index-mj9Ys67i.d.ts +1 -0
- package/dist/index-otwxHF3U.d.ts +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/dist/layouts-hVp-aKom.js +0 -0
- package/dist/lib/charts.d.ts +2 -0
- package/dist/lib/charts.js +1 -0
- package/dist/lib/colors.d.ts +2 -0
- package/dist/lib/colors.js +1 -0
- package/dist/lib/events.d.ts +2 -0
- package/dist/lib/events.js +1 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/registry-colors-data.d.ts +229 -0
- package/dist/lib/registry-colors-data.d.ts.map +1 -0
- package/dist/lib/registry-colors-data.js +1 -0
- package/dist/lib/registry-styles.d.ts +2 -0
- package/dist/lib/registry-styles.js +1 -0
- package/dist/lib/themes.d.ts +2 -0
- package/dist/lib/themes.js +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +1 -0
- package/dist/main-nav-Df2pgQUs.js +2 -0
- package/dist/main-nav-Df2pgQUs.js.map +1 -0
- package/dist/main-nav-SathVgSN.d.ts +7 -0
- package/dist/main-nav-SathVgSN.d.ts.map +1 -0
- package/dist/mdx-CBnfwESR.d.ts +12 -0
- package/dist/mdx-CBnfwESR.d.ts.map +1 -0
- package/dist/mdx-components-BoD1jTr7.js +0 -0
- package/dist/mdx-cqn1ggXI.js +2 -0
- package/dist/mdx-cqn1ggXI.js.map +1 -0
- package/dist/metadata-plugin-Ag61IUUu.d.ts +7 -0
- package/dist/metadata-plugin-Ag61IUUu.d.ts.map +1 -0
- package/dist/metadata-plugin-Mc8lCfYT.js +2 -0
- package/dist/metadata-plugin-Mc8lCfYT.js.map +1 -0
- package/dist/mobile-nav-DRQtHK-O.js +2 -0
- package/dist/mobile-nav-DRQtHK-O.js.map +1 -0
- package/dist/mobile-nav-hEfoD2ld.d.ts +7 -0
- package/dist/mobile-nav-hEfoD2ld.d.ts.map +1 -0
- package/dist/mode-toggle-BcPx4Vfk.d.ts +7 -0
- package/dist/mode-toggle-BcPx4Vfk.d.ts.map +1 -0
- package/dist/mode-toggle-CGGAaMUK.js +2 -0
- package/dist/mode-toggle-CGGAaMUK.js.map +1 -0
- package/dist/nav-0JAtUIst.d.ts +18 -0
- package/dist/nav-0JAtUIst.d.ts.map +1 -0
- package/dist/nav-6wUjcK0K.js +0 -0
- package/dist/page-header-BGKsl1LK.js +2 -0
- package/dist/page-header-BGKsl1LK.js.map +1 -0
- package/dist/page-header-Brw3423H.d.ts +23 -0
- package/dist/page-header-Brw3423H.d.ts.map +1 -0
- package/dist/pre-block-BThyCz1h.js +2 -0
- package/dist/pre-block-BThyCz1h.js.map +1 -0
- package/dist/pre-block-CTP3z9eq.d.ts +33 -0
- package/dist/pre-block-CTP3z9eq.d.ts.map +1 -0
- package/dist/providers-BU3xm7I4.d.ts +11 -0
- package/dist/providers-BU3xm7I4.d.ts.map +1 -0
- package/dist/providers-fDpVqSs8.js +2 -0
- package/dist/providers-fDpVqSs8.js.map +1 -0
- package/dist/registry-colors-data-FyxAihEQ.js +2 -0
- package/dist/registry-colors-data-FyxAihEQ.js.map +1 -0
- package/dist/registry-styles-Cm1HpC4C.js +2 -0
- package/dist/registry-styles-Cm1HpC4C.js.map +1 -0
- package/dist/registry-styles-WvCGd0xY.d.ts +9 -0
- package/dist/registry-styles-WvCGd0xY.d.ts.map +1 -0
- package/dist/rehype-pre-block-source-Bz3-G4tr.js +2 -0
- package/dist/rehype-pre-block-source-Bz3-G4tr.js.map +1 -0
- package/dist/rehype-pre-block-source-Le9z9RN8.d.ts +7 -0
- package/dist/rehype-pre-block-source-Le9z9RN8.d.ts.map +1 -0
- package/dist/rehype-title-C1q6PbyG.js +2 -0
- package/dist/rehype-title-C1q6PbyG.js.map +1 -0
- package/dist/rehype-title-Dwt_OKnR.d.ts +7 -0
- package/dist/rehype-title-Dwt_OKnR.d.ts.map +1 -0
- package/dist/site-footer-CsUC-l-l.js +2 -0
- package/dist/site-footer-CsUC-l-l.js.map +1 -0
- package/dist/site-header-Bi3-9Kl3.js +2 -0
- package/dist/site-header-Bi3-9Kl3.js.map +1 -0
- package/dist/style-switcher-BXEGTMW2.d.ts +12 -0
- package/dist/style-switcher-BXEGTMW2.d.ts.map +1 -0
- package/dist/style-switcher-CpcMcuwL.js +2 -0
- package/dist/style-switcher-CpcMcuwL.js.map +1 -0
- package/dist/styles/base.css +156 -0
- package/dist/styles/docs.css +186 -0
- package/dist/styles/mdx.css +205 -0
- package/dist/table-B1hJe5kw.d.ts +10 -0
- package/dist/table-B1hJe5kw.d.ts.map +1 -0
- package/dist/table-Sc60jiil.js +2 -0
- package/dist/table-Sc60jiil.js.map +1 -0
- package/dist/tabs-DWxNPhgN.d.ts +23 -0
- package/dist/tabs-DWxNPhgN.d.ts.map +1 -0
- package/dist/tabs-KvYm5au9.js +2 -0
- package/dist/tabs-KvYm5au9.js.map +1 -0
- package/dist/tailwind-indicator-CV2jUfip.js +2 -0
- package/dist/tailwind-indicator-CV2jUfip.js.map +1 -0
- package/dist/themes-Dg5GgDgK.js +0 -0
- package/dist/themes-DsvojWlq.js +2 -0
- package/dist/themes-DsvojWlq.js.map +1 -0
- package/dist/themes-dv8YVpXg.d.ts +495 -0
- package/dist/themes-dv8YVpXg.d.ts.map +1 -0
- package/dist/typepography-B_jjjv9F.d.ts +54 -0
- package/dist/typepography-B_jjjv9F.d.ts.map +1 -0
- package/dist/typepography-Btk-lJ3O.js +2 -0
- package/dist/typepography-Btk-lJ3O.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +0 -0
- package/dist/types/nav.d.ts +2 -0
- package/dist/types/nav.js +0 -0
- package/dist/types/unist.d.ts +2 -0
- package/dist/types/unist.js +0 -0
- package/dist/unist-Bs-H_R8g.d.ts +40 -0
- package/dist/unist-Bs-H_R8g.d.ts.map +1 -0
- package/dist/unist-DpNAVhDX.js +0 -0
- package/dist/use-colors-CeiLGCjZ.d.ts +13 -0
- package/dist/use-colors-CeiLGCjZ.d.ts.map +1 -0
- package/dist/use-colors-JhoQAYK2.js +2 -0
- package/dist/use-colors-JhoQAYK2.js.map +1 -0
- package/dist/use-config-CFygUPAg.d.ts +13 -0
- package/dist/use-config-CFygUPAg.d.ts.map +1 -0
- package/dist/use-config-D1zkiIbf.js +2 -0
- package/dist/use-config-D1zkiIbf.js.map +1 -0
- package/dist/use-lift-mode-Dya2HcpU.js +2 -0
- package/dist/use-lift-mode-Dya2HcpU.js.map +1 -0
- package/dist/use-lift-mode-IpZRia0D.d.ts +8 -0
- package/dist/use-lift-mode-IpZRia0D.d.ts.map +1 -0
- package/dist/use-meta-colors-BhIhFzvx.js +2 -0
- package/dist/use-meta-colors-BhIhFzvx.js.map +1 -0
- package/dist/use-meta-colors-C8OegAZO.d.ts +8 -0
- package/dist/use-meta-colors-C8OegAZO.d.ts.map +1 -0
- package/dist/use-mounted-D25Cx8rc.d.ts +5 -0
- package/dist/use-mounted-D25Cx8rc.d.ts.map +1 -0
- package/dist/use-mounted-SpB3P6Vt.js +2 -0
- package/dist/use-mounted-SpB3P6Vt.js.map +1 -0
- package/dist/use-themes-config-Bo-JZDNU.js +2 -0
- package/dist/use-themes-config-Bo-JZDNU.js.map +1 -0
- package/dist/use-themes-config-DfQCuhPn.d.ts +14 -0
- package/dist/use-themes-config-DfQCuhPn.d.ts.map +1 -0
- package/dist/utils-CMPpWmbv.d.ts +9 -0
- package/dist/utils-CMPpWmbv.d.ts.map +1 -0
- package/dist/utils-NjSy-iOL.js +2 -0
- package/dist/utils-NjSy-iOL.js.map +1 -0
- package/dist/velite/browser.d.ts +11 -0
- package/dist/velite/browser.d.ts.map +1 -0
- package/dist/velite/browser.js +2 -0
- package/dist/velite/browser.js.map +1 -0
- package/dist/velite/config.d.ts +21 -0
- package/dist/velite/config.d.ts.map +1 -0
- package/dist/velite/config.js +2 -0
- package/dist/velite/config.js.map +1 -0
- package/dist/velite/index.d.ts +10 -0
- package/dist/velite/index.js +1 -0
- package/dist/velite/plugins/index.d.ts +6 -0
- package/dist/velite/plugins/index.js +1 -0
- package/dist/velite/plugins/metadata-plugin.d.ts +4 -0
- package/dist/velite/plugins/metadata-plugin.js +1 -0
- package/dist/velite/plugins/rehype-pre-block-source.d.ts +4 -0
- package/dist/velite/plugins/rehype-pre-block-source.js +1 -0
- package/dist/velite/plugins/rehype-title.d.ts +4 -0
- package/dist/velite/plugins/rehype-title.js +1 -0
- package/dist/velite/rehype-npm-command.d.ts +8 -0
- package/dist/velite/rehype-npm-command.d.ts.map +1 -0
- package/dist/velite/rehype-npm-command.js +2 -0
- package/dist/velite/rehype-npm-command.js.map +1 -0
- package/dist/velite/utils.d.ts +5 -0
- package/dist/velite/utils.d.ts.map +1 -0
- package/dist/velite/utils.js +2 -0
- package/dist/velite/utils.js.map +1 -0
- package/package.json +174 -0
- package/src/client.ts +5 -0
- package/src/components/copy-button/copy-button.tsx +88 -0
- package/src/components/copy-button/copy-button.types.ts +17 -0
- package/src/components/copy-button/index.ts +2 -0
- package/src/components/docs/docs-copy-page.tsx +106 -0
- package/src/components/docs/docs-pager.tsx +114 -0
- package/src/components/docs/docs-sidebar.tsx +104 -0
- package/src/components/docs/docs-toc.tsx +104 -0
- package/src/components/docs/index.ts +4 -0
- package/src/components/icons.tsx +194 -0
- package/src/components/index.ts +13 -0
- package/src/components/layouts/command-menu/command-menu.tsx +166 -0
- package/src/components/layouts/command-menu/index.ts +1 -0
- package/src/components/layouts/index.ts +4 -0
- package/src/components/layouts/site-footer/index.tsx +70 -0
- package/src/components/layouts/site-header/header-shell.tsx +75 -0
- package/src/components/layouts/site-header/index.tsx +121 -0
- package/src/components/layouts/tailwind-indicator/index.tsx +16 -0
- package/src/components/main-nav.tsx +33 -0
- package/src/components/mdx/mdx-components/callout.tsx +17 -0
- package/src/components/mdx/mdx-components/code/code-block-wrapper.tsx +12 -0
- package/src/components/mdx/mdx-components/code/code-block.tsx +30 -0
- package/src/components/mdx/mdx-components/code/code-preview.tsx +80 -0
- package/src/components/mdx/mdx-components/code/component-preview.tsx +161 -0
- package/src/components/mdx/mdx-components/code/component-source.tsx +54 -0
- package/src/components/mdx/mdx-components/code/figcaption-block.tsx +25 -0
- package/src/components/mdx/mdx-components/code/index.ts +7 -0
- package/src/components/mdx/mdx-components/code/pre-block.tsx +103 -0
- package/src/components/mdx/mdx-components/code/span-block.tsx +13 -0
- package/src/components/mdx/mdx-components/components-list.tsx +23 -0
- package/src/components/mdx/mdx-components/exalidraw.tsx +12 -0
- package/src/components/mdx/mdx-components/framework-docs.tsx +20 -0
- package/src/components/mdx/mdx-components/index.ts +7 -0
- package/src/components/mdx/mdx-components/table.tsx +35 -0
- package/src/components/mdx/mdx-components/tabs.tsx +32 -0
- package/src/components/mdx/mdx-components/typepography.tsx +70 -0
- package/src/components/mdx/mdx.tsx +103 -0
- package/src/components/mobile-nav.tsx +91 -0
- package/src/components/mode-toggle.tsx +41 -0
- package/src/components/page-header.tsx +42 -0
- package/src/components/providers.tsx +14 -0
- package/src/components/themes/index.ts +1 -0
- package/src/components/themes/style-switcher.tsx +35 -0
- package/src/context/context.tsx +66 -0
- package/src/context/context.types.ts +55 -0
- package/src/context/index.ts +2 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/use-colors.ts +27 -0
- package/src/hooks/use-config.ts +19 -0
- package/src/hooks/use-lift-mode.ts +19 -0
- package/src/hooks/use-meta-colors.ts +27 -0
- package/src/hooks/use-mounted.ts +11 -0
- package/src/hooks/use-themes-config.ts +17 -0
- package/src/index.ts +10 -0
- package/src/lib/charts.ts +23 -0
- package/src/lib/colors.ts +86 -0
- package/src/lib/events.ts +30 -0
- package/src/lib/index.ts +5 -0
- package/src/lib/registry-colors-data.ts +1810 -0
- package/src/lib/registry-styles.ts +8 -0
- package/src/lib/themes.ts +482 -0
- package/src/lib/utils.ts +42 -0
- package/src/styles/base.css +156 -0
- package/src/styles/docs.css +186 -0
- package/src/styles/mdx.css +205 -0
- package/src/types/index.ts +2 -0
- package/src/types/nav.ts +17 -0
- package/src/types/unist.ts +39 -0
- package/src/velite/browser.ts +11 -0
- package/src/velite/config.ts +118 -0
- package/src/velite/index.ts +5 -0
- package/src/velite/plugins/index.ts +3 -0
- package/src/velite/plugins/metadata-plugin.ts +26 -0
- package/src/velite/plugins/rehype-pre-block-source.ts +25 -0
- package/src/velite/plugins/rehype-title.ts +24 -0
- package/src/velite/rehype-npm-command.ts +42 -0
- 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
|
+
}
|
package/src/types/nav.ts
ADDED
|
@@ -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,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
|
+
}
|