fumadocs-ui 15.7.8 → 15.7.9
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/neutral.css +1 -1
- package/dist/components/codeblock.js +2 -2
- package/dist/components/layout/sidebar.js +2 -2
- package/dist/components/type-table.d.ts +18 -10
- package/dist/components/type-table.d.ts.map +1 -1
- package/dist/components/type-table.js +17 -14
- package/dist/provider/base.js +0 -1
- package/dist/style.css +31 -18
- package/package.json +3 -3
package/css/neutral.css
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
--color-fd-popover-foreground: hsl(0, 0%, 15.1%);
|
|
8
8
|
--color-fd-card: hsl(0, 0%, 94.7%);
|
|
9
9
|
--color-fd-card-foreground: hsl(0, 0%, 3.9%);
|
|
10
|
-
--color-fd-border: hsla(0, 0%,
|
|
10
|
+
--color-fd-border: hsla(0, 0%, 80%, 50%);
|
|
11
11
|
--color-fd-primary: hsl(0, 0%, 9%);
|
|
12
12
|
--color-fd-primary-foreground: hsl(0, 0%, 98%);
|
|
13
13
|
--color-fd-secondary: hsl(0, 0%, 93.1%);
|
|
@@ -15,7 +15,7 @@ export function CodeBlock({ ref, title, allowCopy, keepBackground = false, icon,
|
|
|
15
15
|
const inTab = useContext(TabsContext) !== null;
|
|
16
16
|
const areaRef = useRef(null);
|
|
17
17
|
allowCopy ?? (allowCopy = !inTab);
|
|
18
|
-
return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn(inTab ? 'bg-fd-secondary' : 'my-4 bg-fd-card', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)', 'shiki relative border shadow-
|
|
18
|
+
return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn(inTab ? 'bg-fd-secondary' : 'my-4 bg-fd-card', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)', 'shiki relative border shadow-sm rounded-xl outline-none not-prose overflow-hidden text-sm', props.className), children: [title ? (_jsxs("div", { className: "flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4", children: [typeof icon === 'string' ? (_jsx("div", { className: "[&_svg]:size-3.5", dangerouslySetInnerHTML: {
|
|
19
19
|
__html: icon,
|
|
20
20
|
} })) : (icon), _jsx("figcaption", { className: "flex-1 truncate", children: title }), Actions({
|
|
21
21
|
className: '-me-2',
|
|
@@ -51,7 +51,7 @@ function CopyButton({ className, containerRef, ...props }) {
|
|
|
51
51
|
export function CodeBlockTabs({ ref, ...props }) {
|
|
52
52
|
const containerRef = useRef(null);
|
|
53
53
|
const nested = useContext(TabsContext) !== null;
|
|
54
|
-
return (_jsx(Tabs, { ref: mergeRefs(containerRef, ref), ...props, className: cn('bg-fd-card rounded-xl border', nested
|
|
54
|
+
return (_jsx(Tabs, { ref: mergeRefs(containerRef, ref), ...props, className: cn('bg-fd-card rounded-xl border', !nested && 'my-4', props.className), children: _jsx(TabsContext.Provider, { value: useMemo(() => ({
|
|
55
55
|
containerRef,
|
|
56
56
|
nested,
|
|
57
57
|
}), [nested]), children: props.children }) }));
|
|
@@ -14,7 +14,7 @@ import { cva } from 'class-variance-authority';
|
|
|
14
14
|
import { useTreeContext, useTreePath } from '../../contexts/tree.js';
|
|
15
15
|
import { useMediaQuery } from 'fumadocs-core/utils/use-media-query';
|
|
16
16
|
import { Presence } from '@radix-ui/react-presence';
|
|
17
|
-
const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-
|
|
17
|
+
const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-lg p-2 ps-(--sidebar-item-offset) text-start text-fd-muted-foreground [overflow-wrap:anywhere] [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
18
18
|
variants: {
|
|
19
19
|
active: {
|
|
20
20
|
true: 'bg-fd-primary/10 text-fd-primary',
|
|
@@ -44,7 +44,7 @@ export function SidebarContent(props) {
|
|
|
44
44
|
setHover(false);
|
|
45
45
|
closeTimeRef.current = Date.now() + 150;
|
|
46
46
|
});
|
|
47
|
-
return (_jsx("aside", { id: "nd-sidebar", ...props, "data-collapsed": collapsed, className: cn('fixed left-0 rtl:left-auto rtl:right-(--removed-body-scroll-bar-size,0) flex flex-col items-end top-(--fd-sidebar-top) bottom-(--fd-sidebar-margin) z-20 bg-fd-card text-sm border-e transition-[top,opacity,translate,width] max-md:hidden *:w-(--fd-sidebar-width)', collapsed && [
|
|
47
|
+
return (_jsx("aside", { id: "nd-sidebar", ...props, "data-collapsed": collapsed, className: cn('fixed left-0 rtl:left-auto rtl:right-(--removed-body-scroll-bar-size,0) flex flex-col items-end top-(--fd-sidebar-top) bottom-(--fd-sidebar-margin) z-20 bg-fd-card text-sm border-e transition-[top,opacity,translate,width] duration-200 max-md:hidden *:w-(--fd-sidebar-width)', collapsed && [
|
|
48
48
|
'rounded-xl border translate-x-(--fd-sidebar-offset) rtl:-translate-x-(--fd-sidebar-offset)',
|
|
49
49
|
hover ? 'z-50 shadow-lg' : 'opacity-0',
|
|
50
50
|
], props.className), style: {
|
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ParameterNode {
|
|
3
|
+
name: string;
|
|
4
|
+
description: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface TypeNode {
|
|
6
7
|
/**
|
|
7
8
|
* Additional description of the field
|
|
8
9
|
*/
|
|
9
10
|
description?: ReactNode;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* type signature (short)
|
|
13
|
+
*/
|
|
14
|
+
type: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* type signature (full)
|
|
17
|
+
*/
|
|
11
18
|
typeDescription?: ReactNode;
|
|
12
19
|
/**
|
|
13
|
-
* Optional
|
|
20
|
+
* Optional `href` for the type
|
|
14
21
|
*/
|
|
15
22
|
typeDescriptionLink?: string;
|
|
16
|
-
default?:
|
|
23
|
+
default?: ReactNode;
|
|
17
24
|
required?: boolean;
|
|
18
25
|
deprecated?: boolean;
|
|
26
|
+
parameters?: ParameterNode[];
|
|
27
|
+
returns?: ReactNode;
|
|
19
28
|
}
|
|
20
29
|
export declare function TypeTable({ type }: {
|
|
21
|
-
type: Record<string,
|
|
30
|
+
type: Record<string, TypeNode>;
|
|
22
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {};
|
|
24
32
|
//# sourceMappingURL=type-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-table.d.ts","sourceRoot":"","sources":["../../src/components/type-table.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-table.d.ts","sourceRoot":"","sources":["../../src/components/type-table.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAOjD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAE5B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAE7B,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAYD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;CAAE,2CAYrE"}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown } from '../icons.js';
|
|
4
4
|
import Link from 'fumadocs-core/link';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { cn } from '../utils/cn.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
const field = cva('inline-flex flex-row items-center gap-1');
|
|
12
|
-
const code = cva('rounded-md bg-fd-secondary p-1 text-fd-secondary-foreground', {
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../components/ui/collapsible.js';
|
|
9
|
+
const keyVariants = cva('text-fd-primary', {
|
|
13
10
|
variants: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
deprecated: 'line-through text-fd-primary/50',
|
|
11
|
+
deprecated: {
|
|
12
|
+
true: 'line-through text-fd-primary/50',
|
|
17
13
|
},
|
|
18
14
|
},
|
|
19
15
|
});
|
|
16
|
+
const fieldVariants = cva('text-fd-muted-foreground not-prose');
|
|
20
17
|
export function TypeTable({ type }) {
|
|
21
|
-
return (
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
return (_jsxs("div", { className: "@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden", children: [_jsxs("div", { className: "flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground", children: [_jsx("p", { className: "w-[25%]", children: "Prop" }), _jsx("p", { className: "@max-xl:hidden", children: "Type" })] }), Object.entries(type).map(([key, value]) => (_jsx(Item, { name: key, item: value }, key)))] }));
|
|
19
|
+
}
|
|
20
|
+
function Item({ name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns, }, }) {
|
|
21
|
+
const [open, setOpen] = useState(false);
|
|
22
|
+
return (_jsxs(Collapsible, { open: open, onOpenChange: setOpen, className: cn('rounded-xl border overflow-hidden transition-all', open
|
|
23
|
+
? 'shadow-sm bg-fd-background not-last:mb-2'
|
|
24
|
+
: 'border-transparent'), children: [_jsxs(CollapsibleTrigger, { className: "relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent", children: [_jsx("span", { className: "pe-2 min-w-fit font-medium w-[25%]", children: _jsxs("code", { className: cn(keyVariants({
|
|
25
|
+
deprecated,
|
|
26
|
+
})), children: [name, !required && '?'] }) }), typeDescriptionLink ? (_jsx(Link, { href: typeDescriptionLink, className: "underline @max-xl:hidden", children: type })) : (_jsx("span", { className: "@max-xl:hidden", children: type })), _jsx(ChevronDown, { className: "absolute end-2 size-4 text-fd-muted-foreground transition-transform group-data-[state=open]:rotate-180" })] }), _jsx(CollapsibleContent, { children: _jsxs("div", { className: "grid grid-cols-[1fr_3fr] gap-x-2 gap-y-4 text-sm p-3 overflow-auto fd-scroll-container border-t", children: [_jsx("div", { className: "text-sm prose col-span-full prose-no-margin empty:hidden", children: description }), typeDescription && (_jsxs(_Fragment, { children: [_jsx("p", { className: cn(fieldVariants()), children: "Type" }), _jsx("p", { className: "my-auto not-prose", children: typeDescription })] })), defaultValue && (_jsxs(_Fragment, { children: [_jsx("p", { className: cn(fieldVariants()), children: "Default" }), _jsx("p", { className: "my-auto not-prose", children: defaultValue })] })), parameters.length > 0 && (_jsxs(_Fragment, { children: [_jsx("p", { className: cn(fieldVariants()), children: "Parameters" }), _jsx("div", { className: "flex flex-col gap-2", children: parameters.map((param) => (_jsxs("div", { className: "inline-flex items-center gap-1", children: [_jsxs("p", { className: "font-medium not-prose", children: [param.name, " -"] }), _jsx("div", { className: "text-sm prose prose-no-margin", children: param.description })] }, param.name))) })] })), returns && (_jsxs(_Fragment, { children: [_jsx("p", { className: cn(fieldVariants()), children: "Returns" }), _jsx("div", { className: "my-auto text-sm prose prose-no-margin", children: returns })] }))] }) })] }));
|
|
24
27
|
}
|
package/dist/provider/base.js
CHANGED
package/dist/style.css
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
--color-fd-popover-foreground: hsl(0, 0%, 15.1%);
|
|
45
45
|
--color-fd-card: hsl(0, 0%, 94.7%);
|
|
46
46
|
--color-fd-card-foreground: hsl(0, 0%, 3.9%);
|
|
47
|
-
--color-fd-border: hsla(0, 0%,
|
|
47
|
+
--color-fd-border: hsla(0, 0%, 80%, 50%);
|
|
48
48
|
--color-fd-primary: hsl(0, 0%, 9%);
|
|
49
49
|
--color-fd-primary-foreground: hsl(0, 0%, 98%);
|
|
50
50
|
--color-fd-secondary: hsl(0, 0%, 93.1%);
|
|
@@ -400,6 +400,9 @@
|
|
|
400
400
|
.z-\[-1\] {
|
|
401
401
|
z-index: -1;
|
|
402
402
|
}
|
|
403
|
+
.col-span-full {
|
|
404
|
+
grid-column: 1 / -1;
|
|
405
|
+
}
|
|
403
406
|
.container {
|
|
404
407
|
width: 100%;
|
|
405
408
|
@media (width >= 40rem) {
|
|
@@ -1009,9 +1012,6 @@
|
|
|
1009
1012
|
.max-h-\[80svh\] {
|
|
1010
1013
|
max-height: 80svh;
|
|
1011
1014
|
}
|
|
1012
|
-
.max-h-\[400px\] {
|
|
1013
|
-
max-height: 400px;
|
|
1014
|
-
}
|
|
1015
1015
|
.max-h-\[460px\] {
|
|
1016
1016
|
max-height: 460px;
|
|
1017
1017
|
}
|
|
@@ -1036,14 +1036,8 @@
|
|
|
1036
1036
|
.w-1\.5 {
|
|
1037
1037
|
width: calc(var(--spacing) * 1.5);
|
|
1038
1038
|
}
|
|
1039
|
-
.w
|
|
1040
|
-
width:
|
|
1041
|
-
}
|
|
1042
|
-
.w-\[30\%\] {
|
|
1043
|
-
width: 30%;
|
|
1044
|
-
}
|
|
1045
|
-
.w-\[45\%\] {
|
|
1046
|
-
width: 45%;
|
|
1039
|
+
.w-\[25\%\] {
|
|
1040
|
+
width: 25%;
|
|
1047
1041
|
}
|
|
1048
1042
|
.w-\[85\%\] {
|
|
1049
1043
|
width: 85%;
|
|
@@ -1078,9 +1072,6 @@
|
|
|
1078
1072
|
.max-w-\[380px\] {
|
|
1079
1073
|
max-width: 380px;
|
|
1080
1074
|
}
|
|
1081
|
-
.max-w-\[400px\] {
|
|
1082
|
-
max-width: 400px;
|
|
1083
|
-
}
|
|
1084
1075
|
.max-w-\[860px\] {
|
|
1085
1076
|
max-width: 860px;
|
|
1086
1077
|
}
|
|
@@ -1096,12 +1087,12 @@
|
|
|
1096
1087
|
.min-w-0 {
|
|
1097
1088
|
min-width: calc(var(--spacing) * 0);
|
|
1098
1089
|
}
|
|
1099
|
-
.min-w-\[220px\] {
|
|
1100
|
-
min-width: 220px;
|
|
1101
|
-
}
|
|
1102
1090
|
.min-w-\[240px\] {
|
|
1103
1091
|
min-width: 240px;
|
|
1104
1092
|
}
|
|
1093
|
+
.min-w-fit {
|
|
1094
|
+
min-width: fit-content;
|
|
1095
|
+
}
|
|
1105
1096
|
.min-w-full {
|
|
1106
1097
|
min-width: 100%;
|
|
1107
1098
|
}
|
|
@@ -1167,6 +1158,9 @@
|
|
|
1167
1158
|
.grid-cols-2 {
|
|
1168
1159
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1169
1160
|
}
|
|
1161
|
+
.grid-cols-\[1fr_3fr\] {
|
|
1162
|
+
grid-template-columns: 1fr 3fr;
|
|
1163
|
+
}
|
|
1170
1164
|
.flex-col {
|
|
1171
1165
|
flex-direction: column;
|
|
1172
1166
|
}
|
|
@@ -1221,6 +1215,12 @@
|
|
|
1221
1215
|
.gap-6 {
|
|
1222
1216
|
gap: calc(var(--spacing) * 6);
|
|
1223
1217
|
}
|
|
1218
|
+
.gap-x-2 {
|
|
1219
|
+
column-gap: calc(var(--spacing) * 2);
|
|
1220
|
+
}
|
|
1221
|
+
.gap-y-4 {
|
|
1222
|
+
row-gap: calc(var(--spacing) * 4);
|
|
1223
|
+
}
|
|
1224
1224
|
.divide-y {
|
|
1225
1225
|
:where(& > :not(:last-child)) {
|
|
1226
1226
|
--tw-divide-y-reverse: 0;
|
|
@@ -1506,6 +1506,9 @@
|
|
|
1506
1506
|
.pe-\(--fd-toc-width\) {
|
|
1507
1507
|
padding-inline-end: var(--fd-toc-width);
|
|
1508
1508
|
}
|
|
1509
|
+
.pe-2 {
|
|
1510
|
+
padding-inline-end: calc(var(--spacing) * 2);
|
|
1511
|
+
}
|
|
1509
1512
|
.pe-2\.5 {
|
|
1510
1513
|
padding-inline-end: calc(var(--spacing) * 2.5);
|
|
1511
1514
|
}
|
|
@@ -1841,6 +1844,11 @@
|
|
|
1841
1844
|
border-bottom-width: 1px;
|
|
1842
1845
|
}
|
|
1843
1846
|
}
|
|
1847
|
+
.not-last\:mb-2 {
|
|
1848
|
+
&:not(*:last-child) {
|
|
1849
|
+
margin-bottom: calc(var(--spacing) * 2);
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1844
1852
|
.group-data-\[state\=active\]\:bg-fd-primary {
|
|
1845
1853
|
&:is(:where(.group)[data-state="active"] *) {
|
|
1846
1854
|
background-color: var(--color-fd-primary);
|
|
@@ -2496,6 +2504,11 @@
|
|
|
2496
2504
|
--fd-toc-width: 286px;
|
|
2497
2505
|
}
|
|
2498
2506
|
}
|
|
2507
|
+
.\@max-xl\:hidden {
|
|
2508
|
+
@container (width < 36rem) {
|
|
2509
|
+
display: none;
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2499
2512
|
.\@max-lg\:col-span-full {
|
|
2500
2513
|
@container (width < 32rem) {
|
|
2501
2514
|
grid-column: 1 / -1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "15.7.
|
|
3
|
+
"version": "15.7.9",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"react-medium-image-zoom": "^5.3.0",
|
|
122
122
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
123
123
|
"tailwind-merge": "^3.3.1",
|
|
124
|
-
"fumadocs-core": "15.7.
|
|
124
|
+
"fumadocs-core": "15.7.9"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@next/eslint-plugin-next": "^15.5.2",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"tsc-alias": "^1.8.16",
|
|
135
135
|
"@fumadocs/cli": "1.0.1",
|
|
136
136
|
"eslint-config-custom": "0.0.0",
|
|
137
|
-
"fumadocs-core": "15.7.
|
|
137
|
+
"fumadocs-core": "15.7.9",
|
|
138
138
|
"tsconfig": "0.0.0"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|