{"version":3,"file":"ListLoadMore.Eu_5ILPd.mjs","names":["useState","useRef","__esmMin","_e","de","init_jsx_runtime","c","p","init_npm_react_18_3_1","ce","init_framer_BWFVvmND","addPropertyControls","ControlType","RenderTarget","useCardInteraction","surfaceInk","focusCss","typography","init_tokens","revealIn","stagger","space","init_motion","toneControl","init_Section","useReveal","easeCss","dur","prefersReducedMotion","ListLoadMore","sel","listName","ink","tone","isCanvas","shown","setShown","initial","prev","setPrev","total","setTotal","reduced","setReduced","ref","buttonRef","hover","buttonReveal","revealNext","list","count","mo","countVisible","busy","apply","kids","k","visible","a","b","i","next","clicked","more","firstNew","step","target","reveal","css","done","gone","setGone","t","leaving","handlers","label","init_ListLoadMore"],"sources":["https:/framerusercontent.com/modules/ePqoK4BrawNXLLzfQuph/Y7Q2v4AyQnzDnpvhkd6u/ListLoadMore.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{typography,space,surfaceInk,focusCss}from\"https://framerusercontent.com/modules/HDAkrahb3ethcU2GAef2/Qzi5WwAqTpY4UXfR17L7/tokens.js\";import{toneControl}from\"https://framerusercontent.com/modules/QAOPTtLoApnb5MkIYZk8/nkzmSiXF9iOrfz9rOGTJ/Section.js\";import{dur,easeCss,stagger,prefersReducedMotion,useCardInteraction,revealIn,useReveal}from\"https://framerusercontent.com/modules/YFy4SNb784n2qKl2hppy/colxGJTFY3MkaqyjCjL8/motion.js\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ListLoadMore({listName=\"Press list\",initial=4,step=4,label=\"Meer laden\",tone=\"surface\",countVisible=false}){const name=listName.replace(/\"/g,\"\");const sel=`[data-framer-name=\"${name}\"]`;const ink=surfaceInk(tone);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[shown,setShown]=useState(initial);const[prev,setPrev]=useState(initial);const[total,setTotal]=useState(null);const[reduced,setReduced]=useState(false);const ref=useRef(null);// Hover colour for mouse/pen only (a tap left it stuck on phones) and for keyboard focus\nconst buttonRef=useRef(null);const{active:hover,handlers}=useCardInteraction(buttonRef);// Entrance: one-time reveal in page order (MOTION_SYSTEM §4.4), after the list above it; the button's\n// hover colour transition rides along. Items shown after a click keep their own rise (revealIn / wofLmIn).\nconst buttonReveal=useReveal(buttonRef,`color ${dur.micro}s ${easeCss.spring}`);const revealNext=useRef([])// countVisible: items hidden before the click\n;useEffect(()=>{setReduced(prefersReducedMotion());const list=document.querySelector(sel);if(!list)return;const count=()=>setTotal(list.children.length);count();const mo=new MutationObserver(count)// CMS lists can re-render their children\n;mo.observe(list,{childList:true});return()=>mo.disconnect();},[sel]);// countVisible: mark items past `shown` among the visible ones; re-run when an item hides/shows itself\nuseEffect(()=>{if(!countVisible||isCanvas)return;const list=document.querySelector(sel);if(!list)return;let busy=false;const apply=()=>{if(busy)return;busy=true;const kids=Array.from(list.children);kids.forEach(k=>k.removeAttribute(\"data-wof-lm-off\"));// In display order: items can be reordered with CSS `order` (eventWindow.tsx usePastLast)\nconst visible=kids.filter(k=>k.style.display!==\"none\"&&getComputedStyle(k).display!==\"none\"&&!k.querySelector(\"[data-wof-lm-skip]\")).map((k,i)=>({k,i,o:Number(getComputedStyle(k).order)||0})).sort((a,b)=>a.o-b.o||a.i-b.i).map(({k})=>k);visible.forEach((k,i)=>{if(i>=shown)k.setAttribute(\"data-wof-lm-off\",\"\");});setTotal(visible.length);// After a click: the items that just became visible rise in, one stagger step each\nconst next=revealNext.current.filter(k=>!k.hasAttribute(\"data-wof-lm-off\"));revealNext.current=[];if(!reduced)next.forEach((k,i)=>revealIn(k,i));busy=false;};apply();const mo=new MutationObserver(()=>requestAnimationFrame(apply));mo.observe(list,{childList:true,subtree:true,attributes:true,attributeFilter:[\"style\"]});return()=>{mo.disconnect();Array.from(list.children).forEach(k=>k.removeAttribute(\"data-wof-lm-off\"));};},[countVisible,sel,shown,isCanvas,reduced]);const clicked=useRef(false);const more=()=>{const list=document.querySelector(sel);if(countVisible){revealNext.current=list?Array.from(list.querySelectorAll(\":scope > [data-wof-lm-off]\")):[];}// The last click removes the button, which dropped keyboard focus to <body> (2026-10-08): hand it to the\n// first newly shown item instead (its link, so the card shows its focus state). No scroll — it's right above.\nconst firstNew=countVisible?revealNext.current[0]:(list?.children[shown]);const lastClick=total!==null&&shown+step>=total;if(lastClick&&firstNew&&document.activeElement===buttonRef.current){requestAnimationFrame(()=>{const target=firstNew.querySelector(\"a[href], button, [tabindex]:not([tabindex='-1'])\")||firstNew;if(target===firstNew&&!firstNew.hasAttribute(\"tabindex\"))firstNew.tabIndex=-1;target.focus({preventScroll:true});});}clicked.current=true;setPrev(shown);setShown(shown+step);};// Newly revealed items: nth-child(prev+1 … shown), one rule each for the stagger delay.\nconst animate=!reduced&&!isCanvas&&shown>prev;const reveal=animate?Array.from({length:shown-prev},(_,i)=>`${sel} > *:nth-child(${prev+1+i}){animation:wofLmIn ${dur.medium}s ${easeCss.primary} ${(i*stagger.item).toFixed(2)}s both}`).join(\"\"):\"\";const css=(countVisible?`${sel} > [data-wof-lm-off]{display:none !important}`:`${sel} > *:nth-child(n+${shown+1}){display:none !important}`)+(countVisible?\"\":reveal)+`@keyframes wofLmIn{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}`+focusCss(\".wof-lm\",\"link\",tone);const done=total!==null&&shown>=total;// Done after a click: the button fades out (dur.short, ease.inOut) before it unmounts, instead of vanishing\n// (2026-10-08). A list that is short from the start never shows it at all.\nconst[gone,setGone]=useState(false);useEffect(()=>{if(!done){setGone(false);return;}if(!clicked.current||reduced||isCanvas){setGone(true);return;}const t=setTimeout(()=>setGone(true),dur.short*1e3);return()=>clearTimeout(t);},[done,reduced,isCanvas]);const leaving=done?{opacity:0,pointerEvents:\"none\",transition:`opacity ${dur.short}s ${easeCss.inOut}`}:{};return(// Space above (2026-09-25): the Press timeline line runs through each row's bottom padding and touched the label\n/*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{width:\"100%\",paddingTop:space.gapLarge,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),!gone&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",ref:buttonRef,className:\"wof-lm\",onClick:more,...handlers,style:{...typography.label,// Hidden (space kept) until the item count is known, so it never flashes on a short list\nvisibility:total===null?\"hidden\":\"visible\",background:\"none\",border:\"none\",padding:0,cursor:\"pointer\",color:hover?ink.linkHover:ink.text,textDecoration:\"underline\",textUnderlineOffset:\"0.25em\",...buttonReveal,...leaving},children:label})]}));}addPropertyControls(ListLoadMore,{listName:{type:ControlType.String,title:\"List layer name\",defaultValue:\"Press list\",description:\"Exact layer name of the Collection List frame (must be unique on the page)\"},initial:{type:ControlType.Number,title:\"Show first\",defaultValue:4,min:1,step:1,displayStepper:true},step:{type:ControlType.Number,title:\"Load per click\",defaultValue:4,min:1,step:1,displayStepper:true},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Meer laden\"},tone:toneControl(\"surface\"),countVisible:{type:ControlType.Boolean,title:\"Count visible only\",defaultValue:false,description:\"For lists whose items hide themselves (events: Show = Past/Upcoming)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ListLoadMore\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,uVAGG,SAAwB6B,EAAa,CAAC,WAAS,aAAa,UAAQ,EAAE,OAAK,EAAE,QAAM,aAAa,OAAK,UAAU,eAAa,IAAO,CAAsC,IAAMC,EAAI,sBAApCC,EAAS,QAAQ,KAAK,EAAuC,EAAE,IAAUC,EAAIjB,EAAWkB,CAAI,EAAQC,EAASrB,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACsB,EAAMC,GAAUpC,EAASqC,CAAO,EAAO,CAACC,EAA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