Files
NapCatQQ/.pnpm-store/v3/files/58/614819ad4b37dc5c64b5c3d98b167e350d434eadb0af9a671715ffc01c9b614e30132810dba6e1ef7497c2c7f93290f7d289fe0dad1ab46e479e2ca07de2e3
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

125 lines
3.8 KiB
Plaintext

"use client";
import {
usePopover
} from "./chunk-L4NZQNWQ.mjs";
// src/free-solo-popover.tsx
import * as React from "react";
import { DismissButton, Overlay } from "@react-aria/overlays";
import { forwardRef } from "@heroui/system";
import { LazyMotion, m } from "framer-motion";
import { mergeProps } from "@react-aria/utils";
import { getTransformOrigins } from "@heroui/aria-utils";
import { TRANSITION_VARIANTS } from "@heroui/framer-utils";
import { useDialog } from "@react-aria/dialog";
import { jsx, jsxs } from "react/jsx-runtime";
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
var FreeSoloPopoverWrapper = forwardRef(
({
children,
motionProps,
placement,
disableAnimation,
style: styleProp = {},
transformOrigin = {},
...otherProps
}, ref) => {
let style = styleProp;
if (transformOrigin.originX !== void 0 || transformOrigin.originY !== void 0) {
style = {
...style,
transformOrigin
};
} else if (placement) {
style = {
...style,
...getTransformOrigins(placement === "center" ? "top" : placement)
};
}
return disableAnimation ? /* @__PURE__ */ jsx("div", { ...otherProps, ref, children }) : /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
m.div,
{
ref,
animate: "enter",
exit: "exit",
initial: "initial",
style,
variants: TRANSITION_VARIANTS.scaleSpringOpacity,
...mergeProps(otherProps, motionProps),
children
}
) });
}
);
FreeSoloPopoverWrapper.displayName = "HeroUI.FreeSoloPopoverWrapper";
var FreeSoloPopover = forwardRef(
({ children, transformOrigin, disableDialogFocus = false, ...props }, ref) => {
const {
Component,
state,
placement,
backdrop,
portalContainer,
disableAnimation,
motionProps,
isNonModal,
getPopoverProps,
getBackdropProps,
getDialogProps,
getContentProps
} = usePopover({
...props,
ref
});
const dialogRef = React.useRef(null);
const { dialogProps: ariaDialogProps, titleProps } = useDialog({}, dialogRef);
const dialogProps = getDialogProps({
...!disableDialogFocus && { ref: dialogRef },
...ariaDialogProps
});
const backdropContent = React.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]);
return /* @__PURE__ */ jsxs(Overlay, { portalContainer, children: [
!isNonModal && backdropContent,
/* @__PURE__ */ jsx(Component, { ...getPopoverProps(), children: /* @__PURE__ */ jsxs(
FreeSoloPopoverWrapper,
{
disableAnimation,
motionProps,
placement,
tabIndex: -1,
transformOrigin,
...dialogProps,
children: [
!isNonModal && /* @__PURE__ */ jsx(DismissButton, { onDismiss: state.close }),
/* @__PURE__ */ jsx("div", { ...getContentProps(), children: typeof children === "function" ? children(titleProps) : children }),
/* @__PURE__ */ jsx(DismissButton, { onDismiss: state.close })
]
}
) })
] });
}
);
FreeSoloPopover.displayName = "HeroUI.FreeSoloPopover";
var free_solo_popover_default = FreeSoloPopover;
export {
free_solo_popover_default
};