fumadocs-ui 15.2.6 → 15.2.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/css/preset.css +1 -0
- package/css/shiki.css +10 -10
- package/css/style.css +0 -4
- package/dist/components/layout/search-toggle.js +1 -1
- package/dist/components/layout/toc.d.ts +0 -11
- package/dist/components/layout/toc.d.ts.map +1 -1
- package/dist/components/layout/toc.js +4 -25
- package/dist/components/ui/button.js +1 -1
- package/dist/layouts/docs/shared.d.ts +0 -6
- package/dist/layouts/docs/shared.d.ts.map +1 -1
- package/dist/layouts/docs-client.d.ts.map +1 -1
- package/dist/layouts/docs-client.js +4 -2
- package/dist/layouts/docs.d.ts +2 -3
- package/dist/layouts/docs.d.ts.map +1 -1
- package/dist/layouts/docs.js +9 -9
- package/dist/layouts/home.d.ts +3 -2
- package/dist/layouts/home.d.ts.map +1 -1
- package/dist/layouts/home.js +8 -10
- package/dist/layouts/notebook-client.js +1 -1
- package/dist/layouts/notebook.d.ts +1 -1
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +8 -9
- package/dist/layouts/shared.d.ts +12 -7
- package/dist/layouts/shared.d.ts.map +1 -1
- package/dist/layouts/shared.js +8 -1
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +1 -1
- package/dist/page-client.d.ts +7 -3
- package/dist/page-client.d.ts.map +1 -1
- package/dist/page-client.js +47 -8
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +5 -5
- package/dist/style.css +58 -47
- package/dist/theme/typography/styles.d.ts.map +1 -1
- package/dist/theme/typography/styles.js +2 -1
- package/package.json +20 -20
package/css/preset.css
CHANGED
package/css/shiki.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.
|
|
1
|
+
.shiki code span {
|
|
2
2
|
color: var(--shiki-light);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.dark .
|
|
5
|
+
.dark .shiki code span {
|
|
6
6
|
color: var(--shiki-dark);
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -11,37 +11,37 @@
|
|
|
11
11
|
font-size: 13px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.
|
|
14
|
+
.shiki code .diff.remove {
|
|
15
15
|
background-color: var(--fd-diff-remove-color);
|
|
16
16
|
opacity: 0.7;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.
|
|
19
|
+
.shiki code .diff::before {
|
|
20
20
|
position: absolute;
|
|
21
21
|
left: 6px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.
|
|
24
|
+
.shiki code .diff.remove::before {
|
|
25
25
|
content: '-';
|
|
26
26
|
color: var(--fd-diff-remove-symbol-color);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.
|
|
29
|
+
.shiki code .diff.add {
|
|
30
30
|
background-color: var(--fd-diff-add-color);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.
|
|
33
|
+
.shiki code .diff.add::before {
|
|
34
34
|
content: '+';
|
|
35
35
|
color: var(--fd-diff-add-symbol-color);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.
|
|
38
|
+
.shiki code .diff {
|
|
39
39
|
margin: 0 -16px;
|
|
40
40
|
padding: 0 16px;
|
|
41
41
|
position: relative;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.
|
|
44
|
+
.shiki .highlighted {
|
|
45
45
|
margin: 0 -16px;
|
|
46
46
|
padding: 0 16px;
|
|
47
47
|
background-color: color-mix(
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.
|
|
54
|
+
.shiki .highlighted-word {
|
|
55
55
|
padding: 1px 2px;
|
|
56
56
|
margin: -1px -3px;
|
|
57
57
|
border: 1px solid
|
package/css/style.css
CHANGED
|
@@ -14,7 +14,7 @@ export function SearchToggle({ hideIfDisabled, size = 'icon', color = 'ghost', .
|
|
|
14
14
|
color,
|
|
15
15
|
}), props.className), "data-search": "", "aria-label": "Open Search", onClick: () => {
|
|
16
16
|
setOpenSearch(true);
|
|
17
|
-
}, children: _jsx(SearchIcon, {}) }));
|
|
17
|
+
}, children: _jsx(SearchIcon, { className: "p-px" }) }));
|
|
18
18
|
}
|
|
19
19
|
export function LargeSearchToggle({ hideIfDisabled, ...props }) {
|
|
20
20
|
const { enabled, hotKey, setOpenSearch } = useSearchContext();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { TOCItemType } from 'fumadocs-core/server';
|
|
2
2
|
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
3
|
import { ScrollArea } from '../ui/scroll-area.js';
|
|
4
|
-
import type { PopoverContentProps, PopoverTriggerProps } from '@radix-ui/react-popover';
|
|
5
|
-
import { Collapsible } from '../../components/ui/collapsible.js';
|
|
6
4
|
export interface TOCProps {
|
|
7
5
|
/**
|
|
8
6
|
* Custom content in TOC container, before the main TOC
|
|
@@ -22,13 +20,4 @@ export declare function TOCScrollArea({ isMenu, ...props }: ComponentProps<typeo
|
|
|
22
20
|
export declare function TOCItems({ items }: {
|
|
23
21
|
items: TOCItemType[];
|
|
24
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
type MakeRequired<T, K extends keyof T> = T & {
|
|
26
|
-
[P in K]-?: T[P];
|
|
27
|
-
};
|
|
28
|
-
export declare function TocPopover({ open, onOpenChange, ref: _ref, ...props }: MakeRequired<ComponentProps<typeof Collapsible>, 'open' | 'onOpenChange'>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export declare function TocPopoverTrigger({ items, ...props }: PopoverTriggerProps & {
|
|
30
|
-
items: TOCItemType[];
|
|
31
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export declare function TocPopoverContent(props: PopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export {};
|
|
34
23
|
//# sourceMappingURL=toc.d.ts.map
|
|
@@ -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,
|
|
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,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,UAAU,EAAkB,MAAM,mBAAmB,CAAC;AAG/D,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,2CAsB1D;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,2CAqB3D"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
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
|
-
import {
|
|
4
|
+
import { useRef, } from 'react';
|
|
5
5
|
import { cn } from '../../utils/cn.js';
|
|
6
6
|
import { useI18n } from '../../contexts/i18n.js';
|
|
7
7
|
import { TocThumb } from '../../components/layout/toc-thumb.js';
|
|
8
8
|
import { ScrollArea, ScrollViewport } from '../ui/scroll-area.js';
|
|
9
|
-
import { ChevronRight, Text } from 'lucide-react';
|
|
10
9
|
import { usePageStyles } from '../../contexts/layout.js';
|
|
11
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible.js';
|
|
12
10
|
export function Toc(props) {
|
|
13
11
|
const { toc } = usePageStyles();
|
|
14
12
|
return (_jsx("div", { id: "nd-toc", ...props, className: cn('sticky top-[calc(var(--fd-banner-height)+var(--fd-nav-height))] h-(--fd-toc-height) pb-2 pt-12', toc, props.className), style: {
|
|
@@ -22,34 +20,15 @@ export function TocItemsEmpty() {
|
|
|
22
20
|
}
|
|
23
21
|
export function TOCScrollArea({ isMenu, ...props }) {
|
|
24
22
|
const viewRef = useRef(null);
|
|
25
|
-
return (_jsx(ScrollArea, { ...props, className: cn('flex flex-col ps-px', props.className), children: _jsx(
|
|
23
|
+
return (_jsx(ScrollArea, { ...props, className: cn('flex flex-col ps-px', props.className), children: _jsx(ScrollViewport, { ref: viewRef, className: cn('relative min-h-0 text-sm', isMenu &&
|
|
24
|
+
'[mask-image:linear-gradient(to_bottom,transparent,white_16px,white_calc(100%-16px),transparent)] px-4 md:px-6 py-2'), children: _jsx(Primitive.ScrollProvider, { containerRef: viewRef, children: props.children }) }) }));
|
|
26
25
|
}
|
|
27
26
|
export function TOCItems({ items }) {
|
|
28
27
|
const containerRef = useRef(null);
|
|
29
28
|
if (items.length === 0)
|
|
30
29
|
return _jsx(TocItemsEmpty, {});
|
|
31
|
-
return (_jsxs(_Fragment, { children: [_jsx(TocThumb, { containerRef: containerRef, className: "absolute
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(TocThumb, { containerRef: containerRef, className: "absolute top-(--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))) })] }));
|
|
32
31
|
}
|
|
33
32
|
function TOCItem({ item }) {
|
|
34
33
|
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 }));
|
|
35
34
|
}
|
|
36
|
-
const Context = createContext(null);
|
|
37
|
-
const TocProvider = Context.Provider || Context;
|
|
38
|
-
export function TocPopover({ open, onOpenChange, ref: _ref, ...props }) {
|
|
39
|
-
return (_jsx(Collapsible, { open: open, onOpenChange: onOpenChange, ...props, children: _jsx(TocProvider, { value: useMemo(() => ({
|
|
40
|
-
open,
|
|
41
|
-
setOpen: onOpenChange,
|
|
42
|
-
}), [onOpenChange, open]), children: props.children }) }));
|
|
43
|
-
}
|
|
44
|
-
export function TocPopoverTrigger({ items, ...props }) {
|
|
45
|
-
const { text } = useI18n();
|
|
46
|
-
const { open } = use(Context);
|
|
47
|
-
const active = Primitive.useActiveAnchor();
|
|
48
|
-
const current = useMemo(() => {
|
|
49
|
-
return items.find((item) => active === item.url.slice(1))?.title;
|
|
50
|
-
}, [items, active]);
|
|
51
|
-
return (_jsxs(CollapsibleTrigger, { ...props, className: cn('inline-flex items-center text-sm gap-2 text-nowrap px-4 py-2.5 text-start md:px-6 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 })] }));
|
|
52
|
-
}
|
|
53
|
-
export function TocPopoverContent(props) {
|
|
54
|
-
return (_jsx(CollapsibleContent, { "data-toc-popover": "", className: "flex flex-col max-h-[50vh]", ...props, children: props.children }));
|
|
55
|
-
}
|
|
@@ -8,7 +8,7 @@ export const buttonVariants = cva('inline-flex items-center justify-center round
|
|
|
8
8
|
secondary: 'border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground',
|
|
9
9
|
},
|
|
10
10
|
size: {
|
|
11
|
-
sm: 'gap-1 p-
|
|
11
|
+
sm: 'gap-1 p-1 text-xs',
|
|
12
12
|
icon: 'p-1.5 [&_svg]:size-5',
|
|
13
13
|
'icon-sm': 'p-1.5 [&_svg]:size-4.5',
|
|
14
14
|
},
|
|
@@ -16,12 +16,6 @@ export interface SidebarOptions extends SidebarProps {
|
|
|
16
16
|
tabs?: Option[] | GetSidebarTabsOptions | false;
|
|
17
17
|
banner?: ReactNode;
|
|
18
18
|
footer?: ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* Hide search trigger. You can also disable search for the entire site from `<RootProvider />`.
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue false
|
|
23
|
-
*/
|
|
24
|
-
hideSearch?: boolean;
|
|
25
19
|
}
|
|
26
20
|
export declare function SidebarLinkItem({ item, ...props }: {
|
|
27
21
|
item: LinkItemType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,KAAK,iBAAiB,EAMtB,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,eAAe;;CAE3B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,qBAAqB,GAAG,KAAK,CAAC;IAEhD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,KAAK,iBAAiB,EAMtB,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,eAAe;;CAE3B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,qBAAqB,GAAG,KAAK,CAAC;IAEhD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAmCA;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,wBASpB"}
|
|
@@ -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;AASvE,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAiBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAkB/C;AAED,wBAAgB,kBAAkB,
|
|
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;AASvE,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAiBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAkB/C;AAED,wBAAgB,kBAAkB,wDAyBjC"}
|
|
@@ -11,7 +11,7 @@ import { SearchToggle } from '../components/layout/search-toggle.js';
|
|
|
11
11
|
export function Navbar(props) {
|
|
12
12
|
const { open } = useSidebar();
|
|
13
13
|
const { isTransparent } = useNav();
|
|
14
|
-
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('sticky top-(--fd-banner-height) z-30 flex h-14
|
|
14
|
+
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('sticky top-(--fd-banner-height) z-30 flex h-14 items-center px-4 border-b border-fd-foreground/10 transition-colors backdrop-blur-sm md:px-6', (!isTransparent || open) && 'bg-fd-background/80', props.className), children: props.children }));
|
|
15
15
|
}
|
|
16
16
|
export function NavbarSidebarTrigger(props) {
|
|
17
17
|
const { open } = useSidebar();
|
|
@@ -24,7 +24,9 @@ export function CollapsibleControl() {
|
|
|
24
24
|
const { collapsed } = useSidebar();
|
|
25
25
|
if (!collapsed)
|
|
26
26
|
return;
|
|
27
|
-
return (_jsxs("div", { className: "fixed flex flex-row
|
|
27
|
+
return (_jsxs("div", { className: "fixed flex flex-row animate-fd-fade-in rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10 xl:start-4 max-xl:end-4", style: {
|
|
28
|
+
top: 'calc(var(--fd-banner-height) + var(--fd-tocnav-height) + var(--spacing) * 4)',
|
|
29
|
+
}, children: [_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
28
30
|
color: 'ghost',
|
|
29
31
|
size: 'icon-sm',
|
|
30
32
|
}), 'rounded-lg'), children: _jsx(SidebarIcon, {}) }), _jsx(SearchToggle, { size: "icon-sm", className: "rounded-lg" })] }));
|
package/dist/layouts/docs.d.ts
CHANGED
|
@@ -15,9 +15,8 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
15
15
|
*/
|
|
16
16
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
17
17
|
}
|
|
18
|
-
export declare function DocsLayout({ nav: {
|
|
19
|
-
export declare function DocsLayoutSidebar({ collapsible, components,
|
|
20
|
-
tree: PageTree.Root;
|
|
18
|
+
export declare function DocsLayout({ nav: { transparentMode, ...nav }, searchToggle, disableThemeSwitch, themeSwitch, sidebar: { tabs: tabOptions, ...sidebar }, i18n, children, ...props }: DocsLayoutProps): ReactNode;
|
|
19
|
+
export declare function DocsLayoutSidebar({ collapsible, components, nav, links, footer, banner, ...props }: Omit<SidebarOptions, 'tabs'> & {
|
|
21
20
|
links?: LinkItemType[];
|
|
22
21
|
nav?: ReactNode;
|
|
23
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,EAAW,MAAM,OAAO,CAAC;AAcrE,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG;QAClC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEF;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,
|
|
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,EAAW,MAAM,OAAO,CAAC;AAcrE,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG;QAClC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEF;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,YAAY,EACZ,kBAA0B,EAC1B,WAA8C,EAC9C,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,EAAO,EAC9C,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CAoG7B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,WAAkB,EAClB,UAAU,EACV,GAAG,EACH,KAAU,EACV,MAAM,EACN,MAAM,EACN,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IAChC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB,2CA2CA;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,WAAW,EACX,KAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;CAC9C,kDAiCA;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Languages, SidebarIcon } 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 '../components/layout/sidebar.js';
|
|
7
|
-
import {
|
|
7
|
+
import { slot, slots } from '../layouts/shared.js';
|
|
8
8
|
import { BaseLinkItem, } from '../layouts/links.js';
|
|
9
9
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
10
10
|
import { getLinks } from './shared.js';
|
|
@@ -16,27 +16,27 @@ import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-to
|
|
|
16
16
|
import { getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
|
|
17
17
|
import { StylesProvider, NavProvider, } from '../contexts/layout.js';
|
|
18
18
|
import Link from 'fumadocs-core/link';
|
|
19
|
-
export function DocsLayout({ nav: {
|
|
19
|
+
export function DocsLayout({ nav: { transparentMode, ...nav } = {}, searchToggle, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, sidebar: { tabs: tabOptions, ...sidebar } = {}, i18n = false, children, ...props }) {
|
|
20
|
+
const tabs = useMemo(() => getSidebarTabsFromOptions(tabOptions, props.tree) ?? [], [tabOptions, props.tree]);
|
|
20
21
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
21
|
-
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]', !
|
|
22
|
+
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]', !nav.component && nav.enabled !== false
|
|
22
23
|
? '[--fd-nav-height:calc(var(--spacing)*14)] md:[--fd-nav-height:0px]'
|
|
23
24
|
: undefined);
|
|
24
25
|
const pageStyles = {
|
|
25
26
|
tocNav: cn('xl:hidden'),
|
|
26
27
|
toc: cn('max-xl:hidden'),
|
|
27
28
|
};
|
|
28
|
-
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [
|
|
29
|
+
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [slot(nav, _jsxs(Navbar, { className: "md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), _jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children: nav.children }), slots('sm', searchToggle, _jsx(SearchToggle, { hideIfDisabled: true })), _jsx(NavbarSidebarTrigger, { className: "-me-2 md:hidden" })] })), _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex flex-1 flex-row pe-(--fd-layout-offset)', variables, props.containerProps?.className), style: {
|
|
29
30
|
...layoutVariables,
|
|
30
31
|
...props.containerProps?.style,
|
|
31
|
-
}, children: [
|
|
32
|
+
}, children: [slot(sidebar, _jsx(DocsLayoutSidebar, { ...sidebar, links: links, nav: _jsxs(_Fragment, { children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium", children: nav.title }), nav.children] }), banner: _jsxs(_Fragment, { children: [tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null, slots('lg', searchToggle, _jsx(LargeSearchToggle, { hideIfDisabled: true, className: "rounded-lg max-md:hidden" })), sidebar.banner] }), footer: _jsxs(_Fragment, { children: [_jsx(DocsLayoutSidebarFooter, { links: links.filter((item) => item.type === 'icon'), i18n: i18n, themeSwitch: themeSwitch }), sidebar.footer] }) })), _jsx(StylesProvider, { ...pageStyles, children: children })] })] }) }));
|
|
32
33
|
}
|
|
33
|
-
export function DocsLayoutSidebar({ collapsible = true, components,
|
|
34
|
-
const tabs = useMemo(() => getSidebarTabsFromOptions(tabOptions, tree) ?? [], [tabOptions, tree]);
|
|
34
|
+
export function DocsLayoutSidebar({ collapsible = true, components, nav, links = [], footer, banner, ...props }) {
|
|
35
35
|
const Aside = collapsible ? CollapsibleSidebar : Sidebar;
|
|
36
36
|
return (_jsxs(_Fragment, { children: [collapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Aside, { ...props, className: cn('md:ps-(--fd-layout-offset)', props.className), children: [_jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex flex-row pt-1 max-md:hidden", children: [nav, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
37
37
|
color: 'ghost',
|
|
38
38
|
size: 'icon-sm',
|
|
39
|
-
}), 'ms-auto mb-auto text-fd-muted-foreground max-md:hidden'), children: _jsx(SidebarIcon, {}) }))] }), banner
|
|
39
|
+
}), 'ms-auto mb-auto text-fd-muted-foreground max-md:hidden'), children: _jsx(SidebarIcon, {}) }))] }), banner] }), _jsxs(SidebarViewport, { children: [_jsx("div", { className: "mb-4 empty:hidden", children: links
|
|
40
40
|
.filter((v) => v.type !== 'icon')
|
|
41
41
|
.map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx(SidebarPageTree, { components: components })] }), _jsx(SidebarFooter, { children: footer })] })] }));
|
|
42
42
|
}
|
|
@@ -44,7 +44,7 @@ export function DocsLayoutSidebarFooter({ i18n, themeSwitch, links = [], }) {
|
|
|
44
44
|
// empty footer items
|
|
45
45
|
if (links.length === 0 && !i18n && themeSwitch?.enabled === false)
|
|
46
46
|
return null;
|
|
47
|
-
return (_jsxs("div", { className: "flex flex-row items-center", children: [links.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,
|
|
47
|
+
return (_jsxs("div", { className: "flex flex-row items-center", children: [links.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, slot(themeSwitch, _jsx(ThemeToggle, { className: "p-0", mode: themeSwitch?.mode }))] }));
|
|
48
48
|
}
|
|
49
49
|
export { CollapsibleControl, Navbar, NavbarSidebarTrigger };
|
|
50
50
|
export { getSidebarTabsFromOptions } from './docs/shared.js';
|
package/dist/layouts/home.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type NavOptions } from '../layouts/shared.js';
|
|
3
3
|
import { type BaseLayoutProps } from './shared.js';
|
|
4
|
-
export interface HomeLayoutProps extends BaseLayoutProps
|
|
4
|
+
export interface HomeLayoutProps extends BaseLayoutProps {
|
|
5
5
|
nav?: Partial<NavOptions & {
|
|
6
6
|
/**
|
|
7
7
|
* Open mobile menu when hovering the trigger
|
|
@@ -9,5 +9,6 @@ export interface HomeLayoutProps extends BaseLayoutProps, HTMLAttributes<HTMLEle
|
|
|
9
9
|
enableHoverToOpen?: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
|
-
export declare function HomeLayout(props: HomeLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function HomeLayout(props: HomeLayoutProps & HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function Header({ nav, i18n, links, githubUrl, themeSwitch, searchToggle, }: HomeLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
//# sourceMappingURL=home.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AA6B1D,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,GAAG,cAAc,CAAC,WAAW,CAAC,2CAmCrD;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAQ,EACR,IAAY,EACZ,KAAK,EACL,SAAS,EACT,WAAW,EACX,YAAY,GACb,EAAE,eAAe,2CA8FjB"}
|
package/dist/layouts/home.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { Fragment, useMemo } from 'react';
|
|
3
|
+
import { slot, slots } from '../layouts/shared.js';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
5
|
import { getLinks } from './shared.js';
|
|
6
6
|
import { NavProvider } from '../contexts/layout.js';
|
|
@@ -12,20 +12,18 @@ import { ChevronDown, Languages } from 'lucide-react';
|
|
|
12
12
|
import Link from 'fumadocs-core/link';
|
|
13
13
|
import { Menu, MenuContent, MenuLinkItem, MenuTrigger, } from '../layouts/home/menu.js';
|
|
14
14
|
export function HomeLayout(props) {
|
|
15
|
-
const { nav, links, githubUrl, i18n
|
|
16
|
-
|
|
17
|
-
return (_jsx(NavProvider, { transparentMode: nav?.transparentMode, children: _jsxs("main", { id: "nd-home-layout", ...rest, className: cn('flex flex-1 flex-col pt-14', rest.className), children: [replaceOrDefault(nav, _jsx(Header, { finalLinks: finalLinks, ...props }), {
|
|
18
|
-
items: finalLinks,
|
|
19
|
-
}), props.children] }) }));
|
|
15
|
+
const { nav, links, githubUrl, i18n, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, searchToggle, ...rest } = props;
|
|
16
|
+
return (_jsx(NavProvider, { transparentMode: nav?.transparentMode, children: _jsxs("main", { id: "nd-home-layout", ...rest, className: cn('flex flex-1 flex-col pt-14', rest.className), children: [slot(nav, _jsx(Header, { links: links, nav: nav, themeSwitch: themeSwitch, searchToggle: searchToggle, i18n: i18n, githubUrl: githubUrl })), props.children] }) }));
|
|
20
17
|
}
|
|
21
|
-
function Header({ nav
|
|
18
|
+
export function Header({ nav = {}, i18n = false, links, githubUrl, themeSwitch, searchToggle, }) {
|
|
19
|
+
const finalLinks = useMemo(() => getLinks(links, githubUrl), [links, githubUrl]);
|
|
22
20
|
const navItems = finalLinks.filter((item) => ['nav', 'all'].includes(item.on ?? 'all'));
|
|
23
21
|
const menuItems = finalLinks.filter((item) => ['menu', 'all'].includes(item.on ?? 'all'));
|
|
24
22
|
return (_jsxs(Navbar, { children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), nav.children, _jsx("ul", { className: "flex flex-row items-center gap-2 px-6 max-sm:hidden", children: navItems
|
|
25
23
|
.filter((item) => !isSecondary(item))
|
|
26
|
-
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-row items-center justify-end gap-1.5 flex-1", children: [
|
|
24
|
+
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-row items-center justify-end gap-1.5 flex-1", children: [slots('sm', searchToggle, _jsx(SearchToggle, { className: "lg:hidden", hideIfDisabled: true })), slots('lg', searchToggle, _jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-lg:hidden", hideIfDisabled: true })), slot(themeSwitch, _jsx(ThemeToggle, { className: "max-lg:hidden", mode: themeSwitch?.mode })), i18n ? (_jsx(LanguageToggle, { className: "max-lg:hidden", children: _jsx(Languages, { className: "size-5" }) })) : null] }), _jsxs("ul", { className: "flex flex-row items-center", children: [navItems.filter(isSecondary).map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "-me-1.5 max-lg:hidden" }, i))), _jsxs(Menu, { className: "lg:hidden", children: [_jsx(MenuTrigger, { "aria-label": "Toggle Menu", className: "group -me-2", enableHover: nav.enableHoverToOpen, children: _jsx(ChevronDown, { className: "size-3 transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(MenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [menuItems
|
|
27
25
|
.filter((item) => !isSecondary(item))
|
|
28
|
-
.map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "sm:hidden" }, i))), _jsxs("div", { className: "-ms-1.5 flex flex-row items-center gap-1.5 max-sm:mt-2", children: [menuItems.filter(isSecondary).map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "-me-1.5" }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { children: [_jsx(Languages, { className: "size-5" }), _jsx(LanguageToggleText, {}), _jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })] })) : null,
|
|
26
|
+
.map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "sm:hidden" }, i))), _jsxs("div", { className: "-ms-1.5 flex flex-row items-center gap-1.5 max-sm:mt-2", children: [menuItems.filter(isSecondary).map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "-me-1.5" }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { children: [_jsx(Languages, { className: "size-5" }), _jsx(LanguageToggleText, {}), _jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })] })) : null, slot(themeSwitch, _jsx(ThemeToggle, { mode: themeSwitch?.mode }))] })] })] })] })] }));
|
|
29
27
|
}
|
|
30
28
|
function NavbarLinkItem({ item, ...props }) {
|
|
31
29
|
if (item.type === 'custom')
|
|
@@ -12,7 +12,7 @@ import { isActive } from '../utils/is-active.js';
|
|
|
12
12
|
export function Navbar({ mode, ...props }) {
|
|
13
13
|
const { open, collapsed } = useSidebar();
|
|
14
14
|
const { isTransparent } = useNav();
|
|
15
|
-
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('fixed inset-x-0 top-(--fd-banner-height) z-10 px-(--fd-layout-offset) backdrop-blur-
|
|
15
|
+
return (_jsx("header", { id: "nd-subnav", ...props, className: cn('fixed inset-x-0 top-(--fd-banner-height) z-10 px-(--fd-layout-offset) backdrop-blur-sm transition-colors', (!isTransparent || open) && 'bg-fd-background/80', mode === 'auto' &&
|
|
16
16
|
!collapsed &&
|
|
17
17
|
'ps-[calc(var(--fd-layout-offset)+var(--fd-sidebar-width))]', props.className), children: props.children }));
|
|
18
18
|
}
|
|
@@ -12,6 +12,6 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
12
12
|
sidebar?: Omit<Partial<SidebarOptions>, 'component' | 'enabled'>;
|
|
13
13
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
14
14
|
}
|
|
15
|
-
export declare function DocsLayout({ tabMode, nav: { transparentMode, ...nav }, sidebar: { collapsible: sidebarCollapsible, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, themeSwitch, ...props }: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DocsLayout({ tabMode, nav: { transparentMode, ...nav }, sidebar: { collapsible: sidebarCollapsible, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, disableThemeSwitch, themeSwitch, searchToggle, ...props }: DocsLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export { Navbar, NavbarSidebarTrigger };
|
|
17
17
|
//# 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,
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAA2B,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,kBAAkB,CAAC;AAsB/E,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EAErB,MAAM,mBAAmB,CAAC;AAa3B,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,kBAA0B,EAC1B,WAA8C,EAC9C,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,2CAmJjB;AAqLD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useMemo } from 'react';
|
|
3
|
-
import { getLinks,
|
|
3
|
+
import { getLinks, slot, slots } from '../layouts/shared.js';
|
|
4
4
|
import { CollapsibleSidebar, Sidebar, SidebarCollapseTrigger, SidebarFooter, SidebarHeader, SidebarViewport, SidebarPageTree, } from '../components/layout/sidebar.js';
|
|
5
5
|
import { TreeContextProvider } from '../contexts/tree.js';
|
|
6
|
-
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
7
6
|
import { cn } from '../utils/cn.js';
|
|
8
7
|
import { buttonVariants } from '../components/ui/button.js';
|
|
9
8
|
import { ChevronDown, Languages, SidebarIcon } from 'lucide-react';
|
|
@@ -16,7 +15,8 @@ import { LayoutTab, LayoutTabs, Navbar, NavbarSidebarTrigger, SidebarLayoutTab,
|
|
|
16
15
|
import { StylesProvider, NavProvider, } from '../contexts/layout.js';
|
|
17
16
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
18
17
|
import Link from 'fumadocs-core/link';
|
|
19
|
-
|
|
18
|
+
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
19
|
+
export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { collapsible: sidebarCollapsible = true, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, searchToggle, ...props }) {
|
|
20
20
|
const navMode = nav.mode ?? 'auto';
|
|
21
21
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
22
22
|
const tabs = useMemo(() => getSidebarTabsFromOptions(tabOptions, props.tree) ?? [], [tabOptions, props.tree]);
|
|
@@ -38,18 +38,17 @@ export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav
|
|
|
38
38
|
color: 'ghost',
|
|
39
39
|
size: 'icon-sm',
|
|
40
40
|
}), 'text-fd-muted-foreground mb-auto'), children: _jsx(SidebarIcon, {}) })] })), nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null] }), _jsxs(SidebarViewport, { children: [tabMode === 'navbar' &&
|
|
41
|
-
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,
|
|
41
|
+
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, slot(themeSwitch, _jsx(ThemeToggle, { className: "md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarFooter] })] }), _jsx(DocsNavbar, { mode: nav.mode, nav: _jsx(Link, { href: nav.url ?? '/', className: cn('inline-flex items-center gap-2.5 font-semibold', navMode === 'auto' && 'md:hidden'), children: nav.title }), links: links, i18n: i18n, sidebarCollapsible: sidebarCollapsible, searchToggle: searchToggle, tabs: tabMode == 'navbar' ? tabs : [], children: nav.children }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
|
|
42
42
|
}
|
|
43
|
-
function DocsNavbar({ sidebarCollapsible, links, themeSwitch,
|
|
44
|
-
const navMode = nav.mode ?? 'auto';
|
|
43
|
+
function DocsNavbar({ mode: navMode = 'auto', nav, sidebarCollapsible = false, links, themeSwitch, searchToggle, i18n = false, tabs, children, }) {
|
|
45
44
|
return (_jsxs(Navbar, { mode: navMode, children: [_jsxs("div", { className: cn('flex flex-row border-b border-fd-foreground/10 px-4 h-14', navMode === 'auto' && 'md:px-6'), children: [_jsxs("div", { className: cn('flex flex-row items-center', navMode === 'top' && 'flex-1 pe-4'), children: [sidebarCollapsible && navMode === 'auto' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
46
45
|
color: 'ghost',
|
|
47
46
|
size: 'icon-sm',
|
|
48
|
-
}), 'text-fd-muted-foreground -ms-1.5 me-2 data-[collapsed=false]:hidden max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null,
|
|
47
|
+
}), 'text-fd-muted-foreground -ms-1.5 me-2 data-[collapsed=false]:hidden max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null, nav] }), slots('lg', searchToggle, _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
|
|
49
48
|
.filter((item) => item.type !== 'icon')
|
|
50
|
-
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground" }, i))) }),
|
|
49
|
+
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground" }, i))) }), children, slots('sm', searchToggle, _jsx(SearchToggle, { hideIfDisabled: true, className: "md:hidden" })), _jsx(NavbarSidebarTrigger, { className: "md:hidden" }), links
|
|
51
50
|
.filter((item) => item.type === 'icon')
|
|
52
|
-
.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,
|
|
51
|
+
.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, slot(themeSwitch, _jsx(ThemeToggle, { className: "ms-2 max-md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarCollapsible && navMode === 'top' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
53
52
|
color: 'secondary',
|
|
54
53
|
size: 'icon-sm',
|
|
55
54
|
}), 'ms-2 text-fd-muted-foreground rounded-full max-md:hidden'), children: _jsx(SidebarIcon, {}) })) : null] })] }), tabs.length > 0 ? (_jsx(LayoutTabs, { className: "px-6 border-b border-fd-foreground/10 h-10 max-lg:hidden", children: tabs.map((tab) => (_jsx(LayoutTab, { ...tab }, tab.url))) })) : null] }));
|
package/dist/layouts/shared.d.ts
CHANGED
|
@@ -11,12 +11,6 @@ export interface NavOptions extends NavProviderProps {
|
|
|
11
11
|
* @defaultValue '/'
|
|
12
12
|
*/
|
|
13
13
|
url?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Show/hide search toggle
|
|
16
|
-
*
|
|
17
|
-
* Note: Enable/disable search from root provider instead
|
|
18
|
-
*/
|
|
19
|
-
enableSearch?: boolean;
|
|
20
14
|
children?: ReactNode;
|
|
21
15
|
}
|
|
22
16
|
export interface BaseLayoutProps {
|
|
@@ -25,6 +19,13 @@ export interface BaseLayoutProps {
|
|
|
25
19
|
component?: ReactNode;
|
|
26
20
|
mode?: 'light-dark' | 'light-dark-system';
|
|
27
21
|
};
|
|
22
|
+
searchToggle?: Partial<{
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
components: Partial<{
|
|
25
|
+
sm: ReactNode;
|
|
26
|
+
lg: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
28
29
|
/**
|
|
29
30
|
* Remove theme switcher component
|
|
30
31
|
*
|
|
@@ -53,8 +54,12 @@ export { type LinkItemType };
|
|
|
53
54
|
* Get Links Items with shortcuts
|
|
54
55
|
*/
|
|
55
56
|
export declare function getLinks(links?: LinkItemType[], githubUrl?: string): LinkItemType[];
|
|
56
|
-
export declare function
|
|
57
|
+
export declare function slot(obj: {
|
|
57
58
|
enabled?: boolean;
|
|
58
59
|
component?: ReactNode;
|
|
59
60
|
} | undefined, def: ReactNode, customComponentProps?: object, disabled?: ReactNode): ReactNode;
|
|
61
|
+
export declare function slots<Comp extends Record<string, ReactNode>>(variant: keyof Comp, obj: {
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
components?: Comp;
|
|
64
|
+
} | undefined, def: ReactNode): ReactNode;
|
|
60
65
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/layouts/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/layouts/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE;QACZ,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,IAAI,CAAC,EAAE,YAAY,GAAG,mBAAmB,CAAC;KAC3C,CAAC;IAEF,YAAY,CAAC,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;YAClB,EAAE,EAAE,SAAS,CAAC;YACd,EAAE,EAAE,SAAS,CAAC;SACf,CAAC,CAAC;KACJ,CAAC,CAAC;IAEH;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC;AAE7B;;GAEG;AACH,wBAAgB,QAAQ,CACtB,KAAK,GAAE,YAAY,EAAO,EAC1B,SAAS,CAAC,EAAE,MAAM,GACjB,YAAY,EAAE,CAqBhB;AAED,wBAAgB,IAAI,CAClB,GAAG,EACC;IACE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GACD,SAAS,EACb,GAAG,EAAE,SAAS,EACd,oBAAoB,CAAC,EAAE,MAAM,EAC7B,QAAQ,CAAC,EAAE,SAAS,GACnB,SAAS,CAMX;AAED,wBAAgB,KAAK,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC1D,OAAO,EAAE,MAAM,IAAI,EACnB,GAAG,EACC;IACE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB,GACD,SAAS,EACb,GAAG,EAAE,SAAS,GACb,SAAS,CAMX"}
|
package/dist/layouts/shared.js
CHANGED
|
@@ -19,10 +19,17 @@ export function getLinks(links = [], githubUrl) {
|
|
|
19
19
|
];
|
|
20
20
|
return result;
|
|
21
21
|
}
|
|
22
|
-
export function
|
|
22
|
+
export function slot(obj, def, customComponentProps, disabled) {
|
|
23
23
|
if (obj?.enabled === false)
|
|
24
24
|
return disabled;
|
|
25
25
|
if (obj?.component !== undefined)
|
|
26
26
|
return _jsx(Slot, { ...customComponentProps, children: obj.component });
|
|
27
27
|
return def;
|
|
28
28
|
}
|
|
29
|
+
export function slots(variant, obj, def) {
|
|
30
|
+
if (obj?.enabled === false)
|
|
31
|
+
return;
|
|
32
|
+
if (obj?.components?.[variant] !== undefined)
|
|
33
|
+
return _jsx(Slot, { children: obj.components[variant] });
|
|
34
|
+
return def;
|
|
35
|
+
}
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,EAAE,EACF,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAMhD,iBAAS,KAAK,CACZ,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,EAAE,EACF,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAMhD,iBAAS,KAAK,CACZ,KAAK,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CAUF;AAED,iBAAS,KAAK,CAAC,KAAK,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,2CAM1D;AAED,QAAA,MAAM,oBAAoB;iBACX,cAAc,CAAC,cAAc,CAAC;;;OAOhC,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;;gBAE1C,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;gBAGlC,cAAc,CAAC,kBAAkB,CAAC;;;;;;;CAK/C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,cAAc,EAAE,kBAK5D,CAAC;AAEJ,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
|
package/dist/mdx.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Heading } from './components/heading.js';
|
|
|
7
7
|
import { cn } from './utils/cn.js';
|
|
8
8
|
import { CodeBlock, Pre } from './components/codeblock.js';
|
|
9
9
|
function Image(props) {
|
|
10
|
-
return (_jsx(FrameworkImage, { sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px", ...props, className: cn('rounded-lg', props.className) }));
|
|
10
|
+
return (_jsx(FrameworkImage, { sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px", ...props, src: props.src, className: cn('rounded-lg', props.className) }));
|
|
11
11
|
}
|
|
12
12
|
function Table(props) {
|
|
13
13
|
return (_jsx("div", { className: "relative overflow-auto prose-no-margin my-6", children: _jsx("table", { ...props }) }));
|
package/dist/page-client.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { PageTree } from 'fumadocs-core/server';
|
|
1
|
+
import { type ComponentProps, type HTMLAttributes } from 'react';
|
|
2
|
+
import type { PageTree, TOCItemType } from 'fumadocs-core/server';
|
|
3
3
|
import { type BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function TocPopoverTrigger({ items, ...props }: ComponentProps<'button'> & {
|
|
5
|
+
items: TOCItemType[];
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function TocPopoverContent(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TocPopover(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
9
|
export declare function PageBody(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
6
10
|
export declare function PageArticle(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
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,
|
|
1
|
+
{"version":3,"file":"page-client.d.ts","sourceRoot":"","sources":["../src/page-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAgBlC,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,2CAoDrD;AA4DD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAU7D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,2CA0D/D;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,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC;AAChE,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,IAAI,CAAC;KACb,CAAC;CACH;AAyBD,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,WAAW,2CA+B5C;AA8BD,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAEhD,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,kDAsClD"}
|
package/dist/page-client.js
CHANGED
|
@@ -1,19 +1,54 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Fragment, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
-
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';
|
|
5
5
|
import Link from 'fumadocs-core/link';
|
|
6
6
|
import { cn } from './utils/cn.js';
|
|
7
7
|
import { useI18n } from './contexts/i18n.js';
|
|
8
8
|
import { useTreeContext, useTreePath } from './contexts/tree.js';
|
|
9
9
|
import { useSidebar } from './contexts/sidebar.js';
|
|
10
|
-
import { usePathname } from 'fumadocs-core/framework';
|
|
10
|
+
import { createContext, usePathname } from 'fumadocs-core/framework';
|
|
11
11
|
import { getBreadcrumbItemsFromPath, } from 'fumadocs-core/breadcrumb';
|
|
12
|
-
import {
|
|
12
|
+
import { useNav, usePageStyles } from './contexts/layout.js';
|
|
13
13
|
import { isActive } from './utils/is-active.js';
|
|
14
|
-
import { TocPopover } from './components/layout/toc.js';
|
|
15
14
|
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
16
|
-
|
|
15
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './components/ui/collapsible.js';
|
|
16
|
+
import * as Primitive from 'fumadocs-core/toc';
|
|
17
|
+
const TocPopoverContext = createContext('TocPopoverContext');
|
|
18
|
+
export function TocPopoverTrigger({ items, ...props }) {
|
|
19
|
+
const { text } = useI18n();
|
|
20
|
+
const { open } = TocPopoverContext.use();
|
|
21
|
+
const active = Primitive.useActiveAnchor();
|
|
22
|
+
const selected = useMemo(() => items.findIndex((item) => active === item.url.slice(1)), [items, active]);
|
|
23
|
+
const path = useTreePath().at(-1);
|
|
24
|
+
const showCurrent = selected !== -1 && !open;
|
|
25
|
+
return (_jsxs(CollapsibleTrigger, { ...props, className: cn('flex flex-row items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:shrink-0 [&_svg]:size-4 md:px-6', props.className), children: [_jsx(ProgressCircle, { value: (selected + 1) / items.length, max: 1, className: cn(open && 'text-fd-primary') }), _jsxs("span", { className: cn('grid flex-1 *:row-start-1 *:col-start-1', open && 'text-fd-foreground'), children: [_jsx("span", { className: cn('truncate transition-all', showCurrent && 'opacity-0 -translate-y-full pointer-events-none'), children: path?.name ?? text.toc }), _jsx("span", { className: cn('truncate transition-all', !showCurrent && 'opacity-0 translate-y-full pointer-events-none'), children: items[selected]?.title })] }), _jsx(ChevronDown, { className: cn('transition-transform', open && 'rotate-180') })] }));
|
|
26
|
+
}
|
|
27
|
+
function clamp(input, min, max) {
|
|
28
|
+
if (input < min)
|
|
29
|
+
return min;
|
|
30
|
+
if (input > max)
|
|
31
|
+
return max;
|
|
32
|
+
return input;
|
|
33
|
+
}
|
|
34
|
+
function ProgressCircle({ value, strokeWidth = 2, size = 24, min = 0, max = 100, ...restSvgProps }) {
|
|
35
|
+
const normalizedValue = clamp(value, min, max);
|
|
36
|
+
const radius = (size - strokeWidth) / 2;
|
|
37
|
+
const circumference = 2 * Math.PI * radius;
|
|
38
|
+
const progress = (normalizedValue / max) * circumference;
|
|
39
|
+
const circleProps = {
|
|
40
|
+
cx: size / 2,
|
|
41
|
+
cy: size / 2,
|
|
42
|
+
r: radius,
|
|
43
|
+
fill: 'none',
|
|
44
|
+
strokeWidth,
|
|
45
|
+
};
|
|
46
|
+
return (_jsxs("svg", { role: "progressbar", viewBox: `0 0 ${size} ${size}`, "aria-valuenow": normalizedValue, "aria-valuemin": min, "aria-valuemax": max, ...restSvgProps, children: [_jsx("circle", { ...circleProps, className: "stroke-current/25" }), _jsx("circle", { ...circleProps, stroke: "currentColor", strokeDasharray: circumference, strokeDashoffset: circumference - progress, strokeLinecap: "round", transform: `rotate(-90 ${size / 2} ${size / 2})`, className: "transition-all" })] }));
|
|
47
|
+
}
|
|
48
|
+
export function TocPopoverContent(props) {
|
|
49
|
+
return (_jsx(CollapsibleContent, { "data-toc-popover": "", ...props, className: cn('flex flex-col max-h-[50vh]', props.className), children: props.children }));
|
|
50
|
+
}
|
|
51
|
+
export function TocPopover(props) {
|
|
17
52
|
const ref = useRef(null);
|
|
18
53
|
const [open, setOpen] = useState(false);
|
|
19
54
|
const sidebar = useSidebar();
|
|
@@ -31,9 +66,13 @@ export function TocPopoverHeader(props) {
|
|
|
31
66
|
window.removeEventListener('click', onClick);
|
|
32
67
|
};
|
|
33
68
|
}, [onClick]);
|
|
34
|
-
return (_jsx("div", { className: cn('sticky overflow-visible z-10', tocNav, props.className), style: {
|
|
69
|
+
return (_jsx("div", { ...props, className: cn('sticky overflow-visible z-10', tocNav, props.className), style: {
|
|
70
|
+
...props.style,
|
|
35
71
|
top: 'calc(var(--fd-banner-height) + var(--fd-nav-height))',
|
|
36
|
-
}, children: _jsx(
|
|
72
|
+
}, children: _jsx(TocPopoverContext.Provider, { value: useMemo(() => ({
|
|
73
|
+
open,
|
|
74
|
+
setOpen,
|
|
75
|
+
}), [setOpen, open]), children: _jsx(Collapsible, { 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-sm transition-colors', (!isTransparent || open) && 'bg-fd-background/80', open && 'shadow-lg', sidebar.open && 'max-md:hidden'), children: props.children }) }) }) }));
|
|
37
76
|
}
|
|
38
77
|
export function PageBody(props) {
|
|
39
78
|
const { page } = usePageStyles();
|
|
@@ -41,7 +80,7 @@ export function PageBody(props) {
|
|
|
41
80
|
}
|
|
42
81
|
export function PageArticle(props) {
|
|
43
82
|
const { article } = usePageStyles();
|
|
44
|
-
return (_jsx("article", { ...props, className: cn('flex w-full flex-1 flex-col gap-6 px-4
|
|
83
|
+
return (_jsx("article", { ...props, className: cn('flex w-full flex-1 flex-col gap-6 px-4 md:px-6 pt-8 md:pt-12 xl:px-12 xl:mx-auto', article, props.className), children: props.children }));
|
|
45
84
|
}
|
|
46
85
|
export function LastUpdate(props) {
|
|
47
86
|
const { text } = useI18n();
|
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,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,mBAAmB,EAAkB,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAEL,KAAK,WAAW,EAIhB,KAAK,eAAe,EAKrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,QAAQ,EAEd,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,2CA4Ff;AA+BD;;GAEG;AACH,eAAO,MAAM,QAAQ,2HAOnB,CAAC;AAIH,eAAO,MAAM,eAAe,uIAgB1B,CAAC;AAIH,eAAO,MAAM,SAAS,mIAapB,CAAC;AAIH;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAM5E"}
|
package/dist/page.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, } from 'react';
|
|
3
3
|
import { AnchorProvider } from 'fumadocs-core/toc';
|
|
4
|
-
import {
|
|
4
|
+
import { slot } from './layouts/shared.js';
|
|
5
5
|
import { cn } from './utils/cn.js';
|
|
6
|
-
import { Footer, LastUpdate,
|
|
7
|
-
import { Toc, TOCItems,
|
|
6
|
+
import { Footer, LastUpdate, TocPopover, Breadcrumb, PageBody, PageArticle, TocPopoverTrigger, TocPopoverContent, } from './page-client.js';
|
|
7
|
+
import { Toc, TOCItems, TOCScrollArea, } from './components/layout/toc.js';
|
|
8
8
|
import { buttonVariants } from './components/ui/button.js';
|
|
9
9
|
import { Edit, Text } from 'lucide-react';
|
|
10
10
|
import { I18nLabel } from './contexts/i18n.js';
|
|
@@ -21,10 +21,10 @@ export function DocsPage({ toc = [], full = false, tableOfContentPopover: { enab
|
|
|
21
21
|
return (_jsxs(AnchorProvider, { toc: toc, single: tocOptions.single, children: [_jsxs(PageBody, { ...props.container, className: cn(props.container?.className), style: {
|
|
22
22
|
'--fd-tocnav-height': !tocPopoverEnabled ? '0px' : undefined,
|
|
23
23
|
...props.container?.style,
|
|
24
|
-
}, children: [
|
|
24
|
+
}, children: [slot({ enabled: tocPopoverEnabled, component: tocPopoverReplace }, _jsxs(TocPopover, { className: "h-10", 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] })] }), {
|
|
25
25
|
items: toc,
|
|
26
26
|
...tocPopoverOptions,
|
|
27
|
-
}), _jsxs(PageArticle, { ...props.article, className: cn(full || !tocEnabled ? 'max-w-[1120px]' : 'max-w-[860px]', props.article?.className), children: [
|
|
27
|
+
}), _jsxs(PageArticle, { ...props.article, className: cn(full || !tocEnabled ? 'max-w-[1120px]' : 'max-w-[860px]', props.article?.className), children: [slot(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] }), slot(props.footer, _jsx(Footer, { items: props.footer?.items }))] })] }), slot({ 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] }), {
|
|
28
28
|
items: toc,
|
|
29
29
|
...tocOptions,
|
|
30
30
|
})] }));
|
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
--text-base--line-height: calc(1.5 / 1);
|
|
23
23
|
--text-lg: 1.125rem;
|
|
24
24
|
--text-lg--line-height: calc(1.75 / 1.125);
|
|
25
|
+
--text-2xl: 1.5rem;
|
|
25
26
|
--text-3xl: 1.875rem;
|
|
26
27
|
--text-3xl--line-height: calc(2.25 / 1.875);
|
|
27
28
|
--font-weight-medium: 500;
|
|
@@ -231,6 +232,9 @@
|
|
|
231
232
|
.\@container {
|
|
232
233
|
container-type: inline-size;
|
|
233
234
|
}
|
|
235
|
+
.pointer-events-none {
|
|
236
|
+
pointer-events: none;
|
|
237
|
+
}
|
|
234
238
|
.collapse {
|
|
235
239
|
visibility: collapse;
|
|
236
240
|
}
|
|
@@ -304,6 +308,9 @@
|
|
|
304
308
|
.top-\(--fd-nav-height\) {
|
|
305
309
|
top: var(--fd-nav-height);
|
|
306
310
|
}
|
|
311
|
+
.top-\(--fd-top\) {
|
|
312
|
+
top: var(--fd-top);
|
|
313
|
+
}
|
|
307
314
|
.top-0 {
|
|
308
315
|
top: calc(var(--spacing) * 0);
|
|
309
316
|
}
|
|
@@ -316,9 +323,6 @@
|
|
|
316
323
|
.top-2 {
|
|
317
324
|
top: calc(var(--spacing) * 2);
|
|
318
325
|
}
|
|
319
|
-
.top-12 {
|
|
320
|
-
top: calc(var(--spacing) * 12);
|
|
321
|
-
}
|
|
322
326
|
.top-14 {
|
|
323
327
|
top: calc(var(--spacing) * 14);
|
|
324
328
|
}
|
|
@@ -389,9 +393,6 @@
|
|
|
389
393
|
.-mx-2 {
|
|
390
394
|
margin-inline: calc(var(--spacing) * -2);
|
|
391
395
|
}
|
|
392
|
-
.mx-4 {
|
|
393
|
-
margin-inline: calc(var(--spacing) * 4);
|
|
394
|
-
}
|
|
395
396
|
.\!my-0 {
|
|
396
397
|
margin-block: calc(var(--spacing) * 0) !important;
|
|
397
398
|
}
|
|
@@ -581,7 +582,7 @@
|
|
|
581
582
|
:where(h1):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
|
|
582
583
|
color: var(--tw-prose-headings);
|
|
583
584
|
font-weight: 800;
|
|
584
|
-
font-size:
|
|
585
|
+
font-size: var(--text-3xl);
|
|
585
586
|
margin-top: 0;
|
|
586
587
|
margin-bottom: 0.8888889em;
|
|
587
588
|
line-height: 1.1111111;
|
|
@@ -681,6 +682,7 @@
|
|
|
681
682
|
}
|
|
682
683
|
:where(h1 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
|
|
683
684
|
color: inherit;
|
|
685
|
+
font-size: var(--text-2xl);
|
|
684
686
|
}
|
|
685
687
|
:where(h2 code):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
|
|
686
688
|
color: inherit;
|
|
@@ -814,9 +816,6 @@
|
|
|
814
816
|
.mt-\(--fd-top\) {
|
|
815
817
|
margin-top: var(--fd-top);
|
|
816
818
|
}
|
|
817
|
-
.mt-2 {
|
|
818
|
-
margin-top: calc(var(--spacing) * 2);
|
|
819
|
-
}
|
|
820
819
|
.mt-6 {
|
|
821
820
|
margin-top: calc(var(--spacing) * 6);
|
|
822
821
|
}
|
|
@@ -1030,6 +1029,14 @@
|
|
|
1030
1029
|
--tw-translate-y: calc(calc(1/2 * 100%) * -1);
|
|
1031
1030
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1032
1031
|
}
|
|
1032
|
+
.-translate-y-full {
|
|
1033
|
+
--tw-translate-y: -100%;
|
|
1034
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1035
|
+
}
|
|
1036
|
+
.translate-y-full {
|
|
1037
|
+
--tw-translate-y: 100%;
|
|
1038
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1039
|
+
}
|
|
1033
1040
|
.scale-0 {
|
|
1034
1041
|
--tw-scale-x: 0%;
|
|
1035
1042
|
--tw-scale-y: 0%;
|
|
@@ -1039,11 +1046,11 @@
|
|
|
1039
1046
|
.-rotate-90 {
|
|
1040
1047
|
rotate: calc(90deg * -1);
|
|
1041
1048
|
}
|
|
1042
|
-
.rotate-
|
|
1043
|
-
rotate:
|
|
1049
|
+
.rotate-180 {
|
|
1050
|
+
rotate: 180deg;
|
|
1044
1051
|
}
|
|
1045
1052
|
.transform {
|
|
1046
|
-
transform: var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y);
|
|
1053
|
+
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
|
1047
1054
|
}
|
|
1048
1055
|
.animate-fd-fade-in {
|
|
1049
1056
|
animation: var(--animate-fd-fade-in);
|
|
@@ -1280,6 +1287,9 @@
|
|
|
1280
1287
|
.bg-transparent {
|
|
1281
1288
|
background-color: transparent;
|
|
1282
1289
|
}
|
|
1290
|
+
.\[mask-image\:linear-gradient\(to_bottom\,transparent\,white_16px\,white_calc\(100\%-16px\)\,transparent\)\] {
|
|
1291
|
+
mask-image: linear-gradient(to bottom,transparent,white 16px,white calc(100% - 16px),transparent);
|
|
1292
|
+
}
|
|
1283
1293
|
.fill-blue-500 {
|
|
1284
1294
|
fill: var(--color-blue-500);
|
|
1285
1295
|
}
|
|
@@ -1289,6 +1299,12 @@
|
|
|
1289
1299
|
.fill-red-500 {
|
|
1290
1300
|
fill: var(--color-red-500);
|
|
1291
1301
|
}
|
|
1302
|
+
.stroke-current\/25 {
|
|
1303
|
+
stroke: currentcolor;
|
|
1304
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1305
|
+
stroke: color-mix(in oklab, currentcolor 25%, transparent);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1292
1308
|
.stroke-fd-foreground\/10 {
|
|
1293
1309
|
stroke: color-mix(in srgb, hsl(0, 0%, 3.9%) 10%, transparent);
|
|
1294
1310
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1316,6 +1332,9 @@
|
|
|
1316
1332
|
.p-4 {
|
|
1317
1333
|
padding: calc(var(--spacing) * 4);
|
|
1318
1334
|
}
|
|
1335
|
+
.p-px {
|
|
1336
|
+
padding: 1px;
|
|
1337
|
+
}
|
|
1319
1338
|
.px-\(--fd-layout-offset\) {
|
|
1320
1339
|
padding-inline: var(--fd-layout-offset);
|
|
1321
1340
|
}
|
|
@@ -1601,6 +1620,16 @@
|
|
|
1601
1620
|
.\[--fd-tocnav-height\:36px\] {
|
|
1602
1621
|
--fd-tocnav-height: 36px;
|
|
1603
1622
|
}
|
|
1623
|
+
.\*\:col-start-1 {
|
|
1624
|
+
:is(& > *) {
|
|
1625
|
+
grid-column-start: 1;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
.\*\:row-start-1 {
|
|
1629
|
+
:is(& > *) {
|
|
1630
|
+
grid-row-start: 1;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1604
1633
|
.group-hover\:opacity-100 {
|
|
1605
1634
|
&:is(:where(.group):hover *) {
|
|
1606
1635
|
@media (hover: hover) {
|
|
@@ -1970,11 +1999,6 @@
|
|
|
1970
1999
|
position: sticky;
|
|
1971
2000
|
}
|
|
1972
2001
|
}
|
|
1973
|
-
.md\:mx-6 {
|
|
1974
|
-
@media (width >= 48rem) {
|
|
1975
|
-
margin-inline: calc(var(--spacing) * 6);
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
2002
|
.md\:mx-auto {
|
|
1979
2003
|
@media (width >= 48rem) {
|
|
1980
2004
|
margin-inline: auto;
|
|
@@ -2166,11 +2190,6 @@
|
|
|
2166
2190
|
inset-inline-start: calc(var(--spacing) * 4);
|
|
2167
2191
|
}
|
|
2168
2192
|
}
|
|
2169
|
-
.xl\:top-4 {
|
|
2170
|
-
@media (width >= 80rem) {
|
|
2171
|
-
top: calc(var(--spacing) * 4);
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
2193
|
.xl\:mx-auto {
|
|
2175
2194
|
@media (width >= 80rem) {
|
|
2176
2195
|
margin-inline: auto;
|
|
@@ -2313,41 +2332,41 @@
|
|
|
2313
2332
|
--color-fd-secondary: hsl(0, 0%, 18%);
|
|
2314
2333
|
--color-fd-muted-foreground: hsl(0, 0%, 72%);
|
|
2315
2334
|
}
|
|
2316
|
-
.
|
|
2335
|
+
.shiki code span {
|
|
2317
2336
|
color: var(--shiki-light);
|
|
2318
2337
|
}
|
|
2319
|
-
.dark .
|
|
2338
|
+
.dark .shiki code span {
|
|
2320
2339
|
color: var(--shiki-dark);
|
|
2321
2340
|
}
|
|
2322
2341
|
.fd-codeblock pre > * {
|
|
2323
2342
|
display: grid;
|
|
2324
2343
|
font-size: 13px;
|
|
2325
2344
|
}
|
|
2326
|
-
.
|
|
2345
|
+
.shiki code .diff.remove {
|
|
2327
2346
|
background-color: var(--fd-diff-remove-color);
|
|
2328
2347
|
opacity: 0.7;
|
|
2329
2348
|
}
|
|
2330
|
-
.
|
|
2349
|
+
.shiki code .diff::before {
|
|
2331
2350
|
position: absolute;
|
|
2332
2351
|
left: 6px;
|
|
2333
2352
|
}
|
|
2334
|
-
.
|
|
2353
|
+
.shiki code .diff.remove::before {
|
|
2335
2354
|
content: '-';
|
|
2336
2355
|
color: var(--fd-diff-remove-symbol-color);
|
|
2337
2356
|
}
|
|
2338
|
-
.
|
|
2357
|
+
.shiki code .diff.add {
|
|
2339
2358
|
background-color: var(--fd-diff-add-color);
|
|
2340
2359
|
}
|
|
2341
|
-
.
|
|
2360
|
+
.shiki code .diff.add::before {
|
|
2342
2361
|
content: '+';
|
|
2343
2362
|
color: var(--fd-diff-add-symbol-color);
|
|
2344
2363
|
}
|
|
2345
|
-
.
|
|
2364
|
+
.shiki code .diff {
|
|
2346
2365
|
margin: 0 -16px;
|
|
2347
2366
|
padding: 0 16px;
|
|
2348
2367
|
position: relative;
|
|
2349
2368
|
}
|
|
2350
|
-
.
|
|
2369
|
+
.shiki .highlighted {
|
|
2351
2370
|
margin: 0 -16px;
|
|
2352
2371
|
padding: 0 16px;
|
|
2353
2372
|
background-color: color-mix( in oklab, hsl(0, 0%, 9%) 10%, transparent );
|
|
@@ -2355,7 +2374,7 @@
|
|
|
2355
2374
|
background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
|
|
2356
2375
|
}
|
|
2357
2376
|
}
|
|
2358
|
-
.
|
|
2377
|
+
.shiki .highlighted-word {
|
|
2359
2378
|
padding: 1px 2px;
|
|
2360
2379
|
margin: -1px -3px;
|
|
2361
2380
|
border: 1px solid color-mix(in srgb, hsl(0, 0%, 9%) 50%, transparent);
|
|
@@ -2391,9 +2410,6 @@
|
|
|
2391
2410
|
min-height: 100vh;
|
|
2392
2411
|
flex-direction: column;
|
|
2393
2412
|
}
|
|
2394
|
-
button {
|
|
2395
|
-
cursor: pointer;
|
|
2396
|
-
}
|
|
2397
2413
|
}
|
|
2398
2414
|
@property --tw-translate-x {
|
|
2399
2415
|
syntax: "*";
|
|
@@ -2428,27 +2444,22 @@
|
|
|
2428
2444
|
@property --tw-rotate-x {
|
|
2429
2445
|
syntax: "*";
|
|
2430
2446
|
inherits: false;
|
|
2431
|
-
initial-value: rotateX(0);
|
|
2432
2447
|
}
|
|
2433
2448
|
@property --tw-rotate-y {
|
|
2434
2449
|
syntax: "*";
|
|
2435
2450
|
inherits: false;
|
|
2436
|
-
initial-value: rotateY(0);
|
|
2437
2451
|
}
|
|
2438
2452
|
@property --tw-rotate-z {
|
|
2439
2453
|
syntax: "*";
|
|
2440
2454
|
inherits: false;
|
|
2441
|
-
initial-value: rotateZ(0);
|
|
2442
2455
|
}
|
|
2443
2456
|
@property --tw-skew-x {
|
|
2444
2457
|
syntax: "*";
|
|
2445
2458
|
inherits: false;
|
|
2446
|
-
initial-value: skewX(0);
|
|
2447
2459
|
}
|
|
2448
2460
|
@property --tw-skew-y {
|
|
2449
2461
|
syntax: "*";
|
|
2450
2462
|
inherits: false;
|
|
2451
|
-
initial-value: skewY(0);
|
|
2452
2463
|
}
|
|
2453
2464
|
@property --tw-divide-y-reverse {
|
|
2454
2465
|
syntax: "*";
|
|
@@ -2791,11 +2802,11 @@
|
|
|
2791
2802
|
--tw-scale-x: 1;
|
|
2792
2803
|
--tw-scale-y: 1;
|
|
2793
2804
|
--tw-scale-z: 1;
|
|
2794
|
-
--tw-rotate-x:
|
|
2795
|
-
--tw-rotate-y:
|
|
2796
|
-
--tw-rotate-z:
|
|
2797
|
-
--tw-skew-x:
|
|
2798
|
-
--tw-skew-y:
|
|
2805
|
+
--tw-rotate-x: initial;
|
|
2806
|
+
--tw-rotate-y: initial;
|
|
2807
|
+
--tw-rotate-z: initial;
|
|
2808
|
+
--tw-skew-x: initial;
|
|
2809
|
+
--tw-skew-y: initial;
|
|
2799
2810
|
--tw-divide-y-reverse: 0;
|
|
2800
2811
|
--tw-border-style: solid;
|
|
2801
2812
|
--tw-font-weight: initial;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/theme/typography/styles.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCxB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDvB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CACzD;AAED,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/theme/typography/styles.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCxB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDvB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CACzD;AAED,eAAO,MAAM,OAAO,EAAE,MA+TrB,CAAC"}
|
|
@@ -262,7 +262,7 @@ export const DEFAULT = {
|
|
|
262
262
|
h1: {
|
|
263
263
|
color: 'var(--tw-prose-headings)',
|
|
264
264
|
fontWeight: '800',
|
|
265
|
-
fontSize:
|
|
265
|
+
fontSize: 'var(--text-3xl)',
|
|
266
266
|
marginTop: '0',
|
|
267
267
|
marginBottom: em(32, 36),
|
|
268
268
|
lineHeight: round(40 / 36),
|
|
@@ -362,6 +362,7 @@ export const DEFAULT = {
|
|
|
362
362
|
},
|
|
363
363
|
'h1 code': {
|
|
364
364
|
color: 'inherit',
|
|
365
|
+
fontSize: 'var(--text-2xl)',
|
|
365
366
|
},
|
|
366
367
|
'h2 code': {
|
|
367
368
|
color: 'inherit',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.8",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -68,36 +68,36 @@
|
|
|
68
68
|
"css/*"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@radix-ui/react-accordion": "^1.2.
|
|
72
|
-
"@radix-ui/react-collapsible": "^1.1.
|
|
73
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
74
|
-
"@radix-ui/react-direction": "^1.1.
|
|
75
|
-
"@radix-ui/react-navigation-menu": "^1.2.
|
|
76
|
-
"@radix-ui/react-popover": "^1.1.
|
|
77
|
-
"@radix-ui/react-scroll-area": "^1.2.
|
|
78
|
-
"@radix-ui/react-slot": "^1.
|
|
79
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
71
|
+
"@radix-ui/react-accordion": "^1.2.4",
|
|
72
|
+
"@radix-ui/react-collapsible": "^1.1.4",
|
|
73
|
+
"@radix-ui/react-dialog": "^1.1.7",
|
|
74
|
+
"@radix-ui/react-direction": "^1.1.1",
|
|
75
|
+
"@radix-ui/react-navigation-menu": "^1.2.6",
|
|
76
|
+
"@radix-ui/react-popover": "^1.1.7",
|
|
77
|
+
"@radix-ui/react-scroll-area": "^1.2.4",
|
|
78
|
+
"@radix-ui/react-slot": "^1.2.0",
|
|
79
|
+
"@radix-ui/react-tabs": "^1.1.4",
|
|
80
80
|
"class-variance-authority": "^0.7.1",
|
|
81
81
|
"lodash.merge": "^4.6.2",
|
|
82
|
-
"lucide-react": "^0.
|
|
82
|
+
"lucide-react": "^0.488.0",
|
|
83
83
|
"next-themes": "^0.4.6",
|
|
84
84
|
"postcss-selector-parser": "^7.1.0",
|
|
85
85
|
"react-medium-image-zoom": "^5.2.14",
|
|
86
86
|
"tailwind-merge": "^3.2.0",
|
|
87
|
-
"fumadocs-core": "15.2.
|
|
87
|
+
"fumadocs-core": "15.2.8"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@next/eslint-plugin-next": "^15.
|
|
91
|
-
"@tailwindcss/cli": "^4.1.
|
|
90
|
+
"@next/eslint-plugin-next": "^15.3.1",
|
|
91
|
+
"@tailwindcss/cli": "^4.1.4",
|
|
92
92
|
"@types/lodash.merge": "^4.6.9",
|
|
93
|
-
"@types/react": "^19.1.
|
|
94
|
-
"@types/react-dom": "^19.1.
|
|
95
|
-
"next": "15.
|
|
96
|
-
"tailwindcss": "^4.1.
|
|
97
|
-
"tsc-alias": "^1.8.
|
|
93
|
+
"@types/react": "^19.1.2",
|
|
94
|
+
"@types/react-dom": "^19.1.2",
|
|
95
|
+
"next": "15.3.1",
|
|
96
|
+
"tailwindcss": "^4.1.4",
|
|
97
|
+
"tsc-alias": "^1.8.15",
|
|
98
98
|
"@fumadocs/cli": "0.1.1",
|
|
99
|
+
"fumadocs-core": "15.2.8",
|
|
99
100
|
"eslint-config-custom": "0.0.0",
|
|
100
|
-
"fumadocs-core": "15.2.6",
|
|
101
101
|
"tsconfig": "0.0.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|