{"version":3,"file":"ProgressBar.DGoTymcH.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/zDx7sgmQ4boStwzUJ5SW/isQDq3Sr7y2xAk3ZriSq/ProgressBar.js"],"sourcesContent":["// Progress bar component with percentage value from CMS text field\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";function normalizeColor(input){const value=(input||\"\").trim();const m=/^#([0-9a-fA-F]{8})$/.exec(value);if(!m)return value;const hex=m[1];const r=parseInt(hex.slice(0,2),16);const g=parseInt(hex.slice(2,4),16);const b=parseInt(hex.slice(4,6),16);const a=parseInt(hex.slice(6,8),16)/255;return`rgba(${r}, ${g}, ${b}, ${a})`;}/**\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 16\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ProgressBar(props){const{percentage=\"75\",barColor=\"#000000\",backgroundColor=\"#EEEEEE\",borderRadius=8,style}=props;const numericValue=useMemo(()=>{const parsed=parseFloat(percentage);if(isNaN(parsed))return 0;return Math.max(0,Math.min(100,parsed));},[percentage]);const resolvedBarColor=useMemo(()=>normalizeColor(barColor),[barColor]);const resolvedBackgroundColor=useMemo(()=>normalizeColor(backgroundColor),[backgroundColor]);const safeWidth=useMemo(()=>{const w=style?.width;if(typeof w===\"number\")return Math.max(5,w);return\"100%\";},[style]);const safeHeight=useMemo(()=>{const h=style?.height;if(typeof h===\"number\")return Math.max(5,h);return\"100%\";},[style]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:safeWidth,height:safeHeight,minWidth:5,minHeight:5,backgroundColor:resolvedBackgroundColor,borderRadius:borderRadius,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,height:\"100%\",width:`${numericValue}%`,backgroundColor:resolvedBarColor,borderRadius:borderRadius,transition:\"width 0.3s ease\"}})});}addPropertyControls(ProgressBar,{percentage:{type:ControlType.String,title:\"Percentage\",defaultValue:\"75\",placeholder:\"Enter 0-100\"},barColor:{type:ControlType.Color,title:\"Bar Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#EEEEEE\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgressBar\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"16\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProgressBar.map"],"mappings":"qKAC0H,SAAS,EAAe,EAAM,CAAC,IAAM,GAAO,GAAO,IAAI,MAAM,CAAO,EAAE,sBAAsB,KAAK,EAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAM,IAAM,EAAI,EAAE,GAAuJ,MAAM,QAAlJ,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAiI,IAAxH,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAmG,IAA1F,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAqE,IAA5D,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,IAAsC,GAMvb,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,aAAW,KAAK,WAAS,UAAU,kBAAgB,UAAU,eAAa,EAAE,SAAO,EAAY,EAAaA,MAAY,CAAC,IAAM,EAAO,WAAW,EAAW,CAA2B,OAAvB,MAAM,EAAO,CAAQ,EAAS,KAAK,IAAI,EAAE,KAAK,IAAI,IAAI,EAAO,CAAC,EAAG,CAAC,EAAW,CAAC,CAAO,EAAiBA,MAAY,EAAe,EAAS,CAA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