@hanzo/docs-radix-ui 16.4.3
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/README.md +5 -0
- package/css/black.css +1 -0
- package/css/catppuccin.css +1 -0
- package/css/dusk.css +1 -0
- package/css/layouts/docs.css +1 -0
- package/css/layouts/home.css +1 -0
- package/css/layouts/notebook.css +1 -0
- package/css/neutral.css +1 -0
- package/css/ocean.css +1 -0
- package/css/preset.css +89 -0
- package/css/purple.css +1 -0
- package/css/shadcn.css +1 -0
- package/css/solar.css +1 -0
- package/css/style.css +9 -0
- package/css/vitepress.css +1 -0
- package/dist/_virtual/rolldown_runtime.js +36 -0
- package/dist/components/accordion.d.ts +25 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +70 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/banner.d.ts +35 -0
- package/dist/components/banner.d.ts.map +1 -0
- package/dist/components/banner.js +70 -0
- package/dist/components/banner.js.map +1 -0
- package/dist/components/callout.d.ts +43 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +63 -0
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +21 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +41 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/codeblock.d.ts +63 -0
- package/dist/components/codeblock.d.ts.map +1 -0
- package/dist/components/codeblock.js +126 -0
- package/dist/components/codeblock.js.map +1 -0
- package/dist/components/dialog/search-algolia.d.ts +39 -0
- package/dist/components/dialog/search-algolia.d.ts.map +1 -0
- package/dist/components/dialog/search-algolia.js +68 -0
- package/dist/components/dialog/search-algolia.js.map +1 -0
- package/dist/components/dialog/search-default.d.ts +44 -0
- package/dist/components/dialog/search-default.d.ts.map +1 -0
- package/dist/components/dialog/search-default.js +66 -0
- package/dist/components/dialog/search-default.js.map +1 -0
- package/dist/components/dialog/search-orama.d.ts +46 -0
- package/dist/components/dialog/search-orama.d.ts.map +1 -0
- package/dist/components/dialog/search-orama.js +73 -0
- package/dist/components/dialog/search-orama.js.map +1 -0
- package/dist/components/dialog/search.d.ts +113 -0
- package/dist/components/dialog/search.d.ts.map +1 -0
- package/dist/components/dialog/search.js +271 -0
- package/dist/components/dialog/search.js.map +1 -0
- package/dist/components/dynamic-codeblock.d.ts +32 -0
- package/dist/components/dynamic-codeblock.d.ts.map +1 -0
- package/dist/components/dynamic-codeblock.js +66 -0
- package/dist/components/dynamic-codeblock.js.map +1 -0
- package/dist/components/files.d.ts +35 -0
- package/dist/components/files.d.ts.map +1 -0
- package/dist/components/files.js +44 -0
- package/dist/components/files.js.map +1 -0
- package/dist/components/github-info.d.ts +19 -0
- package/dist/components/github-info.d.ts.map +1 -0
- package/dist/components/github-info.js +68 -0
- package/dist/components/github-info.js.map +1 -0
- package/dist/components/heading.d.ts +15 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +29 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/image-zoom-CtfZieBH.css +80 -0
- package/dist/components/image-zoom-CtfZieBH.css.map +1 -0
- package/dist/components/image-zoom.css +77 -0
- package/dist/components/image-zoom.d.ts +25 -0
- package/dist/components/image-zoom.d.ts.map +1 -0
- package/dist/components/image-zoom.js +36 -0
- package/dist/components/image-zoom.js.map +1 -0
- package/dist/components/image-zoom2.js +1 -0
- package/dist/components/inline-toc.d.ts +16 -0
- package/dist/components/inline-toc.d.ts.map +1 -0
- package/dist/components/inline-toc.js +30 -0
- package/dist/components/inline-toc.js.map +1 -0
- package/dist/components/sidebar/base.d.ts +109 -0
- package/dist/components/sidebar/base.d.ts.map +1 -0
- package/dist/components/sidebar/base.js +262 -0
- package/dist/components/sidebar/base.js.map +1 -0
- package/dist/components/sidebar/link-item.d.ts +24 -0
- package/dist/components/sidebar/link-item.d.ts.map +1 -0
- package/dist/components/sidebar/link-item.js +33 -0
- package/dist/components/sidebar/link-item.js.map +1 -0
- package/dist/components/sidebar/page-tree.d.ts +30 -0
- package/dist/components/sidebar/page-tree.d.ts.map +1 -0
- package/dist/components/sidebar/page-tree.js +58 -0
- package/dist/components/sidebar/page-tree.js.map +1 -0
- package/dist/components/sidebar/tabs/dropdown.d.ts +20 -0
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -0
- package/dist/components/sidebar/tabs/dropdown.js +78 -0
- package/dist/components/sidebar/tabs/dropdown.js.map +1 -0
- package/dist/components/sidebar/tabs/index.d.ts +27 -0
- package/dist/components/sidebar/tabs/index.d.ts.map +1 -0
- package/dist/components/sidebar/tabs/index.js +49 -0
- package/dist/components/sidebar/tabs/index.js.map +1 -0
- package/dist/components/steps.d.ts +17 -0
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/steps.js +19 -0
- package/dist/components/steps.js.map +1 -0
- package/dist/components/tabs.d.ts +52 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +101 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/toc/clerk.d.ts +1 -0
- package/dist/components/toc/clerk.js +12 -0
- package/dist/components/toc/clerk.js.map +1 -0
- package/dist/components/toc/default.d.ts +1 -0
- package/dist/components/toc/default.js +12 -0
- package/dist/components/toc/default.js.map +1 -0
- package/dist/components/toc/index.d.ts +1 -0
- package/dist/components/toc/index.js +12 -0
- package/dist/components/toc/index.js.map +1 -0
- package/dist/components/type-table.d.ts +39 -0
- package/dist/components/type-table.d.ts.map +1 -0
- package/dist/components/type-table.js +109 -0
- package/dist/components/type-table.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +32 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +46 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +23 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +13 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +27 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +16 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +44 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +24 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +11 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +37 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +39 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +81 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/contexts/i18n.d.ts +1 -0
- package/dist/contexts/i18n.js +12 -0
- package/dist/contexts/i18n.js.map +1 -0
- package/dist/contexts/search.d.ts +8 -0
- package/dist/contexts/search.d.ts.map +1 -0
- package/dist/contexts/search.js +12 -0
- package/dist/contexts/search.js.map +1 -0
- package/dist/contexts/tree.d.ts +1 -0
- package/dist/contexts/tree.js +12 -0
- package/dist/contexts/tree.js.map +1 -0
- package/dist/i18n.d.ts +1 -0
- package/dist/i18n.js +3 -0
- package/dist/layouts/docs/client.d.ts +32 -0
- package/dist/layouts/docs/client.d.ts.map +1 -0
- package/dist/layouts/docs/client.js +68 -0
- package/dist/layouts/docs/client.js.map +1 -0
- package/dist/layouts/docs/index.d.ts +60 -0
- package/dist/layouts/docs/index.d.ts.map +1 -0
- package/dist/layouts/docs/index.js +179 -0
- package/dist/layouts/docs/index.js.map +1 -0
- package/dist/layouts/docs/page/client.d.ts +46 -0
- package/dist/layouts/docs/page/client.d.ts.map +1 -0
- package/dist/layouts/docs/page/client.js +227 -0
- package/dist/layouts/docs/page/client.js.map +1 -0
- package/dist/layouts/docs/page/index.d.ts +94 -0
- package/dist/layouts/docs/page/index.d.ts.map +1 -0
- package/dist/layouts/docs/page/index.js +104 -0
- package/dist/layouts/docs/page/index.js.map +1 -0
- package/dist/layouts/docs/sidebar.d.ts +58 -0
- package/dist/layouts/docs/sidebar.d.ts.map +1 -0
- package/dist/layouts/docs/sidebar.js +147 -0
- package/dist/layouts/docs/sidebar.js.map +1 -0
- package/dist/layouts/home/client.d.ts +19 -0
- package/dist/layouts/home/client.d.ts.map +1 -0
- package/dist/layouts/home/client.js +262 -0
- package/dist/layouts/home/client.js.map +1 -0
- package/dist/layouts/home/index.d.ts +17 -0
- package/dist/layouts/home/index.d.ts.map +1 -0
- package/dist/layouts/home/index.js +25 -0
- package/dist/layouts/home/index.js.map +1 -0
- package/dist/layouts/home/navbar.d.ts +14 -0
- package/dist/layouts/home/navbar.d.ts.map +1 -0
- package/dist/layouts/home/navbar.js +38 -0
- package/dist/layouts/home/navbar.js.map +1 -0
- package/dist/layouts/notebook/client.d.ts +47 -0
- package/dist/layouts/notebook/client.d.ts.map +1 -0
- package/dist/layouts/notebook/client.js +159 -0
- package/dist/layouts/notebook/client.js.map +1 -0
- package/dist/layouts/notebook/index.d.ts +38 -0
- package/dist/layouts/notebook/index.d.ts.map +1 -0
- package/dist/layouts/notebook/index.js +219 -0
- package/dist/layouts/notebook/index.js.map +1 -0
- package/dist/layouts/notebook/page/client.d.ts +46 -0
- package/dist/layouts/notebook/page/client.d.ts.map +1 -0
- package/dist/layouts/notebook/page/client.js +227 -0
- package/dist/layouts/notebook/page/client.js.map +1 -0
- package/dist/layouts/notebook/page/index.d.ts +94 -0
- package/dist/layouts/notebook/page/index.d.ts.map +1 -0
- package/dist/layouts/notebook/page/index.js +104 -0
- package/dist/layouts/notebook/page/index.js.map +1 -0
- package/dist/layouts/notebook/sidebar.d.ts +63 -0
- package/dist/layouts/notebook/sidebar.d.ts.map +1 -0
- package/dist/layouts/notebook/sidebar.js +147 -0
- package/dist/layouts/notebook/sidebar.js.map +1 -0
- package/dist/layouts/shared/index.d.ts +69 -0
- package/dist/layouts/shared/index.d.ts.map +1 -0
- package/dist/layouts/shared/index.js +39 -0
- package/dist/layouts/shared/index.js.map +1 -0
- package/dist/layouts/shared/language-toggle.d.ts +10 -0
- package/dist/layouts/shared/language-toggle.d.ts.map +1 -0
- package/dist/layouts/shared/language-toggle.js +47 -0
- package/dist/layouts/shared/language-toggle.js.map +1 -0
- package/dist/layouts/shared/search-toggle.d.ts +23 -0
- package/dist/layouts/shared/search-toggle.d.ts.map +1 -0
- package/dist/layouts/shared/search-toggle.js +56 -0
- package/dist/layouts/shared/search-toggle.js.map +1 -0
- package/dist/layouts/shared/theme-toggle.d.ts +14 -0
- package/dist/layouts/shared/theme-toggle.d.ts.map +1 -0
- package/dist/layouts/shared/theme-toggle.js +62 -0
- package/dist/layouts/shared/theme-toggle.js.map +1 -0
- package/dist/mdx.d.ts +38 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +74 -0
- package/dist/mdx.js.map +1 -0
- package/dist/mdx.server.d.ts +17 -0
- package/dist/mdx.server.d.ts.map +1 -0
- package/dist/mdx.server.js +23 -0
- package/dist/mdx.server.js.map +1 -0
- package/dist/og.d.ts +1 -0
- package/dist/og.js +3 -0
- package/dist/page.d.ts +37 -0
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +38 -0
- package/dist/page.js.map +1 -0
- package/dist/provider/base.d.ts +50 -0
- package/dist/provider/base.d.ts.map +1 -0
- package/dist/provider/base.js +39 -0
- package/dist/provider/base.js.map +1 -0
- package/dist/provider/next.d.ts +22 -0
- package/dist/provider/next.d.ts.map +1 -0
- package/dist/provider/next.js +21 -0
- package/dist/provider/next.js.map +1 -0
- package/dist/provider/react-router.d.ts +22 -0
- package/dist/provider/react-router.d.ts.map +1 -0
- package/dist/provider/react-router.js +21 -0
- package/dist/provider/react-router.js.map +1 -0
- package/dist/provider/tanstack.d.ts +22 -0
- package/dist/provider/tanstack.d.ts.map +1 -0
- package/dist/provider/tanstack.js +21 -0
- package/dist/provider/tanstack.js.map +1 -0
- package/dist/provider/waku.d.ts +22 -0
- package/dist/provider/waku.d.ts.map +1 -0
- package/dist/provider/waku.js +21 -0
- package/dist/provider/waku.js.map +1 -0
- package/dist/style.css +3255 -0
- package/dist/utils/use-copy-button.d.ts +1 -0
- package/dist/utils/use-copy-button.js +3 -0
- package/dist/utils/use-footer-items.d.ts +1 -0
- package/dist/utils/use-footer-items.js +3 -0
- package/dist/utils/use-is-scroll-top.d.ts +1 -0
- package/dist/utils/use-is-scroll-top.js +3 -0
- package/package.json +149 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { BreadcrumbProps, FooterProps, PageBreadcrumb, PageLastUpdate } from "./client.js";
|
|
2
|
+
import * as react_jsx_runtime123 from "react/jsx-runtime";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
import { AnchorProviderProps, TOCItemType } from "@hanzo/docs-core/toc";
|
|
5
|
+
|
|
6
|
+
//#region src/layouts/notebook/page/index.d.ts
|
|
7
|
+
interface BreadcrumbOptions extends BreadcrumbProps {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
component: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface FooterOptions extends FooterProps {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
component: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
interface DocsPageProps {
|
|
16
|
+
toc?: TOCItemType[];
|
|
17
|
+
tableOfContent?: Partial<TableOfContentOptions>;
|
|
18
|
+
tableOfContentPopover?: Partial<TableOfContentPopoverOptions>;
|
|
19
|
+
/**
|
|
20
|
+
* Extend the page to fill all available space
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue false
|
|
23
|
+
*/
|
|
24
|
+
full?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Replace or disable breadcrumb
|
|
27
|
+
*/
|
|
28
|
+
breadcrumb?: Partial<BreadcrumbOptions>;
|
|
29
|
+
/**
|
|
30
|
+
* Footer navigation, you can disable it by passing `false`
|
|
31
|
+
*/
|
|
32
|
+
footer?: Partial<FooterOptions>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
type TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {
|
|
36
|
+
/**
|
|
37
|
+
* Custom content in TOC container, before the main TOC
|
|
38
|
+
*/
|
|
39
|
+
header?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Custom content in TOC container, after the main TOC
|
|
42
|
+
*/
|
|
43
|
+
footer?: ReactNode;
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
component: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* @defaultValue 'normal'
|
|
48
|
+
*/
|
|
49
|
+
style?: 'normal' | 'clerk';
|
|
50
|
+
};
|
|
51
|
+
type TableOfContentPopoverOptions = Omit<TableOfContentOptions, 'single'>;
|
|
52
|
+
declare function DocsPage({
|
|
53
|
+
breadcrumb: {
|
|
54
|
+
enabled: breadcrumbEnabled,
|
|
55
|
+
component: breadcrumb,
|
|
56
|
+
...breadcrumbProps
|
|
57
|
+
},
|
|
58
|
+
footer,
|
|
59
|
+
full,
|
|
60
|
+
tableOfContentPopover: {
|
|
61
|
+
enabled: tocPopoverEnabled,
|
|
62
|
+
component: tocPopover,
|
|
63
|
+
...tocPopoverOptions
|
|
64
|
+
},
|
|
65
|
+
tableOfContent: {
|
|
66
|
+
enabled: tocEnabled,
|
|
67
|
+
component: tocReplace,
|
|
68
|
+
...tocOptions
|
|
69
|
+
},
|
|
70
|
+
toc,
|
|
71
|
+
children
|
|
72
|
+
}: DocsPageProps): ReactNode;
|
|
73
|
+
declare function EditOnGitHub(props: ComponentProps<'a'>): react_jsx_runtime123.JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* Add typography styles
|
|
76
|
+
*/
|
|
77
|
+
declare function DocsBody({
|
|
78
|
+
children,
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}: ComponentProps<'div'>): react_jsx_runtime123.JSX.Element;
|
|
82
|
+
declare function DocsDescription({
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}: ComponentProps<'p'>): react_jsx_runtime123.JSX.Element | null;
|
|
87
|
+
declare function DocsTitle({
|
|
88
|
+
children,
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}: ComponentProps<'h1'>): react_jsx_runtime123.JSX.Element;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate };
|
|
94
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/layouts/notebook/page/index.tsx"],"sourcesContent":[],"mappings":";;;;;;UAmBU,iBAAA,SAA0B;;aAEvB;AAPgE;AAK1B,UAKzC,aAAA,SAAsB,WAEnB,CAFmB;EAKf,OAAA,EAAA,OAAa;EACtB,SAAA,EAJK,SAIL;;AACW,UAFF,aAAA,CAEE;EACe,GAAA,CAAA,EAF1B,WAE0B,EAAA;EAAR,cAAA,CAAA,EADP,OACO,CADC,qBACD,CAAA;EAYH,qBAAA,CAAA,EAZG,OAYH,CAZW,4BAYX,CAAA;EAAR;;;;;EAUV,IAAA,CAAA,EAAA,OAAA;EAA6B;;;EASvB,UAAA,CAAA,EAnBI,OAmBJ,CAnBY,iBAmBZ,CAAA;EAGE;;AAAS;EAUN,MAAA,CAAA,EA3BL,OA2Ba,CA3BL,aA2BK,CAAA;EACC,QAAA,CAAA,EA1BZ,SA0BY;;KAvBpB,qBAAA,GAAwB,IAwB3B,CAxBgC,mBAwBhC,EAAA,QAAA,CAAA,GAAA;EACA;;;EAM2B,MAAA,CAAA,EA3BlB,SA2BkB;EAAuB;;;EAGjD,MAAA,CAAA,EAzBQ,SAyBR;EAAa,OAAA,EAAA,OAAA;EAAA,SAAA,EAtBH,SAsBG;EA2EA;AA4BhB;;EAAqC,KAAA,CAAA,EAAA,QAAA,GAAA,OAAA;CAAuB;KArHvD,4BAAA,GAA+B,IAqH6C,CArHxC,qBAqHwC,EAAA,QAAA,CAAA;AAAA,iBAnHjE,QAAA,CAmHiE;EAAA,UAAA,EAAA;IAAA,OAAA,EAlHxD,iBAkHwD;IAAA,SAAA,EAlHnB,UAkHmB;IAAA,GAAA;EAAA,CAAA;EAAA,MAAA;EAAA,IAAA;EAAA,qBAAA,EAAA;IAAA,OAAA,EA9GpE,iBA8GoE;IAAA,SAAA,EA7GlE,UA6GkE;IAAA,GAAA;EAAA,CAAA;EAAA,cAAA,EAAA;IAAA,OAAA,EA1GpD,UA0GoD;IAAA,SAAA,EA1G7B,UA0G6B;IAAA,GAAA;EAAA,CAAA;EAAA,GAAA;EAAA;AAAA,CAAA,EAvG9E,aAuG8E,CAAA,EAvGjE,SAuGiE;AAQjE,iBApCA,YAAA,CAoCe,KAAA,EApCK,cAoCL,CAAA,GAAA,CAAA,CAAA,EApCwB,oBAAA,CAAA,GAAA,CAAA,OAoCxB;;;;AAAuD,iBARtE,QAAA,CAQsE;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAR1B,cAQ0B,CAAA,KAAA,CAAA,CAAA,EARL,oBAAA,CAAA,GAAA,CAAA,OAQK;AAAA,iBAAtE,eAAA,CAAsE;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAAnB,cAAmB,CAAA,GAAA,CAAA,CAAA,EAAA,oBAAA,CAAA,GAAA,CAAA,OAAA,GAAA,IAAA;AAWtE,iBAAA,SAAA,CAAS;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EAAoC,cAApC,CAAA,IAAA,CAAA,CAAA,EAAwD,oBAAA,CAAA,GAAA,CAAA,OAAxD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { __exportAll } from "../../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { buttonVariants } from "../../../components/ui/button.js";
|
|
3
|
+
import { i18n_exports } from "../../../contexts/i18n.js";
|
|
4
|
+
import { toc_exports } from "../../../components/toc/index.js";
|
|
5
|
+
import { default_exports } from "../../../components/toc/default.js";
|
|
6
|
+
import { clerk_exports } from "../../../components/toc/clerk.js";
|
|
7
|
+
import { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger } from "./client.js";
|
|
8
|
+
import { cn } from "@hanzo/docs-ui/cn";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Edit, Text } from "lucide-react";
|
|
11
|
+
|
|
12
|
+
//#region src/layouts/notebook/page/index.tsx
|
|
13
|
+
var page_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
+
DocsBody: () => DocsBody,
|
|
15
|
+
DocsDescription: () => DocsDescription,
|
|
16
|
+
DocsPage: () => DocsPage,
|
|
17
|
+
DocsTitle: () => DocsTitle,
|
|
18
|
+
EditOnGitHub: () => EditOnGitHub,
|
|
19
|
+
PageBreadcrumb: () => PageBreadcrumb,
|
|
20
|
+
PageLastUpdate: () => PageLastUpdate
|
|
21
|
+
});
|
|
22
|
+
function DocsPage({ breadcrumb: { enabled: breadcrumbEnabled = true, component: breadcrumb, ...breadcrumbProps } = {}, footer = {}, full = false, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopover, ...tocPopoverOptions } = {}, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {}, toc = [], children }) {
|
|
23
|
+
tocEnabled ??= !full && (toc.length > 0 || tocOptions.footer !== void 0 || tocOptions.header !== void 0);
|
|
24
|
+
tocPopoverEnabled ??= toc.length > 0 || tocPopoverOptions.header !== void 0 || tocPopoverOptions.footer !== void 0;
|
|
25
|
+
let wrapper = (children$1) => children$1;
|
|
26
|
+
if (tocEnabled || tocPopoverEnabled) wrapper = (children$1) => /* @__PURE__ */ jsx(toc_exports.TOCProvider, {
|
|
27
|
+
single: tocOptions.single,
|
|
28
|
+
toc,
|
|
29
|
+
children: children$1
|
|
30
|
+
});
|
|
31
|
+
return wrapper(/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
|
+
tocPopoverEnabled && (tocPopover ?? /* @__PURE__ */ jsxs(PageTOCPopover, { children: [/* @__PURE__ */ jsx(PageTOCPopoverTrigger, {}), /* @__PURE__ */ jsxs(PageTOCPopoverContent, { children: [
|
|
33
|
+
tocPopoverOptions.header,
|
|
34
|
+
/* @__PURE__ */ jsx(toc_exports.TOCScrollArea, { children: tocPopoverOptions.style === "clerk" ? /* @__PURE__ */ jsx(clerk_exports.TOCItems, {}) : /* @__PURE__ */ jsx(default_exports.TOCItems, {}) }),
|
|
35
|
+
tocPopoverOptions.footer
|
|
36
|
+
] })] })),
|
|
37
|
+
/* @__PURE__ */ jsxs("article", {
|
|
38
|
+
id: "nd-page",
|
|
39
|
+
"data-full": full,
|
|
40
|
+
className: cn("flex flex-col [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14 *:max-w-[900px]", full && "*:max-w-[1285px]"),
|
|
41
|
+
children: [
|
|
42
|
+
breadcrumbEnabled && (breadcrumb ?? /* @__PURE__ */ jsx(PageBreadcrumb, { ...breadcrumbProps })),
|
|
43
|
+
children,
|
|
44
|
+
footer.enabled !== false && (footer.component ?? /* @__PURE__ */ jsx(PageFooter, { items: footer.items }))
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
tocEnabled && (tocReplace ?? /* @__PURE__ */ jsxs("div", {
|
|
48
|
+
id: "nd-toc",
|
|
49
|
+
className: "sticky top-(--fd-docs-row-3) [grid-area:toc] h-[calc(var(--fd-docs-height)-var(--fd-docs-row-3))] flex flex-col w-(--fd-toc-width) pt-12 pe-4 pb-2 xl:layout:[--fd-toc-width:268px] max-xl:hidden",
|
|
50
|
+
children: [
|
|
51
|
+
tocOptions.header,
|
|
52
|
+
/* @__PURE__ */ jsxs("h3", {
|
|
53
|
+
id: "toc-title",
|
|
54
|
+
className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",
|
|
55
|
+
children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }), /* @__PURE__ */ jsx(i18n_exports.I18nLabel, { label: "toc" })]
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ jsx(toc_exports.TOCScrollArea, { children: tocOptions.style === "clerk" ? /* @__PURE__ */ jsx(clerk_exports.TOCItems, {}) : /* @__PURE__ */ jsx(default_exports.TOCItems, {}) }),
|
|
58
|
+
tocOptions.footer
|
|
59
|
+
]
|
|
60
|
+
}))
|
|
61
|
+
] }));
|
|
62
|
+
}
|
|
63
|
+
function EditOnGitHub(props) {
|
|
64
|
+
return /* @__PURE__ */ jsx("a", {
|
|
65
|
+
target: "_blank",
|
|
66
|
+
rel: "noreferrer noopener",
|
|
67
|
+
...props,
|
|
68
|
+
className: cn(buttonVariants({
|
|
69
|
+
color: "secondary",
|
|
70
|
+
size: "sm",
|
|
71
|
+
className: "gap-1.5 not-prose"
|
|
72
|
+
}), props.className),
|
|
73
|
+
children: props.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Edit, { className: "size-3.5" }), /* @__PURE__ */ jsx(i18n_exports.I18nLabel, { label: "editOnGithub" })] })
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Add typography styles
|
|
78
|
+
*/
|
|
79
|
+
function DocsBody({ children, className, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx("div", {
|
|
81
|
+
...props,
|
|
82
|
+
className: cn("prose flex-1", className),
|
|
83
|
+
children
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function DocsDescription({ children, className, ...props }) {
|
|
87
|
+
if (children === void 0) return null;
|
|
88
|
+
return /* @__PURE__ */ jsx("p", {
|
|
89
|
+
...props,
|
|
90
|
+
className: cn("mb-8 text-lg text-fd-muted-foreground", className),
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function DocsTitle({ children, className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx("h1", {
|
|
96
|
+
...props,
|
|
97
|
+
className: cn("text-[1.75em] font-semibold", className),
|
|
98
|
+
children
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, PageBreadcrumb, PageLastUpdate, page_exports };
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["children","TOCProvider","TOCScrollArea","TocClerk","TocDefault","I18nLabel"],"sources":["../../../../src/layouts/notebook/page/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from '@hanzo/docs-ui/cn';\nimport { buttonVariants } from '@/components/ui/button';\nimport { Edit, Text } from 'lucide-react';\nimport { I18nLabel } from '@/contexts/i18n';\nimport {\n type BreadcrumbProps,\n type FooterProps,\n PageBreadcrumb,\n PageFooter,\n PageTOCPopover,\n PageTOCPopoverContent,\n PageTOCPopoverTrigger,\n} from './client';\nimport type { AnchorProviderProps, TOCItemType } from '@hanzo/docs-core/toc';\nimport * as TocDefault from '@/components/toc/default';\nimport * as TocClerk from '@/components/toc/clerk';\nimport { TOCProvider, TOCScrollArea } from '@/components/toc';\n\ninterface BreadcrumbOptions extends BreadcrumbProps {\n enabled: boolean;\n component: ReactNode;\n}\n\ninterface FooterOptions extends FooterProps {\n enabled: boolean;\n component: ReactNode;\n}\n\nexport interface DocsPageProps {\n toc?: TOCItemType[];\n tableOfContent?: Partial<TableOfContentOptions>;\n tableOfContentPopover?: Partial<TableOfContentPopoverOptions>;\n\n /**\n * Extend the page to fill all available space\n *\n * @defaultValue false\n */\n full?: boolean;\n\n /**\n * Replace or disable breadcrumb\n */\n breadcrumb?: Partial<BreadcrumbOptions>;\n\n /**\n * Footer navigation, you can disable it by passing `false`\n */\n footer?: Partial<FooterOptions>;\n\n children?: ReactNode;\n}\n\ntype TableOfContentOptions = Pick<AnchorProviderProps, 'single'> & {\n /**\n * Custom content in TOC container, before the main TOC\n */\n header?: ReactNode;\n\n /**\n * Custom content in TOC container, after the main TOC\n */\n footer?: ReactNode;\n\n enabled: boolean;\n component: ReactNode;\n\n /**\n * @defaultValue 'normal'\n */\n style?: 'normal' | 'clerk';\n};\n\ntype TableOfContentPopoverOptions = Omit<TableOfContentOptions, 'single'>;\n\nexport function DocsPage({\n breadcrumb: { enabled: breadcrumbEnabled = true, component: breadcrumb, ...breadcrumbProps } = {},\n footer = {},\n full = false,\n tableOfContentPopover: {\n enabled: tocPopoverEnabled,\n component: tocPopover,\n ...tocPopoverOptions\n } = {},\n tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {},\n toc = [],\n children,\n}: DocsPageProps) {\n // disable TOC on full mode, you can still enable it with `enabled` option.\n tocEnabled ??=\n !full && (toc.length > 0 || tocOptions.footer !== undefined || tocOptions.header !== undefined);\n\n tocPopoverEnabled ??=\n toc.length > 0 ||\n tocPopoverOptions.header !== undefined ||\n tocPopoverOptions.footer !== undefined;\n\n let wrapper = (children: ReactNode) => children;\n\n if (tocEnabled || tocPopoverEnabled) {\n wrapper = (children) => (\n <TOCProvider single={tocOptions.single} toc={toc}>\n {children}\n </TOCProvider>\n );\n }\n\n return wrapper(\n <>\n {tocPopoverEnabled &&\n (tocPopover ?? (\n <PageTOCPopover>\n <PageTOCPopoverTrigger />\n <PageTOCPopoverContent>\n {tocPopoverOptions.header}\n <TOCScrollArea>\n {tocPopoverOptions.style === 'clerk' ? (\n <TocClerk.TOCItems />\n ) : (\n <TocDefault.TOCItems />\n )}\n </TOCScrollArea>\n {tocPopoverOptions.footer}\n </PageTOCPopoverContent>\n </PageTOCPopover>\n ))}\n <article\n id=\"nd-page\"\n data-full={full}\n className={cn(\n 'flex flex-col [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14 *:max-w-[900px]',\n full && '*:max-w-[1285px]',\n )}\n >\n {breadcrumbEnabled && (breadcrumb ?? <PageBreadcrumb {...breadcrumbProps} />)}\n {children}\n {footer.enabled !== false && (footer.component ?? <PageFooter items={footer.items} />)}\n </article>\n {tocEnabled &&\n (tocReplace ?? (\n <div\n id=\"nd-toc\"\n className=\"sticky top-(--fd-docs-row-3) [grid-area:toc] h-[calc(var(--fd-docs-height)-var(--fd-docs-row-3))] flex flex-col w-(--fd-toc-width) pt-12 pe-4 pb-2 xl:layout:[--fd-toc-width:268px] max-xl:hidden\"\n >\n {tocOptions.header}\n <h3\n id=\"toc-title\"\n className=\"inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground\"\n >\n <Text className=\"size-4\" />\n <I18nLabel label=\"toc\" />\n </h3>\n <TOCScrollArea>\n {tocOptions.style === 'clerk' ? <TocClerk.TOCItems /> : <TocDefault.TOCItems />}\n </TOCScrollArea>\n {tocOptions.footer}\n </div>\n ))}\n </>,\n );\n}\n\nexport function EditOnGitHub(props: ComponentProps<'a'>) {\n return (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n {...props}\n className={cn(\n buttonVariants({\n color: 'secondary',\n size: 'sm',\n className: 'gap-1.5 not-prose',\n }),\n props.className,\n )}\n >\n {props.children ?? (\n <>\n <Edit className=\"size-3.5\" />\n <I18nLabel label=\"editOnGithub\" />\n </>\n )}\n </a>\n );\n}\n\n/**\n * Add typography styles\n */\nexport function DocsBody({ children, className, ...props }: ComponentProps<'div'>) {\n return (\n <div {...props} className={cn('prose flex-1', className)}>\n {children}\n </div>\n );\n}\n\nexport function DocsDescription({ children, className, ...props }: ComponentProps<'p'>) {\n // Don't render if no description provided\n if (children === undefined) return null;\n\n return (\n <p {...props} className={cn('mb-8 text-lg text-fd-muted-foreground', className)}>\n {children}\n </p>\n );\n}\n\nexport function DocsTitle({ children, className, ...props }: ComponentProps<'h1'>) {\n return (\n <h1 {...props} className={cn('text-[1.75em] font-semibold', className)}>\n {children}\n </h1>\n );\n}\n\nexport { PageLastUpdate, PageBreadcrumb } from './client';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgB,SAAS,EACvB,YAAY,EAAE,SAAS,oBAAoB,MAAM,WAAW,YAAY,GAAG,oBAAoB,EAAE,EACjG,SAAS,EAAE,EACX,OAAO,OACP,uBAAuB,EACrB,SAAS,mBACT,WAAW,YACX,GAAG,sBACD,EAAE,EACN,gBAAgB,EAAE,SAAS,YAAY,WAAW,YAAY,GAAG,eAAe,EAAE,EAClF,MAAM,EAAE,EACR,YACgB;AAEhB,gBACE,CAAC,SAAS,IAAI,SAAS,KAAK,WAAW,WAAW,UAAa,WAAW,WAAW;AAEvF,uBACE,IAAI,SAAS,KACb,kBAAkB,WAAW,UAC7B,kBAAkB,WAAW;CAE/B,IAAI,WAAW,eAAwBA;AAEvC,KAAI,cAAc,kBAChB,YAAW,eACT,oBAACC;EAAY,QAAQ,WAAW;EAAa;YAC1CD;GACW;AAIlB,QAAO,QACL;EACG,sBACE,cACC,qBAAC,6BACC,oBAAC,0BAAwB,EACzB,qBAAC;GACE,kBAAkB;GACnB,oBAACE,uCACE,kBAAkB,UAAU,UAC3B,oBAACC,cAAS,aAAW,GAErB,oBAACC,gBAAW,aAAW,GAEX;GACf,kBAAkB;MACG,IACT;EAErB,qBAAC;GACC,IAAG;GACH,aAAW;GACX,WAAW,GACT,mGACA,QAAQ,mBACT;;IAEA,sBAAsB,cAAc,oBAAC,kBAAe,GAAI,kBAAmB;IAC3E;IACA,OAAO,YAAY,UAAU,OAAO,aAAa,oBAAC,cAAW,OAAO,OAAO,QAAS;;IAC7E;EACT,eACE,cACC,qBAAC;GACC,IAAG;GACH,WAAU;;IAET,WAAW;IACZ,qBAAC;KACC,IAAG;KACH,WAAU;gBAEV,oBAAC,QAAK,WAAU,WAAW,EAC3B,oBAACC,0BAAU,OAAM,QAAQ;MACtB;IACL,oBAACH,uCACE,WAAW,UAAU,UAAU,oBAACC,cAAS,aAAW,GAAG,oBAACC,gBAAW,aAAW,GACjE;IACf,WAAW;;IACR;KAET,CACJ;;AAGH,SAAgB,aAAa,OAA4B;AACvD,QACE,oBAAC;EACC,QAAO;EACP,KAAI;EACJ,GAAI;EACJ,WAAW,GACT,eAAe;GACb,OAAO;GACP,MAAM;GACN,WAAW;GACZ,CAAC,EACF,MAAM,UACP;YAEA,MAAM,YACL,4CACE,oBAAC,QAAK,WAAU,aAAa,EAC7B,oBAACC,0BAAU,OAAM,iBAAiB,IACjC;GAEH;;;;;AAOR,SAAgB,SAAS,EAAE,UAAU,WAAW,GAAG,SAAgC;AACjF,QACE,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,gBAAgB,UAAU;EACrD;GACG;;AAIV,SAAgB,gBAAgB,EAAE,UAAU,WAAW,GAAG,SAA8B;AAEtF,KAAI,aAAa,OAAW,QAAO;AAEnC,QACE,oBAAC;EAAE,GAAI;EAAO,WAAW,GAAG,yCAAyC,UAAU;EAC5E;GACC;;AAIR,SAAgB,UAAU,EAAE,UAAU,WAAW,GAAG,SAA+B;AACjF,QACE,oBAAC;EAAG,GAAI;EAAO,WAAW,GAAG,+BAA+B,UAAU;EACnE;GACE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SidebarCollapseTrigger as SidebarCollapseTrigger$1, SidebarDrawerContent, SidebarFolder as SidebarFolder$1, SidebarFolderContent as SidebarFolderContent$1, SidebarFolderLink as SidebarFolderLink$1, SidebarFolderTrigger as SidebarFolderTrigger$1, SidebarItem as SidebarItem$1, SidebarProvider, SidebarTrigger as SidebarTrigger$1, SidebarViewport as SidebarViewport$1 } from "../../components/sidebar/base.js";
|
|
2
|
+
import { SidebarPageTreeComponents } from "../../components/sidebar/page-tree.js";
|
|
3
|
+
import * as react_jsx_runtime59 from "react/jsx-runtime";
|
|
4
|
+
import * as react12 from "react";
|
|
5
|
+
import { ComponentProps } from "react";
|
|
6
|
+
import * as _hanzo_docs_ui_link_item0 from "@hanzo/docs-ui/link-item";
|
|
7
|
+
|
|
8
|
+
//#region src/layouts/notebook/sidebar.d.ts
|
|
9
|
+
declare function Sidebar(props: ComponentProps<typeof SidebarProvider>): react_jsx_runtime59.JSX.Element;
|
|
10
|
+
declare function SidebarFolder(props: ComponentProps<typeof SidebarFolder$1>): react_jsx_runtime59.JSX.Element;
|
|
11
|
+
declare function SidebarCollapseTrigger(props: ComponentProps<typeof SidebarCollapseTrigger$1>): react_jsx_runtime59.JSX.Element;
|
|
12
|
+
declare function SidebarViewport(props: ComponentProps<typeof SidebarViewport$1>): react_jsx_runtime59.JSX.Element;
|
|
13
|
+
declare function SidebarTrigger(props: ComponentProps<typeof SidebarTrigger$1>): react_jsx_runtime59.JSX.Element;
|
|
14
|
+
declare function SidebarContent({
|
|
15
|
+
ref: refProp,
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
...props
|
|
19
|
+
}: ComponentProps<'aside'>): react_jsx_runtime59.JSX.Element;
|
|
20
|
+
declare function SidebarDrawer({
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: ComponentProps<typeof SidebarDrawerContent>): react_jsx_runtime59.JSX.Element;
|
|
25
|
+
declare function SidebarSeparator({
|
|
26
|
+
className,
|
|
27
|
+
style,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
}: ComponentProps<'p'>): react_jsx_runtime59.JSX.Element;
|
|
31
|
+
declare function SidebarItem({
|
|
32
|
+
className,
|
|
33
|
+
style,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: ComponentProps<typeof SidebarItem$1>): react_jsx_runtime59.JSX.Element;
|
|
37
|
+
declare function SidebarFolderTrigger({
|
|
38
|
+
className,
|
|
39
|
+
style,
|
|
40
|
+
...props
|
|
41
|
+
}: ComponentProps<typeof SidebarFolderTrigger$1>): react_jsx_runtime59.JSX.Element;
|
|
42
|
+
declare function SidebarFolderLink({
|
|
43
|
+
className,
|
|
44
|
+
style,
|
|
45
|
+
...props
|
|
46
|
+
}: ComponentProps<typeof SidebarFolderLink$1>): react_jsx_runtime59.JSX.Element;
|
|
47
|
+
declare function SidebarFolderContent({
|
|
48
|
+
className,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}: ComponentProps<typeof SidebarFolderContent$1>): react_jsx_runtime59.JSX.Element;
|
|
52
|
+
declare const SidebarPageTree: (components: Partial<SidebarPageTreeComponents>) => react_jsx_runtime59.JSX.Element;
|
|
53
|
+
declare const SidebarLinkItem: ({
|
|
54
|
+
item,
|
|
55
|
+
...props
|
|
56
|
+
}: react12.HTMLAttributes<HTMLElement> & {
|
|
57
|
+
item: Exclude<_hanzo_docs_ui_link_item0.LinkItemType, {
|
|
58
|
+
type: "icon";
|
|
59
|
+
}>;
|
|
60
|
+
}) => react_jsx_runtime59.JSX.Element;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarDrawer, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarLinkItem, SidebarPageTree, SidebarSeparator, SidebarTrigger, SidebarViewport };
|
|
63
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","names":[],"sources":["../../../src/layouts/notebook/sidebar.tsx"],"sourcesContent":[],"mappings":";;;;;;;;iBA8BgB,OAAA,QAAe,sBAAsB,mBAAqB,mBAAA,CAAA,GAAA,CAAA;iBAI1D,aAAA,QAAqB,sBAAsB,mBAAmB,mBAAA,CAAA,GAAA,CAAA;iBAI9D,sBAAA,QAA8B,sBAAsB,4BAA4B,mBAAA,CAAA,GAAA,CAAA;iBAIhF,eAAA,QAAuB,sBAAsB,qBAAqB,mBAAA,CAAA,GAAA,CAAA;iBAIlE,cAAA,QAAsB,sBAAsB,oBAAoB,mBAAA,CAAA,GAAA,CAAA;iBAIhE,cAAA;OACT;;;;GAIJ,0BAAuB,mBAAA,CAAA,GAAA,CAAA;AAzBV,iBAwEA,aAAA,CAxEO;EAAA,QAAA;EAAA,SAAA;EAAA,GAAA;AAAA,CAAA,EA4EpB,cA5EoB,CAAA,OA4EE,oBA5EF,CAAA,CAAA,EA4E4B,mBAAA,CAAA,GAAA,CAAA,OA5E5B;AAA8B,iBA6FrC,gBAAA,CA7FqC;EAAA,SAAA;EAAA,KAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EA6FsB,cA7FtB,CAAA,GAAA,CAAA,CAAA,EA6FyC,mBAAA,CAAA,GAAA,CAAA,OA7FzC;AAAtB,iBA8Gf,WAAA,CA9Ge;EAAA,SAAA;EAAA,KAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAmH5B,cAnH4B,CAAA,OAmHN,aAnHM,CAAA,CAAA,EAmHW,mBAAA,CAAA,GAAA,CAAA,OAnHX;AAA2C,iBAoI1D,oBAAA,CApI0D;EAAA,SAAA;EAAA,KAAA;EAAA,GAAA;AAAA,CAAA,EAwIvE,cAxIuE,CAAA,OAwIjD,sBAxIiD,CAAA,CAAA,EAwIvB,mBAAA,CAAA,GAAA,CAAA,OAxIuB;AAAA,iBAyJ1D,iBAAA,CAzJ0D;EAAA,SAAA;EAAA,KAAA;EAAA,GAAA;AAAA,CAAA,EA6JvE,cA7JuE,CAAA,OA6JjD,mBA7JiD,CAAA,CAAA,EA6J1B,mBAAA,CAAA,GAAA,CAAA,OA7J0B;AAI1D,iBA0KA,oBAAA,CA1Ka;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EA8K1B,cA9K0B,CAAA,OA8KJ,sBA9KI,CAAA,CAAA,EA8KsB,mBAAA,CAAA,GAAA,CAAA,OA9KtB;AAA8B,cA+L9C,eA/L8C,EAAA,CAAA,UAAA,EA+L/B,OA/L+B,CAsMzD,yBAAA,CAtMyD,EAAA,GA+L/B,mBAAA,CAAA,GAAA,CAAA,OA/L+B;AAAtB,cAwMxB,eAxMwB,EAAA,CAAA;EAAA,IAAA;EAAA,GAAA;CAAA,EAwMT,OAAA,CAAA,cAxMS,CAwMT,WAxMS,CAAA,GAAA;EAAyC,IAAA,SAAA,CAwMlD,yBAAA,CAAA,YAAA,EAxMkD;IAAA,IAAA,EAAA,MAAA;EAI9D,CAAA,CAAA;CAAoD,EAAA,kCAAA"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { SidebarCollapseTrigger as SidebarCollapseTrigger$1, SidebarContent as SidebarContent$1, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder as SidebarFolder$1, SidebarFolderContent as SidebarFolderContent$1, SidebarFolderLink as SidebarFolderLink$1, SidebarFolderTrigger as SidebarFolderTrigger$1, SidebarItem as SidebarItem$1, SidebarProvider, SidebarSeparator as SidebarSeparator$1, SidebarTrigger as SidebarTrigger$1, SidebarViewport as SidebarViewport$1, useFolder, useFolderDepth } from "../../components/sidebar/base.js";
|
|
4
|
+
import { LayoutContext } from "./client.js";
|
|
5
|
+
import { createLinkItemRenderer } from "../../components/sidebar/link-item.js";
|
|
6
|
+
import { createPageTreeRenderer } from "../../components/sidebar/page-tree.js";
|
|
7
|
+
import { cn } from "@hanzo/docs-ui/cn";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { use, useRef } from "react";
|
|
10
|
+
import { cva } from "class-variance-authority";
|
|
11
|
+
import { mergeRefs } from "@hanzo/docs-ui/merge-refs";
|
|
12
|
+
|
|
13
|
+
//#region src/layouts/notebook/sidebar.tsx
|
|
14
|
+
const itemVariants = cva("relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground wrap-anywhere [&_svg]:size-4 [&_svg]:shrink-0", { variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
link: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none data-[active=true]:bg-fd-primary/10 data-[active=true]:text-fd-primary data-[active=true]:hover:transition-colors",
|
|
17
|
+
button: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"
|
|
18
|
+
},
|
|
19
|
+
highlight: { true: "data-[active=true]:before:content-[''] data-[active=true]:before:bg-fd-primary data-[active=true]:before:absolute data-[active=true]:before:w-px data-[active=true]:before:inset-y-2.5 data-[active=true]:before:start-2.5" }
|
|
20
|
+
} });
|
|
21
|
+
function getItemOffset(depth) {
|
|
22
|
+
return `calc(${2 + 3 * depth} * var(--spacing))`;
|
|
23
|
+
}
|
|
24
|
+
function Sidebar(props) {
|
|
25
|
+
return /* @__PURE__ */ jsx(SidebarProvider, { ...props });
|
|
26
|
+
}
|
|
27
|
+
function SidebarFolder(props) {
|
|
28
|
+
return /* @__PURE__ */ jsx(SidebarFolder$1, { ...props });
|
|
29
|
+
}
|
|
30
|
+
function SidebarCollapseTrigger(props) {
|
|
31
|
+
return /* @__PURE__ */ jsx(SidebarCollapseTrigger$1, { ...props });
|
|
32
|
+
}
|
|
33
|
+
function SidebarViewport(props) {
|
|
34
|
+
return /* @__PURE__ */ jsx(SidebarViewport$1, { ...props });
|
|
35
|
+
}
|
|
36
|
+
function SidebarTrigger(props) {
|
|
37
|
+
return /* @__PURE__ */ jsx(SidebarTrigger$1, { ...props });
|
|
38
|
+
}
|
|
39
|
+
function SidebarContent({ ref: refProp, className, children, ...props }) {
|
|
40
|
+
const { navMode } = use(LayoutContext);
|
|
41
|
+
const ref = useRef(null);
|
|
42
|
+
return /* @__PURE__ */ jsx(SidebarContent$1, { children: ({ collapsed, hovered, ref: asideRef, ...rest }) => /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
"data-sidebar-placeholder": "",
|
|
44
|
+
className: cn("sticky z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto md:layout:[--fd-sidebar-width:268px] max-md:hidden", navMode === "auto" ? "top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))]" : "top-(--fd-docs-row-2) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-2))]"),
|
|
45
|
+
children: [collapsed && /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: "absolute start-0 inset-y-0 w-4",
|
|
47
|
+
...rest
|
|
48
|
+
}), /* @__PURE__ */ jsx("aside", {
|
|
49
|
+
id: "nd-sidebar",
|
|
50
|
+
ref: mergeRefs(ref, refProp, asideRef),
|
|
51
|
+
"data-collapsed": collapsed,
|
|
52
|
+
"data-hovered": collapsed && hovered,
|
|
53
|
+
className: cn("absolute flex flex-col w-full start-0 inset-y-0 items-end text-sm duration-250 *:w-(--fd-sidebar-width)", navMode === "auto" && "bg-fd-card border-e", collapsed && ["inset-y-2 rounded-xl bg-fd-card transition-transform border w-(--fd-sidebar-width)", hovered ? "shadow-lg translate-x-2 rtl:-translate-x-2" : "-translate-x-(--fd-sidebar-width) rtl:translate-x-full"], ref.current && ref.current.getAttribute("data-collapsed") === "true" !== collapsed && "transition-[width,inset-block,translate,background-color]", className),
|
|
54
|
+
...props,
|
|
55
|
+
...rest,
|
|
56
|
+
children
|
|
57
|
+
})]
|
|
58
|
+
}) });
|
|
59
|
+
}
|
|
60
|
+
function SidebarDrawer({ children, className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SidebarDrawerOverlay, { className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out" }), /* @__PURE__ */ jsx(SidebarDrawerContent, {
|
|
62
|
+
className: cn("fixed text-[0.9375rem] flex flex-col shadow-lg border-s end-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out", className),
|
|
63
|
+
...props,
|
|
64
|
+
children
|
|
65
|
+
})] });
|
|
66
|
+
}
|
|
67
|
+
function SidebarSeparator({ className, style, children, ...props }) {
|
|
68
|
+
const depth = useFolderDepth();
|
|
69
|
+
return /* @__PURE__ */ jsx(SidebarSeparator$1, {
|
|
70
|
+
className: cn("[&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
71
|
+
style: {
|
|
72
|
+
paddingInlineStart: getItemOffset(depth),
|
|
73
|
+
...style
|
|
74
|
+
},
|
|
75
|
+
...props,
|
|
76
|
+
children
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function SidebarItem({ className, style, children, ...props }) {
|
|
80
|
+
const depth = useFolderDepth();
|
|
81
|
+
return /* @__PURE__ */ jsx(SidebarItem$1, {
|
|
82
|
+
className: cn(itemVariants({
|
|
83
|
+
variant: "link",
|
|
84
|
+
highlight: depth >= 1
|
|
85
|
+
}), className),
|
|
86
|
+
style: {
|
|
87
|
+
paddingInlineStart: getItemOffset(depth),
|
|
88
|
+
...style
|
|
89
|
+
},
|
|
90
|
+
...props,
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function SidebarFolderTrigger({ className, style, ...props }) {
|
|
95
|
+
const { depth, collapsible } = useFolder();
|
|
96
|
+
return /* @__PURE__ */ jsx(SidebarFolderTrigger$1, {
|
|
97
|
+
className: cn(itemVariants({ variant: collapsible ? "button" : null }), "w-full", className),
|
|
98
|
+
style: {
|
|
99
|
+
paddingInlineStart: getItemOffset(depth - 1),
|
|
100
|
+
...style
|
|
101
|
+
},
|
|
102
|
+
...props,
|
|
103
|
+
children: props.children
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function SidebarFolderLink({ className, style, ...props }) {
|
|
107
|
+
const depth = useFolderDepth();
|
|
108
|
+
return /* @__PURE__ */ jsx(SidebarFolderLink$1, {
|
|
109
|
+
className: cn(itemVariants({
|
|
110
|
+
variant: "link",
|
|
111
|
+
highlight: depth > 1
|
|
112
|
+
}), "w-full", className),
|
|
113
|
+
style: {
|
|
114
|
+
paddingInlineStart: getItemOffset(depth - 1),
|
|
115
|
+
...style
|
|
116
|
+
},
|
|
117
|
+
...props,
|
|
118
|
+
children: props.children
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function SidebarFolderContent({ className, children, ...props }) {
|
|
122
|
+
const depth = useFolderDepth();
|
|
123
|
+
return /* @__PURE__ */ jsx(SidebarFolderContent$1, {
|
|
124
|
+
className: cn("relative", depth === 1 && "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5", className),
|
|
125
|
+
...props,
|
|
126
|
+
children
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const SidebarPageTree = createPageTreeRenderer({
|
|
130
|
+
SidebarFolder,
|
|
131
|
+
SidebarFolderContent,
|
|
132
|
+
SidebarFolderLink,
|
|
133
|
+
SidebarFolderTrigger,
|
|
134
|
+
SidebarItem,
|
|
135
|
+
SidebarSeparator
|
|
136
|
+
});
|
|
137
|
+
const SidebarLinkItem = createLinkItemRenderer({
|
|
138
|
+
SidebarFolder,
|
|
139
|
+
SidebarFolderContent,
|
|
140
|
+
SidebarFolderLink,
|
|
141
|
+
SidebarFolderTrigger,
|
|
142
|
+
SidebarItem
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
export { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarDrawer, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarLinkItem, SidebarPageTree, SidebarSeparator, SidebarTrigger, SidebarViewport };
|
|
147
|
+
//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","names":["Base.SidebarProvider","Base.SidebarFolder","Base.SidebarCollapseTrigger","Base.SidebarViewport","Base.SidebarTrigger","Base.SidebarContent","Base.SidebarDrawerOverlay","Base.SidebarDrawerContent","Base.useFolderDepth","Base.SidebarSeparator","Base.SidebarItem","Base.useFolder","Base.SidebarFolderTrigger","Base.SidebarFolderLink","Base.SidebarFolderContent"],"sources":["../../../src/layouts/notebook/sidebar.tsx"],"sourcesContent":["'use client';\nimport * as Base from '@/components/sidebar/base';\nimport { cn } from '@hanzo/docs-ui/cn';\nimport { type ComponentProps, use, useRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { LayoutContext } from './client';\nimport { createPageTreeRenderer } from '@/components/sidebar/page-tree';\nimport { createLinkItemRenderer } from '@/components/sidebar/link-item';\nimport { mergeRefs } from '@hanzo/docs-ui/merge-refs';\n\nconst itemVariants = cva(\n 'relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground wrap-anywhere [&_svg]:size-4 [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n link: 'transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none data-[active=true]:bg-fd-primary/10 data-[active=true]:text-fd-primary data-[active=true]:hover:transition-colors',\n button:\n 'transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none',\n },\n highlight: {\n true: \"data-[active=true]:before:content-[''] data-[active=true]:before:bg-fd-primary data-[active=true]:before:absolute data-[active=true]:before:w-px data-[active=true]:before:inset-y-2.5 data-[active=true]:before:start-2.5\",\n },\n },\n },\n);\n\nfunction getItemOffset(depth: number) {\n return `calc(${2 + 3 * depth} * var(--spacing))`;\n}\n\nexport function Sidebar(props: ComponentProps<typeof Base.SidebarProvider>) {\n return <Base.SidebarProvider {...props} />;\n}\n\nexport function SidebarFolder(props: ComponentProps<typeof Base.SidebarFolder>) {\n return <Base.SidebarFolder {...props} />;\n}\n\nexport function SidebarCollapseTrigger(props: ComponentProps<typeof Base.SidebarCollapseTrigger>) {\n return <Base.SidebarCollapseTrigger {...props} />;\n}\n\nexport function SidebarViewport(props: ComponentProps<typeof Base.SidebarViewport>) {\n return <Base.SidebarViewport {...props} />;\n}\n\nexport function SidebarTrigger(props: ComponentProps<typeof Base.SidebarTrigger>) {\n return <Base.SidebarTrigger {...props} />;\n}\n\nexport function SidebarContent({\n ref: refProp,\n className,\n children,\n ...props\n}: ComponentProps<'aside'>) {\n const { navMode } = use(LayoutContext)!;\n const ref = useRef<HTMLElement>(null);\n\n return (\n <Base.SidebarContent>\n {({ collapsed, hovered, ref: asideRef, ...rest }) => (\n <div\n data-sidebar-placeholder=\"\"\n className={cn(\n 'sticky z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto md:layout:[--fd-sidebar-width:268px] max-md:hidden',\n navMode === 'auto'\n ? 'top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))]'\n : 'top-(--fd-docs-row-2) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-2))]',\n )}\n >\n {collapsed && <div className=\"absolute start-0 inset-y-0 w-4\" {...rest} />}\n <aside\n id=\"nd-sidebar\"\n ref={mergeRefs(ref, refProp, asideRef)}\n data-collapsed={collapsed}\n data-hovered={collapsed && hovered}\n className={cn(\n 'absolute flex flex-col w-full start-0 inset-y-0 items-end text-sm duration-250 *:w-(--fd-sidebar-width)',\n navMode === 'auto' && 'bg-fd-card border-e',\n collapsed && [\n 'inset-y-2 rounded-xl bg-fd-card transition-transform border w-(--fd-sidebar-width)',\n hovered\n ? 'shadow-lg translate-x-2 rtl:-translate-x-2'\n : '-translate-x-(--fd-sidebar-width) rtl:translate-x-full',\n ],\n ref.current &&\n (ref.current.getAttribute('data-collapsed') === 'true') !== collapsed &&\n 'transition-[width,inset-block,translate,background-color]',\n className,\n )}\n {...props}\n {...rest}\n >\n {children}\n </aside>\n </div>\n )}\n </Base.SidebarContent>\n );\n}\n\nexport function SidebarDrawer({\n children,\n className,\n ...props\n}: ComponentProps<typeof Base.SidebarDrawerContent>) {\n return (\n <>\n <Base.SidebarDrawerOverlay className=\"fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out\" />\n <Base.SidebarDrawerContent\n className={cn(\n 'fixed text-[0.9375rem] flex flex-col shadow-lg border-s end-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out',\n className,\n )}\n {...props}\n >\n {children}\n </Base.SidebarDrawerContent>\n </>\n );\n}\n\nexport function SidebarSeparator({ className, style, children, ...props }: ComponentProps<'p'>) {\n const depth = Base.useFolderDepth();\n\n return (\n <Base.SidebarSeparator\n className={cn('[&_svg]:size-4 [&_svg]:shrink-0', className)}\n style={{\n paddingInlineStart: getItemOffset(depth),\n ...style,\n }}\n {...props}\n >\n {children}\n </Base.SidebarSeparator>\n );\n}\n\nexport function SidebarItem({\n className,\n style,\n children,\n ...props\n}: ComponentProps<typeof Base.SidebarItem>) {\n const depth = Base.useFolderDepth();\n\n return (\n <Base.SidebarItem\n className={cn(itemVariants({ variant: 'link', highlight: depth >= 1 }), className)}\n style={{\n paddingInlineStart: getItemOffset(depth),\n ...style,\n }}\n {...props}\n >\n {children}\n </Base.SidebarItem>\n );\n}\n\nexport function SidebarFolderTrigger({\n className,\n style,\n ...props\n}: ComponentProps<typeof Base.SidebarFolderTrigger>) {\n const { depth, collapsible } = Base.useFolder()!;\n\n return (\n <Base.SidebarFolderTrigger\n className={cn(itemVariants({ variant: collapsible ? 'button' : null }), 'w-full', className)}\n style={{\n paddingInlineStart: getItemOffset(depth - 1),\n ...style,\n }}\n {...props}\n >\n {props.children}\n </Base.SidebarFolderTrigger>\n );\n}\n\nexport function SidebarFolderLink({\n className,\n style,\n ...props\n}: ComponentProps<typeof Base.SidebarFolderLink>) {\n const depth = Base.useFolderDepth();\n\n return (\n <Base.SidebarFolderLink\n className={cn(itemVariants({ variant: 'link', highlight: depth > 1 }), 'w-full', className)}\n style={{\n paddingInlineStart: getItemOffset(depth - 1),\n ...style,\n }}\n {...props}\n >\n {props.children}\n </Base.SidebarFolderLink>\n );\n}\n\nexport function SidebarFolderContent({\n className,\n children,\n ...props\n}: ComponentProps<typeof Base.SidebarFolderContent>) {\n const depth = Base.useFolderDepth();\n\n return (\n <Base.SidebarFolderContent\n className={cn(\n 'relative',\n depth === 1 &&\n \"before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5\",\n className,\n )}\n {...props}\n >\n {children}\n </Base.SidebarFolderContent>\n );\n}\nexport const SidebarPageTree = createPageTreeRenderer({\n SidebarFolder,\n SidebarFolderContent,\n SidebarFolderLink,\n SidebarFolderTrigger,\n SidebarItem,\n SidebarSeparator,\n});\n\nexport const SidebarLinkItem = createLinkItemRenderer({\n SidebarFolder,\n SidebarFolderContent,\n SidebarFolderLink,\n SidebarFolderTrigger,\n SidebarItem,\n});\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,eAAe,IACnB,8IACA,EACE,UAAU;CACR,SAAS;EACP,MAAM;EACN,QACE;EACH;CACD,WAAW,EACT,MAAM,8NACP;CACF,EACF,CACF;AAED,SAAS,cAAc,OAAe;AACpC,QAAO,QAAQ,IAAI,IAAI,MAAM;;AAG/B,SAAgB,QAAQ,OAAoD;AAC1E,QAAO,oBAACA,mBAAqB,GAAI,QAAS;;AAG5C,SAAgB,cAAc,OAAkD;AAC9E,QAAO,oBAACC,mBAAmB,GAAI,QAAS;;AAG1C,SAAgB,uBAAuB,OAA2D;AAChG,QAAO,oBAACC,4BAA4B,GAAI,QAAS;;AAGnD,SAAgB,gBAAgB,OAAoD;AAClF,QAAO,oBAACC,qBAAqB,GAAI,QAAS;;AAG5C,SAAgB,eAAe,OAAmD;AAChF,QAAO,oBAACC,oBAAoB,GAAI,QAAS;;AAG3C,SAAgB,eAAe,EAC7B,KAAK,SACL,WACA,UACA,GAAG,SACuB;CAC1B,MAAM,EAAE,YAAY,IAAI,cAAc;CACtC,MAAM,MAAM,OAAoB,KAAK;AAErC,QACE,oBAACC,+BACG,EAAE,WAAW,SAAS,KAAK,UAAU,GAAG,WACxC,qBAAC;EACC,4BAAyB;EACzB,WAAW,GACT,gIACA,YAAY,SACR,+EACA,6EACL;aAEA,aAAa,oBAAC;GAAI,WAAU;GAAiC,GAAI;IAAQ,EAC1E,oBAAC;GACC,IAAG;GACH,KAAK,UAAU,KAAK,SAAS,SAAS;GACtC,kBAAgB;GAChB,gBAAc,aAAa;GAC3B,WAAW,GACT,2GACA,YAAY,UAAU,uBACtB,aAAa,CACX,sFACA,UACI,+CACA,yDACL,EACD,IAAI,WACD,IAAI,QAAQ,aAAa,iBAAiB,KAAK,WAAY,aAC5D,6DACF,UACD;GACD,GAAI;GACJ,GAAI;GAEH;IACK;GACJ,GAEY;;AAI1B,SAAgB,cAAc,EAC5B,UACA,WACA,GAAG,SACgD;AACnD,QACE,4CACE,oBAACC,wBAA0B,WAAU,qHAAqH,EAC1J,oBAACC;EACC,WAAW,GACT,0MACA,UACD;EACD,GAAI;EAEH;GACyB,IAC3B;;AAIP,SAAgB,iBAAiB,EAAE,WAAW,OAAO,UAAU,GAAG,SAA8B;CAC9F,MAAM,QAAQC,gBAAqB;AAEnC,QACE,oBAACC;EACC,WAAW,GAAG,mCAAmC,UAAU;EAC3D,OAAO;GACL,oBAAoB,cAAc,MAAM;GACxC,GAAG;GACJ;EACD,GAAI;EAEH;GACqB;;AAI5B,SAAgB,YAAY,EAC1B,WACA,OACA,UACA,GAAG,SACuC;CAC1C,MAAM,QAAQD,gBAAqB;AAEnC,QACE,oBAACE;EACC,WAAW,GAAG,aAAa;GAAE,SAAS;GAAQ,WAAW,SAAS;GAAG,CAAC,EAAE,UAAU;EAClF,OAAO;GACL,oBAAoB,cAAc,MAAM;GACxC,GAAG;GACJ;EACD,GAAI;EAEH;GACgB;;AAIvB,SAAgB,qBAAqB,EACnC,WACA,OACA,GAAG,SACgD;CACnD,MAAM,EAAE,OAAO,gBAAgBC,WAAgB;AAE/C,QACE,oBAACC;EACC,WAAW,GAAG,aAAa,EAAE,SAAS,cAAc,WAAW,MAAM,CAAC,EAAE,UAAU,UAAU;EAC5F,OAAO;GACL,oBAAoB,cAAc,QAAQ,EAAE;GAC5C,GAAG;GACJ;EACD,GAAI;YAEH,MAAM;GACmB;;AAIhC,SAAgB,kBAAkB,EAChC,WACA,OACA,GAAG,SAC6C;CAChD,MAAM,QAAQJ,gBAAqB;AAEnC,QACE,oBAACK;EACC,WAAW,GAAG,aAAa;GAAE,SAAS;GAAQ,WAAW,QAAQ;GAAG,CAAC,EAAE,UAAU,UAAU;EAC3F,OAAO;GACL,oBAAoB,cAAc,QAAQ,EAAE;GAC5C,GAAG;GACJ;EACD,GAAI;YAEH,MAAM;GACgB;;AAI7B,SAAgB,qBAAqB,EACnC,WACA,UACA,GAAG,SACgD;CACnD,MAAM,QAAQL,gBAAqB;AAEnC,QACE,oBAACM;EACC,WAAW,GACT,YACA,UAAU,KACR,yGACF,UACD;EACD,GAAI;EAEH;GACyB;;AAGhC,MAAa,kBAAkB,uBAAuB;CACpD;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAa,kBAAkB,uBAAuB;CACpD;CACA;CACA;CACA;CACA;CACD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as react_jsx_runtime87 from "react/jsx-runtime";
|
|
2
|
+
import * as react17 from "react";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
import { LinkItemType } from "@hanzo/docs-ui/link-item";
|
|
5
|
+
import { I18nConfig } from "@hanzo/docs-core/i18n";
|
|
6
|
+
export * from "@hanzo/docs-ui/link-item";
|
|
7
|
+
|
|
8
|
+
//#region src/layouts/shared/index.d.ts
|
|
9
|
+
interface NavOptions {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
component: ReactNode;
|
|
12
|
+
title?: ReactNode | ((props: ComponentProps<'a'>) => ReactNode);
|
|
13
|
+
/**
|
|
14
|
+
* Redirect url of title
|
|
15
|
+
* @defaultValue '/'
|
|
16
|
+
*/
|
|
17
|
+
url?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Use transparent background
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue none
|
|
22
|
+
*/
|
|
23
|
+
transparentMode?: 'always' | 'top' | 'none';
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
interface BaseLayoutProps {
|
|
27
|
+
themeSwitch?: {
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
component?: ReactNode;
|
|
30
|
+
mode?: 'light-dark' | 'light-dark-system';
|
|
31
|
+
};
|
|
32
|
+
searchToggle?: Partial<{
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
components: Partial<{
|
|
35
|
+
sm: ReactNode;
|
|
36
|
+
lg: ReactNode;
|
|
37
|
+
}>;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* I18n options
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue false
|
|
43
|
+
*/
|
|
44
|
+
i18n?: boolean | I18nConfig;
|
|
45
|
+
/**
|
|
46
|
+
* GitHub url
|
|
47
|
+
*/
|
|
48
|
+
githubUrl?: string;
|
|
49
|
+
links?: LinkItemType[];
|
|
50
|
+
/**
|
|
51
|
+
* Replace or disable navbar
|
|
52
|
+
*/
|
|
53
|
+
nav?: Partial<NavOptions>;
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get link items with shortcuts
|
|
58
|
+
*/
|
|
59
|
+
declare function resolveLinkItems({
|
|
60
|
+
links,
|
|
61
|
+
githubUrl
|
|
62
|
+
}: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): LinkItemType[];
|
|
63
|
+
declare function renderTitleNav({
|
|
64
|
+
title,
|
|
65
|
+
url
|
|
66
|
+
}: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean | react_jsx_runtime87.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react17.ReactPortal | react17.ReactElement<unknown, string | react17.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { BaseLayoutProps, NavOptions, renderTitleNav, resolveLinkItems };
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/layouts/shared/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;UAKiB,UAAA;;aAEJ;UAEH,qBAAqB,wBAAwB;;;AAJvD;;EAIU,GAAA,CAAA,EAAA,MAAA;EAAqB;;;;AAkB/B;EAGgB,eAAA,CAAA,EAAA,QAAA,GAAA,KAAA,GAAA,MAAA;EAON,QAAA,CAAA,EAbG,SAaH;;AADM,UATC,eAAA,CASD;EAFC,WAAA,CAAA,EAAA;IAaE,OAAA,CAAA,EAAA,OAAA;IAOT,SAAA,CAAA,EAxBM,SAwBN;IAIM,IAAA,CAAA,EAAA,YAAA,GAAA,mBAAA;EAAR,CAAA;EAEK,YAAA,CAAA,EA1BI,OA0BJ,CAAA;IAAS,OAAA,EAAA,OAAA;IAMN,UAAA,EA9BA,OA8BgB,CAAA;MAC9B,EAAA,EA9BQ,SA8BR;MACA,EAAA,EA9BQ,SA8BR;IACM,CAAA,CAAA;EAAL,CAAA,CAAA;EAA+C;;AAoBlD;;;EACgC,IAAA,CAAA,EAAA,OAAA,GA3Cb,UA2Ca;EAAR;;;EACI,SAAA,CAAA,EAAA,MAAA;EAAA,KAAA,CAAA,EArClB,YAqCkB,EAAA;EAAA;;;EAAA,GAAA,CAAA,EAjCpB,OAiCoB,CAjCZ,UAiCY,CAAA;EAAA,QAAA,CAAA,EA/Bf,SA+Be;;;;;iBAzBZ,gBAAA;;;GAGb,KAAK,0CAA0C;iBAoBlC,cAAA;;;GACQ,QAAQ,oBACvB,2DAAmB,mBAAA,CAAA,GAAA,CAAA,OAAA,GAAA,SAAA,aAAA,6CAAA,OAAA,CAAA,WAAA,GAAA,OAAA,CAAA,+BAAA,OAAA,CAAA,8BAAA,SAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Link from "@hanzo/docs-core/link";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/layouts/shared/index.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Get link items with shortcuts
|
|
7
|
+
*/
|
|
8
|
+
function resolveLinkItems({ links = [], githubUrl }) {
|
|
9
|
+
const result = [...links];
|
|
10
|
+
if (githubUrl) result.push({
|
|
11
|
+
type: "icon",
|
|
12
|
+
url: githubUrl,
|
|
13
|
+
text: "Github",
|
|
14
|
+
label: "GitHub",
|
|
15
|
+
icon: /* @__PURE__ */ jsx("svg", {
|
|
16
|
+
role: "img",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
|
|
20
|
+
}),
|
|
21
|
+
external: true
|
|
22
|
+
});
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
function renderTitleNav({ title, url = "/" }, props) {
|
|
26
|
+
if (typeof title === "function") return title({
|
|
27
|
+
href: url,
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
31
|
+
href: url,
|
|
32
|
+
...props,
|
|
33
|
+
children: title
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { renderTitleNav, resolveLinkItems };
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/layouts/shared/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport type { I18nConfig } from '@hanzo/docs-core/i18n';\nimport type { LinkItemType } from '@hanzo/docs-ui/link-item';\nimport Link from '@hanzo/docs-core/link';\n\nexport interface NavOptions {\n enabled: boolean;\n component: ReactNode;\n\n title?: ReactNode | ((props: ComponentProps<'a'>) => ReactNode);\n\n /**\n * Redirect url of title\n * @defaultValue '/'\n */\n url?: string;\n\n /**\n * Use transparent background\n *\n * @defaultValue none\n */\n transparentMode?: 'always' | 'top' | 'none';\n\n children?: ReactNode;\n}\n\nexport interface BaseLayoutProps {\n themeSwitch?: {\n enabled?: boolean;\n component?: ReactNode;\n mode?: 'light-dark' | 'light-dark-system';\n };\n\n searchToggle?: Partial<{\n enabled: boolean;\n components: Partial<{\n sm: ReactNode;\n lg: ReactNode;\n }>;\n }>;\n\n /**\n * I18n options\n *\n * @defaultValue false\n */\n i18n?: boolean | I18nConfig;\n\n /**\n * GitHub url\n */\n githubUrl?: string;\n\n links?: LinkItemType[];\n /**\n * Replace or disable navbar\n */\n nav?: Partial<NavOptions>;\n\n children?: ReactNode;\n}\n\n/**\n * Get link items with shortcuts\n */\nexport function resolveLinkItems({\n links = [],\n githubUrl,\n}: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): LinkItemType[] {\n const result = [...links];\n\n if (githubUrl)\n result.push({\n type: 'icon',\n url: githubUrl,\n text: 'Github',\n label: 'GitHub',\n icon: (\n <svg role=\"img\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\" />\n </svg>\n ),\n external: true,\n });\n\n return result;\n}\n\nexport function renderTitleNav(\n { title, url = '/' }: Partial<NavOptions>,\n props: ComponentProps<'a'>,\n) {\n if (typeof title === 'function') return title({ href: url, ...props });\n return (\n <Link href={url} {...props}>\n {title}\n </Link>\n );\n}\n\nexport type * from '@hanzo/docs-ui/link-item';\n"],"mappings":";;;;;;;AAkEA,SAAgB,iBAAiB,EAC/B,QAAQ,EAAE,EACV,aAC+D;CAC/D,MAAM,SAAS,CAAC,GAAG,MAAM;AAEzB,KAAI,UACF,QAAO,KAAK;EACV,MAAM;EACN,KAAK;EACL,MAAM;EACN,OAAO;EACP,MACE,oBAAC;GAAI,MAAK;GAAM,SAAQ;GAAY,MAAK;aACvC,oBAAC,UAAK,GAAE,6sBAA6sB;IACjtB;EAER,UAAU;EACX,CAAC;AAEJ,QAAO;;AAGT,SAAgB,eACd,EAAE,OAAO,MAAM,OACf,OACA;AACA,KAAI,OAAO,UAAU,WAAY,QAAO,MAAM;EAAE,MAAM;EAAK,GAAG;EAAO,CAAC;AACtE,QACE,oBAAC;EAAK,MAAM;EAAK,GAAI;YAClB;GACI"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime91 from "react/jsx-runtime";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/layouts/shared/language-toggle.d.ts
|
|
5
|
+
type LanguageSelectProps = ComponentProps<'button'>;
|
|
6
|
+
declare function LanguageToggle(props: LanguageSelectProps): React.ReactElement;
|
|
7
|
+
declare function LanguageToggleText(props: ComponentProps<'span'>): react_jsx_runtime91.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { LanguageSelectProps, LanguageToggle, LanguageToggleText };
|
|
10
|
+
//# sourceMappingURL=language-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-toggle.d.ts","names":[],"sources":["../../../src/layouts/shared/language-toggle.tsx"],"sourcesContent":[],"mappings":";;;;KAOY,mBAAA,GAAsB;iBAElB,cAAA,QAAsB,sBAAsB,KAAA,CAAM;iBA6ClD,kBAAA,QAA0B,yBAAsB,mBAAA,CAAA,GAAA,CAAA"}
|