fumadocs-ui 15.2.2 → 15.2.4

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,5 +1,5 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
- export declare const Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
2
+ export declare const Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "icon" | "type" | "title"> & {
3
3
  title?: ReactNode;
4
4
  /**
5
5
  * @defaultValue info
@@ -1,7 +1,7 @@
1
- import type { HighlightOptions } from 'fumadocs-core/highlight';
1
+ import type { HighlightOptionsCommon, HighlightOptionsThemes } from 'fumadocs-core/highlight';
2
2
  export declare function DynamicCodeBlock({ lang, code, options, }: {
3
3
  lang: string;
4
4
  code: string;
5
- options?: Omit<HighlightOptions, 'lang'>;
5
+ options?: Omit<HighlightOptionsCommon, 'lang'> & HighlightOptionsThemes;
6
6
  }): import("react").ReactNode;
7
7
  //# sourceMappingURL=dynamic-codeblock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-codeblock.d.ts","sourceRoot":"","sources":["../../src/components/dynamic-codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAchE,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;CAC1C,6BAUA"}
1
+ {"version":3,"file":"dynamic-codeblock.d.ts","sourceRoot":"","sources":["../../src/components/dynamic-codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAcjC,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,IAAI,EACJ,OAAO,GACR,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,GAAG,sBAAsB,CAAC;CACzE,6BAUA"}
@@ -1,8 +1,8 @@
1
- import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';
1
+ import { type ButtonHTMLAttributes, type FC, type HTMLAttributes, type ReactNode } from 'react';
2
2
  import { type LinkProps } from 'fumadocs-core/link';
3
3
  import { type ScrollAreaProps } from '@radix-ui/react-scroll-area';
4
4
  import type { CollapsibleContentProps, CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
5
- import type { SidebarComponents } from '../../layouts/docs/shared.js';
5
+ import type { PageTree } from 'fumadocs-core/server';
6
6
  export interface SidebarProps extends HTMLAttributes<HTMLElement> {
7
7
  /**
8
8
  * Open folders by default if their level is lower or equal to a specific level
@@ -36,6 +36,19 @@ export declare function SidebarFolderTrigger(props: CollapsibleTriggerProps): im
36
36
  export declare function SidebarFolderLink(props: LinkProps): import("react/jsx-runtime").JSX.Element;
37
37
  export declare function SidebarFolderContent(props: CollapsibleContentProps): import("react/jsx-runtime").JSX.Element;
38
38
  export declare function SidebarCollapseTrigger(props: ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
39
+ export interface SidebarComponents {
40
+ Item: FC<{
41
+ item: PageTree.Item;
42
+ }>;
43
+ Folder: FC<{
44
+ item: PageTree.Folder;
45
+ level: number;
46
+ children: ReactNode;
47
+ }>;
48
+ Separator: FC<{
49
+ item: PageTree.Separator;
50
+ }>;
51
+ }
39
52
  /**
40
53
  * Render sidebar items from page tree
41
54
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layout/sidebar.tsx"],"names":[],"mappings":"AAI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,EAAE;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACzC,2CAuDA"}
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  export declare const buttonVariants: (props?: ({
3
3
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
4
- size?: "icon" | "sm" | "icon-sm" | null | undefined;
4
+ size?: "sm" | "icon" | "icon-sm" | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export type ButtonProps = VariantProps<typeof buttonVariants>;
7
7
  //# sourceMappingURL=button.d.ts.map
@@ -1,4 +1,3 @@
1
- import { type ReactNode } from 'react';
2
1
  export interface Translations {
3
2
  search: string;
4
3
  searchNoResult: string;
@@ -22,41 +21,10 @@ interface I18nContextType {
22
21
  locales?: LocaleItem[];
23
22
  }
24
23
  export declare const defaultTranslations: Translations;
25
- export declare const I18nContext: {
26
- Provider: (props: {
27
- value: I18nContextType;
28
- children: ReactNode;
29
- }) => import("react/jsx-runtime").JSX.Element;
30
- use: (errorMessage?: string) => I18nContextType;
31
- };
24
+ export declare const I18nContext: import("react").Context<I18nContextType>;
32
25
  export declare function I18nLabel(props: {
33
26
  label: keyof Translations;
34
27
  }): string;
35
28
  export declare function useI18n(): I18nContextType;
36
- export interface I18nProviderProps {
37
- /**
38
- * Current locale
39
- */
40
- locale: string;
41
- /**
42
- * Handle changes to the locale, redirect user when not specified.
43
- */
44
- onLocaleChange?: (v: string) => void;
45
- /**
46
- * Translations of current locale
47
- */
48
- translations?: Partial<Translations>;
49
- /**
50
- * Available languages
51
- */
52
- locales?: LocaleItem[];
53
- children?: ReactNode;
54
- }
55
- export declare function I18nProvider({ locales, locale, onChange: _onChange, onLocaleChange, ...props }: I18nProviderProps & {
56
- /**
57
- * @deprecated use `onLocaleChange` instead
58
- */
59
- onChange?: I18nProviderProps['onLocaleChange'];
60
- }): import("react/jsx-runtime").JSX.Element;
61
29
  export {};
62
30
  //# s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C"}
@@ -1,8 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { createContext, usePathname, useRouter } from 'fumadocs-core/framework';
4
- import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
5
- import { useMemo } from 'react';
2
+ import { createContext, useContext } from 'react';
6
3
  export const defaultTranslations = {
7
4
  search: 'Search',
8
5
  searchNoResult: 'No results found',
@@ -15,7 +12,7 @@ export const defaultTranslations = {
15
12
  chooseTheme: 'Theme',
16
13
  editOnGithub: 'Edit on GitHub',
17
14
  };
18
- export const I18nContext = createContext('I18nContext', {
15
+ export const I18nContext = createContext({
19
16
  text: defaultTranslations,
20
17
  });
21
18
  export function I18nLabel(props) {
@@ -23,33 +20,5 @@ export function I18nLabel(props) {
23
20
  return text[props.label];
24
21
  }
25
22
  export function useI18n() {
26
- return I18nContext.use();
27
- }
28
- export function I18nProvider({ locales = [], locale, onChange: _onChange, onLocaleChange = _onChange, ...props }) {
29
- const router = useRouter();
30
- const pathname = usePathname();
31
- const onChange = useEffectEvent((value) => {
32
- if (onLocaleChange) {
33
- return onLocaleChange(value);
34
- }
35
- const segments = pathname.split('/').filter((v) => v.length > 0);
36
- // If locale prefix hidden
37
- if (segments[0] !== locale) {
38
- segments.unshift(value);
39
- }
40
- else {
41
- segments[0] = value;
42
- }
43
- router.push(`/${segments.join('/')}`);
44
- router.refresh();
45
- });
46
- return (_jsx(I18nContext.Provider, { value: useMemo(() => ({
47
- locale,
48
- locales,
49
- text: {
50
- ...defaultTranslations,
51
- ...props.translations,
52
- },
53
- onChange,
54
- }), [locale, locales, onChange, props.translations]), children: props.children }));
23
+ return useContext(I18nContext);
55
24
  }
package/dist/i18n.d.ts CHANGED
@@ -1,2 +1,13 @@
1
- export { defaultTranslations, type Translations, I18nProvider, type I18nProviderProps, } from './contexts/i18n.js';
1
+ import type { I18nProviderProps } from './provider/base.js';
2
+ export type { I18nProviderProps };
3
+ export { defaultTranslations, type Translations } from './contexts/i18n.js';
4
+ /**
5
+ * @deprecated legacy I18n Provider, use `<RootProvider i18n={...} />` instead
6
+ */
7
+ export declare function I18nProvider({ locales, locale, onChange: _onChange, onLocaleChange, ...props }: I18nProviderProps & {
8
+ /**
9
+ * @deprecated use `onLocaleChange` instead
10
+ */
11
+ onChange?: I18nProviderProps['onLocaleChange'];
12
+ }): import("react/jsx-runtime").JSX.Element;
2
13
  //# sourceMappingURL=i18n.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGzE;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAY,EACZ,MAAM,EACN,QAAQ,EAAE,SAAS,EACnB,cAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAChD,2CAsCA"}
package/dist/i18n.js CHANGED
@@ -1 +1,39 @@
1
- export { defaultTranslations, I18nProvider, } from './contexts/i18n.js';
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { usePathname, useRouter } from 'next/navigation';
4
+ import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
5
+ import { useMemo } from 'react';
6
+ import { defaultTranslations, I18nContext } from './contexts/i18n.js';
7
+ export { defaultTranslations } from './contexts/i18n.js';
8
+ // TODO: remove next major
9
+ /**
10
+ * @deprecated legacy I18n Provider, use `<RootProvider i18n={...} />` instead
11
+ */
12
+ export function I18nProvider({ locales = [], locale, onChange: _onChange, onLocaleChange = _onChange, ...props }) {
13
+ const router = useRouter();
14
+ const pathname = usePathname();
15
+ const onChange = useEffectEvent((value) => {
16
+ if (onLocaleChange) {
17
+ return onLocaleChange(value);
18
+ }
19
+ const segments = pathname.split('/').filter((v) => v.length > 0);
20
+ // If locale prefix hidden
21
+ if (segments[0] !== locale) {
22
+ segments.unshift(value);
23
+ }
24
+ else {
25
+ segments[0] = value;
26
+ }
27
+ router.push(`/${segments.join('/')}`);
28
+ router.refresh();
29
+ });
30
+ return (_jsx(I18nContext.Provider, { value: useMemo(() => ({
31
+ locale,
32
+ locales,
33
+ text: {
34
+ ...defaultTranslations,
35
+ ...props.translations,
36
+ },
37
+ onChange,
38
+ }), [locale, locales, onChange, props.translations]), children: props.children }));
39
+ }
@@ -1,21 +1,19 @@
1
- import { type LinkItemType } from '../../layouts/links.js';
2
- import { type SidebarProps } from '../../components/layout/sidebar.js';
1
+ import type { LinkItemType } from '../../layouts/links.js';
2
+ import { type SidebarComponents, type SidebarProps } from '../../components/layout/sidebar.js';
3
3
  import type { PageTree } from 'fumadocs-core/server';
4
- import type { FC, ReactNode } from 'react';
4
+ import type { ReactNode } from 'react';
5
5
  import type { Option } from '../../components/layout/root-toggle.js';
6
+ import { type GetSidebarTabsOptions } from '../../utils/get-sidebar-tabs.js';
6
7
  export declare const layoutVariables: {
7
8
  '--fd-layout-offset': string;
8
9
  };
9
- export interface TabOptions {
10
- transform?: (option: Option, node: PageTree.Folder) => Option | null;
11
- }
12
10
  export interface SidebarOptions extends SidebarProps {
13
11
  collapsible?: boolean;
14
12
  components?: Partial<SidebarComponents>;
15
13
  /**
16
14
  * Root Toggle options
17
15
  */
18
- tabs?: Option[] | TabOptions | false;
16
+ tabs?: Option[] | GetSidebarTabsOptions | false;
19
17
  banner?: ReactNode;
20
18
  footer?: ReactNode;
21
19
  /**
@@ -25,23 +23,9 @@ export interface SidebarOptions extends SidebarProps {
25
23
  */
26
24
  hideSearch?: boolean;
27
25
  }
28
- export interface SidebarComponents {
29
- Item: FC<{
30
- item: PageTree.Item;
31
- }>;
32
- Folder: FC<{
33
- item: PageTree.Folder;
34
- level: number;
35
- children: ReactNode;
36
- }>;
37
- Separator: FC<{
38
- item: PageTree.Separator;
39
- }>;
40
- }
41
26
  export declare function SidebarLinkItem({ item, ...props }: {
42
27
  item: LinkItemType;
43
28
  className?: string;
44
29
  }): import("react/jsx-runtime").JSX.Element;
45
- export declare function checkPageTree(passed: unknown): void;
46
30
  export declare function getSidebarTabsFromOptions(options: SidebarOptions['tabs'], tree: PageTree.Root): Option[] | undefined;
47
31
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,eAAO,MAAM,eAAe;;CAE3B,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACtE;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExC;;OAEG;IACH,IAAI,CAAC,EAAE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;AAC9D,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAElC,eAAO,MAAM,eAAe;;CAE3B,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,qBAAqB,GAAG,KAAK,CAAC;IAEhD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAmCA;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,IAAI,EAAE,QAAQ,CAAC,IAAI,wBASpB"}
@@ -1,31 +1,16 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { BaseLinkItem } from '../../layouts/links.js';
3
2
  import { SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, } from '../../components/layout/sidebar.js';
4
- import { cn } from '../../utils/cn.js';
5
- import { buttonVariants } from '../../components/ui/button.js';
3
+ import { getSidebarTabs, } from '../../utils/get-sidebar-tabs.js';
6
4
  export const layoutVariables = {
7
5
  '--fd-layout-offset': 'max(calc(50vw - var(--fd-layout-width) / 2), 0px)',
8
6
  };
9
7
  export function SidebarLinkItem({ item, ...props }) {
10
8
  if (item.type === 'menu')
11
9
  return (_jsxs(SidebarFolder, { ...props, children: [item.url ? (_jsxs(SidebarFolderLink, { href: item.url, children: [item.icon, item.text] })) : (_jsxs(SidebarFolderTrigger, { children: [item.icon, item.text] })), _jsx(SidebarFolderContent, { children: item.items.map((child, i) => (_jsx(SidebarLinkItem, { item: child }, i))) })] }));
12
- if (item.type === 'button') {
13
- return (_jsxs(BaseLinkItem, { item: item, ...props, className: cn(buttonVariants({
14
- color: 'secondary',
15
- }), 'gap-1.5 [&_svg]:size-4', props.className), children: [item.icon, item.text] }));
16
- }
17
10
  if (item.type === 'custom')
18
11
  return _jsx("div", { ...props, children: item.children });
19
12
  return (_jsx(SidebarItem, { href: item.url, icon: item.icon, external: item.external, ...props, children: item.text }));
20
13
  }
21
- export function checkPageTree(passed) {
22
- if (passed &&
23
- typeof passed === 'object' &&
24
- 'children' in passed &&
25
- Array.isArray(passed.children))
26
- return;
27
- throw new Error('You passed an invalid page tree to `<DocsLayout />`. Check your usage in layout.tsx if you have enabled i18n.');
28
- }
29
14
  export function getSidebarTabsFromOptions(options, tree) {
30
15
  if (Array.isArray(options)) {
31
16
  return options;
@@ -37,48 +22,3 @@ export function getSidebarTabsFromOptions(options, tree) {
37
22
  return getSidebarTabs(tree);
38
23
  }
39
24
  }
40
- const defaultTransform = (option, node) => {
41
- if (!node.icon)
42
- return option;
43
- return {
44
- ...option,
45
- icon: (_jsx("div", { className: "rounded-md border bg-fd-secondary p-1 shadow-md [&_svg]:size-5", children: node.icon })),
46
- };
47
- };
48
- function getSidebarTabs(pageTree, { transform = defaultTransform } = {}) {
49
- function findOptions(node) {
50
- const results = [];
51
- if (node.root) {
52
- const urls = getFolderUrls(node);
53
- if (urls.size > 0) {
54
- const option = {
55
- url: urls.values().next().value ?? '',
56
- title: node.name,
57
- icon: node.icon,
58
- description: node.description,
59
- urls,
60
- };
61
- const mapped = transform ? transform(option, node) : option;
62
- if (mapped)
63
- results.push(mapped);
64
- }
65
- }
66
- for (const child of node.children) {
67
- if (child.type === 'folder')
68
- results.push(...findOptions(child));
69
- }
70
- return results;
71
- }
72
- return findOptions(pageTree);
73
- }
74
- function getFolderUrls(folder, output = new Set()) {
75
- if (folder.index)
76
- output.add(folder.index.url);
77
- for (const child of folder.children) {
78
- if (child.type === 'page' && !child.external)
79
- output.add(child.url);
80
- if (child.type === 'folder')
81
- getFolderUrls(child, output);
82
- }
83
- return output;
84
- }
@@ -27,5 +27,5 @@ export declare function DocsLayoutSidebarFooter({ i18n, themeSwitch, links, }: {
27
27
  themeSwitch?: DocsLayoutProps['themeSwitch'];
28
28
  }): import("react/jsx-runtime").JSX.Element | null;
29
29
  export { CollapsibleControl, Navbar, NavbarSidebarTrigger, type LinkItemType };
30
- export { getSidebarTabsFromOptions, type TabOptions } from './docs/shared.js';
30
+ export { getSidebarTabsFromOptions } from './docs/shared.js';
31
31
  //# sourceMappingURL=docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/layouts/docs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAcrE,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,UAAU,CAAC;AAK1D,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG;QAClC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IAEF;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wB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W,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;CAC9C,kDAiCA;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
@@ -13,11 +13,10 @@ import { CollapsibleControl, Navbar, NavbarSidebarTrigger, } from '../layouts/do
13
13
  import { TreeContextProvider } from '../contexts/tree.js';
14
14
  import { ThemeToggle } from '../components/layout/theme-toggle.js';
15
15
  import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle.js';
16
- import { checkPageTree, getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
16
+ import { getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
17
17
  import { StylesProvider, NavProvider, } from '../contexts/layout.js';
18
18
  import Link from 'fumadocs-core/link';
19
19
  export function DocsLayout({ nav: { enabled: navEnabled = true, component: navReplace, transparentMode, ...nav } = {}, themeSwitch, sidebar = {}, i18n = false, children, ...props }) {
20
- checkPageTree(props.tree);
21
20
  const links = getLinks(props.links ?? [], props.githubUrl);
22
21
  const variables = cn('[--fd-tocnav-height:36px] md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px] xl:[--fd-toc-width:286px] xl:[--fd-tocnav-height:0px]', !navReplace && navEnabled
23
22
  ? '[--fd-nav-height:calc(var(--spacing)*14)] md:[--fd-nav-height:0px]'
@@ -29,14 +29,13 @@ function Header({ nav: { enableSearch = true, ...nav } = {}, i18n = false, final
29
29
  }
30
30
  function NavbarLinkItem({ item, ...props }) {
31
31
  if (item.type === 'custom')
32
- return item.children;
32
+ return _jsx("div", { ...props, children: item.children });
33
33
  if (item.type === 'menu') {
34
34
  const children = item.items.map((child, j) => {
35
35
  if (child.type === 'custom')
36
36
  return _jsx(Fragment, { children: child.children }, j);
37
- const { banner, footer, ...rest } = child.menu ?? {};
38
- return (_jsxs(NavbarMenuLink, { href: child.url, ...rest, children: [banner ??
39
- (child.icon ? (_jsx("div", { className: "w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4", children: child.icon })) : null), _jsx("p", { className: "-mb-1 text-sm font-medium", children: child.text }), child.description ? (_jsx("p", { className: "text-[13px] text-fd-muted-foreground", children: child.description })) : null, footer] }, j));
37
+ const { banner = child.icon ? (_jsx("div", { className: "w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4", children: child.icon })) : null, ...rest } = child.menu ?? {};
38
+ return (_jsx(NavbarMenuLink, { href: child.url, ...rest, children: rest.children ?? (_jsxs(_Fragment, { children: [banner, _jsx("p", { className: "-mb-1 text-sm font-medium", children: child.text }), child.description ? (_jsx("p", { className: "text-[13px] text-fd-muted-foreground", children: child.description })) : null] })) }, j));
40
39
  });
41
40
  return (_jsxs(NavbarMenu, { children: [_jsx(NavbarMenuTrigger, { ...props, children: item.url ? _jsx(Link, { href: item.url, children: item.text }) : item.text }), _jsx(NavbarMenuContent, { children: children })] }));
42
41
  }
@@ -56,7 +56,6 @@ export interface MenuItemType extends BaseItem {
56
56
  */
57
57
  menu?: HTMLAttributes<HTMLElement> & {
58
58
  banner?: ReactNode;
59
- footer?: ReactNode;
60
59
  };
61
60
  }) | CustomItem)[];
62
61
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/layouts/links.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,UAAU,QAAQ;IAChB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;CAC7B;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,MAAM,CAA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AAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IAEjE,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAmB,EACnB,GAAG,EAAE,EAAE,eAAe,EAAE,GAAG,GAAG,EAAO,EACrC,OAAO,EAAE,EACP,WAAW,EAAE,kBAAyB,EACtC,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB,EAC7B,GAAG,OAAO,EACN,EACN,IAAY,EACZ,WAAW,EACX,GAAG,KAAK,EACT,EAAE,eAAe,2CAqIjB;AAiLD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC"}
@@ -11,13 +11,12 @@ import { BaseLinkItem } from '../layouts/links.js';
11
11
  import { LanguageToggle } from '../components/layout/language-toggle.js';
12
12
  import { ThemeToggle } from '../components/layout/theme-toggle.js';
13
13
  import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover.js';
14
- import { checkPageTree, getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
14
+ import { getSidebarTabsFromOptions, layoutVariables, SidebarLinkItem, } from '../layouts/docs/shared.js';
15
15
  import { LayoutTab, LayoutTabs, Navbar, NavbarSidebarTrigger, SidebarLayoutTab, } from './notebook-client.js';
16
16
  import { StylesProvider, NavProvider, } from '../contexts/layout.js';
17
17
  import { RootToggle } from '../components/layout/root-toggle.js';
18
18
  import Link from 'fumadocs-core/link';
19
19
  export function DocsLayout({ tabMode = 'sidebar', nav: { transparentMode, ...nav } = {}, sidebar: { collapsible: sidebarCollapsible = true, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, ...sidebar } = {}, i18n = false, themeSwitch, ...props }) {
20
- checkPageTree(props.tree);
21
20
  const navMode = nav.mode ?? 'auto';
22
21
  const links = getLinks(props.links ?? [], props.githubUrl);
23
22
  const tabs = useMemo(() => getSidebarTabsFromOptions(tabOptions, props.tree) ?? [], [tabOptions, props.tree]);
package/dist/mdx.d.ts CHANGED
@@ -17,7 +17,7 @@ declare const defaultMdxComponents: {
17
17
  h5: (props: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
18
18
  h6: (props: HTMLAttributes<HTMLHeadingElement>) => import("react/jsx-runtime").JSX.Element;
19
19
  table: typeof Table;
20
- Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
20
+ Callout: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "icon" | "type" | "title"> & {
21
21
  title?: import("react").ReactNode;
22
22
  type?: "info" | "warn" | "error";
23
23
  icon?: import("react").ReactNode;
@@ -2,6 +2,7 @@ import { ThemeProvider } from 'next-themes';
2
2
  import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
3
3
  import type { DefaultSearchDialogProps } from '../components/dialog/search-default.js';
4
4
  import { type SearchProviderProps } from '../contexts/search.js';
5
+ import { type LocaleItem, type Translations } from '../contexts/i18n.js';
5
6
  interface SearchOptions extends Omit<SearchProviderProps, 'options' | 'children'> {
6
7
  options?: Partial<DefaultSearchDialogProps> | SearchProviderProps['options'];
7
8
  /**
@@ -31,8 +32,28 @@ export interface RootProviderProps {
31
32
  */
32
33
  enabled?: boolean;
33
34
  };
35
+ i18n?: Omit<I18nProviderProps, 'children'>;
34
36
  children?: ReactNode;
35
37
  }
36
- export declare function RootProvider({ children, dir, theme, search, }: RootProviderProps): import("react/jsx-runtime").JSX.Element;
38
+ export interface I18nProviderProps {
39
+ /**
40
+ * Current locale
41
+ */
42
+ locale: string;
43
+ /**
44
+ * Handle changes to the locale, redirect user when not specified.
45
+ */
46
+ onLocaleChange?: (v: string) => void;
47
+ /**
48
+ * Translations of current locale
49
+ */
50
+ translations?: Partial<Translations>;
51
+ /**
52
+ * Available languages
53
+ */
54
+ locales?: LocaleItem[];
55
+ children?: ReactNode;
56
+ }
57
+ export declare function RootProvider({ children, dir, theme, search, i18n, }: RootProviderProps): import("react/jsx-runtime").JSX.Element;
37
58
  export {};
38
59
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/provider/base.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,wBAAwB,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,UAAU,aACR,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,UAAU,CAAC;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7E;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEhC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,OAAO,aAAa,CAAC,CAAC,GAAG;QAChE;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IAEF,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,GAAW,EACX,KAAU,EACV,MAAM,GACP,EAAE,iBAAiB,2CA4BnB"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/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AAE,UAAU,EAAE,CAAC;IAEvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAMD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,GAAW,EACX,KAAU,EACV,MAAM,EACN,IAAI,GACL,EAAE,iBAAiB,2CAgCnB"}
@@ -1,16 +1,50 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { ThemeProvider } from 'next-themes';
4
- import { lazy } from 'react';
4
+ import { lazy, useMemo, } from 'react';
5
5
  import { DirectionProvider } from '@radix-ui/react-direction';
6
6
  import { SidebarProvider } from '../contexts/sidebar.js';
7
7
  import { SearchProvider } from '../contexts/search.js';
8
+ import { useEffectEvent } from 'fumadocs-core/utils/use-effect-event';
9
+ import { defaultTranslations, I18nContext, } from '../contexts/i18n.js';
10
+ import { usePathname, useRouter } from 'fumadocs-core/framework';
8
11
  const DefaultSearchDialog = lazy(() => import('../components/dialog/search-default.js'));
9
- export function RootProvider({ children, dir = 'ltr', theme = {}, search, }) {
12
+ export function RootProvider({ children, dir = 'ltr', theme = {}, search, i18n, }) {
10
13
  let body = children;
14
+ if (i18n) {
15
+ body = _jsx(I18nProvider, { ...i18n, children: body });
16
+ }
11
17
  if (search?.enabled !== false)
12
18
  body = (_jsx(SearchProvider, { SearchDialog: DefaultSearchDialog, ...search, children: body }));
13
19
  if (theme?.enabled !== false)
14
20
  body = (_jsx(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, disableTransitionOnChange: true, ...theme, children: body }));
15
21
  return (_jsx(DirectionProvider, { dir: dir, children: _jsx(SidebarProvider, { children: body }) }));
16
22
  }
23
+ function I18nProvider({ locales = [], locale, onLocaleChange, ...props }) {
24
+ const router = useRouter();
25
+ const pathname = usePathname();
26
+ const onChange = useEffectEvent((value) => {
27
+ if (onLocaleChange) {
28
+ return onLocaleChange(value);
29
+ }
30
+ const segments = pathname.split('/').filter((v) => v.length > 0);
31
+ // If locale prefix hidden
32
+ if (segments[0] !== locale) {
33
+ segments.unshift(value);
34
+ }
35
+ else {
36
+ segments[0] = value;
37
+ }
38
+ router.push(`/${segments.join('/')}`);
39
+ router.refresh();
40
+ });
41
+ return (_jsx(I18nContext.Provider, { value: useMemo(() => ({
42
+ locale,
43
+ locales,
44
+ text: {
45
+ ...defaultTranslations,
46
+ ...props.translations,
47
+ },
48
+ onChange,
49
+ }), [locale, locales, onChange, props.translations]), children: props.children }));
50
+ }
package/dist/style.css CHANGED
@@ -1,10 +1,73 @@
1
- /*! tailwindcss v4.0.17 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.1 | MIT License | https://tailwindcss.com */
2
2
  @layer theme, base, components, utilities;
3
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
4
+ @layer base {
5
+ *, ::before, ::after, ::backdrop {
6
+ --tw-translate-x: 0;
7
+ --tw-translate-y: 0;
8
+ --tw-translate-z: 0;
9
+ --tw-scale-x: 1;
10
+ --tw-scale-y: 1;
11
+ --tw-scale-z: 1;
12
+ --tw-rotate-x: rotateX(0);
13
+ --tw-rotate-y: rotateY(0);
14
+ --tw-rotate-z: rotateZ(0);
15
+ --tw-skew-x: skewX(0);
16
+ --tw-skew-y: skewY(0);
17
+ --tw-divide-y-reverse: 0;
18
+ --tw-border-style: solid;
19
+ --tw-font-weight: initial;
20
+ --tw-shadow: 0 0 #0000;
21
+ --tw-shadow-color: initial;
22
+ --tw-shadow-alpha: 100%;
23
+ --tw-inset-shadow: 0 0 #0000;
24
+ --tw-inset-shadow-color: initial;
25
+ --tw-inset-shadow-alpha: 100%;
26
+ --tw-ring-color: initial;
27
+ --tw-ring-shadow: 0 0 #0000;
28
+ --tw-inset-ring-color: initial;
29
+ --tw-inset-ring-shadow: 0 0 #0000;
30
+ --tw-ring-inset: initial;
31
+ --tw-ring-offset-width: 0px;
32
+ --tw-ring-offset-color: #fff;
33
+ --tw-ring-offset-shadow: 0 0 #0000;
34
+ --tw-outline-style: solid;
35
+ --tw-blur: initial;
36
+ --tw-brightness: initial;
37
+ --tw-contrast: initial;
38
+ --tw-grayscale: initial;
39
+ --tw-hue-rotate: initial;
40
+ --tw-invert: initial;
41
+ --tw-opacity: initial;
42
+ --tw-saturate: initial;
43
+ --tw-sepia: initial;
44
+ --tw-drop-shadow: initial;
45
+ --tw-drop-shadow-color: initial;
46
+ --tw-drop-shadow-alpha: 100%;
47
+ --tw-drop-shadow-size: initial;
48
+ --tw-backdrop-blur: initial;
49
+ --tw-backdrop-brightness: initial;
50
+ --tw-backdrop-contrast: initial;
51
+ --tw-backdrop-grayscale: initial;
52
+ --tw-backdrop-hue-rotate: initial;
53
+ --tw-backdrop-invert: initial;
54
+ --tw-backdrop-opacity: initial;
55
+ --tw-backdrop-saturate: initial;
56
+ --tw-backdrop-sepia: initial;
57
+ --tw-duration: initial;
58
+ --radix-collapsible-content-height: 0px;
59
+ }
60
+ }
61
+ }
3
62
  @layer theme {
4
63
  :root, :host {
5
- --color-red-500: oklch(0.637 0.237 25.331);
6
- --color-orange-500: oklch(0.705 0.213 47.604);
7
- --color-blue-500: oklch(0.623 0.214 259.815);
64
+ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
65
+ "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
66
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
67
+ "Courier New", monospace;
68
+ --color-red-500: oklch(63.7% 0.237 25.331);
69
+ --color-orange-500: oklch(70.5% 0.213 47.604);
70
+ --color-blue-500: oklch(62.3% 0.214 259.815);
8
71
  --color-black: #000;
9
72
  --spacing: 0.25rem;
10
73
  --breakpoint-sm: 40rem;
@@ -31,6 +94,8 @@
31
94
  --blur-lg: 16px;
32
95
  --default-transition-duration: 150ms;
33
96
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
97
+ --default-font-family: var(--font-sans);
98
+ --default-mono-font-family: var(--font-mono);
34
99
  --color-fd-background: hsl(0, 0%, 96%);
35
100
  --color-fd-foreground: hsl(0, 0%, 3.9%);
36
101
  --color-fd-muted: hsl(0, 0%, 96.1%);
@@ -86,10 +151,9 @@
86
151
  line-height: 1.5;
87
152
  -webkit-text-size-adjust: 100%;
88
153
  tab-size: 4;
89
- font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
90
- "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
91
- font-feature-settings: initial;
92
- font-variation-settings: initial;
154
+ font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
155
+ font-feature-settings: var(--default-font-feature-settings, normal);
156
+ font-variation-settings: var(--default-font-variation-settings, normal);
93
157
  -webkit-tap-highlight-color: transparent;
94
158
  }
95
159
  hr {
@@ -114,10 +178,9 @@
114
178
  font-weight: bolder;
115
179
  }
116
180
  code, kbd, samp, pre {
117
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
118
- "Courier New", monospace;
119
- font-feature-settings: initial;
120
- font-variation-settings: initial;
181
+ font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
182
+ font-feature-settings: var(--default-mono-font-feature-settings, normal);
183
+ font-variation-settings: var(--default-mono-font-variation-settings, normal);
121
184
  font-size: 1em;
122
185
  }
123
186
  small {
@@ -735,7 +798,10 @@
735
798
  :where(a:not([data-card]):hover):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
736
799
  opacity: 80%;
737
800
  }
738
- --tw-prose-body: color-mix(in oklab, var(--color-fd-foreground) 90%, transparent);
801
+ --tw-prose-body: color-mix(in srgb, hsl(0, 0%, 3.9%) 90%, transparent);
802
+ @supports (color: color-mix(in lab, red, red)) {
803
+ --tw-prose-body: color-mix(in oklab, var(--color-fd-foreground) 90%, transparent);
804
+ }
739
805
  --tw-prose-headings: var(--color-fd-foreground);
740
806
  --tw-prose-lead: var(--color-fd-foreground);
741
807
  --tw-prose-links: var(--color-fd-foreground);
@@ -750,7 +816,10 @@
750
816
  --tw-prose-th-borders: var(--color-fd-border);
751
817
  --tw-prose-td-borders: var(--color-fd-border);
752
818
  --tw-prose-kbd: var(--color-fd-foreground);
753
- --tw-prose-kbd-shadows: color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
819
+ --tw-prose-kbd-shadows: color-mix(in srgb, hsl(0, 0%, 9%) 50%, transparent);
820
+ @supports (color: color-mix(in lab, red, red)) {
821
+ --tw-prose-kbd-shadows: color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
822
+ }
754
823
  :where(.prose > :first-child):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
755
824
  margin-top: 0;
756
825
  }
@@ -1177,7 +1246,10 @@
1177
1246
  border-left-width: 1px;
1178
1247
  }
1179
1248
  .border-fd-foreground\/10 {
1180
- border-color: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
1249
+ border-color: color-mix(in srgb, hsl(0, 0%, 3.9%) 10%, transparent);
1250
+ @supports (color: color-mix(in lab, red, red)) {
1251
+ border-color: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
1252
+ }
1181
1253
  }
1182
1254
  .border-fd-primary {
1183
1255
  border-color: var(--color-fd-primary);
@@ -1186,19 +1258,31 @@
1186
1258
  border-color: transparent;
1187
1259
  }
1188
1260
  .border-s-blue-500\/50 {
1189
- border-inline-start-color: color-mix(in oklab, var(--color-blue-500) 50%, transparent);
1261
+ border-inline-start-color: color-mix(in srgb, oklch(62.3% 0.214 259.815) 50%, transparent);
1262
+ @supports (color: color-mix(in lab, red, red)) {
1263
+ border-inline-start-color: color-mix(in oklab, var(--color-blue-500) 50%, transparent);
1264
+ }
1190
1265
  }
1191
1266
  .border-s-orange-500\/50 {
1192
- border-inline-start-color: color-mix(in oklab, var(--color-orange-500) 50%, transparent);
1267
+ border-inline-start-color: color-mix(in srgb, oklch(70.5% 0.213 47.604) 50%, transparent);
1268
+ @supports (color: color-mix(in lab, red, red)) {
1269
+ border-inline-start-color: color-mix(in oklab, var(--color-orange-500) 50%, transparent);
1270
+ }
1193
1271
  }
1194
1272
  .border-s-red-500\/50 {
1195
- border-inline-start-color: color-mix(in oklab, var(--color-red-500) 50%, transparent);
1273
+ border-inline-start-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 50%, transparent);
1274
+ @supports (color: color-mix(in lab, red, red)) {
1275
+ border-inline-start-color: color-mix(in oklab, var(--color-red-500) 50%, transparent);
1276
+ }
1196
1277
  }
1197
1278
  .bg-\(--shiki-light-bg\) {
1198
1279
  background-color: var(--shiki-light-bg);
1199
1280
  }
1200
1281
  .bg-black\/30 {
1201
- background-color: color-mix(in oklab, var(--color-black) 30%, transparent);
1282
+ background-color: color-mix(in srgb, #000 30%, transparent);
1283
+ @supports (color: color-mix(in lab, red, red)) {
1284
+ background-color: color-mix(in oklab, var(--color-black) 30%, transparent);
1285
+ }
1202
1286
  }
1203
1287
  .bg-fd-accent {
1204
1288
  background-color: var(--color-fd-accent);
@@ -1207,7 +1291,10 @@
1207
1291
  background-color: var(--color-fd-background);
1208
1292
  }
1209
1293
  .bg-fd-background\/80 {
1210
- background-color: color-mix(in oklab, var(--color-fd-background) 80%, transparent);
1294
+ background-color: color-mix(in srgb, hsl(0, 0%, 96%) 80%, transparent);
1295
+ @supports (color: color-mix(in lab, red, red)) {
1296
+ background-color: color-mix(in oklab, var(--color-fd-background) 80%, transparent);
1297
+ }
1211
1298
  }
1212
1299
  .bg-fd-border {
1213
1300
  background-color: var(--color-fd-border);
@@ -1216,7 +1303,10 @@
1216
1303
  background-color: var(--color-fd-card);
1217
1304
  }
1218
1305
  .bg-fd-foreground\/10 {
1219
- background-color: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
1306
+ background-color: color-mix(in srgb, hsl(0, 0%, 3.9%) 10%, transparent);
1307
+ @supports (color: color-mix(in lab, red, red)) {
1308
+ background-color: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
1309
+ }
1220
1310
  }
1221
1311
  .bg-fd-muted {
1222
1312
  background-color: var(--color-fd-muted);
@@ -1228,13 +1318,19 @@
1228
1318
  background-color: var(--color-fd-primary);
1229
1319
  }
1230
1320
  .bg-fd-primary\/10 {
1231
- background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
1321
+ background-color: color-mix(in srgb, hsl(0, 0%, 9%) 10%, transparent);
1322
+ @supports (color: color-mix(in lab, red, red)) {
1323
+ background-color: color-mix(in oklab, var(--color-fd-primary) 10%, transparent);
1324
+ }
1232
1325
  }
1233
1326
  .bg-fd-secondary {
1234
1327
  background-color: var(--color-fd-secondary);
1235
1328
  }
1236
1329
  .bg-fd-secondary\/50 {
1237
- background-color: color-mix(in oklab, var(--color-fd-secondary) 50%, transparent);
1330
+ background-color: color-mix(in srgb, hsl(0, 0%, 93.1%) 50%, transparent);
1331
+ @supports (color: color-mix(in lab, red, red)) {
1332
+ background-color: color-mix(in oklab, var(--color-fd-secondary) 50%, transparent);
1333
+ }
1238
1334
  }
1239
1335
  .bg-transparent {
1240
1336
  background-color: transparent;
@@ -1249,7 +1345,10 @@
1249
1345
  fill: var(--color-red-500);
1250
1346
  }
1251
1347
  .stroke-fd-foreground\/10 {
1252
- stroke: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
1348
+ stroke: color-mix(in srgb, hsl(0, 0%, 3.9%) 10%, transparent);
1349
+ @supports (color: color-mix(in lab, red, red)) {
1350
+ stroke: color-mix(in oklab, var(--color-fd-foreground) 10%, transparent);
1351
+ }
1253
1352
  }
1254
1353
  .p-0 {
1255
1354
  padding: calc(var(--spacing) * 0);
@@ -1433,10 +1532,16 @@
1433
1532
  color: var(--color-fd-foreground);
1434
1533
  }
1435
1534
  .text-fd-foreground\/30 {
1436
- color: color-mix(in oklab, var(--color-fd-foreground) 30%, transparent);
1535
+ color: color-mix(in srgb, hsl(0, 0%, 3.9%) 30%, transparent);
1536
+ @supports (color: color-mix(in lab, red, red)) {
1537
+ color: color-mix(in oklab, var(--color-fd-foreground) 30%, transparent);
1538
+ }
1437
1539
  }
1438
1540
  .text-fd-foreground\/80 {
1439
- color: color-mix(in oklab, var(--color-fd-foreground) 80%, transparent);
1541
+ color: color-mix(in srgb, hsl(0, 0%, 3.9%) 80%, transparent);
1542
+ @supports (color: color-mix(in lab, red, red)) {
1543
+ color: color-mix(in oklab, var(--color-fd-foreground) 80%, transparent);
1544
+ }
1440
1545
  }
1441
1546
  .text-fd-muted-foreground {
1442
1547
  color: var(--color-fd-muted-foreground);
@@ -1610,21 +1715,30 @@
1610
1715
  .hover\:bg-fd-accent\/50 {
1611
1716
  &:hover {
1612
1717
  @media (hover: hover) {
1613
- background-color: color-mix(in oklab, var(--color-fd-accent) 50%, transparent);
1718
+ background-color: color-mix(in srgb, hsl(0, 0%, 90.1%) 50%, transparent);
1719
+ @supports (color: color-mix(in lab, red, red)) {
1720
+ background-color: color-mix(in oklab, var(--color-fd-accent) 50%, transparent);
1721
+ }
1614
1722
  }
1615
1723
  }
1616
1724
  }
1617
1725
  .hover\:bg-fd-accent\/80 {
1618
1726
  &:hover {
1619
1727
  @media (hover: hover) {
1620
- background-color: color-mix(in oklab, var(--color-fd-accent) 80%, transparent);
1728
+ background-color: color-mix(in srgb, hsl(0, 0%, 90.1%) 80%, transparent);
1729
+ @supports (color: color-mix(in lab, red, red)) {
1730
+ background-color: color-mix(in oklab, var(--color-fd-accent) 80%, transparent);
1731
+ }
1621
1732
  }
1622
1733
  }
1623
1734
  }
1624
1735
  .hover\:bg-fd-primary\/80 {
1625
1736
  &:hover {
1626
1737
  @media (hover: hover) {
1627
- background-color: color-mix(in oklab, var(--color-fd-primary) 80%, transparent);
1738
+ background-color: color-mix(in srgb, hsl(0, 0%, 9%) 80%, transparent);
1739
+ @supports (color: color-mix(in lab, red, red)) {
1740
+ background-color: color-mix(in oklab, var(--color-fd-primary) 80%, transparent);
1741
+ }
1628
1742
  }
1629
1743
  }
1630
1744
  }
@@ -1638,14 +1752,20 @@
1638
1752
  .hover\:text-fd-accent-foreground\/80 {
1639
1753
  &:hover {
1640
1754
  @media (hover: hover) {
1641
- color: color-mix(in oklab, var(--color-fd-accent-foreground) 80%, transparent);
1755
+ color: color-mix(in srgb, hsl(0, 0%, 9%) 80%, transparent);
1756
+ @supports (color: color-mix(in lab, red, red)) {
1757
+ color: color-mix(in oklab, var(--color-fd-accent-foreground) 80%, transparent);
1758
+ }
1642
1759
  }
1643
1760
  }
1644
1761
  }
1645
1762
  .hover\:text-fd-popover-foreground\/50 {
1646
1763
  &:hover {
1647
1764
  @media (hover: hover) {
1648
- color: color-mix(in oklab, var(--color-fd-popover-foreground) 50%, transparent);
1765
+ color: color-mix(in srgb, hsl(0, 0%, 15.1%) 50%, transparent);
1766
+ @supports (color: color-mix(in lab, red, red)) {
1767
+ color: color-mix(in oklab, var(--color-fd-popover-foreground) 50%, transparent);
1768
+ }
1649
1769
  }
1650
1770
  }
1651
1771
  }
@@ -1797,7 +1917,10 @@
1797
1917
  }
1798
1918
  .data-\[state\=open\]\:bg-fd-accent\/50 {
1799
1919
  &[data-state="open"] {
1800
- background-color: color-mix(in oklab, var(--color-fd-accent) 50%, transparent);
1920
+ background-color: color-mix(in srgb, hsl(0, 0%, 90.1%) 50%, transparent);
1921
+ @supports (color: color-mix(in lab, red, red)) {
1922
+ background-color: color-mix(in oklab, var(--color-fd-accent) 50%, transparent);
1923
+ }
1801
1924
  }
1802
1925
  }
1803
1926
  .max-xl\:end-4 {
@@ -1842,7 +1965,10 @@
1842
1965
  }
1843
1966
  .max-md\:bg-fd-background\/80 {
1844
1967
  @media (width < 48rem) {
1845
- background-color: color-mix(in oklab, var(--color-fd-background) 80%, transparent);
1968
+ background-color: color-mix(in srgb, hsl(0, 0%, 96%) 80%, transparent);
1969
+ @supports (color: color-mix(in lab, red, red)) {
1970
+ background-color: color-mix(in oklab, var(--color-fd-background) 80%, transparent);
1971
+ }
1846
1972
  }
1847
1973
  }
1848
1974
  .max-md\:text-\[15px\] {
@@ -2279,13 +2405,22 @@
2279
2405
  .fd-codeblock .highlighted {
2280
2406
  margin: 0 -16px;
2281
2407
  padding: 0 16px;
2282
- background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
2408
+ background-color: color-mix( in oklab, hsl(0, 0%, 9%) 10%, transparent );
2409
+ @supports (color: color-mix(in lab, red, red)) {
2410
+ background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
2411
+ }
2283
2412
  }
2284
2413
  .fd-codeblock .highlighted-word {
2285
2414
  padding: 1px 2px;
2286
2415
  margin: -1px -3px;
2287
- border: 1px solid color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
2288
- background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
2416
+ border: 1px solid color-mix(in srgb, hsl(0, 0%, 9%) 50%, transparent);
2417
+ @supports (color: color-mix(in lab, red, red)) {
2418
+ border: 1px solid color-mix(in oklab, var(--color-fd-primary) 50%, transparent);
2419
+ }
2420
+ background-color: color-mix( in oklab, hsl(0, 0%, 9%) 10%, transparent );
2421
+ @supports (color: color-mix(in lab, red, red)) {
2422
+ background-color: color-mix( in oklab, var(--color-fd-primary) 10%, transparent );
2423
+ }
2289
2424
  border-radius: 2px;
2290
2425
  }
2291
2426
  @layer base {
@@ -2393,6 +2528,11 @@
2393
2528
  syntax: "*";
2394
2529
  inherits: false;
2395
2530
  }
2531
+ @property --tw-shadow-alpha {
2532
+ syntax: "<percentage>";
2533
+ inherits: false;
2534
+ initial-value: 100%;
2535
+ }
2396
2536
  @property --tw-inset-shadow {
2397
2537
  syntax: "*";
2398
2538
  inherits: false;
@@ -2402,6 +2542,11 @@
2402
2542
  syntax: "*";
2403
2543
  inherits: false;
2404
2544
  }
2545
+ @property --tw-inset-shadow-alpha {
2546
+ syntax: "<percentage>";
2547
+ inherits: false;
2548
+ initial-value: 100%;
2549
+ }
2405
2550
  @property --tw-ring-color {
2406
2551
  syntax: "*";
2407
2552
  inherits: false;
@@ -2484,6 +2629,19 @@
2484
2629
  syntax: "*";
2485
2630
  inherits: false;
2486
2631
  }
2632
+ @property --tw-drop-shadow-color {
2633
+ syntax: "*";
2634
+ inherits: false;
2635
+ }
2636
+ @property --tw-drop-shadow-alpha {
2637
+ syntax: "<percentage>";
2638
+ inherits: false;
2639
+ initial-value: 100%;
2640
+ }
2641
+ @property --tw-drop-shadow-size {
2642
+ syntax: "*";
2643
+ inherits: false;
2644
+ }
2487
2645
  @property --tw-backdrop-blur {
2488
2646
  syntax: "*";
2489
2647
  inherits: false;
@@ -0,0 +1,7 @@
1
+ import type { PageTree } from 'fumadocs-core/server';
2
+ import type { Option } from '../components/layout/root-toggle.js';
3
+ export interface GetSidebarTabsOptions {
4
+ transform?: (option: Option, node: PageTree.Folder) => Option | null;
5
+ }
6
+ export declare function getSidebarTabs(pageTree: PageTree.Root, { transform }?: GetSidebarTabsOptions): Option[];
7
+ //# sourceMappingURL=get-sidebar-tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-sidebar-tabs.d.ts","sourceRoot":"","sources":["../../src/utils/get-sidebar-tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACtE;AAeD,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,CAAC,IAAI,EACvB,EAAE,SAA4B,EAAE,GAAE,qBAA0B,GAC3D,MAAM,EAAE,CA6BV"}
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const defaultTransform = (option, node) => {
3
+ if (!node.icon)
4
+ return option;
5
+ return {
6
+ ...option,
7
+ icon: (_jsx("div", { className: "rounded-md border bg-fd-secondary p-1 shadow-md [&_svg]:size-5", children: node.icon })),
8
+ };
9
+ };
10
+ export function getSidebarTabs(pageTree, { transform = defaultTransform } = {}) {
11
+ function findOptions(node) {
12
+ const results = [];
13
+ if (node.root) {
14
+ const urls = getFolderUrls(node);
15
+ if (urls.size > 0) {
16
+ const option = {
17
+ url: urls.values().next().value ?? '',
18
+ title: node.name,
19
+ icon: node.icon,
20
+ description: node.description,
21
+ urls,
22
+ };
23
+ const mapped = transform ? transform(option, node) : option;
24
+ if (mapped)
25
+ results.push(mapped);
26
+ }
27
+ }
28
+ for (const child of node.children) {
29
+ if (child.type === 'folder')
30
+ results.push(...findOptions(child));
31
+ }
32
+ return results;
33
+ }
34
+ return findOptions(pageTree);
35
+ }
36
+ function getFolderUrls(folder, output = new Set()) {
37
+ if (folder.index)
38
+ output.add(folder.index.url);
39
+ for (const child of folder.children) {
40
+ if (child.type === 'page' && !child.external)
41
+ output.add(child.url);
42
+ if (child.type === 'folder')
43
+ getFolderUrls(child, output);
44
+ }
45
+ return output;
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "15.2.2",
3
+ "version": "15.2.4",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -56,6 +56,10 @@
56
56
  "./theme/*": {
57
57
  "import": "./dist/theme/*.js",
58
58
  "types": "./dist/theme/*.d.ts"
59
+ },
60
+ "./utils/*": {
61
+ "import": "./dist/utils/*.js",
62
+ "types": "./dist/utils/*.d.ts"
59
63
  }
60
64
  },
61
65
  "files": [
@@ -74,25 +78,25 @@
74
78
  "@radix-ui/react-tabs": "^1.1.3",
75
79
  "class-variance-authority": "^0.7.1",
76
80
  "lodash.merge": "^4.6.2",
77
- "lucide-react": "^0.486.0",
81
+ "lucide-react": "^0.487.0",
78
82
  "next-themes": "^0.4.6",
79
83
  "postcss-selector-parser": "^7.1.0",
80
84
  "react-medium-image-zoom": "^5.2.14",
81
85
  "tailwind-merge": "^3.1.0",
82
- "fumadocs-core": "15.2.2"
86
+ "fumadocs-core": "15.2.4"
83
87
  },
84
88
  "devDependencies": {
85
89
  "@next/eslint-plugin-next": "^15.2.4",
86
- "@tailwindcss/cli": "^4.0.17",
90
+ "@tailwindcss/cli": "^4.1.1",
87
91
  "@types/lodash.merge": "^4.6.9",
88
- "@types/react": "^19.0.12",
89
- "@types/react-dom": "^19.0.4",
92
+ "@types/react": "^19.1.0",
93
+ "@types/react-dom": "^19.1.1",
90
94
  "next": "15.2.4",
91
- "tailwindcss": "^4.0.17",
95
+ "tailwindcss": "^4.1.1",
92
96
  "tsc-alias": "^1.8.13",
93
- "@fumadocs/cli": "0.1.0",
97
+ "@fumadocs/cli": "0.1.1",
94
98
  "eslint-config-custom": "0.0.0",
95
- "fumadocs-core": "15.2.2",
99
+ "fumadocs-core": "15.2.4",
96
100
  "tsconfig": "0.0.0"
97
101
  },
98
102
  "peerDependencies": {