{"version":3,"file":"DropdownNavigation.CoscbtdG.mjs","names":["useState","useRef","__esmMin","init_ssg_sandbox_shims","te","window","_e","p","ce","init_npm_react_18_3_1","de","motion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_BWFVvmND","useIsStaticRenderer","ControlType","addPropertyControls","DropdownNavigation","props","isOpen","setIsOpen","selectedIndex","setSelectedIndex","initialSelectedIndex","containerRef","isStatic","handleClickOutside","event","handleSelect","index","item","nodeId","targetElement","toggleDropdown","selectedItem","items","font","padding","textColor","placeholder","DropdownItem","borderRadius","isHovered","setIsHovered","isSelected","accentColor","init_DropdownNavigation","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/0l66JoNiTf5oJg0aN7wK/pwP36XUKIWc76mncrDfg/DropdownNavigation.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{AnimatePresence,motion}from\"framer-motion\";import{useEffect,useRef,useState,startTransition}from\"react\";/**\n * Change the font type to this website's font type, remove the shadow and the border\n * \n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function DropdownNavigation(props){const{items=[],placeholder,backgroundColor,textColor,accentColor,font,borderRadius,padding,initialSelectedIndex}=props;const[isOpen,setIsOpen]=useState(false);const[selectedIndex,setSelectedIndex]=useState(initialSelectedIndex);const containerRef=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{setSelectedIndex(initialSelectedIndex);},[initialSelectedIndex]);// Close dropdown when clicking outside\nuseEffect(()=>{if(isStatic||!isOpen)return;const handleClickOutside=event=>{if(containerRef.current&&!containerRef.current.contains(event.target)){startTransition(()=>setIsOpen(false));}};document.addEventListener(\"mousedown\",handleClickOutside);return()=>{document.removeEventListener(\"mousedown\",handleClickOutside);};},[isStatic,isOpen]);const handleSelect=(index,item)=>{startTransition(()=>{setSelectedIndex(index);setIsOpen(false);});// Handle navigation if a link is provided\nif(item.link&&!isStatic){// Check if it's a Framer editor URL with a node parameter\nconst url=new URL(item.link,window.location.href);const nodeId=url.searchParams.get(\"node\");if(nodeId){// Try to find the element by data-framer-name or id\nconst targetElement=document.querySelector(`[data-framer-name=\"${nodeId}\"]`)||document.querySelector(`[id=\"${nodeId}\"]`)||document.querySelector(`#${nodeId}`);if(targetElement){targetElement.scrollIntoView({behavior:\"smooth\",block:\"start\"});return;}}// If it's a hash link (e.g., #section-name)\nif(item.link.startsWith(\"#\")){const targetElement=document.querySelector(item.link);if(targetElement){targetElement.scrollIntoView({behavior:\"smooth\",block:\"start\"});return;}}// Otherwise navigate to the URL\nwindow.location.href=item.link;}};const toggleDropdown=()=>{if(isStatic)return;startTransition(()=>setIsOpen(!isOpen));};const selectedItem=selectedIndex>=0&&selectedIndex<items.length?items[selectedIndex]:null;return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"max-content\",minWidth:200,height:\"auto\",position:\"relative\",zIndex:isOpen?9999:1,overflow:\"visible\",fontFamily:\"Manrope, sans-serif\",...font},children:[/*#__PURE__*/_jsx(\"link\",{href:\"https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap\",rel:\"stylesheet\"}),/*#__PURE__*/_jsxs(motion.button,{onClick:toggleDropdown,onMouseDown:e=>e.preventDefault(),style:{width:\"100%\",height:\"auto\",display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",padding:`0 ${padding}px`,backgroundColor:backgroundColor,color:textColor,border:\"none\",borderRadius:borderRadius,cursor:\"pointer\",outline:\"none\",textAlign:\"left\",transition:\"opacity 0.2s ease\",pointerEvents:\"auto\",fontFamily:\"Manrope, sans-serif\",...font},whileHover:isStatic?undefined:{opacity:.85},whileTap:{scale:.99},children:[/*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\",opacity:selectedItem?1:.6},children:selectedItem?selectedItem.label:placeholder}),/*#__PURE__*/_jsx(motion.div,{animate:{rotate:isOpen?180:0},transition:{duration:.2},style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",marginLeft:8,opacity:.5},children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 12 12\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M2.5 4.5L6 8L9.5 4.5\",stroke:\"currentColor\",strokeWidth:\"1.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]}),/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:4,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.2,ease:[0,0,.2,1]},style:{position:\"absolute\",top:\"100%\",left:0,width:\"100%\",minWidth:\"100%\",backgroundColor:backgroundColor,border:\"none\",borderRadius:borderRadius,overflow:\"visible\",padding:4,display:\"flex\",flexDirection:\"column\",gap:2,maxHeight:300,overflowY:\"auto\",pointerEvents:\"auto\",zIndex:1e4,boxShadow:\"0 4px 12px rgba(0, 0, 0, 0.15)\"},children:items.map((item,index)=>/*#__PURE__*/_jsx(DropdownItem,{item:item,isSelected:index===selectedIndex,onClick:()=>handleSelect(index,item),accentColor:accentColor,textColor:textColor,borderRadius:Math.max(0,borderRadius-2),padding:padding,font:font},item.id||index))})})]});}function DropdownItem({item,isSelected,onClick,accentColor,textColor,borderRadius,padding,font}){const[isHovered,setIsHovered]=useState(false);return /*#__PURE__*/_jsx(motion.div,{onClick:onClick,onHoverStart:()=>setIsHovered(true),onHoverEnd:()=>setIsHovered(false),style:{padding:`8px ${padding}px`,cursor:\"pointer\",borderRadius:borderRadius,backgroundColor:isSelected?\"#E0E0E0\":\"transparent\",color:textColor,display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",position:\"relative\",borderLeft:`2px solid ${isHovered&&!isSelected?`${accentColor}60`:\"transparent\"}`,paddingLeft:`${padding-2}px`,transition:\"border-color 0.2s ease, background-color 0.2s ease\",fontFamily:\"Manrope, sans-serif\",...font},whileHover:{backgroundColor:isSelected?\"#E0E0E0\":\"#F5F5F5\"},children:/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:isSelected?700:400,whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\",opacity:isHovered&&!isSelected?1:.92,transition:\"opacity 0.2s ease\"},children:item.label})});}addPropertyControls(DropdownNavigation,{items:{type:ControlType.Array,title:\"Options\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,defaultValue:\"Option Label\"},link:{type:ControlType.Link,title:\"Link\"}}},defaultValue:[{label:\"Layout A\",link:\"\"},{label:\"Layout B\",link:\"\"},{label:\"Layout C\",link:\"\"}]},initialSelectedIndex:{type:ControlType.Number,title:\"Selected\",defaultValue:-1,min:-1,displayStepper:true},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Select Layout...\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:20,lineHeight:\"1.75em\"}},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#111111\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#0099FF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:20},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:12,min:4,max:32}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DropdownNavigation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DropdownNavigation.map"],"mappings":"A,0QAKG,SAAwBkB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,EAAE,cAAY,kBAAgB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