fumadocs-ui 15.0.6 → 15.0.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/css/preset.css +46 -1
- package/dist/components/banner.d.ts.map +1 -1
- package/dist/components/banner.js +6 -7
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +13 -1
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +1 -2
- package/dist/components/dialog/search.d.ts.map +1 -1
- package/dist/components/dialog/search.js +7 -9
- package/dist/components/layout/root-toggle.js +1 -1
- package/dist/components/layout/theme-toggle.d.ts.map +1 -1
- package/dist/components/layout/theme-toggle.js +4 -4
- package/dist/components/layout/toc-clerk.d.ts +1 -1
- package/dist/components/layout/toc-clerk.d.ts.map +1 -1
- package/dist/components/layout/toc-clerk.js +3 -3
- package/dist/components/layout/toc-thumb.d.ts +2 -2
- package/dist/components/layout/toc-thumb.d.ts.map +1 -1
- package/dist/components/layout/toc-thumb.js +8 -9
- package/dist/components/layout/toc.d.ts +7 -2
- package/dist/components/layout/toc.d.ts.map +1 -1
- package/dist/components/layout/toc.js +18 -11
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +5 -7
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +3 -6
- package/dist/layouts/docs/sidebar.d.ts.map +1 -1
- package/dist/layouts/docs/sidebar.js +9 -13
- package/dist/layouts/docs.client.d.ts +0 -6
- package/dist/layouts/docs.client.d.ts.map +1 -1
- package/dist/layouts/docs.client.js +1 -13
- package/dist/layouts/docs.d.ts.map +1 -1
- package/dist/layouts/docs.js +18 -19
- package/dist/layouts/home/navbar.js +1 -1
- package/dist/layouts/notebook.client.js +1 -1
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +10 -4
- package/dist/page.client.d.ts +1 -1
- package/dist/page.client.d.ts.map +1 -1
- package/dist/page.client.js +27 -9
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +5 -5
- package/dist/style.css +176 -131
- package/dist/theme/typography/styles.js +4 -3
- package/package.json +3 -3
- package/dist/theme/docs-ui.d.ts +0 -23
- package/dist/theme/docs-ui.d.ts.map +0 -1
- package/dist/theme/docs-ui.js +0 -58
|
@@ -11,7 +11,6 @@ import { ScrollArea, ScrollViewport } from '../../components/ui/scroll-area.js';
|
|
|
11
11
|
import { isActive } from '../../utils/is-active.js';
|
|
12
12
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible.js';
|
|
13
13
|
import { useSidebar } from '../../contexts/sidebar.js';
|
|
14
|
-
import { buttonVariants } from '../../components/ui/button.js';
|
|
15
14
|
import { cva } from 'class-variance-authority';
|
|
16
15
|
import { useTreeContext, useTreePath } from '../../contexts/tree.js';
|
|
17
16
|
const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-md p-2 text-start text-fd-muted-foreground [overflow-wrap:anywhere] md:py-1.5 [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
@@ -51,7 +50,7 @@ export function CollapsibleSidebar(props) {
|
|
|
51
50
|
: 500);
|
|
52
51
|
}, []);
|
|
53
52
|
return (_jsx(Sidebar, { ...props, onPointerEnter: collapsed ? onEnter : undefined, onPointerLeave: collapsed ? onLeave : undefined, "data-collapsed": collapsed, className: cn('md:transition-all', collapsed &&
|
|
54
|
-
'md:-me-
|
|
53
|
+
'md:-me-(--fd-sidebar-width) md:translate-x-[calc(var(--fd-sidebar-offset)*-1)] rtl:md:translate-x-(--fd-sidebar-offset)', collapsed && hover && 'z-50 md:translate-x-0', collapsed && !hover && 'md:opacity-0', props.className), style: {
|
|
55
54
|
'--fd-sidebar-offset': 'calc(var(--fd-sidebar-width) - 20px)',
|
|
56
55
|
} }));
|
|
57
56
|
}
|
|
@@ -63,25 +62,25 @@ export function Sidebar({ defaultOpenLevel = 0, prefetch = true, inner, ...props
|
|
|
63
62
|
level: 1,
|
|
64
63
|
};
|
|
65
64
|
}, [defaultOpenLevel, prefetch]);
|
|
66
|
-
return (_jsx(Context.Provider, { value: context, children: _jsx(Base.SidebarList, { id: "nd-sidebar", blockScrollingWidth: 768, ...props, className: cn('fixed top-[calc(var(--fd-banner-height)+var(--fd-nav-height))] z-30 bg-fd-card text-sm md:sticky md:h-
|
|
65
|
+
return (_jsx(Context.Provider, { value: context, children: _jsx(Base.SidebarList, { id: "nd-sidebar", blockScrollingWidth: 768, ...props, className: cn('fixed top-[calc(var(--fd-banner-height)+var(--fd-nav-height))] z-30 bg-fd-card text-sm md:sticky md:h-(--fd-sidebar-height)', 'max-md:inset-x-0 max-md:bottom-0 max-md:bg-fd-background/80 max-md:text-[15px] max-md:backdrop-blur-lg max-md:data-[open=false]:invisible', props.className), style: {
|
|
67
66
|
...props.style,
|
|
68
67
|
'--fd-sidebar-height': 'calc(100dvh - var(--fd-banner-height) - var(--fd-nav-height))',
|
|
69
|
-
}, children: _jsx("div", { ...inner, className: cn('flex size-full max-w-full flex-col pt-2 md:ms-auto md:w-
|
|
68
|
+
}, children: _jsx("div", { ...inner, className: cn('flex size-full max-w-full flex-col pt-2 md:ms-auto md:w-(--fd-sidebar-width) md:border-e md:pt-4', inner?.className), children: props.children }) }) }));
|
|
70
69
|
}
|
|
71
70
|
export function SidebarHeader(props) {
|
|
72
|
-
return (_jsx("div", { ...props, className: cn('flex flex-col gap-2
|
|
71
|
+
return (_jsx("div", { ...props, className: cn('flex flex-col gap-2 px-4 empty:hidden md:ps-5', props.className), children: props.children }));
|
|
73
72
|
}
|
|
74
73
|
export function SidebarFooter(props) {
|
|
75
|
-
return (_jsx("div", { ...props, className: cn('flex flex-col border-t
|
|
74
|
+
return (_jsx("div", { ...props, className: cn('flex flex-col border-t px-4 py-3 empty:hidden md:ps-5', props.className), children: props.children }));
|
|
76
75
|
}
|
|
77
76
|
export function SidebarViewport(props) {
|
|
78
|
-
return (_jsx(ScrollArea, { ...props, className: cn('h-full', props.className), children: _jsx(ScrollViewport, { className: "p-4
|
|
77
|
+
return (_jsx(ScrollArea, { ...props, className: cn('h-full', props.className), children: _jsx(ScrollViewport, { className: "p-4 md:ps-5", style: {
|
|
79
78
|
maskImage: 'linear-gradient(to bottom, transparent, white 12px)',
|
|
80
79
|
}, children: props.children }) }));
|
|
81
80
|
}
|
|
82
81
|
export function SidebarSeparator(props) {
|
|
83
82
|
const { level } = useInternalContext();
|
|
84
|
-
return (_jsx("p", { ...props, className: cn('mb-2 px-2 text-sm font-medium', props.className), style: {
|
|
83
|
+
return (_jsx("p", { ...props, className: cn('inline-flex items-center gap-2 mb-2 px-2 text-sm font-medium [&_svg]:size-4 [&_svg]:shrink-0', props.className), style: {
|
|
85
84
|
paddingInlineStart: getOffset(level),
|
|
86
85
|
...props.style,
|
|
87
86
|
}, children: props.children }));
|
|
@@ -138,10 +137,7 @@ export function SidebarFolderContent(props) {
|
|
|
138
137
|
}
|
|
139
138
|
export function SidebarCollapseTrigger(props) {
|
|
140
139
|
const { collapsed, setCollapsed } = useSidebar();
|
|
141
|
-
return (_jsx("button", { type: "button", "aria-label": "Collapse Sidebar", "data-collapsed": collapsed, ...props,
|
|
142
|
-
color: 'ghost',
|
|
143
|
-
size: 'icon',
|
|
144
|
-
}), props.className), onClick: () => {
|
|
140
|
+
return (_jsx("button", { type: "button", "aria-label": "Collapse Sidebar", "data-collapsed": collapsed, ...props, onClick: () => {
|
|
145
141
|
setCollapsed((prev) => !prev);
|
|
146
142
|
}, children: props.children ?? _jsx(SidebarIcon, {}) }));
|
|
147
143
|
}
|
|
@@ -170,7 +166,7 @@ export function SidebarPageTree(props) {
|
|
|
170
166
|
if (item.type === 'separator') {
|
|
171
167
|
if (Separator)
|
|
172
168
|
return _jsx(Separator, { item: item }, id);
|
|
173
|
-
return (
|
|
169
|
+
return (_jsxs(SidebarSeparator, { className: cn(i !== 0 && 'mt-8'), children: [item.icon, item.name] }, id));
|
|
174
170
|
}
|
|
175
171
|
if (item.type === 'folder') {
|
|
176
172
|
const children = renderSidebarList(item.children, level + 1);
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
|
|
2
|
-
import { type LinkItemType } from '../layouts/links.js';
|
|
3
|
-
interface LinksMenuProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
-
items: LinkItemType[];
|
|
5
|
-
}
|
|
6
|
-
export declare function LinksMenu({ items, ...props }: LinksMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
7
2
|
export declare function Navbar(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
3
|
export declare function NavbarSidebarTrigger(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
10
4
|
//# sourceMappingURL=docs.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.client.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"docs.client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAkBvE,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAiBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAkB/C"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronDown, Menu, X } from 'lucide-react';
|
|
4
|
-
import { useState, } from 'react';
|
|
5
|
-
import { usePathname } from 'next/navigation';
|
|
6
|
-
import { useOnChange } from 'fumadocs-core/utils/use-on-change';
|
|
7
4
|
import { cn } from '../utils/cn.js';
|
|
8
|
-
import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover.js';
|
|
9
5
|
import { BaseLinkItem } from '../layouts/links.js';
|
|
10
6
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../components/ui/collapsible.js';
|
|
11
7
|
import { cva } from 'class-variance-authority';
|
|
@@ -14,18 +10,10 @@ import { useSidebar } from '../contexts/sidebar.js';
|
|
|
14
10
|
import { useNav } from '../components/layout/nav.js';
|
|
15
11
|
import { SidebarTrigger } from 'fumadocs-core/sidebar';
|
|
16
12
|
const itemVariants = cva('flex flex-row items-center gap-2 rounded-md px-3 py-2.5 text-fd-muted-foreground transition-colors duration-100 [overflow-wrap:anywhere] hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none md:px-2 md:py-1.5 [&_svg]:size-4');
|
|
17
|
-
export function LinksMenu({ items, ...props }) {
|
|
18
|
-
const [open, setOpen] = useState(false);
|
|
19
|
-
const pathname = usePathname();
|
|
20
|
-
useOnChange(pathname, () => {
|
|
21
|
-
setOpen(false);
|
|
22
|
-
});
|
|
23
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { ...props }), _jsx(PopoverContent, { className: "flex flex-col p-1", children: items.map((item, i) => (_jsx(MenuItem, { item: item }, i))) })] }));
|
|
24
|
-
}
|
|
25
13
|
export function Navbar(props) {
|
|
26
14
|
const { open } = useSidebar();
|
|
27
15
|
const { isTransparent } = useNav();
|
|
28
|
-
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('sticky top-
|
|
16
|
+
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('sticky top-(--fd-banner-height) z-30 flex h-14 flex-row items-center border-b border-fd-foreground/10 px-4 backdrop-blur-lg transition-colors', (!isTransparent || open) && 'bg-fd-background/80', props.className), children: props.children }));
|
|
29
17
|
}
|
|
30
18
|
export function NavbarSidebarTrigger(props) {
|
|
31
19
|
const { open } = useSidebar();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5D,OAAO,
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5D,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAa1D,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAG/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EACH,OAAO,EAAE,UAAiB,EAC1B,SAAS,EAAE,UAAU,EACrB,eAAe,EACf,GAAG,GAAG,EACF,EACN,OAAO,EAAE,EACP,OAAO,EAAE,cAAqB,EAC9B,WAAkB,EAClB,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CA+G7B;AA6ED,OAAO,EAAE,yBAAyB,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Link from 'next/link';
|
|
3
|
-
import {
|
|
3
|
+
import { ChevronRight, Languages } from 'lucide-react';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
5
|
import { buttonVariants } from '../components/ui/button.js';
|
|
6
6
|
import { CollapsibleSidebar, Sidebar, SidebarFooter, SidebarHeader, SidebarCollapseTrigger, SidebarViewport, SidebarPageTree, } from '../layouts/docs/sidebar.js';
|
|
7
7
|
import { replaceOrDefault } from '../layouts/shared.js';
|
|
8
|
-
import { BaseLinkItem
|
|
8
|
+
import { BaseLinkItem } from '../layouts/links.js';
|
|
9
9
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
10
10
|
import { getLinks } from './shared.js';
|
|
11
11
|
import { LanguageToggle, LanguageToggleText, } from '../components/layout/language-toggle.js';
|
|
12
|
-
import {
|
|
12
|
+
import { Navbar, NavbarSidebarTrigger } from '../layouts/docs.client.js';
|
|
13
13
|
import { TreeContextProvider } from '../contexts/tree.js';
|
|
14
14
|
import { NavProvider, Title } from '../components/layout/nav.js';
|
|
15
15
|
import { ThemeToggle } from '../components/layout/theme-toggle.js';
|
|
@@ -21,41 +21,40 @@ export function DocsLayout({ nav: { enabled: navEnabled = true, component: navRe
|
|
|
21
21
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
22
22
|
const Aside = collapsible ? CollapsibleSidebar : Sidebar;
|
|
23
23
|
const tabs = getSidebarTabsFromOptions(tabOptions, props.tree) ?? [];
|
|
24
|
-
const variables = cn('[--fd-tocnav-height:36px] md:[--fd-sidebar-width:268px]
|
|
24
|
+
const variables = cn('[--fd-tocnav-height:36px] md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px] xl:[--fd-toc-width:286px] xl:[--fd-tocnav-height:0px]', !navReplace && navEnabled
|
|
25
25
|
? '[--fd-nav-height:3.5rem] md:[--fd-nav-height:0px]'
|
|
26
26
|
: undefined);
|
|
27
27
|
const pageStyles = {
|
|
28
28
|
tocNav: cn('xl:hidden'),
|
|
29
29
|
toc: cn('max-xl:hidden'),
|
|
30
30
|
};
|
|
31
|
-
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [replaceOrDefault({ enabled: navEnabled, component: navReplace }, _jsxs(Navbar, { className: "md:hidden", children: [_jsx(Title, { url: nav.url, title: nav.title }), _jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children: nav.children }), _jsx(SearchToggle, { hideIfDisabled: true }), _jsx(NavbarSidebarTrigger, { className: "-me-2 md:hidden" })] }), nav), _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex flex-1 flex-row pe-
|
|
31
|
+
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [replaceOrDefault({ enabled: navEnabled, component: navReplace }, _jsxs(Navbar, { className: "md:hidden", children: [_jsx(Title, { url: nav.url, title: nav.title }), _jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children: nav.children }), _jsx(SearchToggle, { hideIfDisabled: true }), _jsx(NavbarSidebarTrigger, { className: "-me-2 md:hidden" })] }), nav), _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex flex-1 flex-row pe-(--fd-layout-offset)', variables, props.containerProps?.className), style: {
|
|
32
32
|
...layoutVariables,
|
|
33
33
|
...props.containerProps?.style,
|
|
34
|
-
}, children: [collapsible ? (_jsx(SidebarCollapseTrigger, { className:
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
}, children: [collapsible ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
35
|
+
color: 'secondary',
|
|
36
|
+
size: 'icon',
|
|
37
|
+
}), 'fixed top-1/2 -translate-y-1/2 start-0 z-40 text-fd-muted-foreground border-s-0 rounded-s-none shadow-md data-[collapsed=false]:hidden max-md:hidden'), children: _jsx(ChevronRight, {}) })) : null, replaceOrDefault({ enabled: sidebarEnabled, component: sidebarReplace }, _jsxs(Aside, { ...sidebar, className: cn('md:ps-(--fd-layout-offset)', sidebar.className), children: [_jsxs(SidebarHeader, { children: [_jsx(SidebarHeaderItems, { ...nav, links: links, sidebarCollapsible: collapsible }), sidebarBanner, tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null, !sidebarHideSearch ? (_jsx(LargeSearchToggle, { hideIfDisabled: true, className: "rounded-lg max-md:hidden" })) : null] }), _jsxs(SidebarViewport, { children: [_jsx("div", { className: "mb-4 empty:hidden md:hidden", children: links
|
|
37
38
|
.filter((v) => v.type !== 'icon')
|
|
38
|
-
.map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { children: [_jsx(SidebarFooterItems, {
|
|
39
|
+
.map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { children: [_jsx(SidebarFooterItems, { links: links, i18n: i18n, disableThemeSwitch: props.disableThemeSwitch ?? false }), sidebarFooter] })] }), {
|
|
39
40
|
...sidebar,
|
|
40
41
|
tabs,
|
|
41
42
|
}), _jsx(StylesProvider, { ...pageStyles, children: props.children })] })] }) }));
|
|
42
43
|
}
|
|
43
|
-
function SidebarHeaderItems({ links, ...props }) {
|
|
44
|
+
function SidebarHeaderItems({ links, sidebarCollapsible, ...props }) {
|
|
44
45
|
const isEmpty = !props.title && !props.children && links.length === 0;
|
|
45
46
|
if (isEmpty)
|
|
46
47
|
return null;
|
|
47
|
-
return (_jsxs("div", { className: "flex flex-row items-center max-md:hidden", children: [props.title ? (_jsx(Link, { href: props.url ?? '/', className: "inline-flex items-center gap-2.5 py-1 font-medium", children: props.title })) : null, props.children,
|
|
48
|
-
size: 'icon',
|
|
48
|
+
return (_jsxs("div", { className: "flex flex-row items-center max-md:hidden", children: [props.title ? (_jsx(Link, { href: props.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 py-1 font-medium", children: props.title })) : null, props.children, sidebarCollapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
49
49
|
color: 'ghost',
|
|
50
|
-
|
|
50
|
+
size: 'icon',
|
|
51
|
+
}), 'ms-auto text-fd-muted-foreground [&_svg]:size-4.5 max-md:hidden') }))] }));
|
|
51
52
|
}
|
|
52
|
-
function SidebarFooterItems({
|
|
53
|
+
function SidebarFooterItems({ i18n, disableThemeSwitch, links, }) {
|
|
54
|
+
const iconItems = links.filter((v) => v.type === 'icon');
|
|
53
55
|
// empty footer items
|
|
54
|
-
if (
|
|
55
|
-
!i18n &&
|
|
56
|
-
disableThemeSwitch &&
|
|
57
|
-
!sidebarCollapsible)
|
|
56
|
+
if (links.length === 0 && !i18n && disableThemeSwitch)
|
|
58
57
|
return null;
|
|
59
|
-
return (_jsxs("div", { className: "flex flex-row items-center", children: [iconItems.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:
|
|
58
|
+
return (_jsxs("div", { className: "flex flex-row items-center", children: [iconItems.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:[&_svg]:size-4.5'), "aria-label": item.label, children: item.icon }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { className: "me-1.5", children: [_jsx(Languages, { className: "size-5" }), _jsx(LanguageToggleText, { className: "md:hidden" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, { className: "p-0" }) : null] }));
|
|
60
59
|
}
|
|
61
60
|
export { getSidebarTabsFromOptions } from './docs/shared.js';
|
|
@@ -12,7 +12,7 @@ const navItemVariants = cva('inline-flex items-center gap-1 p-2 text-fd-muted-fo
|
|
|
12
12
|
export function Navbar(props) {
|
|
13
13
|
const [value, setValue] = useState('');
|
|
14
14
|
const { isTransparent } = useNav();
|
|
15
|
-
return (_jsx(NavigationMenu, { value: value, onValueChange: setValue, asChild: true, children: _jsxs("header", { id: "nd-nav", ...props, className: cn('fixed left-1/2 top-
|
|
15
|
+
return (_jsx(NavigationMenu, { value: value, onValueChange: setValue, asChild: true, children: _jsxs("header", { id: "nd-nav", ...props, className: cn('fixed left-1/2 top-(--fd-banner-height) z-40 box-content w-full max-w-fd-container -translate-x-1/2 border-b border-fd-foreground/10 transition-colors lg:mt-2 lg:w-[calc(100%-1rem)] lg:rounded-2xl lg:border', value.length > 0 ? 'shadow-lg' : 'shadow-sm', (!isTransparent || value.length > 0) &&
|
|
16
16
|
'bg-fd-background/80 backdrop-blur-lg', props.className), children: [_jsx(NavigationMenuList, { className: "flex h-14 w-full flex-row items-center px-4 lg:h-12", asChild: true, children: _jsx("nav", { children: props.children }) }), _jsx(NavigationMenuViewport, {})] }) }));
|
|
17
17
|
}
|
|
18
18
|
export const NavbarMenu = NavigationMenuItem;
|
|
@@ -9,7 +9,7 @@ import { Menu, X } from 'lucide-react';
|
|
|
9
9
|
export function Navbar(props) {
|
|
10
10
|
const { open, collapsed } = useSidebar();
|
|
11
11
|
const { isTransparent } = useNav();
|
|
12
|
-
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('fixed inset-x-0 top-
|
|
12
|
+
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('fixed inset-x-0 top-(--fd-banner-height) z-10 h-14 pe-(--fd-layout-offset) backdrop-blur-lg transition-colors', (!isTransparent || open) && 'bg-fd-background/80', props.className), style: {
|
|
13
13
|
paddingInlineStart: collapsed
|
|
14
14
|
? 'calc(var(--fd-layout-offset))'
|
|
15
15
|
: 'calc(var(--fd-layout-offset) + var(--fd-sidebar-width))',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AA6B1B,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AA6B1B,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CAwF7B"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -26,15 +26,21 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { c
|
|
|
26
26
|
const pageStyles = {
|
|
27
27
|
tocNav: cn('xl:hidden'),
|
|
28
28
|
toc: cn('max-xl:hidden'),
|
|
29
|
-
page: cn('mt-
|
|
29
|
+
page: cn('mt-(--fd-nav-height)'),
|
|
30
30
|
};
|
|
31
|
-
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsx(NavProvider, { transparentMode: transparentMode, children: _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex w-full flex-1 flex-row pe-
|
|
31
|
+
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsx(NavProvider, { transparentMode: transparentMode, children: _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex w-full flex-1 flex-row pe-(--fd-layout-offset)', variables, props.containerProps?.className), style: {
|
|
32
32
|
...layoutVariables,
|
|
33
33
|
...props.containerProps?.style,
|
|
34
|
-
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-
|
|
34
|
+
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-(--fd-layout-offset) md:[--fd-nav-height:0px]', sidebar.className), children: [_jsxs(SidebarHeader, { children: [_jsxs(SidebarHeaderItems, { nav: nav, links: links, children: [nav.children, sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
35
|
+
color: 'ghost',
|
|
36
|
+
size: 'icon',
|
|
37
|
+
}), 'ms-auto text-fd-muted-foreground') })) : null] }), sidebarBanner, tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null] }), _jsxs(SidebarViewport, { children: [_jsx("div", { className: "mb-4 empty:hidden lg:hidden", children: links.map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: cn(!sidebarFooter && 'md:hidden'), children: [!props.disableThemeSwitch ? (_jsx(ThemeToggle, { className: "w-fit md:hidden", mode: "light-dark-system" })) : null, sidebarFooter] })] }), _jsx(DocsNavbar, { nav: nav, links: links, i18n: i18n, sidebarCollapsible: sidebarCollapsible }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
|
|
35
38
|
}
|
|
36
39
|
function DocsNavbar({ sidebarCollapsible, links, nav = {}, i18n, }) {
|
|
37
|
-
return (_jsxs(Navbar, { children: [sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className:
|
|
40
|
+
return (_jsxs(Navbar, { children: [sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
41
|
+
color: 'ghost',
|
|
42
|
+
size: 'icon',
|
|
43
|
+
}), '-ms-1.5 text-fd-muted-foreground data-[collapsed=false]:hidden max-md:hidden') })) : null, _jsx(LargeSearchToggle, { hideIfDisabled: true, className: "w-full max-w-[240px] rounded-lg max-md:hidden" }), _jsx(Title, { url: nav.url, title: nav.title, className: "md:hidden" }), _jsxs("div", { className: "flex flex-1 flex-row items-center gap-6 px-2", children: [links
|
|
38
44
|
.filter((item) => item.type !== 'icon')
|
|
39
45
|
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground max-lg:hidden" }, i))), nav.children] }), _jsx(SearchToggle, { hideIfDisabled: true, className: "md:hidden" }), _jsx(NavbarSidebarTrigger, { className: "-me-1.5 md:hidden" }), _jsx("div", { className: "flex flex-row items-center empty:hidden max-lg:hidden", children: links
|
|
40
46
|
.filter((item) => item.type === 'icon')
|
package/dist/page.client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function TocPopoverHeader(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare function PageBody(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare function PageArticle(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function LastUpdate(props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.client.d.ts","sourceRoot":"","sources":["../src/page.client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"page.client.d.ts","sourceRoot":"","sources":["../src/page.client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAWf,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAMlC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAkDrE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAY7D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAe7D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,2CAc/C;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QACzC,IAAI,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KACtC,CAAC;CACH;AAiCD,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,WAAW,2CA8C5C;AAED,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,kDAsClD"}
|
package/dist/page.client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment, useEffect, useMemo, useState, } from 'react';
|
|
3
|
+
import { Fragment, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
4
|
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
5
5
|
import Link from 'next/link';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -13,14 +13,29 @@ import { useNav } from './components/layout/nav.js';
|
|
|
13
13
|
import { getBreadcrumbItemsFromPath, } from 'fumadocs-core/breadcrumb';
|
|
14
14
|
import { usePageStyles } from './contexts/layout.js';
|
|
15
15
|
import { isActive } from './utils/is-active.js';
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import { TocPopover } from './components/layout/toc.js';
|
|
17
|
+
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
18
|
+
export function TocPopoverHeader(props) {
|
|
19
|
+
const ref = useRef(null);
|
|
20
|
+
const [open, setOpen] = useState(false);
|
|
21
|
+
const sidebar = useSidebar();
|
|
18
22
|
const { tocNav } = usePageStyles();
|
|
19
23
|
const { isTransparent } = useNav();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const onClick = useEffectEvent((e) => {
|
|
25
|
+
if (!open)
|
|
26
|
+
return;
|
|
27
|
+
if (ref.current && !ref.current.contains(e.target))
|
|
28
|
+
setOpen(false);
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
window.addEventListener('click', onClick);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener('click', onClick);
|
|
34
|
+
};
|
|
35
|
+
}, [onClick]);
|
|
36
|
+
return (_jsx("div", { className: cn('sticky overflow-visible z-10 h-8', tocNav, props.className), style: {
|
|
37
|
+
top: 'calc(var(--fd-banner-height) + var(--fd-nav-height))',
|
|
38
|
+
}, children: _jsx(TocPopover, { open: open, onOpenChange: setOpen, asChild: true, children: _jsx("header", { ref: ref, id: "nd-tocnav", ...props, className: cn('border-b border-fd-foreground/10 backdrop-blur-md transition-colors', (!isTransparent || open) && 'bg-fd-background/80', open && 'shadow-lg', sidebar.open && 'opacity-0'), children: props.children }) }) }));
|
|
24
39
|
}
|
|
25
40
|
export function PageBody(props) {
|
|
26
41
|
const { page } = usePageStyles();
|
|
@@ -28,7 +43,7 @@ export function PageBody(props) {
|
|
|
28
43
|
}
|
|
29
44
|
export function PageArticle(props) {
|
|
30
45
|
const { article } = usePageStyles();
|
|
31
|
-
return (_jsx("article", { ...props, className: cn('flex w-full flex-1 flex-col gap-6 px-4 pt-8 md:pt-12
|
|
46
|
+
return (_jsx("article", { ...props, className: cn('flex w-full flex-1 flex-col gap-6 px-4 pt-8 md:px-6 md:pt-12 xl:px-12 xl:mx-auto', article, props.className), children: props.children }));
|
|
32
47
|
}
|
|
33
48
|
export function LastUpdate(props) {
|
|
34
49
|
const { text } = useI18n();
|
|
@@ -89,5 +104,8 @@ export function Breadcrumb(options) {
|
|
|
89
104
|
}, [options, path, root]);
|
|
90
105
|
if (items.length === 0)
|
|
91
106
|
return null;
|
|
92
|
-
return (_jsx("div", { className: "
|
|
107
|
+
return (_jsx("div", { className: "flex flex-row items-center gap-1.5 text-[15px] text-fd-muted-foreground -mb-1.5", children: items.map((item, i) => {
|
|
108
|
+
const className = cn('truncate', i === items.length - 1 && 'text-fd-primary font-medium');
|
|
109
|
+
return (_jsxs(Fragment, { children: [i !== 0 && _jsx("span", { className: "text-fd-foreground/30", children: "/" }), item.url ? (_jsx(Link, { href: item.url, className: cn(className, 'transition-opacity hover:opacity-80'), children: item.name })) : (_jsx("span", { className: className, children: item.name }))] }, i));
|
|
110
|
+
}) }));
|
|
93
111
|
}
|
package/dist/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,mBAAmB,CAAC;AAI7E,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,eAAe,EAGrB,MAAM,eAAe,CAAC;AACvB,OAAO,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,mBAAmB,CAAC;AAI7E,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,eAAe,EAGrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAMjC,KAAK,qBAAqB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,CAAC,GAC/D,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEJ,KAAK,4BAA4B,GAAG,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAE1E,UAAU,mBACR,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,iBAAkB,SAAQ,eAAe;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,aAAc,SAAQ,WAAW;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,eAAe,CAAC;IAEtB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,cAAc,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAChD,qBAAqB,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAE9D;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEhC,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAEpC,SAAS,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAQ,EACR,IAAY,EACZ,qBAAqB,EAAE,EACrB,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,iBAAiB,EAC5B,GAAG,iBAAiB,EAChB,EACN,cAAc,EAAE,EACd,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,GAAG,UAAU,EACT,EACN,GAAG,KAAK,EACT,EAAE,aAAa,2CA8Ff;AA+BD;;GAEG;AACH,eAAO,MAAM,QAAQ,2HAOnB,CAAC;AAIH,eAAO,MAAM,eAAe,uIAgB1B,CAAC;AAIH,eAAO,MAAM,SAAS,mIAapB,CAAC;AAIH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,IAAI,EACJ,IAAI,EAAE,UAAU,EAChB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;CACtB,kDAmEA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAM5E"}
|
package/dist/page.js
CHANGED
|
@@ -4,8 +4,8 @@ import { AnchorProvider } from 'fumadocs-core/toc';
|
|
|
4
4
|
import { Card, Cards } from './components/card.js';
|
|
5
5
|
import { replaceOrDefault } from './layouts/shared.js';
|
|
6
6
|
import { cn } from './utils/cn.js';
|
|
7
|
-
import { Footer, LastUpdate,
|
|
8
|
-
import { Toc, TOCItems, TocPopoverTrigger,
|
|
7
|
+
import { Footer, LastUpdate, TocPopoverHeader, Breadcrumb, PageBody, PageArticle, } from './page.client.js';
|
|
8
|
+
import { Toc, TOCItems, TocPopoverTrigger, TocPopoverContent, } from './components/layout/toc.js';
|
|
9
9
|
import { buttonVariants } from './components/ui/button.js';
|
|
10
10
|
import { Edit, Text } from 'lucide-react';
|
|
11
11
|
import { I18nLabel } from './contexts/i18n.js';
|
|
@@ -22,10 +22,10 @@ export function DocsPage({ toc = [], full = false, tableOfContentPopover: { enab
|
|
|
22
22
|
return (_jsxs(AnchorProvider, { toc: toc, single: tocOptions.single, children: [_jsxs(PageBody, { ...props.container, className: cn(props.container?.className), style: {
|
|
23
23
|
'--fd-tocnav-height': !tocPopoverEnabled ? '0px' : undefined,
|
|
24
24
|
...props.container?.style,
|
|
25
|
-
}, children: [replaceOrDefault({ enabled: tocPopoverEnabled, component: tocPopoverReplace },
|
|
25
|
+
}, children: [replaceOrDefault({ enabled: tocPopoverEnabled, component: tocPopoverReplace }, _jsxs(TocPopoverHeader, { children: [_jsx(TocPopoverTrigger, { className: "w-full", items: toc }), _jsxs(TocPopoverContent, { children: [tocPopoverOptions.header, tocPopoverOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc, isMenu: true })) : (_jsx(TOCItems, { items: toc, isMenu: true })), tocPopoverOptions.footer] })] }), {
|
|
26
26
|
items: toc,
|
|
27
27
|
...tocPopoverOptions,
|
|
28
|
-
}), _jsxs(PageArticle, { ...props.article, className: cn(full || !tocEnabled ? 'max-w-[1120px]' : 'max-w-[860px]', props.article?.className), children: [replaceOrDefault(props.breadcrumb, _jsx(Breadcrumb, {
|
|
28
|
+
}), _jsxs(PageArticle, { ...props.article, className: cn(full || !tocEnabled ? 'max-w-[1120px]' : 'max-w-[860px]', props.article?.className), children: [replaceOrDefault(props.breadcrumb, _jsx(Breadcrumb, { ...props.breadcrumb })), props.children, _jsx("div", { role: "none", className: "flex-1" }), _jsxs("div", { className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden", children: [props.editOnGithub ? (_jsx(EditOnGitHub, { ...props.editOnGithub })) : null, props.lastUpdate ? (_jsx(LastUpdate, { date: new Date(props.lastUpdate) })) : null] }), replaceOrDefault(props.footer, _jsx(Footer, { items: props.footer?.items }))] })] }), replaceOrDefault({ enabled: tocEnabled, component: tocReplace }, _jsxs(Toc, { children: [tocOptions.header, _jsxs("h3", { className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground", children: [_jsx(Text, { className: "size-4" }), _jsx(I18nLabel, { label: "toc" })] }), tocOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc })) : (_jsx(TOCItems, { items: toc })), tocOptions.footer] }), {
|
|
29
29
|
items: toc,
|
|
30
30
|
...tocOptions,
|
|
31
31
|
})] }));
|
|
@@ -50,7 +50,7 @@ export const DocsDescription = forwardRef((props, ref) => {
|
|
|
50
50
|
});
|
|
51
51
|
DocsDescription.displayName = 'DocsDescription';
|
|
52
52
|
export const DocsTitle = forwardRef((props, ref) => {
|
|
53
|
-
return (_jsx("h1", { ref: ref, ...props, className: cn('text-3xl font-
|
|
53
|
+
return (_jsx("h1", { ref: ref, ...props, className: cn('text-3xl font-semibold', props.className), children: props.children }));
|
|
54
54
|
});
|
|
55
55
|
DocsTitle.displayName = 'DocsTitle';
|
|
56
56
|
export function DocsCategory({ page, from, tree: forcedTree, ...props }) {
|