@xiping/react-components 0.0.64 → 0.0.67
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/README.md +10 -2
- package/dist/cjs/components/hyper-text/index.d.ts +22 -0
- package/dist/cjs/components/hyper-text/index.js +1 -0
- package/dist/cjs/components/image-viewer/ImageViewer.js +1 -1
- package/dist/cjs/components/morphing-text/index.d.ts +6 -0
- package/dist/cjs/components/pinch-content/PinchContent.d.ts +1 -0
- package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
- package/dist/cjs/components/shimmer-button/ShimmerButton.d.ts +12 -0
- package/dist/cjs/components/text-animate/TextAnimate.d.ts +52 -0
- package/dist/cjs/components/text-animate/index.d.ts +3 -0
- package/dist/cjs/components/txt-reader/TxtReader.d.ts +4 -0
- package/dist/cjs/components/txt-reader/TxtReader.js +1 -1
- package/dist/cjs/components/typing-animation/index.d.ts +11 -0
- package/dist/cjs/components/typing-animation/index.js +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react-components.css +1 -1
- package/dist/cjs/utils/utils.d.ts +2 -0
- package/dist/cjs/utils/utils.js +1 -0
- package/dist/es/components/hyper-text/index.d.ts +22 -0
- package/dist/es/components/hyper-text/index.js +73 -0
- package/dist/es/components/image-viewer/ImageViewer.js +52 -41
- package/dist/es/components/morphing-text/index.d.ts +6 -0
- package/dist/es/components/pinch-content/PinchContent.d.ts +1 -0
- package/dist/es/components/pinch-content/PinchContent.js +53 -45
- package/dist/es/components/shimmer-button/ShimmerButton.d.ts +12 -0
- package/dist/es/components/text-animate/TextAnimate.d.ts +52 -0
- package/dist/es/components/text-animate/index.d.ts +3 -0
- package/dist/es/components/txt-reader/TxtReader.d.ts +4 -0
- package/dist/es/components/txt-reader/TxtReader.js +69 -57
- package/dist/es/components/typing-animation/index.d.ts +11 -0
- package/dist/es/components/typing-animation/index.js +58 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +12 -8
- package/dist/es/react-components.css +1 -1
- package/dist/es/utils/utils.d.ts +2 -0
- package/dist/es/utils/utils.js +8 -0
- package/package.json +29 -27
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { cn as x } from "../../utils/utils.js";
|
|
3
|
+
import { motion as b } from "motion/react";
|
|
4
|
+
import { useState as a, useRef as I, useEffect as u } from "react";
|
|
5
|
+
function R({
|
|
6
|
+
children: r,
|
|
7
|
+
className: l,
|
|
8
|
+
duration: s = 100,
|
|
9
|
+
delay: n = 0,
|
|
10
|
+
as: m = "div",
|
|
11
|
+
startOnView: i = !1,
|
|
12
|
+
...p
|
|
13
|
+
}) {
|
|
14
|
+
const d = b.create(m, {
|
|
15
|
+
forwardMotionProps: !0
|
|
16
|
+
}), [g, v] = a(""), [c, f] = a(!1), o = I(null);
|
|
17
|
+
return u(() => {
|
|
18
|
+
if (!i) {
|
|
19
|
+
const t = setTimeout(() => {
|
|
20
|
+
f(!0);
|
|
21
|
+
}, n);
|
|
22
|
+
return () => clearTimeout(t);
|
|
23
|
+
}
|
|
24
|
+
const e = new IntersectionObserver(
|
|
25
|
+
([t]) => {
|
|
26
|
+
t.isIntersecting && (setTimeout(() => {
|
|
27
|
+
f(!0);
|
|
28
|
+
}, n), e.disconnect());
|
|
29
|
+
},
|
|
30
|
+
{ threshold: 0.1 }
|
|
31
|
+
);
|
|
32
|
+
return o.current && e.observe(o.current), () => e.disconnect();
|
|
33
|
+
}, [n, i]), u(() => {
|
|
34
|
+
if (!c) return;
|
|
35
|
+
let e = 0;
|
|
36
|
+
const t = setInterval(() => {
|
|
37
|
+
e < r.length ? (v(r.substring(0, e + 1)), e++) : clearInterval(t);
|
|
38
|
+
}, s);
|
|
39
|
+
return () => {
|
|
40
|
+
clearInterval(t);
|
|
41
|
+
};
|
|
42
|
+
}, [r, s, c]), /* @__PURE__ */ T(
|
|
43
|
+
d,
|
|
44
|
+
{
|
|
45
|
+
ref: o,
|
|
46
|
+
className: x(
|
|
47
|
+
"text-4xl font-bold leading-[5rem] tracking-[-0.02em]",
|
|
48
|
+
l
|
|
49
|
+
),
|
|
50
|
+
...p,
|
|
51
|
+
children: g
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
R as TypingAnimation,
|
|
57
|
+
R as default
|
|
58
|
+
};
|
package/dist/es/index.d.ts
CHANGED
|
@@ -2,3 +2,5 @@ export * from './components/button/Button';
|
|
|
2
2
|
export * from './components/txt-reader/TxtReader';
|
|
3
3
|
export * from './components/pinch-content';
|
|
4
4
|
export * from './components/image-viewer';
|
|
5
|
+
export * from './components/hyper-text';
|
|
6
|
+
export * from './components/typing-animation';
|
package/dist/es/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Button as
|
|
3
|
-
import { TxtReader as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Button as t } from "./components/button/Button.js";
|
|
3
|
+
import { TxtReader as p } from "./components/txt-reader/TxtReader.js";
|
|
4
|
+
import { HyperText as x } from "./components/hyper-text/index.js";
|
|
5
|
+
import { TypingAnimation as n } from "./components/typing-animation/index.js";
|
|
6
|
+
import { default as d } from "./components/pinch-content/PinchContent.js";
|
|
7
|
+
import { default as T } from "./components/image-viewer/ImageViewer.js";
|
|
6
8
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
t as Button,
|
|
10
|
+
x as HyperText,
|
|
11
|
+
T as ImageViewer,
|
|
12
|
+
d as PinchContent,
|
|
13
|
+
p as TxtReader,
|
|
14
|
+
n as TypingAnimation
|
|
11
15
|
};
|