{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/eEREEUkumGKKNOzCAmHA/blIGVaf5c5jdTAj428r7/YearDropDownButtom.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// import { useStore } from \"./AppData.tsx\"\nexport default function YearDropdown(props){const{year,onYearSelect=year=>console.log(year),fontFamily}=props;const currentYear=new Date().getFullYear();const[selectedYear,setSelectedYear]=useState(Number(year)||currentYear);const[isOpen,setIsOpen]=useState(false);const[openDecade,setOpenDecade]=useState(null);// const [store, setStore] = useStore()\nuseEffect(()=>{setSelectedYear(year);},[year]);const years=Array.from({length:currentYear-1928},(_,i)=>currentYear-i);const decades={};years.forEach(year=>{const decade=Math.floor(year/10)*10;if(!decades[decade])decades[decade]=[];decades[decade].push(year);});const handleYearChange=year=>{setSelectedYear(year);setIsOpen(false);setOpenDecade(null);//setStore({ selectedYear: year })\n// console.log(year, store)\n// Call the external handler\nif(onYearSelect){onYearSelect(year);}};const toggleDecade=decade=>{setOpenDecade(openDecade===decade?null:decade);};const Arrow=({isOpen})=>/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 20 20\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:{transform:isOpen?\"rotate(180deg)\":\"rotate(0deg)\",transition:\"transform 0.3s ease\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 7.5L10 12.5L15 7.5\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})});return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:dropdownStyle,children:[/*#__PURE__*/_jsxs(\"button\",{style:{...buttonStyle,fontFamily:fontFamily},onClick:()=>setIsOpen(!isOpen),children:[/*#__PURE__*/_jsx(\"span\",{style:yearStyle,children:selectedYear}),/*#__PURE__*/_jsx(\"span\",{style:arrowStyle,children:/*#__PURE__*/_jsx(Arrow,{isOpen:isOpen})})]}),isOpen&&/*#__PURE__*/_jsx(\"ul\",{style:{...listStyle,fontFamily:fontFamily},children:Object.entries(decades).reverse().map(([decade,yearsInDecade])=>/*#__PURE__*/_jsxs(\"li\",{style:decadeStyle,children:[/*#__PURE__*/_jsxs(\"div\",{style:decadeLabelStyle,onClick:()=>toggleDecade(decade),children:[decade,\"s\",/*#__PURE__*/_jsx(\"span\",{style:decadeArrowStyle,children:/*#__PURE__*/_jsx(Arrow,{isOpen:openDecade===decade})})]}),openDecade===decade&&/*#__PURE__*/_jsx(\"ul\",{style:yearListStyle,children:yearsInDecade.map(year=>/*#__PURE__*/_jsx(\"li\",{style:listItemStyle,onClick:()=>handleYearChange(year),children:year},year))})]},decade))})]})});}addPropertyControls(YearDropdown,{year:{type:ControlType.String,title:\"Year\",defaultValue:\"2024\"},onYearSelect:{type:ControlType.EventHandler,title:\"On Year Selected\"},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"TT Fors Trial Regular\"}});const containerStyle={position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\"};const dropdownStyle={position:\"relative\",zIndex:100};const buttonStyle={padding:\"10px 20px\",fontSize:\"30px\",backgroundColor:\"#BA9E5E\",color:\"#F4F4F4\",border:\"none\",borderRadius:\"50px\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",width:\"200px\",boxShadow:\"0 4px 6px rgba(0, 0, 0, 0.1)\",position:\"relative\",zIndex:101};const yearStyle={marginRight:\"10px\"};const arrowStyle={display:\"flex\",alignItems:\"center\"};const listStyle={position:\"absolute\",top:\"0\",left:\"100%\",maxHeight:\"400px\",overflowY:\"auto\",listStyle:\"none\",padding:0,margin:\"0\",backgroundColor:\"#fff\",border:\"1px solid #ccc\",borderRadius:\"4px\",boxShadow:\"0 2px 4px rgba(0,0,0,0.1)\",width:\"200px\",fontSize:\"14px\",zIndex:101,opacity:.7};const decadeStyle={borderBottom:\"1px solid #eee\"};const decadeLabelStyle={display:\"flex\",justifyContent:\"space-between\",padding:\"10px 20px\",fontWeight:\"bold\",color:\"#666\",cursor:\"pointer\"};const decadeArrowStyle={display:\"flex\",alignItems:\"center\"};const yearListStyle={listStyle:\"none\",padding:0,margin:0};const listItemStyle={padding:\"8px 30px\",cursor:\"pointer\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"YearDropdown\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./YearDropDownButtom.map"],
  "mappings": "8EACe,SAARA,EAA8BC,EAAM,CAAC,GAAK,CAAC,KAAAC,EAAK,aAAAC,EAAaD,GAAM,QAAQ,IAAIA,CAAI,EAAE,WAAAE,CAAU,EAAEH,EAAYI,EAAY,IAAI,KAAK,EAAE,YAAY,EAAO,CAACC,EAAaC,CAAe,EAAEC,EAAS,OAAON,CAAI,GAAGG,CAAW,EAAO,CAACI,EAAOC,CAAS,EAAEF,EAAS,EAAK,EAAO,CAACG,EAAWC,CAAa,EAAEJ,EAAS,IAAI,EACtTK,EAAU,IAAI,CAACN,EAAgBL,CAAI,CAAE,EAAE,CAACA,CAAI,CAAC,EAAE,IAAMY,EAAM,MAAM,KAAK,CAAC,OAAOT,EAAY,IAAI,EAAE,CAACU,EAAEC,IAAIX,EAAYW,CAAC,EAAQC,EAAQ,CAAC,EAAEH,EAAM,QAAQZ,GAAM,CAAC,IAAMgB,EAAO,KAAK,MAAMhB,EAAK,EAAE,EAAE,GAAOe,EAAQC,CAAM,IAAED,EAAQC,CAAM,EAAE,CAAC,GAAED,EAAQC,CAAM,EAAE,KAAKhB,CAAI,CAAE,CAAC,EAAE,IAAMiB,EAAiBjB,GAAM,CAACK,EAAgBL,CAAI,EAAEQ,EAAU,EAAK,EAAEE,EAAc,IAAI,EA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AAO,SAAS,EAAQC,EAAiB,CAAC,QAAQ,OAAO,WAAW,QAAQ,EAAQC,EAAc,CAAC,UAAU,OAAO,QAAQ,EAAE,OAAO,CAAC,EAAQC,EAAc,CAAC,QAAQ,WAAW,OAAO,SAAS",
  "names": ["YearDropdown", "props", "year", "onYearSelect", "fontFamily", "currentYear", "selectedYear", "setSelectedYear", "ye", "isOpen", "setIsOpen", "openDecade", "setOpenDecade", "ue", "years", "_", "i", "decades", "decade", "handleYearChange", "toggleDecade", "Arrow", "p", "containerStyle", "u", "dropdownStyle", "buttonStyle", "yearStyle", "arrowStyle", "listStyle", "yearsInDecade", "decadeStyle", "decadeLabelStyle", "decadeArrowStyle", "yearListStyle", "listItemStyle", "addPropertyControls", "ControlType"]
}
