{"version":3,"file":"LoadingLine.CKB4LrH8.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/5rYnKmdgjIRu1Oi3i6kC/7OEgXDJP6J7AckYYg2Jz/LoadingLine.js"],"sourcesContent":["// Animated loading line (no heading)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * LoadingLine\n *\n * Animated loading line (no heading).\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LoadingLine(props){const{backgroundColor,fillColor,lineHeight,borderRadius,duration,style}=props;const isStatic=useIsStaticRenderer();const[progress,setProgress]=useState(isStatic?1:0);const requestRef=useRef();const startTime=useRef();// Get numeric width for animation\nlet containerWidth=\"100%\";if(props.enableMaxWidth){const maxW=props.maxWidth||1200;containerWidth=maxW+\"px\";if(style&&typeof style.width===\"number\"){containerWidth=Math.min(style.width,maxW)+\"px\";}else if(style&&typeof style.width===\"string\"&&style.width.endsWith(\"px\")){containerWidth=Math.min(parseFloat(style.width),maxW)+\"px\";}}useEffect(()=>{if(isStatic){setProgress(1);return;}setProgress(0);function animate(ts){if(!startTime.current)startTime.current=ts;const elapsed=ts-startTime.current;const pct=Math.min(1,elapsed/(duration*1e3));startTransition(()=>setProgress(pct));if(pct<1){requestRef.current=requestAnimationFrame(animate);}}requestRef.current=requestAnimationFrame(animate);return()=>{if(requestRef.current)cancelAnimationFrame(requestRef.current);startTime.current=undefined;};},[duration,isStatic]);// Sizing\nconst containerStyle={...style,position:\"relative\",width:style?.width||\"100%\",minHeight:Math.max(lineHeight,8),display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\"};const lineStyle={width:`${progress*100}%`,height:lineHeight,background:fillColor,borderRadius:borderRadius,overflow:\"hidden\",transition:isStatic?\"none\":`width ${duration}s cubic-bezier(.4,0,.2,1)`};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{style:{width:containerWidth,maxWidth:\"100%\",height:lineHeight,background:backgroundColor,borderRadius:borderRadius,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:lineStyle})})});}addPropertyControls(LoadingLine,{backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#eee\"},fillColor:{type:ControlType.Color,title:\"Fill Color\",defaultValue:\"#222\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:6,min:.5,max:20,step:1,unit:\"px\"},duration:{type:ControlType.Number,title:\"Load Duration\",defaultValue:1.2,min:.2,max:5,step:.1,unit:\"s\"},enableMaxWidth:{type:ControlType.Boolean,title:\"Enable Max Width\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},maxWidth:{type:ControlType.Number,title:\"Max Width\",defaultValue:1200,min:100,max:2e3,step:10,unit:\"px\",hidden:({enableMaxWidth})=>!enableMaxWidth},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:3,min:0,max:20,step:.5,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoadingLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoadingLine.map"],"mappings":"uMAQG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,kBAAgB,YAAU,aAAW,eAAa,WAAS,SAAO,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAS,GAAaA,EAAS,IAAY,EAAQ,EAAWC,EAAO,EAAQ,EAAUA,EAAO,EACjQ,EAAe,OAAO,GAAG,EAAM,eAAe,CAAC,IAAM,EAAK,EAAM,UAAU,KAAK,EAAe,EAAK,KAAQ,GAAO,OAAO,EAAM,OAAQ,SAAU,EA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