{"version":3,"file":"CustomScrollbar_2.DtxPhDVC.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/s129dSc4nXoIltiECLfN/wBJeZ6Y7fDNju6Mfpcg7/CustomScrollbar_2.js"],"sourcesContent":["// Custom scrollbar component with editable track color, thumb color, size, and border radius\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 300\n */export default function CustomScrollbar(props){const{trackColor,thumbColor,scrollbarSize,borderRadius,trackStyle,autoHide,autoHideDelay,thumbStyle,thumbGradientStart,thumbGradientEnd}=props;const[isVisible,setIsVisible]=useState(true);useEffect(()=>{// Only apply scrollbar styles in preview/export, not in canvas\nif(typeof window===\"undefined\"||RenderTarget.current()===RenderTarget.canvas)return;const style=document.createElement(\"style\");style.setAttribute(\"data-custom-scrollbar\",\"true\");const trackBackground=trackStyle===\"transparent\"?\"transparent\":trackColor;const thumbBackground=thumbStyle===\"gradient\"?`linear-gradient(180deg, ${thumbGradientStart}, ${thumbGradientEnd})`:thumbColor;style.textContent=`\n            body::-webkit-scrollbar {\n                width: ${scrollbarSize}px;\n                transition: width 2s ease;\n            }\n\n            body::-webkit-scrollbar-track {\n                background: ${trackBackground};\n                border-radius: ${borderRadius}px;\n            }\n\n            body::-webkit-scrollbar-thumb {\n                background: ${thumbBackground};\n                border-radius: ${borderRadius}px;\n            }\n\n            @supports not selector(::-webkit-scrollbar) {\n                body {\n                    scrollbar-color: ${thumbStyle===\"gradient\"?thumbGradientStart:thumbColor} ${trackBackground};\n                    scrollbar-width: auto;\n                }\n            }\n        `;document.head.appendChild(style);let scrollTimeout;const handleScroll=()=>{// Remove existing scrollbar style\nconst existingScrollbarStyle=document.getElementById(\"dynamic-scrollbar-width\");if(existingScrollbarStyle){existingScrollbarStyle.remove();}// Show scrollbar\nconst showStyle=document.createElement(\"style\");showStyle.id=\"dynamic-scrollbar-width\";showStyle.textContent=`\n                body::-webkit-scrollbar {\n                    width: ${scrollbarSize}px !important;\n                }\n            `;document.head.appendChild(showStyle);clearTimeout(scrollTimeout);scrollTimeout=window.setTimeout(()=>{const hideStyle=document.createElement(\"style\");hideStyle.id=\"dynamic-scrollbar-width\";const existingStyle=document.getElementById(\"dynamic-scrollbar-width\");if(existingStyle){existingStyle.remove();}hideStyle.textContent=`\n                    body::-webkit-scrollbar {\n                        width: 0px !important;\n                    }\n                `;document.head.appendChild(hideStyle);},autoHideDelay*1e3);};if(autoHide){window.addEventListener(\"scroll\",handleScroll);// Set initial timeout to hide scrollbar\nscrollTimeout=window.setTimeout(()=>{const hideStyle=document.createElement(\"style\");hideStyle.id=\"dynamic-scrollbar-width\";hideStyle.textContent=`\n                    body::-webkit-scrollbar {\n                        width: 0px !important;\n                    }\n                `;document.head.appendChild(hideStyle);},autoHideDelay*1e3);}return()=>{if(style&&style.parentNode){style.parentNode.removeChild(style);}const dynamicStyle=document.getElementById(\"dynamic-scrollbar-width\");if(dynamicStyle&&dynamicStyle.parentNode){dynamicStyle.parentNode.removeChild(dynamicStyle);}if(autoHide){window.removeEventListener(\"scroll\",handleScroll);clearTimeout(scrollTimeout);}};},[trackColor,thumbColor,scrollbarSize,borderRadius,trackStyle,autoHide,autoHideDelay,thumbStyle,thumbGradientStart,thumbGradientEnd]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:\"100px\",height:\"100px\",zIndex:-10,opacity:0,pointerEvents:\"none\"}});}addPropertyControls(CustomScrollbar,{thumbStyle:{type:ControlType.Enum,title:\"Thumb Style\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],defaultValue:\"solid\",displaySegmentedControl:true},thumbColor:{type:ControlType.Color,title:\"Thumb Color\",defaultValue:\"#6BAF8D\",hidden:({thumbStyle})=>thumbStyle===\"gradient\"},thumbGradientStart:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#6BAF8D\",hidden:({thumbStyle})=>thumbStyle===\"solid\"},thumbGradientEnd:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#4A9D7E\",hidden:({thumbStyle})=>thumbStyle===\"solid\"},trackStyle:{type:ControlType.Enum,title:\"Track Style\",options:[\"transparent\",\"colored\"],optionTitles:[\"Transparent\",\"Colored\"],defaultValue:\"transparent\",displaySegmentedControl:true},trackColor:{type:ControlType.Color,title:\"Track Color\",defaultValue:\"#F5F5F5\",hidden:({trackStyle})=>trackStyle===\"transparent\"},scrollbarSize:{type:ControlType.Number,title:\"Size\",defaultValue:14,min:4,max:30,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:3,min:0,max:20,step:1,unit:\"px\"},autoHide:{type:ControlType.Boolean,title:\"Auto Hide\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},autoHideDelay:{type:ControlType.Number,title:\"Auto Hide Delay\",defaultValue:2,min:0,max:10,step:.5,unit:\"s\",hidden:({autoHide})=>!autoHide}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomScrollbar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"300\",\"framerIntrinsicWidth\":\"300\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomScrollbar_2.map"],"mappings":"kMAMG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,aAAW,aAAW,gBAAc,eAAa,aAAW,WAAS,gBAAc,aAAW,qBAAmB,oBAAkB,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAK,CAsCoT,OAtCnT,MAAc,CAC5P,GAAU,IAAS,QAAa,EAAa,SAAS,GAAG,EAAa,OAAO,OAAO,IAAM,E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