fumadocs-ui 13.4.7 → 13.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,7 +39,7 @@ function Banner({
39
39
  props.className
40
40
  ),
41
41
  children: [
42
- changeLayout ? /* @__PURE__ */ jsx("style", { children: `
42
+ changeLayout && open ? /* @__PURE__ */ jsx("style", { children: `
43
43
  #nd-sidebar${cssFilter}, #nd-nav${cssFilter}, #nd-subnav${cssFilter}, [data-toc]${cssFilter} { top: 3rem; }
44
44
  #nd-tocnav${cssFilter} { top: 6.5rem; }
45
45
  #nd-sidebar${cssFilter}, [data-toc]${cssFilter} { height: calc(100dvh - 3rem); }
@@ -90,7 +90,7 @@ var rainbowLayer = /* @__PURE__ */ jsxs(Fragment, { children: [
90
90
  "--end": "rgba(255,77,0,0.4)",
91
91
  "--via": "rgba(164,255,68,0.4)",
92
92
  animationDirection: "reverse",
93
- backgroundImage: "repeating-linear-gradient(to right, var(--end), var(--start) 2%, var(--start) 5%, transparent 8%, transparent 14%, var(--via) 18%, var(--via) 22%, var(--mid) 28%, var(--mid) 30%, var(--via) 34%, var(--via) 36%, transparent, var(--end) 50%)",
93
+ backgroundImage: "repeating-linear-gradient(60deg, var(--end), var(--start) 2%, var(--start) 5%, transparent 8%, transparent 14%, var(--via) 18%, var(--via) 22%, var(--mid) 28%, var(--mid) 30%, var(--via) 34%, var(--via) 36%, transparent, var(--end) calc(50% - 12px))",
94
94
  backgroundSize: "200% 100%",
95
95
  mixBlendMode: "difference"
96
96
  }
@@ -108,8 +108,9 @@ var rainbowLayer = /* @__PURE__ */ jsxs(Fragment, { children: [
108
108
  "--mid": "rgba(36,188,255,0.4)",
109
109
  "--end": "rgba(64,0,255,0.51)",
110
110
  "--via": "rgba(255,89,0,0.56)",
111
- backgroundImage: "repeating-linear-gradient(to right, var(--end), var(--start) 4%, var(--start) 8%, transparent 9%, transparent 14%, var(--mid) 16%, var(--mid) 20%, transparent, var(--via) 36%, var(--via) 40%, transparent 42%, var(--end) 46%, var(--end) 50%)",
112
- backgroundSize: "200% 100%"
111
+ backgroundImage: "repeating-linear-gradient(45deg, var(--end), var(--start) 4%, var(--start) 8%, transparent 9%, transparent 14%, var(--mid) 16%, var(--mid) 20%, transparent, var(--via) 36%, var(--via) 40%, transparent 42%, var(--end) 46%, var(--end) calc(50% - 16.8px))",
112
+ backgroundSize: "200% 100%",
113
+ mixBlendMode: "color-dodge"
113
114
  }
114
115
  }
115
116
  ),
@@ -1,16 +1,17 @@
1
- import { ReactNode } from 'react';
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
2
 
3
3
  interface Option {
4
4
  /**
5
5
  * Redirect URL of the folder, usually the index page
6
6
  */
7
7
  url: string;
8
- icon: ReactNode;
8
+ icon?: ReactNode;
9
9
  title: ReactNode;
10
10
  description: ReactNode;
11
+ props?: HTMLAttributes<HTMLElement>;
11
12
  }
12
- declare function RootToggle({ options, }: {
13
+ declare function RootToggle({ options, ...props }: {
13
14
  options: Option[];
14
- }): React.ReactElement;
15
+ } & HTMLAttributes<HTMLButtonElement>): React.ReactElement;
15
16
 
16
17
  export { RootToggle };
@@ -22,7 +22,8 @@ import Link from "next/link";
22
22
  import { usePathname } from "next/navigation";
23
23
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
24
24
  function RootToggle({
25
- options
25
+ options,
26
+ ...props
26
27
  }) {
27
28
  const [open, setOpen] = useState(false);
28
29
  const { closeOnRedirect } = useSidebar();
@@ -33,18 +34,30 @@ function RootToggle({
33
34
  setOpen(false);
34
35
  }, [closeOnRedirect]);
35
36
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
36
- /* @__PURE__ */ jsxs(PopoverTrigger, { className: "-mx-2 flex flex-row items-center gap-2.5 rounded-lg p-2 hover:bg-fd-accent/50 hover:text-fd-accent-foreground", children: [
37
- /* @__PURE__ */ jsx(Item, { ...selected }),
38
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 text-fd-muted-foreground md:me-1.5" })
39
- ] }),
37
+ /* @__PURE__ */ jsxs(
38
+ PopoverTrigger,
39
+ {
40
+ ...props,
41
+ className: twMerge(
42
+ "-mx-2 flex flex-row items-center gap-2.5 rounded-lg p-2 hover:bg-fd-accent/50 hover:text-fd-accent-foreground",
43
+ props.className
44
+ ),
45
+ children: [
46
+ /* @__PURE__ */ jsx(Item, { ...selected }),
47
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-4 text-fd-muted-foreground md:me-1.5" })
48
+ ]
49
+ }
50
+ ),
40
51
  /* @__PURE__ */ jsx(PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] overflow-hidden p-0", children: options.map((item) => /* @__PURE__ */ jsx(
41
52
  Link,
42
53
  {
43
54
  href: item.url,
44
55
  onClick,
56
+ ...item.props,
45
57
  className: twMerge(
46
- "flex w-full flex-row gap-2 p-2",
47
- selected === item ? "bg-fd-accent text-fd-accent-foreground" : "hover:bg-fd-accent/50"
58
+ "flex w-full flex-row items-center gap-2.5 p-2",
59
+ selected === item ? "bg-fd-accent text-fd-accent-foreground" : "hover:bg-fd-accent/50",
60
+ item.props?.className
48
61
  ),
49
62
  children: /* @__PURE__ */ jsx(Item, { ...item })
50
63
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "13.4.7",
3
+ "version": "13.4.9",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -110,7 +110,7 @@
110
110
  "react-medium-image-zoom": "^5.2.9",
111
111
  "swr": "^2.2.5",
112
112
  "tailwind-merge": "^2.5.2",
113
- "fumadocs-core": "13.4.7"
113
+ "fumadocs-core": "13.4.9"
114
114
  },
115
115
  "devDependencies": {
116
116
  "@algolia/client-search": "^4.24.0",