fumadocs-ui 16.4.0 → 16.4.2
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/css/preset.css +2 -4
- package/dist/_virtual/rolldown_runtime.js +36 -0
- package/dist/components/accordion.d.ts +24 -7
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +65 -38
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/banner.d.ts +33 -22
- package/dist/components/banner.d.ts.map +1 -1
- package/dist/components/banner.js +63 -47
- package/dist/components/banner.js.map +1 -0
- package/dist/components/callout.d.ts +41 -17
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +57 -28
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +19 -9
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +39 -8
- package/dist/components/card.js.map +1 -0
- package/dist/components/codeblock.d.ts +61 -40
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +116 -58
- package/dist/components/codeblock.js.map +1 -0
- package/dist/components/dialog/search-algolia.d.ts +37 -23
- package/dist/components/dialog/search-algolia.d.ts.map +1 -1
- package/dist/components/dialog/search-algolia.js +64 -31
- package/dist/components/dialog/search-algolia.js.map +1 -0
- package/dist/components/dialog/search-default.d.ts +42 -27
- package/dist/components/dialog/search-default.d.ts.map +1 -1
- package/dist/components/dialog/search-default.js +64 -38
- package/dist/components/dialog/search-default.js.map +1 -0
- package/dist/components/dialog/search-orama.d.ts +41 -25
- package/dist/components/dialog/search-orama.d.ts.map +1 -1
- package/dist/components/dialog/search-orama.js +68 -35
- package/dist/components/dialog/search-orama.js.map +1 -0
- package/dist/components/dialog/search.d.ts +103 -64
- package/dist/components/dialog/search.d.ts.map +1 -1
- package/dist/components/dialog/search.js +264 -185
- package/dist/components/dialog/search.js.map +1 -0
- package/dist/components/dynamic-codeblock.d.ts +30 -19
- package/dist/components/dynamic-codeblock.d.ts.map +1 -1
- package/dist/components/dynamic-codeblock.js +60 -27
- package/dist/components/dynamic-codeblock.js.map +1 -0
- package/dist/components/files.d.ts +32 -16
- package/dist/components/files.d.ts.map +1 -1
- package/dist/components/files.js +40 -14
- package/dist/components/files.js.map +1 -0
- package/dist/components/github-info.d.ts +18 -7
- package/dist/components/github-info.d.ts.map +1 -1
- package/dist/components/github-info.js +63 -48
- package/dist/components/github-info.js.map +1 -0
- package/dist/components/heading.d.ts +11 -4
- package/dist/components/heading.d.ts.map +1 -1
- package/dist/components/heading.js +28 -8
- 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.d.ts +23 -14
- package/dist/components/image-zoom.d.ts.map +1 -1
- package/dist/components/image-zoom.js +32 -19
- package/dist/components/image-zoom.js.map +1 -0
- package/dist/components/image-zoom2.js +1 -0
- package/dist/components/inline-toc.d.ts +14 -6
- package/dist/components/inline-toc.d.ts.map +1 -1
- package/dist/components/inline-toc.js +28 -8
- package/dist/components/inline-toc.js.map +1 -0
- package/dist/components/sidebar/base.d.ts +102 -65
- package/dist/components/sidebar/base.d.ts.map +1 -1
- package/dist/components/sidebar/base.js +256 -180
- package/dist/components/sidebar/base.js.map +1 -0
- package/dist/components/sidebar/link-item.d.ts +23 -10
- package/dist/components/sidebar/link-item.d.ts.map +1 -1
- package/dist/components/sidebar/link-item.js +32 -12
- package/dist/components/sidebar/link-item.js.map +1 -0
- package/dist/components/sidebar/page-tree.d.ts +28 -17
- package/dist/components/sidebar/page-tree.d.ts.map +1 -1
- package/dist/components/sidebar/page-tree.js +57 -33
- package/dist/components/sidebar/page-tree.js.map +1 -0
- package/dist/components/sidebar/tabs/dropdown.d.ts +18 -9
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/dropdown.js +75 -31
- package/dist/components/sidebar/tabs/dropdown.js.map +1 -0
- package/dist/components/sidebar/tabs/index.d.ts +24 -18
- package/dist/components/sidebar/tabs/index.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/index.js +45 -45
- package/dist/components/sidebar/tabs/index.js.map +1 -0
- package/dist/components/steps.d.ts +16 -7
- package/dist/components/steps.d.ts.map +1 -1
- package/dist/components/steps.js +17 -5
- package/dist/components/steps.js.map +1 -0
- package/dist/components/tabs.d.ts +49 -28
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +88 -51
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/toc/clerk.d.ts +1 -2
- package/dist/components/toc/clerk.js +12 -1
- package/dist/components/toc/clerk.js.map +1 -0
- package/dist/components/toc/default.d.ts +1 -2
- package/dist/components/toc/default.js +12 -1
- package/dist/components/toc/default.js.map +1 -0
- package/dist/components/toc/index.d.ts +1 -2
- package/dist/components/toc/index.js +12 -1
- package/dist/components/toc/index.js.map +1 -0
- package/dist/components/type-table.d.ts +36 -29
- package/dist/components/type-table.d.ts.map +1 -1
- package/dist/components/type-table.js +106 -25
- package/dist/components/type-table.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +31 -7
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +40 -14
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/button.d.ts +12 -7
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +21 -18
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +12 -8
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +21 -11
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +8 -5
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +36 -9
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/popover.d.ts +6 -3
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +19 -6
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +7 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +33 -7
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +37 -19
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +75 -73
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/contexts/i18n.d.ts +1 -2
- package/dist/contexts/i18n.js +12 -1
- package/dist/contexts/i18n.js.map +1 -0
- package/dist/contexts/search.d.ts +7 -1
- package/dist/contexts/search.d.ts.map +1 -1
- package/dist/contexts/search.js +12 -1
- package/dist/contexts/search.js.map +1 -0
- package/dist/contexts/tree.d.ts +1 -2
- package/dist/contexts/tree.js +12 -1
- package/dist/contexts/tree.js.map +1 -0
- package/dist/i18n.d.ts +1 -2
- package/dist/i18n.js +3 -1
- package/dist/layouts/docs/client.d.ts +30 -13
- package/dist/layouts/docs/client.d.ts.map +1 -1
- package/dist/layouts/docs/client.js +61 -34
- package/dist/layouts/docs/client.js.map +1 -0
- package/dist/layouts/docs/index.d.ts +57 -33
- package/dist/layouts/docs/index.d.ts.map +1 -1
- package/dist/layouts/docs/index.js +178 -68
- package/dist/layouts/docs/index.js.map +1 -0
- package/dist/layouts/docs/page/client.d.ts +43 -21
- package/dist/layouts/docs/page/client.d.ts.map +1 -1
- package/dist/layouts/docs/page/client.js +213 -105
- package/dist/layouts/docs/page/client.js.map +1 -0
- package/dist/layouts/docs/page/index.d.ts +82 -46
- package/dist/layouts/docs/page/index.d.ts.map +1 -1
- package/dist/layouts/docs/page/index.js +98 -45
- package/dist/layouts/docs/page/index.js.map +1 -0
- package/dist/layouts/docs/sidebar.d.ts +57 -16
- package/dist/layouts/docs/sidebar.d.ts.map +1 -1
- package/dist/layouts/docs/sidebar.js +135 -82
- package/dist/layouts/docs/sidebar.js.map +1 -0
- package/dist/layouts/home/client.d.ts +18 -5
- package/dist/layouts/home/client.d.ts.map +1 -1
- package/dist/layouts/home/client.js +252 -103
- package/dist/layouts/home/client.js.map +1 -0
- package/dist/layouts/home/index.d.ts +15 -10
- package/dist/layouts/home/index.d.ts.map +1 -1
- package/dist/layouts/home/index.js +24 -7
- package/dist/layouts/home/index.js.map +1 -0
- package/dist/layouts/home/navbar.d.ts +13 -6
- package/dist/layouts/home/navbar.d.ts.map +1 -1
- package/dist/layouts/home/navbar.js +34 -12
- package/dist/layouts/home/navbar.js.map +1 -0
- package/dist/layouts/notebook/client.d.ts +44 -20
- package/dist/layouts/notebook/client.d.ts.map +1 -1
- package/dist/layouts/notebook/client.js +148 -93
- package/dist/layouts/notebook/client.js.map +1 -0
- package/dist/layouts/notebook/index.d.ts +34 -30
- package/dist/layouts/notebook/index.d.ts.map +1 -1
- package/dist/layouts/notebook/index.js +216 -90
- package/dist/layouts/notebook/index.js.map +1 -0
- package/dist/layouts/notebook/page/client.d.ts +43 -21
- package/dist/layouts/notebook/page/client.d.ts.map +1 -1
- package/dist/layouts/notebook/page/client.js +213 -105
- package/dist/layouts/notebook/page/client.js.map +1 -0
- package/dist/layouts/notebook/page/index.d.ts +82 -46
- package/dist/layouts/notebook/page/index.d.ts.map +1 -1
- package/dist/layouts/notebook/page/index.js +98 -45
- package/dist/layouts/notebook/page/index.js.map +1 -0
- package/dist/layouts/notebook/sidebar.d.ts +62 -16
- package/dist/layouts/notebook/sidebar.d.ts.map +1 -1
- package/dist/layouts/notebook/sidebar.js +135 -79
- package/dist/layouts/notebook/sidebar.js.map +1 -0
- package/dist/layouts/shared/index.d.ts +62 -50
- package/dist/layouts/shared/index.d.ts.map +1 -1
- package/dist/layouts/shared/index.js +36 -20
- package/dist/layouts/shared/index.js.map +1 -0
- package/dist/layouts/shared/language-toggle.d.ts +9 -4
- package/dist/layouts/shared/language-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/language-toggle.js +44 -21
- package/dist/layouts/shared/language-toggle.js.map +1 -0
- package/dist/layouts/shared/search-toggle.d.ts +20 -8
- package/dist/layouts/shared/search-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/search-toggle.js +53 -24
- package/dist/layouts/shared/search-toggle.js.map +1 -0
- package/dist/layouts/shared/theme-toggle.d.ts +13 -4
- package/dist/layouts/shared/theme-toggle.d.ts.map +1 -1
- package/dist/layouts/shared/theme-toggle.js +58 -34
- package/dist/layouts/shared/theme-toggle.js.map +1 -0
- package/dist/mdx.d.ts +34 -29
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +68 -34
- package/dist/mdx.js.map +1 -0
- package/dist/mdx.server.d.ts +9 -5
- package/dist/mdx.server.d.ts.map +1 -1
- package/dist/mdx.server.js +21 -13
- package/dist/mdx.server.js.map +1 -0
- package/dist/og.d.ts +1 -2
- package/dist/og.js +3 -1
- package/dist/page.d.ts +30 -20
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +34 -18
- package/dist/page.js.map +1 -0
- package/dist/provider/base.d.ts +43 -33
- package/dist/provider/base.d.ts.map +1 -1
- package/dist/provider/base.js +37 -17
- package/dist/provider/base.js.map +1 -0
- package/dist/provider/next.d.ts +20 -12
- package/dist/provider/next.d.ts.map +1 -1
- package/dist/provider/next.js +19 -5
- package/dist/provider/next.js.map +1 -0
- package/dist/provider/react-router.d.ts +20 -12
- package/dist/provider/react-router.d.ts.map +1 -1
- package/dist/provider/react-router.js +19 -5
- package/dist/provider/react-router.js.map +1 -0
- package/dist/provider/tanstack.d.ts +20 -12
- package/dist/provider/tanstack.d.ts.map +1 -1
- package/dist/provider/tanstack.js +19 -5
- package/dist/provider/tanstack.js.map +1 -0
- package/dist/provider/waku.d.ts +20 -12
- package/dist/provider/waku.d.ts.map +1 -1
- package/dist/provider/waku.js +19 -5
- package/dist/provider/waku.js.map +1 -0
- package/dist/style.css +30 -12
- package/dist/utils/use-copy-button.d.ts +1 -2
- package/dist/utils/use-copy-button.js +3 -1
- package/dist/utils/use-footer-items.d.ts +1 -2
- package/dist/utils/use-footer-items.js +3 -1
- package/dist/utils/use-is-scroll-top.d.ts +1 -2
- package/dist/utils/use-is-scroll-top.js +3 -1
- package/package.json +51 -52
- package/dist/components/toc/clerk.d.ts.map +0 -1
- package/dist/components/toc/default.d.ts.map +0 -1
- package/dist/components/toc/index.d.ts.map +0 -1
- package/dist/contexts/i18n.d.ts.map +0 -1
- package/dist/contexts/tree.d.ts.map +0 -1
- package/dist/i18n.d.ts.map +0 -1
- package/dist/og.d.ts.map +0 -1
- package/dist/utils/use-copy-button.d.ts.map +0 -1
- package/dist/utils/use-footer-items.d.ts.map +0 -1
- package/dist/utils/use-is-scroll-top.d.ts.map +0 -1
|
@@ -1,51 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger } from "./client.js";
|
|
6
|
+
import { default_exports } from "../../../components/toc/default.js";
|
|
7
|
+
import { clerk_exports } from "../../../components/toc/clerk.js";
|
|
8
|
+
import { cn } from "@fumadocs/ui/cn";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Edit, Text } from "lucide-react";
|
|
11
|
+
|
|
12
|
+
//#region src/layouts/docs/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 w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14", full ? "max-w-[1200px]" : "xl:layout:[--fd-toc-width:268px]"),
|
|
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-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 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
|
+
] }));
|
|
28
62
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
+
});
|
|
35
75
|
}
|
|
36
76
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
+
});
|
|
41
85
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
+
});
|
|
47
93
|
}
|
|
48
|
-
|
|
49
|
-
|
|
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
|
+
});
|
|
50
100
|
}
|
|
51
|
-
|
|
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/docs/page/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from '@fumadocs/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 'fumadocs-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 w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14',\n full ? 'max-w-[1200px]' : 'xl:layout:[--fd-toc-width:268px]',\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-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 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,gHACA,OAAO,mBAAmB,mCAC3B;;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"}
|
|
@@ -1,17 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { SidebarCollapseTrigger, SidebarDrawerContent, SidebarFolder, SidebarFolderContent as SidebarFolderContent$1, SidebarFolderLink as SidebarFolderLink$1, SidebarFolderTrigger as SidebarFolderTrigger$1, SidebarItem as SidebarItem$1, SidebarProvider, SidebarTrigger, SidebarViewport } from "../../components/sidebar/base.js";
|
|
2
|
+
import { SidebarPageTreeComponents } from "../../components/sidebar/page-tree.js";
|
|
3
|
+
import * as react_jsx_runtime116 from "react/jsx-runtime";
|
|
4
|
+
import * as react16 from "react";
|
|
5
|
+
import { ComponentProps } from "react";
|
|
6
|
+
import * as _fumadocs_ui_link_item0 from "@fumadocs/ui/link-item";
|
|
7
|
+
|
|
8
|
+
//#region src/layouts/docs/sidebar.d.ts
|
|
9
|
+
declare function SidebarContent({
|
|
10
|
+
ref: refProp,
|
|
11
|
+
className,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}: ComponentProps<'aside'>): react_jsx_runtime116.JSX.Element;
|
|
15
|
+
declare function SidebarDrawer({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: ComponentProps<typeof SidebarDrawerContent>): react_jsx_runtime116.JSX.Element;
|
|
20
|
+
declare function SidebarSeparator({
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}: ComponentProps<'p'>): react_jsx_runtime116.JSX.Element;
|
|
26
|
+
declare function SidebarItem({
|
|
27
|
+
className,
|
|
28
|
+
style,
|
|
29
|
+
children,
|
|
30
|
+
...props
|
|
31
|
+
}: ComponentProps<typeof SidebarItem$1>): react_jsx_runtime116.JSX.Element;
|
|
32
|
+
declare function SidebarFolderTrigger({
|
|
33
|
+
className,
|
|
34
|
+
style,
|
|
35
|
+
...props
|
|
36
|
+
}: ComponentProps<typeof SidebarFolderTrigger$1>): react_jsx_runtime116.JSX.Element;
|
|
37
|
+
declare function SidebarFolderLink({
|
|
38
|
+
className,
|
|
39
|
+
style,
|
|
40
|
+
...props
|
|
41
|
+
}: ComponentProps<typeof SidebarFolderLink$1>): react_jsx_runtime116.JSX.Element;
|
|
42
|
+
declare function SidebarFolderContent({
|
|
43
|
+
className,
|
|
44
|
+
children,
|
|
45
|
+
...props
|
|
46
|
+
}: ComponentProps<typeof SidebarFolderContent$1>): react_jsx_runtime116.JSX.Element;
|
|
47
|
+
declare const SidebarPageTree: (components: Partial<SidebarPageTreeComponents>) => react_jsx_runtime116.JSX.Element;
|
|
48
|
+
declare const SidebarLinkItem: ({
|
|
49
|
+
item,
|
|
50
|
+
...props
|
|
51
|
+
}: react16.HTMLAttributes<HTMLElement> & {
|
|
52
|
+
item: Exclude<_fumadocs_ui_link_item0.LinkItemType, {
|
|
53
|
+
type: "icon";
|
|
54
|
+
}>;
|
|
55
|
+
}) => react_jsx_runtime116.JSX.Element;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { SidebarProvider as Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarDrawer, SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, SidebarLinkItem, SidebarPageTree, SidebarSeparator, SidebarTrigger, SidebarViewport };
|
|
17
58
|
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","names":[],"sources":["../../../src/layouts/docs/sidebar.tsx"],"sourcesContent":[],"mappings":";;;;;;;;iBAwCgB,cAAA;OACT;;;;GAIJ,0BAAuB,oBAAA,CAAA,GAAA,CAAA;iBA8DV,aAAA;;;;GAIb,sBAAsB,wBAA0B,oBAAA,CAAA,GAAA,CAAA;iBAiBnC,gBAAA;;;;;GAA2D,sBAAmB,oBAAA,CAAA,GAAA,CAAA;iBAiB9E,WAAA;;;;;GAKb,sBAAsB,iBAAiB,oBAAA,CAAA,GAAA,CAAA;iBAiB1B,oBAAA;;;;GAIb,sBAAsB,0BAA0B,oBAAA,CAAA,GAAA,CAAA;AAnInC,iBAoJA,iBAAA,CApJc;EAAA,SAAA;EAAA,KAAA;EAAA,GAAA;AAAA,CAAA,EAwJ3B,cAxJ2B,CAAA,OAwJL,mBAxJK,CAAA,CAAA,EAwJkB,oBAAA,CAAA,GAAA,CAAA,OAxJlB;AACvB,iBAwKS,oBAAA,CAxKT;EAAA,SAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EA4KJ,cA5KI,CAAA,OA4KkB,sBA5KlB,CAAA,CAAA,EA4K4C,oBAAA,CAAA,GAAA,CAAA,OA5K5C;AACL,cA6LW,eA7LX,EAAA,CAAA,UAAA,EA6L0B,OA7L1B,CAoMA,yBAAA,CApMA,EAAA,GA6L0B,oBAAA,CAAA,GAAA,CAAA,OA7L1B;AACA,cAqMW,eArMX,EAAA,CAAA;EAAA,IAAA;EAAA,GAAA;AAgEF,CAhEE,EAqM0B,OAAA,CAAA,cArM1B,CAqM0B,WArM1B,CAAA,GAAA;EAEC,IAAA,SAAA,CAmMyB,uBAAA,CAAA,YAAA,EAnMzB;IAAuB,IAAA,EAAA,MAAA;EAAA,CAAA,CAAA;AA8D1B,CAAA,EAAA,mCAA6B"}
|
|
@@ -1,94 +1,147 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
2
|
+
|
|
3
|
+
import { buttonVariants } from "../../components/ui/button.js";
|
|
4
|
+
import { SidebarCollapseTrigger, SidebarContent as SidebarContent$1, SidebarDrawerContent, SidebarDrawerOverlay, SidebarFolder, SidebarFolderContent as SidebarFolderContent$1, SidebarFolderLink as SidebarFolderLink$1, SidebarFolderTrigger as SidebarFolderTrigger$1, SidebarItem as SidebarItem$1, SidebarProvider, SidebarSeparator as SidebarSeparator$1, SidebarTrigger, SidebarViewport, useFolder, useFolderDepth } from "../../components/sidebar/base.js";
|
|
5
|
+
import { createLinkItemRenderer } from "../../components/sidebar/link-item.js";
|
|
6
|
+
import { createPageTreeRenderer } from "../../components/sidebar/page-tree.js";
|
|
7
|
+
import { SearchToggle } from "../shared/search-toggle.js";
|
|
8
|
+
import { cn } from "@fumadocs/ui/cn";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Sidebar } from "lucide-react";
|
|
11
|
+
import { useRef } from "react";
|
|
12
|
+
import { cva } from "class-variance-authority";
|
|
13
|
+
import { mergeRefs } from "@fumadocs/ui/merge-refs";
|
|
14
|
+
|
|
15
|
+
//#region src/layouts/docs/sidebar.tsx
|
|
16
|
+
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: {
|
|
17
|
+
variant: {
|
|
18
|
+
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",
|
|
19
|
+
button: "transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"
|
|
20
|
+
},
|
|
21
|
+
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" }
|
|
22
|
+
} });
|
|
24
23
|
function getItemOffset(depth) {
|
|
25
|
-
|
|
24
|
+
return `calc(${2 + 3 * depth} * var(--spacing))`;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
function SidebarContent({ ref: refProp, className, children, ...props }) {
|
|
27
|
+
const ref = useRef(null);
|
|
28
|
+
return /* @__PURE__ */ jsx(SidebarContent$1, { children: ({ collapsed, hovered, ref: asideRef, ...rest }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
29
|
+
"data-sidebar-placeholder": "",
|
|
30
|
+
className: "sticky top-(--fd-docs-row-1) z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] md:layout:[--fd-sidebar-width:268px] max-md:hidden",
|
|
31
|
+
children: [collapsed && /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: "absolute start-0 inset-y-0 w-4",
|
|
33
|
+
...rest
|
|
34
|
+
}), /* @__PURE__ */ jsx("aside", {
|
|
35
|
+
id: "nd-sidebar",
|
|
36
|
+
ref: mergeRefs(ref, refProp, asideRef),
|
|
37
|
+
"data-collapsed": collapsed,
|
|
38
|
+
"data-hovered": collapsed && hovered,
|
|
39
|
+
className: cn("absolute flex flex-col w-full start-0 inset-y-0 items-end bg-fd-card text-sm border-e duration-250 *:w-(--fd-sidebar-width)", collapsed && ["inset-y-2 rounded-xl 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),
|
|
40
|
+
...props,
|
|
41
|
+
...rest,
|
|
42
|
+
children
|
|
43
|
+
})]
|
|
44
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
"data-sidebar-panel": "",
|
|
46
|
+
className: cn("fixed flex top-[calc(--spacing(4)+var(--fd-docs-row-3))] start-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10", (!collapsed || hovered) && "pointer-events-none opacity-0"),
|
|
47
|
+
children: [/* @__PURE__ */ jsx(SidebarCollapseTrigger, {
|
|
48
|
+
className: cn(buttonVariants({
|
|
49
|
+
color: "ghost",
|
|
50
|
+
size: "icon-sm",
|
|
51
|
+
className: "rounded-lg"
|
|
52
|
+
})),
|
|
53
|
+
children: /* @__PURE__ */ jsx(Sidebar, {})
|
|
54
|
+
}), /* @__PURE__ */ jsx(SearchToggle, {
|
|
55
|
+
className: "rounded-lg",
|
|
56
|
+
hideIfDisabled: true
|
|
57
|
+
})]
|
|
58
|
+
})] }) });
|
|
43
59
|
}
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
})] });
|
|
46
66
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
+
});
|
|
53
78
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
+
});
|
|
60
93
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
+
});
|
|
67
105
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
+
});
|
|
74
120
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
+
});
|
|
79
128
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
129
|
+
const SidebarPageTree = createPageTreeRenderer({
|
|
130
|
+
SidebarFolder,
|
|
131
|
+
SidebarFolderContent,
|
|
132
|
+
SidebarFolderLink,
|
|
133
|
+
SidebarFolderTrigger,
|
|
134
|
+
SidebarItem,
|
|
135
|
+
SidebarSeparator
|
|
87
136
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
137
|
+
const SidebarLinkItem = createLinkItemRenderer({
|
|
138
|
+
SidebarFolder,
|
|
139
|
+
SidebarFolderContent,
|
|
140
|
+
SidebarFolderLink,
|
|
141
|
+
SidebarFolderTrigger,
|
|
142
|
+
SidebarItem
|
|
94
143
|
});
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
export { SidebarProvider as 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.SidebarContent","Base.SidebarCollapseTrigger","SidebarIcon","Base.SidebarDrawerOverlay","Base.SidebarDrawerContent","Base.useFolderDepth","Base.SidebarSeparator","Base.SidebarItem","Base.useFolder","Base.SidebarFolderTrigger","Base.SidebarFolderLink","Base.SidebarFolderContent","Base.SidebarFolder"],"sources":["../../../src/layouts/docs/sidebar.tsx"],"sourcesContent":["'use client';\nimport * as Base from '@/components/sidebar/base';\nimport { cn } from '@fumadocs/ui/cn';\nimport { type ComponentProps, useRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { createPageTreeRenderer } from '@/components/sidebar/page-tree';\nimport { createLinkItemRenderer } from '@/components/sidebar/link-item';\nimport { buttonVariants } from '@/components/ui/button';\nimport { SearchToggle } from '@/layouts/shared/search-toggle';\nimport { Sidebar as SidebarIcon } from 'lucide-react';\nimport { mergeRefs } from '@fumadocs/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 {\n SidebarProvider as Sidebar,\n SidebarFolder,\n SidebarCollapseTrigger,\n SidebarViewport,\n SidebarTrigger,\n} from '@/components/sidebar/base';\n\nexport function SidebarContent({\n ref: refProp,\n className,\n children,\n ...props\n}: ComponentProps<'aside'>) {\n const ref = useRef<HTMLElement>(null);\n\n return (\n <Base.SidebarContent>\n {({ collapsed, hovered, ref: asideRef, ...rest }) => (\n <>\n <div\n data-sidebar-placeholder=\"\"\n className=\"sticky top-(--fd-docs-row-1) z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] md:layout:[--fd-sidebar-width:268px] max-md:hidden\"\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 bg-fd-card text-sm border-e duration-250 *:w-(--fd-sidebar-width)',\n collapsed && [\n 'inset-y-2 rounded-xl 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 <div\n data-sidebar-panel=\"\"\n className={cn(\n 'fixed flex top-[calc(--spacing(4)+var(--fd-docs-row-3))] start-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10',\n (!collapsed || hovered) && 'pointer-events-none opacity-0',\n )}\n >\n <Base.SidebarCollapseTrigger\n className={cn(\n buttonVariants({\n color: 'ghost',\n size: 'icon-sm',\n className: 'rounded-lg',\n }),\n )}\n >\n <SidebarIcon />\n </Base.SidebarCollapseTrigger>\n <SearchToggle className=\"rounded-lg\" hideIfDisabled />\n </div>\n </>\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}\n\nexport const SidebarPageTree = createPageTreeRenderer({\n SidebarFolder: Base.SidebarFolder,\n SidebarFolderContent,\n SidebarFolderLink,\n SidebarFolderTrigger,\n SidebarItem,\n SidebarSeparator,\n});\n\nexport const SidebarLinkItem = createLinkItemRenderer({\n SidebarFolder: Base.SidebarFolder,\n SidebarFolderContent,\n SidebarFolderLink,\n SidebarFolderTrigger,\n SidebarItem,\n});\n"],"mappings":"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"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { HomeLayoutProps } from "./index.js";
|
|
2
|
+
import * as react_jsx_runtime134 from "react/jsx-runtime";
|
|
3
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
|
+
|
|
5
|
+
//#region src/layouts/home/client.d.ts
|
|
6
|
+
declare const navItemVariants: (props?: ({
|
|
7
|
+
variant?: "button" | "main" | "icon" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
|
+
declare function Header({
|
|
10
|
+
nav,
|
|
11
|
+
i18n,
|
|
12
|
+
links,
|
|
13
|
+
githubUrl,
|
|
14
|
+
themeSwitch,
|
|
15
|
+
searchToggle
|
|
16
|
+
}: HomeLayoutProps): react_jsx_runtime134.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Header, navItemVariants };
|
|
6
19
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/layouts/home/client.tsx"],"sourcesContent":[],"mappings":";;;;;cA6Ba;;IAiBX,+BAAA,CAAA;iBAEc,MAAA;;;;;;;GAOb,kBAAe,oBAAA,CAAA,GAAA,CAAA"}
|