{"version":3,"file":"ImageSlider.CIBVdJex.mjs","names":["useState","useMemo","__esmMin","pe","te","init_npm_react_18_3_1","_e","init_jsx_runtime","c","p","init_framer_DKtAEkcX","ControlType","addPropertyControls","ImageSlider","DEFAULT_IMAGES","props","activeIndex","setActiveIndex","images","image1","showImage2","image2","showImage3","image3","activeImage","showThumbnails","handleThumbnailClick","index","containerStyle","style","thumbnailSpacing","mainImageContainerStyle","borderRadius","mainBorderWidth","mainBorderColor","imageStyle","isActive","activeBorderWidth","activeBorderColor","image","init_ImageSlider"],"sources":["https:/framerusercontent.com/modules/L43IJA6yvHNxp4qdSu3u/4wVWY2OEizCYhNyacTS2/ImageSlider.js"],"sourcesContent":["// 画像選択で上の大きな画像が切り替わるスライドショーコンポーネント（最大3枚、16:9比率）\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useMemo,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const DEFAULT_IMAGES={image1:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},image2:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},image3:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"}};/**\n * Image Slideshow with Thumbnail Selection\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ImageSlider(props){const{image1=DEFAULT_IMAGES.image1,image2=DEFAULT_IMAGES.image2,image3=DEFAULT_IMAGES.image3,showImage2=true,showImage3=true,thumbnailSpacing=12,borderRadius=8,activeBorderColor=\"#0099FF\",activeBorderWidth=3,mainBorderColor=\"#cccccc\",mainBorderWidth=1,style}=props;const[activeIndex,setActiveIndex]=useState(0);const images=useMemo(()=>{return[image1,...showImage2?[image2]:[],...showImage3?[image3]:[]];},[image1,image2,image3,showImage2,showImage3]);const activeImage=images[activeIndex]??images[0];const showThumbnails=images.length>1;const handleThumbnailClick=index=>{if(index===activeIndex)return;startTransition(()=>{setActiveIndex(index);});};const containerStyle={...style,width:style?.width===\"100%\"?\"100%\":\"600px\",height:style?.height===\"100%\"?\"100%\":\"400px\",display:\"flex\",flexDirection:\"column\",gap:showThumbnails?`${thumbnailSpacing}px`:0,position:\"relative\"};const mainImageContainerStyle={flex:1,width:\"100%\",borderRadius:`${borderRadius}px`,overflow:\"hidden\",backgroundColor:\"#f5f5f5\",border:`${mainBorderWidth}px solid ${mainBorderColor}`,boxSizing:\"border-box\"};const imageStyle={width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:mainImageContainerStyle,children:/*#__PURE__*/_jsx(\"img\",{src:activeImage.src,alt:activeImage.alt,style:imageStyle})}),showThumbnails&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:`${thumbnailSpacing}px`,justifyContent:\"center\",alignItems:\"center\",width:\"100%\",overflow:\"hidden\"},children:images.map((image,index)=>{const isActive=activeIndex===index;return /*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>handleThumbnailClick(index),\"aria-label\":`Show image ${index+1}`,\"aria-pressed\":isActive,style:{position:\"relative\",width:`calc((100% - ${thumbnailSpacing*(images.length-1)}px) / ${images.length})`,maxWidth:\"160px\",aspectRatio:\"16 / 9\",borderRadius:`${borderRadius/2}px`,overflow:\"hidden\",cursor:\"pointer\",border:isActive?`${activeBorderWidth}px solid ${activeBorderColor}`:`${activeBorderWidth}px solid transparent`,transition:\"border-color 0.2s ease\",backgroundColor:\"#f5f5f5\",boxSizing:\"border-box\",padding:0,appearance:\"none\"},children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{position:\"absolute\",inset:0,...imageStyle}})},`${image.src}-${index}`);})})]});}addPropertyControls(ImageSlider,{image1:{type:ControlType.ResponsiveImage,title:\"Image 1\"},image2:{type:ControlType.ResponsiveImage,title:\"Image 2\"},image3:{type:ControlType.ResponsiveImage,title:\"Image 3\"},showImage2:{type:ControlType.Boolean,title:\"Show Image 2\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showImage3:{type:ControlType.Boolean,title:\"Show Image 3\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},thumbnailSpacing:{type:ControlType.Number,title:\"Thumbnail Spacing\",defaultValue:12,min:4,max:32,step:2,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:24,step:1,unit:\"px\"},activeBorderColor:{type:ControlType.Color,title:\"Active Border Color\",defaultValue:\"#0099FF\"},activeBorderWidth:{type:ControlType.Number,title:\"Active Border Width\",defaultValue:3,min:1,max:8,step:1,unit:\"px\"},mainBorderColor:{type:ControlType.Color,title:\"Main Border Color\",defaultValue:\"#cccccc\"},mainBorderWidth:{type:ControlType.Number,title:\"Main Border Width\",defaultValue:1,min:0,max:8,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageSlider\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageSlider.map"],"mappings":"A,+LASG,SAAwBa,EAAY,EAAM,CAAC,GAAK,CAAC,SAAOC,EAAe,OAAO,SAAOA,EAAe,OAAO,SAAOA,EAAe,OAAO,aAAW,GAAK,aAAW,GAAK,mBAAiB,GAAG,eAAa,EAAE,oBAAkB,UAAU,oBAAkB,EAAE,kBAAgB,UAAU,kBAAgB,EAAE,SAAOC,EAAW,CAACC,EAAYC,GAAgBjB,E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