{"version":3,"file":"PhotoRow.JULwbeJb.mjs","names":["useRef","useState","useCallback","__esmMin","init_npm_react_18_3_1","ne","_e","p","c","init_jsx_runtime","ce","de","init_framer_CaDWdxiz","addPropertyControls","ControlType","PhotoRow","props","scrollRef","edges","setEdges","drag","dragging","setDragging","updateEdges","el","max","ro","items","onPointerDown","onPointerMove","d","dx","endDrag","onKeyDown","step","fadeL","edgeFade","fadeWidth","fadeR","mask","style","bleed","captionGap","item","photoHeight","radius","placeholder","monoFont","captionColor","i","gap","init_PhotoRow"],"sources":["https:/framerusercontent.com/modules/TT9rxG1tFWDSc7zsy7VE/SPploHnjCAb42wcnOqgG/PhotoRow.js"],"sourcesContent":["// Photo Row: a horizontal, drag-to-scroll strip of captioned photos.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,useRef,useCallback}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1120\n */export default function PhotoRow(props){const{items=[],photoHeight=360,gap=16,radius=12,captionGap=10,edgeFade=true,fadeWidth=48,monoFont,captionColor=\"#7A7A7A\",placeholder=\"#E8E4DC\",bleed=0,style}=props;const scrollRef=useRef(null);const[edges,setEdges]=useState({start:true,end:false});const drag=useRef({active:false,moved:false,x:0,left:0,id:-1});const[dragging,setDragging]=useState(false);const updateEdges=useCallback(()=>{const el=scrollRef.current;if(!el)return;const max=el.scrollWidth-el.clientWidth;setEdges({start:el.scrollLeft<=2,end:el.scrollLeft>=max-2});},[]);useEffect(()=>{const el=scrollRef.current;if(!el)return;updateEdges();if(typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(updateEdges);ro.observe(el);return()=>ro.disconnect();},[updateEdges,items.length]);// Mouse drag only; touch and trackpads use native scrolling.\nconst onPointerDown=e=>{if(e.pointerType!==\"mouse\"||e.button!==0)return;const el=scrollRef.current;if(!el)return;drag.current={active:true,moved:false,x:e.clientX,left:el.scrollLeft,id:e.pointerId};};const onPointerMove=e=>{const d=drag.current;if(!d.active)return;const dx=e.clientX-d.x;if(!d.moved&&Math.abs(dx)>4){d.moved=true;setDragging(true);scrollRef.current?.setPointerCapture?.(d.id);}if(d.moved&&scrollRef.current)scrollRef.current.scrollLeft=d.left-dx;};const endDrag=()=>{if(!drag.current.active)return;const el=scrollRef.current;if(el&&drag.current.moved)el.releasePointerCapture?.(drag.current.id);drag.current.active=false;setDragging(false);};const onKeyDown=e=>{const el=scrollRef.current;if(!el)return;const step=Math.max(200,el.clientWidth*.6);if(e.key===\"ArrowRight\"){el.scrollBy({left:step,behavior:\"smooth\"});e.preventDefault();}if(e.key===\"ArrowLeft\"){el.scrollBy({left:-step,behavior:\"smooth\"});e.preventDefault();}};const fadeL=edgeFade&&!edges.start?fadeWidth:0;const fadeR=edgeFade&&!edges.end?fadeWidth:0;const mask=edgeFade?`linear-gradient(90deg, transparent 0px, #000 ${fadeL}px, #000 calc(100% - ${fadeR}px), transparent 100%)`:undefined;return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:bleed?`calc(100% + ${bleed*2}px)`:\"100%\",marginLeft:-bleed,marginRight:-bleed},children:[/*#__PURE__*/_jsx(\"style\",{children:`.photo-row-scroll::-webkit-scrollbar{display:none}`}),/*#__PURE__*/_jsxs(\"div\",{ref:scrollRef,className:\"photo-row-scroll\",role:\"region\",\"aria-label\":\"Photos\",tabIndex:0,onScroll:updateEdges,onKeyDown:onKeyDown,onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:endDrag,onPointerCancel:endDrag,onLostPointerCapture:endDrag,style:{display:\"flex\",gap,overflowX:\"auto\",overflowY:\"hidden\",scrollbarWidth:\"none\",overscrollBehaviorX:\"contain\",cursor:dragging?\"grabbing\":\"grab\",userSelect:\"none\",WebkitMaskImage:mask,maskImage:mask,outline:\"none\",paddingLeft:bleed},children:[items.map((item,i)=>/*#__PURE__*/_jsxs(\"figure\",{style:{margin:0,flex:\"0 0 auto\",display:\"flex\",flexDirection:\"column\",gap:captionGap},children:[item?.image?.src?/*#__PURE__*/_jsx(\"img\",{src:item.image.src,srcSet:item.image.srcSet,alt:item.image.alt||item.caption||\"\",loading:\"lazy\",draggable:false,style:{display:\"block\",height:photoHeight,width:\"auto\",borderRadius:radius,background:placeholder,pointerEvents:\"none\"}}):/*#__PURE__*/_jsx(\"div\",{style:{height:photoHeight,width:photoHeight*.75,borderRadius:radius,background:placeholder}}),item?.caption?/*#__PURE__*/_jsx(\"figcaption\",{style:{fontSize:11,letterSpacing:\"0.04em\",textTransform:\"uppercase\",...monoFont,lineHeight:1.35,color:captionColor,width:0,minWidth:\"100%\",overflowWrap:\"break-word\"},children:item.caption}):null]},i)),bleed>gap?/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{flex:`0 0 ${bleed-gap}px`}}):null]})]});}PhotoRow.displayName=\"Photo Row\";addPropertyControls(PhotoRow,{items:{type:ControlType.Array,title:\"Photos\",control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Image\"},caption:{type:ControlType.String,title:\"Caption\"}}}},photoHeight:{type:ControlType.Number,title:\"Photo Height\",min:120,max:800,step:10,defaultValue:360,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",min:0,max:80,defaultValue:16,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:40,defaultValue:12,unit:\"px\"},captionGap:{type:ControlType.Number,title:\"Caption Gap\",min:0,max:40,defaultValue:10,unit:\"px\"},edgeFade:{type:ControlType.Boolean,title:\"Edge Fade\",defaultValue:true},fadeWidth:{type:ControlType.Number,title:\"Fade W\",min:0,max:200,defaultValue:48,unit:\"px\",hidden:p=>!p.edgeFade},monoFont:{type:ControlType.Font,title:\"Mono Font\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:11}},captionColor:{type:ControlType.Color,title:\"Caption\",defaultValue:\"#7A7A7A\"},placeholder:{type:ControlType.Color,title:\"Placeholder\",defaultValue:\"#E8E4DC\"},bleed:{type:ControlType.Number,title:\"Bleed\",min:0,max:120,defaultValue:0,unit:\"px\",description:\"Extends the row past its container on both sides; the first photo stays aligned.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PhotoRow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"1120\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PhotoRow.map"],"mappings":"A,sMAKG,SAAwBe,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,EAAE,cAAY,IAAI,MAAI,GAAG,SAAO,GAAG,aAAW,GAAG,WAAS,GAAK,YAAU,GAAG,WAAS,eAAa,UAAU,cAAY,UAAU,QAAM,EAAE,SAAOC,EAAYC,EAAUjB,EAAO,IAAI,EAAO,CAACkB,EAAMC,GAAUlB,EAAS,CAAC,MAAM,GAAK,IAAI,EAAK,CAAC,EAAQmB,EAAKpB,EAAO,CAAC,OAAO,GAAM,MAAM,GAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAO,CAACqB,EAASC,GAAarB,EAAS,EAAK,EAAQsB,EAAYrB,MAAgB,CAAC,IAAMsB,EAAGP,EAAU,QAAQ,GAAG,CAACO,EAAG,OAAO,IAAMC,EAAID,EAAG,YAAYA,EAAG,YAAYL,EAAS,CAAC,MAAMK,EAAG,YAAY,EAAE,IAAIA,EAAG,YAAYC,EAAI,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,EAAEf,MAAc,CAAC,IAAMc,EAAGP,EAAU,QAAoC,GAAzB,CAACO,IAAUD,EAAY,EAAK,OAAO,eAAiB,KAAY,OAAO,IAAMG,EAAG,IAAI,eAAeH,CAAW,EAAiB,OAAfG,EAAG,QAAQF,CAAE,MAAYE,EAAG,WAAW,CAAE,EAAE,C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