{"version":3,"file":"ScrollProgressBar.OFIn8VTR.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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