fumadocs-ui 16.6.0 → 16.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -493,7 +493,6 @@
493
493
  @source inline("k");
494
494
  @source inline("keepBackground");
495
495
  @source inline("key");
496
- @source inline("keyVariants");
497
496
  @source inline("keydown");
498
497
  @source inline("keyof");
499
498
  @source inline("label");
@@ -701,6 +700,7 @@
701
700
  @source inline("page");
702
701
  @source inline("parameters");
703
702
  @source inline("params");
703
+ @source inline("parentId");
704
704
  @source inline("pass");
705
705
  @source inline("passed");
706
706
  @source inline("path");
@@ -821,6 +821,7 @@
821
821
  @source inline("s");
822
822
  @source inline("scroll");
823
823
  @source inline("scroll-into-view-if-needed");
824
+ @source inline("scroll-m-20");
824
825
  @source inline("scroll-m-24");
825
826
  @source inline("scroll-m-28");
826
827
  @source inline("scrollIntoView");
@@ -1050,7 +1051,7 @@
1050
1051
  @source inline("w-0");
1051
1052
  @source inline("w-0.5");
1052
1053
  @source inline("w-1.5");
1053
- @source inline("w-[25%]");
1054
+ @source inline("w-1/4");
1054
1055
  @source inline("w-[calc(100%-1rem)]");
1055
1056
  @source inline("w-fit");
1056
1057
  @source inline("w-full");
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ComponentProps, ReactNode } from "react";
2
2
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/type-table.d.ts
@@ -30,9 +30,12 @@ interface TypeNode {
30
30
  returns?: ReactNode;
31
31
  }
32
32
  declare function TypeTable({
33
- type
33
+ id,
34
+ type,
35
+ className,
36
+ ...props
34
37
  }: {
35
38
  type: Record<string, TypeNode>;
36
- }): react_jsx_runtime0.JSX.Element;
39
+ } & ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
37
40
  //#endregion
38
41
  export { ParameterNode, TypeNode, TypeTable };
@@ -2,47 +2,56 @@
2
2
 
3
3
  import { cn } from "../utils/cn.js";
4
4
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
5
- import { useState } from "react";
5
+ import { useEffect, useState } from "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import Link from "fumadocs-core/link";
8
8
  import { ChevronDown } from "lucide-react";
9
9
  import { cva } from "class-variance-authority";
10
10
 
11
11
  //#region src/components/type-table.tsx
12
- const keyVariants = cva("text-fd-primary", { variants: { deprecated: { true: "line-through text-fd-primary/50" } } });
13
12
  const fieldVariants = cva("text-fd-muted-foreground not-prose pe-2");
14
- function TypeTable({ type }) {
13
+ function TypeTable({ id, type, className, ...props }) {
15
14
  return /* @__PURE__ */ jsxs("div", {
16
- className: "@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden",
15
+ id,
16
+ className: cn("@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden", className),
17
+ ...props,
17
18
  children: [/* @__PURE__ */ jsxs("div", {
18
19
  className: "flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground",
19
20
  children: [/* @__PURE__ */ jsx("p", {
20
- className: "w-[25%]",
21
+ className: "w-1/4",
21
22
  children: "Prop"
22
23
  }), /* @__PURE__ */ jsx("p", {
23
24
  className: "@max-xl:hidden",
24
25
  children: "Type"
25
26
  })]
26
27
  }), Object.entries(type).map(([key, value]) => /* @__PURE__ */ jsx(Item, {
28
+ parentId: id,
27
29
  name: key,
28
30
  item: value
29
31
  }, key))]
30
32
  });
31
33
  }
32
- function Item({ name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
34
+ function Item({ parentId, name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
33
35
  const [open, setOpen] = useState(false);
36
+ const id = parentId ? `${parentId}-${name}` : void 0;
37
+ useEffect(() => {
38
+ const hash = window.location.hash;
39
+ if (!id || !hash) return;
40
+ if (`#${id}` === hash) setOpen(true);
41
+ }, [id]);
34
42
  return /* @__PURE__ */ jsxs(Collapsible, {
43
+ id,
35
44
  open,
36
- onOpenChange: setOpen,
37
- className: cn("rounded-xl border overflow-hidden transition-all", open ? "shadow-sm bg-fd-background not-last:mb-2" : "border-transparent"),
45
+ onOpenChange: (v) => {
46
+ if (v && id) window.history.replaceState(null, "", `#${id}`);
47
+ setOpen(v);
48
+ },
49
+ className: cn("rounded-xl border overflow-hidden scroll-m-20 transition-all", open ? "shadow-sm bg-fd-background not-last:mb-2" : "border-transparent"),
38
50
  children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
39
51
  className: "relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent",
40
52
  children: [
41
53
  /* @__PURE__ */ jsxs("code", {
42
- className: cn(keyVariants({
43
- deprecated,
44
- className: "min-w-fit w-[25%] font-medium pe-2"
45
- })),
54
+ className: cn("text-fd-primary min-w-fit w-1/4 font-mono font-medium pe-2", deprecated && "line-through text-fd-primary/50"),
46
55
  children: [name, !required && "?"]
47
56
  }),
48
57
  typeDescriptionLink ? /* @__PURE__ */ jsx(Link, {
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
4
4
 
5
5
  //#region src/layouts/home/client.d.ts
6
6
  declare const navItemVariants: (props?: ({
7
- variant?: "button" | "main" | "icon" | null | undefined;
7
+ variant?: "icon" | "button" | "main" | null | undefined;
8
8
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
9
9
  declare function Header({
10
10
  nav,
package/dist/style.css CHANGED
@@ -1053,12 +1053,12 @@
1053
1053
  .w-1\.5 {
1054
1054
  width: calc(var(--spacing) * 1.5);
1055
1055
  }
1056
+ .w-1\/4 {
1057
+ width: calc(1/4 * 100%);
1058
+ }
1056
1059
  .w-4 {
1057
1060
  width: calc(var(--spacing) * 4);
1058
1061
  }
1059
- .w-\[25\%\] {
1060
- width: 25%;
1061
- }
1062
1062
  .w-\[85\%\] {
1063
1063
  width: 85%;
1064
1064
  }
@@ -1180,6 +1180,9 @@
1180
1180
  .animate-pulse {
1181
1181
  animation: var(--animate-pulse);
1182
1182
  }
1183
+ .scroll-m-20 {
1184
+ scroll-margin: calc(var(--spacing) * 20);
1185
+ }
1183
1186
  .scroll-m-24 {
1184
1187
  scroll-margin: calc(var(--spacing) * 24);
1185
1188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.6.0",
3
+ "version": "16.6.1",
4
4
  "description": "The Radix UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -114,7 +114,7 @@
114
114
  "@radix-ui/react-tabs": "^1.1.13",
115
115
  "class-variance-authority": "^0.7.1",
116
116
  "lucide-react": "^0.563.0",
117
- "motion": "^12.33.0",
117
+ "motion": "^12.34.0",
118
118
  "next-themes": "^0.4.6",
119
119
  "react-medium-image-zoom": "^5.4.0",
120
120
  "react-remove-scroll": "^2.7.2",
@@ -127,15 +127,15 @@
127
127
  "devDependencies": {
128
128
  "@tailwindcss/cli": "^4.1.18",
129
129
  "@types/hast": "^3.0.4",
130
- "@types/node": "^25.2.1",
131
- "@types/react": "^19.2.13",
130
+ "@types/node": "^25.2.3",
131
+ "@types/react": "^19.2.14",
132
132
  "@types/react-dom": "^19.2.3",
133
133
  "tailwindcss": "^4.1.18",
134
134
  "tsdown": "^0.20.3",
135
135
  "unified": "^11.0.5",
136
136
  "@fumadocs/cli": "1.2.4",
137
137
  "eslint-config-custom": "0.0.0",
138
- "fumadocs-core": "16.6.0",
138
+ "fumadocs-core": "16.6.1",
139
139
  "tsconfig": "0.0.0"
140
140
  },
141
141
  "peerDependencies": {
@@ -143,7 +143,7 @@
143
143
  "next": "16.x.x",
144
144
  "react": "^19.2.0",
145
145
  "react-dom": "^19.2.0",
146
- "fumadocs-core": "16.6.0"
146
+ "fumadocs-core": "16.6.1"
147
147
  },
148
148
  "peerDependenciesMeta": {
149
149
  "next": {