fumadocs-ui 15.3.0 → 15.3.2
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 +16 -0
- package/css/shiki.css +35 -20
- package/dist/components/callout.d.ts +1 -1
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +6 -2
- package/dist/components/codeblock.d.ts +18 -3
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +9 -5
- package/dist/components/layout/sidebar.d.ts.map +1 -1
- package/dist/components/layout/sidebar.js +4 -4
- package/dist/components/layout/toc.d.ts +1 -4
- package/dist/components/layout/toc.d.ts.map +1 -1
- package/dist/components/layout/toc.js +3 -5
- package/dist/components/ui/hide-if-empty.d.ts +10 -0
- package/dist/components/ui/hide-if-empty.d.ts.map +1 -0
- package/dist/components/ui/hide-if-empty.js +52 -0
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/layouts/docs.d.ts +1 -1
- package/dist/layouts/docs.d.ts.map +1 -1
- package/dist/layouts/docs.js +8 -10
- package/dist/layouts/home/menu.js +1 -1
- package/dist/layouts/home/navbar.js +4 -4
- package/dist/layouts/home.d.ts.map +1 -1
- package/dist/layouts/home.js +1 -1
- package/dist/layouts/notebook-client.d.ts +0 -3
- package/dist/layouts/notebook-client.d.ts.map +1 -1
- package/dist/layouts/notebook-client.js +1 -7
- package/dist/layouts/notebook.d.ts.map +1 -1
- package/dist/layouts/notebook.js +16 -7
- package/dist/mdx.d.ts +1 -1
- package/dist/page-client.js +1 -1
- package/dist/page.d.ts +7 -9
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +5 -5
- package/dist/style.css +110 -64
- package/package.json +3 -3
package/css/preset.css
CHANGED
|
@@ -227,6 +227,22 @@
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
@utility fd-scroll-container {
|
|
231
|
+
&::-webkit-scrollbar {
|
|
232
|
+
width: 5px;
|
|
233
|
+
height: 5px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&::-webkit-scrollbar-thumb {
|
|
237
|
+
border-radius: 5px;
|
|
238
|
+
background: var(--color-fd-border);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&::-webkit-scrollbar-track {
|
|
242
|
+
background: transparent;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
230
246
|
@utility fd-steps {
|
|
231
247
|
counter-reset: step;
|
|
232
248
|
position: relative;
|
package/css/shiki.css
CHANGED
|
@@ -3,9 +3,40 @@
|
|
|
3
3
|
color: var(--shiki-light);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
code .line {
|
|
7
|
+
line-height: 1.45em;
|
|
8
|
+
min-height: 1.45em;
|
|
9
|
+
@apply relative;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.has-focused code .line:not(.focused) {
|
|
13
|
+
filter: blur(2px);
|
|
14
|
+
transition: filter 200ms;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.has-focused:hover code .line:not(.focused) {
|
|
18
|
+
filter: blur(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&[data-line-numbers] code .twoslash-meta-line {
|
|
22
|
+
@apply ml-7;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&[data-line-numbers] code .line {
|
|
26
|
+
width: calc(100% - 7 * var(--spacing));
|
|
27
|
+
counter-increment: line;
|
|
28
|
+
@apply ml-7;
|
|
29
|
+
|
|
30
|
+
&::after {
|
|
31
|
+
position: absolute;
|
|
32
|
+
content: counter(line);
|
|
33
|
+
@apply top-0 -left-5 text-fd-muted-foreground/60;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
6
37
|
code .diff::before {
|
|
7
38
|
position: absolute;
|
|
8
|
-
left:
|
|
39
|
+
left: var(--spacing);
|
|
9
40
|
}
|
|
10
41
|
|
|
11
42
|
code .diff.remove {
|
|
@@ -27,29 +58,13 @@
|
|
|
27
58
|
@apply text-fd-diff-add-symbol;
|
|
28
59
|
}
|
|
29
60
|
|
|
30
|
-
code .diff {
|
|
31
|
-
width: calc(100% + 8 * var(--spacing));
|
|
32
|
-
|
|
33
|
-
@apply relative inline-block -mx-4 px-4;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
61
|
.highlighted {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@apply inline-block -mx-4 px-4 bg-fd-primary/10;
|
|
62
|
+
@apply bg-fd-primary/10;
|
|
40
63
|
}
|
|
41
64
|
|
|
42
65
|
.highlighted-word {
|
|
43
|
-
padding: 1px
|
|
44
|
-
|
|
45
|
-
border: 1px solid
|
|
46
|
-
color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
|
|
47
|
-
background-color: color-mix(
|
|
48
|
-
in oklab,
|
|
49
|
-
var(--color-fd-primary) 10%,
|
|
50
|
-
transparent
|
|
51
|
-
);
|
|
52
|
-
border-radius: 2px;
|
|
66
|
+
padding: 1px;
|
|
67
|
+
@apply border -my-px border-fd-primary/30 bg-fd-primary/10 rounded-md font-medium;
|
|
53
68
|
}
|
|
54
69
|
}
|
|
55
70
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/components/callout.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkCxE,eAAO,MAAM,OAAO;YA1BV,SAAS;IACjB;;OAEG;WACI,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS;IAExD;;OAEG;WACI,SAAS;kDAoDjB,CAAC"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CircleX, Info, TriangleAlert } from '../icons.js';
|
|
2
|
+
import { CircleCheck, CircleX, Info, TriangleAlert } from '../icons.js';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { cn } from '../utils/cn.js';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
|
-
const calloutVariants = cva('my-4 flex
|
|
6
|
+
const calloutVariants = cva('my-4 flex gap-2 rounded-lg border border-s-2 bg-fd-card p-3 text-sm text-fd-card-foreground shadow-md', {
|
|
7
7
|
variants: {
|
|
8
8
|
type: {
|
|
9
9
|
info: 'border-s-blue-500/50',
|
|
10
10
|
warn: 'border-s-orange-500/50',
|
|
11
11
|
error: 'border-s-red-500/50',
|
|
12
|
+
success: 'border-s-green-500/50',
|
|
12
13
|
},
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
16
|
export const Callout = forwardRef(({ className, children, title, type = 'info', icon, ...props }, ref) => {
|
|
17
|
+
if (type === 'warning')
|
|
18
|
+
type = 'warn';
|
|
16
19
|
return (_jsxs("div", { ref: ref, className: cn(calloutVariants({
|
|
17
20
|
type: type,
|
|
18
21
|
}), className), ...props, children: [icon ??
|
|
@@ -20,6 +23,7 @@ export const Callout = forwardRef(({ className, children, title, type = 'info',
|
|
|
20
23
|
info: _jsx(Info, { className: "size-5 fill-blue-500 text-fd-card" }),
|
|
21
24
|
warn: (_jsx(TriangleAlert, { className: "size-5 fill-orange-500 text-fd-card" })),
|
|
22
25
|
error: _jsx(CircleX, { className: "size-5 fill-red-500 text-fd-card" }),
|
|
26
|
+
success: (_jsx(CircleCheck, { className: "size-5 fill-green-500 text-fd-card" })),
|
|
23
27
|
}[type], _jsxs("div", { className: "min-w-0 flex flex-col gap-2 flex-1", children: [title ? _jsx("p", { className: "font-medium !my-0", children: title }) : null, _jsx("div", { className: "text-fd-muted-foreground prose-no-margin empty:hidden", children: children })] })] }));
|
|
24
28
|
});
|
|
25
29
|
Callout.displayName = 'Callout';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
-
import type { ScrollAreaViewportProps } from '@radix-ui/react-scroll-area';
|
|
3
2
|
export type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
4
3
|
/**
|
|
5
4
|
* Icon of code block
|
|
@@ -19,7 +18,15 @@ export type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
|
19
18
|
* @defaultValue false
|
|
20
19
|
*/
|
|
21
20
|
keepBackground?: boolean;
|
|
22
|
-
viewportProps?:
|
|
21
|
+
viewportProps?: HTMLAttributes<HTMLElement>;
|
|
22
|
+
/**
|
|
23
|
+
* show line numbers
|
|
24
|
+
*/
|
|
25
|
+
'data-line-numbers'?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @defaultValue 1
|
|
28
|
+
*/
|
|
29
|
+
'data-line-numbers-start'?: number;
|
|
23
30
|
};
|
|
24
31
|
export declare const Pre: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLPreElement> & import("react").RefAttributes<HTMLPreElement>>;
|
|
25
32
|
export declare const CodeBlock: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
@@ -41,6 +48,14 @@ export declare const CodeBlock: import("react").ForwardRefExoticComponent<HTMLAt
|
|
|
41
48
|
* @defaultValue false
|
|
42
49
|
*/
|
|
43
50
|
keepBackground?: boolean;
|
|
44
|
-
viewportProps?:
|
|
51
|
+
viewportProps?: HTMLAttributes<HTMLElement>;
|
|
52
|
+
/**
|
|
53
|
+
* show line numbers
|
|
54
|
+
*/
|
|
55
|
+
'data-line-numbers'?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* @defaultValue 1
|
|
58
|
+
*/
|
|
59
|
+
'data-line-numbers-start'?: number;
|
|
45
60
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
46
61
|
//# sourceMappingURL=codeblock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAKf,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACzD;;;;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;CACpC,CAAC;AAEF,eAAO,MAAM,GAAG,2HAYf,CAAC;AAIF,eAAO,MAAM,SAAS;IAlDpB;;;;OAIG;WACI,SAAS;IAEhB;;;;OAIG;gBACS,OAAO;IAEnB;;;;OAIG;qBACc,OAAO;oBAER,cAAc,CAAC,WAAW,CAAC;IAE3C;;OAEG;0BACmB,OAAO;IAE7B;;OAEG;gCACyB,MAAM;+CA2GnC,CAAC"}
|
|
@@ -3,14 +3,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Check, Copy } from '../icons.js';
|
|
4
4
|
import { forwardRef, useRef, } from 'react';
|
|
5
5
|
import { cn } from '../utils/cn.js';
|
|
6
|
-
import { ScrollArea, ScrollBar, ScrollViewport, } from '../components/ui/scroll-area.js';
|
|
7
6
|
import { useCopyButton } from '../utils/use-copy-button.js';
|
|
8
7
|
import { buttonVariants } from '../components/ui/button.js';
|
|
9
8
|
export const Pre = forwardRef(({ className, ...props }, ref) => {
|
|
10
|
-
return (_jsx("pre", { ref: ref, className: cn('
|
|
9
|
+
return (_jsx("pre", { ref: ref, className: cn('min-w-full w-max *:flex *:flex-col', className), ...props, children: props.children }));
|
|
11
10
|
});
|
|
12
11
|
Pre.displayName = 'Pre';
|
|
13
|
-
export const CodeBlock = forwardRef(({ title, allowCopy = true, keepBackground = false, icon, viewportProps, ...props }, ref) => {
|
|
12
|
+
export const CodeBlock = forwardRef(({ title, allowCopy = true, keepBackground = false, icon, viewportProps, children, ...props }, ref) => {
|
|
14
13
|
const areaRef = useRef(null);
|
|
15
14
|
const onCopy = () => {
|
|
16
15
|
const pre = areaRef.current?.getElementsByTagName('pre').item(0);
|
|
@@ -22,11 +21,16 @@ export const CodeBlock = forwardRef(({ title, allowCopy = true, keepBackground =
|
|
|
22
21
|
});
|
|
23
22
|
void navigator.clipboard.writeText(clone.textContent ?? '');
|
|
24
23
|
};
|
|
25
|
-
return (_jsxs("figure", { ref: ref, ...props, className: cn('not-prose group relative my-4 overflow-hidden rounded-lg border bg-fd-card text-sm outline-none', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)', props.className), children: [title ? (_jsxs("div", { className: "flex items-center gap-2 bg-fd-secondary px-4 py-1.5", children: [icon ? (_jsx("div", { className: "text-fd-muted-foreground [&_svg]:size-3.5", dangerouslySetInnerHTML: typeof icon === 'string'
|
|
24
|
+
return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn('not-prose group relative my-4 overflow-hidden rounded-lg border bg-fd-card text-sm outline-none', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)', props.className), children: [title ? (_jsxs("div", { className: "flex items-center gap-2 bg-fd-secondary px-4 py-1.5", children: [icon ? (_jsx("div", { className: "text-fd-muted-foreground [&_svg]:size-3.5", dangerouslySetInnerHTML: typeof icon === 'string'
|
|
26
25
|
? {
|
|
27
26
|
__html: icon,
|
|
28
27
|
}
|
|
29
|
-
: undefined, children: typeof icon !== 'string' ? icon : null })) : null, _jsx("figcaption", { className: "flex-1 truncate text-fd-muted-foreground", children: title }), allowCopy ? (_jsx(CopyButton, { className: "-me-2", onCopy: onCopy })) : null] })) : (allowCopy && (_jsx(CopyButton, { className: "absolute right-2 top-2 z-[2] backdrop-blur-md", onCopy: onCopy }))),
|
|
28
|
+
: undefined, children: typeof icon !== 'string' ? icon : null })) : null, _jsx("figcaption", { className: "flex-1 truncate text-fd-muted-foreground", children: title }), allowCopy ? (_jsx(CopyButton, { className: "-me-2", onCopy: onCopy })) : null] })) : (allowCopy && (_jsx(CopyButton, { className: "absolute right-2 top-2 z-[2] backdrop-blur-md", onCopy: onCopy }))), _jsx("div", { ref: areaRef, ...viewportProps, className: cn('text-[13px] py-3.5 overflow-auto [&_.line]:px-4 max-h-[600px] fd-scroll-container', props['data-line-numbers'] && '[&_.line]:pl-3', viewportProps?.className), style: {
|
|
29
|
+
counterSet: props['data-line-numbers']
|
|
30
|
+
? `line ${Number(props['data-line-numbers-start'] ?? 1) - 1}`
|
|
31
|
+
: undefined,
|
|
32
|
+
...viewportProps?.style,
|
|
33
|
+
}, children: children })] }));
|
|
30
34
|
});
|
|
31
35
|
CodeBlock.displayName = 'CodeBlock';
|
|
32
36
|
function CopyButton({ className, onCopy, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layout/sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,EAAE,EAGP,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMrD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC3D;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA2BD,wBAAgB,OAAO,CAAC,EACtB,gBAAoB,EACpB,QAAe,EACf,WAAkB,EAClB,GAAG,KAAK,EACT,EAAE,YAAY,2CAkHd;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layout/sidebar.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,EAAE,EAGP,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMrD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC3D;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA2BD,wBAAgB,OAAO,CAAC,EACtB,gBAAoB,EACpB,QAAe,EACf,WAAkB,EAClB,GAAG,KAAK,EACT,EAAE,YAAY,2CAkHd;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CASzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CASzD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,2CAarD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,2CAkB1D;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,SAAS,GAAG;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,2CAsBA;AAED,wBAAgB,aAAa,CAAC,EAC5B,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,2CAgBA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAqBlE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,2CAmCjD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAqBlE;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"}
|
|
@@ -45,7 +45,7 @@ export function Sidebar({ defaultOpenLevel = 0, prefetch = true, collapsible = t
|
|
|
45
45
|
});
|
|
46
46
|
if (isMobile) {
|
|
47
47
|
const state = open ? 'open' : 'closed';
|
|
48
|
-
return (_jsxs(_Fragment, { children: [_jsx(Presence, { present: open, children: _jsx("div", { "data-state": state, className: "fixed z-40 inset-0 bg-black/30 backdrop-blur-sm data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", onClick: () => setOpen(false) }) }), _jsx(Presence, { present: open, children: ({ present }) => (_jsx(RemoveScroll, { as: "aside", enabled: present, id: "nd-sidebar-mobile", ...props, "data-state": state, className: cn('fixed text-[15px] flex flex-col rounded-e-xl border-e start-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-enterFromLeft data-[state=closed]:animate-fd-exitToLeft', !present && 'invisible', props.className), children: _jsx(Context.Provider, { value: context, children: props.children }) })) })] }));
|
|
48
|
+
return (_jsxs(_Fragment, { children: [_jsx(Presence, { present: open, children: _jsx("div", { "data-state": state, className: "fixed z-40 inset-0 bg-black/30 backdrop-blur-sm data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", onClick: () => setOpen(false) }) }), _jsx(Presence, { present: open, children: ({ present }) => (_jsx(RemoveScroll, { as: "aside", enabled: present, id: "nd-sidebar-mobile", ...props, "data-state": state, className: cn('fixed text-[15px] flex flex-col py-3 rounded-e-xl border-e start-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-enterFromLeft data-[state=closed]:animate-fd-exitToLeft', !present && 'invisible', props.className), children: _jsx(Context.Provider, { value: context, children: props.children }) })) })] }));
|
|
49
49
|
}
|
|
50
50
|
return (_jsx("aside", { id: "nd-sidebar", ...props, "data-collapsed": collapsed, className: cn('sticky top-(--fd-sidebar-top) z-20 bg-fd-card text-sm h-(--fd-sidebar-height) max-md:hidden', collapsible && [
|
|
51
51
|
'transition-all',
|
|
@@ -76,13 +76,13 @@ export function Sidebar({ defaultOpenLevel = 0, prefetch = true, collapsible = t
|
|
|
76
76
|
}, Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100
|
|
77
77
|
? 0
|
|
78
78
|
: 500);
|
|
79
|
-
}, children: _jsx("div", { className: "flex w-(--fd-sidebar-width) h-full max-w-full flex-col ms-auto border-e", children: _jsx(Context.Provider, { value: context, children: props.children }) }) }));
|
|
79
|
+
}, children: _jsx("div", { className: "flex w-(--fd-sidebar-width) h-full max-w-full flex-col pt-1.5 ms-auto border-e", children: _jsx(Context.Provider, { value: context, children: props.children }) }) }));
|
|
80
80
|
}
|
|
81
81
|
export function SidebarHeader(props) {
|
|
82
|
-
return (_jsx("div", { ...props, className: cn('flex flex-col gap-3 px-4
|
|
82
|
+
return (_jsx("div", { ...props, className: cn('flex flex-col gap-3 px-4 py-2', props.className), children: props.children }));
|
|
83
83
|
}
|
|
84
84
|
export function SidebarFooter(props) {
|
|
85
|
-
return (_jsx("div", { ...props, className: cn('flex flex-col border-t px-4 py-3
|
|
85
|
+
return (_jsx("div", { ...props, className: cn('flex flex-col border-t px-4 py-3', props.className), children: props.children }));
|
|
86
86
|
}
|
|
87
87
|
export function SidebarViewport(props) {
|
|
88
88
|
return (_jsx(ScrollArea, { ...props, className: cn('h-full', props.className), children: _jsx(ScrollViewport, { className: "p-4", style: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { TOCItemType } from 'fumadocs-core/server';
|
|
2
2
|
import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
|
|
3
|
-
import { ScrollArea } from '../ui/scroll-area.js';
|
|
4
3
|
export interface TOCProps {
|
|
5
4
|
/**
|
|
6
5
|
* Custom content in TOC container, before the main TOC
|
|
@@ -14,9 +13,7 @@ export interface TOCProps {
|
|
|
14
13
|
}
|
|
15
14
|
export declare function Toc(props: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export declare function TocItemsEmpty(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function TOCScrollArea(
|
|
18
|
-
isMenu?: boolean;
|
|
19
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function TOCScrollArea(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
20
17
|
export declare function TOCItems({ items }: {
|
|
21
18
|
items: TOCItemType[];
|
|
22
19
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../../src/components/layout/toc.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAMf,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,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAiBzD;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,2CAqB3D"}
|
|
@@ -5,23 +5,21 @@ 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
|
-
import { ScrollArea, ScrollViewport } from '../ui/scroll-area.js';
|
|
9
8
|
import { usePageStyles } from '../../contexts/layout.js';
|
|
10
9
|
export function Toc(props) {
|
|
11
10
|
const { toc } = usePageStyles();
|
|
12
11
|
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: {
|
|
13
12
|
...props.style,
|
|
14
13
|
'--fd-toc-height': 'calc(100dvh - var(--fd-banner-height) - var(--fd-nav-height))',
|
|
15
|
-
}, children: _jsx("div", { className: "flex h-full w-(--fd-toc-width) max-w-full flex-col
|
|
14
|
+
}, children: _jsx("div", { className: "flex h-full w-(--fd-toc-width) max-w-full flex-col pe-4", children: props.children }) }));
|
|
16
15
|
}
|
|
17
16
|
export function TocItemsEmpty() {
|
|
18
17
|
const { text } = useI18n();
|
|
19
18
|
return (_jsx("div", { className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground", children: text.tocNoHeadings }));
|
|
20
19
|
}
|
|
21
|
-
export function TOCScrollArea(
|
|
20
|
+
export function TOCScrollArea(props) {
|
|
22
21
|
const viewRef = useRef(null);
|
|
23
|
-
return (_jsx(
|
|
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 }) }) }));
|
|
22
|
+
return (_jsx("div", { ...props, ref: viewRef, className: cn('relative min-h-0 text-sm ms-px overflow-auto [scrollbar-width:none] [mask-image:linear-gradient(to_bottom,transparent,white_16px,white_calc(100%-16px),transparent)] py-3', props.className), children: _jsx(Primitive.ScrollProvider, { containerRef: viewRef, children: props.children }) }));
|
|
25
23
|
}
|
|
26
24
|
export function TOCItems({ items }) {
|
|
27
25
|
const containerRef = useRef(null);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in CSS `:empty` selector cannot detect if the children is hidden, classes such as `md:hidden` causes it to fail.
|
|
3
|
+
* This component is an enhancement to `empty:hidden` to fix the issue described above.
|
|
4
|
+
*
|
|
5
|
+
* This can be expensive, please avoid this whenever possible.
|
|
6
|
+
*/
|
|
7
|
+
export declare function HideIfEmpty({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=hide-if-empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hide-if-empty.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hide-if-empty.tsx"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAyCtE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
5
|
+
const init = `function isEmpty(node) {
|
|
6
|
+
for (let i = 0; i < node.childNodes.length; i++) {
|
|
7
|
+
const child = node.childNodes.item(i);
|
|
8
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
9
|
+
return false
|
|
10
|
+
} else if (
|
|
11
|
+
child.nodeType === Node.ELEMENT_NODE &&
|
|
12
|
+
window.getComputedStyle(child).display !== 'none'
|
|
13
|
+
) {
|
|
14
|
+
return false
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return true;
|
|
19
|
+
}`;
|
|
20
|
+
const isEmpty = eval(`${init}; isEmpty`);
|
|
21
|
+
/**
|
|
22
|
+
* The built-in CSS `:empty` selector cannot detect if the children is hidden, classes such as `md:hidden` causes it to fail.
|
|
23
|
+
* This component is an enhancement to `empty:hidden` to fix the issue described above.
|
|
24
|
+
*
|
|
25
|
+
* This can be expensive, please avoid this whenever possible.
|
|
26
|
+
*/
|
|
27
|
+
export function HideIfEmpty({ children }) {
|
|
28
|
+
const id = useId();
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
const [empty, setEmpty] = useState();
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const element = ref.current;
|
|
33
|
+
if (!element)
|
|
34
|
+
return;
|
|
35
|
+
const onUpdate = () => {
|
|
36
|
+
setEmpty(isEmpty(element));
|
|
37
|
+
};
|
|
38
|
+
const observer = new ResizeObserver(onUpdate);
|
|
39
|
+
observer.observe(element);
|
|
40
|
+
onUpdate();
|
|
41
|
+
return () => {
|
|
42
|
+
observer.disconnect();
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
const inject = `
|
|
46
|
+
${init}
|
|
47
|
+
const element = document.querySelector('[data-hide-if-empty="${id}"]')
|
|
48
|
+
if (element) {
|
|
49
|
+
element.setAttribute('data-empty', String(isEmpty(element)))
|
|
50
|
+
}`;
|
|
51
|
+
return (_jsxs(_Fragment, { children: [empty === undefined && _jsx("script", { children: `{ ${inject} }` }), _jsx(Slot, { ref: ref, "data-hide-if-empty": id, "data-empty": empty, className: "data-[empty=true]:hidden", children: children })] }));
|
|
52
|
+
}
|
|
@@ -12,6 +12,6 @@ NavigationMenuTrigger.displayName = Primitive.Trigger.displayName;
|
|
|
12
12
|
const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(Primitive.Content, { ref: ref, className: cn('absolute inset-x-0 top-0 data-[motion=from-end]:animate-fd-enterFromRight data-[motion=from-start]:animate-fd-enterFromLeft data-[motion=to-end]:animate-fd-exitToRight data-[motion=to-start]:animate-fd-exitToLeft', className), ...props })));
|
|
13
13
|
NavigationMenuContent.displayName = Primitive.Content.displayName;
|
|
14
14
|
const NavigationMenuLink = Primitive.Link;
|
|
15
|
-
const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: "flex w-full justify-center", children: _jsx(Primitive.Viewport, { ...props, className: cn('relative h-(--radix-navigation-menu-viewport-height) w-full origin-[top_center] overflow-
|
|
15
|
+
const NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: "flex w-full justify-center", children: _jsx(Primitive.Viewport, { ...props, className: cn('relative h-(--radix-navigation-menu-viewport-height) max-h-[80svh] w-full origin-[top_center] overflow-auto [scrollbar-width:none] text-fd-popover-foreground transition-[width,height] duration-300 data-[state=closed]:animate-fd-nav-menu-out data-[state=open]:animate-fd-nav-menu-in', className) }) })));
|
|
16
16
|
NavigationMenuViewport.displayName = Primitive.Viewport.displayName;
|
|
17
17
|
export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuViewport, };
|
package/dist/layouts/docs.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare function DocsLayoutSidebarFooter({ i18n, themeSwitch, links, }: {
|
|
|
24
24
|
i18n?: DocsLayoutProps['i18n'];
|
|
25
25
|
links?: IconItemType[];
|
|
26
26
|
themeSwitch?: DocsLayoutProps['themeSwitch'];
|
|
27
|
-
}): import("react/jsx-runtime").JSX.Element
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export { CollapsibleControl, Navbar, NavbarSidebarTrigger, type LinkItemType };
|
|
29
29
|
export { getSidebarTabsFromOptions } from './docs/shared.js';
|
|
30
30
|
//# 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,cAAc,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAarE,OAAO,EAEL,KAAK,YAAY,EACjB,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;AAG/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,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,cAAc,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAarE,OAAO,EAEL,KAAK,YAAY,EACjB,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;AAG/B,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAa/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,OAAY,EACZ,YAAY,EACZ,kBAA0B,EAC1B,WAA8C,EAC9C,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,SAAS,CAkG7B;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,2CAgDA;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,2CAgCA;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
|
@@ -16,6 +16,7 @@ import { getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '..
|
|
|
16
16
|
import { NavProvider, StylesProvider, } from '../contexts/layout.js';
|
|
17
17
|
import Link from 'fumadocs-core/link';
|
|
18
18
|
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
19
|
+
import { HideIfEmpty } from '../components/ui/hide-if-empty.js';
|
|
19
20
|
export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar = {}, searchToggle, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, i18n = false, children, ...props }) {
|
|
20
21
|
const tabs = useMemo(() => getSidebarTabsFromOptions(sidebar.tabs, props.tree) ?? [], [sidebar.tabs, props.tree]);
|
|
21
22
|
const links = getLinks(props.links ?? [], props.githubUrl);
|
|
@@ -32,18 +33,15 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar = {}
|
|
|
32
33
|
}, children: [slot(sidebar, _jsx(DocsLayoutSidebar, { ...omit(sidebar, 'enabled', 'component', 'tabs'), 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 }) : 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 })] })] }) }));
|
|
33
34
|
}
|
|
34
35
|
export function DocsLayoutSidebar({ collapsible = true, components, nav, links = [], footer, banner, ...props }) {
|
|
35
|
-
return (_jsxs(_Fragment, { children: [collapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Sidebar, { ...props, collapsible: collapsible, className: cn('md:ps-(--fd-layout-offset)', props.className), children: [_jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
return (_jsxs(_Fragment, { children: [collapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Sidebar, { ...props, collapsible: collapsible, className: cn('md:ps-(--fd-layout-offset)', props.className), children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex py-1.5 max-md:hidden", children: [nav, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
37
|
+
color: 'ghost',
|
|
38
|
+
size: 'icon-sm',
|
|
39
|
+
}), 'ms-auto mb-auto -my-1.5 text-fd-muted-foreground max-md:hidden'), children: _jsx(SidebarIcon, {}) }))] }), banner] }) }), _jsxs(SidebarViewport, { children: [links
|
|
40
|
+
.filter((v) => v.type !== 'icon')
|
|
41
|
+
.map((item, i, list) => (_jsx(SidebarLinkItem, { item: item, className: cn(i === list.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: components })] }), _jsx(HideIfEmpty, { children: _jsx(SidebarFooter, { children: footer }) })] })] }));
|
|
41
42
|
}
|
|
42
43
|
export function DocsLayoutSidebarFooter({ i18n, themeSwitch, links = [], }) {
|
|
43
|
-
|
|
44
|
-
if (links.length === 0 && !i18n && themeSwitch?.enabled === false)
|
|
45
|
-
return null;
|
|
46
|
-
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 }))] }));
|
|
44
|
+
return (_jsx(HideIfEmpty, { children: _jsxs("div", { className: "flex items-center justify-end", children: [_jsx("div", { className: "flex items-center flex-1 empty:hidden", 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))) }), 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 }))] }) }));
|
|
47
45
|
}
|
|
48
46
|
export { CollapsibleControl, Navbar, NavbarSidebarTrigger };
|
|
49
47
|
export { getSidebarTabsFromOptions } from './docs/shared.js';
|
|
@@ -41,5 +41,5 @@ export function MenuTrigger({ enableHover = false, ...props }) {
|
|
|
41
41
|
}), props.className), children: props.children }));
|
|
42
42
|
}
|
|
43
43
|
export function MenuContent(props) {
|
|
44
|
-
return (_jsx(NavigationMenuContent, { ...props, className: cn('flex flex-col
|
|
44
|
+
return (_jsx(NavigationMenuContent, { ...props, className: cn('flex flex-col px-4 pb-4', props.className), children: props.children }));
|
|
45
45
|
}
|
|
@@ -12,11 +12,11 @@ const navItemVariants = cva('inline-flex items-center gap-1 p-2 text-fd-muted-fo
|
|
|
12
12
|
export function Navbar(props) {
|
|
13
13
|
const [value, setValue] = useState('');
|
|
14
14
|
const { isTransparent } = useNav();
|
|
15
|
-
return (_jsx(NavigationMenu, { value: value, onValueChange: setValue, asChild: true, children: _jsxs("header", { id: "nd-nav", ...props, className: cn('fixed
|
|
16
|
-
'
|
|
17
|
-
|
|
15
|
+
return (_jsx(NavigationMenu, { value: value, onValueChange: setValue, asChild: true, children: _jsxs("header", { id: "nd-nav", ...props, className: cn('fixed top-(--fd-banner-height) z-40 box-content backdrop-blur-lg max-w-fd-container -translate-x-1/2 border-b transition-colors lg:mt-2 lg:[--fd-padding:1rem] lg:rounded-2xl lg:border', value.length > 0 ? 'shadow-lg' : 'shadow-sm', (!isTransparent || value.length > 0) && 'bg-fd-background/80', props.className), style: {
|
|
16
|
+
width: 'calc(100% - var(--fd-padding,0px) - var(--removed-body-scroll-bar-size,0px))',
|
|
17
|
+
left: 'calc(50% - var(--removed-body-scroll-bar-size,0px) / 2)',
|
|
18
18
|
...props.style,
|
|
19
|
-
}, children: [_jsx(NavigationMenuList, { className: "flex h-14 w-full
|
|
19
|
+
}, children: [_jsx(NavigationMenuList, { className: "flex h-14 w-full items-center px-4 lg:h-12", asChild: true, children: _jsx("nav", { children: props.children }) }), _jsx(NavigationMenuViewport, {})] }) }));
|
|
20
20
|
}
|
|
21
21
|
export const NavbarMenu = NavigationMenuItem;
|
|
22
22
|
export function NavbarMenuContent(props) {
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAAE,KAAK,eAAe,EAAY,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
|
@@ -33,7 +33,7 @@ function NavbarLinkItem({ item, ...props }) {
|
|
|
33
33
|
if (child.type === 'custom')
|
|
34
34
|
return _jsx(Fragment, { children: child.children }, j);
|
|
35
35
|
const { banner = child.icon ? (_jsx("div", { className: "w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4", children: child.icon })) : null, ...rest } = child.menu ?? {};
|
|
36
|
-
return (_jsx(NavbarMenuLink, { href: child.url, ...rest, children: rest.children ?? (_jsxs(_Fragment, { children: [banner, _jsx("p", { className: "
|
|
36
|
+
return (_jsx(NavbarMenuLink, { href: child.url, external: child.external, ...rest, children: rest.children ?? (_jsxs(_Fragment, { children: [banner, _jsx("p", { className: "text-[15px] font-medium", children: child.text }), _jsx("p", { className: "text-sm text-fd-muted-foreground empty:hidden", children: child.description })] })) }, j));
|
|
37
37
|
});
|
|
38
38
|
return (_jsxs(NavbarMenu, { children: [_jsx(NavbarMenuTrigger, { ...props, children: item.url ? _jsx(Link, { href: item.url, children: item.text }) : item.text }), _jsx(NavbarMenuContent, { children: children })] }));
|
|
39
39
|
}
|
|
@@ -6,7 +6,4 @@ export declare function Navbar({ mode, ...props }: HTMLAttributes<HTMLElement> &
|
|
|
6
6
|
export declare function NavbarSidebarTrigger(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function LayoutTabs(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function LayoutTab(item: Option): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function SidebarLayoutTab({ item, ...props }: {
|
|
10
|
-
item: Option;
|
|
11
|
-
} & HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
12
9
|
//# sourceMappingURL=notebook-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook-client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,2CAoBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAmB/C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAY5D;AAUD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,2CAkBrC
|
|
1
|
+
{"version":3,"file":"notebook-client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,2CAoBxD;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,2CAmB/C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAY5D;AAUD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,2CAkBrC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from '../utils/cn.js';
|
|
4
4
|
import { useSidebar } from '../contexts/sidebar.js';
|
|
5
5
|
import { useNav } from '../contexts/layout.js';
|
|
@@ -38,9 +38,3 @@ export function LayoutTab(item) {
|
|
|
38
38
|
closeOnRedirect.current = false;
|
|
39
39
|
}, children: item.title }));
|
|
40
40
|
}
|
|
41
|
-
export function SidebarLayoutTab({ item, ...props }) {
|
|
42
|
-
const selected = useIsSelected(item);
|
|
43
|
-
return (_jsxs(Link, { ...props, className: cn('flex flex-row items-center px-2 -mx-2 py-1.5 gap-2.5 text-fd-muted-foreground [&_svg]:!size-4.5', selected
|
|
44
|
-
? 'text-fd-primary font-medium'
|
|
45
|
-
: 'hover:text-fd-accent-foreground', props.className), "data-active": selected, href: item.url, children: [item.icon, item.title] }));
|
|
46
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,kBAAkB,CAAC;AAqB/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,
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,kBAAkB,CAAC;AAqB/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,EACrB,MAAM,mBAAmB,CAAC;AAc3B,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,OAAO,CAAC,cAAc,CAAC,CAAC;IAElC,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAmKhD;AAoLD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
|
package/dist/layouts/notebook.js
CHANGED
|
@@ -11,11 +11,12 @@ import { LanguageToggle } from '../components/layout/language-toggle.js';
|
|
|
11
11
|
import { ThemeToggle } from '../components/layout/theme-toggle.js';
|
|
12
12
|
import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover.js';
|
|
13
13
|
import { getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
|
|
14
|
-
import { LayoutTab, LayoutTabs, Navbar, NavbarSidebarTrigger,
|
|
14
|
+
import { LayoutTab, LayoutTabs, Navbar, NavbarSidebarTrigger, } from './notebook-client.js';
|
|
15
15
|
import { NavProvider, StylesProvider, } from '../contexts/layout.js';
|
|
16
16
|
import { RootToggle } from '../components/layout/root-toggle.js';
|
|
17
17
|
import Link from 'fumadocs-core/link';
|
|
18
18
|
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
|
|
19
|
+
import { HideIfEmpty } from '../components/ui/hide-if-empty.js';
|
|
19
20
|
export function DocsLayout(props) {
|
|
20
21
|
const { tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, } = props;
|
|
21
22
|
const navMode = nav.mode ?? 'auto';
|
|
@@ -29,17 +30,25 @@ export function DocsLayout(props) {
|
|
|
29
30
|
toc: cn('max-xl:hidden'),
|
|
30
31
|
page: cn('mt-(--fd-nav-height)'),
|
|
31
32
|
};
|
|
33
|
+
const sidebarHeader = navMode === 'auto' && (_jsxs("div", { className: "flex justify-between max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-medium", children: nav.title }), (sidebar.collapsible ?? true) && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
34
|
+
color: 'ghost',
|
|
35
|
+
size: 'icon-sm',
|
|
36
|
+
className: 'mb-auto text-fd-muted-foreground',
|
|
37
|
+
})), children: _jsx(SidebarIcon, {}) }))] }));
|
|
32
38
|
return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsx(NavProvider, { transparentMode: transparentMode, children: _jsxs("main", { id: "nd-docs-layout", ...props.containerProps, className: cn('flex w-full flex-1 flex-row pe-(--fd-layout-offset)', variables, props.containerProps?.className), style: {
|
|
33
39
|
...layoutVariables,
|
|
34
40
|
...props.containerProps?.style,
|
|
35
41
|
}, children: [_jsxs(Sidebar, { ...sidebar, className: cn('md:ps-(--fd-layout-offset)', navMode === 'top'
|
|
36
42
|
? 'md:bg-transparent'
|
|
37
|
-
: 'md:[--fd-nav-height:0px]', sidebar.className), children: [_jsxs(SidebarHeader, { children: [
|
|
38
|
-
|
|
43
|
+
: 'md:[--fd-nav-height:0px]', sidebar.className), children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { children: [sidebarHeader, nav.children, sidebarBanner, tabMode === 'sidebar' && tabs.length > 0 ? (_jsx(RootToggle, { className: "mb-2", options: tabs })) : null, tabMode === 'navbar' && tabs.length > 0 && (_jsx(RootToggle, { options: tabs, className: "lg:hidden" }))] }) }), _jsxs(SidebarViewport, { children: [links
|
|
44
|
+
.filter((item) => item.type !== 'icon')
|
|
45
|
+
.map((item, i) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === links.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsx(HideIfEmpty, { children: _jsxs(SidebarFooter, { className: "flex flex-row items-center justify-end", children: [_jsx("div", { className: "flex items-center flex-1 empty:hidden lg:hidden", children: links
|
|
46
|
+
.filter((item) => item.type === 'icon')
|
|
47
|
+
.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({
|
|
39
48
|
size: 'icon-sm',
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
color: 'ghost',
|
|
50
|
+
className: 'text-fd-muted-foreground',
|
|
51
|
+
})), "aria-label": item.label, children: item.icon }, i))) }), i18n ? (_jsx(LanguageToggle, { className: "me-auto md:hidden", children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, slot(themeSwitch, _jsx(ThemeToggle, { className: "md:hidden", mode: themeSwitch?.mode ?? 'light-dark-system' })), sidebarFooter] }) })] }), _jsx(DocsNavbar, { ...props, links: links, tabs: tabMode == 'navbar' ? tabs : [] }), _jsx(StylesProvider, { ...pageStyles, children: props.children })] }) }) }));
|
|
43
52
|
}
|
|
44
53
|
function DocsNavbar({ links, tabs, ...props }) {
|
|
45
54
|
const navMode = props.nav?.mode ?? 'auto';
|
|
@@ -55,7 +64,7 @@ function DocsNavbar({ links, tabs, ...props }) {
|
|
|
55
64
|
.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))), props.i18n ? (_jsx(LanguageToggle, { className: "max-md:hidden", children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, slot(props.themeSwitch, _jsx(ThemeToggle, { className: "ms-2 max-md:hidden", mode: props.themeSwitch?.mode ?? 'light-dark-system' })), sidebarCollapsible && navMode === 'top' ? (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
56
65
|
color: 'secondary',
|
|
57
66
|
size: 'icon-sm',
|
|
58
|
-
}), '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
|
|
67
|
+
}), '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 h-10 max-lg:hidden", children: tabs.map((tab) => (_jsx(LayoutTab, { ...tab }, tab.url))) })) : null] }));
|
|
59
68
|
}
|
|
60
69
|
function NavbarLinkItem({ item, ...props }) {
|
|
61
70
|
if (item.type === 'menu') {
|
package/dist/mdx.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare const defaultMdxComponents: {
|
|
|
19
19
|
table: typeof Table;
|
|
20
20
|
Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
|
|
21
21
|
title?: import("react").ReactNode;
|
|
22
|
-
type?: "info" | "warn" | "error";
|
|
22
|
+
type?: "info" | "warn" | "error" | "success" | "warning";
|
|
23
23
|
icon?: import("react").ReactNode;
|
|
24
24
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
25
|
};
|
package/dist/page-client.js
CHANGED
|
@@ -21,7 +21,7 @@ export function TocPopoverTrigger({ items, ...props }) {
|
|
|
21
21
|
const selected = useMemo(() => items.findIndex((item) => active === item.url.slice(1)), [items, active]);
|
|
22
22
|
const path = useTreePath().at(-1);
|
|
23
23
|
const showItem = selected !== -1 && !open;
|
|
24
|
-
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: "grid flex-1 *: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('
|
|
24
|
+
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: "grid flex-1 *: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('transition-transform', open && 'rotate-180') })] }));
|
|
25
25
|
}
|
|
26
26
|
function clamp(input, min, max) {
|
|
27
27
|
if (input < min)
|
package/dist/page.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TableOfContents } from 'fumadocs-core/server';
|
|
2
|
-
import { type ComponentProps, type
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
3
3
|
import { type AnchorProviderProps } from 'fumadocs-core/toc';
|
|
4
4
|
import { type BreadcrumbProps, type FooterProps } from './page-client.js';
|
|
5
5
|
import { type TOCProps } from './components/layout/toc.js';
|
|
@@ -61,8 +61,8 @@ export interface DocsPageProps {
|
|
|
61
61
|
footer?: Partial<FooterOptions>;
|
|
62
62
|
editOnGithub?: EditOnGitHubOptions;
|
|
63
63
|
lastUpdate?: Date | string | number;
|
|
64
|
-
container?:
|
|
65
|
-
article?:
|
|
64
|
+
container?: ComponentProps<'div'>;
|
|
65
|
+
article?: ComponentProps<'article'>;
|
|
66
66
|
children: ReactNode;
|
|
67
67
|
}
|
|
68
68
|
export declare function DocsPage({ toc, full, editOnGithub, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopoverReplace, ...tocPopoverOptions }, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions }, ...props }: DocsPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -70,14 +70,12 @@ export declare function EditOnGitHub(props: ComponentProps<'a'>): import("react/
|
|
|
70
70
|
/**
|
|
71
71
|
* Add typography styles
|
|
72
72
|
*/
|
|
73
|
-
export declare const DocsBody: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
74
|
-
export declare const DocsDescription: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
75
|
-
export declare const DocsTitle: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
73
|
+
export declare const DocsBody: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
74
|
+
export declare const DocsDescription: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
75
|
+
export declare const DocsTitle: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
76
76
|
/**
|
|
77
77
|
* For separate MDX page
|
|
78
78
|
*/
|
|
79
|
-
export declare function withArticle(
|
|
80
|
-
children: ReactNode;
|
|
81
|
-
}): ReactNode;
|
|
79
|
+
export declare function withArticle(props: ComponentProps<'main'>): ReactNode;
|
|
82
80
|
export {};
|
|
83
81
|
//# sourceMappingURL=page.d.ts.map
|
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,
|
|
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,EAAE,KAAK,cAAc,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,WAAW,EAOjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,yBAAyB,CAAC;AAOjC,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,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACtD,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,KAAK,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAQ,EACR,IAAY,EACZ,YAAY,EACZ,qBAAqB,EAAE,EACrB,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,iBAAiB,EAC5B,GAAG,iBAAiB,EAChB,EACN,cAAc,EAAE,EACd,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,GAAG,UAAU,EACT,EACN,GAAG,KAAK,EACT,EAAE,aAAa,2CA8Ff;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,2CAuBtD;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,2MAMpB,CAAC;AAIF,eAAO,MAAM,eAAe,6NAgB1B,CAAC;AAIH,eAAO,MAAM,SAAS,uNAYrB,CAAC;AAIF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAMpE"}
|
package/dist/page.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, } from 'react';
|
|
2
|
+
import { forwardRef, lazy } from 'react';
|
|
3
3
|
import { AnchorProvider } from 'fumadocs-core/toc';
|
|
4
4
|
import { slot } from './layouts/shared.js';
|
|
5
5
|
import { cn } from './utils/cn.js';
|
|
@@ -8,7 +8,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 './icons.js';
|
|
10
10
|
import { I18nLabel } from './contexts/i18n.js';
|
|
11
|
-
|
|
11
|
+
const ClerkTOCItems = lazy(() => import('./components/layout/toc-clerk.js'));
|
|
12
12
|
export function DocsPage({ toc = [], full = false, editOnGithub, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopoverReplace, ...tocPopoverOptions } = {}, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {}, ...props }) {
|
|
13
13
|
const isTocRequired = toc.length > 0 ||
|
|
14
14
|
tocOptions.footer !== undefined ||
|
|
@@ -21,7 +21,7 @@ export function DocsPage({ toc = [], full = false, editOnGithub, tableOfContentP
|
|
|
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: [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, {
|
|
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, { className: "px-4 md:px-6", children: tocPopoverOptions.style === 'clerk' ? (_jsx(ClerkTOCItems, { items: toc })) : (_jsx(TOCItems, { items: toc })) }), tocPopoverOptions.footer] })] }), {
|
|
25
25
|
items: toc,
|
|
26
26
|
...tocPopoverOptions,
|
|
27
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: [editOnGithub && (_jsx(EditOnGitHub, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith('/') ? editOnGithub.path.slice(1) : editOnGithub.path}` })), props.lastUpdate && (_jsx(LastUpdate, { date: new Date(props.lastUpdate) }))] }), 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] }), {
|
|
@@ -55,6 +55,6 @@ DocsTitle.displayName = 'DocsTitle';
|
|
|
55
55
|
/**
|
|
56
56
|
* For separate MDX page
|
|
57
57
|
*/
|
|
58
|
-
export function withArticle(
|
|
59
|
-
return (_jsx("main", { className:
|
|
58
|
+
export function withArticle(props) {
|
|
59
|
+
return (_jsx("main", { ...props, className: cn('container py-12', props.className), children: _jsx("article", { className: "prose", children: props.children }) }));
|
|
60
60
|
}
|
package/dist/style.css
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"Courier New", monospace;
|
|
10
10
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
|
11
11
|
--color-orange-500: oklch(70.5% 0.213 47.604);
|
|
12
|
+
--color-green-500: oklch(72.3% 0.219 149.579);
|
|
12
13
|
--color-blue-500: oklch(62.3% 0.214 259.815);
|
|
13
14
|
--color-black: #000;
|
|
14
15
|
--spacing: 0.25rem;
|
|
@@ -354,9 +355,6 @@
|
|
|
354
355
|
.bottom-1\.5 {
|
|
355
356
|
bottom: calc(var(--spacing) * 1.5);
|
|
356
357
|
}
|
|
357
|
-
.left-\(--fd-nav-left\) {
|
|
358
|
-
left: var(--fd-nav-left);
|
|
359
|
-
}
|
|
360
358
|
.left-1\/2 {
|
|
361
359
|
left: calc(1/2 * 100%);
|
|
362
360
|
}
|
|
@@ -409,9 +407,6 @@
|
|
|
409
407
|
.-mx-1 {
|
|
410
408
|
margin-inline: calc(var(--spacing) * -1);
|
|
411
409
|
}
|
|
412
|
-
.-mx-2 {
|
|
413
|
-
margin-inline: calc(var(--spacing) * -2);
|
|
414
|
-
}
|
|
415
410
|
.\!my-0 {
|
|
416
411
|
margin-block: calc(var(--spacing) * 0) !important;
|
|
417
412
|
}
|
|
@@ -442,6 +437,9 @@
|
|
|
442
437
|
.ms-auto {
|
|
443
438
|
margin-inline-start: auto;
|
|
444
439
|
}
|
|
440
|
+
.ms-px {
|
|
441
|
+
margin-inline-start: 1px;
|
|
442
|
+
}
|
|
445
443
|
.-me-\(--fd-sidebar-width\) {
|
|
446
444
|
margin-inline-end: calc(var(--fd-sidebar-width) * -1);
|
|
447
445
|
}
|
|
@@ -847,9 +845,6 @@
|
|
|
847
845
|
.mr-auto {
|
|
848
846
|
margin-right: auto;
|
|
849
847
|
}
|
|
850
|
-
.-mb-1 {
|
|
851
|
-
margin-bottom: calc(var(--spacing) * -1);
|
|
852
|
-
}
|
|
853
848
|
.mb-1 {
|
|
854
849
|
margin-bottom: calc(var(--spacing) * 1);
|
|
855
850
|
}
|
|
@@ -889,6 +884,19 @@
|
|
|
889
884
|
.table {
|
|
890
885
|
display: table;
|
|
891
886
|
}
|
|
887
|
+
.fd-scroll-container {
|
|
888
|
+
&::-webkit-scrollbar {
|
|
889
|
+
width: 5px;
|
|
890
|
+
height: 5px;
|
|
891
|
+
}
|
|
892
|
+
&::-webkit-scrollbar-thumb {
|
|
893
|
+
border-radius: 5px;
|
|
894
|
+
background: var(--color-fd-border);
|
|
895
|
+
}
|
|
896
|
+
&::-webkit-scrollbar-track {
|
|
897
|
+
background: transparent;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
892
900
|
.size-3 {
|
|
893
901
|
width: calc(var(--spacing) * 3);
|
|
894
902
|
height: calc(var(--spacing) * 3);
|
|
@@ -947,6 +955,9 @@
|
|
|
947
955
|
.max-h-\[50vh\] {
|
|
948
956
|
max-height: 50vh;
|
|
949
957
|
}
|
|
958
|
+
.max-h-\[80svh\] {
|
|
959
|
+
max-height: 80svh;
|
|
960
|
+
}
|
|
950
961
|
.max-h-\[400px\] {
|
|
951
962
|
max-height: 400px;
|
|
952
963
|
}
|
|
@@ -1001,6 +1012,9 @@
|
|
|
1001
1012
|
.w-full {
|
|
1002
1013
|
width: 100%;
|
|
1003
1014
|
}
|
|
1015
|
+
.w-max {
|
|
1016
|
+
width: max-content;
|
|
1017
|
+
}
|
|
1004
1018
|
.w-px {
|
|
1005
1019
|
width: 1px;
|
|
1006
1020
|
}
|
|
@@ -1040,6 +1054,9 @@
|
|
|
1040
1054
|
.min-w-\[220px\] {
|
|
1041
1055
|
min-width: 220px;
|
|
1042
1056
|
}
|
|
1057
|
+
.min-w-full {
|
|
1058
|
+
min-width: 100%;
|
|
1059
|
+
}
|
|
1043
1060
|
.flex-1 {
|
|
1044
1061
|
flex: 1;
|
|
1045
1062
|
}
|
|
@@ -1265,6 +1282,12 @@
|
|
|
1265
1282
|
border-inline-start-color: color-mix(in oklab, var(--color-blue-500) 50%, transparent);
|
|
1266
1283
|
}
|
|
1267
1284
|
}
|
|
1285
|
+
.border-s-green-500\/50 {
|
|
1286
|
+
border-inline-start-color: color-mix(in srgb, oklch(72.3% 0.219 149.579) 50%, transparent);
|
|
1287
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1288
|
+
border-inline-start-color: color-mix(in oklab, var(--color-green-500) 50%, transparent);
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1268
1291
|
.border-s-orange-500\/50 {
|
|
1269
1292
|
border-inline-start-color: color-mix(in srgb, oklch(70.5% 0.213 47.604) 50%, transparent);
|
|
1270
1293
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1343,6 +1366,9 @@
|
|
|
1343
1366
|
.fill-blue-500 {
|
|
1344
1367
|
fill: var(--color-blue-500);
|
|
1345
1368
|
}
|
|
1369
|
+
.fill-green-500 {
|
|
1370
|
+
fill: var(--color-green-500);
|
|
1371
|
+
}
|
|
1346
1372
|
.fill-orange-500 {
|
|
1347
1373
|
fill: var(--color-orange-500);
|
|
1348
1374
|
}
|
|
@@ -1421,6 +1447,9 @@
|
|
|
1421
1447
|
.py-3 {
|
|
1422
1448
|
padding-block: calc(var(--spacing) * 3);
|
|
1423
1449
|
}
|
|
1450
|
+
.py-3\.5 {
|
|
1451
|
+
padding-block: calc(var(--spacing) * 3.5);
|
|
1452
|
+
}
|
|
1424
1453
|
.py-8 {
|
|
1425
1454
|
padding-block: calc(var(--spacing) * 8);
|
|
1426
1455
|
}
|
|
@@ -1442,9 +1471,6 @@
|
|
|
1442
1471
|
.ps-\[calc\(var\(--fd-layout-offset\)\+var\(--fd-sidebar-width\)\)\] {
|
|
1443
1472
|
padding-inline-start: calc(var(--fd-layout-offset) + var(--fd-sidebar-width));
|
|
1444
1473
|
}
|
|
1445
|
-
.ps-px {
|
|
1446
|
-
padding-inline-start: 1px;
|
|
1447
|
-
}
|
|
1448
1474
|
.pe-\(--fd-layout-offset\) {
|
|
1449
1475
|
padding-inline-end: var(--fd-layout-offset);
|
|
1450
1476
|
}
|
|
@@ -1457,8 +1483,8 @@
|
|
|
1457
1483
|
.pt-0 {
|
|
1458
1484
|
padding-top: calc(var(--spacing) * 0);
|
|
1459
1485
|
}
|
|
1460
|
-
.pt-
|
|
1461
|
-
padding-top: calc(var(--spacing) *
|
|
1486
|
+
.pt-1\.5 {
|
|
1487
|
+
padding-top: calc(var(--spacing) * 1.5);
|
|
1462
1488
|
}
|
|
1463
1489
|
.pt-8 {
|
|
1464
1490
|
padding-top: calc(var(--spacing) * 8);
|
|
@@ -1472,6 +1498,9 @@
|
|
|
1472
1498
|
.pb-2 {
|
|
1473
1499
|
padding-bottom: calc(var(--spacing) * 2);
|
|
1474
1500
|
}
|
|
1501
|
+
.pb-4 {
|
|
1502
|
+
padding-bottom: calc(var(--spacing) * 4);
|
|
1503
|
+
}
|
|
1475
1504
|
.pb-6 {
|
|
1476
1505
|
padding-bottom: calc(var(--spacing) * 6);
|
|
1477
1506
|
}
|
|
@@ -1587,9 +1616,6 @@
|
|
|
1587
1616
|
.opacity-0 {
|
|
1588
1617
|
opacity: 0%;
|
|
1589
1618
|
}
|
|
1590
|
-
.opacity-50 {
|
|
1591
|
-
opacity: 50%;
|
|
1592
|
-
}
|
|
1593
1619
|
.shadow-lg {
|
|
1594
1620
|
--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1595
1621
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -1683,6 +1709,9 @@
|
|
|
1683
1709
|
.\[--fd-tocnav-height\:36px\] {
|
|
1684
1710
|
--fd-tocnav-height: 36px;
|
|
1685
1711
|
}
|
|
1712
|
+
.\[scrollbar-width\:none\] {
|
|
1713
|
+
scrollbar-width: none;
|
|
1714
|
+
}
|
|
1686
1715
|
.\*\:col-start-1 {
|
|
1687
1716
|
:is(& > *) {
|
|
1688
1717
|
grid-column-start: 1;
|
|
@@ -1693,14 +1722,14 @@
|
|
|
1693
1722
|
grid-row-start: 1;
|
|
1694
1723
|
}
|
|
1695
1724
|
}
|
|
1696
|
-
.\*\:
|
|
1725
|
+
.\*\:flex {
|
|
1697
1726
|
:is(& > *) {
|
|
1698
|
-
display:
|
|
1727
|
+
display: flex;
|
|
1699
1728
|
}
|
|
1700
1729
|
}
|
|
1701
|
-
.\*\:
|
|
1730
|
+
.\*\:flex-col {
|
|
1702
1731
|
:is(& > *) {
|
|
1703
|
-
|
|
1732
|
+
flex-direction: column;
|
|
1704
1733
|
}
|
|
1705
1734
|
}
|
|
1706
1735
|
.group-hover\:opacity-100 {
|
|
@@ -1872,6 +1901,11 @@
|
|
|
1872
1901
|
display: none;
|
|
1873
1902
|
}
|
|
1874
1903
|
}
|
|
1904
|
+
.data-\[empty\=true\]\:hidden {
|
|
1905
|
+
&[data-empty="true"] {
|
|
1906
|
+
display: none;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1875
1909
|
.data-\[motion\=from-end\]\:animate-fd-enterFromRight {
|
|
1876
1910
|
&[data-motion="from-end"] {
|
|
1877
1911
|
animation: var(--animate-fd-enterFromRight);
|
|
@@ -2025,21 +2059,6 @@
|
|
|
2025
2059
|
background-color: var(--color-fd-background);
|
|
2026
2060
|
}
|
|
2027
2061
|
}
|
|
2028
|
-
.max-md\:pt-6 {
|
|
2029
|
-
@media (width < 48rem) {
|
|
2030
|
-
padding-top: calc(var(--spacing) * 6);
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
.max-md\:pb-4 {
|
|
2034
|
-
@media (width < 48rem) {
|
|
2035
|
-
padding-bottom: calc(var(--spacing) * 4);
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
.max-md\:pb-6 {
|
|
2039
|
-
@media (width < 48rem) {
|
|
2040
|
-
padding-bottom: calc(var(--spacing) * 6);
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
2062
|
.max-sm\:mt-2 {
|
|
2044
2063
|
@media (width < 40rem) {
|
|
2045
2064
|
margin-top: calc(var(--spacing) * 2);
|
|
@@ -2172,11 +2191,6 @@
|
|
|
2172
2191
|
height: calc(var(--spacing) * 12);
|
|
2173
2192
|
}
|
|
2174
2193
|
}
|
|
2175
|
-
.lg\:w-\[calc\(100\%-1rem\)\] {
|
|
2176
|
-
@media (width >= 64rem) {
|
|
2177
|
-
width: calc(100% - 1rem);
|
|
2178
|
-
}
|
|
2179
|
-
}
|
|
2180
2194
|
.lg\:grid-cols-3 {
|
|
2181
2195
|
@media (width >= 64rem) {
|
|
2182
2196
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
@@ -2208,6 +2222,11 @@
|
|
|
2208
2222
|
--fd-nav-height: calc(var(--spacing) * 24);
|
|
2209
2223
|
}
|
|
2210
2224
|
}
|
|
2225
|
+
.lg\:\[--fd-padding\:1rem\] {
|
|
2226
|
+
@media (width >= 64rem) {
|
|
2227
|
+
--fd-padding: 1rem;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2211
2230
|
.lg\:\[--fd-sidebar-width\:286px\] {
|
|
2212
2231
|
@media (width >= 64rem) {
|
|
2213
2232
|
--fd-sidebar-width: 286px;
|
|
@@ -2270,10 +2289,14 @@
|
|
|
2270
2289
|
background-color: var(--shiki-dark-bg);
|
|
2271
2290
|
}
|
|
2272
2291
|
}
|
|
2273
|
-
.\[\&
|
|
2274
|
-
&
|
|
2275
|
-
|
|
2276
|
-
|
|
2292
|
+
.\[\&_\.line\]\:px-4 {
|
|
2293
|
+
& .line {
|
|
2294
|
+
padding-inline: calc(var(--spacing) * 4);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
.\[\&_\.line\]\:pl-3 {
|
|
2298
|
+
& .line {
|
|
2299
|
+
padding-left: calc(var(--spacing) * 3);
|
|
2277
2300
|
}
|
|
2278
2301
|
}
|
|
2279
2302
|
.\[\&_svg\]\:size-3\.5 {
|
|
@@ -2357,9 +2380,39 @@
|
|
|
2357
2380
|
code span {
|
|
2358
2381
|
color: var(--shiki-light);
|
|
2359
2382
|
}
|
|
2383
|
+
code .line {
|
|
2384
|
+
line-height: 1.45em;
|
|
2385
|
+
min-height: 1.45em;
|
|
2386
|
+
position: relative;
|
|
2387
|
+
}
|
|
2388
|
+
&.has-focused code .line:not(.focused) {
|
|
2389
|
+
filter: blur(2px);
|
|
2390
|
+
transition: filter 200ms;
|
|
2391
|
+
}
|
|
2392
|
+
&.has-focused:hover code .line:not(.focused) {
|
|
2393
|
+
filter: blur(0);
|
|
2394
|
+
}
|
|
2395
|
+
&[data-line-numbers] code .twoslash-meta-line {
|
|
2396
|
+
margin-left: calc(var(--spacing) * 7);
|
|
2397
|
+
}
|
|
2398
|
+
&[data-line-numbers] code .line {
|
|
2399
|
+
width: calc(100% - 7 * var(--spacing));
|
|
2400
|
+
counter-increment: line;
|
|
2401
|
+
margin-left: calc(var(--spacing) * 7);
|
|
2402
|
+
&::after {
|
|
2403
|
+
position: absolute;
|
|
2404
|
+
content: counter(line);
|
|
2405
|
+
top: calc(var(--spacing) * 0);
|
|
2406
|
+
left: calc(var(--spacing) * -5);
|
|
2407
|
+
color: color-mix(in srgb, hsl(0, 0%, 45.1%) 60%, transparent);
|
|
2408
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2409
|
+
color: color-mix(in oklab, var(--color-fd-muted-foreground) 60%, transparent);
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2360
2413
|
code .diff::before {
|
|
2361
2414
|
position: absolute;
|
|
2362
|
-
left:
|
|
2415
|
+
left: var(--spacing);
|
|
2363
2416
|
}
|
|
2364
2417
|
code .diff.remove {
|
|
2365
2418
|
opacity: 0.7;
|
|
@@ -2376,35 +2429,28 @@
|
|
|
2376
2429
|
content: '+';
|
|
2377
2430
|
color: var(--color-fd-diff-add-symbol);
|
|
2378
2431
|
}
|
|
2379
|
-
code .diff {
|
|
2380
|
-
width: calc(100% + 8 * var(--spacing));
|
|
2381
|
-
position: relative;
|
|
2382
|
-
margin-inline: calc(var(--spacing) * -4);
|
|
2383
|
-
display: inline-block;
|
|
2384
|
-
padding-inline: calc(var(--spacing) * 4);
|
|
2385
|
-
}
|
|
2386
2432
|
.highlighted {
|
|
2387
|
-
width: calc(100% + 8 * var(--spacing));
|
|
2388
|
-
margin-inline: calc(var(--spacing) * -4);
|
|
2389
|
-
display: inline-block;
|
|
2390
2433
|
background-color: color-mix(in srgb, hsl(0, 0%, 9%) 10%, transparent);
|
|
2391
2434
|
@supports (color: color-mix(in lab, red, red)) {
|
|
2392
2435
|
background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
|
|
2393
2436
|
}
|
|
2394
|
-
padding-inline: calc(var(--spacing) * 4);
|
|
2395
2437
|
}
|
|
2396
2438
|
.highlighted-word {
|
|
2397
|
-
padding: 1px
|
|
2398
|
-
margin: -1px
|
|
2399
|
-
border:
|
|
2439
|
+
padding: 1px;
|
|
2440
|
+
margin-block: -1px;
|
|
2441
|
+
border-radius: var(--radius-md);
|
|
2442
|
+
border-style: var(--tw-border-style);
|
|
2443
|
+
border-width: 1px;
|
|
2444
|
+
border-color: color-mix(in srgb, hsl(0, 0%, 9%) 30%, transparent);
|
|
2400
2445
|
@supports (color: color-mix(in lab, red, red)) {
|
|
2401
|
-
border:
|
|
2446
|
+
border-color: color-mix(in oklab, var(--color-fd-primary) 30%, transparent);
|
|
2402
2447
|
}
|
|
2403
|
-
background-color: color-mix(
|
|
2448
|
+
background-color: color-mix(in srgb, hsl(0, 0%, 9%) 10%, transparent);
|
|
2404
2449
|
@supports (color: color-mix(in lab, red, red)) {
|
|
2405
|
-
background-color: color-mix(
|
|
2450
|
+
background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
|
|
2406
2451
|
}
|
|
2407
|
-
|
|
2452
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
2453
|
+
font-weight: var(--font-weight-medium);
|
|
2408
2454
|
}
|
|
2409
2455
|
}
|
|
2410
2456
|
.dark .shiki:not(.not-fumadocs-codeblock *) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.3.
|
|
3
|
+
"version": "15.3.2",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"react-medium-image-zoom": "^5.2.14",
|
|
90
90
|
"react-remove-scroll": "^2.6.3",
|
|
91
91
|
"tailwind-merge": "^3.2.0",
|
|
92
|
-
"fumadocs-core": "15.3.
|
|
92
|
+
"fumadocs-core": "15.3.2"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@next/eslint-plugin-next": "^15.3.1",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"tsc-alias": "^1.8.16",
|
|
103
103
|
"@fumadocs/cli": "0.1.1",
|
|
104
104
|
"eslint-config-custom": "0.0.0",
|
|
105
|
-
"fumadocs-core": "15.3.
|
|
105
|
+
"fumadocs-core": "15.3.2",
|
|
106
106
|
"tsconfig": "0.0.0"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|