{"version":3,"file":"Carousel.BBOo2K1G.mjs","names":["useMemo","Children","useState","useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/6xrryj9bYsqgJcVqPQZv/88aUlaN6vvz6Nrmx2iiI/Carousel.js"],"sourcesContent":["// Responsive carousel component with expandable cards, smooth animations, and automatic height adjustment\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback,useMemo,startTransition,Children,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function Carousel(props){const{children,backgroundColor=\"#F5F5F5\",arrowColor=\"#000000\",borderRadius=12,cardsToShow=1,padding=60,arrowBackground=\"#FFFFFF\",arrowBorderRadius=8,gap=20,arrowHorizontalPosition=20,arrowVerticalPosition=50,enableResponsive=true}=props;const cards=useMemo(()=>Children.toArray(children),[children]);const[currentIndex,setCurrentIndex]=useState(0);const[responsiveCardsToShow,setResponsiveCardsToShow]=useState(cardsToShow);const containerRef=useRef(null);// Responsive behavior: adjust cards based on container width\nuseEffect(()=>{if(!enableResponsive){setResponsiveCardsToShow(cardsToShow);return;}const updateCardsToShow=()=>{if(containerRef.current){const containerWidth=containerRef.current.offsetWidth;const availableWidth=containerWidth-(padding+20)*2-arrowHorizontalPosition*2;// Calculate how many cards can fit based on width\n// Assuming minimum card width of 250px\nconst minCardWidth=250;const maxPossibleCards=Math.floor((availableWidth+gap)/(minCardWidth+gap));const newCardsToShow=Math.min(Math.max(1,maxPossibleCards),cardsToShow);startTransition(()=>{setResponsiveCardsToShow(newCardsToShow);});}};updateCardsToShow();if(typeof window!==\"undefined\"){window.addEventListener(\"resize\",updateCardsToShow);return()=>window.removeEventListener(\"resize\",updateCardsToShow);}},[cardsToShow,padding,gap,arrowHorizontalPosition,enableResponsive]);const handlePrevious=useCallback(()=>{startTransition(()=>{setCurrentIndex(prev=>prev===0?Math.max(0,cards.length-responsiveCardsToShow):Math.max(0,prev-responsiveCardsToShow));});},[cards.length,responsiveCardsToShow]);const handleNext=useCallback(()=>{startTransition(()=>{setCurrentIndex(prev=>{const nextIndex=prev+responsiveCardsToShow;return nextIndex>=cards.length?0:nextIndex;});});},[cards.length,responsiveCardsToShow]);const visibleCards=useMemo(()=>{return cards.slice(currentIndex,currentIndex+responsiveCardsToShow);},[cards,currentIndex,responsiveCardsToShow]);const isFixedWidth=props?.style&&props.style.width===\"100%\";const isFixedHeight=props?.style&&props.style.height===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{...props.style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius,padding:`${padding}px ${padding+20}px`,overflow:\"hidden\",...isFixedWidth?{}:{minWidth:400},...isFixedHeight?{}:{minHeight:200}},children:[/*#__PURE__*/_jsx(\"button\",{onClick:handlePrevious,style:{position:\"absolute\",left:arrowHorizontalPosition,top:`${arrowVerticalPosition}%`,transform:\"translateY(-50%)\",background:arrowBackground,border:\"none\",cursor:\"pointer\",padding:10,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,transition:\"opacity 0.2s\",borderRadius:arrowBorderRadius,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\"},onMouseEnter:e=>e.currentTarget.style.opacity=\"0.6\",onMouseLeave:e=>e.currentTarget.style.opacity=\"1\",\"aria-label\":\"Previous review\",children:/*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:arrowColor,strokeWidth:\"2\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Previous\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M15 18l-6-6 6-6\"})]})}),/*#__PURE__*/_jsx(\"div\",{style:{flex:1,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",position:\"relative\",minHeight:150},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",initial:false,children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.3,ease:\"easeInOut\"},style:{width:\"100%\",display:\"grid\",gridTemplateColumns:`repeat(${responsiveCardsToShow}, 1fr)`,gap:gap},children:visibleCards.map((card,index)=>/*#__PURE__*/_jsx(motion.div,{layout:true,transition:{duration:.3,ease:\"easeInOut\"},style:{width:\"100%\"},children:card},currentIndex+index))},currentIndex)})}),/*#__PURE__*/_jsx(\"button\",{onClick:handleNext,style:{position:\"absolute\",right:arrowHorizontalPosition,top:`${arrowVerticalPosition}%`,transform:\"translateY(-50%)\",background:arrowBackground,border:\"none\",cursor:\"pointer\",padding:10,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,transition:\"opacity 0.2s\",borderRadius:arrowBorderRadius,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\"},onMouseEnter:e=>e.currentTarget.style.opacity=\"0.6\",onMouseLeave:e=>e.currentTarget.style.opacity=\"1\",\"aria-label\":\"Next review\",children:/*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:arrowColor,strokeWidth:\"2\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Next\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M9 18l6-6-6-6\"})]})})]});}addPropertyControls(Carousel,{children:{type:ControlType.Array,title:\"Cards\",control:{type:ControlType.ComponentInstance},maxCount:10},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\"},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#000000\"},arrowBackground:{type:ControlType.Color,title:\"Arrow Background\",defaultValue:\"#FFFFFF\"},arrowBorderRadius:{type:ControlType.Number,title:\"Arrow Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:32,step:1},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:60,min:0,max:200,step:5,unit:\"px\"},cardsToShow:{type:ControlType.Number,title:\"Cards to Show\",defaultValue:1,min:1,max:10,step:1},enableResponsive:{type:ControlType.Boolean,title:\"Responsive\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},gap:{type:ControlType.Number,title:\"Card Gap\",defaultValue:20,min:0,max:100,step:5,unit:\"px\"},arrowHorizontalPosition:{type:ControlType.Number,title:\"Arrow Horizontal\",defaultValue:20,min:0,max:200,step:5,unit:\"px\"},arrowVerticalPosition:{type:ControlType.Number,title:\"Arrow Vertical\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Carousel\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carousel.map"],"mappings":"4RAIG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,WAAS,kBAAgB,UAAU,aAAW,UAAU,eAAa,GAAG,cAAY,EAAE,UAAQ,GAAG,kBAAgB,UAAU,oBAAkB,EAAE,MAAI,GAAG,0BAAwB,GAAG,wBAAsB,GAAG,mBAAiB,IAAM,EAAY,EAAMA,MAAYC,EAAS,QAAQ,EAAS,CAAC,CAAC,EAAS,CAAC,CAAM,CAAC,EAAa,GAAiBC,EAAS,EAAE,CAAM,CAAC,EAAsB,GAA0BA,EAAS,EAAY,CAAO,EAAaC,EAAO,KAAK,CAClf,MAAc,CAAC,GAAG,CAAC,EAAiB,CAAC,EAAyB,EAAY,CAAC,OAAQ,IAAM,MAAsB,CAAC,GAAG,EAAa,QAAQ,CAAuD,IAAM,EAAvC,EAAa,QAAQ,aAAiD,EAAQ,IAAI,EAAE,EAAwB,E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