{"version":3,"file":"StackOffset.BhTnKNC2.mjs","names":["useRef","useEffect","_jsx","__esmMin","de","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","init_framer_ChujFWHC","RenderTarget","ControlType","StackOffset","props","from","step","style","root","item","el","mates","at","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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