@fumadocs/ui 16.4.0 → 16.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/toc/clerk.js +1 -1
- package/dist/components/toc/default.js +1 -1
- package/dist/components/toc/index.d.ts.map +1 -1
- package/dist/components/toc/index.js +12 -9
- package/dist/icons.d.ts +1 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +11 -0
- package/package.json +4 -4
|
@@ -54,7 +54,7 @@ export function TOCItems({ ref, className, ...props }) {
|
|
|
54
54
|
maskImage: `url("data:image/svg+xml,${
|
|
55
55
|
// Inline SVG
|
|
56
56
|
encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${svg.width} ${svg.height}"><path d="${svg.path}" stroke="black" stroke-width="1" fill="none" /></svg>`)}")`,
|
|
57
|
-
}, children: _jsx(TocThumb, { containerRef: containerRef, className: "
|
|
57
|
+
}, children: _jsx(TocThumb, { containerRef: containerRef, className: "absolute w-full top-(--fd-top) h-(--fd-height) bg-fd-primary transition-[top,height] ease-linear" }) })), _jsx("div", { ref: mergeRefs(containerRef, ref), className: cn('flex flex-col', className), ...props, children: items.map((item, i) => (_jsx(TOCItem, { item: item, upper: items[i - 1]?.depth, lower: items[i + 1]?.depth }, item.url))) })] }));
|
|
58
58
|
}
|
|
59
59
|
function getItemOffset(depth) {
|
|
60
60
|
if (depth <= 2)
|
|
@@ -12,7 +12,7 @@ export function TOCItems({ ref, className, ...props }) {
|
|
|
12
12
|
const { text } = useI18n();
|
|
13
13
|
if (items.length === 0)
|
|
14
14
|
return (_jsx("div", { className: "rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground", children: text.tocNoHeadings }));
|
|
15
|
-
return (_jsxs(_Fragment, { children: [_jsx(TocThumb, { containerRef: containerRef, className: "absolute top-0 translate-y-(--fd-top) h-(--fd-height) w-px bg-fd-primary transition-[translate,height]" }), _jsx("div", { ref: mergeRefs(ref, containerRef), className: cn('flex flex-col border-s border-fd-foreground/10', className), ...props, children: items.map((item) => (_jsx(TOCItem, { item: item }, item.url))) })] }));
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx(TocThumb, { containerRef: containerRef, className: "absolute top-0 translate-y-(--fd-top) h-(--fd-height) w-px bg-fd-primary transition-[translate,height] ease-linear" }), _jsx("div", { ref: mergeRefs(ref, containerRef), className: cn('flex flex-col border-s border-fd-foreground/10', className), ...props, children: items.map((item) => (_jsx(TOCItem, { item: item }, item.url))) })] }));
|
|
16
16
|
}
|
|
17
17
|
function TOCItem({ item }) {
|
|
18
18
|
return (_jsx(Primitive.TOCItem, { href: item.url, className: cn('prose py-1.5 text-sm text-fd-muted-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary', item.depth <= 2 && 'ps-3', item.depth === 3 && 'ps-6', item.depth >= 4 && 'ps-8'), children: item.title }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toc/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAOf,wBAAgB,WAAW,IAAI,SAAS,CAAC,WAAW,EAAE,CAErD;AAED,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,2CAQjD;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CAiBvB;AAID,UAAU,QAAQ;IAChB,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC7C;AAED,wBAAgB,QAAQ,CAAC,EACvB,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toc/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAOf,wBAAgB,WAAW,IAAI,SAAS,CAAC,WAAW,EAAE,CAErD;AAED,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,2CAQjD;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CAiBvB;AAID,UAAU,QAAQ;IAChB,YAAY,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC7C;AAED,wBAAgB,QAAQ,CAAC,EACvB,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,QAAQ,2CAmClC"}
|
|
@@ -19,10 +19,17 @@ export function TOCScrollArea({ ref, className, ...props }) {
|
|
|
19
19
|
export function TocThumb({ containerRef, ...props }) {
|
|
20
20
|
const thumbRef = useRef(null);
|
|
21
21
|
const active = Primitive.useActiveAnchors();
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
function update(info) {
|
|
23
|
+
const element = thumbRef.current;
|
|
24
|
+
if (!element)
|
|
24
25
|
return;
|
|
25
|
-
|
|
26
|
+
element.style.setProperty('--fd-top', `${info[0]}px`);
|
|
27
|
+
element.style.setProperty('--fd-height', `${info[1]}px`);
|
|
28
|
+
}
|
|
29
|
+
const onPrint = useEffectEvent(() => {
|
|
30
|
+
if (containerRef.current) {
|
|
31
|
+
update(calc(containerRef.current, active));
|
|
32
|
+
}
|
|
26
33
|
});
|
|
27
34
|
useEffect(() => {
|
|
28
35
|
if (!containerRef.current)
|
|
@@ -35,8 +42,8 @@ export function TocThumb({ containerRef, ...props }) {
|
|
|
35
42
|
};
|
|
36
43
|
}, [containerRef]);
|
|
37
44
|
useOnChange(active, () => {
|
|
38
|
-
if (containerRef.current
|
|
39
|
-
update(
|
|
45
|
+
if (containerRef.current) {
|
|
46
|
+
update(calc(containerRef.current, active));
|
|
40
47
|
}
|
|
41
48
|
});
|
|
42
49
|
return _jsx("div", { ref: thumbRef, role: "none", ...props });
|
|
@@ -58,7 +65,3 @@ function calc(container, active) {
|
|
|
58
65
|
}
|
|
59
66
|
return [upper, lower - upper];
|
|
60
67
|
}
|
|
61
|
-
function update(element, info) {
|
|
62
|
-
element.style.setProperty('--fd-top', `${info[0]}px`);
|
|
63
|
-
element.style.setProperty('--fd-height', `${info[1]}px`);
|
|
64
|
-
}
|
package/dist/icons.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const Search: import("react").ForwardRefExoticComponent<Omit<Luci
|
|
|
20
20
|
export declare const ExternalLink: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
21
21
|
export declare const Moon: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
22
22
|
export declare const Sun: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
23
|
+
export declare const LightBulb: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
23
24
|
export declare const Airplay: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
24
25
|
export declare const Menu: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
25
26
|
export declare const X: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
package/dist/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAC;AAcvE,KAAK,cAAc,GACf,QAAQ,GACR,SAAS,GACT,GAAG,GACH,MAAM,GACN,MAAM,GACN,SAAS,GACT,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,KAAK,CAAC;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAC9B,EAAE,CAAC;AAyBJ,eAAO,MAAM,WAAW,oHAEtB,CAAC;AAEH,eAAO,MAAM,SAAS,oHAOpB,CAAC;AAEH,eAAO,MAAM,OAAO,oHAMlB,CAAC;AAEH,eAAO,MAAM,cAAc,oHAGzB,CAAC;AAEH,eAAO,MAAM,MAAM,oHAGjB,CAAC;AAEH,eAAO,MAAM,YAAY,oHAUvB,CAAC;AAEH,eAAO,MAAM,IAAI,oHAEf,CAAC;AAEH,eAAO,MAAM,GAAG,oHAUd,CAAC;AAEH,eAAO,MAAM,OAAO,oHASlB,CAAC;AAEH,eAAO,MAAM,IAAI,oHAIf,CAAC;AAEH,eAAO,MAAM,CAAC,oHAGZ,CAAC;AAEH,eAAO,MAAM,YAAY,oHAEvB,CAAC;AAEH,eAAO,MAAM,WAAW,oHAGtB,CAAC;AAEH,eAAO,MAAM,OAAO,oHAIlB,CAAC;AAEH,eAAO,MAAM,KAAK,oHAEhB,CAAC;AAEH,eAAO,MAAM,aAAa,oHAUxB,CAAC;AAEH,eAAO,MAAM,IAAI,oHAIf,CAAC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('sun', [
|
|
|
74
74
|
['path', { d: 'm6.34 17.66-1.41 1.41', key: '1m8zz5' }],
|
|
75
75
|
['path', { d: 'm19.07 4.93-1.41 1.41', key: '1shlcs' }],
|
|
76
76
|
]);
|
|
77
|
+
export const LightBulb = createLucideIcon('svg', [
|
|
78
|
+
[
|
|
79
|
+
'path',
|
|
80
|
+
{
|
|
81
|
+
d: 'M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5',
|
|
82
|
+
key: '1gvzjb',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
['path', { d: 'M9 18h6', key: 'x1upvd' }],
|
|
86
|
+
['path', { d: 'M10 22h4', key: 'ceow96' }],
|
|
87
|
+
]);
|
|
77
88
|
export const Airplay = createLucideIcon('airplay', [
|
|
78
89
|
[
|
|
79
90
|
'path',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fumadocs/ui",
|
|
3
|
-
"version": "16.4.
|
|
3
|
+
"version": "16.4.1",
|
|
4
4
|
"description": "The low-level primitives for Fumadocs UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fumadocs",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"next-themes": "^0.4.6",
|
|
28
28
|
"postcss-selector-parser": "^7.1.1",
|
|
29
29
|
"tailwind-merge": "^3.4.0",
|
|
30
|
-
"fumadocs-core": "16.4.
|
|
30
|
+
"fumadocs-core": "16.4.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/bun": "^1.3.5",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"next": "16.1.1",
|
|
40
40
|
"tailwindcss": "^4.1.18",
|
|
41
41
|
"tsc-alias": "^1.8.16",
|
|
42
|
-
"eslint-config-custom": "0.0.0",
|
|
43
|
-
"fumadocs-core": "16.4.0",
|
|
44
42
|
"@fumadocs/cli": "1.2.0",
|
|
43
|
+
"eslint-config-custom": "0.0.0",
|
|
44
|
+
"fumadocs-core": "16.4.1",
|
|
45
45
|
"tsconfig": "0.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|