fumadocs-ui 12.1.1 → 12.1.3
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-45QF3XKA.js → chunk-BHP6OUWK.js} +1 -1
- package/dist/{chunk-YJDZJ4BG.js → chunk-IOZPSMRL.js} +68 -22
- package/dist/chunk-MXPAPA74.js +106 -0
- package/dist/chunk-NUPTR2L5.js +166 -0
- package/dist/components/accordion.js +6 -100
- package/dist/components/api.d.ts +19 -1
- package/dist/components/api.js +44 -29
- package/dist/components/dialog/search-algolia.js +2 -2
- package/dist/components/dialog/search-default.js +2 -2
- package/dist/components/dialog/search.js +2 -2
- package/dist/components/tabs.js +7 -157
- package/dist/docs.client.d.ts +3 -3
- package/dist/docs.client.js +18 -13
- package/dist/{layout.client-BzAmSQXB.d.ts → layout-DAwDgfTa.d.ts} +20 -19
- package/dist/layout.client.d.ts +8 -2
- package/dist/layout.client.js +42 -73
- package/dist/layout.d.ts +1 -1
- package/dist/layout.js +1 -1
- package/dist/page.client.d.ts +2 -2
- package/dist/page.client.js +14 -4
- package/dist/page.d.ts +7 -1
- package/dist/page.js +12 -5
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/{chunk-FSPYEOFC.js → chunk-ET4TW6M5.js} +4 -4
package/dist/components/api.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Tab,
|
|
4
|
+
Tabs
|
|
5
|
+
} from "../chunk-NUPTR2L5.js";
|
|
6
|
+
import {
|
|
7
|
+
Accordion,
|
|
8
|
+
Accordions
|
|
9
|
+
} from "../chunk-MXPAPA74.js";
|
|
10
|
+
import "../chunk-2KMKNVSN.js";
|
|
11
|
+
import "../chunk-H5USAX5W.js";
|
|
5
12
|
import {
|
|
6
13
|
twMerge
|
|
7
14
|
} from "../chunk-TK3TM3MR.js";
|
|
8
15
|
import "../chunk-MLKGABMK.js";
|
|
9
16
|
|
|
10
17
|
// src/components/api.tsx
|
|
11
|
-
import { useState } from "react";
|
|
12
18
|
import { cva } from "class-variance-authority";
|
|
13
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
20
|
function Root({
|
|
@@ -89,42 +95,51 @@ function APIExample({
|
|
|
89
95
|
className,
|
|
90
96
|
...props
|
|
91
97
|
}) {
|
|
92
|
-
|
|
93
|
-
return /* @__PURE__ */ jsxs(
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
94
99
|
"div",
|
|
95
100
|
{
|
|
96
101
|
className: twMerge("sticky top-6 h-fit xl:w-2/5 xl:min-w-[400px]", className),
|
|
97
102
|
...props,
|
|
98
|
-
children
|
|
99
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-4 xl:hidden", children: [
|
|
100
|
-
/* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-border" }),
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
102
|
-
"button",
|
|
103
|
-
{
|
|
104
|
-
type: "button",
|
|
105
|
-
className: twMerge(
|
|
106
|
-
buttonVariants({
|
|
107
|
-
color: "secondary",
|
|
108
|
-
size: "lg"
|
|
109
|
-
})
|
|
110
|
-
),
|
|
111
|
-
onClick: () => {
|
|
112
|
-
setIsOpen((v) => !v);
|
|
113
|
-
},
|
|
114
|
-
children: "More Details"
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-border" })
|
|
118
|
-
] }),
|
|
119
|
-
/* @__PURE__ */ jsx("div", { className: twMerge(!isOpen && "max-xl:hidden"), children })
|
|
120
|
-
]
|
|
103
|
+
children
|
|
121
104
|
}
|
|
122
105
|
);
|
|
123
106
|
}
|
|
107
|
+
var Responses = Tabs;
|
|
108
|
+
var Response = Tab;
|
|
109
|
+
var Requests = Tabs;
|
|
110
|
+
var Request = Tab;
|
|
111
|
+
function ResponseTypes(props) {
|
|
112
|
+
return /* @__PURE__ */ jsx(
|
|
113
|
+
Accordions,
|
|
114
|
+
{
|
|
115
|
+
type: "single",
|
|
116
|
+
className: "!-m-4 border-none pt-2",
|
|
117
|
+
defaultValue: "Response",
|
|
118
|
+
children: props.children
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function ExampleResponse(props) {
|
|
123
|
+
return /* @__PURE__ */ jsx(Accordion, { title: "Response", children: props.children });
|
|
124
|
+
}
|
|
125
|
+
function TypeScriptResponse(props) {
|
|
126
|
+
return /* @__PURE__ */ jsx(Accordion, { title: "Typescript", children: props.children });
|
|
127
|
+
}
|
|
128
|
+
function ObjectCollapsible(props) {
|
|
129
|
+
return /* @__PURE__ */ jsx(Accordions, { type: "single", children: /* @__PURE__ */ jsx(Accordion, { title: "Object Type", children: props.children }) });
|
|
130
|
+
}
|
|
124
131
|
export {
|
|
125
132
|
API,
|
|
126
133
|
APIExample,
|
|
127
134
|
APIInfo,
|
|
135
|
+
ExampleResponse,
|
|
136
|
+
ObjectCollapsible,
|
|
128
137
|
Property,
|
|
129
|
-
|
|
138
|
+
Request,
|
|
139
|
+
Requests,
|
|
140
|
+
Response,
|
|
141
|
+
ResponseTypes,
|
|
142
|
+
Responses,
|
|
143
|
+
Root,
|
|
144
|
+
TypeScriptResponse
|
|
130
145
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SearchDialog
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-BHP6OUWK.js";
|
|
5
5
|
import "../../chunk-3F57TIUQ.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-ET4TW6M5.js";
|
|
7
7
|
import "../../chunk-HLGNIWUN.js";
|
|
8
8
|
import "../../chunk-H5USAX5W.js";
|
|
9
9
|
import "../../chunk-TK3TM3MR.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SearchDialog
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-BHP6OUWK.js";
|
|
5
5
|
import "../../chunk-3F57TIUQ.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-ET4TW6M5.js";
|
|
7
7
|
import {
|
|
8
8
|
useI18n
|
|
9
9
|
} from "../../chunk-HLGNIWUN.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SearchDialog
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-BHP6OUWK.js";
|
|
4
4
|
import "../../chunk-3F57TIUQ.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-ET4TW6M5.js";
|
|
6
6
|
import "../../chunk-HLGNIWUN.js";
|
|
7
7
|
import "../../chunk-H5USAX5W.js";
|
|
8
8
|
import "../../chunk-TK3TM3MR.js";
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,163 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// src/components/tabs.tsx
|
|
10
|
-
import {
|
|
11
|
-
useEffect,
|
|
12
|
-
useMemo,
|
|
13
|
-
useState,
|
|
14
|
-
useCallback
|
|
15
|
-
} from "react";
|
|
16
|
-
|
|
17
|
-
// src/components/ui/tabs.tsx
|
|
18
|
-
var tabs_exports = {};
|
|
19
|
-
__export(tabs_exports, {
|
|
20
|
-
Tabs: () => Tabs,
|
|
21
|
-
TabsContent: () => TabsContent,
|
|
22
|
-
TabsList: () => TabsList,
|
|
23
|
-
TabsTrigger: () => TabsTrigger
|
|
24
|
-
});
|
|
25
|
-
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
26
|
-
import * as React from "react";
|
|
27
|
-
import { jsx } from "react/jsx-runtime";
|
|
28
|
-
var Tabs = React.forwardRef((props, ref) => {
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
TabsPrimitive.Root,
|
|
31
|
-
{
|
|
32
|
-
ref,
|
|
33
|
-
...props,
|
|
34
|
-
className: twMerge(
|
|
35
|
-
"flex flex-col overflow-hidden rounded-xl border bg-card",
|
|
36
|
-
props.className
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
Tabs.displayName = "Tabs";
|
|
42
|
-
var TabsList = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
43
|
-
TabsPrimitive.List,
|
|
44
|
-
{
|
|
45
|
-
ref,
|
|
46
|
-
...props,
|
|
47
|
-
className: twMerge(
|
|
48
|
-
"flex flex-row items-end gap-4 overflow-x-auto bg-secondary px-4 text-muted-foreground",
|
|
49
|
-
props.className
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
));
|
|
53
|
-
TabsList.displayName = "TabsList";
|
|
54
|
-
var TabsTrigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
55
|
-
TabsPrimitive.Trigger,
|
|
56
|
-
{
|
|
57
|
-
ref,
|
|
58
|
-
...props,
|
|
59
|
-
className: twMerge(
|
|
60
|
-
"whitespace-nowrap border-b border-transparent py-2 text-sm font-medium transition-colors hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-primary data-[state=active]:text-primary",
|
|
61
|
-
props.className
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
));
|
|
65
|
-
TabsTrigger.displayName = "TabsTrigger";
|
|
66
|
-
var TabsContent = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
67
|
-
TabsPrimitive.Content,
|
|
68
|
-
{
|
|
69
|
-
ref,
|
|
70
|
-
...props,
|
|
71
|
-
className: twMerge("p-4", props.className)
|
|
72
|
-
}
|
|
73
|
-
));
|
|
74
|
-
TabsContent.displayName = "TabsContent";
|
|
75
|
-
|
|
76
|
-
// src/components/tabs.tsx
|
|
77
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
78
|
-
var listeners = /* @__PURE__ */ new Map();
|
|
79
|
-
function addChangeListener(id, listener) {
|
|
80
|
-
const list = listeners.get(id) ?? [];
|
|
81
|
-
list.push(listener);
|
|
82
|
-
listeners.set(id, list);
|
|
83
|
-
}
|
|
84
|
-
function removeChangeListener(id, listener) {
|
|
85
|
-
const list = listeners.get(id) ?? [];
|
|
86
|
-
listeners.set(
|
|
87
|
-
id,
|
|
88
|
-
list.filter((item) => item !== listener)
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
function update(id, v, persist) {
|
|
92
|
-
listeners.get(id)?.forEach((item) => {
|
|
93
|
-
item(v);
|
|
94
|
-
});
|
|
95
|
-
if (persist) localStorage.setItem(id, v);
|
|
96
|
-
else sessionStorage.setItem(id, v);
|
|
97
|
-
}
|
|
98
|
-
function Tabs2({
|
|
99
|
-
id,
|
|
100
|
-
items = [],
|
|
101
|
-
persist = false,
|
|
102
|
-
defaultIndex = 0,
|
|
103
|
-
children
|
|
104
|
-
}) {
|
|
105
|
-
const values = useMemo(() => items.map((item) => toValue(item)), [items]);
|
|
106
|
-
const [value, setValue] = useState(values[defaultIndex]);
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
if (!id) return;
|
|
109
|
-
const onUpdate = (v) => {
|
|
110
|
-
if (values.includes(v)) setValue(v);
|
|
111
|
-
};
|
|
112
|
-
const previous = persist ? localStorage.getItem(id) : sessionStorage.getItem(id);
|
|
113
|
-
if (previous) onUpdate(previous);
|
|
114
|
-
addChangeListener(id, onUpdate);
|
|
115
|
-
return () => {
|
|
116
|
-
removeChangeListener(id, onUpdate);
|
|
117
|
-
};
|
|
118
|
-
}, [id, persist, values]);
|
|
119
|
-
const onValueChange = useCallback((v) => {
|
|
120
|
-
if (id) {
|
|
121
|
-
update(id, v, persist);
|
|
122
|
-
} else {
|
|
123
|
-
setValue(v);
|
|
124
|
-
}
|
|
125
|
-
}, []);
|
|
126
|
-
return /* @__PURE__ */ jsxs(
|
|
127
|
-
Tabs,
|
|
128
|
-
{
|
|
129
|
-
value,
|
|
130
|
-
onValueChange,
|
|
131
|
-
className: "my-4",
|
|
132
|
-
children: [
|
|
133
|
-
/* @__PURE__ */ jsx2(TabsList, { children: values.map((v, i) => /* @__PURE__ */ jsx2(TabsTrigger, { value: v, children: items[i] }, v)) }),
|
|
134
|
-
children
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
function toValue(v) {
|
|
140
|
-
return v.toLowerCase().replace(/\s/, "-");
|
|
141
|
-
}
|
|
142
|
-
function Tab({
|
|
143
|
-
value,
|
|
144
|
-
className,
|
|
145
|
-
...props
|
|
146
|
-
}) {
|
|
147
|
-
return /* @__PURE__ */ jsx2(
|
|
148
|
-
TabsContent,
|
|
149
|
-
{
|
|
150
|
-
value: toValue(value),
|
|
151
|
-
className: twMerge(
|
|
152
|
-
"prose-no-margin [&>figure:only-child]:-m-4 [&>figure:only-child]:rounded-none [&>figure:only-child]:border-none",
|
|
153
|
-
className
|
|
154
|
-
),
|
|
155
|
-
...props
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
3
|
+
Tab,
|
|
4
|
+
Tabs,
|
|
5
|
+
tabs_exports
|
|
6
|
+
} from "../chunk-NUPTR2L5.js";
|
|
7
|
+
import "../chunk-TK3TM3MR.js";
|
|
8
|
+
import "../chunk-MLKGABMK.js";
|
|
159
9
|
export {
|
|
160
10
|
tabs_exports as Primitive,
|
|
161
11
|
Tab,
|
|
162
|
-
|
|
12
|
+
Tabs
|
|
163
13
|
};
|
package/dist/docs.client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LinkItemType, S as SidebarProps,
|
|
2
|
-
export {
|
|
1
|
+
import { L as LinkItemType, S as SidebarProps, a as SharedNavProps } from './layout-DAwDgfTa.js';
|
|
2
|
+
export { b as Sidebar } from './layout-DAwDgfTa.js';
|
|
3
3
|
export { T as TreeContextProvider } from './tree-CrKzI9Nz.js';
|
|
4
4
|
import { ButtonHTMLAttributes } from 'react';
|
|
5
5
|
import 'fumadocs-core/server';
|
|
@@ -14,6 +14,6 @@ declare function DynamicSidebar(props: SidebarProps): React.ReactElement;
|
|
|
14
14
|
|
|
15
15
|
declare function ThemeToggle({ className, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): React.ReactElement;
|
|
16
16
|
|
|
17
|
-
declare function SubNav({ title, url, children, enableSearch, }:
|
|
17
|
+
declare function SubNav({ title, url, transparentMode, children, enableSearch, }: SharedNavProps): React.ReactElement;
|
|
18
18
|
|
|
19
19
|
export { DynamicSidebar, LinksMenu, SubNav, ThemeToggle };
|
package/dist/docs.client.js
CHANGED
|
@@ -3,9 +3,11 @@ import {
|
|
|
3
3
|
LargeSearchToggle,
|
|
4
4
|
LinkItem,
|
|
5
5
|
LinksMenu,
|
|
6
|
+
NavBox,
|
|
6
7
|
SearchToggle,
|
|
7
|
-
ThemeToggle
|
|
8
|
-
|
|
8
|
+
ThemeToggle,
|
|
9
|
+
Title
|
|
10
|
+
} from "./chunk-IOZPSMRL.js";
|
|
9
11
|
import {
|
|
10
12
|
ScrollArea,
|
|
11
13
|
ScrollViewport
|
|
@@ -24,7 +26,7 @@ import {
|
|
|
24
26
|
} from "./chunk-3F57TIUQ.js";
|
|
25
27
|
import {
|
|
26
28
|
useSearchContext
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ET4TW6M5.js";
|
|
28
30
|
import "./chunk-HLGNIWUN.js";
|
|
29
31
|
import {
|
|
30
32
|
Collapsible,
|
|
@@ -40,7 +42,6 @@ import {
|
|
|
40
42
|
import "./chunk-MLKGABMK.js";
|
|
41
43
|
|
|
42
44
|
// src/docs.client.tsx
|
|
43
|
-
import Link2 from "next/link";
|
|
44
45
|
import { SidebarTrigger } from "fumadocs-core/sidebar";
|
|
45
46
|
import { Menu, X } from "lucide-react";
|
|
46
47
|
|
|
@@ -268,12 +269,14 @@ function DynamicSidebar(props) {
|
|
|
268
269
|
const { collapsed, setCollapsed } = useSidebar();
|
|
269
270
|
const [hover, setHover] = useState2(false);
|
|
270
271
|
const timerRef = useRef(0);
|
|
272
|
+
const hoverTimeRef = useRef(0);
|
|
271
273
|
const onCollapse = useCallback2(() => {
|
|
272
274
|
setCollapsed((v) => !v);
|
|
273
275
|
setHover(false);
|
|
276
|
+
hoverTimeRef.current = Date.now() + 500;
|
|
274
277
|
}, [setCollapsed]);
|
|
275
|
-
const
|
|
276
|
-
if (e.pointerType === "touch") return;
|
|
278
|
+
const onEnter = useCallback2((e) => {
|
|
279
|
+
if (e.pointerType === "touch" || hoverTimeRef.current > Date.now()) return;
|
|
277
280
|
window.clearTimeout(timerRef.current);
|
|
278
281
|
setHover(true);
|
|
279
282
|
}, []);
|
|
@@ -288,8 +291,8 @@ function DynamicSidebar(props) {
|
|
|
288
291
|
collapsed ? /* @__PURE__ */ jsx2(
|
|
289
292
|
"div",
|
|
290
293
|
{
|
|
291
|
-
className: "fixed inset-y-0 start-0 w-4 max-md:hidden
|
|
292
|
-
onPointerEnter:
|
|
294
|
+
className: "fixed inset-y-0 start-0 w-4 max-md:hidden 2xl:w-[180px]",
|
|
295
|
+
onPointerEnter: onEnter,
|
|
293
296
|
onPointerLeave: onLeave
|
|
294
297
|
}
|
|
295
298
|
) : null,
|
|
@@ -316,7 +319,7 @@ function DynamicSidebar(props) {
|
|
|
316
319
|
aside: {
|
|
317
320
|
"data-collapse": collapsed,
|
|
318
321
|
"data-hover": hover,
|
|
319
|
-
onPointerEnter:
|
|
322
|
+
onPointerEnter: onEnter,
|
|
320
323
|
onPointerLeave: onLeave,
|
|
321
324
|
"aria-hidden": Boolean(collapsed && !hover),
|
|
322
325
|
className: twMerge(
|
|
@@ -352,19 +355,21 @@ function DynamicSidebar(props) {
|
|
|
352
355
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
353
356
|
function SubNav({
|
|
354
357
|
title,
|
|
355
|
-
url
|
|
358
|
+
url,
|
|
359
|
+
transparentMode,
|
|
356
360
|
children,
|
|
357
361
|
enableSearch = true
|
|
358
362
|
}) {
|
|
359
363
|
const { open } = useSidebar();
|
|
360
364
|
const { enabled } = useSearchContext();
|
|
361
365
|
return /* @__PURE__ */ jsxs3(
|
|
362
|
-
|
|
366
|
+
NavBox,
|
|
363
367
|
{
|
|
364
368
|
id: "nd-subnav",
|
|
365
|
-
className: "
|
|
369
|
+
className: "flex flex-row items-center px-4 md:hidden",
|
|
370
|
+
transparentMode,
|
|
366
371
|
children: [
|
|
367
|
-
/* @__PURE__ */ jsx3(
|
|
372
|
+
/* @__PURE__ */ jsx3(Title, { url, title }),
|
|
368
373
|
children,
|
|
369
374
|
enabled && enableSearch ? /* @__PURE__ */ jsx3(SearchToggle, { className: "ms-auto" }) : null,
|
|
370
375
|
/* @__PURE__ */ jsx3(
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
1
|
import { PageTree } from 'fumadocs-core/server';
|
|
2
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface NavBoxProps {
|
|
5
|
+
/**
|
|
6
|
+
* When to use transparent navbar
|
|
7
|
+
* @defaultValue none
|
|
8
|
+
*/
|
|
9
|
+
transparentMode?: 'always' | 'top' | 'none';
|
|
10
|
+
}
|
|
11
|
+
interface TitleProps {
|
|
5
12
|
title?: ReactNode;
|
|
6
13
|
/**
|
|
7
14
|
* Redirect url of title
|
|
8
15
|
* @defaultValue '/'
|
|
9
16
|
*/
|
|
10
17
|
url?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Show/hide search toggle
|
|
13
|
-
*
|
|
14
|
-
* Note: Enable/disable search from root provider instead
|
|
15
|
-
*/
|
|
16
|
-
enableSearch?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* When to use transparent navbar
|
|
19
|
-
* @defaultValue none
|
|
20
|
-
*/
|
|
21
|
-
transparentMode?: 'always' | 'top' | 'none';
|
|
22
|
-
children?: ReactNode;
|
|
23
18
|
}
|
|
24
|
-
declare function Nav({ title, url, items, transparentMode, enableSearch, children, }: NavProps & {
|
|
25
|
-
items: LinkItemType[];
|
|
26
|
-
}): React.ReactElement;
|
|
27
19
|
|
|
28
20
|
interface SidebarProps {
|
|
29
21
|
items: LinkItemType[];
|
|
@@ -87,10 +79,19 @@ type LinkItemType = {
|
|
|
87
79
|
text: string;
|
|
88
80
|
external?: boolean;
|
|
89
81
|
};
|
|
90
|
-
interface NavOptions extends
|
|
82
|
+
interface NavOptions extends SharedNavProps {
|
|
91
83
|
enabled: boolean;
|
|
92
84
|
component: ReactNode;
|
|
93
85
|
}
|
|
86
|
+
interface SharedNavProps extends TitleProps, NavBoxProps {
|
|
87
|
+
/**
|
|
88
|
+
* Show/hide search toggle
|
|
89
|
+
*
|
|
90
|
+
* Note: Enable/disable search from root provider instead
|
|
91
|
+
*/
|
|
92
|
+
enableSearch?: boolean;
|
|
93
|
+
children?: ReactNode;
|
|
94
|
+
}
|
|
94
95
|
interface SidebarOptions extends Omit<SidebarProps, 'items'> {
|
|
95
96
|
enabled: boolean;
|
|
96
97
|
component: ReactNode;
|
|
@@ -122,4 +123,4 @@ interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
122
123
|
declare function Layout({ nav, links, githubUrl, children, }: BaseLayoutProps): React.ReactElement;
|
|
123
124
|
declare function DocsLayout({ nav, githubUrl, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, ...sidebar }, links, containerProps, tree, i18n, children, }: DocsLayoutProps): React.ReactElement;
|
|
124
125
|
|
|
125
|
-
export { type BaseLayoutProps as B, type DocsLayoutProps as D, type LinkItemType as L, type
|
|
126
|
+
export { type BaseLayoutProps as B, type DocsLayoutProps as D, type LinkItemType as L, type SidebarProps as S, type SharedNavProps as a, Sidebar as b, Layout as c, DocsLayout as d };
|
package/dist/layout.client.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import 'react';
|
|
1
|
+
import { a as SharedNavProps, L as LinkItemType } from './layout-DAwDgfTa.js';
|
|
3
2
|
import 'fumadocs-core/server';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare function Nav({ title, url, items, transparentMode, enableSearch, children, }: SharedNavProps & {
|
|
6
|
+
items: LinkItemType[];
|
|
7
|
+
}): React.ReactElement;
|
|
8
|
+
|
|
9
|
+
export { Nav };
|
package/dist/layout.client.js
CHANGED
|
@@ -3,100 +3,69 @@ import {
|
|
|
3
3
|
LargeSearchToggle,
|
|
4
4
|
LinkItem,
|
|
5
5
|
LinksMenu,
|
|
6
|
+
NavBox,
|
|
6
7
|
SearchToggle,
|
|
7
|
-
ThemeToggle
|
|
8
|
-
|
|
8
|
+
ThemeToggle,
|
|
9
|
+
Title
|
|
10
|
+
} from "./chunk-IOZPSMRL.js";
|
|
9
11
|
import "./chunk-GHKJ6EFT.js";
|
|
10
12
|
import "./chunk-AN2Y6MA2.js";
|
|
11
13
|
import {
|
|
12
14
|
useSearchContext
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ET4TW6M5.js";
|
|
14
16
|
import {
|
|
15
17
|
useI18n
|
|
16
18
|
} from "./chunk-HLGNIWUN.js";
|
|
17
19
|
import "./chunk-7XPZOMJ2.js";
|
|
18
20
|
import "./chunk-H5USAX5W.js";
|
|
19
|
-
import
|
|
20
|
-
twMerge
|
|
21
|
-
} from "./chunk-TK3TM3MR.js";
|
|
21
|
+
import "./chunk-TK3TM3MR.js";
|
|
22
22
|
import "./chunk-MLKGABMK.js";
|
|
23
23
|
|
|
24
|
-
// src/
|
|
25
|
-
import Link from "fumadocs-core/link";
|
|
26
|
-
import { useEffect, useState } from "react";
|
|
24
|
+
// src/layout.client.tsx
|
|
27
25
|
import { MoreVertical } from "lucide-react";
|
|
28
26
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
29
27
|
function Nav({
|
|
30
|
-
title
|
|
31
|
-
url
|
|
28
|
+
title,
|
|
29
|
+
url,
|
|
32
30
|
items,
|
|
33
|
-
transparentMode
|
|
31
|
+
transparentMode,
|
|
34
32
|
enableSearch = true,
|
|
35
33
|
children
|
|
36
34
|
}) {
|
|
37
35
|
const search = useSearchContext();
|
|
38
|
-
const [transparent, setTransparent] = useState(transparentMode !== "none");
|
|
39
36
|
const { text } = useI18n();
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className: "
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
item,
|
|
73
|
-
className: "-mx-2 text-sm max-lg:hidden"
|
|
74
|
-
},
|
|
75
|
-
i
|
|
76
|
-
)),
|
|
77
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-row items-center justify-end md:gap-2", children: [
|
|
78
|
-
enableSearch && search.enabled ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
79
|
-
/* @__PURE__ */ jsx(SearchToggle, { className: "md:hidden" }),
|
|
80
|
-
/* @__PURE__ */ jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-md:hidden" })
|
|
81
|
-
] }) : null,
|
|
82
|
-
/* @__PURE__ */ jsx(ThemeToggle, { className: "max-lg:hidden" }),
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
84
|
-
LinksMenu,
|
|
85
|
-
{
|
|
86
|
-
items,
|
|
87
|
-
className: "lg:hidden",
|
|
88
|
-
footer: /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between px-2 py-1", children: [
|
|
89
|
-
/* @__PURE__ */ jsx("p", { className: "font-medium text-muted-foreground", children: text.chooseTheme }),
|
|
90
|
-
/* @__PURE__ */ jsx(ThemeToggle, {})
|
|
91
|
-
] }),
|
|
92
|
-
children: /* @__PURE__ */ jsx(MoreVertical, {})
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
items.filter((item) => item.type === "secondary").map((item, i) => /* @__PURE__ */ jsx(LinkItem, { item, className: "max-lg:hidden" }, i))
|
|
96
|
-
] })
|
|
97
|
-
] })
|
|
98
|
-
}
|
|
99
|
-
);
|
|
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: [
|
|
38
|
+
/* @__PURE__ */ jsx(Title, { title, url }),
|
|
39
|
+
children,
|
|
40
|
+
items.filter((item) => item.type !== "secondary").map((item, i) => /* @__PURE__ */ jsx(
|
|
41
|
+
LinkItem,
|
|
42
|
+
{
|
|
43
|
+
item,
|
|
44
|
+
className: "-mx-2 text-sm max-lg:hidden"
|
|
45
|
+
},
|
|
46
|
+
i
|
|
47
|
+
)),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-row items-center justify-end md:gap-2", children: [
|
|
49
|
+
enableSearch && search.enabled ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(SearchToggle, { className: "md:hidden" }),
|
|
51
|
+
/* @__PURE__ */ jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-md:hidden" })
|
|
52
|
+
] }) : null,
|
|
53
|
+
/* @__PURE__ */ jsx(ThemeToggle, { className: "max-lg:hidden" }),
|
|
54
|
+
items.filter((item) => item.type === "secondary").map((item, i) => /* @__PURE__ */ jsx(LinkItem, { item, className: "max-lg:hidden" }, i)),
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
LinksMenu,
|
|
57
|
+
{
|
|
58
|
+
items,
|
|
59
|
+
className: "lg:hidden",
|
|
60
|
+
footer: /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-between px-2 pt-2", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-muted-foreground", children: text.chooseTheme }),
|
|
62
|
+
/* @__PURE__ */ jsx(ThemeToggle, {})
|
|
63
|
+
] }),
|
|
64
|
+
children: /* @__PURE__ */ jsx(MoreVertical, {})
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] })
|
|
68
|
+
] }) });
|
|
100
69
|
}
|
|
101
70
|
export {
|
|
102
71
|
Nav
|
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,
|
|
3
|
+
export { B as BaseLayoutProps, d as DocsLayout, D as DocsLayoutProps, c as Layout, L as LinkItemType, a as SharedNavProps } from './layout-DAwDgfTa.js';
|
package/dist/layout.js
CHANGED
|
@@ -53,7 +53,7 @@ function DocsLayout({
|
|
|
53
53
|
children
|
|
54
54
|
}) {
|
|
55
55
|
const finalLinks = getLinks(links, githubUrl);
|
|
56
|
-
const Aside =
|
|
56
|
+
const Aside = collapsible ? DynamicSidebar : Sidebar;
|
|
57
57
|
return /* @__PURE__ */ jsxs(TreeContextProvider, { tree, children: [
|
|
58
58
|
replaceOrDefault(nav, /* @__PURE__ */ jsx(SubNav, { ...nav })),
|
|
59
59
|
/* @__PURE__ */ jsxs(
|
package/dist/page.client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TOCItemType } from 'fumadocs-core/server';
|
|
2
2
|
import * as Primitive from 'fumadocs-core/toc-internal';
|
|
3
|
-
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { ReactNode, ReactElement, ButtonHTMLAttributes } from 'react';
|
|
4
4
|
import { BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
|
|
5
5
|
|
|
6
6
|
interface TOCProps {
|
|
@@ -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 }: TOCProps): ReactElement;
|
|
19
|
+
declare function SubToc({ items, header, footer, ...props }: TOCProps & ButtonHTMLAttributes<HTMLButtonElement>): ReactElement;
|
|
20
20
|
|
|
21
21
|
interface BreadcrumbProps extends Omit<BreadcrumbOptions, 'includePage'> {
|
|
22
22
|
/**
|