{"version":3,"file":"CMSImageContain.BN32ysag.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/RlJ4DmblQg7tGDLEMyfL/2HRotyDza541Ef1nckCt/CMSImageContain.js"],"sourcesContent":["// User request: Create a Framer code component named CMSImageContain for displaying CMS-bound images without cropping, with object-fit contain by default, configurable object-position, 100% width/height, transparent background by default, optional backgroundColor, borderRadius, alt text, and property controls for image, alt, fit, position, backgroundColor, borderRadius.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CMSImageContain(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},alt,fit,position,backgroundColor,borderRadius}=props;const resolvedImage=useMemo(()=>{if(typeof image===\"string\"){return{src:image,srcSet:undefined,alt:undefined};}return{src:image?.src??\"\",srcSet:image?.srcSet,alt:image?.alt};},[image]);const objectPosition=useMemo(()=>{switch(position){case\"left\":return\"left center\";case\"right\":return\"right center\";case\"top\":return\"center top\";case\"bottom\":return\"center bottom\";case\"center\":default:return\"center center\";}},[position]);const computedAlt=alt||resolvedImage.alt||\"\";return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",backgroundColor,borderRadius},children:/*#__PURE__*/_jsx(\"img\",{src:resolvedImage.src,srcSet:resolvedImage.srcSet,alt:computedAlt,style:{width:\"100%\",height:\"100%\",objectFit:fit,objectPosition,display:\"block\"}})});}addPropertyControls(CMSImageContain,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},alt:{type:ControlType.String,title:\"Alt\",defaultValue:\"\",placeholder:\"Describe the image\"},fit:{type:ControlType.Enum,title:\"Fit\",defaultValue:\"contain\",options:[\"contain\",\"cover\"],optionTitles:[\"Contain\",\"Cover\"],displaySegmentedControl:true},position:{type:ControlType.Enum,title:\"Position\",defaultValue:\"center\",options:[\"center\",\"left\",\"right\",\"top\",\"bottom\"],optionTitles:[\"Center\",\"Left\",\"Right\",\"Top\",\"Bottom\"]},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(0,0,0,0)\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:200,unit:\"px\",step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSImageContain\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSImageContain.map"],"mappings":"0KAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,mBAAmB,EAAE,MAAI,MAAI,WAAS,kBAAgB,gBAAc,EAAY,EAAcA,MAAgB,OAAO,GAAQ,SAAgB,CAAC,IAAI,EAAM,OAAO,IAAA,GAAU,IAAI,IAAA,EAAS,EAAS,CAAC,IAAI,GAAO,KAAK,GAAG,OAAO,GAAO,OAAO,IAAI,GAAO,GAAG,EAAI,CAAC,CAAK,CAAC,EAAQ,EAAeA,MAAY,CAAC,OAAO,EAAP,CAAiB,IAAI,OAAO,MAAM,cAAc,IAAI,QAAQ,MAAM,eAAe,IAAI,MAAM,MAAM,aAAa,IAAI,SAAS,MAAM,gBAA6B,QAAQ,MAAM,eAAgB,CAAC,EAAE,CAAC,CAAQ,CAAC,EAAQ,EAAY,GAAK,EAAc,KAAK,GAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,kBAAgB,cAAY,EAAE,SAAsB,EAAK,MAAM,CAAC,IAAI,EAAc,IAAI,OAAO,EAAc,OAAO,IA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