{"version":3,"file":"New.CEhHLd9S.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/56Sa92947wzaEH92KfNC/gE2oslih8zLDlcDRJalJ/New.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Scroll-to-Section Side Navigator (Vertical)\n * - Variants per spec (default/hover/selected/selectedHover)\n * - Only one item selected at a time\n * - Smooth scroll on click\n * - Font (single control), Alignment (segmented), Transition (single control)\n * - Order toggle (text first vs indicator first)\n * - Click + ScrollSpy coexist: clicking selects & scrolls; scrolling also updates selection\n * - Parent auto-sizes to fit content (width & height). Each SectionItem is 20px tall and fits content width.\n * - FIX: Closed JSX tags correctly to avoid parser errors.\n *\n * @framerIntrinsicWidth 60\n * @framerIntrinsicHeight 60\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */// ------------------------------\n// Hook: ScrollSpy selects the section closest to viewport top\n// ------------------------------\nfunction useSectionScrollSpy(enabled,sections){const[activeId,setActiveId]=React.useState(null);React.useEffect(()=>{if(!enabled)return;function handler(){let best=null;for(const s of sections){const el=typeof window!==\"undefined\"?document.getElementById(s.targetId):null;if(!el)continue;const rect=el.getBoundingClientRect();const dist=Math.abs(rect.top);if(best===null||dist<best.dist)best={id:s.targetId,dist};}if(best)setActiveId(best.id);}handler();if(typeof window!==\"undefined\"){window.addEventListener(\"scroll\",handler,{passive:true});window.addEventListener(\"resize\",handler);}return()=>{if(typeof window!==\"undefined\"){window.removeEventListener(\"scroll\",handler);window.removeEventListener(\"resize\",handler);}};// eslint-disable-next-line react-hooks/exhaustive-deps\n},[enabled,JSON.stringify(sections)]);return activeId;}// ------------------------------\n// Constants\n// ------------------------------\nconst INDICATOR_HEIGHT=4;const WIDTH_DEFAULT=28;const WIDTH_HOVER=40;function SectionItem({label,selected,onClick,activeColor,deactiveColor,font,transition,alignment,reverseOrder}){const[isHover,setIsHover]=React.useState(false);const variant=selected?isHover?\"selectedHover\":\"selected\":isHover?\"hover\":\"default\";const indicatorVariants={default:{width:WIDTH_DEFAULT,height:INDICATOR_HEIGHT,borderRadius:100,backgroundColor:deactiveColor},hover:{width:WIDTH_HOVER,height:INDICATOR_HEIGHT,borderRadius:100,backgroundColor:activeColor},selected:{width:WIDTH_DEFAULT,height:INDICATOR_HEIGHT,borderRadius:100,backgroundColor:activeColor},selectedHover:{width:WIDTH_HOVER,height:INDICATOR_HEIGHT,borderRadius:100,backgroundColor:activeColor}};const textVariants={default:{opacity:0,x:reverseOrder?-4:4,pointerEvents:\"none\"},hover:{opacity:1,x:0,pointerEvents:\"auto\"},selected:{opacity:0,x:reverseOrder?-4:4,pointerEvents:\"none\"},selectedHover:{opacity:1,x:0,pointerEvents:\"auto\"}};const justifyContent=alignment===\"left\"?\"flex-start\":alignment===\"center\"?\"center\":\"flex-end\";return /*#__PURE__*/_jsxs(\"div\",{style:{height:20,minWidth:0,display:\"flex\",alignItems:\"center\",justifyContent,cursor:\"pointer\",userSelect:\"none\",flexDirection:reverseOrder?\"row-reverse\":\"row\",gap:8,width:\"fit-content\"},onMouseEnter:()=>setIsHover(true),onMouseLeave:()=>setIsHover(false),onClick:onClick,role:\"button\",\"aria-pressed\":selected,children:[/*#__PURE__*/_jsx(motion.div,{variants:indicatorVariants,animate:variant,transition:transition,style:{display:\"inline-block\"},\"aria-hidden\":true},\"indicator\"),/*#__PURE__*/_jsx(motion.span,{variants:textVariants,animate:variant,transition:transition,style:{...font,color:activeColor,whiteSpace:\"nowrap\",lineHeight:1},children:label},\"label\")]});}export default function ScrollSideNavigator(props){const{sections=[{label:\"Intro\",targetId:\"intro\"},{label:\"Work\",targetId:\"work\"},{label:\"About\",targetId:\"about\"}],activeColor=\"#111111\",deactiveColor=\"#C8C8C8\",alignment=\"left\",gap=8,font={fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},transition={type:\"tween\",ease:\"easeOut\",duration:.2},reverseOrder=false,scrollSpyEnabled=true,appearEnabled=true,style}=props;// Unified selection source: updates on both click and scroll\nconst[selectedId,setSelectedId]=React.useState(null);// ScrollSpy updates selection when enabled\nconst spyActiveId=useSectionScrollSpy(!!scrollSpyEnabled,sections);React.useEffect(()=>{if(scrollSpyEnabled&&spyActiveId&&spyActiveId!==selectedId){setSelectedId(spyActiveId);}},[spyActiveId,scrollSpyEnabled,selectedId]);// Dev self-checks (lightweight)\nReact.useEffect(()=>{if(WIDTH_DEFAULT!==28||WIDTH_HOVER!==40||INDICATOR_HEIGHT!==4){// eslint-disable-next-line no-console\nconsole.warn(\"[Navigator] Spec mismatch in indicator dimensions.\");}if(!scrollSpyEnabled){console.assert(spyActiveId==null,\"ScrollSpy should be inactive when disabled\");}},[scrollSpyEnabled,spyActiveId]);const alignItems=alignment===\"left\"?\"flex-start\":alignment===\"center\"?\"center\":\"flex-end\";return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems,gap,width:\"fit-content\",height:\"fit-content\"},children:sections.map((s,i)=>/*#__PURE__*/_jsx(motion.div,{initial:appearEnabled?{opacity:0,y:4}:false,animate:appearEnabled?{opacity:1,y:0}:undefined,transition:transition,style:{width:\"fit-content\"},children:/*#__PURE__*/_jsx(SectionItem,{label:s.label,selected:selectedId===s.targetId,onClick:()=>{// Manual select + smooth scroll\n    setSelectedId(s.targetId);if(typeof window!==\"undefined\"){const el=document.getElementById(s.targetId);if(el)el.scrollIntoView({behavior:\"smooth\",block:\"start\"});}},activeColor:activeColor,deactiveColor:deactiveColor,font:font,transition:transition,alignment:alignment,reverseOrder:reverseOrder})},`wrap-${s.targetId||`${s.label}-${i}`}`))});}// ------------------------------\n// Property Controls\n// ------------------------------\naddPropertyControls(ScrollSideNavigator,{sections:{type:ControlType.Array,title:\"Sections\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Section\"},targetId:{type:ControlType.String,title:\"Section ID\",defaultValue:\"section-id\"}}},defaultValue:[{label:\"Intro\",targetId:\"intro\"},{label:\"Work\",targetId:\"work\"},{label:\"About\",targetId:\"about\"}]},activeColor:{type:ControlType.Color,title:\"Active\",defaultValue:\"#111111\"},deactiveColor:{type:ControlType.Color,title:\"Deactive\",defaultValue:\"#C8C8C8\"},alignment:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:8,min:0,max:64,step:1},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"tween\",ease:\"easeOut\",duration:.2}},reverseOrder:{type:ControlType.Boolean,title:\"Text First\",defaultValue:false,enabledTitle:\"Text First\",disabledTitle:\"Indicator First\"},appearEnabled:{type:ControlType.Boolean,title:\"Appear\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},scrollSpyEnabled:{type:ControlType.Boolean,title:\"ScrollSpy\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollSideNavigator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./New.map"],"mappings":"uPAkBA,SAAS,EAAoB,EAAQ,EAAS,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAe,IAAI,EACxD,OAD0D,MAAoB,CAAC,GAAG,CAAC,EAAQ,OAAO,SAAS,GAAS,CAAC,IAAI,EAAK,KAAK,IAAI,IAAM,KAAK,EAAS,CAAC,I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