{"version":3,"file":"ImageSlider.DBYX4ePa.mjs","names":["useState","useMemo"],"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":"+LASG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,EAAe,OAAO,SAAO,EAAe,OAAO,SAAO,EAAe,OAAO,aAAW,GAAK,aAAW,GAAK,mBAAiB,GAAG,eAAa,EAAE,oBAAkB,UAAU,oBAAkB,EAAE,kBAAgB,UAAU,kBAAgB,EAAE,SAAO,EAAW,CAAC,EAAY,GAAgBA,EAAS,CAAC,EAAQ,EAAOC,MAAmB,CAAC,EAAO,GAAG,EAAW,CAAC,CAAM,EAAE,CAAC,EAAE,GAAG,EAAW,CAAC,CAAM,EAAE,CAAC,CAAC,EAAI,CAAC,EAAO,EAAO,EAAO,EAAW,CAAU,CAAC,EAAQ,EAAY,EAAO,IAAc,EAAO,GAAS,EAAe,EAAO,OAAO,EAAQ,EAAqB,GAAO,CAAI,IAAQ,GAAmB,MAAoB,CAAC,EAAe,CAAK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