@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,13 @@
|
|
|
1
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
2
|
+
|
|
3
|
+
export function SpanBlock({ className, children, ...props }: React.HTMLAttributes<HTMLSpanElement>) {
|
|
4
|
+
return isLineComment(children?.toString()!) ? null : (
|
|
5
|
+
<span className={cn(className)} {...props}>
|
|
6
|
+
{children}
|
|
7
|
+
</span>
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
function isLineComment(str: string): boolean {
|
|
11
|
+
// Matches strings starting with // followed by optional space and text
|
|
12
|
+
return /^\/\/.*$/.test(str)
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { type DocsEntry, useDocsEntries } from '@duck-docs/context'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
|
|
6
|
+
export function ComponentsList({ components }: { components?: DocsEntry[] }) {
|
|
7
|
+
const docs = useDocsEntries()
|
|
8
|
+
const resolved = components ?? docs ?? []
|
|
9
|
+
const list = resolved.filter((doc) => doc.component)
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 md:gap-x-8 lg:gap-x-16 lg:gap-y-6 xl:gap-x-20">
|
|
13
|
+
{list.map((component) => (
|
|
14
|
+
<Link
|
|
15
|
+
className="font-medium text-lg underline-offset-4 hover:underline md:text-base"
|
|
16
|
+
href={component.permalink ?? component.slug}
|
|
17
|
+
key={component.title}>
|
|
18
|
+
{component.title}
|
|
19
|
+
</Link>
|
|
20
|
+
))}
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Mdx } from '@duck-docs/components/mdx/mdx'
|
|
4
|
+
import { useDocsEntries } from '@duck-docs/context'
|
|
5
|
+
import type * as React from 'react'
|
|
6
|
+
|
|
7
|
+
interface FrameworkDocsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
data: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function FrameworkDocs({ ...props }: FrameworkDocsProps) {
|
|
12
|
+
const docs = useDocsEntries() ?? []
|
|
13
|
+
const frameworkDoc = docs.find((doc) => doc.slug === `/docs/installation/${props.data}`)
|
|
14
|
+
|
|
15
|
+
if (!frameworkDoc?.content) {
|
|
16
|
+
return null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return <Mdx code={frameworkDoc.content} />
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
2
|
+
import type { FC } from 'react'
|
|
3
|
+
|
|
4
|
+
export const Table: FC<React.HTMLAttributes<HTMLTableElement>> = ({ className, ...props }) => (
|
|
5
|
+
<div className="my-6 w-full rounded-lg border">
|
|
6
|
+
<table
|
|
7
|
+
className={cn(
|
|
8
|
+
'relative w-full overflow-hidden border-none text-sm [&_tbody_tr:last-child]:border-b-0',
|
|
9
|
+
className,
|
|
10
|
+
)}
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export const TableRow: FC<React.HTMLAttributes<HTMLTableRowElement>> = ({ className, ...props }) => (
|
|
17
|
+
<tr className={cn('m-0 border-b', className)} {...props} />
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export const TableHeader: FC<React.HTMLAttributes<HTMLTableCellElement>> = ({ className, ...props }) => (
|
|
21
|
+
<th
|
|
22
|
+
className={cn('px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right', className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
export const TableCell: FC<React.HTMLAttributes<HTMLTableCellElement>> = ({ className, ...props }) => (
|
|
28
|
+
<td
|
|
29
|
+
className={cn(
|
|
30
|
+
'whitespace-nowrap px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
2
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@gentleduck/registry-ui-duckui/tabs'
|
|
3
|
+
|
|
4
|
+
export function Tab({ className, ...props }: React.ComponentProps<typeof Tabs>) {
|
|
5
|
+
return <Tabs className={cn('relative mt-6 w-full', className)} {...props} />
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function TabList({ className, ...props }: React.ComponentProps<typeof TabsList>) {
|
|
9
|
+
return (
|
|
10
|
+
<TabsList className={cn('w-full justify-start rounded-none border-b bg-transparent p-0', className)} {...props} />
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
export function TabTrigger({ className, ...props }: React.ComponentProps<typeof TabsTrigger>) {
|
|
14
|
+
return (
|
|
15
|
+
<TabsTrigger
|
|
16
|
+
className={cn(
|
|
17
|
+
"cursor-pointer rounded-none border-b-[2px] border-b-transparent px-12 py-2 font-semibold [&[aria-selected='true']]:border-b-primary [&[aria-selected='true']]:shadow-none",
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function TabContent({ className, ...props }: React.ComponentProps<typeof TabsContent>) {
|
|
26
|
+
return (
|
|
27
|
+
<TabsContent
|
|
28
|
+
className={cn('relative [&_h3.font-heading]:font-semibold [&_h3.font-heading]:text-base', className)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
2
|
+
import Link from 'next/link'
|
|
3
|
+
import type React from 'react'
|
|
4
|
+
|
|
5
|
+
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {}
|
|
6
|
+
interface AnchorProps extends React.HTMLAttributes<HTMLAnchorElement> {}
|
|
7
|
+
interface ParagraphProps extends React.HTMLAttributes<HTMLParagraphElement> {}
|
|
8
|
+
|
|
9
|
+
export function H1({ className, ...props }: HeadingProps) {
|
|
10
|
+
return <h1 className={cn('mt-2 scroll-m-20 font-bold font-heading text-4xl', className)} {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function H2({ className, ...props }: HeadingProps) {
|
|
14
|
+
return (
|
|
15
|
+
<h2
|
|
16
|
+
className={cn(
|
|
17
|
+
'mt-12 scroll-m-20 border-b pb-2 font-heading font-semibold text-2xl tracking-tight first:mt-0',
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function H3({ className, ...props }: HeadingProps) {
|
|
26
|
+
return (
|
|
27
|
+
<h3 className={cn('mt-8 scroll-m-20 font-heading font-semibold text-xl tracking-tight', className)} {...props} />
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function H4({ className, ...props }: HeadingProps) {
|
|
32
|
+
return (
|
|
33
|
+
<h4 className={cn('mt-8 scroll-m-20 font-heading font-semibold text-lg tracking-tight', className)} {...props} />
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function H5({ className, ...props }: HeadingProps) {
|
|
38
|
+
return <h5 className={cn('mt-8 scroll-m-20 font-semibold text-lg tracking-tight', className)} {...props} />
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function H6({ className, ...props }: HeadingProps) {
|
|
42
|
+
return <h6 className={cn('mt-8 scroll-m-20 font-semibold text-base tracking-tight', className)} {...props} />
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function A({ className, ...props }: AnchorProps) {
|
|
46
|
+
return <a className={cn('font-medium underline underline-offset-4', className)} {...props} />
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function P({ className, ...props }: ParagraphProps) {
|
|
50
|
+
return <p className={cn('leading-7 [&:not(:first-child)]:mt-6', className)} {...props} />
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function LinkBlock({ className, ...props }: React.ComponentProps<typeof Link>) {
|
|
54
|
+
return <Link className={cn('font-medium underline underline-offset-4', className)} {...props} />
|
|
55
|
+
}
|
|
56
|
+
export function LinkedCard({ className, ...props }: React.ComponentProps<typeof Link>) {
|
|
57
|
+
return (
|
|
58
|
+
<Link
|
|
59
|
+
className={cn(
|
|
60
|
+
'flex w-full flex-col items-center rounded-xl border bg-card p-6 text-card-foreground shadow transition-colors hover:bg-muted/50 sm:p-10',
|
|
61
|
+
className,
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function Hr({ ...props }: React.HTMLAttributes<HTMLHRElement>) {
|
|
69
|
+
return <hr className="my-4 md:my-8" {...props} />
|
|
70
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
4
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@gentleduck/registry-ui-duckui/accordion'
|
|
5
|
+
import { Alert, AlertDescription, AlertTitle } from '@gentleduck/registry-ui-duckui/alert'
|
|
6
|
+
import { AspectRatio } from '@gentleduck/registry-ui-duckui/aspect-ratio'
|
|
7
|
+
import { Badge } from '@gentleduck/registry-ui-duckui/badge'
|
|
8
|
+
import { Button } from '@gentleduck/registry-ui-duckui/button'
|
|
9
|
+
import { Kbd } from '@gentleduck/registry-ui-duckui/kbd'
|
|
10
|
+
import Image from 'next/image'
|
|
11
|
+
import type * as React from 'react'
|
|
12
|
+
import runtime from 'react/jsx-runtime'
|
|
13
|
+
import { Callout } from './mdx-components/callout'
|
|
14
|
+
import { CodeBlock, CodeBlockWrapper, ComponentPreview, ComponentSource, PreBlock } from './mdx-components/code'
|
|
15
|
+
import { FigcaptionBlock } from './mdx-components/code/figcaption-block'
|
|
16
|
+
import { ComponentsList } from './mdx-components/components-list'
|
|
17
|
+
import { Table, TableCell, TableHeader, TableRow } from './mdx-components/table'
|
|
18
|
+
import { Tab, TabContent, TabList, TabTrigger } from './mdx-components/tabs'
|
|
19
|
+
import { A, H1, H2, H3, H4, H5, H6, Hr, LinkBlock, LinkedCard, P } from './mdx-components/typepography'
|
|
20
|
+
|
|
21
|
+
const useMDXComponent = (code: string) => {
|
|
22
|
+
const fn = new Function(code)
|
|
23
|
+
return fn({ ...runtime }).default
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const components = {
|
|
27
|
+
Accordion,
|
|
28
|
+
AccordionContent,
|
|
29
|
+
AccordionItem,
|
|
30
|
+
AccordionTrigger,
|
|
31
|
+
Alert,
|
|
32
|
+
AlertDescription,
|
|
33
|
+
AlertTitle,
|
|
34
|
+
AspectRatio,
|
|
35
|
+
a: A,
|
|
36
|
+
Badge,
|
|
37
|
+
Button,
|
|
38
|
+
blockquote: ({ className, ...props }: React.HTMLAttributes<HTMLElement>) => (
|
|
39
|
+
<blockquote className={cn('mt-6 border-l-2 pl-6 italic', className)} {...props} />
|
|
40
|
+
),
|
|
41
|
+
Callout,
|
|
42
|
+
CodeBlockWrapper,
|
|
43
|
+
ComponentPreview,
|
|
44
|
+
ComponentSource,
|
|
45
|
+
ComponentsList,
|
|
46
|
+
code: CodeBlock,
|
|
47
|
+
figcaption: FigcaptionBlock,
|
|
48
|
+
h1: H1,
|
|
49
|
+
h2: H2,
|
|
50
|
+
h3: H3,
|
|
51
|
+
h4: H4,
|
|
52
|
+
h5: H5,
|
|
53
|
+
h6: H6,
|
|
54
|
+
hr: Hr,
|
|
55
|
+
// span: SpanBlock,
|
|
56
|
+
Image,
|
|
57
|
+
img: ({ className, alt, ...props }: React.ImgHTMLAttributes<HTMLImageElement>) => (
|
|
58
|
+
<img alt={alt} className={cn('rounded-md', className)} {...props} />
|
|
59
|
+
),
|
|
60
|
+
Kbd: Kbd,
|
|
61
|
+
Link: LinkBlock,
|
|
62
|
+
LinkedCard,
|
|
63
|
+
li: ({ className, ...props }: React.HTMLAttributes<HTMLElement>) => (
|
|
64
|
+
<li className={cn('mt-2', className)} {...props} />
|
|
65
|
+
),
|
|
66
|
+
ol: ({ className, ...props }: React.HTMLAttributes<HTMLOListElement>) => (
|
|
67
|
+
<ol className={cn('my-6 ml-6 list-decimal', className)} {...props} />
|
|
68
|
+
),
|
|
69
|
+
p: P,
|
|
70
|
+
pre: PreBlock,
|
|
71
|
+
Step: ({ className, ...props }: React.ComponentProps<'h3'>) => (
|
|
72
|
+
<h3 className={cn('step scroll-m-20 font-heading font-semibold text-xl tracking-tight', className)} {...props} />
|
|
73
|
+
),
|
|
74
|
+
Steps: ({ ...props }) => (
|
|
75
|
+
<div className="[&>h3]:step steps mb-12 ml-4 border-l pl-8 [counter-reset:step]" {...props} />
|
|
76
|
+
),
|
|
77
|
+
Tabs: Tab,
|
|
78
|
+
TabsContent: TabContent,
|
|
79
|
+
TabsList: TabList,
|
|
80
|
+
TabsTrigger: TabTrigger,
|
|
81
|
+
table: Table,
|
|
82
|
+
td: TableCell,
|
|
83
|
+
th: TableHeader,
|
|
84
|
+
tr: TableRow,
|
|
85
|
+
ul: ({ className, ...props }: React.HTMLAttributes<HTMLUListElement>) => (
|
|
86
|
+
<ul className={cn('my-6 ml-6 list-disc', className)} {...props} />
|
|
87
|
+
),
|
|
88
|
+
// FrameworkDocs,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface MdxProps {
|
|
92
|
+
code: string
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function Mdx({ code }: MdxProps) {
|
|
96
|
+
const Component = useMDXComponent(code)
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div className="mdx">
|
|
100
|
+
<Component components={components} />
|
|
101
|
+
</div>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useDocsConfig } from '@duck-docs/context'
|
|
4
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
5
|
+
import { Button } from '@gentleduck/registry-ui-duckui/button'
|
|
6
|
+
import { Drawer, DrawerContent, DrawerTrigger } from '@gentleduck/registry-ui-duckui/drawer'
|
|
7
|
+
import { ScrollArea } from '@gentleduck/registry-ui-duckui/scroll-area'
|
|
8
|
+
import { PanelsTopLeft } from 'lucide-react'
|
|
9
|
+
import Link, { type LinkProps } from 'next/link'
|
|
10
|
+
import { useRouter } from 'next/navigation'
|
|
11
|
+
import * as React from 'react'
|
|
12
|
+
|
|
13
|
+
export function MobileNav() {
|
|
14
|
+
const [open, setOpen] = React.useState(false)
|
|
15
|
+
const docsConfig = useDocsConfig()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Drawer onOpenChange={setOpen} open={open}>
|
|
19
|
+
<DrawerTrigger asChild>
|
|
20
|
+
<Button
|
|
21
|
+
className="mr-2 px-0 text-base hover:bg-transparent focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 md:hidden"
|
|
22
|
+
icon={<PanelsTopLeft />}
|
|
23
|
+
size={'icon'}
|
|
24
|
+
variant="ghost"></Button>
|
|
25
|
+
</DrawerTrigger>
|
|
26
|
+
<DrawerContent className="pr-0 pb-4">
|
|
27
|
+
<ScrollArea>
|
|
28
|
+
<div className="hide-scroll my-4 h-[calc(100vh-8rem)] pb-10 pl-6">
|
|
29
|
+
<div className="flex flex-col space-y-3">
|
|
30
|
+
{docsConfig.mainNav?.map(
|
|
31
|
+
(item) =>
|
|
32
|
+
item.href && (
|
|
33
|
+
<MobileLink href={item.href} key={item.href} onOpenChange={setOpen}>
|
|
34
|
+
{item.title}
|
|
35
|
+
</MobileLink>
|
|
36
|
+
),
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
<div className="flex flex-col space-y-2">
|
|
40
|
+
{docsConfig.sidebarNav.map((item, index) => (
|
|
41
|
+
<div className="flex flex-col space-y-3 pt-6" key={index}>
|
|
42
|
+
<h4 className="font-medium">{item.title}</h4>
|
|
43
|
+
{item?.items?.length &&
|
|
44
|
+
item.items.map((item) => (
|
|
45
|
+
<React.Fragment key={item.href}>
|
|
46
|
+
{!item.disabled &&
|
|
47
|
+
(item.href ? (
|
|
48
|
+
<MobileLink className="text-muted-foreground" href={item.href} onOpenChange={setOpen}>
|
|
49
|
+
{item.title}
|
|
50
|
+
{item.label && (
|
|
51
|
+
<span className="ml-2 rounded-md bg-primary px-1.5 py-0.5 text-accent text-xs leading-none no-underline group-hover:no-underline">
|
|
52
|
+
{item.label}
|
|
53
|
+
</span>
|
|
54
|
+
)}
|
|
55
|
+
</MobileLink>
|
|
56
|
+
) : (
|
|
57
|
+
item.title
|
|
58
|
+
))}
|
|
59
|
+
</React.Fragment>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
))}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</ScrollArea>
|
|
66
|
+
</DrawerContent>
|
|
67
|
+
</Drawer>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface MobileLinkProps extends LinkProps {
|
|
72
|
+
onOpenChange?: (open: boolean) => void
|
|
73
|
+
children: React.ReactNode
|
|
74
|
+
className?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function MobileLink({ href, onOpenChange, className, children, ...props }: MobileLinkProps) {
|
|
78
|
+
const router = useRouter()
|
|
79
|
+
return (
|
|
80
|
+
<Link
|
|
81
|
+
className={cn(className)}
|
|
82
|
+
href={href}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
router.push(href.toString())
|
|
85
|
+
onOpenChange?.(false)
|
|
86
|
+
}}
|
|
87
|
+
{...props}>
|
|
88
|
+
{children}
|
|
89
|
+
</Link>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useSiteConfig } from '@duck-docs/context'
|
|
4
|
+
import { useMetaColor } from '@duck-docs/hooks/use-meta-colors'
|
|
5
|
+
import { Button } from '@gentleduck/registry-ui-duckui/button'
|
|
6
|
+
import { MoonIcon, SunIcon } from 'lucide-react'
|
|
7
|
+
import { useTheme } from 'next-themes'
|
|
8
|
+
import * as React from 'react'
|
|
9
|
+
|
|
10
|
+
const DEFAULT_META_THEME_COLORS = {
|
|
11
|
+
dark: '#000000',
|
|
12
|
+
light: '#ffffff',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function ModeSwitcher() {
|
|
16
|
+
const { setTheme, resolvedTheme } = useTheme()
|
|
17
|
+
const { setMetaColor } = useMetaColor()
|
|
18
|
+
const siteConfig = useSiteConfig()
|
|
19
|
+
const metaThemeColors = siteConfig.metaThemeColors ?? DEFAULT_META_THEME_COLORS
|
|
20
|
+
|
|
21
|
+
const toggleTheme = React.useCallback(() => {
|
|
22
|
+
setTheme(resolvedTheme === 'dark' ? 'light' : 'dark')
|
|
23
|
+
setMetaColor(resolvedTheme === 'dark' ? metaThemeColors.light : metaThemeColors.dark)
|
|
24
|
+
}, [resolvedTheme, setTheme, setMetaColor])
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Button
|
|
28
|
+
aria-label="toggle theme"
|
|
29
|
+
className="group/toggle"
|
|
30
|
+
icon={
|
|
31
|
+
<>
|
|
32
|
+
<SunIcon className="hidden [html.dark_&]:block" />
|
|
33
|
+
<MoonIcon className="hidden [html.light_&]:block" />
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
onClick={toggleTheme}
|
|
37
|
+
size={'icon'}
|
|
38
|
+
variant="ghost"
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
2
|
+
|
|
3
|
+
function PageHeader({ className, children, ...props }: React.ComponentProps<'section'>) {
|
|
4
|
+
return (
|
|
5
|
+
<section className={cn('border-grid', className)} {...props}>
|
|
6
|
+
<div className="container-wrapper">
|
|
7
|
+
<div className="container flex flex-col items-center gap-2 py-[clamp(2rem,5vw,5rem)] text-center xl:gap-4">
|
|
8
|
+
{children}
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</section>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function PageHeaderHeading({ className, ...props }: React.ComponentProps<'h1'>) {
|
|
16
|
+
return (
|
|
17
|
+
<h1
|
|
18
|
+
className={cn(
|
|
19
|
+
'max-w-4xl text-balance font-semibold text-4xl text-primary uppercase leading-tighter tracking-tight lg:font-semibold lg:leading-[1.1] xl:text-5xl xl:tracking-tighter',
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function PageHeaderDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
28
|
+
return (
|
|
29
|
+
<p className={cn('max-w-3xl text-balance text-accent-foreground/80 text-base sm:text-lg', className)} {...props} />
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function PageActions({ className, ...props }: React.ComponentProps<'div'>) {
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
className={cn('flex w-full items-center justify-center gap-2 pt-2 **:data-[slot=button]:shadow-none', className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { PageActions, PageHeader, PageHeaderDescription, PageHeaderHeading }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Provider as JotaiProvider } from 'jotai'
|
|
4
|
+
import type { ThemeProviderProps } from 'next-themes'
|
|
5
|
+
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
6
|
+
import * as React from 'react'
|
|
7
|
+
|
|
8
|
+
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
|
9
|
+
return (
|
|
10
|
+
<JotaiProvider>
|
|
11
|
+
<NextThemesProvider {...props}>{children}</NextThemesProvider>
|
|
12
|
+
</JotaiProvider>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './style-switcher'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useConfig } from '@duck-docs/hooks/use-config'
|
|
4
|
+
import { type Style, styles } from '@duck-docs/lib/registry-styles'
|
|
5
|
+
import { cn } from '@gentleduck/libs/cn'
|
|
6
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@gentleduck/registry-ui-duckui/select'
|
|
7
|
+
import type * as React from 'react'
|
|
8
|
+
|
|
9
|
+
export function StyleSwitcher({ className, ...props }: React.ComponentPropsWithoutRef<typeof SelectTrigger>) {
|
|
10
|
+
const [config, setConfig] = useConfig()
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Select
|
|
14
|
+
onValueChange={
|
|
15
|
+
((value: Style['name']) =>
|
|
16
|
+
setConfig({
|
|
17
|
+
...config,
|
|
18
|
+
style: value,
|
|
19
|
+
})) as never
|
|
20
|
+
}
|
|
21
|
+
value={config.style}>
|
|
22
|
+
<SelectTrigger className={cn('h-7 w-[145px] text-xs [&_svg]:h-4 [&_svg]:w-4', className)} {...props}>
|
|
23
|
+
<span className="text-muted-foreground">Style: </span>
|
|
24
|
+
<SelectValue placeholder="Select style" />
|
|
25
|
+
</SelectTrigger>
|
|
26
|
+
<SelectContent>
|
|
27
|
+
{styles.map((style) => (
|
|
28
|
+
<SelectItem className="text-xs" key={style.name} value={style.name}>
|
|
29
|
+
{style.label}
|
|
30
|
+
</SelectItem>
|
|
31
|
+
))}
|
|
32
|
+
</SelectContent>
|
|
33
|
+
</Select>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { DocsConfig, DocsContextValue, DocsEntry, DocsSiteConfig, RegistryIndex } from './context.types'
|
|
5
|
+
|
|
6
|
+
const DocsContext = React.createContext<DocsContextValue | null>(null)
|
|
7
|
+
|
|
8
|
+
export function DocsProvider({
|
|
9
|
+
children,
|
|
10
|
+
docs,
|
|
11
|
+
docsConfig,
|
|
12
|
+
registryIndex,
|
|
13
|
+
siteConfig,
|
|
14
|
+
}: {
|
|
15
|
+
children: React.ReactNode
|
|
16
|
+
docs?: DocsEntry[]
|
|
17
|
+
docsConfig: DocsConfig
|
|
18
|
+
registryIndex?: RegistryIndex
|
|
19
|
+
siteConfig: DocsSiteConfig
|
|
20
|
+
}) {
|
|
21
|
+
const value = React.useMemo(
|
|
22
|
+
() => ({
|
|
23
|
+
docs,
|
|
24
|
+
docsConfig,
|
|
25
|
+
registryIndex,
|
|
26
|
+
siteConfig,
|
|
27
|
+
}),
|
|
28
|
+
[docs, docsConfig, registryIndex, siteConfig],
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
return <DocsContext.Provider value={value}>{children}</DocsContext.Provider>
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function useDocsContext() {
|
|
35
|
+
const context = React.useContext(DocsContext)
|
|
36
|
+
if (!context) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
'DocsProvider is missing. Wrap your app with <DocsProvider> from @gentleduck/docs and pass docsConfig and siteConfig.',
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
return context
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function useDocsConfig() {
|
|
45
|
+
const { docsConfig } = useDocsContext()
|
|
46
|
+
if (!docsConfig) {
|
|
47
|
+
throw new Error('DocsProvider is missing docsConfig. Pass docsConfig to <DocsProvider>.')
|
|
48
|
+
}
|
|
49
|
+
return docsConfig
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function useSiteConfig() {
|
|
53
|
+
const { siteConfig } = useDocsContext()
|
|
54
|
+
if (!siteConfig) {
|
|
55
|
+
throw new Error('DocsProvider is missing siteConfig. Pass siteConfig to <DocsProvider>.')
|
|
56
|
+
}
|
|
57
|
+
return siteConfig
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function useDocsEntries() {
|
|
61
|
+
return useDocsContext().docs
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function useRegistryIndex() {
|
|
65
|
+
return useDocsContext().registryIndex
|
|
66
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { MainNavItem, SidebarNavItem } from '@duck-docs/types/nav'
|
|
2
|
+
export type DocsConfig = {
|
|
3
|
+
chartsNav?: SidebarNavItem[]
|
|
4
|
+
mainNav: MainNavItem[]
|
|
5
|
+
sidebarNav: SidebarNavItem[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type DocsSiteConfig = {
|
|
9
|
+
author?: {
|
|
10
|
+
name: string
|
|
11
|
+
url?: string
|
|
12
|
+
}
|
|
13
|
+
branding?: {
|
|
14
|
+
logoDark?: string
|
|
15
|
+
logoLight?: string
|
|
16
|
+
}
|
|
17
|
+
description?: string
|
|
18
|
+
githubRepo?: string
|
|
19
|
+
links?: {
|
|
20
|
+
email?: string
|
|
21
|
+
github?: string
|
|
22
|
+
twitter?: string
|
|
23
|
+
}
|
|
24
|
+
metaThemeColors?: {
|
|
25
|
+
dark: string
|
|
26
|
+
light: string
|
|
27
|
+
}
|
|
28
|
+
name: string
|
|
29
|
+
title?: string
|
|
30
|
+
url?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type DocsEntry = {
|
|
34
|
+
component?: boolean
|
|
35
|
+
content?: string
|
|
36
|
+
permalink?: string
|
|
37
|
+
slug: string
|
|
38
|
+
title: string
|
|
39
|
+
toc?: TocEntry[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type TocEntry = {
|
|
43
|
+
items?: TocEntry[]
|
|
44
|
+
title: string
|
|
45
|
+
url: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type DocsContextValue = {
|
|
49
|
+
docs?: DocsEntry[]
|
|
50
|
+
docsConfig: DocsConfig
|
|
51
|
+
registryIndex?: RegistryIndex
|
|
52
|
+
siteConfig: DocsSiteConfig
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type RegistryIndex = Record<string, { component?: React.ComponentType } & Record<string, unknown>>
|