fumadocs-ui 12.1.3 → 12.2.1

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-MXPAPA74.js → chunk-3WVIP3N5.js} +1 -1
  2. package/dist/{chunk-H5USAX5W.js → chunk-CPOVVDVF.js} +0 -1
  3. package/dist/{chunk-BHP6OUWK.js → chunk-G7WCPUM7.js} +1 -1
  4. package/dist/{chunk-U4G4ZLRB.js → chunk-Q3FSJZ3E.js} +1 -1
  5. package/dist/{chunk-IOZPSMRL.js → chunk-XVCWFZ3A.js} +3 -3
  6. package/dist/components/accordion.js +2 -2
  7. package/dist/components/api.js +25 -15
  8. package/dist/components/banner.d.ts +5 -0
  9. package/dist/components/banner.js +72 -0
  10. package/dist/components/callout.d.ts +1 -1
  11. package/dist/components/codeblock.js +2 -2
  12. package/dist/components/dialog/search-algolia.js +2 -2
  13. package/dist/components/dialog/search-default.js +2 -2
  14. package/dist/components/dialog/search.js +2 -2
  15. package/dist/components/layout/language-toggle.js +1 -1
  16. package/dist/components/layout/root-toggle.js +1 -1
  17. package/dist/components/roll-button.js +4 -4
  18. package/dist/docs.client.d.ts +2 -2
  19. package/dist/docs.client.js +26 -19
  20. package/dist/{layout-DAwDgfTa.d.ts → layout-C2Cxe6NB.d.ts} +5 -1
  21. package/dist/layout.client.d.ts +1 -1
  22. package/dist/layout.client.js +4 -4
  23. package/dist/layout.d.ts +1 -1
  24. package/dist/layout.js +4 -3
  25. package/dist/mdx.client.js +2 -2
  26. package/dist/page.client.d.ts +2 -2
  27. package/dist/page.client.js +62 -66
  28. package/dist/page.d.ts +1 -1
  29. package/dist/page.js +32 -19
  30. package/dist/style.css +1 -1
  31. package/dist/tailwind-plugin.cjs +10 -12
  32. package/dist/tailwind-plugin.js +10 -12
  33. package/dist/twoslash.css +1 -1
  34. package/package.json +2 -2
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2KMKNVSN.js";
4
4
  import {
5
5
  buttonVariants
6
- } from "./chunk-H5USAX5W.js";
6
+ } from "./chunk-CPOVVDVF.js";
7
7
  import {
8
8
  twMerge
9
9
  } from "./chunk-TK3TM3MR.js";
@@ -10,7 +10,6 @@ var buttonVariants = cva(
10
10
  secondary: "border bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground"
11
11
  },
12
12
  size: {
13
- lg: "px-4 py-2 text-[15px]",
14
13
  icon: "p-1.5 [&_svg]:size-5"
15
14
  }
16
15
  }
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-HLGNIWUN.js";
10
10
  import {
11
11
  buttonVariants
12
- } from "./chunk-H5USAX5W.js";
12
+ } from "./chunk-CPOVVDVF.js";
13
13
  import {
14
14
  twMerge
15
15
  } from "./chunk-TK3TM3MR.js";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-2KMKNVSN.js";
9
9
  import {
10
10
  buttonVariants
11
- } from "./chunk-H5USAX5W.js";
11
+ } from "./chunk-CPOVVDVF.js";
12
12
  import {
13
13
  twMerge
14
14
  } from "./chunk-TK3TM3MR.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-7XPZOMJ2.js";
20
20
  import {
21
21
  buttonVariants
22
- } from "./chunk-H5USAX5W.js";
22
+ } from "./chunk-CPOVVDVF.js";
23
23
  import {
24
24
  twMerge
25
25
  } from "./chunk-TK3TM3MR.js";
@@ -101,8 +101,8 @@ function NavBox({
101
101
  {
102
102
  ...props,
103
103
  className: twMerge(
104
- "sticky top-0 z-50 h-16 border-b transition-colors",
105
- transparent ? "border-transparent" : "border-foreground/10 bg-background/80 backdrop-blur-md",
104
+ "sticky top-0 z-50 border-b transition-colors",
105
+ transparent ? "border-transparent" : "border-foreground/10 bg-background/60 backdrop-blur-md",
106
106
  props.className
107
107
  )
108
108
  }
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  Accordion,
4
4
  Accordions
5
- } from "../chunk-MXPAPA74.js";
5
+ } from "../chunk-3WVIP3N5.js";
6
6
  import "../chunk-2KMKNVSN.js";
7
- import "../chunk-H5USAX5W.js";
7
+ import "../chunk-CPOVVDVF.js";
8
8
  import "../chunk-TK3TM3MR.js";
9
9
  import "../chunk-MLKGABMK.js";
10
10
  export {
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import {
3
- Tab,
4
- Tabs
5
- } from "../chunk-NUPTR2L5.js";
6
2
  import {
7
3
  Accordion,
8
4
  Accordions
9
- } from "../chunk-MXPAPA74.js";
5
+ } from "../chunk-3WVIP3N5.js";
10
6
  import "../chunk-2KMKNVSN.js";
11
- import "../chunk-H5USAX5W.js";
7
+ import {
8
+ Tab,
9
+ Tabs
10
+ } from "../chunk-NUPTR2L5.js";
11
+ import "../chunk-CPOVVDVF.js";
12
12
  import {
13
13
  twMerge
14
14
  } from "../chunk-TK3TM3MR.js";
@@ -25,7 +25,10 @@ function Root({
25
25
  return /* @__PURE__ */ jsx(
26
26
  "div",
27
27
  {
28
- className: twMerge("space-y-24 text-sm text-muted-foreground", className),
28
+ className: twMerge(
29
+ "flex flex-col gap-24 text-sm text-muted-foreground",
30
+ className
31
+ ),
29
32
  ...props,
30
33
  children
31
34
  }
@@ -39,7 +42,10 @@ function API({
39
42
  return /* @__PURE__ */ jsx(
40
43
  "div",
41
44
  {
42
- className: twMerge("flex flex-col gap-x-6 gap-y-2 xl:flex-row", className),
45
+ className: twMerge(
46
+ "flex flex-col gap-x-6 gap-y-2 xl:flex-row xl:items-start",
47
+ className
48
+ ),
43
49
  ...props,
44
50
  children
45
51
  }
@@ -50,7 +56,9 @@ var badgeVariants = cva("rounded-lg border px-1 py-0.5 text-xs font-medium", {
50
56
  color: {
51
57
  green: "border-green-400/50 bg-green-400/20 text-green-600 dark:text-green-400",
52
58
  yellow: "border-yellow-400/50 bg-yellow-400/20 text-yellow-600 dark:text-yellow-400",
53
- red: "border-red-400/50 bg-red-400/20 text-red-600 dark:text-red-400"
59
+ red: "border-red-400/50 bg-red-400/20 text-red-600 dark:text-red-400",
60
+ blue: "border-blue-400/50 bg-blue-400/20 text-blue-600 dark:text-blue-400",
61
+ orange: "border-orange-400/50 bg-orange-400/20 text-orange-600 dark:text-orange-400"
54
62
  }
55
63
  }
56
64
  });
@@ -63,12 +71,14 @@ function APIInfo({
63
71
  }) {
64
72
  let color = "green";
65
73
  if (["GET", "HEAD"].includes(method)) color = "green";
66
- if (["POST", "PATCH", "PUT"].includes(method)) color = "yellow";
74
+ if (["PUT"].includes(method)) color = "yellow";
75
+ if (["PATCH"].includes(method)) color = "orange";
76
+ if (["POST"].includes(method)) color = "blue";
67
77
  if (["DELETE"].includes(method)) color = "red";
68
- return /* @__PURE__ */ jsxs("div", { className: twMerge("flex-1", className), ...props, children: [
69
- /* @__PURE__ */ jsxs("h2", { className: "not-prose mb-2 inline-flex items-center gap-3 font-mono", children: [
70
- /* @__PURE__ */ jsx("div", { className: twMerge(badgeVariants({ color })), children: method }),
71
- /* @__PURE__ */ jsx("p", { className: "text-xs", children: route })
78
+ return /* @__PURE__ */ jsxs("div", { className: twMerge("flex-1 prose-no-margin", className), ...props, children: [
79
+ /* @__PURE__ */ jsxs("h2", { className: "flex flex-row items-center gap-3 rounded-lg border bg-card p-3 text-base", children: [
80
+ /* @__PURE__ */ jsx("span", { className: twMerge(badgeVariants({ color })), children: method }),
81
+ /* @__PURE__ */ jsx("code", { children: route })
72
82
  ] }),
73
83
  children
74
84
  ] });
@@ -98,7 +108,7 @@ function APIExample({
98
108
  return /* @__PURE__ */ jsx(
99
109
  "div",
100
110
  {
101
- className: twMerge("sticky top-6 h-fit xl:w-2/5 xl:min-w-[400px]", className),
111
+ className: twMerge("sticky top-6 prose-no-margin xl:w-[400px]", className),
102
112
  ...props,
103
113
  children
104
114
  }
@@ -0,0 +1,5 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ declare function Banner({ id, ...props }: HTMLAttributes<HTMLDivElement>): React.ReactElement;
4
+
5
+ export { Banner };
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import {
3
+ buttonVariants
4
+ } from "../chunk-CPOVVDVF.js";
5
+ import {
6
+ twMerge
7
+ } from "../chunk-TK3TM3MR.js";
8
+ import "../chunk-MLKGABMK.js";
9
+
10
+ // src/components/banner.tsx
11
+ import { useCallback, useEffect, useState } from "react";
12
+ import { X } from "lucide-react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ function Banner({
15
+ id,
16
+ ...props
17
+ }) {
18
+ const [open, setOpen] = useState(true);
19
+ useEffect(() => {
20
+ if (id) setOpen(localStorage.getItem(`nd-banner-${id}`) !== "true");
21
+ }, [id]);
22
+ const onClick = useCallback(() => {
23
+ setOpen(false);
24
+ if (id) localStorage.setItem(`nd-banner-${id}`, "true");
25
+ }, [id]);
26
+ return /* @__PURE__ */ jsxs(
27
+ "div",
28
+ {
29
+ id,
30
+ ...props,
31
+ className: twMerge(
32
+ "relative flex h-12 flex-row items-center justify-center bg-secondary px-4 text-center text-sm font-medium",
33
+ !open && "hidden",
34
+ props.className
35
+ ),
36
+ suppressHydrationWarning: true,
37
+ children: [
38
+ id ? /* @__PURE__ */ jsx(
39
+ "script",
40
+ {
41
+ dangerouslySetInnerHTML: {
42
+ __html: `const ndBannerItem = localStorage.getItem('nd-banner-${id}');
43
+ if (ndBannerItem === 'true') {
44
+ document.getElementById('${id}').style.display = 'none';
45
+ }`
46
+ }
47
+ }
48
+ ) : null,
49
+ props.children,
50
+ id ? /* @__PURE__ */ jsx(
51
+ "button",
52
+ {
53
+ type: "button",
54
+ "aria-label": "Close Banner",
55
+ onClick,
56
+ className: twMerge(
57
+ buttonVariants({
58
+ color: "ghost",
59
+ className: "absolute end-2 top-3 text-muted-foreground",
60
+ size: "icon"
61
+ })
62
+ ),
63
+ children: /* @__PURE__ */ jsx(X, {})
64
+ }
65
+ ) : null
66
+ ]
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ Banner
72
+ };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
3
 
4
- declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
4
+ declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
5
5
  title?: ReactNode;
6
6
  /**
7
7
  * @defaultValue info
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CodeBlock,
4
4
  Pre
5
- } from "../chunk-U4G4ZLRB.js";
5
+ } from "../chunk-Q3FSJZ3E.js";
6
6
  import "../chunk-VYTHQTZE.js";
7
7
  import "../chunk-2KMKNVSN.js";
8
- import "../chunk-H5USAX5W.js";
8
+ import "../chunk-CPOVVDVF.js";
9
9
  import "../chunk-TK3TM3MR.js";
10
10
  import "../chunk-MLKGABMK.js";
11
11
  export {
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  SearchDialog
4
- } from "../../chunk-BHP6OUWK.js";
4
+ } from "../../chunk-G7WCPUM7.js";
5
5
  import "../../chunk-3F57TIUQ.js";
6
6
  import "../../chunk-ET4TW6M5.js";
7
7
  import "../../chunk-HLGNIWUN.js";
8
- import "../../chunk-H5USAX5W.js";
8
+ import "../../chunk-CPOVVDVF.js";
9
9
  import "../../chunk-TK3TM3MR.js";
10
10
  import "../../chunk-MLKGABMK.js";
11
11
 
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  SearchDialog
4
- } from "../../chunk-BHP6OUWK.js";
4
+ } from "../../chunk-G7WCPUM7.js";
5
5
  import "../../chunk-3F57TIUQ.js";
6
6
  import "../../chunk-ET4TW6M5.js";
7
7
  import {
8
8
  useI18n
9
9
  } from "../../chunk-HLGNIWUN.js";
10
- import "../../chunk-H5USAX5W.js";
10
+ import "../../chunk-CPOVVDVF.js";
11
11
  import "../../chunk-TK3TM3MR.js";
12
12
  import "../../chunk-MLKGABMK.js";
13
13
 
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  SearchDialog
3
- } from "../../chunk-BHP6OUWK.js";
3
+ } from "../../chunk-G7WCPUM7.js";
4
4
  import "../../chunk-3F57TIUQ.js";
5
5
  import "../../chunk-ET4TW6M5.js";
6
6
  import "../../chunk-HLGNIWUN.js";
7
- import "../../chunk-H5USAX5W.js";
7
+ import "../../chunk-CPOVVDVF.js";
8
8
  import "../../chunk-TK3TM3MR.js";
9
9
  import "../../chunk-MLKGABMK.js";
10
10
  export {
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../chunk-HLGNIWUN.js";
10
10
  import {
11
11
  buttonVariants
12
- } from "../../chunk-H5USAX5W.js";
12
+ } from "../../chunk-CPOVVDVF.js";
13
13
  import {
14
14
  twMerge
15
15
  } from "../../chunk-TK3TM3MR.js";
@@ -27,7 +27,7 @@ function RootToggle({
27
27
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
28
28
  /* @__PURE__ */ jsxs(PopoverTrigger, { className: "-mx-2 flex flex-row items-center gap-2.5 rounded-lg p-2 hover:bg-muted", children: [
29
29
  /* @__PURE__ */ jsx(Item, { ...selected }),
30
- /* @__PURE__ */ jsx(ChevronDown, { className: "me-1.5 size-4 text-muted-foreground" })
30
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 text-muted-foreground md:me-1.5" })
31
31
  ] }),
32
32
  /* @__PURE__ */ jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] overflow-hidden p-0", children: options.map((item) => /* @__PURE__ */ jsx(
33
33
  Link,
@@ -5,7 +5,7 @@ import {
5
5
  import "../chunk-AN2Y6MA2.js";
6
6
  import {
7
7
  buttonVariants
8
- } from "../chunk-H5USAX5W.js";
8
+ } from "../chunk-CPOVVDVF.js";
9
9
  import {
10
10
  twMerge
11
11
  } from "../chunk-TK3TM3MR.js";
@@ -30,7 +30,7 @@ function RollButton({
30
30
  const listener = () => {
31
31
  const element = document.scrollingElement;
32
32
  if (!element) return;
33
- const nearTop = element.scrollTop / (element.scrollHeight - element.clientHeight) < percentage;
33
+ const nearTop = element.scrollHeight === element.clientHeight || element.scrollTop / (element.scrollHeight - element.clientHeight) < percentage;
34
34
  setShow(!nearTop);
35
35
  };
36
36
  listener();
@@ -47,9 +47,9 @@ function RollButton({
47
47
  className: twMerge(
48
48
  buttonVariants({
49
49
  color: "secondary",
50
- className: "fixed top-16 [&_svg]:size-4 gap-1 left-1/2 translate-x-[-50%] z-10 shadow-md rounded-full transition-all md:top-4"
50
+ className: "fixed top-[108px] [&_svg]:size-4 gap-1 left-1/2 translate-x-[-50%] z-10 shadow-md rounded-full transition-all md:top-4"
51
51
  }),
52
- !show && "translate-y-20 opacity-0"
52
+ !show && "pointer-events-none translate-y-20 opacity-0"
53
53
  ),
54
54
  onClick: useCallback(() => {
55
55
  document.scrollingElement?.scrollTo({
@@ -1,5 +1,5 @@
1
- import { L as LinkItemType, S as SidebarProps, a as SharedNavProps } from './layout-DAwDgfTa.js';
2
- export { b as Sidebar } from './layout-DAwDgfTa.js';
1
+ import { L as LinkItemType, S as SidebarProps, a as SharedNavProps } from './layout-C2Cxe6NB.js';
2
+ export { b as Sidebar } from './layout-C2Cxe6NB.js';
3
3
  export { T as TreeContextProvider } from './tree-CrKzI9Nz.js';
4
4
  import { ButtonHTMLAttributes } from 'react';
5
5
  import 'fumadocs-core/server';
@@ -7,7 +7,7 @@ import {
7
7
  SearchToggle,
8
8
  ThemeToggle,
9
9
  Title
10
- } from "./chunk-IOZPSMRL.js";
10
+ } from "./chunk-XVCWFZ3A.js";
11
11
  import {
12
12
  ScrollArea,
13
13
  ScrollViewport
@@ -35,7 +35,7 @@ import {
35
35
  } from "./chunk-7XPZOMJ2.js";
36
36
  import {
37
37
  buttonVariants
38
- } from "./chunk-H5USAX5W.js";
38
+ } from "./chunk-CPOVVDVF.js";
39
39
  import {
40
40
  twMerge
41
41
  } from "./chunk-TK3TM3MR.js";
@@ -105,8 +105,8 @@ function Sidebar({
105
105
  blockScrollingWidth: 768,
106
106
  ...aside,
107
107
  className: twMerge(
108
- "z-30 flex w-full flex-col text-[15px] md:sticky md:top-0 md:h-dvh md:w-[240px] md:border-e md:bg-card md:text-sm xl:w-[260px]",
109
- "max-md:fixed max-md:inset-0 max-md:bg-background/80 max-md:pt-16 max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
108
+ "fixed z-30 flex shrink-0 flex-col bg-card text-sm md:sticky md:top-0 md:h-dvh md:w-[240px] md:border-e xl:w-[260px]",
109
+ "max-md:inset-0 max-md:bg-background/80 max-md:pt-12 max-md:text-[15px] max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
110
110
  aside?.className
111
111
  ),
112
112
  children: [
@@ -130,7 +130,7 @@ function Sidebar({
130
130
  {
131
131
  ...footerProps,
132
132
  className: twMerge(
133
- "flex flex-row items-center border-t px-4 py-1 md:px-3",
133
+ "flex flex-row items-center border-t px-4 pb-2 pt-1 md:px-3",
134
134
  footerProps?.className
135
135
  ),
136
136
  children: footer
@@ -269,29 +269,33 @@ function DynamicSidebar(props) {
269
269
  const { collapsed, setCollapsed } = useSidebar();
270
270
  const [hover, setHover] = useState2(false);
271
271
  const timerRef = useRef(0);
272
- const hoverTimeRef = useRef(0);
272
+ const closeTimeRef = useRef(0);
273
273
  const onCollapse = useCallback2(() => {
274
274
  setCollapsed((v) => !v);
275
275
  setHover(false);
276
- hoverTimeRef.current = Date.now() + 500;
276
+ closeTimeRef.current = Date.now() + 150;
277
277
  }, [setCollapsed]);
278
278
  const onEnter = useCallback2((e) => {
279
- if (e.pointerType === "touch" || hoverTimeRef.current > Date.now()) return;
279
+ if (e.pointerType === "touch" || closeTimeRef.current > Date.now()) return;
280
280
  window.clearTimeout(timerRef.current);
281
281
  setHover(true);
282
282
  }, []);
283
283
  const onLeave = useCallback2((e) => {
284
284
  if (e.pointerType === "touch") return;
285
285
  window.clearTimeout(timerRef.current);
286
- timerRef.current = window.setTimeout(() => {
287
- setHover(false);
288
- }, 300);
286
+ timerRef.current = window.setTimeout(
287
+ () => {
288
+ setHover(false);
289
+ closeTimeRef.current = Date.now() + 150;
290
+ },
291
+ Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500
292
+ );
289
293
  }, []);
290
294
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
291
295
  collapsed ? /* @__PURE__ */ jsx2(
292
296
  "div",
293
297
  {
294
- className: "fixed inset-y-0 start-0 w-4 max-md:hidden 2xl:w-[180px]",
298
+ className: "fixed inset-y-0 start-0 w-6 max-md:hidden xl:w-[50px]",
295
299
  onPointerEnter: onEnter,
296
300
  onPointerLeave: onLeave
297
301
  }
@@ -305,7 +309,7 @@ function DynamicSidebar(props) {
305
309
  buttonVariants({
306
310
  color: "secondary",
307
311
  size: "icon",
308
- className: "fixed start-4 bottom-4 z-10 max-md:hidden"
312
+ className: "fixed start-4 bottom-2 z-10 max-md:hidden"
309
313
  })
310
314
  ),
311
315
  onClick: onCollapse,
@@ -323,8 +327,11 @@ function DynamicSidebar(props) {
323
327
  onPointerLeave: onLeave,
324
328
  "aria-hidden": Boolean(collapsed && !hover),
325
329
  className: twMerge(
326
- "overflow-hidden md:transition-transform",
327
- collapsed && "md:fixed md:inset-y-2 md:start-2 md:h-auto md:rounded-xl md:border md:shadow-md"
330
+ "md:transition-[transform,margin]",
331
+ collapsed && [
332
+ "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]",
333
+ hover ? "md:translate-x-1 rtl:md:-translate-x-1" : "md:-translate-x-full rtl:md:translate-x-full"
334
+ ]
328
335
  )
329
336
  },
330
337
  footer: /* @__PURE__ */ jsxs2(Fragment2, { children: [
@@ -366,12 +373,12 @@ function SubNav({
366
373
  NavBox,
367
374
  {
368
375
  id: "nd-subnav",
369
- className: "flex flex-row items-center px-4 md:hidden",
376
+ className: "flex h-16 flex-row items-center px-4 md:hidden",
370
377
  transparentMode,
371
378
  children: [
372
379
  /* @__PURE__ */ jsx3(Title, { url, title }),
373
- children,
374
- enabled && enableSearch ? /* @__PURE__ */ jsx3(SearchToggle, { className: "ms-auto" }) : null,
380
+ /* @__PURE__ */ jsx3("div", { className: "flex flex-1 flex-row items-center", children }),
381
+ enabled && enableSearch ? /* @__PURE__ */ jsx3(SearchToggle, {}) : null,
375
382
  /* @__PURE__ */ jsx3(
376
383
  SidebarTrigger,
377
384
  {
@@ -379,7 +386,7 @@ function SubNav({
379
386
  buttonVariants({
380
387
  color: "ghost",
381
388
  size: "icon",
382
- className: (!enabled || !enableSearch) && "ms-auto"
389
+ className: "-me-2"
383
390
  })
384
391
  ),
385
392
  children: open ? /* @__PURE__ */ jsx3(X, {}) : /* @__PURE__ */ jsx3(Menu, {})
@@ -3,7 +3,8 @@ import { ReactNode, HTMLAttributes } from 'react';
3
3
 
4
4
  interface NavBoxProps {
5
5
  /**
6
- * When to use transparent navbar
6
+ * Use transparent background
7
+ *
7
8
  * @defaultValue none
8
9
  */
9
10
  transparentMode?: 'always' | 'top' | 'none';
@@ -26,6 +27,9 @@ interface SidebarProps {
26
27
  * @defaultValue 1
27
28
  */
28
29
  defaultOpenLevel?: number;
30
+ /**
31
+ * Customise each of the component
32
+ */
29
33
  components?: Partial<Components>;
30
34
  banner?: React.ReactNode;
31
35
  bannerProps?: HTMLAttributes<HTMLDivElement>;
@@ -1,4 +1,4 @@
1
- import { a as SharedNavProps, L as LinkItemType } from './layout-DAwDgfTa.js';
1
+ import { a as SharedNavProps, L as LinkItemType } from './layout-C2Cxe6NB.js';
2
2
  import 'fumadocs-core/server';
3
3
  import 'react';
4
4
 
@@ -7,7 +7,7 @@ import {
7
7
  SearchToggle,
8
8
  ThemeToggle,
9
9
  Title
10
- } from "./chunk-IOZPSMRL.js";
10
+ } from "./chunk-XVCWFZ3A.js";
11
11
  import "./chunk-GHKJ6EFT.js";
12
12
  import "./chunk-AN2Y6MA2.js";
13
13
  import {
@@ -17,7 +17,7 @@ import {
17
17
  useI18n
18
18
  } from "./chunk-HLGNIWUN.js";
19
19
  import "./chunk-7XPZOMJ2.js";
20
- import "./chunk-H5USAX5W.js";
20
+ import "./chunk-CPOVVDVF.js";
21
21
  import "./chunk-TK3TM3MR.js";
22
22
  import "./chunk-MLKGABMK.js";
23
23
 
@@ -34,7 +34,7 @@ function Nav({
34
34
  }) {
35
35
  const search = useSearchContext();
36
36
  const { text } = useI18n();
37
- return /* @__PURE__ */ jsx(NavBox, { id: "nd-nav", transparentMode, children: /* @__PURE__ */ jsxs("nav", { className: "mx-auto flex size-full max-w-container flex-row items-center gap-6 px-4", children: [
37
+ return /* @__PURE__ */ jsx(NavBox, { id: "nd-nav", className: "h-16", transparentMode, children: /* @__PURE__ */ jsxs("nav", { className: "mx-auto flex size-full max-w-container flex-row items-center gap-6 px-4", children: [
38
38
  /* @__PURE__ */ jsx(Title, { title, url }),
39
39
  children,
40
40
  items.filter((item) => item.type !== "secondary").map((item, i) => /* @__PURE__ */ jsx(
@@ -56,7 +56,7 @@ function Nav({
56
56
  LinksMenu,
57
57
  {
58
58
  items,
59
- className: "lg:hidden",
59
+ className: "-me-2 lg:hidden",
60
60
  footer: /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between px-2 pt-2", children: [
61
61
  /* @__PURE__ */ jsx("p", { className: "font-medium text-muted-foreground", children: text.chooseTheme }),
62
62
  /* @__PURE__ */ jsx(ThemeToggle, {})
package/dist/layout.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import 'fumadocs-core/server';
2
2
  import 'react';
3
- export { B as BaseLayoutProps, d as DocsLayout, D as DocsLayoutProps, c as Layout, L as LinkItemType, a as SharedNavProps } from './layout-DAwDgfTa.js';
3
+ export { B as BaseLayoutProps, d as DocsLayout, D as DocsLayoutProps, c as Layout, L as LinkItemType, a as SharedNavProps } from './layout-C2Cxe6NB.js';
package/dist/layout.js CHANGED
@@ -47,7 +47,7 @@ function DocsLayout({
47
47
  ...sidebar
48
48
  } = {},
49
49
  links = [],
50
- containerProps,
50
+ containerProps = {},
51
51
  tree,
52
52
  i18n = false,
53
53
  children
@@ -57,10 +57,11 @@ function DocsLayout({
57
57
  return /* @__PURE__ */ jsxs(TreeContextProvider, { tree, children: [
58
58
  replaceOrDefault(nav, /* @__PURE__ */ jsx(SubNav, { ...nav })),
59
59
  /* @__PURE__ */ jsxs(
60
- "div",
60
+ "main",
61
61
  {
62
+ id: "nd-docs-layout",
62
63
  ...containerProps,
63
- className: twMerge("flex flex-1 flex-row", containerProps?.className),
64
+ className: twMerge("flex flex-1 flex-row", containerProps.className),
64
65
  children: [
65
66
  replaceOrDefault(
66
67
  { enabled: sidebarEnabled, component: sidebarReplace },
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  CodeBlock,
4
4
  Pre
5
- } from "./chunk-U4G4ZLRB.js";
5
+ } from "./chunk-Q3FSJZ3E.js";
6
6
  import "./chunk-VYTHQTZE.js";
7
7
  import "./chunk-2KMKNVSN.js";
8
- import "./chunk-H5USAX5W.js";
8
+ import "./chunk-CPOVVDVF.js";
9
9
  import "./chunk-TK3TM3MR.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
 
@@ -16,7 +16,7 @@ interface TOCProps {
16
16
  }
17
17
  declare const TocProvider: typeof Primitive.AnchorProvider;
18
18
  declare function Toc({ items, header, footer }: TOCProps): ReactElement;
19
- declare function SubToc({ items, header, footer, ...props }: TOCProps & ButtonHTMLAttributes<HTMLButtonElement>): ReactElement;
19
+ declare function TocPopover({ items, header, footer, ...props }: TOCProps & ButtonHTMLAttributes<HTMLButtonElement>): ReactElement;
20
20
 
21
21
  interface BreadcrumbProps extends Omit<BreadcrumbOptions, 'includePage'> {
22
22
  /**
@@ -48,4 +48,4 @@ interface FooterProps {
48
48
  }
49
49
  declare function Footer({ items }: FooterProps): React.ReactElement;
50
50
 
51
- export { Breadcrumb, type BreadcrumbProps, Footer, type FooterProps, LastUpdate, SubToc, type TOCProps, Toc, TocProvider };
51
+ export { Breadcrumb, type BreadcrumbProps, Footer, type FooterProps, LastUpdate, type TOCProps, Toc, TocPopover, TocProvider };