{"version":3,"file":"ScrollProgressBar.Cx-o7Qin.mjs","names":[],"sources":["https:/framerusercontent.com/modules/v5MJOY0qNWcRAPBPJIWx/STfoCqqQZMJHDxIuh2QV/ScrollProgressBar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,useSpring,useTransform,useScroll}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 40\n */export default function ScrollProgressBar(props){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const borderRadius=props.radiusIsMixed?`${props.topLeft}px ${props.topRight}px ${props.bottomRight}px ${props.bottomLeft}px`:`${props.radius}px`;const isVertical=props.direction==\"vertical\";const previewScroll=props.previewPercent/100;const{alignment}=props;const gradientScaled=props.fill.gradientScaled;const{scrollYProgress}=useScroll();const scroll=useSpring(scrollYProgress,props.transition);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:props.direction==\"horizontal\"?\"row\":\"column\",justifyContent:alignment,borderRadius:borderRadius,backgroundColor:props.background,overflow:\"hidden\",...props.style},children:/*#__PURE__*/_jsx(motion.div,{initial:false,transition:{type:false},style:{[isVertical?\"width\":\"height\"]:\"100%\",[isVertical?\"height\":\"width\"]:useTransform(()=>`${isCanvas?previewScroll*100:scroll.get()*100}%`),background:useTransform(()=>props.fill.mode==\"color\"?props.fill.color:`linear-gradient(to ${isVertical?\"bottom\":\"right\"}, ${props.fill.startColor} ${gradientScaled?0:alignment==\"center\"?50+-50/(isCanvas?previewScroll:scroll.get()):alignment==\"flex-end\"?-100/(isCanvas?previewScroll:scroll.get())+100:0}%, ${props.fill.endColor} ${gradientScaled?100:alignment==\"center\"?50+50/(isCanvas?previewScroll:scroll.get()):alignment==\"flex-start\"?100/(isCanvas?previewScroll:scroll.get()):100}%)`),borderRadius:props.innerRadius?borderRadius:\"0px\"}})});}ScrollProgressBar.displayName=\"Scroll Progress Bar\";addPropertyControls(ScrollProgressBar,{fill:{type:ControlType.Object,controls:{mode:{type:ControlType.Enum,defaultValue:\"color\",options:[\"color\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],displaySegmentedControl:true},color:{type:ControlType.Color,defaultValue:\"#000\",hidden(props){return props.mode!=\"color\";}},startColor:{type:ControlType.Color,defaultValue:\"#000\",hidden(props){return props.mode!=\"gradient\";}},endColor:{type:ControlType.Color,defaultValue:\"#CCC\",hidden(props){return props.mode!=\"gradient\";}},gradientScaled:{type:ControlType.Boolean,defaultValue:false,title:\"Scaled\"}}},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\"],optionIcons:{direction:{horizontal:[\"align-left\",\"align-center\",\"align-right\"],vertical:[\"align-top\",\"align-middle\",\"align-bottom\"]}},displaySegmentedControl:true},previewPercent:{type:ControlType.Number,defaultValue:75,min:0,max:100,unit:\"%\",title:\"Preview\"},radius:{type:ControlType.FusedNumber,defaultValue:10,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeft\",\"topRight\",\"bottomRight\",\"bottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},innerRadius:{type:ControlType.Boolean,defaultValue:true},transition:{type:ControlType.Transition,defaultValue:{type:false,damping:60,delay:0,duration:.3,mass:1,stiffness:600},description:'Do not use \"Ease\"'}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"40\",\"framerIntrinsicWidth\":\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