{"version":3,"file":"ImageWithFrame.C267lF7i.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/h35113OGDN7yaJCVIHlg/FiUUBO5qvBArmLZ6iHwL/ImageWithFrame.js"],"sourcesContent":["// Image with recolourable frame and zoom modal\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Image with Frame and Zoom Modal\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 240\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageWithFrame(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},frameColor,frameWidth,borderRadius,modalBackground,style}=props;const[open,setOpen]=useState(false);function handleOpen(){startTransition(()=>setOpen(true));}function handleClose(e){e.stopPropagation();startTransition(()=>setOpen(false));}// Hide modal in thumbnail\nif(RenderTarget.current()===RenderTarget.thumbnail)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{border:`${frameWidth}px ${props.frameStyle} ${frameColor}`,borderRadius,overflow:\"hidden\",width:\"100%\",height:\"100%\",boxSizing:\"border-box\",cursor:\"zoom-in\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},tabIndex:0,\"aria-label\":\"Open image zoom modal\",onClick:handleOpen,onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \")handleOpen();},role:\"button\",children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:borderRadius-frameWidth>0?borderRadius-frameWidth:0},draggable:false})}),open&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",background:modalBackground,zIndex:9999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"zoom-out\"},onClick:handleClose,\"aria-modal\":\"true\",role:\"dialog\",children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{maxWidth:\"90vw\",maxHeight:\"90vh\",borderRadius,boxShadow:\"0 8px 32px rgba(0,0,0,0.25)\",background:\"#fff\"},draggable:false})})]});}addPropertyControls(ImageWithFrame,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},frameColor:{type:ControlType.Color,title:\"Frame Color\",defaultValue:\"#222222\"},frameWidth:{type:ControlType.Number,title:\"Frame Width\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},frameStyle:{type:ControlType.Enum,title:\"Frame Style\",options:[\"solid\",\"dotted\",\"dashed\",\"double\"],optionTitles:[\"Solid\",\"Dotted\",\"Dashed\",\"Double\"],defaultValue:\"solid\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:64,step:1,unit:\"px\"},modalBackground:{type:ControlType.Color,title:\"Modal BG\",defaultValue:\"rgba(0,0,0,0.7)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageWithFrame\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"320\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"240\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageWithFrame.map"],"mappings":"+LASG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,oBAAoB,CAAC,aAAW,aAAW,eAAa,kBAAgB,SAAO,EAAW,CAAC,EAAK,GAASA,EAAS,GAAM,CAAC,SAAS,GAAY,CAAC,MAAoB,EAAQ,GAAK,CAAC,CAA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