{"version":3,"file":"AnimatedDashedBorder.wLbonsel.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/xyISh897iCXcjuOYtMRm/EKEHBoFJhQifR5jatHWS/AnimatedDashedBorder.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Perfect Radius Animated Dashed Border\n *\n * ✔ Pixel-based SVG (no distortion)\n * ✔ Non-scaling stroke\n * ✔ Smooth animation\n * ✔ Fully responsive\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function AnimatedDashedBorder(props){const{borderColor,borderWidth,dashLength,gapLength,borderRadius,speed,background,style,children}=props;const isStatic=useIsStaticRenderer();const containerRef=useRef(null);const requestRef=useRef();const[offset,setOffset]=useState(0);const[size,setSize]=useState({width:0,height:0});// Resize observer for real pixel dimensions\nuseEffect(()=>{if(!containerRef.current)return;const observer=new ResizeObserver(entries=>{const rect=entries[0].contentRect;setSize({width:rect.width,height:rect.height});});observer.observe(containerRef.current);return()=>observer.disconnect();},[]);// Smooth animation loop\nuseEffect(()=>{if(isStatic)return;let lastTime=performance.now();const animate=time=>{const delta=time-lastTime;lastTime=time;startTransition(()=>{setOffset(prev=>(prev+speed*delta*.05)%(dashLength+gapLength));});requestRef.current=requestAnimationFrame(animate);};requestRef.current=requestAnimationFrame(animate);return()=>{if(requestRef.current){cancelAnimationFrame(requestRef.current);}};},[isStatic,speed,dashLength,gapLength]);const strokeW=Math.max(.5,borderWidth);const radius=Math.max(0,borderRadius);return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",background,borderRadius:radius,overflow:\"hidden\",boxSizing:\"border-box\",display:\"flex\",flexDirection:\"column\"},children:[children,size.width>0&&size.height>0&&/*#__PURE__*/_jsx(\"svg\",{width:size.width,height:size.height,viewBox:`0 0 ${size.width} ${size.height}`,style:{position:\"absolute\",inset:0,pointerEvents:\"none\",zIndex:2},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"rect\",{x:strokeW/2,y:strokeW/2,width:size.width-strokeW,height:size.height-strokeW,rx:radius,ry:radius,fill:\"none\",stroke:borderColor,strokeWidth:strokeW,strokeDasharray:`${dashLength} ${gapLength}`,strokeDashoffset:offset,vectorEffect:\"non-scaling-stroke\"})})]});}addPropertyControls(AnimatedDashedBorder,{borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#0099FF\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:.5,max:12,step:.5,unit:\"px\"},dashLength:{type:ControlType.Number,title:\"Dash Length\",defaultValue:3,min:1,max:40,step:1,unit:\"px\"},gapLength:{type:ControlType.Number,title:\"Gap Length\",defaultValue:6,min:1,max:40,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:200,step:1,unit:\"px\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:2,min:.1,max:10,step:.1},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},children:{type:ControlType.Slot,title:\"Content\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedDashedBorder\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedDashedBorder.map"],"mappings":"yMAUG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,cAAY,cAAY,aAAW,YAAU,eAAa,QAAM,aAAW,QAAM,YAAU,EAAY,EAAS,EAAoB,EAAQ,EAAaA,EAAO,IAAI,EAAQ,EAAWA,EAAO,EAAO,CAAC,EAAO,GA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