{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/nm9DO8evMQ4SputNTy4K/Ay5nySM6SBeysyYsV8Oi/Image_url.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ImageFromURL(props){const{url,placeholderText,width,height,altText,fit,backgroundColor,cornerRadius}=props;const containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",width:\"100%\",height:\"100%\",backgroundColor:url?\"transparent\":backgroundColor,overflow:\"hidden\",borderRadius:`${cornerRadius}px`};const imageStyle={display:\"block\",width:\"100%\",height:\"100%\",objectFit:fit};const placeholderStyle={color:\"#888\",textAlign:\"center\",padding:\"10px\",fontSize:\"14px\"};// Use a state to handle image loading errors to show placeholder\nconst[showPlaceholderOnError,setShowPlaceholderOnError]=React.useState(false);React.useEffect(()=>{// Reset error state when URL changes\nsetShowPlaceholderOnError(false);},[url]);const handleImageError=()=>{setShowPlaceholderOnError(true);};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,\"data-framer-name\":\"Image Container\",children:url&&!showPlaceholderOnError?/*#__PURE__*/_jsx(\"img\",{src:url,alt:altText||\"Image from URL\",style:imageStyle,onError:handleImageError}):/*#__PURE__*/_jsx(\"span\",{style:placeholderStyle,children:placeholderText})});}ImageFromURL.defaultProps={url:\"\",placeholderText:\"Provide an image URL\",width:200,height:200,altText:\"User-provided image\",fit:\"contain\",backgroundColor:\"#E0E0E0\",cornerRadius:0};addPropertyControls(ImageFromURL,{url:{title:\"Image URL\",type:ControlType.String,defaultValue:ImageFromURL.defaultProps.url,placeholder:\"https://example.com/image.jpg\",description:\"The URL of the image to display.\"},placeholderText:{title:\"Placeholder Text\",type:ControlType.String,defaultValue:ImageFromURL.defaultProps.placeholderText,description:\"Text to show when no URL is provided or on error.\"},altText:{title:\"Alt Text\",type:ControlType.String,defaultValue:ImageFromURL.defaultProps.altText,description:\"Descriptive text for accessibility (screen readers).\"},// Width and Height controls are removed as per Framer best practices\n// The component should respect the dimensions set in the Framer canvas\n// The @framerSupportedLayoutWidth/Height auto annotations ensure this.\n// Default width/height in props are for initial rendering before canvas size is applied.\nfit:{title:\"Fit\",type:ControlType.Enum,defaultValue:ImageFromURL.defaultProps.fit,options:[\"contain\",\"cover\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Contain\",\"Cover\",\"Fill\",\"None\",\"Scale Down\"],description:\"How the image should be resized to fit its container.\"},backgroundColor:{title:\"Placeholder BG\",type:ControlType.Color,defaultValue:ImageFromURL.defaultProps.backgroundColor,description:\"Background color for the placeholder area.\"},cornerRadius:{title:\"Corner Radius\",type:ControlType.Number,defaultValue:ImageFromURL.defaultProps.cornerRadius,min:0,max:500,step:1,displayStepper:true,description:\"Rounds the corners of the image container.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageFromURL\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Image_url.map"],
  "mappings": "sEAA0I,SAARA,EAA8BC,EAAM,CAAC,GAAK,CAAC,IAAAC,EAAI,gBAAAC,EAAgB,MAAAC,EAAM,OAAAC,EAAO,QAAAC,EAAQ,IAAAC,EAAI,gBAAAC,EAAgB,aAAAC,CAAY,EAAER,EAAYS,EAAe,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,MAAM,OAAO,OAAO,OAAO,gBAAgBR,EAAI,cAAcM,EAAgB,SAAS,SAAS,aAAa,GAAGC,CAAY,IAAI,EAAQE,EAAW,CAAC,QAAQ,QAAQ,MAAM,OAAO,OAAO,OAAO,UAAUJ,CAAG,EAAQK,EAAiB,CAAC,MAAM,OAAO,UAAU,SAAS,QAAQ,OAAO,SAAS,MAAM,EAC7mB,CAACC,EAAuBC,CAAyB,EAAQC,EAAS,EAAK,EAAE,OAAMC,EAAU,IAAI,CAClGF,EAA0B,EAAK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", "width", "height", "altText", "fit", "backgroundColor", "cornerRadius", "containerStyle", "imageStyle", "placeholderStyle", "showPlaceholderOnError", "setShowPlaceholderOnError", "ye", "ue", "p", "addPropertyControls", "ControlType"]
}
