{"version":3,"file":"ProgressBar.CjF4Fpdk.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/dKyucgtWzcVPD6iomRNe/mYlTl98PylQp918xGUqJ/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,GAAA,CAAI,KAAK,EAAQ,EAAE,sBAAsB,KAAK,CAAK,EAAE,GAAG,CAAC,EAAE,OAAO,EAAM,IAAM,EAAI,EAAE,GAAuJ,MAAM,QAAlJ,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAAkI,EAAE,IAAxH,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAAoG,EAAE,IAA1F,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAAsE,EAAE,IAA5D,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,IAAsC,EAAG,CAM1b,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,aAAW,KAAK,WAAS,UAAU,kBAAgB,UAAU,eAAa,EAAE,SAAO,EAAY,EAAaA,MAAY,CAAC,IAAM,EAAO,WAAW,CAAU,EAA4B,OAAvB,MAAM,CAAM,EAAS,EAAS,KAAK,IAAI,EAAE,KAAK,IAAI,IAAI,CAAM,CAAC,CAAE,EAAE,CAAC,CAAU,CAAC,EAAQ,EAAiBA,MAAY,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