fumadocs-ui 15.0.7 → 15.0.8
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/layout/toc-clerk.d.ts +1 -2
- package/dist/components/layout/toc-clerk.d.ts.map +1 -1
- package/dist/components/layout/toc-clerk.js +9 -11
- package/dist/components/layout/toc.d.ts +5 -2
- package/dist/components/layout/toc.d.ts.map +1 -1
- package/dist/components/layout/toc.js +8 -5
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -0
- package/dist/layouts/docs.client.d.ts.map +1 -1
- package/dist/layouts/docs.client.js +2 -19
- package/dist/layouts/docs.js +4 -4
- package/dist/layouts/notebook.client.d.ts +7 -1
- package/dist/layouts/notebook.client.d.ts.map +1 -1
- package/dist/layouts/notebook.client.js +29 -3
- package/dist/layouts/notebook.d.ts +6 -2
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +26 -24
- package/dist/page.client.js +1 -1
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +3 -3
- package/dist/style.css +52 -28
- package/package.json +4 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { TOCItemType } from 'fumadocs-core/server';
|
|
2
|
-
export default function ClerkTOCItems({ items
|
|
2
|
+
export default function ClerkTOCItems({ items }: {
|
|
3
3
|
items: TOCItemType[];
|
|
4
|
-
isMenu?: boolean;
|
|
5
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
//# sourceMappingURL=toc-clerk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toc-clerk.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc-clerk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"toc-clerk.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc-clerk.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,2CA2FxE"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as Primitive from 'fumadocs-core/toc';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import { cn } from '../../utils/cn.js';
|
|
6
6
|
import { TocThumb } from '../../components/layout/toc-thumb.js';
|
|
7
|
-
import { ScrollArea, ScrollViewport } from '../ui/scroll-area.js';
|
|
8
7
|
import { TocItemsEmpty } from '../../components/layout/toc.js';
|
|
9
|
-
export default function ClerkTOCItems({ items
|
|
10
|
-
const viewRef = useRef(null);
|
|
8
|
+
export default function ClerkTOCItems({ items }) {
|
|
11
9
|
const containerRef = useRef(null);
|
|
12
10
|
const [svg, setSvg] = useState();
|
|
13
11
|
useEffect(() => {
|
|
@@ -47,13 +45,13 @@ export default function ClerkTOCItems({ items, }) {
|
|
|
47
45
|
}, [items]);
|
|
48
46
|
if (items.length === 0)
|
|
49
47
|
return _jsx(TocItemsEmpty, {});
|
|
50
|
-
return (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
return (_jsxs(_Fragment, { children: [svg ? (_jsx("div", { className: "absolute start-0 top-0 rtl:-scale-x-100", style: {
|
|
49
|
+
width: svg.width,
|
|
50
|
+
height: svg.height,
|
|
51
|
+
maskImage: `url("data:image/svg+xml,${
|
|
52
|
+
// Inline SVG
|
|
53
|
+
encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${svg.width} ${svg.height}"><path d="${svg.path}" stroke="black" stroke-width="1" fill="none" /></svg>`)}")`,
|
|
54
|
+
}, children: _jsx(TocThumb, { containerRef: containerRef, className: "mt-(--fd-top) h-(--fd-height) bg-fd-primary transition-all" }) })) : null, _jsx("div", { className: "flex flex-col", ref: containerRef, children: items.map((item, i) => (_jsx(TOCItem, { item: item, upper: items[i - 1]?.depth, lower: items[i + 1]?.depth }, item.url))) })] }));
|
|
57
55
|
}
|
|
58
56
|
function getItemOffset(depth) {
|
|
59
57
|
if (depth <= 2)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TOCItemType } from 'fumadocs-core/server';
|
|
2
2
|
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
|
+
import { ScrollArea } from '../ui/scroll-area.js';
|
|
3
4
|
import type { PopoverContentProps, PopoverTriggerProps } from '@radix-ui/react-popover';
|
|
4
5
|
import { Collapsible } from '../../components/ui/collapsible.js';
|
|
5
6
|
export interface TOCProps {
|
|
@@ -15,10 +16,12 @@ export interface TOCProps {
|
|
|
15
16
|
}
|
|
16
17
|
export declare function Toc(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export declare function TocItemsEmpty(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare function
|
|
19
|
-
items: TOCItemType[];
|
|
19
|
+
export declare function TOCScrollArea({ isMenu, ...props }: ComponentProps<typeof ScrollArea> & {
|
|
20
20
|
isMenu?: boolean;
|
|
21
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function TOCItems({ items }: {
|
|
23
|
+
items: TOCItemType[];
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
25
|
type MakeRequired<T, K extends keyof T> = T & {
|
|
23
26
|
[P in K]-?: T[P];
|
|
24
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,UAAU,EAAkB,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,WAAW,EAGZ,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CAyBxD;AAED,wBAAgB,aAAa,4CAQ5B;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,2CAqB1D;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,2CAqB3D;AAkBD,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAOnE,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,GAAG,EAAE,IAAI,EACT,GAAG,KAAK,EACT,EAAE,YAAY,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,2CAgB3E;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,GAAG,KAAK,EACT,EAAE,mBAAmB,GAAG;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,2CAmChD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,2CAU3D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as Primitive from 'fumadocs-core/toc';
|
|
4
4
|
import { createContext, use, useMemo, useRef, } from 'react';
|
|
5
5
|
import { cn } from '../../utils/cn.js';
|
|
@@ -20,12 +20,15 @@ export function TocItemsEmpty() {
|
|
|
20
20
|
const { text } = useI18n();
|
|
21
21
|
return (_jsx("div", { className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground", children: text.tocNoHeadings }));
|
|
22
22
|
}
|
|
23
|
-
export function
|
|
24
|
-
const containerRef = useRef(null);
|
|
23
|
+
export function TOCScrollArea({ isMenu, ...props }) {
|
|
25
24
|
const viewRef = useRef(null);
|
|
25
|
+
return (_jsx(ScrollArea, { ...props, className: cn('flex flex-col ps-px', props.className), children: _jsx(Primitive.ScrollProvider, { containerRef: viewRef, children: _jsx(ScrollViewport, { className: cn('relative min-h-0 text-sm', isMenu && 'mt-2 mb-4 mx-4 md:mx-6'), ref: viewRef, children: props.children }) }) }));
|
|
26
|
+
}
|
|
27
|
+
export function TOCItems({ items }) {
|
|
28
|
+
const containerRef = useRef(null);
|
|
26
29
|
if (items.length === 0)
|
|
27
30
|
return _jsx(TocItemsEmpty, {});
|
|
28
|
-
return (
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(TocThumb, { containerRef: containerRef, className: "absolute start-0 mt-(--fd-top) h-(--fd-height) w-px bg-fd-primary transition-all" }), _jsx("div", { ref: containerRef, className: "flex flex-col border-s border-fd-foreground/10", children: items.map((item) => (_jsx(TOCItem, { item: item }, item.url))) })] }));
|
|
29
32
|
}
|
|
30
33
|
function TOCItem({ item }) {
|
|
31
34
|
return (_jsx(Primitive.TOCItem, { href: item.url, className: cn('prose py-1.5 text-sm text-fd-muted-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary', item.depth <= 2 && 'ps-3', item.depth === 3 && 'ps-6', item.depth >= 4 && 'ps-8'), children: item.title }));
|
|
@@ -44,7 +47,7 @@ export function TocPopoverTrigger({ items, ...props }) {
|
|
|
44
47
|
const current = useMemo(() => {
|
|
45
48
|
return items.find((item) => active === item.url.slice(1))?.title;
|
|
46
49
|
}, [items, active]);
|
|
47
|
-
return (_jsxs(CollapsibleTrigger, { ...props, className: cn('inline-flex items-center text-sm gap-2 text-nowrap px-4 py-2 text-start md:px-6 md:py-3', props.className), children: [_jsx(Text, { className: "size-4 shrink-0" }), text.toc, _jsx(ChevronRight, { className: cn('size-4 shrink-0 text-fd-muted-foreground transition-all', !current && 'opacity-0', open ? 'rotate-90' : '-ms-1.5') }), _jsx("span", { className: cn('truncate text-fd-muted-foreground transition-opacity -ms-1.5', (!current || open) && 'opacity-0'), children: current })] }));
|
|
50
|
+
return (_jsxs(CollapsibleTrigger, { ...props, className: cn('inline-flex items-center text-sm gap-2 text-nowrap px-4 py-2 text-start md:px-6 md:py-3 focus-visible:outline-none', props.className), children: [_jsx(Text, { className: "size-4 shrink-0" }), text.toc, _jsx(ChevronRight, { className: cn('size-4 shrink-0 text-fd-muted-foreground transition-all', !current && 'opacity-0', open ? 'rotate-90' : '-ms-1.5') }), _jsx("span", { className: cn('truncate text-fd-muted-foreground transition-opacity -ms-1.5', (!current || open) && 'opacity-0'), children: current })] }));
|
|
48
51
|
}
|
|
49
52
|
export function TocPopoverContent(props) {
|
|
50
53
|
return (_jsx(CollapsibleContent, { "data-toc-popover": "", className: "flex flex-col max-h-[50vh]", ...props, children: props.children }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const buttonVariants: (props?: ({
|
|
2
2
|
color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
|
|
3
|
-
size?: "sm" | "icon" | null | undefined;
|
|
3
|
+
size?: "sm" | "icon" | "icon-sm" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;8EAmB1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAOvE,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAiBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAkB/C"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Menu, X } from 'lucide-react';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
|
-
import { BaseLinkItem } from '../layouts/links.js';
|
|
6
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../components/ui/collapsible.js';
|
|
7
|
-
import { cva } from 'class-variance-authority';
|
|
8
5
|
import { buttonVariants } from '../components/ui/button.js';
|
|
9
6
|
import { useSidebar } from '../contexts/sidebar.js';
|
|
10
7
|
import { useNav } from '../components/layout/nav.js';
|
|
11
8
|
import { SidebarTrigger } from 'fumadocs-core/sidebar';
|
|
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');
|
|
13
9
|
export function Navbar(props) {
|
|
14
10
|
const { open } = useSidebar();
|
|
15
11
|
const { isTransparent } = useNav();
|
|
@@ -22,16 +18,3 @@ export function NavbarSidebarTrigger(props) {
|
|
|
22
18
|
size: 'icon',
|
|
23
19
|
}), props.className), children: open ? _jsx(X, {}) : _jsx(Menu, {}) }));
|
|
24
20
|
}
|
|
25
|
-
function MenuItem({ item, ...props }) {
|
|
26
|
-
if (item.type === 'custom')
|
|
27
|
-
return (_jsx("div", { ...props, className: cn('grid', props.className), children: item.children }));
|
|
28
|
-
if (item.type === 'menu') {
|
|
29
|
-
return (_jsxs(Collapsible, { className: "flex flex-col", children: [_jsxs(CollapsibleTrigger, { ...props, className: cn(itemVariants(), 'group', props.className), children: [item.icon, item.text, _jsx(ChevronDown, { className: "ms-auto transition-transform group-data-[state=closed]:-rotate-90" })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "flex flex-col py-2 ps-2", children: item.items.map((child, i) => (_jsx(MenuItem, { item: child }, i))) }) })] }));
|
|
30
|
-
}
|
|
31
|
-
return (_jsxs(BaseLinkItem, { item: item, ...props, className: cn(item.type === 'button'
|
|
32
|
-
? buttonVariants({
|
|
33
|
-
color: 'secondary',
|
|
34
|
-
className: 'gap-1.5 [&_svg]:size-4',
|
|
35
|
-
})
|
|
36
|
-
: itemVariants(), props.className), children: [item.icon, item.text] }));
|
|
37
|
-
}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -22,7 +22,7 @@ export function DocsLayout({ nav: { enabled: navEnabled = true, component: navRe
|
|
|
22
22
|
const Aside = collapsible ? CollapsibleSidebar : Sidebar;
|
|
23
23
|
const tabs = getSidebarTabsFromOptions(tabOptions, props.tree) ?? [];
|
|
24
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
|
-
? '[--fd-nav-height:
|
|
25
|
+
? '[--fd-nav-height:calc(var(--spacing)*14)] md:[--fd-nav-height:0px]'
|
|
26
26
|
: undefined);
|
|
27
27
|
const pageStyles = {
|
|
28
28
|
tocNav: cn('xl:hidden'),
|
|
@@ -47,14 +47,14 @@ function SidebarHeaderItems({ links, sidebarCollapsible, ...props }) {
|
|
|
47
47
|
return null;
|
|
48
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
|
-
size: 'icon',
|
|
51
|
-
}), 'ms-auto text-fd-muted-foreground
|
|
50
|
+
size: 'icon-sm',
|
|
51
|
+
}), 'ms-auto text-fd-muted-foreground max-md:hidden') }))] }));
|
|
52
52
|
}
|
|
53
53
|
function SidebarFooterItems({ i18n, disableThemeSwitch, links, }) {
|
|
54
54
|
const iconItems = links.filter((v) => v.type === 'icon');
|
|
55
55
|
// empty footer items
|
|
56
56
|
if (links.length === 0 && !i18n && disableThemeSwitch)
|
|
57
57
|
return null;
|
|
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] }));
|
|
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-4.5" }), _jsx(LanguageToggleText, { className: "md:hidden" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, { className: "p-0" }) : null] }));
|
|
59
59
|
}
|
|
60
60
|
export { getSidebarTabsFromOptions } from './docs/shared.js';
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
|
|
2
|
+
import type { Option } from '../components/layout/root-toggle.js';
|
|
2
3
|
export declare function Navbar(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export declare function NavbarSidebarTrigger(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function LayoutTabs(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function LayoutTab(item: Option): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function SidebarLayoutTab({ item, ...props }: {
|
|
8
|
+
item: Option;
|
|
9
|
+
} & HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
4
10
|
//# sourceMappingURL=notebook.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"notebook.client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AASvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAyBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAkB/C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAY5D;AAUD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,2CAkBrC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAAC,WAAW,CAAC,2CAoBhD"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
4
|
import { useSidebar } from '../contexts/sidebar.js';
|
|
5
5
|
import { useNav } from '../components/layout/nav.js';
|
|
6
6
|
import { SidebarTrigger } from 'fumadocs-core/sidebar';
|
|
7
7
|
import { buttonVariants } from '../components/ui/button.js';
|
|
8
8
|
import { Menu, X } from 'lucide-react';
|
|
9
|
+
import Link from 'fumadocs-core/link';
|
|
10
|
+
import { usePathname } from 'next/navigation';
|
|
11
|
+
import { isActive } from '../utils/is-active.js';
|
|
9
12
|
export function Navbar(props) {
|
|
10
13
|
const { open, collapsed } = useSidebar();
|
|
11
14
|
const { isTransparent } = useNav();
|
|
12
15
|
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
16
|
paddingInlineStart: collapsed
|
|
14
|
-
? '
|
|
17
|
+
? 'var(--fd-layout-offset)'
|
|
15
18
|
: 'calc(var(--fd-layout-offset) + var(--fd-sidebar-width))',
|
|
16
|
-
|
|
19
|
+
...props.style,
|
|
20
|
+
}, children: props.children }));
|
|
17
21
|
}
|
|
18
22
|
export function NavbarSidebarTrigger(props) {
|
|
19
23
|
const { open } = useSidebar();
|
|
@@ -22,3 +26,25 @@ export function NavbarSidebarTrigger(props) {
|
|
|
22
26
|
size: 'icon',
|
|
23
27
|
}), props.className), children: open ? _jsx(X, {}) : _jsx(Menu, {}) }));
|
|
24
28
|
}
|
|
29
|
+
export function LayoutTabs(props) {
|
|
30
|
+
return (_jsx("div", { ...props, className: cn('flex flex-row items-end gap-6 overflow-auto', props.className), children: props.children }));
|
|
31
|
+
}
|
|
32
|
+
function useIsSelected(item) {
|
|
33
|
+
const pathname = usePathname();
|
|
34
|
+
return item.urls
|
|
35
|
+
? item.urls.has(pathname.endsWith('/') ? pathname.slice(0, -1) : pathname)
|
|
36
|
+
: isActive(item.url, pathname, true);
|
|
37
|
+
}
|
|
38
|
+
export function LayoutTab(item) {
|
|
39
|
+
const { closeOnRedirect } = useSidebar();
|
|
40
|
+
const selected = useIsSelected(item);
|
|
41
|
+
return (_jsx(Link, { className: cn('inline-flex items-center py-2.5 border-b-2 border-transparent gap-2 text-fd-muted-foreground text-sm text-nowrap', selected && 'text-fd-foreground font-medium border-fd-primary'), href: item.url, onClick: () => {
|
|
42
|
+
closeOnRedirect.current = false;
|
|
43
|
+
}, children: item.title }));
|
|
44
|
+
}
|
|
45
|
+
export function SidebarLayoutTab({ item, ...props }) {
|
|
46
|
+
const selected = useIsSelected(item);
|
|
47
|
+
return (_jsxs(Link, { ...props, className: cn('flex flex-row items-center px-2 py-1.5 gap-2.5 text-fd-muted-foreground [&_svg]:!size-4.5', selected
|
|
48
|
+
? 'text-fd-primary font-medium'
|
|
49
|
+
: 'hover:text-fd-accent-foreground', props.className), "data-active": selected, href: item.url, children: [item.icon, item.title] }));
|
|
50
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { type HTMLAttributes
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type BaseLayoutProps } from '../layouts/shared.js';
|
|
3
3
|
import { type SidebarOptions } from '../layouts/docs/shared.js';
|
|
4
4
|
import type { PageTree } from 'fumadocs-core/server';
|
|
5
5
|
export interface DocsLayoutProps extends BaseLayoutProps {
|
|
6
6
|
tree: PageTree.Root;
|
|
7
|
+
tabMode?: 'sidebar' | 'navbar';
|
|
8
|
+
nav?: BaseLayoutProps['nav'] & {
|
|
9
|
+
mode?: 'top' | 'auto';
|
|
10
|
+
};
|
|
7
11
|
sidebar?: Omit<Partial<SidebarOptions>, 'component' | 'enabled'>;
|
|
8
12
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
9
13
|
}
|
|
10
|
-
export declare function DocsLayout({ nav: { transparentMode, ...nav }, sidebar: { collapsible: sidebarCollapsible, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, ...props }: DocsLayoutProps):
|
|
14
|
+
export declare function DocsLayout({ tabMode, nav: { transparentMode, ...nav }, sidebar: { collapsible: sidebarCollapsible, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, ...props }: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
//# sourceMappingURL=notebook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AA4BlE,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAWrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,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,OAAmB,EACnB,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,2CA6GjB"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
|
-
import { getLinks
|
|
3
|
+
import { getLinks } from '../layouts/shared.js';
|
|
4
4
|
import { CollapsibleSidebar, Sidebar, SidebarCollapseTrigger, SidebarFooter, SidebarHeader, SidebarViewport, SidebarPageTree, } from '../layouts/docs/sidebar.js';
|
|
5
|
-
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
6
5
|
import { TreeContextProvider } from '../contexts/tree.js';
|
|
7
6
|
import { NavProvider, Title } from '../components/layout/nav.js';
|
|
8
7
|
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
@@ -15,14 +14,18 @@ import { LanguageToggle } from '../components/layout/language-toggle.js';
|
|
|
15
14
|
import { ThemeToggle } from '../components/layout/theme-toggle.js';
|
|
16
15
|
import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover.js';
|
|
17
16
|
import { checkPageTree, getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
|
|
18
|
-
import { Navbar, NavbarSidebarTrigger } from './notebook.client.js';
|
|
17
|
+
import { LayoutTab, LayoutTabs, Navbar, NavbarSidebarTrigger, SidebarLayoutTab, } from './notebook.client.js';
|
|
19
18
|
import { StylesProvider } from '../contexts/layout.js';
|
|
20
|
-
|
|
19
|
+
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
20
|
+
export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { collapsible: sidebarCollapsible = true, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, ...props }) {
|
|
21
21
|
checkPageTree(props.tree);
|
|
22
|
+
const navMode = nav.mode ?? 'auto';
|
|
22
23
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
23
24
|
const Aside = sidebarCollapsible ? CollapsibleSidebar : Sidebar;
|
|
24
25
|
const tabs = getSidebarTabsFromOptions(tabOptions, props.tree) ?? [];
|
|
25
|
-
const variables = cn('[--fd-nav-height:
|
|
26
|
+
const variables = cn('[--fd-nav-height:calc(var(--spacing)*14)] [--fd-tocnav-height:36px] md:[--fd-sidebar-width:286px] xl:[--fd-toc-width:286px] xl:[--fd-tocnav-height:0px]', tabs.length > 0 &&
|
|
27
|
+
tabMode === 'navbar' &&
|
|
28
|
+
'lg:[--fd-nav-height:calc(var(--spacing)*26)]');
|
|
26
29
|
const pageStyles = {
|
|
27
30
|
tocNav: cn('xl:hidden'),
|
|
28
31
|
toc: cn('max-xl:hidden'),
|
|
@@ -31,20 +34,25 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { c
|
|
|
31
34
|
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
35
|
...layoutVariables,
|
|
33
36
|
...props.containerProps?.style,
|
|
34
|
-
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-(--fd-layout-offset)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-(--fd-layout-offset)', navMode === 'top'
|
|
38
|
+
? 'bg-transparent *:!pt-0'
|
|
39
|
+
: 'md:[--fd-nav-height:0px]', sidebar.className), children: [_jsxs(SidebarHeader, { children: [nav.title && navMode === 'auto' ? (_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 py-1 font-medium max-md:hidden", children: nav.title })) : null, nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null] }), _jsxs(SidebarViewport, { children: [tabMode === 'navbar' &&
|
|
40
|
+
tabs.map((tab, i) => (_jsx(SidebarLayoutTab, { item: tab, className: cn('lg:hidden', i === tabs.length - 1 && 'mb-4') }, tab.url))), links.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: cn('flex flex-row items-center', !sidebarFooter && 'md:hidden'), children: [i18n ? (_jsx(LanguageToggle, { className: "me-auto md:hidden", children: _jsx(Languages, { className: "size-5 text-fd-muted-foreground" }) })) : null, !props.disableThemeSwitch ? (_jsx(ThemeToggle, { className: "md:hidden", mode: "light-dark-system" })) : null, sidebarFooter] })] }), _jsx(DocsNavbar, { nav: nav, links: links, i18n: i18n, sidebarCollapsible: sidebarCollapsible, tabs: tabMode == 'navbar' ? tabs : [] }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
|
|
38
41
|
}
|
|
39
|
-
function DocsNavbar({ sidebarCollapsible, links, nav = {}, i18n, }) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
function DocsNavbar({ sidebarCollapsible, links, nav = {}, i18n, tabs, }) {
|
|
43
|
+
const navMode = nav.mode ?? 'auto';
|
|
44
|
+
return (_jsxs(Navbar, { className: cn('flex flex-col h-14', tabs.length > 0 && 'lg:h-26'), style: navMode === 'top'
|
|
45
|
+
? {
|
|
46
|
+
paddingInlineStart: 'var(--fd-layout-offset)',
|
|
47
|
+
}
|
|
48
|
+
: undefined, children: [_jsxs("div", { className: "flex flex-row border-b border-fd-foreground/10 px-4 flex-1 md:px-6", children: [_jsxs("div", { className: cn('flex flex-row items-center', navMode === 'top' && 'flex-1'), children: [_jsx(Title, { url: nav.url, title: nav.title, className: cn(navMode === 'auto' ? 'md:hidden' : 'pe-6') }), sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
49
|
+
color: 'ghost',
|
|
50
|
+
size: 'icon',
|
|
51
|
+
}), 'text-fd-muted-foreground data-[collapsed=false]:hidden max-md:hidden') })) : null] }), _jsx(LargeSearchToggle, { hideIfDisabled: true, className: cn('w-full my-auto rounded-xl max-md:hidden', navMode === 'top' ? 'max-w-sm px-2' : 'max-w-[240px]') }), _jsxs("div", { className: "flex flex-1 flex-row items-center justify-end", children: [_jsx("div", { className: "flex flex-row items-center gap-6 px-4 empty:hidden max-lg:hidden", children: links
|
|
52
|
+
.filter((item) => item.type !== 'icon')
|
|
53
|
+
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground" }, i))) }), nav.children, _jsx(SearchToggle, { hideIfDisabled: true, className: "md:hidden" }), _jsx(NavbarSidebarTrigger, { className: "md:hidden" }), links
|
|
54
|
+
.filter((item) => item.type === 'icon')
|
|
55
|
+
.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon-sm', color: 'ghost' }), 'text-fd-muted-foreground max-lg:hidden'), "aria-label": item.label, children: item.icon }, i))), i18n ? (_jsx(LanguageToggle, { className: "max-md:hidden", children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, _jsx(ThemeToggle, { className: "ms-2 max-md:hidden", mode: "light-dark-system" })] })] }), tabs.length > 0 ? (_jsx(LayoutTabs, { className: "px-6 border-b border-fd-foreground/10 max-lg:hidden", children: tabs.map((tab) => (_jsx(LayoutTab, { ...tab }, tab.url))) })) : null] }));
|
|
48
56
|
}
|
|
49
57
|
function NavbarLinkItem({ item, ...props }) {
|
|
50
58
|
if (item.type === 'menu') {
|
|
@@ -58,9 +66,3 @@ function NavbarLinkItem({ item, ...props }) {
|
|
|
58
66
|
return item.children;
|
|
59
67
|
return (_jsx(BaseLinkItem, { item: item, ...props, children: item.text }));
|
|
60
68
|
}
|
|
61
|
-
function SidebarHeaderItems({ links, nav = {}, children, }) {
|
|
62
|
-
const isEmpty = !nav.title && !nav.children && links.length === 0;
|
|
63
|
-
if (isEmpty)
|
|
64
|
-
return null;
|
|
65
|
-
return (_jsxs("div", { className: "flex flex-row items-center max-md:hidden", children: [nav.title ? (_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 py-1 font-medium", children: nav.title })) : null, children] }));
|
|
66
|
-
}
|
package/dist/page.client.js
CHANGED
|
@@ -104,7 +104,7 @@ export function Breadcrumb(options) {
|
|
|
104
104
|
}, [options, path, root]);
|
|
105
105
|
if (items.length === 0)
|
|
106
106
|
return null;
|
|
107
|
-
return (_jsx("div", { className: "flex flex-row items-center gap-1.5 text-[15px] text-fd-muted-foreground
|
|
107
|
+
return (_jsx("div", { className: "flex flex-row items-center gap-1.5 text-[15px] text-fd-muted-foreground", children: items.map((item, i) => {
|
|
108
108
|
const className = cn('truncate', i === items.length - 1 && 'text-fd-primary font-medium');
|
|
109
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
110
|
}) }));
|
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,EAKL,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"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"}
|
package/dist/page.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Card, Cards } from './components/card.js';
|
|
|
5
5
|
import { replaceOrDefault } from './layouts/shared.js';
|
|
6
6
|
import { cn } from './utils/cn.js';
|
|
7
7
|
import { Footer, LastUpdate, TocPopoverHeader, Breadcrumb, PageBody, PageArticle, } from './page.client.js';
|
|
8
|
-
import { Toc, TOCItems, TocPopoverTrigger, TocPopoverContent, } from './components/layout/toc.js';
|
|
8
|
+
import { Toc, TOCItems, TocPopoverTrigger, TocPopoverContent, TOCScrollArea, } 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 }, _jsxs(TocPopoverHeader, { children: [_jsx(TocPopoverTrigger, { className: "w-full", items: toc }), _jsxs(TocPopoverContent, { children: [tocPopoverOptions.header, tocPopoverOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc
|
|
25
|
+
}, children: [replaceOrDefault({ enabled: tocPopoverEnabled, component: tocPopoverReplace }, _jsxs(TocPopoverHeader, { children: [_jsx(TocPopoverTrigger, { className: "w-full", items: toc }), _jsxs(TocPopoverContent, { children: [tocPopoverOptions.header, _jsx(TOCScrollArea, { isMenu: true, children: tocPopoverOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc })) : (_jsx(TOCItems, { items: toc })) }), 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, { ...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] }), {
|
|
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" })] }), _jsx(TOCScrollArea, { children: tocOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc })) : (_jsx(TOCItems, { items: toc })) }), tocOptions.footer] }), {
|
|
29
29
|
items: toc,
|
|
30
30
|
...tocOptions,
|
|
31
31
|
})] }));
|
package/dist/style.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
--color-black: #000;
|
|
13
13
|
--spacing: 0.25rem;
|
|
14
14
|
--breakpoint-sm: 40rem;
|
|
15
|
+
--container-sm: 24rem;
|
|
15
16
|
--text-xs: 0.75rem;
|
|
16
17
|
--text-xs--line-height: calc(1 / 0.75);
|
|
17
18
|
--text-sm: 0.875rem;
|
|
@@ -357,9 +358,6 @@
|
|
|
357
358
|
.mx-4 {
|
|
358
359
|
margin-inline: calc(var(--spacing) * 4);
|
|
359
360
|
}
|
|
360
|
-
.mx-auto {
|
|
361
|
-
margin-inline: auto;
|
|
362
|
-
}
|
|
363
361
|
.my-0 {
|
|
364
362
|
margin-block: calc(var(--spacing) * 0);
|
|
365
363
|
}
|
|
@@ -369,6 +367,9 @@
|
|
|
369
367
|
.my-6 {
|
|
370
368
|
margin-block: calc(var(--spacing) * 6);
|
|
371
369
|
}
|
|
370
|
+
.my-auto {
|
|
371
|
+
margin-block: auto;
|
|
372
|
+
}
|
|
372
373
|
.-ms-1 {
|
|
373
374
|
margin-inline-start: calc(var(--spacing) * -1);
|
|
374
375
|
}
|
|
@@ -399,6 +400,9 @@
|
|
|
399
400
|
.me-2 {
|
|
400
401
|
margin-inline-end: calc(var(--spacing) * 2);
|
|
401
402
|
}
|
|
403
|
+
.me-auto {
|
|
404
|
+
margin-inline-end: auto;
|
|
405
|
+
}
|
|
402
406
|
.prose {
|
|
403
407
|
color: var(--tw-prose-body);
|
|
404
408
|
max-width: none;
|
|
@@ -774,9 +778,6 @@
|
|
|
774
778
|
.-mb-1 {
|
|
775
779
|
margin-bottom: calc(var(--spacing) * -1);
|
|
776
780
|
}
|
|
777
|
-
.-mb-1\.5 {
|
|
778
|
-
margin-bottom: calc(var(--spacing) * -1.5);
|
|
779
|
-
}
|
|
780
781
|
.mb-1 {
|
|
781
782
|
margin-bottom: calc(var(--spacing) * 1);
|
|
782
783
|
}
|
|
@@ -825,6 +826,10 @@
|
|
|
825
826
|
width: calc(var(--spacing) * 4);
|
|
826
827
|
height: calc(var(--spacing) * 4);
|
|
827
828
|
}
|
|
829
|
+
.size-4\.5 {
|
|
830
|
+
width: calc(var(--spacing) * 4.5);
|
|
831
|
+
height: calc(var(--spacing) * 4.5);
|
|
832
|
+
}
|
|
828
833
|
.size-5 {
|
|
829
834
|
width: calc(var(--spacing) * 5);
|
|
830
835
|
height: calc(var(--spacing) * 5);
|
|
@@ -933,6 +938,9 @@
|
|
|
933
938
|
.max-w-screen-sm {
|
|
934
939
|
max-width: var(--breakpoint-sm);
|
|
935
940
|
}
|
|
941
|
+
.max-w-sm {
|
|
942
|
+
max-width: var(--container-sm);
|
|
943
|
+
}
|
|
936
944
|
.min-w-0 {
|
|
937
945
|
min-width: calc(var(--spacing) * 0);
|
|
938
946
|
}
|
|
@@ -1120,6 +1128,10 @@
|
|
|
1120
1128
|
border-bottom-style: var(--tw-border-style);
|
|
1121
1129
|
border-bottom-width: 1px;
|
|
1122
1130
|
}
|
|
1131
|
+
.border-b-2 {
|
|
1132
|
+
border-bottom-style: var(--tw-border-style);
|
|
1133
|
+
border-bottom-width: 2px;
|
|
1134
|
+
}
|
|
1123
1135
|
.border-l {
|
|
1124
1136
|
border-left-style: var(--tw-border-style);
|
|
1125
1137
|
border-left-width: 1px;
|
|
@@ -1127,6 +1139,9 @@
|
|
|
1127
1139
|
.border-fd-foreground\/10 {
|
|
1128
1140
|
border-color: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
|
|
1129
1141
|
}
|
|
1142
|
+
.border-fd-primary {
|
|
1143
|
+
border-color: var(--color-fd-primary);
|
|
1144
|
+
}
|
|
1130
1145
|
.border-transparent {
|
|
1131
1146
|
border-color: transparent;
|
|
1132
1147
|
}
|
|
@@ -1274,6 +1289,9 @@
|
|
|
1274
1289
|
.pe-4 {
|
|
1275
1290
|
padding-inline-end: calc(var(--spacing) * 4);
|
|
1276
1291
|
}
|
|
1292
|
+
.pe-6 {
|
|
1293
|
+
padding-inline-end: calc(var(--spacing) * 6);
|
|
1294
|
+
}
|
|
1277
1295
|
.pt-0 {
|
|
1278
1296
|
padding-top: calc(var(--spacing) * 0);
|
|
1279
1297
|
}
|
|
@@ -1465,8 +1483,8 @@
|
|
|
1465
1483
|
--tw-duration: 300ms;
|
|
1466
1484
|
transition-duration: 300ms;
|
|
1467
1485
|
}
|
|
1468
|
-
.\[--fd-nav-height\:
|
|
1469
|
-
--fd-nav-height:
|
|
1486
|
+
.\[--fd-nav-height\:calc\(var\(--spacing\)\*14\)\] {
|
|
1487
|
+
--fd-nav-height: calc(var(--spacing) * 14);
|
|
1470
1488
|
}
|
|
1471
1489
|
.\[--fd-tocnav-height\:36px\] {
|
|
1472
1490
|
--fd-tocnav-height: 36px;
|
|
@@ -1478,6 +1496,11 @@
|
|
|
1478
1496
|
-webkit-user-select: none;
|
|
1479
1497
|
user-select: none;
|
|
1480
1498
|
}
|
|
1499
|
+
.\*\:\!pt-0 {
|
|
1500
|
+
:is(& > *) {
|
|
1501
|
+
padding-top: calc(var(--spacing) * 0) !important;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1481
1504
|
.group-hover\:opacity-100 {
|
|
1482
1505
|
&:is(:where(.group):hover *) {
|
|
1483
1506
|
@media (hover: hover) {
|
|
@@ -1485,11 +1508,6 @@
|
|
|
1485
1508
|
}
|
|
1486
1509
|
}
|
|
1487
1510
|
}
|
|
1488
|
-
.group-data-\[state\=closed\]\:-rotate-90 {
|
|
1489
|
-
&:is(:where(.group)[data-state="closed"] *) {
|
|
1490
|
-
rotate: calc(90deg * -1);
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
1511
|
.group-data-\[state\=open\]\:rotate-180 {
|
|
1494
1512
|
&:is(:where(.group)[data-state="open"] *) {
|
|
1495
1513
|
rotate: 180deg;
|
|
@@ -1869,22 +1887,12 @@
|
|
|
1869
1887
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1870
1888
|
}
|
|
1871
1889
|
}
|
|
1872
|
-
.md\:gap-1\.5 {
|
|
1873
|
-
@media (width >= 48rem) {
|
|
1874
|
-
gap: calc(var(--spacing) * 1.5);
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
1890
|
.md\:border-e {
|
|
1878
1891
|
@media (width >= 48rem) {
|
|
1879
1892
|
border-inline-end-style: var(--tw-border-style);
|
|
1880
1893
|
border-inline-end-width: 1px;
|
|
1881
1894
|
}
|
|
1882
1895
|
}
|
|
1883
|
-
.md\:px-2 {
|
|
1884
|
-
@media (width >= 48rem) {
|
|
1885
|
-
padding-inline: calc(var(--spacing) * 2);
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
1896
|
.md\:px-6 {
|
|
1889
1897
|
@media (width >= 48rem) {
|
|
1890
1898
|
padding-inline: calc(var(--spacing) * 6);
|
|
@@ -1942,6 +1950,11 @@
|
|
|
1942
1950
|
--fd-sidebar-width: 268px;
|
|
1943
1951
|
}
|
|
1944
1952
|
}
|
|
1953
|
+
.md\:\[--fd-sidebar-width\:286px\] {
|
|
1954
|
+
@media (width >= 48rem) {
|
|
1955
|
+
--fd-sidebar-width: 286px;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1945
1958
|
.lg\:mt-2 {
|
|
1946
1959
|
@media (width >= 64rem) {
|
|
1947
1960
|
margin-top: calc(var(--spacing) * 2);
|
|
@@ -1957,6 +1970,11 @@
|
|
|
1957
1970
|
height: calc(var(--spacing) * 12);
|
|
1958
1971
|
}
|
|
1959
1972
|
}
|
|
1973
|
+
.lg\:h-26 {
|
|
1974
|
+
@media (width >= 64rem) {
|
|
1975
|
+
height: calc(var(--spacing) * 26);
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1960
1978
|
.lg\:w-\[calc\(100\%-1rem\)\] {
|
|
1961
1979
|
@media (width >= 64rem) {
|
|
1962
1980
|
width: calc(100% - 1rem);
|
|
@@ -1978,6 +1996,11 @@
|
|
|
1978
1996
|
border-width: 1px;
|
|
1979
1997
|
}
|
|
1980
1998
|
}
|
|
1999
|
+
.lg\:\[--fd-nav-height\:calc\(var\(--spacing\)\*26\)\] {
|
|
2000
|
+
@media (width >= 64rem) {
|
|
2001
|
+
--fd-nav-height: calc(var(--spacing) * 26);
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
1981
2004
|
.lg\:\[--fd-sidebar-width\:286px\] {
|
|
1982
2005
|
@media (width >= 64rem) {
|
|
1983
2006
|
--fd-sidebar-width: 286px;
|
|
@@ -1998,11 +2021,6 @@
|
|
|
1998
2021
|
padding-inline: calc(var(--spacing) * 12);
|
|
1999
2022
|
}
|
|
2000
2023
|
}
|
|
2001
|
-
.xl\:\[--fd-toc-width\:268px\] {
|
|
2002
|
-
@media (width >= 80rem) {
|
|
2003
|
-
--fd-toc-width: 268px;
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
2024
|
.xl\:\[--fd-toc-width\:286px\] {
|
|
2007
2025
|
@media (width >= 80rem) {
|
|
2008
2026
|
--fd-toc-width: 286px;
|
|
@@ -2037,6 +2055,12 @@
|
|
|
2037
2055
|
background-color: var(--shiki-dark-bg);
|
|
2038
2056
|
}
|
|
2039
2057
|
}
|
|
2058
|
+
.\[\&_svg\]\:\!size-4\.5 {
|
|
2059
|
+
& svg {
|
|
2060
|
+
width: calc(var(--spacing) * 4.5) !important;
|
|
2061
|
+
height: calc(var(--spacing) * 4.5) !important;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2040
2064
|
.\[\&_svg\]\:size-3\.5 {
|
|
2041
2065
|
& svg {
|
|
2042
2066
|
width: calc(var(--spacing) * 3.5);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.8",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"next": "15.1.6",
|
|
80
80
|
"tailwindcss": "^4.0.5",
|
|
81
81
|
"tsc-alias": "^1.8.10",
|
|
82
|
-
"@fumadocs/cli": "0.0.8",
|
|
83
82
|
"eslint-config-custom": "0.0.0",
|
|
84
|
-
"fumadocs
|
|
83
|
+
"@fumadocs/cli": "0.0.8",
|
|
84
|
+
"fumadocs-core": "15.0.8",
|
|
85
85
|
"tsconfig": "0.0.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"react": "18.x.x || 19.x.x",
|
|
90
90
|
"react-dom": "18.x.x || 19.x.x",
|
|
91
91
|
"tailwindcss": "^3.4.14 || ^4.0.0",
|
|
92
|
-
"fumadocs-core": "15.0.
|
|
92
|
+
"fumadocs-core": "15.0.8"
|
|
93
93
|
},
|
|
94
94
|
"peerDependenciesMeta": {
|
|
95
95
|
"tailwindcss": {
|