fumadocs-ui 16.9.0 → 16.9.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.
@@ -1,3 +1,4 @@
1
+ @source inline("!header");
1
2
  @source inline("!showItem");
2
3
  @source inline("*:col-start-1");
3
4
  @source inline("*:my-auto");
@@ -146,6 +147,7 @@
146
147
  @source inline("nd-page");
147
148
  @source inline("nd-subnav");
148
149
  @source inline("nd-toc");
150
+ @source inline("nd-toc-placeholder");
149
151
  @source inline("no");
150
152
  @source inline("normalizedValue");
151
153
  @source inline("onClickItem");
@@ -1,4 +1,5 @@
1
1
  @source inline("!enabled");
2
+ @source inline("!header");
2
3
  @source inline("*:gap-0!");
3
4
  @source inline("*:rounded-lg");
4
5
  @source inline("---spacing");
@@ -1,3 +1,4 @@
1
+ @source inline("!footer");
1
2
  @source inline("!isSelected");
2
3
  @source inline("!showItem");
3
4
  @source inline("*:col-start-1");
@@ -172,6 +173,7 @@
172
173
  @source inline("nd-page");
173
174
  @source inline("nd-subnav");
174
175
  @source inline("nd-toc");
176
+ @source inline("nd-toc-placeholder");
175
177
  @source inline("no");
176
178
  @source inline("normalizedValue");
177
179
  @source inline("onClickItem");
package/css/preset.css CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
  @plugin '../dist/tailwind/typography.js';
5
5
 
6
- /* TODO: remove them on next major */
7
6
  @import './generated/docs.css';
8
7
  @import './generated/home.css';
9
8
  @import './generated/notebook.css';
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
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
@@ -9,7 +9,7 @@ const PathContext = createContext([]);
9
9
  function TreeContextProvider({ tree: rawTree, children }) {
10
10
  const nextIdRef = useRef(0);
11
11
  const pathname = usePathname();
12
- const tree = useMemo(() => rawTree, [rawTree.$id ?? rawTree]);
12
+ const tree = useMemo(() => rawTree, [rawTree.$id]);
13
13
  const path = useMemo(() => {
14
14
  return searchPath(tree.children, pathname) ?? (tree.fallback ? searchPath(tree.fallback.children, pathname) : null) ?? [];
15
15
  }, [tree, pathname]);
@@ -14,7 +14,7 @@ interface DocsPageProps extends ComponentProps<'article'> {
14
14
  *
15
15
  * @defaultValue false
16
16
  */
17
- full?: boolean;
17
+ full?: boolean | undefined;
18
18
  slots?: Partial<DocsPageSlots>;
19
19
  footer?: FooterOptions;
20
20
  breadcrumb?: BreadcrumbOptions;
@@ -59,12 +59,12 @@ interface DocsPageSlots {
59
59
  footer: FC<FooterProps>;
60
60
  breadcrumb: FC<BreadcrumbProps>;
61
61
  }
62
- type PageSlotsProps = Pick<DocsPageProps, 'full'>;
63
62
  declare function useDocsPage(): {
64
- props: PageSlotsProps;
63
+ full: NonNullable<DocsPageProps["full"]>;
65
64
  slots: DocsPageSlots;
66
65
  };
67
66
  declare function DocsPage({
67
+ full,
68
68
  tableOfContent: {
69
69
  enabled: tocEnabled,
70
70
  single,
@@ -82,7 +82,6 @@ declare function DocsPage({
82
82
  enabled: footerEnabled,
83
83
  ...footer
84
84
  },
85
- full,
86
85
  toc,
87
86
  slots: defaultSlots,
88
87
  children,
@@ -31,8 +31,7 @@ function useDocsPage() {
31
31
  if (!context) throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/docs/page`).");
32
32
  return context;
33
33
  }
34
- function DocsPage({ tableOfContent: { enabled: tocEnabled, single, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, full = false, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
35
- tocEnabled ??= Boolean(!full && (toc.length > 0 || tocProps.footer || tocProps.header));
34
+ function DocsPage({ full = false, tableOfContent: { enabled: tocEnabled = !full, single, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
36
35
  tocPopoverEnabled ??= Boolean(toc.length > 0 || tocPopoverProps.header || tocPopoverProps.footer);
37
36
  const slots = {
38
37
  breadcrumb: defaultSlots.breadcrumb ?? Breadcrumb,
@@ -46,7 +45,7 @@ function DocsPage({ tableOfContent: { enabled: tocEnabled, single, ...tocProps }
46
45
  };
47
46
  return /* @__PURE__ */ jsx(PageContext, {
48
47
  value: {
49
- props: { full },
48
+ full,
50
49
  slots
51
50
  },
52
51
  children: /* @__PURE__ */ jsxs(slots.toc.provider, {
@@ -4,7 +4,7 @@ import { useDocsPage } from "../index.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/layouts/docs/page/slots/container.tsx
6
6
  function Container(props) {
7
- const { props: { full } } = useDocsPage();
7
+ const { full } = useDocsPage();
8
8
  return /* @__PURE__ */ jsx("article", {
9
9
  id: "nd-page",
10
10
  "data-full": full,
@@ -18,6 +18,10 @@ function TOCProvider(props) {
18
18
  function TOC({ container, header, footer, style = "normal", list }) {
19
19
  const items = useTOCItems();
20
20
  const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
21
+ if (items.length === 0 && !header && !footer) return /* @__PURE__ */ jsx("div", {
22
+ id: "nd-toc-placeholder",
23
+ className: "hidden xl:layout:[--fd-toc-width:268px]"
24
+ });
21
25
  return /* @__PURE__ */ jsxs("div", {
22
26
  id: "nd-toc",
23
27
  ...container,
@@ -14,7 +14,7 @@ interface DocsPageProps extends ComponentProps<'article'> {
14
14
  *
15
15
  * @defaultValue false
16
16
  */
17
- full?: boolean;
17
+ full?: boolean | undefined;
18
18
  slots?: Partial<DocsPageSlots>;
19
19
  footer?: FooterOptions;
20
20
  breadcrumb?: BreadcrumbOptions;
@@ -50,12 +50,12 @@ interface DocsPageSlots {
50
50
  footer: FC<FooterProps>;
51
51
  breadcrumb: FC<BreadcrumbProps>;
52
52
  }
53
- type PageSlotsProps = Pick<DocsPageProps, 'full'>;
54
53
  declare function useDocsPage(): {
55
- props: PageSlotsProps;
54
+ full: NonNullable<DocsPageProps["full"]>;
56
55
  slots: DocsPageSlots;
57
56
  };
58
57
  declare function DocsPage({
58
+ full,
59
59
  tableOfContent: {
60
60
  enabled: tocEnabled,
61
61
  single,
@@ -69,7 +69,6 @@ declare function DocsPage({
69
69
  enabled: footerEnabled,
70
70
  ...footer
71
71
  },
72
- full,
73
72
  toc,
74
73
  slots: defaultSlots,
75
74
  children,
@@ -17,8 +17,7 @@ function useDocsPage() {
17
17
  if (!context) throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/flux/page`).");
18
18
  return context;
19
19
  }
20
- function DocsPage({ tableOfContent: { enabled: tocEnabled, single, ...tocProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, full = false, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
21
- tocEnabled ??= Boolean(toc.length > 0 || tocProps.header || tocProps.footer);
20
+ function DocsPage({ full = false, tableOfContent: { enabled: tocEnabled = !full, single, ...tocProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
22
21
  const slots = {
23
22
  breadcrumb: defaultSlots.breadcrumb ?? Breadcrumb,
24
23
  footer: defaultSlots.footer ?? Footer,
@@ -30,7 +29,7 @@ function DocsPage({ tableOfContent: { enabled: tocEnabled, single, ...tocProps }
30
29
  };
31
30
  return /* @__PURE__ */ jsx(PageContext, {
32
31
  value: {
33
- props: { full },
32
+ full,
34
33
  slots
35
34
  },
36
35
  children: /* @__PURE__ */ jsxs(slots.toc.provider, {
@@ -4,7 +4,7 @@ import { useDocsPage } from "../index.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/layouts/flux/page/slots/container.tsx
6
6
  function Container(props) {
7
- const { props: { full } } = useDocsPage();
7
+ const { full } = useDocsPage();
8
8
  return /* @__PURE__ */ jsx("article", {
9
9
  id: "nd-page",
10
10
  "data-full": full,
@@ -34,6 +34,6 @@ declare function TOC({
34
34
  footer,
35
35
  style,
36
36
  list
37
- }: TOCProps): _$react_jsx_runtime0.JSX.Element;
37
+ }: TOCProps): _$react_jsx_runtime0.JSX.Element | undefined;
38
38
  //#endregion
39
39
  export { TOC, TOCProps, TOCProvider, TOCProviderProps };
@@ -17,6 +17,7 @@ const { TOCProvider } = toc_exports;
17
17
  function TOC({ container, trigger, content, header, footer, style = "normal", list }) {
18
18
  const items = useTOCItems();
19
19
  const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
20
+ if (items.length === 0 && !header && !footer) return;
20
21
  return /* @__PURE__ */ jsxs(PageTOCPopover, {
21
22
  ...container,
22
23
  children: [/* @__PURE__ */ jsxs(PageTOCPopoverContent, {
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
5
5
 
6
6
  //#region src/layouts/home/slots/header.d.ts
7
7
  declare const navItemVariants: (props?: ({
8
- variant?: "icon" | "main" | "button" | null | undefined;
8
+ variant?: "icon" | "button" | "main" | null | undefined;
9
9
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | _$react_jsx_runtime0.JSX.Element | Iterable<_$react.ReactNode> | Promise<string | number | bigint | boolean | _$react.ReactPortal | _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | Iterable<_$react.ReactNode> | null | undefined>;
11
11
  //#endregion
@@ -14,7 +14,7 @@ interface DocsPageProps extends ComponentProps<'article'> {
14
14
  *
15
15
  * @defaultValue false
16
16
  */
17
- full?: boolean;
17
+ full?: boolean | undefined;
18
18
  slots?: Partial<DocsPageSlots>;
19
19
  footer?: FooterOptions;
20
20
  breadcrumb?: BreadcrumbOptions;
@@ -59,12 +59,12 @@ interface DocsPageSlots {
59
59
  footer: FC<FooterProps>;
60
60
  breadcrumb: FC<BreadcrumbProps>;
61
61
  }
62
- type PageSlotsProps = Pick<DocsPageProps, 'full'>;
63
62
  declare function useDocsPage(): {
64
- props: PageSlotsProps;
63
+ full: NonNullable<DocsPageProps["full"]>;
65
64
  slots: DocsPageSlots;
66
65
  };
67
66
  declare function DocsPage({
67
+ full,
68
68
  tableOfContent: {
69
69
  enabled: tocEnabled,
70
70
  single,
@@ -82,7 +82,6 @@ declare function DocsPage({
82
82
  enabled: footerEnabled,
83
83
  ...footer
84
84
  },
85
- full,
86
85
  toc,
87
86
  slots: defaultSlots,
88
87
  children,
@@ -31,8 +31,7 @@ function useDocsPage() {
31
31
  if (!context) throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/notebook/page`).");
32
32
  return context;
33
33
  }
34
- function DocsPage({ tableOfContent: { enabled: tocEnabled, single, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, full = false, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
35
- tocEnabled ??= Boolean(!full && (toc.length > 0 || tocProps.footer || tocProps.header));
34
+ function DocsPage({ full = false, tableOfContent: { enabled: tocEnabled = !full, single, ...tocProps } = {}, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps } = {}, breadcrumb: { enabled: breadcrumbEnabled = true, ...breadcrumb } = {}, footer: { enabled: footerEnabled = true, ...footer } = {}, toc = [], slots: defaultSlots = {}, children, ...containerProps }) {
36
35
  tocPopoverEnabled ??= Boolean(toc.length > 0 || tocPopoverProps.header || tocPopoverProps.footer);
37
36
  const slots = {
38
37
  breadcrumb: defaultSlots.breadcrumb ?? Breadcrumb,
@@ -46,7 +45,7 @@ function DocsPage({ tableOfContent: { enabled: tocEnabled, single, ...tocProps }
46
45
  };
47
46
  return /* @__PURE__ */ jsx(PageContext, {
48
47
  value: {
49
- props: { full },
48
+ full,
50
49
  slots
51
50
  },
52
51
  children: /* @__PURE__ */ jsxs(slots.toc.provider, {
@@ -4,7 +4,7 @@ import { useDocsPage } from "../index.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/layouts/notebook/page/slots/container.tsx
6
6
  function Container(props) {
7
- const { props: { full } } = useDocsPage();
7
+ const { full } = useDocsPage();
8
8
  return /* @__PURE__ */ jsx("article", {
9
9
  id: "nd-page",
10
10
  "data-full": full,
@@ -17,6 +17,10 @@ function TOCProvider(props) {
17
17
  function TOC({ container, header, footer, style = "normal", list }) {
18
18
  const items = useTOCItems();
19
19
  const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
20
+ if (items.length === 0 && !footer && !header) return /* @__PURE__ */ jsx("div", {
21
+ id: "nd-toc-placeholder",
22
+ className: "hidden xl:layout:[--fd-toc-width:268px]"
23
+ });
20
24
  return /* @__PURE__ */ jsxs("div", {
21
25
  id: "nd-toc",
22
26
  ...container,
package/dist/mdx.d.ts CHANGED
@@ -17,9 +17,7 @@ declare module 'mdx/types.js' {
17
17
  type IntrinsicElements = React.JSX.IntrinsicElements;
18
18
  }
19
19
  }
20
- declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
21
- sizes?: string;
22
- }): _$react_jsx_runtime0.JSX.Element;
20
+ declare function Image(props: ImgHTMLAttributes<HTMLImageElement>): _$react_jsx_runtime0.JSX.Element;
23
21
  declare function Table(props: TableHTMLAttributes<HTMLTableElement>): _$react_jsx_runtime0.JSX.Element;
24
22
  declare const defaultMdxComponents: {
25
23
  CodeBlockTab: typeof CodeBlockTab;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.9.0",
3
+ "version": "16.9.2",
4
4
  "description": "The Radix UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -132,12 +132,12 @@
132
132
  "@radix-ui/react-tabs": "^1.1.13",
133
133
  "class-variance-authority": "^0.7.1",
134
134
  "lucide-react": "^1.16.0",
135
- "motion": "^12.38.0",
135
+ "motion": "^12.40.0",
136
136
  "next-themes": "^0.4.6",
137
137
  "react-remove-scroll": "^2.7.2",
138
138
  "rehype-raw": "^7.0.0",
139
139
  "scroll-into-view-if-needed": "^3.1.0",
140
- "shiki": "^4.0.2",
140
+ "shiki": "^4.1.0",
141
141
  "tailwind-merge": "^3.6.0",
142
142
  "unist-util-visit": "^5.1.0",
143
143
  "@fumadocs/tailwind": "0.0.5"
@@ -148,8 +148,8 @@
148
148
  "@tsdown/css": "^0.22.0",
149
149
  "@types/hast": "^3.0.4",
150
150
  "@types/mdx": "^2.0.13",
151
- "@types/node": "^25.8.0",
152
- "@types/react": "^19.2.14",
151
+ "@types/node": "^25.9.1",
152
+ "@types/react": "^19.2.15",
153
153
  "@types/react-dom": "^19.2.3",
154
154
  "fuma-cli": "^0.1.1",
155
155
  "react-medium-image-zoom": "^5.4.5",
@@ -157,7 +157,7 @@
157
157
  "tsdown": "0.22.0",
158
158
  "unified": "^11.0.5",
159
159
  "@fumadocs/cli": "1.3.10",
160
- "fumadocs-core": "16.9.0",
160
+ "fumadocs-core": "16.9.2",
161
161
  "tsconfig": "0.0.0"
162
162
  },
163
163
  "peerDependencies": {
@@ -167,7 +167,7 @@
167
167
  "next": "16.x.x",
168
168
  "react": "^19.2.0",
169
169
  "react-dom": "^19.2.0",
170
- "fumadocs-core": "16.9.0"
170
+ "fumadocs-core": "16.9.2"
171
171
  },
172
172
  "peerDependenciesMeta": {
173
173
  "next": {