{"version":3,"file":"StackOffset.CdHfJiG_.mjs","names":["useRef","__esmMin","de","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","init_framer_BpuvUAiZ","RenderTarget","ControlType","StackOffset","props","root","item","el","mates","at","from","step","style","init_StackOffset"],"sources":["https:/framerusercontent.com/modules/X7YZwyxRAmOE9w4FjN0y/WryWhBrFNleNK6f3Idub/StackOffset.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 1\n * @framerIntrinsicHeight 1\n */export default function StackOffset(props){const{from,step,style}=props;const root=useRef(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;let item=root.current;while(item&&getComputedStyle(item).position!==\"sticky\")item=item.parentElement;if(!item||!item.parentElement)return;const el=item;const mates=Array.from(item.parentElement.children).filter(c=>getComputedStyle(c).position===\"sticky\");const at=Math.max(0,mates.indexOf(el));el.style.top=`${from+at*step}px`;// margins cancel out in the layout, but keep the stacked edges together as the list scrolls away\nel.style.marginBottom=`${(mates.length-1-at)*step}px`;el.style.marginTop=at?`${-(mates.length-at)*step}px`:\"\";return()=>{el.style.top=el.style.marginBottom=el.style.marginTop=\"\";};},[from,step]);return /*#__PURE__*/_jsx(\"div\",{ref:root,\"aria-hidden\":true,style:{...style,width:1,height:1,pointerEvents:\"none\"}});}StackOffset.defaultProps={from:84,step:8};addPropertyControls(StackOffset,{from:{type:ControlType.Number,title:\"Top\",min:0,max:300,unit:\"px\",defaultValue:84},step:{type:ControlType.Number,title:\"Peek\",min:0,max:40,unit:\"px\",defaultValue:8}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StackOffset\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\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