@xiping/react-components 0.0.70 → 0.0.72

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.
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),x=require("../../utils/utils.js"),f=require("motion/react"),r=require("react"),q=Object.freeze("ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")),y=t=>Math.floor(Math.random()*t);function d({children:t,className:I,duration:m=800,delay:i=0,as:M="div",startOnView:p=!1,animateOnHover:A=!0,characterSet:u=q,...R}){const b=f.motion.create(M,{forwardMotionProps:!0}),[E,h]=r.useState(()=>t.split("")),[c,o]=r.useState(!1),s=r.useRef(0),a=r.useRef(null),j=()=>{A&&!c&&(s.current=0,o(!0))};return r.useEffect(()=>{if(!p){const n=setTimeout(()=>{o(!0)},i);return()=>clearTimeout(n)}const e=new IntersectionObserver(([n])=>{n.isIntersecting&&(setTimeout(()=>{o(!0)},i),e.disconnect())},{threshold:.1,rootMargin:"-30% 0px -30% 0px"});return a.current&&e.observe(a.current),()=>e.disconnect()},[i,p]),r.useEffect(()=>{if(!c)return;const e=m/(t.length*10),n=t.length,T=setInterval(()=>{s.current<n?(h(C=>C.map((g,v)=>g===" "?g:v<=s.current?t[v]:u[y(u.length)])),s.current=s.current+.1):(o(!1),clearInterval(T))},e);return()=>clearInterval(T)},[t,m,c,u]),l.jsx(b,{ref:a,className:x.cn("overflow-hidden py-2 text-4xl font-bold",I),onMouseEnter:j,...R,children:l.jsx(f.AnimatePresence,{children:E.map((e,n)=>l.jsx(f.motion.span,{className:x.cn("font-mono",e===" "?"w-3":""),children:e.toUpperCase()},n))})})}exports.HyperText=d;exports.default=d;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),x=require("../../utils/utils.js"),f=require("motion/react"),r=require("react"),q=Object.freeze("ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("")),y=t=>Math.floor(Math.random()*t);function d({children:t,className:I,duration:m=800,delay:i=0,as:M="div",startOnView:p=!1,animateOnHover:R=!0,characterSet:u=q,...A}){const b=f.motion.create(M,{forwardMotionProps:!0}),[E,h]=r.useState(()=>t.split("")),[c,o]=r.useState(!1),s=r.useRef(0),a=r.useRef(null),j=()=>{R&&!c&&(s.current=0,o(!0))};return r.useEffect(()=>{if(!p){const n=setTimeout(()=>{o(!0)},i);return()=>clearTimeout(n)}const e=new IntersectionObserver(([n])=>{n.isIntersecting&&(setTimeout(()=>{o(!0)},i),e.disconnect())},{threshold:.1,rootMargin:"-30% 0px -30% 0px"});return a.current&&e.observe(a.current),()=>e.disconnect()},[i,p]),r.useEffect(()=>{if(!c)return;const e=m/(t.length*10),n=t.length,T=setInterval(()=>{s.current<n?(h(C=>C.map((g,v)=>g===" "?g:v<=s.current?t[v]:u[y(u.length)])),s.current=s.current+.1):(o(!1),clearInterval(T))},e);return()=>clearInterval(T)},[t,m,c,u]),l.jsx(b,{ref:a,className:x.cn("overflow-hidden py-2 text-4xl font-bold",I),onMouseEnter:j,...A,children:l.jsx(f.AnimatePresence,{children:E.map((e,n)=>l.jsx(f.motion.span,{className:x.cn("font-mono",e===" "?"w-3":""),children:e.toUpperCase()},n))})})}exports.HyperText=d;exports.default=d;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),x=require("clsx"),t=require("react"),j=(r,n)=>{let s;return function(...c){s||(r.apply(this,c),s=!0,setTimeout(()=>s=!1,n))}},R=r=>{const{originalImage:n,modifiedImage:s,className:c}=r,[d,b]=t.useState(50),[a,h]=t.useState(!1),[v,k]=t.useState(16/9),i=t.useRef(null),g=t.useCallback(e=>{if(!a||!i.current)return;const m=i.current.getBoundingClientRect(),M=(e-m.left)/m.width*100;b(Math.min(100,Math.max(0,M)))},[a]),l=t.useCallback(j(e=>g(e),16),[g]),p=t.useCallback(e=>{l(e.clientX)},[l]),w=t.useCallback(e=>{l(e.touches[0].clientX)},[l]),f=t.useCallback(()=>{h(!0)},[]),u=t.useCallback(()=>{h(!1)},[]);return t.useEffect(()=>{const e=new Image;e.onload=()=>{k(e.width/e.height)},e.src=n},[n]),o.jsxs("div",{ref:i,className:x("relative select-none overflow-hidden w-full",c),style:{backgroundRepeat:"no-repeat",backgroundPosition:"top left",backgroundImage:`url(${n})`,backgroundSize:"contain",aspectRatio:v},onMouseMove:a?p:void 0,onTouchMove:a?w:void 0,onMouseUp:u,onMouseLeave:u,onTouchEnd:u,children:[o.jsx("div",{className:"absolute inset-0 h-full overflow-hidden",style:{width:`${d}%`,backgroundImage:`url(${s})`,backgroundRepeat:"no-repeat",backgroundPosition:"top left",backgroundSize:"auto 100%"}}),o.jsx("div",{className:"absolute top-0 bottom-0 w-1 bg-white cursor-ew-resize",style:{left:`${d}%`,transform:"translateX(-50%)"},onMouseDown:f,onTouchStart:f,children:o.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-white shadow-lg flex items-center justify-center",children:o.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l4-4 4 4m0 6l-4 4-4-4"})})})})]})};exports.default=R;
@@ -0,0 +1,3 @@
1
+ import { default as ImageCompare } from './ImageCompare.tsx';
2
+ export { ImageCompare };
3
+ export default ImageCompare;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),h=require("@heroui/modal"),C=require("@heroui/spinner"),m=require("react-icons/io5"),k=require("../pinch-content/PinchContent.js"),S=require("@radix-ui/react-scroll-area"),p=require("react");function z(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return a.default=t,Object.freeze(a)}const i=z(S),O=t=>{const{isOpen:a,onClose:o,imgSrc:r,canDownload:g=!1}=t,c=Array.isArray(r)?r:[r],[d,x]=p.useState(0),[j,f]=p.useState(!0),u=()=>{f(!0),o()},w=async()=>{const s=c[d];try{const y=await(await fetch(s)).blob(),b=window.URL.createObjectURL(y),l=document.createElement("a");l.href=b,l.download=s.split("/").pop()||"image",document.body.appendChild(l),l.click(),window.URL.revokeObjectURL(b),document.body.removeChild(l)}catch(n){console.error("Error downloading image:",n)}},v=()=>{f(!1)},N=()=>{f(!1)};return e.jsx(h.Modal,{isOpen:a,size:"full",onClose:u,className:"bg-black bg-opacity-70",hideCloseButton:!0,portalContainer:document.body,children:e.jsx(h.ModalContent,{className:"overflow-hidden",children:e.jsxs("div",{className:"w-screen h-screen relative flex flex-col pt-safe-offset-0",children:[e.jsxs("div",{className:"absolute top-2 right-2 flex gap-4 z-10",children:[g&&e.jsx(m.IoDownloadOutline,{size:24,className:"text-white cursor-pointer",onClick:w}),e.jsx(m.IoCloseSharp,{size:24,className:"text-white cursor-pointer",onClick:u})]}),e.jsxs("div",{className:"flex-1 min-h-0 relative flex items-center justify-center",children:[e.jsx(k.default,{canRotate:!1,className:"w-full h-full",children:e.jsx("img",{draggable:"false",src:c[d],alt:"",className:"w-screen h-full object-contain pointer-events-none",onLoad:v,onError:N})}),j&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-50",children:e.jsx(C.Spinner,{color:"white",size:"lg"})})]}),c.length>1&&e.jsx("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:e.jsxs(i.Root,{className:"h-24 w-screen",type:"auto",children:[e.jsx(i.Viewport,{className:"pppp h-full w-full",children:e.jsx("div",{className:"flex gap-2 p-2 h-24",children:c.map((s,n)=>e.jsx("div",{className:`h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${n===d?"border-white":"border-transparent"}`,onClick:()=>x(n),children:e.jsx("img",{src:s,alt:"",className:"w-full h-full object-contain",draggable:"false"})},s))})}),e.jsx(i.Scrollbar,{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",orientation:"horizontal",children:e.jsx(i.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]"})})]})})]})})})};exports.default=O;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),h=require("@heroui/modal"),C=require("@heroui/spinner"),m=require("react-icons/io5"),k=require("../pinch-content/PinchContent.js"),S=require("@radix-ui/react-scroll-area"),p=require("react");function z(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>t[o]})}}return r.default=t,Object.freeze(r)}const i=z(S),O=t=>{const{isOpen:r,onClose:o,imgSrc:a,canDownload:g=!1}=t,c=Array.isArray(a)?a:[a],[d,x]=p.useState(0),[j,f]=p.useState(!0),u=()=>{f(!0),o()},w=async()=>{const s=c[d];try{const y=await(await fetch(s)).blob(),b=window.URL.createObjectURL(y),l=document.createElement("a");l.href=b,l.download=s.split("/").pop()||"image",document.body.appendChild(l),l.click(),window.URL.revokeObjectURL(b),document.body.removeChild(l)}catch(n){console.error("Error downloading image:",n)}},v=()=>{f(!1)},N=()=>{f(!1)};return e.jsx(h.Modal,{isOpen:r,size:"full",onClose:u,className:"bg-black bg-opacity-70",hideCloseButton:!0,portalContainer:document.body,children:e.jsx(h.ModalContent,{className:"overflow-hidden",children:e.jsxs("div",{className:"w-screen h-screen relative flex flex-col pt-safe-offset-0",children:[e.jsxs("div",{className:"absolute top-2 right-2 flex gap-4 z-10",children:[g&&e.jsx(m.IoDownloadOutline,{size:24,className:"text-white cursor-pointer",onClick:w}),e.jsx(m.IoCloseSharp,{size:24,className:"text-white cursor-pointer",onClick:u})]}),e.jsxs("div",{className:"flex-1 min-h-0 relative flex items-center justify-center",children:[e.jsx(k.default,{canRotate:!1,className:"w-full h-full",children:e.jsx("img",{draggable:"false",src:c[d],alt:"",className:"w-screen h-full object-contain pointer-events-none",onLoad:v,onError:N})}),j&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-50",children:e.jsx(C.Spinner,{color:"white",size:"lg"})})]}),c.length>1&&e.jsx("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:e.jsxs(i.Root,{className:"h-24 w-screen",type:"auto",children:[e.jsx(i.Viewport,{className:"pppp h-full w-full",children:e.jsx("div",{className:"flex gap-2 p-2 h-24",children:c.map((s,n)=>e.jsx("div",{className:`h-full aspect-square flex-shrink-0 cursor-pointer border-2 transition-all ${n===d?"border-white":"border-transparent"}`,onClick:()=>x(n),children:e.jsx("img",{src:s,alt:"",className:"w-full h-full object-contain",draggable:"false"})},s))})}),e.jsx(i.Scrollbar,{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",orientation:"horizontal",children:e.jsx(i.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]"})})]})})]})})})};exports.default=O;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("react/jsx-runtime"),v=require("@react-spring/web"),i=require("@use-gesture/react"),B=require("react"),x=require("ahooks"),C=require("clsx"),G=i.createUseGesture([i.dragAction,i.pinchAction,i.wheelAction]),u=l=>l.preventDefault(),N=l=>{const{className:m,children:y,canPinch:h=!0,canDrag:p=!0,canRotate:b=!0,scaleBounds:d={min:.3,max:10},wheelZoomFactor:S=.1}=l,n=B.useRef(null);x.useMount(()=>{var t,e,r;(t=n.current)==null||t.addEventListener("gesturestart",u),(e=n.current)==null||e.addEventListener("gesturechange",u),(r=n.current)==null||r.addEventListener("gestureend",u)}),x.useUnmount(()=>{var t,e,r;(t=n.current)==null||t.removeEventListener("gesturestart",u),(e=n.current)==null||e.removeEventListener("gesturechange",u),(r=n.current)==null||r.removeEventListener("gestureend",u)});const[s,g]=v.useSpring(()=>({x:0,y:0,scale:1,rotateZ:0}));return G({onWheel:({event:t,delta:[,e]})=>{if(!h)return;const c=s.scale.get()*(1-e*S),o=Math.min(Math.max(c,d.min),d.max);g.start({scale:o})},onDrag:({pinching:t,cancel:e,offset:[r,c],...o})=>{if(!p||t)return e();g.start({x:r,y:c})},onPinch:({origin:[t,e],first:r,movement:[c],offset:[o,q],memo:a,cancel:w})=>{if(!h)return w();if(r){const{width:M,height:P,x:R,y:Z}=n.current.getBoundingClientRect(),j=t-(R+M/2),A=e-(Z+P/2);a=[s.x.get(),s.y.get(),j,A]}const E=a[0]-(c-1)*a[2],L=a[1]-(c-1)*a[3],f={scale:o,rotateZ:0,x:E,y:L};return b&&(f.rotateZ=q),g.start(f),a}},{target:n,drag:{from:()=>[s.x.get(),s.y.get()]},pinch:{scaleBounds:d,rubberband:!0},wheel:{enabled:!0}}),D.jsx(v.animated.div,{className:C("select-none",m),ref:n,style:s,children:y})};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("react/jsx-runtime"),v=require("@react-spring/web"),i=require("@use-gesture/react"),B=require("react"),x=require("ahooks"),C=require("clsx"),G=i.createUseGesture([i.dragAction,i.pinchAction,i.wheelAction]),u=l=>l.preventDefault(),N=l=>{const{className:m,children:y,canPinch:h=!0,canDrag:p=!0,canRotate:b=!0,scaleBounds:d={min:.3,max:10},wheelZoomFactor:S=.1}=l,n=B.useRef(null);x.useMount(()=>{var t,e,r;(t=n.current)==null||t.addEventListener("gesturestart",u),(e=n.current)==null||e.addEventListener("gesturechange",u),(r=n.current)==null||r.addEventListener("gestureend",u)}),x.useUnmount(()=>{var t,e,r;(t=n.current)==null||t.removeEventListener("gesturestart",u),(e=n.current)==null||e.removeEventListener("gesturechange",u),(r=n.current)==null||r.removeEventListener("gestureend",u)});const[s,g]=v.useSpring(()=>({x:0,y:0,scale:1,rotateZ:0}));return G({onWheel:({event:t,delta:[,e]})=>{if(!h)return;const c=s.scale.get()*(1-e*S),o=Math.min(Math.max(c,d.min),d.max);g.start({scale:o})},onDrag:({pinching:t,cancel:e,offset:[r,c],...o})=>{if(!p||t)return e();g.start({x:r,y:c})},onPinch:({origin:[t,e],first:r,movement:[c],offset:[o,q],memo:a,cancel:w})=>{if(!h)return w();if(r){const{width:M,height:R,x:P,y:Z}=n.current.getBoundingClientRect(),j=t-(P+M/2),A=e-(Z+R/2);a=[s.x.get(),s.y.get(),j,A]}const E=a[0]-(c-1)*a[2],L=a[1]-(c-1)*a[3],f={scale:o,rotateZ:0,x:E,y:L};return b&&(f.rotateZ=q),g.start(f),a}},{target:n,drag:{from:()=>[s.x.get(),s.y.get()]},pinch:{scaleBounds:d,rubberband:!0},wheel:{enabled:!0}}),D.jsx(v.animated.div,{className:C("select-none",m),ref:n,style:s,children:y})};exports.default=N;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("react"),r=require("../../utils/utils.js"),a=c.forwardRef(({shimmerColor:t="#ffffff",shimmerSize:s="0.05em",shimmerDuration:i="3s",borderRadius:n="100px",background:o="rgba(0, 0, 0, 1)",className:u,children:d,...l},f)=>e.jsxs("button",{style:{"--spread":"90deg","--shimmer-color":t,"--radius":n,"--speed":i,"--cut":s,"--bg":o},className:r.cn("group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden whitespace-nowrap border border-white/10 px-6 py-3 text-white [background:var(--bg)] [border-radius:var(--radius)] dark:text-black","transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px",u),ref:f,...l,children:[e.jsx("div",{className:r.cn("-z-30 blur-[2px]","absolute inset-0 overflow-visible [container-type:size]"),children:e.jsx("div",{className:"absolute inset-0 h-[100cqh] animate-shimmer-slide [aspect-ratio:1] [border-radius:0] [mask:none]",children:e.jsx("div",{className:"absolute -inset-full w-auto rotate-0 animate-spin-around [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]"})})}),d,e.jsx("div",{className:r.cn("insert-0 absolute size-full","rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]","transform-gpu transition-all duration-300 ease-in-out","group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]","group-active:shadow-[inset_0_-10px_10px_#ffffff3f]")}),e.jsx("div",{className:r.cn("absolute -z-20 [background:var(--bg)] [border-radius:var(--radius)] [inset:var(--cut)]")})]}));a.displayName="ShimmerButton";exports.ShimmerButton=a;exports.default=a;
@@ -0,0 +1,3 @@
1
+ import { default as ShimmerButton } from './ShimmerButton.tsx';
2
+ export { ShimmerButton };
3
+ export default ShimmerButton;
@@ -0,0 +1,2 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("../../utils/utils.js"),s=require("motion/react"),c={text:.06,word:.05,character:.03,line:.06},i={hidden:{opacity:1},show:{opacity:1,transition:{staggerChildren:.05}},exit:{opacity:0,transition:{staggerChildren:.05,staggerDirection:-1}}},g={hidden:{opacity:0},show:{opacity:1},exit:{opacity:0}},o={fadeIn:{container:i,item:{hidden:{opacity:0,y:20},show:t=>({opacity:1,y:0,transition:{delay:t,duration:.3}}),exit:{opacity:0,y:20,transition:{duration:.3}}}},blurIn:{container:i,item:{hidden:{opacity:0,filter:"blur(10px)"},show:t=>({opacity:1,filter:"blur(0px)",transition:{delay:t*.1,duration:.3}}),exit:{opacity:0,filter:"blur(10px)",transition:{duration:.3}}}},blurInUp:{container:i,item:{hidden:{opacity:0,filter:"blur(10px)",y:20},show:t=>({opacity:1,filter:"blur(0px)",y:0,transition:{y:{duration:.3},opacity:{duration:.4},filter:{duration:.3}}}),exit:{opacity:0,filter:"blur(10px)",y:20,transition:{y:{duration:.3},opacity:{duration:.4},filter:{duration:.3}}}}},blurInDown:{container:i,item:{hidden:{opacity:0,filter:"blur(10px)",y:-20},show:t=>({opacity:1,filter:"blur(0px)",y:0,transition:{y:{duration:.3},opacity:{duration:.4},filter:{duration:.3}}})}},slideUp:{container:i,item:{hidden:{y:20,opacity:0},show:t=>({y:0,opacity:1,transition:{delay:t,duration:.3}}),exit:{y:-20,opacity:0,transition:{duration:.3}}}},slideDown:{container:i,item:{hidden:{y:-20,opacity:0},show:{y:0,opacity:1,transition:{duration:.3}},exit:{y:20,opacity:0,transition:{duration:.3}}}},slideLeft:{container:i,item:{hidden:{x:20,opacity:0},show:{x:0,opacity:1,transition:{duration:.3}},exit:{x:-20,opacity:0,transition:{duration:.3}}}},slideRight:{container:i,item:{hidden:{x:-20,opacity:0},show:{x:0,opacity:1,transition:{duration:.3}},exit:{x:20,opacity:0,transition:{duration:.3}}}},scaleUp:{container:i,item:{hidden:{scale:.5,opacity:0},show:{scale:1,opacity:1,transition:{duration:.3,scale:{type:"spring",damping:15,stiffness:300}}},exit:{scale:.5,opacity:0,transition:{duration:.3}}}},scaleDown:{container:i,item:{hidden:{scale:1.5,opacity:0},show:t=>({scale:1,opacity:1,transition:{delay:t,duration:.3,scale:{type:"spring",damping:15,stiffness:300}}}),exit:{scale:1.5,opacity:0,transition:{duration:.3}}}}};function b({children:t,delay:I=0,duration:k=.3,variants:v,className:h,segmentClassName:x,as:m="p",startOnView:d=!0,once:C=!1,by:n="word",animation:a="fadeIn",...w}){const f=s.motion.create(m),p=a?{container:{...o[a].container,show:{...o[a].container.show,transition:{staggerChildren:c[n]}},exit:{...o[a].container.exit,transition:{staggerChildren:c[n],staggerDirection:-1}}},item:o[a].item}:{container:i,item:g};let e=[];switch(n){case"word":e=t.split(/(\s+)/);break;case"character":e=t.split("");break;case"line":e=t.split(`
2
+ `);break;case"text":default:e=[t];break}return r.jsx(s.AnimatePresence,{mode:"popLayout",children:r.jsx(f,{variants:p.container,initial:"hidden",whileInView:d?"show":void 0,animate:d?void 0:"show",exit:"exit",className:u.cn("whitespace-pre-wrap",h),...w,children:e.map((l,y)=>r.jsx(s.motion.span,{variants:p.item,custom:y*c[n],className:u.cn(n==="line"?"block":"inline-block whitespace-pre",x),children:l},`${n}-${l}-${y}`))})})}exports.TextAnimate=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),r=require("clsx"),t=require("motion/react"),j=require("./index.module.css.js"),w=16,E=1.5,F="normal",a=({content:u,lineHeight:d=E,fontSize:f=w,fontWeight:x=F,className:m="",style:p={},onProgressChange:l,initialScrollPosition:R,cacheKey:g,showTopProgress:T=!0,topProgressClassName:b,showBottomProgress:_=!0,bottomProgressClassName:h})=>{const s=n.useRef(null),i=n.useRef(null),{scrollYProgress:o}=t.useScroll({container:s,target:i}),c=t.useTransform(()=>(o.get()*100).toFixed(2).replace(/\.0*$/,"")),v=t.useMotionTemplate`${c}%`;return c.on("change",N=>{l==null||l(Number(N))}),e.jsxs(e.Fragment,{children:[T&&e.jsx(t.motion.div,{id:"scroll-indicator",className:r("fixed left-0 top-0 right-0 bg-[#ff0088] h-2.5",b),style:{scaleX:o,originX:0}}),e.jsx("div",{className:r("relative w-full h-full overflow-y-auto",j.default.textContent),ref:s,children:e.jsx("div",{ref:i,className:r("w-full whitespace-pre-wrap break-words",m),style:{fontSize:`${f}px`,lineHeight:d,fontWeight:x,...p},children:u})}),_&&e.jsx(t.motion.div,{id:"scroll-present",className:r("fixed text-white rounded text-sm bg-black bg-opacity-70 pl-2 pr-2 pb-1 pt-1 right-5 bottom-5",h),children:v})]})};exports.TxtReader=a;exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),r=require("clsx"),t=require("motion/react"),R=require("./index.module.css.js"),j=16,w=1.5,E="normal",a=({content:u,lineHeight:d=w,fontSize:f=j,fontWeight:x=E,className:m="",style:p={},onProgressChange:l,initialScrollPosition:F,cacheKey:g,showTopProgress:T=!0,topProgressClassName:b,showBottomProgress:_=!0,bottomProgressClassName:h})=>{const s=n.useRef(null),i=n.useRef(null),{scrollYProgress:o}=t.useScroll({container:s,target:i}),c=t.useTransform(()=>(o.get()*100).toFixed(2).replace(/\.0*$/,"")),v=t.useMotionTemplate`${c}%`;return c.on("change",N=>{l==null||l(Number(N))}),e.jsxs(e.Fragment,{children:[T&&e.jsx(t.motion.div,{id:"scroll-indicator",className:r("fixed left-0 top-0 right-0 bg-[#ff0088] h-2.5",b),style:{scaleX:o,originX:0}}),e.jsx("div",{className:r("relative w-full h-full overflow-y-auto",R.default.textContent),ref:s,children:e.jsx("div",{ref:i,className:r("w-full whitespace-pre-wrap break-words",m),style:{fontSize:`${f}px`,lineHeight:d,fontWeight:x,...p},children:u})}),_&&e.jsx(t.motion.div,{id:"scroll-present",className:r("fixed text-white rounded text-sm bg-black bg-opacity-70 pl-2 pr-2 pb-1 pt-1 right-5 bottom-5",h),children:v})]})};exports.TxtReader=a;exports.default=a;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react/jsx-runtime"),b=require("../../utils/utils.js"),x=require("motion/react"),r=require("react");function l({children:n,className:f,duration:o=100,delay:s=0,as:m="div",startOnView:u=!1,...d}){const g=x.motion.create(m,{forwardMotionProps:!0}),[v,T]=r.useState(""),[c,a]=r.useState(!1),i=r.useRef(null);return r.useEffect(()=>{if(!u){const t=setTimeout(()=>{a(!0)},s);return()=>clearTimeout(t)}const e=new IntersectionObserver(([t])=>{t.isIntersecting&&(setTimeout(()=>{a(!0)},s),e.disconnect())},{threshold:.1});return i.current&&e.observe(i.current),()=>e.disconnect()},[s,u]),r.useEffect(()=>{if(!c)return;let e=0;const t=setInterval(()=>{e<n.length?(T(n.substring(0,e+1)),e++):clearInterval(t)},o);return()=>{clearInterval(t)}},[n,o,c]),p.jsx(g,{ref:i,className:b.cn("text-4xl font-bold leading-[5rem] tracking-[-0.02em]",f),...d,children:v})}exports.TypingAnimation=l;exports.default=l;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react/jsx-runtime"),b=require("../../utils/utils.js"),x=require("motion/react"),n=require("react");function l({children:r,className:f,duration:o=100,delay:s=0,as:m="div",startOnView:u=!1,...d}){const g=x.motion.create(m,{forwardMotionProps:!0}),[v,T]=n.useState(""),[c,a]=n.useState(!1),i=n.useRef(null);return n.useEffect(()=>{if(!u){const t=setTimeout(()=>{a(!0)},s);return()=>clearTimeout(t)}const e=new IntersectionObserver(([t])=>{t.isIntersecting&&(setTimeout(()=>{a(!0)},s),e.disconnect())},{threshold:.1});return i.current&&e.observe(i.current),()=>e.disconnect()},[s,u]),n.useEffect(()=>{if(!c)return;let e=0;const t=setInterval(()=>{e<r.length?(T(r.substring(0,e+1)),e++):clearInterval(t)},o);return()=>{clearInterval(t)}},[r,o,c]),p.jsx(g,{ref:i,className:b.cn("text-4xl font-bold leading-[5rem] tracking-[-0.02em]",f),...d,children:v})}exports.TypingAnimation=l;exports.default=l;
@@ -4,3 +4,6 @@ export * from './components/pinch-content';
4
4
  export * from './components/image-viewer';
5
5
  export * from './components/hyper-text';
6
6
  export * from './components/typing-animation';
7
+ export * from './components/text-animate';
8
+ export * from './components/shimmer-button';
9
+ export * from './components/image-compare';
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const e=require("./components/button/Button.js"),t=require("./components/txt-reader/TxtReader.js"),n=require("./components/hyper-text/index.js"),r=require("./components/typing-animation/index.js"),i=require("./components/pinch-content/PinchContent.js"),o=require("./components/image-viewer/ImageViewer.js");exports.Button=e.Button;exports.TxtReader=t.TxtReader;exports.HyperText=n.HyperText;exports.TypingAnimation=r.TypingAnimation;exports.PinchContent=i.default;exports.ImageViewer=o.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const e=require("./components/button/Button.js"),t=require("./components/txt-reader/TxtReader.js"),r=require("./components/hyper-text/index.js"),n=require("./components/typing-animation/index.js"),i=require("./components/pinch-content/PinchContent.js"),o=require("./components/image-viewer/ImageViewer.js"),u=require("./components/shimmer-button/ShimmerButton.js"),a=require("./components/image-compare/ImageCompare.js"),m=require("./components/text-animate/TextAnimate.js");exports.Button=e.Button;exports.TxtReader=t.TxtReader;exports.HyperText=r.HyperText;exports.TypingAnimation=n.TypingAnimation;exports.PinchContent=i.default;exports.ImageViewer=o.default;exports.ShimmerButton=u.ShimmerButton;exports.ImageCompare=a.default;exports.TextAnimate=m.TextAnimate;
@@ -0,0 +1,101 @@
1
+ import { jsxs as R, jsx as s } from "react/jsx-runtime";
2
+ import y from "clsx";
3
+ import { useState as d, useRef as I, useCallback as t, useEffect as N } from "react";
4
+ const T = (i, o) => {
5
+ let n;
6
+ return function(...l) {
7
+ n || (i.apply(this, l), n = !0, setTimeout(() => n = !1, o));
8
+ };
9
+ }, P = (i) => {
10
+ const { originalImage: o, modifiedImage: n, className: l } = i, [h, v] = d(50), [a, g] = d(!1), [w, b] = d(16 / 9), c = I(null), f = t(
11
+ (e) => {
12
+ if (!a || !c.current) return;
13
+ const p = c.current.getBoundingClientRect(), x = (e - p.left) / p.width * 100;
14
+ v(Math.min(100, Math.max(0, x)));
15
+ },
16
+ [a]
17
+ ), r = t(
18
+ T((e) => f(e), 16),
19
+ [f]
20
+ ), M = t((e) => {
21
+ r(e.clientX);
22
+ }, [r]), k = t((e) => {
23
+ r(e.touches[0].clientX);
24
+ }, [r]), m = t(() => {
25
+ g(!0);
26
+ }, []), u = t(() => {
27
+ g(!1);
28
+ }, []);
29
+ return N(() => {
30
+ const e = new Image();
31
+ e.onload = () => {
32
+ b(e.width / e.height);
33
+ }, e.src = o;
34
+ }, [o]), /* @__PURE__ */ R(
35
+ "div",
36
+ {
37
+ ref: c,
38
+ className: y("relative select-none overflow-hidden w-full", l),
39
+ style: {
40
+ backgroundRepeat: "no-repeat",
41
+ backgroundPosition: "top left",
42
+ backgroundImage: `url(${o})`,
43
+ backgroundSize: "contain",
44
+ aspectRatio: w
45
+ },
46
+ onMouseMove: a ? M : void 0,
47
+ onTouchMove: a ? k : void 0,
48
+ onMouseUp: u,
49
+ onMouseLeave: u,
50
+ onTouchEnd: u,
51
+ children: [
52
+ /* @__PURE__ */ s(
53
+ "div",
54
+ {
55
+ className: "absolute inset-0 h-full overflow-hidden",
56
+ style: {
57
+ width: `${h}%`,
58
+ backgroundImage: `url(${n})`,
59
+ backgroundRepeat: "no-repeat",
60
+ backgroundPosition: "top left",
61
+ backgroundSize: "auto 100%"
62
+ }
63
+ }
64
+ ),
65
+ /* @__PURE__ */ s(
66
+ "div",
67
+ {
68
+ className: "absolute top-0 bottom-0 w-1 bg-white cursor-ew-resize",
69
+ style: {
70
+ left: `${h}%`,
71
+ transform: "translateX(-50%)"
72
+ },
73
+ onMouseDown: m,
74
+ onTouchStart: m,
75
+ children: /* @__PURE__ */ s("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-white shadow-lg flex items-center justify-center", children: /* @__PURE__ */ s(
76
+ "svg",
77
+ {
78
+ className: "w-6 h-6 text-gray-600",
79
+ fill: "none",
80
+ stroke: "currentColor",
81
+ viewBox: "0 0 24 24",
82
+ children: /* @__PURE__ */ s(
83
+ "path",
84
+ {
85
+ strokeLinecap: "round",
86
+ strokeLinejoin: "round",
87
+ strokeWidth: 2,
88
+ d: "M8 9l4-4 4 4m0 6l-4 4-4-4"
89
+ }
90
+ )
91
+ }
92
+ ) })
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ );
98
+ };
99
+ export {
100
+ P as default
101
+ };
@@ -0,0 +1,3 @@
1
+ import { default as ImageCompare } from './ImageCompare.tsx';
2
+ export { ImageCompare };
3
+ export default ImageCompare;
@@ -0,0 +1,75 @@
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import p from "react";
3
+ import { cn as e } from "../../utils/utils.js";
4
+ const m = p.forwardRef(
5
+ ({
6
+ shimmerColor: a = "#ffffff",
7
+ shimmerSize: t = "0.05em",
8
+ shimmerDuration: s = "3s",
9
+ borderRadius: i = "100px",
10
+ background: o = "rgba(0, 0, 0, 1)",
11
+ className: n,
12
+ children: d,
13
+ ...f
14
+ }, u) => /* @__PURE__ */ l(
15
+ "button",
16
+ {
17
+ style: {
18
+ "--spread": "90deg",
19
+ "--shimmer-color": a,
20
+ "--radius": i,
21
+ "--speed": s,
22
+ "--cut": t,
23
+ "--bg": o
24
+ },
25
+ className: e(
26
+ "group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden whitespace-nowrap border border-white/10 px-6 py-3 text-white [background:var(--bg)] [border-radius:var(--radius)] dark:text-black",
27
+ "transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px",
28
+ n
29
+ ),
30
+ ref: u,
31
+ ...f,
32
+ children: [
33
+ /* @__PURE__ */ r(
34
+ "div",
35
+ {
36
+ className: e(
37
+ "-z-30 blur-[2px]",
38
+ "absolute inset-0 overflow-visible [container-type:size]"
39
+ ),
40
+ children: /* @__PURE__ */ r("div", { className: "absolute inset-0 h-[100cqh] animate-shimmer-slide [aspect-ratio:1] [border-radius:0] [mask:none]", children: /* @__PURE__ */ r("div", { className: "absolute -inset-full w-auto rotate-0 animate-spin-around [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))] [translate:0_0]" }) })
41
+ }
42
+ ),
43
+ d,
44
+ /* @__PURE__ */ r(
45
+ "div",
46
+ {
47
+ className: e(
48
+ "insert-0 absolute size-full",
49
+ "rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#ffffff1f]",
50
+ // transition
51
+ "transform-gpu transition-all duration-300 ease-in-out",
52
+ // on hover
53
+ "group-hover:shadow-[inset_0_-6px_10px_#ffffff3f]",
54
+ // on click
55
+ "group-active:shadow-[inset_0_-10px_10px_#ffffff3f]"
56
+ )
57
+ }
58
+ ),
59
+ /* @__PURE__ */ r(
60
+ "div",
61
+ {
62
+ className: e(
63
+ "absolute -z-20 [background:var(--bg)] [border-radius:var(--radius)] [inset:var(--cut)]"
64
+ )
65
+ }
66
+ )
67
+ ]
68
+ }
69
+ )
70
+ );
71
+ m.displayName = "ShimmerButton";
72
+ export {
73
+ m as ShimmerButton,
74
+ m as default
75
+ };
@@ -0,0 +1,3 @@
1
+ import { default as ShimmerButton } from './ShimmerButton.tsx';
2
+ export { ShimmerButton };
3
+ export default ShimmerButton;
@@ -0,0 +1,309 @@
1
+ "use client";
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { cn as y } from "../../utils/utils.js";
4
+ import { motion as u, AnimatePresence as g } from "motion/react";
5
+ const s = {
6
+ text: 0.06,
7
+ word: 0.05,
8
+ character: 0.03,
9
+ line: 0.06
10
+ }, t = {
11
+ hidden: { opacity: 1 },
12
+ show: {
13
+ opacity: 1,
14
+ transition: {
15
+ staggerChildren: 0.05
16
+ }
17
+ },
18
+ exit: {
19
+ opacity: 0,
20
+ transition: {
21
+ staggerChildren: 0.05,
22
+ staggerDirection: -1
23
+ }
24
+ }
25
+ }, b = {
26
+ hidden: { opacity: 0 },
27
+ show: {
28
+ opacity: 1
29
+ },
30
+ exit: {
31
+ opacity: 0
32
+ }
33
+ }, o = {
34
+ fadeIn: {
35
+ container: t,
36
+ item: {
37
+ hidden: { opacity: 0, y: 20 },
38
+ show: (i) => ({
39
+ opacity: 1,
40
+ y: 0,
41
+ transition: {
42
+ delay: i,
43
+ duration: 0.3
44
+ }
45
+ }),
46
+ exit: {
47
+ opacity: 0,
48
+ y: 20,
49
+ transition: { duration: 0.3 }
50
+ }
51
+ }
52
+ },
53
+ blurIn: {
54
+ container: t,
55
+ item: {
56
+ hidden: { opacity: 0, filter: "blur(10px)" },
57
+ show: (i) => ({
58
+ opacity: 1,
59
+ filter: "blur(0px)",
60
+ transition: {
61
+ delay: i * 0.1,
62
+ duration: 0.3
63
+ }
64
+ }),
65
+ exit: {
66
+ opacity: 0,
67
+ filter: "blur(10px)",
68
+ transition: { duration: 0.3 }
69
+ }
70
+ }
71
+ },
72
+ blurInUp: {
73
+ container: t,
74
+ item: {
75
+ hidden: { opacity: 0, filter: "blur(10px)", y: 20 },
76
+ show: (i) => ({
77
+ opacity: 1,
78
+ filter: "blur(0px)",
79
+ y: 0,
80
+ transition: {
81
+ y: { duration: 0.3 },
82
+ opacity: { duration: 0.4 },
83
+ filter: { duration: 0.3 }
84
+ }
85
+ }),
86
+ exit: {
87
+ opacity: 0,
88
+ filter: "blur(10px)",
89
+ y: 20,
90
+ transition: {
91
+ y: { duration: 0.3 },
92
+ opacity: { duration: 0.4 },
93
+ filter: { duration: 0.3 }
94
+ }
95
+ }
96
+ }
97
+ },
98
+ blurInDown: {
99
+ container: t,
100
+ item: {
101
+ hidden: { opacity: 0, filter: "blur(10px)", y: -20 },
102
+ show: (i) => ({
103
+ opacity: 1,
104
+ filter: "blur(0px)",
105
+ y: 0,
106
+ transition: {
107
+ y: { duration: 0.3 },
108
+ opacity: { duration: 0.4 },
109
+ filter: { duration: 0.3 }
110
+ }
111
+ })
112
+ }
113
+ },
114
+ slideUp: {
115
+ container: t,
116
+ item: {
117
+ hidden: { y: 20, opacity: 0 },
118
+ show: (i) => ({
119
+ y: 0,
120
+ opacity: 1,
121
+ transition: {
122
+ delay: i,
123
+ duration: 0.3
124
+ }
125
+ }),
126
+ exit: {
127
+ y: -20,
128
+ opacity: 0,
129
+ transition: {
130
+ duration: 0.3
131
+ }
132
+ }
133
+ }
134
+ },
135
+ slideDown: {
136
+ container: t,
137
+ item: {
138
+ hidden: { y: -20, opacity: 0 },
139
+ show: {
140
+ y: 0,
141
+ opacity: 1,
142
+ transition: { duration: 0.3 }
143
+ },
144
+ exit: {
145
+ y: 20,
146
+ opacity: 0,
147
+ transition: { duration: 0.3 }
148
+ }
149
+ }
150
+ },
151
+ slideLeft: {
152
+ container: t,
153
+ item: {
154
+ hidden: { x: 20, opacity: 0 },
155
+ show: {
156
+ x: 0,
157
+ opacity: 1,
158
+ transition: { duration: 0.3 }
159
+ },
160
+ exit: {
161
+ x: -20,
162
+ opacity: 0,
163
+ transition: { duration: 0.3 }
164
+ }
165
+ }
166
+ },
167
+ slideRight: {
168
+ container: t,
169
+ item: {
170
+ hidden: { x: -20, opacity: 0 },
171
+ show: {
172
+ x: 0,
173
+ opacity: 1,
174
+ transition: { duration: 0.3 }
175
+ },
176
+ exit: {
177
+ x: 20,
178
+ opacity: 0,
179
+ transition: { duration: 0.3 }
180
+ }
181
+ }
182
+ },
183
+ scaleUp: {
184
+ container: t,
185
+ item: {
186
+ hidden: { scale: 0.5, opacity: 0 },
187
+ show: {
188
+ scale: 1,
189
+ opacity: 1,
190
+ transition: {
191
+ duration: 0.3,
192
+ scale: {
193
+ type: "spring",
194
+ damping: 15,
195
+ stiffness: 300
196
+ }
197
+ }
198
+ },
199
+ exit: {
200
+ scale: 0.5,
201
+ opacity: 0,
202
+ transition: { duration: 0.3 }
203
+ }
204
+ }
205
+ },
206
+ scaleDown: {
207
+ container: t,
208
+ item: {
209
+ hidden: { scale: 1.5, opacity: 0 },
210
+ show: (i) => ({
211
+ scale: 1,
212
+ opacity: 1,
213
+ transition: {
214
+ delay: i,
215
+ duration: 0.3,
216
+ scale: {
217
+ type: "spring",
218
+ damping: 15,
219
+ stiffness: 300
220
+ }
221
+ }
222
+ }),
223
+ exit: {
224
+ scale: 1.5,
225
+ opacity: 0,
226
+ transition: { duration: 0.3 }
227
+ }
228
+ }
229
+ }
230
+ };
231
+ function U({
232
+ children: i,
233
+ delay: I = 0,
234
+ duration: k = 0.3,
235
+ variants: C,
236
+ className: h,
237
+ segmentClassName: x,
238
+ as: m = "p",
239
+ startOnView: c = !0,
240
+ once: v = !1,
241
+ by: a = "word",
242
+ animation: n = "fadeIn",
243
+ ...f
244
+ }) {
245
+ const w = u.create(m), d = n ? {
246
+ container: {
247
+ ...o[n].container,
248
+ show: {
249
+ ...o[n].container.show,
250
+ transition: {
251
+ staggerChildren: s[a]
252
+ }
253
+ },
254
+ exit: {
255
+ ...o[n].container.exit,
256
+ transition: {
257
+ staggerChildren: s[a],
258
+ staggerDirection: -1
259
+ }
260
+ }
261
+ },
262
+ item: o[n].item
263
+ } : { container: t, item: b };
264
+ let e = [];
265
+ switch (a) {
266
+ case "word":
267
+ e = i.split(/(\s+)/);
268
+ break;
269
+ case "character":
270
+ e = i.split("");
271
+ break;
272
+ case "line":
273
+ e = i.split(`
274
+ `);
275
+ break;
276
+ case "text":
277
+ default:
278
+ e = [i];
279
+ break;
280
+ }
281
+ return /* @__PURE__ */ r(g, { mode: "popLayout", children: /* @__PURE__ */ r(
282
+ w,
283
+ {
284
+ variants: d.container,
285
+ initial: "hidden",
286
+ whileInView: c ? "show" : void 0,
287
+ animate: c ? void 0 : "show",
288
+ exit: "exit",
289
+ className: y("whitespace-pre-wrap", h),
290
+ ...f,
291
+ children: e.map((p, l) => /* @__PURE__ */ r(
292
+ u.span,
293
+ {
294
+ variants: d.item,
295
+ custom: l * s[a],
296
+ className: y(
297
+ a === "line" ? "block" : "inline-block whitespace-pre",
298
+ x
299
+ ),
300
+ children: p
301
+ },
302
+ `${a}-${p}-${l}`
303
+ ))
304
+ }
305
+ ) });
306
+ }
307
+ export {
308
+ U as TextAnimate
309
+ };
@@ -4,3 +4,6 @@ export * from './components/pinch-content';
4
4
  export * from './components/image-viewer';
5
5
  export * from './components/hyper-text';
6
6
  export * from './components/typing-animation';
7
+ export * from './components/text-animate';
8
+ export * from './components/shimmer-button';
9
+ export * from './components/image-compare';
package/dist/es/index.js CHANGED
@@ -1,15 +1,21 @@
1
1
  /* empty css */
2
2
  import { Button as t } from "./components/button/Button.js";
3
3
  import { TxtReader as p } from "./components/txt-reader/TxtReader.js";
4
- import { HyperText as x } from "./components/hyper-text/index.js";
4
+ import { HyperText as f } from "./components/hyper-text/index.js";
5
5
  import { TypingAnimation as n } from "./components/typing-animation/index.js";
6
- import { default as d } from "./components/pinch-content/PinchContent.js";
6
+ import { default as u } from "./components/pinch-content/PinchContent.js";
7
7
  import { default as T } from "./components/image-viewer/ImageViewer.js";
8
+ import { ShimmerButton as l } from "./components/shimmer-button/ShimmerButton.js";
9
+ import { default as h } from "./components/image-compare/ImageCompare.js";
10
+ import { TextAnimate as A } from "./components/text-animate/TextAnimate.js";
8
11
  export {
9
12
  t as Button,
10
- x as HyperText,
13
+ f as HyperText,
14
+ h as ImageCompare,
11
15
  T as ImageViewer,
12
- d as PinchContent,
16
+ u as PinchContent,
17
+ l as ShimmerButton,
18
+ A as TextAnimate,
13
19
  p as TxtReader,
14
20
  n as TypingAnimation
15
21
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xiping/react-components",
3
3
  "private": false,
4
- "version": "0.0.70",
4
+ "version": "0.0.72",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
7
7
  "module": "./dist/es/index.js",
@@ -100,5 +100,5 @@
100
100
  "engines": {
101
101
  "node": ">=18"
102
102
  },
103
- "gitHead": "336071be7e8e3761428541b22cf841d43c8dce2c"
103
+ "gitHead": "675ebe9e6615200de89b4a353c51e36e81d926cf"
104
104
  }