{"version":3,"file":"HorizontalProgressBar.B2zf_Zb5.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/B2V1jtCrJjS1bUlLjlLd/pqn1JxBPT2JzVpD6PgBA/HorizontalProgressBar.js"],"sourcesContent":["// Horizontal scroll progress bar with customizable color, thickness, and design options\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Scroll Progress Bar\n *\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 10\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function HorizontalProgressBar(props){const{backgroundColor=\"#EEEEEE\",progressColor=\"#000000\",thickness=4,position=\"top\",borderRadius=0,showShadow=false,shadowColor=\"#000000\",opacity=1}=props;const[scrollProgress,setScrollProgress]=useState(0);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const handleScroll=()=>{const scrollableWidth=document.documentElement.scrollWidth-window.innerWidth;const scrolled=window.scrollX;const progress=scrollableWidth>0?scrolled/scrollableWidth*100:0;setScrollProgress(Math.min(100,Math.max(0,progress)));};handleScroll();window.addEventListener(\"scroll\",handleScroll,{passive:true});window.addEventListener(\"resize\",handleScroll,{passive:true});return()=>{window.removeEventListener(\"scroll\",handleScroll);window.removeEventListener(\"resize\",handleScroll);};},[isStatic]);const displayProgress=isStatic?60:scrollProgress;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",[position]:0,left:0,right:0,width:\"100%\",height:`${thickness}px`,backgroundColor,borderRadius:`${borderRadius}px`,overflow:\"hidden\",opacity,boxShadow:showShadow?`0 2px 8px ${shadowColor}33`:\"none\",zIndex:9999},role:\"progressbar\",\"aria-valuenow\":displayProgress,\"aria-valuemin\":0,\"aria-valuemax\":100,\"aria-label\":\"Horizontal scroll progress\",children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,height:\"100%\",width:`${displayProgress}%`,backgroundColor:progressColor,borderRadius:`${borderRadius}px`}})});}addPropertyControls(HorizontalProgressBar,{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#EEEEEE\"},progressColor:{type:ControlType.Color,title:\"Progress Color\",defaultValue:\"#000000\"},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:4,min:1,max:20,step:1,unit:\"px\"},position:{type:ControlType.Enum,title:\"Position\",options:[\"top\",\"bottom\"],optionTitles:[\"Top\",\"Bottom\"],defaultValue:\"top\",displaySegmentedControl:true},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:20,step:1,unit:\"px\"},showShadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},shadowColor:{type:ControlType.Color,title:\"Shadow Color\",defaultValue:\"#000000\",hidden:({showShadow})=>!showShadow},opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:1,min:0,max:1,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HorizontalProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"1200\",\"framerIntrinsicHeight\":\"10\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HorizontalProgressBar.map"],"mappings":"uMASG,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,kBAAgB,UAAU,gBAAc,UAAU,YAAU,EAAE,WAAS,MAAM,eAAa,EAAE,aAAW,GAAM,cAAY,UAAU,UAAQ,GAAG,EAAW,CAAC,EAAe,GAAmBA,EAAS,EAAE,CAAO,EAAS,GAAqB,CAAC,MAAc,CAAC,GAAG,GAAiB,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAgB,SAAS,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