fumadocs-ui 16.0.11 → 16.0.13

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.
@@ -29,7 +29,7 @@ export const Accordions = forwardRef(({ type = 'single', className, defaultValue
29
29
  });
30
30
  Accordions.displayName = 'Accordions';
31
31
  export const Accordion = forwardRef(({ title, className, id, value = String(title), children, ...props }, ref) => {
32
- return (_jsxs(AccordionPrimitive.Item, { ref: ref, value: value, className: cn('scroll-m-24', className), ...props, children: [_jsxs(AccordionPrimitive.Header, { id: id, "data-accordion-value": value, className: "not-prose flex flex-row items-center text-fd-card-foreground font-medium has-focus-visible:bg-fd-accent", children: [_jsxs(AccordionPrimitive.Trigger, { className: "group flex flex-1 items-center gap-2 px-3 py-2.5 text-start focus-visible:outline-none", children: [_jsx(ChevronRight, { className: "size-4 shrink-0 text-fd-muted-foreground transition-transform duration-200 group-data-[state=open]:rotate-90" }), title] }), id ? _jsx(CopyButton, { id: id }) : null] }), _jsx(AccordionPrimitive.Content, { className: "overflow-hidden data-[state=closed]:animate-fd-accordion-up data-[state=open]:animate-fd-accordion-down", children: _jsx("div", { className: "px-4 pb-2 text-[15px] prose-no-margin", children: children }) })] }));
32
+ return (_jsxs(AccordionPrimitive.Item, { ref: ref, value: value, className: cn('scroll-m-24', className), ...props, children: [_jsxs(AccordionPrimitive.Header, { id: id, "data-accordion-value": value, className: "not-prose flex flex-row items-center text-fd-card-foreground font-medium has-focus-visible:bg-fd-accent", children: [_jsxs(AccordionPrimitive.Trigger, { className: "group flex flex-1 items-center gap-2 px-3 py-2.5 text-start focus-visible:outline-none", children: [_jsx(ChevronRight, { className: "size-4 shrink-0 text-fd-muted-foreground transition-transform duration-200 group-data-[state=open]:rotate-90" }), title] }), id ? _jsx(CopyButton, { id: id }) : null] }), _jsx(AccordionPrimitive.Content, { className: "overflow-hidden data-[state=closed]:animate-fd-accordion-up data-[state=open]:animate-fd-accordion-down", children: _jsx("div", { className: "px-4 pb-2 text-[0.9375rem] prose-no-margin", children: children }) })] }));
33
33
  });
34
34
  function CopyButton({ id }) {
35
35
  const [checked, onClick] = useCopyButton(() => {
@@ -24,7 +24,7 @@ export function CodeBlock({ ref, title, allowCopy = true, keepBackground = false
24
24
  })] })) : (Actions({
25
25
  className: 'absolute top-2 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground',
26
26
  children: allowCopy && _jsx(CopyButton, { containerRef: areaRef }),
27
- })), _jsx("div", { ref: areaRef, ...viewportProps, role: "region", tabIndex: 0, className: cn('text-[13px] py-3.5 overflow-auto max-h-[600px] fd-scroll-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring', viewportProps.className), style: {
27
+ })), _jsx("div", { ref: areaRef, ...viewportProps, role: "region", tabIndex: 0, className: cn('text-[0.8125rem] py-3.5 overflow-auto max-h-[600px] fd-scroll-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring', viewportProps.className), style: {
28
28
  // space for toolbar
29
29
  '--padding-right': !title ? 'calc(var(--spacing) * 8)' : undefined,
30
30
  counterSet: props['data-line-numbers']
@@ -19,11 +19,11 @@ export function RootToggle({ options, placeholder, ...props }) {
19
19
  closeOnRedirect.current = false;
20
20
  setOpen(false);
21
21
  };
22
- const item = selected ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "size-9 shrink-0 empty:hidden md:size-5", children: selected.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: selected.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden md:hidden", children: selected.description })] })] })) : (placeholder);
22
+ const item = selected ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "size-9 shrink-0 empty:hidden md:size-5", children: selected.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: selected.title }), _jsx("p", { className: "text-sm text-fd-muted-foreground empty:hidden md:hidden", children: selected.description })] })] })) : (placeholder);
23
23
  return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [item && (_jsxs(PopoverTrigger, { ...props, className: cn('flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-start text-fd-secondary-foreground transition-colors hover:bg-fd-accent data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground', props.className), children: [item, _jsx(ChevronsUpDown, { className: "shrink-0 ms-auto size-4 text-fd-muted-foreground" })] })), _jsx(PopoverContent, { className: "flex flex-col gap-1 w-(--radix-popover-trigger-width) p-1 fd-scroll-container", children: options.map((item) => {
24
24
  const isActive = selected && item.url === selected.url;
25
25
  if (!isActive && item.unlisted)
26
26
  return;
27
- return (_jsxs(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground', item.props?.className), children: [_jsx("div", { className: "shrink-0 size-9 md:mt-1 md:mb-auto md:size-5 empty:hidden", children: item.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: item.title }), _jsx("p", { className: "text-[13px] text-fd-muted-foreground empty:hidden", children: item.description })] }), _jsx(Check, { className: cn('shrink-0 ms-auto size-3.5 text-fd-primary', !isActive && 'invisible') })] }, item.url));
27
+ return (_jsxs(Link, { href: item.url, onClick: onClick, ...item.props, className: cn('flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground', item.props?.className), children: [_jsx("div", { className: "shrink-0 size-9 md:mt-1 md:mb-auto md:size-5 empty:hidden", children: item.icon }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium", children: item.title }), _jsx("p", { className: "text-[0.8125rem] text-fd-muted-foreground empty:hidden", children: item.description })] }), _jsx(Check, { className: cn('shrink-0 ms-auto size-3.5 text-fd-primary', !isActive && 'invisible') })] }, item.url));
28
28
  }) })] }));
29
29
  }
@@ -79,7 +79,7 @@ export function SidebarContent(props) {
79
79
  export function SidebarContentMobile({ className, children, ...props }) {
80
80
  const { open, setOpen } = useSidebar();
81
81
  const state = open ? 'open' : 'closed';
82
- return (_jsxs(_Fragment, { children: [_jsx(Presence, { present: open, children: _jsx("div", { "data-state": state, className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", onClick: () => setOpen(false) }) }), _jsx(Presence, { present: open, children: ({ present }) => (_jsx("aside", { id: "nd-sidebar-mobile", ...props, "data-state": state, className: cn('fixed text-[15px] flex flex-col shadow-lg border-s end-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out', !present && 'invisible', className), children: children })) })] }));
82
+ return (_jsxs(_Fragment, { children: [_jsx(Presence, { present: open, children: _jsx("div", { "data-state": state, className: "fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", onClick: () => setOpen(false) }) }), _jsx(Presence, { present: open, children: ({ present }) => (_jsx("aside", { id: "nd-sidebar-mobile", ...props, "data-state": state, className: cn('fixed text-[0.9375rem] flex flex-col shadow-lg border-s end-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out', !present && 'invisible', className), children: children })) })] }));
83
83
  }
84
84
  export function SidebarHeader(props) {
85
85
  return (_jsx("div", { ...props, className: cn('flex flex-col gap-3 p-4 pb-2', props.className), children: props.children }));
@@ -34,7 +34,7 @@ export function Tab({ value, ...props }) {
34
34
  return (_jsx(TabsContent, { value: escapeValue(resolved), ...props, children: props.children }));
35
35
  }
36
36
  export function TabsContent({ value, className, ...props }) {
37
- return (_jsx(Unstyled.TabsContent, { value: value, forceMount: true, className: cn('p-4 text-[15px] bg-fd-background rounded-xl outline-none prose-no-margin data-[state=inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none', className), ...props, children: props.children }));
37
+ return (_jsx(Unstyled.TabsContent, { value: value, forceMount: true, className: cn('p-4 text-[0.9375rem] bg-fd-background rounded-xl outline-none prose-no-margin data-[state=inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none', className), ...props, children: props.children }));
38
38
  }
39
39
  /**
40
40
  * Inspired by Headless UI.
@@ -47,7 +47,7 @@ export function DocsLayout({ nav: { transparentMode, ...nav } = {}, sidebar: { t
47
47
  size: 'icon-sm',
48
48
  className: 'p-2',
49
49
  })), children: _jsx(SidebarIcon, {}) })] }), tabs.length > 0 && _jsx(RootToggle, { options: tabs }), banner] }), viewport, _jsx(SidebarFooter, { className: "empty:hidden", children: footer })] }));
50
- const content = (_jsxs(SidebarContent, { ...rest, children: [_jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[15px] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
50
+ const content = (_jsxs(SidebarContent, { ...rest, children: [_jsxs(SidebarHeader, { children: [_jsxs("div", { className: "flex", children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex text-[0.9375rem] items-center gap-2.5 font-medium me-auto", children: nav.title }), nav.children, collapsible && (_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
51
51
  color: 'ghost',
52
52
  size: 'icon-sm',
53
53
  className: 'mb-auto text-fd-muted-foreground',
@@ -1,24 +1,24 @@
1
1
  import { type ComponentProps } from 'react';
2
2
  import { LinkItemType } from '../../layouts/shared/index.js';
3
- import { NavigationMenuContent, NavigationMenuTrigger } from '../../components/ui/navigation-menu.js';
3
+ import { NavigationMenuContent, NavigationMenuItem, NavigationMenuTrigger } from '../../components/ui/navigation-menu.js';
4
4
  export declare const navItemVariants: (props?: ({
5
5
  variant?: "button" | "main" | "icon" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export declare function Navbar(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
8
- export declare function NavbarLinkItem({ item, ...props }: {
8
+ export { NavigationMenuItem };
9
+ export declare function NavigationMenuLinkItem({ item, ...props }: {
9
10
  item: LinkItemType;
10
11
  className?: string;
11
12
  }): import("react/jsx-runtime").JSX.Element;
12
- export declare const Menu: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
13
- export declare function MenuLinkItem({ item, ...props }: {
13
+ export declare function MobileNavigationMenuLinkItem({ item, ...props }: {
14
14
  item: LinkItemType;
15
15
  className?: string;
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
- export declare function MenuTrigger({ enableHover, ...props }: ComponentProps<typeof NavigationMenuTrigger> & {
17
+ export declare function MobileNavigationMenuTrigger({ enableHover, ...props }: ComponentProps<typeof NavigationMenuTrigger> & {
18
18
  /**
19
19
  * Enable hover to trigger
20
20
  */
21
21
  enableHover?: boolean;
22
22
  }): import("react/jsx-runtime").JSX.Element;
23
- export declare function MenuContent(props: ComponentProps<typeof NavigationMenuContent>): import("react/jsx-runtime").JSX.Element;
23
+ export declare function MobileNavigationMenuContent(props: ComponentProps<typeof NavigationMenuContent>): import("react/jsx-runtime").JSX.Element;
24
24
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/client.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,OAAO,CAAC;AAIhE,OAAO,EAAgB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAEL,qBAAqB,EAIrB,qBAAqB,EAEtB,MAAM,iCAAiC,CAAC;AAIzC,eAAO,MAAM,eAAe;;8EAiB1B,CAAC;AAEH,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CA2BlD;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAiFA;AAED,eAAO,MAAM,IAAI,yNAAqB,CAAC;AAEvC,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAyDA;AAED,wBAAgB,WAAW,CAAC,EAC1B,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,2CASA;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,2CAUpD"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/client.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,OAAO,CAAC;AAIhE,OAAO,EAAgB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAEL,qBAAqB,EACrB,kBAAkB,EAGlB,qBAAqB,EAEtB,MAAM,iCAAiC,CAAC;AAIzC,eAAO,MAAM,eAAe;;8EAiB1B,CAAC;AAEH,wBAAgB,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,2CA2BlD;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA0EA;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,IAAI,EACJ,GAAG,KAAK,EACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAyDA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,WAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,2CASA;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,2CAUpD"}
@@ -31,7 +31,8 @@ export function Navbar(props) {
31
31
  const { isTransparent } = useNav();
32
32
  return (_jsx(NavigationMenu, { value: value, onValueChange: setValue, asChild: true, children: _jsxs("header", { id: "nd-nav", ...props, className: cn('fixed top-(--fd-banner-height) z-40 left-0 right-(--removed-body-scroll-bar-size,0) backdrop-blur-lg border-b transition-colors *:mx-auto *:max-w-fd-container', value.length > 0 && 'max-lg:shadow-lg max-lg:rounded-b-2xl', (!isTransparent || value.length > 0) && 'bg-fd-background/80', props.className), children: [_jsx(NavigationMenuList, { className: "flex h-14 w-full items-center px-4", asChild: true, children: _jsx("nav", { children: props.children }) }), _jsx(NavigationMenuViewport, {})] }) }));
33
33
  }
34
- export function NavbarLinkItem({ item, ...props }) {
34
+ export { NavigationMenuItem };
35
+ export function NavigationMenuLinkItem({ item, ...props }) {
35
36
  if (item.type === 'custom')
36
37
  return _jsx("div", { ...props, children: item.children });
37
38
  if (item.type === 'menu') {
@@ -40,19 +41,18 @@ export function NavbarLinkItem({ item, ...props }) {
40
41
  return _jsx(Fragment, { children: child.children }, j);
41
42
  }
42
43
  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 ?? {};
43
- return (_jsx(NavigationMenuLink, { asChild: true, children: _jsx(Link, { href: child.url, external: child.external, ...rest, 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', rest.className), children: rest.children ?? (_jsxs(_Fragment, { children: [banner, _jsx("p", { className: "text-[15px] font-medium", children: child.text }), _jsx("p", { className: "text-sm text-fd-muted-foreground empty:hidden", children: child.description })] })) }) }, `${j}-${child.url}`));
44
+ return (_jsx(NavigationMenuLink, { asChild: true, children: _jsx(Link, { href: child.url, external: child.external, ...rest, 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', rest.className), children: rest.children ?? (_jsxs(_Fragment, { children: [banner, _jsx("p", { className: "text-base font-medium", children: child.text }), _jsx("p", { className: "text-sm text-fd-muted-foreground empty:hidden", children: child.description })] })) }) }, `${j}-${child.url}`));
44
45
  });
45
- return (_jsxs(NavigationMenuItem, { children: [_jsx(NavigationMenuTrigger, { ...props, className: cn(navItemVariants(), 'rounded-md', props.className), children: item.url ? (_jsx(Link, { href: item.url, external: item.external, children: item.text })) : (item.text) }), _jsx(NavigationMenuContent, { className: "grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3", children: children })] }));
46
+ return (_jsxs(NavigationMenuItem, { ...props, children: [_jsx(NavigationMenuTrigger, { className: cn(navItemVariants(), 'rounded-md'), children: item.url ? (_jsx(Link, { href: item.url, external: item.external, children: item.text })) : (item.text) }), _jsx(NavigationMenuContent, { className: "grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3", children: children })] }));
46
47
  }
47
- return (_jsx(NavigationMenuItem, { children: _jsx(NavigationMenuLink, { asChild: true, children: _jsx(BaseLinkItem, { item: item, "aria-label": item.type === 'icon' ? item.label : undefined, ...props, className: cn(navItemVariants({ variant: item.type }), props.className), children: item.type === 'icon' ? item.icon : item.text }) }) }));
48
+ return (_jsx(NavigationMenuItem, { ...props, children: _jsx(NavigationMenuLink, { asChild: true, children: _jsx(BaseLinkItem, { item: item, "aria-label": item.type === 'icon' ? item.label : undefined, className: cn(navItemVariants({ variant: item.type })), children: item.type === 'icon' ? item.icon : item.text }) }) }));
48
49
  }
49
- export const Menu = NavigationMenuItem;
50
- export function MenuLinkItem({ item, ...props }) {
50
+ export function MobileNavigationMenuLinkItem({ item, ...props }) {
51
51
  if (item.type === 'custom')
52
52
  return _jsx("div", { className: cn('grid', props.className), children: item.children });
53
53
  if (item.type === 'menu') {
54
54
  const header = (_jsxs(_Fragment, { children: [item.icon, item.text] }));
55
- 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, external: item.external, children: header }) })) : (header) }), item.items.map((child, i) => (_jsx(MenuLinkItem, { item: child }, i)))] }));
55
+ 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, external: item.external, children: header }) })) : (header) }), item.items.map((child, i) => (_jsx(MobileNavigationMenuLinkItem, { item: child }, i)))] }));
56
56
  }
57
57
  return (_jsx(NavigationMenuLink, { asChild: true, children: _jsxs(BaseLinkItem, { item: item, className: cn({
58
58
  main: 'inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4',
@@ -66,9 +66,9 @@ export function MenuLinkItem({ item, ...props }) {
66
66
  }),
67
67
  }[item.type ?? 'main'], props.className), "aria-label": item.type === 'icon' ? item.label : undefined, children: [item.icon, item.type === 'icon' ? undefined : item.text] }) }));
68
68
  }
69
- export function MenuTrigger({ enableHover = false, ...props }) {
69
+ export function MobileNavigationMenuTrigger({ enableHover = false, ...props }) {
70
70
  return (_jsx(NavigationMenuTrigger, { ...props, onPointerMove: enableHover ? undefined : (e) => e.preventDefault(), children: props.children }));
71
71
  }
72
- export function MenuContent(props) {
72
+ export function MobileNavigationMenuContent(props) {
73
73
  return (_jsx(NavigationMenuContent, { ...props, className: cn('flex flex-col p-4', props.className), children: props.children }));
74
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAErD,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAuB1B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,GAAG,cAAc,CAAC,WAAW,CAAC,2CAkCrD;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAQ,EACR,IAAY,EACZ,KAAK,EACL,SAAS,EACT,WAAgB,EAChB,YAAiB,GAClB,EAAE,eAAe,2CA2GjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/home/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAW,MAAM,OAAO,CAAC;AAErD,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAuB1B,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,GAAG,CAAC,EAAE,OAAO,CACX,UAAU,GAAG;QACX;;WAEG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CACF,CAAC;CACH;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,eAAe,GAAG,cAAc,CAAC,WAAW,CAAC,2CAkCrD;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAQ,EACR,IAAY,EACZ,KAAK,EACL,SAAS,EACT,WAAgB,EAChB,YAAiB,GAClB,EAAE,eAAe,2CA+GjB"}
@@ -8,7 +8,7 @@ import { ThemeToggle } from '../../components/layout/theme-toggle.js';
8
8
  import { LanguageToggle, LanguageToggleText, } from '../../components/layout/language-toggle.js';
9
9
  import { ChevronDown, Languages } from '../../icons.js';
10
10
  import Link from 'fumadocs-core/link';
11
- import { Navbar, NavbarLinkItem, Menu, MenuContent, MenuLinkItem, MenuTrigger, } from '../../layouts/home/client.js';
11
+ import { Navbar, NavigationMenuLinkItem, MobileNavigationMenuContent, MobileNavigationMenuLinkItem, MobileNavigationMenuTrigger, NavigationMenuItem, } from '../../layouts/home/client.js';
12
12
  import { buttonVariants } from '../../components/ui/button.js';
13
13
  export function HomeLayout(props) {
14
14
  const { nav = {}, links, githubUrl, i18n, themeSwitch = {}, searchToggle, ...rest } = props;
@@ -21,20 +21,16 @@ export function Header({ nav = {}, i18n = false, links, githubUrl, themeSwitch =
21
21
  const menuItems = finalLinks.filter((item) => ['menu', 'all'].includes(item.on ?? 'all'));
22
22
  return (_jsxs(Navbar, { children: [_jsx(Link, { href: nav.url ?? '/', className: "inline-flex items-center gap-2.5 font-semibold", children: nav.title }), nav.children, _jsx("ul", { className: "flex flex-row items-center gap-2 px-6 max-sm:hidden", children: navItems
23
23
  .filter((item) => !isSecondary(item))
24
- .map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-row items-center justify-end gap-1.5 flex-1 max-lg:hidden", children: [searchToggle.enabled !== false &&
24
+ .map((item, i) => (_jsx(NavigationMenuLinkItem, { item: item, className: "text-sm" }, i))) }), _jsxs("div", { className: "flex flex-row items-center justify-end gap-1.5 flex-1 max-lg:hidden", children: [searchToggle.enabled !== false &&
25
25
  (searchToggle.components?.lg ?? (_jsx(LargeSearchToggle, { className: "w-full rounded-full ps-2.5 max-w-[240px]", hideIfDisabled: true }))), themeSwitch.enabled !== false &&
26
- (themeSwitch.component ?? _jsx(ThemeToggle, { mode: themeSwitch?.mode })), i18n && (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-5" }) })), _jsx("ul", { className: "flex flex-row gap-2 items-center empty:hidden", children: navItems.filter(isSecondary).map((item, i) => (_jsx(NavbarLinkItem, { item: item, className: cn(item.type === 'icon' && [
27
- '-mx-1',
28
- i === 0 && 'ms-0',
29
- i === navItems.length - 1 && 'me-0',
30
- ]) }, i))) })] }), _jsxs("ul", { className: "flex flex-row items-center ms-auto -me-1.5 lg:hidden", children: [searchToggle.enabled !== false &&
31
- (searchToggle.components?.sm ?? (_jsx(SearchToggle, { className: "p-2", hideIfDisabled: true }))), _jsxs(Menu, { children: [_jsx(MenuTrigger, { "aria-label": "Toggle Menu", className: cn(buttonVariants({
26
+ (themeSwitch.component ?? _jsx(ThemeToggle, { mode: themeSwitch?.mode })), i18n && (_jsx(LanguageToggle, { children: _jsx(Languages, { className: "size-5" }) })), _jsx("ul", { className: "flex flex-row gap-2 items-center empty:hidden", children: navItems.filter(isSecondary).map((item, i) => (_jsx(NavigationMenuLinkItem, { className: cn(item.type === 'icon' && '-mx-1 first:ms-0 last:me-0'), item: item }, i))) })] }), _jsxs("ul", { className: "flex flex-row items-center ms-auto -me-1.5 lg:hidden", children: [searchToggle.enabled !== false &&
27
+ (searchToggle.components?.sm ?? (_jsx(SearchToggle, { className: "p-2", hideIfDisabled: true }))), _jsxs(NavigationMenuItem, { children: [_jsx(MobileNavigationMenuTrigger, { "aria-label": "Toggle Menu", className: cn(buttonVariants({
32
28
  size: 'icon',
33
29
  color: 'ghost',
34
30
  className: 'group [&_svg]:size-5.5',
35
- })), enableHover: nav.enableHoverToOpen, children: _jsx(ChevronDown, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(MenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [menuItems
31
+ })), enableHover: nav.enableHoverToOpen, children: _jsx(ChevronDown, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), _jsxs(MobileNavigationMenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [menuItems
36
32
  .filter((item) => !isSecondary(item))
37
- .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, themeSwitch.enabled !== false &&
33
+ .map((item, i) => (_jsx(MobileNavigationMenuLinkItem, { item: item, className: "sm:hidden" }, i))), _jsxs("div", { className: "-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2", children: [menuItems.filter(isSecondary).map((item, i) => (_jsx(MobileNavigationMenuLinkItem, { item: item, className: cn(item.type === 'icon' && '-mx-1 first:ms-0') }, 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" })] })), themeSwitch.enabled !== false &&
38
34
  (themeSwitch.component ?? (_jsx(ThemeToggle, { mode: themeSwitch?.mode })))] })] })] })] })] }));
39
35
  }
40
36
  function isSecondary(item) {
package/dist/style.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer theme {
@@ -15,6 +15,8 @@
15
15
  --text-xs--line-height: calc(1 / 0.75);
16
16
  --text-sm: 0.875rem;
17
17
  --text-sm--line-height: calc(1.25 / 0.875);
18
+ --text-base: 1rem;
19
+ --text-base--line-height: calc(1.5 / 1);
18
20
  --text-lg: 1.125rem;
19
21
  --text-lg--line-height: calc(1.75 / 1.125);
20
22
  --text-2xl: 1.5rem;
@@ -465,9 +467,6 @@
465
467
  .-ms-1\.5 {
466
468
  margin-inline-start: calc(var(--spacing) * -1.5);
467
469
  }
468
- .ms-0 {
469
- margin-inline-start: calc(var(--spacing) * 0);
470
- }
471
470
  .ms-2 {
472
471
  margin-inline-start: calc(var(--spacing) * 2);
473
472
  }
@@ -486,9 +485,6 @@
486
485
  .-me-2 {
487
486
  margin-inline-end: calc(var(--spacing) * -2);
488
487
  }
489
- .me-0 {
490
- margin-inline-end: calc(var(--spacing) * 0);
491
- }
492
488
  .me-1 {
493
489
  margin-inline-end: calc(var(--spacing) * 1);
494
490
  }
@@ -1584,6 +1580,10 @@
1584
1580
  font-size: var(--text-3xl);
1585
1581
  line-height: var(--tw-leading, var(--text-3xl--line-height));
1586
1582
  }
1583
+ .text-base {
1584
+ font-size: var(--text-base);
1585
+ line-height: var(--tw-leading, var(--text-base--line-height));
1586
+ }
1587
1587
  .text-lg {
1588
1588
  font-size: var(--text-lg);
1589
1589
  line-height: var(--tw-leading, var(--text-lg--line-height));
@@ -1596,14 +1596,14 @@
1596
1596
  font-size: var(--text-xs);
1597
1597
  line-height: var(--tw-leading, var(--text-xs--line-height));
1598
1598
  }
1599
- .text-\[1\.75em\] {
1600
- font-size: 1.75em;
1599
+ .text-\[0\.8125rem\] {
1600
+ font-size: 0.8125rem;
1601
1601
  }
1602
- .text-\[13px\] {
1603
- font-size: 13px;
1602
+ .text-\[0\.9375rem\] {
1603
+ font-size: 0.9375rem;
1604
1604
  }
1605
- .text-\[15px\] {
1606
- font-size: 15px;
1605
+ .text-\[1\.75em\] {
1606
+ font-size: 1.75em;
1607
1607
  }
1608
1608
  .font-medium {
1609
1609
  --tw-font-weight: var(--font-weight-medium);
@@ -1921,6 +1921,11 @@
1921
1921
  content: var(--tw-content);
1922
1922
  }
1923
1923
  }
1924
+ .first\:ms-0 {
1925
+ &:first-child {
1926
+ margin-inline-start: calc(var(--spacing) * 0);
1927
+ }
1928
+ }
1924
1929
  .first\:mt-0 {
1925
1930
  &:first-child {
1926
1931
  margin-top: calc(var(--spacing) * 0);
@@ -1931,6 +1936,11 @@
1931
1936
  padding-top: calc(var(--spacing) * 0);
1932
1937
  }
1933
1938
  }
1939
+ .last\:me-0 {
1940
+ &:last-child {
1941
+ margin-inline-end: calc(var(--spacing) * 0);
1942
+ }
1943
+ }
1934
1944
  .last\:rounded-b-xl {
1935
1945
  &:last-child {
1936
1946
  border-bottom-right-radius: var(--radius-xl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "16.0.11",
3
+ "version": "16.0.13",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -120,22 +120,22 @@
120
120
  "postcss-selector-parser": "^7.1.0",
121
121
  "react-medium-image-zoom": "^5.4.0",
122
122
  "scroll-into-view-if-needed": "^3.1.0",
123
- "tailwind-merge": "^3.3.1",
124
- "fumadocs-core": "16.0.11"
123
+ "tailwind-merge": "^3.4.0",
124
+ "fumadocs-core": "16.0.13"
125
125
  },
126
126
  "devDependencies": {
127
- "@next/eslint-plugin-next": "16.0.1",
128
- "@tailwindcss/cli": "^4.1.16",
127
+ "@next/eslint-plugin-next": "16.0.3",
128
+ "@tailwindcss/cli": "^4.1.17",
129
129
  "@types/lodash.merge": "^4.6.9",
130
- "@types/node": "^24.10.0",
131
- "@types/react": "^19.2.2",
132
- "@types/react-dom": "^19.2.2",
133
- "next": "16.0.1",
134
- "tailwindcss": "^4.1.16",
130
+ "@types/node": "^24.10.1",
131
+ "@types/react": "^19.2.5",
132
+ "@types/react-dom": "^19.2.3",
133
+ "next": "16.0.3",
134
+ "tailwindcss": "^4.1.17",
135
135
  "tsc-alias": "^1.8.16",
136
136
  "@fumadocs/cli": "1.0.3",
137
137
  "eslint-config-custom": "0.0.0",
138
- "fumadocs-core": "16.0.11",
138
+ "fumadocs-core": "16.0.13",
139
139
  "tsconfig": "0.0.0"
140
140
  },
141
141
  "peerDependencies": {