telecop 0.1.39 → 0.1.40

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.
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ParallaxScrollProps {
3
+ children: ReactNode;
4
+ speed?: number;
5
+ direction?: 'up' | 'down' | 'left' | 'right';
6
+ scale?: boolean;
7
+ rotate?: boolean;
8
+ blur?: boolean;
9
+ opacity?: boolean;
10
+ triggerStart?: string;
11
+ triggerEnd?: string;
12
+ scrub?: boolean | number;
13
+ className?: string;
14
+ }
15
+ export declare function ParallaxScroll({ children, speed, direction, scale, rotate, blur, opacity, triggerStart, triggerEnd, scrub, className, }: ParallaxScrollProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ParallaxScroll } from './ParallaxScroll';
2
+ export type { ParallaxScrollProps } from './ParallaxScroll';
@@ -1,2 +1,4 @@
1
1
  export { FadeIn } from './FadeIn';
2
2
  export type { FadeInProps } from './FadeIn';
3
+ export { ParallaxScroll } from './ParallaxScroll';
4
+ export type { ParallaxScrollProps } from './ParallaxScroll';
package/dist/motion.js CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";var u=Object.create;var c=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var R=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of m(t))!f.call(e,o)&&o!==n&&c(e,o,{get:()=>t[o],enumerable:!(s=l(t,o))||s.enumerable});return e};var g=(e,t,n)=>(n=e!=null?u(p(e)):{},R(t||!e||!e.__esModule?c(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),i=require("react");function d({children:e,duration:t=1,delay:n=0,y:s=30,className:o=""}){const r=i.useRef(null);return i.useEffect(()=>{(async()=>{try{const{gsap:a}=await import("gsap");a.from(r.current,{opacity:0,y:s,duration:t,delay:n,ease:"power3.out"})}catch{console.warn("⚠️ Telecop: Please install GSAP to use motion components"),console.warn("Run: npm install gsap")}})()},[t,n,s]),w.jsx("div",{ref:r,className:o,children:e})}exports.FadeIn=d;
1
+ "use client";"use strict";var S=Object.create;var P=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var M=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of T(t))!v.call(e,o)&&o!==n&&P(e,o,{get:()=>t[o],enumerable:!(r=h(t,o))||r.enumerable});return e};var m=(e,t,n)=>(n=e!=null?S(j(e)):{},M(t||!e||!e.__esModule?P(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),p=require("react");function b({children:e,duration:t=1,delay:n=0,y:r=30,className:o=""}){const l=p.useRef(null);return p.useEffect(()=>{(async()=>{try{const{gsap:c}=await import("gsap");c.from(l.current,{opacity:0,y:r,duration:t,delay:n,ease:"power3.out"})}catch{console.warn("⚠️ Telecop: Please install GSAP to use motion components"),console.warn("Run: npm install gsap")}})()},[t,n,r]),y.jsx("div",{ref:l,className:o,children:e})}function A({children:e,speed:t=1,direction:n="up",scale:r=!1,rotate:o=!1,blur:l=!1,opacity:g=!1,triggerStart:c="top bottom",triggerEnd:w="bottom top",scrub:x=!0,className:R=""}){const i=p.useRef(null);return p.useEffect(()=>((async()=>{if(i.current)try{const u=(await import("gsap")).default,{ScrollTrigger:f}=await import("gsap/ScrollTrigger");u.registerPlugin(f);const a=100*t,s={...{up:{y:-a},down:{y:a},left:{x:-a},right:{x:a}}[n]};r&&(s.scale=1+.2*t),o&&(s.rotation=15*t),l&&(s.filter=`blur(${10*t}px)`),g&&(s.opacity=Math.max(0,1-.5*t)),u.to(i.current,{...s,ease:"none",scrollTrigger:{trigger:i.current,start:c,end:w,scrub:x}})}catch{console.warn("⚠️ Telecop: Please install GSAP to use ParallaxScroll"),console.warn("Run: npm install gsap")}})(),()=>{(async()=>{try{const{ScrollTrigger:f}=await import("gsap/ScrollTrigger");f.getAll().forEach(a=>a.kill())}catch{}})()}),[t,n,r,o,l,g,c,w,x]),y.jsx("div",{ref:i,className:R,children:e})}exports.FadeIn=b;exports.ParallaxScroll=A;
package/dist/motion.mjs CHANGED
@@ -1,31 +1,83 @@
1
1
  "use client";
2
- import { jsx as c } from "react/jsx-runtime";
3
- import { useRef as i, useEffect as m } from "react";
4
- function u({
5
- children: s,
6
- duration: e = 1,
7
- delay: n = 0,
8
- y: o = 30,
9
- className: a = ""
2
+ import { jsx as w } from "react/jsx-runtime";
3
+ import { useRef as x, useEffect as P } from "react";
4
+ function v({
5
+ children: m,
6
+ duration: t = 1,
7
+ delay: o = 0,
8
+ y: r = 30,
9
+ className: c = ""
10
10
  }) {
11
- const t = i(null);
12
- return m(() => {
11
+ const e = x(null);
12
+ return P(() => {
13
13
  (async () => {
14
14
  try {
15
- const { gsap: r } = await import("gsap");
16
- r.from(t.current, {
15
+ const { gsap: a } = await import("gsap");
16
+ a.from(e.current, {
17
17
  opacity: 0,
18
- y: o,
19
- duration: e,
20
- delay: n,
18
+ y: r,
19
+ duration: t,
20
+ delay: o,
21
21
  ease: "power3.out"
22
22
  });
23
23
  } catch {
24
24
  console.warn("⚠️ Telecop: Please install GSAP to use motion components"), console.warn("Run: npm install gsap");
25
25
  }
26
26
  })();
27
- }, [e, n, o]), /* @__PURE__ */ c("div", { ref: t, className: a, children: s });
27
+ }, [t, o, r]), /* @__PURE__ */ w("div", { ref: e, className: c, children: m });
28
+ }
29
+ function A({
30
+ children: m,
31
+ speed: t = 1,
32
+ direction: o = "up",
33
+ scale: r = !1,
34
+ rotate: c = !1,
35
+ blur: e = !1,
36
+ opacity: u = !1,
37
+ triggerStart: a = "top bottom",
38
+ triggerEnd: p = "bottom top",
39
+ scrub: g = !0,
40
+ className: y = ""
41
+ }) {
42
+ const i = x(null);
43
+ return P(() => ((async () => {
44
+ if (i.current)
45
+ try {
46
+ const s = (await import("gsap")).default, { ScrollTrigger: f } = await import("gsap/ScrollTrigger");
47
+ s.registerPlugin(f);
48
+ const n = 100 * t, l = {
49
+ ...{
50
+ up: { y: -n },
51
+ down: { y: n },
52
+ left: { x: -n },
53
+ right: { x: n }
54
+ }[o]
55
+ };
56
+ r && (l.scale = 1 + 0.2 * t), c && (l.rotation = 15 * t), e && (l.filter = `blur(${10 * t}px)`), u && (l.opacity = Math.max(0, 1 - 0.5 * t)), s.to(i.current, {
57
+ ...l,
58
+ ease: "none",
59
+ scrollTrigger: {
60
+ trigger: i.current,
61
+ start: a,
62
+ end: p,
63
+ scrub: g
64
+ // markers: true, // Enable for debugging
65
+ }
66
+ });
67
+ } catch {
68
+ console.warn("⚠️ Telecop: Please install GSAP to use ParallaxScroll"), console.warn("Run: npm install gsap");
69
+ }
70
+ })(), () => {
71
+ (async () => {
72
+ try {
73
+ const { ScrollTrigger: f } = await import("gsap/ScrollTrigger");
74
+ f.getAll().forEach((n) => n.kill());
75
+ } catch {
76
+ }
77
+ })();
78
+ }), [t, o, r, c, e, u, a, p, g]), /* @__PURE__ */ w("div", { ref: i, className: y, children: m });
28
79
  }
29
80
  export {
30
- u as FadeIn
81
+ v as FadeIn,
82
+ A as ParallaxScroll
31
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "telecop",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "Modern React UI Components Library with optional GSAP animations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",