{"version":3,"file":"ProgressBar.BZAzXRup.mjs","names":[],"sources":["https:/framerusercontent.com/modules/jJ1d3Cej594ryy76ch1b/dSoDjECd9dCyaXsBwnzN/ProgressBar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsOnFramerCanvas}from\"framer\";import{useEffect}from\"react\";import{motion,animate,useMotionValue,useTransform,useMotionValueEvent}from\"https://framerusercontent.com/modules/j2h0mtj9J5YgmzJPLhxh/SX5r5WXA4psgt1t6GE1P/libs.js\";// LEGACY MI-MAY 2025\n// Min and Max Property controls has been depreceated. The following function allow a transition period to support user that has been previously using min-max controls\nconst hideRelativeValue=({min,max})=>min===0&&max===100;function supportLegacyMinMaxControls(props){const{value,min,max}=props;if(hideRelativeValue(props)){return value;}else if(value<min){return 0;}else if(value>max){return 100;}else{return 100*(value-min)/(max-min);}}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 40\n * @framerDisableUnlink\n */function ProgressBar(props){const{transition,radius,direction,alignment,innerRadius,background,onAnimationEnd,onProgressCompleted,onAnimationStart}=props;//Support Legacy Controls\nconst value=supportLegacyMinMaxControls(props);const progressFillMode=props.progressFillMode||props.fill.mode;const progressFillColor=props.progressFillColor||props.fill.color;const{startColor,endColor}=props.fill;//COMPONENT COMPUTED VALUES\nconst isVertical=direction===\"vertical\";const gradientTo=isVertical?\"bottom\":\"right\";const flexDirection=isVertical?\"column\":\"row\";const isGradientSet=progressFillMode===\"gradient\";//COMPONENT HOOK\nconst isOnFramerCanvas=useIsOnFramerCanvas();const progress=useMotionValue(value);const percent=useTransform(()=>`${progress.get()}%`);const backgroundImage=useTransform(()=>{const Pt=1e4/progress.get();return`linear-gradient(to ${gradientTo}, ${startColor} 0%, ${endColor} ${Pt}%)`;});//COMPONENT LIFECYLCE\nuseEffect(()=>{if(isOnFramerCanvas){progress.jump(value);}else if(progress.get()!==value){animate(progress,value,transition);}},[isOnFramerCanvas,value,transition,progress]);useMotionValueEvent(progress,\"animationComplete\",()=>{onAnimationEnd?.();progress.get()>=1&&onProgressCompleted?.();});useMotionValueEvent(progress,\"animationStart\",()=>{onAnimationStart?.();});return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,display:\"flex\",flexDirection:flexDirection,justifyContent:alignment,borderRadius:radius,backgroundColor:background,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(motion.div,{style:{width:isVertical?\"100%\":percent,height:isVertical?percent:\"100%\",backgroundColor:!isGradientSet?progressFillColor:\"\",backgroundImage:isGradientSet?backgroundImage:\"\",borderRadius:innerRadius&&radius}})});}addPropertyControls(ProgressBar,{// Events\nonProgressCompleted:{type:ControlType.EventHandler},onAnimationStart:{type:ControlType.EventHandler},onAnimationEnd:{type:ControlType.EventHandler},// Controls\nvalue:{title:\"Progress\",type:ControlType.Number,defaultValue:25,min:0,//max: 100,\nstep:.1,unit:\"%\"},min:{type:ControlType.Number,defaultValue:0,hidden:({min,max})=>hideRelativeValue({min,max})},max:{type:ControlType.Number,defaultValue:100,hidden:({min,max})=>hideRelativeValue({min,max})},progressFillMode:{title:\"Fill\",type:ControlType.Enum,defaultValue:\"color\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],displaySegmentedControl:true},progressFillColor:{title:\"Color\",type:ControlType.Color,defaultValue:\"#6019FA\",hidden:({progressFillMode})=>progressFillMode!==\"solid\"},//progressFillGradient\nfill:{title:\"Gradient\",type:ControlType.Object,controls:{startColor:{type:ControlType.Color,defaultValue:\"#6019FA\"},endColor:{type:ControlType.Color,defaultValue:\"#00CCFF\"}},hidden:({progressFillMode})=>progressFillMode!==\"gradient\"},background:{type:ControlType.Color,defaultValue:\"#EDEDED\",optional:true},direction:{type:ControlType.Enum,defaultValue:\"horizontal\",options:[\"horizontal\",\"vertical\"],displaySegmentedControl:true},alignment:{type:ControlType.Enum,defaultValue:\"flex-start\",options:[\"flex-start\",\"center\",\"flex-end\"],//@ts-ignore //option Icons exist but are not typed\noptionIcons:{direction:{horizontal:[\"align-left\",\"align-center\",\"align-right\"],vertical:[\"align-top\",\"align-middle\",\"align-bottom\"]}},displaySegmentedControl:true},radius:{type:ControlType.BorderRadius,defaultValue:\"10px\"},innerRadius:{type:ControlType.Boolean,defaultValue:true},transition:{type:ControlType.Transition}});/* EXPORT */ProgressBar.displayName=\"Progress Bar\";export default ProgressBar;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"400\",\"framerDisableUnlink\":\"\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"uSAEwD,SAAS,EAA4B,EAAM,CAAC,GAAK,CAAC,QAAM,MAAI,OAAK,EAAkH,OAAzG,EAAkB,CAAK,EAAU,EAAe,EAAM,EAAY,EAAW,EAAM,EAAY,IAAiB,KAAK,EAAM,IAAM,EAAI,EAAM,CAM1Q,SAAS,EAAY,EAAM,CAAC,GAAK,CAAC,aAAW,SAAO,YAAU,YAAU,cAAY,aAAW,iBAAe,sBAAoB,oBAAkB,EACjJ,EAAM,EAA4B,CAAK,EAAQ,EAAiB,EAAM,kBAAkB,EAAM,KAAK,KAAW,EAAkB,EAAM,mBAAmB,EAAM,KAAK,MAAW,CAAC,aAAW,YAAU,EAAM,KAC3M,EAAW,IAAY,WAAiB,EAAW,EAAW,SAAS,QAAc,EAAc,EAAW,SAAS,MAAY,EAAc,IAAmB,WACpK,EAAiB,EAAoB,EAAQ,EAAS,EAAe,CAAK,EAAQ,EAAQ,MAAiB,GAAG,EAAS,IAAI,EAAE,EAAE,EAAQ,EAAgB,MAAiB,CAAC,IAAM,EAAG,IAAI,EAAS,IAAI,EAAE,MAAM,sBAAsB,EAA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