@fumadocs/base-ui 16.9.1 → 16.9.3

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");
@@ -144,6 +145,7 @@
144
145
  @source inline("nd-page");
145
146
  @source inline("nd-subnav");
146
147
  @source inline("nd-toc");
148
+ @source inline("nd-toc-placeholder");
147
149
  @source inline("no");
148
150
  @source inline("normalizedValue");
149
151
  @source inline("onClickItem");
@@ -1,4 +1,5 @@
1
1
  @source inline("!enabled");
2
+ @source inline("!header");
2
3
  @source inline("*:rounded-lg");
3
4
  @source inline("---spacing");
4
5
  @source inline("--removed-body-scroll-bar-size");
@@ -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");
@@ -169,6 +170,7 @@
169
170
  @source inline("nd-page");
170
171
  @source inline("nd-subnav");
171
172
  @source inline("nd-toc");
173
+ @source inline("nd-toc-placeholder");
172
174
  @source inline("no");
173
175
  @source inline("normalizedValue");
174
176
  @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/flux.css';
8
7
  @import './generated/docs.css';
9
8
  @import './generated/home.css';
@@ -182,14 +182,14 @@ function ThumbTrack({ computed, thumbBox }) {
182
182
  }
183
183
  const a = 8;
184
184
  function getItemOffset(depth) {
185
- if (depth <= 2) return 12 + a;
186
- if (depth === 3) return 24 + a;
187
- return 36 + a;
185
+ if (depth <= 2) return 20;
186
+ if (depth === 3) return 32;
187
+ return 44;
188
188
  }
189
189
  function getLineOffset(depth) {
190
190
  if (depth <= 2) return a;
191
- if (depth === 3) return 8 + a;
192
- return 16 + a;
191
+ if (depth === 3) return 16;
192
+ return 24;
193
193
  }
194
194
  function TOCItem({ item, ...props }) {
195
195
  const items = useTOCItems();
@@ -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, {
@@ -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/base-ui",
3
- "version": "16.9.1",
3
+ "version": "16.9.3",
4
4
  "description": "The Base UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Docs",
@@ -116,15 +116,15 @@
116
116
  "access": "public"
117
117
  },
118
118
  "dependencies": {
119
- "@base-ui/react": "^1.4.1",
119
+ "@base-ui/react": "^1.5.0",
120
120
  "class-variance-authority": "^0.7.1",
121
- "lucide-react": "^1.16.0",
122
- "motion": "^12.38.0",
121
+ "lucide-react": "^1.17.0",
122
+ "motion": "^12.40.0",
123
123
  "next-themes": "^0.4.6",
124
124
  "react-remove-scroll": "^2.7.2",
125
125
  "rehype-raw": "^7.0.0",
126
126
  "scroll-into-view-if-needed": "^3.1.0",
127
- "shiki": "^4.0.2",
127
+ "shiki": "^4.1.0",
128
128
  "tailwind-merge": "^3.6.0",
129
129
  "unist-util-visit": "^5.1.0",
130
130
  "@fumadocs/tailwind": "0.0.5"
@@ -135,17 +135,17 @@
135
135
  "@tsdown/css": "^0.22.0",
136
136
  "@types/hast": "^3.0.4",
137
137
  "@types/mdx": "^2.0.13",
138
- "@types/node": "^25.8.0",
139
- "@types/react": "^19.2.14",
138
+ "@types/node": "^25.9.1",
139
+ "@types/react": "^19.2.15",
140
140
  "@types/react-dom": "^19.2.3",
141
141
  "fuma-cli": "^0.1.1",
142
142
  "react-medium-image-zoom": "^5.4.5",
143
143
  "tailwindcss": "^4.3.0",
144
144
  "tsdown": "0.22.0",
145
145
  "unified": "^11.0.5",
146
- "fumadocs-core": "16.9.1",
147
- "tsconfig": "0.0.0",
148
- "@fumadocs/cli": "1.3.10"
146
+ "@fumadocs/cli": "1.3.10",
147
+ "fumadocs-core": "16.9.3",
148
+ "tsconfig": "0.0.0"
149
149
  },
150
150
  "peerDependencies": {
151
151
  "@takumi-rs/image-response": "*",
@@ -154,7 +154,7 @@
154
154
  "next": "16.x.x",
155
155
  "react": "^19.2.0",
156
156
  "react-dom": "^19.2.0",
157
- "fumadocs-core": "16.9.1"
157
+ "fumadocs-core": "16.9.3"
158
158
  },
159
159
  "peerDependenciesMeta": {
160
160
  "next": {