Files
NapCatQQ/.pnpm-store/v3/files/7b/3c3f8872704a5eae788581de7a691ab58735aca7af9bc895f9c2bc88f000e960874afa41a27ad45f271335218550ccb36543615d2ec033126cd4ae9da6c594
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

67 lines
2.2 KiB
Plaintext

"use client";
import {
useNavbarContext
} from "./chunk-IGERPFKH.mjs";
import {
menuVariants
} from "./chunk-UJDFI5KD.mjs";
// src/navbar-menu.tsx
import { forwardRef } from "@heroui/system";
import { useDOMRef } from "@heroui/react-utils";
import { clsx, dataAttr } from "@heroui/shared-utils";
import { AnimatePresence, LazyMotion, m } from "framer-motion";
import { mergeProps } from "@react-aria/utils";
import { Overlay } from "@react-aria/overlays";
import { jsx } from "react/jsx-runtime";
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
var NavbarMenu = forwardRef((props, ref) => {
var _a, _b;
const { className, children, portalContainer, motionProps, style, ...otherProps } = props;
const domRef = useDOMRef(ref);
const { slots, isMenuOpen, height, disableAnimation, classNames } = useNavbarContext();
const styles = clsx(classNames == null ? void 0 : classNames.menu, className);
if (disableAnimation) {
if (!isMenuOpen)
return null;
return /* @__PURE__ */ jsx(Overlay, { portalContainer, children: /* @__PURE__ */ jsx(
"ul",
{
ref: domRef,
className: (_a = slots.menu) == null ? void 0 : _a.call(slots, { class: styles }),
"data-open": dataAttr(isMenuOpen),
style: {
"--navbar-height": typeof height === "number" ? `${height}px` : height
},
...otherProps,
children
}
) });
}
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isMenuOpen ? /* @__PURE__ */ jsx(Overlay, { portalContainer, children: /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
m.ul,
{
ref: domRef,
layoutScroll: true,
animate: "enter",
className: (_b = slots.menu) == null ? void 0 : _b.call(slots, { class: styles }),
"data-open": dataAttr(isMenuOpen),
exit: "exit",
initial: "exit",
style: {
"--navbar-height": typeof height === "number" ? `${height}px` : height,
...style
},
variants: menuVariants,
...mergeProps(motionProps, otherProps),
children
}
) }) }) : null });
});
NavbarMenu.displayName = "HeroUI.NavbarMenu";
var navbar_menu_default = NavbarMenu;
export {
navbar_menu_default
};