{"version":3,"file":"ProgramProjectsHeader.3HH8sSRZ.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/wG5MalcHFfflejIzdqWh/LRCkecSPwnwXKJaBmzMZ/ProgramProjectsHeader.js"],"sourcesContent":["\"use client\";import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{colors,typography,getSpacing,component}from\"https://framerusercontent.com/modules/HDAkrahb3ethcU2GAef2/nCb5ot8a39Uw7ZcMqia0/tokens.js\";import{useReveal}from\"https://framerusercontent.com/modules/YFy4SNb784n2qKl2hppy/GBtnVzB0BJq3YcX7fdeG/motion.js\";export default function ProgramProjectsHeader({eyebrow=\"Onderdeel van dit programma\",heading=\"Hier werken we aan\",description=\"\",collapseIfEmpty=false,size=\"section\"}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const[w,setW]=useState(9999);useEffect(()=>{const el=ref.current;if(!el)return;const ro=new ResizeObserver(([e])=>setW(e.contentRect.width));ro.observe(el);return()=>ro.disconnect();},[]);// collapseIfEmpty (2026-09-23): for a CMS-filled section (e.g. \"Onderzoek bij dit programma\") placed as\n// [this header, Collection List] inside one wrapper frame. When the list rendered no items for this page, the\n// whole wrapper is hidden, so an empty CMS field leaves no heading behind. Framer can't bind a frame's\n// visibility to a list's item count from outside that list (the DSL errors), hence this read-only DOM check.\n// It only reads siblings and sets one inline style on the wrapper — never reparents (FRAMER_MCP lessons).\nuseEffect(()=>{if(!collapseIfEmpty||isCanvas||typeof window===\"undefined\")return;const own=ref.current?.closest('[class*=\"-container\"]');const list=own?.nextElementSibling;const wrapper=own?.parentElement;if(!own||!list||!wrapper)return;const check=()=>{const hasItems=Array.from(list.children).some(c=>c.offsetHeight>0);if(hasItems)wrapper.style.removeProperty(\"display\");else wrapper.style.setProperty(\"display\",\"none\",\"important\");};check();const mo=new MutationObserver(check);mo.observe(list,{childList:true});return()=>{mo.disconnect();wrapper.style.removeProperty(\"display\");};},[collapseIfEmpty,isCanvas]);const isMobile=w<768;const isTablet=w>=768&&w<1024;const{hPad,headerGap}=getSpacing(w);// Vertical: top padding only — the Collection List below provides its own spacing\nconst padTop=headerGap;// Named size variant (2026-09-23): \"sub\" = h3 scale, for secondary blocks under a section\n// (e.g. \"Onderzoek / Verhalen bij dit programma\"). The tag stays h2; only the scale changes.\nconst scale=size===\"sub\"?isMobile?typography.h3Mobile:typography.h3:isMobile?typography.h2Mobile:typography.h2;const h2Style={fontSize:scale.fontSize,lineHeight:scale.lineHeight,letterSpacing:scale.letterSpacing};// One-time reveal in page order (MOTION_SYSTEM §4.4, motion.tsx useReveal): heading, then description —\n// and the shared queue keeps the Collection List below from arriving before them.\nconst headingRef=useRef(null);const descRef=useRef(null);const headingStyle=useReveal(headingRef);const descStyle=useReveal(descRef);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",backgroundColor:colors.creamWarm,boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(\"div\",{style:{maxWidth:1400,margin:\"0 auto\",padding:`${padTop} ${hPad} 0`,boxSizing:\"border-box\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:16},children:[/*#__PURE__*/_jsx(\"h2\",{ref:headingRef,style:{...headingStyle,fontFamily:scale.fontFamily,fontWeight:scale.fontWeight,...h2Style,color:component.headingOnCream,margin:0},children:heading}),description&&/*#__PURE__*/_jsx(\"p\",{ref:descRef,style:{...descStyle,fontFamily:typography.body.fontFamily,fontWeight:typography.body.fontWeight,fontSize:isMobile?typography.bodyMobile.fontSize:typography.body.fontSize,lineHeight:isMobile?typography.bodyMobile.lineHeight:typography.body.lineHeight,color:colors.slate,margin:0,maxWidth:640},children:description})]})})});}addPropertyControls(ProgramProjectsHeader,{heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"Hier werken we aan\"},description:{type:ControlType.String,title:\"Description\",displayTextArea:true,placeholder:\"Optional short intro line\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"section\",\"sub\"],optionTitles:[\"Section (H2)\",\"Sub-section (H3)\"],defaultValue:\"section\"},collapseIfEmpty:{type:ControlType.Boolean,title:\"Hide if list empty\",defaultValue:false,description:\"Hides the wrapper when the Collection List right after this header has no items (live site only)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgramProjectsHeader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"4SAAmb,SAAwB,EAAsB,CAAC,UAAQ,8BAA8B,UAAQ,qBAAqB,cAAY,GAAG,kBAAgB,GAAM,OAAK,WAAW,CAAC,IAAM,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAIA,EAAO,IAAI,EAAO,CAAC,EAAE,GAAMC,EAAS,IAAI,EAAE,MAAc,CAAC,IAAM,EAAG,EAAI,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAM,EAAG,IAAI,gBAAgB,CAAC,KAAK,EAAK,EAAE,YAAY,KAAK,CAAC,EAAiB,OAAf,EAAG,QAAQ,CAAE,MAAY,EAAG,WAAW,CAAE,EAAE,CAAC,CAAC,EAKx2B,MAAc,CAAC,GAAG,CAAC,GAAiB,GAAiB,IAAS,OAAY,OAAO,IAAM,EAAI,EAAI,SAAS,QAAQ,uBAAuB,EAAQ,EAAK,GAAK,mBAAyB,EAAQ,GAAK,cAAc,GAAG,CAAC,GAAK,CAAC,GAAM,CAAC,EAAQ,OAAO,IAAM,MAAU,CAAgB,MAAM,KAAK,EAAK,QAAQ,CAAC,CAAC,KAAK,GAAG,EAAE,aAAa,CAAa,EAAE,EAAQ,MAAM,eAAe,SAAS,EAAO,EAAQ,MAAM,YAAY,UAAU,OAAO,WAAW,CAAE,EAAE,EAAM,EAAE,IAAM,EAAG,IAAI,iBAAiB,CAAK,EAAoC,OAAlC,EAAG,QAAQ,EAAK,CA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