{"version":3,"file":"FranklinButton.osePLfcQ.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/vpl46KEZt6bsq07e0PcV/a88S6YqN7wCXijaZMFhg/FranklinButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";const INK=\"#232323\";const GREEN=\"#D9E5BA\";// Hover fill for the green variant. The old hover was brightness(0.96) on\n// GREEN, which only dims — same hue, ~3 points of L*, and next to the dark\n// variant's brightness(1.35) it read as no response at all. This is an explicit\n// deeper accent instead: down in lightness and up in chroma, so it reads as the\n// button going a shade greener rather than dimmer. Contrast against the label\n// stays at ~10:1, well clear of the accent-green legibility problem from\n// 2026-08-19 (that rule is about green on *text*, not the fill).\nconst GREEN_HOVER=\"#C5D894\";const WHITE=\"#FFFFFF\";// Franklin radius scale: 8 = controls (buttons, inputs), 12 = surfaces\n// (cards, media), full = pills. Buttons are the only thing on 8.\nconst RADIUS=8;const EASE=\"cubic-bezier(0.65, 0, 0.35, 1)\";const DURATION=\"0.42s\";// Matches Framer's breakpoint ranges for this project, and the values already\n// used by CashbackCalculator.tsx.\nconst TABLET_MAX=1199;const PHONE_MAX=809;/**\n * Responsive size scale.\n *\n * The button used to be a fixed 16px / 12-24 at every width, so on a 390px\n * phone it sat at desktop size next to type that had already stepped down.\n * Sizing now lives in CSS custom properties set per breakpoint, which keeps it\n * out of React state — a matchMedia hook would render the desktop size on the\n * server and snap after hydration.\n *\n * Vertical padding deliberately stays at 12px on phone. Only the type and the\n * horizontal padding come down, so the button lands at ~41px tall and stays a\n * comfortable touch target instead of dropping under 40.\n *\n *   desktop  16 / 12-24 / arrow 16 / glyph 20.38  -> 43.3 tall\n *   tablet   15 / 12-20 / arrow 14 / glyph 19     -> 42.1 tall\n *   phone    14 / 12-18 / arrow 12 / glyph 18     -> 40.9 tall\n */const SIZE_CSS=`\n.fk-btn {\n    --fk-fs: 16px;\n    --fk-lh: 19.327px;\n    --fk-ls: -0.32px;\n    --fk-py: 12px;\n    --fk-px: 24px;\n    --fk-ax: 16px;\n    --fk-glyph: 20.3774px;\n    --fk-gap: 2px;\n}\n@media (max-width: ${TABLET_MAX}px) {\n    .fk-btn {\n        --fk-fs: 15px;\n        --fk-lh: 18.12px;\n        --fk-ls: -0.3px;\n        --fk-px: 20px;\n        --fk-ax: 14px;\n        --fk-glyph: 19px;\n    }\n}\n@media (max-width: ${PHONE_MAX}px) {\n    .fk-btn {\n        --fk-fs: 14px;\n        --fk-lh: 16.93px;\n        --fk-ls: -0.28px;\n        --fk-px: 18px;\n        --fk-ax: 12px;\n        --fk-glyph: 18px;\n    }\n}\n`;function ArrowGlyph({color,offset}){return /*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 20.3774 20.3774\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",transform:`translateX(${offset})`,transition:`transform ${DURATION} ${EASE}`},children:/*#__PURE__*/_jsx(\"path\",{d:\"M17.6436 10.6395L11.9125 16.3706C11.793 16.4901 11.631 16.5572 11.462 16.5572C11.293 16.5572 11.1309 16.4901 11.0114 16.3706C10.892 16.2511 10.8248 16.0891 10.8248 15.9201C10.8248 15.7511 10.892 15.589 11.0114 15.4695L15.656 10.8257H3.18367C3.01478 10.8257 2.85281 10.7586 2.73339 10.6392C2.61397 10.5198 2.54688 10.3578 2.54688 10.1889C2.54688 10.0201 2.61397 9.85809 2.73339 9.73866C2.85281 9.61924 3.01478 9.55215 3.18367 9.55215H15.656L11.0114 4.90834C10.892 4.78886 10.8248 4.62679 10.8248 4.45781C10.8248 4.28883 10.892 4.12677 11.0114 4.00728C11.1309 3.88779 11.293 3.82067 11.462 3.82067C11.631 3.82067 11.793 3.88779 11.9125 4.00728L17.6436 9.73841C17.7028 9.79755 17.7498 9.86779 17.7819 9.94509C17.8139 10.0224 17.8304 10.1053 17.8304 10.1889C17.8304 10.2726 17.8139 10.3555 17.7819 10.4328C17.7498 10.5101 17.7028 10.5803 17.6436 10.6395Z\",fill:color})});}/**\n * Franklin primary button.\n * Dark variant renders a separate arrow box whose arrow swaps on hover:\n * the resting arrow slides out right while a second arrow slides in from left,\n * clipped by the box so it reads as a masked swap.\n *\n * Hover also lifts the whole button 1px and changes the fill, so the pointer\n * gets feedback on the green variant too (which has no arrow box to animate).\n * The two variants get there differently on purpose: dark lightens with a\n * brightness filter, green swaps to a hand-picked deeper accent (GREEN_HOVER),\n * because a brightness multiplier can only dim the accent and never shifts its\n * chroma — which is what actually makes the state legible.\n *\n * Size steps down at the tablet and phone breakpoints — see SIZE_CSS above.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 180\n * @framerIntrinsicHeight 44\n */export default function FranklinButton(props){const{label,variant,showArrow,link,newTab,style}=props;const[hover,setHover]=useState(false);const isDark=variant===\"dark\";const background=isDark?INK:hover?GREEN_HOVER:GREEN;const foreground=isDark?WHITE:INK;const labelStyle={fontFamily:'\"Geist\", sans-serif',fontWeight:500,fontSize:\"var(--fk-fs)\",lineHeight:\"var(--fk-lh)\",letterSpacing:\"var(--fk-ls)\",color:foreground,whiteSpace:\"nowrap\"};const boxBase={background,borderRadius:RADIUS,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:`filter ${DURATION} ${EASE}, background-color ${DURATION} ${EASE}`,filter:hover&&isDark?\"brightness(1.35)\":\"brightness(1)\"};const content=/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:SIZE_CSS}),/*#__PURE__*/_jsx(\"div\",{style:{...boxBase,padding:\"var(--fk-py) var(--fk-px)\"},children:/*#__PURE__*/_jsx(\"span\",{style:labelStyle,children:label})}),showArrow&&/*#__PURE__*/_jsx(\"div\",{style:{...boxBase,padding:\"var(--fk-py) var(--fk-ax)\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"var(--fk-glyph)\",height:\"var(--fk-glyph)\",flex:\"none\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(ArrowGlyph,{color:foreground,offset:hover?\"160%\":\"0%\"}),/*#__PURE__*/_jsx(ArrowGlyph,{color:foreground,offset:hover?\"0%\":\"-160%\"})]})})]});const rootStyle={...style,display:\"flex\",alignItems:\"center\",gap:\"var(--fk-gap)\",width:\"fit-content\",height:\"fit-content\",// Never let a long label push the page wider than the viewport.\nmaxWidth:\"100%\",textDecoration:\"none\",cursor:\"pointer\",transform:hover?\"translateY(-1px)\":\"translateY(0)\",transition:`transform ${DURATION} ${EASE}`};const handlers={onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false)};if(link){return /*#__PURE__*/_jsx(\"a\",{className:\"fk-btn\",href:link,target:newTab?\"_blank\":undefined,rel:newTab?\"noopener noreferrer\":undefined,style:rootStyle,...handlers,children:content});}return /*#__PURE__*/_jsx(\"div\",{className:\"fk-btn\",style:rootStyle,...handlers,children:content});}FranklinButton.defaultProps={label:\"Get started\",variant:\"dark\",showArrow:true,newTab:false};addPropertyControls(FranklinButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Get started\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"dark\",\"green\"],optionTitles:[\"Dark\",\"Green\"],defaultValue:\"dark\",displaySegmentedControl:true},showArrow:{type:ControlType.Boolean,title:\"Arrow box\",defaultValue:true},link:{type:ControlType.Link,title:\"Link\"},newTab:{type:ControlType.Boolean,title:\"New tab\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FranklinButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"44\",\"framerIntrinsicWidth\":\"180\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FranklinButton.map"],"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