fumadocs-ui 14.6.3 → 14.6.4
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/layouts/docs/shared.d.ts +3 -1
- package/dist/layouts/docs/shared.d.ts.map +1 -1
- package/dist/layouts/docs/shared.js +46 -1
- package/dist/layouts/docs.d.ts +2 -2
- package/dist/layouts/docs.d.ts.map +1 -1
- package/dist/layouts/docs.js +1 -2
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +1 -1
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +4 -1
- package/dist/style.css +4 -6
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +1 -6
- package/package.json +4 -4
- package/dist/utils/get-sidebar-tabs.d.ts +0 -7
- package/dist/utils/get-sidebar-tabs.d.ts.map +0 -1
- package/dist/utils/get-sidebar-tabs.js +0 -47
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { type LinkItemType } from '../../layouts/links';
|
|
2
2
|
import { type SidebarProps } from '../../layouts/docs/sidebar';
|
|
3
3
|
import type { PageTree } from 'fumadocs-core/server';
|
|
4
|
-
import { type TabOptions } from '../../utils/get-sidebar-tabs';
|
|
5
4
|
import type { FC, ReactNode } from 'react';
|
|
6
5
|
import type { Option } from '../../components/layout/root-toggle';
|
|
7
6
|
export declare const layoutVariables: {
|
|
8
7
|
'--fd-layout-offset': string;
|
|
9
8
|
};
|
|
9
|
+
export interface TabOptions {
|
|
10
|
+
transform?: (option: Option, node: PageTree.Folder) => Option | null;
|
|
11
|
+
}
|
|
10
12
|
export interface SidebarOptions extends SidebarProps {
|
|
11
13
|
enabled: boolean;
|
|
12
14
|
component: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,iBAAi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AE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,SAAS,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CAC7C;AAED,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,2UA+C/D;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,wBASpB"}
|
|
@@ -3,7 +3,6 @@ import { BaseLinkItem } from '../../layouts/links';
|
|
|
3
3
|
import { SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, } from '../../layouts/docs/sidebar';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
5
|
import { buttonVariants } from '../../components/ui/button';
|
|
6
|
-
import { getSidebarTabs } from '../../utils/get-sidebar-tabs';
|
|
7
6
|
export const layoutVariables = {
|
|
8
7
|
'--fd-layout-offset': 'max(calc(50vw - var(--fd-layout-width) / 2), 0px)',
|
|
9
8
|
};
|
|
@@ -31,3 +30,49 @@ export function getSidebarTabsFromOptions(options, tree) {
|
|
|
31
30
|
return getSidebarTabs(tree);
|
|
32
31
|
}
|
|
33
32
|
}
|
|
33
|
+
const defaultTransform = (option, node) => {
|
|
34
|
+
if (!node.icon)
|
|
35
|
+
return option;
|
|
36
|
+
return {
|
|
37
|
+
...option,
|
|
38
|
+
icon: (_jsx("div", { className: "rounded-md border bg-fd-secondary p-1 shadow-md [&_svg]:size-5", children: node.icon })),
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
function getSidebarTabs(pageTree, { transform = defaultTransform } = {}) {
|
|
42
|
+
function findOptions(node) {
|
|
43
|
+
const results = [];
|
|
44
|
+
if (node.root) {
|
|
45
|
+
const index = node.index ?? node.children.at(0);
|
|
46
|
+
if (index?.type === 'page') {
|
|
47
|
+
const option = {
|
|
48
|
+
url: index.url,
|
|
49
|
+
title: node.name,
|
|
50
|
+
icon: node.icon,
|
|
51
|
+
description: node.description,
|
|
52
|
+
urls: getFolderUrls(node),
|
|
53
|
+
};
|
|
54
|
+
const mapped = transform ? transform(option, node) : option;
|
|
55
|
+
if (mapped)
|
|
56
|
+
results.push(mapped);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
for (const child of node.children) {
|
|
60
|
+
if (child.type === 'folder')
|
|
61
|
+
results.push(...findOptions(child));
|
|
62
|
+
}
|
|
63
|
+
return results;
|
|
64
|
+
}
|
|
65
|
+
return findOptions(pageTree);
|
|
66
|
+
}
|
|
67
|
+
function getFolderUrls(folder) {
|
|
68
|
+
const results = [];
|
|
69
|
+
if (folder.index)
|
|
70
|
+
results.push(folder.index.url);
|
|
71
|
+
for (const child of folder.children) {
|
|
72
|
+
if (child.type === 'page')
|
|
73
|
+
results.push(child.url);
|
|
74
|
+
if (child.type === 'folder')
|
|
75
|
+
results.push(...getFolderUrls(child));
|
|
76
|
+
}
|
|
77
|
+
return results;
|
|
78
|
+
}
|
package/dist/layouts/docs.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PageTree } from 'fumadocs-core/server';
|
|
2
2
|
import { type ReactNode, type HTMLAttributes } from 'react';
|
|
3
3
|
import { type LinkItemType } from '../layouts/links';
|
|
4
|
-
import { getSidebarTabs, type TabOptions } from '../utils/get-sidebar-tabs';
|
|
5
4
|
import { type BaseLayoutProps } from './shared';
|
|
6
5
|
import { type SidebarOptions } from '../layouts/docs/shared';
|
|
7
6
|
export interface DocsLayoutProps extends BaseLayoutProps {
|
|
@@ -10,5 +9,6 @@ export interface DocsLayoutProps extends BaseLayoutProps {
|
|
|
10
9
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
11
10
|
}
|
|
12
11
|
export declare function DocsLayout({ nav: { enabled: navEnabled, component: navReplace, transparentMode, ...nav }, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar }, i18n, ...props }: DocsLayoutProps): ReactNode;
|
|
13
|
-
export {
|
|
12
|
+
export { getSidebarTabsFromOptions, type TabOptions } from './docs/shared';
|
|
13
|
+
export { type LinkItemType };
|
|
14
14
|
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5D,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAe5D,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAc1D,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAI/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EACH,OAAO,EAAE,UAAiB,EAC1B,SAAS,EAAE,UAAU,EACrB,eAAe,EACf,GAAG,GAAG,EACF,EACN,OAAO,EAAE,EACP,OAAO,EAAE,cAAqB,EAC9B,WAAkB,EAClB,SAAS,EAAE,cAAc,EACzB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CA2G7B;AA0FD,OAAO,EAAE,yBAAyB,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -6,7 +6,6 @@ import { buttonVariants } from '../components/ui/button';
|
|
|
6
6
|
import { CollapsibleSidebar, Sidebar, SidebarFooter, SidebarHeader, SidebarCollapseTrigger, SidebarViewport, SidebarPageTree, } from '../layouts/docs/sidebar';
|
|
7
7
|
import { replaceOrDefault } from '../layouts/shared';
|
|
8
8
|
import { BaseLinkItem, } from '../layouts/links';
|
|
9
|
-
import { getSidebarTabs } from '../utils/get-sidebar-tabs';
|
|
10
9
|
import { RootToggle } from '../components/layout/root-toggle';
|
|
11
10
|
import { getLinks } from './shared';
|
|
12
11
|
import { LanguageToggle, LanguageToggleText, } from '../components/layout/language-toggle';
|
|
@@ -62,4 +61,4 @@ function SidebarFooterItems({ iconItems, i18n, sidebarCollapsible, disableThemeS
|
|
|
62
61
|
return null;
|
|
63
62
|
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:hidden'), "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 md:order-first" })) : null, sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: "-me-1.5 max-md:hidden" })) : null] }));
|
|
64
63
|
}
|
|
65
|
-
export {
|
|
64
|
+
export { getSidebarTabsFromOptions } from './docs/shared';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AA+B1B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AA+B1B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CA+E7B"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -34,7 +34,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { c
|
|
|
34
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-[var(--fd-layout-offset)]', variables, props.containerProps?.className), style: {
|
|
35
35
|
...layoutVariables,
|
|
36
36
|
...props.containerProps?.style,
|
|
37
|
-
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-[var(--fd-layout-offset)] md:[--fd-nav-height:0px]', sidebar.className), children: [_jsxs(SidebarHeader, { children: [_jsxs(SidebarHeaderItems, { nav: nav, links: links, children: [nav.children, sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: "ms-auto text-fd-muted-foreground" })) : null] }), sidebarBanner, tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null] }), _jsxs(SidebarViewport, { children: [_jsx("div", { className: "pt-4 empty:hidden lg:hidden", children: links.map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx("div", { className: "py-4", children: _jsx(SidebarPageTree, { components: sidebarComponents }) })] }),
|
|
37
|
+
}, children: [_jsxs(Aside, { ...sidebar, className: cn('md:ps-[var(--fd-layout-offset)] md:[--fd-nav-height:0px]', sidebar.className), children: [_jsxs(SidebarHeader, { children: [_jsxs(SidebarHeaderItems, { nav: nav, links: links, children: [nav.children, sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: "ms-auto text-fd-muted-foreground" })) : null] }), sidebarBanner, tabs.length > 0 ? (_jsx(RootToggle, { options: tabs, className: "-mx-2" })) : null] }), _jsxs(SidebarViewport, { children: [_jsx("div", { className: "pt-4 empty:hidden lg:hidden", children: links.map((item, i) => (_jsx(SidebarLinkItem, { item: item }, i))) }), _jsx("div", { className: "py-4", children: _jsx(SidebarPageTree, { components: sidebarComponents }) })] }), _jsxs(SidebarFooter, { className: cn(!sidebarFooter && 'md:hidden'), children: [!props.disableThemeSwitch ? (_jsx(ThemeToggle, { className: "w-fit md:hidden" })) : null, sidebarFooter] })] }), _jsx(DocsNavbar, { nav: nav, links: links, i18n: i18n, sidebarCollapsible: sidebarCollapsible }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
|
|
38
38
|
}
|
|
39
39
|
function DocsNavbar({ sidebarCollapsible, links, nav = {}, i18n, }) {
|
|
40
40
|
return (_jsxs(Navbar, { children: [sidebarCollapsible ? (_jsx(SidebarCollapseTrigger, { className: "-ms-1.5 text-fd-muted-foreground data-[collapsed=false]:hidden max-md:hidden" })) : null, _jsx(SearchOnly, { children: _jsx(LargeSearchToggle, { className: "w-full max-w-[240px] rounded-lg max-md:hidden" }) }), _jsx(Title, { url: nav.url, title: nav.title, className: "md:hidden" }), _jsxs("div", { className: "flex flex-1 flex-row items-center gap-6 px-2", children: [links
|
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,EAML,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AAMjC,KAAK,qBAAqB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,UAAU,CAAC,GAC/D,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEJ,KAAK,4BAA4B,GAAG,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAE1E,UAAU,mBACR,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,GAAG,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IAAI,EACJ,IAAI,EAAE,UAAU,EAChB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC;CACtB,kDAmCA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAM5E"}
|
package/dist/page.js
CHANGED
|
@@ -40,7 +40,10 @@ function EditOnGitHub({ owner, repo, sha, path, ...props }) {
|
|
|
40
40
|
/**
|
|
41
41
|
* Add typography styles
|
|
42
42
|
*/
|
|
43
|
-
export const DocsBody = forwardRef((
|
|
43
|
+
export const DocsBody = forwardRef((props, ref) => (_jsx("div", { ref: ref, ...props, className: cn('prose contain-content', props.className), style: {
|
|
44
|
+
contentVisibility: 'auto',
|
|
45
|
+
...props.style,
|
|
46
|
+
} })));
|
|
44
47
|
DocsBody.displayName = 'DocsBody';
|
|
45
48
|
export const DocsDescription = forwardRef((props, ref) => {
|
|
46
49
|
// don't render if no description provided
|
package/dist/style.css
CHANGED
|
@@ -505,7 +505,7 @@ video {
|
|
|
505
505
|
--foreground: 0 0% 3.9%;
|
|
506
506
|
--muted: 0 0% 96.1%;
|
|
507
507
|
--muted-foreground: 0 0% 45.1%;
|
|
508
|
-
--popover: 0 0%
|
|
508
|
+
--popover: 0 0% 98%;
|
|
509
509
|
--popover-foreground: 0 0% 15.1%;
|
|
510
510
|
--card: 0 0% 94.7%;
|
|
511
511
|
--card-foreground: 0 0% 3.9%;
|
|
@@ -987,11 +987,6 @@ body {
|
|
|
987
987
|
border-bottom-width: 1px;
|
|
988
988
|
border-bottom-color: var(--tw-prose-th-borders);
|
|
989
989
|
}
|
|
990
|
-
#nd-sidebar {
|
|
991
|
-
--muted: 0deg 0% 89%;
|
|
992
|
-
--secondary: 0deg 0% 99%;
|
|
993
|
-
--muted-foreground: 0 0% 30%;
|
|
994
|
-
}
|
|
995
990
|
.dark #nd-sidebar {
|
|
996
991
|
--muted: 0deg 0% 16%;
|
|
997
992
|
--secondary: 0deg 0% 18%;
|
|
@@ -1868,6 +1863,9 @@ body {
|
|
|
1868
1863
|
.ease-out {
|
|
1869
1864
|
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
1870
1865
|
}
|
|
1866
|
+
.contain-content {
|
|
1867
|
+
contain: content;
|
|
1868
|
+
}
|
|
1871
1869
|
.steps {
|
|
1872
1870
|
counter-reset: step;
|
|
1873
1871
|
border-left-width: 1px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/theme/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/theme/colors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAoUhD,eAAO,MAAM,OAAO;;;;;;;;;CASnB,CAAC"}
|
package/dist/theme/colors.js
CHANGED
|
@@ -86,7 +86,7 @@ const neutral = {
|
|
|
86
86
|
foreground: '0 0% 3.9%',
|
|
87
87
|
muted: '0 0% 96.1%',
|
|
88
88
|
'muted-foreground': '0 0% 45.1%',
|
|
89
|
-
popover: '0 0%
|
|
89
|
+
popover: '0 0% 98%',
|
|
90
90
|
'popover-foreground': '0 0% 15.1%',
|
|
91
91
|
card: '0 0% 94.7%',
|
|
92
92
|
'card-foreground': '0 0% 3.9%',
|
|
@@ -118,11 +118,6 @@ const neutral = {
|
|
|
118
118
|
ring: '0 0% 14.9%',
|
|
119
119
|
},
|
|
120
120
|
css: {
|
|
121
|
-
'#nd-sidebar': {
|
|
122
|
-
'--muted': '0deg 0% 89%',
|
|
123
|
-
'--secondary': '0deg 0% 99%',
|
|
124
|
-
'--muted-foreground': '0 0% 30%',
|
|
125
|
-
},
|
|
126
121
|
'.dark #nd-sidebar': {
|
|
127
122
|
'--muted': '0deg 0% 16%',
|
|
128
123
|
'--secondary': '0deg 0% 18%',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "14.6.
|
|
3
|
+
"version": "14.6.4",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"postcss-selector-parser": "^7.0.0",
|
|
69
69
|
"react-medium-image-zoom": "^5.2.12",
|
|
70
70
|
"tailwind-merge": "^2.5.5",
|
|
71
|
-
"fumadocs-core": "14.6.
|
|
71
|
+
"fumadocs-core": "14.6.4"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@next/eslint-plugin-next": "^15.1.2",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"postcss-cli": "^11.0.0",
|
|
82
82
|
"tailwindcss": "^3.4.17",
|
|
83
83
|
"tsc-alias": "^1.8.10",
|
|
84
|
-
"@fumadocs/cli": "0.0.4",
|
|
85
84
|
"tsconfig": "0.0.0",
|
|
86
|
-
"eslint-config-custom": "0.0.0"
|
|
85
|
+
"eslint-config-custom": "0.0.0",
|
|
86
|
+
"@fumadocs/cli": "0.0.4"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"next": "14.x.x || 15.x.x",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PageTree } from 'fumadocs-core/server';
|
|
2
|
-
import type { Option } from '../components/layout/root-toggle';
|
|
3
|
-
export interface TabOptions {
|
|
4
|
-
transform?: (option: Option, node: PageTree.Folder) => Option | null;
|
|
5
|
-
}
|
|
6
|
-
export declare function getSidebarTabs(pageTree: PageTree.Root, { transform }?: TabOptions): Option[];
|
|
7
|
-
//# sourceMappingURL=get-sidebar-tabs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-sidebar-tabs.d.ts","sourceRoot":"","sources":["../../src/utils/get-sidebar-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACtE;AAeD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,CAAC,IAAI,EACvB,EAAE,SAA4B,EAAE,GAAE,UAAe,GAChD,MAAM,EAAE,CA8BV"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
const defaultTransform = (option, node) => {
|
|
3
|
-
if (!node.icon)
|
|
4
|
-
return option;
|
|
5
|
-
return {
|
|
6
|
-
...option,
|
|
7
|
-
icon: (_jsx("div", { className: "rounded-md border bg-fd-secondary p-1 shadow-md [&_svg]:size-5", children: node.icon })),
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export function getSidebarTabs(pageTree, { transform = defaultTransform } = {}) {
|
|
11
|
-
function findOptions(node) {
|
|
12
|
-
const results = [];
|
|
13
|
-
if (node.root) {
|
|
14
|
-
const index = node.index ?? node.children.at(0);
|
|
15
|
-
if (index?.type === 'page') {
|
|
16
|
-
const option = {
|
|
17
|
-
url: index.url,
|
|
18
|
-
title: node.name,
|
|
19
|
-
icon: node.icon,
|
|
20
|
-
description: node.description,
|
|
21
|
-
urls: getFolderUrls(node),
|
|
22
|
-
};
|
|
23
|
-
const mapped = transform ? transform(option, node) : option;
|
|
24
|
-
if (mapped)
|
|
25
|
-
results.push(mapped);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
for (const child of node.children) {
|
|
29
|
-
if (child.type === 'folder')
|
|
30
|
-
results.push(...findOptions(child));
|
|
31
|
-
}
|
|
32
|
-
return results;
|
|
33
|
-
}
|
|
34
|
-
return findOptions(pageTree);
|
|
35
|
-
}
|
|
36
|
-
function getFolderUrls(folder) {
|
|
37
|
-
const results = [];
|
|
38
|
-
if (folder.index)
|
|
39
|
-
results.push(folder.index.url);
|
|
40
|
-
for (const child of folder.children) {
|
|
41
|
-
if (child.type === 'page')
|
|
42
|
-
results.push(child.url);
|
|
43
|
-
if (child.type === 'folder')
|
|
44
|
-
results.push(...getFolderUrls(child));
|
|
45
|
-
}
|
|
46
|
-
return results;
|
|
47
|
-
}
|