@hanzo/docs-base-ui 16.5.0 → 16.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/css/aspen.css +39 -0
- package/css/black.css +39 -1
- package/css/catppuccin.css +49 -1
- package/css/dusk.css +47 -1
- package/css/emerald.css +39 -0
- package/css/generated/docs.css +490 -0
- package/css/generated/flux.css +429 -0
- package/css/generated/home.css +285 -0
- package/css/generated/notebook.css +526 -0
- package/css/generated/shared.css +1173 -0
- package/css/lib/base.css +214 -0
- package/css/lib/default-colors.css +51 -0
- package/css/lib/shiki.css +98 -0
- package/css/neutral.css +7 -1
- package/css/ocean.css +44 -1
- package/css/preset.css +9 -7
- package/css/purple.css +39 -1
- package/css/ruby.css +39 -0
- package/css/shadcn.css +36 -1
- package/css/solar.css +75 -1
- package/css/vitepress.css +65 -1
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/accordion.d.ts +2 -3
- package/dist/components/accordion.js +9 -13
- package/dist/components/banner.d.ts +3 -4
- package/dist/components/banner.js +5 -9
- package/dist/components/callout.d.ts +6 -7
- package/dist/components/callout.js +1 -4
- package/dist/components/card.d.ts +4 -5
- package/dist/components/card.js +2 -5
- package/dist/components/codeblock.d.ts +8 -9
- package/dist/components/codeblock.js +9 -13
- package/dist/components/codeblock.rsc.d.ts +21 -0
- package/dist/components/codeblock.rsc.js +22 -0
- package/dist/components/dialog/search-algolia.d.ts +7 -9
- package/dist/components/dialog/search-algolia.js +8 -12
- package/dist/components/dialog/search-default.d.ts +7 -9
- package/dist/components/dialog/search-default.js +8 -12
- package/dist/components/dialog/search-orama.d.ts +7 -9
- package/dist/components/dialog/search-orama.js +8 -12
- package/dist/components/dialog/search.d.ts +21 -21
- package/dist/components/dialog/search.js +137 -60
- package/dist/components/dynamic-codeblock.core.d.ts +35 -0
- package/dist/components/dynamic-codeblock.core.js +51 -0
- package/dist/components/dynamic-codeblock.d.ts +7 -29
- package/dist/components/dynamic-codeblock.js +11 -60
- package/dist/components/files.d.ts +1 -2
- package/dist/components/files.js +6 -10
- package/dist/components/github-info.d.ts +23 -10
- package/dist/components/github-info.js +34 -29
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/heading.js +3 -6
- package/dist/components/image-zoom.d.ts +4 -5
- package/dist/components/image-zoom.js +2 -5
- package/dist/components/inline-toc.d.ts +3 -4
- package/dist/components/inline-toc.js +2 -6
- package/dist/components/sidebar/base.d.ts +29 -23
- package/dist/components/sidebar/base.js +16 -22
- package/dist/components/sidebar/link-item.d.ts +3 -4
- package/dist/components/sidebar/link-item.js +6 -3
- package/dist/components/sidebar/page-tree.d.ts +3 -4
- package/dist/components/sidebar/page-tree.js +56 -45
- package/dist/components/sidebar/tabs/dropdown.d.ts +6 -9
- package/dist/components/sidebar/tabs/dropdown.js +22 -29
- package/dist/components/sidebar/tabs/index.d.ts +3 -17
- package/dist/components/sidebar/tabs/index.js +0 -3
- package/dist/components/steps.d.ts +4 -5
- package/dist/components/steps.js +0 -3
- package/dist/components/tabs.d.ts +15 -11
- package/dist/components/tabs.js +15 -20
- package/dist/components/toc/clerk.d.ts +19 -1
- package/dist/components/toc/clerk.js +165 -10
- package/dist/components/toc/default.d.ts +19 -1
- package/dist/components/toc/default.js +45 -10
- package/dist/components/toc/index.d.ts +29 -1
- package/dist/components/toc/index.js +105 -10
- package/dist/components/type-table.d.ts +11 -6
- package/dist/components/type-table.js +28 -23
- package/dist/components/ui/accordion.d.ts +7 -8
- package/dist/components/ui/accordion.js +2 -6
- package/dist/components/ui/button.d.ts +1 -2
- package/dist/components/ui/button.js +0 -3
- package/dist/components/ui/collapsible.d.ts +6 -7
- package/dist/components/ui/collapsible.js +3 -7
- package/dist/components/ui/navigation-menu.d.ts +27 -13
- package/dist/components/ui/navigation-menu.js +53 -31
- package/dist/components/ui/popover.d.ts +11 -6
- package/dist/components/ui/popover.js +15 -19
- package/dist/components/ui/scroll-area.d.ts +17 -7
- package/dist/components/ui/scroll-area.js +27 -31
- package/dist/components/ui/tabs.d.ts +8 -9
- package/dist/components/ui/tabs.js +5 -9
- package/dist/contexts/i18n.d.ts +62 -1
- package/dist/contexts/i18n.js +53 -10
- package/dist/contexts/search.d.ts +71 -5
- package/dist/contexts/search.js +64 -10
- package/dist/contexts/tree.d.ts +21 -1
- package/dist/contexts/tree.js +36 -10
- package/dist/i18n.d.ts +21 -1
- package/dist/i18n.js +20 -3
- package/dist/layouts/docs/client.d.ts +30 -29
- package/dist/layouts/docs/client.js +76 -52
- package/dist/layouts/docs/index.d.ts +21 -35
- package/dist/layouts/docs/index.js +16 -172
- package/dist/layouts/docs/page/index.d.ts +75 -52
- package/dist/layouts/docs/page/index.js +76 -56
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/docs/page/slots/breadcrumb.js +44 -0
- package/dist/layouts/docs/page/slots/container.d.ts +7 -0
- package/dist/layouts/docs/page/slots/container.js +17 -0
- package/dist/layouts/docs/page/slots/footer.d.ts +23 -0
- package/dist/layouts/docs/page/slots/footer.js +56 -0
- package/dist/layouts/docs/page/slots/toc.d.ts +55 -0
- package/dist/layouts/docs/page/slots/toc.js +166 -0
- package/dist/layouts/docs/slots/container.d.ts +7 -0
- package/dist/layouts/docs/slots/container.js +29 -0
- package/dist/layouts/docs/slots/header.d.ts +8 -0
- package/dist/layouts/docs/slots/header.js +38 -0
- package/dist/layouts/docs/slots/sidebar.d.ts +30 -0
- package/dist/layouts/docs/slots/sidebar.js +319 -0
- package/dist/layouts/flux/index.d.ts +74 -0
- package/dist/layouts/flux/index.js +146 -0
- package/dist/layouts/flux/page/index.d.ts +105 -0
- package/dist/layouts/flux/page/index.js +104 -0
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/flux/page/slots/breadcrumb.js +44 -0
- package/dist/layouts/flux/page/slots/container.d.ts +7 -0
- package/dist/layouts/flux/page/slots/container.js +17 -0
- package/dist/layouts/flux/page/slots/footer.d.ts +23 -0
- package/dist/layouts/flux/page/slots/footer.js +56 -0
- package/dist/layouts/flux/page/slots/toc.d.ts +34 -0
- package/dist/layouts/flux/page/slots/toc.js +172 -0
- package/dist/layouts/flux/slots/container.d.ts +7 -0
- package/dist/layouts/flux/slots/container.js +13 -0
- package/dist/layouts/flux/slots/sidebar.d.ts +23 -0
- package/dist/layouts/flux/slots/sidebar.js +237 -0
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +17 -0
- package/dist/layouts/flux/slots/tab-dropdown.js +85 -0
- package/dist/layouts/home/index.d.ts +25 -8
- package/dist/layouts/home/index.js +39 -19
- package/dist/layouts/home/navbar.d.ts +7 -16
- package/dist/layouts/home/navbar.js +12 -14
- package/dist/layouts/home/not-found.d.ts +9 -0
- package/dist/layouts/home/not-found.js +38 -0
- package/dist/layouts/home/slots/container.d.ts +7 -0
- package/dist/layouts/home/slots/container.js +13 -0
- package/dist/layouts/home/slots/header.d.ts +11 -0
- package/dist/layouts/home/slots/header.js +242 -0
- package/dist/layouts/notebook/client.d.ts +32 -44
- package/dist/layouts/notebook/client.js +58 -148
- package/dist/layouts/notebook/index.d.ts +26 -25
- package/dist/layouts/notebook/index.js +16 -213
- package/dist/layouts/notebook/page/index.d.ts +75 -52
- package/dist/layouts/notebook/page/index.js +76 -56
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +14 -0
- package/dist/layouts/notebook/page/slots/breadcrumb.js +44 -0
- package/dist/layouts/notebook/page/slots/container.d.ts +7 -0
- package/dist/layouts/notebook/page/slots/container.js +17 -0
- package/dist/layouts/notebook/page/slots/footer.d.ts +23 -0
- package/dist/layouts/notebook/page/slots/footer.js +56 -0
- package/dist/layouts/notebook/page/slots/toc.d.ts +55 -0
- package/dist/layouts/notebook/page/slots/toc.js +165 -0
- package/dist/layouts/notebook/slots/container.d.ts +7 -0
- package/dist/layouts/notebook/slots/container.js +31 -0
- package/dist/layouts/notebook/slots/header.d.ts +8 -0
- package/dist/layouts/notebook/slots/header.js +194 -0
- package/dist/layouts/notebook/slots/sidebar.d.ts +40 -0
- package/dist/layouts/notebook/slots/sidebar.js +297 -0
- package/dist/layouts/shared/client.d.ts +45 -0
- package/dist/layouts/shared/client.js +84 -0
- package/dist/layouts/shared/index.d.ts +144 -35
- package/dist/layouts/shared/index.js +74 -15
- package/dist/layouts/shared/page-actions.d.ts +36 -0
- package/dist/layouts/shared/page-actions.js +190 -0
- package/dist/layouts/shared/slots/language-select.d.ts +10 -0
- package/dist/layouts/shared/{language-toggle.js → slots/language-select.js} +12 -16
- package/dist/layouts/shared/slots/search-trigger.d.ts +23 -0
- package/dist/layouts/shared/{search-toggle.js → slots/search-trigger.js} +12 -16
- package/dist/layouts/shared/slots/theme-switch.d.ts +14 -0
- package/dist/layouts/shared/{theme-toggle.js → slots/theme-switch.js} +11 -15
- package/dist/mdx.d.ts +23 -13
- package/dist/mdx.js +2 -6
- package/dist/mdx.server.d.ts +1 -3
- package/dist/mdx.server.js +0 -3
- package/dist/og/takumi.d.ts +21 -0
- package/dist/og/takumi.js +70 -0
- package/dist/og.d.ts +22 -1
- package/dist/og.js +70 -3
- package/dist/page.d.ts +6 -7
- package/dist/page.js +9 -14
- package/dist/provider/base.d.ts +5 -6
- package/dist/provider/base.js +5 -9
- package/dist/provider/next.d.ts +4 -5
- package/dist/provider/next.js +1 -5
- package/dist/provider/react-router.d.ts +4 -5
- package/dist/provider/react-router.js +1 -5
- package/dist/provider/tanstack.d.ts +4 -5
- package/dist/provider/tanstack.js +1 -5
- package/dist/provider/waku.d.ts +4 -5
- package/dist/provider/waku.js +1 -5
- package/dist/style.css +594 -192
- package/dist/tailwind/typography.d.ts +2 -0
- package/dist/tailwind/typography.js +2 -0
- package/dist/utils/cn.js +2 -0
- package/dist/utils/merge-refs.js +11 -0
- package/dist/utils/urls.js +15 -0
- package/dist/utils/use-copy-button.d.ts +6 -1
- package/dist/utils/use-copy-button.js +26 -3
- package/dist/utils/use-footer-items.d.ts +9 -1
- package/dist/utils/use-footer-items.js +24 -3
- package/dist/utils/use-is-scroll-top.d.ts +8 -1
- package/dist/utils/use-is-scroll-top.js +20 -3
- package/package.json +133 -81
- package/css/layouts/docs.css +0 -1
- package/css/layouts/home.css +0 -1
- package/css/layouts/notebook.css +0 -1
- package/dist/_virtual/rolldown_runtime.js +0 -36
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/banner.js.map +0 -1
- package/dist/components/callout.d.ts.map +0 -1
- package/dist/components/callout.js.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js.map +0 -1
- package/dist/components/codeblock.d.ts.map +0 -1
- package/dist/components/codeblock.js.map +0 -1
- package/dist/components/dialog/search-algolia.d.ts.map +0 -1
- package/dist/components/dialog/search-algolia.js.map +0 -1
- package/dist/components/dialog/search-default.d.ts.map +0 -1
- package/dist/components/dialog/search-default.js.map +0 -1
- package/dist/components/dialog/search-orama.d.ts.map +0 -1
- package/dist/components/dialog/search-orama.js.map +0 -1
- package/dist/components/dialog/search.d.ts.map +0 -1
- package/dist/components/dialog/search.js.map +0 -1
- package/dist/components/dynamic-codeblock.d.ts.map +0 -1
- package/dist/components/dynamic-codeblock.js.map +0 -1
- package/dist/components/files.d.ts.map +0 -1
- package/dist/components/files.js.map +0 -1
- package/dist/components/github-info.d.ts.map +0 -1
- package/dist/components/github-info.js.map +0 -1
- package/dist/components/heading.d.ts.map +0 -1
- package/dist/components/heading.js.map +0 -1
- package/dist/components/image-zoom-CtfZieBH.css +0 -80
- package/dist/components/image-zoom-CtfZieBH.css.map +0 -1
- package/dist/components/image-zoom.d.ts.map +0 -1
- package/dist/components/image-zoom.js.map +0 -1
- package/dist/components/image-zoom2.js +0 -1
- package/dist/components/inline-toc.d.ts.map +0 -1
- package/dist/components/inline-toc.js.map +0 -1
- package/dist/components/sidebar/base.d.ts.map +0 -1
- package/dist/components/sidebar/base.js.map +0 -1
- package/dist/components/sidebar/link-item.d.ts.map +0 -1
- package/dist/components/sidebar/link-item.js.map +0 -1
- package/dist/components/sidebar/page-tree.d.ts.map +0 -1
- package/dist/components/sidebar/page-tree.js.map +0 -1
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +0 -1
- package/dist/components/sidebar/tabs/dropdown.js.map +0 -1
- package/dist/components/sidebar/tabs/index.d.ts.map +0 -1
- package/dist/components/sidebar/tabs/index.js.map +0 -1
- package/dist/components/steps.d.ts.map +0 -1
- package/dist/components/steps.js.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js.map +0 -1
- package/dist/components/toc/clerk.js.map +0 -1
- package/dist/components/toc/default.js.map +0 -1
- package/dist/components/toc/index.js.map +0 -1
- package/dist/components/type-table.d.ts.map +0 -1
- package/dist/components/type-table.js.map +0 -1
- package/dist/components/ui/accordion.d.ts.map +0 -1
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/collapsible.d.ts.map +0 -1
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/scroll-area.d.ts.map +0 -1
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/tabs.d.ts.map +0 -1
- package/dist/components/ui/tabs.js.map +0 -1
- package/dist/contexts/i18n.js.map +0 -1
- package/dist/contexts/search.d.ts.map +0 -1
- package/dist/contexts/search.js.map +0 -1
- package/dist/contexts/tree.js.map +0 -1
- package/dist/layouts/docs/client.d.ts.map +0 -1
- package/dist/layouts/docs/client.js.map +0 -1
- package/dist/layouts/docs/index.d.ts.map +0 -1
- package/dist/layouts/docs/index.js.map +0 -1
- package/dist/layouts/docs/page/client.d.ts +0 -46
- package/dist/layouts/docs/page/client.d.ts.map +0 -1
- package/dist/layouts/docs/page/client.js +0 -227
- package/dist/layouts/docs/page/client.js.map +0 -1
- package/dist/layouts/docs/page/index.d.ts.map +0 -1
- package/dist/layouts/docs/page/index.js.map +0 -1
- package/dist/layouts/docs/sidebar.d.ts +0 -63
- package/dist/layouts/docs/sidebar.d.ts.map +0 -1
- package/dist/layouts/docs/sidebar.js +0 -162
- package/dist/layouts/docs/sidebar.js.map +0 -1
- package/dist/layouts/home/client.d.ts +0 -19
- package/dist/layouts/home/client.d.ts.map +0 -1
- package/dist/layouts/home/client.js +0 -285
- package/dist/layouts/home/client.js.map +0 -1
- package/dist/layouts/home/index.d.ts.map +0 -1
- package/dist/layouts/home/index.js.map +0 -1
- package/dist/layouts/home/navbar.d.ts.map +0 -1
- package/dist/layouts/home/navbar.js.map +0 -1
- package/dist/layouts/notebook/client.d.ts.map +0 -1
- package/dist/layouts/notebook/client.js.map +0 -1
- package/dist/layouts/notebook/index.d.ts.map +0 -1
- package/dist/layouts/notebook/index.js.map +0 -1
- package/dist/layouts/notebook/page/client.d.ts +0 -46
- package/dist/layouts/notebook/page/client.d.ts.map +0 -1
- package/dist/layouts/notebook/page/client.js +0 -227
- package/dist/layouts/notebook/page/client.js.map +0 -1
- package/dist/layouts/notebook/page/index.d.ts.map +0 -1
- package/dist/layouts/notebook/page/index.js.map +0 -1
- package/dist/layouts/notebook/sidebar.d.ts +0 -59
- package/dist/layouts/notebook/sidebar.d.ts.map +0 -1
- package/dist/layouts/notebook/sidebar.js +0 -133
- package/dist/layouts/notebook/sidebar.js.map +0 -1
- package/dist/layouts/shared/index.d.ts.map +0 -1
- package/dist/layouts/shared/index.js.map +0 -1
- package/dist/layouts/shared/language-toggle.d.ts +0 -10
- package/dist/layouts/shared/language-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/language-toggle.js.map +0 -1
- package/dist/layouts/shared/search-toggle.d.ts +0 -23
- package/dist/layouts/shared/search-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/search-toggle.js.map +0 -1
- package/dist/layouts/shared/theme-toggle.d.ts +0 -14
- package/dist/layouts/shared/theme-toggle.d.ts.map +0 -1
- package/dist/layouts/shared/theme-toggle.js.map +0 -1
- package/dist/mdx.d.ts.map +0 -1
- package/dist/mdx.js.map +0 -1
- package/dist/mdx.server.d.ts.map +0 -1
- package/dist/mdx.server.js.map +0 -1
- package/dist/page.d.ts.map +0 -1
- package/dist/page.js.map +0 -1
- package/dist/provider/base.d.ts.map +0 -1
- package/dist/provider/base.js.map +0 -1
- package/dist/provider/next.d.ts.map +0 -1
- package/dist/provider/next.js.map +0 -1
- package/dist/provider/react-router.d.ts.map +0 -1
- package/dist/provider/react-router.js.map +0 -1
- package/dist/provider/tanstack.d.ts.map +0 -1
- package/dist/provider/tanstack.js.map +0 -1
- package/dist/provider/waku.d.ts.map +0 -1
- package/dist/provider/waku.js.map +0 -1
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { BaseSlots, BaseSlotsProps } from "../shared/client.js";
|
|
2
|
+
import { LayoutTab, LinkItemType } from "../shared/index.js";
|
|
3
|
+
import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
|
|
4
|
+
import { DocsLayoutProps } from "./index.js";
|
|
5
|
+
import { ComponentProps, FC } from "react";
|
|
6
6
|
//#region src/layouts/docs/client.d.ts
|
|
7
|
-
|
|
7
|
+
interface DocsSlots extends BaseSlots {
|
|
8
|
+
container: FC<ComponentProps<'div'>>;
|
|
9
|
+
header: FC<ComponentProps<'header'>>;
|
|
10
|
+
sidebar: {
|
|
11
|
+
provider: FC<SidebarProviderProps>;
|
|
12
|
+
root: FC<SidebarProps>;
|
|
13
|
+
trigger: FC<ComponentProps<'button'>>;
|
|
14
|
+
useSidebar: () => {
|
|
15
|
+
collapsed: boolean;
|
|
16
|
+
open: boolean;
|
|
17
|
+
setOpen: (v: boolean) => void;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
interface SlotsProps extends BaseSlotsProps<DocsLayoutProps> {
|
|
22
|
+
tabs: LayoutTab[];
|
|
23
|
+
tabMode: NonNullable<DocsLayoutProps['tabMode']>;
|
|
24
|
+
}
|
|
25
|
+
declare function useDocsLayout(): {
|
|
26
|
+
props: SlotsProps;
|
|
8
27
|
isNavTransparent: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}: {
|
|
14
|
-
navTransparentMode?: 'always' | 'top' | 'none';
|
|
15
|
-
children: ReactNode;
|
|
16
|
-
}): react_jsx_runtime93.JSX.Element;
|
|
17
|
-
declare function LayoutHeader(props: ComponentProps<'header'>): react_jsx_runtime93.JSX.Element;
|
|
18
|
-
declare function LayoutBody({
|
|
19
|
-
className,
|
|
20
|
-
style,
|
|
21
|
-
children,
|
|
22
|
-
...props
|
|
23
|
-
}: ComponentProps<'div'>): react_jsx_runtime93.JSX.Element;
|
|
24
|
-
declare function LayoutTabs({
|
|
25
|
-
options,
|
|
26
|
-
...props
|
|
27
|
-
}: ComponentProps<'div'> & {
|
|
28
|
-
options: SidebarTab[];
|
|
29
|
-
}): react_jsx_runtime93.JSX.Element;
|
|
28
|
+
navItems: LinkItemType[];
|
|
29
|
+
menuItems: LinkItemType[];
|
|
30
|
+
slots: DocsSlots;
|
|
31
|
+
};
|
|
30
32
|
//#endregion
|
|
31
|
-
export {
|
|
32
|
-
//# sourceMappingURL=client.d.ts.map
|
|
33
|
+
export { DocsSlots, useDocsLayout };
|
|
@@ -1,68 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { TreeContextProvider } from "../../contexts/tree.js";
|
|
4
|
+
import { baseSlots } from "../shared/client.js";
|
|
5
|
+
import { isLayoutTabActive, useLinkItems } from "../shared/index.js";
|
|
6
|
+
import { useIsScrollTop } from "../../utils/use-is-scroll-top.js";
|
|
7
|
+
import { Sidebar, SidebarProvider, SidebarTrigger, useSidebar } from "./slots/sidebar.js";
|
|
8
|
+
import { Header } from "./slots/header.js";
|
|
9
|
+
import { Container } from "./slots/container.js";
|
|
9
10
|
import { createContext, use, useMemo } from "react";
|
|
10
|
-
import {
|
|
11
|
-
|
|
11
|
+
import { usePathname } from "@hanzo/docs-core/framework";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import Link from "@hanzo/docs-core/link";
|
|
12
14
|
//#region src/layouts/docs/client.tsx
|
|
15
|
+
const { useProvider } = baseSlots({ useProps() {
|
|
16
|
+
return useDocsLayout().props;
|
|
17
|
+
} });
|
|
13
18
|
const LayoutContext = createContext(null);
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
const isNavTransparent = navTransparentMode === "top" ? isTop : navTransparentMode === "always";
|
|
17
|
-
return /* @__PURE__ */ jsx(LayoutContext, {
|
|
18
|
-
value: useMemo(() => ({ isNavTransparent }), [isNavTransparent]),
|
|
19
|
-
children
|
|
20
|
-
});
|
|
19
|
+
function useIsDocsLayout() {
|
|
20
|
+
return use(LayoutContext) !== null;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
...props,
|
|
27
|
-
children: props.children
|
|
28
|
-
});
|
|
22
|
+
function useDocsLayout() {
|
|
23
|
+
const context = use(LayoutContext);
|
|
24
|
+
if (!context) throw new Error("Please use <DocsPage /> (`@hanzo/docs-ui/layouts/docs/page`) under <DocsLayout /> (`@hanzo/docs-ui/layouts/docs`).");
|
|
25
|
+
return context;
|
|
29
26
|
}
|
|
30
|
-
function LayoutBody(
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
function LayoutBody(props) {
|
|
28
|
+
const { nav: { enabled: navEnabled = true, transparentMode: navTransparentMode = "none" } = {}, sidebar: { enabled: sidebarEnabled = true, defaultOpenLevel, prefetch, ...sidebarProps } = {}, slots: defaultSlots, tabs, tabMode = "auto", tree, containerProps, children } = props;
|
|
29
|
+
const isTop = useIsScrollTop({ enabled: navTransparentMode === "top" }) ?? true;
|
|
30
|
+
const isNavTransparent = navTransparentMode === "top" ? isTop : navTransparentMode === "always";
|
|
31
|
+
const { baseSlots, baseProps } = useProvider(props);
|
|
32
|
+
const linkItems = useLinkItems(props);
|
|
33
|
+
const slots = {
|
|
34
|
+
...baseSlots,
|
|
35
|
+
header: defaultSlots?.header ?? Header,
|
|
36
|
+
container: defaultSlots?.container ?? Container,
|
|
37
|
+
sidebar: defaultSlots?.sidebar ?? {
|
|
38
|
+
provider: SidebarProvider,
|
|
39
|
+
root: Sidebar,
|
|
40
|
+
trigger: SidebarTrigger,
|
|
41
|
+
useSidebar
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(TreeContextProvider, {
|
|
45
|
+
tree,
|
|
46
|
+
children: /* @__PURE__ */ jsx(LayoutContext, {
|
|
47
|
+
value: {
|
|
48
|
+
props: {
|
|
49
|
+
tabMode,
|
|
50
|
+
tabs,
|
|
51
|
+
...baseProps
|
|
52
|
+
},
|
|
53
|
+
isNavTransparent,
|
|
54
|
+
slots,
|
|
55
|
+
...linkItems
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ jsx(slots.sidebar.provider, {
|
|
58
|
+
defaultOpenLevel,
|
|
59
|
+
prefetch,
|
|
60
|
+
children: /* @__PURE__ */ jsxs(slots.container, {
|
|
61
|
+
...containerProps,
|
|
62
|
+
children: [
|
|
63
|
+
navEnabled && /* @__PURE__ */ jsx(slots.header, {}),
|
|
64
|
+
sidebarEnabled && /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }),
|
|
65
|
+
tabMode === "top" && tabs.length > 0 && /* @__PURE__ */ jsx(LayoutTabs, {
|
|
66
|
+
tabs,
|
|
67
|
+
className: "z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"
|
|
68
|
+
}),
|
|
69
|
+
children
|
|
70
|
+
]
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})
|
|
48
74
|
});
|
|
49
75
|
}
|
|
50
|
-
function LayoutTabs({
|
|
76
|
+
function LayoutTabs({ tabs, ...props }) {
|
|
51
77
|
const pathname = usePathname();
|
|
52
78
|
const selected = useMemo(() => {
|
|
53
|
-
return
|
|
54
|
-
}, [
|
|
79
|
+
return tabs.findLast((option) => isLayoutTabActive(option, pathname));
|
|
80
|
+
}, [tabs, pathname]);
|
|
55
81
|
return /* @__PURE__ */ jsx("div", {
|
|
56
82
|
...props,
|
|
57
83
|
className: cn("flex flex-row items-end gap-6 overflow-auto [grid-area:main]", props.className),
|
|
58
|
-
children:
|
|
59
|
-
href:
|
|
60
|
-
className: cn("inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground",
|
|
61
|
-
children:
|
|
84
|
+
children: tabs.map((tab, i) => /* @__PURE__ */ jsx(Link, {
|
|
85
|
+
href: tab.url,
|
|
86
|
+
className: cn("inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground", tab.unlisted && selected !== tab && "hidden", selected === tab && "border-fd-primary text-fd-primary"),
|
|
87
|
+
children: tab.title
|
|
62
88
|
}, i))
|
|
63
89
|
});
|
|
64
90
|
}
|
|
65
|
-
|
|
66
91
|
//#endregion
|
|
67
|
-
export { LayoutBody,
|
|
68
|
-
//# sourceMappingURL=client.js.map
|
|
92
|
+
export { LayoutBody, useDocsLayout, useIsDocsLayout };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import * as react_jsx_runtime141 from "react/jsx-runtime";
|
|
7
|
-
import { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
1
|
+
import { BaseLayoutProps, GetLayoutTabsOptions, LayoutTab } from "../shared/index.js";
|
|
2
|
+
import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
|
|
3
|
+
import { DocsSlots, useDocsLayout } from "./client.js";
|
|
4
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
6
|
import * as PageTree from "@hanzo/docs-core/page-tree";
|
|
9
7
|
|
|
10
8
|
//#region src/layouts/docs/index.d.ts
|
|
@@ -12,48 +10,36 @@ interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
12
10
|
tree: PageTree.Root;
|
|
13
11
|
sidebar?: SidebarOptions;
|
|
14
12
|
tabMode?: 'top' | 'auto';
|
|
15
|
-
|
|
16
|
-
* Props for the `div` container
|
|
17
|
-
*/
|
|
13
|
+
tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
|
|
18
14
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
|
+
slots?: Partial<DocsSlots>;
|
|
19
16
|
}
|
|
20
|
-
interface SidebarOptions extends
|
|
17
|
+
interface SidebarOptions extends SidebarProps, SidebarProviderProps {
|
|
21
18
|
enabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated use `slots.sidebar` instead.
|
|
21
|
+
*/
|
|
22
22
|
component?: ReactNode;
|
|
23
|
-
components?: Partial<SidebarPageTreeComponents>;
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
24
|
+
* @deprecated use layout-level `tabMode` option instead.
|
|
26
25
|
*/
|
|
27
|
-
|
|
28
|
-
banner?: ReactNode;
|
|
29
|
-
footer?: ReactNode;
|
|
26
|
+
tabMode?: 'auto' | 'top';
|
|
30
27
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @defaultValue true
|
|
28
|
+
* @deprecated use layout-level `tabs` option instead.
|
|
34
29
|
*/
|
|
35
|
-
|
|
30
|
+
tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
|
|
36
31
|
}
|
|
37
32
|
declare function DocsLayout({
|
|
38
|
-
|
|
39
|
-
transparentMode,
|
|
40
|
-
...nav
|
|
41
|
-
},
|
|
33
|
+
tree,
|
|
42
34
|
sidebar: {
|
|
43
|
-
tabs:
|
|
44
|
-
|
|
45
|
-
defaultOpenLevel,
|
|
46
|
-
prefetch,
|
|
35
|
+
tabs: _tabs,
|
|
36
|
+
tabMode: _tabMode,
|
|
47
37
|
...sidebarProps
|
|
48
38
|
},
|
|
49
|
-
|
|
50
|
-
themeSwitch,
|
|
39
|
+
tabs: layoutTabs,
|
|
51
40
|
tabMode,
|
|
52
|
-
i18n,
|
|
53
41
|
children,
|
|
54
|
-
tree,
|
|
55
42
|
...props
|
|
56
|
-
}: DocsLayoutProps):
|
|
43
|
+
}: DocsLayoutProps): react_jsx_runtime0.JSX.Element;
|
|
57
44
|
//#endregion
|
|
58
|
-
export { DocsLayout, DocsLayoutProps };
|
|
59
|
-
//# sourceMappingURL=index.d.ts.map
|
|
45
|
+
export { DocsLayout, DocsLayoutProps, type DocsSlots, useDocsLayout };
|
|
@@ -1,178 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { SidebarTabsDropdown } from "../../components/sidebar/tabs/dropdown.js";
|
|
4
|
-
import { LayoutBody, LayoutContextProvider, LayoutHeader, LayoutTabs } from "./client.js";
|
|
5
|
-
import { renderTitleNav, resolveLinkItems } from "../shared/index.js";
|
|
6
|
-
import { LargeSearchToggle, SearchToggle } from "../shared/search-toggle.js";
|
|
7
|
-
import { ThemeToggle } from "../shared/theme-toggle.js";
|
|
8
|
-
import { LanguageToggle, LanguageToggleText } from "../shared/language-toggle.js";
|
|
9
|
-
import { getSidebarTabs } from "../../components/sidebar/tabs/index.js";
|
|
10
|
-
import { Sidebar as Sidebar$1, SidebarCollapseTrigger, SidebarContent, SidebarDrawer, SidebarLinkItem, SidebarPageTree, SidebarTrigger, SidebarViewport } from "./sidebar.js";
|
|
11
|
-
import { cn } from "@hanzo/docs-ui/cn";
|
|
12
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Languages, Sidebar } from "lucide-react";
|
|
1
|
+
import { getLayoutTabs } from "../shared/index.js";
|
|
2
|
+
import { LayoutBody, useDocsLayout } from "./client.js";
|
|
14
3
|
import { useMemo } from "react";
|
|
15
|
-
import {
|
|
16
|
-
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
5
|
//#region src/layouts/docs/index.tsx
|
|
18
|
-
function DocsLayout({
|
|
19
|
-
|
|
20
|
-
if (Array.isArray(sidebarTabs)) return sidebarTabs;
|
|
21
|
-
if (typeof sidebarTabs === "object") return getSidebarTabs(tree, sidebarTabs);
|
|
22
|
-
if (sidebarTabs !== false) return getSidebarTabs(tree);
|
|
23
|
-
return [];
|
|
24
|
-
}, [tree, sidebarTabs]);
|
|
25
|
-
const links = resolveLinkItems(props);
|
|
26
|
-
function sidebar() {
|
|
27
|
-
const { footer, banner, collapsible = true, component, components, ...rest } = sidebarProps;
|
|
28
|
-
if (component) return component;
|
|
29
|
-
const iconLinks = links.filter((item) => item.type === "icon");
|
|
30
|
-
const viewport = /* @__PURE__ */ jsxs(SidebarViewport, { children: [links.filter((v) => v.type !== "icon").map((item, i, list) => /* @__PURE__ */ jsx(SidebarLinkItem, {
|
|
31
|
-
item,
|
|
32
|
-
className: cn(i === list.length - 1 && "mb-4")
|
|
33
|
-
}, i)), /* @__PURE__ */ jsx(SidebarPageTree, { ...components })] });
|
|
34
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(SidebarContent, {
|
|
35
|
-
...rest,
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ jsxs("div", {
|
|
38
|
-
className: "flex flex-col gap-3 p-4 pb-2",
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ jsxs("div", {
|
|
41
|
-
className: "flex",
|
|
42
|
-
children: [
|
|
43
|
-
renderTitleNav(nav, { className: "inline-flex text-[0.9375rem] items-center gap-2.5 font-medium me-auto" }),
|
|
44
|
-
nav.children,
|
|
45
|
-
collapsible && /* @__PURE__ */ jsx(SidebarCollapseTrigger, {
|
|
46
|
-
className: cn(buttonVariants({
|
|
47
|
-
color: "ghost",
|
|
48
|
-
size: "icon-sm",
|
|
49
|
-
className: "mb-auto text-fd-muted-foreground"
|
|
50
|
-
})),
|
|
51
|
-
children: /* @__PURE__ */ jsx(Sidebar, {})
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
}),
|
|
55
|
-
searchToggle.enabled !== false && (searchToggle.components?.lg ?? /* @__PURE__ */ jsx(LargeSearchToggle, { hideIfDisabled: true })),
|
|
56
|
-
tabs.length > 0 && tabMode === "auto" && /* @__PURE__ */ jsx(SidebarTabsDropdown, { options: tabs }),
|
|
57
|
-
banner
|
|
58
|
-
]
|
|
59
|
-
}),
|
|
60
|
-
viewport,
|
|
61
|
-
(i18n || iconLinks.length > 0 || themeSwitch?.enabled !== false || footer) && /* @__PURE__ */ jsxs("div", {
|
|
62
|
-
className: "flex flex-col border-t p-4 pt-2 empty:hidden",
|
|
63
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
64
|
-
className: "flex text-fd-muted-foreground items-center empty:hidden",
|
|
65
|
-
children: [
|
|
66
|
-
i18n && /* @__PURE__ */ jsx(LanguageToggle, { children: /* @__PURE__ */ jsx(Languages, { className: "size-4.5" }) }),
|
|
67
|
-
iconLinks.map((item, i) => /* @__PURE__ */ jsx(LinkItem, {
|
|
68
|
-
item,
|
|
69
|
-
className: cn(buttonVariants({
|
|
70
|
-
size: "icon-sm",
|
|
71
|
-
color: "ghost"
|
|
72
|
-
})),
|
|
73
|
-
"aria-label": item.label,
|
|
74
|
-
children: item.icon
|
|
75
|
-
}, i)),
|
|
76
|
-
themeSwitch.enabled !== false && (themeSwitch.component ?? /* @__PURE__ */ jsx(ThemeToggle, {
|
|
77
|
-
className: "ms-auto p-0",
|
|
78
|
-
mode: themeSwitch.mode
|
|
79
|
-
}))
|
|
80
|
-
]
|
|
81
|
-
}), footer]
|
|
82
|
-
})
|
|
83
|
-
]
|
|
84
|
-
}), /* @__PURE__ */ jsxs(SidebarDrawer, { children: [
|
|
85
|
-
/* @__PURE__ */ jsxs("div", {
|
|
86
|
-
className: "flex flex-col gap-3 p-4 pb-2",
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ jsxs("div", {
|
|
89
|
-
className: "flex text-fd-muted-foreground items-center gap-1.5",
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsx("div", {
|
|
92
|
-
className: "flex flex-1",
|
|
93
|
-
children: iconLinks.map((item, i) => /* @__PURE__ */ jsx(LinkItem, {
|
|
94
|
-
item,
|
|
95
|
-
className: cn(buttonVariants({
|
|
96
|
-
size: "icon-sm",
|
|
97
|
-
color: "ghost",
|
|
98
|
-
className: "p-2"
|
|
99
|
-
})),
|
|
100
|
-
"aria-label": item.label,
|
|
101
|
-
children: item.icon
|
|
102
|
-
}, i))
|
|
103
|
-
}),
|
|
104
|
-
i18n && /* @__PURE__ */ jsxs(LanguageToggle, { children: [/* @__PURE__ */ jsx(Languages, { className: "size-4.5" }), /* @__PURE__ */ jsx(LanguageToggleText, {})] }),
|
|
105
|
-
themeSwitch.enabled !== false && (themeSwitch.component ?? /* @__PURE__ */ jsx(ThemeToggle, {
|
|
106
|
-
className: "p-0",
|
|
107
|
-
mode: themeSwitch.mode
|
|
108
|
-
})),
|
|
109
|
-
/* @__PURE__ */ jsx(SidebarTrigger, {
|
|
110
|
-
className: cn(buttonVariants({
|
|
111
|
-
color: "ghost",
|
|
112
|
-
size: "icon-sm",
|
|
113
|
-
className: "p-2"
|
|
114
|
-
})),
|
|
115
|
-
children: /* @__PURE__ */ jsx(Sidebar, {})
|
|
116
|
-
})
|
|
117
|
-
]
|
|
118
|
-
}),
|
|
119
|
-
tabs.length > 0 && /* @__PURE__ */ jsx(SidebarTabsDropdown, { options: tabs }),
|
|
120
|
-
banner
|
|
121
|
-
]
|
|
122
|
-
}),
|
|
123
|
-
viewport,
|
|
124
|
-
/* @__PURE__ */ jsx("div", {
|
|
125
|
-
className: "flex flex-col border-t p-4 pt-2 empty:hidden",
|
|
126
|
-
children: footer
|
|
127
|
-
})
|
|
128
|
-
] })] });
|
|
129
|
-
}
|
|
130
|
-
return /* @__PURE__ */ jsx(tree_exports.TreeContextProvider, {
|
|
6
|
+
function DocsLayout({ tree, sidebar: { tabs: _tabs, tabMode: _tabMode, ...sidebarProps } = {}, tabs: layoutTabs = _tabs, tabMode = _tabMode, children, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(LayoutBody, {
|
|
131
8
|
tree,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
className: "[grid-area:header] sticky top-(--fd-docs-row-1) z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm h-(--fd-header-height) md:hidden max-md:layout:[--fd-header-height:--spacing(14)] data-[transparent=false]:bg-fd-background/80",
|
|
143
|
-
children: [
|
|
144
|
-
renderTitleNav(nav, { className: "inline-flex items-center gap-2.5 font-semibold" }),
|
|
145
|
-
/* @__PURE__ */ jsx("div", {
|
|
146
|
-
className: "flex-1",
|
|
147
|
-
children: nav.children
|
|
148
|
-
}),
|
|
149
|
-
searchToggle.enabled !== false && (searchToggle.components?.sm ?? /* @__PURE__ */ jsx(SearchToggle, {
|
|
150
|
-
className: "p-2",
|
|
151
|
-
hideIfDisabled: true
|
|
152
|
-
})),
|
|
153
|
-
sidebarEnabled && /* @__PURE__ */ jsx(SidebarTrigger, {
|
|
154
|
-
className: cn(buttonVariants({
|
|
155
|
-
color: "ghost",
|
|
156
|
-
size: "icon-sm",
|
|
157
|
-
className: "p-2"
|
|
158
|
-
})),
|
|
159
|
-
children: /* @__PURE__ */ jsx(Sidebar, {})
|
|
160
|
-
})
|
|
161
|
-
]
|
|
162
|
-
})),
|
|
163
|
-
sidebarEnabled && sidebar(),
|
|
164
|
-
tabMode === "top" && tabs.length > 0 && /* @__PURE__ */ jsx(LayoutTabs, {
|
|
165
|
-
options: tabs,
|
|
166
|
-
className: "z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"
|
|
167
|
-
}),
|
|
168
|
-
children
|
|
169
|
-
]
|
|
170
|
-
})
|
|
171
|
-
})
|
|
172
|
-
})
|
|
9
|
+
tabs: useMemo(() => {
|
|
10
|
+
if (Array.isArray(layoutTabs)) return layoutTabs;
|
|
11
|
+
if (typeof layoutTabs === "object") return getLayoutTabs(tree, layoutTabs);
|
|
12
|
+
if (layoutTabs !== false) return getLayoutTabs(tree);
|
|
13
|
+
return [];
|
|
14
|
+
}, [tree, layoutTabs]),
|
|
15
|
+
tabMode,
|
|
16
|
+
sidebar: sidebarProps,
|
|
17
|
+
...props,
|
|
18
|
+
children
|
|
173
19
|
});
|
|
174
20
|
}
|
|
175
|
-
|
|
176
21
|
//#endregion
|
|
177
|
-
export { DocsLayout };
|
|
178
|
-
//# sourceMappingURL=index.js.map
|
|
22
|
+
export { DocsLayout, useDocsLayout };
|
|
@@ -1,76 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { TOCPopoverProps, TOCProps, TOCProviderProps } from "./slots/toc.js";
|
|
2
|
+
import { Footer, FooterProps } from "./slots/footer.js";
|
|
3
|
+
import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
|
|
4
|
+
import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
|
|
5
|
+
import { ComponentProps, FC, ReactNode } from "react";
|
|
6
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
import { TOCItemType } from "@hanzo/docs-core/toc";
|
|
5
8
|
|
|
6
9
|
//#region src/layouts/docs/page/index.d.ts
|
|
7
|
-
interface
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
component: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
interface FooterOptions extends FooterProps {
|
|
12
|
-
enabled: boolean;
|
|
13
|
-
component: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
interface DocsPageProps {
|
|
10
|
+
interface DocsPageProps extends ComponentProps<'article'> {
|
|
16
11
|
toc?: TOCItemType[];
|
|
17
|
-
tableOfContent?: Partial<TableOfContentOptions>;
|
|
18
|
-
tableOfContentPopover?: Partial<TableOfContentPopoverOptions>;
|
|
19
12
|
/**
|
|
20
13
|
* Extend the page to fill all available space
|
|
21
14
|
*
|
|
22
15
|
* @defaultValue false
|
|
23
16
|
*/
|
|
24
17
|
full?: boolean;
|
|
18
|
+
slots?: Partial<DocsPageSlots>;
|
|
19
|
+
footer?: FooterOptions;
|
|
20
|
+
breadcrumb?: BreadcrumbOptions;
|
|
21
|
+
tableOfContent?: TableOfContentOptions;
|
|
22
|
+
tableOfContentPopover?: TableOfContentPopoverOptions;
|
|
23
|
+
}
|
|
24
|
+
interface BreadcrumbOptions extends BreadcrumbProps {
|
|
25
|
+
enabled?: boolean;
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
breadcrumb?: Partial<BreadcrumbOptions>;
|
|
29
|
-
/**
|
|
30
|
-
* Footer navigation, you can disable it by passing `false`
|
|
27
|
+
* @deprecated use `slots.breadcrumb` instead.
|
|
31
28
|
*/
|
|
32
|
-
|
|
33
|
-
children?: ReactNode;
|
|
29
|
+
component?: ReactNode;
|
|
34
30
|
}
|
|
35
|
-
|
|
31
|
+
interface FooterOptions extends FooterProps {
|
|
32
|
+
enabled?: boolean;
|
|
36
33
|
/**
|
|
37
|
-
*
|
|
34
|
+
* @deprecated use `slots.footer` instead.
|
|
38
35
|
*/
|
|
39
|
-
|
|
36
|
+
component?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
interface TableOfContentOptions extends Pick<TOCProviderProps, 'single'>, TOCProps {
|
|
39
|
+
enabled?: boolean;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* @deprecated use `slots.toc` instead.
|
|
42
42
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
component?: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
interface TableOfContentPopoverOptions extends TOCPopoverProps {
|
|
46
|
+
enabled?: boolean;
|
|
46
47
|
/**
|
|
47
|
-
* @
|
|
48
|
+
* @deprecated use `slots.tocPopover` instead.
|
|
48
49
|
*/
|
|
49
|
-
|
|
50
|
+
component?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
interface DocsPageSlots {
|
|
53
|
+
toc: {
|
|
54
|
+
provider: FC<TOCProviderProps>;
|
|
55
|
+
main: FC<TOCProps>;
|
|
56
|
+
popover: FC<TOCPopoverProps>;
|
|
57
|
+
};
|
|
58
|
+
container: FC<ComponentProps<'article'>>;
|
|
59
|
+
footer: FC<FooterProps>;
|
|
60
|
+
breadcrumb: FC<BreadcrumbProps>;
|
|
61
|
+
}
|
|
62
|
+
type PageSlotsProps = Pick<DocsPageProps, 'full'>;
|
|
63
|
+
declare function useDocsPage(): {
|
|
64
|
+
props: PageSlotsProps;
|
|
65
|
+
slots: DocsPageSlots;
|
|
50
66
|
};
|
|
51
|
-
type TableOfContentPopoverOptions = Omit<TableOfContentOptions, 'single'>;
|
|
52
67
|
declare function DocsPage({
|
|
53
|
-
|
|
54
|
-
enabled:
|
|
55
|
-
|
|
56
|
-
...
|
|
68
|
+
tableOfContent: {
|
|
69
|
+
enabled: tocEnabled,
|
|
70
|
+
single,
|
|
71
|
+
...tocProps
|
|
57
72
|
},
|
|
58
|
-
footer,
|
|
59
|
-
full,
|
|
60
73
|
tableOfContentPopover: {
|
|
61
74
|
enabled: tocPopoverEnabled,
|
|
62
|
-
|
|
63
|
-
...tocPopoverOptions
|
|
75
|
+
...tocPopoverProps
|
|
64
76
|
},
|
|
65
|
-
|
|
66
|
-
enabled:
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
breadcrumb: {
|
|
78
|
+
enabled: breadcrumbEnabled,
|
|
79
|
+
...breadcrumb
|
|
80
|
+
},
|
|
81
|
+
footer: {
|
|
82
|
+
enabled: footerEnabled,
|
|
83
|
+
...footer
|
|
69
84
|
},
|
|
85
|
+
full,
|
|
70
86
|
toc,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
slots: defaultSlots,
|
|
88
|
+
children,
|
|
89
|
+
...containerProps
|
|
90
|
+
}: DocsPageProps): react_jsx_runtime0.JSX.Element;
|
|
91
|
+
declare function EditOnGitHub(props: ComponentProps<'a'>): react_jsx_runtime0.JSX.Element;
|
|
74
92
|
/**
|
|
75
93
|
* Add typography styles
|
|
76
94
|
*/
|
|
@@ -78,17 +96,22 @@ declare function DocsBody({
|
|
|
78
96
|
children,
|
|
79
97
|
className,
|
|
80
98
|
...props
|
|
81
|
-
}: ComponentProps<'div'>):
|
|
99
|
+
}: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
82
100
|
declare function DocsDescription({
|
|
83
101
|
children,
|
|
84
102
|
className,
|
|
85
103
|
...props
|
|
86
|
-
}: ComponentProps<'p'>):
|
|
104
|
+
}: ComponentProps<'p'>): react_jsx_runtime0.JSX.Element | null;
|
|
87
105
|
declare function DocsTitle({
|
|
88
106
|
children,
|
|
89
107
|
className,
|
|
90
108
|
...props
|
|
91
|
-
}: ComponentProps<'h1'>):
|
|
109
|
+
}: ComponentProps<'h1'>): react_jsx_runtime0.JSX.Element;
|
|
110
|
+
declare function PageLastUpdate({
|
|
111
|
+
date: value,
|
|
112
|
+
...props
|
|
113
|
+
}: Omit<ComponentProps<'p'>, 'children'> & {
|
|
114
|
+
date: Date;
|
|
115
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
92
116
|
//#endregion
|
|
93
|
-
export { DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate };
|
|
94
|
-
//# sourceMappingURL=index.d.ts.map
|
|
117
|
+
export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
|