{"version":3,"file":"RefreshButton.CXnoEUu5.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/wrllVcmI1iWekpJMi107/f2cX0MF8StewmhZyB4uu/RefreshButton.js"],"sourcesContent":["// Button with animated dot and tooltip\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Button with Animated Dot and Tooltip\n *\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function RefreshButton(props){const{dotColor,strokeColor,animationSpeed,style}=props;const[dot,setDot]=useState({x:0,y:0,axis:\"x\"});const[rotation,setRotation]=useState(0);const[showTooltip,setShowTooltip]=useState(false);const size=24;// Animate dot in a fixed sequence\nuseEffect(()=>{let timeout;const sequence=[{x:-8,y:0,axis:\"x\",rotation:-40},{x:8,y:0,axis:\"x\",rotation:40},{x:0,y:8,axis:\"y\",rotation:-40},{x:0,y:-8,axis:\"y\",rotation:40}];let idx=0;function moveDot(){const step=sequence[idx];setDot({x:step.x,y:step.y,axis:step.axis});setRotation(step.rotation);idx=(idx+1)%sequence.length;timeout=window.setTimeout(moveDot,animationSpeed);}moveDot();return()=>{clearTimeout(timeout);};},[animationSpeed]);return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:size,height:size,display:\"inline-block\"},children:[/*#__PURE__*/_jsx(\"button\",{style:{...style,width:size,height:size,background:\"#fff\",border:`1px solid ${strokeColor}`,borderRadius:\"50%\",padding:0,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",outline:\"none\"},\"aria-label\":\"Button\",onMouseEnter:()=>setShowTooltip(true),onMouseLeave:()=>setShowTooltip(false),onFocus:()=>setShowTooltip(true),onBlur:()=>setShowTooltip(false),children:/*#__PURE__*/_jsx(\"div\",{style:{width:6,height:6,borderRadius:\"50%\",background:dotColor,position:\"absolute\",left:\"50%\",top:\"50%\",transform:`translate(-50%, -50%) translate(${dot.x}px, ${dot.y}px) ${dot.axis===\"x\"?`rotateY(${rotation}deg)`:`rotateX(${rotation}deg)`}`,transition:`transform ${animationSpeed*.7}ms cubic-bezier(.4,2,.6,1)`,pointerEvents:\"none\"}})}),showTooltip&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:-8,top:\"50%\",transform:\"translate(-100%, -50%)\",background:\"#222\",color:\"#fff\",fontSize:12,padding:\"4px 10px\",borderRadius:6,whiteSpace:\"nowrap\",pointerEvents:\"none\",zIndex:10,boxShadow:\"0 2px 8px rgba(0,0,0,0.10)\"},role:\"tooltip\",children:props.hoverText})]});}addPropertyControls(RefreshButton,{dotColor:{type:ControlType.Color,title:\"Dot Color\",defaultValue:\"#111\"},strokeColor:{type:ControlType.Color,title:\"Stroke Color\",defaultValue:\"#111\"},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:600,min:200,max:2e3,unit:\"ms\"},hoverText:{type:ControlType.String,title:\"Hover Text\",defaultValue:\"reset drag\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RefreshButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"24\",\"framerIntrinsicWidth\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RefreshButton.map"],"mappings":"sMASG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,iBAAe,SAAO,EAAW,CAAC,EAAI,GAAQA,EAAS,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,CAAC,EAAO,CAAC,EAAS,GAAaA,EAAS,CAAC,EAAO,CAAC,EAAY,GAAgBA,EAAS,EAAK,EAC0M,OAAxb,MAAc,CAAC,IAAI,EAAc,EAAS,CAAC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