@xiping/react-components 0.0.68 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as u } from "react/jsx-runtime";
2
3
  import { cn as g } from "../../utils/utils.js";
3
4
  import { motion as v, AnimatePresence as H } from "motion/react";
@@ -8,10 +9,10 @@ const N = Object.freeze(
8
9
  function L({
9
10
  children: e,
10
11
  className: A,
11
- duration: m = 800,
12
+ duration: l = 800,
12
13
  delay: s = 0,
13
14
  as: M = "div",
14
- startOnView: f = !1,
15
+ startOnView: m = !1,
15
16
  animateOnHover: h = !0,
16
17
  characterSet: i = N,
17
18
  ...C
@@ -24,7 +25,7 @@ function L({
24
25
  h && !a && (r.current = 0, o(!0));
25
26
  };
26
27
  return d(() => {
27
- if (!f) {
28
+ if (!m) {
28
29
  const n = setTimeout(() => {
29
30
  o(!0);
30
31
  }, s);
@@ -39,17 +40,17 @@ function L({
39
40
  { threshold: 0.1, rootMargin: "-30% 0px -30% 0px" }
40
41
  );
41
42
  return c.current && t.observe(c.current), () => t.disconnect();
42
- }, [s, f]), d(() => {
43
+ }, [s, m]), d(() => {
43
44
  if (!a) return;
44
- const t = m / (e.length * 10), n = e.length, l = setInterval(() => {
45
+ const t = l / (e.length * 10), n = e.length, f = setInterval(() => {
45
46
  r.current < n ? (b(
46
47
  (w) => w.map(
47
48
  (p, T) => p === " " ? p : T <= r.current ? e[T] : i[P(i.length)]
48
49
  )
49
- ), r.current = r.current + 0.1) : (o(!1), clearInterval(l));
50
+ ), r.current = r.current + 0.1) : (o(!1), clearInterval(f));
50
51
  }, t);
51
- return () => clearInterval(l);
52
- }, [e, m, a, i]), /* @__PURE__ */ u(
52
+ return () => clearInterval(f);
53
+ }, [e, l, a, i]), /* @__PURE__ */ u(
53
54
  E,
54
55
  {
55
56
  ref: c,
@@ -0,0 +1,7 @@
1
+ interface ImageCompareProps {
2
+ className?: string;
3
+ originalImage: string;
4
+ modifiedImage: string;
5
+ }
6
+ declare const ImageCompare: (props: ImageCompareProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ImageCompare;
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
3
  import { Modal as C, ModalContent as k } from "@heroui/modal";
3
4
  import { Spinner as z } from "@heroui/spinner";
@@ -1,7 +1,8 @@
1
+ "use client";
1
2
  import { jsx as T } from "react/jsx-runtime";
2
3
  import { cn as x } from "../../utils/utils.js";
3
4
  import { motion as b } from "motion/react";
4
- import { useState as a, useRef as I, useEffect as u } from "react";
5
+ import { useState as u, useRef as I, useEffect as a } from "react";
5
6
  function R({
6
7
  children: r,
7
8
  className: l,
@@ -13,8 +14,8 @@ function R({
13
14
  }) {
14
15
  const d = b.create(m, {
15
16
  forwardMotionProps: !0
16
- }), [g, v] = a(""), [c, f] = a(!1), o = I(null);
17
- return u(() => {
17
+ }), [g, v] = u(""), [c, f] = u(!1), o = I(null);
18
+ return a(() => {
18
19
  if (!i) {
19
20
  const t = setTimeout(() => {
20
21
  f(!0);
@@ -30,7 +31,7 @@ function R({
30
31
  { threshold: 0.1 }
31
32
  );
32
33
  return o.current && e.observe(o.current), () => e.disconnect();
33
- }, [n, i]), u(() => {
34
+ }, [n, i]), a(() => {
34
35
  if (!c) return;
35
36
  let e = 0;
36
37
  const t = setInterval(() => {