fumadocs-ui 13.4.5 → 13.4.7
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-N47AX4K6.js → chunk-KCZRDPB4.js} +145 -61
- package/dist/chunk-NSEJBI4V.js +56 -0
- package/dist/components/banner.d.ts +12 -1
- package/dist/components/banner.js +62 -11
- package/dist/components/layout/language-toggle.js +6 -51
- package/dist/docs-layout.client.d.ts +9 -4
- package/dist/docs-layout.client.js +325 -24
- package/dist/{edit-on-github-FSFN5H36.js → edit-on-github-YFVYCMB7.js} +2 -1
- package/dist/home-layout.client.d.ts +3 -2
- package/dist/home-layout.client.js +17 -9
- package/dist/home-layout.d.ts +2 -2
- package/dist/home-layout.js +2 -1
- package/dist/layout.d.ts +3 -9
- package/dist/layout.js +2 -11
- package/dist/{layout.shared-C5L62VPM.d.ts → layout.shared-DEQFTB9M.d.ts} +6 -0
- package/dist/page.js +2 -1
- package/dist/{sidebar-BguPKq_K.d.ts → sidebar-DwBSl7jC.d.ts} +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.js +2 -2
- package/package.json +6 -6
- package/dist/chunk-J5B4GINE.js +0 -90
- package/dist/chunk-VTGJREY6.js +0 -237
- package/dist/dynamic-sidebar-JFB3Z7SK.js +0 -106
|
@@ -25,14 +25,104 @@ import {
|
|
|
25
25
|
twMerge
|
|
26
26
|
} from "./chunk-TK3TM3MR.js";
|
|
27
27
|
|
|
28
|
-
// src/components/layout/
|
|
28
|
+
// src/components/layout/search-toggle.tsx
|
|
29
|
+
import { useCallback } from "react";
|
|
30
|
+
import { SearchIcon } from "lucide-react";
|
|
31
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
+
function SearchToggle(props) {
|
|
33
|
+
const { setOpenSearch } = useSearchContext();
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
className: twMerge(
|
|
39
|
+
buttonVariants({
|
|
40
|
+
size: "icon",
|
|
41
|
+
color: "ghost",
|
|
42
|
+
className: props.className
|
|
43
|
+
})
|
|
44
|
+
),
|
|
45
|
+
"data-search": "",
|
|
46
|
+
"aria-label": "Open Search",
|
|
47
|
+
onClick: useCallback(() => {
|
|
48
|
+
setOpenSearch(true);
|
|
49
|
+
}, [setOpenSearch]),
|
|
50
|
+
children: /* @__PURE__ */ jsx(SearchIcon, {})
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function LargeSearchToggle(props) {
|
|
55
|
+
const { hotKey, setOpenSearch } = useSearchContext();
|
|
56
|
+
const { text } = useI18n();
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
type: "button",
|
|
61
|
+
"data-search-full": "",
|
|
62
|
+
...props,
|
|
63
|
+
className: twMerge(
|
|
64
|
+
"inline-flex items-center gap-2 rounded-full border bg-fd-secondary/50 p-1.5 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground",
|
|
65
|
+
props.className
|
|
66
|
+
),
|
|
67
|
+
onClick: useCallback(() => {
|
|
68
|
+
setOpenSearch(true);
|
|
69
|
+
}, [setOpenSearch]),
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(SearchIcon, { className: "ms-1 size-4" }),
|
|
72
|
+
text.search,
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "ms-auto inline-flex gap-0.5", children: hotKey.map((k, i) => /* @__PURE__ */ jsx("kbd", { className: "rounded-md border bg-fd-background px-1.5", children: k.display }, i)) })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// src/components/layout/nav.tsx
|
|
29
80
|
import Link from "fumadocs-core/link";
|
|
81
|
+
import {
|
|
82
|
+
useEffect,
|
|
83
|
+
useState
|
|
84
|
+
} from "react";
|
|
85
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
86
|
+
function NavBox({
|
|
87
|
+
transparentMode = "none",
|
|
88
|
+
...props
|
|
89
|
+
}) {
|
|
90
|
+
const [transparent, setTransparent] = useState(transparentMode !== "none");
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (transparentMode !== "top") return;
|
|
93
|
+
const listener = () => {
|
|
94
|
+
setTransparent(window.scrollY < 10);
|
|
95
|
+
};
|
|
96
|
+
listener();
|
|
97
|
+
window.addEventListener("scroll", listener);
|
|
98
|
+
return () => {
|
|
99
|
+
window.removeEventListener("scroll", listener);
|
|
100
|
+
};
|
|
101
|
+
}, [transparentMode]);
|
|
102
|
+
return /* @__PURE__ */ jsx2(
|
|
103
|
+
"header",
|
|
104
|
+
{
|
|
105
|
+
...props,
|
|
106
|
+
className: twMerge(
|
|
107
|
+
"sticky top-0 z-40 border-b transition-colors",
|
|
108
|
+
transparent ? "border-transparent" : "border-fd-foreground/10 bg-fd-background/60 backdrop-blur-md",
|
|
109
|
+
props.className
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function Title({ title, url = "/" }) {
|
|
115
|
+
return /* @__PURE__ */ jsx2(Link, { href: url, className: "inline-flex items-center gap-2 font-semibold", children: title });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/components/layout/link-item.tsx
|
|
119
|
+
import Link2 from "fumadocs-core/link";
|
|
30
120
|
import { ChevronDown } from "lucide-react";
|
|
31
121
|
import { usePathname } from "next/navigation";
|
|
32
122
|
import { cva } from "class-variance-authority";
|
|
33
|
-
import { useState } from "react";
|
|
123
|
+
import { useState as useState2 } from "react";
|
|
34
124
|
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
35
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
125
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
36
126
|
var linkItemVariants = cva(
|
|
37
127
|
"-m-2 inline-flex items-center gap-1 p-2 text-fd-muted-foreground transition-colors [&_svg]:size-4",
|
|
38
128
|
{
|
|
@@ -57,7 +147,7 @@ function LinkItem({
|
|
|
57
147
|
if (item.on && item.on !== "all" && item.on !== on) return null;
|
|
58
148
|
if (item.type === "custom") return item.children;
|
|
59
149
|
if (item.type === "menu" && on === "nav") {
|
|
60
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ jsxs2(
|
|
61
151
|
LinksMenu,
|
|
62
152
|
{
|
|
63
153
|
items: item.items,
|
|
@@ -66,14 +156,14 @@ function LinkItem({
|
|
|
66
156
|
children: [
|
|
67
157
|
item.icon,
|
|
68
158
|
item.text,
|
|
69
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ jsx3(ChevronDown, { className: "ms-auto !size-3.5" })
|
|
70
160
|
]
|
|
71
161
|
}
|
|
72
162
|
);
|
|
73
163
|
}
|
|
74
164
|
if (item.type === "menu") {
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ jsxs2(Collapsible, { className: "flex flex-col", children: [
|
|
166
|
+
/* @__PURE__ */ jsxs2(
|
|
77
167
|
CollapsibleTrigger,
|
|
78
168
|
{
|
|
79
169
|
className: twMerge(itemVariants({ className }), "group/link"),
|
|
@@ -81,16 +171,16 @@ function LinkItem({
|
|
|
81
171
|
children: [
|
|
82
172
|
item.icon,
|
|
83
173
|
item.text,
|
|
84
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ jsx3(ChevronDown, { className: "ms-auto transition-transform group-data-[state=closed]/link:-rotate-90" })
|
|
85
175
|
]
|
|
86
176
|
}
|
|
87
177
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ jsx3(CollapsibleContent, { children: /* @__PURE__ */ jsx3("div", { className: "ms-2 flex flex-col border-s py-2 ps-2", children: item.items.map((child, i) => /* @__PURE__ */ jsx3(LinkItem, { item: child, on: "menu" }, i)) }) })
|
|
89
179
|
] });
|
|
90
180
|
}
|
|
91
181
|
if (item.type === "button") {
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
182
|
+
return /* @__PURE__ */ jsxs2(
|
|
183
|
+
Link2,
|
|
94
184
|
{
|
|
95
185
|
href: item.url,
|
|
96
186
|
external: item.external,
|
|
@@ -109,8 +199,8 @@ function LinkItem({
|
|
|
109
199
|
const activeType = item.active ?? "url";
|
|
110
200
|
const active = activeType !== "none" && isActive(item.url, pathname, activeType === "nested-url");
|
|
111
201
|
if (item.type === "icon" && on === "nav") {
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
|
|
202
|
+
return /* @__PURE__ */ jsx3(
|
|
203
|
+
Link2,
|
|
114
204
|
{
|
|
115
205
|
"aria-label": item.label,
|
|
116
206
|
href: item.url,
|
|
@@ -127,8 +217,8 @@ function LinkItem({
|
|
|
127
217
|
}
|
|
128
218
|
);
|
|
129
219
|
}
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
|
|
220
|
+
return /* @__PURE__ */ jsxs2(
|
|
221
|
+
Link2,
|
|
132
222
|
{
|
|
133
223
|
href: item.url,
|
|
134
224
|
external: item.external,
|
|
@@ -151,74 +241,68 @@ function LinksMenu({
|
|
|
151
241
|
footer,
|
|
152
242
|
...props
|
|
153
243
|
}) {
|
|
154
|
-
const [open, setOpen] =
|
|
244
|
+
const [open, setOpen] = useState2(false);
|
|
155
245
|
const pathname = usePathname();
|
|
156
246
|
useOnChange(pathname, () => {
|
|
157
247
|
setOpen(false);
|
|
158
248
|
});
|
|
159
|
-
return /* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
items.map((item, i) => /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ jsxs2(Popover, { open, onOpenChange: setOpen, children: [
|
|
250
|
+
/* @__PURE__ */ jsx3(PopoverTrigger, { ...props }),
|
|
251
|
+
/* @__PURE__ */ jsxs2(PopoverContent, { className: "flex flex-col", children: [
|
|
252
|
+
items.map((item, i) => /* @__PURE__ */ jsx3(LinkItem, { item, on: "menu" }, i)),
|
|
163
253
|
footer
|
|
164
254
|
] })
|
|
165
255
|
] });
|
|
166
256
|
}
|
|
167
257
|
|
|
168
|
-
// src/components/layout/
|
|
169
|
-
import {
|
|
170
|
-
import {
|
|
171
|
-
import {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
buttonVariants({
|
|
180
|
-
size: "icon",
|
|
181
|
-
color: "ghost",
|
|
182
|
-
className: props.className
|
|
183
|
-
})
|
|
184
|
-
),
|
|
185
|
-
"data-search": "",
|
|
186
|
-
"aria-label": "Open Search",
|
|
187
|
-
onClick: useCallback(() => {
|
|
188
|
-
setOpenSearch(true);
|
|
189
|
-
}, [setOpenSearch]),
|
|
190
|
-
children: /* @__PURE__ */ jsx2(SearchIcon, {})
|
|
258
|
+
// src/components/layout/theme-toggle.tsx
|
|
259
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
260
|
+
import { Moon, Sun } from "lucide-react";
|
|
261
|
+
import { useTheme } from "next-themes";
|
|
262
|
+
import { useCallback as useCallback2 } from "react";
|
|
263
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
264
|
+
var buttonVariants2 = cva2("size-6 rounded-full p-1 text-fd-muted-foreground", {
|
|
265
|
+
variants: {
|
|
266
|
+
dark: {
|
|
267
|
+
true: "dark:bg-fd-accent dark:text-fd-accent-foreground",
|
|
268
|
+
false: "bg-fd-accent text-fd-accent-foreground dark:bg-transparent dark:text-fd-muted-foreground"
|
|
191
269
|
}
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
function ThemeToggle({
|
|
273
|
+
className,
|
|
274
|
+
...props
|
|
275
|
+
}) {
|
|
276
|
+
const { setTheme, resolvedTheme } = useTheme();
|
|
277
|
+
const onToggle = useCallback2(() => {
|
|
278
|
+
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
279
|
+
}, [setTheme, resolvedTheme]);
|
|
280
|
+
return /* @__PURE__ */ jsxs3(
|
|
198
281
|
"button",
|
|
199
282
|
{
|
|
200
283
|
type: "button",
|
|
201
|
-
"data-search-full": "",
|
|
202
|
-
...props,
|
|
203
284
|
className: twMerge(
|
|
204
|
-
"inline-flex items-center
|
|
205
|
-
|
|
285
|
+
"inline-flex items-center rounded-full border p-0.5",
|
|
286
|
+
className
|
|
206
287
|
),
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
288
|
+
"data-theme-toggle": "",
|
|
289
|
+
"aria-label": "Toggle Theme",
|
|
290
|
+
onClick: onToggle,
|
|
291
|
+
...props,
|
|
210
292
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */ jsx2("div", { className: "ms-auto inline-flex gap-0.5", children: hotKey.map((k, i) => /* @__PURE__ */ jsx2("kbd", { className: "rounded-md border bg-fd-background px-1.5", children: k.display }, i)) })
|
|
293
|
+
/* @__PURE__ */ jsx4(Sun, { className: twMerge(buttonVariants2({ dark: false })) }),
|
|
294
|
+
/* @__PURE__ */ jsx4(Moon, { className: twMerge(buttonVariants2({ dark: true })) })
|
|
214
295
|
]
|
|
215
296
|
}
|
|
216
297
|
);
|
|
217
298
|
}
|
|
218
299
|
|
|
219
300
|
export {
|
|
301
|
+
SearchToggle,
|
|
302
|
+
LargeSearchToggle,
|
|
303
|
+
NavBox,
|
|
304
|
+
Title,
|
|
220
305
|
LinkItem,
|
|
221
306
|
LinksMenu,
|
|
222
|
-
|
|
223
|
-
LargeSearchToggle
|
|
307
|
+
ThemeToggle
|
|
224
308
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover,
|
|
3
|
+
PopoverContent,
|
|
4
|
+
PopoverTrigger
|
|
5
|
+
} from "./chunk-CP67AHDD.js";
|
|
6
|
+
import {
|
|
7
|
+
useI18n
|
|
8
|
+
} from "./chunk-EFMHXXHW.js";
|
|
9
|
+
import {
|
|
10
|
+
buttonVariants
|
|
11
|
+
} from "./chunk-EDNTYBXS.js";
|
|
12
|
+
import {
|
|
13
|
+
twMerge
|
|
14
|
+
} from "./chunk-TK3TM3MR.js";
|
|
15
|
+
|
|
16
|
+
// src/components/layout/language-toggle.tsx
|
|
17
|
+
import { useState } from "react";
|
|
18
|
+
import { LanguagesIcon } from "lucide-react";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
function LanguageToggle(props) {
|
|
21
|
+
const context = useI18n();
|
|
22
|
+
const [open, setOpen] = useState(false);
|
|
23
|
+
if (!context.locales) throw new Error("Missing `<I18nProvider />`");
|
|
24
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, ...props, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
PopoverTrigger,
|
|
27
|
+
{
|
|
28
|
+
"aria-label": context.text.chooseLanguage,
|
|
29
|
+
className: twMerge(buttonVariants({ size: "icon", color: "ghost" })),
|
|
30
|
+
children: /* @__PURE__ */ jsx(LanguagesIcon, {})
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsxs(PopoverContent, { className: "flex flex-col p-1", children: [
|
|
34
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1 p-2 text-xs font-medium text-fd-muted-foreground", children: context.text.chooseLanguage }),
|
|
35
|
+
context.locales.map((item) => /* @__PURE__ */ jsx(
|
|
36
|
+
"button",
|
|
37
|
+
{
|
|
38
|
+
type: "button",
|
|
39
|
+
className: twMerge(
|
|
40
|
+
"rounded-md p-2 text-left text-sm transition-colors duration-100",
|
|
41
|
+
item.locale === context.locale ? "bg-fd-primary/10 font-medium text-fd-primary" : "hover:bg-fd-accent hover:text-fd-accent-foreground"
|
|
42
|
+
),
|
|
43
|
+
onClick: () => {
|
|
44
|
+
context.onChange?.(item.locale);
|
|
45
|
+
},
|
|
46
|
+
children: item.name
|
|
47
|
+
},
|
|
48
|
+
item.locale
|
|
49
|
+
))
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
LanguageToggle
|
|
56
|
+
};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
declare function Banner({ id, ...props }: HTMLAttributes<HTMLDivElement>
|
|
3
|
+
declare function Banner({ id, variant, changeLayout, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
/**
|
|
5
|
+
* @defaultValue 'normal'
|
|
6
|
+
*/
|
|
7
|
+
variant?: 'rainbow' | 'normal';
|
|
8
|
+
/**
|
|
9
|
+
* Change Fumadocs layout styles
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue true
|
|
12
|
+
*/
|
|
13
|
+
changeLayout?: boolean;
|
|
14
|
+
}): React.ReactElement;
|
|
4
15
|
|
|
5
16
|
export { Banner };
|
|
@@ -10,42 +10,50 @@ import "../chunk-MLKGABMK.js";
|
|
|
10
10
|
// src/components/banner.tsx
|
|
11
11
|
import { useCallback, useEffect, useState } from "react";
|
|
12
12
|
import { X } from "lucide-react";
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
function Banner({
|
|
15
15
|
id,
|
|
16
|
+
variant = "normal",
|
|
17
|
+
changeLayout = true,
|
|
16
18
|
...props
|
|
17
19
|
}) {
|
|
18
20
|
const [open, setOpen] = useState(true);
|
|
21
|
+
const globalKey = id ? `nd-banner-${id}` : void 0;
|
|
22
|
+
const cssFilter = `:not(.${globalKey ?? "nd-banner-never"} *)`;
|
|
19
23
|
useEffect(() => {
|
|
20
|
-
if (
|
|
21
|
-
}, [
|
|
24
|
+
if (globalKey) setOpen(localStorage.getItem(globalKey) !== "true");
|
|
25
|
+
}, [globalKey]);
|
|
22
26
|
const onClick = useCallback(() => {
|
|
23
27
|
setOpen(false);
|
|
24
|
-
if (
|
|
25
|
-
}, [
|
|
28
|
+
if (globalKey) localStorage.setItem(globalKey, "true");
|
|
29
|
+
}, [globalKey]);
|
|
26
30
|
return /* @__PURE__ */ jsxs(
|
|
27
31
|
"div",
|
|
28
32
|
{
|
|
29
33
|
id,
|
|
30
34
|
...props,
|
|
31
35
|
className: twMerge(
|
|
32
|
-
"
|
|
36
|
+
"sticky top-0 z-40 flex h-12 flex-row items-center justify-center bg-fd-secondary px-4 text-center text-sm font-medium",
|
|
37
|
+
variant === "rainbow" && "bg-fd-background",
|
|
33
38
|
!open && "hidden",
|
|
34
39
|
props.className
|
|
35
40
|
),
|
|
36
|
-
suppressHydrationWarning: true,
|
|
37
41
|
children: [
|
|
42
|
+
changeLayout ? /* @__PURE__ */ jsx("style", { children: `
|
|
43
|
+
#nd-sidebar${cssFilter}, #nd-nav${cssFilter}, #nd-subnav${cssFilter}, [data-toc]${cssFilter} { top: 3rem; }
|
|
44
|
+
#nd-tocnav${cssFilter} { top: 6.5rem; }
|
|
45
|
+
#nd-sidebar${cssFilter}, [data-toc]${cssFilter} { height: calc(100dvh - 3rem); }
|
|
46
|
+
` }) : null,
|
|
47
|
+
globalKey ? /* @__PURE__ */ jsx("style", { children: `.${globalKey} #${id} { display: none; }` }) : null,
|
|
38
48
|
id ? /* @__PURE__ */ jsx(
|
|
39
49
|
"script",
|
|
40
50
|
{
|
|
41
51
|
dangerouslySetInnerHTML: {
|
|
42
|
-
__html: `
|
|
43
|
-
if (ndBannerItem === 'true') {
|
|
44
|
-
document.getElementById('${id}').style.display = 'none';
|
|
45
|
-
}`
|
|
52
|
+
__html: `if (localStorage.getItem('${globalKey}') === 'true') document.documentElement.classList.add('${globalKey}');`
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
) : null,
|
|
56
|
+
variant === "rainbow" ? rainbowLayer : null,
|
|
49
57
|
props.children,
|
|
50
58
|
id ? /* @__PURE__ */ jsx(
|
|
51
59
|
"button",
|
|
@@ -67,6 +75,49 @@ function Banner({
|
|
|
67
75
|
}
|
|
68
76
|
);
|
|
69
77
|
}
|
|
78
|
+
var maskImage = "linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)";
|
|
79
|
+
var rainbowLayer = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "absolute inset-0 z-[-1]",
|
|
84
|
+
style: {
|
|
85
|
+
maskImage,
|
|
86
|
+
maskComposite: "intersect",
|
|
87
|
+
animation: "fd-moving-banner 16s linear infinite",
|
|
88
|
+
"--start": "rgba(0,87,255,0.5)",
|
|
89
|
+
"--mid": "rgba(255,0,166,0.77)",
|
|
90
|
+
"--end": "rgba(255,77,0,0.4)",
|
|
91
|
+
"--via": "rgba(164,255,68,0.4)",
|
|
92
|
+
animationDirection: "reverse",
|
|
93
|
+
backgroundImage: "repeating-linear-gradient(to right, var(--end), var(--start) 2%, var(--start) 5%, transparent 8%, transparent 14%, var(--via) 18%, var(--via) 22%, var(--mid) 28%, var(--mid) 30%, var(--via) 34%, var(--via) 36%, transparent, var(--end) 50%)",
|
|
94
|
+
backgroundSize: "200% 100%",
|
|
95
|
+
mixBlendMode: "difference"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: "absolute inset-0 z-[-1]",
|
|
103
|
+
style: {
|
|
104
|
+
maskImage,
|
|
105
|
+
maskComposite: "intersect",
|
|
106
|
+
animation: "fd-moving-banner 20s linear infinite",
|
|
107
|
+
"--start": "rgba(255,120,120,0.5)",
|
|
108
|
+
"--mid": "rgba(36,188,255,0.4)",
|
|
109
|
+
"--end": "rgba(64,0,255,0.51)",
|
|
110
|
+
"--via": "rgba(255,89,0,0.56)",
|
|
111
|
+
backgroundImage: "repeating-linear-gradient(to right, var(--end), var(--start) 4%, var(--start) 8%, transparent 9%, transparent 14%, var(--mid) 16%, var(--mid) 20%, transparent, var(--via) 36%, var(--via) 40%, transparent 42%, var(--end) 46%, var(--end) 50%)",
|
|
112
|
+
backgroundSize: "200% 100%"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes fd-moving-banner {
|
|
117
|
+
from { background-position: 0% 0; }
|
|
118
|
+
to { background-position: 100% 0; }
|
|
119
|
+
}` })
|
|
120
|
+
] });
|
|
70
121
|
export {
|
|
71
122
|
Banner
|
|
72
123
|
};
|
|
@@ -1,57 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
} from "../../chunk-EFMHXXHW.js";
|
|
10
|
-
import {
|
|
11
|
-
buttonVariants
|
|
12
|
-
} from "../../chunk-EDNTYBXS.js";
|
|
13
|
-
import {
|
|
14
|
-
twMerge
|
|
15
|
-
} from "../../chunk-TK3TM3MR.js";
|
|
3
|
+
LanguageToggle
|
|
4
|
+
} from "../../chunk-NSEJBI4V.js";
|
|
5
|
+
import "../../chunk-CP67AHDD.js";
|
|
6
|
+
import "../../chunk-EFMHXXHW.js";
|
|
7
|
+
import "../../chunk-EDNTYBXS.js";
|
|
8
|
+
import "../../chunk-TK3TM3MR.js";
|
|
16
9
|
import "../../chunk-MLKGABMK.js";
|
|
17
|
-
|
|
18
|
-
// src/components/layout/language-toggle.tsx
|
|
19
|
-
import { useState } from "react";
|
|
20
|
-
import { LanguagesIcon } from "lucide-react";
|
|
21
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
function LanguageToggle(props) {
|
|
23
|
-
const context = useI18n();
|
|
24
|
-
const [open, setOpen] = useState(false);
|
|
25
|
-
if (!context.locales) throw new Error("Missing `<I18nProvider />`");
|
|
26
|
-
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, ...props, children: [
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
PopoverTrigger,
|
|
29
|
-
{
|
|
30
|
-
"aria-label": context.text.chooseLanguage,
|
|
31
|
-
className: twMerge(buttonVariants({ size: "icon", color: "ghost" })),
|
|
32
|
-
children: /* @__PURE__ */ jsx(LanguagesIcon, {})
|
|
33
|
-
}
|
|
34
|
-
),
|
|
35
|
-
/* @__PURE__ */ jsxs(PopoverContent, { className: "flex flex-col p-1", children: [
|
|
36
|
-
/* @__PURE__ */ jsx("p", { className: "mb-1 p-2 text-xs font-medium text-fd-muted-foreground", children: context.text.chooseLanguage }),
|
|
37
|
-
context.locales.map((item) => /* @__PURE__ */ jsx(
|
|
38
|
-
"button",
|
|
39
|
-
{
|
|
40
|
-
type: "button",
|
|
41
|
-
className: twMerge(
|
|
42
|
-
"rounded-md p-2 text-left text-sm transition-colors duration-100",
|
|
43
|
-
item.locale === context.locale ? "bg-fd-primary/10 font-medium text-fd-primary" : "hover:bg-fd-accent hover:text-fd-accent-foreground"
|
|
44
|
-
),
|
|
45
|
-
onClick: () => {
|
|
46
|
-
context.onChange?.(item.locale);
|
|
47
|
-
},
|
|
48
|
-
children: item.name
|
|
49
|
-
},
|
|
50
|
-
item.locale
|
|
51
|
-
))
|
|
52
|
-
] })
|
|
53
|
-
] });
|
|
54
|
-
}
|
|
55
10
|
export {
|
|
56
11
|
LanguageToggle
|
|
57
12
|
};
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { S as SharedNavProps } from './layout.shared-
|
|
2
|
-
export { a as LinksMenu } from './layout.shared-
|
|
3
|
-
|
|
1
|
+
import { S as SharedNavProps } from './layout.shared-DEQFTB9M.js';
|
|
2
|
+
export { a as LinksMenu } from './layout.shared-DEQFTB9M.js';
|
|
3
|
+
import { S as SidebarProps } from './sidebar-DwBSl7jC.js';
|
|
4
|
+
export { a as Sidebar } from './sidebar-DwBSl7jC.js';
|
|
4
5
|
export { T as TreeContextProvider } from './tree-CrKzI9Nz.js';
|
|
5
6
|
import { ButtonHTMLAttributes } from 'react';
|
|
7
|
+
export { LanguageToggle } from './components/layout/language-toggle.js';
|
|
6
8
|
import 'fumadocs-core/server';
|
|
9
|
+
import '@radix-ui/react-popover';
|
|
7
10
|
|
|
8
11
|
declare function ThemeToggle({ className, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): React.ReactElement;
|
|
9
12
|
|
|
13
|
+
declare function DynamicSidebar(props: SidebarProps): React.ReactElement;
|
|
14
|
+
|
|
10
15
|
declare function SubNav({ title, url, transparentMode, children, enableSearch, }: SharedNavProps): React.ReactElement;
|
|
11
16
|
declare function SidebarCollapseTrigger(): React.ReactElement;
|
|
12
17
|
|
|
13
|
-
export { SidebarCollapseTrigger, SubNav, ThemeToggle };
|
|
18
|
+
export { DynamicSidebar, SidebarCollapseTrigger, SubNav, ThemeToggle };
|