fumadocs-ui 16.2.0 → 16.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/css/shadcn.css CHANGED
@@ -1,3 +1,5 @@
1
+ @import './colors/index.css';
2
+
1
3
  @theme {
2
4
  --color-fd-background: var(--background);
3
5
  --color-fd-foreground: var(--foreground);
@@ -27,3 +29,7 @@
27
29
  --color-fd-ring: var(--sidebar-ring);
28
30
  --color-fd-primary-foreground: var(--sidebar-primary-foreground);
29
31
  }
32
+
33
+ @theme static {
34
+ --color-fd-error: var(--destructive);
35
+ }
package/css/solar.css CHANGED
@@ -69,10 +69,6 @@
69
69
  }
70
70
  }
71
71
 
72
- #nd-sidebar {
73
- @apply bg-fd-card;
74
- }
75
-
76
72
  #nd-sidebar[data-collapsed='false'] {
77
73
  border: none;
78
74
  @apply bg-fd-background;
@@ -1,4 +1,4 @@
1
- import { type ComponentProps, type ReactNode, type RefObject } from 'react';
1
+ import { type ComponentProps, type PointerEvent, type ReactNode, type RefObject } from 'react';
2
2
  import { type LinkProps } from 'fumadocs-core/link';
3
3
  import { type ScrollAreaProps } from '@radix-ui/react-scroll-area';
4
4
  import type { CollapsibleContentProps, CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
@@ -36,13 +36,15 @@ declare const SidebarContext: import("react").Context<SidebarContext | null>;
36
36
  export declare function SidebarProvider({ defaultOpenLevel, prefetch, children, }: SidebarProviderProps): import("react/jsx-runtime").JSX.Element;
37
37
  export declare function useSidebar(): SidebarContext;
38
38
  export declare function useFolderDepth(): number;
39
- export declare function SidebarContent({ children, aside, }: {
40
- aside?: (state: {
39
+ export declare function SidebarContent({ children, }: {
40
+ children: (state: {
41
+ ref: RefObject<HTMLElement | null>;
41
42
  collapsed: boolean;
42
43
  hovered: boolean;
43
- }) => ComponentProps<'aside'>;
44
- children: ReactNode;
45
- }): import("react/jsx-runtime").JSX.Element | undefined;
44
+ onPointerEnter: (event: PointerEvent) => void;
45
+ onPointerLeave: (event: PointerEvent) => void;
46
+ }) => ReactNode;
47
+ }): ReactNode;
46
48
  export declare function SidebarDrawerOverlay(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element | undefined;
47
49
  export declare function SidebarDrawerContent({ className, children, ...props }: ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element | undefined;
48
50
  export declare function SidebarViewport(props: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/base.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACd,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAMrC,UAAU,cAAc;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5D;;OAEG;IACH,eAAe,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,SAAS,CAAC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AAG,CAAC,CAAC,cAAc,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC;CAChE,2CAsBA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAYlE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,2CAmCjD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB,2CAElE;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"}
@@ -46,42 +46,46 @@ export function useSidebar() {
46
46
  export function useFolderDepth() {
47
47
  return use(FolderContext)?.depth ?? 0;
48
48
  }
49
- export function SidebarContent({ children, aside, }) {
49
+ export function SidebarContent({ children, }) {
50
50
  const { collapsed, mode } = useSidebar();
51
51
  const [hover, setHover] = useState(false);
52
+ const ref = useRef(null);
52
53
  const timerRef = useRef(0);
53
- const ignoreHoverUntil = useRef(0);
54
54
  useOnChange(collapsed, () => {
55
- if (collapsed) {
56
- setHover(true);
57
- ignoreHoverUntil.current = Date.now() + 200;
58
- setTimeout(() => {
59
- setHover(false);
60
- }, 200);
61
- }
55
+ if (collapsed)
56
+ setHover(false);
62
57
  });
63
58
  if (mode !== 'full')
64
59
  return;
65
- return (_jsx("aside", { id: "nd-sidebar", "data-collapsed": collapsed, "data-hovered": collapsed && hover, ...aside?.({ collapsed, hovered: hover }), onPointerEnter: (e) => {
66
- if (!collapsed ||
67
- e.pointerType === 'touch' ||
68
- ignoreHoverUntil.current > Date.now())
60
+ function shouldIgnoreHover(e) {
61
+ const element = ref.current;
62
+ if (!element)
63
+ return true;
64
+ return (!collapsed ||
65
+ e.pointerType === 'touch' ||
66
+ element.getAnimations().length > 0);
67
+ }
68
+ return children({
69
+ ref,
70
+ collapsed,
71
+ hovered: hover,
72
+ onPointerEnter(e) {
73
+ if (shouldIgnoreHover(e))
69
74
  return;
70
75
  window.clearTimeout(timerRef.current);
71
76
  setHover(true);
72
- }, onPointerLeave: (e) => {
73
- if (!collapsed ||
74
- e.pointerType === 'touch' ||
75
- ignoreHoverUntil.current > Date.now())
77
+ },
78
+ onPointerLeave(e) {
79
+ if (shouldIgnoreHover(e))
76
80
  return;
77
81
  window.clearTimeout(timerRef.current);
78
- timerRef.current = window.setTimeout(() => {
79
- setHover(false);
80
- ignoreHoverUntil.current = Date.now() + 200;
81
- }, Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100
82
+ timerRef.current = window.setTimeout(() => setHover(false),
83
+ // if mouse is leaving the viewport, add a close delay
84
+ Math.min(e.clientX, document.body.clientWidth - e.clientX) > 100
82
85
  ? 0
83
86
  : 500);
84
- }, children: children }));
87
+ },
88
+ });
85
89
  }
86
90
  export function SidebarDrawerOverlay(props) {
87
91
  const { open, setOpen, mode } = useSidebar();
@@ -9,7 +9,6 @@ export declare function LayoutContextProvider({ navTransparentMode, children, }:
9
9
  }): import("react/jsx-runtime").JSX.Element;
10
10
  export declare function LayoutHeader(props: ComponentProps<'header'>): import("react/jsx-runtime").JSX.Element;
11
11
  export declare function LayoutBody({ className, style, children, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
- export declare function CollapsibleControl(): import("react/jsx-runtime").JSX.Element;
13
12
  export declare function LayoutTabs({ options, ...props }: ComponentProps<'div'> & {
14
13
  options: SidebarTab[];
15
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/client.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,eAAO,MAAM,aAAa;sBACN,OAAO;SACZ,CAAC;AAEhB,wBAAgB,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Ac,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB,2CA6BA"}
@@ -1,12 +1,8 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Sidebar as SidebarIcon } from '../../icons.js';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
4
3
  import { createContext, use, useMemo, } from 'react';
5
4
  import { cn } from '../../utils/cn.js';
6
- import { buttonVariants } from '../../components/ui/button.js';
7
5
  import { useSidebar } from '../../components/sidebar/base.js';
8
- import { SidebarCollapseTrigger } from './sidebar.js';
9
- import { SearchToggle } from '../shared/search-toggle.js';
10
6
  import { usePathname } from 'fumadocs-core/framework';
11
7
  import { isTabActive } from '../../utils/is-active.js';
12
8
  import Link from 'fumadocs-core/link';
@@ -25,7 +21,7 @@ export function LayoutHeader(props) {
25
21
  }
26
22
  export function LayoutBody({ className, style, children, ...props }) {
27
23
  const { collapsed } = useSidebar();
28
- return (_jsx("div", { id: "nd-docs-layout", className: cn('grid transition-[grid-template-columns] overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]', className), "data-sidebar-collapsed": collapsed, style: {
24
+ return (_jsx("div", { id: "nd-docs-layout", className: cn('grid transition-[grid-template-columns] overflow-x-clip min-h-(--fd-docs-height) auto-cols-auto auto-rows-auto [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]', className), "data-sidebar-collapsed": collapsed, style: {
29
25
  gridTemplate: `"sidebar header toc"
30
26
  "sidebar toc-popover toc"
31
27
  "sidebar main toc" 1fr / minmax(var(--fd-sidebar-col), 1fr) minmax(0, calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-width) - var(--fd-toc-width))) minmax(min-content, 1fr)`,
@@ -33,19 +29,9 @@ export function LayoutBody({ className, style, children, ...props }) {
33
29
  '--fd-docs-row-2': 'calc(var(--fd-docs-row-1) + var(--fd-header-height))',
34
30
  '--fd-docs-row-3': 'calc(var(--fd-docs-row-2) + var(--fd-toc-popover-height))',
35
31
  '--fd-sidebar-col': collapsed ? '0px' : 'var(--fd-sidebar-width)',
36
- gridAutoColumns: 'auto',
37
- gridAutoRows: 'auto',
38
32
  ...style,
39
33
  }, ...props, children: children }));
40
34
  }
41
- export function CollapsibleControl() {
42
- const { collapsed } = useSidebar();
43
- return (_jsxs("div", { className: cn('fixed flex top-16 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10 max-md:hidden xl:top-4 xl:start-4 max-xl:end-4', !collapsed && 'pointer-events-none opacity-0'), children: [_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
44
- color: 'ghost',
45
- size: 'icon-sm',
46
- className: 'rounded-lg',
47
- })), children: _jsx(SidebarIcon, {}) }), _jsx(SearchToggle, { className: "rounded-lg", hideIfDisabled: true })] }));
48
- }
49
35
  export function LayoutTabs({ options, ...props }) {
50
36
  const pathname = usePathname();
51
37
  const selected = useMemo(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,OAAO,EAQR,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,kBAAkB,CAAC;AAoB1E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AAE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AAgB,EAChB,OAAgB,EAChB,IAAY,EACZ,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,eAAe,2CA0NjB"}
@@ -7,7 +7,7 @@ import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarDrawer, Sidebar
7
7
  import { resolveLinkItems } from '../../layouts/shared/index.js';
8
8
  import { LinkItem } from '../../layouts/shared/link-item.js';
9
9
  import { LanguageToggle, LanguageToggleText, } from '../../layouts/shared/language-toggle.js';
10
- import { CollapsibleControl, LayoutTabs, LayoutHeader, LayoutBody, LayoutContextProvider, } from './client.js';
10
+ import { LayoutTabs, LayoutHeader, LayoutBody, LayoutContextProvider, } from './client.js';
11
11
  import { TreeContextProvider } from '../../contexts/tree.js';
12
12
  import { ThemeToggle } from '../shared/theme-toggle.js';
13
13
  import Link from 'fumadocs-core/link';
@@ -36,7 +36,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
36
36
  const viewport = (_jsxs(SidebarViewport, { children: [links
37
37
  .filter((v) => v.type !== 'icon')
38
38
  .map((item, i, list) => (_jsx(SidebarLinkItem, { item: item, className: cn(i === list.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { ...components })] }));
39
- return (_jsxs(_Fragment, { children: [collapsible && _jsx(CollapsibleControl, {}), _jsxs(SidebarContent, { ...rest, children: [_jsxs("div", { className: "flex flex-col gap-3 p-4 pb-2", children: [_jsxs("div", { className: "flex", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[0.9375rem] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
39
+ return (_jsxs(_Fragment, { children: [_jsxs(SidebarContent, { ...rest, children: [_jsxs("div", { className: "flex flex-col gap-3 p-4 pb-2", children: [_jsxs("div", { className: "flex", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[0.9375rem] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
40
40
  color: 'ghost',
41
41
  size: 'icon-sm',
42
42
  className: 'mb-auto text-fd-muted-foreground',
@@ -1,7 +1,7 @@
1
1
  import * as Base from '../../components/sidebar/base.js';
2
- import type { ComponentProps } from 'react';
2
+ import { type ComponentProps } from 'react';
3
3
  export declare const Sidebar: typeof Base.SidebarProvider, SidebarFolder: typeof Base.SidebarFolder, SidebarCollapseTrigger: typeof Base.SidebarCollapseTrigger, SidebarViewport: typeof Base.SidebarViewport, SidebarTrigger: typeof Base.SidebarTrigger;
4
- export declare function SidebarContent({ className, children, ...props }: ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element;
4
+ export declare function SidebarContent({ ref: refProp, className, children, ...props }: ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element;
5
5
  export declare function SidebarDrawer({ children, className, ...props }: ComponentProps<typeof Base.SidebarDrawerContent>): import("react/jsx-runtime").JSX.Element;
6
6
  export declare function SidebarSeparator({ className, style, children, ...props }: ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
7
7
  export declare function SidebarItem({ className, style, children, ...props }: ComponentProps<typeof Base.SidebarItem>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAoB5C,eAAO,MACY,OAAO,+BACxB,aAAa,6BACb,sBAAsB,sCACtB,eAAe,+BACf,cAAc,4BACR,CAAC;AAET,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,CAAC,2CAoBzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,E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B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAelD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,GAAG,CAAC,2CAerB;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,2CAkBzC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAelD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,iBAAiB,CAAC,2CAmB/C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAgBlD;AAED,eAAO,MAAM,eAAe,sIAO1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;6CAM1B,CAAC"}
@@ -1,31 +1,44 @@
1
1
  'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as Base from '../../components/sidebar/base.js';
4
4
  import { cn } from '../../utils/cn.js';
5
+ import { useRef } from 'react';
5
6
  import { cva } from 'class-variance-authority';
6
7
  import { createPageTreeRenderer } from '../../components/sidebar/page-tree.js';
7
8
  import { createLinkItemRenderer } from '../../components/sidebar/link-item.js';
9
+ import { buttonVariants } from '../../components/ui/button.js';
10
+ import { SearchToggle } from '../../layouts/shared/search-toggle.js';
11
+ import { Sidebar as SidebarIcon } from '../../icons.js';
12
+ import { mergeRefs } from '../../utils/merge-refs.js';
8
13
  const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground wrap-anywhere transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none [&_svg]:size-4 [&_svg]:shrink-0', {
9
14
  variants: {
10
15
  variant: {
11
16
  link: 'data-[active=true]:bg-fd-primary/10 data-[active=true]:text-fd-primary data-[active=true]:hover:transition-colors',
12
17
  },
18
+ highlight: {
19
+ true: "data-[active=true]:before:content-[''] data-[active=true]:before:bg-fd-primary data-[active=true]:before:absolute data-[active=true]:before:w-px data-[active=true]:before:inset-y-2.5 data-[active=true]:before:start-2.5",
20
+ },
13
21
  },
14
22
  });
15
23
  function getItemOffset(depth) {
16
24
  return `calc(${2 + 3 * depth} * var(--spacing))`;
17
25
  }
18
26
  export const { SidebarProvider: Sidebar, SidebarFolder, SidebarCollapseTrigger, SidebarViewport, SidebarTrigger, } = Base;
19
- export function SidebarContent({ className, children, ...props }) {
20
- return (_jsx(Base.SidebarContent, { aside: ({ collapsed, hovered }) => ({
21
- className: cn('sticky top-(--fd-docs-row-1) [grid-area:sidebar] h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col items-end z-20 bg-fd-card text-sm border-e *:w-(--fd-sidebar-width) md:layout:[--fd-sidebar-width:268px] max-md:hidden', collapsed && [
22
- 'fixed start-0 inset-y-2 h-auto rounded-xl border transition-[opacity,translate] duration-200',
23
- hovered
24
- ? 'z-50 shadow-lg translate-x-2 rtl:-translate-x-2'
25
- : 'opacity-0 -translate-x-[calc(100%-16px)] rtl:translate-x-[calc(100%-16px)]',
26
- ], className),
27
- ...props,
28
- }), children: children }));
27
+ export function SidebarContent({ ref: refProp, className, children, ...props }) {
28
+ const ref = useRef(null);
29
+ return (_jsx(Base.SidebarContent, { children: ({ collapsed, hovered, ref: asideRef, ...rest }) => (_jsxs(_Fragment, { children: [_jsxs("div", { "data-sidebar-placeholder": "", className: "sticky top-(--fd-docs-row-1) z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] md:layout:[--fd-sidebar-width:268px] max-md:hidden", children: [collapsed && (_jsx("div", { className: "absolute start-0 inset-y-0 w-4", ...rest })), _jsx("aside", { id: "nd-sidebar", ref: mergeRefs(ref, refProp, asideRef), "data-collapsed": collapsed, "data-hovered": collapsed && hovered, className: cn('absolute flex flex-col w-full start-0 inset-y-0 items-end bg-fd-card text-sm border-e duration-250 *:w-(--fd-sidebar-width)', collapsed && [
30
+ 'inset-y-2 rounded-xl transition-transform border w-(--fd-sidebar-width)',
31
+ hovered
32
+ ? 'shadow-lg translate-x-2 rtl:-translate-x-2'
33
+ : '-translate-x-(--fd-sidebar-width) rtl:translate-x-full',
34
+ ], ref.current &&
35
+ (ref.current.getAttribute('data-collapsed') === 'true') !==
36
+ collapsed &&
37
+ 'transition-[width,inset-block,translate,background-color]', className), ...props, ...rest, children: children })] }), _jsxs("div", { "data-sidebar-panel": "", className: cn('fixed flex top-[calc(--spacing(4)+var(--fd-toc-popover-height))] start-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10', (!collapsed || hovered) && 'pointer-events-none opacity-0'), children: [_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
38
+ color: 'ghost',
39
+ size: 'icon-sm',
40
+ className: 'rounded-lg',
41
+ })), children: _jsx(SidebarIcon, {}) }), _jsx(SearchToggle, { className: "rounded-lg", hideIfDisabled: true })] })] })) }));
29
42
  }
30
43
  export function SidebarDrawer({ children, className, ...props }) {
31
44
  return (_jsxs(_Fragment, { children: [_jsx(Base.SidebarDrawerOverlay, { className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out" }), _jsx(Base.SidebarDrawerContent, { className: cn('fixed text-[0.9375rem] flex flex-col shadow-lg border-s end-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', className), ...props, children: children })] }));
@@ -39,7 +52,7 @@ export function SidebarSeparator({ className, style, children, ...props }) {
39
52
  }
40
53
  export function SidebarItem({ className, style, children, ...props }) {
41
54
  const depth = Base.useFolderDepth();
42
- return (_jsx(Base.SidebarItem, { className: cn(itemVariants({ variant: 'link' }), className), style: {
55
+ return (_jsx(Base.SidebarItem, { className: cn(itemVariants({ variant: 'link', highlight: depth >= 1 }), className), style: {
43
56
  paddingInlineStart: getItemOffset(depth),
44
57
  ...style,
45
58
  }, ...props, children: children }));
@@ -53,17 +66,15 @@ export function SidebarFolderTrigger({ className, style, ...props }) {
53
66
  }
54
67
  export function SidebarFolderLink({ className, style, ...props }) {
55
68
  const depth = Base.useFolderDepth();
56
- return (_jsx(Base.SidebarFolderLink, { className: cn(itemVariants({ variant: 'link' }), 'w-full', className), style: {
69
+ return (_jsx(Base.SidebarFolderLink, { className: cn(itemVariants({ variant: 'link', highlight: depth > 1 }), 'w-full', className), style: {
57
70
  paddingInlineStart: getItemOffset(depth - 1),
58
71
  ...style,
59
72
  }, ...props, children: props.children }));
60
73
  }
61
74
  export function SidebarFolderContent({ className, children, ...props }) {
62
75
  const depth = Base.useFolderDepth();
63
- return (_jsx(Base.SidebarFolderContent, { className: cn('relative', depth === 1 && [
64
- "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5",
65
- "**:data-[active=true]:before:content-[''] **:data-[active=true]:before:bg-fd-primary **:data-[active=true]:before:absolute **:data-[active=true]:before:w-px **:data-[active=true]:before:inset-y-2.5 **:data-[active=true]:before:start-2.5",
66
- ], className), ...props, children: children }));
76
+ return (_jsx(Base.SidebarFolderContent, { className: cn('relative', depth === 1 &&
77
+ "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5", className), ...props, children: children }));
67
78
  }
68
79
  export const SidebarPageTree = createPageTreeRenderer({
69
80
  SidebarFolder,
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/notebook/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAOf,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,aAAa;sBAEF,OAAO;UAGxB,CAAC;AAER,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC9B,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;CACzB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,kBAA2B,EAC3B,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,UAAU,GAAG;IACd,kBAAkB,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAoBA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAS3D;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CAuCvB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC,2CAmCA;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GAAG,cAAc,CAAC,WAAW,CAAC,2UAqDtD"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/notebook/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAOf,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMlE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,aAAa;sBAEF,OAAO;UAGxB,CAAC;AAER,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC9B,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;CACzB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,kBAA2B,EAC3B,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,UAAU,GAAG;IACd,kBAAkB,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAoBA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAS3D;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CAqCvB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC,2CAmCA;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,SAAS,EACT,GAAG,KAAK,EACT,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GAAG,cAAc,CAAC,WAAW,CAAC,2UAqDtD"}
@@ -29,11 +29,11 @@ export function LayoutBody({ className, style, children, ...props }) {
29
29
  const { navMode } = use(LayoutContext);
30
30
  const { collapsed } = useSidebar();
31
31
  const pageCol = 'calc(var(--fd-layout-width,97rem) - var(--fd-sidebar-col) - var(--fd-toc-width))';
32
- return (_jsx("div", { id: "nd-notebook-layout", className: cn('grid overflow-x-clip min-h-(--fd-docs-height) [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]', className), style: {
32
+ return (_jsx("div", { id: "nd-notebook-layout", className: cn('grid overflow-x-clip min-h-(--fd-docs-height) transition-[grid-template-columns] auto-cols-auto auto-rows-auto [--fd-docs-height:100dvh] [--fd-header-height:0px] [--fd-toc-popover-height:0px] [--fd-sidebar-width:0px] [--fd-toc-width:0px]', className), style: {
33
33
  gridTemplate: navMode === 'top'
34
34
  ? `". header header header ."
35
35
  "sidebar sidebar toc-popover toc-popover ."
36
- "sidebar sidebar main toc toc" 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)`
36
+ "sidebar sidebar main toc ." 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)`
37
37
  : `"sidebar sidebar header header ."
38
38
  "sidebar sidebar toc-popover toc-popover ."
39
39
  "sidebar sidebar main toc ." 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)`,
@@ -41,8 +41,6 @@ export function LayoutBody({ className, style, children, ...props }) {
41
41
  '--fd-docs-row-2': 'calc(var(--fd-docs-row-1) + var(--fd-header-height))',
42
42
  '--fd-docs-row-3': 'calc(var(--fd-docs-row-2) + var(--fd-toc-popover-height))',
43
43
  '--fd-sidebar-col': collapsed ? '0px' : 'var(--fd-sidebar-width)',
44
- gridAutoColumns: 'auto',
45
- gridAutoRows: 'auto',
46
44
  ...style,
47
45
  }, ...props, children: children }));
48
46
  }
@@ -1,7 +1,7 @@
1
1
  import * as Base from '../../components/sidebar/base.js';
2
2
  import { type ComponentProps } from 'react';
3
3
  export declare const Sidebar: typeof Base.SidebarProvider, SidebarFolder: typeof Base.SidebarFolder, SidebarCollapseTrigger: typeof Base.SidebarCollapseTrigger, SidebarViewport: typeof Base.SidebarViewport, SidebarTrigger: typeof Base.SidebarTrigger;
4
- export declare function SidebarContent({ className, children, ...props }: ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element;
4
+ export declare function SidebarContent({ ref: refProp, className, children, ...props }: ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element;
5
5
  export declare function SidebarDrawer({ children, className, ...props }: ComponentProps<typeof Base.SidebarDrawerContent>): import("react/jsx-runtime").JSX.Element;
6
6
  export declare function SidebarSeparator({ className, style, children, ...props }: ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
7
7
  export declare function SidebarItem({ className, style, children, ...props }: ComponentProps<typeof Base.SidebarItem>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/layouts/notebook/sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,KAAK,cAAc,EAAO,MAAM,OAAO,CAAC;AAqBjD,eAAO,MACY,OAAO,+BACxB,aAAa,6BACb,sBAAsB,sCACtB,eAAe,+BACf,cAAc,4BACR,CAAC;AAET,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,CAAC,2CA0BzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAelD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,KAAK,EACL,QA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BAAgB,CAAC,EAC/B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,GAAG,CAAC,2CAerB;AAED,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,2CAkBzC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAelD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,iBAAiB,CAAC,2CAmB/C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAgBlD;AACD,eAAO,MAAM,eAAe,sIAO1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;6CAM1B,CAAC"}
@@ -1,36 +1,41 @@
1
1
  'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as Base from '../../components/sidebar/base.js';
4
4
  import { cn } from '../../utils/cn.js';
5
- import { use } from 'react';
5
+ import { use, useRef } from 'react';
6
6
  import { cva } from 'class-variance-authority';
7
7
  import { LayoutContext } from './client.js';
8
8
  import { createPageTreeRenderer } from '../../components/sidebar/page-tree.js';
9
9
  import { createLinkItemRenderer } from '../../components/sidebar/link-item.js';
10
+ import { mergeRefs } from '../../utils/merge-refs.js';
10
11
  const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground wrap-anywhere transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none [&_svg]:size-4 [&_svg]:shrink-0', {
11
12
  variants: {
12
13
  variant: {
13
14
  link: 'data-[active=true]:bg-fd-primary/10 data-[active=true]:text-fd-primary data-[active=true]:hover:transition-colors',
14
15
  },
16
+ highlight: {
17
+ true: "data-[active=true]:before:content-[''] data-[active=true]:before:bg-fd-primary data-[active=true]:before:absolute data-[active=true]:before:w-px data-[active=true]:before:inset-y-2.5 data-[active=true]:before:start-2.5",
18
+ },
15
19
  },
16
20
  });
17
21
  function getItemOffset(depth) {
18
22
  return `calc(${2 + 3 * depth} * var(--spacing))`;
19
23
  }
20
24
  export const { SidebarProvider: Sidebar, SidebarFolder, SidebarCollapseTrigger, SidebarViewport, SidebarTrigger, } = Base;
21
- export function SidebarContent({ className, children, ...props }) {
25
+ export function SidebarContent({ ref: refProp, className, children, ...props }) {
22
26
  const { navMode } = use(LayoutContext);
23
- return (_jsx(Base.SidebarContent, { aside: ({ collapsed, hovered }) => ({
24
- className: cn('sticky [grid-area:sidebar] flex flex-col items-end z-20 text-sm *:w-(--fd-sidebar-width) md:layout:[--fd-sidebar-width:268px] max-md:hidden', (navMode === 'auto' || collapsed) &&
25
- 'data-[collapsed=true]:bg-fd-card data-[collapsed=true]:border-e', navMode === 'auto'
27
+ const ref = useRef(null);
28
+ return (_jsx(Base.SidebarContent, { children: ({ collapsed, hovered, ref: asideRef, ...rest }) => (_jsxs("div", { "data-sidebar-placeholder": "", className: cn('sticky z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto md:layout:[--fd-sidebar-width:268px] max-md:hidden', navMode === 'auto'
26
29
  ? 'top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))]'
27
- : 'top-(--fd-docs-row-2) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-2))]', collapsed && [
28
- 'fixed start-0 inset-y-2 h-auto rounded-xl border transition-[opacity,translate] duration-200',
29
- hovered
30
- ? 'z-50 shadow-lg translate-x-2 rtl:-translate-x-2'
31
- : 'opacity-0 -translate-x-[calc(100%-16px)] rtl:translate-x-[calc(100%-16px)]',
32
- ], className),
33
- }), ...props, children: children }));
30
+ : 'top-(--fd-docs-row-2) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-2))]'), children: [collapsed && (_jsx("div", { className: "absolute start-0 inset-y-0 w-4", ...rest })), _jsx("aside", { id: "nd-sidebar", ref: mergeRefs(ref, refProp, asideRef), "data-collapsed": collapsed, "data-hovered": collapsed && hovered, className: cn('absolute flex flex-col w-full start-0 inset-y-0 items-end text-sm duration-250 *:w-(--fd-sidebar-width)', navMode === 'auto' && 'bg-fd-card border-e', collapsed && [
31
+ 'inset-y-2 rounded-xl bg-fd-card transition-transform border w-(--fd-sidebar-width)',
32
+ hovered
33
+ ? 'shadow-lg translate-x-2 rtl:-translate-x-2'
34
+ : '-translate-x-(--fd-sidebar-width) rtl:translate-x-full',
35
+ ], ref.current &&
36
+ (ref.current.getAttribute('data-collapsed') === 'true') !==
37
+ collapsed &&
38
+ 'transition-[width,inset-block,translate,background-color]', className), ...props, ...rest, children: children })] })) }));
34
39
  }
35
40
  export function SidebarDrawer({ children, className, ...props }) {
36
41
  return (_jsxs(_Fragment, { children: [_jsx(Base.SidebarDrawerOverlay, { className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out" }), _jsx(Base.SidebarDrawerContent, { className: cn('fixed text-[0.9375rem] flex flex-col shadow-lg border-s end-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', className), ...props, children: children })] }));
@@ -44,7 +49,7 @@ export function SidebarSeparator({ className, style, children, ...props }) {
44
49
  }
45
50
  export function SidebarItem({ className, style, children, ...props }) {
46
51
  const depth = Base.useFolderDepth();
47
- return (_jsx(Base.SidebarItem, { className: cn(itemVariants({ variant: 'link' }), className), style: {
52
+ return (_jsx(Base.SidebarItem, { className: cn(itemVariants({ variant: 'link', highlight: depth >= 1 }), className), style: {
48
53
  paddingInlineStart: getItemOffset(depth),
49
54
  ...style,
50
55
  }, ...props, children: children }));
@@ -58,17 +63,15 @@ export function SidebarFolderTrigger({ className, style, ...props }) {
58
63
  }
59
64
  export function SidebarFolderLink({ className, style, ...props }) {
60
65
  const depth = Base.useFolderDepth();
61
- return (_jsx(Base.SidebarFolderLink, { className: cn(itemVariants({ variant: 'link' }), 'w-full', className), style: {
66
+ return (_jsx(Base.SidebarFolderLink, { className: cn(itemVariants({ variant: 'link', highlight: depth > 1 }), 'w-full', className), style: {
62
67
  paddingInlineStart: getItemOffset(depth - 1),
63
68
  ...style,
64
69
  }, ...props, children: props.children }));
65
70
  }
66
71
  export function SidebarFolderContent({ className, children, ...props }) {
67
72
  const depth = Base.useFolderDepth();
68
- return (_jsx(Base.SidebarFolderContent, { className: cn('relative', depth === 1 && [
69
- "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5",
70
- "**:data-[active=true]:before:content-[''] **:data-[active=true]:before:bg-fd-primary **:data-[active=true]:before:absolute **:data-[active=true]:before:w-px **:data-[active=true]:before:inset-y-2.5 **:data-[active=true]:before:start-2.5",
71
- ], className), ...props, children: children }));
73
+ return (_jsx(Base.SidebarFolderContent, { className: cn('relative', depth === 1 &&
74
+ "before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5", className), ...props, children: children }));
72
75
  }
73
76
  export const SidebarPageTree = createPageTreeRenderer({
74
77
  SidebarFolder,
package/dist/style.css CHANGED
@@ -317,6 +317,9 @@
317
317
  .start-3 {
318
318
  inset-inline-start: calc(var(--spacing) * 3);
319
319
  }
320
+ .start-4 {
321
+ inset-inline-start: calc(var(--spacing) * 4);
322
+ }
320
323
  .end-0 {
321
324
  inset-inline-end: calc(var(--spacing) * 0);
322
325
  }
@@ -359,8 +362,8 @@
359
362
  .top-14 {
360
363
  top: calc(var(--spacing) * 14);
361
364
  }
362
- .top-16 {
363
- top: calc(var(--spacing) * 16);
365
+ .top-\[calc\(--spacing\(4\)\+var\(--fd-toc-popover-height\)\)\] {
366
+ top: calc(calc(var(--spacing) * 4) + var(--fd-toc-popover-height));
364
367
  }
365
368
  .right-2 {
366
369
  right: calc(var(--spacing) * 2);
@@ -992,9 +995,6 @@
992
995
  .h-\[calc\(var\(--fd-docs-height\)-var\(--fd-docs-row-3\)\)\] {
993
996
  height: calc(var(--fd-docs-height) - var(--fd-docs-row-3));
994
997
  }
995
- .h-auto {
996
- height: auto;
997
- }
998
998
  .h-full {
999
999
  height: 100%;
1000
1000
  }
@@ -1022,6 +1022,9 @@
1022
1022
  .min-h-0 {
1023
1023
  min-height: calc(var(--spacing) * 0);
1024
1024
  }
1025
+ .w-\(--fd-sidebar-width\) {
1026
+ width: var(--fd-sidebar-width);
1027
+ }
1025
1028
  .w-\(--fd-toc-width\) {
1026
1029
  width: var(--fd-toc-width);
1027
1030
  }
@@ -1037,6 +1040,9 @@
1037
1040
  .w-1\.5 {
1038
1041
  width: calc(var(--spacing) * 1.5);
1039
1042
  }
1043
+ .w-4 {
1044
+ width: calc(var(--spacing) * 4);
1045
+ }
1040
1046
  .w-\[25\%\] {
1041
1047
  width: 25%;
1042
1048
  }
@@ -1115,12 +1121,12 @@
1115
1121
  .origin-\[top_center\] {
1116
1122
  transform-origin: top center;
1117
1123
  }
1118
- .-translate-x-1\/2 {
1119
- --tw-translate-x: calc(calc(1/2 * 100%) * -1);
1124
+ .-translate-x-\(--fd-sidebar-width\) {
1125
+ --tw-translate-x: calc(var(--fd-sidebar-width) * -1);
1120
1126
  translate: var(--tw-translate-x) var(--tw-translate-y);
1121
1127
  }
1122
- .-translate-x-\[calc\(100\%-16px\)\] {
1123
- --tw-translate-x: calc(calc(100% - 16px) * -1);
1128
+ .-translate-x-1\/2 {
1129
+ --tw-translate-x: calc(calc(1/2 * 100%) * -1);
1124
1130
  translate: var(--tw-translate-x) var(--tw-translate-y);
1125
1131
  }
1126
1132
  .translate-x-2 {
@@ -1160,6 +1166,12 @@
1160
1166
  .list-none {
1161
1167
  list-style-type: none;
1162
1168
  }
1169
+ .auto-cols-auto {
1170
+ grid-auto-columns: auto;
1171
+ }
1172
+ .auto-rows-auto {
1173
+ grid-auto-rows: auto;
1174
+ }
1163
1175
  .grid-cols-1 {
1164
1176
  grid-template-columns: repeat(1, minmax(0, 1fr));
1165
1177
  }
@@ -1714,13 +1726,13 @@
1714
1726
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1715
1727
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1716
1728
  }
1717
- .transition-\[opacity\,translate\] {
1718
- transition-property: opacity,translate;
1729
+ .transition-\[width\,height\] {
1730
+ transition-property: width,height;
1719
1731
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1720
1732
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1721
1733
  }
1722
- .transition-\[width\,height\] {
1723
- transition-property: width,height;
1734
+ .transition-\[width\,inset-block\,translate\,background-color\] {
1735
+ transition-property: width,inset-block,translate,background-color;
1724
1736
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1725
1737
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1726
1738
  }
@@ -1752,6 +1764,10 @@
1752
1764
  --tw-duration: 200ms;
1753
1765
  transition-duration: 200ms;
1754
1766
  }
1767
+ .duration-250 {
1768
+ --tw-duration: 250ms;
1769
+ transition-duration: 250ms;
1770
+ }
1755
1771
  .duration-300 {
1756
1772
  --tw-duration: 300ms;
1757
1773
  transition-duration: 300ms;
@@ -1807,6 +1823,11 @@
1807
1823
  .\[scrollbar-width\:none\] {
1808
1824
  scrollbar-width: none;
1809
1825
  }
1826
+ .\*\:pointer-events-auto {
1827
+ :is(& > *) {
1828
+ pointer-events: auto;
1829
+ }
1830
+ }
1810
1831
  .\*\:col-start-1 {
1811
1832
  :is(& > *) {
1812
1833
  grid-column-start: 1;
@@ -2132,63 +2153,51 @@
2132
2153
  color: var(--color-fd-primary);
2133
2154
  }
2134
2155
  }
2135
- .\*\*\:data-\[active\=true\]\:before\:absolute {
2136
- :is(& *) {
2137
- &[data-active="true"] {
2138
- &::before {
2139
- content: var(--tw-content);
2140
- position: absolute;
2141
- }
2156
+ .data-\[active\=true\]\:before\:absolute {
2157
+ &[data-active="true"] {
2158
+ &::before {
2159
+ content: var(--tw-content);
2160
+ position: absolute;
2142
2161
  }
2143
2162
  }
2144
2163
  }
2145
- .\*\*\:data-\[active\=true\]\:before\:inset-y-2\.5 {
2146
- :is(& *) {
2147
- &[data-active="true"] {
2148
- &::before {
2149
- content: var(--tw-content);
2150
- inset-block: calc(var(--spacing) * 2.5);
2151
- }
2164
+ .data-\[active\=true\]\:before\:inset-y-2\.5 {
2165
+ &[data-active="true"] {
2166
+ &::before {
2167
+ content: var(--tw-content);
2168
+ inset-block: calc(var(--spacing) * 2.5);
2152
2169
  }
2153
2170
  }
2154
2171
  }
2155
- .\*\*\:data-\[active\=true\]\:before\:start-2\.5 {
2156
- :is(& *) {
2157
- &[data-active="true"] {
2158
- &::before {
2159
- content: var(--tw-content);
2160
- inset-inline-start: calc(var(--spacing) * 2.5);
2161
- }
2172
+ .data-\[active\=true\]\:before\:start-2\.5 {
2173
+ &[data-active="true"] {
2174
+ &::before {
2175
+ content: var(--tw-content);
2176
+ inset-inline-start: calc(var(--spacing) * 2.5);
2162
2177
  }
2163
2178
  }
2164
2179
  }
2165
- .\*\*\:data-\[active\=true\]\:before\:w-px {
2166
- :is(& *) {
2167
- &[data-active="true"] {
2168
- &::before {
2169
- content: var(--tw-content);
2170
- width: 1px;
2171
- }
2180
+ .data-\[active\=true\]\:before\:w-px {
2181
+ &[data-active="true"] {
2182
+ &::before {
2183
+ content: var(--tw-content);
2184
+ width: 1px;
2172
2185
  }
2173
2186
  }
2174
2187
  }
2175
- .\*\*\:data-\[active\=true\]\:before\:bg-fd-primary {
2176
- :is(& *) {
2177
- &[data-active="true"] {
2178
- &::before {
2179
- content: var(--tw-content);
2180
- background-color: var(--color-fd-primary);
2181
- }
2188
+ .data-\[active\=true\]\:before\:bg-fd-primary {
2189
+ &[data-active="true"] {
2190
+ &::before {
2191
+ content: var(--tw-content);
2192
+ background-color: var(--color-fd-primary);
2182
2193
  }
2183
2194
  }
2184
2195
  }
2185
- .\*\*\:data-\[active\=true\]\:before\:content-\[\'\'\] {
2186
- :is(& *) {
2187
- &[data-active="true"] {
2188
- &::before {
2189
- --tw-content: '';
2190
- content: var(--tw-content);
2191
- }
2196
+ .data-\[active\=true\]\:before\:content-\[\'\'\] {
2197
+ &[data-active="true"] {
2198
+ &::before {
2199
+ --tw-content: '';
2200
+ content: var(--tw-content);
2192
2201
  }
2193
2202
  }
2194
2203
  }
@@ -2208,17 +2217,6 @@
2208
2217
  display: none;
2209
2218
  }
2210
2219
  }
2211
- .data-\[collapsed\=true\]\:border-e {
2212
- &[data-collapsed="true"] {
2213
- border-inline-end-style: var(--tw-border-style);
2214
- border-inline-end-width: 1px;
2215
- }
2216
- }
2217
- .data-\[collapsed\=true\]\:bg-fd-card {
2218
- &[data-collapsed="true"] {
2219
- background-color: var(--color-fd-card);
2220
- }
2221
- }
2222
2220
  .\*\:data-\[empty\=true\]\:border-b-0 {
2223
2221
  :is(& > *) {
2224
2222
  &[data-empty="true"] {
@@ -2363,11 +2361,6 @@
2363
2361
  }
2364
2362
  }
2365
2363
  }
2366
- .max-xl\:end-4 {
2367
- @media (width < 80rem) {
2368
- inset-inline-end: calc(var(--spacing) * 4);
2369
- }
2370
- }
2371
2364
  .max-xl\:hidden {
2372
2365
  @media (width < 80rem) {
2373
2366
  display: none;
@@ -2569,16 +2562,6 @@
2569
2562
  align-items: center;
2570
2563
  }
2571
2564
  }
2572
- .xl\:start-4 {
2573
- @media (width >= 80rem) {
2574
- inset-inline-start: calc(var(--spacing) * 4);
2575
- }
2576
- }
2577
- .xl\:top-4 {
2578
- @media (width >= 80rem) {
2579
- top: calc(var(--spacing) * 4);
2580
- }
2581
- }
2582
2565
  .xl\:hidden {
2583
2566
  @media (width >= 80rem) {
2584
2567
  display: none;
@@ -2610,9 +2593,9 @@
2610
2593
  translate: var(--tw-translate-x) var(--tw-translate-y);
2611
2594
  }
2612
2595
  }
2613
- .rtl\:translate-x-\[calc\(100\%-16px\)\] {
2596
+ .rtl\:translate-x-full {
2614
2597
  &:where(:dir(rtl), [dir="rtl"], [dir="rtl"] *) {
2615
- --tw-translate-x: calc(100% - 16px);
2598
+ --tw-translate-x: 100%;
2616
2599
  translate: var(--tw-translate-x) var(--tw-translate-y);
2617
2600
  }
2618
2601
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.2.0",
3
+ "version": "16.2.1",
4
4
  "description": "The React.js documentation framework",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -108,7 +108,7 @@
108
108
  "react-medium-image-zoom": "^5.4.0",
109
109
  "scroll-into-view-if-needed": "^3.1.0",
110
110
  "tailwind-merge": "^3.4.0",
111
- "fumadocs-core": "16.2.0"
111
+ "fumadocs-core": "16.2.1"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@next/eslint-plugin-next": "16.0.3",
@@ -122,7 +122,7 @@
122
122
  "tsc-alias": "^1.8.16",
123
123
  "@fumadocs/cli": "1.1.0",
124
124
  "eslint-config-custom": "0.0.0",
125
- "fumadocs-core": "16.2.0",
125
+ "fumadocs-core": "16.2.1",
126
126
  "tsconfig": "0.0.0"
127
127
  },
128
128
  "peerDependencies": {