fumadocs-ui 15.6.7 → 15.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/css/neutral.css CHANGED
@@ -22,7 +22,7 @@
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: hsla(0, 0%, 70%, 0.8);
25
- --color-fd-popover: hsl(0, 0%, 10.6%);
25
+ --color-fd-popover: hsl(0, 0%, 11.6%);
26
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%);
@@ -50,7 +50,7 @@ export function SearchDialogOverlay(props) {
50
50
  }
51
51
  export function SearchDialogContent({ children, ...props }) {
52
52
  const { text } = useI18n();
53
- return (_jsxs(DialogContent, { "aria-describedby": undefined, ...props, className: cn('fixed 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', '*:border-b *:has-[+:last-child[data-empty=true]]:border-b-0 *:data-[empty=true]:border-b-0 *:last:border-b-0', props.className), children: [_jsx(DialogTitle, { className: "hidden", children: text.search }), children] }));
53
+ return (_jsxs(DialogContent, { "aria-describedby": undefined, ...props, className: cn('fixed left-1/2 top-4 md:top-[calc(50%-250px)] z-50 w-[calc(100%-1rem)] max-w-screen-sm -translate-x-1/2 rounded-2xl border bg-fd-popover/80 backdrop-blur-xl text-fd-popover-foreground shadow-2xl shadow-black/50 overflow-hidden data-[state=closed]:animate-fd-dialog-out data-[state=open]:animate-fd-dialog-in', '*:border-b *:has-[+:last-child[data-empty=true]]:border-b-0 *:data-[empty=true]:border-b-0 *:last:border-b-0', props.className), children: [_jsx(DialogTitle, { className: "hidden", children: text.search }), children] }));
54
54
  }
55
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 }) {
56
56
  const ref = useRef(null);
@@ -24,9 +24,9 @@ export function RootToggle({ options, placeholder, ...props }) {
24
24
  closeOnRedirect.current = false;
25
25
  setOpen(false);
26
26
  };
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) => {
27
+ const item = selected ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "size-9 shrink-0 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: "shrink-0 ms-auto size-4 text-fd-muted-foreground" })] })), _jsx(PopoverContent, { className: "flex flex-col gap-1 w-(--radix-popover-trigger-width) overflow-hidden p-1", children: options.map((item) => {
29
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));
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: "shrink-0 size-9 md:mt-1 md:mb-auto md:size-5", 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('shrink-0 ms-auto size-3.5 text-fd-primary', !isActive && 'invisible') })] }, item.url));
31
31
  }) })] }));
32
32
  }
@@ -42,6 +42,7 @@ export declare function SidebarFolder({ defaultOpen, ...props }: ComponentProps<
42
42
  export declare function SidebarFolderTrigger({ className, ...props }: CollapsibleTriggerProps): import("react/jsx-runtime").JSX.Element;
43
43
  export declare function SidebarFolderLink(props: LinkProps): import("react/jsx-runtime").JSX.Element;
44
44
  export declare function SidebarFolderContent(props: CollapsibleContentProps): import("react/jsx-runtime").JSX.Element;
45
+ export declare function SidebarTrigger({ children, ...props }: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
45
46
  export declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
46
47
  export interface SidebarComponents {
47
48
  Item: FC<{
@@ -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;AAKrD,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AA2BD,wBAAgB,OAAO,CAAC,EACtB,gBAAoB,EACpB,QAAe,EACf,MAAM,EACN,OAAO,GACR,EAAE,YAAY,2CAed;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,2CAoE5D;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,CAAC,2CA+BzB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CASzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CASzD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,2CAiBrD;AAED,w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AAmB,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,2CAezB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,2CAiCjD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAoClE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAY1B;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"}
@@ -145,6 +145,10 @@ export function SidebarFolderContent(props) {
145
145
  level,
146
146
  }), [ctx, level]), children: props.children })] }));
147
147
  }
148
+ export function SidebarTrigger({ children, ...props }) {
149
+ const { setOpen } = useSidebar();
150
+ return (_jsx("button", { ...props, "aria-label": "Open Sidebar", onClick: () => setOpen((prev) => !prev), children: children }));
151
+ }
148
152
  export function SidebarCollapseTrigger(props) {
149
153
  const { collapsed, setCollapsed } = useSidebar();
150
154
  return (_jsx("button", { type: "button", "aria-label": "Collapse Sidebar", "data-collapsed": collapsed, ...props, onClick: () => {
@@ -8,7 +8,6 @@ export declare function PageTOCPopover(props: ComponentProps<'div'>): import("re
8
8
  export interface RootProps extends ComponentProps<'div'> {
9
9
  toc: Omit<AnchorProviderProps, 'children'>;
10
10
  }
11
- export declare function PageRoot({ toc, children, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
12
11
  export declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
13
12
  date: Date | string;
14
13
  }): 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,CAAC;AAO9E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAiDpE;AA4DD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAUjE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAuD1D;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,KAAK,CAAC;IACtD,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CAC5C;AAED,wBAAgB,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAqB9D;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EAAE,KAAK,EACX,GA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;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAuD1D;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,KAAK,CAAC;IACtD,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;CAC5C;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EAAE,KAAK,EACX,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG;IAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,2CAiBjE;AAED,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAAC,CAAC;AAChE,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,KAAK,CAAC;IACxD;;OAEG;IACH,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,IAAI,CAAC;KACb,CAAC;CACH;AAyBD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAiC1D;AA8BD,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExE,wBAAgB,cAAc,CAAC,EAC7B,WAAmB,EACnB,gBAAgB,EAChB,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,eAAe,kDA6CjB;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAiBnD"}
@@ -13,7 +13,7 @@ import { isActive } from '../../utils/is-active.js';
13
13
  import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
14
14
  import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible.js';
15
15
  import { useSidebar } from '../../contexts/sidebar.js';
16
- import { TOCProvider, useTOCItems } from '../../components/layout/toc.js';
16
+ import { useTOCItems } from '../../components/layout/toc.js';
17
17
  import { useActiveAnchor } from 'fumadocs-core/toc';
18
18
  const TocPopoverContext = createContext('TocPopoverContext');
19
19
  export function PageTOCPopoverTrigger(props) {
@@ -24,7 +24,7 @@ export function PageTOCPopoverTrigger(props) {
24
24
  const selected = useMemo(() => items.findIndex((item) => active === item.url.slice(1)), [items, active]);
25
25
  const path = useTreePath().at(-1);
26
26
  const showItem = selected !== -1 && !open;
27
- return (_jsxs(CollapsibleTrigger, { ...props, className: cn('flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:shrink-0 [&_svg]:size-4 md:px-6', props.className), children: [_jsx(ProgressCircle, { value: (selected + 1) / Math.max(1, items.length), max: 1, className: cn(open && 'text-fd-primary') }), _jsxs("span", { className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1", children: [_jsx("span", { className: cn('truncate transition-all', open && 'text-fd-foreground', showItem && 'opacity-0 -translate-y-full pointer-events-none'), children: path?.name ?? text.toc }), _jsx("span", { className: cn('truncate transition-all', !showItem && 'opacity-0 translate-y-full pointer-events-none'), children: items[selected]?.title })] }), _jsx(ChevronDown, { className: cn('transition-transform mx-0.5', open && 'rotate-180') })] }));
27
+ return (_jsxs(CollapsibleTrigger, { ...props, className: cn('flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6', props.className), children: [_jsx(ProgressCircle, { value: (selected + 1) / Math.max(1, items.length), max: 1, className: cn('shrink-0', open && 'text-fd-primary') }), _jsxs("span", { className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1", children: [_jsx("span", { className: cn('truncate transition-all', open && 'text-fd-foreground', showItem && 'opacity-0 -translate-y-full pointer-events-none'), children: path?.name ?? text.toc }), _jsx("span", { className: cn('truncate transition-all', !showItem && 'opacity-0 translate-y-full pointer-events-none'), children: items[selected]?.title })] }), _jsx(ChevronDown, { className: cn('shrink-0 transition-transform mx-0.5', open && 'rotate-180') })] }));
28
28
  }
29
29
  function clamp(input, min, max) {
30
30
  if (input < min)
@@ -78,16 +78,6 @@ export function PageTOCPopover(props) {
78
78
  : 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
79
79
  }, children: props.children }) }) }));
80
80
  }
81
- export function PageRoot({ toc, children, ...props }) {
82
- const { collapsed } = useSidebar();
83
- return (_jsx(TOCProvider, { ...toc, children: _jsx("div", { id: "nd-page", ...props, className: cn('flex flex-1 mx-auto w-full', props.className), style: {
84
- paddingTop: 'calc(var(--fd-nav-height) + var(--fd-tocnav-height))',
85
- maxWidth: collapsed
86
- ? 'var(--fd-page-width)'
87
- : 'min(var(--fd-page-width),calc(var(--fd-layout-width) - var(--fd-sidebar-width)))',
88
- ...props.style,
89
- }, children: children }) }));
90
- }
91
81
  export function PageLastUpdate({ date: value, ...props }) {
92
82
  const { text } = useI18n();
93
83
  const [date, setDate] = useState('');
@@ -113,16 +103,16 @@ function scanNavigationList(tree) {
113
103
  });
114
104
  return list;
115
105
  }
116
- const listCache = new WeakMap();
106
+ const listCache = new Map();
117
107
  export function PageFooter({ items, ...props }) {
118
108
  const { root } = useTreeContext();
119
109
  const pathname = usePathname();
120
110
  const { previous, next } = useMemo(() => {
121
111
  if (items)
122
112
  return items;
123
- const cached = listCache.get(root);
113
+ const cached = listCache.get(root.$id);
124
114
  const list = cached ?? scanNavigationList(root.children);
125
- listCache.set(root, list);
115
+ listCache.set(root.$id, list);
126
116
  const idx = list.findIndex((item) => isActive(item.url, pathname, false));
127
117
  if (idx === -1)
128
118
  return {};
@@ -152,7 +142,7 @@ export function PageBreadcrumb({ includeRoot = false, includeSeparator, includeP
152
142
  return null;
153
143
  return (_jsx("div", { ...props, className: cn('flex items-center gap-1.5 text-sm text-fd-muted-foreground', props.className), children: items.map((item, i) => {
154
144
  const className = cn('truncate', i === items.length - 1 && 'text-fd-primary font-medium');
155
- return (_jsxs(Fragment, { children: [i !== 0 && _jsx("span", { className: "text-fd-foreground/30", children: "/" }), item.url ? (_jsx(Link, { href: item.url, className: cn(className, 'transition-opacity hover:opacity-80'), children: item.name })) : (_jsx("span", { className: className, children: item.name }))] }, i));
145
+ return (_jsxs(Fragment, { children: [i !== 0 && _jsx(ChevronRight, { className: "size-3.5 shrink-0" }), item.url ? (_jsx(Link, { href: item.url, className: cn(className, 'transition-opacity hover:opacity-80'), children: item.name })) : (_jsx("span", { className: className, children: item.name }))] }, i));
156
146
  }) }));
157
147
  }
158
148
  export function PageTOC(props) {
@@ -1,5 +1,5 @@
1
1
  import { type ComponentProps } from 'react';
2
- import { type BreadcrumbProps, type FooterProps, PageBreadcrumb, PageFooter, PageLastUpdate, PageRoot, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, type RootProps } from './page-client.js';
2
+ import { type BreadcrumbProps, type FooterProps, PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, type RootProps } from './page-client.js';
3
3
  /**
4
4
  * Apply `prose` on div
5
5
  */
@@ -12,5 +12,6 @@ export declare function PageTOCPopoverItems({ variant, ...props }: ComponentProp
12
12
  variant?: 'clerk' | 'normal';
13
13
  }): import("react/jsx-runtime").JSX.Element;
14
14
  export declare function PageArticle(props: ComponentProps<'article'>): import("react/jsx-runtime").JSX.Element;
15
- export { PageRoot, PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, type FooterProps, type BreadcrumbProps, type RootProps, };
15
+ 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, };
16
17
  //# 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,QAAQ,EACR,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,OAAO,EACL,QAAQ,EACR,cAAc,EACd,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,CAAC"}
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,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAe9D;AAED,OAAO,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,OAAO,EACP,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from '../../utils/cn.js';
3
- import { PageBreadcrumb, PageFooter, PageLastUpdate, PageRoot, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, } from './page-client.js';
4
- import { TOCItems, TOCScrollArea } from '../../components/layout/toc.js';
3
+ import { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, } from './page-client.js';
4
+ import { TOCItems, TOCProvider, TOCScrollArea } from '../../components/layout/toc.js';
5
5
  import { Text } from '../../icons.js';
6
6
  import { I18nLabel } from '../../contexts/i18n.js';
7
7
  import ClerkTOCItems from '../../components/layout/toc-clerk.js';
@@ -23,4 +23,7 @@ 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 px-4 pt-8 md:px-6 md:mx-auto xl:pt-12 xl:px-12', props.className), children: props.children }));
25
25
  }
26
- export { PageRoot, PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, };
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 }) }));
28
+ }
29
+ export { PageBreadcrumb, PageFooter, PageLastUpdate, PageTOC, PageTOCPopover, PageTOCPopoverTrigger, PageTOCPopoverContent, };
@@ -1,6 +1,5 @@
1
1
  import { type ComponentProps } from 'react';
2
2
  export declare function Navbar(props: ComponentProps<'header'>): import("react/jsx-runtime").JSX.Element;
3
3
  export declare function LayoutBody(props: ComponentProps<'main'>): import("react/jsx-runtime").JSX.Element;
4
- export declare function SidebarTrigger({ children, ...props }: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
5
4
  export declare function CollapsibleControl(): import("react/jsx-runtime").JSX.Element;
6
5
  //# sourceMappingURL=docs-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs-client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAqBvD;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAY1B;AAED,wBAAgB,kBAAkB,4CA2BjC"}
1
+ {"version":3,"file":"docs-client.d.ts","sourceRoot":"","sources":["../../src/layouts/docs-client.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ5C,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAgBrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,2CAsBvD;AAED,wBAAgB,kBAAkB,4CA2BjC"}
@@ -13,17 +13,14 @@ export function Navbar(props) {
13
13
  }
14
14
  export function LayoutBody(props) {
15
15
  const { collapsed } = useSidebar();
16
- return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[margin]', props.className), style: {
16
+ return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col pt-(--fd-nav-height) transition-[padding]', props.className), style: {
17
17
  ...props.style,
18
- marginInlineStart: collapsed
19
- ? 'max(0px, min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width)))'
20
- : 'var(--fd-sidebar-width)',
18
+ paddingInlineStart: collapsed
19
+ ? 'min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))'
20
+ : 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
21
+ paddingInlineEnd: collapsed ? '0px' : 'var(--fd-layout-offset)',
21
22
  }, children: props.children }));
22
23
  }
23
- export function SidebarTrigger({ children, ...props }) {
24
- const { setOpen } = useSidebar();
25
- return (_jsx("button", { ...props, "aria-label": "Open Sidebar", onClick: () => setOpen((prev) => !prev), children: children }));
26
- }
27
24
  export function CollapsibleControl() {
28
25
  const { collapsed } = useSidebar();
29
26
  return (_jsxs("div", { className: cn('fixed flex shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10 max-md:hidden xl:start-4 max-xl:end-4', !collapsed && 'pointer-events-none opacity-0'), style: {
@@ -1,8 +1,9 @@
1
1
  import type { PageTree } from 'fumadocs-core/server';
2
2
  import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
3
+ import { SidebarTrigger } from '../components/layout/sidebar.js';
3
4
  import { type LinkItemType } from '../layouts/links.js';
4
5
  import { type BaseLayoutProps } from './shared.js';
5
- import { CollapsibleControl, Navbar, SidebarTrigger } from '../layouts/docs-client.js';
6
+ import { CollapsibleControl, Navbar } from '../layouts/docs-client.js';
6
7
  import { type SidebarOptions } from '../layouts/docs/shared.js';
7
8
  export interface DocsLayoutProps extends BaseLayoutProps {
8
9
  tree: PageTree.Root;
@@ -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,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAcf,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAElB,MAAM,EACN,cAAc,EACf,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,cAAc,GACtB,cAAc,CAAC,OAAO,CAAC,GAAG;QACxB,OAAO,CAAC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;KACvB,CAAC;IAEJ;;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,OAAO,EAAE,cAAqB,EAC9B,GAAG,YAAY,EACX,EACN,YAAiB,EACjB,kBAA0B,EAC1B,WAA8C,EAC9C,IAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,eAAe,2CA6NjB;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,CAAC"}
@@ -3,12 +3,12 @@ import { useMemo, } from 'react';
3
3
  import { Languages, Sidebar as SidebarIcon } from '../icons.js';
4
4
  import { cn } from '../utils/cn.js';
5
5
  import { buttonVariants } from '../components/ui/button.js';
6
- import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarViewport, } from '../components/layout/sidebar.js';
6
+ import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '../components/layout/sidebar.js';
7
7
  import { BaseLinkItem, } from '../layouts/links.js';
8
8
  import { RootToggle } from '../components/layout/root-toggle.js';
9
9
  import { getLinks } from './shared.js';
10
10
  import { LanguageToggle, LanguageToggleText, } from '../components/layout/language-toggle.js';
11
- import { CollapsibleControl, LayoutBody, Navbar, SidebarTrigger, } from '../layouts/docs-client.js';
11
+ import { CollapsibleControl, LayoutBody, Navbar } from '../layouts/docs-client.js';
12
12
  import { TreeContextProvider } from '../contexts/tree.js';
13
13
  import { ThemeToggle } from '../components/layout/theme-toggle.js';
14
14
  import { getSidebarTabsFromOptions, SidebarLinkItem, } from '../layouts/docs/shared.js';
@@ -19,10 +19,7 @@ import { HideIfEmpty } from 'fumadocs-core/hide-if-empty';
19
19
  export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { tabs: sidebarTabs, enabled: sidebarEnabled = true, ...sidebarProps } = {}, searchToggle = {}, disableThemeSwitch = false, themeSwitch = { enabled: !disableThemeSwitch }, i18n = false, children, ...props }) {
20
20
  const tabs = useMemo(() => getSidebarTabsFromOptions(sidebarTabs, props.tree) ?? [], [sidebarTabs, props.tree]);
21
21
  const links = getLinks(props.links ?? [], props.githubUrl);
22
- const variables = cn(sidebarEnabled &&
23
- 'md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]', 'xl:[--fd-toc-width:286px]', !nav.component && nav.enabled !== false
24
- ? '[--fd-nav-height:56px] md:[--fd-nav-height:0px]'
25
- : undefined);
22
+ const sidebarVariables = cn('md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]');
26
23
  function sidebar() {
27
24
  const { footer, banner, collapsible = true, component, components, defaultOpenLevel, prefetch, ...rest } = sidebarProps;
28
25
  if (component)
@@ -56,6 +53,8 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
56
53
  color: 'ghost',
57
54
  size: 'icon-sm',
58
55
  className: 'p-2',
59
- })), children: _jsx(SidebarIcon, {}) }))] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn(variables, props.containerProps?.className), children: [sidebarEnabled && sidebar(), children] })] }) }));
56
+ })), children: _jsx(SidebarIcon, {}) }))] }))), _jsxs(LayoutBody, { ...props.containerProps, className: cn('xl:[--fd-toc-width:286px]', sidebarEnabled && sidebarVariables, !nav.component &&
57
+ nav.enabled !== false &&
58
+ '[--fd-nav-height:56px] md:[--fd-nav-height:0px]', props.containerProps?.className), children: [sidebarEnabled && sidebar(), children] })] }) }));
60
59
  }
61
60
  export { CollapsibleControl, Navbar, SidebarTrigger };
@@ -1 +1 @@
1
- {"version":3,"file":"notebook-client.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook-client.tsx"],"names":[],"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E,MAAM,EAAE,CAAC;CACnB,2CA+BA"}
@@ -18,11 +18,12 @@ export function Navbar({ mode, ...props }) {
18
18
  }
19
19
  export function LayoutBody(props) {
20
20
  const { collapsed } = useSidebar();
21
- return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[margin] fd-notebook-layout', props.className), style: {
21
+ return (_jsx("main", { id: "nd-docs-layout", ...props, className: cn('flex flex-1 flex-col transition-[padding] pt-(--fd-nav-height) fd-notebook-layout', props.className), style: {
22
22
  ...props.style,
23
- marginInlineStart: collapsed
24
- ? 'max(0px, min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width)))'
25
- : 'var(--fd-sidebar-width)',
23
+ paddingInlineStart: collapsed
24
+ ? 'min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))'
25
+ : 'calc(var(--fd-sidebar-width) + var(--fd-layout-offset))',
26
+ paddingInlineEnd: collapsed ? '0px' : 'var(--fd-layout-offset)',
26
27
  }, children: props.children }));
27
28
  }
28
29
  export function NavbarSidebarTrigger({ className, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/layouts/notebook.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,kBAAkB,CAAC;AAuBlE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAGL,MAAM,EACN,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B,GAAG,CAAC,EAAE,eAAe,CA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as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Fragment, useMemo, } from 'react';
3
3
  import { getLinks } from '../layouts/shared.js';
4
- import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarViewport, } from '../components/layout/sidebar.js';
4
+ import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarContentMobile, SidebarFooter, SidebarHeader, SidebarPageTree, SidebarTrigger, SidebarViewport, } from '../components/layout/sidebar.js';
5
5
  import { TreeContextProvider } from '../contexts/tree.js';
6
6
  import { cn } from '../utils/cn.js';
7
7
  import { buttonVariants } from '../components/ui/button.js';
8
- import { ChevronDown, Languages, Sidebar as SidebarIcon } from '../icons.js';
8
+ import { ChevronDown, Languages, Sidebar as SidebarIcon, X, } from '../icons.js';
9
9
  import { BaseLinkItem } from '../layouts/links.js';
10
10
  import { LanguageToggle } from '../components/layout/language-toggle.js';
11
11
  import { ThemeToggle } from '../components/layout/theme-toggle.js';
@@ -42,7 +42,11 @@ export function DocsLayout(props) {
42
42
  color: 'ghost',
43
43
  className: 'lg:hidden',
44
44
  })), "aria-label": item.label, children: item.icon }, i))), footer] })] }));
45
- const mobile = (_jsxs(SidebarContentMobile, { ...rest, children: [_jsxs(HideIfEmpty, { as: SidebarHeader, children: [banner, rootToggle] }), viewport, _jsxs(HideIfEmpty, { as: SidebarFooter, className: "flex flex-row items-center justify-end", children: [iconLinks.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({
45
+ const mobile = (_jsxs(SidebarContentMobile, { ...rest, children: [_jsxs(SidebarHeader, { children: [_jsx(SidebarTrigger, { className: cn(buttonVariants({
46
+ size: 'icon-sm',
47
+ color: 'ghost',
48
+ className: 'ms-auto text-fd-muted-foreground',
49
+ })), children: _jsx(X, {}) }), banner, rootToggle] }), viewport, _jsxs(HideIfEmpty, { as: SidebarFooter, className: "flex flex-row items-center justify-end", children: [iconLinks.map((item, i) => (_jsx(BaseLinkItem, { item: item, className: cn(buttonVariants({
46
50
  size: 'icon-sm',
47
51
  color: 'ghost',
48
52
  }), 'text-fd-muted-foreground lg:hidden', i === iconLinks.length - 1 && 'me-auto'), "aria-label": item.label, children: item.icon }, i))), i18n ? (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-4.5 text-fd-muted-foreground" }) })) : null, themeSwitch.enabled !== false &&
package/dist/style.css CHANGED
@@ -1018,6 +1018,9 @@
1018
1018
  .w-\(--fd-toc-width\) {
1019
1019
  width: var(--fd-toc-width);
1020
1020
  }
1021
+ .w-\(--radix-popover-trigger-width\) {
1022
+ width: var(--radix-popover-trigger-width);
1023
+ }
1021
1024
  .w-0 {
1022
1025
  width: calc(var(--spacing) * 0);
1023
1026
  }
@@ -1042,8 +1045,8 @@
1042
1045
  .w-\[286px\] {
1043
1046
  width: 286px;
1044
1047
  }
1045
- .w-\[calc\(100\%-2\*var\(--spacing\)\)\] {
1046
- width: calc(100% - 2 * var(--spacing));
1048
+ .w-\[calc\(100\%-1rem\)\] {
1049
+ width: calc(100% - 1rem);
1047
1050
  }
1048
1051
  .w-fit {
1049
1052
  width: fit-content;
@@ -1057,6 +1060,9 @@
1057
1060
  .w-px {
1058
1061
  width: 1px;
1059
1062
  }
1063
+ .max-w-\(--fd-page-width\) {
1064
+ max-width: var(--fd-page-width);
1065
+ }
1060
1066
  .max-w-\[98vw\] {
1061
1067
  max-width: 98vw;
1062
1068
  }
@@ -1081,9 +1087,6 @@
1081
1087
  .max-w-sm {
1082
1088
  max-width: var(--container-sm);
1083
1089
  }
1084
- .min-w-\(--radix-popover-trigger-width\) {
1085
- min-width: var(--radix-popover-trigger-width);
1086
- }
1087
1090
  .min-w-0 {
1088
1091
  min-width: calc(var(--spacing) * 0);
1089
1092
  }
@@ -1346,6 +1349,12 @@
1346
1349
  background-color: color-mix(in oklab, var(--color-fd-popover) 60%, transparent);
1347
1350
  }
1348
1351
  }
1352
+ .bg-fd-popover\/80 {
1353
+ background-color: color-mix(in srgb, hsl(0, 0%, 98%) 80%, transparent);
1354
+ @supports (color: color-mix(in lab, red, red)) {
1355
+ background-color: color-mix(in oklab, var(--color-fd-popover) 80%, transparent);
1356
+ }
1357
+ }
1349
1358
  .bg-fd-primary {
1350
1359
  background-color: var(--color-fd-primary);
1351
1360
  }
@@ -1487,6 +1496,12 @@
1487
1496
  .pe-4 {
1488
1497
  padding-inline-end: calc(var(--spacing) * 4);
1489
1498
  }
1499
+ .pt-\(--fd-nav-height\) {
1500
+ padding-top: var(--fd-nav-height);
1501
+ }
1502
+ .pt-\(--fd-tocnav-height\) {
1503
+ padding-top: var(--fd-tocnav-height);
1504
+ }
1490
1505
  .pt-0 {
1491
1506
  padding-top: calc(var(--spacing) * 0);
1492
1507
  }
@@ -1571,12 +1586,6 @@
1571
1586
  .text-fd-foreground {
1572
1587
  color: var(--color-fd-foreground);
1573
1588
  }
1574
- .text-fd-foreground\/30 {
1575
- color: color-mix(in srgb, hsl(0, 0%, 3.9%) 30%, transparent);
1576
- @supports (color: color-mix(in lab, red, red)) {
1577
- color: color-mix(in oklab, var(--color-fd-foreground) 30%, transparent);
1578
- }
1579
- }
1580
1589
  .text-fd-foreground\/80 {
1581
1590
  color: color-mix(in srgb, hsl(0, 0%, 3.9%) 80%, transparent);
1582
1591
  @supports (color: color-mix(in lab, red, red)) {
@@ -1644,10 +1653,10 @@
1644
1653
  --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));
1645
1654
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1646
1655
  }
1647
- .shadow-black\/40 {
1648
- --tw-shadow-color: color-mix(in srgb, #000 40%, transparent);
1656
+ .shadow-black\/50 {
1657
+ --tw-shadow-color: color-mix(in srgb, #000 50%, transparent);
1649
1658
  @supports (color: color-mix(in lab, red, red)) {
1650
- --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 40%, transparent) var(--tw-shadow-alpha), transparent);
1659
+ --tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent);
1651
1660
  }
1652
1661
  }
1653
1662
  .outline {
@@ -1687,8 +1696,8 @@
1687
1696
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1688
1697
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1689
1698
  }
1690
- .transition-\[margin\] {
1691
- transition-property: margin;
1699
+ .transition-\[padding\] {
1700
+ transition-property: padding;
1692
1701
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1693
1702
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1694
1703
  }
@@ -2501,7 +2510,7 @@
2501
2510
  --color-fd-foreground: hsl(0, 0%, 92%);
2502
2511
  --color-fd-muted: hsl(0, 0%, 12.9%);
2503
2512
  --color-fd-muted-foreground: hsla(0, 0%, 70%, 0.8);
2504
- --color-fd-popover: hsl(0, 0%, 10.6%);
2513
+ --color-fd-popover: hsl(0, 0%, 11.6%);
2505
2514
  --color-fd-popover-foreground: hsl(0, 0%, 86.9%);
2506
2515
  --color-fd-card: hsl(0, 0%, 9.8%);
2507
2516
  --color-fd-card-foreground: hsl(0, 0%, 98%);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.6.7",
3
+ "version": "15.6.9",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -89,21 +89,21 @@
89
89
  "react-medium-image-zoom": "^5.3.0",
90
90
  "scroll-into-view-if-needed": "^3.1.0",
91
91
  "tailwind-merge": "^3.3.1",
92
- "fumadocs-core": "15.6.7"
92
+ "fumadocs-core": "15.6.9"
93
93
  },
94
94
  "devDependencies": {
95
- "@next/eslint-plugin-next": "^15.4.4",
95
+ "@next/eslint-plugin-next": "^15.4.5",
96
96
  "@tailwindcss/cli": "^4.1.11",
97
97
  "@types/lodash.merge": "^4.6.9",
98
- "@types/react": "^19.1.8",
99
- "@types/react-dom": "^19.1.6",
100
- "next": "15.4.4",
98
+ "@types/react": "^19.1.9",
99
+ "@types/react-dom": "^19.1.7",
100
+ "next": "15.4.5",
101
101
  "tailwindcss": "^4.1.11",
102
102
  "tsc-alias": "^1.8.16",
103
103
  "@fumadocs/cli": "0.2.1",
104
- "eslint-config-custom": "0.0.0",
105
- "fumadocs-core": "15.6.7",
106
- "tsconfig": "0.0.0"
104
+ "fumadocs-core": "15.6.9",
105
+ "tsconfig": "0.0.0",
106
+ "eslint-config-custom": "0.0.0"
107
107
  },
108
108
  "peerDependencies": {
109
109
  "@types/react": "*",