{"version":3,"file":"ImageWithFrame.D1LGjMSd.mjs","names":["useState","__esmMin","te","_e","init_jsx_runtime","c","p","init_npm_react_18_3_1","init_framer_BL70qLPA","RenderTarget","ControlType","addPropertyControls","ImageWithFrame","props","open","setOpen","handleOpen","handleClose","style","frameWidth","frameColor","image","borderRadius","modalBackground","init_ImageWithFrame"],"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":"A,gMASG,SAAwBY,EAAe,EAAM,CAAC,GAAK,CAA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