{"version":3,"file":"HoverStack.CcI_Ec5r.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/QIyKE3PjvLtIDrHNC563/CC5Y8enxg6IyygAfaZCW/HoverStack.js"],"sourcesContent":["// Stack component with 3 items where hovering one makes it 40% width while others fill remaining space\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import*as React from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 200\n */export default function HoverStack(props){const{children,gap=10,orientation=\"horizontal\",scrollableMode=false,hoverWidth=45,enableHover=true,style}=props;const[hoveredIndex,setHoveredIndex]=useState(null);const childArray=React.Children.toArray(children);const getItemStyle=index=>{const isHovered=hoveredIndex===index;const hasHover=hoveredIndex!==null&&enableHover;return{flex:hasHover?isHovered?`0 0 ${hoverWidth}%`:\"1\":\"1\",display:\"flex\",transition:\"flex 0.3s ease\",cursor:enableHover?\"pointer\":\"default\",overflow:\"hidden\",width:\"100%\",height:\"100%\"};};if(scrollableMode){return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",flexDirection:\"column\",gap,width:\"100%\",height:\"100%\",overflowY:\"auto\",overflowX:\"hidden\"},children:childArray.map((child,index)=>/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",flexShrink:0,display:\"flex\"},children:child},index))});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",gap,width:\"100%\",height:\"100%\",minHeight:5,minWidth:5,flexDirection:orientation===\"vertical\"?\"column\":\"row\"},children:childArray.map((child,index)=>/*#__PURE__*/_jsx(\"div\",{style:getItemStyle(index),onMouseEnter:enableHover?()=>startTransition(()=>setHoveredIndex(index)):undefined,onMouseLeave:enableHover?()=>startTransition(()=>setHoveredIndex(null)):undefined,children:child},index))});}addPropertyControls(HoverStack,{children:{type:ControlType.Slot,title:\"Children\",maxCount:10},scrollableMode:{type:ControlType.Boolean,title:\"Scrollable Mode\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},enableHover:{type:ControlType.Boolean,title:\"Enable Hover\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",hidden:props=>props.scrollableMode===true},hoverWidth:{type:ControlType.Number,title:\"Hover Width\",defaultValue:45,min:10,max:90,step:1,unit:\"%\",hidden:props=>props.scrollableMode===true||props.enableHover===false},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:10,min:0,max:50,step:1,unit:\"px\"},orientation:{type:ControlType.Enum,title:\"Orientation\",defaultValue:\"horizontal\",options:[\"horizontal\",\"vertical\"],hidden:props=>props.scrollableMode===true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverStack\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverStack.map"],"mappings":"wLAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,WAAS,MAAI,GAAG,cAAY,aAAa,iBAAe,GAAM,aAAW,GAAG,cAAY,GAAK,SAAO,EAAW,CAAC,EAAa,GAAiBA,EAAS,KAAK,CAAO,EAAA,EAA0B,QAAQ,EAAS,CAAO,EAAa,IAAmG,CAAC,KAAxC,IAAe,MAAM,GAAzD,IAAe,EAAqF,OAAO,EAAW,GAAG,IAAQ,QAAQ,OAAO,WAAW,iBAAiB,OAAO,EAAY,UAAU,UAAU,SAAS,SAAS,MAAM,OAAO,OAAO,OAAO,EAA4T,OAAtT,EAAoC,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,QAAQ,OAAO,cAAc,SAAS,MAAI,MAAM,OAAO,OAAO,OAAO,UAAU,OAAO,UAAU,SAAS,CAAC,SA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