{"version":3,"file":"HFRoadCard.FfOJ0MWX.mjs","names":["useState","_Fragment","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","l","p","c","init_jsx_runtime","ce","init_framer_DKWANagr","ControlType","addPropertyControls","HFRoadCard","props","base","votes","key","itemId","title","mine","setMine","anim","setAnim","all","toggle","next","n","count","q1","s","d","family","display","mono","flood","ink","paper","muted","area","summary","showVote","voteLabel","init_HFRoadCard"],"sources":["https:/framerusercontent.com/modules/2WKWzvYB6fGWnlECiXmJ/fem4FXD46nbyRINwBuHG/HFRoadCard.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Hotfix: a roadmap item with an upvote button. Votes are saved in THIS browser only (localStorage key hotfix:votes),\n// so a vote is a personal bookmark, not a shared count. The count shown is the CMS Votes number plus your own vote.\n// SSR safe: the saved vote is read after mount. A vote can be taken back with a second click.\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 360\n * @framerIntrinsicHeight 200\n */export default function HFRoadCard(props){const{itemId,title,summary,area,votes,showVote,voteLabel,family,display,mono,flood,ink,paper,muted}=props;const base=Math.max(0,Math.round(Number(votes)||0));const key=String(itemId||title||\"item\");const[mine,setMine]=useState(false);const[anim,setAnim]=useState(0);useEffect(()=>{try{const all=JSON.parse(window.localStorage.getItem(\"hotfix:votes\")||\"{}\");setMine(!!all[key]);}catch(e){}},[key]);const toggle=()=>{const next=!mine;setMine(next);setAnim(n=>n+1);try{const all=JSON.parse(window.localStorage.getItem(\"hotfix:votes\")||\"{}\");if(next)all[key]=1;else delete all[key];window.localStorage.setItem(\"hotfix:votes\",JSON.stringify(all));}catch(e){}};const count=base+(mine?1:0);const q1=(s,d)=>`\"${String(s||d).replace(/\"/g,\"\")}\"`;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`.hfc{box-sizing:border-box;display:flex;flex-direction:column;gap:10px;width:100%;padding:20px 20px 18px;background:var(--hcp);color:var(--hci);font-family:var(--hcb)}.hfc-a{align-self:flex-start;font-family:var(--hcm);font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.hfc-t{margin:0;font-family:var(--hcd);font-weight:900;font-size:30px;line-height:.98;text-transform:uppercase}.hfc-s{margin:0;font-size:15px;line-height:22px;font-weight:500;color:var(--hcg)}.hfc-f{display:flex;align-items:center;gap:12px;margin-top:6px}.hfc-v{position:relative;box-sizing:border-box;display:inline-flex;align-items:center;gap:10px;height:46px;min-width:46px;padding:0 16px 0 14px;border:0;background:var(--hci);color:var(--hcp);font-family:var(--hcm);font-size:15px;font-weight:700;cursor:pointer;transition:background-color .12s,color .12s,transform .12s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.hfc-v:hover{background:var(--hcf);color:var(--hci)}.hfc-v:active{background:var(--hcf);color:var(--hci);transform:translateY(2px)}.hfc-v[aria-pressed=true]{background:var(--hcf);color:var(--hci);box-shadow:inset 0 0 0 3px var(--hci)}.hfc-v:focus{outline:none}.hfc-v:focus-visible{outline:3px solid var(--hci);outline-offset:3px;box-shadow:0 0 0 3px var(--hcp)}.hfc-v[aria-pressed=true]:focus-visible{box-shadow:inset 0 0 0 3px var(--hci),0 0 0 3px var(--hcp)}.hfc-ar{display:inline-flex;width:16px;height:16px}.hfc-pop .hfc-ar{animation:hfcUp .45s cubic-bezier(.2,.9,.3,1.4)}.hfc-pop .hfc-n{animation:hfcNum .35s cubic-bezier(.2,.9,.3,1)}.hfc-n{display:inline-block;min-width:1.8ch;text-align:left;font-variant-numeric:tabular-nums}.hfc-h{font-family:var(--hcm);font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}@keyframes hfcUp{0%{transform:translateY(0)}30%{transform:translateY(-7px) scale(1.25)}60%{transform:translateY(1px)}100%{transform:translateY(0)}}@keyframes hfcNum{0%{transform:translateY(60%);opacity:0}100%{transform:translateY(0);opacity:1}}@media (prefers-reduced-motion:reduce){.hfc-pop .hfc-ar,.hfc-pop .hfc-n{animation:none}.hfc-v{transition:none}}`}),/*#__PURE__*/_jsxs(\"div\",{className:\"hfc\",style:{[\"--hcb\"]:`${q1(family,\"Schibsted Grotesk\")}, system-ui, sans-serif`,[\"--hcd\"]:`${q1(display,\"Sofia Sans Extra Condensed\")}, Impact, sans-serif`,[\"--hcm\"]:`${q1(mono,\"JetBrains Mono\")}, ui-monospace, monospace`,[\"--hcf\"]:flood,[\"--hci\"]:ink,[\"--hcp\"]:paper,[\"--hcg\"]:muted},children:[area?/*#__PURE__*/_jsxs(\"span\",{className:\"hfc-a\",children:[\"[\",area,\"]\"]}):null,/*#__PURE__*/_jsx(\"h3\",{className:\"hfc-t\",children:title}),summary?/*#__PURE__*/_jsx(\"p\",{className:\"hfc-s\",children:summary}):null,showVote?/*#__PURE__*/_jsxs(\"div\",{className:\"hfc-f\",children:[/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:`hfc-v${anim?\" hfc-pop\":\"\"}`,\"aria-pressed\":mine,\"aria-label\":`${voteLabel}: ${title}. ${count} ${count===1?\"vote\":\"votes\"}${mine?\", you voted\":\"\"}`,onClick:toggle,children:[/*#__PURE__*/_jsx(\"svg\",{className:\"hfc-ar\",viewBox:\"0 0 16 16\",fill:\"none\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 14V3M2.5 8.5 8 3l5.5 5.5\",stroke:\"currentColor\",strokeWidth:\"2.4\",strokeLinecap:\"square\"})}),/*#__PURE__*/_jsx(\"span\",{className:\"hfc-n\",children:count})]},anim),/*#__PURE__*/_jsx(\"span\",{className:\"hfc-h\",children:mine?\"voted on this device\":voteLabel})]}):null]})]});}HFRoadCard.displayName=\"Hotfix Roadmap Item\";HFRoadCard.defaultProps={itemId:\"\",title:\"Saved views for run history\",summary:\"\",area:\"Dashboards\",votes:\"128\",showVote:true,voteLabel:\"Upvote\",family:\"Schibsted Grotesk\",display:\"Sofia Sans Extra Condensed\",mono:\"JetBrains Mono\",flood:\"#FF5A1F\",ink:\"#0E0E0E\",paper:\"#F2F0EB\",muted:\"#4A4943\"};addPropertyControls(HFRoadCard,{itemId:{type:ControlType.String,title:\"Item ID\",defaultValue:\"\",description:\"Bind to the CMS slug. Used as the vote key.\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Saved views for run history\"},summary:{type:ControlType.String,title:\"Summary\",defaultValue:\"Pin a filter and share it with the team.\"},area:{type:ControlType.String,title:\"Area\",defaultValue:\"Dashboards\"},votes:{type:ControlType.String,title:\"Base Votes\",defaultValue:\"128\"},showVote:{type:ControlType.Boolean,title:\"Vote Button\",defaultValue:true},voteLabel:{type:ControlType.String,title:\"Vote Label\",defaultValue:\"Upvote\"},family:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Schibsted Grotesk\"},display:{type:ControlType.String,title:\"Display Family\",defaultValue:\"Sofia Sans Extra Condensed\"},mono:{type:ControlType.String,title:\"Mono Family\",defaultValue:\"JetBrains Mono\"},flood:{type:ControlType.Color,title:\"Voted Colour\",defaultValue:\"#FF5A1F\"},ink:{type:ControlType.Color,title:\"Ink\",defaultValue:\"#0E0E0E\"},paper:{type:ControlType.Color,title:\"Paper\",defaultValue:\"#F2F0EB\"},muted:{type:ControlType.Color,title:\"Muted Text\",defaultValue:\"#4A4943\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HFRoadCard\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"360\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HFRoadCard.map"],"mappings":"A,6MAQG,SAAwBe,EAAW,EAAM,CAAC,GAAK,CAAC,SAAO,QAAM,UAAQ,OAAK,QAAM,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