Files
NapCatQQ/.pnpm-store/v3/files/46/61c04cfe6c8b23f3b08d042f40b81c00434ea053914727893c354e1399e501d8967715268452739a04b428e44af008f40ca876a1e397f2e022a2bc5889aee4
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

49 lines
1.6 KiB
Plaintext

"use client";
// src/ripple.tsx
import { AnimatePresence, m, LazyMotion } from "framer-motion";
import { clamp } from "@heroui/shared-utils";
import { Fragment, jsx } from "react/jsx-runtime";
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
var Ripple = (props) => {
const { ripples = [], motionProps, color = "currentColor", style, onClear } = props;
return /* @__PURE__ */ jsx(Fragment, { children: ripples.map((ripple) => {
const duration = clamp(0.01 * ripple.size, 0.2, ripple.size > 100 ? 0.75 : 0.5);
return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsx(
m.span,
{
animate: { transform: "scale(2)", opacity: 0 },
className: "heroui-ripple",
exit: { opacity: 0 },
initial: { transform: "scale(0)", opacity: 0.35 },
style: {
position: "absolute",
backgroundColor: color,
borderRadius: "100%",
transformOrigin: "center",
pointerEvents: "none",
overflow: "hidden",
inset: 0,
zIndex: 0,
top: ripple.y,
left: ripple.x,
width: `${ripple.size}px`,
height: `${ripple.size}px`,
...style
},
transition: { duration },
onAnimationComplete: () => {
onClear(ripple.key);
},
...motionProps
}
) }) }, ripple.key);
}) });
};
Ripple.displayName = "HeroUI.Ripple";
var ripple_default = Ripple;
export {
ripple_default
};