Spaces:
Running
Running
| import{i as a,r as x,k as e,C as b}from"./index-BVfpSx5Q.js";import{B as i}from"./Badge-Bu-Xtkc9.js";import{m as c}from"./proxy-Dwi19u3x.js";import{A as g}from"./index-CskJyMLH.js";/** | |
| * @license lucide-react v0.460.0 - ISC | |
| * | |
| * This source code is licensed under the ISC license. | |
| * See the LICENSE file in the root directory of this source tree. | |
| */const f=a("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** | |
| * @license lucide-react v0.460.0 - ISC | |
| * | |
| * This source code is licensed under the ISC license. | |
| * See the LICENSE file in the root directory of this source tree. | |
| */const j=a("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** | |
| * @license lucide-react v0.460.0 - ISC | |
| * | |
| * This source code is licensed under the ISC license. | |
| * See the LICENSE file in the root directory of this source tree. | |
| */const N=a("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** | |
| * @license lucide-react v0.460.0 - ISC | |
| * | |
| * This source code is licensed under the ISC license. | |
| * See the LICENSE file in the root directory of this source tree. | |
| */const w=a("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** | |
| * @license lucide-react v0.460.0 - ISC | |
| * | |
| * This source code is licensed under the ISC license. | |
| * See the LICENSE file in the root directory of this source tree. | |
| */const k=a("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),u=[{id:"f-1",surface:"Sentra - Dashboard",category:"contrast",severity:"critical",description:"Insufficient contrast ratio for incident severity text.",element:'<span class="text-gray-400">Low</span>',currentValue:"3.2:1",requiredValue:"4.5:1",scriptedRecommendation:"Update the text color to --color-a11oy-text-sub (#5e5e5e) to meet WCAG AA requirements."},{id:"f-2",surface:"Counsel - Matter View",category:"banned-term",severity:"high",description:"Deprecated terminology detected in matter summary.",element:'"...utilize the business telemetry platform..."',currentValue:"business telemetry platform",requiredValue:"execution fabric",scriptedRecommendation:'Replace "business telemetry platform" with "execution fabric" and "utilize" with "use".'},{id:"f-3",surface:"Pulse - Executive Brief",category:"hit-target",severity:"medium",description:"Action button touch target is too small for mobile viewport.",element:'<button class="h-6 w-6">',currentValue:"24x24px",requiredValue:"44x44px",scriptedRecommendation:"Increase the padding on the icon button to ensure a minimum 44x44px touch target."},{id:"f-4",surface:"Terra - Property Detail",category:"off-token",severity:"low",description:"Hardcoded hex value used instead of design token for border.",element:"border: 1px solid #1e2a3d",currentValue:"#1e2a3d",requiredValue:"var(--color-a11oy-border)",scriptedRecommendation:"Replace the hardcoded hex with the --color-a11oy-border CSS variable to ensure theme consistency."},{id:"f-5",surface:"Aegis - Threat Map",category:"contrast",severity:"high",description:"Map overlays lack sufficient contrast against dark water tiles.",element:".overlay-polygon",currentValue:"1.8:1",requiredValue:"3.0:1 (UI Components)",scriptedRecommendation:"Add a semi-transparent dark backing to the overlays or increase the opacity of the stroke color."},{id:"f-6",surface:"Command - Overview",category:"banned-term",severity:"medium",description:"Casual phrasing used in system error state.",element:'"Oops! Something went wrong."',currentValue:"Oops!",requiredValue:"N/A",scriptedRecommendation:'Use professional, direct phrasing: "System error encountered. Refreshing state."'},{id:"f-7",surface:"Vessels - Route Panel",category:"off-token",severity:"medium",description:"Legacy spacing utility class used instead of current token.",element:"gap-4 (remnant from Tailwind default)",currentValue:"1rem",requiredValue:"var(--space-md)",scriptedRecommendation:"Update the grid gap to use the governed --space-md token for consistent rhythm."}];function q(){var m;const[l,h]=x.useState({critical:!0,high:!0,medium:!1,low:!1}),[s,p]=x.useState({}),y=t=>{h(o=>({...o,[t]:!o[t]}))},n=t=>{p(o=>({...o,[t]:!o[t]}))},d=u.reduce((t,o)=>(t[o.severity]||(t[o.severity]=[]),t[o.severity].push(o),t),{}),v=[{id:"critical",name:"Critical",icon:w,color:"text-[var(--color-a11oy-critical)]",bg:"bg-[var(--color-a11oy-critical)]/10"},{id:"high",name:"High",icon:k,color:"text-[var(--color-a11oy-warn)]",bg:"bg-[var(--color-a11oy-warn)]/10"},{id:"medium",name:"Medium",icon:j,color:"text-[var(--color-a11oy-gold)]",bg:"bg-[var(--color-a11oy-gold)]/10"},{id:"low",name:"Low",icon:N,color:"text-[var(--color-a11oy-blue)]",bg:"bg-[var(--color-a11oy-blue)]/10"}];return e.jsxs(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"p-8 h-full flex flex-col",children:[e.jsxs("div",{className:"mb-8 shrink-0 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-display font-medium text-[var(--color-a11oy-text)]",children:"Audit Findings"}),e.jsx("p",{className:"text-[var(--color-a11oy-text-sub)] mt-1",children:"Automated compliance, accessibility, and brand drift analysis."})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)]",children:"Total Findings"}),e.jsx("div",{className:"text-2xl font-mono font-medium text-[var(--color-a11oy-text)]",children:u.length})]}),e.jsx("div",{className:"w-px bg-[var(--color-a11oy-border)] h-10"}),e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--color-a11oy-critical)]",children:"Critical"}),e.jsx("div",{className:"text-2xl font-mono font-medium text-[var(--color-a11oy-critical)]",children:((m=d.critical)==null?void 0:m.length)||0})]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto space-y-6 pr-4",children:v.map(t=>{const o=d[t.id]||[];return o.length===0?null:e.jsxs("div",{className:"bg-[var(--color-a11oy-card)] border border-[var(--color-a11oy-border)] rounded-lg overflow-hidden",children:[e.jsxs("button",{onClick:()=>y(t.id),className:`w-full flex items-center justify-between p-4 ${t.bg} border-b border-[var(--color-a11oy-border)] hover:brightness-110 transition-all`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(t.icon,{className:`w-5 h-5 ${t.color}`}),e.jsxs("h2",{className:`font-medium uppercase tracking-widest text-sm ${t.color}`,children:[t.name," Priority"]}),e.jsx(i,{variant:"outline",className:"ml-2 font-mono bg-[var(--color-a11oy-surface)]",children:o.length})]}),l[t.id]?e.jsx(b,{className:"w-5 h-5 text-[var(--color-a11oy-text-sub)]"}):e.jsx(f,{className:"w-5 h-5 text-[var(--color-a11oy-text-sub)]"})]}),e.jsx(g,{children:l[t.id]&&e.jsx(c.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"divide-y divide-[var(--color-a11oy-border)]",children:o.map(r=>e.jsxs("div",{className:"p-4 hover:bg-[var(--color-a11oy-surface)]/50 transition-colors",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1 cursor-pointer",onClick:()=>n(r.id),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(i,{variant:"ghost",size:"sm",className:"bg-[var(--color-a11oy-surface)] font-mono border border-[var(--color-a11oy-border)]",children:r.surface}),e.jsx(i,{variant:"outline",size:"sm",className:"uppercase tracking-wider text-[10px]",children:r.category.replace("-"," ")})]}),e.jsx("h3",{className:"text-sm font-medium text-[var(--color-a11oy-text)] mb-1",children:r.description}),r.element&&!s[r.id]&&e.jsx("div",{className:"text-xs font-mono text-[var(--color-a11oy-text-ghost)] truncate max-w-2xl",children:r.element})]}),e.jsx("button",{onClick:()=>n(r.id),className:"text-xs text-[var(--color-a11oy-blue)] hover:text-[var(--color-a11oy-text)] flex items-center gap-1 font-medium px-3 py-1.5 rounded-md hover:bg-[var(--color-a11oy-surface)] transition-colors",children:s[r.id]?"Hide Details":"View Remediation"})]}),s[r.id]&&e.jsxs(c.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-4 border-t border-[var(--color-a11oy-border)] pt-4",children:[e.jsxs("div",{className:"space-y-4",children:[r.element&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)] mb-1",children:"Target Element"}),e.jsx("div",{className:"bg-[var(--color-a11oy-navy)] border border-[var(--color-a11oy-border)] p-2 rounded text-xs font-mono text-[var(--color-a11oy-text-sub)] overflow-x-auto",children:r.element})]}),(r.currentValue||r.requiredValue)&&e.jsxs("div",{className:"flex gap-4",children:[r.currentValue&&e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)] mb-1",children:"Observed"}),e.jsx("div",{className:"font-mono text-sm text-[var(--color-a11oy-critical)] bg-[var(--color-a11oy-critical)]/10 px-2 py-1 rounded inline-block",children:r.currentValue})]}),r.requiredValue&&e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)] mb-1",children:"Required"}),e.jsx("div",{className:"font-mono text-sm text-[var(--color-a11oy-ok)] bg-[var(--color-a11oy-ok)]/10 px-2 py-1 rounded inline-block",children:r.requiredValue})]})]})]}),e.jsxs("div",{className:"bg-[var(--color-a11oy-surface)] border border-[var(--color-a11oy-border)] rounded p-4 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--color-a11oy-blue)] font-medium",children:"Scripted Remediation"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-mono",style:{backgroundColor:"rgba(201,183,135,0.1)",color:"#c9b787"},children:"Governed"})]}),e.jsx("p",{className:"text-sm text-[var(--color-a11oy-text)] mt-2",children:r.scriptedRecommendation}),e.jsx("div",{className:"mt-auto pt-4",children:e.jsx("button",{className:"w-full py-2 bg-[var(--color-a11oy-blue)]/10 hover:bg-[var(--color-a11oy-blue)]/20 text-[var(--color-a11oy-blue)] text-xs font-medium rounded transition-colors border border-[var(--color-a11oy-blue)]/30",children:"Generate PR to fix"})})]})]})]},r.id))})})]},t.id)})})]})}export{q as AuditSection}; | |