fumadocs-ui 14.7.3 → 14.7.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.
- package/dist/components/banner.d.ts.map +1 -1
- package/dist/components/banner.js +3 -1
- package/dist/components/ui/navigation-menu.d.ts +1 -1
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +3 -1
- package/dist/layouts/home/menu.d.ts +10 -0
- package/dist/layouts/home/menu.d.ts.map +1 -1
- package/dist/layouts/home/menu.js +16 -4
- package/dist/layouts/home/navbar.d.ts +2 -2
- package/dist/layouts/home/navbar.d.ts.map +1 -1
- package/dist/layouts/home/navbar.js +5 -5
- package/dist/layouts/home.d.ts +9 -1
- package/dist/layouts/home.d.ts.map +1 -1
- package/dist/layouts/home.js +5 -9
- package/dist/style.css +0 -3
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAoC,MAAM,OAAO,CAAC;AAK9E,wBAAgB,MAAM,CAAC,EACrB,EAAE,EACF,OAAkB,EAClB,YAAmB,EACnB,MAAe,EACf,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAoC,MAAM,OAAO,CAAC;AAK9E,wBAAgB,MAAM,CAAC,EACrB,EAAE,EACF,OAAkB,EAClB,YAAmB,EACnB,MAAe,EACf,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,kDAoEA"}
|
|
@@ -18,7 +18,9 @@ export function Banner({ id, variant = 'normal', changeLayout = true, height = '
|
|
|
18
18
|
}, [globalKey]);
|
|
19
19
|
if (!open)
|
|
20
20
|
return null;
|
|
21
|
-
return (_jsxs("div", { id: id, ...props, className: cn('sticky top-0 z-40 flex
|
|
21
|
+
return (_jsxs("div", { id: id, ...props, className: cn('sticky top-0 z-40 flex flex-row items-center justify-center bg-fd-secondary px-4 text-center text-sm font-medium', variant === 'rainbow' && 'bg-fd-background', !open && 'hidden', props.className), style: {
|
|
22
|
+
height,
|
|
23
|
+
}, children: [changeLayout && open ? (_jsx("style", { children: globalKey
|
|
22
24
|
? `:root:not(.${globalKey}) { --fd-banner-height: ${height}; }`
|
|
23
25
|
: `:root { --fd-banner-height: ${height}; }` })) : null, globalKey ? (_jsx("style", { children: `.${globalKey} #${id} { display: none; }` })) : null, globalKey ? (_jsx("script", { dangerouslySetInnerHTML: {
|
|
24
26
|
__html: `if (localStorage.getItem('${globalKey}') === 'true') document.documentElement.classList.add('${globalKey}');`,
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import * as Primitive from '@radix-ui/react-navigation-menu';
|
|
3
3
|
declare const NavigationMenu: React.ForwardRefExoticComponent<Primitive.NavigationMenuProps & React.RefAttributes<HTMLElement>>;
|
|
4
4
|
declare const NavigationMenuList: React.ForwardRefExoticComponent<Primitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
|
|
5
|
-
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Primitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
5
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
6
6
|
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<Primitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const NavigationMenuLink: React.ForwardRefExoticComponent<Primitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/navigation-menu.tsx"],"names":[],"mappings":"
|
|
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,10 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import * as Primitive from '@radix-ui/react-navigation-menu';
|
|
4
5
|
import { cn } from '../../utils/cn';
|
|
5
6
|
const NavigationMenu = Primitive.Root;
|
|
6
7
|
const NavigationMenuList = Primitive.List;
|
|
7
|
-
const NavigationMenuItem = Primitive.
|
|
8
|
+
const NavigationMenuItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(Primitive.NavigationMenuItem, { ref: ref, className: cn('list-none', className), ...props, children: children })));
|
|
9
|
+
NavigationMenuItem.displayName = Primitive.NavigationMenuItem.displayName;
|
|
8
10
|
const NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(Primitive.Trigger, { ref: ref, className: cn('data-[state=open]:bg-fd-accent/50', className), ...props, children: children })));
|
|
9
11
|
NavigationMenuTrigger.displayName = Primitive.Trigger.displayName;
|
|
10
12
|
const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(Primitive.Content, { ref: ref, className: cn('absolute inset-x-0 top-0 data-[motion=from-end]:animate-fd-enterFromRight data-[motion=from-start]:animate-fd-enterFromLeft data-[motion=to-end]:animate-fd-exitToRight data-[motion=to-start]:animate-fd-exitToLeft', className), ...props })));
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { type LinkItemType } from '../../layouts/links';
|
|
2
|
+
import { NavigationMenuContent, NavigationMenuTrigger } from '../../components/ui/navigation-menu';
|
|
3
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
4
|
export declare function MenuLinkItem({ item, ...props }: {
|
|
3
5
|
item: LinkItemType;
|
|
4
6
|
className?: string;
|
|
5
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Menu: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
9
|
+
export declare function MenuTrigger({ enableHover, ...props }: ComponentPropsWithoutRef<typeof NavigationMenuTrigger> & {
|
|
10
|
+
/**
|
|
11
|
+
* Enable hover to trigger
|
|
12
|
+
*/
|
|
13
|
+
enableHover?: boolean;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function MenuContent(props: ComponentPropsWithoutRef<typeof NavigationMenuContent>): import("react/jsx-runtime").JSX.Element;
|
|
6
16
|
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/menu.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EACL,qBAAqB,EAGrB,qBAAqB,EACtB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAqBtD,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA6CA;AAED,eAAO,MAAM,IAAI,yNAAqB,CAAC;AAEvC,wBAAgB,WAAW,CAAC,EAC1B,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,GAAG;IAC1D;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,2CAgBA;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,2CAU9D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { BaseLinkItem } from '../../layouts/links';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
|
-
import { NavigationMenuLink } from '../../components/ui/navigation-menu';
|
|
5
|
+
import { NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuTrigger, } from '../../components/ui/navigation-menu';
|
|
6
6
|
import Link from 'fumadocs-core/link';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { buttonVariants } from '../../components/ui/button';
|
|
@@ -27,7 +27,19 @@ const menuItemVariants = cva('', {
|
|
|
27
27
|
export function MenuLinkItem({ item, ...props }) {
|
|
28
28
|
if (item.type === 'custom')
|
|
29
29
|
return _jsx("div", { className: cn('grid', props.className), children: item.children });
|
|
30
|
-
if (item.type === 'menu')
|
|
31
|
-
|
|
30
|
+
if (item.type === 'menu') {
|
|
31
|
+
const header = (_jsxs(_Fragment, { children: [item.icon, item.text] }));
|
|
32
|
+
return (_jsxs("div", { className: cn('mb-4 flex flex-col', props.className), children: [_jsx("p", { className: "mb-1 text-sm text-fd-muted-foreground", children: item.url ? (_jsx(NavigationMenuLink, { asChild: true, children: _jsx(Link, { href: item.url, children: header }) })) : (header) }), item.items.map((child, i) => (_jsx(MenuLinkItem, { item: child }, i)))] }));
|
|
33
|
+
}
|
|
32
34
|
return (_jsx(NavigationMenuLink, { asChild: true, children: _jsxs(BaseLinkItem, { item: item, className: cn(menuItemVariants({ variant: item.type }), props.className), "aria-label": item.type === 'icon' ? item.label : undefined, children: [item.icon, item.type === 'icon' ? undefined : item.text] }) }));
|
|
33
35
|
}
|
|
36
|
+
export const Menu = NavigationMenuItem;
|
|
37
|
+
export function MenuTrigger({ enableHover = false, ...props }) {
|
|
38
|
+
return (_jsx(NavigationMenuTrigger, { ...props, onPointerMove: enableHover ? undefined : (e) => e.preventDefault(), className: cn(buttonVariants({
|
|
39
|
+
size: 'icon',
|
|
40
|
+
color: 'ghost',
|
|
41
|
+
}), props.className), children: props.children }));
|
|
42
|
+
}
|
|
43
|
+
export function MenuContent(props) {
|
|
44
|
+
return (_jsx(NavigationMenuContent, { ...props, className: cn('flex flex-col p-4', props.className), children: props.children }));
|
|
45
|
+
}
|
|
@@ -4,13 +4,13 @@ import { type LinkProps } from 'fumadocs-core/link';
|
|
|
4
4
|
import { BaseLinkItem } from '../../layouts/links';
|
|
5
5
|
import type { NavigationMenuContentProps, NavigationMenuTriggerProps } from '@radix-ui/react-navigation-menu';
|
|
6
6
|
export declare function Navbar(props: HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const NavbarMenu: import("react").ForwardRefExoticComponent<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
7
|
+
export declare const NavbarMenu: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
8
8
|
export declare function NavbarMenuContent(props: NavigationMenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare function NavbarMenuTrigger(props: NavigationMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function NavbarMenuLink(props: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
declare const linkVariants: (props?: ({
|
|
11
12
|
variant?: "button" | "main" | "icon" | null | undefined;
|
|
12
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
14
|
export declare function NavbarLink({ item, variant, ...props }: ComponentProps<typeof BaseLinkItem> & VariantProps<typeof linkVariants>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare function NavbarMenuItem(props: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=navbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/navbar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AAOzC,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAwBxD;AAED,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"navbar.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/navbar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAa,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AAOzC,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,2CAwBxD;AAED,eAAO,MAAM,UAAU,yNAAqB,CAAC;AAE7C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,0BAA0B,2CAYlE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,0BAA0B,2CASlE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,2CAc9C;AAED,QAAA,MAAM,YAAY;;8EAiBhB,CAAC;AAEH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,YAAY,CAAC,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,2CAczE"}
|
|
@@ -22,7 +22,10 @@ export function NavbarMenuContent(props) {
|
|
|
22
22
|
export function NavbarMenuTrigger(props) {
|
|
23
23
|
return (_jsx(NavigationMenuTrigger, { ...props, className: cn(navItemVariants(), 'rounded-md', props.className), children: props.children }));
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
export function NavbarMenuLink(props) {
|
|
26
|
+
return (_jsx(NavigationMenuLink, { asChild: true, children: _jsx(Link, { ...props, className: cn('flex flex-col gap-2 rounded-lg border bg-fd-card p-3 transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground', props.className), children: props.children }) }));
|
|
27
|
+
}
|
|
28
|
+
const linkVariants = cva('', {
|
|
26
29
|
variants: {
|
|
27
30
|
variant: {
|
|
28
31
|
main: navItemVariants(),
|
|
@@ -41,8 +44,5 @@ const linkVariants = cva(undefined, {
|
|
|
41
44
|
},
|
|
42
45
|
});
|
|
43
46
|
export function NavbarLink({ item, variant, ...props }) {
|
|
44
|
-
return (_jsx(NavigationMenuItem, {
|
|
45
|
-
}
|
|
46
|
-
export function NavbarMenuItem(props) {
|
|
47
|
-
return (_jsx(NavigationMenuLink, { asChild: true, children: _jsx(Link, { ...props, className: cn('flex flex-col gap-2 rounded-lg border bg-fd-card p-3 transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground', props.className) }) }));
|
|
47
|
+
return (_jsx(NavigationMenuItem, { children: _jsx(NavigationMenuLink, { asChild: true, children: _jsx(BaseLinkItem, { ...props, item: item, className: cn(linkVariants({ variant }), props.className), children: props.children }) }) }));
|
|
48
48
|
}
|
package/dist/layouts/home.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import { type NavOptions } from '../layouts/shared';
|
|
2
3
|
import { type BaseLayoutProps } from './shared';
|
|
3
|
-
export
|
|
4
|
+
export interface HomeLayoutProps extends BaseLayoutProps, HTMLAttributes<HTMLElement> {
|
|
5
|
+
nav?: Partial<NavOptions & {
|
|
6
|
+
/**
|
|
7
|
+
* Open mobile menu when hovering the trigger
|
|
8
|
+
*/
|
|
9
|
+
enableHoverToOpen?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
4
12
|
export declare function HomeLayout(props: HomeLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
5
13
|
//# sourceMappingURL=home.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/layouts/home.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AA+B1D,MAAM,WAAW,eACf,SAAQ,eAAe,EACrB,cAAc,CAAC,WAAW,CAAC;IAC7B,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CA0BhD"}
|
package/dist/layouts/home.js
CHANGED
|
@@ -3,16 +3,15 @@ import { replaceOrDefault } from '../layouts/shared';
|
|
|
3
3
|
import { cn } from '../utils/cn';
|
|
4
4
|
import { getLinks } from './shared';
|
|
5
5
|
import { NavProvider, Title } from '../components/layout/nav';
|
|
6
|
-
import {
|
|
7
|
-
import { Navbar, NavbarLink, NavbarMenu, NavbarMenuContent,
|
|
6
|
+
import { NavigationMenuList } from '../components/ui/navigation-menu';
|
|
7
|
+
import { Navbar, NavbarLink, NavbarMenu, NavbarMenuContent, NavbarMenuLink, NavbarMenuTrigger, } from '../layouts/home/navbar';
|
|
8
8
|
import { LargeSearchToggle, SearchToggle, } from '../components/layout/search-toggle';
|
|
9
9
|
import { ThemeToggle } from '../components/layout/theme-toggle';
|
|
10
10
|
import { LanguageToggle, LanguageToggleText, } from '../components/layout/language-toggle';
|
|
11
11
|
import { ChevronDown, Languages } from 'lucide-react';
|
|
12
|
-
import { buttonVariants } from '../components/ui/button';
|
|
13
12
|
import { SearchOnly } from '../contexts/search';
|
|
14
13
|
import Link from 'fumadocs-core/link';
|
|
15
|
-
import { MenuLinkItem } from '../layouts/home/menu';
|
|
14
|
+
import { Menu, MenuContent, MenuLinkItem, MenuTrigger, } from '../layouts/home/menu';
|
|
16
15
|
export function HomeLayout(props) {
|
|
17
16
|
const { nav, links, githubUrl, i18n: _i18n, disableThemeSwitch: _disableThemeSwitch, ...rest } = props;
|
|
18
17
|
const finalLinks = getLinks(links, githubUrl);
|
|
@@ -25,10 +24,7 @@ function Header({ nav: { enableSearch = true, ...nav } = {}, i18n = false, final
|
|
|
25
24
|
const menuItems = finalLinks.filter((item) => ['menu', 'all'].includes(item.on ?? 'all'));
|
|
26
25
|
return (_jsxs(Navbar, { children: [_jsx(Title, { title: nav.title, url: nav.url }), nav.children, _jsx(NavigationMenuList, { className: "flex flex-row items-center gap-2 max-sm:hidden", children: navItems
|
|
27
26
|
.filter((item) => !isSecondary(item))
|
|
28
|
-
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-1 flex-row items-center justify-end lg:gap-1.5", children: [enableSearch ? (_jsxs(SearchOnly, { children: [_jsx(SearchToggle, { className: "lg:hidden" }), _jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-lg:hidden" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, { className: "max-lg:hidden" }) : null, i18n ? (_jsx(LanguageToggle, { className: "-me-1.5 max-lg:hidden", children: _jsx(Languages, { className: "size-5" }) })) : null, navItems.filter(isSecondary).map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "-me-1.5
|
|
29
|
-
size: 'icon',
|
|
30
|
-
color: 'ghost',
|
|
31
|
-
}), 'group -me-2'), children: _jsx(ChevronDown, { className: "size-3 transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(NavigationMenuContent, { className: "flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end", children: [menuItems
|
|
27
|
+
.map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-1 flex-row items-center justify-end lg:gap-1.5", children: [enableSearch ? (_jsxs(SearchOnly, { children: [_jsx(SearchToggle, { className: "lg:hidden" }), _jsx(LargeSearchToggle, { className: "w-full max-w-[240px] max-lg:hidden" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, { className: "max-lg:hidden" }) : null, i18n ? (_jsx(LanguageToggle, { className: "-me-1.5 max-lg:hidden", children: _jsx(Languages, { className: "size-5" }) })) : null, navItems.filter(isSecondary).map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "-me-1.5 max-lg:hidden" }, i))), _jsxs(Menu, { className: "lg:hidden", children: [_jsx(MenuTrigger, { className: "group -me-2", enableHover: nav.enableHoverToOpen, children: _jsx(ChevronDown, { className: "size-3 transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(MenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [menuItems
|
|
32
28
|
.filter((item) => !isSecondary(item))
|
|
33
29
|
.map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "sm:hidden" }, i))), _jsxs("div", { className: "-ms-1.5 flex flex-row items-center gap-1.5 max-sm:mt-2", children: [menuItems.filter(isSecondary).map((item, i) => (_jsx(MenuLinkItem, { item: item, className: "-me-1.5" }, i))), _jsx("div", { role: "separator", className: "flex-1" }), i18n ? (_jsxs(LanguageToggle, { children: [_jsx(Languages, { className: "size-5" }), _jsx(LanguageToggleText, {}), _jsx(ChevronDown, { className: "size-3 text-fd-muted-foreground" })] })) : null, !disableThemeSwitch ? _jsx(ThemeToggle, {}) : null] })] })] })] })] }));
|
|
34
30
|
}
|
|
@@ -40,7 +36,7 @@ function NavbarLinkItem({ item, ...props }) {
|
|
|
40
36
|
if (child.type === 'custom')
|
|
41
37
|
return _jsx("div", { children: child.children }, j);
|
|
42
38
|
const { banner, footer, ...rest } = child.menu ?? {};
|
|
43
|
-
return (_jsxs(
|
|
39
|
+
return (_jsxs(NavbarMenuLink, { href: child.url, ...rest, children: [banner ??
|
|
44
40
|
(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));
|
|
45
41
|
});
|
|
46
42
|
return (_jsxs(NavbarMenu, { children: [_jsx(NavbarMenuTrigger, { ...props, children: item.url ? _jsx(Link, { href: item.url, children: item.text }) : item.text }), _jsx(NavbarMenuContent, { children: children })] }));
|
package/dist/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "14.7.
|
|
3
|
+
"version": "14.7.4",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
64
64
|
"class-variance-authority": "^0.7.1",
|
|
65
65
|
"lodash.merge": "^4.6.2",
|
|
66
|
-
"lucide-react": "^0.
|
|
66
|
+
"lucide-react": "^0.471.1",
|
|
67
67
|
"next-themes": "^0.4.4",
|
|
68
68
|
"postcss-selector-parser": "^7.0.0",
|
|
69
69
|
"react-medium-image-zoom": "^5.2.13",
|
|
@@ -72,17 +72,17 @@
|
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@next/eslint-plugin-next": "^15.1.4",
|
|
74
74
|
"@types/lodash.merge": "^4.6.9",
|
|
75
|
-
"@types/react": "^19.0.
|
|
76
|
-
"@types/react-dom": "^19.0.
|
|
75
|
+
"@types/react": "^19.0.7",
|
|
76
|
+
"@types/react-dom": "^19.0.3",
|
|
77
77
|
"autoprefixer": "^10.4.20",
|
|
78
78
|
"next": "15.1.4",
|
|
79
|
-
"postcss": "^8.
|
|
79
|
+
"postcss": "^8.5.1",
|
|
80
80
|
"postcss-cli": "^11.0.0",
|
|
81
81
|
"tailwindcss": "^3.4.17",
|
|
82
82
|
"tsc-alias": "^1.8.10",
|
|
83
|
-
"@fumadocs/cli": "0.0.
|
|
83
|
+
"@fumadocs/cli": "0.0.7",
|
|
84
84
|
"eslint-config-custom": "0.0.0",
|
|
85
|
-
"fumadocs-core": "14.7.
|
|
85
|
+
"fumadocs-core": "14.7.4",
|
|
86
86
|
"tsconfig": "0.0.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"react": "18.x.x || 19.x.x",
|
|
91
91
|
"react-dom": "18.x.x || 19.x.x",
|
|
92
92
|
"tailwindcss": "^3.4.14",
|
|
93
|
-
"fumadocs-core": "14.7.
|
|
93
|
+
"fumadocs-core": "14.7.4"
|
|
94
94
|
},
|
|
95
95
|
"peerDependenciesMeta": {
|
|
96
96
|
"tailwindcss": {
|