a11oy / console /assets /AuditSection-DGSYPf54.js
betterwithage's picture
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
da2854c verified
Raw
History Blame
10.3 kB
import{o as e}from"./chunk-CMxvf4Kt.js";import{t}from"./react-DrNXigiH.js";import{C as n,a as r,l as i,u as a}from"./index-Caa1r77e.js";import{t as o}from"./proxy-DmcaF9M6.js";import{t as s}from"./AnimatePresence-CgAcpCeX.js";import{t as c}from"./Badge-Ctmr0f_9.js";var l=a(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),u=a(`circle-alert`,[[`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`}]]),d=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`}]]),f=a(`shield-alert`,[[`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`}]]),p=e(t(),1),m=[{id:`f-1`,surface:`TENAX - 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.`}],h=n();function g(){let[e,t]=(0,p.useState)({critical:!0,high:!0,medium:!1,low:!1}),[n,a]=(0,p.useState)({}),g=e=>{t(t=>({...t,[e]:!t[e]}))},_=e=>{a(t=>({...t,[e]:!t[e]}))},v=m.reduce((e,t)=>(e[t.severity]||(e[t.severity]=[]),e[t.severity].push(t),e),{}),y=[{id:`critical`,name:`Critical`,icon:f,color:`text-[var(--color-a11oy-critical)]`,bg:`bg-[var(--color-a11oy-critical)]/10`},{id:`high`,name:`High`,icon:r,color:`text-[var(--color-a11oy-warn)]`,bg:`bg-[var(--color-a11oy-warn)]/10`},{id:`medium`,name:`Medium`,icon:u,color:`text-[var(--color-a11oy-gold)]`,bg:`bg-[var(--color-a11oy-gold)]/10`},{id:`low`,name:`Low`,icon:d,color:`text-[var(--color-a11oy-blue)]`,bg:`bg-[var(--color-a11oy-blue)]/10`}];return(0,h.jsxs)(o.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`p-8 h-full flex flex-col`,children:[(0,h.jsxs)(`div`,{className:`mb-8 shrink-0 flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`text-2xl font-display font-medium text-[var(--color-a11oy-text)]`,children:`Audit Findings`}),(0,h.jsx)(`p`,{className:`text-[var(--color-a11oy-text-sub)] mt-1`,children:`Automated compliance, accessibility, and brand drift analysis.`})]}),(0,h.jsxs)(`div`,{className:`flex gap-4`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)]`,children:`Total Findings`}),(0,h.jsx)(`div`,{className:`text-2xl font-mono font-medium text-[var(--color-a11oy-text)]`,children:m.length})]}),(0,h.jsx)(`div`,{className:`w-px bg-[var(--color-a11oy-border)] h-10`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-[var(--color-a11oy-critical)]`,children:`Critical`}),(0,h.jsx)(`div`,{className:`text-2xl font-mono font-medium text-[var(--color-a11oy-critical)]`,children:v.critical?.length||0})]})]})]}),(0,h.jsx)(`div`,{className:`flex-1 overflow-y-auto space-y-6 pr-4`,children:y.map(t=>{let r=v[t.id]||[];return r.length===0?null:(0,h.jsxs)(`div`,{className:`bg-[var(--color-a11oy-card)] border border-[var(--color-a11oy-border)] rounded-lg overflow-hidden`,children:[(0,h.jsxs)(`button`,{onClick:()=>g(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:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(t.icon,{className:`w-5 h-5 ${t.color}`}),(0,h.jsxs)(`h2`,{className:`font-medium uppercase tracking-widest text-sm ${t.color}`,children:[t.name,` Priority`]}),(0,h.jsx)(c,{variant:`outline`,className:`ml-2 font-mono bg-[var(--color-a11oy-surface)]`,children:r.length})]}),e[t.id]?(0,h.jsx)(i,{className:`w-5 h-5 text-[var(--color-a11oy-text-sub)]`}):(0,h.jsx)(l,{className:`w-5 h-5 text-[var(--color-a11oy-text-sub)]`})]}),(0,h.jsx)(s,{children:e[t.id]&&(0,h.jsx)(o.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:r.map(e=>(0,h.jsxs)(`div`,{className:`p-4 hover:bg-[var(--color-a11oy-surface)]/50 transition-colors`,children:[(0,h.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex-1 cursor-pointer`,onClick:()=>_(e.id),children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,h.jsx)(c,{variant:`ghost`,size:`sm`,className:`bg-[var(--color-a11oy-surface)] font-mono border border-[var(--color-a11oy-border)]`,children:e.surface}),(0,h.jsx)(c,{variant:`outline`,size:`sm`,className:`uppercase tracking-wider text-[10px]`,children:e.category.replace(`-`,` `)})]}),(0,h.jsx)(`h3`,{className:`text-sm font-medium text-[var(--color-a11oy-text)] mb-1`,children:e.description}),e.element&&!n[e.id]&&(0,h.jsx)(`div`,{className:`text-xs font-mono text-[var(--color-a11oy-text-ghost)] truncate max-w-2xl`,children:e.element})]}),(0,h.jsx)(`button`,{onClick:()=>_(e.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:n[e.id]?`Hide Details`:`View Remediation`})]}),n[e.id]&&(0,h.jsxs)(o.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:[(0,h.jsxs)(`div`,{className:`space-y-4`,children:[e.element&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)] mb-1`,children:`Target Element`}),(0,h.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:e.element})]}),(e.currentValue||e.requiredValue)&&(0,h.jsxs)(`div`,{className:`flex gap-4`,children:[e.currentValue&&(0,h.jsxs)(`div`,{className:`flex-1`,children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)] mb-1`,children:`Observed`}),(0,h.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:e.currentValue})]}),e.requiredValue&&(0,h.jsxs)(`div`,{className:`flex-1`,children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-[var(--color-a11oy-text-ghost)] mb-1`,children:`Required`}),(0,h.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:e.requiredValue})]})]})]}),(0,h.jsxs)(`div`,{className:`bg-[var(--color-a11oy-surface)] border border-[var(--color-a11oy-border)] rounded p-4 flex flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,h.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-[var(--color-a11oy-blue)] font-medium`,children:`Scripted Remediation`}),(0,h.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`})]}),(0,h.jsx)(`p`,{className:`text-sm text-[var(--color-a11oy-text)] mt-2`,children:e.scriptedRecommendation}),(0,h.jsx)(`div`,{className:`mt-auto pt-4`,children:(0,h.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`})})]})]})]},e.id))})})]},t.id)})})]})}export{g as AuditSection};