Files
NapCatQQ/.pnpm-store/v3/files/b0/18058de43f4ba7bb0ffc30e1eea370bc5770da1d54a12c8126d28043111214888177c5689ef3b76109d9ccd066275e2b9c66cd1c285dc619519069d36ce3a0
T
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

85 lines
2.8 KiB
Plaintext

"use client";
import {
usePopoverContext
} from "./chunk-CGIRYUEE.mjs";
// src/popover-content.tsx
import { useMemo, useRef } from "react";
import { DismissButton } from "@react-aria/overlays";
import { TRANSITION_VARIANTS } from "@heroui/framer-utils";
import { m, LazyMotion } from "framer-motion";
import { getTransformOrigins } from "@heroui/aria-utils";
import { useDialog } from "@react-aria/dialog";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
var PopoverContent = (props) => {
const { as, children, className, ...otherProps } = props;
const {
Component: OverlayComponent,
placement,
backdrop,
motionProps,
disableAnimation,
getPopoverProps,
getDialogProps,
getBackdropProps,
getContentProps,
isNonModal,
onClose
} = usePopoverContext();
const dialogRef = useRef(null);
const { dialogProps: ariaDialogProps, titleProps } = useDialog({}, dialogRef);
const dialogProps = getDialogProps({
ref: dialogRef,
...ariaDialogProps,
...otherProps
});
const Component = as || OverlayComponent || "div";
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
!isNonModal && /* @__PURE__ */ jsx(DismissButton, { onDismiss: onClose }),
/* @__PURE__ */ jsx(Component, { ...dialogProps, children: /* @__PURE__ */ jsx("div", { ...getContentProps({ className }), children: typeof children === "function" ? children(titleProps) : children }) }),
/* @__PURE__ */ jsx(DismissButton, { onDismiss: onClose })
] });
const backdropContent = useMemo(() => {
if (backdrop === "transparent") {
return null;
}
if (disableAnimation) {
return /* @__PURE__ */ jsx("div", { ...getBackdropProps() });
}
return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
m.div,
{
animate: "enter",
exit: "exit",
initial: "exit",
variants: TRANSITION_VARIANTS.fade,
...getBackdropProps()
}
) });
}, [backdrop, disableAnimation, getBackdropProps]);
const style = placement ? getTransformOrigins(placement === "center" ? "top" : placement) : void 0;
const contents = /* @__PURE__ */ jsx(Fragment, { children: disableAnimation ? content : /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
m.div,
{
animate: "enter",
exit: "exit",
initial: "initial",
style,
variants: TRANSITION_VARIANTS.scaleSpringOpacity,
...motionProps,
children: content
}
) }) });
return /* @__PURE__ */ jsxs("div", { ...getPopoverProps(), children: [
backdropContent,
contents
] });
};
PopoverContent.displayName = "HeroUI.PopoverContent";
var popover_content_default = PopoverContent;
export {
popover_content_default
};