{"version":3,"file":"ScrollToTopFloatingButton.-qLEL5ua.mjs","names":["useState","useEffect","startTransition","useCallback","useMemo","_jsx","_jsxs","__esmMin","pe","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","te","_e","p","c","init_jsx_runtime","ce","addPropertyControls","init_framer_ChujFWHC","useIsStaticRenderer","ControlType","ScrollToTopFloatingButton","props","label","ariaLabel","showAfter","smoothScroll","offsetX","offsetY","size","radius","background","color","border","shadow","font","showChevron","chevronSize","chevronStrokeWidth","style","isStatic","visible","setVisible","update","next","onClick","isFullWidth","isFullHeight","containerStyle","buttonStyle","contentStyle","showText","init_ScrollToTopFloatingButton"],"sources":["https:/framerusercontent.com/modules/XW4IY0lZVvh7GCcVOhaV/R1WmTaODaqtLn825FOPi/ScrollToTopFloatingButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";/**\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 240\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ScrollToTopFloatingButton(props){const{label,ariaLabel,showAfter,smoothScroll,offsetX,offsetY,size,radius,background,color,border,shadow,font,showChevron,chevronSize,chevronStrokeWidth,style}=props;const isStatic=useIsStaticRenderer();const[visible,setVisible]=useState(isStatic);useEffect(()=>{if(isStatic){startTransition(()=>setVisible(true));return;}if(typeof window===\"undefined\")return;const update=()=>{const y=typeof window.scrollY===\"number\"?window.scrollY:typeof window.pageYOffset===\"number\"?window.pageYOffset:0;const next=y>=Math.max(0,showAfter);startTransition(()=>setVisible(next));};update();window.addEventListener(\"scroll\",update,{passive:true});return()=>window.removeEventListener(\"scroll\",update);},[isStatic,showAfter]);const onClick=useCallback(()=>{if(typeof window===\"undefined\")return;try{window.scrollTo({top:0,behavior:smoothScroll?\"smooth\":\"auto\"});}catch(e){// Fallback for older browsers\nwindow.scrollTo(0,0);}},[smoothScroll]);const isFullWidth=style?.width===\"100%\";const isFullHeight=style?.height===\"100%\";const containerStyle=useMemo(()=>({position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",...style||{},// Avoid collapsing when used with auto sizing\n    ...isFullWidth?null:{minWidth:1},...isFullHeight?null:{minHeight:1}}),[style,isFullWidth,isFullHeight]);const buttonStyle=useMemo(()=>({position:\"absolute\",right:offsetX,bottom:offsetY,width:size,height:size,borderRadius:radius,background,color,border,boxShadow:shadow,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,padding:10,cursor:\"pointer\",pointerEvents:\"auto\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",opacity:visible?1:0,transform:visible?\"translateY(0px)\":\"translateY(6px)\",transition:\"opacity 220ms ease, transform 220ms ease\",...font}),[offsetX,offsetY,size,radius,background,color,border,shadow,visible,font]);const contentStyle=useMemo(()=>({display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,whiteSpace:\"nowrap\",lineHeight:1}),[]);const showText=label?.trim().length>0;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,\"aria-hidden\":false,children:/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:onClick,style:buttonStyle,\"aria-label\":ariaLabel,tabIndex:0,children:/*#__PURE__*/_jsxs(\"span\",{style:contentStyle,children:[showChevron&&/*#__PURE__*/_jsx(\"svg\",{width:chevronSize,height:chevronSize,viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",style:{display:\"block\",flex:\"0 0 auto\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 14l6-6 6 6\",stroke:\"currentColor\",strokeWidth:chevronStrokeWidth,strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),showText&&/*#__PURE__*/_jsx(\"span\",{style:{minWidth:\"max-content\",display:\"block\"},children:label})]})})});}addPropertyControls(ScrollToTopFloatingButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"\",placeholder:\"Top\"},ariaLabel:{type:ControlType.String,title:\"ARIA Label\",defaultValue:\"Scroll to top\"},showAfter:{type:ControlType.Number,title:\"Show After\",defaultValue:300,min:0,max:3e3,step:10,unit:\"px\"},smoothScroll:{type:ControlType.Boolean,title:\"Smooth\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},offsetX:{type:ControlType.Number,title:\"Right\",defaultValue:24,min:0,max:200,step:1,unit:\"px\"},offsetY:{type:ControlType.Number,title:\"Bottom\",defaultValue:24,min:0,max:200,step:1,unit:\"px\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:52,min:32,max:120,step:1,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:999,min:0,max:999,step:1,unit:\"px\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},border:{type:ControlType.String,title:\"Border\",defaultValue:\"1px solid rgba(0,0,0,0.12)\"},shadow:{type:ControlType.BoxShadow,title:\"Shadow\",defaultValue:\"0 10px 30px rgba(0,0,0,0.14)\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\",textAlign:\"center\"}},showChevron:{type:ControlType.Boolean,title:\"Chevron\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},chevronSize:{type:ControlType.Number,title:\"Chevron Size\",defaultValue:20,min:10,max:48,step:1,unit:\"px\",hidden:({showChevron})=>!showChevron},chevronStrokeWidth:{type:ControlType.Number,title:\"Chevron Weight\",defaultValue:2.5,min:1,max:6,step:.5,hidden:({showChevron})=>!showChevron}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTopFloatingButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"240\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"240\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopFloatingButton.map"],"mappings":"A,mOAMG,SAAwBuB,EAA0BC,EAAM,CAAC,GAAK,CAACC,QAAMC,YAAUC,YAAUC,eAAaC,UAAQC,UAAQC,OAAKC,SAAOC,aAAWC,QAAMC,SAAOC,SAAOC,OAAKC,cAAYC,cAAYC,qBAAmBC,SAAOjB,EAAYkB,EAASrB,EAAoB,EAAO,CAACsB,EAAQC,GAAY5C,EAAS0C,CAAQ,EAAEzC,MAAc,CAAC,GAAGyC,EAAS,CAACxC,MAAoB0C,EAAW,EAAI,CAAC,EAAE,MAAO,CAAC,GAAUhC,IAAS,OAAY,OAAO,IAAMiC,MAAW,CAAmH,IAAMC,GAAhH,OAAOlC,EAAO,SAAU,SAASA,EAAO,QAAQ,OAAOA,EAAO,aAAc,SAASA,EAAO,YAAY,IAAgB,KAAK,IAAI,EAAEe,CAAS,EAAEzB,MAAoB0C,EAAWE,CAAI,CAAC,CAAE,EAAmE,OAAjED,EAAO,EAAEjC,EAAO,iBAAiB,SAASiC,EAAO,CAAC,QAAQ,EAAI,CAAC,MAAYjC,EAAO,oBAAoB,SAASiC,CAAM,CAAE,EAAE,CAACH,EAASf,CAAS,CAAC,EAAE,IAAMoB,EAAQ5C,MAAgB,CAAC,GAAUS,IAAS,OAAmB,GAAG,CAACA,EAAO,SAAS,CAAC,IAAI,EAAE,SAASgB,EAAa,SAAS,MAAM,CAAC,CAAE,MAAS,CACn5BhB,EAAO,SAAS,EAAE,CAAC,CAAE,CAAC,EAAE,CAACgB,CAAY,CAAC,EAAQoB,EAAYP,GAAO,QAAQ,OAAaQ,EAAaR,GAAO,SAAS,OAAaS,EAAe9C,OAAa,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,cAAc,OAAO,GAAGqC,GAAO,CAAC,E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