fumadocs-ui 15.6.8 → 15.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/codeblock.d.ts +1 -1
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +2 -1
- package/dist/components/dialog/search-algolia.d.ts +2 -1
- package/dist/components/dialog/search-algolia.d.ts.map +1 -1
- package/dist/components/dialog/search-default.d.ts +2 -1
- package/dist/components/dialog/search-default.d.ts.map +1 -1
- package/dist/components/dialog/search-orama.d.ts +2 -1
- package/dist/components/dialog/search-orama.d.ts.map +1 -1
- package/dist/components/dialog/search.d.ts +4 -1
- package/dist/components/dialog/search.d.ts.map +1 -1
- package/dist/components/dialog/search.js +12 -2
- package/dist/components/layout/root-toggle.js +3 -3
- package/dist/components/layout/sidebar.d.ts +1 -0
- package/dist/components/layout/sidebar.d.ts.map +1 -1
- package/dist/components/layout/sidebar.js +4 -0
- package/dist/contexts/search.d.ts.map +1 -1
- package/dist/contexts/search.js +5 -1
- package/dist/layouts/docs/page-client.d.ts +0 -1
- package/dist/layouts/docs/page-client.d.ts.map +1 -1
- package/dist/layouts/docs/page-client.js +6 -16
- package/dist/layouts/docs/page.d.ts +3 -2
- package/dist/layouts/docs/page.d.ts.map +1 -1
- package/dist/layouts/docs/page.js +6 -3
- package/dist/layouts/docs-client.d.ts +0 -1
- package/dist/layouts/docs-client.d.ts.map +1 -1
- package/dist/layouts/docs-client.js +5 -8
- package/dist/layouts/docs.d.ts +2 -1
- package/dist/layouts/docs.d.ts.map +1 -1
- package/dist/layouts/docs.js +6 -7
- package/dist/layouts/notebook-client.d.ts.map +1 -1
- package/dist/layouts/notebook-client.js +5 -4
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +7 -3
- package/dist/mdx.d.ts +1 -1
- package/dist/style.css +14 -11
- package/package.json +6 -6
|
@@ -38,5 +38,5 @@ export declare function CodeBlock({ ref, title, allowCopy, keepBackground, icon,
|
|
|
38
38
|
export declare function CodeBlockTabs({ ref, ...props }: ComponentProps<typeof Tabs>): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
export declare function CodeBlockTabsList(props: ComponentProps<typeof TabsList>): import("react/jsx-runtime").JSX.Element;
|
|
40
40
|
export declare function CodeBlockTabsTrigger({ children, ...props }: ComponentProps<typeof TabsTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export declare const CodeBlockTab:
|
|
41
|
+
export declare const CodeBlockTab: typeof TabsContent;
|
|
42
42
|
//# sourceMappingURL=codeblock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IAE5C;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,KAAK,SAAS,CAAC;CAC9E;AAOD,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CA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SAAS,CAAC;CAC9E;AAOD,wBAAgB,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAS/C;AAED,wBAAgB,SAAS,CAAC,EACxB,GAAG,EACH,KAAK,EACL,SAAS,EACT,cAAsB,EACtB,IAAI,EACJ,aAAkB,EAClB,QAAQ,EACR,OAEC,EACD,GAAG,KAAK,EACT,EAAE,cAAc,2CAwEhB;AAwCD,wBAAgB,aAAa,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,2CA2B3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,2CAoBvE;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,WAAW,CAAC,2CAapC;AAGD,eAAO,MAAM,YAAY,oBAAc,CAAC"}
|
|
@@ -63,4 +63,5 @@ export function CodeBlockTabsList(props) {
|
|
|
63
63
|
export function CodeBlockTabsTrigger({ children, ...props }) {
|
|
64
64
|
return (_jsxs(TabsTrigger, { ...props, className: cn('relative group inline-flex text-sm font-medium text-nowrap items-center gap-2 px-2 first:ms-1 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5', props.className), children: [_jsx("div", { className: "absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary" }), children] }));
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
// TODO: currently Vite RSC plugin has problem with adding `asChild` here, maybe revisit this in future
|
|
67
|
+
export const CodeBlockTab = TabsContent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type AlgoliaOptions } from 'fumadocs-core/search/client';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { type SharedProps } from './search.js';
|
|
4
|
+
import type { SearchLink, TagItem } from '../../contexts/search.js';
|
|
4
5
|
export interface AlgoliaSearchDialogProps extends SharedProps {
|
|
5
6
|
searchOptions: AlgoliaOptions;
|
|
6
7
|
links?: SearchLink[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-algolia.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-algolia.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"search-algolia.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-algolia.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,OAAO,EAYL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,aAAa,EAAE,cAAc,CAAC;IAC9B,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,aAAa,EACb,IAAS,EACT,UAAU,EACV,WAAmB,EACnB,UAAkB,EAClB,KAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,wBAAwB,2CA4D1B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { type SharedProps } from './search.js';
|
|
3
|
+
import type { SearchLink, TagItem } from '../../contexts/search.js';
|
|
3
4
|
export interface DefaultSearchDialogProps extends SharedProps {
|
|
4
5
|
links?: SearchLink[];
|
|
5
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-default.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-default.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"search-default.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-default.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAG1D,OAAO,EAYL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IAEjB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,UAAU,EACV,IAAS,EACT,GAAG,EACH,OAAO,EACP,IAAc,EACd,UAAkB,EAClB,KAAU,EACV,MAAM,EACN,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAkE1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type OramaCloudOptions } from 'fumadocs-core/search/client';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { type SharedProps } from './search.js';
|
|
4
|
+
import type { SearchLink, TagItem } from '../../contexts/search.js';
|
|
4
5
|
export interface OramaSearchDialogProps extends SharedProps {
|
|
5
6
|
links?: SearchLink[];
|
|
6
7
|
client: OramaCloudOptions['client'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-orama.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-orama.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"search-orama.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search-orama.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,OAAO,EAYL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAEnC,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,MAAM,EACN,aAAa,EACb,IAAS,EACT,UAAU,EACV,SAAiB,EACjB,UAAkB,EAClB,KAAK,EACL,MAAM,EACN,KAAU,EACV,GAAG,KAAK,EACT,EAAE,sBAAsB,2CAgExB"}
|
|
@@ -2,6 +2,7 @@ import { type ComponentProps, type ReactNode } from 'react';
|
|
|
2
2
|
import { DialogContent, DialogOverlay } from '@radix-ui/react-dialog';
|
|
3
3
|
import type { SortedResult } from 'fumadocs-core/server';
|
|
4
4
|
import type { SharedProps } from '../../contexts/search.js';
|
|
5
|
+
import type { HighlightedText } from 'fumadocs-core/search/server';
|
|
5
6
|
type ReactSortedResult = Omit<SortedResult, 'content'> & {
|
|
6
7
|
external?: boolean;
|
|
7
8
|
content: ReactNode;
|
|
@@ -34,7 +35,8 @@ export declare function SearchDialogList({ items, Empty, Item, ...props }: Omit<
|
|
|
34
35
|
onClick: () => void;
|
|
35
36
|
}) => ReactNode;
|
|
36
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export declare function SearchDialogListItem({ item, className, children, ...props }: ComponentProps<'button'> & {
|
|
38
|
+
export declare function SearchDialogListItem({ item, className, children, renderHighlights: render, ...props }: ComponentProps<'button'> & {
|
|
39
|
+
renderHighlights?: typeof renderHighlights;
|
|
38
40
|
item: ReactSortedResult;
|
|
39
41
|
}): import("react/jsx-runtime").JSX.Element;
|
|
40
42
|
export declare function SearchDialogIcon(props: ComponentProps<'svg'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -47,6 +49,7 @@ export declare function TagsList({ tag, onTagChange, allowClear, ...props }: Tag
|
|
|
47
49
|
export declare function TagsListItem({ value, className, ...props }: ComponentProps<'button'> & {
|
|
48
50
|
value: string;
|
|
49
51
|
}): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare function renderHighlights(highlights: HighlightedText[]): ReactNode;
|
|
50
53
|
export declare function useSearch(): {
|
|
51
54
|
open: boolean;
|
|
52
55
|
onOpenChange: (open: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,aAAa,EACb,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,aAAa,EACb,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,KAAK,iBAAiB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAGF,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAsB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IAC5B,gBAAgB,CAAC,EAAE,OAAO,gBAAgB,CAAC;IAC3C,IAAI,EAAE,iBAAiB,CAAC;CACzB,2CAkDA;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAa5D;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAaD,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,WAAW,EACX,UAAkB,EAClB,GAAG,KAAK,EACT,EAAE,aAAa,2CAoBf;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,2CAkBA;AAED,iBAAS,gBAAgB,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,SAAS,CAYlE;AAED,wBAAgB,SAAS;UAnbjB,OAAO;kBACC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;YAC7B,MAAM;oBACE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;eAExB,OAAO;EAkbnB;AAED,wBAAgB,WAAW;YA3ajB,MAAM;mBACC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI;gBACtC,OAAO;EA6apB;AAED,wBAAgB,aAAa;YAtbnB,MAAM,GAAG,IAAI;eACV,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;EAybtC"}
|
|
@@ -117,7 +117,7 @@ const icons = {
|
|
|
117
117
|
heading: _jsx(Hash, { className: "size-4 shrink-0 text-fd-muted-foreground" }),
|
|
118
118
|
page: (_jsx(FileText, { className: "size-6 text-fd-muted-foreground bg-fd-muted border p-0.5 rounded-sm shadow-sm shrink-0" })),
|
|
119
119
|
};
|
|
120
|
-
export function SearchDialogListItem({ item, className, children, ...props }) {
|
|
120
|
+
export function SearchDialogListItem({ item, className, children, renderHighlights: render = renderHighlights, ...props }) {
|
|
121
121
|
const { active: activeId, setActive } = useSearchList();
|
|
122
122
|
const active = item.id === activeId;
|
|
123
123
|
return (_jsx("button", { type: "button", ref: useCallback((element) => {
|
|
@@ -130,7 +130,9 @@ export function SearchDialogListItem({ item, className, children, ...props }) {
|
|
|
130
130
|
}
|
|
131
131
|
}, [active]), "aria-selected": active, className: cn('relative flex select-none flex-row items-center gap-2 p-2 text-start text-sm rounded-lg', item.type !== 'page' && 'ps-8', item.type === 'page' || item.type === 'heading'
|
|
132
132
|
? 'font-medium'
|
|
133
|
-
: 'text-fd-popover-foreground/80', active && 'bg-fd-accent text-fd-accent-foreground', className), onPointerMove: () => setActive(item.id), ...props, children: children ?? (_jsxs(_Fragment, { children: [item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-4.5 inset-y-0 w-px bg-fd-border" })), icons[item.type], _jsx("p", { className: "min-w-0 truncate", children: item.
|
|
133
|
+
: 'text-fd-popover-foreground/80', active && 'bg-fd-accent text-fd-accent-foreground', className), onPointerMove: () => setActive(item.id), ...props, children: children ?? (_jsxs(_Fragment, { children: [item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-4.5 inset-y-0 w-px bg-fd-border" })), icons[item.type], _jsx("p", { className: "min-w-0 truncate", children: item.contentWithHighlights
|
|
134
|
+
? render(item.contentWithHighlights)
|
|
135
|
+
: item.content })] })) }));
|
|
134
136
|
}
|
|
135
137
|
export function SearchDialogIcon(props) {
|
|
136
138
|
const { isLoading } = useSearch();
|
|
@@ -157,6 +159,14 @@ export function TagsListItem({ value, className, ...props }) {
|
|
|
157
159
|
onValueChange(selected && allowClear ? undefined : value);
|
|
158
160
|
}, tabIndex: -1, ...props, children: props.children }));
|
|
159
161
|
}
|
|
162
|
+
function renderHighlights(highlights) {
|
|
163
|
+
return highlights.map((node, i) => {
|
|
164
|
+
if (node.styles?.highlight) {
|
|
165
|
+
return (_jsx("span", { className: "text-fd-primary bg-fd-primary/10", children: node.content }, i));
|
|
166
|
+
}
|
|
167
|
+
return _jsx(Fragment, { children: node.content }, i);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
160
170
|
export function useSearch() {
|
|
161
171
|
const ctx = useContext(Context);
|
|
162
172
|
if (!ctx)
|
|
@@ -24,9 +24,9 @@ export function RootToggle({ options, placeholder, ...props }) {
|
|
|
24
24
|
closeOnRedirect.current = false;
|
|
25
25
|
setOpen(false);
|
|
26
26
|
};
|
|
27
|
-
const item = selected ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "size-9 md:size-5", children: selected.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: selected.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden md:hidden", children: selected.description })] })] })) : (placeholder);
|
|
28
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [item && (_jsxs(PopoverTrigger, { ...props, className: cn('flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-start text-fd-secondary-foreground transition-colors hover:bg-fd-accent data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground', props.className), children: [item, _jsx(ChevronsUpDown, { className: "ms-auto size-4 text-fd-muted-foreground" })] })), _jsx(PopoverContent, { className: "flex flex-col gap-1
|
|
27
|
+
const item = selected ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "size-9 shrink-0 md:size-5", children: selected.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: selected.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden md:hidden", children: selected.description })] })] })) : (placeholder);
|
|
28
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [item && (_jsxs(PopoverTrigger, { ...props, className: cn('flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-start text-fd-secondary-foreground transition-colors hover:bg-fd-accent data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground', props.className), children: [item, _jsx(ChevronsUpDown, { className: "shrink-0 ms-auto size-4 text-fd-muted-foreground" })] })), _jsx(PopoverContent, { className: "flex flex-col gap-1 w-(--radix-popover-trigger-width) overflow-hidden p-1", children: options.map((item) => {
|
|
29
29
|
const isActive = item === selected;
|
|
30
|
-
return (_jsxs(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground', item.props?.className), children: [_jsx("div", { className: "
|
|
30
|
+
return (_jsxs(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground', item.props?.className), children: [_jsx("div", { className: "shrink-0 size-9 md:mt-1 md:mb-auto md:size-5", children: item.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: item.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden", children: item.description })] }), _jsx(Check, { className: cn('shrink-0 ms-auto size-3.5 text-fd-primary', !isActive && 'invisible') })] }, item.url));
|
|
31
31
|
}) })] }));
|
|
32
32
|
}
|
|
@@ -42,6 +42,7 @@ export declare function SidebarFolder({ defaultOpen, ...props }: ComponentProps<
|
|
|
42
42
|
export declare function SidebarFolderTrigger({ className, ...props }: CollapsibleTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
export declare function SidebarFolderLink(props: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
export declare function SidebarFolderContent(props: CollapsibleContentProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function SidebarTrigger({ children, ...props }: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
45
46
|
export declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
46
47
|
export interface SidebarComponents {
|
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AK,CAAC,GAAG;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,2CAgBA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAezB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,2CAiCjD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAoClE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAY1B;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrE;AAgBD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAA;KAAE,CAAC,CAAC;IAClC,MAAM,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAC1E,SAAS,EAAE,EAAE,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CAC7C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACzC,2CAuDA"}
|
|
@@ -145,6 +145,10 @@ export function SidebarFolderContent(props) {
|
|
|
145
145
|
level,
|
|
146
146
|
}), [ctx, level]), children: props.children })] }));
|
|
147
147
|
}
|
|
148
|
+
export function SidebarTrigger({ children, ...props }) {
|
|
149
|
+
const { setOpen } = useSidebar();
|
|
150
|
+
return (_jsx("button", { ...props, "aria-label": "Open Sidebar", onClick: () => setOpen((prev) => !prev), children: children }));
|
|
151
|
+
}
|
|
148
152
|
export function SidebarCollapseTrigger(props) {
|
|
149
153
|
const { collapsed, setCollapsed } = useSidebar();
|
|
150
154
|
return (_jsx("button", { type: "button", "aria-label": "Collapse Sidebar", "data-collapsed": collapsed, ...props, onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/contexts/search.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAGf,UAAU,MAAM;IACd,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEtD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;;OAIG;IACH,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;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UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAQD,wBAAgB,gBAAgB,IAAI,iBAAiB,CAEpD;AAcD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,QAAQ,EACR,OAAc,EACd,OAAO,EACP,MASC,EACD,KAAK,GACN,EAAE,mBAAmB,2CA4CrB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,aAI/D"}
|
package/dist/contexts/search.js
CHANGED
|
@@ -42,7 +42,11 @@ export function SearchProvider({ SearchDialog, children, preload = true, options
|
|
|
42
42
|
window.removeEventListener('keydown', handler);
|
|
43
43
|
};
|
|
44
44
|
}, [hotKey]);
|
|
45
|
-
return (_jsxs(SearchContext.Provider, { value: useMemo(() => ({
|
|
45
|
+
return (_jsxs(SearchContext.Provider, { value: useMemo(() => ({
|
|
46
|
+
enabled: true,
|
|
47
|
+
hotKey,
|
|
48
|
+
setOpenSearch: setIsOpen,
|
|
49
|
+
}), [hotKey]), children: [isOpen !== undefined && (_jsx(SearchDialog, { open: isOpen, onOpenChange: setIsOpen,
|
|
46
50
|
// @ts-expect-error -- insert prop for official UIs
|
|
47
51
|
links: links, ...options })), children] }));
|
|
48
52
|
}
|
|
@@ -8,7 +8,6 @@ export declare function PageTOCPopover(props: ComponentProps<'div'>): import("re
|
|
|
8
8
|
export interface RootProps extends ComponentProps<'div'> {
|
|
9
9
|
toc: Omit<AnchorProviderProps, 'children'>;
|
|
10
10
|
}
|
|
11
|
-
export declare function PageRoot({ toc, children, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
|
|
13
12
|
date: Date | string;
|
|
14
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/page-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAAE,KAAK,mBAAmB,EAAmB,MAAM,mBAAmB,CAAC;AAO9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"page-client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/page-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAAE,KAAK,mBAAmB,EAAmB,MAAM,mBAAmB,CAAC;AAO9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAoDpE;AA4DD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAUjE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAuD1D;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,KAAK,CAAC;IACtD,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CAC5C;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG;IAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,2CAiBjE;AAED,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC;AAChE,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,KAAK,CAAC;IACxD;;OAEG;IACH,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,IAAI,CAAC;KACb,CAAC;CACH;AAyBD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAiC1D;AA8BD,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExE,wBAAgB,cAAc,CAAC,EAC7B,WAAmB,EACnB,gBAAgB,EAChB,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,eAAe,kDA6CjB;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAiBnD"}
|
|
@@ -13,7 +13,7 @@ import { isActive } from '../../utils/is-active.js';
|
|
|
13
13
|
import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
|
|
14
14
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible.js';
|
|
15
15
|
import { useSidebar } from '../../contexts/sidebar.js';
|
|
16
|
-
import {
|
|
16
|
+
import { useTOCItems } from '../../components/layout/toc.js';
|
|
17
17
|
import { useActiveAnchor } from 'fumadocs-core/toc';
|
|
18
18
|
const TocPopoverContext = createContext('TocPopoverContext');
|
|
19
19
|
export function PageTOCPopoverTrigger(props) {
|
|
@@ -24,7 +24,7 @@ export function PageTOCPopoverTrigger(props) {
|
|
|
24
24
|
const selected = useMemo(() => items.findIndex((item) => active === item.url.slice(1)), [items, active]);
|
|
25
25
|
const path = useTreePath().at(-1);
|
|
26
26
|
const showItem = selected !== -1 && !open;
|
|
27
|
-
return (_jsxs(CollapsibleTrigger, { ...props, className: cn('flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:
|
|
27
|
+
return (_jsxs(CollapsibleTrigger, { ...props, className: cn('flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6', props.className), children: [_jsx(ProgressCircle, { value: (selected + 1) / Math.max(1, items.length), max: 1, className: cn('shrink-0', open && 'text-fd-primary') }), _jsxs("span", { className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1", children: [_jsx("span", { className: cn('truncate transition-all', open && 'text-fd-foreground', showItem && 'opacity-0 -translate-y-full pointer-events-none'), children: path?.name ?? text.toc }), _jsx("span", { className: cn('truncate transition-all', !showItem && 'opacity-0 translate-y-full pointer-events-none'), children: items[selected]?.title })] }), _jsx(ChevronDown, { className: cn('shrink-0 transition-transform mx-0.5', open && 'rotate-180') })] }));
|
|
28
28
|
}
|
|
29
29
|
function clamp(input, min, max) {
|
|
30
30
|
if (input < min)
|
|
@@ -78,16 +78,6 @@ export function PageTOCPopover(props) {
|
|
|
78
78
|
: 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
|
|
79
79
|
}, children: props.children }) }) }));
|
|
80
80
|
}
|
|
81
|
-
export function PageRoot({ toc, children, ...props }) {
|
|
82
|
-
const { collapsed } = useSidebar();
|
|
83
|
-
return (_jsx(TOCProvider, { ...toc, children: _jsx("div", { id: "nd-page", ...props, className: cn('flex flex-1 mx-auto w-full', props.className), style: {
|
|
84
|
-
paddingTop: 'calc(var(--fd-nav-height) + var(--fd-tocnav-height))',
|
|
85
|
-
maxWidth: collapsed
|
|
86
|
-
? 'var(--fd-page-width)'
|
|
87
|
-
: 'min(var(--fd-page-width),calc(var(--fd-layout-width) - var(--fd-sidebar-width)))',
|
|
88
|
-
...props.style,
|
|
89
|
-
}, children: children }) }));
|
|
90
|
-
}
|
|
91
81
|
export function PageLastUpdate({ date: value, ...props }) {
|
|
92
82
|
const { text } = useI18n();
|
|
93
83
|
const [date, setDate] = useState('');
|
|
@@ -113,16 +103,16 @@ function scanNavigationList(tree) {
|
|
|
113
103
|
});
|
|
114
104
|
return list;
|
|
115
105
|
}
|
|
116
|
-
const listCache = new
|
|
106
|
+
const listCache = new Map();
|
|
117
107
|
export function PageFooter({ items, ...props }) {
|
|
118
108
|
const { root } = useTreeContext();
|
|
119
109
|
const pathname = usePathname();
|
|
120
110
|
const { previous, next } = useMemo(() => {
|
|
121
111
|
if (items)
|
|
122
112
|
return items;
|
|
123
|
-
const cached = listCache.get(root);
|
|
113
|
+
const cached = listCache.get(root.$id);
|
|
124
114
|
const list = cached ?? scanNavigationList(root.children);
|
|
125
|
-
listCache.set(root, list);
|
|
115
|
+
listCache.set(root.$id, list);
|
|
126
116
|
const idx = list.findIndex((item) => isActive(item.url, pathname, false));
|
|
127
117
|
if (idx === -1)
|
|
128
118
|
return {};
|
|
@@ -152,7 +142,7 @@ export function PageBreadcrumb({ includeRoot = false, includeSeparator, includeP
|
|
|
152
142
|
return null;
|
|
153
143
|
return (_jsx("div", { ...props, className: cn('flex items-center gap-1.5 text-sm text-fd-muted-foreground', props.className), children: items.map((item, i) => {
|
|
154
144
|
const className = cn('truncate', i === items.length - 1 && 'text-fd-primary font-medium');
|
|
155
|
-
return (_jsxs(Fragment, { children: [i !== 0 && _jsx(
|
|
145
|
+
return (_jsxs(Fragment, { children: [i !== 0 && _jsx(ChevronRight, { className: "size-3.5 shrink-0" }), item.url ? (_jsx(Link, { href: item.url, className: cn(className, 'transition-opacity hover:opacity-80'), children: item.name })) : (_jsx("span", { className: className, children: item.name }))] }, i));
|
|
156
146
|
}) }));
|
|
157
147
|
}
|
|
158
148
|
export function PageTOC(props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
import { type BreadcrumbProps, type FooterProps, PageBreadcrumb, PageFooter, PageLastUpdate,
|
|
2
|
+
import { type BreadcrumbProps, type FooterProps, PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, type RootProps } from './page-client.js';
|
|
3
3
|
/**
|
|
4
4
|
* Apply `prose` on div
|
|
5
5
|
*/
|
|
@@ -12,5 +12,6 @@ export declare function PageTOCPopoverItems({ variant, ...props }: ComponentProp
|
|
|
12
12
|
variant?: 'clerk' | 'normal';
|
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare function PageArticle(props: ComponentProps<'article'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export
|
|
15
|
+
export declare function PageRoot({ toc, children, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, type FooterProps, type BreadcrumbProps, type RootProps, };
|
|
16
17
|
//# sourceMappingURL=page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAMrD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,2CAavD;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CAAE,2CAM1D;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CAAE,2CAM1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,SAAS,CAAC,2CAY3D;AAED,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAe9D;AAED,OAAO,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from '../../utils/cn.js';
|
|
3
|
-
import { PageBreadcrumb, PageFooter, PageLastUpdate,
|
|
4
|
-
import { TOCItems, TOCScrollArea } from '../../components/layout/toc.js';
|
|
3
|
+
import { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, } from './page-client.js';
|
|
4
|
+
import { TOCItems, TOCProvider, TOCScrollArea } from '../../components/layout/toc.js';
|
|
5
5
|
import { Text } from '../../icons.js';
|
|
6
6
|
import { I18nLabel } from '../../contexts/i18n.js';
|
|
7
7
|
import ClerkTOCItems from '../../components/layout/toc-clerk.js';
|
|
@@ -23,4 +23,7 @@ export function PageTOCPopoverItems({ variant = 'normal', ...props }) {
|
|
|
23
23
|
export function PageArticle(props) {
|
|
24
24
|
return (_jsx("article", { ...props, className: cn('flex min-w-0 w-full flex-col gap-4 px-4 pt-8 md:px-6 md:mx-auto xl:pt-12 xl:px-12', props.className), children: props.children }));
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export function PageRoot({ toc, children, ...props }) {
|
|
27
|
+
return (_jsx(TOCProvider, { ...toc, children: _jsx("div", { id: "nd-page", ...props, className: cn('flex flex-1 w-full mx-auto max-w-(--fd-page-width) pt-(--fd-tocnav-height)', props.className), children: children }) }));
|
|
28
|
+
}
|
|
29
|
+
export { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
2
|
export declare function Navbar(props: ComponentProps<'header'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare function LayoutBody(props: ComponentProps<'main'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function SidebarTrigger({ children, ...props }: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
export declare function CollapsibleControl(): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
//# sourceMappingURL=docs-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"docs-client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,kBAAkB,4CA2BjC"}
|
|
@@ -13,17 +13,14 @@ export function Navbar(props) {
|
|
|
13
13
|
}
|
|
14
14
|
export function LayoutBody(props) {
|
|
15
15
|
const { collapsed } = useSidebar();
|
|
16
|
-
return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[
|
|
16
|
+
return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col pt-(--fd-nav-height) transition-[padding]', props.className), style: {
|
|
17
17
|
...props.style,
|
|
18
|
-
|
|
19
|
-
? '
|
|
20
|
-
: 'var(--fd-sidebar-width)',
|
|
18
|
+
paddingInlineStart: collapsed
|
|
19
|
+
? 'min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))'
|
|
20
|
+
: 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
|
|
21
|
+
paddingInlineEnd: collapsed ? '0px' : 'var(--fd-layout-offset)',
|
|
21
22
|
}, children: props.children }));
|
|
22
23
|
}
|
|
23
|
-
export function SidebarTrigger({ children, ...props }) {
|
|
24
|
-
const { setOpen } = useSidebar();
|
|
25
|
-
return (_jsx("button", { ...props, "aria-label": "Open Sidebar", onClick: () => setOpen((prev) => !prev), children: children }));
|
|
26
|
-
}
|
|
27
24
|
export function CollapsibleControl() {
|
|
28
25
|
const { collapsed } = useSidebar();
|
|
29
26
|
return (_jsxs("div", { className: cn('fixed flex shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10 max-md:hidden xl:start-4 max-xl:end-4', !collapsed && 'pointer-events-none opacity-0'), style: {
|
package/dist/layouts/docs.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { PageTree } from 'fumadocs-core/server';
|
|
2
2
|
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
|
+
import { SidebarTrigger } from '../components/layout/sidebar.js';
|
|
3
4
|
import { type LinkItemType } from '../layouts/links.js';
|
|
4
5
|
import { type BaseLayoutProps } from './shared.js';
|
|
5
|
-
import { CollapsibleControl, Navbar
|
|
6
|
+
import { CollapsibleControl, Navbar } from '../layouts/docs-client.js';
|
|
6
7
|
import { type SidebarOptions } from '../layouts/docs/shared.js';
|
|
7
8
|
export interface DocsLayoutProps extends BaseLayoutProps {
|
|
8
9
|
tree: PageTree.Root;
|
|
@@ -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,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,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,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAIf,OAAO,EAQL,cAAc,EAEf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EAAE,kBAAkB,EAAc,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG/E,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAS/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,cAAc,GACtB,cAAc,CAAC,OAAO,CAAC,GAAG;QACxB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEJ;;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,OAAO,EAAE,EACP,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,cAAqB,EAC9B,GAAG,YAAY,EACX,EACN,YAAiB,EACjB,kBAA0B,EAC1B,WAA8C,EAC9C,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,2CA6NjB;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
package/dist/layouts/docs.js
CHANGED
|
@@ -3,12 +3,12 @@ import { useMemo, } from 'react';
|
|
|
3
3
|
import { Languages, Sidebar as SidebarIcon } from '../icons.js';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
5
|
import { buttonVariants } from '../components/ui/button.js';
|
|
6
|
-
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarViewport, } from '../components/layout/sidebar.js';
|
|
6
|
+
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '../components/layout/sidebar.js';
|
|
7
7
|
import { BaseLinkItem, } from '../layouts/links.js';
|
|
8
8
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
9
9
|
import { getLinks } from './shared.js';
|
|
10
10
|
import { LanguageToggle, LanguageToggleText, } from '../components/layout/language-toggle.js';
|
|
11
|
-
import { CollapsibleControl, LayoutBody, Navbar
|
|
11
|
+
import { CollapsibleControl, LayoutBody, Navbar } from '../layouts/docs-client.js';
|
|
12
12
|
import { TreeContextProvider } from '../contexts/tree.js';
|
|
13
13
|
import { ThemeToggle } from '../components/layout/theme-toggle.js';
|
|
14
14
|
import { getSidebarTabsFromOptions, SidebarLinkItem, } from '../layouts/docs/shared.js';
|
|
@@ -19,10 +19,7 @@ import { HideIfEmpty } from 'fumadocs-core/hide-if-empty';
|
|
|
19
19
|
export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { tabs: sidebarTabs, enabled: sidebarEnabled = true, ...sidebarProps } = {}, searchToggle = {}, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, i18n = false, children, ...props }) {
|
|
20
20
|
const tabs = useMemo(() => getSidebarTabsFromOptions(sidebarTabs, props.tree) ?? [], [sidebarTabs, props.tree]);
|
|
21
21
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
22
|
-
const
|
|
23
|
-
'md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]', 'xl:[--fd-toc-width:286px]', !nav.component && nav.enabled !== false
|
|
24
|
-
? '[--fd-nav-height:56px] md:[--fd-nav-height:0px]'
|
|
25
|
-
: undefined);
|
|
22
|
+
const sidebarVariables = cn('md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]');
|
|
26
23
|
function sidebar() {
|
|
27
24
|
const { footer, banner, collapsible = true, component, components, defaultOpenLevel, prefetch, ...rest } = sidebarProps;
|
|
28
25
|
if (component)
|
|
@@ -56,6 +53,8 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
|
|
|
56
53
|
color: 'ghost',
|
|
57
54
|
size: 'icon-sm',
|
|
58
55
|
className: 'p-2',
|
|
59
|
-
})), children: _jsx(SidebarIcon, {}) }))] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn(
|
|
56
|
+
})), children: _jsx(SidebarIcon, {}) }))] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn('xl:[--fd-toc-width:286px]', sidebarEnabled && sidebarVariables, !nav.component &&
|
|
57
|
+
nav.enabled !== false &&
|
|
58
|
+
'[--fd-nav-height:56px] md:[--fd-nav-height:0px]', props.containerProps?.className), children: [sidebarEnabled && sidebar(), children] })] }) }));
|
|
60
59
|
}
|
|
61
60
|
export { CollapsibleControl, Navbar, SidebarTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook-client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAQrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,2CAoBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"notebook-client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAQrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,2CAoBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAkB1B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,2CA+BA"}
|
|
@@ -18,11 +18,12 @@ export function Navbar({ mode, ...props }) {
|
|
|
18
18
|
}
|
|
19
19
|
export function LayoutBody(props) {
|
|
20
20
|
const { collapsed } = useSidebar();
|
|
21
|
-
return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[
|
|
21
|
+
return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[padding] pt-(--fd-nav-height) fd-notebook-layout', props.className), style: {
|
|
22
22
|
...props.style,
|
|
23
|
-
|
|
24
|
-
? '
|
|
25
|
-
: 'var(--fd-sidebar-width)',
|
|
23
|
+
paddingInlineStart: collapsed
|
|
24
|
+
? 'min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))'
|
|
25
|
+
: 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
|
|
26
|
+
paddingInlineEnd: collapsed ? '0px' : 'var(--fd-layout-offset)',
|
|
26
27
|
}, children: props.children }));
|
|
27
28
|
}
|
|
28
29
|
export function NavbarSidebarTrigger({ className, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AA6BlE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAU3B,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,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEnD,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAgNhD;AAiMD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, useMemo, } from 'react';
|
|
3
3
|
import { getLinks } from '../layouts/shared.js';
|
|
4
|
-
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarViewport, } from '../components/layout/sidebar.js';
|
|
4
|
+
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '../components/layout/sidebar.js';
|
|
5
5
|
import { TreeContextProvider } from '../contexts/tree.js';
|
|
6
6
|
import { cn } from '../utils/cn.js';
|
|
7
7
|
import { buttonVariants } from '../components/ui/button.js';
|
|
8
|
-
import { ChevronDown, Languages, Sidebar as SidebarIcon } from '../icons.js';
|
|
8
|
+
import { ChevronDown, Languages, Sidebar as SidebarIcon, X, } from '../icons.js';
|
|
9
9
|
import { BaseLinkItem } from '../layouts/links.js';
|
|
10
10
|
import { LanguageToggle } from '../components/layout/language-toggle.js';
|
|
11
11
|
import { ThemeToggle } from '../components/layout/theme-toggle.js';
|
|
@@ -42,7 +42,11 @@ export function DocsLayout(props) {
|
|
|
42
42
|
color: 'ghost',
|
|
43
43
|
className: 'lg:hidden',
|
|
44
44
|
})), "aria-label": item.label, children: item.icon }, i))), footer] })] }));
|
|
45
|
-
const mobile = (_jsxs(SidebarContentMobile, { ...rest, children: [_jsxs(
|
|
45
|
+
const mobile = (_jsxs(SidebarContentMobile, { ...rest, children: [_jsxs(SidebarHeader, { children: [_jsx(SidebarTrigger, { className: cn(buttonVariants({
|
|
46
|
+
size: 'icon-sm',
|
|
47
|
+
color: 'ghost',
|
|
48
|
+
className: 'ms-auto text-fd-muted-foreground',
|
|
49
|
+
})), children: _jsx(X, {}) }), banner, rootToggle] }), viewport, _jsxs(HideIfEmpty, { as: SidebarFooter, className: "flex flex-row items-center justify-end", children: [iconLinks.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({
|
|
46
50
|
size: 'icon-sm',
|
|
47
51
|
color: 'ghost',
|
|
48
52
|
}), 'text-fd-muted-foreground lg:hidden', i === iconLinks.length - 1 && 'me-auto'), "aria-label": item.label, children: item.icon }, i))), i18n ? (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, themeSwitch.enabled !== false &&
|
package/dist/mdx.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
|
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const defaultMdxComponents: {
|
|
9
|
-
CodeBlockTab:
|
|
9
|
+
CodeBlockTab: typeof import("./components/tabs.unstyled.js").TabsContent;
|
|
10
10
|
CodeBlockTabs: typeof CodeBlockTabs;
|
|
11
11
|
CodeBlockTabsList: typeof CodeBlockTabsList;
|
|
12
12
|
CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
|
package/dist/style.css
CHANGED
|
@@ -1018,6 +1018,9 @@
|
|
|
1018
1018
|
.w-\(--fd-toc-width\) {
|
|
1019
1019
|
width: var(--fd-toc-width);
|
|
1020
1020
|
}
|
|
1021
|
+
.w-\(--radix-popover-trigger-width\) {
|
|
1022
|
+
width: var(--radix-popover-trigger-width);
|
|
1023
|
+
}
|
|
1021
1024
|
.w-0 {
|
|
1022
1025
|
width: calc(var(--spacing) * 0);
|
|
1023
1026
|
}
|
|
@@ -1057,6 +1060,9 @@
|
|
|
1057
1060
|
.w-px {
|
|
1058
1061
|
width: 1px;
|
|
1059
1062
|
}
|
|
1063
|
+
.max-w-\(--fd-page-width\) {
|
|
1064
|
+
max-width: var(--fd-page-width);
|
|
1065
|
+
}
|
|
1060
1066
|
.max-w-\[98vw\] {
|
|
1061
1067
|
max-width: 98vw;
|
|
1062
1068
|
}
|
|
@@ -1081,9 +1087,6 @@
|
|
|
1081
1087
|
.max-w-sm {
|
|
1082
1088
|
max-width: var(--container-sm);
|
|
1083
1089
|
}
|
|
1084
|
-
.min-w-\(--radix-popover-trigger-width\) {
|
|
1085
|
-
min-width: var(--radix-popover-trigger-width);
|
|
1086
|
-
}
|
|
1087
1090
|
.min-w-0 {
|
|
1088
1091
|
min-width: calc(var(--spacing) * 0);
|
|
1089
1092
|
}
|
|
@@ -1493,6 +1496,12 @@
|
|
|
1493
1496
|
.pe-4 {
|
|
1494
1497
|
padding-inline-end: calc(var(--spacing) * 4);
|
|
1495
1498
|
}
|
|
1499
|
+
.pt-\(--fd-nav-height\) {
|
|
1500
|
+
padding-top: var(--fd-nav-height);
|
|
1501
|
+
}
|
|
1502
|
+
.pt-\(--fd-tocnav-height\) {
|
|
1503
|
+
padding-top: var(--fd-tocnav-height);
|
|
1504
|
+
}
|
|
1496
1505
|
.pt-0 {
|
|
1497
1506
|
padding-top: calc(var(--spacing) * 0);
|
|
1498
1507
|
}
|
|
@@ -1577,12 +1586,6 @@
|
|
|
1577
1586
|
.text-fd-foreground {
|
|
1578
1587
|
color: var(--color-fd-foreground);
|
|
1579
1588
|
}
|
|
1580
|
-
.text-fd-foreground\/30 {
|
|
1581
|
-
color: color-mix(in srgb, hsl(0, 0%, 3.9%) 30%, transparent);
|
|
1582
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1583
|
-
color: color-mix(in oklab, var(--color-fd-foreground) 30%, transparent);
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
1589
|
.text-fd-foreground\/80 {
|
|
1587
1590
|
color: color-mix(in srgb, hsl(0, 0%, 3.9%) 80%, transparent);
|
|
1588
1591
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1693,8 +1696,8 @@
|
|
|
1693
1696
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
1694
1697
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
1695
1698
|
}
|
|
1696
|
-
.transition-\[
|
|
1697
|
-
transition-property:
|
|
1699
|
+
.transition-\[padding\] {
|
|
1700
|
+
transition-property: padding;
|
|
1698
1701
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
1699
1702
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
1700
1703
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.6.
|
|
3
|
+
"version": "15.6.10",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -89,20 +89,20 @@
|
|
|
89
89
|
"react-medium-image-zoom": "^5.3.0",
|
|
90
90
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
91
91
|
"tailwind-merge": "^3.3.1",
|
|
92
|
-
"fumadocs-core": "15.6.
|
|
92
|
+
"fumadocs-core": "15.6.10"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@next/eslint-plugin-next": "^15.4.
|
|
95
|
+
"@next/eslint-plugin-next": "^15.4.6",
|
|
96
96
|
"@tailwindcss/cli": "^4.1.11",
|
|
97
97
|
"@types/lodash.merge": "^4.6.9",
|
|
98
98
|
"@types/react": "^19.1.9",
|
|
99
99
|
"@types/react-dom": "^19.1.7",
|
|
100
|
-
"next": "15.4.
|
|
100
|
+
"next": "15.4.6",
|
|
101
101
|
"tailwindcss": "^4.1.11",
|
|
102
102
|
"tsc-alias": "^1.8.16",
|
|
103
|
-
"eslint-config-custom": "0.0.0",
|
|
104
103
|
"@fumadocs/cli": "0.2.1",
|
|
105
|
-
"
|
|
104
|
+
"eslint-config-custom": "0.0.0",
|
|
105
|
+
"fumadocs-core": "15.6.10",
|
|
106
106
|
"tsconfig": "0.0.0"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|