{"version":3,"file":"Custom_scrollbar.D52MOOG-.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/4glTZ9FrvbfMkt2srp5I/OWKmN71HCysGLI7ekQcg/Custom_scrollbar.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// @framerDisableUnlink\nexport default function CustomScrollBar(props){const{color,trackColor,enabled}=props;const[isScrolling,setIsScrolling]=React.useState(false);React.useEffect(()=>{let scrollTimeout;const onScroll=()=>{setIsScrolling(true);clearTimeout(scrollTimeout);scrollTimeout=setTimeout(()=>{setIsScrolling(false);},1e3);};document.addEventListener(\"scroll\",onScroll);return()=>{clearTimeout(scrollTimeout);document.removeEventListener(\"scroll\",onScroll);};},[]);const enableScrollbar=enabled?`\n        ::-webkit-scrollbar {\n          width: 8px;\n        }\n        ::-webkit-scrollbar-track {\n          background: ${isScrolling?trackColor:\"transparent\"};\n          transition: background 0.5s ease; /* Attempt to soften the appearance/disappearance */\n        }\n        ::-webkit-scrollbar-thumb {\n          background: ${isScrolling?color:\"transparent\"};\n          border-radius: 4px;\n          transition: background 0.5s ease; /* Soften the thumb appearance/disappearance */\n        }\n        ::-webkit-scrollbar-thumb:hover {\n          background: ${color};\n        }\n      `:`\n        ::-webkit-scrollbar {\n          display: none;\n        }\n      `;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"auto\"},children:[/*#__PURE__*/_jsx(\"style\",{children:enableScrollbar}),/*#__PURE__*/_jsx(\"div\",{style:{height:\"200%\"}})]});}CustomScrollBar.defaultProps={color:\"#FF00FF\",trackColor:\"#f1f1f1\",enabled:true};addPropertyControls(CustomScrollBar,{color:{type:ControlType.Color,title:\"Thumb Color\"},trackColor:{type:ControlType.Color,title:\"Track Color\"},enabled:{type:ControlType.Boolean,title:\"Enable Scroll\",enabledTitle:\"Yes\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomScrollBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Custom_scrollbar.map"],"mappings":"mLACA,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,aAAW,WAAS,EAAW,CAAC,EAAY,GAAgBA,EAAe,GAAM,CAoBpI,OApBqI,MAAoB,CAAC,IAAI,EAAoB,MAAa,CAAC,EAAe,GAAK,CAAC,aAAa,EAAc,CAAC,EAAc,eAAe,CAAC,EAAe,GAAM,EAAG,IAAI,EAAgD,OAA7C,SAAS,iBAAiB,SAAS,EAAS,KAAW,CAAC,aAAa,EAAc,CAAC,SAAS,oBAAoB,SAAS,EAAS,GAAK,EAAE,CAAC,CAoBra,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,OAAO,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SApBuV,EAAQ;;;;;wBAKxc,EAAY,EAAW,cAAc;;;;wBAIrC,EAAY,EAAM,cAAc;;;;;wBAKhC,EAAM;;QAEtB;;;;QAIkJ,CAAC,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,kBArBtJ,IAA4B,IAAoD,CAqBwE,EAAgB,aAAa,CAAC,MAAM,UAAU,WAAW,UAAU,QAAQ,GAAK,CAAC,EAAoB,EAAgB,CAAC,MAAM,CAAC,KAAK,EAAY,MAAM,MAAM,cAAc,CAAC,WAAW,CAAC,KAAK,EAAY,MAAM,MAAM,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAY,QAAQ,MAAM,gBAAgB,aAAa,MAAM,cAAc,KAAK,CAAC,CAAC"}