@xiping/react-components 0.0.64 → 0.0.66

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 (33) hide show
  1. package/dist/cjs/components/hyper-text/index.d.ts +22 -0
  2. package/dist/cjs/components/hyper-text/index.js +1 -0
  3. package/dist/cjs/components/image-viewer/ImageViewer.js +1 -1
  4. package/dist/cjs/components/morphing-text/index.d.ts +6 -0
  5. package/dist/cjs/components/pinch-content/PinchContent.d.ts +1 -0
  6. package/dist/cjs/components/pinch-content/PinchContent.js +1 -1
  7. package/dist/cjs/components/shimmer-button/ShimmerButton.d.ts +12 -0
  8. package/dist/cjs/components/text-animate/TextAnimate.d.ts +52 -0
  9. package/dist/cjs/components/text-animate/index.d.ts +3 -0
  10. package/dist/cjs/components/typing-animation/index.d.ts +11 -0
  11. package/dist/cjs/components/typing-animation/index.js +1 -0
  12. package/dist/cjs/index.d.ts +2 -0
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/cjs/react-components.css +1 -1
  15. package/dist/cjs/utils/utils.d.ts +2 -0
  16. package/dist/cjs/utils/utils.js +1 -0
  17. package/dist/es/components/hyper-text/index.d.ts +22 -0
  18. package/dist/es/components/hyper-text/index.js +73 -0
  19. package/dist/es/components/image-viewer/ImageViewer.js +52 -41
  20. package/dist/es/components/morphing-text/index.d.ts +6 -0
  21. package/dist/es/components/pinch-content/PinchContent.d.ts +1 -0
  22. package/dist/es/components/pinch-content/PinchContent.js +53 -45
  23. package/dist/es/components/shimmer-button/ShimmerButton.d.ts +12 -0
  24. package/dist/es/components/text-animate/TextAnimate.d.ts +52 -0
  25. package/dist/es/components/text-animate/index.d.ts +3 -0
  26. package/dist/es/components/typing-animation/index.d.ts +11 -0
  27. package/dist/es/components/typing-animation/index.js +58 -0
  28. package/dist/es/index.d.ts +2 -0
  29. package/dist/es/index.js +12 -8
  30. package/dist/es/react-components.css +1 -1
  31. package/dist/es/utils/utils.d.ts +2 -0
  32. package/dist/es/utils/utils.js +8 -0
  33. package/package.json +30 -27
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("clsx"),t=require("tailwind-merge");function n(...e){return t.twMerge(r(e))}exports.cn=n;
@@ -0,0 +1,22 @@
1
+ import { MotionProps } from 'motion/react';
2
+ type CharacterSet = string[] | readonly string[];
3
+ interface HyperTextProps extends MotionProps {
4
+ /** The text content to be animated */
5
+ children: string;
6
+ /** Optional className for styling */
7
+ className?: string;
8
+ /** Duration of the animation in milliseconds */
9
+ duration?: number;
10
+ /** Delay before animation starts in milliseconds */
11
+ delay?: number;
12
+ /** Component to render as - defaults to div */
13
+ as?: React.ElementType;
14
+ /** Whether to start animation when element comes into view */
15
+ startOnView?: boolean;
16
+ /** Whether to trigger animation on hover */
17
+ animateOnHover?: boolean;
18
+ /** Custom character set for scramble effect. Defaults to uppercase alphabet */
19
+ characterSet?: CharacterSet;
20
+ }
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;
@@ -0,0 +1,73 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { cn as g } from "../../utils/utils.js";
3
+ import { motion as v, AnimatePresence as H } from "motion/react";
4
+ import { useState as x, useRef as I, useEffect as d } from "react";
5
+ const N = Object.freeze(
6
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")
7
+ ), P = (e) => Math.floor(Math.random() * e);
8
+ function L({
9
+ children: e,
10
+ className: A,
11
+ duration: m = 800,
12
+ delay: s = 0,
13
+ as: M = "div",
14
+ startOnView: f = !1,
15
+ animateOnHover: h = !0,
16
+ characterSet: i = N,
17
+ ...C
18
+ }) {
19
+ const E = v.create(M, {
20
+ forwardMotionProps: !0
21
+ }), [R, b] = x(
22
+ () => e.split("")
23
+ ), [a, o] = x(!1), r = I(0), c = I(null), D = () => {
24
+ h && !a && (r.current = 0, o(!0));
25
+ };
26
+ return d(() => {
27
+ if (!f) {
28
+ const n = setTimeout(() => {
29
+ o(!0);
30
+ }, s);
31
+ return () => clearTimeout(n);
32
+ }
33
+ const t = new IntersectionObserver(
34
+ ([n]) => {
35
+ n.isIntersecting && (setTimeout(() => {
36
+ o(!0);
37
+ }, s), t.disconnect());
38
+ },
39
+ { threshold: 0.1, rootMargin: "-30% 0px -30% 0px" }
40
+ );
41
+ return c.current && t.observe(c.current), () => t.disconnect();
42
+ }, [s, f]), d(() => {
43
+ if (!a) return;
44
+ const t = m / (e.length * 10), n = e.length, l = setInterval(() => {
45
+ r.current < n ? (b(
46
+ (w) => w.map(
47
+ (p, T) => p === " " ? p : T <= r.current ? e[T] : i[P(i.length)]
48
+ )
49
+ ), r.current = r.current + 0.1) : (o(!1), clearInterval(l));
50
+ }, t);
51
+ return () => clearInterval(l);
52
+ }, [e, m, a, i]), /* @__PURE__ */ u(
53
+ E,
54
+ {
55
+ ref: c,
56
+ className: g("overflow-hidden py-2 text-4xl font-bold", A),
57
+ onMouseEnter: D,
58
+ ...C,
59
+ children: /* @__PURE__ */ u(H, { children: R.map((t, n) => /* @__PURE__ */ u(
60
+ v.span,
61
+ {
62
+ className: g("font-mono", t === " " ? "w-3" : ""),
63
+ children: t.toUpperCase()
64
+ },
65
+ n
66
+ )) })
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ L as HyperText,
72
+ L as default
73
+ };
@@ -1,42 +1,43 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { Modal as N, ModalContent as y } from "@nextui-org/modal";
3
- import { Spinner as k } from "@nextui-org/spinner";
1
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
+ import { Modal as C, ModalContent as k } from "@heroui/modal";
3
+ import { Spinner as z } from "@heroui/spinner";
4
4
  import { IoDownloadOutline as j, IoCloseSharp as I } from "react-icons/io5";
5
5
  import L from "../pinch-content/PinchContent.js";
6
+ import * as n from "@radix-ui/react-scroll-area";
6
7
  import { useState as m } from "react";
7
8
  const D = (h) => {
8
- const { isOpen: f, onClose: u, imgSrc: t, canDownload: p = !1 } = h, r = Array.isArray(t) ? t : [t], [n, g] = m(0), [b, s] = m(!0), i = () => {
9
- s(!0), u();
10
- }, w = async () => {
11
- const o = r[n];
9
+ const { isOpen: p, onClose: b, imgSrc: s, canDownload: u = !1 } = h, r = Array.isArray(s) ? s : [s], [i, g] = m(0), [w, c] = m(!0), d = () => {
10
+ c(!0), b();
11
+ }, x = async () => {
12
+ const o = r[i];
12
13
  try {
13
- const C = await (await fetch(o)).blob(), d = window.URL.createObjectURL(C), l = document.createElement("a");
14
- l.href = d, l.download = o.split("/").pop() || "image", document.body.appendChild(l), l.click(), window.URL.revokeObjectURL(d), document.body.removeChild(l);
14
+ const y = await (await fetch(o)).blob(), f = window.URL.createObjectURL(y), t = document.createElement("a");
15
+ t.href = f, t.download = o.split("/").pop() || "image", document.body.appendChild(t), t.click(), window.URL.revokeObjectURL(f), document.body.removeChild(t);
15
16
  } catch (a) {
16
17
  console.error("Error downloading image:", a);
17
18
  }
18
- }, x = () => {
19
- s(!1);
19
+ }, N = () => {
20
+ c(!1);
20
21
  }, v = () => {
21
- s(!1);
22
+ c(!1);
22
23
  };
23
24
  return /* @__PURE__ */ e(
24
- N,
25
+ C,
25
26
  {
26
- isOpen: f,
27
+ isOpen: p,
27
28
  size: "full",
28
- onClose: i,
29
+ onClose: d,
29
30
  className: "bg-black bg-opacity-70",
30
31
  hideCloseButton: !0,
31
32
  portalContainer: document.body,
32
- children: /* @__PURE__ */ e(y, { className: "overflow-hidden", children: /* @__PURE__ */ c("div", { className: "w-screen h-screen relative flex flex-col", children: [
33
- /* @__PURE__ */ c("div", { className: "absolute top-2 right-2 flex gap-4 z-10", children: [
34
- p && /* @__PURE__ */ e(
33
+ children: /* @__PURE__ */ e(k, { className: "overflow-hidden", children: /* @__PURE__ */ l("div", { className: "w-screen h-screen relative flex flex-col pt-safe-offset-0", children: [
34
+ /* @__PURE__ */ l("div", { className: "absolute top-2 right-2 flex gap-4 z-10", children: [
35
+ u && /* @__PURE__ */ e(
35
36
  j,
36
37
  {
37
38
  size: 24,
38
39
  className: "text-white cursor-pointer",
39
- onClick: w
40
+ onClick: x
40
41
  }
41
42
  ),
42
43
  /* @__PURE__ */ e(
@@ -44,41 +45,51 @@ const D = (h) => {
44
45
  {
45
46
  size: 24,
46
47
  className: "text-white cursor-pointer",
47
- onClick: i
48
+ onClick: d
48
49
  }
49
50
  )
50
51
  ] }),
51
- /* @__PURE__ */ c("div", { className: "flex-1 min-h-0 relative flex items-center justify-center", children: [
52
+ /* @__PURE__ */ l("div", { className: "flex-1 min-h-0 relative flex items-center justify-center", children: [
52
53
  /* @__PURE__ */ e(L, { canRotate: !1, className: "w-full h-full", children: /* @__PURE__ */ e(
53
54
  "img",
54
55
  {
55
56
  draggable: "false",
56
- src: r[n],
57
+ src: r[i],
57
58
  alt: "",
58
59
  className: "w-screen h-full object-contain pointer-events-none",
59
- onLoad: x,
60
+ onLoad: N,
60
61
  onError: v
61
62
  }
62
63
  ) }),
63
- b && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black bg-opacity-50", children: /* @__PURE__ */ e(k, { color: "white", size: "lg" }) })
64
+ w && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center bg-black bg-opacity-50", children: /* @__PURE__ */ e(z, { color: "white", size: "lg" }) })
64
65
  ] }),
65
- r.length > 1 && /* @__PURE__ */ e("div", { className: "h-24 bg-black bg-opacity-50 shrink-0 z-10", children: /* @__PURE__ */ e("div", { className: "w-full h-full overflow-x-auto flex gap-2 p-2", children: r.map((o, a) => /* @__PURE__ */ e(
66
- "div",
67
- {
68
- className: `h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${a === n ? "border-white" : "border-transparent"}`,
69
- onClick: () => g(a),
70
- children: /* @__PURE__ */ e(
71
- "img",
72
- {
73
- src: o,
74
- alt: "",
75
- className: "w-full h-full object-contain",
76
- draggable: "false"
77
- }
78
- )
79
- },
80
- o
81
- )) }) })
66
+ r.length > 1 && /* @__PURE__ */ e("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__ */ l(n.Root, { className: "h-24 w-screen", type: "auto", children: [
67
+ /* @__PURE__ */ e(n.Viewport, { className: "pppp h-full w-full", children: /* @__PURE__ */ e("div", { className: "flex gap-2 p-2 h-24", children: r.map((o, a) => /* @__PURE__ */ e(
68
+ "div",
69
+ {
70
+ className: `h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${a === i ? "border-white" : "border-transparent"}`,
71
+ onClick: () => g(a),
72
+ children: /* @__PURE__ */ e(
73
+ "img",
74
+ {
75
+ src: o,
76
+ alt: "",
77
+ className: "w-full h-full object-contain",
78
+ draggable: "false"
79
+ }
80
+ )
81
+ },
82
+ o
83
+ )) }) }),
84
+ /* @__PURE__ */ e(
85
+ n.Scrollbar,
86
+ {
87
+ className: "flex select-none touch-none p-0.5 bg-black/50 transition-colors duration-150 ease-out hover:bg-black/80 data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5 data-[orientation=horizontal]:flex-col",
88
+ orientation: "horizontal",
89
+ children: /* @__PURE__ */ e(n.Thumb, { className: "flex-1 bg-white/50 rounded-[10px] relative before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-[44px] before:min-h-[44px]" })
90
+ }
91
+ )
92
+ ] }) })
82
93
  ] }) })
83
94
  }
84
95
  );
@@ -0,0 +1,6 @@
1
+ interface MorphingTextProps {
2
+ className?: string;
3
+ texts: string[];
4
+ }
5
+ export declare const MorphingText: React.FC<MorphingTextProps>;
6
+ export default MorphingText;
@@ -9,6 +9,7 @@ export interface PinchContentProps {
9
9
  min: number;
10
10
  max: number;
11
11
  };
12
+ wheelZoomFactor?: number;
12
13
  }
13
14
  declare const PinchContent: (props: PinchContentProps) => import("react/jsx-runtime").JSX.Element;
14
15
  export default PinchContent;
@@ -1,26 +1,27 @@
1
- import { jsx as B } from "react/jsx-runtime";
2
- import { useSpring as C, animated as G } from "@react-spring/web";
3
- import { createUseGesture as N, dragAction as U, pinchAction as j } from "@use-gesture/react";
4
- import { useRef as w } from "react";
5
- import { useMount as M, useUnmount as S } from "ahooks";
1
+ import { jsx as P } from "react/jsx-runtime";
2
+ import { useSpring as R, animated as B } from "@react-spring/web";
3
+ import { createUseGesture as C, dragAction as G, pinchAction as N, wheelAction as U } from "@use-gesture/react";
4
+ import { useRef as j } from "react";
5
+ import { useMount as F, useUnmount as W } from "ahooks";
6
6
  import k from "clsx";
7
- const q = N([U, j]), o = (u) => u.preventDefault(), O = (u) => {
7
+ const q = C([G, N, U]), o = (i) => i.preventDefault(), Q = (i) => {
8
8
  const {
9
- className: f,
10
- children: l,
11
- canPinch: m = !0,
9
+ className: m,
10
+ children: h,
11
+ canPinch: g = !0,
12
12
  canDrag: p = !0,
13
- canRotate: h = !0,
14
- scaleBounds: v = { min: 0.3, max: 10 }
15
- } = u, t = w(null);
16
- M(() => {
17
- var r, e, n;
18
- (r = t.current) == null || r.addEventListener("gesturestart", o), (e = t.current) == null || e.addEventListener("gesturechange", o), (n = t.current) == null || n.addEventListener("gestureend", o);
19
- }), S(() => {
20
- var r, e, n;
21
- (r = t.current) == null || r.removeEventListener("gesturestart", o), (e = t.current) == null || e.removeEventListener("gesturechange", o), (n = t.current) == null || n.removeEventListener("gestureend", o);
13
+ canRotate: v = !0,
14
+ scaleBounds: l = { min: 0.3, max: 10 },
15
+ wheelZoomFactor: x = 0.1
16
+ } = i, n = j(null);
17
+ F(() => {
18
+ var t, e, r;
19
+ (t = n.current) == null || t.addEventListener("gesturestart", o), (e = n.current) == null || e.addEventListener("gesturechange", o), (r = n.current) == null || r.addEventListener("gestureend", o);
20
+ }), W(() => {
21
+ var t, e, r;
22
+ (t = n.current) == null || t.removeEventListener("gesturestart", o), (e = n.current) == null || e.removeEventListener("gesturechange", o), (r = n.current) == null || r.removeEventListener("gestureend", o);
22
23
  });
23
- const [c, g] = C(() => ({
24
+ const [s, d] = R(() => ({
24
25
  x: 0,
25
26
  y: 0,
26
27
  scale: 1,
@@ -28,45 +29,52 @@ const q = N([U, j]), o = (u) => u.preventDefault(), O = (u) => {
28
29
  }));
29
30
  return q(
30
31
  {
31
- // onHover: ({ active, event }) => console.log('hover', event, active),
32
- // onMove: ({ event }) => console.log('move', event),
33
- onDrag: ({ pinching: r, cancel: e, offset: [n, a], ...i }) => {
34
- if (console.log(i), !p || r) return e();
35
- g.start({ x: n, y: a });
32
+ onWheel: ({ event: t, delta: [, e] }) => {
33
+ if (!g) return;
34
+ const a = s.scale.get() * (1 - e * x), u = Math.min(
35
+ Math.max(a, l.min),
36
+ l.max
37
+ );
38
+ d.start({ scale: u });
39
+ },
40
+ onDrag: ({ pinching: t, cancel: e, offset: [r, a], ...u }) => {
41
+ if (!p || t) return e();
42
+ d.start({ x: r, y: a });
36
43
  },
37
44
  onPinch: ({
38
- origin: [r, e],
39
- first: n,
45
+ origin: [t, e],
46
+ first: r,
40
47
  movement: [a],
41
- offset: [i, x],
42
- memo: s,
43
- cancel: y
48
+ offset: [u, y],
49
+ memo: c,
50
+ cancel: E
44
51
  }) => {
45
- if (!m) return y();
46
- if (n) {
47
- const { width: b, height: D, x: P, y: R } = t.current.getBoundingClientRect(), Z = r - (P + b / 2), A = e - (R + D / 2);
48
- s = [c.x.get(), c.y.get(), Z, A];
52
+ if (!g) return E();
53
+ if (r) {
54
+ const { width: S, height: b, x: Z, y: A } = n.current.getBoundingClientRect(), D = t - (Z + S / 2), M = e - (A + b / 2);
55
+ c = [s.x.get(), s.y.get(), D, M];
49
56
  }
50
- const E = s[0] - (a - 1) * s[2], L = s[1] - (a - 1) * s[3], d = { scale: i, rotateZ: 0, x: E, y: L };
51
- return h && (d.rotateZ = x), g.start(d), s;
57
+ const L = c[0] - (a - 1) * c[2], w = c[1] - (a - 1) * c[3], f = { scale: u, rotateZ: 0, x: L, y: w };
58
+ return v && (f.rotateZ = y), d.start(f), c;
52
59
  }
53
60
  },
54
61
  {
55
- target: t,
56
- drag: { from: () => [c.x.get(), c.y.get()] },
57
- pinch: { scaleBounds: v, rubberband: !0 }
62
+ target: n,
63
+ drag: { from: () => [s.x.get(), s.y.get()] },
64
+ pinch: { scaleBounds: l, rubberband: !0 },
65
+ wheel: { enabled: !0 }
58
66
  }
59
67
  ), // <div className="flex items-center justify-center h-full w-full">
60
- /* @__PURE__ */ B(
61
- G.div,
68
+ /* @__PURE__ */ P(
69
+ B.div,
62
70
  {
63
- className: k("select-none", f),
64
- ref: t,
65
- style: c,
66
- children: l
71
+ className: k("select-none", m),
72
+ ref: n,
73
+ style: s,
74
+ children: h
67
75
  }
68
76
  );
69
77
  };
70
78
  export {
71
- O as default
79
+ Q as default
72
80
  };
@@ -0,0 +1,12 @@
1
+ import { default as React, ComponentPropsWithoutRef } from 'react';
2
+ export interface ShimmerButtonProps extends ComponentPropsWithoutRef<"button"> {
3
+ shimmerColor?: string;
4
+ shimmerSize?: string;
5
+ borderRadius?: string;
6
+ shimmerDuration?: string;
7
+ background?: string;
8
+ className?: string;
9
+ children?: React.ReactNode;
10
+ }
11
+ export declare const ShimmerButton: React.ForwardRefExoticComponent<ShimmerButtonProps & React.RefAttributes<HTMLButtonElement>>;
12
+ export default ShimmerButton;
@@ -0,0 +1,52 @@
1
+ import { MotionProps, Variants } from 'motion/react';
2
+ import { ElementType } from 'react';
3
+ type AnimationType = "text" | "word" | "character" | "line";
4
+ type AnimationVariant = "fadeIn" | "blurIn" | "blurInUp" | "blurInDown" | "slideUp" | "slideDown" | "slideLeft" | "slideRight" | "scaleUp" | "scaleDown";
5
+ interface TextAnimateProps extends MotionProps {
6
+ /**
7
+ * The text content to animate
8
+ */
9
+ children: string;
10
+ /**
11
+ * The class name to be applied to the component
12
+ */
13
+ className?: string;
14
+ /**
15
+ * The class name to be applied to each segment
16
+ */
17
+ segmentClassName?: string;
18
+ /**
19
+ * The delay before the animation starts
20
+ */
21
+ delay?: number;
22
+ /**
23
+ * The duration of the animation
24
+ */
25
+ duration?: number;
26
+ /**
27
+ * Custom motion variants for the animation
28
+ */
29
+ variants?: Variants;
30
+ /**
31
+ * The element type to render
32
+ */
33
+ as?: ElementType;
34
+ /**
35
+ * How to split the text ("text", "word", "character")
36
+ */
37
+ by?: AnimationType;
38
+ /**
39
+ * Whether to start animation when component enters viewport
40
+ */
41
+ startOnView?: boolean;
42
+ /**
43
+ * Whether to animate only once
44
+ */
45
+ once?: boolean;
46
+ /**
47
+ * The animation preset to use
48
+ */
49
+ animation?: AnimationVariant;
50
+ }
51
+ export declare function TextAnimate({ children, delay, duration, variants, className, segmentClassName, as: Component, startOnView, once, by, animation, ...props }: TextAnimateProps): import("react/jsx-runtime").JSX.Element;
52
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TextAnimate } from './TextAnimate';
2
+ export { TextAnimate };
3
+ export default TextAnimate;
@@ -0,0 +1,11 @@
1
+ import { MotionProps } from 'motion/react';
2
+ interface TypingAnimationProps extends MotionProps {
3
+ children: string;
4
+ className?: string;
5
+ duration?: number;
6
+ delay?: number;
7
+ as?: React.ElementType;
8
+ startOnView?: boolean;
9
+ }
10
+ export declare function TypingAnimation({ children, className, duration, delay, as: Component, startOnView, ...props }: TypingAnimationProps): import("react/jsx-runtime").JSX.Element;
11
+ export default TypingAnimation;
@@ -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
  };