{"version":3,"file":"RefreshButton.Cgsg3aI8.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,IAAI,CAAC,CAAM,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CACyM,OAAxb,MAAc,CAAC,IAAI,EAAc,EAAS,CAAC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