fumadocs-ui 14.2.0 → 14.3.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/components/accordion.d.ts +4 -7
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +32 -104
- package/dist/components/api.d.ts +4 -13
- package/dist/components/api.d.ts.map +1 -0
- package/dist/components/api.js +3 -16
- package/dist/components/banner.d.ts +3 -5
- package/dist/components/banner.d.ts.map +1 -0
- package/dist/components/banner.js +53 -120
- package/dist/components/callout.d.ts +4 -7
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +13 -9
- package/dist/components/card.d.ts +5 -7
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +10 -10
- package/dist/components/codeblock.d.ts +6 -9
- package/dist/components/codeblock.d.ts.map +1 -0
- package/dist/components/codeblock.js +41 -15
- package/dist/components/dialog/search-algolia.d.ts +7 -11
- package/dist/components/dialog/search-algolia.d.ts.map +1 -0
- package/dist/components/dialog/search-algolia.js +19 -79
- package/dist/components/dialog/search-default.d.ts +6 -10
- package/dist/components/dialog/search-default.d.ts.map +1 -0
- package/dist/components/dialog/search-default.js +24 -73
- package/dist/components/dialog/search-orama.d.ts +7 -11
- package/dist/components/dialog/search-orama.d.ts.map +1 -0
- package/dist/components/dialog/search-orama.js +22 -79
- package/dist/components/dialog/search.d.ts +7 -9
- package/dist/components/dialog/search.d.ts.map +1 -0
- package/dist/components/dialog/search.js +98 -13
- package/dist/components/dialog/tag-list.d.ts +13 -0
- package/dist/components/dialog/tag-list.d.ts.map +1 -0
- package/dist/components/dialog/tag-list.js +20 -0
- package/dist/components/files.d.ts +7 -9
- package/dist/components/files.d.ts.map +1 -0
- package/dist/components/files.js +15 -63
- package/dist/components/heading.d.ts +4 -5
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +9 -9
- package/dist/components/image-zoom.d.ts +7 -8
- package/dist/components/image-zoom.d.ts.map +1 -0
- package/dist/components/image-zoom.js +16 -40
- package/dist/components/inline-toc.d.ts +4 -6
- package/dist/components/inline-toc.d.ts.map +1 -0
- package/dist/components/inline-toc.js +8 -46
- package/dist/components/layout/breadcrumb.d.ts +11 -0
- package/dist/components/layout/breadcrumb.d.ts.map +1 -0
- package/dist/components/layout/breadcrumb.js +20 -0
- package/dist/components/layout/language-toggle.d.ts +5 -7
- package/dist/components/layout/language-toggle.d.ts.map +1 -0
- package/dist/components/layout/language-toggle.js +24 -14
- package/dist/components/layout/nav.d.ts +28 -0
- package/dist/components/layout/nav.d.ts.map +1 -0
- package/dist/components/layout/nav.js +29 -0
- package/dist/components/layout/root-toggle.d.ts +5 -7
- package/dist/components/layout/root-toggle.d.ts.map +1 -0
- package/dist/components/layout/root-toggle.js +28 -13
- package/dist/components/layout/search-toggle.d.ts +4 -0
- package/dist/components/layout/search-toggle.d.ts.map +1 -0
- package/dist/components/layout/search-toggle.js +24 -0
- package/dist/components/layout/theme-toggle.d.ts +3 -0
- package/dist/components/layout/theme-toggle.d.ts.map +1 -0
- package/dist/components/layout/theme-toggle.js +21 -0
- package/dist/components/layout/toc-clerk.d.ts +6 -0
- package/dist/components/layout/toc-clerk.d.ts.map +1 -0
- package/dist/components/layout/toc-clerk.js +76 -0
- package/dist/components/layout/toc-popover.d.ts +8 -0
- package/dist/components/layout/toc-popover.d.ts.map +1 -0
- package/dist/components/layout/toc-popover.js +20 -0
- package/dist/components/layout/toc-thumb.d.ts +6 -0
- package/dist/components/layout/toc-thumb.d.ts.map +1 -0
- package/dist/components/layout/toc-thumb.js +53 -0
- package/dist/components/layout/toc.d.ts +19 -0
- package/dist/components/layout/toc.d.ts.map +1 -0
- package/dist/components/layout/toc.js +25 -0
- package/dist/components/registry.d.ts +3 -0
- package/dist/components/registry.d.ts.map +1 -0
- package/dist/components/registry.js +70 -0
- package/dist/components/steps.d.ts +4 -6
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/steps.js +5 -16
- package/dist/components/tabs.d.ts +7 -21
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +61 -171
- package/dist/components/type-table.d.ts +5 -6
- package/dist/components/type-table.d.ts.map +1 -0
- package/dist/components/type-table.js +18 -59
- package/dist/components/ui/button.d.ts +5 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +14 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +12 -0
- package/dist/components/ui/navigation-menu.d.ts +11 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +15 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +11 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +11 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +16 -0
- package/dist/{i18n-Db2HAPOu.d.ts → contexts/i18n.d.ts} +9 -5
- package/dist/contexts/i18n.d.ts.map +1 -0
- package/dist/contexts/i18n.js +23 -0
- package/dist/contexts/search.d.ts +50 -0
- package/dist/contexts/search.d.ts.map +1 -0
- package/dist/contexts/search.js +50 -0
- package/dist/contexts/sidebar.d.ts +18 -0
- package/dist/contexts/sidebar.d.ts.map +1 -0
- package/dist/contexts/sidebar.js +31 -0
- package/dist/contexts/tree.d.ts +13 -0
- package/dist/contexts/tree.d.ts.map +1 -0
- package/dist/contexts/tree.js +25 -0
- package/dist/i18n.d.ts +5 -6
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +31 -49
- package/dist/layouts/docs/navbar.d.ts +4 -0
- package/dist/layouts/docs/navbar.d.ts.map +1 -0
- package/dist/layouts/docs/navbar.js +22 -0
- package/dist/layouts/docs/sidebar.d.ts +40 -0
- package/dist/layouts/docs/sidebar.d.ts.map +1 -0
- package/dist/layouts/docs/sidebar.js +146 -0
- package/dist/layouts/docs.client.d.ts +14 -25
- package/dist/layouts/docs.client.d.ts.map +1 -0
- package/dist/layouts/docs.client.js +53 -195
- package/dist/layouts/docs.d.ts +34 -19
- package/dist/layouts/docs.d.ts.map +1 -0
- package/dist/layouts/docs.js +67 -202
- package/dist/layouts/home/menu.d.ts +6 -0
- package/dist/layouts/home/menu.d.ts.map +1 -0
- package/dist/layouts/home/menu.js +33 -0
- package/dist/layouts/home/navbar.d.ts +16 -0
- package/dist/layouts/home/navbar.d.ts.map +1 -0
- package/dist/layouts/home/navbar.js +48 -0
- package/dist/layouts/home.d.ts +5 -7
- package/dist/layouts/home.d.ts.map +1 -0
- package/dist/layouts/home.js +51 -59
- package/dist/layouts/links.d.ts +80 -0
- package/dist/layouts/links.d.ts.map +1 -0
- package/dist/layouts/links.js +14 -0
- package/dist/layouts/shared.d.ts +48 -2
- package/dist/layouts/shared.d.ts.map +1 -0
- package/dist/layouts/shared.js +27 -9
- package/dist/mdx.client.d.ts +3 -6
- package/dist/mdx.client.d.ts.map +1 -0
- package/dist/mdx.client.js +12 -19
- package/dist/mdx.d.ts +18 -20
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +47 -56
- package/dist/og.d.ts +6 -7
- package/dist/og.d.ts.map +1 -0
- package/dist/og.js +43 -102
- package/dist/page.client.d.ts +8 -41
- package/dist/page.client.d.ts.map +1 -0
- package/dist/page.client.js +71 -261
- package/dist/page.d.ts +28 -30
- package/dist/page.d.ts.map +1 -0
- package/dist/page.js +80 -168
- package/dist/provider.d.ts +12 -72
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +19 -55
- package/dist/style.css +1 -1
- package/dist/tailwind-plugin.d.ts +9 -20
- package/dist/tailwind-plugin.d.ts.map +1 -0
- package/dist/tailwind-plugin.js +191 -699
- package/dist/theme/animations.d.ts +170 -0
- package/dist/theme/animations.d.ts.map +1 -0
- package/dist/theme/animations.js +95 -0
- package/dist/theme/colors.d.ts +11 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +327 -0
- package/dist/theme/typography.d.ts +70 -0
- package/dist/theme/typography.d.ts.map +1 -0
- package/dist/theme/typography.js +71 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +1 -0
- package/dist/utils/get-sidebar-tabs.d.ts +7 -0
- package/dist/utils/get-sidebar-tabs.d.ts.map +1 -0
- package/dist/utils/get-sidebar-tabs.js +20 -0
- package/dist/utils/is-active.d.ts +2 -0
- package/dist/utils/is-active.d.ts.map +1 -0
- package/dist/utils/is-active.js +3 -0
- package/dist/utils/use-copy-button.d.ts +3 -0
- package/dist/utils/use-copy-button.d.ts.map +1 -0
- package/dist/utils/use-copy-button.js +25 -0
- package/package.json +9 -9
- package/dist/chunk-27HFSL7N.js +0 -53
- package/dist/chunk-2FLZOPQN.js +0 -54
- package/dist/chunk-2KMKNVSN.js +0 -29
- package/dist/chunk-45REPLUI.js +0 -259
- package/dist/chunk-5KVEK5A7.js +0 -139
- package/dist/chunk-5QPVK7QM.js +0 -542
- package/dist/chunk-CDPVENXR.js +0 -8
- package/dist/chunk-CPGKWLLV.js +0 -43
- package/dist/chunk-DGKCMOIC.js +0 -56
- package/dist/chunk-DN6Z5VW6.js +0 -61
- package/dist/chunk-E3VO2QQT.js +0 -29
- package/dist/chunk-EFMHXXHW.js +0 -24
- package/dist/chunk-ET4TW6M5.js +0 -70
- package/dist/chunk-GHOAONNQ.js +0 -48
- package/dist/chunk-IHIFNFRB.js +0 -38
- package/dist/chunk-IVBHRX3O.js +0 -31
- package/dist/chunk-JUOW3DZK.js +0 -212
- package/dist/chunk-KZTWSBYY.js +0 -68
- package/dist/chunk-MCX7E6ZW.js +0 -57
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-PZTQPB4U.js +0 -125
- package/dist/chunk-QKOA6KEZ.js +0 -22
- package/dist/chunk-TK3TM3MR.js +0 -6
- package/dist/chunk-TQJ6YPJ3.js +0 -31
- package/dist/chunk-V6RONFCQ.js +0 -69
- package/dist/chunk-WRBUXI2A.js +0 -82
- package/dist/chunk-YL3MZH7N.js +0 -66
- package/dist/components/api.client.d.ts +0 -5
- package/dist/components/api.client.js +0 -8
- package/dist/dynamic-sidebar-MEINO4E2.js +0 -129
- package/dist/edit-on-github-PCTRDRD6.js +0 -49
- package/dist/layouts/home.client.d.ts +0 -11
- package/dist/layouts/home.client.js +0 -274
- package/dist/shared-SScCiV7b.d.ts +0 -152
- package/dist/sidebar-CQ4HmzQl.d.ts +0 -50
- package/dist/tag-list-BsEgfE3x.d.ts +0 -6
- package/dist/toc-clerk-SKE4LBT7.js +0 -158
- package/dist/tree-06ley65N.d.ts +0 -21
package/dist/chunk-MCX7E6ZW.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
twMerge
|
|
3
|
-
} from "./chunk-TK3TM3MR.js";
|
|
4
|
-
import {
|
|
5
|
-
useI18n
|
|
6
|
-
} from "./chunk-EFMHXXHW.js";
|
|
7
|
-
|
|
8
|
-
// src/components/layout/nav.tsx
|
|
9
|
-
import Link from "fumadocs-core/link";
|
|
10
|
-
import { createContext, useEffect, useState } from "react";
|
|
11
|
-
import { jsx } from "react/jsx-runtime";
|
|
12
|
-
var NavContext = createContext({
|
|
13
|
-
isTransparent: false
|
|
14
|
-
});
|
|
15
|
-
function NavProvider({
|
|
16
|
-
transparentMode = "none",
|
|
17
|
-
children
|
|
18
|
-
}) {
|
|
19
|
-
const [transparent, setTransparent] = useState(transparentMode !== "none");
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (transparentMode !== "top") return;
|
|
22
|
-
const listener = () => {
|
|
23
|
-
setTransparent(window.scrollY < 10);
|
|
24
|
-
};
|
|
25
|
-
listener();
|
|
26
|
-
window.addEventListener("scroll", listener);
|
|
27
|
-
return () => {
|
|
28
|
-
window.removeEventListener("scroll", listener);
|
|
29
|
-
};
|
|
30
|
-
}, [transparentMode]);
|
|
31
|
-
return /* @__PURE__ */ jsx(NavContext.Provider, { value: { isTransparent: transparent }, children });
|
|
32
|
-
}
|
|
33
|
-
function Title({
|
|
34
|
-
title,
|
|
35
|
-
url,
|
|
36
|
-
...props
|
|
37
|
-
}) {
|
|
38
|
-
const { locale } = useI18n();
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
Link,
|
|
41
|
-
{
|
|
42
|
-
href: url ?? (locale ? `/${locale}` : "/"),
|
|
43
|
-
...props,
|
|
44
|
-
className: twMerge(
|
|
45
|
-
"inline-flex items-center gap-2.5 font-semibold",
|
|
46
|
-
props.className
|
|
47
|
-
),
|
|
48
|
-
children: title
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
NavContext,
|
|
55
|
-
NavProvider,
|
|
56
|
-
Title
|
|
57
|
-
};
|
package/dist/chunk-MLKGABMK.js
DELETED
package/dist/chunk-PZTQPB4U.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isActive
|
|
3
|
-
} from "./chunk-CDPVENXR.js";
|
|
4
|
-
import {
|
|
5
|
-
buttonVariants
|
|
6
|
-
} from "./chunk-QKOA6KEZ.js";
|
|
7
|
-
import {
|
|
8
|
-
Moon,
|
|
9
|
-
Sun
|
|
10
|
-
} from "./chunk-5QPVK7QM.js";
|
|
11
|
-
import {
|
|
12
|
-
twMerge
|
|
13
|
-
} from "./chunk-TK3TM3MR.js";
|
|
14
|
-
|
|
15
|
-
// src/layouts/links.tsx
|
|
16
|
-
import Link from "fumadocs-core/link";
|
|
17
|
-
import { usePathname } from "next/navigation";
|
|
18
|
-
import { forwardRef } from "react";
|
|
19
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
-
var BaseLinkItem = forwardRef(({ item, ...props }, ref) => {
|
|
21
|
-
const pathname = usePathname();
|
|
22
|
-
const activeType = item.active ?? "url";
|
|
23
|
-
const active = activeType !== "none" && isActive(item.url, pathname, activeType === "nested-url");
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
Link,
|
|
26
|
-
{
|
|
27
|
-
ref,
|
|
28
|
-
href: item.url,
|
|
29
|
-
external: item.external,
|
|
30
|
-
...props,
|
|
31
|
-
"data-active": active,
|
|
32
|
-
children: props.children
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
BaseLinkItem.displayName = "BaseLinkItem";
|
|
37
|
-
var ButtonItem = forwardRef(({ item, ...props }, ref) => {
|
|
38
|
-
return /* @__PURE__ */ jsxs(
|
|
39
|
-
Link,
|
|
40
|
-
{
|
|
41
|
-
ref,
|
|
42
|
-
href: item.url,
|
|
43
|
-
external: item.external,
|
|
44
|
-
...props,
|
|
45
|
-
className: twMerge(
|
|
46
|
-
buttonVariants({ color: "secondary" }),
|
|
47
|
-
"gap-1.5 [&_svg]:size-4",
|
|
48
|
-
props.className
|
|
49
|
-
),
|
|
50
|
-
children: [
|
|
51
|
-
item.icon,
|
|
52
|
-
item.text
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
ButtonItem.displayName = "ButtonItem";
|
|
58
|
-
var IconItem = forwardRef(({ item, ...props }, ref) => {
|
|
59
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
-
Link,
|
|
61
|
-
{
|
|
62
|
-
ref,
|
|
63
|
-
"aria-label": item.label,
|
|
64
|
-
href: item.url,
|
|
65
|
-
external: item.external,
|
|
66
|
-
...props,
|
|
67
|
-
className: twMerge(
|
|
68
|
-
buttonVariants({
|
|
69
|
-
size: "icon",
|
|
70
|
-
color: "ghost"
|
|
71
|
-
}),
|
|
72
|
-
props.className
|
|
73
|
-
),
|
|
74
|
-
children: item.icon
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
IconItem.displayName = "IconItem";
|
|
79
|
-
|
|
80
|
-
// src/components/layout/theme-toggle.tsx
|
|
81
|
-
import { cva } from "class-variance-authority";
|
|
82
|
-
import { useTheme } from "next-themes";
|
|
83
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
84
|
-
var buttonVariants2 = cva("size-6 rounded-full p-1 text-fd-muted-foreground", {
|
|
85
|
-
variants: {
|
|
86
|
-
dark: {
|
|
87
|
-
true: "dark:bg-fd-accent dark:text-fd-accent-foreground",
|
|
88
|
-
false: "bg-fd-accent text-fd-accent-foreground dark:bg-transparent dark:text-fd-muted-foreground"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
function ThemeToggle({
|
|
93
|
-
className,
|
|
94
|
-
...props
|
|
95
|
-
}) {
|
|
96
|
-
const { setTheme, resolvedTheme } = useTheme();
|
|
97
|
-
const onToggle = () => {
|
|
98
|
-
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
99
|
-
};
|
|
100
|
-
return /* @__PURE__ */ jsxs2(
|
|
101
|
-
"button",
|
|
102
|
-
{
|
|
103
|
-
type: "button",
|
|
104
|
-
className: twMerge(
|
|
105
|
-
"inline-flex items-center rounded-full border p-0.5",
|
|
106
|
-
className
|
|
107
|
-
),
|
|
108
|
-
"data-theme-toggle": "",
|
|
109
|
-
"aria-label": "Toggle Theme",
|
|
110
|
-
onClick: onToggle,
|
|
111
|
-
...props,
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ jsx2(Sun, { className: twMerge(buttonVariants2({ dark: false })) }),
|
|
114
|
-
/* @__PURE__ */ jsx2(Moon, { className: twMerge(buttonVariants2({ dark: true })) })
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export {
|
|
121
|
-
BaseLinkItem,
|
|
122
|
-
ButtonItem,
|
|
123
|
-
IconItem,
|
|
124
|
-
ThemeToggle
|
|
125
|
-
};
|
package/dist/chunk-QKOA6KEZ.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/components/ui/button.tsx
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
var buttonVariants = cva(
|
|
4
|
-
"inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50",
|
|
5
|
-
{
|
|
6
|
-
variants: {
|
|
7
|
-
color: {
|
|
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
|
-
},
|
|
12
|
-
size: {
|
|
13
|
-
sm: "gap-1 p-0.5 text-xs",
|
|
14
|
-
icon: "p-1.5 [&_svg]:size-5"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export {
|
|
21
|
-
buttonVariants
|
|
22
|
-
};
|
package/dist/chunk-TK3TM3MR.js
DELETED
package/dist/chunk-TQJ6YPJ3.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
twMerge
|
|
3
|
-
} from "./chunk-TK3TM3MR.js";
|
|
4
|
-
|
|
5
|
-
// src/components/ui/collapsible.tsx
|
|
6
|
-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
7
|
-
import { forwardRef } from "react";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var Collapsible = CollapsiblePrimitive.Root;
|
|
10
|
-
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
11
|
-
var CollapsibleContent2 = forwardRef(({ children, ...props }, ref) => {
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
-
CollapsiblePrimitive.CollapsibleContent,
|
|
14
|
-
{
|
|
15
|
-
ref,
|
|
16
|
-
...props,
|
|
17
|
-
className: twMerge(
|
|
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
|
|
20
|
-
),
|
|
21
|
-
children
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
CollapsibleContent2.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
Collapsible,
|
|
29
|
-
CollapsibleTrigger2 as CollapsibleTrigger,
|
|
30
|
-
CollapsibleContent2 as CollapsibleContent
|
|
31
|
-
};
|
package/dist/chunk-V6RONFCQ.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buttonVariants
|
|
3
|
-
} from "./chunk-QKOA6KEZ.js";
|
|
4
|
-
import {
|
|
5
|
-
Search
|
|
6
|
-
} from "./chunk-5QPVK7QM.js";
|
|
7
|
-
import {
|
|
8
|
-
twMerge
|
|
9
|
-
} from "./chunk-TK3TM3MR.js";
|
|
10
|
-
import {
|
|
11
|
-
useSearchContext
|
|
12
|
-
} from "./chunk-ET4TW6M5.js";
|
|
13
|
-
import {
|
|
14
|
-
useI18n
|
|
15
|
-
} from "./chunk-EFMHXXHW.js";
|
|
16
|
-
|
|
17
|
-
// src/components/layout/search-toggle.tsx
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
function SearchToggle(props) {
|
|
20
|
-
const { setOpenSearch } = useSearchContext();
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
-
"button",
|
|
23
|
-
{
|
|
24
|
-
type: "button",
|
|
25
|
-
className: twMerge(
|
|
26
|
-
buttonVariants({
|
|
27
|
-
size: "icon",
|
|
28
|
-
color: "ghost",
|
|
29
|
-
className: props.className
|
|
30
|
-
})
|
|
31
|
-
),
|
|
32
|
-
"data-search": "",
|
|
33
|
-
"aria-label": "Open Search",
|
|
34
|
-
onClick: () => {
|
|
35
|
-
setOpenSearch(true);
|
|
36
|
-
},
|
|
37
|
-
children: /* @__PURE__ */ jsx(Search, {})
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
function LargeSearchToggle(props) {
|
|
42
|
-
const { hotKey, setOpenSearch } = useSearchContext();
|
|
43
|
-
const { text } = useI18n();
|
|
44
|
-
return /* @__PURE__ */ jsxs(
|
|
45
|
-
"button",
|
|
46
|
-
{
|
|
47
|
-
type: "button",
|
|
48
|
-
"data-search-full": "",
|
|
49
|
-
...props,
|
|
50
|
-
className: twMerge(
|
|
51
|
-
"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",
|
|
52
|
-
props.className
|
|
53
|
-
),
|
|
54
|
-
onClick: () => {
|
|
55
|
-
setOpenSearch(true);
|
|
56
|
-
},
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ jsx(Search, { className: "ms-1 size-4" }),
|
|
59
|
-
text.search,
|
|
60
|
-
/* @__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)) })
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export {
|
|
67
|
-
SearchToggle,
|
|
68
|
-
LargeSearchToggle
|
|
69
|
-
};
|
package/dist/chunk-WRBUXI2A.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isActive
|
|
3
|
-
} from "./chunk-CDPVENXR.js";
|
|
4
|
-
import {
|
|
5
|
-
Popover,
|
|
6
|
-
PopoverContent,
|
|
7
|
-
PopoverTrigger
|
|
8
|
-
} from "./chunk-IVBHRX3O.js";
|
|
9
|
-
import {
|
|
10
|
-
ChevronDown
|
|
11
|
-
} from "./chunk-5QPVK7QM.js";
|
|
12
|
-
import {
|
|
13
|
-
twMerge
|
|
14
|
-
} from "./chunk-TK3TM3MR.js";
|
|
15
|
-
import {
|
|
16
|
-
useSidebar
|
|
17
|
-
} from "./chunk-27HFSL7N.js";
|
|
18
|
-
|
|
19
|
-
// src/components/layout/root-toggle.tsx
|
|
20
|
-
import { useMemo, useState } from "react";
|
|
21
|
-
import Link from "next/link";
|
|
22
|
-
import { usePathname } from "next/navigation";
|
|
23
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
-
function RootToggle({
|
|
25
|
-
options,
|
|
26
|
-
...props
|
|
27
|
-
}) {
|
|
28
|
-
const [open, setOpen] = useState(false);
|
|
29
|
-
const { closeOnRedirect } = useSidebar();
|
|
30
|
-
const pathname = usePathname();
|
|
31
|
-
const selected = useMemo(() => {
|
|
32
|
-
return options.find((item) => isActive(item.url, pathname, true));
|
|
33
|
-
}, [options, pathname]);
|
|
34
|
-
const onClick = () => {
|
|
35
|
-
closeOnRedirect.current = false;
|
|
36
|
-
setOpen(false);
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
39
|
-
/* @__PURE__ */ jsxs(
|
|
40
|
-
PopoverTrigger,
|
|
41
|
-
{
|
|
42
|
-
...props,
|
|
43
|
-
className: twMerge(
|
|
44
|
-
"flex flex-row items-center gap-2.5 rounded-lg p-1 hover:bg-fd-accent/50 hover:text-fd-accent-foreground",
|
|
45
|
-
props.className
|
|
46
|
-
),
|
|
47
|
-
children: [
|
|
48
|
-
selected ? /* @__PURE__ */ jsx(Item, { ...selected }) : null,
|
|
49
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "size-4 text-fd-muted-foreground md:me-1.5" })
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
),
|
|
53
|
-
/* @__PURE__ */ jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] overflow-hidden p-0", children: options.map((item) => /* @__PURE__ */ jsx(
|
|
54
|
-
Link,
|
|
55
|
-
{
|
|
56
|
-
href: item.url,
|
|
57
|
-
onClick,
|
|
58
|
-
...item.props,
|
|
59
|
-
className: twMerge(
|
|
60
|
-
"flex w-full flex-row items-center gap-2.5 p-1.5",
|
|
61
|
-
selected === item ? "bg-fd-accent text-fd-accent-foreground" : "hover:bg-fd-accent/50",
|
|
62
|
-
item.props?.className
|
|
63
|
-
),
|
|
64
|
-
children: /* @__PURE__ */ jsx(Item, { ...item })
|
|
65
|
-
},
|
|
66
|
-
item.url
|
|
67
|
-
)) })
|
|
68
|
-
] });
|
|
69
|
-
}
|
|
70
|
-
function Item(props) {
|
|
71
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
-
props.icon,
|
|
73
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 text-left", children: [
|
|
74
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: props.title }),
|
|
75
|
-
props.description ? /* @__PURE__ */ jsx("p", { className: "text-xs text-fd-muted-foreground", children: props.description }) : null
|
|
76
|
-
] })
|
|
77
|
-
] });
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export {
|
|
81
|
-
RootToggle
|
|
82
|
-
};
|
package/dist/chunk-YL3MZH7N.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// src/contexts/tree.tsx
|
|
2
|
-
import { usePathname } from "next/navigation";
|
|
3
|
-
import {
|
|
4
|
-
createContext,
|
|
5
|
-
useContext,
|
|
6
|
-
useMemo,
|
|
7
|
-
useRef
|
|
8
|
-
} from "react";
|
|
9
|
-
import { searchPath } from "fumadocs-core/breadcrumb";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
var TreeContext = createContext(void 0);
|
|
12
|
-
function scanNavigationList(tree, list) {
|
|
13
|
-
tree.forEach((node) => {
|
|
14
|
-
if (node.type === "folder") {
|
|
15
|
-
if (node.index) {
|
|
16
|
-
list.push(node.index);
|
|
17
|
-
}
|
|
18
|
-
scanNavigationList(node.children, list);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (node.type === "page" && !node.external) {
|
|
22
|
-
list.push(node);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function TreeContextProvider({
|
|
27
|
-
children,
|
|
28
|
-
tree
|
|
29
|
-
}) {
|
|
30
|
-
const pathname = usePathname();
|
|
31
|
-
const cache = useRef();
|
|
32
|
-
const value = useMemo(() => {
|
|
33
|
-
const path = searchPath(tree.children, pathname) ?? [];
|
|
34
|
-
const root = path.findLast(
|
|
35
|
-
(item) => item.type === "folder" && item.root
|
|
36
|
-
) ?? tree;
|
|
37
|
-
return {
|
|
38
|
-
path,
|
|
39
|
-
root,
|
|
40
|
-
getNeighbours() {
|
|
41
|
-
cache.current ??= /* @__PURE__ */ new WeakMap();
|
|
42
|
-
let result = cache.current.get(root);
|
|
43
|
-
if (!result) {
|
|
44
|
-
result = [];
|
|
45
|
-
scanNavigationList(root.children, result);
|
|
46
|
-
cache.current.set(root, result);
|
|
47
|
-
}
|
|
48
|
-
const idx = result.findIndex((item) => item.url === pathname);
|
|
49
|
-
if (idx === -1) return [void 0, void 0];
|
|
50
|
-
return [result[idx - 1], result[idx + 1]];
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}, [pathname, tree]);
|
|
54
|
-
return /* @__PURE__ */ jsx(TreeContext.Provider, { value, children });
|
|
55
|
-
}
|
|
56
|
-
function useTreeContext() {
|
|
57
|
-
const ctx = useContext(TreeContext);
|
|
58
|
-
if (!ctx)
|
|
59
|
-
throw new Error("You must wrap this component under <DocsLayout />");
|
|
60
|
-
return ctx;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export {
|
|
64
|
-
TreeContextProvider,
|
|
65
|
-
useTreeContext
|
|
66
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Sidebar
|
|
4
|
-
} from "./chunk-JUOW3DZK.js";
|
|
5
|
-
import "./chunk-V6RONFCQ.js";
|
|
6
|
-
import "./chunk-CDPVENXR.js";
|
|
7
|
-
import "./chunk-TQJ6YPJ3.js";
|
|
8
|
-
import {
|
|
9
|
-
buttonVariants
|
|
10
|
-
} from "./chunk-QKOA6KEZ.js";
|
|
11
|
-
import "./chunk-2FLZOPQN.js";
|
|
12
|
-
import {
|
|
13
|
-
PanelLeft
|
|
14
|
-
} from "./chunk-5QPVK7QM.js";
|
|
15
|
-
import {
|
|
16
|
-
twMerge
|
|
17
|
-
} from "./chunk-TK3TM3MR.js";
|
|
18
|
-
import "./chunk-ET4TW6M5.js";
|
|
19
|
-
import "./chunk-YL3MZH7N.js";
|
|
20
|
-
import {
|
|
21
|
-
useSidebar
|
|
22
|
-
} from "./chunk-27HFSL7N.js";
|
|
23
|
-
import "./chunk-EFMHXXHW.js";
|
|
24
|
-
import "./chunk-MLKGABMK.js";
|
|
25
|
-
|
|
26
|
-
// src/components/layout/dynamic-sidebar.tsx
|
|
27
|
-
import {
|
|
28
|
-
useCallback,
|
|
29
|
-
useMemo,
|
|
30
|
-
useRef,
|
|
31
|
-
useState
|
|
32
|
-
} from "react";
|
|
33
|
-
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
34
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
35
|
-
function DynamicSidebar(props) {
|
|
36
|
-
const { collapsed, setCollapsed } = useSidebar();
|
|
37
|
-
const [hover, setHover] = useState(false);
|
|
38
|
-
const timerRef = useRef(0);
|
|
39
|
-
const closeTimeRef = useRef(0);
|
|
40
|
-
useOnChange(collapsed, () => {
|
|
41
|
-
setHover(false);
|
|
42
|
-
closeTimeRef.current = Date.now() + 150;
|
|
43
|
-
});
|
|
44
|
-
const onEnter = useCallback((e) => {
|
|
45
|
-
if (e.pointerType === "touch" || closeTimeRef.current > Date.now()) return;
|
|
46
|
-
window.clearTimeout(timerRef.current);
|
|
47
|
-
setHover(true);
|
|
48
|
-
}, []);
|
|
49
|
-
const onLeave = useCallback((e) => {
|
|
50
|
-
if (e.pointerType === "touch") return;
|
|
51
|
-
window.clearTimeout(timerRef.current);
|
|
52
|
-
timerRef.current = window.setTimeout(
|
|
53
|
-
() => {
|
|
54
|
-
setHover(false);
|
|
55
|
-
closeTimeRef.current = Date.now() + 150;
|
|
56
|
-
},
|
|
57
|
-
Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100 ? 0 : 500
|
|
58
|
-
);
|
|
59
|
-
}, []);
|
|
60
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
-
collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
-
/* @__PURE__ */ jsx(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: "fixed inset-y-0 start-0 w-6 max-md:hidden",
|
|
66
|
-
onPointerEnter: onEnter,
|
|
67
|
-
onPointerLeave: onLeave
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ jsx(
|
|
71
|
-
"button",
|
|
72
|
-
{
|
|
73
|
-
type: "button",
|
|
74
|
-
"aria-label": "Collapse Sidebar",
|
|
75
|
-
className: twMerge(
|
|
76
|
-
buttonVariants({
|
|
77
|
-
color: "secondary",
|
|
78
|
-
size: "icon",
|
|
79
|
-
className: "fixed start-4 bottom-2 z-10 max-md:hidden"
|
|
80
|
-
})
|
|
81
|
-
),
|
|
82
|
-
onClick: () => {
|
|
83
|
-
setCollapsed((v) => !v);
|
|
84
|
-
},
|
|
85
|
-
children: /* @__PURE__ */ jsx(PanelLeft, {})
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
/* @__PURE__ */ jsx("style", { children: `#nd-page { --fd-sidebar-width: 0px; }` })
|
|
89
|
-
] }) : null,
|
|
90
|
-
/* @__PURE__ */ jsx(
|
|
91
|
-
Sidebar,
|
|
92
|
-
{
|
|
93
|
-
...props,
|
|
94
|
-
aside: useMemo(
|
|
95
|
-
() => ({
|
|
96
|
-
"data-collapse": collapsed,
|
|
97
|
-
"data-hover": hover,
|
|
98
|
-
onPointerEnter: collapsed ? onEnter : void 0,
|
|
99
|
-
onPointerLeave: collapsed ? onLeave : void 0,
|
|
100
|
-
"aria-hidden": Boolean(collapsed && !hover),
|
|
101
|
-
style: {
|
|
102
|
-
// the offset given to docs content when the sidebar is collapsed
|
|
103
|
-
"--fd-content-offset": "calc(var(--fd-sidebar-width) * -1)"
|
|
104
|
-
},
|
|
105
|
-
className: twMerge(
|
|
106
|
-
"md:transition-[transform,margin,flex]",
|
|
107
|
-
collapsed && [
|
|
108
|
-
"md:me-[var(--fd-content-offset)] md:grow-0 md:shadow-md",
|
|
109
|
-
hover ? "md:translate-x-0" : "md:translate-x-[calc(var(--fd-sidebar-width)*-1)] rtl:md:translate-x-[var(--fd-sidebar-width)]"
|
|
110
|
-
],
|
|
111
|
-
``
|
|
112
|
-
)
|
|
113
|
-
}),
|
|
114
|
-
[collapsed, hover, onEnter, onLeave]
|
|
115
|
-
)
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
119
|
-
"div",
|
|
120
|
-
{
|
|
121
|
-
role: "none",
|
|
122
|
-
className: twMerge("transition-all max-md:hidden", collapsed && "flex-1")
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
] });
|
|
126
|
-
}
|
|
127
|
-
export {
|
|
128
|
-
DynamicSidebar as default
|
|
129
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
buttonVariants
|
|
4
|
-
} from "./chunk-QKOA6KEZ.js";
|
|
5
|
-
import {
|
|
6
|
-
SquarePen
|
|
7
|
-
} from "./chunk-5QPVK7QM.js";
|
|
8
|
-
import {
|
|
9
|
-
twMerge
|
|
10
|
-
} from "./chunk-TK3TM3MR.js";
|
|
11
|
-
import {
|
|
12
|
-
useI18n
|
|
13
|
-
} from "./chunk-EFMHXXHW.js";
|
|
14
|
-
import "./chunk-MLKGABMK.js";
|
|
15
|
-
|
|
16
|
-
// src/components/layout/edit-on-github.tsx
|
|
17
|
-
import { forwardRef } from "react";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
var EditOnGitHub = forwardRef(
|
|
20
|
-
({ owner, repo, sha = "main", path, ...props }, ref) => {
|
|
21
|
-
const { text } = useI18n();
|
|
22
|
-
return /* @__PURE__ */ jsxs(
|
|
23
|
-
"a",
|
|
24
|
-
{
|
|
25
|
-
ref,
|
|
26
|
-
href: `https://github.com/${owner}/${repo}/blob/${sha}/${path.startsWith("/") ? path.slice(1) : path}`,
|
|
27
|
-
target: "_blank",
|
|
28
|
-
rel: "noreferrer noopener",
|
|
29
|
-
...props,
|
|
30
|
-
className: twMerge(
|
|
31
|
-
buttonVariants({
|
|
32
|
-
color: "secondary",
|
|
33
|
-
className: "gap-1.5 py-1 text-fd-muted-foreground"
|
|
34
|
-
}),
|
|
35
|
-
props.className
|
|
36
|
-
),
|
|
37
|
-
children: [
|
|
38
|
-
/* @__PURE__ */ jsx(SquarePen, { className: "size-3.5" }),
|
|
39
|
-
text.editOnGithub
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
EditOnGitHub.displayName = "EditOnGitHub";
|
|
46
|
-
var edit_on_github_default = EditOnGitHub;
|
|
47
|
-
export {
|
|
48
|
-
edit_on_github_default as default
|
|
49
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { S as SharedNavProps, L as LinkItemType } from '../shared-SScCiV7b.js';
|
|
3
|
-
export { N as NavProvider } from '../shared-SScCiV7b.js';
|
|
4
|
-
|
|
5
|
-
declare function Nav({ items, enableSearch, ...props }: Omit<SharedNavProps, 'transparentMode'> & {
|
|
6
|
-
disableThemeSwitch?: boolean;
|
|
7
|
-
i18n?: boolean;
|
|
8
|
-
items: LinkItemType[];
|
|
9
|
-
}): ReactNode;
|
|
10
|
-
|
|
11
|
-
export { Nav };
|