{"version":3,"file":"StackingSlider.Cc2lvBjT.mjs","names":["Children","useState","useRef"],"sources":["https:/framerusercontent.com/modules/KpmgijqrVZnGxpRfARZa/WgVAYOEew5u59axwRlik/StackingSlider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";import{Children,useState,useRef,useEffect}from\"react\";export default function ReviewSlider(props){const{children,cardGap=24,sideOpacity=.35,sideScale=.92,sideBlur=0,leftArrowIcon,rightArrowIcon,arrowSize=44,arrowColor=\"#ffffff\",arrowBackground=\"rgba(255,255,255,0.08)\",arrowHoverBackground=\"rgba(255,255,255,0.18)\",arrowBorderRadius=100,arrowSpacing=8,arrowGap=28,buttonPosition=\"center\",disabledOpacity=.25,transition}=props;const childrenArray=Children.toArray(children);const[currentIndex,setCurrentIndex]=useState(0);const containerRef=useRef(null);const firstCardRef=useRef(null);const[cardWidth,setCardWidth]=useState(0);const[containerWidth,setContainerWidth]=useState(0);const[hoveredButton,setHoveredButton]=useState(null);useEffect(()=>{const update=()=>{if(firstCardRef.current){setCardWidth(firstCardRef.current.offsetWidth);}if(containerRef.current){setContainerWidth(containerRef.current.offsetWidth);}};update();setTimeout(update,50);const ro=new ResizeObserver(update);if(containerRef.current){ro.observe(containerRef.current);}if(firstCardRef.current){ro.observe(firstCardRef.current);}return()=>ro.disconnect();},[childrenArray.length]);useEffect(()=>{if(currentIndex>=childrenArray.length){setCurrentIndex(Math.max(0,childrenArray.length-1));}},[childrenArray.length,currentIndex]);const goNext=()=>{if(currentIndex<childrenArray.length-1){setCurrentIndex(i=>i+1);}};const goPrev=()=>{if(currentIndex>0){setCurrentIndex(i=>i-1);}};const rowX=containerWidth>0&&cardWidth>0?containerWidth/2-cardWidth/2-currentIndex*(cardWidth+cardGap):0;const tx={duration:transition?.duration??.42,ease:transition?.ease??[.32,.72,0,1],type:\"tween\"};if(RenderTarget.current()===RenderTarget.canvas&&childrenArray.length===0){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",maxWidth:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:8,background:\"rgba(136, 85, 255, 0.08)\",border:\"2px dashed rgba(136, 85, 255, 0.3)\",borderRadius:16,color:\"#8855FF\",fontSize:14,fontWeight:500,textAlign:\"center\",padding:24,overflow:\"hidden\",boxSizing:\"border-box\"},children:[\"💬 Review Slider\",/*#__PURE__*/_jsx(\"span\",{style:{fontSize:12,opacity:.7,fontWeight:400},children:\"Connect review cards via Slides\"})]});}if(childrenArray.length===0)return null;const isAtStart=currentIndex===0;const isAtEnd=currentIndex===childrenArray.length-1;const justifyMap={center:\"center\",right:\"flex-end\",left:\"flex-start\"};const Arrow=({dir,onClick,disabled})=>{const isHovered=hoveredButton===dir&&!disabled;const icon=dir===\"left\"?leftArrowIcon:rightArrowIcon;return /*#__PURE__*/_jsx(\"button\",{onClick:onClick,disabled:disabled,onMouseEnter:()=>setHoveredButton(dir),onMouseLeave:()=>setHoveredButton(null),style:{width:arrowSize,height:arrowSize,minWidth:arrowSize,minHeight:arrowSize,background:isHovered?arrowHoverBackground:arrowBackground,border:\"none\",borderRadius:arrowBorderRadius,cursor:disabled?\"not-allowed\":\"pointer\",opacity:disabled?disabledOpacity:1,transition:\"opacity 0.2s, background 0.15s\",padding:0,flexShrink:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",outline:\"none\",boxSizing:\"border-box\"},children:icon?/*#__PURE__*/_jsx(\"img\",{src:icon,alt:dir,style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",display:\"block\"}}):/*#__PURE__*/_jsx(\"svg\",{width:arrowSize*.42,height:arrowSize*.42,viewBox:\"0 0 24 24\",fill:\"none\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:dir===\"left\"?/*#__PURE__*/_jsx(\"polyline\",{points:\"15 18 9 12 15 6\"}):/*#__PURE__*/_jsx(\"polyline\",{points:\"9 18 15 12 9 6\"})})});};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",maxWidth:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",gap:arrowGap,overflow:\"hidden\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{flex:1,overflow:\"hidden\",position:\"relative\",width:\"100%\",maxWidth:\"100%\",display:\"flex\",alignItems:\"center\",boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(motion.div,{animate:{x:rowX},transition:tx,style:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\",gap:cardGap,flexShrink:0,boxSizing:\"border-box\"},children:childrenArray.map((child,index)=>{const isActive=index===currentIndex;return /*#__PURE__*/_jsx(motion.div,{ref:index===0?firstCardRef:undefined,animate:{opacity:isActive?1:sideOpacity,scale:isActive?1:sideScale,filter:sideBlur>0&&!isActive?`blur(${sideBlur}px)`:\"blur(0px)\"},transition:tx,style:{flexShrink:0,transformOrigin:\"center center\",pointerEvents:isActive?\"auto\":\"none\",boxSizing:\"border-box\"},children:child},index);})})}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:arrowSpacing,alignItems:\"center\",justifyContent:justifyMap[buttonPosition??\"center\"],flexShrink:0,maxWidth:\"100%\",overflow:\"hidden\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(Arrow,{dir:\"left\",onClick:goPrev,disabled:isAtStart}),/*#__PURE__*/_jsx(Arrow,{dir:\"right\",onClick:goNext,disabled:isAtEnd})]})]});}ReviewSlider.displayName=\"Review Slider\";addPropertyControls(ReviewSlider,{children:{type:ControlType.Array,title:\"Slides\",control:{type:ControlType.ComponentInstance}},cardGap:{type:ControlType.Number,title:\"Card Gap\",min:0,max:120,step:4,defaultValue:24,unit:\"px\",displayStepper:true,description:\"Space between cards\"},sideOpacity:{type:ControlType.Number,title:\"Side Opacity\",min:0,max:1,step:.05,defaultValue:.35,displayStepper:true,description:\"Opacity of non-active cards\"},sideScale:{type:ControlType.Number,title:\"Side Scale\",min:.5,max:1,step:.01,defaultValue:.92,displayStepper:true,description:\"Scale of non-active cards\"},sideBlur:{type:ControlType.Number,title:\"Side Blur\",min:0,max:20,step:1,defaultValue:0,unit:\"px\",displayStepper:true,description:\"Blur amount on non-active cards\"},leftArrowIcon:{type:ControlType.Image,title:\"Left Arrow\"},rightArrowIcon:{type:ControlType.Image,title:\"Right Arrow\"},arrowSize:{type:ControlType.Number,title:\"Arrow Size\",min:24,max:80,step:2,defaultValue:44,unit:\"px\",displayStepper:true},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#ffffff\"},arrowBackground:{type:ControlType.Color,title:\"Arrow BG\",defaultValue:\"rgba(255,255,255,0.08)\"},arrowHoverBackground:{type:ControlType.Color,title:\"Arrow Hover BG\",defaultValue:\"rgba(255,255,255,0.18)\"},arrowBorderRadius:{type:ControlType.Number,title:\"Arrow Radius\",min:0,max:100,step:4,defaultValue:100,unit:\"px\",displayStepper:true},arrowSpacing:{type:ControlType.Number,title:\"Between Arrows\",min:0,max:40,step:2,defaultValue:8,unit:\"px\",displayStepper:true},arrowGap:{type:ControlType.Number,title:\"Arrows from Slider\",min:0,max:80,step:4,defaultValue:28,unit:\"px\",displayStepper:true},buttonPosition:{type:ControlType.Enum,title:\"Arrows Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},disabledOpacity:{type:ControlType.Number,title:\"Disabled Opacity\",min:0,max:1,step:.05,defaultValue:.25,displayStepper:true},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{duration:.42,ease:\"easeInOut\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReviewSlider\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StackingSlider.map"],"mapp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