@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.
- package/dist/cjs/components/blur-fade/BlurFade.d.ts +23 -0
- package/dist/cjs/components/blur-fade/BlurFade.js +1 -0
- package/dist/cjs/components/blur-fade/index.d.ts +2 -0
- package/dist/cjs/components/button/Button.d.ts +3 -3
- package/dist/cjs/components/button/Button.js +1 -1
- package/dist/cjs/components/hyper-text/index.d.ts +1 -1
- package/dist/cjs/components/hyper-text/index.js +1 -1
- package/dist/cjs/components/image-viewer/ImageThumbnails.d.ts +7 -0
- package/dist/cjs/components/image-viewer/ImageThumbnails.js +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.js +2 -2
- package/dist/cjs/components/image-viewer/index.d.ts +1 -3
- package/dist/cjs/components/morphing-text/index.d.ts +1 -1
- package/dist/cjs/components/scratch-to-reveal/ScratchToReveal.d.ts +12 -0
- package/dist/cjs/components/scratch-to-reveal/index.d.ts +2 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- 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
- 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
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.module.js +1 -1
- package/dist/cjs/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +1 -1
- package/dist/cjs/react-components.css +1 -1
- package/dist/es/components/blur-fade/BlurFade.d.ts +23 -0
- package/dist/es/components/blur-fade/BlurFade.js +51 -0
- package/dist/es/components/blur-fade/index.d.ts +2 -0
- package/dist/es/components/button/Button.d.ts +3 -3
- package/dist/es/components/button/Button.js +2 -2
- package/dist/es/components/hyper-text/index.d.ts +1 -1
- package/dist/es/components/hyper-text/index.js +52 -50
- package/dist/es/components/image-viewer/ImageThumbnails.d.ts +7 -0
- package/dist/es/components/image-viewer/ImageThumbnails.js +74 -0
- package/dist/es/components/image-viewer/ImageViewer.js +63 -105
- package/dist/es/components/image-viewer/index.d.ts +1 -3
- package/dist/es/components/morphing-text/index.d.ts +1 -1
- package/dist/es/components/scratch-to-reveal/ScratchToReveal.d.ts +12 -0
- package/dist/es/components/scratch-to-reveal/index.d.ts +2 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +18 -16
- 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
- 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
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.core.js +372 -372
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.module.js +1 -1
- package/dist/es/node_modules/.pnpm/three@0.178.0/node_modules/three/build/three.webgpu.js +1 -1
- package/dist/es/react-components.css +1 -1
- package/package.json +19 -19
- /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
- /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
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
2
|
-
export type ButtonVariant =
|
|
3
|
-
export type ButtonSize =
|
|
4
|
-
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
5
|
-
import { useState as
|
|
6
|
-
const
|
|
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
|
-
),
|
|
9
|
-
function
|
|
10
|
-
children:
|
|
11
|
-
className:
|
|
12
|
-
duration:
|
|
13
|
-
delay:
|
|
14
|
-
as:
|
|
15
|
-
startOnView:
|
|
16
|
-
animateOnHover:
|
|
17
|
-
characterSet:
|
|
18
|
-
...
|
|
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
|
|
20
|
+
const b = x.create(E, {
|
|
21
21
|
forwardMotionProps: !0
|
|
22
|
-
}), [
|
|
23
|
-
() =>
|
|
24
|
-
), [
|
|
25
|
-
|
|
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
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
27
|
+
return I(() => {
|
|
28
|
+
if (!p) {
|
|
29
|
+
const t = setTimeout(() => {
|
|
30
30
|
o(!0);
|
|
31
|
-
},
|
|
32
|
-
return () => clearTimeout(
|
|
31
|
+
}, r);
|
|
32
|
+
return () => clearTimeout(t);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
([
|
|
36
|
-
|
|
34
|
+
const e = new IntersectionObserver(
|
|
35
|
+
([t]) => {
|
|
36
|
+
t.isIntersecting && (setTimeout(() => {
|
|
37
37
|
o(!0);
|
|
38
|
-
},
|
|
38
|
+
}, r), e.disconnect());
|
|
39
39
|
},
|
|
40
40
|
{ threshold: 0.1, rootMargin: "-30% 0px -30% 0px" }
|
|
41
41
|
);
|
|
42
|
-
return
|
|
43
|
-
}, [
|
|
44
|
-
if (!
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
),
|
|
51
|
-
}
|
|
52
|
-
return () =>
|
|
53
|
-
}, [
|
|
54
|
-
|
|
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:
|
|
57
|
-
className: g("overflow-hidden py-2 text-4xl font-bold",
|
|
59
|
+
ref: m,
|
|
60
|
+
className: g("overflow-hidden py-2 text-4xl font-bold", C),
|
|
58
61
|
onMouseEnter: D,
|
|
59
|
-
...
|
|
60
|
-
children: /* @__PURE__ */ u(
|
|
61
|
-
|
|
62
|
+
...R,
|
|
63
|
+
children: /* @__PURE__ */ u(U, { children: v.map((e, t) => /* @__PURE__ */ u(
|
|
64
|
+
x.span,
|
|
62
65
|
{
|
|
63
|
-
className: g("font-mono",
|
|
64
|
-
children:
|
|
66
|
+
className: g("font-mono", e === " " ? "w-3" : ""),
|
|
67
|
+
children: e.toUpperCase()
|
|
65
68
|
},
|
|
66
|
-
|
|
69
|
+
t
|
|
67
70
|
)) })
|
|
68
71
|
}
|
|
69
72
|
);
|
|
70
73
|
}
|
|
71
74
|
export {
|
|
72
|
-
|
|
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
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { Spinner as
|
|
5
|
-
import { IoDownloadOutline as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useState as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
},
|
|
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:
|
|
33
|
-
onClose:
|
|
34
|
-
imgSrc:
|
|
35
|
-
canDownload:
|
|
36
|
-
wrapperClassName:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
const
|
|
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
|
|
43
|
-
|
|
44
|
-
} catch (
|
|
45
|
-
console.error("Error downloading image:",
|
|
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
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
29
|
+
}, C = () => {
|
|
30
|
+
l(!1);
|
|
31
|
+
}, x = () => {
|
|
32
|
+
l(!1);
|
|
51
33
|
};
|
|
52
|
-
|
|
53
|
-
if (
|
|
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
|
-
}, [
|
|
60
|
-
|
|
61
|
-
return /* @__PURE__ */ t(
|
|
62
|
-
z,
|
|
41
|
+
}, [o]), /* @__PURE__ */ e(
|
|
42
|
+
N,
|
|
63
43
|
{
|
|
64
|
-
isOpen:
|
|
44
|
+
isOpen: o,
|
|
65
45
|
size: "full",
|
|
66
|
-
onClose:
|
|
46
|
+
onClose: i,
|
|
67
47
|
classNames: {
|
|
68
|
-
wrapper:
|
|
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__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
76
|
-
|
|
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:
|
|
60
|
+
onClick: y
|
|
81
61
|
}
|
|
82
62
|
),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
k,
|
|
85
65
|
{
|
|
86
66
|
size: 24,
|
|
87
67
|
className: "text-white cursor-pointer",
|
|
88
|
-
onClick:
|
|
68
|
+
onClick: i
|
|
89
69
|
}
|
|
90
70
|
)
|
|
91
71
|
] }),
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
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:
|
|
77
|
+
src: s[a],
|
|
98
78
|
alt: "",
|
|
99
79
|
className: "w-screen h-full object-contain pointer-events-none",
|
|
100
|
-
onLoad:
|
|
101
|
-
onError:
|
|
80
|
+
onLoad: C,
|
|
81
|
+
onError: x
|
|
102
82
|
}
|
|
103
83
|
) }),
|
|
104
|
-
|
|
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
|
-
|
|
107
|
-
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
z,
|
|
108
88
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
},
|
|
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
|
|
150
|
-
if (!document.getElementById(
|
|
151
|
-
const
|
|
152
|
-
|
|
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
|
-
|
|
114
|
+
_ as default
|
|
157
115
|
};
|
|
@@ -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 {};
|
package/dist/es/index.d.ts
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Button as
|
|
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
|
|
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
|
|
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
|
|
11
|
-
import { ShimmerButton as
|
|
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
|
|
15
|
-
import { TxtEditor as
|
|
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
|
-
|
|
23
|
+
L as BlurFade,
|
|
24
|
+
t as Button,
|
|
23
25
|
u as Confetti,
|
|
24
26
|
c as ConfettiButton,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
F as Dock,
|
|
28
|
+
P as DockIcon,
|
|
27
29
|
Q as ForceGraph3D,
|
|
28
30
|
x as HyperText,
|
|
29
31
|
I as ImageCompare,
|
|
30
|
-
|
|
32
|
+
B as ImageViewer,
|
|
31
33
|
H as Message,
|
|
32
34
|
g as PinchContent,
|
|
33
35
|
v as Pointer,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
d as QRCode,
|
|
37
|
+
y as ShimmerButton,
|
|
36
38
|
J as SparklesText,
|
|
37
39
|
S as TextAnimate,
|
|
38
|
-
|
|
40
|
+
E as TxtEditor,
|
|
39
41
|
f as TxtReader,
|
|
40
42
|
n as TypingAnimation,
|
|
41
43
|
j as confetti,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
V as dockVariants,
|
|
45
|
+
T as useStayTimeReport
|
|
44
46
|
};
|