fumadocs-ui 12.0.4 → 12.0.5

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.
@@ -1,5 +1,5 @@
1
- import { L as LinkItemType, S as SidebarProps, N as NavProps } from './layout.client-Duq0TTke.js';
2
- export { a as Sidebar } from './layout.client-Duq0TTke.js';
1
+ import { L as LinkItemType, S as SidebarProps, N as NavProps } from './layout.client-BzAmSQXB.js';
2
+ export { a as Sidebar } from './layout.client-BzAmSQXB.js';
3
3
  export { T as TreeContextProvider } from './tree-CrKzI9Nz.js';
4
4
  import { ButtonHTMLAttributes } from 'react';
5
5
  import 'fumadocs-core/server';
@@ -120,6 +120,6 @@ interface DocsLayoutProps extends BaseLayoutProps {
120
120
  i18n?: boolean;
121
121
  }
122
122
  declare function Layout({ nav, links, githubUrl, children, }: BaseLayoutProps): React.ReactElement;
123
- declare function DocsLayout({ nav, githubUrl, sidebar, links, containerProps, tree, i18n, children, }: DocsLayoutProps): React.ReactElement;
123
+ declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, links, containerProps, tree, i18n, children, }: DocsLayoutProps): React.ReactElement;
124
124
 
125
125
  export { type BaseLayoutProps as B, type DocsLayoutProps as D, type LinkItemType as L, type NavProps as N, type SidebarProps as S, Sidebar as a, Layout as b, DocsLayout as c, Nav as d };
@@ -1,3 +1,3 @@
1
- export { d as Nav } from './layout.client-Duq0TTke.js';
1
+ export { d as Nav } from './layout.client-BzAmSQXB.js';
2
2
  import 'react';
3
3
  import 'fumadocs-core/server';
@@ -51,6 +51,7 @@ function Nav({
51
51
  return /* @__PURE__ */ jsx(
52
52
  "header",
53
53
  {
54
+ id: "nd-nav",
54
55
  className: twMerge(
55
56
  "sticky top-0 z-50 h-16 border-b transition-colors",
56
57
  transparent ? "border-transparent" : "border-foreground/10 bg-background/80 backdrop-blur-md"
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, c as DocsLayout, D as DocsLayoutProps, b as Layout, L as LinkItemType } from './layout.client-Duq0TTke.js';
3
+ export { B as BaseLayoutProps, c as DocsLayout, D as DocsLayoutProps, b as Layout, L as LinkItemType } from './layout.client-BzAmSQXB.js';
package/dist/layout.js CHANGED
@@ -40,17 +40,20 @@ function Layout({
40
40
  function DocsLayout({
41
41
  nav,
42
42
  githubUrl,
43
- sidebar = {},
43
+ sidebar: {
44
+ enabled: sidebarEnabled = true,
45
+ collapsible = true,
46
+ component: sidebarReplace,
47
+ ...sidebar
48
+ } = {},
44
49
  links = [],
45
50
  containerProps,
46
51
  tree,
47
52
  i18n = false,
48
53
  children
49
54
  }) {
50
- const sidebarEnabled = sidebar.enabled ?? true;
51
- const sidebarCollapsible = sidebarEnabled && (sidebar.collapsible ?? true);
52
55
  const finalLinks = getLinks(links, githubUrl);
53
- const Aside = sidebarCollapsible ? DynamicSidebar : Sidebar;
56
+ const Aside = sidebarEnabled && collapsible ? DynamicSidebar : Sidebar;
54
57
  return /* @__PURE__ */ jsxs(TreeContextProvider, { tree, children: [
55
58
  replaceOrDefault(nav, /* @__PURE__ */ jsx(SubNav, { ...nav })),
56
59
  /* @__PURE__ */ jsxs(
@@ -60,12 +63,12 @@ function DocsLayout({
60
63
  className: twMerge("flex flex-1 flex-row", containerProps?.className),
61
64
  children: [
62
65
  replaceOrDefault(
63
- sidebar,
66
+ { enabled: sidebarEnabled, component: sidebarReplace },
64
67
  /* @__PURE__ */ jsx(
65
68
  Aside,
66
69
  {
70
+ ...sidebar,
67
71
  items: finalLinks,
68
- defaultOpenLevel: sidebar.defaultOpenLevel,
69
72
  banner: /* @__PURE__ */ jsxs(Fragment, { children: [
70
73
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between border-b pb-2 max-md:hidden", children: [
71
74
  /* @__PURE__ */ jsx(
@@ -81,14 +84,17 @@ function DocsLayout({
81
84
  sidebar.banner
82
85
  ] }),
83
86
  bannerProps: {
84
- className: twMerge(!sidebar.banner && "max-md:hidden")
87
+ className: twMerge(
88
+ !sidebar.banner && "max-md:hidden",
89
+ sidebar.bannerProps?.className
90
+ ),
91
+ ...sidebar.bannerProps
85
92
  },
86
93
  footer: /* @__PURE__ */ jsxs(Fragment, { children: [
87
94
  /* @__PURE__ */ jsx(ThemeToggle, { className: "me-auto" }),
88
95
  sidebar.footer,
89
96
  i18n ? /* @__PURE__ */ jsx(LanguageToggle, {}) : null
90
- ] }),
91
- components: sidebar.components
97
+ ] })
92
98
  }
93
99
  )
94
100
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "12.0.4",
3
+ "version": "12.0.5",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -95,7 +95,7 @@
95
95
  "next-themes": "^0.3.0",
96
96
  "react-medium-image-zoom": "^5.2.4",
97
97
  "tailwind-merge": "^2.3.0",
98
- "fumadocs-core": "12.0.4"
98
+ "fumadocs-core": "12.0.5"
99
99
  },
100
100
  "devDependencies": {
101
101
  "@algolia/client-search": "^4.23.3",