fumadocs-ui 15.7.3 → 15.7.5

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/shiki.css CHANGED
@@ -1,6 +1,6 @@
1
1
  .shiki:not(.not-fumadocs-codeblock *) {
2
- --padding-left: calc(var(--spacing) * 3);
3
- --padding-right: calc(var(--spacing) * 3);
2
+ --padding-left: calc(var(--spacing) * 4);
3
+ --padding-right: calc(var(--spacing) * 4);
4
4
 
5
5
  code span {
6
6
  color: var(--shiki-light);
@@ -44,7 +44,7 @@
44
44
 
45
45
  code .diff::before {
46
46
  position: absolute;
47
- left: var(--spacing);
47
+ left: calc(var(--spacing) * 1.5);
48
48
  }
49
49
 
50
50
  code .diff.remove {
@@ -70,7 +70,9 @@
70
70
 
71
71
  code .highlighted {
72
72
  --fd-counter-color: var(--color-fd-primary);
73
- @apply bg-fd-primary/10;
73
+ padding-left: calc(var(--padding-left) - 2px);
74
+
75
+ @apply border-l-2 border-fd-primary/50 bg-fd-primary/10;
74
76
  }
75
77
 
76
78
  code .highlighted-word {
@@ -38,5 +38,5 @@ export declare function CodeBlock({ ref, title, allowCopy, keepBackground, icon,
38
38
  export declare function CodeBlockTabs({ ref, ...props }: ComponentProps<typeof Tabs>): import("react/jsx-runtime").JSX.Element;
39
39
  export declare function CodeBlockTabsList(props: ComponentProps<typeof TabsList>): import("react/jsx-runtime").JSX.Element;
40
40
  export declare function CodeBlockTabsTrigger({ children, ...props }: ComponentProps<typeof TabsTrigger>): import("react/jsx-runtime").JSX.Element;
41
- export declare const CodeBlockTab: typeof TabsContent;
41
+ export declare function CodeBlockTab({ className, ...props }: ComponentProps<typeof TabsContent>): import("react/jsx-runtime").JSX.Element;
42
42
  //# sourceMappingURL=codeblock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEn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Q,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,WAAW,CAAC,2CAapC;AAGD,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,WAAW,CAAC,2CAEpC"}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Check, Copy } from '../icons.js';
3
+ import { Check, Clipboard } from '../icons.js';
4
4
  import { createContext, useContext, useMemo, useRef, } from 'react';
5
5
  import { cn } from '../utils/cn.js';
6
6
  import { useCopyButton } from '../utils/use-copy-button.js';
@@ -12,18 +12,18 @@ export function Pre(props) {
12
12
  return (_jsx("pre", { ...props, className: cn('min-w-full w-max *:flex *:flex-col', props.className), children: props.children }));
13
13
  }
14
14
  export function CodeBlock({ ref, title, allowCopy, keepBackground = false, icon, viewportProps = {}, children, Actions = (props) => (_jsx("div", { ...props, className: cn('empty:hidden', props.className) })), ...props }) {
15
- const isTab = useContext(TabsContext) !== null;
15
+ const inTab = useContext(TabsContext) !== null;
16
16
  const areaRef = useRef(null);
17
- allowCopy ?? (allowCopy = !isTab);
18
- const bg = cn('bg-fd-secondary', keepBackground && 'bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)');
19
- return (_jsxs("figure", { ref: ref, dir: "ltr", ...props, className: cn(isTab ? [bg, 'rounded-lg'] : 'my-4 rounded-xl bg-fd-card p-1', 'shiki relative border shadow-sm outline-none not-prose overflow-hidden text-sm', props.className), children: [title ? (_jsxs("div", { className: cn('flex text-fd-muted-foreground items-center gap-2 ps-3 h-9.5', isTab && 'border-b'), children: [typeof icon === 'string' ? (_jsx("div", { className: "[&_svg]:size-3.5", dangerouslySetInnerHTML: {
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-md 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: {
20
19
  __html: icon,
21
20
  } })) : (icon), _jsx("figcaption", { className: "flex-1 truncate", children: title }), Actions({
21
+ className: '-me-2',
22
22
  children: allowCopy && _jsx(CopyButton, { containerRef: areaRef }),
23
23
  })] })) : (Actions({
24
- className: 'absolute top-1 right-1 z-2 bg-fd-card rounded-bl-lg border-l border-b text-fd-muted-foreground',
24
+ className: 'absolute top-2 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground',
25
25
  children: allowCopy && _jsx(CopyButton, { containerRef: areaRef }),
26
- })), _jsx("div", { ref: areaRef, ...viewportProps, className: cn(!isTab && [bg, 'rounded-lg border'], 'text-[13px] py-3.5 overflow-auto max-h-[600px] fd-scroll-container', viewportProps.className), style: {
26
+ })), _jsx("div", { ref: areaRef, ...viewportProps, className: cn('text-[13px] py-3.5 overflow-auto max-h-[600px] fd-scroll-container', viewportProps.className), style: {
27
27
  // space for toolbar
28
28
  '--padding-right': !title ? 'calc(var(--spacing) * 8)' : undefined,
29
29
  counterSet: props['data-line-numbers']
@@ -44,23 +44,26 @@ function CopyButton({ className, containerRef, ...props }) {
44
44
  void navigator.clipboard.writeText(clone.textContent ?? '');
45
45
  });
46
46
  return (_jsx("button", { type: "button", className: cn(buttonVariants({
47
- className: '[&_svg]:size-3.5 hover:text-fd-accent-foreground',
48
- }), className), "aria-label": checked ? 'Copied Text' : 'Copy Text', onClick: onClick, ...props, children: checked ? _jsx(Check, {}) : _jsx(Copy, {}) }));
47
+ className: 'hover:text-fd-accent-foreground',
48
+ size: 'icon-xs',
49
+ }), className), "aria-label": checked ? 'Copied Text' : 'Copy Text', onClick: onClick, ...props, children: checked ? _jsx(Check, {}) : _jsx(Clipboard, {}) }));
49
50
  }
50
51
  export function CodeBlockTabs({ ref, ...props }) {
51
52
  const containerRef = useRef(null);
52
53
  const nested = useContext(TabsContext) !== null;
53
- return (_jsx(Tabs, { ref: mergeRefs(containerRef, ref), ...props, className: cn('bg-fd-card p-1 rounded-xl border overflow-hidden', !nested && 'my-4', props.className), children: _jsx(TabsContext.Provider, { value: useMemo(() => ({
54
+ return (_jsx(Tabs, { ref: mergeRefs(containerRef, ref), ...props, className: cn('bg-fd-card rounded-xl border', nested ? 'shadow-sm' : 'my-4', props.className), children: _jsx(TabsContext.Provider, { value: useMemo(() => ({
54
55
  containerRef,
55
56
  nested,
56
57
  }), [nested]), children: props.children }) }));
57
58
  }
58
59
  export function CodeBlockTabsList(props) {
59
60
  const { containerRef, nested } = useContext(TabsContext);
60
- return (_jsxs(TabsList, { ...props, className: cn('flex flex-row overflow-x-auto px-1 -mx-1 text-fd-muted-foreground', props.className), children: [props.children, !nested && (_jsx(CopyButton, { className: "sticky ms-auto right-0 bg-fd-card backdrop-blur-sm", containerRef: containerRef }))] }));
61
+ return (_jsxs(TabsList, { ...props, className: cn('flex flex-row *:first:ms-2 overflow-x-auto text-fd-muted-foreground', props.className), children: [props.children, !nested && (_jsx(CopyButton, { className: "sticky ms-auto right-2 bg-fd-card backdrop-blur-sm", containerRef: containerRef }))] }));
61
62
  }
62
63
  export function CodeBlockTabsTrigger({ children, ...props }) {
63
- return (_jsxs(TabsTrigger, { ...props, className: cn('relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 first:ms-1 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5', props.className), children: [_jsx("div", { className: "absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary" }), children] }));
64
+ return (_jsxs(TabsTrigger, { ...props, className: cn('relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5', props.className), children: [_jsx("div", { className: "absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary" }), children] }));
64
65
  }
65
66
  // TODO: currently Vite RSC plugin has problem with adding `asChild` here, maybe revisit this in future
66
- export const CodeBlockTab = TabsContent;
67
+ export function CodeBlockTab({ className, ...props }) {
68
+ return _jsx(TabsContent, { className: cn('-mx-px -mb-px', className), ...props });
69
+ }
@@ -46,7 +46,7 @@ export function SearchDialogFooter(props) {
46
46
  return (_jsx("div", { ...props, className: cn('bg-fd-secondary/50 p-3 empty:hidden', props.className) }));
47
47
  }
48
48
  export function SearchDialogOverlay(props) {
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
+ return (_jsx(DialogOverlay, { ...props, className: cn('fixed inset-0 z-50 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out', props.className) }));
50
50
  }
51
51
  export function SearchDialogContent({ children, ...props }) {
52
52
  const { text } = useI18n();
package/dist/icons.d.ts CHANGED
@@ -30,6 +30,7 @@ export declare const Check: import("react").ForwardRefExoticComponent<Omit<Lucid
30
30
  export declare const TriangleAlert: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
31
31
  export declare const Info: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
32
32
  export declare const Copy: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
33
+ export declare const Clipboard: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
33
34
  export declare const FileText: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
34
35
  export declare const Hash: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
35
36
  export declare const Text: import("react").ForwardRefExoticComponent<Omit<LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
@@ -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;AAevE,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;AA6BJ,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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
149
+ export const Clipboard = createLucideIcon('clipboard', [
150
+ [
151
+ 'rect',
152
+ {
153
+ width: '8',
154
+ height: '4',
155
+ x: '8',
156
+ y: '2',
157
+ rx: '1',
158
+ ry: '1',
159
+ key: '1',
160
+ },
161
+ ],
162
+ [
163
+ 'path',
164
+ {
165
+ d: 'M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2',
166
+ key: '2',
167
+ },
168
+ ],
169
+ ]);
149
170
  export const FileText = createLucideIcon('file-text', [
150
171
  [
151
172
  'path',
@@ -1,13 +1,9 @@
1
1
  import { type ComponentProps } from 'react';
2
2
  import type { PageTree } from 'fumadocs-core/server';
3
3
  import { type BreadcrumbOptions } from 'fumadocs-core/breadcrumb';
4
- import { type AnchorProviderProps } from 'fumadocs-core/toc';
5
4
  export declare function PageTOCPopoverTrigger(props: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
6
5
  export declare function PageTOCPopoverContent(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
7
6
  export declare function PageTOCPopover(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
- export interface RootProps extends ComponentProps<'div'> {
9
- toc: Omit<AnchorProviderProps, 'children'>;
10
- }
11
7
  export declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
12
8
  date: Date | string;
13
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"page-client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/page-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAAE,KAAK,mBAAmB,EAAmB,MAAM,mBAAmB,CAA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2CAqBnD"}
@@ -146,9 +146,12 @@ export function PageBreadcrumb({ includeRoot = false, includeSeparator, includeP
146
146
  }) }));
147
147
  }
148
148
  export function PageTOC(props) {
149
- return (_jsx("div", { id: "nd-toc", ...props, className: cn('sticky pb-2 pt-12 max-xl:hidden', props.className), style: {
149
+ const { collapsed } = useSidebar();
150
+ return (_jsx("div", { id: "nd-toc", ...props, className: cn('fixed bottom-0 pb-2 pt-12 max-xl:hidden', props.className), style: {
150
151
  ...props.style,
151
152
  top: 'calc(var(--fd-banner-height) + var(--fd-nav-height))',
152
- height: 'calc(100dvh - var(--fd-banner-height) - var(--fd-nav-height))',
153
+ insetInlineEnd: collapsed
154
+ ? 'max(0px, calc(50vw - var(--fd-sidebar-width)/2 - var(--fd-page-width)/2))'
155
+ : 'max(var(--fd-layout-offset), calc(50vw - var(--fd-sidebar-width)/2 - var(--fd-page-width)/2))',
153
156
  }, children: _jsx("div", { className: "flex h-full w-(--fd-toc-width) max-w-full flex-col pe-4", children: props.children }) }));
154
157
  }
@@ -1,5 +1,6 @@
1
1
  import { type ComponentProps } from 'react';
2
- import { type BreadcrumbProps, type FooterProps, PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, type RootProps } from './page-client.js';
2
+ import { type BreadcrumbProps, type FooterProps, PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger } from './page-client.js';
3
+ import type { AnchorProviderProps } from 'fumadocs-core/toc';
3
4
  /**
4
5
  * Apply `prose` on div
5
6
  */
@@ -12,6 +13,9 @@ export declare function PageTOCPopoverItems({ variant, ...props }: ComponentProp
12
13
  variant?: 'clerk' | 'normal';
13
14
  }): import("react/jsx-runtime").JSX.Element;
14
15
  export declare function PageArticle(props: ComponentProps<'article'>): import("react/jsx-runtime").JSX.Element;
16
+ export interface RootProps extends ComponentProps<'div'> {
17
+ toc?: Omit<AnchorProviderProps, 'children'> | false;
18
+ }
15
19
  export declare function PageRoot({ toc, children, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
16
- export { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, type FooterProps, type BreadcrumbProps, type RootProps, };
20
+ export { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, type FooterProps, type BreadcrumbProps, };
17
21
  //# sourceMappingURL=page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAMrD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,2CAavD;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CAAE,2CAM1D;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;CAAE,2CAM1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,SAAS,CAAC,2CAY3D;AAED,wBAAgB,QAAQ,CAAC,EAA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CAAC,GAAG,KAAK,CAAC;CACrD;AAED,wBAAgB,QAAQ,CAAC,EAAE,GAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAgBtE;AAED,OAAO,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,CAAC"}
@@ -23,7 +23,10 @@ export function PageTOCPopoverItems({ variant = 'normal', ...props }) {
23
23
  export function PageArticle(props) {
24
24
  return (_jsx("article", { ...props, className: cn('flex min-w-0 w-full flex-col gap-4 pt-8 px-4 md:px-6 md:mx-auto', props.className), children: props.children }));
25
25
  }
26
- export function PageRoot({ toc, children, ...props }) {
27
- return (_jsx(TOCProvider, { ...toc, children: _jsx("div", { id: "nd-page", ...props, className: cn('flex flex-1 w-full mx-auto max-w-(--fd-page-width) pt-(--fd-tocnav-height)', props.className), children: children }) }));
26
+ export function PageRoot({ toc = false, children, ...props }) {
27
+ const content = (_jsx("div", { id: "nd-page", ...props, className: cn('flex flex-1 w-full mx-auto max-w-(--fd-page-width) pt-(--fd-tocnav-height) pe-(--fd-toc-width)', props.className), children: children }));
28
+ if (toc)
29
+ return _jsx(TOCProvider, { ...toc, children: content });
30
+ return content;
28
31
  }
29
32
  export { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, };
@@ -44,8 +44,8 @@ export function LayoutTabs({ options, ...props }) {
44
44
  return isActive(option.url, pathname, true);
45
45
  });
46
46
  }, [options, pathname]);
47
- return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-4 overflow-auto', props.className), children: options.map((option) => (_jsx(LayoutTab, { selected: selected === option, option: option }, option.url))) }));
47
+ return (_jsx("div", { ...props, className: cn('flex flex-row items-end gap-6 overflow-auto', props.className), children: options.map((option) => (_jsx(LayoutTab, { selected: selected === option, option: option }, option.url))) }));
48
48
  }
49
49
  function LayoutTab({ option, selected = false, }) {
50
- return (_jsx(Link, { className: cn('inline-flex border-b border-transparent transition-colors items-center py-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap', option.unlisted && !selected && 'hidden', selected && 'border-fd-primary text-fd-primary'), href: option.url, children: option.title }));
50
+ return (_jsx(Link, { className: cn('inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground', option.unlisted && !selected && 'hidden', selected && 'border-fd-primary text-fd-primary'), href: option.url, children: option.title }));
51
51
  }
@@ -68,7 +68,7 @@ export function DocsLayout(props) {
68
68
  function DocsNavbar({ links, tabs, searchToggle = {}, themeSwitch = {}, nav = {}, ...props }) {
69
69
  const navMode = nav.mode ?? 'auto';
70
70
  const sidebarCollapsible = props.sidebar?.collapsible ?? true;
71
- return (_jsxs(Navbar, { mode: navMode, children: [_jsxs("div", { className: cn('flex border-b px-4 gap-2 flex-1', navMode === 'auto' && 'md:px-6'), children: [_jsxs("div", { className: cn('items-center', navMode === 'top' && 'flex flex-1', navMode === 'auto' && [
71
+ return (_jsxs(Navbar, { mode: navMode, children: [_jsxs("div", { className: cn('flex border-b px-4 gap-2 flex-1 md:px-6', navMode === 'top' && 'ps-7'), children: [_jsxs("div", { className: cn('items-center', navMode === 'top' && 'flex flex-1', navMode === 'auto' && [
72
72
  'hidden max-md:flex',
73
73
  sidebarCollapsible && 'has-data-[collapsed=true]:md:flex',
74
74
  ]), children: [sidebarCollapsible && navMode === 'auto' && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
@@ -86,7 +86,7 @@ function DocsNavbar({ links, tabs, searchToggle = {}, themeSwitch = {}, nav = {}
86
86
  (themeSwitch.component ?? (_jsx(ThemeToggle, { mode: themeSwitch.mode ?? 'light-dark-system' }))), sidebarCollapsible && navMode === 'top' && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
87
87
  color: 'secondary',
88
88
  size: 'icon-sm',
89
- }), 'text-fd-muted-foreground rounded-full'), children: _jsx(SidebarIcon, {}) }))] })] })] }), tabs.length > 0 && (_jsx(LayoutTabs, { className: cn('border-b h-10 max-lg:hidden', navMode === 'top' ? 'px-4' : 'px-6'), options: tabs }))] }));
89
+ }), 'text-fd-muted-foreground rounded-full -me-1.5'), children: _jsx(SidebarIcon, {}) }))] })] })] }), tabs.length > 0 && (_jsx(LayoutTabs, { className: cn('border-b px-6 h-10 max-lg:hidden', navMode === 'top' && 'ps-7'), options: tabs }))] }));
90
90
  }
91
91
  function NavbarLinkItem({ item, ...props }) {
92
92
  if (item.type === 'menu') {
package/dist/mdx.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from 'react';
2
2
  import { Card, Cards } from './components/card.js';
3
- import { CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from './components/codeblock.js';
3
+ import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from './components/codeblock.js';
4
4
  declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
5
5
  sizes?: string;
6
6
  }): import("react/jsx-runtime").JSX.Element;
7
7
  declare function Table(props: TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
8
8
  declare const defaultMdxComponents: {
9
- CodeBlockTab: typeof import("./components/tabs.unstyled.js").TabsContent;
9
+ CodeBlockTab: typeof CodeBlockTab;
10
10
  CodeBlockTabs: typeof CodeBlockTabs;
11
11
  CodeBlockTabsList: typeof CodeBlockTabsList;
12
12
  CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
package/dist/mdx.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../src/mdx.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,EAAE,EACF,cAAc,EACd,iBAAiB,E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B,GAAG,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAE1E,wBAAgB,QAAQ,CAAC,EACvB,YAAY,EACZ,UAAU,EAAE,EACV,OAAO,EAAE,iBAAwB,EACjC,SAAS,EAAE,UAAU,EACrB,GAAG,eAAe,EACd,EACN,MAAW,EACX,UAAU,EACV,SAAS,EACT,IAAY,EACZ,qBAAqB,EAAE,EACrB,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,UAAU,EACrB,GAAG,iBAAiB,EAChB,EACN,cAAc,EAAE,EACd,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,GAAG,UAAU,EACT,EACN,GAAQ,EACR,OAAO,EACP,QAAQ,GACT,EAAE,aAAa,2CAkEf;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,2CAuBtD;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,2MAMpB,CAAC;AAIF,eAAO,MAAM,eAAe,6NAgB1B,CAAC;AAIH,eAAO,MAAM,SAAS,uNAYrB,CAAC;AAIF;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAMpE"}
package/dist/page.js CHANGED
@@ -6,20 +6,22 @@ import { Edit } from './icons.js';
6
6
  import { I18nLabel } from './contexts/i18n.js';
7
7
  import { PageArticle, PageBreadcrumb, PageFooter, PageLastUpdate, PageRoot, PageTOC, PageTOCItems, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverItems, PageTOCPopoverTrigger, PageTOCTitle, } from './layouts/docs/page.js';
8
8
  export function DocsPage({ editOnGithub, breadcrumb: { enabled: breadcrumbEnabled = true, component: breadcrumb, ...breadcrumbProps } = {}, footer = {}, lastUpdate, container, full = false, tableOfContentPopover: { enabled: tocPopoverEnabled, component: tocPopover, ...tocPopoverOptions } = {}, tableOfContent: { enabled: tocEnabled, component: tocReplace, ...tocOptions } = {}, toc = [], article, children, }) {
9
- const isTocRequired = toc.length > 0 ||
10
- tocOptions.footer !== undefined ||
11
- tocOptions.header !== undefined;
12
9
  // disable TOC on full mode, you can still enable it with `enabled` option.
13
- tocEnabled ?? (tocEnabled = !full && isTocRequired);
10
+ tocEnabled ?? (tocEnabled = !full &&
11
+ (toc.length > 0 ||
12
+ tocOptions.footer !== undefined ||
13
+ tocOptions.header !== undefined));
14
14
  tocPopoverEnabled ?? (tocPopoverEnabled = toc.length > 0 ||
15
15
  tocPopoverOptions.header !== undefined ||
16
16
  tocPopoverOptions.footer !== undefined);
17
- return (_jsxs(PageRoot, { toc: {
18
- toc,
19
- single: tocOptions.single,
20
- }, ...container, children: [tocPopoverEnabled &&
17
+ return (_jsxs(PageRoot, { toc: tocEnabled || tocPopoverEnabled
18
+ ? {
19
+ toc,
20
+ single: tocOptions.single,
21
+ }
22
+ : false, ...container, className: cn(!tocEnabled && '[--fd-toc-width:0px]', container?.className), children: [tocPopoverEnabled &&
21
23
  (tocPopover ?? (_jsxs(PageTOCPopover, { children: [_jsx(PageTOCPopoverTrigger, {}), _jsxs(PageTOCPopoverContent, { children: [tocPopoverOptions.header, _jsx(PageTOCPopoverItems, { variant: tocPopoverOptions.style }), tocPopoverOptions.footer] })] }))), _jsxs(PageArticle, { ...article, children: [breadcrumbEnabled &&
22
- (breadcrumb ?? _jsx(PageBreadcrumb, { ...breadcrumbProps })), children, _jsx("div", { role: "none", className: "flex-1" }), _jsxs("div", { className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden", children: [editOnGithub && (_jsx(EditOnGitHub, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith('/') ? editOnGithub.path.slice(1) : editOnGithub.path}` })), lastUpdate && _jsx(PageLastUpdate, { date: new Date(lastUpdate) })] }), footer.enabled !== false &&
24
+ (breadcrumb ?? _jsx(PageBreadcrumb, { ...breadcrumbProps })), children, _jsxs("div", { className: "flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden", children: [editOnGithub && (_jsx(EditOnGitHub, { href: `https://github.com/${editOnGithub.owner}/${editOnGithub.repo}/blob/${editOnGithub.sha}/${editOnGithub.path.startsWith('/') ? editOnGithub.path.slice(1) : editOnGithub.path}` })), lastUpdate && _jsx(PageLastUpdate, { date: new Date(lastUpdate) })] }), footer.enabled !== false &&
23
25
  (footer.component ?? _jsx(PageFooter, { items: footer.items }))] }), tocEnabled &&
24
26
  (tocReplace ?? (_jsxs(PageTOC, { children: [tocOptions.header, _jsx(PageTOCTitle, {}), _jsx(PageTOCItems, { variant: tocOptions.style }), tocOptions.footer] })))] }));
25
27
  }
@@ -33,7 +35,7 @@ export function EditOnGitHub(props) {
33
35
  /**
34
36
  * Add typography styles
35
37
  */
36
- export const DocsBody = forwardRef((props, ref) => (_jsx("div", { ref: ref, ...props, className: cn('prose', props.className), children: props.children })));
38
+ export const DocsBody = forwardRef((props, ref) => (_jsx("div", { ref: ref, ...props, className: cn('prose flex-1', props.className), children: props.children })));
37
39
  DocsBody.displayName = 'DocsBody';
38
40
  export const DocsDescription = forwardRef((props, ref) => {
39
41
  // don't render if no description provided
package/dist/style.css CHANGED
@@ -343,26 +343,23 @@
343
343
  .top-0 {
344
344
  top: calc(var(--spacing) * 0);
345
345
  }
346
- .top-1 {
347
- top: calc(var(--spacing) * 1);
348
- }
349
346
  .top-1\.5 {
350
347
  top: calc(var(--spacing) * 1.5);
351
348
  }
352
349
  .top-1\/2 {
353
350
  top: calc(1/2 * 100%);
354
351
  }
352
+ .top-2 {
353
+ top: calc(var(--spacing) * 2);
354
+ }
355
355
  .top-4 {
356
356
  top: calc(var(--spacing) * 4);
357
357
  }
358
358
  .top-14 {
359
359
  top: calc(var(--spacing) * 14);
360
360
  }
361
- .right-0 {
362
- right: calc(var(--spacing) * 0);
363
- }
364
- .right-1 {
365
- right: calc(var(--spacing) * 1);
361
+ .right-2 {
362
+ right: calc(var(--spacing) * 2);
366
363
  }
367
364
  .bottom-\(--fd-sidebar-margin\) {
368
365
  bottom: var(--fd-sidebar-margin);
@@ -428,6 +425,9 @@
428
425
  .-mx-1 {
429
426
  margin-inline: calc(var(--spacing) * -1);
430
427
  }
428
+ .-mx-px {
429
+ margin-inline: -1px;
430
+ }
431
431
  .mx-\(--fd-layout-offset\) {
432
432
  margin-inline: var(--fd-layout-offset);
433
433
  }
@@ -470,6 +470,9 @@
470
470
  .-me-1\.5 {
471
471
  margin-inline-end: calc(var(--spacing) * -1.5);
472
472
  }
473
+ .-me-2 {
474
+ margin-inline-end: calc(var(--spacing) * -2);
475
+ }
473
476
  .me-2 {
474
477
  margin-inline-end: calc(var(--spacing) * 2);
475
478
  }
@@ -860,6 +863,9 @@
860
863
  .mr-auto {
861
864
  margin-right: auto;
862
865
  }
866
+ .-mb-px {
867
+ margin-bottom: -1px;
868
+ }
863
869
  .mb-1 {
864
870
  margin-bottom: calc(var(--spacing) * 1);
865
871
  }
@@ -1267,9 +1273,6 @@
1267
1273
  .rounded-xl {
1268
1274
  border-radius: var(--radius-xl);
1269
1275
  }
1270
- .rounded-bl-lg {
1271
- border-bottom-left-radius: var(--radius-lg);
1272
- }
1273
1276
  .border {
1274
1277
  border-style: var(--tw-border-style);
1275
1278
  border-width: 1px;
@@ -1294,6 +1297,10 @@
1294
1297
  border-bottom-style: var(--tw-border-style);
1295
1298
  border-bottom-width: 1px;
1296
1299
  }
1300
+ .border-b-2 {
1301
+ border-bottom-style: var(--tw-border-style);
1302
+ border-bottom-width: 2px;
1303
+ }
1297
1304
  .border-l {
1298
1305
  border-left-style: var(--tw-border-style);
1299
1306
  border-left-width: 1px;
@@ -1421,9 +1428,6 @@
1421
1428
  .px-\(--fd-layout-offset\) {
1422
1429
  padding-inline: var(--fd-layout-offset);
1423
1430
  }
1424
- .px-1 {
1425
- padding-inline: calc(var(--spacing) * 1);
1426
- }
1427
1431
  .px-1\.5 {
1428
1432
  padding-inline: calc(var(--spacing) * 1.5);
1429
1433
  }
@@ -1487,12 +1491,18 @@
1487
1491
  .ps-6 {
1488
1492
  padding-inline-start: calc(var(--spacing) * 6);
1489
1493
  }
1494
+ .ps-7 {
1495
+ padding-inline-start: calc(var(--spacing) * 7);
1496
+ }
1490
1497
  .ps-8 {
1491
1498
  padding-inline-start: calc(var(--spacing) * 8);
1492
1499
  }
1493
1500
  .ps-\[calc\(var\(--fd-layout-offset\)\+var\(--fd-sidebar-width\)\)\] {
1494
1501
  padding-inline-start: calc(var(--fd-layout-offset) + var(--fd-sidebar-width));
1495
1502
  }
1503
+ .pe-\(--fd-toc-width\) {
1504
+ padding-inline-end: var(--fd-toc-width);
1505
+ }
1496
1506
  .pe-2\.5 {
1497
1507
  padding-inline-end: calc(var(--spacing) * 2.5);
1498
1508
  }
@@ -1517,6 +1527,9 @@
1517
1527
  .pt-14 {
1518
1528
  padding-top: calc(var(--spacing) * 14);
1519
1529
  }
1530
+ .pb-1\.5 {
1531
+ padding-bottom: calc(var(--spacing) * 1.5);
1532
+ }
1520
1533
  .pb-2 {
1521
1534
  padding-bottom: calc(var(--spacing) * 2);
1522
1535
  }
@@ -1759,6 +1772,9 @@
1759
1772
  .\[--fd-nav-height\:56px\] {
1760
1773
  --fd-nav-height: 56px;
1761
1774
  }
1775
+ .\[--fd-toc-width\:0px\] {
1776
+ --fd-toc-width: 0px;
1777
+ }
1762
1778
  .\[scrollbar-width\:none\] {
1763
1779
  scrollbar-width: none;
1764
1780
  }
@@ -1872,11 +1888,6 @@
1872
1888
  content: var(--tw-content);
1873
1889
  }
1874
1890
  }
1875
- .first\:ms-1 {
1876
- &:first-child {
1877
- margin-inline-start: calc(var(--spacing) * 1);
1878
- }
1879
- }
1880
1891
  .first\:mt-0 {
1881
1892
  &:first-child {
1882
1893
  margin-top: calc(var(--spacing) * 0);
@@ -1887,6 +1898,13 @@
1887
1898
  padding-top: calc(var(--spacing) * 0);
1888
1899
  }
1889
1900
  }
1901
+ .\*\:first\:ms-2 {
1902
+ :is(& > *) {
1903
+ &:first-child {
1904
+ margin-inline-start: calc(var(--spacing) * 2);
1905
+ }
1906
+ }
1907
+ }
1890
1908
  .last\:pb-0 {
1891
1909
  &:last-child {
1892
1910
  padding-bottom: calc(var(--spacing) * 0);
@@ -2308,13 +2326,6 @@
2308
2326
  padding: calc(var(--spacing) * 1.5);
2309
2327
  }
2310
2328
  }
2311
- .max-md\:backdrop-blur-xs {
2312
- @media (width < 48rem) {
2313
- --tw-backdrop-blur: blur(var(--blur-xs));
2314
- -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,);
2315
- 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,);
2316
- }
2317
- }
2318
2329
  .max-sm\:mt-2 {
2319
2330
  @media (width < 40rem) {
2320
2331
  margin-top: calc(var(--spacing) * 2);
@@ -2590,8 +2601,8 @@
2590
2601
  --color-fd-muted-foreground: hsl(0, 0%, 72%);
2591
2602
  }
2592
2603
  .shiki:not(.not-fumadocs-codeblock *) {
2593
- --padding-left: calc(var(--spacing) * 3);
2594
- --padding-right: calc(var(--spacing) * 3);
2604
+ --padding-left: calc(var(--spacing) * 4);
2605
+ --padding-right: calc(var(--spacing) * 4);
2595
2606
  code span {
2596
2607
  color: var(--shiki-light);
2597
2608
  }
@@ -2627,7 +2638,7 @@
2627
2638
  }
2628
2639
  code .diff::before {
2629
2640
  position: absolute;
2630
- left: var(--spacing);
2641
+ left: calc(var(--spacing) * 1.5);
2631
2642
  }
2632
2643
  code .diff.remove {
2633
2644
  opacity: 0.7;
@@ -2648,6 +2659,13 @@
2648
2659
  }
2649
2660
  code .highlighted {
2650
2661
  --fd-counter-color: var(--color-fd-primary);
2662
+ padding-left: calc(var(--padding-left) - 2px);
2663
+ border-left-style: var(--tw-border-style);
2664
+ border-left-width: 2px;
2665
+ border-color: color-mix(in srgb, hsl(0, 0%, 9%) 50%, transparent);
2666
+ @supports (color: color-mix(in lab, red, red)) {
2667
+ border-color: color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
2668
+ }
2651
2669
  background-color: color-mix(in srgb, hsl(0, 0%, 9%) 10%, transparent);
2652
2670
  @supports (color: color-mix(in lab, red, red)) {
2653
2671
  background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
@@ -1 +1 @@
1
- {"version":3,"file":"is-active.d.ts","sourceRoot":"","sources":["../../src/utils/is-active.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,UAAO,GACZ,OAAO,CAKT"}
1
+ {"version":3,"file":"is-active.d.ts","sourceRoot":"","sources":["../../src/utils/is-active.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,UAAO,GACZ,OAAO,CAKT"}
@@ -1,7 +1,10 @@
1
+ function normalize(url) {
2
+ if (url.length > 1 && url.endsWith('/'))
3
+ return url.slice(0, -1);
4
+ return url;
5
+ }
1
6
  export function isActive(url, pathname, nested = true) {
2
- if (url.endsWith('/'))
3
- url = url.slice(0, -1);
4
- if (pathname.endsWith('/'))
5
- pathname = pathname.slice(0, -1);
7
+ url = normalize(url);
8
+ pathname = normalize(pathname);
6
9
  return url === pathname || (nested && pathname.startsWith(`${url}/`));
7
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.7.3",
3
+ "version": "15.7.5",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -121,20 +121,20 @@
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.3"
124
+ "fumadocs-core": "15.7.5"
125
125
  },
126
126
  "devDependencies": {
127
- "@next/eslint-plugin-next": "^15.5.0",
127
+ "@next/eslint-plugin-next": "^15.5.2",
128
128
  "@tailwindcss/cli": "^4.1.12",
129
129
  "@types/lodash.merge": "^4.6.9",
130
- "@types/react": "^19.1.11",
131
- "@types/react-dom": "^19.1.7",
132
- "next": "15.5.0",
130
+ "@types/react": "^19.1.12",
131
+ "@types/react-dom": "^19.1.8",
132
+ "next": "15.5.2",
133
133
  "tailwindcss": "^4.1.12",
134
134
  "tsc-alias": "^1.8.16",
135
- "@fumadocs/cli": "1.0.0",
135
+ "@fumadocs/cli": "1.0.1",
136
136
  "eslint-config-custom": "0.0.0",
137
- "fumadocs-core": "15.7.3",
137
+ "fumadocs-core": "15.7.5",
138
138
  "tsconfig": "0.0.0"
139
139
  },
140
140
  "peerDependencies": {