fumadocs-ui 12.5.5 → 13.0.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-VYTHQTZE.js → chunk-2FLZOPQN.js} +2 -2
- package/dist/{chunk-R3M2OC5U.js → chunk-34Z7WODD.js} +1 -1
- package/dist/{chunk-IIDV3RNQ.js → chunk-AN2Y6MA2.js} +1 -5
- package/dist/{chunk-QQAMPLSA.js → chunk-B63IB7CZ.js} +16 -8
- package/dist/{chunk-7W3V2Z46.js → chunk-E2FDBE7T.js} +10 -10
- package/dist/{chunk-GHKJ6EFT.js → chunk-GLZ6ALZV.js} +1 -1
- package/dist/{chunk-FMI5QZTV.js → chunk-HOIRMHZT.js} +1 -1
- package/dist/{chunk-YSCK5YFO.js → chunk-IMIWZAMU.js} +6 -6
- package/dist/{chunk-LRPJWLSI.js → chunk-J6TIWNTK.js} +20 -20
- package/dist/{chunk-SZGCBNYN.js → chunk-KACGIS2N.js} +10 -7
- package/dist/chunk-KWZZNVSY.js +39 -0
- package/dist/{chunk-7XPZOMJ2.js → chunk-TQJ6YPJ3.js} +4 -4
- package/dist/{chunk-5CZEA2KX.js → chunk-TRYAQONT.js} +6 -5
- package/dist/{chunk-KWGNIMEM.js → chunk-U7FLICJE.js} +10 -10
- package/dist/{chunk-N3HFQZRE.js → chunk-WLTWFYQA.js} +3 -3
- package/dist/components/accordion.js +98 -6
- package/dist/components/api.d.ts +2 -38
- package/dist/components/api.js +1 -150
- package/dist/components/banner.js +3 -3
- package/dist/components/callout.d.ts +4 -1
- package/dist/components/callout.js +3 -34
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/codeblock.d.ts +22 -0
- package/dist/components/codeblock.js +3 -3
- package/dist/components/dialog/search-algolia.js +3 -3
- package/dist/components/dialog/search-default.js +2 -2
- package/dist/components/dialog/search.js +2 -2
- package/dist/components/files.js +3 -3
- package/dist/components/heading.js +1 -1
- package/dist/components/image-zoom.js +1 -1
- package/dist/components/inline-toc.js +4 -4
- package/dist/components/layout/language-toggle.js +9 -10
- package/dist/components/layout/root-toggle.js +6 -6
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +156 -7
- package/dist/components/type-table.js +11 -8
- package/dist/docs-layout.client.d.ts +3 -3
- package/dist/docs-layout.client.js +9 -9
- package/dist/{dynamic-sidebar-OGMKLIPA.js → dynamic-sidebar-N5DEONM3.js} +9 -9
- package/dist/home-layout.client.d.ts +1 -1
- package/dist/home-layout.client.js +10 -9
- package/dist/home-layout.d.ts +1 -1
- package/dist/home-layout.js +2 -2
- package/dist/{i18n-DSnJuWoW.d.ts → i18n-BDWFZFLm.d.ts} +4 -6
- package/dist/i18n.d.ts +11 -10
- package/dist/i18n.js +4 -4
- package/dist/image-zoom.css +1 -1
- package/dist/layout.d.ts +4 -8
- package/dist/layout.js +5 -22
- package/dist/{layout.shared-GQuo9xqE.d.ts → layout.shared-C5L62VPM.d.ts} +1 -1
- package/dist/mdx.client.d.ts +8 -1
- package/dist/mdx.client.js +5 -10
- package/dist/mdx.d.ts +7 -1
- package/dist/mdx.js +8 -4
- package/dist/page.client.d.ts +1 -1
- package/dist/page.client.js +22 -20
- package/dist/page.d.ts +1 -1
- package/dist/page.js +2 -2
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +2 -2
- package/dist/{sidebar-DN7GLdpV.d.ts → sidebar-CKjkPpjB.d.ts} +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.d.ts +16 -5
- package/dist/tailwind-plugin.js +107 -120
- package/dist/twoslash/popup.js +1 -1
- package/dist/twoslash.css +1 -1
- package/package.json +3 -3
- package/dist/chunk-QZBW7643.js +0 -162
- package/dist/chunk-YKLVLKDA.js +0 -104
- package/dist/components/roll-button.d.ts +0 -14
- package/dist/components/roll-button.js +0 -69
- package/dist/tailwind-plugin.cjs +0 -621
|
@@ -36,13 +36,13 @@ var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...prop
|
|
|
36
36
|
ref,
|
|
37
37
|
orientation,
|
|
38
38
|
className: twMerge(
|
|
39
|
-
"flex select-none data-[state=hidden]:animate-fade-out",
|
|
39
|
+
"flex select-none data-[state=hidden]:animate-fd-fade-out",
|
|
40
40
|
orientation === "vertical" && "h-full w-1.5",
|
|
41
41
|
orientation === "horizontal" && "h-1.5 flex-col",
|
|
42
42
|
className
|
|
43
43
|
),
|
|
44
44
|
...props,
|
|
45
|
-
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
|
|
45
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-fd-border" })
|
|
46
46
|
}
|
|
47
47
|
));
|
|
48
48
|
ScrollBar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
|
@@ -18,14 +18,10 @@ function hasActive(items, url) {
|
|
|
18
18
|
return false;
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function isSecondary(item) {
|
|
22
|
-
return "secondary" in item && item.secondary === true || item.type === "secondary" || item.type === "icon";
|
|
23
|
-
}
|
|
24
21
|
|
|
25
22
|
export {
|
|
26
23
|
defaultImageSizes,
|
|
27
24
|
isActive,
|
|
28
25
|
replaceOrDefault,
|
|
29
|
-
hasActive
|
|
30
|
-
isSecondary
|
|
26
|
+
hasActive
|
|
31
27
|
};
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
ScrollArea,
|
|
3
3
|
ScrollBar,
|
|
4
4
|
ScrollViewport
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2FLZOPQN.js";
|
|
6
6
|
import {
|
|
7
7
|
useCopyButton
|
|
8
8
|
} from "./chunk-2KMKNVSN.js";
|
|
9
9
|
import {
|
|
10
10
|
buttonVariants
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IMIWZAMU.js";
|
|
12
12
|
import {
|
|
13
13
|
twMerge
|
|
14
14
|
} from "./chunk-TK3TM3MR.js";
|
|
@@ -23,12 +23,19 @@ import {
|
|
|
23
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
24
|
var Pre = forwardRef(
|
|
25
25
|
({ className, ...props }, ref) => {
|
|
26
|
-
return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("
|
|
26
|
+
return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("p-4", className), ...props, children: props.children });
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
29
|
Pre.displayName = "Pre";
|
|
30
30
|
var CodeBlock = forwardRef(
|
|
31
|
-
({
|
|
31
|
+
({
|
|
32
|
+
title,
|
|
33
|
+
allowCopy = true,
|
|
34
|
+
keepBackground = false,
|
|
35
|
+
icon,
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}, ref) => {
|
|
32
39
|
const areaRef = useRef(null);
|
|
33
40
|
const onCopy = useCallback(() => {
|
|
34
41
|
const pre = areaRef.current?.getElementsByTagName("pre").item(0);
|
|
@@ -44,16 +51,17 @@ var CodeBlock = forwardRef(
|
|
|
44
51
|
{
|
|
45
52
|
ref,
|
|
46
53
|
className: twMerge(
|
|
47
|
-
"not-prose group relative my-6 overflow-hidden rounded-lg border bg-secondary/50 text-sm",
|
|
54
|
+
"not-prose group fd-codeblock relative my-6 overflow-hidden rounded-lg border bg-fd-secondary/50 text-sm",
|
|
55
|
+
keepBackground && "fd-codeblock-keep-bg",
|
|
48
56
|
className
|
|
49
57
|
),
|
|
50
58
|
...props,
|
|
51
59
|
children: [
|
|
52
|
-
title ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 border-b bg-muted px-4 py-1.5", children: [
|
|
60
|
+
title ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 border-b bg-fd-muted px-4 py-1.5", children: [
|
|
53
61
|
icon ? /* @__PURE__ */ jsx(
|
|
54
62
|
"div",
|
|
55
63
|
{
|
|
56
|
-
className: "text-muted-foreground [&_svg]:size-3.5",
|
|
64
|
+
className: "text-fd-muted-foreground [&_svg]:size-3.5",
|
|
57
65
|
...typeof icon === "string" ? {
|
|
58
66
|
dangerouslySetInnerHTML: { __html: icon }
|
|
59
67
|
} : {
|
|
@@ -61,7 +69,7 @@ var CodeBlock = forwardRef(
|
|
|
61
69
|
}
|
|
62
70
|
}
|
|
63
71
|
) : null,
|
|
64
|
-
/* @__PURE__ */ jsx("figcaption", { className: "flex-1 truncate text-muted-foreground", children: title }),
|
|
72
|
+
/* @__PURE__ */ jsx("figcaption", { className: "flex-1 truncate text-fd-muted-foreground", children: title }),
|
|
65
73
|
allowCopy ? /* @__PURE__ */ jsx(CopyButton, { className: "-me-2", onCopy }) : null
|
|
66
74
|
] }) : allowCopy && /* @__PURE__ */ jsx(
|
|
67
75
|
CopyButton,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-HLGNIWUN.js";
|
|
10
10
|
import {
|
|
11
11
|
buttonVariants
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IMIWZAMU.js";
|
|
13
13
|
import {
|
|
14
14
|
twMerge
|
|
15
15
|
} from "./chunk-TK3TM3MR.js";
|
|
@@ -29,13 +29,13 @@ import { Search } from "lucide-react";
|
|
|
29
29
|
import * as React from "react";
|
|
30
30
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
31
31
|
var CommandInput = React.forwardRef(({ className, onClose, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 px-3", children: [
|
|
32
|
-
/* @__PURE__ */ jsx(Search, { className: "size-4 text-muted-foreground" }),
|
|
32
|
+
/* @__PURE__ */ jsx(Search, { className: "size-4 text-fd-muted-foreground" }),
|
|
33
33
|
/* @__PURE__ */ jsx(
|
|
34
34
|
CommandPrimitive.Input,
|
|
35
35
|
{
|
|
36
36
|
ref,
|
|
37
37
|
className: twMerge(
|
|
38
|
-
"w-0 flex-1 bg-transparent py-3 text-base placeholder:text-muted-foreground focus-visible:outline-none",
|
|
38
|
+
"w-0 flex-1 bg-transparent py-3 text-base placeholder:text-fd-muted-foreground focus-visible:outline-none",
|
|
39
39
|
className
|
|
40
40
|
),
|
|
41
41
|
...props
|
|
@@ -90,7 +90,7 @@ var CommandSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
90
90
|
CommandPrimitive.Separator,
|
|
91
91
|
{
|
|
92
92
|
ref,
|
|
93
|
-
className: twMerge("h-px bg-border", className),
|
|
93
|
+
className: twMerge("h-px bg-fd-border", className),
|
|
94
94
|
...props
|
|
95
95
|
}
|
|
96
96
|
));
|
|
@@ -100,7 +100,7 @@ var CommandItem = React.forwardRef(({ className, icon, nested = false, children,
|
|
|
100
100
|
{
|
|
101
101
|
ref,
|
|
102
102
|
className: twMerge(
|
|
103
|
-
"select-none rounded-lg px-2 text-sm aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
103
|
+
"select-none rounded-lg px-2 text-sm aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-selected:bg-fd-accent aria-selected:text-fd-accent-foreground",
|
|
104
104
|
className
|
|
105
105
|
),
|
|
106
106
|
...props,
|
|
@@ -112,7 +112,7 @@ var CommandItem = React.forwardRef(({ className, icon, nested = false, children,
|
|
|
112
112
|
nested && "ms-2 gap-2 border-s ps-4"
|
|
113
113
|
),
|
|
114
114
|
children: [
|
|
115
|
-
/* @__PURE__ */ jsx("div", { className: "text-muted-foreground [&_svg]:size-4", children: icon }),
|
|
115
|
+
/* @__PURE__ */ jsx("div", { className: "text-fd-muted-foreground [&_svg]:size-4", children: icon }),
|
|
116
116
|
/* @__PURE__ */ jsx("p", { className: "w-0 flex-1 truncate", children })
|
|
117
117
|
]
|
|
118
118
|
}
|
|
@@ -126,8 +126,8 @@ var CommandDialog = React.forwardRef(({ footer, children, ...props }, ref) => /*
|
|
|
126
126
|
ref,
|
|
127
127
|
shouldFilter: false,
|
|
128
128
|
loop: true,
|
|
129
|
-
contentClassName: "fixed left-1/2 top-[10vh] z-50 w-[98vw] max-w-screen-sm origin-left -translate-x-1/2 rounded-lg border bg-popover text-popover-foreground shadow-lg data-[state=closed]:animate-dialog-out data-[state=open]:animate-dialog-in",
|
|
130
|
-
overlayClassName: "fixed inset-0 z-50 bg-background/50 backdrop-blur-sm data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in",
|
|
129
|
+
contentClassName: "fixed left-1/2 top-[10vh] z-50 w-[98vw] max-w-screen-sm origin-left -translate-x-1/2 rounded-lg border bg-fd-popover text-fd-popover-foreground shadow-lg data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in",
|
|
130
|
+
overlayClassName: "fixed inset-0 z-50 bg-fd-background/50 backdrop-blur-sm data-[state=closed]:animate-fd-fade-out data-[state=open]:animate-fd-fade-in",
|
|
131
131
|
...props,
|
|
132
132
|
children: [
|
|
133
133
|
children,
|
|
@@ -217,11 +217,11 @@ function Search2({
|
|
|
217
217
|
] });
|
|
218
218
|
}
|
|
219
219
|
var itemVariants = cva(
|
|
220
|
-
"rounded-md border px-2 py-0.5 text-xs font-medium text-muted-foreground transition-colors",
|
|
220
|
+
"rounded-md border px-2 py-0.5 text-xs font-medium text-fd-muted-foreground transition-colors",
|
|
221
221
|
{
|
|
222
222
|
variants: {
|
|
223
223
|
active: {
|
|
224
|
-
true: "bg-accent text-accent-foreground"
|
|
224
|
+
true: "bg-fd-accent text-fd-accent-foreground"
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
@@ -16,7 +16,7 @@ var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset
|
|
|
16
16
|
sideOffset,
|
|
17
17
|
side: "bottom",
|
|
18
18
|
className: twMerge(
|
|
19
|
-
"z-50 min-w-[220px] max-w-[98vw] rounded-lg border bg-popover p-2 text-sm text-popover-foreground shadow-md outline-none data-[state=closed]:animate-popover-out data-[state=open]:animate-popover-in",
|
|
19
|
+
"z-50 min-w-[220px] max-w-[98vw] rounded-lg border bg-fd-popover p-2 text-sm text-fd-popover-foreground shadow-md outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in",
|
|
20
20
|
className
|
|
21
21
|
),
|
|
22
22
|
...props
|
|
@@ -6,7 +6,7 @@ function getLinks(links, githubUrl) {
|
|
|
6
6
|
result = [
|
|
7
7
|
...result,
|
|
8
8
|
{
|
|
9
|
-
type: "
|
|
9
|
+
type: "icon",
|
|
10
10
|
url: githubUrl,
|
|
11
11
|
text: "Github",
|
|
12
12
|
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" }) }),
|
|
@@ -5,9 +5,9 @@ var buttonVariants = cva(
|
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
color: {
|
|
8
|
-
outline: "border hover:bg-accent hover:text-accent-foreground",
|
|
9
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
10
|
-
secondary: "border bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground"
|
|
8
|
+
outline: "border hover:bg-fd-accent hover:text-fd-accent-foreground",
|
|
9
|
+
ghost: "hover:bg-fd-accent hover:text-fd-accent-foreground",
|
|
10
|
+
secondary: "border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"
|
|
11
11
|
},
|
|
12
12
|
size: {
|
|
13
13
|
sm: "gap-1 p-0.5 text-xs",
|
|
@@ -17,12 +17,12 @@ var buttonVariants = cva(
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
var itemVariants = cva(
|
|
20
|
-
"flex w-full flex-row items-center gap-2 rounded-md px-2 py-1.5 text-muted-foreground transition-colors duration-100 [&_svg]:size-4",
|
|
20
|
+
"flex w-full flex-row items-center gap-2 rounded-md px-2 py-1.5 text-fd-muted-foreground transition-colors duration-100 [&_svg]:size-4",
|
|
21
21
|
{
|
|
22
22
|
variants: {
|
|
23
23
|
active: {
|
|
24
|
-
true: "bg-primary/10 font-medium text-primary",
|
|
25
|
-
false: "hover:bg-accent/50 hover:text-accent-foreground/80 hover:transition-none"
|
|
24
|
+
true: "bg-fd-primary/10 font-medium text-fd-primary",
|
|
25
|
+
false: "hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
defaultVariants: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LargeSearchToggle,
|
|
3
3
|
LinkItem
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U7FLICJE.js";
|
|
5
|
+
import {
|
|
6
|
+
useTreeContext
|
|
7
|
+
} from "./chunk-34Z7WODD.js";
|
|
5
8
|
import {
|
|
6
9
|
ScrollArea,
|
|
7
10
|
ScrollViewport
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
useTreeContext
|
|
11
|
-
} from "./chunk-R3M2OC5U.js";
|
|
11
|
+
} from "./chunk-2FLZOPQN.js";
|
|
12
12
|
import {
|
|
13
13
|
hasActive,
|
|
14
14
|
isActive
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AN2Y6MA2.js";
|
|
16
16
|
import {
|
|
17
17
|
useSearchContext
|
|
18
18
|
} from "./chunk-ET4TW6M5.js";
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
Collapsible,
|
|
21
21
|
CollapsibleContent,
|
|
22
22
|
CollapsibleTrigger
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TQJ6YPJ3.js";
|
|
24
24
|
import {
|
|
25
25
|
itemVariants
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IMIWZAMU.js";
|
|
27
27
|
import {
|
|
28
28
|
twMerge
|
|
29
29
|
} from "./chunk-TK3TM3MR.js";
|
|
@@ -75,8 +75,8 @@ function Sidebar({
|
|
|
75
75
|
blockScrollingWidth: 768,
|
|
76
76
|
...props.aside,
|
|
77
77
|
className: twMerge(
|
|
78
|
-
"fixed z-30 flex shrink-0 flex-col bg-card text-sm md:sticky md:top-0 md:h-dvh md:w-[240px] md:border-e xl:w-[260px]",
|
|
79
|
-
"max-md:inset-0 max-md:bg-background/80 max-md:pt-14 max-md:text-[15px] max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
|
|
78
|
+
"fixed z-30 flex shrink-0 flex-col bg-fd-card text-sm md:sticky md:top-0 md:h-dvh md:w-[240px] md:border-e xl:w-[260px]",
|
|
79
|
+
"max-md:inset-0 max-md:bg-fd-background/80 max-md:pt-14 max-md:text-[15px] max-md:backdrop-blur-md max-md:data-[open=false]:hidden",
|
|
80
80
|
props.aside?.className
|
|
81
81
|
),
|
|
82
82
|
children: [
|
|
@@ -166,17 +166,17 @@ function PageNode({
|
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
function FolderNode({
|
|
169
|
-
item
|
|
169
|
+
item,
|
|
170
170
|
level
|
|
171
171
|
}) {
|
|
172
172
|
const { defaultOpenLevel, prefetch } = useContext(Context);
|
|
173
173
|
const pathname = usePathname();
|
|
174
|
-
const active = index !== void 0 && isActive(index.url, pathname, false);
|
|
174
|
+
const active = item.index !== void 0 && isActive(item.index.url, pathname, false);
|
|
175
175
|
const childActive = useMemo(
|
|
176
|
-
() => hasActive(children, pathname),
|
|
177
|
-
[children, pathname]
|
|
176
|
+
() => hasActive(item.children, pathname),
|
|
177
|
+
[item.children, pathname]
|
|
178
178
|
);
|
|
179
|
-
const shouldExtend = active || childActive || defaultOpenLevel >= level
|
|
179
|
+
const shouldExtend = active || childActive || (item.defaultOpen ?? defaultOpenLevel >= level);
|
|
180
180
|
const [open, setOpen] = useState(shouldExtend);
|
|
181
181
|
useOnChange(shouldExtend, (v) => {
|
|
182
182
|
if (v) setOpen(v);
|
|
@@ -194,8 +194,8 @@ function FolderNode({
|
|
|
194
194
|
[active]
|
|
195
195
|
);
|
|
196
196
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
-
icon,
|
|
198
|
-
name,
|
|
197
|
+
item.icon,
|
|
198
|
+
item.name,
|
|
199
199
|
/* @__PURE__ */ jsx(
|
|
200
200
|
ChevronDown,
|
|
201
201
|
{
|
|
@@ -205,11 +205,11 @@ function FolderNode({
|
|
|
205
205
|
)
|
|
206
206
|
] });
|
|
207
207
|
return /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, children: [
|
|
208
|
-
index ? /* @__PURE__ */ jsx(
|
|
208
|
+
item.index ? /* @__PURE__ */ jsx(
|
|
209
209
|
Link,
|
|
210
210
|
{
|
|
211
211
|
className: twMerge(itemVariants({ active })),
|
|
212
|
-
href: index.url,
|
|
212
|
+
href: item.index.url,
|
|
213
213
|
onClick,
|
|
214
214
|
prefetch,
|
|
215
215
|
children: content
|
|
@@ -219,7 +219,7 @@ function FolderNode({
|
|
|
219
219
|
NodeList,
|
|
220
220
|
{
|
|
221
221
|
className: "ms-2 flex flex-col border-s py-2 ps-2",
|
|
222
|
-
items: children,
|
|
222
|
+
items: item.children,
|
|
223
223
|
level
|
|
224
224
|
}
|
|
225
225
|
) })
|
|
@@ -31,7 +31,7 @@ function NavBox({
|
|
|
31
31
|
...props,
|
|
32
32
|
className: twMerge(
|
|
33
33
|
"sticky top-0 z-50 border-b transition-colors",
|
|
34
|
-
transparent ? "border-transparent" : "border-foreground/10 bg-background/60 backdrop-blur-md",
|
|
34
|
+
transparent ? "border-transparent" : "border-fd-foreground/10 bg-fd-background/60 backdrop-blur-md",
|
|
35
35
|
props.className
|
|
36
36
|
)
|
|
37
37
|
}
|
|
@@ -47,14 +47,17 @@ import { Moon, Sun } from "lucide-react";
|
|
|
47
47
|
import { useTheme } from "next-themes";
|
|
48
48
|
import { useCallback } from "react";
|
|
49
49
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
50
|
-
var buttonVariants = cva(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
var buttonVariants = cva(
|
|
51
|
+
"size-7 rounded-full p-1.5 text-fd-muted-foreground",
|
|
52
|
+
{
|
|
53
|
+
variants: {
|
|
54
|
+
dark: {
|
|
55
|
+
true: "dark:bg-fd-accent dark:text-fd-accent-foreground",
|
|
56
|
+
false: "bg-fd-accent text-fd-accent-foreground dark:bg-transparent dark:text-fd-muted-foreground"
|
|
57
|
+
}
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
|
|
60
|
+
);
|
|
58
61
|
function ThemeToggle({
|
|
59
62
|
className,
|
|
60
63
|
...props
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
twMerge
|
|
3
|
+
} from "./chunk-TK3TM3MR.js";
|
|
4
|
+
|
|
5
|
+
// src/components/callout.tsx
|
|
6
|
+
import { AlertTriangle, Info, OctagonAlert } from "lucide-react";
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var Callout = forwardRef(
|
|
10
|
+
({ className, children, title, type = "info", icon, ...props }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
className: twMerge(
|
|
16
|
+
"my-6 flex flex-row gap-2 rounded-lg border bg-fd-card p-3 text-sm text-fd-card-foreground shadow-md",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props,
|
|
20
|
+
children: [
|
|
21
|
+
icon ?? {
|
|
22
|
+
info: /* @__PURE__ */ jsx(Info, { className: "size-5 fill-blue-500 text-fd-card" }),
|
|
23
|
+
warn: /* @__PURE__ */ jsx(AlertTriangle, { className: "size-5 fill-orange-500 text-fd-card" }),
|
|
24
|
+
error: /* @__PURE__ */ jsx(OctagonAlert, { className: "size-5 fill-red-500 text-fd-card" })
|
|
25
|
+
}[type],
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
27
|
+
title ? /* @__PURE__ */ jsx("p", { className: "not-prose mb-2 font-medium", children: title }) : null,
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: "text-fd-muted-foreground prose-no-margin", children })
|
|
29
|
+
] })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
Callout.displayName = "Callout";
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
Callout
|
|
39
|
+
};
|
|
@@ -8,16 +8,16 @@ import { forwardRef } from "react";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
10
10
|
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
11
|
-
var CollapsibleContent2 = forwardRef(({
|
|
11
|
+
var CollapsibleContent2 = forwardRef(({ children, ...props }, ref) => {
|
|
12
12
|
return /* @__PURE__ */ jsx(
|
|
13
13
|
CollapsiblePrimitive.CollapsibleContent,
|
|
14
14
|
{
|
|
15
15
|
ref,
|
|
16
|
+
...props,
|
|
16
17
|
className: twMerge(
|
|
17
|
-
"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
18
|
-
className
|
|
18
|
+
"overflow-hidden [--radix-collapsible-content-height:0px] data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down",
|
|
19
|
+
props.className
|
|
19
20
|
),
|
|
20
|
-
...props,
|
|
21
21
|
children
|
|
22
22
|
}
|
|
23
23
|
);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-TK3TM3MR.js";
|
|
4
4
|
|
|
5
5
|
// src/components/heading.tsx
|
|
6
|
-
import {
|
|
6
|
+
import { Link } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
function Heading({
|
|
9
9
|
as,
|
|
@@ -11,16 +11,17 @@ function Heading({
|
|
|
11
11
|
...props
|
|
12
12
|
}) {
|
|
13
13
|
const As = as ?? "h1";
|
|
14
|
-
return /* @__PURE__ */ jsx(As, { className
|
|
14
|
+
if (!props.id) return /* @__PURE__ */ jsx(As, { className, ...props });
|
|
15
|
+
return /* @__PURE__ */ jsx(As, { className: twMerge("scroll-m-20", className), ...props, children: /* @__PURE__ */ jsxs("a", { href: `#${props.id}`, className: "group inline-flex items-center", children: [
|
|
15
16
|
props.children,
|
|
16
17
|
/* @__PURE__ */ jsx(
|
|
17
|
-
|
|
18
|
+
Link,
|
|
18
19
|
{
|
|
19
20
|
"aria-label": "Link to section",
|
|
20
|
-
className: "ms-2
|
|
21
|
+
className: "ms-2 size-4 text-fd-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"
|
|
21
22
|
}
|
|
22
23
|
)
|
|
23
|
-
] })
|
|
24
|
+
] }) });
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export {
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
Popover,
|
|
3
3
|
PopoverContent,
|
|
4
4
|
PopoverTrigger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GLZ6ALZV.js";
|
|
6
6
|
import {
|
|
7
7
|
isActive
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AN2Y6MA2.js";
|
|
9
9
|
import {
|
|
10
10
|
useSearchContext
|
|
11
11
|
} from "./chunk-ET4TW6M5.js";
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
Collapsible,
|
|
17
17
|
CollapsibleContent,
|
|
18
18
|
CollapsibleTrigger
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TQJ6YPJ3.js";
|
|
20
20
|
import {
|
|
21
21
|
buttonVariants,
|
|
22
22
|
itemVariants
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IMIWZAMU.js";
|
|
24
24
|
import {
|
|
25
25
|
twMerge
|
|
26
26
|
} from "./chunk-TK3TM3MR.js";
|
|
@@ -34,12 +34,12 @@ import { useState } from "react";
|
|
|
34
34
|
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
35
35
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
36
|
var linkItemVariants = cva(
|
|
37
|
-
"-m-2 inline-flex items-center gap-1 p-2 text-muted-foreground transition-colors [&_svg]:size-4",
|
|
37
|
+
"-m-2 inline-flex items-center gap-1 p-2 text-fd-muted-foreground transition-colors [&_svg]:size-4",
|
|
38
38
|
{
|
|
39
39
|
variants: {
|
|
40
40
|
active: {
|
|
41
|
-
true: "text-primary",
|
|
42
|
-
false: "hover:text-accent-foreground"
|
|
41
|
+
true: "text-fd-primary",
|
|
42
|
+
false: "hover:text-fd-accent-foreground"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
defaultVariants: {
|
|
@@ -108,7 +108,7 @@ function LinkItem({
|
|
|
108
108
|
}
|
|
109
109
|
const activeType = item.active ?? "url";
|
|
110
110
|
const active = activeType !== "none" && isActive(item.url, pathname, activeType === "nested-url");
|
|
111
|
-
if (
|
|
111
|
+
if (item.type === "icon" && on === "nav") {
|
|
112
112
|
return /* @__PURE__ */ jsx(
|
|
113
113
|
Link,
|
|
114
114
|
{
|
|
@@ -201,7 +201,7 @@ function LargeSearchToggle(props) {
|
|
|
201
201
|
"data-search-full": "",
|
|
202
202
|
...props,
|
|
203
203
|
className: twMerge(
|
|
204
|
-
"inline-flex 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",
|
|
204
|
+
"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",
|
|
205
205
|
props.className
|
|
206
206
|
),
|
|
207
207
|
onClick: useCallback(() => {
|
|
@@ -210,7 +210,7 @@ function LargeSearchToggle(props) {
|
|
|
210
210
|
children: [
|
|
211
211
|
/* @__PURE__ */ jsx2(SearchIcon, { className: "ms-1 size-4" }),
|
|
212
212
|
text.search,
|
|
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-background px-1.5", children: k.display }, i)) })
|
|
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)) })
|
|
214
214
|
]
|
|
215
215
|
}
|
|
216
216
|
);
|
|
@@ -26,13 +26,13 @@ function Card({
|
|
|
26
26
|
{
|
|
27
27
|
...props,
|
|
28
28
|
className: twMerge(
|
|
29
|
-
"not-prose block rounded-lg border bg-card p-4 text-sm text-card-foreground shadow-md transition-colors hover:bg-accent/80",
|
|
29
|
+
"not-prose block rounded-lg border bg-fd-card p-4 text-sm text-fd-card-foreground shadow-md transition-colors hover:bg-fd-accent/80",
|
|
30
30
|
props.className
|
|
31
31
|
),
|
|
32
32
|
children: [
|
|
33
|
-
icon ? /* @__PURE__ */ jsx("div", { className: "mb-2 w-fit rounded-md border bg-muted p-2 text-muted-foreground [&_svg]:size-4", children: icon }) : null,
|
|
33
|
+
icon ? /* @__PURE__ */ jsx("div", { className: "mb-2 w-fit rounded-md border bg-fd-muted p-2 text-fd-muted-foreground [&_svg]:size-4", children: icon }) : null,
|
|
34
34
|
/* @__PURE__ */ jsx("h3", { className: "mb-1 font-medium", children: title }),
|
|
35
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: description })
|
|
35
|
+
description ? /* @__PURE__ */ jsx("p", { className: "text-fd-muted-foreground", children: description }) : null
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
);
|