fumadocs-ui 11.1.2 → 11.2.0

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.
@@ -14,12 +14,12 @@ import {
14
14
  } from "./chunk-TK3TM3MR.js";
15
15
 
16
16
  // src/components/codeblock.tsx
17
- import { CheckIcon, CopyIcon } from "lucide-react";
17
+ import { Check, Copy } from "lucide-react";
18
18
  import { forwardRef, useCallback, useRef } from "react";
19
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
20
  var Pre = forwardRef(
21
21
  ({ className, ...props }, ref) => {
22
- return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("nd-codeblock py-4", className), ...props, children: props.children });
22
+ return /* @__PURE__ */ jsx("pre", { ref, className: twMerge("nd-codeblock p-4", className), ...props, children: props.children });
23
23
  }
24
24
  );
25
25
  Pre.displayName = "Pre";
@@ -90,13 +90,13 @@ function CopyButton({
90
90
  ...props,
91
91
  children: [
92
92
  /* @__PURE__ */ jsx(
93
- CheckIcon,
93
+ Check,
94
94
  {
95
95
  className: twMerge("size-3.5 transition-transform", !checked && "scale-0")
96
96
  }
97
97
  ),
98
98
  /* @__PURE__ */ jsx(
99
- CopyIcon,
99
+ Copy,
100
100
  {
101
101
  className: twMerge(
102
102
  "absolute size-3.5 transition-transform",
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-2KA2UOM3.js";
4
4
  import {
5
5
  useI18n
6
- } from "./chunk-YAHHY62W.js";
6
+ } from "./chunk-PW7TBOIJ.js";
7
7
  import {
8
8
  buttonVariants
9
9
  } from "./chunk-7GZKFBAP.js";
@@ -0,0 +1,21 @@
1
+ // src/contexts/i18n.tsx
2
+ import { createContext, useContext } from "react";
3
+ var I18nContext = createContext({
4
+ text: {
5
+ search: "Search",
6
+ searchNoResult: "No results found",
7
+ toc: "On this page",
8
+ lastUpdate: "Last updated on",
9
+ chooseLanguage: "Choose a language",
10
+ nextPage: "Next",
11
+ previousPage: "Previous"
12
+ }
13
+ });
14
+ function useI18n() {
15
+ return useContext(I18nContext);
16
+ }
17
+
18
+ export {
19
+ I18nContext,
20
+ useI18n
21
+ };
@@ -12,7 +12,7 @@ import "../chunk-6C3VEZWH.js";
12
12
 
13
13
  // src/components/accordion.tsx
14
14
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
15
- import { CheckIcon, ChevronRightIcon, LinkIcon } from "lucide-react";
15
+ import { Check, ChevronRight, LinkIcon } from "lucide-react";
16
16
  import {
17
17
  forwardRef,
18
18
  useState,
@@ -66,7 +66,7 @@ var Accordion = forwardRef(({ title, className, id, children, ...props }, ref) =
66
66
  className: "not-prose flex flex-row items-center font-medium text-foreground",
67
67
  children: [
68
68
  /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, { className: "flex flex-1 items-center gap-2 p-4 text-start focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
69
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-4 text-muted-foreground transition-transform duration-200 group-data-[state=open]/accordion:rotate-90" }),
69
+ /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 text-muted-foreground transition-transform duration-200 group-data-[state=open]/accordion:rotate-90" }),
70
70
  title
71
71
  ] }),
72
72
  id ? /* @__PURE__ */ jsx(CopyButton, { id }) : null
@@ -96,7 +96,7 @@ function CopyButton({ id }) {
96
96
  })
97
97
  ),
98
98
  onClick,
99
- children: checked ? /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx(LinkIcon, { className: "size-3.5" })
99
+ children: checked ? /* @__PURE__ */ jsx(Check, { className: "size-3.5" }) : /* @__PURE__ */ jsx(LinkIcon, { className: "size-3.5" })
100
100
  }
101
101
  );
102
102
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { HTMLAttributes, ReactNode } from 'react';
3
3
 
4
- declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
4
+ declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
5
5
  title?: ReactNode;
6
6
  /**
7
7
  * @defaultValue info
@@ -4,7 +4,7 @@ import {
4
4
  import "../chunk-6C3VEZWH.js";
5
5
 
6
6
  // src/components/callout.tsx
7
- import { AlertOctagonIcon, AlertTriangleIcon, InfoIcon } from "lucide-react";
7
+ import { AlertOctagon, AlertTriangle, Info } from "lucide-react";
8
8
  import { forwardRef } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var Callout = forwardRef(
@@ -20,9 +20,9 @@ var Callout = forwardRef(
20
20
  ...props,
21
21
  children: [
22
22
  icon ?? {
23
- info: /* @__PURE__ */ jsx(InfoIcon, { className: "size-5 fill-blue-500 text-card" }),
24
- warn: /* @__PURE__ */ jsx(AlertTriangleIcon, { className: "size-5 fill-orange-500 text-card" }),
25
- error: /* @__PURE__ */ jsx(AlertOctagonIcon, { className: "size-5 fill-red-500 text-card" })
23
+ info: /* @__PURE__ */ jsx(Info, { className: "size-5 fill-blue-500 text-card" }),
24
+ warn: /* @__PURE__ */ jsx(AlertTriangle, { className: "size-5 fill-orange-500 text-card" }),
25
+ error: /* @__PURE__ */ jsx(AlertOctagon, { className: "size-5 fill-red-500 text-card" })
26
26
  }[type],
27
27
  /* @__PURE__ */ jsxs("div", { className: "w-0 flex-1", children: [
28
28
  title ? /* @__PURE__ */ jsx("div", { className: "mb-2 font-medium text-card-foreground", children: title }) : null,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CodeBlock,
4
4
  Pre
5
- } from "../chunk-RPQDC26K.js";
5
+ } from "../chunk-E2VA3Y4S.js";
6
6
  import "../chunk-VYTHQTZE.js";
7
7
  import "../chunk-24NYFO7H.js";
8
8
  import "../chunk-7GZKFBAP.js";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  SearchDialog
4
- } from "../../chunk-XP3DGFDZ.js";
4
+ } from "../../chunk-HUXFUKD2.js";
5
5
  import "../../chunk-2KA2UOM3.js";
6
- import "../../chunk-YAHHY62W.js";
6
+ import "../../chunk-PW7TBOIJ.js";
7
7
  import "../../chunk-7GZKFBAP.js";
8
8
  import "../../chunk-TK3TM3MR.js";
9
9
  import "../../chunk-6C3VEZWH.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  SearchDialog
4
- } from "../../chunk-XP3DGFDZ.js";
4
+ } from "../../chunk-HUXFUKD2.js";
5
5
  import "../../chunk-2KA2UOM3.js";
6
6
  import {
7
7
  useI18n
8
- } from "../../chunk-YAHHY62W.js";
8
+ } from "../../chunk-PW7TBOIJ.js";
9
9
  import "../../chunk-7GZKFBAP.js";
10
10
  import "../../chunk-TK3TM3MR.js";
11
11
  import "../../chunk-6C3VEZWH.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  SearchDialog
3
- } from "../../chunk-XP3DGFDZ.js";
3
+ } from "../../chunk-HUXFUKD2.js";
4
4
  import "../../chunk-2KA2UOM3.js";
5
- import "../../chunk-YAHHY62W.js";
5
+ import "../../chunk-PW7TBOIJ.js";
6
6
  import "../../chunk-7GZKFBAP.js";
7
7
  import "../../chunk-TK3TM3MR.js";
8
8
  import "../../chunk-6C3VEZWH.js";
@@ -11,7 +11,7 @@ import "../chunk-6C3VEZWH.js";
11
11
 
12
12
  // src/components/files.tsx
13
13
  import { cva } from "class-variance-authority";
14
- import { FileIcon, FolderIcon, FolderOpenIcon } from "lucide-react";
14
+ import { FileIcon, FolderIcon, FolderOpen } from "lucide-react";
15
15
  import { useState } from "react";
16
16
  import { jsx, jsxs } from "react/jsx-runtime";
17
17
  var item = cva(
@@ -49,7 +49,7 @@ function Folder({
49
49
  const [open, setOpen] = useState(defaultOpen);
50
50
  return /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, ...props, children: [
51
51
  /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: twMerge(item({ className: "w-full" })), children: [
52
- open ? /* @__PURE__ */ jsx(FolderOpenIcon, {}) : /* @__PURE__ */ jsx(FolderIcon, {}),
52
+ open ? /* @__PURE__ */ jsx(FolderOpen, {}) : /* @__PURE__ */ jsx(FolderIcon, {}),
53
53
  name
54
54
  ] }),
55
55
  /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: "ml-2 flex flex-col border-l pl-2", children: props.children }) })
@@ -8,7 +8,7 @@ import {
8
8
  import "../chunk-6C3VEZWH.js";
9
9
 
10
10
  // src/components/roll-button.tsx
11
- import { ChevronUpIcon } from "lucide-react";
11
+ import { ChevronUp } from "lucide-react";
12
12
  import { useEffect, useState } from "react";
13
13
  import { jsx } from "react/jsx-runtime";
14
14
  function RollButton({
@@ -47,7 +47,7 @@ function RollButton({
47
47
  behavior: "smooth"
48
48
  });
49
49
  },
50
- children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
50
+ children: /* @__PURE__ */ jsx(ChevronUp, {})
51
51
  }
52
52
  );
53
53
  }
@@ -4,6 +4,8 @@ interface Translations {
4
4
  toc: string;
5
5
  lastUpdate: string;
6
6
  chooseLanguage: string;
7
+ nextPage: string;
8
+ previousPage: string;
7
9
  }
8
10
  interface NamedTranslation extends Partial<Translations> {
9
11
  /**
package/dist/i18n.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { SelectProps } from '@radix-ui/react-select';
2
2
  import { ReactNode } from 'react';
3
- import { N as NamedTranslation } from './i18n-dw7ODAws.js';
4
- export { T as Translations } from './i18n-dw7ODAws.js';
3
+ import { N as NamedTranslation } from './i18n-p5QWhj_3.js';
4
+ export { T as Translations } from './i18n-p5QWhj_3.js';
5
5
 
6
6
  type LanguageSelectProps = Omit<SelectProps, 'value' | 'onValueChange'>;
7
7
  declare function LanguageSelect({ ...props }: LanguageSelectProps): React.ReactElement;
package/dist/i18n.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  I18nContext,
4
4
  useI18n
5
- } from "./chunk-YAHHY62W.js";
5
+ } from "./chunk-PW7TBOIJ.js";
6
6
  import {
7
7
  twMerge
8
8
  } from "./chunk-TK3TM3MR.js";
@@ -24,7 +24,7 @@ var SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) =>
24
24
  {
25
25
  ref,
26
26
  className: twMerge(
27
- "flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground",
27
+ "flex h-10 w-full items-center justify-between rounded-lg border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-muted-foreground",
28
28
  className
29
29
  ),
30
30
  ...props,
@@ -41,7 +41,6 @@ var SelectContent = React.forwardRef(({ className, children, position = "popper"
41
41
  ref,
42
42
  className: twMerge(
43
43
  "relative z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-popover-out data-[state=open]:animate-popover-in",
44
- position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
45
44
  className
46
45
  ),
47
46
  position,
@@ -1,5 +1,4 @@
1
1
  import { PageTree } from 'fumadocs-core/server';
2
- import * as React$1 from 'react';
3
2
  import { ReactNode, HTMLAttributes } from 'react';
4
3
 
5
4
  interface NavProps {
@@ -35,24 +34,25 @@ interface SidebarProps {
35
34
  * @defaultValue 1
36
35
  */
37
36
  defaultOpenLevel?: number;
38
- collapsible?: boolean;
39
37
  components?: Partial<Components>;
40
- banner?: React$1.ReactNode;
41
- footer?: React$1.ReactNode;
38
+ banner?: React.ReactNode;
39
+ footer?: React.ReactNode;
42
40
  }
43
41
  interface Components {
44
- Item: React$1.FC<{
42
+ Item: React.FC<{
45
43
  item: PageTree.Item;
46
44
  }>;
47
- Folder: React$1.FC<{
45
+ Folder: React.FC<{
48
46
  item: PageTree.Folder;
49
47
  level: number;
50
48
  }>;
51
- Separator: React$1.FC<{
49
+ Separator: React.FC<{
52
50
  item: PageTree.Separator;
53
51
  }>;
54
52
  }
55
- declare function Sidebar({ footer, components, defaultOpenLevel, collapsible, banner, items, }: SidebarProps): React$1.ReactElement;
53
+ declare function Sidebar({ footer, components, defaultOpenLevel, banner, items, ...props }: SidebarProps & {
54
+ className?: string;
55
+ }): React.ReactElement;
56
56
 
57
57
  type ActiveType = 'none' | 'url' | 'nested-url';
58
58
  type LinkItemType = {
@@ -114,4 +114,4 @@ interface DocsLayoutProps extends BaseLayoutProps {
114
114
  declare function Layout({ nav, links, children, }: BaseLayoutProps): React.ReactElement;
115
115
  declare function DocsLayout({ nav, sidebar, links, containerProps, tree, children, }: DocsLayoutProps): React.ReactElement;
116
116
 
117
- export { type BaseLayoutProps as B, type DocsLayoutProps as D, type LinkItemType as L, Nav as N, Sidebar as S, Layout as a, DocsLayout as b };
117
+ export { type BaseLayoutProps as B, type DocsLayoutProps as D, type LinkItemType as L, Nav as N, type SidebarProps as S, Sidebar as a, Layout as b, DocsLayout as c };
@@ -1,4 +1,9 @@
1
1
  export { T as TreeContextProvider } from './tree-cqNEopxM.js';
2
- export { N as Nav, S as Sidebar } from './layout-2R7eRkWi.js';
2
+ import { S as SidebarProps } from './layout-vxXAvjoq.js';
3
+ export { N as Nav, a as Sidebar } from './layout-vxXAvjoq.js';
3
4
  import 'fumadocs-core/server';
4
5
  import 'react';
6
+
7
+ declare function DynamicSidebar(props: SidebarProps): React.ReactElement;
8
+
9
+ export { DynamicSidebar };