{"version":3,"file":"ButtonGreyToColor.Bi04d7Bu.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/BEixa4hRv7l48M3hRkw0/fawD6xr1LTA2rsxCTMYW/ButtonGreyToColor.js"],"sourcesContent":["// ButtonGreytoColor.tsx — Framer Code Component\n// A button that starts grey and fills with the accent color on hover.\n// CSS var() rendering for flash-free theme switching\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// ============================================================\n// THEME SYSTEM — cookie-first, sets CSS vars on mount\n// ============================================================\nconst THEME_TOKENS={yellow:{\"--accent\":\"#D2FF03\",\"--accent-hover-600\":\"#BFE900\",\"--text-on-accent\":\"#10100F\",\"--text-on-accent-inverse\":\"#FEFEFE\",\"--accent-on-dark\":\"#D2FF03\",\"--accent-hover-on-dark\":\"#BFE900\",\"--accent-400\":\"#DDFF3F\",\"--accent-700\":\"#9CBE00\"},blue:{\"--accent\":\"#0038FF\",\"--accent-hover-600\":\"#131DD6\",\"--text-on-accent\":\"#FEFEFE\",\"--text-on-accent-inverse\":\"#10100F\",\"--accent-on-dark\":\"#FEFEFE\",\"--accent-hover-on-dark\":\"#DCE0E2\",\"--accent-400\":\"#4F57F0\",\"--accent-700\":\"#0E16A4\"},orange:{\"--accent\":\"#FF6B00\",\"--accent-hover-600\":\"#E74702\",\"--text-on-accent\":\"#10100F\",\"--text-on-accent-inverse\":\"#FEFEFE\",\"--accent-on-dark\":\"#FF6B00\",\"--accent-hover-on-dark\":\"#E74702\",\"--accent-400\":\"#FD7941\",\"--accent-700\":\"#BC3A02\"}};const STORAGE_KEY=\"mc2-theme\";function getCookie(name){try{const match=document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`));return match?match[1]:null;}catch(e){}return null;}function getStoredTheme(){try{const match=window.location.hash.match(/mc2=(\\w+)/);if(match&&match[1]&&THEME_TOKENS[match[1]])return match[1];}catch(e){}const fromCookie=getCookie(STORAGE_KEY);if(fromCookie&&THEME_TOKENS[fromCookie])return fromCookie;try{const stored=localStorage.getItem(STORAGE_KEY);if(stored&&THEME_TOKENS[stored])return stored;}catch(e){}return\"yellow\";}function applyCSSVars(themeName){const tokens=THEME_TOKENS[themeName];if(!tokens)return;const root=document.documentElement;for(const[key,value]of Object.entries(tokens)){root.style.setProperty(key,value);}}function useThemeWithCSSVars(){const[theme,setTheme]=useState(()=>typeof window!==\"undefined\"?getStoredTheme():\"yellow\");useEffect(()=>{applyCSSVars(theme);},[]);useEffect(()=>{const stored=getStoredTheme();setTheme(stored);applyCSSVars(stored);const onChange=e=>{const name=e.detail;if(name&&THEME_TOKENS[name]){setTheme(name);applyCSSVars(name);}};const onStorage=e=>{if(e.key===STORAGE_KEY&&e.newValue&&THEME_TOKENS[e.newValue]){setTheme(e.newValue);applyCSSVars(e.newValue);}};window.addEventListener(\"themechange\",onChange);window.addEventListener(\"storage\",onStorage);return()=>{window.removeEventListener(\"themechange\",onChange);window.removeEventListener(\"storage\",onStorage);};},[]);return theme;}export default function ButtonGreytoColor({text=\"Button\",link=\"/\",fontSize=18,paddingX=20,paddingY=12,...props}){const[hovered,setHovered]=useState(false);useThemeWithCSSVars();return /*#__PURE__*/_jsx(\"a\",{href:link,style:{...props.style,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",padding:`${paddingY}px ${paddingX}px`,backgroundColor:hovered?\"var(--accent, #D2FF03)\":\"#DCE0E2\",fontFamily:\"Inter, sans-serif\",fontWeight:400,fontSize:fontSize,lineHeight:1.2,color:hovered?\"var(--text-on-accent, #10100F)\":\"#10100F\",textDecoration:\"none\",cursor:\"pointer\",transition:\"background-color 0.2s ease, color 0.2s ease\",width:\"auto\",whiteSpace:\"nowrap\"},onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),children:text});}addPropertyControls(ButtonGreytoColor,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Button\"},link:{type:ControlType.Link,title:\"Link\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:18,min:10,max:48,step:1},paddingX:{type:ControlType.Number,title:\"Padding Horizontal\",defaultValue:20,min:0,max:60,step:2},paddingY:{type:ControlType.Number,title:\"Padding Vertical\",defaultValue:12,min:0,max:40,step:2}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ButtonGreytoColor\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ButtonGreyToColor.map"],"mappings":"+LAMowB,SAAS,EAAU,EAAK,CAAC,GAAG,CAAC,IAAM,EAAM,SAAS,OAAO,MAAU,OAAO,WAAW,EAAK,UAAU,CAAC,CAAC,OAAO,EAAM,EAAM,GAAG,UAAc,EAAE,OAAO,KAAM,SAAS,GAAgB,CAAC,GAAG,CAAC,IAAM,EAAM,EAAO,SAAS,KAAK,MAAM,YAAY,CAAC,GAAG,GAAO,EAAM,IAAI,EAAa,EAAM,IAAI,OAAO,EAAM,QAAY,EAAE,IAAM,EAAW,EAAU,EAAY,CAAC,GAAG,GAAY,EAAa,GAAY,OAAO,EAAW,GAAG,CAAC,IAAM,EAAO,aAAa,QAAQ,EAAY,CAAC,GAAG,GAAQ,EAAa,GAAQ,OAAO,OAAgB,EAAE,MAAM,SAAU,SAAS,EAAa,EAAU,CAAC,IAAM,EAAO,EAAa,GAAW,GAAG,CAAC,EAAO,OAAO,IAAM,EAAK,SAAS,gBAAgB,IAAI,GAAK,CAAC,EAAI,KAAS,OAAO,QAAQ,EAAO,CAAE,EAAK,MAAM,YAAY,EAAI,EAAM,CAAG,SAAS,GAAqB,CAAC,GAAK,CAAC,EAAM,GAAUA,MAAoB,IAAS,OAA6B,SAAjB,GAAgB,CAAU,CAA4jB,OAA3jB,MAAc,CAAC,EAAa,EAAM,EAAG,EAAE,CAAC,CAAC,MAAc,CAAC,IAAM,EAAO,GAAgB,CAAC,EAAS,EAAO,CAAC,EAAa,EAAO,CAAC,IA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