@xiping/react-components 1.0.24 → 1.0.26

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.
Files changed (46) hide show
  1. package/dist/cjs/components/blur-fade/BlurFade.d.ts +23 -0
  2. package/dist/cjs/components/blur-fade/BlurFade.js +1 -0
  3. package/dist/cjs/components/blur-fade/index.d.ts +2 -0
  4. package/dist/cjs/components/button/Button.d.ts +3 -3
  5. package/dist/cjs/components/button/Button.js +1 -1
  6. package/dist/cjs/components/hyper-text/index.d.ts +1 -1
  7. package/dist/cjs/components/hyper-text/index.js +1 -1
  8. package/dist/cjs/components/image-viewer/ImageThumbnails.d.ts +7 -0
  9. package/dist/cjs/components/image-viewer/ImageThumbnails.js +1 -0
  10. package/dist/cjs/components/image-viewer/ImageViewer.js +2 -2
  11. package/dist/cjs/components/image-viewer/index.d.ts +1 -3
  12. package/dist/cjs/components/morphing-text/index.d.ts +1 -1
  13. package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.d.ts +12 -0
  14. package/dist/cjs/components/scratch-to-reveal/index.d.ts +2 -0
  15. package/dist/cjs/index.d.ts +1 -0
  16. package/dist/cjs/index.js +1 -1
  17. package/dist/cjs/node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +1 -1
  18. package/dist/cjs/node_modules/.pnpm/three-forcegraph@1.43.0_three@0.178.0/node_modules/three-forcegraph/dist/three-forcegraph.js +1 -1
  19. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.module.js +1 -1
  20. package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +1 -1
  21. package/dist/cjs/react-components.css +1 -1
  22. package/dist/es/components/blur-fade/BlurFade.d.ts +23 -0
  23. package/dist/es/components/blur-fade/BlurFade.js +51 -0
  24. package/dist/es/components/blur-fade/index.d.ts +2 -0
  25. package/dist/es/components/button/Button.d.ts +3 -3
  26. package/dist/es/components/button/Button.js +2 -2
  27. package/dist/es/components/hyper-text/index.d.ts +1 -1
  28. package/dist/es/components/hyper-text/index.js +52 -50
  29. package/dist/es/components/image-viewer/ImageThumbnails.d.ts +7 -0
  30. package/dist/es/components/image-viewer/ImageThumbnails.js +74 -0
  31. package/dist/es/components/image-viewer/ImageViewer.js +63 -105
  32. package/dist/es/components/image-viewer/index.d.ts +1 -3
  33. package/dist/es/components/morphing-text/index.d.ts +1 -1
  34. package/dist/es/components/scratch-to-reveal/ScratchToReveal.d.ts +12 -0
  35. package/dist/es/components/scratch-to-reveal/index.d.ts +2 -0
  36. package/dist/es/index.d.ts +1 -0
  37. package/dist/es/index.js +18 -16
  38. package/dist/es/node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js +1 -1
  39. package/dist/es/node_modules/.pnpm/three-forcegraph@1.43.0_three@0.178.0/node_modules/three-forcegraph/dist/three-forcegraph.js +2 -2
  40. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.core.js +372 -372
  41. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.module.js +1 -1
  42. package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +1 -1
  43. package/dist/es/react-components.css +1 -1
  44. package/package.json +19 -19
  45. /package/dist/cjs/node_modules/.pnpm/{3d-force-graph@1.78.2 → 3d-force-graph@1.78.3}/node_modules/3d-force-graph/dist/3d-force-graph.js +0 -0
  46. /package/dist/es/node_modules/.pnpm/{3d-force-graph@1.78.2 → 3d-force-graph@1.78.3}/node_modules/3d-force-graph/dist/3d-force-graph.js +0 -0
@@ -0,0 +1,23 @@
1
+ import { UseInViewOptions, MotionProps } from 'motion/react';
2
+ type MarginType = UseInViewOptions["margin"];
3
+ interface BlurFadeProps extends MotionProps {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ variant?: {
7
+ hidden: {
8
+ y: number;
9
+ };
10
+ visible: {
11
+ y: number;
12
+ };
13
+ };
14
+ duration?: number;
15
+ delay?: number;
16
+ offset?: number;
17
+ direction?: "up" | "down" | "left" | "right";
18
+ inView?: boolean;
19
+ inViewMargin?: MarginType;
20
+ blur?: string;
21
+ }
22
+ export declare function BlurFade({ children, className, variant, duration, delay, offset, direction, inView, inViewMargin, blur, ...props }: BlurFadeProps): import("react/jsx-runtime").JSX.Element;
23
+ export {};
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { useInView as b, AnimatePresence as w, motion as y } from "motion/react";
4
+ import { useRef as V } from "react";
5
+ function R({
6
+ children: r,
7
+ className: a,
8
+ variant: s,
9
+ duration: l = 0.4,
10
+ delay: o = 0,
11
+ offset: i = 6,
12
+ direction: e = "down",
13
+ inView: u = !1,
14
+ inViewMargin: d = "-50px",
15
+ blur: m = "6px",
16
+ ...f
17
+ }) {
18
+ const t = V(null), p = b(t, { once: !0, margin: d }), c = !u || p, h = {
19
+ hidden: {
20
+ [e === "left" || e === "right" ? "x" : "y"]: e === "right" || e === "down" ? -i : i,
21
+ opacity: 0,
22
+ filter: `blur(${m})`
23
+ },
24
+ visible: {
25
+ [e === "left" || e === "right" ? "x" : "y"]: 0,
26
+ opacity: 1,
27
+ filter: "blur(0px)"
28
+ }
29
+ }, x = s || h;
30
+ return /* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(
31
+ y.div,
32
+ {
33
+ ref: t,
34
+ initial: "hidden",
35
+ animate: c ? "visible" : "hidden",
36
+ exit: "hidden",
37
+ variants: x,
38
+ transition: {
39
+ delay: 0.04 + o,
40
+ duration: l,
41
+ ease: "easeOut"
42
+ },
43
+ className: a,
44
+ ...f,
45
+ children: r
46
+ }
47
+ ) });
48
+ }
49
+ export {
50
+ R as BlurFade
51
+ };
@@ -0,0 +1,2 @@
1
+ import { BlurFade } from './BlurFade.tsx';
2
+ export { BlurFade };
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, ButtonHTMLAttributes } from 'react';
2
- export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
3
- export type ButtonSize = 'small' | 'medium' | 'large';
4
- export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> {
2
+ export type ButtonVariant = "primary" | "secondary" | "outline" | "ghost";
3
+ export type ButtonSize = "small" | "medium" | "large";
4
+ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "disabled"> {
5
5
  /** Button variant that changes the visual style */
6
6
  variant?: ButtonVariant;
7
7
  /** Size of the button */
@@ -1,5 +1,5 @@
1
1
  import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import x from "clsx";
2
+ import { cn as h } from "../../utils/utils.js";
3
3
  const w = ({
4
4
  variant: l = "primary",
5
5
  size: n = "medium",
@@ -22,7 +22,7 @@ const w = ({
22
22
  small: "px-3 py-1.5 text-sm",
23
23
  medium: "px-4 py-2 text-base",
24
24
  large: "px-6 py-3 text-lg"
25
- }, b = x(
25
+ }, b = h(
26
26
  y,
27
27
  p[l],
28
28
  f[n],
@@ -19,4 +19,4 @@ interface HyperTextProps extends MotionProps {
19
19
  characterSet?: CharacterSet;
20
20
  }
21
21
  export declare function HyperText({ children, className, duration, delay, as: Component, startOnView, animateOnHover, characterSet, ...props }: HyperTextProps): import("react/jsx-runtime").JSX.Element;
22
- export default HyperText;
22
+ export {};
@@ -1,74 +1,76 @@
1
1
  "use client";
2
2
  import { jsx as u } from "react/jsx-runtime";
3
3
  import { cn as g } from "../../utils/utils.js";
4
- import { motion as v, AnimatePresence as H } from "motion/react";
5
- import { useState as x, useRef as I, useEffect as d } from "react";
6
- const N = Object.freeze(
4
+ import { motion as x, AnimatePresence as U } from "motion/react";
5
+ import { useState as M, useRef as h, useEffect as I } from "react";
6
+ const j = Object.freeze(
7
7
  "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")
8
- ), P = (e) => Math.floor(Math.random() * e);
9
- function L({
10
- children: e,
11
- className: A,
12
- duration: l = 800,
13
- delay: s = 0,
14
- as: M = "div",
15
- startOnView: m = !1,
16
- animateOnHover: h = !0,
17
- characterSet: i = N,
18
- ...C
8
+ ), q = (n) => Math.floor(Math.random() * n);
9
+ function z({
10
+ children: n,
11
+ className: C,
12
+ duration: f = 800,
13
+ delay: r = 0,
14
+ as: E = "div",
15
+ startOnView: p = !1,
16
+ animateOnHover: F = !0,
17
+ characterSet: s = j,
18
+ ...R
19
19
  }) {
20
- const E = v.create(M, {
20
+ const b = x.create(E, {
21
21
  forwardMotionProps: !0
22
- }), [R, b] = x(
23
- () => e.split("")
24
- ), [a, o] = x(!1), r = I(0), c = I(null), D = () => {
25
- h && !a && (r.current = 0, o(!0));
22
+ }), [v, w] = M(
23
+ () => n.split("")
24
+ ), [i, o] = M(!1), a = h(0), m = h(null), D = () => {
25
+ F && !i && (a.current = 0, o(!0));
26
26
  };
27
- return d(() => {
28
- if (!m) {
29
- const n = setTimeout(() => {
27
+ return I(() => {
28
+ if (!p) {
29
+ const t = setTimeout(() => {
30
30
  o(!0);
31
- }, s);
32
- return () => clearTimeout(n);
31
+ }, r);
32
+ return () => clearTimeout(t);
33
33
  }
34
- const t = new IntersectionObserver(
35
- ([n]) => {
36
- n.isIntersecting && (setTimeout(() => {
34
+ const e = new IntersectionObserver(
35
+ ([t]) => {
36
+ t.isIntersecting && (setTimeout(() => {
37
37
  o(!0);
38
- }, s), t.disconnect());
38
+ }, r), e.disconnect());
39
39
  },
40
40
  { threshold: 0.1, rootMargin: "-30% 0px -30% 0px" }
41
41
  );
42
- return c.current && t.observe(c.current), () => t.disconnect();
43
- }, [s, m]), d(() => {
44
- if (!a) return;
45
- const t = l / (e.length * 10), n = e.length, f = setInterval(() => {
46
- r.current < n ? (b(
47
- (w) => w.map(
48
- (p, T) => p === " " ? p : T <= r.current ? e[T] : i[P(i.length)]
42
+ return m.current && e.observe(m.current), () => e.disconnect();
43
+ }, [r, p]), I(() => {
44
+ if (!i) return;
45
+ const e = n.length, t = performance.now();
46
+ let c;
47
+ const l = (H) => {
48
+ const N = H - t, T = Math.min(N / f, 1);
49
+ a.current = T * e, w(
50
+ (P) => P.map(
51
+ (A, d) => A === " " ? A : d <= a.current ? n[d] : s[q(s.length)]
49
52
  )
50
- ), r.current = r.current + 0.1) : (o(!1), clearInterval(f));
51
- }, t);
52
- return () => clearInterval(f);
53
- }, [e, l, a, i]), /* @__PURE__ */ u(
54
- E,
53
+ ), T < 1 ? c = requestAnimationFrame(l) : o(!1);
54
+ };
55
+ return c = requestAnimationFrame(l), () => cancelAnimationFrame(c);
56
+ }, [n, f, i, s]), /* @__PURE__ */ u(
57
+ b,
55
58
  {
56
- ref: c,
57
- className: g("overflow-hidden py-2 text-4xl font-bold", A),
59
+ ref: m,
60
+ className: g("overflow-hidden py-2 text-4xl font-bold", C),
58
61
  onMouseEnter: D,
59
- ...C,
60
- children: /* @__PURE__ */ u(H, { children: R.map((t, n) => /* @__PURE__ */ u(
61
- v.span,
62
+ ...R,
63
+ children: /* @__PURE__ */ u(U, { children: v.map((e, t) => /* @__PURE__ */ u(
64
+ x.span,
62
65
  {
63
- className: g("font-mono", t === " " ? "w-3" : ""),
64
- children: t.toUpperCase()
66
+ className: g("font-mono", e === " " ? "w-3" : ""),
67
+ children: e.toUpperCase()
65
68
  },
66
- n
69
+ t
67
70
  )) })
68
71
  }
69
72
  );
70
73
  }
71
74
  export {
72
- L as HyperText,
73
- L as default
75
+ z as HyperText
74
76
  };
@@ -0,0 +1,7 @@
1
+ interface ImageThumbnailsProps {
2
+ images: string[];
3
+ currentIndex: number;
4
+ onImageSelect: (index: number) => void;
5
+ }
6
+ declare const ImageThumbnails: ({ images, currentIndex, onImageSelect, }: ImageThumbnailsProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ImageThumbnails;
@@ -0,0 +1,74 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useScroll as g, motion as h, useMotionValue as p, useMotionValueEvent as b, animate as l } from "motion/react";
3
+ import { cn as v } from "../../utils/utils.js";
4
+ import { size as w } from "lodash-es";
5
+ import { useRef as k } from "react";
6
+ const m = "0%", x = "100%", d = "20%", s = "80%", n = "#0000", e = "#000";
7
+ function I(r) {
8
+ const o = p(
9
+ `linear-gradient(90deg, ${e}, ${e} ${m}, ${e} ${s}, ${n})`
10
+ );
11
+ return b(r, "change", (a) => {
12
+ a === 0 ? l(
13
+ o,
14
+ `linear-gradient(90deg, ${e}, ${e} ${m}, ${e} ${s}, ${n})`
15
+ ) : a === 1 ? l(
16
+ o,
17
+ `linear-gradient(90deg, ${n}, ${e} ${d}, ${e} ${x}, ${e})`
18
+ ) : (r.getPrevious() === 0 || r.getPrevious() === 1) && l(
19
+ o,
20
+ `linear-gradient(90deg, ${n}, ${e} ${d}, ${e} ${s}, ${n})`
21
+ );
22
+ }), o;
23
+ }
24
+ const j = ({
25
+ images: r,
26
+ currentIndex: o,
27
+ onImageSelect: a
28
+ }) => {
29
+ const i = k(null), { scrollXProgress: $ } = g({ container: i }), u = I($);
30
+ return /* @__PURE__ */ t(
31
+ "div",
32
+ {
33
+ className: v(
34
+ "h-24 bg-black bg-opacity-50 shrink-0 z-10 pb-safe-offset-0 pl-safe-offset-0 pr-safe-offset-0",
35
+ {
36
+ hidden: w(r) <= 1
37
+ }
38
+ ),
39
+ children: /* @__PURE__ */ t(
40
+ h.div,
41
+ {
42
+ ref: i,
43
+ style: {
44
+ maskImage: u,
45
+ WebkitOverflowScrolling: "touch",
46
+ scrollbarWidth: "none",
47
+ msOverflowStyle: "none"
48
+ },
49
+ className: "h-24 w-screen overflow-x-auto overflow-y-hidden scrollbar-hide",
50
+ children: /* @__PURE__ */ t("div", { className: "flex gap-2 p-2 h-24 min-w-max", children: r.map((c, f) => /* @__PURE__ */ t(
51
+ "div",
52
+ {
53
+ className: `h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${f === o ? "border-white" : "border-transparent"}`,
54
+ onClick: () => a(f),
55
+ children: /* @__PURE__ */ t(
56
+ "img",
57
+ {
58
+ src: c,
59
+ alt: "",
60
+ className: "w-full h-full object-contain",
61
+ draggable: "false"
62
+ }
63
+ )
64
+ },
65
+ c
66
+ )) })
67
+ }
68
+ )
69
+ }
70
+ );
71
+ };
72
+ export {
73
+ j as default
74
+ };
@@ -1,142 +1,100 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as u } from "react/jsx-runtime";
3
- import { Modal as z, ModalContent as M } from "@heroui/modal";
4
- import { Spinner as D } from "@heroui/spinner";
5
- import { IoDownloadOutline as U, IoCloseSharp as V } from "react-icons/io5";
6
- import q from "../pinch-content/PinchContent.js";
7
- import { useScroll as A, motion as B, useMotionValue as P, useMotionValueEvent as W, animate as h } from "motion/react";
8
- import { useState as v, useRef as H, useEffect as T } from "react";
9
- import _ from "clsx";
10
- const $ = (o) => {
11
- o.target.closest(".image-viewer-main-content") && o.preventDefault();
12
- }, y = "0%", F = "100%", x = "20%", g = "80%", l = "#0000", n = "#000";
13
- function G(o) {
14
- const e = P(
15
- `linear-gradient(90deg, ${n}, ${n} ${y}, ${n} ${g}, ${l})`
16
- );
17
- return W(o, "change", (i) => {
18
- i === 0 ? h(
19
- e,
20
- `linear-gradient(90deg, ${n}, ${n} ${y}, ${n} ${g}, ${l})`
21
- ) : i === 1 ? h(
22
- e,
23
- `linear-gradient(90deg, ${l}, ${n} ${x}, ${n} ${F}, ${n})`
24
- ) : (o.getPrevious() === 0 || o.getPrevious() === 1) && h(
25
- e,
26
- `linear-gradient(90deg, ${l}, ${n} ${x}, ${n} ${g}, ${l})`
27
- );
28
- }), e;
29
- }
30
- const ne = (o) => {
2
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
+ import { Modal as N, ModalContent as L } from "@heroui/modal";
4
+ import { Spinner as E } from "@heroui/spinner";
5
+ import { IoDownloadOutline as j, IoCloseSharp as k } from "react-icons/io5";
6
+ import S from "../pinch-content/PinchContent.js";
7
+ import z from "./ImageThumbnails.js";
8
+ import { useState as u, useEffect as R } from "react";
9
+ import D from "clsx";
10
+ const h = (t) => {
11
+ t.target.closest(".image-viewer-main-content") && t.preventDefault();
12
+ }, _ = (t) => {
31
13
  const {
32
- isOpen: e,
33
- onClose: i,
34
- imgSrc: d,
35
- canDownload: C = !1,
36
- wrapperClassName: N
37
- } = o, c = Array.isArray(d) ? d : [d], [m, k] = v(0), [I, f] = v(!0), p = H(null), b = () => {
38
- f(!0), i();
39
- }, E = async () => {
40
- const r = c[m];
14
+ isOpen: o,
15
+ onClose: p,
16
+ imgSrc: r,
17
+ canDownload: g = !1,
18
+ wrapperClassName: b
19
+ } = t, s = Array.isArray(r) ? r : [r], [a, w] = u(0), [v, l] = u(!0), i = () => {
20
+ l(!0), p();
21
+ }, y = async () => {
22
+ const d = s[a];
41
23
  try {
42
- const R = await (await fetch(r)).blob(), w = window.URL.createObjectURL(R), a = document.createElement("a");
43
- a.href = w, a.download = r.split("/").pop() || "image", document.body.appendChild(a), a.click(), window.URL.revokeObjectURL(w), document.body.removeChild(a);
44
- } catch (s) {
45
- console.error("Error downloading image:", s);
24
+ const I = await (await fetch(d)).blob(), f = window.URL.createObjectURL(I), n = document.createElement("a");
25
+ n.href = f, n.download = d.split("/").pop() || "image", document.body.appendChild(n), n.click(), window.URL.revokeObjectURL(f), document.body.removeChild(n);
26
+ } catch (m) {
27
+ console.error("Error downloading image:", m);
46
28
  }
47
- }, L = () => {
48
- f(!1);
49
- }, S = () => {
50
- f(!1);
29
+ }, C = () => {
30
+ l(!1);
31
+ }, x = () => {
32
+ l(!1);
51
33
  };
52
- T(() => {
53
- if (e)
54
- return document.addEventListener("touchmove", $, {
34
+ return R(() => {
35
+ if (o)
36
+ return document.addEventListener("touchmove", h, {
55
37
  passive: !1
56
38
  }), () => {
57
- document.removeEventListener("touchmove", $);
39
+ document.removeEventListener("touchmove", h);
58
40
  };
59
- }, [e]);
60
- const { scrollXProgress: j } = A({ container: p }), O = G(j);
61
- return /* @__PURE__ */ t(
62
- z,
41
+ }, [o]), /* @__PURE__ */ e(
42
+ N,
63
43
  {
64
- isOpen: e,
44
+ isOpen: o,
65
45
  size: "full",
66
- onClose: b,
46
+ onClose: i,
67
47
  classNames: {
68
- wrapper: _("", N)
48
+ wrapper: D("", b)
69
49
  },
70
50
  className: "bg-black bg-opacity-70",
71
51
  hideCloseButton: !0,
72
52
  portalContainer: document.body,
73
- children: /* @__PURE__ */ t(M, { className: "overflow-hidden", children: /* @__PURE__ */ u("div", { className: "w-screen h-screen relative flex flex-col pt-safe-offset-0", children: [
74
- /* @__PURE__ */ u("div", { className: "absolute top-2 right-2 flex gap-4 z-10", children: [
75
- C && /* @__PURE__ */ t(
76
- U,
53
+ children: /* @__PURE__ */ e(L, { className: "overflow-hidden", children: /* @__PURE__ */ c("div", { className: "w-screen h-screen relative flex flex-col pt-safe-offset-0", children: [
54
+ /* @__PURE__ */ c("div", { className: "absolute top-2 right-2 flex gap-4 z-10", children: [
55
+ g && /* @__PURE__ */ e(
56
+ j,
77
57
  {
78
58
  size: 24,
79
59
  className: "text-white cursor-pointer",
80
- onClick: E
60
+ onClick: y
81
61
  }
82
62
  ),
83
- /* @__PURE__ */ t(
84
- V,
63
+ /* @__PURE__ */ e(
64
+ k,
85
65
  {
86
66
  size: 24,
87
67
  className: "text-white cursor-pointer",
88
- onClick: b
68
+ onClick: i
89
69
  }
90
70
  )
91
71
  ] }),
92
- /* @__PURE__ */ u("div", { className: "flex-1 min-h-0 relative flex items-center justify-center image-viewer-main-content", children: [
93
- /* @__PURE__ */ t(q, { canRotate: !1, className: "w-full h-full", children: /* @__PURE__ */ t(
72
+ /* @__PURE__ */ c("div", { className: "flex-1 min-h-0 relative flex items-center justify-center image-viewer-main-content", children: [
73
+ /* @__PURE__ */ e(S, { canRotate: !1, className: "w-full h-full", children: /* @__PURE__ */ e(
94
74
  "img",
95
75
  {
96
76
  draggable: "false",
97
- src: c[m],
77
+ src: s[a],
98
78
  alt: "",
99
79
  className: "w-screen h-full object-contain pointer-events-none",
100
- onLoad: L,
101
- onError: S
80
+ onLoad: C,
81
+ onError: x
102
82
  }
103
83
  ) }),
104
- I && /* @__PURE__ */ t("div", { className: "absolute inset-0 flex items-center justify-center bg-black bg-opacity-50", children: /* @__PURE__ */ t(D, { color: "white", size: "lg" }) })
84
+ v && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black bg-opacity-50", children: /* @__PURE__ */ e(E, { color: "white", size: "lg" }) })
105
85
  ] }),
106
- c.length > 1 && /* @__PURE__ */ t("div", { className: "h-24 bg-black bg-opacity-50 shrink-0 z-10 pb-safe-offset-0 pl-safe-offset-0 pr-safe-offset-0", children: /* @__PURE__ */ t(
107
- B.div,
86
+ /* @__PURE__ */ e(
87
+ z,
108
88
  {
109
- ref: p,
110
- style: {
111
- maskImage: O,
112
- WebkitOverflowScrolling: "touch",
113
- scrollbarWidth: "none",
114
- msOverflowStyle: "none"
115
- },
116
- className: "h-24 w-screen overflow-x-auto overflow-y-hidden scrollbar-hide",
117
- children: /* @__PURE__ */ t("div", { className: "flex gap-2 p-2 h-24 min-w-max", children: c.map((r, s) => /* @__PURE__ */ t(
118
- "div",
119
- {
120
- className: `h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${s === m ? "border-white" : "border-transparent"}`,
121
- onClick: () => k(s),
122
- children: /* @__PURE__ */ t(
123
- "img",
124
- {
125
- src: r,
126
- alt: "",
127
- className: "w-full h-full object-contain",
128
- draggable: "false"
129
- }
130
- )
131
- },
132
- r
133
- )) })
89
+ images: s,
90
+ currentIndex: a,
91
+ onImageSelect: w
134
92
  }
135
- ) })
93
+ )
136
94
  ] }) })
137
95
  }
138
96
  );
139
- }, J = `
97
+ }, O = `
140
98
  .scrollbar-hide {
141
99
  -ms-overflow-style: none;
142
100
  scrollbar-width: none;
@@ -146,12 +104,12 @@ const ne = (o) => {
146
104
  }
147
105
  `;
148
106
  if (typeof document < "u") {
149
- const o = "image-viewer-scrollbar-hide";
150
- if (!document.getElementById(o)) {
151
- const e = document.createElement("style");
152
- e.id = o, e.textContent = J, document.head.appendChild(e);
107
+ const t = "image-viewer-scrollbar-hide";
108
+ if (!document.getElementById(t)) {
109
+ const o = document.createElement("style");
110
+ o.id = t, o.textContent = O, document.head.appendChild(o);
153
111
  }
154
112
  }
155
113
  export {
156
- ne as default
114
+ _ as default
157
115
  };
@@ -1,3 +1 @@
1
- import { default as ImageViewer } from './ImageViewer';
2
- export { ImageViewer };
3
- export default ImageViewer;
1
+ export { default as ImageViewer } from './ImageViewer';
@@ -3,4 +3,4 @@ interface MorphingTextProps {
3
3
  texts: string[];
4
4
  }
5
5
  export declare const MorphingText: React.FC<MorphingTextProps>;
6
- export default MorphingText;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ interface ScratchToRevealProps {
3
+ children: React.ReactNode;
4
+ width: number;
5
+ height: number;
6
+ minScratchPercentage?: number;
7
+ className?: string;
8
+ onComplete?: () => void;
9
+ gradientColors?: [string, string, string];
10
+ }
11
+ export declare const ScratchToReveal: React.FC<ScratchToRevealProps>;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ScratchToReveal } from './ScratchToReveal';
2
+ export { ScratchToReveal };
@@ -16,3 +16,4 @@ export * from './components/confetti-button';
16
16
  export * from './hooks/useStayTimeReport';
17
17
  export * from './components/pointer';
18
18
  export * from './components/sparkles-text';
19
+ export * from './components/blur-fade';
package/dist/es/index.js CHANGED
@@ -1,44 +1,46 @@
1
1
  /* empty css */
2
- import { Button as e } from "./components/button/Button.js";
2
+ import { Button as t } from "./components/button/Button.js";
3
3
  import { TxtReader as f } from "./components/txt-reader/TxtReader.js";
4
4
  import { HyperText as x } from "./components/hyper-text/index.js";
5
5
  import { TypingAnimation as n } from "./components/typing-animation/index.js";
6
- import { QRCode as s } from "./components/qr-code/index.js";
6
+ import { QRCode as d } from "./components/qr-code/index.js";
7
7
  import { Confetti as u, ConfettiButton as c } from "./components/confetti-button/index.js";
8
- import { useStayTimeReport as l } from "./hooks/useStayTimeReport.js";
8
+ import { useStayTimeReport as T } from "./hooks/useStayTimeReport.js";
9
9
  import { default as g } from "./components/pinch-content/PinchContent.js";
10
- import { default as h } from "./components/image-viewer/ImageViewer.js";
11
- import { ShimmerButton as B } from "./components/shimmer-button/ShimmerButton.js";
10
+ import { default as B } from "./components/image-viewer/ImageViewer.js";
11
+ import { ShimmerButton as y } from "./components/shimmer-button/ShimmerButton.js";
12
12
  import { default as I } from "./components/image-compare/ImageCompare.js";
13
13
  import { TextAnimate as S } from "./components/text-animate/TextAnimate.js";
14
- import { Dock as P, DockIcon as V, dockVariants as w } from "./components/dock/Duck.js";
15
- import { TxtEditor as F } from "./components/txt-editor/TxtEditor.js";
14
+ import { Dock as F, DockIcon as P, dockVariants as V } from "./components/dock/Duck.js";
15
+ import { TxtEditor as E } from "./components/txt-editor/TxtEditor.js";
16
16
  import { Message as H } from "./components/message/Message.js";
17
17
  import { default as Q } from "./node_modules/.pnpm/react-force-graph-3d@1.28.0_react@19.1.0/node_modules/react-force-graph-3d/dist/react-force-graph-3d.js";
18
18
  import { default as j } from "./node_modules/.pnpm/canvas-confetti@1.9.3/node_modules/canvas-confetti/dist/confetti.module.js";
19
19
  import { Pointer as v } from "./components/pointer/Pointer.js";
20
20
  import { SparklesText as J } from "./components/sparkles-text/SparklesText.js";
21
+ import { BlurFade as L } from "./components/blur-fade/BlurFade.js";
21
22
  export {
22
- e as Button,
23
+ L as BlurFade,
24
+ t as Button,
23
25
  u as Confetti,
24
26
  c as ConfettiButton,
25
- P as Dock,
26
- V as DockIcon,
27
+ F as Dock,
28
+ P as DockIcon,
27
29
  Q as ForceGraph3D,
28
30
  x as HyperText,
29
31
  I as ImageCompare,
30
- h as ImageViewer,
32
+ B as ImageViewer,
31
33
  H as Message,
32
34
  g as PinchContent,
33
35
  v as Pointer,
34
- s as QRCode,
35
- B as ShimmerButton,
36
+ d as QRCode,
37
+ y as ShimmerButton,
36
38
  J as SparklesText,
37
39
  S as TextAnimate,
38
- F as TxtEditor,
40
+ E as TxtEditor,
39
41
  f as TxtReader,
40
42
  n as TypingAnimation,
41
43
  j as confetti,
42
- w as dockVariants,
43
- l as useStayTimeReport
44
+ V as dockVariants,
45
+ T as useStayTimeReport
44
46
  };