fumadocs-ui 15.5.2 → 15.5.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.
package/css/neutral.css CHANGED
@@ -12,7 +12,7 @@
12
12
  --color-fd-primary-foreground: hsl(0, 0%, 98%);
13
13
  --color-fd-secondary: hsl(0, 0%, 93.1%);
14
14
  --color-fd-secondary-foreground: hsl(0, 0%, 9%);
15
- --color-fd-accent: hsl(0, 0%, 90.1%);
15
+ --color-fd-accent: hsla(0, 0%, 82%, 50%);
16
16
  --color-fd-accent-foreground: hsl(0, 0%, 9%);
17
17
  --color-fd-ring: hsl(0, 0%, 63.9%);
18
18
  }
@@ -22,8 +22,8 @@
22
22
  --color-fd-foreground: hsl(0, 0%, 92%);
23
23
  --color-fd-muted: hsl(0, 0%, 12.9%);
24
24
  --color-fd-muted-foreground: hsl(0, 0%, 60.9%);
25
- --color-fd-popover: hsl(0, 0%, 9.8%);
26
- --color-fd-popover-foreground: hsl(0, 0%, 88%);
25
+ --color-fd-popover: hsl(0, 0%, 10.6%);
26
+ --color-fd-popover-foreground: hsl(0, 0%, 86.9%);
27
27
  --color-fd-card: hsl(0, 0%, 9.8%);
28
28
  --color-fd-card-foreground: hsl(0, 0%, 98%);
29
29
  --color-fd-border: hsla(0, 0%, 40%, 20%);
@@ -31,7 +31,7 @@
31
31
  --color-fd-primary-foreground: hsl(0, 0%, 9%);
32
32
  --color-fd-secondary: hsl(0, 0%, 12.9%);
33
33
  --color-fd-secondary-foreground: hsl(0, 0%, 98%);
34
- --color-fd-accent: hsl(0, 0%, 16.9%);
34
+ --color-fd-accent: hsla(0, 0%, 40.9%, 30%);
35
35
  --color-fd-accent-foreground: hsl(0, 0%, 90%);
36
36
  --color-fd-ring: hsl(0, 0%, 54.9%);
37
37
  }
package/css/shiki.css CHANGED
@@ -4,8 +4,7 @@
4
4
  }
5
5
 
6
6
  code .line {
7
- line-height: 1.45em;
8
- min-height: 1.45em;
7
+ min-height: 1lh;
9
8
  @apply relative;
10
9
  }
11
10
 
@@ -7,7 +7,7 @@ const calloutVariants = cva('my-4 flex gap-2 rounded-lg border border-s-2 bg-fd-
7
7
  variants: {
8
8
  type: {
9
9
  info: 'border-s-blue-500/50',
10
- warn: 'border-s-orange-500/50',
10
+ warn: 'border-s-amber-500/50',
11
11
  error: 'border-s-red-500/50',
12
12
  success: 'border-s-green-500/50',
13
13
  },
@@ -21,7 +21,7 @@ export const Callout = forwardRef(({ className, children, title, type = 'info',
21
21
  }), className), ...props, children: [icon ??
22
22
  {
23
23
  info: _jsx(Info, { className: "size-5 fill-blue-500 text-fd-card" }),
24
- warn: (_jsx(TriangleAlert, { className: "size-5 fill-orange-500 text-fd-card" })),
24
+ warn: (_jsx(TriangleAlert, { className: "size-5 fill-amber-500 text-fd-card" })),
25
25
  error: _jsx(CircleX, { className: "size-5 fill-red-500 text-fd-card" }),
26
26
  success: (_jsx(CircleCheck, { className: "size-5 fill-green-500 text-fd-card" })),
27
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 })] })] }));
@@ -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;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"}
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;+CAyGnC,CAAC"}
@@ -17,7 +17,7 @@ export const CodeBlock = forwardRef(({ title, allowCopy = true, keepBackground =
17
17
  return;
18
18
  const clone = pre.cloneNode(true);
19
19
  clone.querySelectorAll('.nd-copy-ignore').forEach((node) => {
20
- node.remove();
20
+ node.replaceWith('\n');
21
21
  });
22
22
  void navigator.clipboard.writeText(clone.textContent ?? '');
23
23
  };
@@ -25,7 +25,7 @@ export const CodeBlock = forwardRef(({ title, allowCopy = true, keepBackground =
25
25
  ? {
26
26
  __html: icon,
27
27
  }
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: {
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 })] })) : (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
29
  counterSet: props['data-line-numbers']
30
30
  ? `line ${Number(props['data-line-numbers-start'] ?? 1) - 1}`
31
31
  : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAIf,OAAO,EAEL,aAAa,EACb,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE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AAW,EACX,UAAkB,EAClB,GAAG,KAAK,EACT,EAAE,aAAa,2CAoBf;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,2CAkBA;AAED,wBAAgB,SAAS;UAjajB,OAAO;kBACC,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI;YAC7B,MAAM;oBACE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;eAExB,OAAO;EAganB;AAED,wBAAgB,WAAW;YAzZjB,MAAM;mBACC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI;gBACtC,OAAO;EA2ZpB;AAED,wBAAgB,aAAa;YApanB,MAAM,GAAG,IAAI;eACV,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI;EAuatC"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { FileText, Hash, Search as SearchIcon, Text, X } from '../../icons.js';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { FileText, Hash, Search as SearchIcon } from '../../icons.js';
4
4
  import { createContext, Fragment, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
5
5
  import { I18nLabel, useI18n } from '../../contexts/i18n.js';
6
6
  import { cn } from '../../utils/cn.js';
@@ -10,6 +10,7 @@ import { cva } from 'class-variance-authority';
10
10
  import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
11
11
  import { useRouter } from 'fumadocs-core/framework';
12
12
  import { useOnChange } from 'fumadocs-core/utils/use-on-change';
13
+ import scrollIntoView from 'scroll-into-view-if-needed';
13
14
  const Context = createContext(null);
14
15
  const ListContext = createContext(null);
15
16
  const TagsListContext = createContext(null);
@@ -26,36 +27,31 @@ export function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoa
26
27
  }), [active, isLoading, onOpenChange, onSearchChange, open, search]), children: children }) }));
27
28
  }
28
29
  export function SearchDialogHeader(props) {
29
- return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-2 px-3', props.className) }));
30
+ return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-2 p-3 pb-2', props.className) }));
30
31
  }
31
32
  export function SearchDialogInput(props) {
32
33
  const { text } = useI18n();
33
34
  const { search, onSearchChange } = useSearch();
34
- return (_jsx("input", { ...props, value: search, onChange: (e) => onSearchChange(e.target.value), placeholder: text.search, className: "w-0 flex-1 bg-transparent py-3 text-base placeholder:text-fd-muted-foreground focus-visible:outline-none" }));
35
+ return (_jsx("input", { ...props, value: search, onChange: (e) => onSearchChange(e.target.value), placeholder: text.search, className: "w-0 flex-1 bg-transparent text-lg placeholder:text-fd-muted-foreground focus-visible:outline-none" }));
35
36
  }
36
- export function SearchDialogClose({ children = _jsx(X, {}), className, ...props }) {
37
+ export function SearchDialogClose({ children = 'ESC', className, ...props }) {
37
38
  const { onOpenChange } = useSearch();
38
- return (_jsx("button", { type: "button", "aria-label": "Close", onClick: () => onOpenChange(false), className: cn(buttonVariants({
39
- color: 'ghost',
40
- size: 'icon-sm',
41
- className: 'text-fd-muted-foreground -me-2',
39
+ return (_jsx("button", { type: "button", onClick: () => onOpenChange(false), className: cn(buttonVariants({
40
+ color: 'outline',
41
+ size: 'sm',
42
+ className: 'font-mono text-fd-muted-foreground',
42
43
  }), className), ...props, children: children }));
43
44
  }
44
45
  export function SearchDialogFooter(props) {
45
- return (_jsx("div", { ...props, className: cn('border-t bg-fd-secondary/50 p-3 empty:hidden', props.className) }));
46
+ return (_jsx("div", { ...props, className: cn('bg-fd-secondary/50 p-3 empty:hidden', props.className) }));
46
47
  }
47
48
  export function SearchDialogOverlay(props) {
48
- return (_jsx(DialogOverlay, { ...props, className: cn('fixed inset-0 z-50 data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out', props.className) }));
49
+ return (_jsx(DialogOverlay, { ...props, className: cn('fixed inset-0 z-50 max-md:backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out', props.className) }));
49
50
  }
50
51
  export function SearchDialogContent({ children, ...props }) {
51
52
  const { text } = useI18n();
52
- return (_jsxs(DialogContent, { "aria-describedby": undefined, ...props, className: cn('fixed left-1/2 top-[10vh] z-50 w-[98vw] max-w-screen-sm -translate-x-1/2 rounded-xl border bg-fd-popover/60 backdrop-blur-sm text-fd-popover-foreground shadow-2xl overflow-hidden shadow-black/20 data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in', props.className), children: [_jsx(DialogTitle, { className: "hidden", children: text.search }), children] }));
53
+ return (_jsxs(DialogContent, { "aria-describedby": undefined, ...props, className: cn('fixed divide-y divide-fd-border left-1/2 top-4 md:top-[calc(50%-250px)] z-50 w-[calc(100%-2*var(--spacing))] max-w-screen-sm -translate-x-1/2 rounded-2xl border bg-fd-popover/60 backdrop-blur-xl text-fd-popover-foreground shadow-2xl shadow-black/40 overflow-hidden data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in', props.className), children: [_jsx(DialogTitle, { className: "hidden", children: text.search }), children] }));
53
54
  }
54
- const icons = {
55
- text: _jsx(Text, { className: "size-4 text-fd-muted-foreground" }),
56
- heading: _jsx(Hash, { className: "size-4 text-fd-muted-foreground" }),
57
- page: _jsx(FileText, { className: "size-4 text-fd-muted-foreground" }),
58
- };
59
55
  export function SearchDialogList({ items = null, Empty = () => (_jsx("div", { className: "py-12 text-center text-sm text-fd-muted-foreground", children: _jsx(I18nLabel, { label: "searchNoResult" }) })), Item = (props) => _jsx(SearchDialogListItem, { ...props }), ...props }) {
60
56
  const ref = useRef(null);
61
57
  const [active, setActive] = useState(() => items && items.length > 0 ? items[0].id : null);
@@ -111,28 +107,34 @@ export function SearchDialogList({ items = null, Empty = () => (_jsx("div", { cl
111
107
  setActive(items[0].id);
112
108
  }
113
109
  });
114
- return (_jsx("div", { ...props, ref: ref, className: cn('overflow-hidden h-(--fd-animated-height) transition-[height]', items && 'border-t', props.className), style: {
115
- ...props.style,
116
- '--fd-animated-height': '0px',
117
- }, children: _jsx("div", { className: cn('w-full flex flex-col overflow-y-auto max-h-[460px]', !items && 'hidden'), children: _jsxs(ListContext.Provider, { value: useMemo(() => ({
110
+ return (_jsx("div", { ...props, ref: ref, className: cn('overflow-hidden h-(--fd-animated-height) transition-[height]', !items && 'border-b-0', props.className), children: _jsx("div", { className: cn('w-full flex flex-col overflow-y-auto max-h-[460px] p-1', !items && 'hidden'), children: _jsxs(ListContext.Provider, { value: useMemo(() => ({
118
111
  active,
119
112
  setActive,
120
113
  }), [active]), children: [items?.length === 0 && Empty(), items?.map((item) => (_jsx(Fragment, { children: Item({ item, onClick: () => onOpen(item) }) }, item.id)))] }) }) }));
121
114
  }
115
+ const icons = {
116
+ text: null,
117
+ heading: _jsx(Hash, { className: "size-4 shrink-0 text-fd-muted-foreground" }),
118
+ page: (_jsx(FileText, { className: "size-6 text-fd-muted-foreground bg-fd-muted border p-0.5 rounded-sm shadow-sm shrink-0" })),
119
+ };
122
120
  export function SearchDialogListItem({ item, className, children, ...props }) {
123
121
  const { active: activeId, setActive } = useSearchList();
124
122
  const active = item.id === activeId;
125
- return (_jsxs("button", { type: "button", ref: useCallback((element) => {
123
+ return (_jsx("button", { type: "button", ref: useCallback((element) => {
126
124
  if (active && element) {
127
- element.scrollIntoView({
125
+ scrollIntoView(element, {
126
+ scrollMode: 'if-needed',
128
127
  block: 'nearest',
128
+ boundary: element.parentElement,
129
129
  });
130
130
  }
131
- }, [active]), "aria-selected": active, className: cn('flex min-h-10 select-none flex-row items-center gap-2.5 px-3 text-start text-sm', active && 'bg-fd-accent text-fd-accent-foreground', className), onPointerMove: () => setActive(item.id), ...props, children: [item.type !== 'page' && (_jsx("div", { role: "none", className: "ms-2 h-full min-h-10 w-px bg-fd-border" })), icons[item.type], _jsx("p", { className: "w-0 flex-1 truncate", children: children ?? item.content })] }));
131
+ }, [active]), "aria-selected": active, className: cn('relative flex select-none flex-row items-center gap-2 p-2 text-start text-sm rounded-lg', item.type !== 'page' && 'ps-8', item.type === 'page' || item.type === 'heading'
132
+ ? 'font-medium'
133
+ : 'text-fd-popover-foreground/80', active && 'bg-fd-accent text-fd-accent-foreground', className), onPointerMove: () => setActive(item.id), ...props, children: children ?? (_jsxs(_Fragment, { children: [item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-4.5 inset-y-0 w-px bg-fd-border" })), icons[item.type], _jsx("p", { className: "min-w-0 truncate", children: item.content })] })) }));
132
134
  }
133
135
  export function SearchDialogIcon(props) {
134
136
  const { isLoading } = useSearch();
135
- return (_jsx(SearchIcon, { ...props, className: cn('size-4.5 text-fd-muted-foreground', isLoading && 'animate-pulse duration-400', props.className) }));
137
+ return (_jsx(SearchIcon, { ...props, className: cn('size-5 text-fd-muted-foreground', isLoading && 'animate-pulse duration-400', props.className) }));
136
138
  }
137
139
  const itemVariants = cva('rounded-md border px-2 py-0.5 text-xs font-medium text-fd-muted-foreground transition-colors', {
138
140
  variants: {
@@ -1 +1 @@
1
- {"version":3,"file":"root-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/root-toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAQ/E,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEnB,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,WAAW,EACX,GAAG,KAAK,EACT,EAAE;IACD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,cAAc,CAAC,QAAQ,CAAC,2CAyD3B"}
1
+ {"version":3,"file":"root-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/root-toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAQ/E,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEnB,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,WAAW,EACX,GAAG,KAAK,EACT,EAAE;IACD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,cAAc,CAAC,QAAQ,CAAC,2CAqF3B"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { ChevronsUpDown } from '../../icons.js';
3
+ import { Check, ChevronsUpDown } from '../../icons.js';
4
4
  import { useMemo, useState } from 'react';
5
5
  import Link from 'fumadocs-core/link';
6
6
  import { usePathname } from 'fumadocs-core/framework';
@@ -13,19 +13,20 @@ export function RootToggle({ options, placeholder, ...props }) {
13
13
  const { closeOnRedirect } = useSidebar();
14
14
  const pathname = usePathname();
15
15
  const selected = useMemo(() => {
16
- return options.findLast((item) => item.urls
17
- ? item.urls.has(pathname.endsWith('/') ? pathname.slice(0, -1) : pathname)
18
- : isActive(item.url, pathname, true));
16
+ const lookup = pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;
17
+ return options.findLast((item) => {
18
+ if (item.urls)
19
+ return item.urls.has(lookup);
20
+ return isActive(item.url, pathname, true);
21
+ });
19
22
  }, [options, pathname]);
20
23
  const onClick = () => {
21
24
  closeOnRedirect.current = false;
22
25
  setOpen(false);
23
26
  };
24
- const item = selected ? _jsx(Item, { ...selected }) : placeholder;
25
- return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [item ? (_jsxs(PopoverTrigger, { ...props, className: cn('flex items-center gap-2 rounded-lg pe-2 hover:text-fd-accent-foreground', props.className), children: [item, _jsx(ChevronsUpDown, { className: "size-4 text-fd-muted-foreground" })] })) : null, _jsx(PopoverContent, { className: "w-(--radix-popover-trigger-width) overflow-hidden p-0", children: options.map((item) => (_jsx(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex w-full flex-row items-center gap-2 px-2 py-1.5', selected === item
26
- ? 'bg-fd-accent text-fd-accent-foreground'
27
- : 'hover:bg-fd-accent/50', item.props?.className), children: _jsx(Item, { ...item }) }, item.url))) })] }));
28
- }
29
- function Item(props) {
30
- return (_jsxs(_Fragment, { children: [_jsx(_Fragment, { children: props.icon }), _jsxs("div", { className: "flex-1 text-start", children: [_jsx("p", { className: "text-[15px] font-medium md:text-sm", children: props.title }), props.description ? (_jsx("p", { className: "text-sm text-fd-muted-foreground md:text-xs", children: props.description })) : null] })] }));
27
+ const item = selected ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "size-9 md:size-5", children: selected.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: selected.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden md:hidden", children: selected.description })] })] })) : (placeholder);
28
+ return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [item && (_jsxs(PopoverTrigger, { ...props, className: cn('flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-start text-fd-secondary-foreground transition-colors hover:bg-fd-accent data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground', props.className), children: [item, _jsx(ChevronsUpDown, { className: "ms-auto size-4 text-fd-muted-foreground" })] })), _jsx(PopoverContent, { className: "flex flex-col gap-1 min-w-(--radix-popover-trigger-width) overflow-hidden p-1", children: options.map((item) => {
29
+ const isActive = item === selected;
30
+ return (_jsxs(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground', item.props?.className), children: [_jsx("div", { className: "size-9 md:size-5 md:mt-1 md:mb-auto", children: item.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: item.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden", children: item.description })] }), _jsx(Check, { className: cn('ms-auto size-3.5 text-fd-primary', !isActive && 'invisible') })] }, item.url));
31
+ }) })] }));
31
32
  }
@@ -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,EAEP,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,wB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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,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAqBzB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,2CAsCjD;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"}
@@ -13,9 +13,8 @@ import { useSidebar } from '../../contexts/sidebar.js';
13
13
  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
- import { RemoveScroll } from 'react-remove-scroll';
17
16
  import { Presence } from '@radix-ui/react-presence';
18
- const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground [overflow-wrap:anywhere] md:py-1.5 [&_svg]:size-4 [&_svg]:shrink-0', {
17
+ const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-xl p-2 text-start text-fd-muted-foreground [overflow-wrap:anywhere] [&_svg]:size-4 [&_svg]:shrink-0', {
19
18
  variants: {
20
19
  active: {
21
20
  true: 'bg-fd-primary/10 text-fd-primary',
@@ -45,7 +44,7 @@ export function Sidebar({ defaultOpenLevel = 0, prefetch = true, collapsible = t
45
44
  });
46
45
  if (isMobile) {
47
46
  const state = open ? 'open' : 'closed';
48
- return (_jsxs(Context.Provider, { value: context, 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-2 rounded-e-2xl border-e start-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out', !present && 'invisible', props.className), children: props.children })) })] }));
47
+ return (_jsxs(Context.Provider, { value: context, children: [_jsx(Presence, { present: open, children: _jsx("div", { "data-state": state, className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", onClick: () => setOpen(false) }) }), _jsx(Presence, { present: open, children: ({ present }) => (_jsx("aside", { id: "nd-sidebar-mobile", ...props, "data-state": state, className: cn('fixed text-[15px] flex flex-col shadow-lg rounded-2xl border start-2 inset-y-2 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out', !present && 'invisible', props.className), children: props.children })) })] }));
49
48
  }
50
49
  return (_jsx("aside", { id: "nd-sidebar", ...props, "data-collapsed": collapsed, className: cn('fixed start-0 flex flex-col items-end top-(--fd-sidebar-top) bottom-(--fd-sidebar-margin) z-20 bg-fd-card text-sm border-e max-md:hidden *:w-(--fd-sidebar-width)', collapsed && [
51
50
  'rounded-xl border',
@@ -96,7 +95,7 @@ export function SidebarViewport(props) {
96
95
  }
97
96
  export function SidebarSeparator(props) {
98
97
  const { level } = useInternalContext();
99
- return (_jsx("p", { ...props, className: cn('inline-flex items-center gap-2 mb-1.5 px-2 font-medium empty:mb-0 [&_svg]:size-4 [&_svg]:shrink-0', props.className), style: {
98
+ return (_jsx("p", { ...props, className: cn('inline-flex items-center gap-2 mb-1.5 px-2 empty:mb-0 [&_svg]:size-4 [&_svg]:shrink-0', props.className), style: {
100
99
  paddingInlineStart: getOffset(level),
101
100
  ...props.style,
102
101
  }, children: props.children }));
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import { cn } from '../../utils/cn.js';
6
6
  const Popover = PopoverPrimitive.Root;
7
7
  const PopoverTrigger = PopoverPrimitive.Trigger;
8
- const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, side: "bottom", className: cn('z-50 origin-(--radix-popover-content-transform-origin) min-w-[220px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-sm p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in', className), ...props }) })));
8
+ const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, side: "bottom", className: cn('z-50 origin-(--radix-popover-content-transform-origin) min-w-[240px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-lg p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in', className), ...props }) })));
9
9
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
10
10
  const PopoverClose = PopoverPrimitive.PopoverClose;
11
11
  export { Popover, PopoverTrigger, PopoverContent, PopoverClose };
@@ -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;AAYrE,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAElB,MAAM,EACN,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAS/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,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,OAAO,EAAE,EACP,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,cAAqB,EAC9B,WAAW,EAAE,kBAAyB,EACtC,SAAS,E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tC,SAAS,EAAE,gBAAgB,EAC3B,UAAU,EAAE,iBAAiB,EAC7B,GAAG,YAAY,EACX,EACN,YAAiB,EACjB,kBAA0B,EAC1B,WAA8C,EAC9C,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,2CAmIjB;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,CAAC"}
@@ -22,16 +22,16 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
22
22
  const variables = cn('md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px] xl:[--fd-toc-width:286px]', !nav.component && nav.enabled !== false
23
23
  ? '[--fd-nav-height:56px] md:[--fd-nav-height:0px]'
24
24
  : undefined);
25
- const sidebar = sidebarComponent ?? (_jsxs(_Fragment, { children: [sidebarCollapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Sidebar, { ...sidebarProps, collapsible: sidebarCollapsible, children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium", children: nav.title }), nav.children, sidebarCollapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
25
+ const sidebar = sidebarComponent ?? (_jsxs(_Fragment, { children: [sidebarCollapsible ? _jsx(CollapsibleControl, {}) : null, _jsxs(Sidebar, { ...sidebarProps, collapsible: sidebarCollapsible, children: [_jsx(HideIfEmpty, { children: _jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex max-md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, sidebarCollapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
26
26
  color: 'ghost',
27
27
  size: 'icon-sm',
28
- className: 'ms-auto mb-auto text-fd-muted-foreground max-md:hidden',
29
- })), children: _jsx(SidebarIcon, {}) }))] }), tabs.length > 0 && _jsx(RootToggle, { options: tabs }), searchToggle.enabled !== false &&
30
- (searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { hideIfDisabled: true, className: "max-md:hidden" }))), sidebarBanner] }) }), _jsxs(SidebarViewport, { children: [links
28
+ className: 'mb-auto text-fd-muted-foreground max-md:hidden',
29
+ })), children: _jsx(SidebarIcon, {}) }))] }), searchToggle.enabled !== false &&
30
+ (searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { hideIfDisabled: true, className: "max-md:hidden" }))), tabs.length > 0 && _jsx(RootToggle, { options: tabs }), sidebarBanner] }) }), _jsxs(SidebarViewport, { children: [links
31
31
  .filter((v) => v.type !== 'icon')
32
32
  .map((item, i, list) => (_jsx(SidebarLinkItem, { item: item, className: cn(i === list.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { components: sidebarComponents })] }), _jsxs(SidebarFooter, { className: "empty:hidden", children: [_jsx(HideIfEmpty, { children: _jsxs("div", { className: "flex items-center justify-end", children: [links
33
33
  .filter((item) => item.type === 'icon')
34
- .map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:[&_svg]:size-4.5', i === links.length - 1 && 'me-auto'), "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, themeSwitch.enabled !== false &&
34
+ .map((item, i, arr) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({ size: 'icon', color: 'ghost' }), 'text-fd-muted-foreground md:[&_svg]:size-4.5', i === arr.length - 1 && 'me-auto'), "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, themeSwitch.enabled !== false &&
35
35
  (themeSwitch.component ?? (_jsx(ThemeToggle, { className: "p-0", mode: themeSwitch.mode })))] }) }), sidebarFooter] })] })] }));
36
36
  return (_jsx(TreeContextProvider, { tree: props.tree, children: _jsxs(NavProvider, { transparentMode: transparentMode, children: [nav.enabled !== false &&
37
37
  (nav.component ?? (_jsxs(Navbar, { className: "h-14 md:hidden", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), _jsx("div", { className: "flex-1", children: nav.children }), searchToggle?.enabled !== false &&
package/dist/style.css CHANGED
@@ -8,7 +8,7 @@
8
8
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
9
9
  "Courier New", monospace;
10
10
  --color-red-500: oklch(63.7% 0.237 25.331);
11
- --color-orange-500: oklch(70.5% 0.213 47.604);
11
+ --color-amber-500: oklch(76.9% 0.188 70.08);
12
12
  --color-green-500: oklch(72.3% 0.219 149.579);
13
13
  --color-blue-500: oklch(62.3% 0.214 259.815);
14
14
  --color-black: #000;
@@ -19,8 +19,6 @@
19
19
  --text-xs--line-height: calc(1 / 0.75);
20
20
  --text-sm: 0.875rem;
21
21
  --text-sm--line-height: calc(1.25 / 0.875);
22
- --text-base: 1rem;
23
- --text-base--line-height: calc(1.5 / 1);
24
22
  --text-lg: 1.125rem;
25
23
  --text-lg--line-height: calc(1.75 / 1.125);
26
24
  --text-2xl: 1.5rem;
@@ -28,14 +26,17 @@
28
26
  --text-3xl--line-height: calc(2.25 / 1.875);
29
27
  --font-weight-medium: 500;
30
28
  --font-weight-semibold: 600;
29
+ --radius-sm: 0.25rem;
31
30
  --radius-md: 0.375rem;
32
31
  --radius-lg: 0.5rem;
33
32
  --radius-xl: 0.75rem;
34
33
  --radius-2xl: 1rem;
35
34
  --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
35
+ --blur-xs: 4px;
36
36
  --blur-sm: 8px;
37
37
  --blur-md: 12px;
38
38
  --blur-lg: 16px;
39
+ --blur-xl: 24px;
39
40
  --default-transition-duration: 150ms;
40
41
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
41
42
  --default-font-family: var(--font-sans);
@@ -53,7 +54,7 @@
53
54
  --color-fd-primary-foreground: hsl(0, 0%, 98%);
54
55
  --color-fd-secondary: hsl(0, 0%, 93.1%);
55
56
  --color-fd-secondary-foreground: hsl(0, 0%, 9%);
56
- --color-fd-accent: hsl(0, 0%, 90.1%);
57
+ --color-fd-accent: hsla(0, 0%, 82%, 50%);
57
58
  --color-fd-accent-foreground: hsl(0, 0%, 9%);
58
59
  --spacing-fd-container: 1400px;
59
60
  --fd-page-width: 1200px;
@@ -309,15 +310,24 @@
309
310
  .inset-y-1 {
310
311
  inset-block: calc(var(--spacing) * 1);
311
312
  }
313
+ .inset-y-2 {
314
+ inset-block: calc(var(--spacing) * 2);
315
+ }
312
316
  .inset-y-3 {
313
317
  inset-block: calc(var(--spacing) * 3);
314
318
  }
315
319
  .start-0 {
316
320
  inset-inline-start: calc(var(--spacing) * 0);
317
321
  }
322
+ .start-2 {
323
+ inset-inline-start: calc(var(--spacing) * 2);
324
+ }
318
325
  .start-2\.5 {
319
326
  inset-inline-start: calc(var(--spacing) * 2.5);
320
327
  }
328
+ .start-4\.5 {
329
+ inset-inline-start: calc(var(--spacing) * 4.5);
330
+ }
321
331
  .end-2 {
322
332
  inset-inline-end: calc(var(--spacing) * 2);
323
333
  }
@@ -348,12 +358,12 @@
348
358
  .top-2 {
349
359
  top: calc(var(--spacing) * 2);
350
360
  }
361
+ .top-4 {
362
+ top: calc(var(--spacing) * 4);
363
+ }
351
364
  .top-14 {
352
365
  top: calc(var(--spacing) * 14);
353
366
  }
354
- .top-\[10vh\] {
355
- top: 10vh;
356
- }
357
367
  .right-2 {
358
368
  right: calc(var(--spacing) * 2);
359
369
  }
@@ -926,10 +936,18 @@
926
936
  width: calc(var(--spacing) * 5);
927
937
  height: calc(var(--spacing) * 5);
928
938
  }
939
+ .size-6 {
940
+ width: calc(var(--spacing) * 6);
941
+ height: calc(var(--spacing) * 6);
942
+ }
929
943
  .size-6\.5 {
930
944
  width: calc(var(--spacing) * 6.5);
931
945
  height: calc(var(--spacing) * 6.5);
932
946
  }
947
+ .size-9 {
948
+ width: calc(var(--spacing) * 9);
949
+ height: calc(var(--spacing) * 9);
950
+ }
933
951
  .size-full {
934
952
  width: 100%;
935
953
  height: 100%;
@@ -985,15 +1003,9 @@
985
1003
  .min-h-0 {
986
1004
  min-height: calc(var(--spacing) * 0);
987
1005
  }
988
- .min-h-10 {
989
- min-height: calc(var(--spacing) * 10);
990
- }
991
1006
  .w-\(--fd-toc-width\) {
992
1007
  width: var(--fd-toc-width);
993
1008
  }
994
- .w-\(--radix-popover-trigger-width\) {
995
- width: var(--radix-popover-trigger-width);
996
- }
997
1009
  .w-0 {
998
1010
  width: calc(var(--spacing) * 0);
999
1011
  }
@@ -1012,12 +1024,12 @@
1012
1024
  .w-\[85\%\] {
1013
1025
  width: 85%;
1014
1026
  }
1015
- .w-\[98vw\] {
1016
- width: 98vw;
1017
- }
1018
1027
  .w-\[286px\] {
1019
1028
  width: 286px;
1020
1029
  }
1030
+ .w-\[calc\(100\%-2\*var\(--spacing\)\)\] {
1031
+ width: calc(100% - 2 * var(--spacing));
1032
+ }
1021
1033
  .w-fit {
1022
1034
  width: fit-content;
1023
1035
  }
@@ -1054,12 +1066,18 @@
1054
1066
  .max-w-sm {
1055
1067
  max-width: var(--container-sm);
1056
1068
  }
1069
+ .min-w-\(--radix-popover-trigger-width\) {
1070
+ min-width: var(--radix-popover-trigger-width);
1071
+ }
1057
1072
  .min-w-0 {
1058
1073
  min-width: calc(var(--spacing) * 0);
1059
1074
  }
1060
1075
  .min-w-\[220px\] {
1061
1076
  min-width: 220px;
1062
1077
  }
1078
+ .min-w-\[240px\] {
1079
+ min-width: 240px;
1080
+ }
1063
1081
  .min-w-full {
1064
1082
  min-width: 100%;
1065
1083
  }
@@ -1223,6 +1241,9 @@
1223
1241
  .overflow-y-auto {
1224
1242
  overflow-y: auto;
1225
1243
  }
1244
+ .rounded-2xl {
1245
+ border-radius: var(--radius-2xl);
1246
+ }
1226
1247
  .rounded-\[inherit\] {
1227
1248
  border-radius: inherit;
1228
1249
  }
@@ -1235,13 +1256,12 @@
1235
1256
  .rounded-md {
1236
1257
  border-radius: var(--radius-md);
1237
1258
  }
1259
+ .rounded-sm {
1260
+ border-radius: var(--radius-sm);
1261
+ }
1238
1262
  .rounded-xl {
1239
1263
  border-radius: var(--radius-xl);
1240
1264
  }
1241
- .rounded-e-2xl {
1242
- border-start-end-radius: var(--radius-2xl);
1243
- border-end-end-radius: var(--radius-2xl);
1244
- }
1245
1265
  .border {
1246
1266
  border-style: var(--tw-border-style);
1247
1267
  border-width: 1px;
@@ -1266,6 +1286,10 @@
1266
1286
  border-bottom-style: var(--tw-border-style);
1267
1287
  border-bottom-width: 1px;
1268
1288
  }
1289
+ .border-b-0 {
1290
+ border-bottom-style: var(--tw-border-style);
1291
+ border-bottom-width: 0px;
1292
+ }
1269
1293
  .border-l {
1270
1294
  border-left-style: var(--tw-border-style);
1271
1295
  border-left-width: 1px;
@@ -1282,6 +1306,12 @@
1282
1306
  .border-transparent {
1283
1307
  border-color: transparent;
1284
1308
  }
1309
+ .border-s-amber-500\/50 {
1310
+ border-inline-start-color: color-mix(in srgb, oklch(76.9% 0.188 70.08) 50%, transparent);
1311
+ @supports (color: color-mix(in lab, red, red)) {
1312
+ border-inline-start-color: color-mix(in oklab, var(--color-amber-500) 50%, transparent);
1313
+ }
1314
+ }
1285
1315
  .border-s-blue-500\/50 {
1286
1316
  border-inline-start-color: color-mix(in srgb, oklch(62.3% 0.214 259.815) 50%, transparent);
1287
1317
  @supports (color: color-mix(in lab, red, red)) {
@@ -1294,12 +1324,6 @@
1294
1324
  border-inline-start-color: color-mix(in oklab, var(--color-green-500) 50%, transparent);
1295
1325
  }
1296
1326
  }
1297
- .border-s-orange-500\/50 {
1298
- border-inline-start-color: color-mix(in srgb, oklch(70.5% 0.213 47.604) 50%, transparent);
1299
- @supports (color: color-mix(in lab, red, red)) {
1300
- border-inline-start-color: color-mix(in oklab, var(--color-orange-500) 50%, transparent);
1301
- }
1302
- }
1303
1327
  .border-s-red-500\/50 {
1304
1328
  border-inline-start-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 50%, transparent);
1305
1329
  @supports (color: color-mix(in lab, red, red)) {
@@ -1309,12 +1333,6 @@
1309
1333
  .bg-\(--shiki-light-bg\) {
1310
1334
  background-color: var(--shiki-light-bg);
1311
1335
  }
1312
- .bg-black\/30 {
1313
- background-color: color-mix(in srgb, #000 30%, transparent);
1314
- @supports (color: color-mix(in lab, red, red)) {
1315
- background-color: color-mix(in oklab, var(--color-black) 30%, transparent);
1316
- }
1317
- }
1318
1336
  .bg-fd-accent {
1319
1337
  background-color: var(--color-fd-accent);
1320
1338
  }
@@ -1372,15 +1390,15 @@
1372
1390
  .\[mask-image\:linear-gradient\(to_bottom\,transparent\,white_16px\,white_calc\(100\%-16px\)\,transparent\)\] {
1373
1391
  mask-image: linear-gradient(to bottom,transparent,white 16px,white calc(100% - 16px),transparent);
1374
1392
  }
1393
+ .fill-amber-500 {
1394
+ fill: var(--color-amber-500);
1395
+ }
1375
1396
  .fill-blue-500 {
1376
1397
  fill: var(--color-blue-500);
1377
1398
  }
1378
1399
  .fill-green-500 {
1379
1400
  fill: var(--color-green-500);
1380
1401
  }
1381
- .fill-orange-500 {
1382
- fill: var(--color-orange-500);
1383
- }
1384
1402
  .fill-red-500 {
1385
1403
  fill: var(--color-red-500);
1386
1404
  }
@@ -1480,9 +1498,6 @@
1480
1498
  .ps-\[calc\(var\(--fd-layout-offset\)\+var\(--fd-sidebar-width\)\)\] {
1481
1499
  padding-inline-start: calc(var(--fd-layout-offset) + var(--fd-sidebar-width));
1482
1500
  }
1483
- .pe-2 {
1484
- padding-inline-end: calc(var(--spacing) * 2);
1485
- }
1486
1501
  .pe-4 {
1487
1502
  padding-inline-end: calc(var(--spacing) * 4);
1488
1503
  }
@@ -1516,14 +1531,13 @@
1516
1531
  .text-start {
1517
1532
  text-align: start;
1518
1533
  }
1534
+ .font-mono {
1535
+ font-family: var(--font-mono);
1536
+ }
1519
1537
  .text-3xl {
1520
1538
  font-size: var(--text-3xl);
1521
1539
  line-height: var(--tw-leading, var(--text-3xl--line-height));
1522
1540
  }
1523
- .text-base {
1524
- font-size: var(--text-base);
1525
- line-height: var(--tw-leading, var(--text-base--line-height));
1526
- }
1527
1541
  .text-lg {
1528
1542
  font-size: var(--text-lg);
1529
1543
  line-height: var(--tw-leading, var(--text-lg--line-height));
@@ -1589,6 +1603,12 @@
1589
1603
  .text-fd-popover-foreground {
1590
1604
  color: var(--color-fd-popover-foreground);
1591
1605
  }
1606
+ .text-fd-popover-foreground\/80 {
1607
+ color: color-mix(in srgb, hsl(0, 0%, 15.1%) 80%, transparent);
1608
+ @supports (color: color-mix(in lab, red, red)) {
1609
+ color: color-mix(in oklab, var(--color-fd-popover-foreground) 80%, transparent);
1610
+ }
1611
+ }
1592
1612
  .text-fd-primary {
1593
1613
  color: var(--color-fd-primary);
1594
1614
  }
@@ -1632,10 +1652,10 @@
1632
1652
  --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
1633
1653
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1634
1654
  }
1635
- .shadow-black\/20 {
1636
- --tw-shadow-color: color-mix(in srgb, #000 20%, transparent);
1655
+ .shadow-black\/40 {
1656
+ --tw-shadow-color: color-mix(in srgb, #000 40%, transparent);
1637
1657
  @supports (color: color-mix(in lab, red, red)) {
1638
- --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent);
1658
+ --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 40%, transparent) var(--tw-shadow-alpha), transparent);
1639
1659
  }
1640
1660
  }
1641
1661
  .outline {
@@ -1660,6 +1680,16 @@
1660
1680
  -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1661
1681
  backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1662
1682
  }
1683
+ .backdrop-blur-xl {
1684
+ --tw-backdrop-blur: blur(var(--blur-xl));
1685
+ -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1686
+ backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1687
+ }
1688
+ .backdrop-blur-xs {
1689
+ --tw-backdrop-blur: blur(var(--blur-xs));
1690
+ -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1691
+ backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
1692
+ }
1663
1693
  .transition {
1664
1694
  transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;
1665
1695
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -1834,7 +1864,7 @@
1834
1864
  .hover\:bg-fd-accent\/50 {
1835
1865
  &:hover {
1836
1866
  @media (hover: hover) {
1837
- background-color: color-mix(in srgb, hsl(0, 0%, 90.1%) 50%, transparent);
1867
+ background-color: color-mix(in srgb, hsla(0, 0%, 82%, 50%) 50%, transparent);
1838
1868
  @supports (color: color-mix(in lab, red, red)) {
1839
1869
  background-color: color-mix(in oklab, var(--color-fd-accent) 50%, transparent);
1840
1870
  }
@@ -1844,7 +1874,7 @@
1844
1874
  .hover\:bg-fd-accent\/80 {
1845
1875
  &:hover {
1846
1876
  @media (hover: hover) {
1847
- background-color: color-mix(in srgb, hsl(0, 0%, 90.1%) 80%, transparent);
1877
+ background-color: color-mix(in srgb, hsla(0, 0%, 82%, 50%) 80%, transparent);
1848
1878
  @supports (color: color-mix(in lab, red, red)) {
1849
1879
  background-color: color-mix(in oklab, var(--color-fd-accent) 80%, transparent);
1850
1880
  }
@@ -2049,14 +2079,24 @@
2049
2079
  animation: var(--animate-fd-sidebar-in);
2050
2080
  }
2051
2081
  }
2082
+ .data-\[state\=open\]\:bg-fd-accent {
2083
+ &[data-state="open"] {
2084
+ background-color: var(--color-fd-accent);
2085
+ }
2086
+ }
2052
2087
  .data-\[state\=open\]\:bg-fd-accent\/50 {
2053
2088
  &[data-state="open"] {
2054
- background-color: color-mix(in srgb, hsl(0, 0%, 90.1%) 50%, transparent);
2089
+ background-color: color-mix(in srgb, hsla(0, 0%, 82%, 50%) 50%, transparent);
2055
2090
  @supports (color: color-mix(in lab, red, red)) {
2056
2091
  background-color: color-mix(in oklab, var(--color-fd-accent) 50%, transparent);
2057
2092
  }
2058
2093
  }
2059
2094
  }
2095
+ .data-\[state\=open\]\:text-fd-accent-foreground {
2096
+ &[data-state="open"] {
2097
+ color: var(--color-fd-accent-foreground);
2098
+ }
2099
+ }
2060
2100
  .max-xl\:end-4 {
2061
2101
  @media (width < 80rem) {
2062
2102
  inset-inline-end: calc(var(--spacing) * 4);
@@ -2092,11 +2132,39 @@
2092
2132
  display: none;
2093
2133
  }
2094
2134
  }
2135
+ .max-md\:rounded-md {
2136
+ @media (width < 48rem) {
2137
+ border-radius: var(--radius-md);
2138
+ }
2139
+ }
2140
+ .max-md\:border {
2141
+ @media (width < 48rem) {
2142
+ border-style: var(--tw-border-style);
2143
+ border-width: 1px;
2144
+ }
2145
+ }
2095
2146
  .max-md\:bg-fd-background {
2096
2147
  @media (width < 48rem) {
2097
2148
  background-color: var(--color-fd-background);
2098
2149
  }
2099
2150
  }
2151
+ .max-md\:bg-fd-secondary {
2152
+ @media (width < 48rem) {
2153
+ background-color: var(--color-fd-secondary);
2154
+ }
2155
+ }
2156
+ .max-md\:p-1\.5 {
2157
+ @media (width < 48rem) {
2158
+ padding: calc(var(--spacing) * 1.5);
2159
+ }
2160
+ }
2161
+ .max-md\:backdrop-blur-xs {
2162
+ @media (width < 48rem) {
2163
+ --tw-backdrop-blur: blur(var(--blur-xs));
2164
+ -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
2165
+ backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
2166
+ }
2167
+ }
2100
2168
  .max-sm\:mt-2 {
2101
2169
  @media (width < 40rem) {
2102
2170
  margin-top: calc(var(--spacing) * 2);
@@ -2137,16 +2205,37 @@
2137
2205
  inset-block: calc(var(--spacing) * 2);
2138
2206
  }
2139
2207
  }
2208
+ .md\:top-\[calc\(50\%-250px\)\] {
2209
+ @media (width >= 48rem) {
2210
+ top: calc(50% - 250px);
2211
+ }
2212
+ }
2140
2213
  .md\:mx-auto {
2141
2214
  @media (width >= 48rem) {
2142
2215
  margin-inline: auto;
2143
2216
  }
2144
2217
  }
2218
+ .md\:mt-1 {
2219
+ @media (width >= 48rem) {
2220
+ margin-top: calc(var(--spacing) * 1);
2221
+ }
2222
+ }
2223
+ .md\:mb-auto {
2224
+ @media (width >= 48rem) {
2225
+ margin-bottom: auto;
2226
+ }
2227
+ }
2145
2228
  .md\:hidden {
2146
2229
  @media (width >= 48rem) {
2147
2230
  display: none;
2148
2231
  }
2149
2232
  }
2233
+ .md\:size-5 {
2234
+ @media (width >= 48rem) {
2235
+ width: calc(var(--spacing) * 5);
2236
+ height: calc(var(--spacing) * 5);
2237
+ }
2238
+ }
2150
2239
  .md\:h-\[calc\(100dvh-56px\)\] {
2151
2240
  @media (width >= 48rem) {
2152
2241
  height: calc(100dvh - 56px);
@@ -2172,23 +2261,6 @@
2172
2261
  padding-inline: calc(var(--spacing) * 6);
2173
2262
  }
2174
2263
  }
2175
- .md\:py-1\.5 {
2176
- @media (width >= 48rem) {
2177
- padding-block: calc(var(--spacing) * 1.5);
2178
- }
2179
- }
2180
- .md\:text-sm {
2181
- @media (width >= 48rem) {
2182
- font-size: var(--text-sm);
2183
- line-height: var(--tw-leading, var(--text-sm--line-height));
2184
- }
2185
- }
2186
- .md\:text-xs {
2187
- @media (width >= 48rem) {
2188
- font-size: var(--text-xs);
2189
- line-height: var(--tw-leading, var(--text-xs--line-height));
2190
- }
2191
- }
2192
2264
  .md\:\[--fd-nav-height\:0px\] {
2193
2265
  @media (width >= 48rem) {
2194
2266
  --fd-nav-height: 0px;
@@ -2325,6 +2397,12 @@
2325
2397
  height: calc(var(--spacing) * 5);
2326
2398
  }
2327
2399
  }
2400
+ .\[\&_svg\]\:size-full {
2401
+ & svg {
2402
+ width: 100%;
2403
+ height: 100%;
2404
+ }
2405
+ }
2328
2406
  .\[\&_svg\]\:shrink-0 {
2329
2407
  & svg {
2330
2408
  flex-shrink: 0;
@@ -2360,8 +2438,8 @@
2360
2438
  --color-fd-foreground: hsl(0, 0%, 92%);
2361
2439
  --color-fd-muted: hsl(0, 0%, 12.9%);
2362
2440
  --color-fd-muted-foreground: hsl(0, 0%, 60.9%);
2363
- --color-fd-popover: hsl(0, 0%, 9.8%);
2364
- --color-fd-popover-foreground: hsl(0, 0%, 88%);
2441
+ --color-fd-popover: hsl(0, 0%, 10.6%);
2442
+ --color-fd-popover-foreground: hsl(0, 0%, 86.9%);
2365
2443
  --color-fd-card: hsl(0, 0%, 9.8%);
2366
2444
  --color-fd-card-foreground: hsl(0, 0%, 98%);
2367
2445
  --color-fd-border: hsla(0, 0%, 40%, 20%);
@@ -2369,7 +2447,7 @@
2369
2447
  --color-fd-primary-foreground: hsl(0, 0%, 9%);
2370
2448
  --color-fd-secondary: hsl(0, 0%, 12.9%);
2371
2449
  --color-fd-secondary-foreground: hsl(0, 0%, 98%);
2372
- --color-fd-accent: hsl(0, 0%, 16.9%);
2450
+ --color-fd-accent: hsla(0, 0%, 40.9%, 30%);
2373
2451
  --color-fd-accent-foreground: hsl(0, 0%, 90%);
2374
2452
  --color-fd-ring: hsl(0, 0%, 54.9%);
2375
2453
  }
@@ -2383,8 +2461,7 @@
2383
2461
  color: var(--shiki-light);
2384
2462
  }
2385
2463
  code .line {
2386
- line-height: 1.45em;
2387
- min-height: 1.45em;
2464
+ min-height: 1lh;
2388
2465
  position: relative;
2389
2466
  }
2390
2467
  &.has-focused code .line:not(.focused) {
@@ -4,7 +4,7 @@ const defaultTransform = (option, node) => {
4
4
  return option;
5
5
  return {
6
6
  ...option,
7
- icon: (_jsx("div", { className: "rounded-md border bg-fd-secondary p-1 shadow-md [&_svg]:size-5", children: node.icon })),
7
+ icon: (_jsx("div", { className: "size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary", children: node.icon })),
8
8
  };
9
9
  };
10
10
  export function getSidebarTabs(pageTree, { transform = defaultTransform } = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.5.2",
3
+ "version": "15.5.4",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -87,30 +87,30 @@
87
87
  "next-themes": "^0.4.6",
88
88
  "postcss-selector-parser": "^7.1.0",
89
89
  "react-medium-image-zoom": "^5.2.14",
90
- "react-remove-scroll": "^2.7.1",
90
+ "scroll-into-view-if-needed": "^3.1.0",
91
91
  "tailwind-merge": "^3.3.1",
92
- "fumadocs-core": "15.5.2"
92
+ "fumadocs-core": "15.5.4"
93
93
  },
94
94
  "devDependencies": {
95
- "@next/eslint-plugin-next": "^15.3.3",
95
+ "@next/eslint-plugin-next": "^15.3.4",
96
96
  "@tailwindcss/cli": "^4.1.10",
97
97
  "@types/lodash.merge": "^4.6.9",
98
98
  "@types/react": "^19.1.8",
99
99
  "@types/react-dom": "^19.1.6",
100
- "next": "15.3.3",
100
+ "next": "15.3.4",
101
101
  "tailwindcss": "^4.1.10",
102
102
  "tsc-alias": "^1.8.16",
103
+ "eslint-config-custom": "0.0.0",
103
104
  "@fumadocs/cli": "0.2.1",
104
- "fumadocs-core": "15.5.2",
105
- "tsconfig": "0.0.0",
106
- "eslint-config-custom": "0.0.0"
105
+ "fumadocs-core": "15.5.4",
106
+ "tsconfig": "0.0.0"
107
107
  },
108
108
  "peerDependencies": {
109
+ "@types/react": "*",
109
110
  "next": "14.x.x || 15.x.x",
110
111
  "react": "18.x.x || 19.x.x",
111
112
  "react-dom": "18.x.x || 19.x.x",
112
- "tailwindcss": "^3.4.14 || ^4.0.0",
113
- "@types/react": "*"
113
+ "tailwindcss": "^3.4.14 || ^4.0.0"
114
114
  },
115
115
  "peerDependenciesMeta": {
116
116
  "next": {