fumadocs-ui 16.2.4 → 16.3.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.
- package/README.md +1 -1
- package/css/black.css +1 -39
- package/css/catppuccin.css +1 -49
- package/css/dusk.css +1 -47
- package/css/neutral.css +1 -7
- package/css/ocean.css +1 -48
- package/css/preset.css +1 -215
- package/css/purple.css +1 -39
- package/css/shadcn.css +1 -35
- package/css/solar.css +1 -75
- package/css/vitepress.css +1 -77
- package/dist/components/accordion.d.ts +5 -6
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +12 -14
- package/dist/components/banner.js +2 -2
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/callout.js +2 -2
- package/dist/components/card.js +1 -1
- package/dist/components/codeblock.d.ts +1 -1
- package/dist/components/codeblock.d.ts.map +1 -1
- package/dist/components/codeblock.js +5 -5
- package/dist/components/dialog/search.js +2 -2
- package/dist/components/dynamic-codeblock.js +1 -1
- package/dist/components/files.js +2 -2
- package/dist/components/github-info.js +2 -2
- package/dist/components/heading.js +2 -2
- package/dist/components/inline-toc.js +2 -2
- package/dist/components/sidebar/base.d.ts +2 -2
- package/dist/components/sidebar/base.d.ts.map +1 -1
- package/dist/components/sidebar/base.js +4 -4
- package/dist/components/sidebar/link-item.d.ts +1 -1
- package/dist/components/sidebar/link-item.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/dropdown.d.ts +1 -0
- package/dist/components/sidebar/tabs/dropdown.d.ts.map +1 -1
- package/dist/components/sidebar/tabs/dropdown.js +8 -3
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/toc/clerk.d.ts +1 -2
- package/dist/components/toc/clerk.d.ts.map +1 -1
- package/dist/components/toc/clerk.js +1 -76
- package/dist/components/toc/default.d.ts +1 -2
- package/dist/components/toc/default.d.ts.map +1 -1
- package/dist/components/toc/default.js +1 -19
- package/dist/components/toc/index.d.ts +1 -10
- package/dist/components/toc/index.d.ts.map +1 -1
- package/dist/components/toc/index.js +1 -64
- package/dist/components/type-table.js +2 -2
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +20 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/collapsible.d.ts +7 -4
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +6 -7
- package/dist/components/ui/navigation-menu.d.ts +2 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/scroll-area.d.ts +5 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +8 -8
- package/dist/components/{tabs.unstyled.d.ts → ui/tabs.d.ts} +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/{tabs.unstyled.js → ui/tabs.js} +1 -1
- package/dist/contexts/i18n.d.ts +1 -29
- package/dist/contexts/i18n.d.ts.map +1 -1
- package/dist/contexts/i18n.js +1 -23
- package/dist/contexts/search.d.ts +1 -60
- package/dist/contexts/search.d.ts.map +1 -1
- package/dist/contexts/search.js +1 -58
- package/dist/contexts/tree.d.ts +1 -14
- package/dist/contexts/tree.d.ts.map +1 -1
- package/dist/contexts/tree.js +1 -31
- package/dist/i18n.d.ts +1 -14
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +1 -16
- package/dist/layouts/docs/client.d.ts.map +1 -1
- package/dist/layouts/docs/client.js +3 -3
- package/dist/layouts/docs/index.js +4 -4
- package/dist/layouts/docs/page/client.js +6 -6
- package/dist/layouts/docs/page/index.js +2 -2
- package/dist/layouts/docs/sidebar.d.ts +1 -1
- package/dist/layouts/docs/sidebar.js +4 -4
- package/dist/layouts/home/client.d.ts +1 -1
- package/dist/layouts/home/client.js +4 -4
- package/dist/layouts/home/index.js +1 -1
- package/dist/layouts/home/navbar.d.ts +1 -1
- package/dist/layouts/home/navbar.d.ts.map +1 -1
- package/dist/layouts/home/navbar.js +1 -1
- package/dist/layouts/notebook/client.d.ts +3 -3
- package/dist/layouts/notebook/client.d.ts.map +1 -1
- package/dist/layouts/notebook/client.js +5 -5
- package/dist/layouts/notebook/index.js +4 -4
- package/dist/layouts/notebook/page/client.js +6 -6
- package/dist/layouts/notebook/page/index.js +2 -2
- package/dist/layouts/notebook/sidebar.d.ts +1 -1
- package/dist/layouts/notebook/sidebar.js +2 -2
- package/dist/layouts/shared/index.d.ts +2 -2
- package/dist/layouts/shared/index.d.ts.map +1 -1
- package/dist/layouts/shared/language-toggle.js +1 -1
- package/dist/layouts/shared/search-toggle.js +2 -2
- package/dist/layouts/shared/theme-toggle.js +2 -2
- package/dist/mdx.js +1 -1
- package/dist/mdx.server.d.ts +1 -1
- package/dist/mdx.server.d.ts.map +1 -1
- package/dist/mdx.server.js +1 -14
- package/dist/og.d.ts +1 -14
- package/dist/og.d.ts.map +1 -1
- package/dist/og.js +1 -45
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js +1 -1
- package/dist/provider/base.d.ts +3 -22
- package/dist/provider/base.d.ts.map +1 -1
- package/dist/provider/base.js +4 -34
- package/dist/style.css +64 -131
- package/dist/utils/use-copy-button.d.ts +1 -2
- package/dist/utils/use-copy-button.d.ts.map +1 -1
- package/dist/utils/use-copy-button.js +1 -27
- package/dist/utils/use-footer-items.d.ts +1 -5
- package/dist/utils/use-footer-items.d.ts.map +1 -1
- package/dist/utils/use-footer-items.js +1 -27
- package/dist/utils/use-is-scroll-top.d.ts +1 -3
- package/dist/utils/use-is-scroll-top.d.ts.map +1 -1
- package/dist/utils/use-is-scroll-top.js +1 -17
- package/package.json +12 -25
- package/css/colors/index.css +0 -51
- package/css/shiki.css +0 -90
- package/dist/components/tabs.unstyled.d.ts.map +0 -1
- package/dist/icons.d.ts +0 -49
- package/dist/icons.d.ts.map +0 -1
- package/dist/icons.js +0 -282
- package/dist/layouts/shared/link-item.d.ts +0 -78
- package/dist/layouts/shared/link-item.d.ts.map +0 -1
- package/dist/layouts/shared/link-item.js +0 -12
- package/dist/theme/typography/index.d.ts +0 -10
- package/dist/theme/typography/index.d.ts.map +0 -1
- package/dist/theme/typography/index.js +0 -137
- package/dist/theme/typography/styles.d.ts +0 -93
- package/dist/theme/typography/styles.d.ts.map +0 -1
- package/dist/theme/typography/styles.js +0 -433
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -1
- package/dist/utils/is-active.d.ts +0 -4
- package/dist/utils/is-active.d.ts.map +0 -1
- package/dist/utils/is-active.js +0 -15
- package/dist/utils/merge-refs.d.ts +0 -3
- package/dist/utils/merge-refs.d.ts.map +0 -1
- package/dist/utils/merge-refs.js +0 -12
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as Primitive from '@radix-ui/react-accordion';
|
|
4
|
+
import { ChevronRight } from '@fumadocs/ui/icons';
|
|
5
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
6
|
+
export function Accordion({ className, ...props }) {
|
|
7
|
+
return (_jsx(Primitive.Root, { className: cn('divide-y divide-fd-border overflow-hidden rounded-lg border bg-fd-card', className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
export function AccordionItem({ className, children, ...props }) {
|
|
10
|
+
return (_jsx(Primitive.Item, { className: cn('scroll-m-24', className), ...props, children: children }));
|
|
11
|
+
}
|
|
12
|
+
export function AccordionHeader({ className, children, ...props }) {
|
|
13
|
+
return (_jsx(Primitive.Header, { className: cn('not-prose flex flex-row items-center text-fd-card-foreground font-medium has-focus-visible:bg-fd-accent', className), ...props, children: children }));
|
|
14
|
+
}
|
|
15
|
+
export function AccordionTrigger({ className, children, ...props }) {
|
|
16
|
+
return (_jsxs(Primitive.Trigger, { className: cn('group flex flex-1 items-center gap-2 px-3 py-2.5 text-start focus-visible:outline-none', className), ...props, children: [_jsx(ChevronRight, { className: "size-4 shrink-0 text-fd-muted-foreground transition-transform duration-200 group-data-[state=open]:rotate-90" }), children] }));
|
|
17
|
+
}
|
|
18
|
+
export function AccordionContent({ className, children, ...props }) {
|
|
19
|
+
return (_jsx(Primitive.Content, { className: cn('overflow-hidden data-[state=closed]:animate-fd-accordion-up data-[state=open]:animate-fd-accordion-down', className), ...props, children: children }));
|
|
20
|
+
}
|
|
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
export declare const buttonVariants: (props?: ({
|
|
3
3
|
variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
|
|
4
4
|
color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type ButtonProps = VariantProps<typeof buttonVariants>;
|
|
8
8
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
declare const Collapsible: import("react").ForwardRefExoticComponent<
|
|
3
|
-
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<
|
|
4
|
-
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<Omit<
|
|
1
|
+
import * as Primitive from '@radix-ui/react-collapsible';
|
|
2
|
+
declare const Collapsible: import("react").ForwardRefExoticComponent<Primitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<Primitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<Omit<Primitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
6
|
+
export type CollapsibleProps = Primitive.CollapsibleProps;
|
|
7
|
+
export type CollapsibleContentProps = Primitive.CollapsibleContentProps;
|
|
8
|
+
export type CollapsibleTriggerProps = Primitive.CollapsibleTriggerProps;
|
|
6
9
|
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AAIzD,QAAA,MAAM,WAAW,uHAAiB,CAAC;AAEnC,QAAA,MAAM,kBAAkB,iIAA+B,CAAC;AAExD,QAAA,MAAM,kBAAkB,2LAwBtB,CAAC;AAIH,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAC;AAC1D,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,uBAAuB,CAAC;AACxE,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,uBAAuB,CAAC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
3
|
+
import * as Primitive from '@radix-ui/react-collapsible';
|
|
4
4
|
import { forwardRef, useEffect, useState } from 'react';
|
|
5
|
-
import { cn } from '
|
|
6
|
-
const Collapsible =
|
|
7
|
-
const CollapsibleTrigger =
|
|
5
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
6
|
+
const Collapsible = Primitive.Root;
|
|
7
|
+
const CollapsibleTrigger = Primitive.CollapsibleTrigger;
|
|
8
8
|
const CollapsibleContent = forwardRef(({ children, ...props }, ref) => {
|
|
9
9
|
const [mounted, setMounted] = useState(false);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
setMounted(true);
|
|
12
12
|
}, []);
|
|
13
|
-
return (_jsx(
|
|
13
|
+
return (_jsx(Primitive.CollapsibleContent, { ref: ref, ...props, className: cn('overflow-hidden', mounted &&
|
|
14
14
|
'data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down', props.className), children: children }));
|
|
15
15
|
});
|
|
16
|
-
CollapsibleContent.displayName =
|
|
17
|
-
CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
16
|
+
CollapsibleContent.displayName = Primitive.CollapsibleContent.displayName;
|
|
18
17
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as Primitive from '@radix-ui/react-navigation-menu';
|
|
3
|
+
export type NavigationMenuContentProps = Primitive.NavigationMenuContentProps;
|
|
4
|
+
export type NavigationMenuTriggerProps = Primitive.NavigationMenuTriggerProps;
|
|
3
5
|
declare const NavigationMenu: React.ForwardRefExoticComponent<Primitive.NavigationMenuProps & React.RefAttributes<HTMLElement>>;
|
|
4
6
|
declare const NavigationMenuList: React.ForwardRefExoticComponent<Primitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
|
|
5
7
|
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/navigation-menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAC;AAG7D,QAAA,MAAM,cAAc,mGAAiB,CAAC;AAEtC,QAAA,MAAM,kBAAkB,4GAAiB,CAAC;AAE1C,QAAA,MAAM,kBAAkB,2JAWtB,CAAC;AAIH,QAAA,MAAM,qBAAqB,sKAWzB,CAAC;AAGH,QAAA,MAAM,qBAAqB,gKAYzB,CAAC;AAGH,QAAA,MAAM,kBAAkB,6GAAiB,CAAC;AAE1C,QAAA,MAAM,sBAAsB,iKAa1B,CAAC;AAGH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,GACvB,CAAC"}
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/navigation-menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAC;AAG7D,MAAM,MAAM,0BAA0B,GAAG,SAAS,CAAC,0BAA0B,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,SAAS,CAAC,0BAA0B,CAAC;AAE9E,QAAA,MAAM,cAAc,mGAAiB,CAAC;AAEtC,QAAA,MAAM,kBAAkB,4GAAiB,CAAC;AAE1C,QAAA,MAAM,kBAAkB,2JAWtB,CAAC;AAIH,QAAA,MAAM,qBAAqB,sKAWzB,CAAC;AAGH,QAAA,MAAM,qBAAqB,gKAYzB,CAAC;AAGH,QAAA,MAAM,kBAAkB,6GAAiB,CAAC;AAE1C,QAAA,MAAM,sBAAsB,iKAa1B,CAAC;AAGH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,GACvB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as Primitive from '@radix-ui/react-navigation-menu';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
6
6
|
const NavigationMenu = Primitive.Root;
|
|
7
7
|
const NavigationMenuList = Primitive.List;
|
|
8
8
|
const NavigationMenuItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(Primitive.NavigationMenuItem, { ref: ref, className: cn('list-none', className), ...props, children: children })));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { cn } from '
|
|
5
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
6
6
|
const Popover = PopoverPrimitive.Root;
|
|
7
7
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8
8
|
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, side: "bottom", className: cn('z-50 origin-(--radix-popover-content-transform-origin) overflow-y-auto max-h-(--radix-popover-content-available-height) min-w-[240px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-lg p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in', className), ...props }) })));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as Primitive from '@radix-ui/react-scroll-area';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<
|
|
4
|
-
declare const ScrollViewport: React.ForwardRefExoticComponent<Omit<
|
|
5
|
-
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<
|
|
3
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<Primitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const ScrollViewport: React.ForwardRefExoticComponent<Omit<Primitive.ScrollAreaViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<Primitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export { ScrollArea, ScrollBar, ScrollViewport };
|
|
7
|
+
export type ScrollAreaProps = Primitive.ScrollAreaProps;
|
|
7
8
|
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../src/components/ui/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../src/components/ui/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,UAAU,qJAcd,CAAC;AAIH,QAAA,MAAM,cAAc,6JAWlB,CAAC;AAIH,QAAA,MAAM,SAAS,8JAiBb,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AACjD,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as Primitive from '@radix-ui/react-scroll-area';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { cn } from '
|
|
5
|
-
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(
|
|
6
|
-
ScrollArea.displayName =
|
|
7
|
-
const ScrollViewport = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(
|
|
8
|
-
ScrollViewport.displayName =
|
|
9
|
-
const ScrollBar = React.forwardRef(({ className, orientation = 'vertical', ...props }, ref) => (_jsx(
|
|
10
|
-
ScrollBar.displayName =
|
|
4
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
5
|
+
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(Primitive.Root, { ref: ref, type: "scroll", className: cn('overflow-hidden', className), ...props, children: [children, _jsx(Primitive.Corner, {}), _jsx(ScrollBar, { orientation: "vertical" })] })));
|
|
6
|
+
ScrollArea.displayName = Primitive.Root.displayName;
|
|
7
|
+
const ScrollViewport = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(Primitive.Viewport, { ref: ref, className: cn('size-full rounded-[inherit]', className), ...props, children: children })));
|
|
8
|
+
ScrollViewport.displayName = Primitive.Viewport.displayName;
|
|
9
|
+
const ScrollBar = React.forwardRef(({ className, orientation = 'vertical', ...props }, ref) => (_jsx(Primitive.Scrollbar, { ref: ref, orientation: orientation, className: cn('flex select-none data-[state=hidden]:animate-fd-fade-out', orientation === 'vertical' && 'h-full w-1.5', orientation === 'horizontal' && 'h-1.5 flex-col', className), ...props, children: _jsx(Primitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-fd-border" }) })));
|
|
10
|
+
ScrollBar.displayName = Primitive.Scrollbar.displayName;
|
|
11
11
|
export { ScrollArea, ScrollBar, ScrollViewport };
|
|
@@ -18,4 +18,4 @@ export declare const TabsList: import("react").ForwardRefExoticComponent<Primiti
|
|
|
18
18
|
export declare const TabsTrigger: import("react").ForwardRefExoticComponent<Primitive.TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
19
19
|
export declare function Tabs({ ref, groupId, persist, updateAnchor, defaultValue, value: _value, onValueChange: _onValueChange, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export declare function TabsContent({ value, ...props }: ComponentProps<typeof Primitive.TabsContent>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
//# sourceMappingURL=tabs.
|
|
21
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAQpB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAMlD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC;IACtE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAYD,eAAO,MAAM,QAAQ,oHAAqB,CAAC;AAE3C,eAAO,MAAM,WAAW,0HAAwB,CAAC;AAEjD,wBAAgB,IAAI,CAAC,EACnB,GAAG,EACH,OAAO,EACP,OAAe,EACf,YAAoB,EACpB,YAAY,EACZ,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACT,EAAE,SAAS,2CAqEX;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,WAAW,CAAC,2CAY9C"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, use, useEffectEvent, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
4
4
|
import * as Primitive from '@radix-ui/react-tabs';
|
|
5
|
-
import { mergeRefs } from '
|
|
5
|
+
import { mergeRefs } from '@fumadocs/ui/merge-refs';
|
|
6
6
|
const listeners = new Map();
|
|
7
7
|
const TabsContext = createContext(null);
|
|
8
8
|
function useTabContext() {
|
package/dist/contexts/i18n.d.ts
CHANGED
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
search: string;
|
|
3
|
-
searchNoResult: string;
|
|
4
|
-
toc: string;
|
|
5
|
-
tocNoHeadings: string;
|
|
6
|
-
lastUpdate: string;
|
|
7
|
-
chooseLanguage: string;
|
|
8
|
-
nextPage: string;
|
|
9
|
-
previousPage: string;
|
|
10
|
-
chooseTheme: string;
|
|
11
|
-
editOnGithub: string;
|
|
12
|
-
}
|
|
13
|
-
export interface LocaleItem {
|
|
14
|
-
name: string;
|
|
15
|
-
locale: string;
|
|
16
|
-
}
|
|
17
|
-
interface I18nContextType {
|
|
18
|
-
locale?: string;
|
|
19
|
-
onChange?: (v: string) => void;
|
|
20
|
-
text: Translations;
|
|
21
|
-
locales?: LocaleItem[];
|
|
22
|
-
}
|
|
23
|
-
export declare const defaultTranslations: Translations;
|
|
24
|
-
export declare const I18nContext: import("react").Context<I18nContextType>;
|
|
25
|
-
export declare function I18nLabel(props: {
|
|
26
|
-
label: keyof Translations;
|
|
27
|
-
}): string;
|
|
28
|
-
export declare function useI18n(): I18nContextType;
|
|
29
|
-
export {};
|
|
1
|
+
export * from '@fumadocs/ui/contexts/i18n';
|
|
30
2
|
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/contexts/i18n.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/contexts/i18n.tsx"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC"}
|
package/dist/contexts/i18n.js
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
export const defaultTranslations = {
|
|
4
|
-
search: 'Search',
|
|
5
|
-
searchNoResult: 'No results found',
|
|
6
|
-
toc: 'On this page',
|
|
7
|
-
tocNoHeadings: 'No Headings',
|
|
8
|
-
lastUpdate: 'Last updated on',
|
|
9
|
-
chooseLanguage: 'Choose a language',
|
|
10
|
-
nextPage: 'Next Page',
|
|
11
|
-
previousPage: 'Previous Page',
|
|
12
|
-
chooseTheme: 'Theme',
|
|
13
|
-
editOnGithub: 'Edit on GitHub',
|
|
14
|
-
};
|
|
15
|
-
export const I18nContext = createContext({
|
|
16
|
-
text: defaultTranslations,
|
|
17
|
-
});
|
|
18
|
-
export function I18nLabel(props) {
|
|
19
|
-
const { text } = useI18n();
|
|
20
|
-
return text[props.label];
|
|
21
|
-
}
|
|
22
|
-
export function useI18n() {
|
|
23
|
-
return useContext(I18nContext);
|
|
24
|
-
}
|
|
2
|
+
export * from '@fumadocs/ui/contexts/i18n';
|
|
@@ -1,61 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
interface HotKey {
|
|
3
|
-
display: ReactNode;
|
|
4
|
-
/**
|
|
5
|
-
* Key code or a function determining whether the key is pressed.
|
|
6
|
-
*/
|
|
7
|
-
key: string | ((e: KeyboardEvent) => boolean);
|
|
8
|
-
}
|
|
9
|
-
export interface SharedProps {
|
|
10
|
-
open: boolean;
|
|
11
|
-
onOpenChange: (open: boolean) => void;
|
|
12
|
-
}
|
|
13
|
-
export type SearchLink = [name: string, href: string];
|
|
14
|
-
export interface TagItem {
|
|
15
|
-
name: string;
|
|
16
|
-
value: string;
|
|
17
|
-
}
|
|
18
|
-
export interface SearchProviderProps {
|
|
19
|
-
/**
|
|
20
|
-
* Preload search dialog before opening it
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue `true`
|
|
23
|
-
*/
|
|
24
|
-
preload?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Custom links to be displayed if search is empty
|
|
27
|
-
*/
|
|
28
|
-
links?: SearchLink[];
|
|
29
|
-
/**
|
|
30
|
-
* Hotkeys for triggering search dialog
|
|
31
|
-
*
|
|
32
|
-
* @defaultValue Meta/Ctrl + K
|
|
33
|
-
*/
|
|
34
|
-
hotKey?: HotKey[];
|
|
35
|
-
/**
|
|
36
|
-
* Replace default search dialog, allowing you to use other solutions such as Algolia Search
|
|
37
|
-
*
|
|
38
|
-
* It receives the `open` and `onOpenChange` prop, can be lazy loaded with `next/dynamic`
|
|
39
|
-
*/
|
|
40
|
-
SearchDialog: ComponentType<SharedProps>;
|
|
41
|
-
/**
|
|
42
|
-
* Additional props to the dialog
|
|
43
|
-
*/
|
|
44
|
-
options?: Partial<SharedProps & Record<string, unknown>>;
|
|
45
|
-
children?: ReactNode;
|
|
46
|
-
}
|
|
47
|
-
interface SearchContextType {
|
|
48
|
-
enabled: boolean;
|
|
49
|
-
hotKey: HotKey[];
|
|
50
|
-
setOpenSearch: (value: boolean) => void;
|
|
51
|
-
}
|
|
52
|
-
export declare function useSearchContext(): SearchContextType;
|
|
53
|
-
export declare function SearchProvider({ SearchDialog, children, preload, options, hotKey, links, }: SearchProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
/**
|
|
55
|
-
* Show children only when search is enabled via React Context
|
|
56
|
-
*/
|
|
57
|
-
export declare function SearchOnly({ children }: {
|
|
58
|
-
children: ReactNode;
|
|
59
|
-
}): ReactNode;
|
|
60
|
-
export {};
|
|
1
|
+
export * from '@fumadocs/ui/contexts/search';
|
|
61
2
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/contexts/search.tsx"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/contexts/search.tsx"],"names":[],"mappings":"AACA,cAAc,8BAA8B,CAAC"}
|
package/dist/contexts/search.js
CHANGED
|
@@ -1,59 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useMemo, useState, createContext, use, useEffectEvent, } from 'react';
|
|
4
|
-
const SearchContext = createContext({
|
|
5
|
-
enabled: false,
|
|
6
|
-
hotKey: [],
|
|
7
|
-
setOpenSearch: () => undefined,
|
|
8
|
-
});
|
|
9
|
-
export function useSearchContext() {
|
|
10
|
-
return use(SearchContext);
|
|
11
|
-
}
|
|
12
|
-
function MetaOrControl() {
|
|
13
|
-
const [key, setKey] = useState('⌘');
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const isWindows = window.navigator.userAgent.includes('Windows');
|
|
16
|
-
if (isWindows)
|
|
17
|
-
setKey('Ctrl');
|
|
18
|
-
}, []);
|
|
19
|
-
return key;
|
|
20
|
-
}
|
|
21
|
-
export function SearchProvider({ SearchDialog, children, preload = true, options, hotKey = [
|
|
22
|
-
{
|
|
23
|
-
key: (e) => e.metaKey || e.ctrlKey,
|
|
24
|
-
display: _jsx(MetaOrControl, {}),
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
key: 'k',
|
|
28
|
-
display: 'K',
|
|
29
|
-
},
|
|
30
|
-
], links, }) {
|
|
31
|
-
const [isOpen, setIsOpen] = useState(preload ? false : undefined);
|
|
32
|
-
const onKeyDown = useEffectEvent((e) => {
|
|
33
|
-
if (hotKey.every((v) => typeof v.key === 'string' ? e.key === v.key : v.key(e))) {
|
|
34
|
-
setIsOpen((open) => !open);
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
window.addEventListener('keydown', onKeyDown);
|
|
40
|
-
return () => {
|
|
41
|
-
window.removeEventListener('keydown', onKeyDown);
|
|
42
|
-
};
|
|
43
|
-
}, [hotKey]);
|
|
44
|
-
return (_jsxs(SearchContext, { value: useMemo(() => ({
|
|
45
|
-
enabled: true,
|
|
46
|
-
hotKey,
|
|
47
|
-
setOpenSearch: setIsOpen,
|
|
48
|
-
}), [hotKey]), children: [isOpen !== undefined && (_jsx(SearchDialog, { open: isOpen, onOpenChange: setIsOpen,
|
|
49
|
-
// @ts-expect-error -- insert prop for official UIs
|
|
50
|
-
links: links, ...options })), children] }));
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Show children only when search is enabled via React Context
|
|
54
|
-
*/
|
|
55
|
-
export function SearchOnly({ children }) {
|
|
56
|
-
const search = useSearchContext();
|
|
57
|
-
if (search.enabled)
|
|
58
|
-
return children;
|
|
59
|
-
}
|
|
2
|
+
export * from '@fumadocs/ui/contexts/search';
|
package/dist/contexts/tree.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
3
|
-
type MakeRequired<O, K extends keyof O> = Omit<O, K> & Pick<Required<O>, K>;
|
|
4
|
-
interface TreeContextType {
|
|
5
|
-
root: MakeRequired<PageTree.Root | PageTree.Folder, '$id'>;
|
|
6
|
-
full: PageTree.Root;
|
|
7
|
-
}
|
|
8
|
-
export declare function TreeContextProvider({ tree: rawTree, children, }: {
|
|
9
|
-
tree: PageTree.Root;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare function useTreePath(): PageTree.Node[];
|
|
13
|
-
export declare function useTreeContext(): TreeContextType;
|
|
14
|
-
export {};
|
|
1
|
+
export * from '@fumadocs/ui/contexts/tree';
|
|
15
2
|
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/contexts/tree.tsx"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/contexts/tree.tsx"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC"}
|
package/dist/contexts/tree.js
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import { usePathname } from 'fumadocs-core/framework';
|
|
4
|
-
import { useMemo, useRef, createContext, use } from 'react';
|
|
5
|
-
import { searchPath } from 'fumadocs-core/breadcrumb';
|
|
6
|
-
const TreeContext = createContext(null);
|
|
7
|
-
const PathContext = createContext([]);
|
|
8
|
-
export function TreeContextProvider({ tree: rawTree, children, }) {
|
|
9
|
-
const nextIdRef = useRef(0);
|
|
10
|
-
const pathname = usePathname();
|
|
11
|
-
// I found that object-typed props passed from a RSC will be re-constructed, hence breaking all hooks' dependencies
|
|
12
|
-
// using the id here to make sure this never happens
|
|
13
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
-
const tree = useMemo(() => rawTree, [rawTree.$id ?? rawTree]);
|
|
15
|
-
const path = useMemo(() => {
|
|
16
|
-
return (searchPath(tree.children, pathname) ??
|
|
17
|
-
(tree.fallback ? searchPath(tree.fallback.children, pathname) : null) ??
|
|
18
|
-
[]);
|
|
19
|
-
}, [tree, pathname]);
|
|
20
|
-
const root = path.findLast((item) => item.type === 'folder' && item.root) ?? tree;
|
|
21
|
-
root.$id ?? (root.$id = String(nextIdRef.current++));
|
|
22
|
-
return (_jsx(TreeContext, { value: useMemo(() => ({ root, full: tree }), [root, tree]), children: _jsx(PathContext, { value: path, children: children }) }));
|
|
23
|
-
}
|
|
24
|
-
export function useTreePath() {
|
|
25
|
-
return use(PathContext);
|
|
26
|
-
}
|
|
27
|
-
export function useTreeContext() {
|
|
28
|
-
const ctx = use(TreeContext);
|
|
29
|
-
if (!ctx)
|
|
30
|
-
throw new Error('You must wrap this component under <DocsLayout />');
|
|
31
|
-
return ctx;
|
|
32
|
-
}
|
|
2
|
+
export * from '@fumadocs/ui/contexts/tree';
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { I18nProviderProps } from './provider/base.js';
|
|
3
|
-
import type { I18nConfig } from 'fumadocs-core/i18n';
|
|
4
|
-
export type { I18nProviderProps, Translations };
|
|
5
|
-
export { defaultTranslations } from './contexts/i18n.js';
|
|
6
|
-
export declare function defineI18nUI<Languages extends string>(config: I18nConfig<Languages>, options: {
|
|
7
|
-
translations: {
|
|
8
|
-
[K in Languages]?: Partial<Translations> & {
|
|
9
|
-
displayName?: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
}): {
|
|
13
|
-
provider(locale?: string): I18nProviderProps;
|
|
14
|
-
};
|
|
1
|
+
export * from '@fumadocs/ui/i18n';
|
|
15
2
|
//# sourceMappingURL=i18n.d.ts.map
|
package/dist/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
package/dist/i18n.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function defineI18nUI(config, options) {
|
|
3
|
-
const { translations } = options;
|
|
4
|
-
return {
|
|
5
|
-
provider(locale = config.defaultLanguage) {
|
|
6
|
-
return {
|
|
7
|
-
locale,
|
|
8
|
-
translations: translations[locale],
|
|
9
|
-
locales: config.languages.map((locale) => ({
|
|
10
|
-
locale,
|
|
11
|
-
name: translations[locale]?.displayName ?? locale,
|
|
12
|
-
})),
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
1
|
+
export * from '@fumadocs/ui/i18n';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/client.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,eAAO,MAAM,aAAa;sBACN,OAAO;SACZ,CAAC;AAEhB,wBAAgB,qBAAqB,CAAC,EACpC,kBAA2B,EAC3B,QAAQ,GACT,EAAE;IACD,kBAAkB,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAkBA;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,2CAQ3D;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,2CA8BvB;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB,2CA6BA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, use, useMemo, } from 'react';
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
5
5
|
import { useSidebar } from '../../components/sidebar/base.js';
|
|
6
6
|
import { usePathname } from 'fumadocs-core/framework';
|
|
7
|
-
import { isTabActive } from '../../utils/is-active.js';
|
|
8
7
|
import Link from 'fumadocs-core/link';
|
|
9
|
-
import {
|
|
8
|
+
import { isTabActive } from '../../components/sidebar/tabs/dropdown.js';
|
|
9
|
+
import { useIsScrollTop } from '@fumadocs/ui/hooks/use-is-scroll-top';
|
|
10
10
|
export const LayoutContext = createContext(null);
|
|
11
11
|
export function LayoutContextProvider({ navTransparentMode = 'none', children, }) {
|
|
12
12
|
const isTop = useIsScrollTop({ enabled: navTransparentMode === 'top' }) ?? true;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, } from 'react';
|
|
3
|
-
import { Languages, Sidebar as SidebarIcon } from '
|
|
4
|
-
import { cn } from '
|
|
3
|
+
import { Languages, Sidebar as SidebarIcon } from '@fumadocs/ui/icons';
|
|
4
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
5
5
|
import { buttonVariants } from '../../components/ui/button.js';
|
|
6
6
|
import { Sidebar, SidebarCollapseTrigger, SidebarContent, SidebarDrawer, SidebarLinkItem, SidebarPageTree, SidebarTrigger, SidebarViewport, } from './sidebar.js';
|
|
7
7
|
import { resolveLinkItems } from '../../layouts/shared/index.js';
|
|
8
|
-
import { LinkItem } from '
|
|
8
|
+
import { LinkItem } from '@fumadocs/ui/link-item';
|
|
9
9
|
import { LanguageToggle, LanguageToggleText, } from '../../layouts/shared/language-toggle.js';
|
|
10
|
-
import {
|
|
10
|
+
import { LayoutBody, LayoutContextProvider, LayoutHeader, LayoutTabs, } from './client.js';
|
|
11
11
|
import { TreeContextProvider } from '../../contexts/tree.js';
|
|
12
12
|
import { ThemeToggle } from '../shared/theme-toggle.js';
|
|
13
13
|
import Link from 'fumadocs-core/link';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment, useEffect, useEffectEvent,
|
|
4
|
-
import { ChevronDown, ChevronLeft, ChevronRight } from '
|
|
3
|
+
import { createContext, Fragment, use, useEffect, useEffectEvent, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from '@fumadocs/ui/icons';
|
|
5
5
|
import Link from 'fumadocs-core/link';
|
|
6
|
-
import { cn } from '
|
|
6
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
7
7
|
import { useI18n } from '../../../contexts/i18n.js';
|
|
8
8
|
import { useTreeContext, useTreePath } from '../../../contexts/tree.js';
|
|
9
9
|
import { usePathname } from 'fumadocs-core/framework';
|
|
10
10
|
import { getBreadcrumbItemsFromPath, } from 'fumadocs-core/breadcrumb';
|
|
11
|
-
import { isActive } from '
|
|
11
|
+
import { isActive } from '@fumadocs/ui/urls';
|
|
12
12
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../../components/ui/collapsible.js';
|
|
13
13
|
import { useTOCItems } from '../../../components/toc/index.js';
|
|
14
14
|
import { useActiveAnchor } from 'fumadocs-core/toc';
|
|
15
15
|
import { LayoutContext } from '../client.js';
|
|
16
|
-
import { useFooterItems } from '
|
|
16
|
+
import { useFooterItems } from '@fumadocs/ui/hooks/use-footer-items';
|
|
17
17
|
const TocPopoverContext = createContext(null);
|
|
18
18
|
export function PageTOCPopover({ className, children, ...rest }) {
|
|
19
19
|
const ref = useRef(null);
|
|
@@ -44,7 +44,7 @@ export function PageTOCPopoverTrigger({ className, ...props }) {
|
|
|
44
44
|
const selected = useMemo(() => items.findIndex((item) => active === item.url.slice(1)), [items, active]);
|
|
45
45
|
const path = useTreePath().at(-1);
|
|
46
46
|
const showItem = selected !== -1 && !open;
|
|
47
|
-
return (_jsxs(CollapsibleTrigger, { className: cn('flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6', className), "data-toc-popover-trigger": "", ...props, children: [_jsx(ProgressCircle, { value: (selected + 1) / Math.max(1, items.length), max: 1, className: cn('shrink-0', open && 'text-fd-primary') }), _jsxs("span", { className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1", children: [_jsx("span", { className: cn('truncate transition-
|
|
47
|
+
return (_jsxs(CollapsibleTrigger, { className: cn('flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6', className), "data-toc-popover-trigger": "", ...props, children: [_jsx(ProgressCircle, { value: (selected + 1) / Math.max(1, items.length), max: 1, className: cn('shrink-0', open && 'text-fd-primary') }), _jsxs("span", { className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1", children: [_jsx("span", { className: cn('truncate transition-[opacity,translate,color]', open && 'text-fd-foreground', showItem && 'opacity-0 -translate-y-full pointer-events-none'), children: path?.name ?? text.toc }), _jsx("span", { className: cn('truncate transition-[opacity,translate]', !showItem && 'opacity-0 translate-y-full pointer-events-none'), children: items[selected]?.title })] }), _jsx(ChevronDown, { className: cn('shrink-0 transition-transform mx-0.5', open && 'rotate-180') })] }));
|
|
48
48
|
}
|
|
49
49
|
function clamp(input, min, max) {
|
|
50
50
|
if (input < min)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '
|
|
2
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
3
3
|
import { buttonVariants } from '../../../components/ui/button.js';
|
|
4
|
-
import { Edit, Text } from '
|
|
4
|
+
import { Edit, Text } from '@fumadocs/ui/icons';
|
|
5
5
|
import { I18nLabel } from '../../../contexts/i18n.js';
|
|
6
6
|
import { PageBreadcrumb, PageFooter, PageTOCPopover, PageTOCPopoverContent, PageTOCPopoverTrigger, } from './client.js';
|
|
7
7
|
import * as TocDefault from '../../../components/toc/default.js';
|
|
@@ -10,7 +10,7 @@ export declare function SidebarFolderLink({ className, style, ...props }: Compon
|
|
|
10
10
|
export declare function SidebarFolderContent({ className, children, ...props }: ComponentProps<typeof Base.SidebarFolderContent>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const SidebarPageTree: (components: Partial<import("../../components/sidebar/page-tree.js").SidebarPageTreeComponents>) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare const SidebarLinkItem: ({ item, ...props }: import("react").HTMLAttributes<HTMLElement> & {
|
|
13
|
-
item: Exclude<import("
|
|
13
|
+
item: Exclude<import("@fumadocs/ui/link-item").LinkItemType, {
|
|
14
14
|
type: "icon";
|
|
15
15
|
}>;
|
|
16
16
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as Base from '../../components/sidebar/base.js';
|
|
4
|
-
import { cn } from '
|
|
4
|
+
import { cn } from '@fumadocs/ui/cn';
|
|
5
5
|
import { useRef } from 'react';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
7
7
|
import { createPageTreeRenderer } from '../../components/sidebar/page-tree.js';
|
|
8
8
|
import { createLinkItemRenderer } from '../../components/sidebar/link-item.js';
|
|
9
9
|
import { buttonVariants } from '../../components/ui/button.js';
|
|
10
10
|
import { SearchToggle } from '../../layouts/shared/search-toggle.js';
|
|
11
|
-
import { Sidebar as SidebarIcon } from '
|
|
12
|
-
import { mergeRefs } from '
|
|
11
|
+
import { Sidebar as SidebarIcon } from '@fumadocs/ui/icons';
|
|
12
|
+
import { mergeRefs } from '@fumadocs/ui/merge-refs';
|
|
13
13
|
const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-lg p-2 text-start text-fd-muted-foreground wrap-anywhere [&_svg]:size-4 [&_svg]:shrink-0', {
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
@@ -35,7 +35,7 @@ export function SidebarContent({ ref: refProp, className, children, ...props })
|
|
|
35
35
|
], ref.current &&
|
|
36
36
|
(ref.current.getAttribute('data-collapsed') === 'true') !==
|
|
37
37
|
collapsed &&
|
|
38
|
-
'transition-[width,inset-block,translate,background-color]', className), ...props, ...rest, children: children })] }), _jsxs("div", { "data-sidebar-panel": "", className: cn('fixed flex top-[calc(--spacing(4)+var(--fd-
|
|
38
|
+
'transition-[width,inset-block,translate,background-color]', className), ...props, ...rest, children: children })] }), _jsxs("div", { "data-sidebar-panel": "", className: cn('fixed flex top-[calc(--spacing(4)+var(--fd-docs-row-3))] start-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10', (!collapsed || hovered) && 'pointer-events-none opacity-0'), children: [_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
|
|
39
39
|
color: 'ghost',
|
|
40
40
|
size: 'icon-sm',
|
|
41
41
|
className: 'rounded-lg',
|