{"version":3,"file":"ProgramProjectsHeader.BSxXUgev.mjs","names":["useRef","useState","__esmMin","init_ssg_sandbox_shims","window","_e","de","init_jsx_runtime","c","p","init_npm_react_18_3_1","ce","init_framer_DJ_0WPVq","addPropertyControls","ControlType","RenderTarget","surfaceInk","typography","getSpacing","init_tokens","init_motion","toneControl","init_Section","useReveal","renderInline","init_inlineLinks","ProgramProjectsHeader","isCanvas","ref","w","setW","el","ro","collapseIfEmpty","own","list","wrapper","check","mo","bare","inset","isMobile","ink","tone","padTop","topSpace","headerGap","size","guideGap","vPad","scale","h2Style","headingRef","descRef","headingStyle","descStyle","hPad","heading","description","init_ProgramProjectsHeader"],"sources":["https:/framerusercontent.com/modules/wG5MalcHFfflejIzdqWh/FEf4YwgWPW2mDnOZXaaQ/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{typography,getSpacing,surfaceInk}from\"https://framerusercontent.com/modules/HDAkrahb3ethcU2GAef2/DkF8oqFSecx6ZaRXcaSg/tokens.js\";import{useReveal}from\"https://framerusercontent.com/modules/YFy4SNb784n2qKl2hppy/colxGJTFY3MkaqyjCjL8/motion.js\";import{renderInline}from\"https://framerusercontent.com/modules/tXSwCsyVq6z0PAi6yLBQ/T4Se4dwGJk5SwKiPbiVp/inlineLinks.js\";import{toneControl}from\"https://framerusercontent.com/modules/QAOPTtLoApnb5MkIYZk8/dc3QSbcDf1WpIWW4hTIx/Section.js\";export default function ProgramProjectsHeader({eyebrow=\"Onderdeel van dit programma\",heading=\"Hier werken we aan\",description=\"\",collapseIfEmpty=false,size=\"section\",tone=\"surface\",topSpace=\"join\",inset=\"page\"}){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. \"Events 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=()=>{wrapper.style.removeProperty(\"display\")// a hidden wrapper measures 0, so show it first; no paint happens in between\n;const hasItems=Array.from(list.children).some(c=>c.offsetHeight>0);if(!hasItems)wrapper.style.setProperty(\"display\",\"none\",\"important\");};check();const mo=new MutationObserver(check);// subtree + style: EventRow's Show control hides rows after this check has run (2026-11-05)\nmo.observe(list,{childList:true,subtree:true,attributes:true,attributeFilter:[\"style\"]});return()=>{mo.disconnect();wrapper.style.removeProperty(\"display\");};},[collapseIfEmpty,isCanvas]);// Side padding \"None\" (2026-11-05): inside a native column, which is narrower than any phone rule. The tag and the scale stay.\nconst bare=inset===\"none\";const isMobile=!bare&&w<768;const{hPad,vPad,headerGap,guideGap}=getSpacing(w);const ink=surfaceInk(tone);// Vertical: top padding only — the Collection List below provides its own spacing\n// Top space \"Section\" (2026-11-04): a block on a detail page that starts something new, one section padding under the\n// block above, so its heading doesn't sit as close to the previous list as to its own (user: \"cropped\").\n// A guiding heading on cream takes the smaller guideGap (2026-11-06); a coloured band keeps the section padding.\nconst padTop=tone!==\"surface\"?vPad:topSpace===\"join\"?headerGap:size===\"sub\"?guideGap:vPad;// Named size variant: \"sub\" = the guiding heading of a CMS detail page (2026-11-04, user: every \"Andere artikelen\" or\n// \"Gerelateerd onderzoek\" looks the same, much smaller than the main headings). The tag stays h2; only the scale changes.\nconst scale=size===\"sub\"?isMobile?typography.guideMobile:typography.guide: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:ink.bg,boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(\"div\",{style:{maxWidth:1400,margin:\"0 auto\",padding:bare?0:`${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:ink.heading,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:ink.text,margin:0,maxWidth:640},children:renderInline(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\",description:\"A link: [text](https://example.com)\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"section\",\"sub\"],optionTitles:[\"Section (H2)\",\"Guiding heading\"],defaultValue:\"section\"},tone:toneControl(\"surface\"),topSpace:{type:ControlType.Enum,title:\"Top space\",options:[\"join\",\"section\"],optionTitles:[\"Join (header gap)\",\"Section (full padding)\"],defaultValue:\"join\",description:\"Section: a new block on a detail page. Join: continues the block above.\"},inset:{type:ControlType.Enum,title:\"Side padding\",options:[\"page\",\"none\"],optionTitles:[\"Page\",\"None\"],defaultValue:\"page\",description:\"None: inside a native column, with no padding of its own.\"},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":"A,0WAA0pB,SAAwB0B,EAAsB,CAAC,UAAQ,8BAA8B,UAAQ,qBAAqB,cAAY,GAAG,kBAAgB,GAAM,OAAK,UAAU,OAAK,UAAU,WAAS,OAAO,QAAM,QAAQ,CAAC,IAAMC,EAASZ,EAAa,QAAQ,IAAIA,EAAa,OAAaa,EAAI5B,EAAO,IAAI,EAAO,CAAC6B,EAAEC,GAAM7B,EAAS,IAAI,EAAEU,MAAc,CAAC,IAAMoB,EAAGH,EAAI,QAAQ,GAAG,CAACG,EAAG,OAAO,IAAMC,EAAG,IAAI,gBAAgB,CAAC,KAAKF,EAAK,EAAE,YAAY,KAAK,CAAC,EAAiB,OAAfE,EAAG,QAAQD,CAAE,MAAYC,EAAG,WAAW,CAAE,EAAE,CAAC,CAAC,EAK3nCrB,MAAc,CAAC,GAAG,CAACsB,GAAiBN,GAAiBvB,IAAS,OAAY,OAAO,IAAM8B,EAAIN,EAAI,SAAS,QAAQ,uBAAuB,EAAQO,EAAKD,GAAK,mBAAyBE,EAAQF,GAAK,cAAc,GAAG,CAACA,GAAK,CAACC,GAAM,CAACC,EAAQ,OAAO,IAAMC,MAAU,CAACD,EAAQ,MAAM,eAAe,SAAS,EACpR,MAAM,KAAKD,EAAK,QAAQ,CAAC,CAAC,KAAK,GAAG3B,EAAE,aAAa,CAAc,GAAE4B,EAAQ,MAAM,YAAY,UAAU,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