UNPKG

xtreme-ui

Version:

Collection of reusable components that can be used in web projects

2 lines (1 loc) 752 B
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),m=require("@lottiefiles/dotlottie-react"),x=require("clsx");;/* empty css */const y=require("./types.cjs"),r=s.forwardRef((a,c)=>{const{className:l,src:u,size:t="default",autoPlay:n=!0,loop:p=!0,speed:d=1}=a,[e,f]=s.useState(null),o=`${typeof t=="number"?t:y.ELottieSize[t]}px`,L=x("xtrLottieWrapper",l);return s.useEffect(()=>{o&&(e==null||e.resize())},[e,o]),i.jsx("div",{ref:c,className:L,style:{"--lottieSize":o},children:i.jsx(m.DotLottieReact,{className:"xtrLottie",dotLottieRefCallback:f,src:u,autoplay:n,loop:p,speed:d,marker:"lottie"})})});r.displayName="Lottie";exports.Lottie=r;