fumadocs-ui 13.0.7 → 13.2.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 (34) hide show
  1. package/dist/{chunk-B63IB7CZ.js → chunk-774JT2B6.js} +2 -2
  2. package/dist/{chunk-U7FLICJE.js → chunk-DDNASC3E.js} +1 -1
  3. package/dist/{chunk-IMIWZAMU.js → chunk-EDNTYBXS.js} +1 -1
  4. package/dist/{chunk-OPVR6PIY.js → chunk-ERUVE5R6.js} +1 -1
  5. package/dist/{chunk-E2FDBE7T.js → chunk-NWEH4N3J.js} +26 -24
  6. package/dist/{chunk-J6TIWNTK.js → chunk-ZK6DLQN7.js} +10 -9
  7. package/dist/components/accordion.js +1 -1
  8. package/dist/components/api.client.d.ts +5 -0
  9. package/dist/components/api.client.js +8 -0
  10. package/dist/components/api.d.ts +4 -3
  11. package/dist/components/api.js +5 -5
  12. package/dist/components/banner.js +1 -1
  13. package/dist/components/codeblock.js +2 -2
  14. package/dist/components/dialog/search-algolia.js +5 -5
  15. package/dist/components/dialog/search-default.js +5 -5
  16. package/dist/components/dialog/search.js +2 -2
  17. package/dist/components/heading.js +1 -1
  18. package/dist/components/layout/language-toggle.js +1 -1
  19. package/dist/docs-layout.client.d.ts +1 -1
  20. package/dist/docs-layout.client.js +3 -3
  21. package/dist/{dynamic-sidebar-N5DEONM3.js → dynamic-sidebar-UAMDQRIN.js} +6 -6
  22. package/dist/home-layout.client.js +2 -2
  23. package/dist/layout.d.ts +2 -2
  24. package/dist/layout.js +45 -38
  25. package/dist/mdx.client.js +2 -2
  26. package/dist/mdx.js +1 -1
  27. package/dist/page.client.js +4 -4
  28. package/dist/page.d.ts +1 -1
  29. package/dist/page.js +30 -29
  30. package/dist/{sidebar-CKjkPpjB.d.ts → sidebar-BguPKq_K.d.ts} +7 -1
  31. package/dist/style.css +1 -1
  32. package/dist/tailwind-plugin.d.ts +7 -0
  33. package/dist/tailwind-plugin.js +96 -6
  34. package/package.json +2 -2
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-2KMKNVSN.js";
9
9
  import {
10
10
  buttonVariants
11
- } from "./chunk-IMIWZAMU.js";
11
+ } from "./chunk-EDNTYBXS.js";
12
12
  import {
13
13
  twMerge
14
14
  } from "./chunk-TK3TM3MR.js";
@@ -23,7 +23,7 @@ import {
23
23
  import { jsx, jsxs } from "react/jsx-runtime";
24
24
  var Pre = forwardRef(
25
25
  ({ className, ...props }, ref) => {
26
- return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("p-4", className), ...props, children: props.children });
26
+ return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("max-h-[400px] p-4", className), ...props, children: props.children });
27
27
  }
28
28
  );
29
29
  Pre.displayName = "Pre";
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  buttonVariants,
22
22
  itemVariants
23
- } from "./chunk-IMIWZAMU.js";
23
+ } from "./chunk-EDNTYBXS.js";
24
24
  import {
25
25
  twMerge
26
26
  } from "./chunk-TK3TM3MR.js";
@@ -17,7 +17,7 @@ var buttonVariants = cva(
17
17
  }
18
18
  );
19
19
  var itemVariants = cva(
20
- "flex w-full flex-row items-center gap-2 rounded-md px-2 py-1.5 text-fd-muted-foreground transition-colors duration-100 [&_svg]:size-4",
20
+ "flex w-full flex-row items-center gap-2 rounded-md px-2 py-1.5 text-fd-muted-foreground transition-colors duration-100 [overflow-wrap:anywhere] [&_svg]:size-4",
21
21
  {
22
22
  variants: {
23
23
  active: {
@@ -15,7 +15,7 @@ function Heading({
15
15
  return /* @__PURE__ */ jsxs(
16
16
  As,
17
17
  {
18
- className: twMerge("flex scroll-m-20 flex-row items-center gap-2", className),
18
+ className: twMerge("flex scroll-m-28 flex-row items-center gap-2", className),
19
19
  ...props,
20
20
  children: [
21
21
  /* @__PURE__ */ jsx("a", { href: `#${props.id}`, className: "peer", children: props.children }),
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-HLGNIWUN.js";
10
10
  import {
11
11
  buttonVariants
12
- } from "./chunk-IMIWZAMU.js";
12
+ } from "./chunk-EDNTYBXS.js";
13
13
  import {
14
14
  twMerge
15
15
  } from "./chunk-TK3TM3MR.js";
@@ -120,21 +120,20 @@ var CommandItem = React.forwardRef(({ className, icon, nested = false, children,
120
120
  }
121
121
  ));
122
122
  CommandItem.displayName = CommandPrimitive.Item.displayName;
123
- var CommandDialog = React.forwardRef(({ footer, children, ...props }, ref) => /* @__PURE__ */ jsxs(
124
- CommandPrimitive.Dialog,
125
- {
126
- ref,
127
- shouldFilter: false,
128
- loop: true,
129
- contentClassName: "fixed left-1/2 top-[10vh] z-50 w-[98vw] max-w-screen-sm origin-left -translate-x-1/2 rounded-lg border bg-fd-popover text-fd-popover-foreground shadow-lg data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in",
130
- overlayClassName: "fixed inset-0 z-50 bg-fd-background/50 backdrop-blur-sm data-[state=closed]:animate-fd-fade-out data-[state=open]:animate-fd-fade-in",
131
- ...props,
132
- children: [
133
- children,
134
- footer ? /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-col border-t p-3", children: footer }) : null
135
- ]
136
- }
137
- ));
123
+ var CommandDialog = React.forwardRef(
124
+ ({ children, ...props }, ref) => /* @__PURE__ */ jsx(
125
+ CommandPrimitive.Dialog,
126
+ {
127
+ ref,
128
+ shouldFilter: false,
129
+ loop: true,
130
+ contentClassName: "fixed left-1/2 top-[10vh] z-50 w-[98vw] max-w-screen-sm origin-left -translate-x-1/2 rounded-lg border bg-fd-popover text-fd-popover-foreground shadow-lg data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in",
131
+ overlayClassName: "fixed inset-0 z-50 bg-fd-background/50 backdrop-blur-sm data-[state=closed]:animate-fd-fade-out data-[state=open]:animate-fd-fade-in",
132
+ ...props,
133
+ children
134
+ }
135
+ )
136
+ );
138
137
  CommandDialog.displayName = CommandPrimitive.Dialog.displayName;
139
138
 
140
139
  // src/components/dialog/search.tsx
@@ -155,14 +154,17 @@ function SearchDialog({
155
154
  })),
156
155
  [links]
157
156
  );
158
- return /* @__PURE__ */ jsx2(CommandDialog, { open, onOpenChange, footer, children: /* @__PURE__ */ jsx2(
159
- Search2,
160
- {
161
- ...props,
162
- items: props.results === "empty" ? defaultItems : props.results,
163
- hideResults: props.results === "empty" && defaultItems.length === 0
164
- }
165
- ) });
157
+ return /* @__PURE__ */ jsxs2(CommandDialog, { open, onOpenChange, children: [
158
+ /* @__PURE__ */ jsx2(
159
+ Search2,
160
+ {
161
+ ...props,
162
+ items: props.results === "empty" ? defaultItems : props.results,
163
+ hideResults: props.results === "empty" && defaultItems.length === 0
164
+ }
165
+ ),
166
+ footer ? /* @__PURE__ */ jsx2("div", { className: "mt-auto flex flex-col border-t p-3", children: footer }) : null
167
+ ] });
166
168
  }
167
169
  var icons = {
168
170
  text: /* @__PURE__ */ jsx2(Text, {}),
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LargeSearchToggle,
3
3
  LinkItem
4
- } from "./chunk-U7FLICJE.js";
4
+ } from "./chunk-DDNASC3E.js";
5
5
  import {
6
6
  useTreeContext
7
7
  } from "./chunk-34Z7WODD.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-TQJ6YPJ3.js";
24
24
  import {
25
25
  itemVariants
26
- } from "./chunk-IMIWZAMU.js";
26
+ } from "./chunk-EDNTYBXS.js";
27
27
  import {
28
28
  twMerge
29
29
  } from "./chunk-TK3TM3MR.js";
@@ -48,18 +48,19 @@ var defaultComponents = {
48
48
  Item: PageNode
49
49
  };
50
50
  var Context = createContext({
51
- defaultOpenLevel: 1,
51
+ defaultOpenLevel: 0,
52
52
  components: defaultComponents,
53
53
  prefetch: true
54
54
  });
55
55
  function Sidebar({
56
56
  components,
57
- defaultOpenLevel = 1,
57
+ defaultOpenLevel = 0,
58
58
  items,
59
59
  prefetch = true,
60
60
  ...props
61
61
  }) {
62
62
  const search = useSearchContext();
63
+ const hasSearch = search.enabled && !props.hideSearch;
63
64
  const context = useMemo(
64
65
  () => ({
65
66
  defaultOpenLevel,
@@ -75,12 +76,12 @@ function Sidebar({
75
76
  blockScrollingWidth: 768,
76
77
  ...props.aside,
77
78
  className: twMerge(
78
- "fixed z-30 flex shrink-0 flex-col bg-fd-card text-sm md:sticky md:top-0 md:h-dvh md:w-[240px] md:border-e xl:w-[260px]",
79
+ "fixed z-30 flex flex-col bg-fd-card text-sm md:sticky md:top-0 md:h-dvh md:w-[var(--fd-c-sidebar)] md:min-w-[var(--fd-sidebar-width)] md:border-e md:ps-[calc(var(--fd-c-sidebar)-var(--fd-sidebar-width))]",
79
80
  "max-md:inset-0 max-md:bg-fd-background/80 max-md:pt-14 max-md:text-[15px] max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
80
81
  props.aside?.className
81
82
  ),
82
83
  children: [
83
- /* @__PURE__ */ jsxs(
84
+ hasSearch || props.banner ? /* @__PURE__ */ jsxs(
84
85
  "div",
85
86
  {
86
87
  ...props.bannerProps,
@@ -90,17 +91,17 @@ function Sidebar({
90
91
  ),
91
92
  children: [
92
93
  props.banner,
93
- search.enabled ? /* @__PURE__ */ jsx(LargeSearchToggle, { className: "rounded-lg max-md:hidden" }) : null
94
+ hasSearch ? /* @__PURE__ */ jsx(LargeSearchToggle, { className: "rounded-lg max-md:hidden" }) : null
94
95
  ]
95
96
  }
96
- ),
97
+ ) : null,
97
98
  /* @__PURE__ */ jsx(ViewportContent, { children: items.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col md:hidden", children: items.map((item, i) => /* @__PURE__ */ jsx(LinkItem, { item, on: "menu" }, i)) }) }),
98
99
  /* @__PURE__ */ jsx(
99
100
  "div",
100
101
  {
101
102
  ...props.footerProps,
102
103
  className: twMerge(
103
- "flex flex-row items-center border-t px-4 pb-2 pt-1 md:px-3",
104
+ "flex flex-row items-center border-t pb-2 pt-1 max-md:px-4 md:mx-3",
104
105
  props.footerProps?.className
105
106
  ),
106
107
  children: props.footer
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-2KMKNVSN.js";
5
5
  import {
6
6
  buttonVariants
7
- } from "../chunk-IMIWZAMU.js";
7
+ } from "../chunk-EDNTYBXS.js";
8
8
  import {
9
9
  twMerge
10
10
  } from "../chunk-TK3TM3MR.js";
@@ -0,0 +1,5 @@
1
+ import { MouseEventHandler } from 'react';
2
+
3
+ declare function useCopyButton(onCopy: () => void): [checked: boolean, onClick: MouseEventHandler];
4
+
5
+ export { useCopyButton as _useCopyButton };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ useCopyButton
4
+ } from "../chunk-2KMKNVSN.js";
5
+ import "../chunk-MLKGABMK.js";
6
+ export {
7
+ useCopyButton as _useCopyButton
8
+ };
@@ -1,8 +1,7 @@
1
- import { MouseEventHandler } from 'react';
1
+ import { _useCopyButton as useCopyButton$1 } from './api.client.js';
2
2
  export { twMerge as cn } from 'tailwind-merge';
3
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
4
-
5
- declare function useCopyButton(onCopy: () => void): [checked: boolean, onClick: MouseEventHandler];
4
+ import 'react';
6
5
 
7
6
  declare const buttonVariants: (props?: ({
8
7
  color?: "outline" | "ghost" | "secondary" | null | undefined;
@@ -12,4 +11,6 @@ declare const itemVariants: (props?: ({
12
11
  active?: boolean | null | undefined;
13
12
  } & class_variance_authority_types.ClassProp) | undefined) => string;
14
13
 
14
+ declare const useCopyButton: typeof useCopyButton$1;
15
+
15
16
  export { buttonVariants, itemVariants, useCopyButton };
@@ -1,15 +1,15 @@
1
- "use client";
2
- import {
3
- useCopyButton
4
- } from "../chunk-2KMKNVSN.js";
1
+ import { _useCopyButton } from "./api.client"
5
2
  import {
6
3
  buttonVariants,
7
4
  itemVariants
8
- } from "../chunk-IMIWZAMU.js";
5
+ } from "../chunk-EDNTYBXS.js";
9
6
  import {
10
7
  twMerge
11
8
  } from "../chunk-TK3TM3MR.js";
12
9
  import "../chunk-MLKGABMK.js";
10
+
11
+ // src/components/api.tsx
12
+ var useCopyButton = _useCopyButton;
13
13
  export {
14
14
  buttonVariants,
15
15
  twMerge as cn,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  buttonVariants
4
- } from "../chunk-IMIWZAMU.js";
4
+ } from "../chunk-EDNTYBXS.js";
5
5
  import {
6
6
  twMerge
7
7
  } from "../chunk-TK3TM3MR.js";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CodeBlock,
4
4
  Pre
5
- } from "../chunk-B63IB7CZ.js";
5
+ } from "../chunk-774JT2B6.js";
6
6
  import "../chunk-2FLZOPQN.js";
7
7
  import "../chunk-2KMKNVSN.js";
8
- import "../chunk-IMIWZAMU.js";
8
+ import "../chunk-EDNTYBXS.js";
9
9
  import "../chunk-TK3TM3MR.js";
10
10
  import "../chunk-MLKGABMK.js";
11
11
  export {
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  SearchDialog,
4
4
  TagsList
5
- } from "../../chunk-E2FDBE7T.js";
5
+ } from "../../chunk-NWEH4N3J.js";
6
6
  import "../../chunk-ET4TW6M5.js";
7
7
  import "../../chunk-27HFSL7N.js";
8
8
  import "../../chunk-HLGNIWUN.js";
9
- import "../../chunk-IMIWZAMU.js";
9
+ import "../../chunk-EDNTYBXS.js";
10
10
  import "../../chunk-TK3TM3MR.js";
11
11
  import "../../chunk-MLKGABMK.js";
12
12
 
@@ -44,10 +44,10 @@ function AlgoliaSearchDialog({
44
44
  onSearchChange: setSearch,
45
45
  results: query.data ?? [],
46
46
  ...props,
47
- footer: /* @__PURE__ */ jsxs(Fragment, { children: [
48
- tags ? /* @__PURE__ */ jsx(TagsList, { tag, onTagChange: setTag, items: tags, children: showAlgolia ? /* @__PURE__ */ jsx(AlgoliaTitle, {}) : null }) : null,
47
+ footer: tags ? /* @__PURE__ */ jsxs(Fragment, { children: [
48
+ /* @__PURE__ */ jsx(TagsList, { tag, onTagChange: setTag, items: tags, children: showAlgolia ? /* @__PURE__ */ jsx(AlgoliaTitle, {}) : null }),
49
49
  props.footer
50
- ] })
50
+ ] }) : props.footer
51
51
  }
52
52
  );
53
53
  }
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  SearchDialog,
4
4
  TagsList
5
- } from "../../chunk-E2FDBE7T.js";
5
+ } from "../../chunk-NWEH4N3J.js";
6
6
  import "../../chunk-ET4TW6M5.js";
7
7
  import "../../chunk-27HFSL7N.js";
8
8
  import {
9
9
  useI18n
10
10
  } from "../../chunk-HLGNIWUN.js";
11
- import "../../chunk-IMIWZAMU.js";
11
+ import "../../chunk-EDNTYBXS.js";
12
12
  import "../../chunk-TK3TM3MR.js";
13
13
  import "../../chunk-MLKGABMK.js";
14
14
 
@@ -37,10 +37,10 @@ function DefaultSearchDialog({
37
37
  onSearchChange: setSearch,
38
38
  results: query.data ?? [],
39
39
  ...props,
40
- footer: /* @__PURE__ */ jsxs(Fragment, { children: [
41
- tags ? /* @__PURE__ */ jsx(TagsList, { tag, onTagChange: setTag, items: tags }) : null,
40
+ footer: tags ? /* @__PURE__ */ jsxs(Fragment, { children: [
41
+ /* @__PURE__ */ jsx(TagsList, { tag, onTagChange: setTag, items: tags }),
42
42
  props.footer
43
- ] })
43
+ ] }) : props.footer
44
44
  }
45
45
  );
46
46
  }
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  SearchDialog,
3
3
  TagsList
4
- } from "../../chunk-E2FDBE7T.js";
4
+ } from "../../chunk-NWEH4N3J.js";
5
5
  import "../../chunk-ET4TW6M5.js";
6
6
  import "../../chunk-27HFSL7N.js";
7
7
  import "../../chunk-HLGNIWUN.js";
8
- import "../../chunk-IMIWZAMU.js";
8
+ import "../../chunk-EDNTYBXS.js";
9
9
  import "../../chunk-TK3TM3MR.js";
10
10
  import "../../chunk-MLKGABMK.js";
11
11
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Heading
3
- } from "../chunk-OPVR6PIY.js";
3
+ } from "../chunk-ERUVE5R6.js";
4
4
  import "../chunk-TK3TM3MR.js";
5
5
  import "../chunk-MLKGABMK.js";
6
6
  export {
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../chunk-HLGNIWUN.js";
10
10
  import {
11
11
  buttonVariants
12
- } from "../../chunk-IMIWZAMU.js";
12
+ } from "../../chunk-EDNTYBXS.js";
13
13
  import {
14
14
  twMerge
15
15
  } from "../../chunk-TK3TM3MR.js";
@@ -1,6 +1,6 @@
1
1
  import { S as SharedNavProps } from './layout.shared-C5L62VPM.js';
2
2
  export { a as LinksMenu } from './layout.shared-C5L62VPM.js';
3
- export { a as Sidebar } from './sidebar-CKjkPpjB.js';
3
+ export { a as Sidebar } from './sidebar-BguPKq_K.js';
4
4
  export { T as TreeContextProvider } from './tree-CrKzI9Nz.js';
5
5
  import { ButtonHTMLAttributes } from 'react';
6
6
  import 'fumadocs-core/server';
@@ -6,11 +6,11 @@ import {
6
6
  } from "./chunk-KACGIS2N.js";
7
7
  import {
8
8
  Sidebar
9
- } from "./chunk-J6TIWNTK.js";
9
+ } from "./chunk-ZK6DLQN7.js";
10
10
  import {
11
11
  LinksMenu,
12
12
  SearchToggle
13
- } from "./chunk-U7FLICJE.js";
13
+ } from "./chunk-DDNASC3E.js";
14
14
  import {
15
15
  TreeContextProvider
16
16
  } from "./chunk-34Z7WODD.js";
@@ -27,7 +27,7 @@ import "./chunk-HLGNIWUN.js";
27
27
  import "./chunk-TQJ6YPJ3.js";
28
28
  import {
29
29
  buttonVariants
30
- } from "./chunk-IMIWZAMU.js";
30
+ } from "./chunk-EDNTYBXS.js";
31
31
  import {
32
32
  twMerge
33
33
  } from "./chunk-TK3TM3MR.js";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  Sidebar
4
- } from "./chunk-J6TIWNTK.js";
5
- import "./chunk-U7FLICJE.js";
4
+ } from "./chunk-ZK6DLQN7.js";
5
+ import "./chunk-DDNASC3E.js";
6
6
  import "./chunk-34Z7WODD.js";
7
7
  import "./chunk-2FLZOPQN.js";
8
8
  import "./chunk-GLZ6ALZV.js";
@@ -15,7 +15,7 @@ import "./chunk-HLGNIWUN.js";
15
15
  import "./chunk-TQJ6YPJ3.js";
16
16
  import {
17
17
  buttonVariants
18
- } from "./chunk-IMIWZAMU.js";
18
+ } from "./chunk-EDNTYBXS.js";
19
19
  import {
20
20
  twMerge
21
21
  } from "./chunk-TK3TM3MR.js";
@@ -87,10 +87,10 @@ function DynamicSidebar(props) {
87
87
  onPointerLeave: onLeave,
88
88
  "aria-hidden": Boolean(collapsed && !hover),
89
89
  className: twMerge(
90
- "md:transition-[transform,margin]",
90
+ "md:transition-[transform,padding,width,margin]",
91
91
  collapsed && [
92
- "md:top-1 md:mr-[-240px] md:h-[calc(100dvh-4px)] md:animate-fd-sidebar-collapse md:rounded-xl md:border md:shadow-md xl:mr-[-260px]",
93
- hover ? "md:translate-x-1 rtl:md:-translate-x-1" : "md:-translate-x-full rtl:md:translate-x-full"
92
+ "md:top-1 md:me-fd-sidebar-offset md:h-[calc(100dvh-4px)] md:w-[var(--fd-sidebar-width)] md:animate-fd-sidebar-collapse md:rounded-xl md:border md:ps-0 md:shadow-md",
93
+ hover ? "md:translate-x-1 rtl:md:-translate-x-1" : "md:translate-x-[calc(var(--fd-sidebar-width)*-1)] rtl:md:translate-x-[var(--fd-sidebar-width)]"
94
94
  ]
95
95
  )
96
96
  },
@@ -9,7 +9,7 @@ import {
9
9
  LinkItem,
10
10
  LinksMenu,
11
11
  SearchToggle
12
- } from "./chunk-U7FLICJE.js";
12
+ } from "./chunk-DDNASC3E.js";
13
13
  import "./chunk-GLZ6ALZV.js";
14
14
  import "./chunk-AN2Y6MA2.js";
15
15
  import {
@@ -21,7 +21,7 @@ import {
21
21
  import "./chunk-TQJ6YPJ3.js";
22
22
  import {
23
23
  buttonVariants
24
- } from "./chunk-IMIWZAMU.js";
24
+ } from "./chunk-EDNTYBXS.js";
25
25
  import {
26
26
  twMerge
27
27
  } from "./chunk-TK3TM3MR.js";
package/dist/layout.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PageTree } from 'fumadocs-core/server';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
- import { S as SidebarProps } from './sidebar-CKjkPpjB.js';
3
+ import { S as SidebarProps } from './sidebar-BguPKq_K.js';
4
4
  import { B as BaseLayoutProps } from './layout.shared-C5L62VPM.js';
5
5
  export { L as LinkItemType } from './layout.shared-C5L62VPM.js';
6
6
 
@@ -20,6 +20,6 @@ interface DocsLayoutProps extends BaseLayoutProps {
20
20
  */
21
21
  i18n?: boolean;
22
22
  }
23
- declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, links, containerProps, tree, i18n, children, }: DocsLayoutProps): React.ReactElement;
23
+ declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, containerProps, i18n, ...props }: DocsLayoutProps): React.ReactElement;
24
24
 
25
25
  export { DocsLayout, type DocsLayoutProps };
package/dist/layout.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-AN2Y6MA2.js";
14
14
  import {
15
15
  buttonVariants
16
- } from "./chunk-IMIWZAMU.js";
16
+ } from "./chunk-EDNTYBXS.js";
17
17
  import {
18
18
  twMerge
19
19
  } from "./chunk-TK3TM3MR.js";
@@ -30,7 +30,7 @@ var LanguageToggle = dynamic(
30
30
  )
31
31
  );
32
32
  var DynamicSidebar = dynamic(
33
- () => import("./dynamic-sidebar-N5DEONM3.js").then(
33
+ () => import("./dynamic-sidebar-UAMDQRIN.js").then(
34
34
  (mod) => mod.DynamicSidebar
35
35
  )
36
36
  );
@@ -43,15 +43,44 @@ function DocsLayout({
43
43
  component: sidebarReplace,
44
44
  ...sidebar
45
45
  } = {},
46
- links = [],
47
46
  containerProps = {},
48
- tree,
49
47
  i18n = false,
50
- children
48
+ ...props
51
49
  }) {
52
- const finalLinks = getLinks(links, githubUrl);
50
+ const links = getLinks(props.links ?? [], githubUrl);
53
51
  const Aside = collapsible ? DynamicSidebar : Sidebar;
54
- return /* @__PURE__ */ jsxs(TreeContextProvider, { tree, children: [
52
+ const banner = [];
53
+ if (nav?.title)
54
+ banner.push(
55
+ /* @__PURE__ */ jsx(
56
+ Link,
57
+ {
58
+ href: nav.url ?? "/",
59
+ className: "inline-flex items-center gap-2.5 font-medium",
60
+ children: nav.title
61
+ },
62
+ "title"
63
+ )
64
+ );
65
+ if (links.length > 0)
66
+ banner.push(
67
+ /* @__PURE__ */ jsx(
68
+ LinksMenu,
69
+ {
70
+ items: links,
71
+ className: twMerge(
72
+ buttonVariants({
73
+ size: "icon",
74
+ color: "ghost",
75
+ className: "ms-auto"
76
+ })
77
+ ),
78
+ children: /* @__PURE__ */ jsx(MoreHorizontal, {})
79
+ },
80
+ "links"
81
+ )
82
+ );
83
+ return /* @__PURE__ */ jsxs(TreeContextProvider, { tree: props.tree, children: [
55
84
  replaceOrDefault(nav, /* @__PURE__ */ jsx(SubNav, { ...nav })),
56
85
  /* @__PURE__ */ jsxs(
57
86
  "main",
@@ -66,49 +95,27 @@ function DocsLayout({
66
95
  Aside,
67
96
  {
68
97
  ...sidebar,
69
- items: finalLinks,
70
- banner: /* @__PURE__ */ jsxs(Fragment, { children: [
71
- /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between border-b pb-2 max-md:hidden", children: [
72
- /* @__PURE__ */ jsx(
73
- Link,
74
- {
75
- href: nav?.url ?? "/",
76
- className: "inline-flex items-center gap-2.5 font-medium",
77
- children: nav?.title
78
- }
79
- ),
80
- finalLinks.length > 0 && /* @__PURE__ */ jsx(
81
- LinksMenu,
82
- {
83
- items: finalLinks,
84
- className: twMerge(
85
- buttonVariants({
86
- size: "icon",
87
- color: "ghost"
88
- })
89
- ),
90
- children: /* @__PURE__ */ jsx(MoreHorizontal, {})
91
- }
92
- )
93
- ] }),
98
+ items: links,
99
+ banner: banner.length > 0 || sidebar.banner ? /* @__PURE__ */ jsxs(Fragment, { children: [
100
+ banner.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center border-b pb-2 max-md:hidden", children: banner }) : null,
94
101
  sidebar.banner
95
- ] }),
102
+ ] }) : null,
96
103
  bannerProps: {
104
+ ...sidebar.bannerProps,
97
105
  className: twMerge(
98
106
  !sidebar.banner && "max-md:hidden",
99
107
  sidebar.bannerProps?.className
100
- ),
101
- ...sidebar.bannerProps
108
+ )
102
109
  },
103
110
  footer: /* @__PURE__ */ jsxs(Fragment, { children: [
104
111
  /* @__PURE__ */ jsx(ThemeToggle, { className: "me-auto" }),
105
- sidebar.footer,
106
- i18n ? /* @__PURE__ */ jsx(LanguageToggle, {}) : null
112
+ i18n ? /* @__PURE__ */ jsx(LanguageToggle, {}) : null,
113
+ sidebar.footer
107
114
  ] })
108
115
  }
109
116
  )
110
117
  ),
111
- children
118
+ props.children
112
119
  ]
113
120
  }
114
121
  )
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CodeBlock,
4
4
  Pre
5
- } from "./chunk-B63IB7CZ.js";
5
+ } from "./chunk-774JT2B6.js";
6
6
  import "./chunk-2FLZOPQN.js";
7
7
  import "./chunk-2KMKNVSN.js";
8
- import "./chunk-IMIWZAMU.js";
8
+ import "./chunk-EDNTYBXS.js";
9
9
  import "./chunk-TK3TM3MR.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
 
package/dist/mdx.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-KWZZNVSY.js";
12
12
  import {
13
13
  Heading
14
- } from "./chunk-OPVR6PIY.js";
14
+ } from "./chunk-ERUVE5R6.js";
15
15
  import "./chunk-TK3TM3MR.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17