{"version":3,"file":"AutoHideFrame.CtsWV0TK.mjs","names":["useState","__esmMin","te","init_npm_react_18_3_1","ce","init_jsx_runtime","c","_e","AnimatePresence","init_framer_motion_DhsWWWsN","motion","init_framer_DDfsYcI0","addPropertyControls","ControlType","AutoHideFrame","props","isVisible","setIsVisible","timeoutId","delay","duration","containerStyle","style","childrenWrapperStyle","animateOut","exitScale","exitY","animationDuration","init_AutoHideFrame"],"sources":["https:/framerusercontent.com/modules/RP3ev43vwS0L2mN7AWxP/DzaNicSTDNJgle9gYR3T/AutoHideFrame.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Auto Hide Frame\n *\n * A frame that automatically hides itself after a specified duration.\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function AutoHideFrame(props){const{duration=3,delay=0,animateOut=true,children,backgroundColor=\"#0099FF\",borderRadius=12,padding=20,style,animationDuration=.3,exitScale=.95,exitY=0}=props;const[isVisible,setIsVisible]=useState(true);useEffect(()=>{startTransition(()=>setIsVisible(true));const timeoutId=setTimeout(()=>{startTransition(()=>setIsVisible(false));},(delay+duration)*1e3);return()=>clearTimeout(timeoutId);},[duration,delay]);const containerStyle={backgroundColor,borderRadius,padding,display:\"flex\",width:\"100%\",height:\"100%\",overflow:\"hidden\",position:\"relative\",...style};const childrenWrapperStyle={flex:1,display:\"flex\",width:\"100%\",height:\"100%\",minWidth:0,minHeight:0,justifyContent:\"center\",alignItems:\"center\"};if(!animateOut){if(!isVisible)return null;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{style:childrenWrapperStyle,children:children})});}return /*#__PURE__*/_jsx(AnimatePresence,{children:isVisible&&/*#__PURE__*/_jsx(motion.div,{style:containerStyle,initial:{opacity:1,scale:1},exit:{opacity:0,scale:exitScale,y:exitY},transition:{duration:animationDuration,ease:\"easeOut\"},children:/*#__PURE__*/_jsx(\"div\",{style:childrenWrapperStyle,children:children})})});}addPropertyControls(AutoHideFrame,{duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3,min:.1,max:60,step:.1,unit:\"s\",displayStepper:true},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:30,step:.1,unit:\"s\",displayStepper:true},animateOut:{type:ControlType.Boolean,title:\"Animate Out\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},animationDuration:{type:ControlType.Number,title:\"Anim Duration\",defaultValue:.3,min:.1,max:5,step:.1,unit:\"s\",displayStepper:true},exitScale:{type:ControlType.Number,title:\"Exit Scale\",defaultValue:.95,min:0,max:2,step:.05},exitY:{type:ControlType.Number,title:\"Exit Y\",defaultValue:0,min:-500,max:500,step:10,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0099FF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:50,step:1,unit:\"px\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},children:{type:ControlType.Slot,title:\"Content\",maxCount:10}});AutoHideFrame.displayName=\"Auto Hide Frame\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AutoHideFrame\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"200\",\"framerIntrinsicWidth\":\"300\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AutoHideFrame.map"],"mappings":"A,gPAUG,SAAwBc,EAAc,EAAM,CAAC,GAAK,CAAC,WAAS,EAAE,QAAM,EAAE,aAAW,GAAK,WAAS,kBAAgB,UAAU,eAAa,GAAG,UA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