fumadocs-ui 12.4.2 → 12.5.0

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.
Files changed (44) hide show
  1. package/dist/{chunk-NZA3MCPM.js → chunk-AAS47F5B.js} +65 -145
  2. package/dist/{docs.client.js → chunk-CIVJB4ZT.js} +20 -179
  3. package/dist/chunk-FMI5QZTV.js +21 -0
  4. package/dist/{chunk-BZ53GHJX.js → chunk-INUQLSIT.js} +66 -18
  5. package/dist/{chunk-KH555T4I.js → chunk-QQAMPLSA.js} +1 -1
  6. package/dist/{chunk-NUPTR2L5.js → chunk-QZBW7643.js} +6 -10
  7. package/dist/chunk-V7IGWU5C.js +13 -0
  8. package/dist/{chunk-6JD7NGHG.js → chunk-YKLVLKDA.js} +4 -6
  9. package/dist/{chunk-VUIQ7ZYI.js → chunk-YSCK5YFO.js} +1 -0
  10. package/dist/{chunk-3F57TIUQ.js → chunk-YXSAWF3G.js} +9 -6
  11. package/dist/chunk-ZMEQF77D.js +89 -0
  12. package/dist/components/accordion.js +2 -2
  13. package/dist/components/api.d.ts +16 -2
  14. package/dist/components/api.js +19 -6
  15. package/dist/components/banner.js +1 -1
  16. package/dist/components/codeblock.js +2 -2
  17. package/dist/components/dialog/search-algolia.d.ts +10 -2
  18. package/dist/components/dialog/search-algolia.js +41 -7
  19. package/dist/components/dialog/search-default.d.ts +6 -2
  20. package/dist/components/dialog/search-default.js +21 -7
  21. package/dist/components/dialog/search.d.ts +16 -5
  22. package/dist/components/dialog/search.js +8 -5
  23. package/dist/components/files.d.ts +1 -0
  24. package/dist/components/layout/language-toggle.js +1 -1
  25. package/dist/components/layout/root-toggle.js +11 -4
  26. package/dist/components/roll-button.js +1 -1
  27. package/dist/components/tabs.d.ts +3 -5
  28. package/dist/components/tabs.js +1 -1
  29. package/dist/{docs.client.d.ts → docs-layout.client.d.ts} +4 -5
  30. package/dist/docs-layout.client.js +83 -0
  31. package/dist/dynamic-sidebar-DCHFPBYF.js +123 -0
  32. package/dist/{layout.client.d.ts → home-layout.client.d.ts} +1 -2
  33. package/dist/{layout.client.js → home-layout.client.js} +10 -7
  34. package/dist/home-layout.d.ts +7 -0
  35. package/dist/home-layout.js +29 -0
  36. package/dist/layout.d.ts +29 -3
  37. package/dist/layout.js +17 -22
  38. package/dist/{layout-ZAteQVYk.d.ts → layout.shared-GQuo9xqE.d.ts} +12 -65
  39. package/dist/mdx.client.js +2 -2
  40. package/dist/provider.d.ts +1 -1
  41. package/dist/provider.js +5 -4
  42. package/dist/sidebar-C7MbvaPk.d.ts +39 -0
  43. package/dist/style.css +1 -1
  44. package/package.json +15 -7
@@ -1,5 +1,5 @@
1
1
  import { SortedResult } from 'fumadocs-core/search/shared';
2
- import { ReactNode } from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
3
 
4
4
  type SearchLink = [name: string, href: string];
5
5
  interface SharedProps {
@@ -10,15 +10,26 @@ interface SharedProps {
10
10
  */
11
11
  links?: SearchLink[];
12
12
  }
13
- interface SearchDialogProps extends SharedProps, Omit<SearchContentProps, 'defaultItems'> {
13
+ interface SearchDialogProps extends SharedProps, Omit<SearchContentProps, 'items'> {
14
+ results: SortedResult[] | 'empty';
14
15
  footer?: ReactNode;
15
16
  }
16
17
  interface SearchContentProps {
17
18
  search: string;
18
19
  onSearchChange: (v: string) => void;
19
- results: SortedResult[] | 'empty';
20
- defaultItems?: SortedResult[];
20
+ items: SortedResult[];
21
+ hideResults?: boolean;
21
22
  }
22
23
  declare function SearchDialog({ open, onOpenChange, footer, links, ...props }: SearchDialogProps): React.ReactElement;
24
+ interface TagItem {
25
+ name: string;
26
+ value: string;
27
+ }
28
+ interface TagsListProps extends HTMLAttributes<HTMLDivElement> {
29
+ tag?: string;
30
+ onTagChange: (tag: string) => void;
31
+ items: TagItem[];
32
+ }
33
+ declare function TagsList({ tag, onTagChange, items, ...props }: TagsListProps): ReactNode;
23
34
 
24
- export { SearchDialog, type SearchLink, type SharedProps };
35
+ export { SearchDialog, type SearchLink, type SharedProps, type TagItem, TagsList, type TagsListProps };
@@ -1,12 +1,15 @@
1
1
  import {
2
- SearchDialog
3
- } from "../../chunk-BZ53GHJX.js";
4
- import "../../chunk-3F57TIUQ.js";
2
+ SearchDialog,
3
+ TagsList
4
+ } from "../../chunk-INUQLSIT.js";
5
5
  import "../../chunk-ET4TW6M5.js";
6
+ import "../../chunk-YXSAWF3G.js";
6
7
  import "../../chunk-HLGNIWUN.js";
7
- import "../../chunk-VUIQ7ZYI.js";
8
+ import "../../chunk-V7IGWU5C.js";
9
+ import "../../chunk-YSCK5YFO.js";
8
10
  import "../../chunk-TK3TM3MR.js";
9
11
  import "../../chunk-MLKGABMK.js";
10
12
  export {
11
- SearchDialog
13
+ SearchDialog,
14
+ TagsList
12
15
  };
@@ -7,6 +7,7 @@ interface FileProps extends HTMLAttributes<HTMLDivElement> {
7
7
  }
8
8
  interface FolderProps extends HTMLAttributes<HTMLDivElement> {
9
9
  name: string;
10
+ disabled?: boolean;
10
11
  /**
11
12
  * Open folder by default
12
13
  *
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../chunk-HLGNIWUN.js";
10
10
  import {
11
11
  buttonVariants
12
- } from "../../chunk-VUIQ7ZYI.js";
12
+ } from "../../chunk-YSCK5YFO.js";
13
13
  import {
14
14
  twMerge
15
15
  } from "../../chunk-TK3TM3MR.js";
@@ -7,6 +7,10 @@ import {
7
7
  import {
8
8
  isActive
9
9
  } from "../../chunk-IIDV3RNQ.js";
10
+ import {
11
+ useSidebar
12
+ } from "../../chunk-YXSAWF3G.js";
13
+ import "../../chunk-V7IGWU5C.js";
10
14
  import {
11
15
  twMerge
12
16
  } from "../../chunk-TK3TM3MR.js";
@@ -14,7 +18,7 @@ import "../../chunk-MLKGABMK.js";
14
18
 
15
19
  // src/components/layout/root-toggle.tsx
16
20
  import { ChevronDown } from "lucide-react";
17
- import { useState } from "react";
21
+ import { useCallback, useState } from "react";
18
22
  import Link from "next/link";
19
23
  import { usePathname } from "next/navigation";
20
24
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -22,8 +26,13 @@ function RootToggle({
22
26
  options
23
27
  }) {
24
28
  const [open, setOpen] = useState(false);
29
+ const { closeOnRedirect } = useSidebar();
25
30
  const pathname = usePathname();
26
31
  const selected = options.find((item) => isActive(item.url, pathname, true)) ?? options[0];
32
+ const onClick = useCallback(() => {
33
+ closeOnRedirect.current = false;
34
+ setOpen(false);
35
+ }, [closeOnRedirect]);
27
36
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
28
37
  /* @__PURE__ */ jsxs(PopoverTrigger, { className: "-mx-2 flex flex-row items-center gap-2.5 rounded-lg p-2 hover:bg-muted", children: [
29
38
  /* @__PURE__ */ jsx(Item, { ...selected }),
@@ -33,9 +42,7 @@ function RootToggle({
33
42
  Link,
34
43
  {
35
44
  href: item.url,
36
- onClick: () => {
37
- setOpen(false);
38
- },
45
+ onClick,
39
46
  className: twMerge(
40
47
  "flex w-full flex-row gap-2 p-2",
41
48
  selected === item ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"
@@ -5,7 +5,7 @@ import {
5
5
  import "../chunk-IIDV3RNQ.js";
6
6
  import {
7
7
  buttonVariants
8
- } from "../chunk-VUIQ7ZYI.js";
8
+ } from "../chunk-YSCK5YFO.js";
9
9
  import {
10
10
  twMerge
11
11
  } from "../chunk-TK3TM3MR.js";
@@ -1,7 +1,6 @@
1
1
  import * as TabsPrimitive from '@radix-ui/react-tabs';
2
- import { TabsContentProps } from '@radix-ui/react-tabs';
2
+ import { TabsProps as TabsProps$1, TabsContentProps } from '@radix-ui/react-tabs';
3
3
  import * as React$1 from 'react';
4
- import { ReactNode } from 'react';
5
4
 
6
5
  declare const Tabs$1: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
7
6
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
@@ -15,7 +14,7 @@ declare namespace tabs {
15
14
  export { Tabs$1 as Tabs, tabs_TabsContent as TabsContent, tabs_TabsList as TabsList, tabs_TabsTrigger as TabsTrigger };
16
15
  }
17
16
 
18
- interface TabsProps {
17
+ interface TabsProps extends TabsProps$1 {
19
18
  /**
20
19
  * Identifier for Sharing value of tabs
21
20
  */
@@ -29,9 +28,8 @@ interface TabsProps {
29
28
  */
30
29
  defaultIndex?: number;
31
30
  items?: string[];
32
- children: ReactNode;
33
31
  }
34
- declare function Tabs({ id, items, persist, defaultIndex, children, }: TabsProps): React.ReactElement;
32
+ declare function Tabs({ id, items, persist, defaultIndex, ...props }: TabsProps): React.ReactElement;
35
33
  declare function Tab({ value, className, ...props }: TabsContentProps): React.ReactElement;
36
34
 
37
35
  export { tabs as Primitive, Tab, Tabs, type TabsProps };
@@ -3,7 +3,7 @@ import {
3
3
  Tab,
4
4
  Tabs,
5
5
  tabs_exports
6
- } from "../chunk-NUPTR2L5.js";
6
+ } from "../chunk-QZBW7643.js";
7
7
  import "../chunk-TK3TM3MR.js";
8
8
  import "../chunk-MLKGABMK.js";
9
9
  export {
@@ -1,13 +1,12 @@
1
- import { S as SidebarProps, a as SharedNavProps } from './layout-ZAteQVYk.js';
2
- export { L as LinksMenu, b as Sidebar } from './layout-ZAteQVYk.js';
1
+ import { S as SharedNavProps } from './layout.shared-GQuo9xqE.js';
2
+ export { a as LinksMenu } from './layout.shared-GQuo9xqE.js';
3
+ export { a as Sidebar } from './sidebar-C7MbvaPk.js';
3
4
  export { T as TreeContextProvider } from './tree-CrKzI9Nz.js';
4
5
  import { ButtonHTMLAttributes } from 'react';
5
6
  import 'fumadocs-core/server';
6
7
 
7
- declare function DynamicSidebar(props: SidebarProps): React.ReactElement;
8
-
9
8
  declare function ThemeToggle({ className, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): React.ReactElement;
10
9
 
11
10
  declare function SubNav({ title, url, transparentMode, children, enableSearch, }: SharedNavProps): React.ReactElement;
12
11
 
13
- export { DynamicSidebar, SubNav, ThemeToggle };
12
+ export { SubNav, ThemeToggle };
@@ -0,0 +1,83 @@
1
+ "use client";
2
+ import {
3
+ NavBox,
4
+ ThemeToggle,
5
+ Title
6
+ } from "./chunk-ZMEQF77D.js";
7
+ import {
8
+ Sidebar
9
+ } from "./chunk-CIVJB4ZT.js";
10
+ import {
11
+ LinksMenu,
12
+ SearchToggle
13
+ } from "./chunk-AAS47F5B.js";
14
+ import "./chunk-VYTHQTZE.js";
15
+ import "./chunk-GHKJ6EFT.js";
16
+ import {
17
+ TreeContextProvider
18
+ } from "./chunk-R3M2OC5U.js";
19
+ import "./chunk-IIDV3RNQ.js";
20
+ import {
21
+ useSearchContext
22
+ } from "./chunk-ET4TW6M5.js";
23
+ import {
24
+ useSidebar
25
+ } from "./chunk-YXSAWF3G.js";
26
+ import "./chunk-HLGNIWUN.js";
27
+ import "./chunk-V7IGWU5C.js";
28
+ import "./chunk-7XPZOMJ2.js";
29
+ import {
30
+ buttonVariants
31
+ } from "./chunk-YSCK5YFO.js";
32
+ import {
33
+ twMerge
34
+ } from "./chunk-TK3TM3MR.js";
35
+ import "./chunk-MLKGABMK.js";
36
+
37
+ // src/docs-layout.client.tsx
38
+ import { SidebarTrigger } from "fumadocs-core/sidebar";
39
+ import { Menu, X } from "lucide-react";
40
+ import { jsx, jsxs } from "react/jsx-runtime";
41
+ function SubNav({
42
+ title,
43
+ url,
44
+ transparentMode,
45
+ children,
46
+ enableSearch = true
47
+ }) {
48
+ const { open } = useSidebar();
49
+ const { enabled } = useSearchContext();
50
+ return /* @__PURE__ */ jsxs(
51
+ NavBox,
52
+ {
53
+ id: "nd-subnav",
54
+ className: "flex h-14 flex-row items-center px-4 md:hidden",
55
+ transparentMode,
56
+ children: [
57
+ /* @__PURE__ */ jsx(Title, { url, title }),
58
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-row items-center", children }),
59
+ enabled && enableSearch ? /* @__PURE__ */ jsx(SearchToggle, {}) : null,
60
+ /* @__PURE__ */ jsx(
61
+ SidebarTrigger,
62
+ {
63
+ className: twMerge(
64
+ buttonVariants({
65
+ color: "ghost",
66
+ size: "icon",
67
+ className: "-me-2"
68
+ })
69
+ ),
70
+ children: open ? /* @__PURE__ */ jsx(X, {}) : /* @__PURE__ */ jsx(Menu, {})
71
+ }
72
+ )
73
+ ]
74
+ }
75
+ );
76
+ }
77
+ export {
78
+ LinksMenu,
79
+ Sidebar,
80
+ SubNav,
81
+ ThemeToggle,
82
+ TreeContextProvider
83
+ };
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ import {
3
+ Sidebar
4
+ } from "./chunk-CIVJB4ZT.js";
5
+ import "./chunk-AAS47F5B.js";
6
+ import "./chunk-VYTHQTZE.js";
7
+ import "./chunk-GHKJ6EFT.js";
8
+ import "./chunk-R3M2OC5U.js";
9
+ import "./chunk-IIDV3RNQ.js";
10
+ import "./chunk-ET4TW6M5.js";
11
+ import {
12
+ useSidebar
13
+ } from "./chunk-YXSAWF3G.js";
14
+ import "./chunk-HLGNIWUN.js";
15
+ import "./chunk-V7IGWU5C.js";
16
+ import "./chunk-7XPZOMJ2.js";
17
+ import {
18
+ buttonVariants
19
+ } from "./chunk-YSCK5YFO.js";
20
+ import {
21
+ twMerge
22
+ } from "./chunk-TK3TM3MR.js";
23
+ import "./chunk-MLKGABMK.js";
24
+
25
+ // src/components/layout/dynamic-sidebar.tsx
26
+ import { useCallback, useRef, useState } from "react";
27
+ import { SidebarIcon } from "lucide-react";
28
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
29
+ function DynamicSidebar(props) {
30
+ const { collapsed, setCollapsed } = useSidebar();
31
+ const [hover, setHover] = useState(false);
32
+ const timerRef = useRef(0);
33
+ const closeTimeRef = useRef(0);
34
+ const onCollapse = useCallback(() => {
35
+ setCollapsed((v) => !v);
36
+ setHover(false);
37
+ closeTimeRef.current = Date.now() + 150;
38
+ }, [setCollapsed]);
39
+ const onEnter = useCallback((e) => {
40
+ if (e.pointerType === "touch" || closeTimeRef.current > Date.now()) return;
41
+ window.clearTimeout(timerRef.current);
42
+ setHover(true);
43
+ }, []);
44
+ const onLeave = useCallback((e) => {
45
+ if (e.pointerType === "touch") return;
46
+ window.clearTimeout(timerRef.current);
47
+ timerRef.current = window.setTimeout(
48
+ () => {
49
+ setHover(false);
50
+ closeTimeRef.current = Date.now() + 150;
51
+ },
52
+ Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500
53
+ );
54
+ }, []);
55
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
56
+ collapsed ? /* @__PURE__ */ jsx(
57
+ "div",
58
+ {
59
+ className: "fixed inset-y-0 start-0 w-6 max-md:hidden xl:w-[50px]",
60
+ onPointerEnter: onEnter,
61
+ onPointerLeave: onLeave
62
+ }
63
+ ) : null,
64
+ collapsed ? /* @__PURE__ */ jsx(
65
+ "button",
66
+ {
67
+ type: "button",
68
+ "aria-label": "Collapse Sidebar",
69
+ className: twMerge(
70
+ buttonVariants({
71
+ color: "secondary",
72
+ size: "icon",
73
+ className: "fixed start-4 bottom-2 z-10 max-md:hidden"
74
+ })
75
+ ),
76
+ onClick: onCollapse,
77
+ children: /* @__PURE__ */ jsx(SidebarIcon, {})
78
+ }
79
+ ) : null,
80
+ /* @__PURE__ */ jsx(
81
+ Sidebar,
82
+ {
83
+ ...props,
84
+ aside: {
85
+ "data-collapse": collapsed,
86
+ "data-hover": hover,
87
+ onPointerEnter: onEnter,
88
+ onPointerLeave: onLeave,
89
+ "aria-hidden": Boolean(collapsed && !hover),
90
+ className: twMerge(
91
+ "md:transition-[transform,margin]",
92
+ collapsed && [
93
+ "md:top-1 md:mr-[-240px] md:h-[calc(100dvh-4px)] md:animate-sidebar-collapse md:rounded-xl md:border md:shadow-md xl:mr-[-260px]",
94
+ hover ? "md:translate-x-1 rtl:md:-translate-x-1" : "md:-translate-x-full rtl:md:translate-x-full"
95
+ ]
96
+ )
97
+ },
98
+ footer: /* @__PURE__ */ jsxs(Fragment, { children: [
99
+ props.footer,
100
+ /* @__PURE__ */ jsx(
101
+ "button",
102
+ {
103
+ type: "button",
104
+ "aria-label": "Collapse Sidebar",
105
+ className: twMerge(
106
+ buttonVariants({
107
+ color: "ghost",
108
+ size: "icon",
109
+ className: "max-md:hidden"
110
+ })
111
+ ),
112
+ onClick: onCollapse,
113
+ children: /* @__PURE__ */ jsx(SidebarIcon, {})
114
+ }
115
+ )
116
+ ] })
117
+ }
118
+ )
119
+ ] });
120
+ }
121
+ export {
122
+ DynamicSidebar
123
+ };
@@ -1,5 +1,4 @@
1
- import { a as SharedNavProps, c as LinkItemType } from './layout-ZAteQVYk.js';
2
- import 'fumadocs-core/server';
1
+ import { S as SharedNavProps, L as LinkItemType } from './layout.shared-GQuo9xqE.js';
3
2
  import 'react';
4
3
 
5
4
  declare function Nav({ title, url, items, transparentMode, enableSearch, children, }: SharedNavProps & {
@@ -1,13 +1,15 @@
1
1
  "use client";
2
2
  import {
3
- LargeSearchToggle,
4
- LinkItem,
5
- LinksMenu,
6
3
  NavBox,
7
- SearchToggle,
8
4
  ThemeToggle,
9
5
  Title
10
- } from "./chunk-NZA3MCPM.js";
6
+ } from "./chunk-ZMEQF77D.js";
7
+ import {
8
+ LargeSearchToggle,
9
+ LinkItem,
10
+ LinksMenu,
11
+ SearchToggle
12
+ } from "./chunk-AAS47F5B.js";
11
13
  import "./chunk-GHKJ6EFT.js";
12
14
  import {
13
15
  isSecondary
@@ -18,16 +20,17 @@ import {
18
20
  import {
19
21
  useI18n
20
22
  } from "./chunk-HLGNIWUN.js";
23
+ import "./chunk-V7IGWU5C.js";
21
24
  import "./chunk-7XPZOMJ2.js";
22
25
  import {
23
26
  buttonVariants
24
- } from "./chunk-VUIQ7ZYI.js";
27
+ } from "./chunk-YSCK5YFO.js";
25
28
  import {
26
29
  twMerge
27
30
  } from "./chunk-TK3TM3MR.js";
28
31
  import "./chunk-MLKGABMK.js";
29
32
 
30
- // src/layout.client.tsx
33
+ // src/home-layout.client.tsx
31
34
  import { MoreVertical } from "lucide-react";
32
35
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
33
36
  function Nav({
@@ -0,0 +1,7 @@
1
+ import { B as BaseLayoutProps } from './layout.shared-GQuo9xqE.js';
2
+ import 'react';
3
+
4
+ type HomeLayoutProps = BaseLayoutProps;
5
+ declare function HomeLayout({ nav, links, githubUrl, children, }: BaseLayoutProps): React.ReactElement;
6
+
7
+ export { HomeLayout, type HomeLayoutProps };
@@ -0,0 +1,29 @@
1
+ import { Nav } from "./home-layout.client"
2
+ import {
3
+ getLinks
4
+ } from "./chunk-FMI5QZTV.js";
5
+ import {
6
+ replaceOrDefault
7
+ } from "./chunk-IIDV3RNQ.js";
8
+ import "./chunk-MLKGABMK.js";
9
+
10
+ // src/home-layout.tsx
11
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
+ function HomeLayout({
13
+ nav = {},
14
+ links = [],
15
+ githubUrl,
16
+ children
17
+ }) {
18
+ const finalLinks = getLinks(links, githubUrl);
19
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ replaceOrDefault(
21
+ nav,
22
+ /* @__PURE__ */ jsx(Nav, { items: finalLinks, ...nav, children: nav.children })
23
+ ),
24
+ children
25
+ ] });
26
+ }
27
+ export {
28
+ HomeLayout
29
+ };
package/dist/layout.d.ts CHANGED
@@ -1,3 +1,29 @@
1
- import 'fumadocs-core/server';
2
- import 'react';
3
- export { B as BaseLayoutProps, e as DocsLayout, D as DocsLayoutProps, d as Layout, c as LinkItemType, a as SharedNavProps } from './layout-ZAteQVYk.js';
1
+ import { PageTree } from 'fumadocs-core/server';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { S as SidebarProps } from './sidebar-C7MbvaPk.js';
4
+ import { B as BaseLayoutProps } from './layout.shared-GQuo9xqE.js';
5
+ export { L as LinkItemType } from './layout.shared-GQuo9xqE.js';
6
+
7
+ interface SidebarOptions extends Omit<SidebarProps, 'items'> {
8
+ enabled: boolean;
9
+ component: ReactNode;
10
+ collapsible: boolean;
11
+ }
12
+ interface DocsLayoutProps extends BaseLayoutProps {
13
+ tree: PageTree.Root;
14
+ sidebar?: Partial<SidebarOptions>;
15
+ containerProps?: HTMLAttributes<HTMLDivElement>;
16
+ /**
17
+ * Enable Language Switch
18
+ *
19
+ * @defaultValue false
20
+ */
21
+ i18n?: boolean;
22
+ }
23
+ /**
24
+ * @deprecated Use `HomeLayout` from `fumadocs-ui/home-layout` instead
25
+ */
26
+ declare function Layout({ nav, links, githubUrl, children, }: BaseLayoutProps): React.ReactElement;
27
+ declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, links, containerProps, tree, i18n, children, }: DocsLayoutProps): React.ReactElement;
28
+
29
+ export { BaseLayoutProps, DocsLayout, type DocsLayoutProps, Layout };
package/dist/layout.js CHANGED
@@ -1,21 +1,20 @@
1
- import {
2
- LanguageToggle,
3
- } from "./components/layout/language-toggle"
4
1
  import {
5
2
  TreeContextProvider,
6
- DynamicSidebar,
7
3
  SubNav,
8
4
  LinksMenu,
9
5
  Sidebar,
10
6
  ThemeToggle,
11
- } from "./docs.client"
12
- import { Nav } from "./layout.client"
7
+ } from "./docs-layout.client"
8
+ import { Nav } from "./home-layout.client"
9
+ import {
10
+ getLinks
11
+ } from "./chunk-FMI5QZTV.js";
13
12
  import {
14
13
  replaceOrDefault
15
14
  } from "./chunk-IIDV3RNQ.js";
16
15
  import {
17
16
  buttonVariants
18
- } from "./chunk-VUIQ7ZYI.js";
17
+ } from "./chunk-YSCK5YFO.js";
19
18
  import {
20
19
  twMerge
21
20
  } from "./chunk-TK3TM3MR.js";
@@ -24,7 +23,18 @@ import "./chunk-MLKGABMK.js";
24
23
  // src/layout.tsx
25
24
  import Link from "next/link";
26
25
  import { MoreHorizontal } from "lucide-react";
26
+ import dynamic from "next/dynamic";
27
27
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
28
+ var LanguageToggle = dynamic(
29
+ () => import("./components/layout/language-toggle.js").then(
30
+ (mod) => mod.LanguageToggle
31
+ )
32
+ );
33
+ var DynamicSidebar = dynamic(
34
+ () => import("./dynamic-sidebar-DCHFPBYF.js").then(
35
+ (mod) => mod.DynamicSidebar
36
+ )
37
+ );
28
38
  function Layout({
29
39
  nav = {},
30
40
  links = [],
@@ -120,21 +130,6 @@ function DocsLayout({
120
130
  )
121
131
  ] });
122
132
  }
123
- function getLinks(links, githubUrl) {
124
- let result = links ?? [];
125
- if (githubUrl)
126
- result = [
127
- ...result,
128
- {
129
- type: "secondary",
130
- url: githubUrl,
131
- text: "Github",
132
- icon: /* @__PURE__ */ jsx("svg", { role: "img", viewBox: "0 0 24 24", fill: "currentColor", 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" }) }),
133
- external: true
134
- }
135
- ];
136
- return result;
137
- }
138
133
  export {
139
134
  DocsLayout,
140
135
  Layout