@fumadocs/ui 16.4.2 → 16.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ @import './index.css';
2
+
3
+ @theme {
4
+ --color-fd-background: hsl(165, 45%, 96%);
5
+ --color-fd-foreground: hsl(165, 40%, 18%);
6
+ --color-fd-primary: hsl(168, 70%, 40%);
7
+ --color-fd-primary-foreground: hsl(168, 100%, 12%);
8
+ --color-fd-border: hsla(168, 40%, 70%, 0.5);
9
+ --color-fd-ring: hsl(168, 70%, 40%);
10
+ --color-fd-accent: hsl(165, 50%, 90%);
11
+ --color-fd-accent-foreground: hsl(168, 70%, 20%);
12
+ --color-fd-muted: hsl(165, 40%, 92%);
13
+ --color-fd-muted-foreground: hsl(165, 30%, 45%);
14
+ --color-fd-secondary: hsl(168, 45%, 88%);
15
+ --color-fd-secondary-foreground: hsl(168, 60%, 18%);
16
+ --color-fd-card: hsl(165, 45%, 94%);
17
+ --color-fd-card-foreground: hsl(165, 40%, 18%);
18
+ --color-fd-popover: hsl(165, 45%, 97%);
19
+ --color-fd-popover-foreground: hsl(165, 40%, 18%);
20
+ }
21
+
22
+ .dark {
23
+ --color-fd-background: hsl(200, 30%, 7%);
24
+ --color-fd-foreground: hsl(168, 40%, 88%);
25
+ --color-fd-primary: hsl(168, 70%, 60%);
26
+ --color-fd-primary-foreground: hsl(200, 40%, 8%);
27
+ --color-fd-border: hsla(168, 40%, 35%, 0.35);
28
+ --color-fd-ring: hsl(168, 70%, 60%);
29
+ --color-fd-accent: hsl(200, 30%, 18%);
30
+ --color-fd-accent-foreground: hsl(168, 70%, 75%);
31
+ --color-fd-muted: hsl(200, 30%, 12%);
32
+ --color-fd-muted-foreground: hsl(168, 25%, 65%);
33
+ --color-fd-secondary: hsl(200, 30%, 16%);
34
+ --color-fd-secondary-foreground: hsl(168, 40%, 88%);
35
+ --color-fd-card: hsl(200, 30%, 10%);
36
+ --color-fd-card-foreground: hsl(168, 40%, 88%);
37
+ --color-fd-popover: hsl(200, 30%, 8%);
38
+ --color-fd-popover-foreground: hsl(168, 40%, 88%);
39
+ }
@@ -1,12 +1,12 @@
1
1
  import { ComponentProps } from "react";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/toc/clerk.d.ts
5
5
  declare function TOCItems({
6
6
  ref,
7
7
  className,
8
8
  ...props
9
- }: ComponentProps<'div'>): react_jsx_runtime7.JSX.Element;
9
+ }: ComponentProps<'div'>): react_jsx_runtime8.JSX.Element;
10
10
  //#endregion
11
11
  export { TOCItems };
12
12
  //# sourceMappingURL=clerk.d.ts.map
@@ -57,7 +57,7 @@ function TOCItems({ ref, className, ...props }) {
57
57
  },
58
58
  children: /* @__PURE__ */ jsx(TocThumb, {
59
59
  containerRef,
60
- className: "absolute w-full top-(--fd-top) h-(--fd-height) bg-fd-primary transition-[top,height] ease-linear duration-250"
60
+ className: "absolute w-full top-(--fd-top) h-(--fd-height) bg-fd-primary transition-[top,height]"
61
61
  })
62
62
  }), /* @__PURE__ */ jsx("div", {
63
63
  ref: mergeRefs(containerRef, ref),
@@ -1 +1 @@
1
- {"version":3,"file":"clerk.js","names":["d: string[]","element: HTMLElement | null"],"sources":["../../../src/components/toc/clerk.tsx"],"sourcesContent":["'use client';\nimport * as Primitive from 'fumadocs-core/toc';\nimport { type ComponentProps, useEffect, useRef, useState } from 'react';\nimport { cn } from '@/cn';\nimport { TocThumb, useTOCItems } from '.';\nimport { mergeRefs } from '@/merge-refs';\nimport { useI18n } from '@/contexts/i18n';\n\nexport function TOCItems({ ref, className, ...props }: ComponentProps<'div'>) {\n const containerRef = useRef<HTMLDivElement>(null);\n const items = useTOCItems();\n const { text } = useI18n();\n\n const [svg, setSvg] = useState<{\n path: string;\n width: number;\n height: number;\n }>();\n\n useEffect(() => {\n if (!containerRef.current) return;\n const container = containerRef.current;\n\n function onResize(): void {\n if (container.clientHeight === 0) return;\n let w = 0,\n h = 0;\n const d: string[] = [];\n for (let i = 0; i < items.length; i++) {\n const element: HTMLElement | null = container.querySelector(\n `a[href=\"#${items[i].url.slice(1)}\"]`,\n );\n if (!element) continue;\n\n const styles = getComputedStyle(element);\n const offset = getLineOffset(items[i].depth) + 1,\n top = element.offsetTop + parseFloat(styles.paddingTop),\n bottom = element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom);\n\n w = Math.max(offset, w);\n h = Math.max(h, bottom);\n\n d.push(`${i === 0 ? 'M' : 'L'}${offset} ${top}`);\n d.push(`L${offset} ${bottom}`);\n }\n\n setSvg({\n path: d.join(' '),\n width: w + 1,\n height: h,\n });\n }\n\n const observer = new ResizeObserver(onResize);\n onResize();\n\n observer.observe(container);\n return () => {\n observer.disconnect();\n };\n }, [items]);\n\n if (items.length === 0)\n return (\n <div className=\"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground\">\n {text.tocNoHeadings}\n </div>\n );\n\n return (\n <>\n {svg && (\n <div\n className=\"absolute start-0 top-0 rtl:-scale-x-100\"\n style={{\n width: svg.width,\n height: svg.height,\n maskImage: `url(\"data:image/svg+xml,${\n // Inline SVG\n encodeURIComponent(\n `<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>`,\n )\n }\")`,\n }}\n >\n <TocThumb\n containerRef={containerRef}\n className=\"absolute w-full top-(--fd-top) h-(--fd-height) bg-fd-primary transition-[top,height] ease-linear duration-250\"\n />\n </div>\n )}\n <div ref={mergeRefs(containerRef, ref)} className={cn('flex flex-col', className)} {...props}>\n {items.map((item, i) => (\n <TOCItem\n key={item.url}\n item={item}\n upper={items[i - 1]?.depth}\n lower={items[i + 1]?.depth}\n />\n ))}\n </div>\n </>\n );\n}\n\nfunction getItemOffset(depth: number): number {\n if (depth <= 2) return 14;\n if (depth === 3) return 26;\n return 36;\n}\n\nfunction getLineOffset(depth: number): number {\n return depth >= 3 ? 10 : 0;\n}\n\nfunction TOCItem({\n item,\n upper = item.depth,\n lower = item.depth,\n}: {\n item: Primitive.TOCItemType;\n upper?: number;\n lower?: number;\n}) {\n const offset = getLineOffset(item.depth),\n upperOffset = getLineOffset(upper),\n lowerOffset = getLineOffset(lower);\n\n return (\n <Primitive.TOCItem\n href={item.url}\n style={{\n paddingInlineStart: getItemOffset(item.depth),\n }}\n className=\"prose relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary\"\n >\n {offset !== upperOffset && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n className=\"absolute -top-1.5 start-0 size-4 rtl:-scale-x-100\"\n >\n <line\n x1={upperOffset}\n y1=\"0\"\n x2={offset}\n y2=\"12\"\n className=\"stroke-fd-foreground/10\"\n strokeWidth=\"1\"\n />\n </svg>\n )}\n <div\n className={cn(\n 'absolute inset-y-0 w-px bg-fd-foreground/10',\n offset !== upperOffset && 'top-1.5',\n offset !== lowerOffset && 'bottom-1.5',\n )}\n style={{\n insetInlineStart: offset,\n }}\n />\n {item.title}\n </Primitive.TOCItem>\n );\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,SAAS,EAAE,KAAK,WAAW,GAAG,SAAgC;CAC5E,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,QAAQ,aAAa;CAC3B,MAAM,EAAE,SAAS,SAAS;CAE1B,MAAM,CAAC,KAAK,UAAU,UAIlB;AAEJ,iBAAgB;AACd,MAAI,CAAC,aAAa,QAAS;EAC3B,MAAM,YAAY,aAAa;EAE/B,SAAS,WAAiB;AACxB,OAAI,UAAU,iBAAiB,EAAG;GAClC,IAAI,IAAI,GACN,IAAI;GACN,MAAMA,IAAc,EAAE;AACtB,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAA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OAAuB;AAC5C,KAAI,SAAS,EAAG,QAAO;AACvB,KAAI,UAAU,EAAG,QAAO;AACxB,QAAO;;AAGT,SAAS,cAAc,OAAuB;AAC5C,QAAO,SAAS,IAAI,KAAK;;AAG3B,SAAS,QAAQ,EACf,MACA,QAAQ,KAAK,OACb,QAAQ,KAAK,SAKZ;CACD,MAAM,SAAS,cAAc,KAAK,MAAM,EACtC,cAAc,cAAc,MAAM,EAClC,cAAc,cAAc,MAAM;AAEpC,QACE,qBAAC,UAAU;EACT,MAAM,KAAK;EACX,OAAO,EACL,oBAAoB,cAAc,KAAK,MAAM,EAC9C;EACD,WAAU;;GAET,WAAW,eACV,oBAAC;IACC,OAAM;IACN,SAAQ;IACR,WAAU;cAEV,oBAAC;KACC,IAAI;KACJ,IAAG;KACH,IAAI;KACJ,IAAG;KACH,WAAU;KACV,aAAY;MACZ;KACE;GAER,oBAAC;IACC,WAAW,GACT,+CACA,WAAW,eAAe,WAC1B,WAAW,eAAe,aAC3B;IACD,OAAO,EACL,kBAAkB,QACnB;KACD;GACD,KAAK;;GACY"}
1
+ {"version":3,"file":"clerk.js","names":["d: string[]","element: HTMLElement | null"],"sources":["../../../src/components/toc/clerk.tsx"],"sourcesContent":["'use client';\nimport * as Primitive from 'fumadocs-core/toc';\nimport { type ComponentProps, useEffect, useRef, useState } from 'react';\nimport { cn } from '@/cn';\nimport { TocThumb, useTOCItems } from '.';\nimport { mergeRefs } from '@/merge-refs';\nimport { useI18n } from '@/contexts/i18n';\n\nexport function TOCItems({ ref, className, ...props }: ComponentProps<'div'>) {\n const containerRef = useRef<HTMLDivElement>(null);\n const items = useTOCItems();\n const { text } = useI18n();\n\n const [svg, setSvg] = useState<{\n path: string;\n width: number;\n height: number;\n }>();\n\n useEffect(() => {\n if (!containerRef.current) return;\n const container = containerRef.current;\n\n function onResize(): void {\n if (container.clientHeight === 0) return;\n let w = 0,\n h = 0;\n const d: string[] = [];\n for (let i = 0; i < items.length; i++) {\n const element: HTMLElement | null = container.querySelector(\n `a[href=\"#${items[i].url.slice(1)}\"]`,\n );\n if (!element) continue;\n\n const styles = getComputedStyle(element);\n const offset = getLineOffset(items[i].depth) + 1,\n top = element.offsetTop + parseFloat(styles.paddingTop),\n bottom = element.offsetTop + element.clientHeight - parseFloat(styles.paddingBottom);\n\n w = Math.max(offset, w);\n h = Math.max(h, bottom);\n\n d.push(`${i === 0 ? 'M' : 'L'}${offset} ${top}`);\n d.push(`L${offset} ${bottom}`);\n }\n\n setSvg({\n path: d.join(' '),\n width: w + 1,\n height: h,\n });\n }\n\n const observer = new ResizeObserver(onResize);\n onResize();\n\n observer.observe(container);\n return () => {\n observer.disconnect();\n };\n }, [items]);\n\n if (items.length === 0)\n return (\n <div className=\"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground\">\n {text.tocNoHeadings}\n </div>\n );\n\n return (\n <>\n {svg && (\n <div\n className=\"absolute start-0 top-0 rtl:-scale-x-100\"\n style={{\n width: svg.width,\n height: svg.height,\n maskImage: `url(\"data:image/svg+xml,${\n // Inline SVG\n encodeURIComponent(\n `<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>`,\n )\n }\")`,\n }}\n >\n <TocThumb\n containerRef={containerRef}\n className=\"absolute w-full top-(--fd-top) h-(--fd-height) bg-fd-primary transition-[top,height]\"\n />\n </div>\n )}\n <div ref={mergeRefs(containerRef, ref)} className={cn('flex flex-col', className)} {...props}>\n {items.map((item, i) => (\n <TOCItem\n key={item.url}\n item={item}\n upper={items[i - 1]?.depth}\n lower={items[i + 1]?.depth}\n />\n ))}\n </div>\n </>\n );\n}\n\nfunction getItemOffset(depth: number): number {\n if (depth <= 2) return 14;\n if (depth === 3) return 26;\n return 36;\n}\n\nfunction getLineOffset(depth: number): number {\n return depth >= 3 ? 10 : 0;\n}\n\nfunction TOCItem({\n item,\n upper = item.depth,\n lower = item.depth,\n}: {\n item: Primitive.TOCItemType;\n upper?: number;\n lower?: number;\n}) {\n const offset = getLineOffset(item.depth),\n upperOffset = getLineOffset(upper),\n lowerOffset = getLineOffset(lower);\n\n return (\n <Primitive.TOCItem\n href={item.url}\n style={{\n paddingInlineStart: getItemOffset(item.depth),\n }}\n className=\"prose relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors wrap-anywhere first:pt-0 last:pb-0 data-[active=true]:text-fd-primary\"\n >\n {offset !== upperOffset && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n className=\"absolute -top-1.5 start-0 size-4 rtl:-scale-x-100\"\n >\n <line\n x1={upperOffset}\n y1=\"0\"\n x2={offset}\n y2=\"12\"\n className=\"stroke-fd-foreground/10\"\n strokeWidth=\"1\"\n />\n </svg>\n )}\n <div\n className={cn(\n 'absolute inset-y-0 w-px bg-fd-foreground/10',\n offset !== upperOffset && 'top-1.5',\n offset !== lowerOffset && 'bottom-1.5',\n )}\n style={{\n insetInlineStart: offset,\n }}\n />\n {item.title}\n </Primitive.TOCItem>\n );\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,SAAS,EAAE,KAAK,WAAW,GAAG,SAAgC;CAC5E,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,QAAQ,aAAa;CAC3B,MAAM,EAAE,SAAS,SAAS;CAE1B,MAAM,CAAC,KAAK,UAAU,UAIlB;AAEJ,iBAAgB;AACd,MAAI,CAAC,aAAa,QAAS;EAC3B,MAAM,YAAY,aAAa;EAE/B,SAAS,WAAiB;AACxB,OAAI,UAAU,iBAAiB,EAAG;GAClC,IAAI,IAAI,GACN,IAAI;GACN,MAAMA,IAAc,EAAE;AACtB,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;IACrC,MAAMC,UAA8B,UAAU,cAC5C,YAAY,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC,IACnC;AACD,QAAI,CAAC,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AC5C,QAAO,SAAS,IAAI,KAAK;;AAG3B,SAAS,QAAQ,EACf,MACA,QAAQ,KAAK,OACb,QAAQ,KAAK,SAKZ;CACD,MAAM,SAAS,cAAc,KAAK,MAAM,EACtC,cAAc,cAAc,MAAM,EAClC,cAAc,cAAc,MAAM;AAEpC,QACE,qBAAC,UAAU;EACT,MAAM,KAAK;EACX,OAAO,EACL,oBAAoB,cAAc,KAAK,MAAM,EAC9C;EACD,WAAU;;GAET,WAAW,eACV,oBAAC;IACC,OAAM;IACN,SAAQ;IACR,WAAU;cAEV,oBAAC;KACC,IAAI;KACJ,IAAG;KACH,IAAI;KACJ,IAAG;KACH,WAAU;KACV,aAAY;MACZ;KACE;GAER,oBAAC;IACC,WAAW,GACT,+CACA,WAAW,eAAe,WAC1B,WAAW,eAAe,aAC3B;IACD,OAAO,EACL,kBAAkB,QACnB;KACD;GACD,KAAK;;GACY"}
@@ -1,12 +1,12 @@
1
1
  import { ComponentProps } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/toc/default.d.ts
5
5
  declare function TOCItems({
6
6
  ref,
7
7
  className,
8
8
  ...props
9
- }: ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
9
+ }: ComponentProps<'div'>): react_jsx_runtime3.JSX.Element;
10
10
  //#endregion
11
11
  export { TOCItems };
12
12
  //# sourceMappingURL=default.d.ts.map
@@ -19,7 +19,7 @@ function TOCItems({ ref, className, ...props }) {
19
19
  });
20
20
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TocThumb, {
21
21
  containerRef,
22
- className: "absolute top-(--fd-top) h-(--fd-height) w-0.5 rounded-e-sm bg-fd-primary transition-[top,height] ease-linear duration-250"
22
+ className: "absolute top-(--fd-top) h-(--fd-height) w-0.5 rounded-e-sm bg-fd-primary transition-[top,height] ease-linear"
23
23
  }), /* @__PURE__ */ jsx("div", {
24
24
  ref: mergeRefs(ref, containerRef),
25
25
  className: cn("flex flex-col border-s border-fd-foreground/10", className),
@@ -1 +1 @@
1
- {"version":3,"file":"default.js","names":[],"sources":["../../../src/components/toc/default.tsx"],"sourcesContent":["'use client';\nimport { useI18n } from '@/contexts/i18n';\nimport { cn } from '@/cn';\nimport { type ComponentProps, useRef } from 'react';\nimport { mergeRefs } from '@/merge-refs';\nimport { TocThumb, useTOCItems } from '.';\nimport * as Primitive from 'fumadocs-core/toc';\n\nexport function TOCItems({ ref, className, ...props }: ComponentProps<'div'>) {\n const containerRef = useRef<HTMLDivElement>(null);\n const items = useTOCItems();\n const { text } = useI18n();\n\n if (items.length === 0)\n return (\n <div className=\"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground\">\n {text.tocNoHeadings}\n </div>\n );\n\n return (\n <>\n <TocThumb\n containerRef={containerRef}\n className=\"absolute top-(--fd-top) h-(--fd-height) w-0.5 rounded-e-sm bg-fd-primary transition-[top,height] ease-linear duration-250\"\n />\n <div\n ref={mergeRefs(ref, containerRef)}\n className={cn('flex flex-col border-s border-fd-foreground/10', className)}\n {...props}\n >\n {items.map((item) => (\n <TOCItem key={item.url} item={item} />\n ))}\n </div>\n </>\n );\n}\n\nfunction TOCItem({ item }: { item: Primitive.TOCItemType }) {\n return (\n <Primitive.TOCItem\n href={item.url}\n className={cn(\n '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',\n item.depth <= 2 && 'ps-3',\n item.depth === 3 && 'ps-6',\n item.depth >= 4 && 'ps-8',\n )}\n >\n {item.title}\n </Primitive.TOCItem>\n );\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,SAAS,EAAE,KAAK,WAAW,GAAG,SAAgC;CAC5E,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,QAAQ,aAAa;CAC3B,MAAM,EAAE,SAAS,SAAS;AAE1B,KAAI,MAAM,WAAW,EACnB,QACE,oBAAC;EAAI,WAAU;YACZ,KAAK;GACF;AAGV,QACE,4CACE,oBAAC;EACe;EACd,WAAU;GACV,EACF,oBAAC;EACC,KAAK,UAAU,KAAK,aAAa;EACjC,WAAW,GAAG,kDAAkD,UAAU;EAC1E,GAAI;YAEH,MAAM,KAAK,SACV,oBAAC,WAA6B,QAAhB,KAAK,IAAmB,CACtC;GACE,IACL;;AAIP,SAAS,QAAQ,EAAE,QAAyC;AAC1D,QACE,oBAAC,UAAU;EACT,MAAM,KAAK;EACX,WAAW,GACT,yIACA,KAAK,SAAS,KAAK,QACnB,KAAK,UAAU,KAAK,QACpB,KAAK,SAAS,KAAK,OACpB;YAEA,KAAK;GACY"}
1
+ {"version":3,"file":"default.js","names":[],"sources":["../../../src/components/toc/default.tsx"],"sourcesContent":["'use client';\nimport { useI18n } from '@/contexts/i18n';\nimport { cn } from '@/cn';\nimport { type ComponentProps, useRef } from 'react';\nimport { mergeRefs } from '@/merge-refs';\nimport { TocThumb, useTOCItems } from '.';\nimport * as Primitive from 'fumadocs-core/toc';\n\nexport function TOCItems({ ref, className, ...props }: ComponentProps<'div'>) {\n const containerRef = useRef<HTMLDivElement>(null);\n const items = useTOCItems();\n const { text } = useI18n();\n\n if (items.length === 0)\n return (\n <div className=\"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground\">\n {text.tocNoHeadings}\n </div>\n );\n\n return (\n <>\n <TocThumb\n containerRef={containerRef}\n className=\"absolute top-(--fd-top) h-(--fd-height) w-0.5 rounded-e-sm bg-fd-primary transition-[top,height] ease-linear\"\n />\n <div\n ref={mergeRefs(ref, containerRef)}\n className={cn('flex flex-col border-s border-fd-foreground/10', className)}\n {...props}\n >\n {items.map((item) => (\n <TOCItem key={item.url} item={item} />\n ))}\n </div>\n </>\n );\n}\n\nfunction TOCItem({ item }: { item: Primitive.TOCItemType }) {\n return (\n <Primitive.TOCItem\n href={item.url}\n className={cn(\n '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',\n item.depth <= 2 && 'ps-3',\n item.depth === 3 && 'ps-6',\n item.depth >= 4 && 'ps-8',\n )}\n >\n {item.title}\n </Primitive.TOCItem>\n );\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,SAAS,EAAE,KAAK,WAAW,GAAG,SAAgC;CAC5E,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,QAAQ,aAAa;CAC3B,MAAM,EAAE,SAAS,SAAS;AAE1B,KAAI,MAAM,WAAW,EACnB,QACE,oBAAC;EAAI,WAAU;YACZ,KAAK;GACF;AAGV,QACE,4CACE,oBAAC;EACe;EACd,WAAU;GACV,EACF,oBAAC;EACC,KAAK,UAAU,KAAK,aAAa;EACjC,WAAW,GAAG,kDAAkD,UAAU;EAC1E,GAAI;YAEH,MAAM,KAAK,SACV,oBAAC,WAA6B,QAAhB,KAAK,IAAmB,CACtC;GACE,IACL;;AAIP,SAAS,QAAQ,EAAE,QAAyC;AAC1D,QACE,oBAAC,UAAU;EACT,MAAM,KAAK;EACX,WAAW,GACT,yIACA,KAAK,SAAS,KAAK,QACnB,KAAK,UAAU,KAAK,QACpB,KAAK,SAAS,KAAK,OACpB;YAEA,KAAK;GACY"}
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, RefObject } from "react";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
  import * as Primitive from "fumadocs-core/toc";
4
4
 
5
5
  //#region src/components/toc/index.d.ts
@@ -8,19 +8,19 @@ declare function TOCProvider({
8
8
  toc,
9
9
  children,
10
10
  ...props
11
- }: ComponentProps<typeof Primitive.AnchorProvider>): react_jsx_runtime1.JSX.Element;
11
+ }: ComponentProps<typeof Primitive.AnchorProvider>): react_jsx_runtime5.JSX.Element;
12
12
  declare function TOCScrollArea({
13
13
  ref,
14
14
  className,
15
15
  ...props
16
- }: ComponentProps<'div'>): react_jsx_runtime1.JSX.Element;
16
+ }: ComponentProps<'div'>): react_jsx_runtime5.JSX.Element;
17
17
  interface RefProps {
18
18
  containerRef: RefObject<HTMLElement | null>;
19
19
  }
20
20
  declare function TocThumb({
21
21
  containerRef,
22
22
  ...props
23
- }: ComponentProps<'div'> & RefProps): react_jsx_runtime1.JSX.Element;
23
+ }: ComponentProps<'div'> & RefProps): react_jsx_runtime5.JSX.Element;
24
24
  //#endregion
25
25
  export { TOCProvider, TOCScrollArea, TocThumb, useTOCItems };
26
26
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/contexts/i18n.d.ts
5
5
  interface Translations {
@@ -54,7 +54,7 @@ declare function I18nProvider({
54
54
  onLocaleChange,
55
55
  children,
56
56
  translations
57
- }: I18nProviderProps): react_jsx_runtime5.JSX.Element;
57
+ }: I18nProviderProps): react_jsx_runtime2.JSX.Element;
58
58
  //#endregion
59
59
  export { I18nLabel, I18nProvider, I18nProviderProps, LocaleItem, Translations, defaultTranslations, useI18n };
60
60
  //# sourceMappingURL=i18n.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, ReactNode } from "react";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/contexts/search.d.ts
5
5
  interface HotKey {
@@ -60,7 +60,7 @@ declare function SearchProvider({
60
60
  options,
61
61
  hotKey,
62
62
  links
63
- }: SearchProviderProps): react_jsx_runtime6.JSX.Element;
63
+ }: SearchProviderProps): react_jsx_runtime0.JSX.Element;
64
64
  /**
65
65
  * Show children only when search is enabled via React Context
66
66
  */
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
  import * as PageTree from "fumadocs-core/page-tree";
4
4
 
5
5
  //#region src/contexts/tree.d.ts
@@ -14,7 +14,7 @@ declare function TreeContextProvider({
14
14
  }: {
15
15
  tree: PageTree.Root;
16
16
  children: ReactNode;
17
- }): react_jsx_runtime8.JSX.Element;
17
+ }): react_jsx_runtime1.JSX.Element;
18
18
  declare function useTreePath(): PageTree.Node[];
19
19
  declare function useTreeContext(): TreeContextType;
20
20
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, ReactNode } from "react";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/link-item.d.ts
5
5
  interface Filterable {
@@ -80,7 +80,7 @@ declare function LinkItem({
80
80
  ...props
81
81
  }: Omit<ComponentProps<'a'>, 'href'> & {
82
82
  item: WithHref;
83
- }): react_jsx_runtime4.JSX.Element;
83
+ }): react_jsx_runtime0.JSX.Element;
84
84
  //#endregion
85
85
  export { ButtonItemType, CustomItemType, IconItemType, LinkItem, LinkItemType, MainItemType, MenuItemType };
86
86
  //# sourceMappingURL=link-item.d.ts.map
package/dist/og/next.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
3
3
  import { ImageResponse } from "next/og";
4
4
  import { ImageResponseOptions } from "next/dist/compiled/@vercel/og/types";
5
5
 
@@ -17,7 +17,7 @@ declare function generate({
17
17
  primaryColor,
18
18
  primaryTextColor,
19
19
  ...props
20
- }: GenerateProps): react_jsx_runtime0.JSX.Element;
20
+ }: GenerateProps): react_jsx_runtime4.JSX.Element;
21
21
  //#endregion
22
22
  export { generate, generateOGImage };
23
23
  //# sourceMappingURL=next.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fumadocs/ui",
3
- "version": "16.4.2",
3
+ "version": "16.4.4",
4
4
  "description": "The low-level primitives for Fumadocs UI.",
5
5
  "keywords": [
6
6
  "Docs",
@@ -29,7 +29,7 @@
29
29
  "next-themes": "^0.4.6",
30
30
  "postcss-selector-parser": "^7.1.1",
31
31
  "tailwind-merge": "^3.4.0",
32
- "fumadocs-core": "16.4.2"
32
+ "fumadocs-core": "16.4.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/bun": "^1.3.5",
@@ -41,10 +41,10 @@
41
41
  "lodash.merge": "^4.6.2",
42
42
  "next": "16.1.1",
43
43
  "tailwindcss": "^4.1.18",
44
- "tsdown": "^0.18.3",
45
- "@fumadocs/cli": "1.2.1",
44
+ "tsdown": "^0.18.4",
45
+ "@fumadocs/cli": "1.2.2",
46
46
  "eslint-config-custom": "0.0.0",
47
- "fumadocs-core": "16.4.2",
47
+ "fumadocs-core": "16.4.4",
48
48
  "tsconfig": "0.0.0"
49
49
  },
50
50
  "peerDependencies": {