{"version":3,"file":"ImageWithCaption.JK7Bans2.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","_e","p","c","init_jsx_runtime","ce","motion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_BWFVvmND","addPropertyControls","ControlType","ImageWithCaption","props","isOpen","setIsOpen","src","imageUrl","image","alt","caption","style","showLightbox","captionColor","lightboxBackground","init_ImageWithCaption"],"sources":["https:/framerusercontent.com/modules/dDpVm05nO9Y2n0orqTjO/dqK2dpqsIRQFjlw54xa0/ImageWithCaption.js"],"sourcesContent":["// Image with Caption - Case study images with lightbox\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";import{useState,useEffect}from\"react\";/**\n * Image with Caption\n *\n * Displays a case study image with optional caption and lightbox.\n * Scroll animations should be applied via Framer's native scroll\n * animation settings on the canvas, not in code.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ImageWithCaption(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image\"},imageUrl=\"\",caption=\"\",captionColor=\"rgba(255, 255, 255, 0.6)\",borderRadius=8,showLightbox=true,lightboxBackground=\"rgba(0, 0, 0, 0.92)\",style}=props;const[isOpen,setIsOpen]=useState(false);// Get image source\nconst src=imageUrl||image?.src||\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\";const alt=image?.alt||caption||\"Image\";// Lock body scroll when lightbox is open\nuseEffect(()=>{if(typeof document===\"undefined\")return;if(isOpen){document.body.style.overflow=\"hidden\";return()=>{document.body.style.overflow=\"\";};}},[isOpen]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",borderRadius,overflow:\"hidden\",cursor:showLightbox?\"zoom-in\":\"default\"},onClick:()=>{if(showLightbox)setIsOpen(true);},children:/*#__PURE__*/_jsx(\"img\",{src:src,alt:alt,style:{width:\"100%\",height:\"auto\",display:\"block\",borderRadius}})}),caption&&/*#__PURE__*/_jsx(\"p\",{style:{color:captionColor,margin:\"12px 0 0 0\",textAlign:\"center\",fontSize:13},children:caption}),/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{position:\"fixed\",inset:0,backgroundColor:lightboxBackground,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999,cursor:\"zoom-out\"},onClick:()=>setIsOpen(false),children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:20,right:20,width:44,height:44,borderRadius:22,backgroundColor:\"rgba(255,255,255,0.1)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",color:\"white\",fontSize:24},whileHover:{backgroundColor:\"rgba(255,255,255,0.2)\"},whileTap:{scale:.9},onClick:e=>{e.stopPropagation();setIsOpen(false);},children:\"\\xd7\"}),/*#__PURE__*/_jsx(motion.img,{src:src,alt:alt,initial:{scale:.9},animate:{scale:1},exit:{scale:.9},style:{maxWidth:\"90vw\",maxHeight:\"90vh\",objectFit:\"contain\",borderRadius:4},onClick:e=>e.stopPropagation()}),caption&&/*#__PURE__*/_jsx(motion.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},style:{position:\"absolute\",bottom:30,left:0,right:0,textAlign:\"center\",color:\"rgba(255,255,255,0.8)\",fontSize:14},children:caption})]})})]});}addPropertyControls(ImageWithCaption,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},imageUrl:{type:ControlType.String,title:\"Image URL\",defaultValue:\"\"},caption:{type:ControlType.String,title:\"Caption\",displayTextArea:true,defaultValue:\"\"},captionColor:{type:ControlType.Color,title:\"Caption Color\",defaultValue:\"rgba(255, 255, 255, 0.6)\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:24},showLightbox:{type:ControlType.Boolean,title:\"Lightbox\",defaultValue:true},lightboxBackground:{type:ControlType.Color,title:\"Lightbox BG\",defaultValue:\"rgba(0, 0, 0, 0.92)\",hidden:props=>!props.showLightbox}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageWithCaption\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageWithCaption.map"],"mappings":"A,gPAUG,SAAwBc,EAAiB,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,OAAO,EAAE,WAAS,GAAG,UAAQ,GAAG,eAAa,2BAA2B,eAAa,EAAE,eAAa,GAAK,qBAAmB,sBAAsB,SAAOC,EAAW,CAACC,EAAOC,GAAWjB,EAAS,EAAK,EAC7UkB,EAAIC,GAAUC,GAAO,KAAK,sEAA4EC,EAAID,GAAO,KAAKE,GAAS,QAC6B,OAAlKf,MAAc,CAAC,GAAG,OAAO,SAAW,KAAsBS,EAA8C,MAAtC,UAAS,KAAK,MAAM,SAAS,aAAmB,CAAC,SAAS,KAAK,MAAM,SAAS,EAAG,CAAG,EAAE,CAACA,CAAM,CAAC,EAAsB,gBAAM,MAAM,CAAC,MAAM,CAAC,GAAGO,EAAM,SAAS,WAAW,MAAM,MAAM,EAAE,SAAS,CAAc,gBAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,eAAa,SAAS,SAAS,OAAOC,EAAa,UAAU,SAAS,EAAE,YAAY,CAAIA,GAAaP,EAAU,EAAI,CAAE,EAAE,SAAsB,gBAAK,MAAM,CAAK,MAAQ,MAAI,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,QAAQ,cAAY,CAAC,CAAC,CAAC,CAAC,EAAEK,GAAsB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