fumadocs-ui 16.6.5 → 16.6.6

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.
@@ -2,6 +2,7 @@
2
2
  @source inline("!isActive");
3
3
  @source inline("!open");
4
4
  @source inline("*:rounded-lg");
5
+ @source inline("---spacing");
5
6
  @source inline("--fd-toc-width");
6
7
  @source inline("--removed-body-scroll-bar-size");
7
8
  @source inline("--spacing");
@@ -12,7 +13,6 @@
12
13
  @source inline("[&_svg]:shrink-0");
13
14
  @source inline("[&_svg]:size-4");
14
15
  @source inline("[grid-area:main]");
15
- @source inline("[scrollbar-width:none]");
16
16
  @source inline("a");
17
17
  @source inline("absolute");
18
18
  @source inline("active");
@@ -187,6 +187,7 @@
187
187
  @source inline("inline-flex");
188
188
  @source inline("input");
189
189
  @source inline("inset-0");
190
+ @source inline("inset-x-0");
190
191
  @source inline("interface");
191
192
  @source inline("invisible");
192
193
  @source inline("isActive");
@@ -207,7 +208,7 @@
207
208
  @source inline("located");
208
209
  @source inline("lucide-react");
209
210
  @source inline("main");
210
- @source inline("mask-[linear-gradient(to_bottom,transparent,white_calc(var(--spacing)*14),white_calc(100%-var(--spacing)*14),transparent)]");
211
+ @source inline("mask-[linear-gradient(to_bottom,transparent,white_--spacing(14),white_calc(100%---spacing(14)),transparent)]");
211
212
  @source inline("max");
212
213
  @source inline("max-h-[50vh]");
213
214
  @source inline("max-w-[1200px]");
@@ -221,6 +222,7 @@
221
222
  @source inline("menuItems");
222
223
  @source inline("mergeRefs");
223
224
  @source inline("min");
225
+ @source inline("min-h-0");
224
226
  @source inline("min-h-11");
225
227
  @source inline("min-w-0");
226
228
  @source inline("mode");
@@ -249,6 +251,7 @@
249
251
  @source inline("number");
250
252
  @source inline("object");
251
253
  @source inline("of");
254
+ @source inline("onAnimationComplete");
252
255
  @source inline("onClick");
253
256
  @source inline("onOpenChange");
254
257
  @source inline("opacity");
@@ -260,7 +263,6 @@
260
263
  @source inline("overflow-x-clip");
261
264
  @source inline("overflow-y-auto");
262
265
  @source inline("overflow-y-hidden");
263
- @source inline("overscroll-contain");
264
266
  @source inline("p");
265
267
  @source inline("p-1");
266
268
  @source inline("p-1.5");
@@ -311,10 +313,12 @@
311
313
  @source inline("rounded-lg");
312
314
  @source inline("rounded-xl");
313
315
  @source inline("rtl:rotate-180");
316
+ @source inline("scale");
314
317
  @source inline("searchToggle");
315
318
  @source inline("secondary");
316
319
  @source inline("selected");
317
320
  @source inline("selectedIdx");
321
+ @source inline("setBlockScroll");
318
322
  @source inline("setContainer");
319
323
  @source inline("setDate");
320
324
  @source inline("setOpen");
@@ -378,6 +382,7 @@
378
382
  @source inline("tocOptions");
379
383
  @source inline("tocPopoverEnabled");
380
384
  @source inline("tool");
385
+ @source inline("top-0");
381
386
  @source inline("transform");
382
387
  @source inline("transition");
383
388
  @source inline("transition-all");
@@ -385,6 +390,7 @@
385
390
  @source inline("transition-opacity");
386
391
  @source inline("transition-transform");
387
392
  @source inline("translate-x-[calc(-50%-var(--removed-body-scroll-bar-size,0px)/2)]");
393
+ @source inline("translateY");
388
394
  @source inline("tree");
389
395
  @source inline("true");
390
396
  @source inline("truncate");
@@ -400,6 +406,7 @@
400
406
  @source inline("useMemo");
401
407
  @source inline("usePathname");
402
408
  @source inline("useRef");
409
+ @source inline("useSearchContext");
403
410
  @source inline("useSidebar");
404
411
  @source inline("useState");
405
412
  @source inline("useTOCItems");
@@ -480,6 +480,7 @@
480
480
  @source inline("is");
481
481
  @source inline("isActive");
482
482
  @source inline("isLoading");
483
+ @source inline("isOpen");
483
484
  @source inline("isWindows");
484
485
  @source inline("it");
485
486
  @source inline("item");
@@ -5,7 +5,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
5
5
  declare const buttonVariants: (props?: ({
6
6
  variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
7
7
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
8
- size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
8
+ size?: "sm" | "icon" | "icon-sm" | "icon-xs" | null | undefined;
9
9
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  type ButtonProps = VariantProps<typeof buttonVariants>;
11
11
  //#endregion
@@ -49,6 +49,7 @@ interface SearchProviderProps {
49
49
  }
50
50
  interface SearchContextType {
51
51
  enabled: boolean;
52
+ open: boolean;
52
53
  hotKey: HotKey[];
53
54
  setOpenSearch: (value: boolean) => void;
54
55
  }
@@ -6,6 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/contexts/search.tsx
7
7
  const SearchContext = createContext({
8
8
  enabled: false,
9
+ open: false,
9
10
  hotKey: [],
10
11
  setOpenSearch: () => void 0
11
12
  });
@@ -42,9 +43,10 @@ function SearchProvider({ SearchDialog, children, preload = true, options, hotKe
42
43
  return /* @__PURE__ */ jsxs(SearchContext, {
43
44
  value: useMemo(() => ({
44
45
  enabled: true,
46
+ open: isOpen ?? false,
45
47
  hotKey,
46
48
  setOpenSearch: setIsOpen
47
- }), [hotKey]),
49
+ }), [isOpen, hotKey]),
48
50
  children: [isOpen !== void 0 && /* @__PURE__ */ jsx(Suspense, {
49
51
  fallback: null,
50
52
  children: /* @__PURE__ */ jsx(SearchDialog, {
@@ -58,7 +58,6 @@ declare function NavigationPanel({
58
58
  tabDropdown,
59
59
  tool,
60
60
  link,
61
- className,
62
61
  children,
63
62
  ...props
64
63
  }: NavigationPanelProps & Omit<ComponentProps<typeof motion.div>, 'children'> & {
@@ -5,6 +5,7 @@ import { buttonVariants } from "../../components/ui/button.js";
5
5
  import { TreeContextProvider } from "../../contexts/tree.js";
6
6
  import { SidebarViewport, useSidebar } from "../../components/sidebar/base.js";
7
7
  import { LinkItem } from "../../utils/link-item.js";
8
+ import { useSearchContext } from "../../contexts/search.js";
8
9
  import { SearchToggle } from "../shared/search-toggle.js";
9
10
  import { renderTitleNav, useLinkItems } from "../shared/index.js";
10
11
  import { LanguageToggle } from "../shared/language-toggle.js";
@@ -117,10 +118,16 @@ function NavigationSidebarTrigger() {
117
118
  })
118
119
  });
119
120
  }
120
- function NavigationPanel({ head, tabDropdown, tool, link, className, children = (v) => v, ...props }) {
121
+ function NavigationPanel({ head, tabDropdown, tool, link, children = (v) => v, ...props }) {
122
+ const { open } = useSearchContext();
121
123
  return /* @__PURE__ */ jsx(motion.div, {
122
- className: cn("fixed left-1/2 w-[calc(100%-var(--removed-body-scroll-bar-size,0px))] translate-x-[calc(-50%-var(--removed-body-scroll-bar-size,0px)/2)] bottom-0 z-40 bg-fd-popover text-fd-popover-foreground border-t shadow-lg sm:bottom-6 sm:rounded-2xl sm:border sm:max-w-[380px]", className),
123
124
  ...props,
125
+ className: cn("fixed left-1/2 w-[calc(100%-var(--removed-body-scroll-bar-size,0px))] translate-x-[calc(-50%-var(--removed-body-scroll-bar-size,0px)/2)] bottom-0 z-40 bg-fd-popover text-fd-popover-foreground border-t shadow-lg sm:bottom-6 sm:rounded-2xl sm:border sm:max-w-[380px]", props.className),
126
+ animate: props.animate ?? {
127
+ scale: open ? .9 : 1,
128
+ translateY: open ? 20 : 0,
129
+ opacity: open ? .8 : 1
130
+ },
124
131
  children: children(/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
125
132
  className: "flex flex-row items-center ps-2.5 p-1 gap-2 min-h-11",
126
133
  children: [head, /* @__PURE__ */ jsx("div", {
@@ -5,7 +5,7 @@ import { mergeRefs } from "../../utils/merge-refs.js";
5
5
  import { SidebarCollapseTrigger as SidebarCollapseTrigger$1, SidebarFolder as SidebarFolder$1, SidebarFolderContent as SidebarFolderContent$1, SidebarFolderLink as SidebarFolderLink$1, SidebarFolderTrigger as SidebarFolderTrigger$1, SidebarItem as SidebarItem$1, SidebarProvider, SidebarSeparator as SidebarSeparator$1, SidebarTrigger as SidebarTrigger$1, SidebarViewport as SidebarViewport$1, useFolder, useFolderDepth, useSidebar } from "../../components/sidebar/base.js";
6
6
  import { createLinkItemRenderer } from "../../components/sidebar/link-item.js";
7
7
  import { createPageTreeRenderer } from "../../components/sidebar/page-tree.js";
8
- import { useEffect, useEffectEvent, useRef } from "react";
8
+ import { useEffect, useEffectEvent, useRef, useState } from "react";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  import { cva } from "class-variance-authority";
11
11
  import { motion } from "motion/react";
@@ -43,6 +43,7 @@ function SidebarTrigger(props) {
43
43
  }
44
44
  function SidebarContent({ ref: refProp, className, children, ...props }) {
45
45
  const ref = useRef(null);
46
+ const [blockScroll, setBlockScroll] = useState(false);
46
47
  const { open, setOpen } = useSidebar();
47
48
  const listener = useEffectEvent((e) => {
48
49
  if (open && e.key === "Escape") {
@@ -56,8 +57,9 @@ function SidebarContent({ ref: refProp, className, children, ...props }) {
56
57
  window.removeEventListener("keydown", listener);
57
58
  };
58
59
  }, []);
60
+ if (open && !blockScroll) setBlockScroll(true);
59
61
  return /* @__PURE__ */ jsx(RemoveScroll, {
60
- enabled: open,
62
+ enabled: blockScroll,
61
63
  children: /* @__PURE__ */ jsx(motion.div, {
62
64
  className: cn("fixed inset-0 py-10 z-30 backdrop-blur-md bg-fd-background/60", !open && "pointer-events-none"),
63
65
  initial: "hide",
@@ -70,8 +72,11 @@ function SidebarContent({ ref: refProp, className, children, ...props }) {
70
72
  onClick: () => {
71
73
  setOpen(false);
72
74
  },
75
+ onAnimationComplete: (definition) => {
76
+ if (definition === "hide") setBlockScroll(false);
77
+ },
73
78
  children: /* @__PURE__ */ jsx(motion.div, {
74
- className: "absolute overflow-y-auto pr-(--removed-body-scroll-bar-size,0) [scrollbar-width:none] py-16 inset-0 bottom-26 overscroll-contain mask-[linear-gradient(to_bottom,transparent,white_calc(var(--spacing)*14),white_calc(100%-var(--spacing)*14),transparent)] lg:text-sm",
79
+ className: "absolute top-0 min-h-0 inset-x-0 bottom-26 overflow-y-auto fd-scroll-container pr-(--removed-body-scroll-bar-size,0) py-16 mask-[linear-gradient(to_bottom,transparent,white_--spacing(14),white_calc(100%---spacing(14)),transparent)] lg:text-sm",
75
80
  variants: {
76
81
  show: {
77
82
  y: 0,
@@ -83,14 +88,13 @@ function SidebarContent({ ref: refProp, className, children, ...props }) {
83
88
  }
84
89
  },
85
90
  transition: {
86
- duration: .3,
91
+ duration: .4,
87
92
  ease: [
88
93
  .16,
89
94
  1,
90
95
  .3,
91
96
  1
92
- ],
93
- opacity: { duration: .1 }
97
+ ]
94
98
  },
95
99
  children: /* @__PURE__ */ jsx(motion.aside, {
96
100
  id: "nd-sidebar",
package/dist/style.css CHANGED
@@ -1472,12 +1472,12 @@
1472
1472
  .bg-transparent {
1473
1473
  background-color: transparent;
1474
1474
  }
1475
+ .mask-\[linear-gradient\(to_bottom\,transparent\,white_--spacing\(14\)\,white_calc\(100\%---spacing\(14\)\)\,transparent\)\] {
1476
+ mask-image: linear-gradient(to bottom,transparent,white calc(var(--spacing) * 14),white calc(100% - calc(var(--spacing) * 14)),transparent);
1477
+ }
1475
1478
  .mask-\[linear-gradient\(to_bottom\,transparent\,white_16px\,white_calc\(100\%-16px\)\,transparent\)\] {
1476
1479
  mask-image: linear-gradient(to bottom,transparent,white 16px,white calc(100% - 16px),transparent);
1477
1480
  }
1478
- .mask-\[linear-gradient\(to_bottom\,transparent\,white_calc\(var\(--spacing\)\*14\)\,white_calc\(100\%-var\(--spacing\)\*14\)\,transparent\)\] {
1479
- mask-image: linear-gradient(to bottom,transparent,white calc(var(--spacing) * 14),white calc(100% - var(--spacing) * 14),transparent);
1480
- }
1481
1481
  .mask-\[linear-gradient\(to_bottom\,white\,white_30px\,transparent_80px\)\] {
1482
1482
  mask-image: linear-gradient(to bottom,white,white 30px,transparent 80px);
1483
1483
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.6.5",
3
+ "version": "16.6.6",
4
4
  "description": "The Radix UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -139,7 +139,7 @@
139
139
  "unified": "^11.0.5",
140
140
  "@fumadocs/cli": "1.2.4",
141
141
  "eslint-config-custom": "0.0.0",
142
- "fumadocs-core": "16.6.5",
142
+ "fumadocs-core": "16.6.6",
143
143
  "tsconfig": "0.0.0"
144
144
  },
145
145
  "peerDependencies": {
@@ -148,7 +148,7 @@
148
148
  "next": "16.x.x",
149
149
  "react": "^19.2.0",
150
150
  "react-dom": "^19.2.0",
151
- "fumadocs-core": "16.6.5"
151
+ "fumadocs-core": "16.6.6"
152
152
  },
153
153
  "peerDependenciesMeta": {
154
154
  "next": {