{"version":3,"file":"ProgressBar.j6NWf7MS.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/aUTp1ozm5yhd9Xqiwyva/18xTZogmj0OlFPU2nNDU/ProgressBar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{Frame,addPropertyControls,ControlType}from\"framer\";export default function ProgressBar({barWidth,trackName,color}){const barRef=useRef(null);useEffect(()=>{const container=document.querySelector(`[data-framer-name=\"${trackName}\"]`);if(!container||!barRef.current)return;const scrollableWidth=container.scrollWidth-container.clientWidth;const update=()=>{const scrollLeft=container.scrollLeft;const ratio=Math.min(scrollLeft/scrollableWidth,1);barRef.current.style.width=`${ratio*barWidth}px`;};container.addEventListener(\"scroll\",update);update();return()=>container.removeEventListener(\"scroll\",update);},[barWidth,trackName]);return /*#__PURE__*/_jsx(Frame,{background:\"none\",width:\"100%\",height:\"100%\",style:{overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{ref:barRef,style:{height:\"100%\",backgroundColor:color,width:0,borderRadius:999,transition:\"width 0.1s linear\"}})});}addPropertyControls(ProgressBar,{barWidth:{title:\"Bar Width\",type:ControlType.Number,defaultValue:1120,min:0,step:1},trackName:{title:\"Track Name\",type:ControlType.String,defaultValue:\"carouselTrack\"},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#0045FF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProgressBar.map"],"mappings":"wLAAyI,SAAwB,EAAY,CAAC,WAAS,YAAU,SAAO,CAAC,IAAM,EAAOA,EAAO,KAAK,CAAwe,OAAve,MAAc,CAAC,IAAM,EAAU,SAAS,cAAc,sBAAsB,EAAU,IAAI,CAAC,GAAG,CAAC,GAAW,CAAC,EAAO,QAAQ,OAAO,IAAM,EAAgB,EAAU,YAAY,EAAU,YAAkB,MAAW,CAAC,IAAM,EAAW,EAAU,WAAiB,EAAM,KAAK,IAAI,EAAW,EAAgB,EAAE,CAAC,EAAO,QAAQ,MAAM,MAAM,GAAG,EAAM,EAAS,KAA2D,OAArD,EAAU,iBAAiB,SAAS,EAAO,CAAC,GAAQ,KAAW,EAAU,oBAAoB,SAAS,EAAO,EAAG,CAAC,EAAS,EAAU,CAAC,CAAqB,EAAK,EAAM,CAAC,WAAW,OAAO,MAAM,OAAO,OAAO,OAAO,MAAM,CAAC,SAAS,SAAS,CAAC,SAAsB,EAAK,MAAM,CAAC,IAAI,EAAO,MAAM,CAAC,OAAO,OAAO,gBAAgB,EAAM,MAAM,EAAE,aAAa,IAAI,WAAW,oBAAoB,CAAC,CAAC,CAAC,CAAC,kBAA15B,IAAoC,IAA0D,CAA8zB,EAAoB,EAAY,CAAC,SAAS,CAAC,MAAM,YAAY,KAAK,EAAY,OAAO,aAAa,KAAK,IAAI,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,MAAM,aAAa,KAAK,EAAY,OAAO,aAAa,gBAAgB,CAAC,MAAM,CAAC,MAAM,QAAQ,KAAK,EAAY,MAAM,aAAa,UAAU,CAAC,CAAC"}