{"version":3,"file":"AutoHideFrame.D7ami_re.mjs","names":["useState"],"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":"iPAUG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,WAAS,EAAE,QAAM,EAAE,aAAW,GAAK,WAAS,kBAAgB,UAAU,eAAa,GAAG,UAAQ,GAAG,QAAM,oBAAkB,GAAG,YAAU,IAAI,QAAM,GAAG,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAI,EAAE,MAAc,CAAC,MAAoB,EAAa,EAAI,CAAC,EAAE,IAAM,EAAU,eAAe,CAAC,MAAoB,EAAa,EAAK,CAAC,CAAE,GAAG,EAAM,GAAU,GAAG,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