@xiping/react-components 1.0.24 → 1.0.25
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/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/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,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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import t from "../../../../react-kapsule@2.5.7_react@19.1.0/node_modules/react-kapsule/dist/react-kapsule.js";
|
|
2
|
-
import c from "../../../../3d-force-graph@1.78.
|
|
2
|
+
import c from "../../../../3d-force-graph@1.78.3/node_modules/3d-force-graph/dist/3d-force-graph.js";
|
|
3
3
|
import n from "../../../../../../_virtual/index.js";
|
|
4
4
|
const e = {
|
|
5
5
|
width: n.number,
|
|
@@ -644,7 +644,7 @@ var l = window.THREE ? window.THREE : {
|
|
|
644
644
|
p.geometry.getAttribute("position").array.length !== L.length * 3 && p.geometry[ce]("position", new l.BufferAttribute(new Float32Array(L.length * 3), 3)), p.geometry.setFromPoints(L);
|
|
645
645
|
} else {
|
|
646
646
|
var D = p.geometry.getAttribute("position");
|
|
647
|
-
(!D || !D.array || D.array.length !== 6) && p.geometry[ce]("position", D = new l.BufferAttribute(new Float32Array(
|
|
647
|
+
(!D || !D.array || D.array.length !== 6) && p.geometry[ce]("position", D = new l.BufferAttribute(new Float32Array(6), 3)), D.array[0] = h.x, D.array[1] = h.y || 0, D.array[2] = h.z || 0, D.array[3] = O.x, D.array[4] = O.y || 0, D.array[5] = O.z || 0, D.needsUpdate = !0;
|
|
648
648
|
}
|
|
649
649
|
p.geometry.computeBoundingSphere();
|
|
650
650
|
} else if (p.type === "Mesh")
|
|
@@ -870,7 +870,7 @@ var l = window.THREE ? window.THREE : {
|
|
|
870
870
|
M = new l.Mesh();
|
|
871
871
|
else {
|
|
872
872
|
var T = new l.BufferGeometry();
|
|
873
|
-
T[ce]("position", new l.BufferAttribute(new Float32Array(
|
|
873
|
+
T[ce]("position", new l.BufferAttribute(new Float32Array(6), 3)), M = new l.Line(T);
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
var A;
|