@fumadocs/base-ui 16.11.0 → 16.11.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.
Files changed (109) hide show
  1. package/css/generated/docs.css +1 -1
  2. package/css/generated/flux.css +1 -1
  3. package/css/generated/home.css +1 -1
  4. package/css/generated/notebook.css +1 -1
  5. package/css/generated/shared.css +1 -1
  6. package/dist/components/accordion.d.ts +2 -14
  7. package/dist/components/banner.d.ts +1 -9
  8. package/dist/components/callout.d.ts +4 -24
  9. package/dist/components/card.d.ts +1 -7
  10. package/dist/components/codeblock.d.ts +4 -26
  11. package/dist/components/codeblock.rsc.d.ts +1 -6
  12. package/dist/components/dialog/search-algolia.d.ts +2 -11
  13. package/dist/components/dialog/search-default.d.ts +2 -12
  14. package/dist/components/dialog/search-orama.d.ts +2 -13
  15. package/dist/components/dialog/search.d.ts +10 -50
  16. package/dist/components/dialog/search.js +19 -6
  17. package/dist/components/dynamic-codeblock.core.d.ts +1 -9
  18. package/dist/components/dynamic-codeblock.d.ts +0 -1
  19. package/dist/components/files.d.ts +3 -16
  20. package/dist/components/github-info.d.ts +2 -17
  21. package/dist/components/heading.d.ts +1 -5
  22. package/dist/components/image-zoom.d.ts +2 -7
  23. package/dist/components/inline-toc.d.ts +1 -6
  24. package/dist/components/sidebar/base.d.ts +9 -45
  25. package/dist/components/sidebar/link-item.d.ts +1 -11
  26. package/dist/components/sidebar/page-tree.d.ts +1 -9
  27. package/dist/components/sidebar/tabs/dropdown.d.ts +1 -6
  28. package/dist/components/sidebar/tabs/index.d.ts +1 -4
  29. package/dist/components/steps.d.ts +2 -7
  30. package/dist/components/tabs.d.ts +5 -27
  31. package/dist/components/toc/clerk.d.ts +2 -11
  32. package/dist/components/toc/default.d.ts +2 -12
  33. package/dist/components/toc/index.d.ts +2 -11
  34. package/dist/components/type-table.d.ts +1 -7
  35. package/dist/components/ui/accordion.d.ts +5 -24
  36. package/dist/components/ui/button.d.ts +0 -1
  37. package/dist/components/ui/collapsible.d.ts +1 -6
  38. package/dist/components/ui/popover.d.ts +1 -7
  39. package/dist/components/ui/scroll-area.d.ts +3 -15
  40. package/dist/components/ui/tabs.d.ts +2 -15
  41. package/dist/contexts/i18n.d.ts +1 -8
  42. package/dist/contexts/search.d.ts +6 -12
  43. package/dist/contexts/search.js +11 -5
  44. package/dist/contexts/tree.d.ts +1 -5
  45. package/dist/i18n.d.ts +0 -1
  46. package/dist/layouts/docs/client.d.ts +0 -1
  47. package/dist/layouts/docs/index.d.ts +1 -13
  48. package/dist/layouts/docs/page/index.d.ts +5 -44
  49. package/dist/layouts/docs/page/slots/breadcrumb.d.ts +1 -7
  50. package/dist/layouts/docs/page/slots/container.d.ts +0 -1
  51. package/dist/layouts/docs/page/slots/footer.d.ts +1 -7
  52. package/dist/layouts/docs/page/slots/toc.d.ts +2 -17
  53. package/dist/layouts/docs/slots/container.d.ts +0 -1
  54. package/dist/layouts/docs/slots/header.d.ts +0 -1
  55. package/dist/layouts/docs/slots/sidebar.d.ts +1 -8
  56. package/dist/layouts/flux/index.d.ts +2 -14
  57. package/dist/layouts/flux/page/index.d.ts +5 -40
  58. package/dist/layouts/flux/page/slots/breadcrumb.d.ts +1 -7
  59. package/dist/layouts/flux/page/slots/container.d.ts +0 -1
  60. package/dist/layouts/flux/page/slots/footer.d.ts +1 -7
  61. package/dist/layouts/flux/page/slots/toc.d.ts +1 -10
  62. package/dist/layouts/flux/slots/container.d.ts +0 -1
  63. package/dist/layouts/flux/slots/sidebar.d.ts +1 -7
  64. package/dist/layouts/flux/slots/tab-dropdown.d.ts +1 -7
  65. package/dist/layouts/home/index.d.ts +0 -1
  66. package/dist/layouts/home/navbar.d.ts +5 -5
  67. package/dist/layouts/home/navbar.js +18 -15
  68. package/dist/layouts/home/slots/container.d.ts +0 -1
  69. package/dist/layouts/home/slots/header.d.ts +1 -2
  70. package/dist/layouts/home/slots/header.js +71 -52
  71. package/dist/layouts/notebook/client.d.ts +0 -1
  72. package/dist/layouts/notebook/index.d.ts +1 -12
  73. package/dist/layouts/notebook/page/index.d.ts +5 -44
  74. package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +1 -7
  75. package/dist/layouts/notebook/page/slots/container.d.ts +0 -1
  76. package/dist/layouts/notebook/page/slots/footer.d.ts +1 -7
  77. package/dist/layouts/notebook/page/slots/toc.d.ts +2 -17
  78. package/dist/layouts/notebook/slots/container.d.ts +0 -1
  79. package/dist/layouts/notebook/slots/header.d.ts +0 -1
  80. package/dist/layouts/notebook/slots/sidebar.d.ts +2 -13
  81. package/dist/layouts/shared/client.d.ts +2 -9
  82. package/dist/layouts/shared/index.d.ts +3 -12
  83. package/dist/layouts/shared/page-actions.d.ts +2 -17
  84. package/dist/layouts/shared/slots/language-select.d.ts +1 -7
  85. package/dist/layouts/shared/slots/search-trigger.d.ts +2 -11
  86. package/dist/layouts/shared/slots/search-trigger.js +7 -10
  87. package/dist/layouts/shared/slots/theme-switch.d.ts +1 -6
  88. package/dist/mdx.d.ts +0 -1
  89. package/dist/mdx.server.d.ts +0 -1
  90. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.8_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/react-medium-image-zoom/dist/controlled.d.ts +0 -1
  91. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.8_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +0 -1
  92. package/dist/og/takumi.d.ts +2 -8
  93. package/dist/og/takumi.js +1 -1
  94. package/dist/og.d.ts +1 -7
  95. package/dist/page.d.ts +1 -7
  96. package/dist/provider/astro.d.ts +29 -0
  97. package/dist/provider/astro.js +20 -0
  98. package/dist/provider/base.d.ts +1 -8
  99. package/dist/provider/next.d.ts +1 -5
  100. package/dist/provider/react-router.d.ts +1 -5
  101. package/dist/provider/tanstack.d.ts +1 -5
  102. package/dist/provider/waku.d.ts +1 -5
  103. package/dist/style.css +5 -24
  104. package/dist/utils/use-copy-button.d.ts +0 -1
  105. package/dist/utils/use-footer-items.d.ts +0 -1
  106. package/dist/utils/use-is-scroll-top.d.ts +1 -3
  107. package/package.json +10 -10
  108. package/dist/components/ui/navigation-menu.d.ts +0 -28
  109. package/dist/components/ui/navigation-menu.js +0 -56
@@ -6,14 +6,14 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../co
6
6
  import { LinkItem } from "../../shared/client.js";
7
7
  import "../../shared/index.js";
8
8
  import { useIsScrollTop } from "../../../utils/use-is-scroll-top.js";
9
- import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from "../../../components/ui/navigation-menu.js";
10
9
  import { useHomeLayout } from "../index.js";
11
10
  import Link from "fumadocs-core/link";
12
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
12
  import { ChevronDown, Languages } from "lucide-react";
14
13
  import { cva } from "class-variance-authority";
15
- import { Fragment as Fragment$1, useEffect, useEffectEvent, useRef, useState } from "react";
14
+ import { Fragment as Fragment$1, createContext, use, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
16
15
  import { useTranslations } from "@fuma-translate/react";
16
+ import { NavigationMenu } from "@base-ui/react/navigation-menu";
17
17
  //#region src/layouts/home/slots/header.tsx
18
18
  const navItemVariants = cva("[&_svg]:size-4", {
19
19
  variants: { variant: {
@@ -29,6 +29,7 @@ const navItemVariants = cva("[&_svg]:size-4", {
29
29
  } },
30
30
  defaultVariants: { variant: "main" }
31
31
  });
32
+ const MobileNavigationMenuContext = createContext(null);
32
33
  function Header(props) {
33
34
  const { navItems, menuItems, slots, props: { nav } } = useHomeLayout();
34
35
  const headerRef = useRef(null);
@@ -49,7 +50,7 @@ function Header(props) {
49
50
  window.removeEventListener("click", onClick);
50
51
  };
51
52
  }, []);
52
- const list = /* @__PURE__ */ jsxs(NavigationMenuList, {
53
+ const list = /* @__PURE__ */ jsxs(NavigationMenu.List, {
53
54
  ref: listRef,
54
55
  className: "flex h-14 w-full mx-auto max-w-(--fd-layout-width) items-center px-4",
55
56
  children: [
@@ -107,42 +108,58 @@ function Header(props) {
107
108
  ...props,
108
109
  ref: mergeRefs(headerRef, props.ref),
109
110
  className: cn("sticky h-14 top-0 z-40", props.className),
110
- children: /* @__PURE__ */ jsxs(NavigationMenu, {
111
+ children: /* @__PURE__ */ jsxs(NavigationMenu.Root, {
111
112
  className: (s) => cn("backdrop-blur-lg border-b transition-[box-shadow,background-color,border-radius]", open && "max-lg:shadow-lg max-lg:rounded-b-2xl", (open || !isNavTransparent || s.open) && "bg-fd-background/80"),
112
113
  children: [
113
114
  list,
114
115
  /* @__PURE__ */ jsx(CollapsibleContent, {
115
116
  className: "mx-auto max-w-(--fd-layout-width) lg:hidden",
116
- children: /* @__PURE__ */ jsxs("div", {
117
+ children: /* @__PURE__ */ jsx("div", {
117
118
  className: "flex flex-col pt-2 p-4 sm:flex-row sm:items-center sm:justify-end",
118
- children: [menuItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
119
- item,
120
- className: "sm:hidden"
121
- }, i)), /* @__PURE__ */ jsxs("div", {
122
- className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",
123
- children: [
124
- menuItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
125
- item,
126
- className: cn(item.type === "icon" && "-mx-1 first:ms-0")
127
- }, i)),
128
- /* @__PURE__ */ jsx("div", {
129
- role: "separator",
130
- className: "flex-1"
131
- }),
132
- slots.languageSelect && /* @__PURE__ */ jsxs(slots.languageSelect.root, { children: [
133
- /* @__PURE__ */ jsx(Languages, { className: "size-5" }),
134
- slots.languageSelect.text && /* @__PURE__ */ jsx(slots.languageSelect.text, {}),
135
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })
136
- ] }),
137
- slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {})
138
- ]
139
- })]
119
+ children: /* @__PURE__ */ jsxs(MobileNavigationMenuContext, {
120
+ value: useMemo(() => ({ setOpen }), []),
121
+ children: [menuItems.filter((item) => !isSecondary(item)).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
122
+ item,
123
+ className: "sm:hidden"
124
+ }, i)), /* @__PURE__ */ jsxs("div", {
125
+ className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",
126
+ children: [
127
+ menuItems.filter(isSecondary).map((item, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, {
128
+ item,
129
+ className: cn(item.type === "icon" && "-mx-1 first:ms-0")
130
+ }, i)),
131
+ /* @__PURE__ */ jsx("div", {
132
+ role: "separator",
133
+ className: "flex-1"
134
+ }),
135
+ slots.languageSelect && /* @__PURE__ */ jsxs(slots.languageSelect.root, { children: [
136
+ /* @__PURE__ */ jsx(Languages, { className: "size-5" }),
137
+ slots.languageSelect.text && /* @__PURE__ */ jsx(slots.languageSelect.text, {}),
138
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })
139
+ ] }),
140
+ slots.themeSwitch && /* @__PURE__ */ jsx(slots.themeSwitch, {})
141
+ ]
142
+ })]
143
+ })
140
144
  })
141
145
  }),
142
- /* @__PURE__ */ jsx(NavigationMenuViewport, {
146
+ /* @__PURE__ */ jsx(NavigationMenu.Portal, { children: /* @__PURE__ */ jsx(NavigationMenu.Positioner, {
143
147
  side: "bottom",
144
- anchor: listRef
145
- })
148
+ anchor: listRef,
149
+ collisionPadding: {
150
+ top: 5,
151
+ bottom: 5
152
+ },
153
+ className: "z-40 box-border h-(--positioner-height) w-(--anchor-width) max-w-(--available-width) duration-(--duration) ease-(--easing) before:absolute before:content-[''] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0 data-[side=bottom]:before:h-2.5 data-[side=left]:before:top-0 data-[side=left]:before:right-[-10px] data-[side=left]:before:bottom-0 data-[side=left]:before:w-2.5 data-[side=right]:before:top-0 data-[side=right]:before:bottom-0 data-[side=right]:before:left-[-10px] data-[side=right]:before:w-2.5 data-[side=top]:before:right-0 data-[side=top]:before:bottom-[-10px] data-[side=top]:before:left-0 data-[side=top]:before:h-2.5",
154
+ style: {
155
+ ["--duration"]: "0.35s",
156
+ ["--easing"]: "cubic-bezier(0.22, 1, 0.36, 1)"
157
+ },
158
+ children: /* @__PURE__ */ jsx(NavigationMenu.Popup, {
159
+ className: "relative border h-(--popup-height) w-full rounded-xl bg-fd-popover/80 text-fd-popover-foreground backdrop-blur-md shadow-lg transition-[opacity,width,height] duration-(--duration) ease-(--easing) data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:opacity-0",
160
+ children: /* @__PURE__ */ jsx(NavigationMenu.Viewport, { className: "relative size-full overflow-hidden" })
161
+ })
162
+ }) })
146
163
  ]
147
164
  })
148
165
  })
@@ -152,7 +169,7 @@ function isSecondary(item) {
152
169
  if ("secondary" in item && item.secondary != null) return item.secondary;
153
170
  return item.type === "icon";
154
171
  }
155
- function NavigationMenuLinkItem({ item, ...props }) {
172
+ function NavigationMenuLinkItem({ item, className, ...props }) {
156
173
  if (item.type === "custom") return item.children;
157
174
  if (item.type === "menu") {
158
175
  const children = item.items.map((child, j) => {
@@ -161,7 +178,7 @@ function NavigationMenuLinkItem({ item, ...props }) {
161
178
  className: "w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4",
162
179
  children: child.icon
163
180
  }) : null, ...rest } = child.menu ?? {};
164
- return /* @__PURE__ */ jsx(NavigationMenuLink, { render: /* @__PURE__ */ jsx(Link, {
181
+ return /* @__PURE__ */ jsx(NavigationMenu.Link, { render: /* @__PURE__ */ jsx(Link, {
165
182
  href: child.url,
166
183
  external: child.external,
167
184
  ...rest,
@@ -179,24 +196,26 @@ function NavigationMenuLinkItem({ item, ...props }) {
179
196
  ] })
180
197
  }) }, `${j}-${child.url}`);
181
198
  });
182
- return /* @__PURE__ */ jsxs(NavigationMenuItem, {
199
+ return /* @__PURE__ */ jsxs(NavigationMenu.Item, {
200
+ className: cn("list-none", className),
183
201
  ...props,
184
- children: [/* @__PURE__ */ jsx(NavigationMenuTrigger, {
202
+ children: [/* @__PURE__ */ jsx(NavigationMenu.Trigger, {
185
203
  className: cn(navItemVariants(), "rounded-md"),
186
204
  children: item.url ? /* @__PURE__ */ jsx(Link, {
187
205
  href: item.url,
188
206
  external: item.external,
189
207
  children: item.text
190
208
  }) : item.text
191
- }), /* @__PURE__ */ jsx(NavigationMenuContent, {
192
- className: "grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3",
209
+ }), /* @__PURE__ */ jsx(NavigationMenu.Content, {
210
+ className: cn("h-full w-(--anchor-width) max-w-(--available-width) p-3", "transition-[opacity,transform,translate] duration-(--duration) ease-(--easing)", "data-starting-style:opacity-0 data-ending-style:opacity-0", "data-starting-style:data-[activation-direction=left]:-translate-x-1/2", "data-starting-style:data-[activation-direction=right]:translate-x-1/2", "data-ending-style:data-[activation-direction=left]:translate-x-1/2", "data-ending-style:data-[activation-direction=right]:-translate-x-1/2", "grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3"),
193
211
  children
194
212
  })]
195
213
  });
196
214
  }
197
- return /* @__PURE__ */ jsx(NavigationMenuItem, {
215
+ return /* @__PURE__ */ jsx(NavigationMenu.Item, {
216
+ className: cn("list-none", className),
198
217
  ...props,
199
- children: /* @__PURE__ */ jsx(NavigationMenuLink, { render: /* @__PURE__ */ jsx(LinkItem, {
218
+ children: /* @__PURE__ */ jsx(NavigationMenu.Link, { render: /* @__PURE__ */ jsx(LinkItem, {
200
219
  item,
201
220
  "aria-label": item.type === "icon" ? item.label : void 0,
202
221
  className: cn(navItemVariants({ variant: item.type })),
@@ -205,24 +224,23 @@ function NavigationMenuLinkItem({ item, ...props }) {
205
224
  });
206
225
  }
207
226
  function MobileNavigationMenuLinkItem({ item, ...props }) {
227
+ const { setOpen } = use(MobileNavigationMenuContext);
208
228
  if (item.type === "custom") return /* @__PURE__ */ jsx("div", {
209
229
  className: cn("grid", props.className),
210
230
  children: item.children
211
231
  });
212
- if (item.type === "menu") {
213
- const header = /* @__PURE__ */ jsxs(Fragment, { children: [item.icon, item.text] });
214
- return /* @__PURE__ */ jsxs("div", {
215
- className: cn("mb-4 flex flex-col", props.className),
216
- children: [/* @__PURE__ */ jsx("p", {
217
- className: "mb-1 text-sm text-fd-muted-foreground",
218
- children: item.url ? /* @__PURE__ */ jsx(Link, {
219
- href: item.url,
220
- external: item.external,
221
- children: header
222
- }) : header
223
- }), item.items.map((child, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, { item: child }, i))]
224
- });
225
- }
232
+ if (item.type === "menu") return /* @__PURE__ */ jsxs("div", {
233
+ className: cn("mb-4 flex flex-col", props.className),
234
+ children: [/* @__PURE__ */ jsx("p", {
235
+ className: "mb-1 text-sm text-fd-muted-foreground",
236
+ children: item.url ? /* @__PURE__ */ jsxs(Link, {
237
+ href: item.url,
238
+ external: item.external,
239
+ onClick: () => setOpen(false),
240
+ children: [item.icon, item.text]
241
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [item.icon, item.text] })
242
+ }), item.items.map((child, i) => /* @__PURE__ */ jsx(MobileNavigationMenuLinkItem, { item: child }, i))]
243
+ });
226
244
  return /* @__PURE__ */ jsxs(LinkItem, {
227
245
  item,
228
246
  className: cn({
@@ -237,6 +255,7 @@ function MobileNavigationMenuLinkItem({ item, ...props }) {
237
255
  })
238
256
  }[item.type ?? "main"], props.className),
239
257
  "aria-label": item.type === "icon" ? item.label : void 0,
258
+ onClick: () => setOpen(false),
240
259
  children: [item.icon, item.type === "icon" ? void 0 : item.text]
241
260
  });
242
261
  }
@@ -3,7 +3,6 @@ import { LayoutTab, LinkItemType } from "../shared/index.js";
3
3
  import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
4
4
  import { DocsLayoutProps } from "./index.js";
5
5
  import { ComponentProps, FC } from "react";
6
-
7
6
  //#region src/layouts/notebook/client.d.ts
8
7
  interface DocsSlots extends BaseSlots {
9
8
  container: FC<ComponentProps<'div'>>;
@@ -3,7 +3,6 @@ import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
3
3
  import { DocsSlots, useNotebookLayout } from "./client.js";
4
4
  import { HTMLAttributes } from "react";
5
5
  import * as PageTree from "fumadocs-core/page-tree";
6
-
7
6
  //#region src/layouts/notebook/index.d.ts
8
7
  interface DocsLayoutProps extends Omit<BaseLayoutProps, 'nav'> {
9
8
  tree: PageTree.Root;
@@ -22,16 +21,6 @@ interface SidebarOptions extends SidebarProps, SidebarProviderProps {
22
21
  */
23
22
  tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
24
23
  }
25
- declare function DocsLayout({
26
- tree,
27
- tabMode,
28
- sidebar: {
29
- tabs: defaultTabs,
30
- ...sidebarProps
31
- },
32
- children,
33
- tabs,
34
- ...props
35
- }: DocsLayoutProps): import("react").JSX.Element;
24
+ declare function DocsLayout({ tree, tabMode, sidebar: { tabs: defaultTabs, ...sidebarProps }, children, tabs, ...props }: DocsLayoutProps): import("react").JSX.Element;
36
25
  //#endregion
37
26
  export { DocsLayout, DocsLayoutProps, type DocsSlots, useNotebookLayout };
@@ -4,7 +4,6 @@ import { Footer, FooterProps } from "./slots/footer.js";
4
4
  import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
5
5
  import { ComponentProps, FC, ReactNode } from "react";
6
6
  import { TOCItemType } from "fumadocs-core/toc";
7
-
8
7
  //#region src/layouts/notebook/page/index.d.ts
9
8
  interface DocsPageProps extends ComponentProps<'article'> {
10
9
  toc?: TOCItemType[];
@@ -62,53 +61,15 @@ declare function useDocsPage(): {
62
61
  full: NonNullable<DocsPageProps["full"]>;
63
62
  slots: DocsPageSlots;
64
63
  };
65
- declare function DocsPage({
66
- full,
67
- tableOfContent: {
68
- enabled: tocEnabled,
69
- single,
70
- ...tocProps
71
- },
72
- tableOfContentPopover: {
73
- enabled: tocPopoverEnabled,
74
- ...tocPopoverProps
75
- },
76
- breadcrumb: {
77
- enabled: breadcrumbEnabled,
78
- ...breadcrumb
79
- },
80
- footer: {
81
- enabled: footerEnabled,
82
- ...footer
83
- },
84
- toc,
85
- slots: defaultSlots,
86
- children,
87
- ...containerProps
88
- }: DocsPageProps): import("react").JSX.Element;
64
+ declare function DocsPage({ full, tableOfContent: { enabled: tocEnabled, single, ...tocProps }, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps }, breadcrumb: { enabled: breadcrumbEnabled, ...breadcrumb }, footer: { enabled: footerEnabled, ...footer }, toc, slots: defaultSlots, children, ...containerProps }: DocsPageProps): import("react").JSX.Element;
89
65
  declare function EditOnGitHub(props: ComponentProps<'a'>): import("react").JSX.Element;
90
66
  /**
91
67
  * Add typography styles
92
68
  */
93
- declare function DocsBody({
94
- children,
95
- className,
96
- ...props
97
- }: ComponentProps<'div'>): import("react").JSX.Element;
98
- declare function DocsDescription({
99
- children,
100
- className,
101
- ...props
102
- }: ComponentProps<'p'>): import("react").JSX.Element | null;
103
- declare function DocsTitle({
104
- children,
105
- className,
106
- ...props
107
- }: ComponentProps<'h1'>): import("react").JSX.Element;
108
- declare function PageLastUpdate({
109
- date: value,
110
- ...props
111
- }: Omit<ComponentProps<'p'>, 'children'> & {
69
+ declare function DocsBody({ children, className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
70
+ declare function DocsDescription({ children, className, ...props }: ComponentProps<'p'>): import("react").JSX.Element | null;
71
+ declare function DocsTitle({ children, className, ...props }: ComponentProps<'h1'>): import("react").JSX.Element;
72
+ declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
112
73
  date: Date;
113
74
  }): import("react").JSX.Element;
114
75
  //#endregion
@@ -1,13 +1,7 @@
1
1
  import { ComponentProps } from "react";
2
2
  import { BreadcrumbOptions } from "fumadocs-core/breadcrumb";
3
-
4
3
  //#region src/layouts/notebook/page/slots/breadcrumb.d.ts
5
4
  type BreadcrumbProps = BreadcrumbOptions & ComponentProps<'div'>;
6
- declare function Breadcrumb({
7
- includeRoot,
8
- includeSeparator,
9
- includePage,
10
- ...props
11
- }: BreadcrumbProps): import("react").JSX.Element | null;
5
+ declare function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }: BreadcrumbProps): import("react").JSX.Element | null;
12
6
  //#endregion
13
7
  export { Breadcrumb, BreadcrumbProps };
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps } from "react";
2
-
3
2
  //#region src/layouts/notebook/page/slots/container.d.ts
4
3
  declare function Container(props: ComponentProps<'article'>): import("react").JSX.Element;
5
4
  //#endregion
@@ -1,6 +1,5 @@
1
1
  import { ComponentProps } from "react";
2
2
  import * as PageTree from "fumadocs-core/page-tree";
3
-
4
3
  //#region src/layouts/notebook/page/slots/footer.d.ts
5
4
  type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
6
5
  interface FooterProps extends ComponentProps<'div'> {
@@ -12,11 +11,6 @@ interface FooterProps extends ComponentProps<'div'> {
12
11
  next?: Item;
13
12
  };
14
13
  }
15
- declare function Footer({
16
- items,
17
- children,
18
- className,
19
- ...props
20
- }: FooterProps): import("react").JSX.Element;
14
+ declare function Footer({ items, children, className, ...props }: FooterProps): import("react").JSX.Element;
21
15
  //#endregion
22
16
  export { Footer, FooterProps };
@@ -2,7 +2,6 @@ import { TOCItemsProps } from "../../../../components/toc/clerk.js";
2
2
  import { TOCItemsProps as TOCItemsProps$1 } from "../../../../components/toc/default.js";
3
3
  import { TOCProviderProps as TOCProviderProps$1 } from "../../../../components/toc/index.js";
4
4
  import { ComponentProps, ReactNode } from "react";
5
-
6
5
  //#region src/layouts/notebook/page/slots/toc.d.ts
7
6
  type TOCProviderProps = TOCProviderProps$1;
8
7
  declare function TOCProvider(props: TOCProviderProps): import("react").JSX.Element;
@@ -23,13 +22,7 @@ type TOCProps = {
23
22
  style: 'clerk';
24
23
  list?: TOCItemsProps;
25
24
  });
26
- declare function TOC({
27
- container,
28
- header,
29
- footer,
30
- style,
31
- list
32
- }: TOCProps): import("react").JSX.Element;
25
+ declare function TOC({ container, header, footer, style, list }: TOCProps): import("react").JSX.Element;
33
26
  type TOCPopoverProps = {
34
27
  container?: ComponentProps<'div'>;
35
28
  trigger?: ComponentProps<'button'>;
@@ -49,14 +42,6 @@ type TOCPopoverProps = {
49
42
  style: 'clerk';
50
43
  list?: TOCItemsProps;
51
44
  });
52
- declare function TOCPopover({
53
- container,
54
- trigger,
55
- content,
56
- header,
57
- footer,
58
- style,
59
- list
60
- }: TOCPopoverProps): import("react").JSX.Element;
45
+ declare function TOCPopover({ container, trigger, content, header, footer, style, list }: TOCPopoverProps): import("react").JSX.Element;
61
46
  //#endregion
62
47
  export { TOC, TOCPopover, TOCPopoverProps, TOCProps, TOCProvider, TOCProviderProps };
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps } from "react";
2
-
3
2
  //#region src/layouts/notebook/slots/container.d.ts
4
3
  declare function Container(props: ComponentProps<'div'>): import("react").JSX.Element;
5
4
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { ComponentProps } from "react";
2
-
3
2
  //#region src/layouts/notebook/slots/header.d.ts
4
3
  declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
5
4
  //#endregion
@@ -2,7 +2,6 @@ import { SidebarProviderProps as SidebarProviderProps$1, useSidebar as useSideba
2
2
  import { LayoutTab } from "../../shared/index.js";
3
3
  import { SidebarPageTreeComponents } from "../../../components/sidebar/page-tree.js";
4
4
  import { ComponentProps, FC, ReactNode } from "react";
5
-
6
5
  //#region src/layouts/notebook/slots/sidebar.d.ts
7
6
  interface SidebarProps extends ComponentProps<'aside'> {
8
7
  components?: Partial<SidebarPageTreeComponents>;
@@ -20,18 +19,8 @@ declare const useSidebar: typeof useSidebar$1;
20
19
  declare function SidebarProvider(props: SidebarProviderProps): import("react").JSX.Element;
21
20
  declare function SidebarTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
22
21
  declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
23
- declare function Sidebar({
24
- banner,
25
- footer,
26
- components,
27
- collapsible,
28
- ...rest
29
- }: SidebarProps): import("react").JSX.Element;
30
- declare function SidebarTabsDropdown({
31
- options,
32
- placeholder,
33
- ...props
34
- }: {
22
+ declare function Sidebar({ banner, footer, components, collapsible, ...rest }: SidebarProps): import("react").JSX.Element;
23
+ declare function SidebarTabsDropdown({ options, placeholder, ...props }: {
35
24
  placeholder?: ReactNode;
36
25
  options: LayoutTab[];
37
26
  } & ComponentProps<'button'>): import("react").JSX.Element;
@@ -3,13 +3,8 @@ import { FullSearchTriggerProps, SearchTriggerProps } from "./slots/search-trigg
3
3
  import { ThemeSwitchProps } from "./slots/theme-switch.js";
4
4
  import { BaseLayoutProps, LinkItemType } from "./index.js";
5
5
  import { ComponentProps, FC } from "react";
6
-
7
6
  //#region src/layouts/shared/client.d.ts
8
- declare function LinkItem({
9
- ref,
10
- item,
11
- ...props
12
- }: Omit<ComponentProps<'a'>, 'href'> & {
7
+ declare function LinkItem({ ref, item, ...props }: Omit<ComponentProps<'a'>, 'href'> & {
13
8
  item: Extract<LinkItemType, {
14
9
  url: string;
15
10
  }>;
@@ -30,9 +25,7 @@ interface BaseSlotsProps<P extends BaseLayoutProps = BaseLayoutProps> extends Pi
30
25
  themeSwitch: Omit<NonNullable<P['themeSwitch']>, 'enabled'>;
31
26
  searchToggle: Omit<NonNullable<P['searchToggle']>, 'enabled'>;
32
27
  }
33
- declare function baseSlots({
34
- useProps
35
- }: {
28
+ declare function baseSlots({ useProps }: {
36
29
  useProps: () => BaseSlotsProps;
37
30
  }): {
38
31
  useProvider(options: BaseLayoutProps): {
@@ -4,7 +4,6 @@ import { BaseSlots, BaseSlotsProps, LinkItem, baseSlots } from "./client.js";
4
4
  import { ComponentProps, FC, ReactNode } from "react";
5
5
  import * as PageTree from "fumadocs-core/page-tree";
6
6
  import { I18nConfig } from "fumadocs-core/i18n";
7
-
8
7
  //#region src/layouts/shared/index.d.ts
9
8
  interface NavOptions {
10
9
  enabled?: boolean;
@@ -82,9 +81,7 @@ interface LayoutTab {
82
81
  interface GetLayoutTabsOptions {
83
82
  transform?: (option: LayoutTab, node: PageTree.Folder) => LayoutTab | null;
84
83
  }
85
- declare function getLayoutTabs(tree: PageTree.Root, {
86
- transform
87
- }?: GetLayoutTabsOptions): LayoutTab[];
84
+ declare function getLayoutTabs(tree: PageTree.Root, { transform }?: GetLayoutTabsOptions): LayoutTab[];
88
85
  declare function isLayoutTabActive(tab: LayoutTab, pathname: string): boolean;
89
86
  interface Filterable {
90
87
  /**
@@ -161,14 +158,8 @@ type LinkItemType = MainItemType | IconItemType | ButtonItemType | MenuItemType
161
158
  /**
162
159
  * Get link items with shortcuts
163
160
  */
164
- declare function resolveLinkItems({
165
- links,
166
- githubUrl
167
- }: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): LinkItemType[];
168
- declare function useLinkItems({
169
- githubUrl,
170
- links
171
- }: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): {
161
+ declare function resolveLinkItems({ links, githubUrl }: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): LinkItemType[];
162
+ declare function useLinkItems({ githubUrl, links }: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): {
172
163
  navItems: LinkItemType[];
173
164
  menuItems: LinkItemType[];
174
165
  all: LinkItemType[];
@@ -1,14 +1,10 @@
1
1
  import { PopoverTrigger } from "../../components/ui/popover.js";
2
2
  import { ComponentProps } from "react";
3
-
4
3
  //#region src/layouts/shared/page-actions.d.ts
5
4
  /**
6
5
  * see https://fumadocs.dev/docs/integrations/llms#page-actions to customize.
7
6
  */
8
- declare function MarkdownCopyButton({
9
- markdownUrl,
10
- ...props
11
- }: ComponentProps<'button'> & {
7
+ declare function MarkdownCopyButton({ markdownUrl, ...props }: ComponentProps<'button'> & {
12
8
  /**
13
9
  * A URL to fetch the raw Markdown/MDX content of page
14
10
  */
@@ -17,11 +13,7 @@ declare function MarkdownCopyButton({
17
13
  /**
18
14
  * see https://fumadocs.dev/docs/integrations/llms#page-actions to customize.
19
15
  */
20
- declare function ViewOptionsPopover({
21
- markdownUrl,
22
- githubUrl,
23
- ...props
24
- }: ComponentProps<typeof PopoverTrigger> & {
16
+ declare function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }: ComponentProps<typeof PopoverTrigger> & {
25
17
  /**
26
18
  * A URL to the raw Markdown/MDX content of page
27
19
  */
@@ -31,12 +23,5 @@ declare function ViewOptionsPopover({
31
23
  */
32
24
  githubUrl?: string;
33
25
  }): import("react").JSX.Element;
34
- declare global {
35
- interface ImportMeta {
36
- env?: {
37
- BASE_URL?: unknown;
38
- };
39
- }
40
- }
41
26
  //#endregion
42
27
  export { MarkdownCopyButton, ViewOptionsPopover };
@@ -1,17 +1,11 @@
1
1
  import { buttonVariants } from "../../../components/ui/button.js";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  import { ComponentProps } from "react";
4
-
5
4
  //#region src/layouts/shared/slots/language-select.d.ts
6
5
  interface LanguageSelectProps extends ComponentProps<'button'> {
7
6
  variant?: VariantProps<typeof buttonVariants>['variant'];
8
7
  }
9
- declare function LanguageSelect({
10
- className,
11
- variant,
12
- children,
13
- ...rest
14
- }: LanguageSelectProps): React.ReactElement;
8
+ declare function LanguageSelect({ className, variant, children, ...rest }: LanguageSelectProps): React.ReactElement;
15
9
  type LanguageSelectTextProps = ComponentProps<'span'>;
16
10
  declare function LanguageSelectText(props: LanguageSelectTextProps): import("react").JSX.Element;
17
11
  //#endregion
@@ -1,22 +1,13 @@
1
1
  import { ButtonProps } from "../../../components/ui/button.js";
2
2
  import { ComponentProps } from "react";
3
-
4
3
  //#region src/layouts/shared/slots/search-trigger.d.ts
5
4
  interface SearchTriggerProps extends Omit<ComponentProps<'button'>, 'color'>, ButtonProps {
6
5
  hideIfDisabled?: boolean;
7
6
  }
8
- declare function SearchTrigger({
9
- hideIfDisabled,
10
- size,
11
- color,
12
- ...props
13
- }: SearchTriggerProps): import("react").JSX.Element | null;
7
+ declare function SearchTrigger({ hideIfDisabled, size, color, ...props }: SearchTriggerProps): import("react").JSX.Element | null;
14
8
  interface FullSearchTriggerProps extends ComponentProps<'button'> {
15
9
  hideIfDisabled?: boolean;
16
10
  }
17
- declare function FullSearchTrigger({
18
- hideIfDisabled,
19
- ...props
20
- }: FullSearchTriggerProps): import("react").JSX.Element | null;
11
+ declare function FullSearchTrigger({ hideIfDisabled, ...props }: FullSearchTriggerProps): import("react").JSX.Element | null;
21
12
  //#endregion
22
13
  export { FullSearchTrigger, FullSearchTriggerProps, SearchTrigger, SearchTriggerProps };
@@ -5,12 +5,14 @@ import { useSearchContext } from "../../../contexts/search.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Search } from "lucide-react";
7
7
  import { useTranslations } from "@fuma-translate/react";
8
+ import { Dialog } from "@base-ui/react/dialog";
8
9
  //#region src/layouts/shared/slots/search-trigger.tsx
9
10
  function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...props }) {
10
- const { setOpenSearch, enabled } = useSearchContext();
11
+ const { enabled, dialogHandle } = useSearchContext();
11
12
  const t = useTranslations({ note: "search trigger" });
12
13
  if (hideIfDisabled && !enabled) return null;
13
- return /* @__PURE__ */ jsx("button", {
14
+ return /* @__PURE__ */ jsx(Dialog.Trigger, {
15
+ handle: dialogHandle,
14
16
  type: "button",
15
17
  className: cn(buttonVariants({
16
18
  size,
@@ -18,24 +20,19 @@ function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...p
18
20
  }), props.className),
19
21
  "data-search": "",
20
22
  "aria-label": t("Open Search", { note: "aria-label" }),
21
- onClick: () => {
22
- setOpenSearch(true);
23
- },
24
23
  children: /* @__PURE__ */ jsx(Search, {})
25
24
  });
26
25
  }
27
26
  function FullSearchTrigger({ hideIfDisabled, ...props }) {
28
- const { enabled, hotKey, setOpenSearch } = useSearchContext();
27
+ const { enabled, hotKey, dialogHandle } = useSearchContext();
29
28
  const t = useTranslations({ note: "search trigger" });
30
29
  if (hideIfDisabled && !enabled) return null;
31
- return /* @__PURE__ */ jsxs("button", {
30
+ return /* @__PURE__ */ jsxs(Dialog.Trigger, {
31
+ handle: dialogHandle,
32
32
  type: "button",
33
33
  "data-search-full": "",
34
34
  ...props,
35
35
  className: cn("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground", props.className),
36
- onClick: () => {
37
- setOpenSearch(true);
38
- },
39
36
  children: [
40
37
  /* @__PURE__ */ jsx(Search, { className: "size-4" }),
41
38
  t("Search"),