fumadocs-ui 10.0.5 → 10.1.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.
- package/dist/{chunk-CYNHK27D.js → chunk-AVHD2JXX.js} +3 -1
- package/dist/chunk-SHMZYIS4.js +219 -0
- package/dist/components/accordion.js +10 -8
- package/dist/components/api.d.mts +5 -5
- package/dist/components/api.js +1 -4
- package/dist/components/card.d.mts +2 -2
- package/dist/components/dialog/search-algolia.d.mts +3 -5
- package/dist/components/dialog/search-algolia.js +3 -11
- package/dist/components/dialog/search-default.d.mts +3 -5
- package/dist/components/dialog/search-default.js +5 -9
- package/dist/components/dialog/search.d.mts +5 -9
- package/dist/components/dialog/search.js +3 -5
- package/dist/components/files.d.mts +3 -3
- package/dist/components/heading.d.mts +1 -1
- package/dist/components/image-zoom.d.mts +1 -1
- package/dist/components/inline-toc.d.mts +1 -1
- package/dist/components/inline-toc.js +4 -1
- package/dist/components/roll-button.d.mts +1 -1
- package/dist/components/roll-button.js +3 -1
- package/dist/components/steps.d.mts +4 -4
- package/dist/components/steps.js +6 -2
- package/dist/components/tabs.d.mts +7 -7
- package/dist/components/type-table.d.mts +5 -7
- package/dist/components/type-table.js +5 -3
- package/dist/i18n.d.mts +2 -2
- package/dist/i18n.js +4 -2
- package/dist/{layout-W7dJ6OHQ.d.mts → layout-joG0n3LI.d.mts} +4 -4
- package/dist/layout.client.d.mts +2 -2
- package/dist/layout.client.js +34 -20
- package/dist/layout.d.mts +1 -1
- package/dist/layout.js +1 -2
- package/dist/mdx.client.d.mts +1 -1
- package/dist/mdx.d.mts +9 -8
- package/dist/page.client.d.mts +5 -5
- package/dist/page.client.js +6 -4
- package/dist/page.d.mts +3 -3
- package/dist/provider.d.mts +11 -7
- package/dist/provider.js +17 -11
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.js +0 -3
- package/dist/{tree-ersey5_u.d.mts → tree-cqNEopxM.d.mts} +1 -1
- package/package.json +10 -9
- package/dist/chunk-CUAH5G3U.js +0 -246
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Popover,
|
|
4
4
|
PopoverContent,
|
|
5
5
|
PopoverTrigger
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-AVHD2JXX.js";
|
|
7
7
|
import {
|
|
8
8
|
twMerge
|
|
9
9
|
} from "../chunk-TK3TM3MR.js";
|
|
@@ -14,7 +14,9 @@ import { InfoIcon } from "lucide-react";
|
|
|
14
14
|
import Link from "next/link";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
function Info({
|
|
17
|
+
function Info({
|
|
18
|
+
children
|
|
19
|
+
}) {
|
|
18
20
|
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
19
21
|
/* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(InfoIcon, { className: "size-4" }) }),
|
|
20
22
|
/* @__PURE__ */ jsx(PopoverContent, { className: "prose text-sm", children })
|
|
@@ -35,7 +37,7 @@ function TypeTable({
|
|
|
35
37
|
/* @__PURE__ */ jsx("thead", { className: "border-b", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
36
38
|
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-[45%]"), children: "Prop" }),
|
|
37
39
|
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-[30%]"), children: "Type" }),
|
|
38
|
-
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-
|
|
40
|
+
/* @__PURE__ */ jsx("th", { className: twMerge(th(), "w-1/4"), children: "Default" })
|
|
39
41
|
] }) }),
|
|
40
42
|
/* @__PURE__ */ jsx("tbody", { className: "border-collapse divide-y divide-border", children: Object.entries(type).map(([key, value]) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
41
43
|
/* @__PURE__ */ jsx("td", { className: td(), children: /* @__PURE__ */ jsxs("div", { className: field(), children: [
|
package/dist/i18n.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { N as NamedTranslation } from './i18n-dw7ODAws.mjs';
|
|
|
4
4
|
export { T as Translations } from './i18n-dw7ODAws.mjs';
|
|
5
5
|
|
|
6
6
|
type LanguageSelectProps = Omit<SelectProps, 'value' | 'onValueChange'>;
|
|
7
|
-
declare function LanguageSelect({ ...props }: LanguageSelectProps):
|
|
7
|
+
declare function LanguageSelect({ ...props }: LanguageSelectProps): React.ReactElement;
|
|
8
8
|
interface I18nProviderProps {
|
|
9
9
|
/**
|
|
10
10
|
* Force a locale
|
|
@@ -16,6 +16,6 @@ interface I18nProviderProps {
|
|
|
16
16
|
translations?: Record<string, NamedTranslation>;
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
}
|
|
19
|
-
declare function I18nProvider({ translations, locale: forceLocale, children, }: I18nProviderProps):
|
|
19
|
+
declare function I18nProvider({ translations, locale: forceLocale, children, }: I18nProviderProps): React.ReactElement;
|
|
20
20
|
|
|
21
21
|
export { I18nProvider, LanguageSelect, type LanguageSelectProps };
|
package/dist/i18n.js
CHANGED
|
@@ -40,7 +40,7 @@ var SelectContent = React.forwardRef(({ className, children, position = "popper"
|
|
|
40
40
|
{
|
|
41
41
|
ref,
|
|
42
42
|
className: twMerge(
|
|
43
|
-
"relative z-50 min-w-
|
|
43
|
+
"relative z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-popover-out data-[state=open]:animate-popover-in",
|
|
44
44
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
45
45
|
className
|
|
46
46
|
),
|
|
@@ -96,7 +96,9 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
96
96
|
|
|
97
97
|
// src/i18n.tsx
|
|
98
98
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
99
|
-
function LanguageSelect({
|
|
99
|
+
function LanguageSelect({
|
|
100
|
+
...props
|
|
101
|
+
}) {
|
|
100
102
|
const context = useI18n();
|
|
101
103
|
if (!context.translations)
|
|
102
104
|
throw new Error("Missing prop `translations`");
|
|
@@ -25,7 +25,7 @@ interface NavProps {
|
|
|
25
25
|
transparentMode?: 'always' | 'top' | 'none';
|
|
26
26
|
children?: ReactNode;
|
|
27
27
|
}
|
|
28
|
-
declare function Nav({ title, url, links, items, transparentMode, enableSidebar, collapsibleSidebar, children, }: NavProps):
|
|
28
|
+
declare function Nav({ title, url, links, items, transparentMode, enableSidebar, collapsibleSidebar, children, }: NavProps): React.ReactElement;
|
|
29
29
|
|
|
30
30
|
interface SidebarProps {
|
|
31
31
|
items: LinkItem[];
|
|
@@ -52,7 +52,7 @@ interface Components {
|
|
|
52
52
|
item: PageTree.Separator;
|
|
53
53
|
}>;
|
|
54
54
|
}
|
|
55
|
-
declare function Sidebar({ banner, footer, components, items, defaultOpenLevel, }: SidebarProps):
|
|
55
|
+
declare function Sidebar({ banner, footer, components, items, defaultOpenLevel, }: SidebarProps): React.ReactElement;
|
|
56
56
|
|
|
57
57
|
interface LinkItem {
|
|
58
58
|
url: string;
|
|
@@ -86,7 +86,7 @@ interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
86
86
|
sidebar?: Partial<SidebarOptions>;
|
|
87
87
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
88
88
|
}
|
|
89
|
-
declare function Layout({ nav, links, children, }: BaseLayoutProps):
|
|
90
|
-
declare function DocsLayout({ nav, sidebar, links, containerProps, tree, children, }: DocsLayoutProps):
|
|
89
|
+
declare function Layout({ nav, links, children, }: BaseLayoutProps): React.ReactElement;
|
|
90
|
+
declare function DocsLayout({ nav, sidebar, links, containerProps, tree, children, }: DocsLayoutProps): React.ReactElement;
|
|
91
91
|
|
|
92
92
|
export { type BaseLayoutProps as B, type DocsLayoutProps as D, type LinkItem as L, Nav as N, Sidebar as S, Layout as a, DocsLayout as b };
|
package/dist/layout.client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as TreeContextProvider } from './tree-
|
|
2
|
-
export { N as Nav, S as Sidebar } from './layout-
|
|
1
|
+
export { T as TreeContextProvider } from './tree-cqNEopxM.mjs';
|
|
2
|
+
export { N as Nav, S as Sidebar } from './layout-joG0n3LI.mjs';
|
|
3
3
|
import 'fumadocs-core/server';
|
|
4
4
|
import 'react';
|
package/dist/layout.client.js
CHANGED
|
@@ -12,9 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-VYTHQTZE.js";
|
|
13
13
|
import {
|
|
14
14
|
Popover,
|
|
15
|
+
PopoverClose,
|
|
15
16
|
PopoverContent,
|
|
16
17
|
PopoverTrigger
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AVHD2JXX.js";
|
|
18
19
|
import {
|
|
19
20
|
hasActive,
|
|
20
21
|
isActive
|
|
@@ -56,7 +57,6 @@ import {
|
|
|
56
57
|
useState,
|
|
57
58
|
useCallback as useCallback2
|
|
58
59
|
} from "react";
|
|
59
|
-
import { PopoverClose } from "@radix-ui/react-popover";
|
|
60
60
|
|
|
61
61
|
// src/components/theme-toggle.tsx
|
|
62
62
|
import { cva } from "class-variance-authority";
|
|
@@ -132,7 +132,14 @@ function Nav({
|
|
|
132
132
|
transparent ? "border-transparent" : "border-foreground/10 bg-background/50 backdrop-blur-md"
|
|
133
133
|
),
|
|
134
134
|
children: /* @__PURE__ */ jsxs2("nav", { className: "container flex h-full flex-row items-center gap-4", children: [
|
|
135
|
-
/* @__PURE__ */ jsx2(
|
|
135
|
+
/* @__PURE__ */ jsx2(
|
|
136
|
+
Link,
|
|
137
|
+
{
|
|
138
|
+
href: url,
|
|
139
|
+
className: "inline-flex items-center gap-3 font-semibold",
|
|
140
|
+
children: title
|
|
141
|
+
}
|
|
142
|
+
),
|
|
136
143
|
children,
|
|
137
144
|
items.map((item) => /* @__PURE__ */ jsx2(NavItem, { item, className: "max-lg:hidden" }, item.url)),
|
|
138
145
|
/* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-row items-center justify-end md:gap-2", children: [
|
|
@@ -164,7 +171,7 @@ function Nav({
|
|
|
164
171
|
"div",
|
|
165
172
|
{
|
|
166
173
|
className: twMerge(
|
|
167
|
-
"flex flex-row items-center border-
|
|
174
|
+
"flex flex-row items-center border-s ps-2 max-md:hidden",
|
|
168
175
|
links.length === 0 && "hidden"
|
|
169
176
|
),
|
|
170
177
|
children: links.map((item) => /* @__PURE__ */ jsx2(
|
|
@@ -216,9 +223,9 @@ function SearchToggle() {
|
|
|
216
223
|
className: "inline-flex w-full max-w-[240px] items-center gap-2 rounded-full border bg-secondary/50 p-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground max-md:hidden",
|
|
217
224
|
onClick,
|
|
218
225
|
children: [
|
|
219
|
-
/* @__PURE__ */ jsx2(SearchIcon, { "aria-label": "Open Search", className: "
|
|
226
|
+
/* @__PURE__ */ jsx2(SearchIcon, { "aria-label": "Open Search", className: "ms-1 size-4" }),
|
|
220
227
|
text.search,
|
|
221
|
-
/* @__PURE__ */ jsxs2("div", { className: "
|
|
228
|
+
/* @__PURE__ */ jsxs2("div", { className: "ms-auto inline-flex gap-0.5 text-xs", children: [
|
|
222
229
|
/* @__PURE__ */ jsx2("kbd", { className: shortcut(), children: "\u2318" }),
|
|
223
230
|
/* @__PURE__ */ jsx2("kbd", { className: shortcut(), children: "K" })
|
|
224
231
|
] })
|
|
@@ -227,7 +234,9 @@ function SearchToggle() {
|
|
|
227
234
|
)
|
|
228
235
|
] });
|
|
229
236
|
}
|
|
230
|
-
function SidebarToggle({
|
|
237
|
+
function SidebarToggle({
|
|
238
|
+
collapsible
|
|
239
|
+
}) {
|
|
231
240
|
const [open, setOpen] = useSidebarCollapse();
|
|
232
241
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
233
242
|
/* @__PURE__ */ jsx2(
|
|
@@ -274,8 +283,8 @@ var NavItem = forwardRef(({ item, className, ...props }, ref) => {
|
|
|
274
283
|
href: url,
|
|
275
284
|
external,
|
|
276
285
|
className: twMerge(
|
|
277
|
-
"text-sm text-muted-foreground",
|
|
278
|
-
isActive(url, pathname) ? "font-medium text-accent-foreground" : "
|
|
286
|
+
"text-sm text-muted-foreground transition-colors",
|
|
287
|
+
isActive(url, pathname) ? "font-medium text-accent-foreground" : "hover:text-accent-foreground",
|
|
279
288
|
className
|
|
280
289
|
),
|
|
281
290
|
...props,
|
|
@@ -361,7 +370,11 @@ function Sidebar({
|
|
|
361
370
|
}
|
|
362
371
|
);
|
|
363
372
|
}
|
|
364
|
-
function NodeList({
|
|
373
|
+
function NodeList({
|
|
374
|
+
items,
|
|
375
|
+
level = 0,
|
|
376
|
+
...props
|
|
377
|
+
}) {
|
|
365
378
|
const { components } = useContext(SidebarContext);
|
|
366
379
|
return /* @__PURE__ */ jsx3("div", { ...props, children: items.map((item) => {
|
|
367
380
|
const id = `${item.type}_${item.name}`;
|
|
@@ -381,7 +394,7 @@ function BaseItem({
|
|
|
381
394
|
}) {
|
|
382
395
|
const pathname = usePathname2();
|
|
383
396
|
const active = isActive(item.url, pathname, nested);
|
|
384
|
-
const
|
|
397
|
+
const icon = item.icon ?? (item.external ? /* @__PURE__ */ jsx3(ExternalLinkIcon, {}) : null);
|
|
385
398
|
return /* @__PURE__ */ jsxs3(
|
|
386
399
|
Link2,
|
|
387
400
|
{
|
|
@@ -389,7 +402,7 @@ function BaseItem({
|
|
|
389
402
|
external: item.external,
|
|
390
403
|
className: twMerge(itemVariants({ active })),
|
|
391
404
|
children: [
|
|
392
|
-
|
|
405
|
+
icon,
|
|
393
406
|
item.text
|
|
394
407
|
]
|
|
395
408
|
}
|
|
@@ -406,13 +419,12 @@ function FolderNode({
|
|
|
406
419
|
() => hasActive(children, pathname),
|
|
407
420
|
[children, pathname]
|
|
408
421
|
);
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
);
|
|
422
|
+
const shouldExtend = active || childActive || defaultOpenLevel >= level || defaultOpen;
|
|
423
|
+
const [extend, setExtend] = useState2(shouldExtend);
|
|
412
424
|
useEffect2(() => {
|
|
413
|
-
if (
|
|
425
|
+
if (shouldExtend)
|
|
414
426
|
setExtend(true);
|
|
415
|
-
}, [
|
|
427
|
+
}, [shouldExtend]);
|
|
416
428
|
const content = /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
417
429
|
icon,
|
|
418
430
|
name,
|
|
@@ -423,7 +435,7 @@ function FolderNode({
|
|
|
423
435
|
setExtend((prev) => !prev);
|
|
424
436
|
e.preventDefault();
|
|
425
437
|
},
|
|
426
|
-
className: twMerge("
|
|
438
|
+
className: twMerge("ms-auto transition-transform", !extend && "-rotate-90")
|
|
427
439
|
}
|
|
428
440
|
)
|
|
429
441
|
] });
|
|
@@ -444,7 +456,7 @@ function FolderNode({
|
|
|
444
456
|
/* @__PURE__ */ jsx3(CollapsibleContent, { children: /* @__PURE__ */ jsx3(
|
|
445
457
|
NodeList,
|
|
446
458
|
{
|
|
447
|
-
className: "
|
|
459
|
+
className: "ms-4 flex flex-col border-s py-2 ps-2",
|
|
448
460
|
items: children,
|
|
449
461
|
level
|
|
450
462
|
}
|
|
@@ -453,7 +465,9 @@ function FolderNode({
|
|
|
453
465
|
}
|
|
454
466
|
);
|
|
455
467
|
}
|
|
456
|
-
function SeparatorNode({
|
|
468
|
+
function SeparatorNode({
|
|
469
|
+
item
|
|
470
|
+
}) {
|
|
457
471
|
return /* @__PURE__ */ jsx3("p", { className: "mb-2 mt-8 px-2 font-medium first:mt-0", children: item.name });
|
|
458
472
|
}
|
|
459
473
|
export {
|
package/dist/layout.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'fumadocs-core/server';
|
|
2
2
|
import 'react';
|
|
3
|
-
export { B as BaseLayoutProps, b as DocsLayout, D as DocsLayoutProps, a as Layout, L as LinkItem } from './layout-
|
|
3
|
+
export { B as BaseLayoutProps, b as DocsLayout, D as DocsLayoutProps, a as Layout, L as LinkItem } from './layout-joG0n3LI.mjs';
|
package/dist/layout.js
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import "./chunk-6C3VEZWH.js";
|
|
13
13
|
|
|
14
14
|
// src/layout.tsx
|
|
15
|
-
import { GithubIcon } from "lucide-react";
|
|
16
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
16
|
function Layout({
|
|
18
17
|
nav = {},
|
|
@@ -71,7 +70,7 @@ function getNav(enableSidebar, collapsibleSidebar, items, { githubUrl, links, ..
|
|
|
71
70
|
{
|
|
72
71
|
href: githubUrl,
|
|
73
72
|
label: "Github",
|
|
74
|
-
icon: /* @__PURE__ */ jsx(
|
|
73
|
+
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" }) }),
|
|
75
74
|
external: true
|
|
76
75
|
}
|
|
77
76
|
];
|
package/dist/mdx.client.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CodeBlockProps } from './components/codeblock.mjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
|
-
declare function Pre({ title, allowCopy, icon, ...props }: CodeBlockProps):
|
|
4
|
+
declare function Pre({ title, allowCopy, icon, ...props }: CodeBlockProps): React.ReactElement;
|
|
5
5
|
|
|
6
6
|
export { Pre };
|
package/dist/mdx.d.mts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { FC, HTMLAttributes, AnchorHTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from 'react';
|
|
2
3
|
import { Card, Cards } from './components/card.mjs';
|
|
3
4
|
import 'fumadocs-core/link';
|
|
4
5
|
|
|
5
|
-
declare function Image(props: ImgHTMLAttributes<HTMLImageElement>):
|
|
6
|
-
declare function Table(props: TableHTMLAttributes<HTMLTableElement>):
|
|
6
|
+
declare function Image(props: ImgHTMLAttributes<HTMLImageElement>): React.ReactElement;
|
|
7
|
+
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): React.ReactElement;
|
|
7
8
|
declare const defaultMdxComponents: {
|
|
8
9
|
pre: FC<HTMLAttributes<HTMLPreElement>>;
|
|
9
10
|
Card: typeof Card;
|
|
10
11
|
Cards: typeof Cards;
|
|
11
12
|
a: FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
12
13
|
img: typeof Image;
|
|
13
|
-
h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element;
|
|
14
|
-
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element;
|
|
15
|
-
h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element;
|
|
16
|
-
h4: (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element;
|
|
17
|
-
h5: (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element;
|
|
18
|
-
h6: (props: React.HTMLAttributes<HTMLHeadingElement>) => JSX.Element;
|
|
14
|
+
h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
h3: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
h4: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
18
|
+
h5: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
19
|
+
h6: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
19
20
|
table: typeof Table;
|
|
20
21
|
};
|
|
21
22
|
/**
|
package/dist/page.client.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TOCItemType } from 'fumadocs-core/server';
|
|
2
2
|
|
|
3
|
-
declare function TOCItems({ items }: {
|
|
3
|
+
declare function TOCItems({ items, }: {
|
|
4
4
|
items: TOCItemType[];
|
|
5
|
-
}):
|
|
5
|
+
}): React.ReactElement;
|
|
6
6
|
|
|
7
|
-
declare function Breadcrumb():
|
|
7
|
+
declare function Breadcrumb(): React.ReactElement;
|
|
8
8
|
|
|
9
9
|
declare function LastUpdate(props: {
|
|
10
10
|
date: Date;
|
|
11
|
-
}):
|
|
11
|
+
}): React.ReactElement;
|
|
12
12
|
interface FooterProps {
|
|
13
13
|
/**
|
|
14
14
|
* Items including information for the next and previous page
|
|
@@ -24,6 +24,6 @@ interface FooterProps {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
declare function Footer({ items }: FooterProps):
|
|
27
|
+
declare function Footer({ items }: FooterProps): React.ReactElement;
|
|
28
28
|
|
|
29
29
|
export { Breadcrumb, Footer, type FooterProps, LastUpdate, TOCItems };
|
package/dist/page.client.js
CHANGED
|
@@ -27,7 +27,9 @@ import { TextIcon } from "lucide-react";
|
|
|
27
27
|
import * as Primitive from "fumadocs-core/toc";
|
|
28
28
|
import { useEffect, useRef } from "react";
|
|
29
29
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
-
function TOCItems({
|
|
30
|
+
function TOCItems({
|
|
31
|
+
items
|
|
32
|
+
}) {
|
|
31
33
|
const { text } = useI18n();
|
|
32
34
|
const containerRef = useRef(null);
|
|
33
35
|
const markerRef = useRef(null);
|
|
@@ -35,8 +37,8 @@ function TOCItems({ items }) {
|
|
|
35
37
|
const element = markerRef.current;
|
|
36
38
|
if (!element)
|
|
37
39
|
return;
|
|
38
|
-
element.style.setProperty("top", `${top}px`);
|
|
39
|
-
element.style.setProperty("height", `${height}px`);
|
|
40
|
+
element.style.setProperty("top", `${top.toString()}px`);
|
|
41
|
+
element.style.setProperty("height", `${height.toString()}px`);
|
|
40
42
|
element.style.setProperty("display", `block`);
|
|
41
43
|
};
|
|
42
44
|
return /* @__PURE__ */ jsx(ScrollArea, { className: "pt-4 text-sm first:pt-0", children: /* @__PURE__ */ jsx(ScrollViewport, { className: "relative", ref: containerRef, children: /* @__PURE__ */ jsxs(Primitive.TOCScrollProvider, { containerRef, toc: items, children: [
|
|
@@ -154,7 +156,7 @@ function Footer({ items }) {
|
|
|
154
156
|
/* @__PURE__ */ jsx3(ChevronLeftIcon, { className: "size-5 shrink-0" }),
|
|
155
157
|
/* @__PURE__ */ jsx3("p", { className: "font-medium text-foreground", children: previous.name })
|
|
156
158
|
] }) : null,
|
|
157
|
-
next ? /* @__PURE__ */ jsxs3(Link2, { href: next.url, className: footerItem({ className: "
|
|
159
|
+
next ? /* @__PURE__ */ jsxs3(Link2, { href: next.url, className: footerItem({ className: "ms-auto" }), children: [
|
|
158
160
|
/* @__PURE__ */ jsx3("p", { className: "text-end font-medium text-foreground", children: next.name }),
|
|
159
161
|
/* @__PURE__ */ jsx3(ChevronRightIcon2, { className: "size-5 shrink-0" })
|
|
160
162
|
] }) : null
|
package/dist/page.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
2
|
import { ReactNode, HTMLAttributes } from 'react';
|
|
3
3
|
import { TableOfContents, TOCItemType } from 'fumadocs-core/server';
|
|
4
4
|
import { FooterProps } from './page.client.mjs';
|
|
@@ -29,7 +29,7 @@ interface DocsPageProps {
|
|
|
29
29
|
lastUpdate?: Date | string | number;
|
|
30
30
|
children: ReactNode;
|
|
31
31
|
}
|
|
32
|
-
declare function DocsPage({ tableOfContent, breadcrumb, footer, ...props }: DocsPageProps):
|
|
32
|
+
declare function DocsPage({ tableOfContent, breadcrumb, footer, ...props }: DocsPageProps): React.ReactElement;
|
|
33
33
|
interface TOCProps {
|
|
34
34
|
items: TOCItemType[];
|
|
35
35
|
/**
|
|
@@ -44,6 +44,6 @@ interface TOCProps {
|
|
|
44
44
|
/**
|
|
45
45
|
* Add typography styles
|
|
46
46
|
*/
|
|
47
|
-
declare const DocsBody: React.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
declare const DocsBody: React$1.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
48
48
|
|
|
49
49
|
export { DocsBody, DocsPage, type DocsPageProps };
|
package/dist/provider.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
import { DefaultSearchDialogProps } from './components/dialog/search-default.mjs';
|
|
4
4
|
import { SearchLink, SharedProps } from './components/dialog/search.mjs';
|
|
5
5
|
export { u as useI18n } from './i18n-dw7ODAws.mjs';
|
|
6
|
-
export { u as useTreeContext } from './tree-
|
|
6
|
+
export { u as useTreeContext } from './tree-cqNEopxM.mjs';
|
|
7
7
|
import 'fumadocs-core/search/shared';
|
|
8
8
|
import 'fumadocs-core/server';
|
|
9
9
|
|
|
@@ -23,12 +23,12 @@ interface SearchProviderProps {
|
|
|
23
23
|
*
|
|
24
24
|
* It receives the `open` and `onOpenChange` prop, can be lazy loaded with `next/dynamic`
|
|
25
25
|
*/
|
|
26
|
-
SearchDialog: ComponentType<SharedProps>;
|
|
26
|
+
SearchDialog: React$1.ComponentType<SharedProps>;
|
|
27
27
|
/**
|
|
28
28
|
* Additional props to the dialog
|
|
29
29
|
*/
|
|
30
30
|
options?: object;
|
|
31
|
-
children?: ReactNode;
|
|
31
|
+
children?: React$1.ReactNode;
|
|
32
32
|
}
|
|
33
33
|
interface SearchContextType {
|
|
34
34
|
setOpenSearch: (value: boolean) => void;
|
|
@@ -36,10 +36,14 @@ interface SearchContextType {
|
|
|
36
36
|
declare function useSearchContext(): SearchContextType;
|
|
37
37
|
|
|
38
38
|
type SidebarCollapseContext = [open: boolean, setOpen: (v: boolean) => void];
|
|
39
|
-
declare const SidebarCollapseContext: React.Context<SidebarCollapseContext | undefined>;
|
|
39
|
+
declare const SidebarCollapseContext: React$1.Context<SidebarCollapseContext | undefined>;
|
|
40
40
|
declare function useSidebarCollapse(): SidebarCollapseContext;
|
|
41
41
|
|
|
42
42
|
interface RootProviderProps {
|
|
43
|
+
/**
|
|
44
|
+
* `dir` option for Radix UI
|
|
45
|
+
*/
|
|
46
|
+
dir?: 'rtl' | 'ltr';
|
|
43
47
|
/**
|
|
44
48
|
* @remarks `SearchProviderProps`
|
|
45
49
|
*/
|
|
@@ -54,6 +58,6 @@ interface RootProviderProps {
|
|
|
54
58
|
enableThemeProvider?: boolean;
|
|
55
59
|
children: ReactNode;
|
|
56
60
|
}
|
|
57
|
-
declare function RootProvider({ children, enableThemeProvider, search, }: RootProviderProps):
|
|
61
|
+
declare function RootProvider({ children, dir, enableThemeProvider, search, }: RootProviderProps): React.ReactElement;
|
|
58
62
|
|
|
59
63
|
export { RootProvider, type RootProviderProps, useSearchContext, useSidebarCollapse };
|
package/dist/provider.js
CHANGED
|
@@ -20,6 +20,7 @@ import "./chunk-6C3VEZWH.js";
|
|
|
20
20
|
import { SidebarProvider } from "fumadocs-core/sidebar";
|
|
21
21
|
import { ThemeProvider } from "next-themes";
|
|
22
22
|
import dynamic from "next/dynamic";
|
|
23
|
+
import { DirectionProvider } from "@radix-ui/react-direction";
|
|
23
24
|
import { jsx } from "react/jsx-runtime";
|
|
24
25
|
var DefaultSearchDialog = dynamic(
|
|
25
26
|
() => import("./components/dialog/search-default.js"),
|
|
@@ -27,20 +28,25 @@ var DefaultSearchDialog = dynamic(
|
|
|
27
28
|
);
|
|
28
29
|
function RootProvider({
|
|
29
30
|
children,
|
|
31
|
+
dir,
|
|
30
32
|
enableThemeProvider = true,
|
|
31
33
|
search
|
|
32
34
|
}) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
let body = /* @__PURE__ */ jsx(SidebarProvider, { children: /* @__PURE__ */ jsx(SidebarCollapseProvider, { children: /* @__PURE__ */ jsx(SearchProvider, { SearchDialog: DefaultSearchDialog, ...search, children }) }) });
|
|
36
|
+
if (enableThemeProvider)
|
|
37
|
+
body = /* @__PURE__ */ jsx(
|
|
38
|
+
ThemeProvider,
|
|
39
|
+
{
|
|
40
|
+
attribute: "class",
|
|
41
|
+
defaultTheme: "system",
|
|
42
|
+
enableSystem: true,
|
|
43
|
+
disableTransitionOnChange: true,
|
|
44
|
+
children: body
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
if (dir)
|
|
48
|
+
body = /* @__PURE__ */ jsx(DirectionProvider, { dir, children: body });
|
|
49
|
+
return body;
|
|
44
50
|
}
|
|
45
51
|
export {
|
|
46
52
|
RootProvider,
|