import { jsx as m } from "react/jsx-runtime";
import { useRef as p, useState as u, useEffect as y } from "react";
import { motion as b } from "motion/react";
import h from "../../hooks/useOnScreen.js";
const I = (s) => {
  const { delay: n = 0, duration: o = 0.4, className: r = "", offset: a = 15, children: f, ...c } = s, e = p(null), t = h(e), [i, d] = u(!1), l = {
    hidden: {
      opacity: 0,
      y: a
    },
    visible: {
      opacity: 1,
      y: 0
    }
  };
  return y(() => {
    t && !i && d(!0);
  }, [t, i]), /* @__PURE__ */ m(
    b.div,
    {
      ref: e,
      variants: l,
      initial: "hidden",
      animate: i ? "visible" : "hidden",
      transition: { delay: n, type: "spring", duration: o },
      ...c,
      className: r,
      children: f
    }
  );
};
export {
  I as default
};
//# sourceMappingURL=FadeUp.js.map
