@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.
Files changed (38) hide show
  1. package/README.md +10 -2
  2. package/dist/cjs/components/hyper-text/index.d.ts +22 -0
  3. package/dist/cjs/components/hyper-text/index.js +1 -0
  4. package/dist/cjs/components/image-viewer/ImageViewer.js +1 -1
  5. package/dist/cjs/components/morphing-text/index.d.ts +6 -0
  6. package/dist/cjs/components/pinch-content/PinchContent.d.ts +1 -0
  7. package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
  8. package/dist/cjs/components/shimmer-button/ShimmerButton.d.ts +12 -0
  9. package/dist/cjs/components/text-animate/TextAnimate.d.ts +52 -0
  10. package/dist/cjs/components/text-animate/index.d.ts +3 -0
  11. package/dist/cjs/components/txt-reader/TxtReader.d.ts +4 -0
  12. package/dist/cjs/components/txt-reader/TxtReader.js +1 -1
  13. package/dist/cjs/components/typing-animation/index.d.ts +11 -0
  14. package/dist/cjs/components/typing-animation/index.js +1 -0
  15. package/dist/cjs/index.d.ts +2 -0
  16. package/dist/cjs/index.js +1 -1
  17. package/dist/cjs/react-components.css +1 -1
  18. package/dist/cjs/utils/utils.d.ts +2 -0
  19. package/dist/cjs/utils/utils.js +1 -0
  20. package/dist/es/components/hyper-text/index.d.ts +22 -0
  21. package/dist/es/components/hyper-text/index.js +73 -0
  22. package/dist/es/components/image-viewer/ImageViewer.js +52 -41
  23. package/dist/es/components/morphing-text/index.d.ts +6 -0
  24. package/dist/es/components/pinch-content/PinchContent.d.ts +1 -0
  25. package/dist/es/components/pinch-content/PinchContent.js +53 -45
  26. package/dist/es/components/shimmer-button/ShimmerButton.d.ts +12 -0
  27. package/dist/es/components/text-animate/TextAnimate.d.ts +52 -0
  28. package/dist/es/components/text-animate/index.d.ts +3 -0
  29. package/dist/es/components/txt-reader/TxtReader.d.ts +4 -0
  30. package/dist/es/components/txt-reader/TxtReader.js +69 -57
  31. package/dist/es/components/typing-animation/index.d.ts +11 -0
  32. package/dist/es/components/typing-animation/index.js +58 -0
  33. package/dist/es/index.d.ts +2 -0
  34. package/dist/es/index.js +12 -8
  35. package/dist/es/react-components.css +1 -1
  36. package/dist/es/utils/utils.d.ts +2 -0
  37. package/dist/es/utils/utils.js +8 -0
  38. 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
+ };
@@ -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 r } from "./components/button/Button.js";
3
- import { TxtReader as f } from "./components/txt-reader/TxtReader.js";
4
- import { default as p } from "./components/pinch-content/PinchContent.js";
5
- import { default as n } from "./components/image-viewer/ImageViewer.js";
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
- r as Button,
8
- n as ImageViewer,
9
- p as PinchContent,
10
- f as TxtReader
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
  };