{"version":3,"file":"ImageLightboxDescription.QjAg-e64.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/yq4vpxN8lBbXomD3sPhL/gJyRguJk2qdhyCwJPZDV/ImageLightboxDescription.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,startTransition,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Image component with lightbox effect and description overlay\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageLightboxDescription(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},description,showDescription,backgroundColor,textColor,font,overlayColor,borderRadius,imageAlignment=\"center\"}=props;const[isLightboxOpen,setIsLightboxOpen]=useState(false);const openLightbox=()=>{startTransition(()=>setIsLightboxOpen(true));};const closeLightbox=()=>{startTransition(()=>setIsLightboxOpen(false));};// Add escape key listener when lightbox is open\nuseEffect(()=>{const handleEscapeKey=e=>{if(e.key===\"Escape\"){closeLightbox();}};if(isLightboxOpen){document.addEventListener(\"keydown\",handleEscapeKey);}return()=>{document.removeEventListener(\"keydown\",handleEscapeKey);};},[isLightboxOpen]);const handleKeyDown=e=>{if(e.key===\"Escape\"){closeLightbox();}};const handleOverlayClick=e=>{if(e.target===e.currentTarget){closeLightbox();}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",cursor:\"pointer\",borderRadius,overflow:\"hidden\"},onClick:openLightbox,onKeyDown:e=>e.key===\"Enter\"&&openLightbox(),tabIndex:0,role:\"button\",\"aria-label\":\"Open image in lightbox\",children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:imageAlignment,display:\"block\"}})}),/*#__PURE__*/_jsx(AnimatePresence,{children:isLightboxOpen&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:overlayColor,display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999,padding:\"20px\",boxSizing:\"border-box\"},onClick:handleOverlayClick,onKeyDown:handleKeyDown,tabIndex:0,role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":\"Image lightbox\",children:[/*#__PURE__*/_jsx(\"button\",{onClick:closeLightbox,style:{position:\"absolute\",top:\"20px\",right:\"20px\",background:\"transparent\",border:\"none\",borderRadius:\"50%\",width:\"40px\",height:\"40px\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:\"20px\",color:\"#FFC8D8\",zIndex:1e4,lineHeight:\"1\"},\"aria-label\":\"Close lightbox\",children:\"\\xd7\"}),/*#__PURE__*/_jsx(motion.img,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.3},src:image.src,alt:image.alt,style:{maxWidth:\"90%\",maxHeight:showDescription?\"70%\":\"90%\",objectFit:\"contain\",objectPosition:imageAlignment,borderRadius:borderRadius/2}}),showDescription&&description&&/*#__PURE__*/_jsxs(motion.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:20,opacity:0},transition:{duration:.3,delay:.1},style:{backgroundColor:\"transparent\",color:textColor,padding:\"16px 24px\",borderRadius:borderRadius/2,marginTop:\"20px\",maxWidth:\"90%\",textAlign:\"center\",...font,fontFamily:\"Raleway\"},children:[/*#__PURE__*/_jsx(\"link\",{href:\"https://fonts.googleapis.com/css2?family=Raleway:wght@100;200;300;400;500;600;700;800;900&display=swap\",rel:\"stylesheet\"}),description]})]})})]});}addPropertyControls(ImageLightboxDescription,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},imageAlignment:{type:ControlType.Enum,title:\"Image Alignment\",options:[\"top\",\"center\",\"bottom\"],optionTitles:[\"Top\",\"Center\",\"Bottom\"],defaultValue:\"center\",displaySegmentedControl:true},description:{type:ControlType.String,title:\"Description\",defaultValue:\"This is a beautiful image with detailed description that appears in the lightbox.\",displayTextArea:true},showDescription:{type:ControlType.Boolean,title:\"Show Description\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},backgroundColor:{type:ControlType.Color,title:\"Description Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Description Text\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Description Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},overlayColor:{type:ControlType.Color,title:\"Overlay Background\",defaultValue:\"rgba(0, 0, 0, 0.9)\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageLightboxDescription\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageLightboxDescription.map"],"mappings":"8PAKG,SAAwB,EAAyB,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,oBAAoB,CAAC,cAAY,kBAAgB,kBAAgB,YAAU,OAAK,eAAa,eAAa,iBAAe,UAAU,EAAW,CAAC,EAAe,GAAmBA,EAAS,GAAM,CAAO,MAAiB,CAAC,MAAoB,EAAkB,GAAK,CAAC,EAAS,MAAkB,CAAC,MAAoB,EAAkB,GAAM,CAAC,EACpe,MAAc,CAAC,IAAM,EAA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