@fumadocs/base-ui 16.7.1 → 16.7.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.
Files changed (54) hide show
  1. package/css/generated/docs.css +4 -1
  2. package/css/generated/flux.css +3 -3
  3. package/css/generated/home.css +2 -3
  4. package/css/generated/notebook.css +3 -1
  5. package/dist/components/toc/index.js +10 -1
  6. package/dist/components/ui/button.d.ts +1 -1
  7. package/dist/layouts/docs/client.d.ts +3 -3
  8. package/dist/layouts/docs/client.js +19 -22
  9. package/dist/layouts/docs/index.d.ts +1 -1
  10. package/dist/layouts/docs/page/index.d.ts +91 -3
  11. package/dist/layouts/docs/page/index.js +67 -7
  12. package/dist/layouts/docs/page/slots/breadcrumb.js +1 -0
  13. package/dist/layouts/docs/page/slots/container.js +2 -1
  14. package/dist/layouts/docs/page/slots/footer.js +1 -0
  15. package/dist/layouts/docs/slots/container.js +1 -0
  16. package/dist/layouts/docs/slots/header.js +1 -0
  17. package/dist/layouts/flux/index.d.ts +4 -4
  18. package/dist/layouts/flux/index.js +8 -11
  19. package/dist/layouts/flux/page/index.d.ts +79 -3
  20. package/dist/layouts/flux/page/index.js +61 -7
  21. package/dist/layouts/flux/page/slots/breadcrumb.js +1 -0
  22. package/dist/layouts/flux/page/slots/container.js +2 -1
  23. package/dist/layouts/flux/page/slots/footer.js +1 -0
  24. package/dist/layouts/flux/page/slots/toc.d.ts +4 -1
  25. package/dist/layouts/flux/page/slots/toc.js +3 -2
  26. package/dist/layouts/flux/slots/container.js +1 -0
  27. package/dist/layouts/home/index.d.ts +3 -3
  28. package/dist/layouts/home/index.js +6 -8
  29. package/dist/layouts/home/slots/container.js +1 -0
  30. package/dist/layouts/home/slots/header.d.ts +1 -1
  31. package/dist/layouts/home/slots/header.js +4 -4
  32. package/dist/layouts/notebook/client.d.ts +3 -3
  33. package/dist/layouts/notebook/client.js +14 -17
  34. package/dist/layouts/notebook/index.d.ts +1 -1
  35. package/dist/layouts/notebook/page/index.d.ts +91 -3
  36. package/dist/layouts/notebook/page/index.js +67 -7
  37. package/dist/layouts/notebook/page/slots/breadcrumb.js +1 -0
  38. package/dist/layouts/notebook/page/slots/container.js +2 -1
  39. package/dist/layouts/notebook/page/slots/footer.js +1 -0
  40. package/dist/layouts/notebook/slots/container.js +1 -0
  41. package/dist/layouts/shared/client.d.ts +6 -6
  42. package/dist/layouts/shared/client.js +4 -4
  43. package/dist/layouts/shared/index.d.ts +3 -3
  44. package/dist/layouts/shared/page-actions.d.ts +2 -2
  45. package/dist/layouts/shared/page-actions.js +3 -3
  46. package/dist/page.d.ts +1 -2
  47. package/dist/page.js +1 -2
  48. package/package.json +4 -4
  49. package/dist/layouts/docs/page/client.d.ts +0 -98
  50. package/dist/layouts/docs/page/client.js +0 -110
  51. package/dist/layouts/flux/page/client.d.ts +0 -82
  52. package/dist/layouts/flux/page/client.js +0 -94
  53. package/dist/layouts/notebook/page/client.d.ts +0 -98
  54. package/dist/layouts/notebook/page/client.js +0 -110
@@ -81,6 +81,7 @@
81
81
  @source inline("border-t");
82
82
  @source inline("border-transparent");
83
83
  @source inline("breadcrumb");
84
+ @source inline("breadcrumbEnabled");
84
85
  @source inline("button");
85
86
  @source inline("buttonVariants");
86
87
  @source inline("children");
@@ -97,6 +98,7 @@
97
98
  @source inline("collapsible");
98
99
  @source inline("collapsing");
99
100
  @source inline("color");
101
+ @source inline("component");
100
102
  @source inline("components");
101
103
  @source inline("const");
102
104
  @source inline("container");
@@ -165,6 +167,7 @@
165
167
  @source inline("font-medium");
166
168
  @source inline("font-semibold");
167
169
  @source inline("footer");
170
+ @source inline("footerEnabled");
168
171
  @source inline("footerList");
169
172
  @source inline("for");
170
173
  @source inline("from");
@@ -241,7 +244,6 @@
241
244
  @source inline("layoutTabs");
242
245
  @source inline("leading-none");
243
246
  @source inline("length");
244
- @source inline("let");
245
247
  @source inline("link");
246
248
  @source inline("linkItems");
247
249
  @source inline("lucide-react");
@@ -374,6 +376,7 @@
374
376
  @source inline("showItem");
375
377
  @source inline("shrink-0");
376
378
  @source inline("sidebar");
379
+ @source inline("sidebarEnabled");
377
380
  @source inline("sidebarProps");
378
381
  @source inline("single");
379
382
  @source inline("size");
@@ -53,6 +53,7 @@
53
53
  @source inline("bottom-0");
54
54
  @source inline("bottom-26");
55
55
  @source inline("breadcrumb");
56
+ @source inline("breadcrumbEnabled");
56
57
  @source inline("button");
57
58
  @source inline("buttonVariants");
58
59
  @source inline("children");
@@ -68,6 +69,7 @@
68
69
  @source inline("collapsed");
69
70
  @source inline("collapsible");
70
71
  @source inline("color");
72
+ @source inline("component");
71
73
  @source inline("components");
72
74
  @source inline("const");
73
75
  @source inline("container");
@@ -131,6 +133,7 @@
131
133
  @source inline("font-medium");
132
134
  @source inline("font-semibold");
133
135
  @source inline("footer");
136
+ @source inline("footerEnabled");
134
137
  @source inline("footerList");
135
138
  @source inline("for");
136
139
  @source inline("from");
@@ -201,7 +204,6 @@
201
204
  @source inline("leading-none");
202
205
  @source inline("left-1/2");
203
206
  @source inline("length");
204
- @source inline("let");
205
207
  @source inline("lg:text-sm");
206
208
  @source inline("link");
207
209
  @source inline("linkItems");
@@ -384,7 +386,6 @@
384
386
  @source inline("toc");
385
387
  @source inline("tocEnabled");
386
388
  @source inline("tocProps");
387
- @source inline("tocProvider");
388
389
  @source inline("tool");
389
390
  @source inline("top-0");
390
391
  @source inline("transform");
@@ -417,7 +418,6 @@
417
418
  @source inline("useSearchContext");
418
419
  @source inline("useSidebar");
419
420
  @source inline("useState");
420
- @source inline("useTOCItems");
421
421
  @source inline("useTreePath");
422
422
  @source inline("value");
423
423
  @source inline("variant");
@@ -31,7 +31,6 @@
31
31
  @source inline("component");
32
32
  @source inline("const");
33
33
  @source inline("container");
34
- @source inline("content");
35
34
  @source inline("context");
36
35
  @source inline("createContext");
37
36
  @source inline("custom");
@@ -101,9 +100,9 @@
101
100
  @source inline("justify-end");
102
101
  @source inline("key");
103
102
  @source inline("label");
103
+ @source inline("languageSelect");
104
104
  @source inline("last:me-0");
105
105
  @source inline("length");
106
- @source inline("let");
107
106
  @source inline("lg:grid-cols-3");
108
107
  @source inline("lg:hidden");
109
108
  @source inline("linkItems");
@@ -160,11 +159,11 @@
160
159
  @source inline("rest");
161
160
  @source inline("return");
162
161
  @source inline("role");
163
- @source inline("root");
164
162
  @source inline("rounded-full");
165
163
  @source inline("rounded-lg");
166
164
  @source inline("rounded-md");
167
165
  @source inline("searchToggle");
166
+ @source inline("searchTrigger");
168
167
  @source inline("secondary");
169
168
  @source inline("separator");
170
169
  @source inline("setValue");
@@ -83,6 +83,7 @@
83
83
  @source inline("border-t");
84
84
  @source inline("border-transparent");
85
85
  @source inline("breadcrumb");
86
+ @source inline("breadcrumbEnabled");
86
87
  @source inline("button");
87
88
  @source inline("buttonVariants");
88
89
  @source inline("children");
@@ -100,6 +101,7 @@
100
101
  @source inline("collapsible");
101
102
  @source inline("collapsing");
102
103
  @source inline("color");
104
+ @source inline("component");
103
105
  @source inline("components");
104
106
  @source inline("const");
105
107
  @source inline("container");
@@ -172,6 +174,7 @@
172
174
  @source inline("font-medium");
173
175
  @source inline("font-semibold");
174
176
  @source inline("footer");
177
+ @source inline("footerEnabled");
175
178
  @source inline("footerList");
176
179
  @source inline("for");
177
180
  @source inline("freezeUntil");
@@ -257,7 +260,6 @@
257
260
  @source inline("layout:[--fd-header-height:--spacing(14)]");
258
261
  @source inline("leading-none");
259
262
  @source inline("length");
260
- @source inline("let");
261
263
  @source inline("lg:hidden");
262
264
  @source inline("lg:layout:[--fd-header-height:--spacing(24)]");
263
265
  @source inline("link");
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
3
  import { cn } from "../../utils/cn.js";
3
4
  import { mergeRefs } from "../../utils/merge-refs.js";
4
5
  import { createContext, use, useEffect, useEffectEvent, useRef } from "react";
@@ -6,6 +7,14 @@ import { jsx } from "react/jsx-runtime";
6
7
  import * as Primitive from "fumadocs-core/toc";
7
8
  import { useOnChange } from "fumadocs-core/utils/use-on-change";
8
9
  //#region src/components/toc/index.tsx
10
+ var toc_exports = /* @__PURE__ */ __exportAll({
11
+ TOCProvider: () => TOCProvider,
12
+ TOCScrollArea: () => TOCScrollArea,
13
+ TocThumb: () => TocThumb,
14
+ useActiveAnchor: () => useActiveAnchor,
15
+ useActiveAnchors: () => useActiveAnchors,
16
+ useTOCItems: () => useTOCItems
17
+ });
9
18
  const TOCContext = createContext([]);
10
19
  function useTOCItems() {
11
20
  return use(TOCContext);
@@ -76,4 +85,4 @@ function calc(container, active) {
76
85
  return [upper, lower - upper];
77
86
  }
78
87
  //#endregion
79
- export { TOCProvider, TOCScrollArea, TocThumb, useActiveAnchor, useActiveAnchors, useTOCItems };
88
+ export { TOCProvider, TOCScrollArea, TocThumb, toc_exports, useActiveAnchor, useActiveAnchors, useTOCItems };
@@ -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
@@ -5,8 +5,9 @@ import { DocsLayoutProps } from "./index.js";
5
5
  import { ComponentProps, FC } from "react";
6
6
  //#region src/layouts/docs/client.d.ts
7
7
  interface DocsSlots extends BaseSlots {
8
- container?: FC<ComponentProps<'div'>>;
9
- sidebar?: {
8
+ container: FC<ComponentProps<'div'>>;
9
+ header: FC<ComponentProps<'header'>>;
10
+ sidebar: {
10
11
  provider: FC<SidebarProviderProps>;
11
12
  root: FC<SidebarProps>;
12
13
  trigger: FC<ComponentProps<'button'>>;
@@ -16,7 +17,6 @@ interface DocsSlots extends BaseSlots {
16
17
  setOpen: (v: boolean) => void;
17
18
  };
18
19
  };
19
- header?: FC<ComponentProps<'header'>>;
20
20
  }
21
21
  interface SlotsProps extends BaseSlotsProps<DocsLayoutProps> {
22
22
  tabs: LayoutTab[];
@@ -9,7 +9,7 @@ import { Header } from "./slots/header.js";
9
9
  import { Container } from "./slots/container.js";
10
10
  import { createContext, use, useMemo } from "react";
11
11
  import { usePathname } from "fumadocs-core/framework";
12
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import Link from "fumadocs-core/link";
14
14
  //#region src/layouts/docs/client.tsx
15
15
  const { useProvider } = baseSlots({ useProps() {
@@ -25,14 +25,14 @@ function useDocsLayout() {
25
25
  return context;
26
26
  }
27
27
  function LayoutBody(props) {
28
- const { nav: { enabled: navEnabled = true, transparentMode: navTransparentMode = "none" } = {}, sidebar: { defaultOpenLevel, prefetch, ...sidebarProps } = {}, slots: defaultSlots, tabs, tabMode = "auto", tree, containerProps, children } = props;
28
+ const { nav: { enabled: navEnabled = true, transparentMode: navTransparentMode = "none" } = {}, sidebar: { enabled: sidebarEnabled = true, defaultOpenLevel, prefetch, ...sidebarProps } = {}, slots: defaultSlots, tabs, tabMode = "auto", tree, containerProps, children } = props;
29
29
  const isTop = useIsScrollTop({ enabled: navTransparentMode === "top" }) ?? true;
30
30
  const isNavTransparent = navTransparentMode === "top" ? isTop : navTransparentMode === "always";
31
31
  const { baseSlots, baseProps } = useProvider(props);
32
32
  const linkItems = useLinkItems(props);
33
33
  const slots = {
34
34
  ...baseSlots,
35
- header: navEnabled ? defaultSlots?.header ?? Header : void 0,
35
+ header: defaultSlots?.header ?? Header,
36
36
  container: defaultSlots?.container ?? Container,
37
37
  sidebar: defaultSlots?.sidebar ?? {
38
38
  provider: SidebarProvider,
@@ -41,24 +41,6 @@ function LayoutBody(props) {
41
41
  useSidebar
42
42
  }
43
43
  };
44
- let content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
45
- slots.header && /* @__PURE__ */ jsx(slots.header, {}),
46
- slots.sidebar && /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }),
47
- tabMode === "top" && tabs.length > 0 && /* @__PURE__ */ jsx(LayoutTabs, {
48
- tabs,
49
- className: "z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"
50
- }),
51
- children
52
- ] });
53
- if (slots.container) content = /* @__PURE__ */ jsx(slots.container, {
54
- ...containerProps,
55
- children: content
56
- });
57
- if (slots.sidebar) content = /* @__PURE__ */ jsx(slots.sidebar.provider, {
58
- defaultOpenLevel,
59
- prefetch,
60
- children: content
61
- });
62
44
  return /* @__PURE__ */ jsx(TreeContextProvider, {
63
45
  tree,
64
46
  children: /* @__PURE__ */ jsx(LayoutContext, {
@@ -72,7 +54,22 @@ function LayoutBody(props) {
72
54
  slots,
73
55
  ...linkItems
74
56
  },
75
- children: content
57
+ children: /* @__PURE__ */ jsx(slots.sidebar.provider, {
58
+ defaultOpenLevel,
59
+ prefetch,
60
+ children: /* @__PURE__ */ jsxs(slots.container, {
61
+ ...containerProps,
62
+ children: [
63
+ navEnabled && /* @__PURE__ */ jsx(slots.header, {}),
64
+ sidebarEnabled && /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }),
65
+ tabMode === "top" && tabs.length > 0 && /* @__PURE__ */ jsx(LayoutTabs, {
66
+ tabs,
67
+ className: "z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"
68
+ }),
69
+ children
70
+ ]
71
+ })
72
+ })
76
73
  })
77
74
  });
78
75
  }
@@ -12,7 +12,7 @@ interface DocsLayoutProps extends BaseLayoutProps {
12
12
  tabMode?: 'top' | 'auto';
13
13
  tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
14
14
  containerProps?: HTMLAttributes<HTMLDivElement>;
15
- slots?: DocsSlots;
15
+ slots?: Partial<DocsSlots>;
16
16
  }
17
17
  interface SidebarOptions extends SidebarProps, SidebarProviderProps {
18
18
  enabled?: boolean;
@@ -1,11 +1,93 @@
1
+ import { TOCPopoverProps, TOCProps, TOCProviderProps } from "./slots/toc.js";
1
2
  import { Footer, FooterProps } from "./slots/footer.js";
2
3
  import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
3
- import { DocsPage, DocsPageProps, DocsPageSlots, PageLastUpdate, useDocsPage } from "./client.js";
4
4
  import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
5
- import { ComponentProps } from "react";
5
+ import { ComponentProps, FC, ReactNode } from "react";
6
6
  import * as react_jsx_runtime0 from "react/jsx-runtime";
7
+ import { TOCItemType } from "fumadocs-core/toc";
7
8
 
8
9
  //#region src/layouts/docs/page/index.d.ts
10
+ interface DocsPageProps extends ComponentProps<'article'> {
11
+ toc?: TOCItemType[];
12
+ /**
13
+ * Extend the page to fill all available space
14
+ *
15
+ * @defaultValue false
16
+ */
17
+ full?: boolean;
18
+ slots?: Partial<DocsPageSlots>;
19
+ footer?: FooterOptions;
20
+ breadcrumb?: BreadcrumbOptions;
21
+ tableOfContent?: TableOfContentOptions;
22
+ tableOfContentPopover?: TableOfContentPopoverOptions;
23
+ }
24
+ interface BreadcrumbOptions extends BreadcrumbProps {
25
+ enabled?: boolean;
26
+ /**
27
+ * @deprecated use `slots.breadcrumb` instead.
28
+ */
29
+ component?: ReactNode;
30
+ }
31
+ interface FooterOptions extends FooterProps {
32
+ enabled?: boolean;
33
+ /**
34
+ * @deprecated use `slots.footer` instead.
35
+ */
36
+ component?: ReactNode;
37
+ }
38
+ interface TableOfContentOptions extends Pick<TOCProviderProps, 'single'>, TOCProps {
39
+ enabled?: boolean;
40
+ /**
41
+ * @deprecated use `slots.toc` instead.
42
+ */
43
+ component?: ReactNode;
44
+ }
45
+ interface TableOfContentPopoverOptions extends TOCPopoverProps {
46
+ enabled?: boolean;
47
+ /**
48
+ * @deprecated use `slots.tocPopover` instead.
49
+ */
50
+ component?: ReactNode;
51
+ }
52
+ interface DocsPageSlots {
53
+ toc: {
54
+ provider: FC<TOCProviderProps>;
55
+ main: FC<TOCProps>;
56
+ popover: FC<TOCPopoverProps>;
57
+ };
58
+ container: FC<ComponentProps<'article'>>;
59
+ footer: FC<FooterProps>;
60
+ breadcrumb: FC<BreadcrumbProps>;
61
+ }
62
+ type PageSlotsProps = Pick<DocsPageProps, 'full'>;
63
+ declare function useDocsPage(): {
64
+ props: PageSlotsProps;
65
+ slots: DocsPageSlots;
66
+ };
67
+ declare function DocsPage({
68
+ tableOfContent: {
69
+ enabled: tocEnabled,
70
+ single,
71
+ ...tocProps
72
+ },
73
+ tableOfContentPopover: {
74
+ enabled: tocPopoverEnabled,
75
+ ...tocPopoverProps
76
+ },
77
+ breadcrumb: {
78
+ enabled: breadcrumbEnabled,
79
+ ...breadcrumb
80
+ },
81
+ footer: {
82
+ enabled: footerEnabled,
83
+ ...footer
84
+ },
85
+ full,
86
+ toc,
87
+ slots: defaultSlots,
88
+ children,
89
+ ...containerProps
90
+ }: DocsPageProps): react_jsx_runtime0.JSX.Element;
9
91
  declare function EditOnGitHub(props: ComponentProps<'a'>): react_jsx_runtime0.JSX.Element;
10
92
  /**
11
93
  * Add typography styles
@@ -25,5 +107,11 @@ declare function DocsTitle({
25
107
  className,
26
108
  ...props
27
109
  }: ComponentProps<'h1'>): react_jsx_runtime0.JSX.Element;
110
+ declare function PageLastUpdate({
111
+ date: value,
112
+ ...props
113
+ }: Omit<ComponentProps<'p'>, 'children'> & {
114
+ date: Date;
115
+ }): react_jsx_runtime0.JSX.Element;
28
116
  //#endregion
29
- export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, type DocsPageProps, type DocsPageSlots, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
117
+ export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
@@ -1,12 +1,15 @@
1
+ "use client";
1
2
  import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
2
- import { I18nLabel } from "../../../contexts/i18n.js";
3
+ import { I18nLabel, useI18n } from "../../../contexts/i18n.js";
3
4
  import { cn } from "../../../utils/cn.js";
4
5
  import { buttonVariants } from "../../../components/ui/button.js";
6
+ import { TOC, TOCPopover, TOCProvider } from "./slots/toc.js";
5
7
  import { Footer } from "./slots/footer.js";
6
8
  import { Breadcrumb } from "./slots/breadcrumb.js";
7
- import { DocsPage, PageLastUpdate, useDocsPage } from "./client.js";
9
+ import { Container } from "./slots/container.js";
8
10
  import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { createContext, use, useEffect, useState } from "react";
12
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
13
  import { Edit } from "lucide-react";
11
14
  //#region src/layouts/docs/page/index.tsx
12
15
  var page_exports = /* @__PURE__ */ __exportAll({
@@ -22,6 +25,48 @@ var page_exports = /* @__PURE__ */ __exportAll({
22
25
  ViewOptionsPopover: () => ViewOptionsPopover,
23
26
  useDocsPage: () => useDocsPage
24
27
  });
28
+ const PageContext = createContext(null);
29
+ function useDocsPage() {
30
+ const context = use(PageContext);
31
+ if (!context) throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/docs/page`).");
32
+ return context;
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));
36
+ tocPopoverEnabled ??= Boolean(toc.length > 0 || tocPopoverProps.header || tocPopoverProps.footer);
37
+ const slots = {
38
+ breadcrumb: defaultSlots.breadcrumb ?? Breadcrumb,
39
+ footer: defaultSlots.footer ?? Footer,
40
+ toc: defaultSlots.toc ?? {
41
+ provider: TOCProvider,
42
+ main: TOC,
43
+ popover: TOCPopover
44
+ },
45
+ container: defaultSlots.container ?? Container
46
+ };
47
+ return /* @__PURE__ */ jsx(PageContext, {
48
+ value: {
49
+ props: { full },
50
+ slots
51
+ },
52
+ children: /* @__PURE__ */ jsxs(slots.toc.provider, {
53
+ single,
54
+ toc: tocEnabled || tocPopoverEnabled ? toc : [],
55
+ children: [
56
+ tocPopoverEnabled && (tocPopoverProps.component ?? /* @__PURE__ */ jsx(slots.toc.popover, { ...tocPopoverProps })),
57
+ /* @__PURE__ */ jsxs(slots.container, {
58
+ ...containerProps,
59
+ children: [
60
+ breadcrumbEnabled && (breadcrumb.component ?? /* @__PURE__ */ jsx(slots.breadcrumb, { ...breadcrumb })),
61
+ children,
62
+ footerEnabled && (footer.component ?? /* @__PURE__ */ jsx(slots.footer, { ...footer }))
63
+ ]
64
+ }),
65
+ tocEnabled && (tocProps.component ?? /* @__PURE__ */ jsx(slots.toc.main, { ...tocProps }))
66
+ ]
67
+ })
68
+ });
69
+ }
25
70
  function EditOnGitHub(props) {
26
71
  return /* @__PURE__ */ jsx("a", {
27
72
  target: "_blank",
@@ -29,10 +74,9 @@ function EditOnGitHub(props) {
29
74
  ...props,
30
75
  className: cn(buttonVariants({
31
76
  color: "secondary",
32
- size: "sm",
33
- className: "gap-1.5 not-prose"
34
- }), props.className),
35
- children: props.children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Edit, { className: "size-3.5" }), /* @__PURE__ */ jsx(I18nLabel, { label: "editOnGithub" })] })
77
+ size: "sm"
78
+ }), "gap-1.5 not-prose", props.className),
79
+ children: props.children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Edit, { className: "size-3.5" }), /* @__PURE__ */ jsx(I18nLabel, { label: "editOnGithub" })] })
36
80
  });
37
81
  }
38
82
  /**
@@ -60,5 +104,21 @@ function DocsTitle({ children, className, ...props }) {
60
104
  children
61
105
  });
62
106
  }
107
+ function PageLastUpdate({ date: value, ...props }) {
108
+ const { text } = useI18n();
109
+ const [date, setDate] = useState("");
110
+ useEffect(() => {
111
+ setDate(value.toLocaleDateString());
112
+ }, [value]);
113
+ return /* @__PURE__ */ jsxs("p", {
114
+ ...props,
115
+ className: cn("text-sm text-fd-muted-foreground", props.className),
116
+ children: [
117
+ text.lastUpdate,
118
+ " ",
119
+ date
120
+ ]
121
+ });
122
+ }
63
123
  //#endregion
64
124
  export { DocsBody, DocsDescription, DocsPage, DocsTitle, EditOnGitHub, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, page_exports, useDocsPage };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cn } from "../../../../utils/cn.js";
2
3
  import { useTreeContext, useTreePath } from "../../../../contexts/tree.js";
3
4
  import { Fragment, useMemo } from "react";
@@ -1,5 +1,6 @@
1
+ "use client";
1
2
  import { cn } from "../../../../utils/cn.js";
2
- import { useDocsPage } from "../client.js";
3
+ import { useDocsPage } from "../index.js";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  //#region src/layouts/docs/page/slots/container.tsx
5
6
  function Container(props) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useI18n } from "../../../../contexts/i18n.js";
2
3
  import { cn } from "../../../../utils/cn.js";
3
4
  import { isActive } from "../../../../utils/urls.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cn } from "../../../utils/cn.js";
2
3
  import { useDocsLayout } from "../client.js";
3
4
  import "../index.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { cn } from "../../../utils/cn.js";
2
3
  import { buttonVariants } from "../../../components/ui/button.js";
3
4
  import { useDocsLayout } from "../client.js";
@@ -9,9 +9,9 @@ import { motion } from "motion/react";
9
9
 
10
10
  //#region src/layouts/flux/index.d.ts
11
11
  interface DocsSlots extends BaseSlots {
12
- container?: FC<ComponentProps<'div'>>;
13
- tabDropdown?: FC<TabDropdownProps>;
14
- sidebar?: {
12
+ container: FC<ComponentProps<'div'>>;
13
+ tabDropdown: FC<TabDropdownProps>;
14
+ sidebar: {
15
15
  provider: FC<SidebarProviderProps>;
16
16
  trigger: FC<ComponentProps<'button'>>;
17
17
  root: FC<SidebarProps>;
@@ -26,7 +26,7 @@ interface DocsLayoutProps extends BaseLayoutProps {
26
26
  tree: PageTree.Root;
27
27
  sidebar?: SidebarOptions;
28
28
  tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
29
- slots?: DocsSlots;
29
+ slots?: Partial<DocsSlots>;
30
30
  renderNavigationPanel?: (props: NavigationPanelProps) => ReactNode;
31
31
  containerProps?: ComponentProps<'div'>;
32
32
  }
@@ -44,16 +44,6 @@ function DocsLayout(props) {
44
44
  useSidebar
45
45
  }
46
46
  };
47
- let content = /* @__PURE__ */ jsxs(Fragment$1, { children: [sidebarEnabled && slots.sidebar && /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }), children] });
48
- if (slots.container) content = /* @__PURE__ */ jsx(slots.container, {
49
- ...containerProps,
50
- children: content
51
- });
52
- if (slots.sidebar) content = /* @__PURE__ */ jsx(slots.sidebar.provider, {
53
- defaultOpenLevel,
54
- prefetch,
55
- children: content
56
- });
57
47
  return /* @__PURE__ */ jsx(LayoutContext, {
58
48
  value: {
59
49
  props: baseProps,
@@ -62,7 +52,14 @@ function DocsLayout(props) {
62
52
  },
63
53
  children: /* @__PURE__ */ jsxs(TreeContextProvider, {
64
54
  tree,
65
- children: [content, renderNavigationPanel({
55
+ children: [/* @__PURE__ */ jsx(slots.sidebar.provider, {
56
+ defaultOpenLevel,
57
+ prefetch,
58
+ children: /* @__PURE__ */ jsxs(slots.container, {
59
+ ...containerProps,
60
+ children: [sidebarEnabled && /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }), children]
61
+ })
62
+ }), renderNavigationPanel({
66
63
  head: /* @__PURE__ */ jsxs(Fragment$1, { children: [slots.navTitle && /* @__PURE__ */ jsx(slots.navTitle, { className: "inline-flex items-center gap-2.5 text-sm font-semibold" }), nav.children] }),
67
64
  tabDropdown: slots.tabDropdown && tabs.length > 0 && /* @__PURE__ */ jsx(slots.tabDropdown, {
68
65
  className: "flex-1",