fumadocs-ui 16.2.0 → 16.2.2

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.
Files changed (41) hide show
  1. package/css/shadcn.css +6 -0
  2. package/css/solar.css +0 -4
  3. package/dist/components/sidebar/base.d.ts +8 -6
  4. package/dist/components/sidebar/base.d.ts.map +1 -1
  5. package/dist/components/sidebar/base.js +26 -22
  6. package/dist/components/sidebar/{tabs.d.ts → tabs/dropdown.d.ts} +3 -3
  7. package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -0
  8. package/dist/components/sidebar/{tabs.js → tabs/dropdown.js} +6 -6
  9. package/dist/{utils/get-sidebar-tabs.d.ts → components/sidebar/tabs/index.d.ts} +1 -1
  10. package/dist/components/sidebar/tabs/index.d.ts.map +1 -0
  11. package/dist/components/tabs.d.ts.map +1 -1
  12. package/dist/layouts/docs/client.d.ts +1 -2
  13. package/dist/layouts/docs/client.d.ts.map +1 -1
  14. package/dist/layouts/docs/client.js +2 -16
  15. package/dist/layouts/docs/index.d.ts +2 -2
  16. package/dist/layouts/docs/index.d.ts.map +1 -1
  17. package/dist/layouts/docs/index.js +6 -6
  18. package/dist/layouts/docs/page/client.d.ts.map +1 -1
  19. package/dist/layouts/docs/sidebar.d.ts +2 -2
  20. package/dist/layouts/docs/sidebar.d.ts.map +1 -1
  21. package/dist/layouts/docs/sidebar.js +28 -17
  22. package/dist/layouts/notebook/client.d.ts +1 -1
  23. package/dist/layouts/notebook/client.d.ts.map +1 -1
  24. package/dist/layouts/notebook/client.js +44 -11
  25. package/dist/layouts/notebook/index.d.ts +2 -2
  26. package/dist/layouts/notebook/index.d.ts.map +1 -1
  27. package/dist/layouts/notebook/index.js +8 -8
  28. package/dist/layouts/notebook/page/client.d.ts.map +1 -1
  29. package/dist/layouts/notebook/sidebar.d.ts +1 -1
  30. package/dist/layouts/notebook/sidebar.d.ts.map +1 -1
  31. package/dist/layouts/notebook/sidebar.js +22 -19
  32. package/dist/layouts/shared/search-toggle.d.ts.map +1 -1
  33. package/dist/page.d.ts.map +1 -1
  34. package/dist/provider/base.d.ts.map +1 -1
  35. package/dist/style.css +66 -83
  36. package/dist/utils/is-active.d.ts +1 -1
  37. package/dist/utils/is-active.d.ts.map +1 -1
  38. package/package.json +11 -7
  39. package/dist/components/sidebar/tabs.d.ts.map +0 -1
  40. package/dist/utils/get-sidebar-tabs.d.ts.map +0 -1
  41. /package/dist/{utils/get-sidebar-tabs.js → components/sidebar/tabs/index.js} +0 -0
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,OA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,EACT,EAAE,SAAS,GAAG;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,2CAeA;AAED,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EAAE,iBAAyB,EACtC,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,WAAW,CAAC,EAAE,OAAO,GAAG,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();
@@ -1,10 +1,10 @@
1
1
  import { type ComponentProps, type ReactNode } from 'react';
2
- import type { SidebarTab } from '../../utils/get-sidebar-tabs.js';
2
+ import type { SidebarTab } from './index.js';
3
3
  export interface SidebarTabWithProps extends SidebarTab {
4
4
  props?: ComponentProps<'a'>;
5
5
  }
6
- export declare function SidebarTabTrigger({ options, placeholder, ...props }: {
6
+ export declare function SidebarTabsDropdown({ options, placeholder, ...props }: {
7
7
  placeholder?: ReactNode;
8
8
  options: SidebarTabWithProps[];
9
9
  } & ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
10
- //# sourceMappingURL=tabs.d.ts.map
10
+ //# sourceMappingURL=dropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/sidebar/tabs/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAW/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,WAAW,EACX,GAAG,KAAK,EACT,EAAE;IACD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC,GAAG,cAAc,CAAC,QAAQ,CAAC,2CAkF3B"}
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Check, ChevronsUpDown } from '../../icons.js';
3
+ import { Check, ChevronsUpDown } from '../../../icons.js';
4
4
  import { useMemo, useState } from 'react';
5
5
  import Link from 'fumadocs-core/link';
6
6
  import { usePathname } from 'fumadocs-core/framework';
7
- import { cn } from '../../utils/cn.js';
8
- import { isTabActive } from '../../utils/is-active.js';
9
- import { useSidebar } from '../../components/sidebar/base.js';
10
- import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover.js';
11
- export function SidebarTabTrigger({ options, placeholder, ...props }) {
7
+ import { cn } from '../../../utils/cn.js';
8
+ import { isTabActive } from '../../../utils/is-active.js';
9
+ import { useSidebar } from '../../../components/sidebar/base.js';
10
+ import { Popover, PopoverContent, PopoverTrigger, } from '../../../components/ui/popover.js';
11
+ export function SidebarTabsDropdown({ options, placeholder, ...props }) {
12
12
  const [open, setOpen] = useState(false);
13
13
  const { closeOnRedirect } = useSidebar();
14
14
  const pathname = usePathname();
@@ -18,4 +18,4 @@ export interface GetSidebarTabsOptions {
18
18
  transform?: (option: SidebarTab, node: PageTree.Folder) => SidebarTab | null;
19
19
  }
20
20
  export declare function getSidebarTabs(tree: PageTree.Root, { transform }?: GetSidebarTabsOptions): SidebarTab[];
21
- //# sourceMappingURL=get-sidebar-tabs.d.ts.map
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/sidebar/tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,KAAK,UAAU,GAAG,IAAI,CAAC;CAC9E;AAeD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,EAAE,SAA4B,EAAE,GAAE,qBAA0B,GAC3D,UAAU,EAAE,CAkCd"}
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAI5C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KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAaD,eAAO,MAAM,QAAQ,wKAYnB,CAAC;AAGH,eAAO,MAAM,WAAW,iLAYtB,CAAC;AAGH,wBAAgB,IAAI,CAAC,EACnB,GAAG,EACH,SAAS,EACT,KAAK,EACL,KAAK,EACL,YAAgB,EAChB,YAAmE,EACnE,GAAG,KAAK,EACT,EAAE,SAAS,2CAqCX;AAED,MAAM,WAAW,QAAS,SAAQ,IAAI,CACpC,cAAc,CAAC,OAAO,QAAQ,CAAC,WAAW,CAAC,EAC3C,OAAO,CACR;IACC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,2CAgBhD;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,WAAW,CAAC,2CAc7C"}
@@ -1,5 +1,5 @@
1
1
  import { type ComponentProps, type ReactNode } from 'react';
2
- import type { SidebarTab } from '../../utils/get-sidebar-tabs.js';
2
+ import type { SidebarTab } from '../../components/sidebar/tabs/index.js';
3
3
  export declare const LayoutContext: import("react").Context<{
4
4
  isNavTransparent: boolean;
5
5
  } | null>;
@@ -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,qBAAqB,CAAC,EACpC,kBAA2B,EAC3B,QAAQ,GACT,EAAE;IACD,kBAAkB,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkBA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAQ3D;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CAgCvB;AAED,wBAAgB,kBAAkB,4CAwBjC;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB,2CA6BA"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,eAAO,MAAM,aAAa;sBACN,OAAO;SACZ,CAAC;AAEhB,wBAAgB,qBAAqB,CAAC,EACpC,kBAA2B,EAC3B,QAAQ,GACT,EAAE;IACD,kBAAkB,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkBA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAQ3D;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CA8BvB;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,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(() => {
@@ -2,9 +2,9 @@ import type * as PageTree from 'fumadocs-core/page-tree';
2
2
  import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
3
3
  import { Sidebar } from './sidebar.js';
4
4
  import { type BaseLayoutProps } from '../../layouts/shared/index.js';
5
- import { type GetSidebarTabsOptions } from '../../utils/get-sidebar-tabs.js';
5
+ import { type GetSidebarTabsOptions } from '../../components/sidebar/tabs/index.js';
6
6
  import type { SidebarPageTreeComponents } from '../../components/sidebar/page-tree.js';
7
- import { type SidebarTabWithProps } from '../../components/sidebar/tabs.js';
7
+ import { type SidebarTabWithProps } from '../../components/sidebar/tabs/dropdown.js';
8
8
  export interface DocsLayoutProps extends BaseLayoutProps {
9
9
  tree: PageTree.Root;
10
10
  sidebar?: SidebarOptions;
@@ -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;AAEnC,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,UAAU,cACR,SAAQ,cAAc,CAAC,OAAO,CAAC,EAC7B,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IA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E,cAAc,CAAC;IAEzB,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,UAAU,cACR,SACE,cAAc,CAAC,OAAO,CAAC,EACvB,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAAC;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEhD;;OAEG;IACH,IAAI,CAAC,EAAE,mBAAmB,EAAE,GAAG,qBAAqB,GAAG,KAAK,CAAC;IAE7D,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;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,gBAAgB,EAChB,QAAQ,EACR,GAAG,YAAY,EACX,EACN,YAAiB,EACjB,WAAgB,EAChB,OAAgB,EAChB,IAAY,EACZ,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,eAAe,2CA0NjB"}
@@ -7,13 +7,13 @@ 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';
14
14
  import { LargeSearchToggle, SearchToggle, } from '../../layouts/shared/search-toggle.js';
15
- import { getSidebarTabs, } from '../../utils/get-sidebar-tabs.js';
16
- import { SidebarTabTrigger, } from '../../components/sidebar/tabs.js';
15
+ import { getSidebarTabs, } from '../../components/sidebar/tabs/index.js';
16
+ import { SidebarTabsDropdown, } from '../../components/sidebar/tabs/dropdown.js';
17
17
  export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { tabs: sidebarTabs, enabled: sidebarEnabled = true, defaultOpenLevel, prefetch, ...sidebarProps } = {}, searchToggle = {}, themeSwitch = {}, tabMode = 'auto', i18n = false, children, tree, ...props }) {
18
18
  const tabs = useMemo(() => {
19
19
  if (Array.isArray(sidebarTabs)) {
@@ -36,12 +36,12 @@ 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',
43
43
  })), children: _jsx(SidebarIcon, {}) }))] }), searchToggle.enabled !== false &&
44
- (searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { hideIfDisabled: true }))), tabs.length > 0 && tabMode === 'auto' && (_jsx(SidebarTabTrigger, { options: tabs })), banner] }), viewport, (i18n ||
44
+ (searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { hideIfDisabled: true }))), tabs.length > 0 && tabMode === 'auto' && (_jsx(SidebarTabsDropdown, { options: tabs })), banner] }), viewport, (i18n ||
45
45
  iconLinks.length > 0 ||
46
46
  themeSwitch?.enabled !== false ||
47
47
  footer) && (_jsxs("div", { className: "flex flex-col border-t p-4 pt-2 empty:hidden", children: [_jsxs("div", { className: "flex text-fd-muted-foreground items-center empty:hidden", children: [i18n && (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-4.5" }) })), iconLinks.map((item, i) => (_jsx(LinkItem, { item: item, className: cn(buttonVariants({ size: 'icon-sm', color: 'ghost' })), "aria-label": item.label, children: item.icon }, i))), themeSwitch.enabled !== false &&
@@ -54,7 +54,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
54
54
  color: 'ghost',
55
55
  size: 'icon-sm',
56
56
  className: 'p-2',
57
- })), children: _jsx(SidebarIcon, {}) })] }), tabs.length > 0 && _jsx(SidebarTabTrigger, { options: tabs }), banner] }), viewport, _jsx("div", { className: "flex flex-col border-t p-4 pt-2 empty:hidden", children: footer })] })] }));
57
+ })), children: _jsx(SidebarIcon, {}) })] }), tabs.length > 0 && _jsx(SidebarTabsDropdown, { options: tabs }), banner] }), viewport, _jsx("div", { className: "flex flex-col border-t p-4 pt-2 empty:hidden", children: footer })] })] }));
58
58
  }
59
59
  return (_jsx(TreeContextProvider, { tree: tree, children: _jsx(LayoutContextProvider, { navTransparentMode: transparentMode, children: _jsx(Sidebar, { defaultOpenLevel: defaultOpenLevel, prefetch: prefetch, children: _jsxs(LayoutBody, { ...props.containerProps, children: [nav.enabled !== false &&
60
60
  (nav.component ?? (_jsxs(LayoutHeader, { id: "nd-subnav", className: "[grid-area:header] sticky top-(--fd-docs-row-1) z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm h-(--fd-header-height) md:hidden max-md:layout:[--fd-header-height:--spacing(14)] data-[transparent=false]:bg-fd-background/80", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), _jsx("div", { className: "flex-1", children: nav.children }), searchToggle.enabled !== false &&
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/layouts/docs/page/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EASpB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,0BAA0B,CAAC;AAiBlC,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,KAAK,CAAC,2CAqDvB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAqD1B;AA4DD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CAUjE;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,CAAA;CAAE,2CAiBxD;AAED,KAAK,IAAI,GAA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AAA;CAAE,2CAiBxD;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;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CA+B1D;AA8BD,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExE,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,GAAG,KAAK,EACT,EAAE,eAAe,kDA6CjB"}
@@ -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 @@
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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,6 +1,6 @@
1
1
  import { type ComponentProps, type HTMLAttributes, type ReactNode } from 'react';
2
2
  import { type LinkItemType } from '../shared/link-item.js';
3
- import type { SidebarTabWithProps } from '../../components/sidebar/tabs.js';
3
+ import type { SidebarTabWithProps } from '../../components/sidebar/tabs/dropdown.js';
4
4
  export declare const LayoutContext: import("react").Context<(LayoutInfo & {
5
5
  isNavTransparent: boolean;
6
6
  }) | null>;
@@ -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,KA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ACpC,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,2UAmBtD"}
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cn } from '../../utils/cn.js';
4
- import { createContext, Fragment, use, useMemo, } from 'react';
4
+ import { createContext, Fragment, use, useMemo, useRef, useState, } from 'react';
5
5
  import { useSidebar } from '../../components/sidebar/base.js';
6
6
  import { ChevronDown } from '../../icons.js';
7
7
  import Link from 'fumadocs-core/link';
8
8
  import { usePathname } from 'fumadocs-core/framework';
9
9
  import { isTabActive } from '../../utils/is-active.js';
10
10
  import { useIsScrollTop } from '../../utils/use-is-scroll-top.js';
11
- import { LinkItem } from '../shared/link-item.js';
11
+ import { LinkItem, } from '../shared/link-item.js';
12
12
  import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover.js';
13
13
  export const LayoutContext = createContext(null);
14
14
  export function LayoutContextProvider({ navTransparentMode = 'none', navMode, tabMode, children, }) {
@@ -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
  }
@@ -61,11 +59,46 @@ export function NavbarLinkItem({ item, className, ...props }) {
61
59
  if (item.type === 'custom')
62
60
  return item.children;
63
61
  if (item.type === 'menu') {
64
- return (_jsxs(Popover, { children: [_jsxs(PopoverTrigger, { className: cn('inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground has-data-[active=true]:text-fd-primary', className), ...props, children: [item.url ? (_jsx(LinkItem, { item: item, children: item.text })) : (item.text), _jsx(ChevronDown, { className: "size-3" })] }), _jsx(PopoverContent, { className: "flex flex-col", children: item.items.map((child, i) => {
65
- if (child.type === 'custom')
66
- return _jsx(Fragment, { children: child.children }, i);
67
- return (_jsxs(LinkItem, { item: child, className: "inline-flex items-center gap-2 rounded-md p-2 text-start hover:bg-fd-accent hover:text-fd-accent-foreground data-[active=true]:text-fd-primary [&_svg]:size-4", children: [child.icon, child.text] }, i));
68
- }) })] }));
62
+ return _jsx(NavbarLinkItemMenu, { item: item, className: className, ...props });
69
63
  }
70
64
  return (_jsx(LinkItem, { item: item, className: cn('text-sm text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary', className), ...props, children: item.text }));
71
65
  }
66
+ function NavbarLinkItemMenu({ item, hoverDelay = 50, className, ...props }) {
67
+ const [open, setOpen] = useState(false);
68
+ const timeoutRef = useRef(null);
69
+ const freezeUntil = useRef(null);
70
+ const delaySetOpen = (value) => {
71
+ if (timeoutRef.current) {
72
+ clearTimeout(timeoutRef.current);
73
+ timeoutRef.current = null;
74
+ }
75
+ timeoutRef.current = window.setTimeout(() => {
76
+ setOpen(value);
77
+ freezeUntil.current = Date.now() + 300;
78
+ }, hoverDelay);
79
+ };
80
+ const onPointerEnter = (e) => {
81
+ if (e.pointerType === 'touch')
82
+ return;
83
+ delaySetOpen(true);
84
+ };
85
+ const onPointerLeave = (e) => {
86
+ if (e.pointerType === 'touch')
87
+ return;
88
+ delaySetOpen(false);
89
+ };
90
+ function isTouchDevice() {
91
+ return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
92
+ }
93
+ return (_jsxs(Popover, { open: open, onOpenChange: (value) => {
94
+ if (freezeUntil.current === null || Date.now() >= freezeUntil.current)
95
+ setOpen(value);
96
+ }, children: [_jsxs(PopoverTrigger, { className: cn('inline-flex items-center gap-1.5 p-1 text-sm text-fd-muted-foreground transition-colors has-data-[active=true]:text-fd-primary data-[state=open]:text-fd-accent-foreground focus-visible:outline-none', className), onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, ...props, children: [item.url ? (_jsx(LinkItem, { item: item, children: item.text })) : (item.text), _jsx(ChevronDown, { className: "size-3" })] }), _jsx(PopoverContent, { className: "flex flex-col p-1 text-fd-muted-foreground text-start", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: item.items.map((child, i) => {
97
+ if (child.type === 'custom')
98
+ return _jsx(Fragment, { children: child.children }, i);
99
+ return (_jsxs(LinkItem, { item: child, className: "inline-flex items-center gap-2 rounded-md p-2 transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground data-[active=true]:text-fd-primary [&_svg]:size-4", onClick: () => {
100
+ if (isTouchDevice())
101
+ setOpen(false);
102
+ }, children: [child.icon, child.text] }, i));
103
+ }) })] }));
104
+ }
@@ -2,9 +2,9 @@ import { type ComponentProps, type FC, type HTMLAttributes, type ReactNode } fro
2
2
  import { type BaseLayoutProps } from '../../layouts/shared/index.js';
3
3
  import { Sidebar } from './sidebar.js';
4
4
  import type * as PageTree from 'fumadocs-core/page-tree';
5
- import { type GetSidebarTabsOptions } from '../../utils/get-sidebar-tabs.js';
6
5
  import type { SidebarPageTreeComponents } from '../../components/sidebar/page-tree.js';
7
- import { type SidebarTabWithProps } from '../../components/sidebar/tabs.js';
6
+ import { type GetSidebarTabsOptions } from '../../components/sidebar/tabs/index.js';
7
+ import { type SidebarTabWithProps } from '../../components/sidebar/tabs/dropdown.js';
8
8
  export interface DocsLayoutProps extends BaseLayoutProps {
9
9
  tree: PageTree.Root;
10
10
  tabMode?: 'sidebar' | 'navbar';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/notebook/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,OAAO,EAQR,MAAM,WAAW,CAAC;AAOnB,OAAO,KAAK,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAazD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AAEnC,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,CAAC,KAAK,CAAC,GAAG;QAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,UAAU,cACR,SAAQ,cAAc,CAAC,OAAO,CAAC,EAC7B,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAAC;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEhD;;OAEG;IACH,IAAI,CAAC,EAAE,mBAAmB,EAAE,GAAG,qBAAqB,GAAG,KAAK,CAA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,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAAC;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEhD;;OAEG;IACH,IAAI,CAAC,EAAE,mBAAmB,EAAE,GAAG,qBAAqB,GAAG,KAAK,CAAC;IAE7D,MAAM,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,SAAS,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/C;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAyNhD"}
@@ -11,9 +11,9 @@ import { ThemeToggle } from '../../layouts/shared/theme-toggle.js';
11
11
  import { LayoutBody, LayoutContextProvider, LayoutHeaderTabs, LayoutHeader, NavbarLinkItem, } from '../../layouts/notebook/client.js';
12
12
  import Link from 'fumadocs-core/link';
13
13
  import { LargeSearchToggle, SearchToggle, } from '../../layouts/shared/search-toggle.js';
14
- import { getSidebarTabs, } from '../../utils/get-sidebar-tabs.js';
15
14
  import { LinkItem } from '../../layouts/shared/link-item.js';
16
- import { SidebarTabTrigger, } from '../../components/sidebar/tabs.js';
15
+ import { getSidebarTabs, } from '../../components/sidebar/tabs/index.js';
16
+ import { SidebarTabsDropdown, } from '../../components/sidebar/tabs/dropdown.js';
17
17
  export function DocsLayout(props) {
18
18
  const { tabMode = 'sidebar', nav = {}, sidebar: { tabs: tabOptions, defaultOpenLevel, prefetch, ...sidebarProps } = {}, i18n = false, themeSwitch = {}, tree, } = props;
19
19
  const navMode = nav.mode ?? 'auto';
@@ -32,21 +32,21 @@ export function DocsLayout(props) {
32
32
  }, [tabOptions, tree]);
33
33
  function sidebar() {
34
34
  const { banner, footer, components, collapsible = true, ...rest } = sidebarProps;
35
+ const iconLinks = links.filter((item) => item.type === 'icon');
35
36
  const Header = typeof banner === 'function'
36
37
  ? banner
37
- : ({ className, ...props }) => (_jsxs("div", { className: cn('flex flex-col gap-3 p-4 pb-2', className), ...props, children: [props.children, banner] }));
38
+ : ({ className, ...props }) => (_jsxs("div", { className: cn('flex flex-col gap-3 p-4 pb-2 empty:hidden', className), ...props, children: [props.children, banner] }));
38
39
  const Footer = typeof footer === 'function'
39
40
  ? footer
40
- : ({ className, ...props }) => (_jsxs("div", { className: cn('flex flex-col border-t p-4 pt-2', className), ...props, children: [props.children, footer] }));
41
- const iconLinks = links.filter((item) => item.type === 'icon');
41
+ : ({ className, ...props }) => (_jsxs("div", { className: cn('hidden flex-row text-fd-muted-foreground items-center border-t p-4 pt-2', iconLinks.length > 0 && 'max-lg:flex', className), ...props, children: [props.children, footer] }));
42
42
  const viewport = (_jsxs(SidebarViewport, { children: [links
43
43
  .filter((item) => item.type !== 'icon')
44
44
  .map((item, i, arr) => (_jsx(SidebarLinkItem, { item: item, className: cn('lg:hidden', i === arr.length - 1 && 'mb-4') }, i))), _jsx(SidebarPageTree, { ...components })] }));
45
- return (_jsxs(_Fragment, { children: [_jsxs(SidebarContent, { ...rest, children: [_jsxs(Header, { className: "empty:hidden", children: [navMode === 'auto' && (_jsxs("div", { className: "flex justify-between", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-medium", children: nav.title }), collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
45
+ return (_jsxs(_Fragment, { children: [_jsxs(SidebarContent, { ...rest, children: [_jsxs(Header, { children: [navMode === 'auto' && (_jsxs("div", { className: "flex justify-between", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-medium", children: nav.title }), collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
46
46
  color: 'ghost',
47
47
  size: 'icon-sm',
48
48
  className: 'mt-px mb-auto text-fd-muted-foreground',
49
- })), children: _jsx(SidebarIcon, {}) }))] })), nav.children, tabs.length > 0 && (_jsx(SidebarTabTrigger, { options: tabs, className: cn(tabMode === 'navbar' && 'lg:hidden') }))] }), viewport, _jsx(Footer, { className: cn('hidden flex-row text-fd-muted-foreground items-center', iconLinks.length > 0 && 'max-lg:flex'), children: iconLinks.map((item, i) => (_jsx(LinkItem, { item: item, className: cn(buttonVariants({
49
+ })), children: _jsx(SidebarIcon, {}) }))] })), nav.children, tabs.length > 0 && (_jsx(SidebarTabsDropdown, { options: tabs, className: cn(tabMode === 'navbar' && 'lg:hidden') }))] }), viewport, _jsx(Footer, { children: iconLinks.map((item, i) => (_jsx(LinkItem, { item: item, className: cn(buttonVariants({
50
50
  size: 'icon-sm',
51
51
  color: 'ghost',
52
52
  className: 'lg:hidden',
@@ -54,7 +54,7 @@ export function DocsLayout(props) {
54
54
  size: 'icon-sm',
55
55
  color: 'ghost',
56
56
  className: 'ms-auto text-fd-muted-foreground',
57
- })), children: _jsx(X, {}) }), tabs.length > 0 && _jsx(SidebarTabTrigger, { options: tabs })] }), viewport, _jsxs(Footer, { className: cn('hidden flex-row items-center justify-end', (i18n || themeSwitch.enabled !== false) && 'flex', iconLinks.length > 0 && 'max-lg:flex'), children: [iconLinks.map((item, i) => (_jsx(LinkItem, { item: item, className: cn(buttonVariants({
57
+ })), children: _jsx(X, {}) }), tabs.length > 0 && _jsx(SidebarTabsDropdown, { options: tabs })] }), viewport, _jsxs(Footer, { className: cn('hidden flex-row items-center justify-end', (i18n || themeSwitch.enabled !== false) && 'flex', iconLinks.length > 0 && 'max-lg:flex'), children: [iconLinks.map((item, i) => (_jsx(LinkItem, { item: item, className: cn(buttonVariants({
58
58
  size: 'icon-sm',
59
59
  color: 'ghost',
60
60
  }), '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" }) })), themeSwitch.enabled !== false &&
@@ -1 +1 @@
1
- {"version":3,"file":"client.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BAAgB,EAChB,WAAW,EACX,GAAG,KAAK,EACT,EAAE,eAAe,kDA6CjB"}
@@ -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,g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I,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;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,
@@ -1 +1 @@
1
- {"version":3,"file":"search-toggle.d.ts","sourceRoot":"","sources":["../../../src/layouts/shared/search-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,wBAAwB,CAAC;AAE1E,UAAU,iBACR,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAC7C,WAAW;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAC3B,cAAc,EACd,IAAgB,EAChB,KAAe,EACf,GAAG,KAAK,EACT,EAAE,iBAAiB,kDAuBnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,kDA6BA"}
1
+ {"version":3,"file":"search-toggle.d.ts","sourceRoot":"","sources":["../../../src/layouts/shared/search-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,wBAAwB,CAAC;AAE1E,UAAU,iBACR,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW;IAC5D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,EAC3B,cAAc,EACd,IAAgB,EAChB,KAAe,EACf,GAAG,KAAK,EACT,EAAE,iBAAiB,kDAuBnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,kDA6BA"}
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAM5C,OAAO,EACL,eAAe,EACf,SAAS,EACT,YAAY,EACZ,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H,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,OAAO,aAAa,CAAC,CAAC,GAAG;QAChE;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IAEF,IAAI,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAE3C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAErC;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IAEvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,GAAW,EACX,KAAU,EACV,MAAM,EACN,IAAI,GACL,EAAE,iBAAiB,2CA4BnB"}
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
  }
@@ -1,4 +1,4 @@
1
- import type { SidebarTab } from '../utils/get-sidebar-tabs.js';
1
+ import type { SidebarTab } from '../components/sidebar/tabs/index.js';
2
2
  export declare function isActive(url: string, pathname: string, nested?: boolean): boolean;
3
3
  export declare function isTabActive(tab: SidebarTab, pathname: string): boolean;
4
4
  //# sourceMappingURL=is-active.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-active.d.ts","sourceRoot":"","sources":["../../src/utils/is-active.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAO3D,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,UAAO,GACZ,OAAO,CAKT;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAI5D"}
1
+ {"version":3,"file":"is-active.d.ts","sourceRoot":"","sources":["../../src/utils/is-active.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAO5D,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,MAAM,UAAO,GACZ,OAAO,CAKT;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAI5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.2.0",
3
+ "version": "16.2.2",
4
4
  "description": "The React.js documentation framework",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -77,6 +77,10 @@
77
77
  "import": "./dist/theme/*.js",
78
78
  "types": "./dist/theme/*.d.ts"
79
79
  },
80
+ "./utils/get-sidebar-tabs": {
81
+ "import": "./dist/components/sidebar/tabs/index.js",
82
+ "types": "./dist/components/sidebar/tabs/index.d.ts"
83
+ },
80
84
  "./utils/*": {
81
85
  "import": "./dist/utils/*.js",
82
86
  "types": "./dist/utils/*.d.ts"
@@ -104,25 +108,25 @@
104
108
  "class-variance-authority": "^0.7.1",
105
109
  "lodash.merge": "^4.6.2",
106
110
  "next-themes": "^0.4.6",
107
- "postcss-selector-parser": "^7.1.0",
111
+ "postcss-selector-parser": "^7.1.1",
108
112
  "react-medium-image-zoom": "^5.4.0",
109
113
  "scroll-into-view-if-needed": "^3.1.0",
110
114
  "tailwind-merge": "^3.4.0",
111
- "fumadocs-core": "16.2.0"
115
+ "fumadocs-core": "16.2.2"
112
116
  },
113
117
  "devDependencies": {
114
- "@next/eslint-plugin-next": "16.0.3",
118
+ "@next/eslint-plugin-next": "16.0.6",
115
119
  "@tailwindcss/cli": "^4.1.17",
116
120
  "@types/lodash.merge": "^4.6.9",
117
121
  "@types/node": "^24.10.1",
118
- "@types/react": "^19.2.5",
122
+ "@types/react": "^19.2.7",
119
123
  "@types/react-dom": "^19.2.3",
120
- "next": "16.0.3",
124
+ "next": "16.0.6",
121
125
  "tailwindcss": "^4.1.17",
122
126
  "tsc-alias": "^1.8.16",
123
127
  "@fumadocs/cli": "1.1.0",
124
128
  "eslint-config-custom": "0.0.0",
125
- "fumadocs-core": "16.2.0",
129
+ "fumadocs-core": "16.2.2",
126
130
  "tsconfig": "0.0.0"
127
131
  },
128
132
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAW/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,KAAK,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;CAC7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